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 long add(News news) throws Exception { openCurrentSessionWithTransaction(); getCurrentSession().save(news); closeCurrentSessionWithTransaction(); return news.getIdNews(); }
{ "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
TODO Autogenerated method stub
@Override public boolean modify(News news) { try { openCurrentSessionWithTransaction(); getCurrentSession().update(news); closeCurrentSessionWithTransaction(); return true; } catch(Exception e) { e.printStackTrace(); return false; } }
{ "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
TODO Autogenerated method stub
@Override public boolean delete(News news) { try { openCurrentSessionWithTransaction(); getCurrentSession().delete(news); closeCurrentSessionWithTransaction(); return true; } catch(Exception e) { e.printStackTrace(); return false; } }
{ "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
TODO Autogenerated method stub
@Override public List<News> getList() { openCurrentSession(); @SuppressWarnings("unchecked") List<News> list = (List<News>)getCurrentSession().createQuery("FROM News").list(); closeCurrentSession(); return list; }
{ "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
ExStart:AccessSmartArt The path to the documents directory.
public static void main(String[] args) { String dataDir = RunExamples.getDataDir_SmartArts(); // Load the desired the presentation Presentation pres = new Presentation(dataDir + "AccessSmartArt.pptx"); try { // Traverse through every shape inside first slide for (IShape shape : pres.getSlides().get_Item(0).getShapes()) { // Check if shape is of SmartArt type if (shape instanceof ISmartArt) { // Typecast shape to SmartArt ISmartArt smart = (ISmartArt) shape; // Traverse through all nodes inside SmartArt for (int i = 0; i < smart.getAllNodes().size(); i++) { // Accessing SmartArt node at index i ISmartArtNode node = (ISmartArtNode) smart.getAllNodes().get_Item(i); // Printing the SmartArt node parameters String outString = String.format("i = {0},.Text{1}, Level = {2}, Position = {3}", i, node.getTextFrame().getText(), node.getLevel(), node.getPosition()); System.out.println(outString); } } } } finally { if (pres != null) pres.dispose(); } //ExEnd:AccessSmartArt }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getDicDir() {\n\t\tString wDir = null;\n\n\t\tif (System.getProperties().containsKey(\"root\")) {\n\t\t\twDir = System.getProperty(\"root\");\n\t\t}\n\n\t\tif ((wDir == null || wDir.isEmpty()) && CPlatform.isMacOs())\n\t\t\twDir = new File(CPlatform.getUserHome(), \"Library/Spelling\")\n\t\t\t\t\t.getAbsolutePath();\n\n\t\tif (wDir == null || wDir.isEmpty())\n\t\t\twDir = \"/home/ff/projects/hunspell\";\n\t\treturn wDir;\n\t}", "public String getDocumentBase() {\n return getServerBase() + getContextPath() + \"/\";\n }", "public void startDocument()\r\n\t{\r\n\t marc_out.add(\"=LDR 00000nam\\\\\\\\22000007a\\\\4500\") ;\r\n\t marc_out.add(\"=001 etd_\" + pid);\r\n\t marc_out.add(\"=003 MiAaPQ\");\r\n\t marc_out.add(\"=006 m\\\\\\\\\\\\\\\\fo\\\\\\\\d\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");\r\n\t marc_out.add(\"=007 cr\\\\mnu\\\\\\\\\\\\aacaa\");\r\n\t marc_out.add(\"=040 \\\\\\\\$aMiAaPQ$beng$cDGW$dDGW\");\r\n\t marc_out.add(\"=049 \\\\\\\\$aDGWW\");\r\n\t marc_out.add(\"=504 \\\\\\\\$aIncludes bibliographical references.\");\r\n\t marc_out.add(\"=538 \\\\\\\\$aMode of access: Internet\");\r\n marc_out.add(\"=996 \\\\\\\\$aNew title added ; 20\" + running_date);\r\n marc_out.add(\"=998 \\\\\\\\$cgwjshieh ; UMI-ETDxml conv ; 20\" + running_date);\r\n\t marc_out.add(\"=852 8\\\\$bgwg ed$hGW: Electronic Dissertation\");\r\n\t marc_out.add(\"=856 40$uhttp://etd.gelman.gwu.edu/\" + pid + \".html$zClick here to access.\");\r\n\r\n }", "public File getStoreDir();", "@Override\n\tpublic void openDocument(String path, String name) {\n\t\t\n\t}", "Path getMainCatalogueFilePath();", "Path getModBookFilePath();", "public void startDocument ()\n\t\t{\n\t\t\t//System.out.println(\"Start document\");\n\t\t}", "public void startDocument ()\n {\n\tSystem.out.println(\"Start document\");\n }", "public String getDir();", "public void gettingDesktopPath() {\n FileSystemView filesys = FileSystemView.getFileSystemView();\n File[] roots = filesys.getRoots();\n homePath = filesys.getHomeDirectory().toString();\n System.out.println(homePath);\n //checking if file existing on that location\n pathTo = homePath + \"\\\\SpisakReversa.xlsx\";\n }", "private static void displaySoundDir(){\n System.out.println(SOUNDS_DIR);\n }", "public File getScratchDir();", "public L getDocumentLocation();", "public void setRootDir(String rootDir);", "@Property String getDocumentURI();", "public URL getDocumentBase() {\n/* 158 */ return this.stub.getDocumentBase();\n/* */ }", "public void setDocumentLocation(L documentLocation);", "public static String getHelpContentFilePath() {\n\t\tFile jarPath = SX3Manager.getInstance().getInstallLocation();\n\t\tString sx3helpContentPath = jarPath.getParentFile().getAbsolutePath() + \"/SX3_CONFIGURATION_HELP_CONTENT.json\";\n\t\treturn sx3helpContentPath;\n\t}", "public abstract String getFileLocation();", "String getDir();", "public void init( ){\n\t filepath = getServletContext().getContextPath();\r\n\tappPath = getServletContext().getRealPath(SAVE_DIR);\r\n\t \r\n\t }", "protected File getCurrentDocument() {\n\n return (File)stage.getProperties().get(GlobalConstants.CURRENT_DOCUMENT_PROPERTY_KEY);\n }", "private void jCBListFoodActionPerformed(java.awt.event.ActionEvent evt) {\n int aux2 = jCBListFood.getSelectedIndex();\n if (aux2 != -1) {\n filePath = \"C:\\\\PGS\\\\nutricion\\\\\" + jCBListFood.getSelectedItem();\n controller.openDocument(filePath);\n } else {\n filePath = \"\";\n }\n }", "public String getDocumentURI() {\n return this.documentURI;\n }", "private String getDesignPath() {\n Class<?> clazz = getClass();\n String designFilePath = null;\n if (clazz.getAnnotation(DeclarativeUI.class).absolutePath()) {\n designFilePath = \"\";\n } else {\n // This is rather nasty.. but it works well enough for now.\n String userDir = System.getProperty(\"user.dir\");\n designFilePath = userDir + \"/uitest/src/\"\n + clazz.getPackage().getName().replace('.', '/') + \"/\";\n }\n\n String designFileName = clazz.getAnnotation(DeclarativeUI.class)\n .value();\n\n return designFilePath + designFileName;\n }", "public File getSubtitleStorageDir() {\n File file = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS), \"Subtitle\");\n if (!file.mkdirs()) {\n Log.e(\"Subtitle\", \"Directory not created\");\n }\n return file;\n }", "String getFilepath();", "private String getAbsoluteFilesPath() {\n\n //sdcard/Android/data/cucumber.cukeulator\n //File directory = getTargetContext().getExternalFilesDir(null);\n //return new File(directory,\"reports\").getAbsolutePath();\n return null;\n }", "protected File getFlexHomeDirectory()\n\t{\n\t\tif (!m_initializedFlexHomeDirectory)\n\t\t{\n\t\t\tm_initializedFlexHomeDirectory = true;\n\t\t\tm_flexHomeDirectory = new File(\".\"); // default in case the following logic fails //$NON-NLS-1$\n\t\t\tString flexHome = System.getProperty(\"application.home\"); //$NON-NLS-1$\n\t\t\tif (flexHome != null && flexHome.length() > 0)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_flexHomeDirectory = new File(flexHome).getCanonicalFile();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e)\n\t\t\t\t{\n\t\t\t\t\t// ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn m_flexHomeDirectory;\n\t}", "@Override\n\tpublic java.lang.String getSrcPath() {\n\t\treturn _scienceApp.getSrcPath();\n\t}", "private String getHome()\n {\n return this.bufferHome.getAbsolutePath() + \"/\";\n }", "public File getInstHomeDir() {\n \treturn this.getHomeDir(\"octHome\");\n }", "FsPath baseDir();", "@Override\n\tpublic void startDocument() {\n\t\t\n\t}", "public String getWorkDirectory(){\n String wd = \"\";\n try {\n wd = new File(\"test.txt\").getCanonicalPath().replace(\"/test.txt\",\"\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n return wd;\n }", "public static String rootDir()\n {\n read_if_needed_();\n \n return _root;\n }", "String rootPath();", "public String getDefDir() {\n\n\t\t// String newDefDir = defDir.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\");\n\n\t\treturn defDir;\n\n\t}", "public static void view(Document doc) throws URISyntaxException, IOException {\n Desktop desktop = Desktop.getDesktop();\n URI uri = new URI(doc.getLocation());\n if (Desktop.isDesktopSupported()) {\n desktop = Desktop.getDesktop();\n }\n if (desktop != null) {\n desktop.browse(uri);\n }\n }", "void setAppRootDirectory(String rootDir);", "public FileObject getStarterObject() {\n return starterDir;\n }", "public static Path getWordsDir() {\n\t\treturn Paths.get(prefs.get(Constants.PREF_USERSAVE_DIR, null)).resolve(WORDS_DIR);\n\t}", "public String pathToSave() {\n String path;\n File folder;\n do {\n System.out.print(\"Introduce la ruta en la que quieres guardar el fichero(separando directorios por guiones: directorio1-directorio2-directorio3): \");\n path = Utils.getString();\n path = String.valueOf(System.getProperty(\"user.dir\")).substring(0, 2) + \"\\\\\" + path.replace('-', '\\\\');\n folder = new File(path);\n if (!folder.exists()) {\n System.out.println(\"El directorio introducido no existe intentalo de nuevo...\");\n } else {\n if (!folder.isDirectory()) {\n System.out.println(\"Eso no es un directorio intentalo de nuevo...\");\n }\n }\n } while (!folder.exists() && !folder.isDirectory());\n return path;\n }", "public void openDocument(L documentLocation) throws IOException;", "File getSaveLocation();", "public String getPathToDefinitionFiles() {\n\treturn msPathToDefinitionFiles;\n }", "public File start(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tfileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n\t\tint result = fileChooser.showOpenDialog(null);\n\t\tFile selectedFile = null;\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tselectedFile = fileChooser.getSelectedFile();\n\t\t}\n\t\treturn selectedFile;\n\t\t\n\t}", "public void openDiskFile(String musicFileName) throws IOException;", "abstract public String getSoundResourcesDir();", "public String getSavingLocation()\n {\n return Environment.getExternalStorageDirectory() + File.separator + getResources().getString(R.string.app_name);\n }", "public static String mount() {\n\n String mount = stringValue(\"treefs.mount\");\n if(isNullOrEmpty(mount)) {\n // default home location\n mount = home() + File.separator + \"treefs-data\";\n } else {\n mount = home() + File.separator + mount;\n }\n\n return mount;\n }", "@Override\r\n\tpublic String getRootDir() {\t\t\r\n\t\treturn Global.USERROOTDIR;\r\n\t}", "public void setupDrive(){\n // Place Dove/ into base of drive\n new File(drv.toString() + File.separator + folderName).mkdir();\n //upload preset content if required\n isSetup = true;\n }", "public File getHomeDir() {\n return physicalHomeDir;\n }", "String getDatabaseDirectoryPath();", "private void setWorkDiretory() {\n\t\tthis.workDiretory = System.getProperty(\"user.dir\");\n\t}", "public EmbeddedADS(File workDir) {\n initDirectoryService(workDir);\n }", "private String setFolderPath(int selection) {\n\t\tString directory = \"\";\n\t\tswitch (selection) {\n\t\tcase 1:\n\t\t\tdirectory = \"\\\\art\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdirectory = \"\\\\mikons_1\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdirectory = \"\\\\mikons_2\";\n\t\t\tbreak;\n\t\t}\n\t\treturn directory;\n\t}", "public String getShHarvestedDataDir() {\n\n\t\treturn shHarvestedDataDir;\n\n\t}", "public Path getDataDirectory();", "private static String systemInstallDir() {\n String systemInstallDir = System.getProperty(ESSEM_INSTALL_DIR_SYSPROP, \"\").trim();\n if(systemInstallDir.length() > 0 && !systemInstallDir.endsWith(\"/\")) {\n systemInstallDir = systemInstallDir + \"/\";\n }\n return systemInstallDir;\n }", "Path getBaseInputDir();", "Path getManageMeFilePath();", "public abstract String getFullPath();", "private String getFullPath()\n\t{\n\t\tif (libraryName.equals(\"\"))\n\t\t{\n\t\t\treturn fileName;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn libraryName + \"/\" + fileName;\n\t\t}\n\t}", "public DocumentController() {\n\t\tthis.content = this.getstartpage();\n\t\tthis.url = \"https://\";\n\t}", "public EmbeddedADS(String workDir) {\n this(new File(workDir));\n }", "private void printSketchFolder() {\n File sketchFolder = sketch.getFolder();\n System.out.println(\"++++++++++sketch folder: [\" + sketchFolder.getAbsolutePath() + \"]\");\n }", "private void tbsOpenFile(){\n String path = Environment.getExternalStorageDirectory().getPath() + \"/\" + \"android面试题及答案.docx\";\n File file=new File(path);\n if (file.exists()){\n\n\n Bundle bundle=new Bundle();\n bundle.putString(\"filePath\", file.getPath());\n bundle.putString(\"tempPath\", Environment.getExternalStorageDirectory().getPath());\n boolean result = mTbsReaderView.preOpen(\"doc\", false);//Word类型的是“doc” 、 PDF的类型是“pdf”\n\n mTbsReaderView.openFile(bundle);\n\n }else {\n Toast.makeText(this,\"文件不存在\",Toast.LENGTH_SHORT).show();\n }\n\n }", "private void setDefaultPath(){\n\t\tdownloadPath = System.getProperty(\"user.home\") + File.separator + \"Downloads\" + File.separator;\n\t\tif(!downloadPath.endsWith(File.separator)){\n\t\t\tdownloadPath += File.separator;\n\t\t}\n\t\tcurrentPath.setText(downloadPath);\n\t\tcurrentPath.setToolTipText(downloadPath);\n\t}", "public File getHome() {\r\n\t\treturn homeDir;\r\n\t}", "private static String getDirectoryPath() {\n // Replace the path here with your own\n File file = new File(Environment.getExternalStorageDirectory(),\n \"/GenericAndroidSoundboard/Audio/\");\n // Create the directory if it doesn't exist\n if (!file.exists()) {\n file.mkdirs();\n }\n\n // Get the path to the newly created directory\n return Environment.getExternalStorageDirectory()\n .getAbsolutePath() + \"/GenericAndroidSoundboard/Audio/\";\n }", "public static String sActivePath() \r\n\t{\r\n\t\tString activePath = null;\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\tactivePath = new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn activePath;\r\n\t}", "public String getPath () throws java.io.IOException, com.linar.jintegra.AutomationException;", "public String getDirectoryPath() {\n return EXTERNAL_PATH;\n }", "private void SetupStoryLocation() {\n\n //Delete previous project directories\n deleteDirectories();\n //ensure that newStoryReady is set to false\n newStoryReady = false;\n //Give story name a unique identifier\n String name = UUID.randomUUID().toString();\n //Set the value of the tag data to be the unique identifier of the story\n tag_data = name;\n //Create new story folder based on the name of the new story - this will be home to the new stories as well as any additional stories recorded\n story_directory = new File (getFilesDir() + File.separator + \"Stories\" + File.separator + name);\n //Create new tag folder based on the name of the new story - this will be home to the stories recorded which are saved to the tags.\n //Currently only a single audio file and picture are associated with one story folder.\n tag_directory = new File (getFilesDir() + File.separator + \"Tag\" + File.separator + name);\n //Create new cover image folder based on the name of the story - this stores the image representing the object.\n cover_directory = new File (getFilesDir() + File.separator + \"Covers\" + File.separator + name);\n //A temporary storage directory for files which are being sent and downloaded from the cloud.\n cloud_directory = new File (getFilesDir() + File.separator + \"Cloud\" + File.separator + name);\n //Make the described directory folders\n story_directory.mkdir();\n tag_directory.mkdir();\n cover_directory.mkdir();\n cloud_directory.mkdir();\n\n /* Example of saving stories to external directories\n\n// String newDirectory = LocalStoryFolder + \"/\" + name;\n// String newDirectory2 = TagFolder + \"/\" + name;\n// String newDirectory3 = CoverFolder + \"/\" + name;\n// story_directory = getExternalFilesDir(newDirectory);\n// tag_directory = getExternalFilesDir(newDirectory2);\n// cover_directory = getExternalFilesDir(newDirectory3);\n\n */\n }", "void setModBookFilePath(Path modBookFilePath);", "@Override\r\n\tprotected String getBasePath() {\n\t\treturn \"/module/tstaff/\";\r\n\t}", "File getWorkDir() {\n return workDir;\n }", "public String getPlayFile();", "private String db4oDBFullPath(Context ctx) {\t\n\t\treturn ctx.getDir(\"data\", 0) + \"/\" + LOCAL_SERVER;\n\t\n\t}", "abstract public String getDataResourcesDir();", "private void startDoc(Attributes attributes) {\n\n\t\t// Start storing the document in the content store\n\t\tstartCaptureContent();\n\n\t\t// Create a new Lucene document\n\t\tcurrentLuceneDoc = new Document();\n\t\tcurrentLuceneDoc.add(new Field(\"fromInputFile\", fileName, Store.YES, Index.NOT_ANALYZED,\n\t\t\t\tTermVector.NO));\n\n\t\t// Store attribute values from the <doc> tag as fields\n\t\tfor (int i = 0; i < attributes.getLength(); i++) {\n\t\t\tString attName = attributes.getLocalName(i);\n\t\t\tString value = attributes.getValue(i);\n\n\t\t\tcurrentLuceneDoc.add(new Field(attName, value, Store.YES, Index.ANALYZED_NO_NORMS,\n\t\t\t\t\tTermVector.WITH_POSITIONS_OFFSETS));\n\t\t}\n\n\t\t// Report indexing progress\n\t\treportDocumentStarted(attributes);\n\t}", "public static File getSdCardMediaMusicDirectory(){\n return getSdDirectoryStoragePath(\"/NWD-MEDIA\");\n }", "private void openDocument(DocumentInfo doc, Model model) {\n Intent intent = new QuickViewIntentBuilder(\n getPackageManager(), getResources(), doc, model).build();\n\n if (intent != null) {\n // TODO: un-work around issue b/24963914. Should be fixed soon.\n try {\n startActivity(intent);\n return;\n } catch (SecurityException e) {\n // Carry on to regular view mode.\n Log.e(TAG, \"Caught security error: \" + e.getLocalizedMessage());\n }\n }\n\n // Fall back to traditional VIEW action...\n intent = new Intent(Intent.ACTION_VIEW);\n intent.setDataAndType(doc.derivedUri, doc.mimeType);\n\n // Downloads has traditionally added the WRITE permission\n // in the TrampolineActivity. Since this behavior is long\n // established, we set the same permission for non-managed files\n // This ensures consistent behavior between the Downloads root\n // and other roots.\n int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION;\n if (doc.isWriteSupported()) {\n flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION;\n }\n intent.setFlags(flags);\n\n if (DEBUG && intent.getClipData() != null) {\n Log.d(TAG, \"Starting intent w/ clip data: \" + intent.getClipData());\n }\n\n try {\n startActivity(intent);\n } catch (ActivityNotFoundException e) {\n Snackbars.makeSnackbar(\n this, R.string.toast_no_application, Snackbar.LENGTH_SHORT).show();\n }\n }", "protected String getFileNamePath()\n {\n String sep = System.getProperty(\"file.separator\", \"/\");\n// String path = System.getProperty(\"user.dir\", \".\");\n\n String filename = getPath() + sep + \"sec.dat\";\n\n return filename;\n }", "public String getFileDirectory() {\n String storedDirectory = settings.get(\"fileDirectory\");\n \n // Default to the program files\n if (storedDirectory == null) {\n storedDirectory = System.getenv(\"ProgramFiles\");\n }\n \n return storedDirectory;\n }", "public static void setRootDir() {\n for(int i = 0; i < rootDir.length; i++){\n Character temp = (char) (65 + i);\n Search.rootDir[i] = temp.toString() + \":\\\\\\\\\";\n }\n }", "public static File fMibsTextDir() \r\n\t{\r\n\t\treturn new File(fMibsDir() + File.separator + \"txt\");\t\r\n\t}", "private String setFileDestinationPath(){\n String filePathEnvironment = Environment.getExternalStorageDirectory().getAbsolutePath();\n Log.d(TAG, \"Full path edited \" + filePathEnvironment + \"/earwormfix/\" + generatedFilename + EXTENSION_JPG);\n return filePathEnvironment+ \"/earwormfix/\" + generatedFilename + EXTENSION_JPG;\n }", "@Override\n public void command(String path) {\n StringBuilder html = new StringBuilder();\n html.append(\"<!doctype html>\\n\");\n html.append(\"<html lang='en'>\\n\");\n\n html.append(\"<head>\\n\");\n html.append(\"<meta charset='utf-8'>\\n\");\n html.append(\"<title>optional.Catalog</title>\\n\");\n html.append(\"</head>\\n\\n\");\n\n html.append(\"<body>\\n\");\n html.append(\"<h1>optional.Catalog</h1>\\n\");\n html.append(\"<p>Nume catalog:\" + c.getName() + \"</p>\\n\");\n html.append(\"<p>Path catalog:\" + c.getPath() + \"</p>\\n\");\n html.append(\"<p>Documents: </p>\\n\");\n html.append(\"<ul>\\n\");\n for (Document document : c.getDocuments()) {\n System.out.println(document);\n html.append(\"<li>\" + document + \"</li>\\n\");\n }\n html.append(\"</ul>\\n\");\n html.append(\"</body>\\n\\n\");\n\n html.append(\"</html>\");\n try (FileWriter fout = new FileWriter(path)){\n String htmlString = html.toString();\n fout.write(htmlString);\n Desktop desktop = Desktop.getDesktop();\n desktop.open(new File(path));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static String setFilePath() {\r\n\t\tJFileChooser fc = new JFileChooser(\".\"); // start at current directory\r\n\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tFile file = fc.getSelectedFile();\r\n\t\t\tString pathName = file.getAbsolutePath();\r\n\t\t\treturn pathName;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn \"\";\r\n\t}", "private synchronized Directory getDirectoryEmDisco() throws IOException{\r\n\t\tif(diretorioEmDisco == null){\r\n\t\t\tdiretorioEmDisco = FSDirectory.open(pastaDoIndice);\r\n\t\t}\r\n\t\t\r\n\t\treturn diretorioEmDisco;\r\n\t}", "@Override\n public void run() throws SmartServiceException {\n UserProfile author = us.getUser(smartServiceCtx.getUsername());\n String username = author.getUsername();\n\n // Create a filename based on the user's name and MadLib title.\n String userFullName = author.getFirstName() + \" \" + author.getLastName();\n String docName = username + \" \" + madlib.getTitle();\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(String.format(\"Creating new document in folder %d with name %s and ext %s\", saveIn, docName,\n DOC_EXTENSION));\n }\n // Instantiate a new Document object with the necessary metadata\n Document newDoc = new Document(saveIn, docName, DOC_EXTENSION);\n try {\n // Creates a new document in the Appian engine. At this point the document is empty.\n // Content.UNIQUE_NONE specifies that we don't need to worry about document name uniqueness\n ContentOutputStream madlibOS = cs.upload(newDoc, Content.UNIQUE_NONE);\n\n // Save the id of the new document as our smartservice output\n madlibDoc = madlibOS.getContentId();\n\n // Write the madlib text and some footer information to the new document file on disk\n PrintWriter pw = new PrintWriter(madlibOS);\n pw.println(AppianMadLibUtil.createMadLibText(madlib));\n pw.println(\"By \" + userFullName);\n pw.println(\"Created \" + new Date());\n pw.close();\n\n } catch (PrivilegeException e) {\n LOG.error(\n String.format(\"User %s did not have permission to write to folder [id=%d]\", username, saveIn), e);\n throw createException(e, \"error.exception.permission\", smartServiceCtx.getUsername(), saveIn);\n } catch (Exception e) {\n LOG.error(\n String.format(\"Unexpected error creating new doc in folder [id=%d] as user %s\", saveIn, username), e);\n throw createException(e, \"error.exception.unknown\", smartServiceCtx.getUsername(), saveIn);\n }\n }", "private static File setYdfDirectory()\r\n/* 27: */ throws IOException\r\n/* 28: */ {\r\n/* 29: 32 */ log.finest(\"OSHandler.setYdfDirectory\");\r\n/* 30: 33 */ ydfDirectory = new File(USER_HOME + \"/\" + \".yourdigitalfile\");\r\n/* 31: 34 */ ydfDirectory.mkdir();\r\n/* 32: 35 */ return ydfDirectory;\r\n/* 33: */ }", "File getWorkfile();", "public void setHarvestedDataDir(String val) {\n\n\t\tthis.harvestedDataDir = val;\n\n\t}", "public void setApplicationDir( String path ) {\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n Editor editor = preferences.edit();\r\n editor.putString(LibraryConstants.PREFS_KEY_BASEFOLDER, path);\r\n editor.commit();\r\n resetManager();\r\n }", "public String getHarvestedDataDir() {\n\n\t\treturn harvestedDataDir;\n\n\t}", "private static String m119220d() {\n File externalFilesDir = C6399b.m19921a().getExternalFilesDir(null);\n if (externalFilesDir == null) {\n return null;\n }\n C7276d.m22805a(externalFilesDir);\n return externalFilesDir.getAbsolutePath();\n }" ]
[ "0.5663338", "0.5559289", "0.5539013", "0.5491924", "0.5460955", "0.5394009", "0.5364018", "0.5359379", "0.5340629", "0.5323169", "0.5267008", "0.52116114", "0.52079326", "0.51765054", "0.51701707", "0.51678246", "0.5126845", "0.51213324", "0.50949425", "0.50904703", "0.508325", "0.5080387", "0.50706047", "0.5070555", "0.50682724", "0.506134", "0.5035881", "0.50296307", "0.5018144", "0.501253", "0.5006855", "0.50009364", "0.49958542", "0.49953935", "0.49863335", "0.49676892", "0.4964912", "0.49631676", "0.49517998", "0.49478662", "0.4932841", "0.4929874", "0.49296984", "0.4926862", "0.49245858", "0.48844838", "0.4881084", "0.48720062", "0.4866019", "0.48642126", "0.48593333", "0.48592782", "0.48424765", "0.4842428", "0.48383644", "0.4837484", "0.48354346", "0.4834173", "0.48288253", "0.4826787", "0.48229626", "0.48224887", "0.4822487", "0.48201293", "0.4815501", "0.48150972", "0.48113313", "0.48109272", "0.4807373", "0.48026425", "0.47949922", "0.4794755", "0.4792979", "0.47910216", "0.47889188", "0.47864577", "0.47827092", "0.47817755", "0.4777123", "0.4775821", "0.4759379", "0.475713", "0.4756101", "0.475581", "0.47548497", "0.4750472", "0.4746174", "0.4743196", "0.47393394", "0.47378695", "0.4733175", "0.47321346", "0.47278386", "0.4727664", "0.47269225", "0.47236726", "0.47228447", "0.47225833", "0.47179827", "0.47153434", "0.47092688" ]
0.0
-1
Konstruktor tworzy pusta tablice o rozmiarze 2.
public ZbiorNaTablicyDynamicznej() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void obiektyTablice() {\n\n Object obiektString = new String();\n Object obiektObiekt = new Object();\n Integer[] obiektInt = new Integer[3];\n int[] tablicaInt = new int[5];\n\n obiektString = \"tekstStringa\";\n obiektObiekt = \"tekstObiektu\";\n obiektInt[2] = 3;\n tablicaInt[2] = 2;\n int wielkoscTablicy = tablicaInt.length;\n System.out.println(obiektObiekt + \"\\n\" + obiektString + \"\\n\" + obiektInt[2] + \"\\n\" + tablicaInt[3] + \"\\n\"\n + wielkoscTablicy);\n\n // modulo mniejszej przez większą = reszta*większa\n int b = 7 % 12;\n System.out.println(\"Modulo = \" + b);\n }", "public void rozmiarTablicy()\n {\n iloscWierszy = tabelaDanych.getRowCount();\n iloscKolumn = tabelaDanych.getColumnCount();\n tablica = new int[iloscWierszy][iloscKolumn];\n // wypelnienie tablicy pomocniczej z wartościami tabeli\n for (int i = 0; i < iloscWierszy ; i++)\n {\n for (int j = 0; j < iloscKolumn; j++)\n {\n tablica [i][j] = (int) tabelaDanych.getValueAt(i,j);\n }\n }\n }", "protected void dataTableleibie(int i) {\n\t\r\n}", "public void tablero(){\r\n System.out.println(\" X \");\r\n System.out.println(\" 1 2 3\");\r\n System.out.println(\" | |\");\r\n //imprimir primera fila\r\n System.out.println(\" 1 \"+gato[0][0]+\" | \"+gato[0][1]+\" | \"+gato[0][2]+\" \");\r\n System.out.println(\" _____|_____|_____\");\r\n System.out.println(\" | |\");\r\n //imprimir segunda fila\r\n System.out.println(\"Y 2 \"+gato[1][0]+\" | \"+gato[1][1]+\" | \"+gato[1][2]+\" \");\r\n System.out.println(\" _____|_____|_____\");\r\n System.out.println(\" | |\");\r\n //imprimir tercera fila\r\n System.out.println(\" 3 \"+gato[2][0]+\" | \"+gato[2][1]+\" | \"+gato[2][2]+\" \");\r\n System.out.println(\" | |\");\r\n }", "protected void dataTablePlan2(int i) {\n\t\t\r\n\t}", "public void paramTable() {\n jTable2.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\n mode = (DefaultTableModel) jTable2.getModel();\n dtcm = (DefaultTableColumnModel) jTable2.getColumnModel();\n\n jTable2.setRowHeight(40);\n largeurColoneMax(dtcm, 0, 70);\n largeurColoneMax(dtcm, 3, 50);\n largeurColoneMax(dtcm, 4, 100);\n largeurColoneMax(dtcm, 6, 90);\n largeurColoneMax(dtcm, 9, 70);\n\n TableCellRenderer tbcProjet = getTableCellRenderer();\n TableCellRenderer tbcProjet2 = getTableHeaderRenderer();\n for (int i = 0; i < jTable2.getColumnCount(); i++) {\n TableColumn tc = jTable2.getColumnModel().getColumn(i);\n tc.setCellRenderer(tbcProjet);\n tc.setHeaderRenderer(tbcProjet2);\n\n }\n\n }", "public Tabla(int tip) {\n\t\tthis.sirinaTable = 20;\n\t\tthis.visinaTable = 20;\n\t\tthis.tip = tip;\n\t\tthis.tabla = new char[20][20];\n\t\tfor (int i = 0; i < this.visinaTable;i++) {\n\t\t\tfor (int j = 0; j < this.sirinaTable;j++) {\n\t\t\t\ttabla[i][j] = '.';\n\t\t\t}\n\t\t}\n\t\trezultat = 0;\n\t\tzmija = new ArrayList<Cvor>();\n\t\t\n\t\tif (tip == 2) {\n\t\t\tthis.dodajZidove();\n\t\t}\n\t\telse if(tip == 3) {\n\t\t\tthis.dodajPrepreke1();\n\t\t}\n\t\telse if(tip == 4) {\n\t\t\tthis.dodajPrepreke2();\n\t\t}\n\t\tthis.dodajZmijuPocetak();\n\t\tthis.dodajHranu();\n\t\tthis.smjer = 'd';\n\t}", "public void rePintarTablero() {\n int colorArriba = turnoComputadora != 0 ? turnoComputadora : -1;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n if (x % 2 == 0) {\n tablero[x][y].setFondo(y % 2 == 1 ? getNegro() : getBlanco());\n tablero[x][y].setResaltar(y % 2 == 1 ? getNegroResaltado() : getBlancoResaltado());\n } else {\n tablero[x][y].setFondo(y % 2 == 0 ? getNegro() : getBlanco());\n tablero[x][y].setResaltar(y % 2 == 0 ? getNegroResaltado() : getBlancoResaltado());\n }\n tablero[x][y].setBounds(anchoCuadro * (colorArriba == -1 ? x : (7 - x)), altoCuadro * (colorArriba == -1 ? y : (7 - y)), anchoCuadro, altoCuadro);\n }\n }\n }", "private int h1(int p){\n\t\t return p % table.length;\n\t}", "@Override\n\t\t\tpublic int getColumnCount() \n\t\t\t{\n\t\t\t\treturn 2;\n\t\t\t}", "private void utvidtabellen() {\n\t\tCD[] hjelpeTab;\n\t\tif (cdTabell.length == 0) {\n\t\t\thjelpeTab = new CD[1];\n\t\t\tmaksAntall = 1;\n\t\t} else {\n\t\t\thjelpeTab = new CD[(int) Math.ceil(cdTabell.length * 1.1)];\n\t\t\tmaksAntall = hjelpeTab.length;\n\t\t}\n\t\tfor (int i = 0; i < cdTabell.length; i++) {\n\t\t\thjelpeTab[i] = cdTabell[i];\n\t\t}\n\t\tcdTabell = hjelpeTab;\n\t}", "@Override\n public int getColumnCount() {\n return 2;\n }", "@Override\r\n\tpublic int getIndexStep() {\n\t\t\r\n\t\treturn 2;\r\n\t}", "public Tabla(int sirina, int visina, int tip) {\n\t\tthis.sirinaTable = sirina;\n\t\tthis.visinaTable = visina;\n\t\tthis.tip = tip;\n\t\tthis.tabla = new char[sirina][visina];\n\t\tfor (int i = 0; i < this.visinaTable;i++) {\n\t\t\tfor (int j = 0; j < this.sirinaTable;j++) {\n\t\t\t\ttabla[i][j] = '.';\n\t\t\t}\n\t\t}\n\t\trezultat = 0;\n\t\tzmija = new ArrayList<Cvor>();\n\t\tif (tip == 2) {\n\t\t\tthis.dodajZidove();\n\t\t}\n\t\tthis.dodajZmijuPocetak();\n\t\tthis.dodajHranu();\n\t\tthis.smjer = 'd';\n\t}", "public void llenarTabla(int inicio, int limite) {\n DefaultTableModel dtm = (DefaultTableModel) jTableVerRondas.getModel();//se usa DefaultTableModel para manipular facilmente el Tablemodel\n dtm.setRowCount(0);//eliminando la s filas que ya hay. para agregar desde el principio.\n //los datos se agregan la defaultTableModel.\n ArrayList<Partido> llenar = miOpenAustralia.getPartidos();//sacando al informacion a agregar en la tabla.\n\n //como se va a llenar una tabla de 5 columnas, se crea un vector de 3 elementos.\n //se usa un arreglo de Object para poder agregar a la tabla cualquier tipo de datos.\n Object[] datos = new Object[5];\n for (int i = inicio; i < limite; i++) {\n\n Partido parti = llenar.get(i);\n //Se agrega este if para evitar que el extraiga datos en un campo null\n if (parti != null) {\n\n datos[0] = parti.getId();\n datos[1] = parti.getFechaHora();//el primer elemetno del arreglo va a ser el id,la primera col en la Tabla.\n datos[2] = parti.getJugador1().getNombre();\n datos[3] = parti.getJugador2().getNombre();\n datos[4] = parti.getPista().getNombre();\n\n //agrego al TableModleo ese arreglo\n dtm.addRow(datos);\n }\n }\n }", "private void popuniTabelu() {\n try {\n List<PutnikEntity> putnici=Controller.vratiSvePutnike();\n TableModel tm=new PutnikTableModel(putnici);\n jtblPutnici.setModel(tm);\n } catch (Exception ex) {\n Logger.getLogger(FIzaberiLet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void llenadoDeTablas() {\n /**\n *\n * creaccion de la tabla de de titulos \n */\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Bitacora\");\n modelo.addColumn(\"Usuario\");\n modelo.addColumn(\"Fecha\");\n modelo.addColumn(\"Hora\");\n modelo.addColumn(\"Ip\");\n modelo.addColumn(\"host\");\n \n modelo.addColumn(\"Accion\");\n modelo.addColumn(\"Codigo Aplicacion\");\n modelo.addColumn(\"Modulo\");\n /**\n *\n * instaciamiento de las las clases Bitacora y BiracoraDAO\n * intaciamiento de la clases con el llenado de tablas\n */\n BitacoraDao BicDAO = new BitacoraDao();\n List<Bitacora> usuario = BicDAO.select();\n JtProductos1.setModel(modelo);\n String[] dato = new String[9];\n for (int i = 0; i < usuario.size(); i++) {\n dato[0] = usuario.get(i).getId_Bitacora();\n dato[1] = usuario.get(i).getId_Usuario();\n dato[2] = usuario.get(i).getFecha();\n dato[3] = usuario.get(i).getHora();\n dato[4] = usuario.get(i).getHost();\n dato[5] = usuario.get(i).getIp();\n dato[6] = usuario.get(i).getAccion();\n dato[7] = usuario.get(i).getCodigoAplicacion();\n dato[8] = usuario.get(i).getModulo();\n \n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }}", "public JTable crtTBLPNL1(JPanel LP_TBLPNL,String[] LP_COLHD,int LP_ROWCNT,int LP_XPOS,int LP_YPOS,int LP_WID,int LP_HGT,int[] LP_ARRGSZ){ \n\t try{\n\t\t cl_tab2 L_TBLOBJ1; \n\t\t JPanel pnlTAB1 = new JPanel();\n\t\t Object[][] L_TBLDT1;\n\t\t L_TBLDT1 = crtTBLDAT(LP_ROWCNT,LP_COLHD.length); // Creating the Object Data\n\t\t L_TBLOBJ1 = new cl_tab2(L_TBLDT1,LP_COLHD);\n\t\t JTable L_TBL1 = new JTable(L_TBLOBJ1); \n\t\t L_TBL1.setBackground(new Color(213,213,255));\n\t\t int h1 = JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS;\n\t\t int v1 = JScrollPane.VERTICAL_SCROLLBAR_ALWAYS;\n\t\t JScrollPane jspTBL1 = new JScrollPane(L_TBL1,v1,h1);\n\t\t jspTBL1.setPreferredSize(new Dimension(LP_WID-25,LP_HGT-25));\n\t\t jspTBL1.setLocation(0,100);\n\t\t pnlTAB1.removeAll();\n\t\t setCOLWDT(L_TBL1,LP_COLHD,LP_ARRGSZ);\n\t\t pnlTAB1.add(jspTBL1);\n\t\t pnlTAB1.setSize(LP_WID,LP_HGT);\n\t\t pnlTAB1.setLocation(LP_XPOS,LP_YPOS);\n\t\t LP_TBLPNL.add(pnlTAB1);\n\t\t LP_TBLPNL.updateUI();\n\t\treturn L_TBL1;\n\t }catch(Exception L_EX){\n\t\t System.out.println(\"crtTBLPNL1 \"+L_EX);\n\t }\n\treturn null;\n }", "public ExibeTarefas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n jTable1.setRowSorter(new TableRowSorter(modelo));\n readJTable();\n readItemBox();\n }", "private static void popuniTabelu() {\r\n\t\tDefaultTableModel dfm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\r\n\t\tdfm.setRowCount(0);\r\n\r\n\t\tfor (int i = 0; i < listaClanova.size(); i++) {\r\n\t\t\tClan c = listaClanova.getClan(i);\r\n\t\t\tdfm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\t}\r\n\t\tcentrirajTabelu();\r\n\t}", "@org.junit.jupiter.api.Test\n void drop2ColisionesSeparados() {\n String key = \"0\";\n String value =\"David\";\n String key2 = \"11\";\n String value2 =\"ferrero\";\n HashTable hashTable = new HashTable();\n hashTable.put(key,value);\n hashTable.put(key2,value2);\n hashTable.put(\"22\",\"hola\");\n\n hashTable.drop(\"0\");\n hashTable.drop(\"22\");\n\n String esperado =\"bucket[0] = [11, ferrero]\\n\";\n Assertions.assertEquals(esperado,hashTable.toString());\n\n }", "private int h2(int p){\n\t\tdouble A = (Math.sqrt(5) - 1) / 2;\n\t\treturn (int) Math.abs(this.table.length * ((p * A) - (int)(p * A))) % table.length;\n\t}", "public int getColumnCount() {\n return 2;\r\n }", "public abstract int rows();", "public void testTableroLleno( )\n {\n setupEscenario2( );\n for( int i = 1; i <= 9; i++ )\n {\n triqui.marcarCasilla( i, marcaJugador1 );\n }\n assertTrue( triqui.tableroLleno( ) );\n }", "public int getRowspan() \n {\n return 1;\n }", "@Override\n public void tableRows_()\n {\n }", "private void popularTabela() {\n\n if (CadastroCliente.listaAluno.isEmpty()) {\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setNumRows(0);\n }\n int t = 0;\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setNumRows(0);\n int aux = CadastroCliente.listaAluno.size();\n\n while (t < aux) {\n aluno = CadastroCliente.listaAluno.get(t);\n modelo.addRow(new Object[]{aluno.getMatricula(), aluno.getNome(), aluno.getCpf(), aluno.getTel()});\n t++;\n }\n }", "private void srediTabelu() {\n\n mtu = (ModelTabeleUlica) jtblUlica.getModel();\n ArrayList<Ulica> ulice = kontrolor.Kontroler.getInstanca().vratiUlice();\n mtu.setLista(ulice);\n\n }", "public void llenarTabla() {\n\n String matriz[][] = new String[lPComunes.size()][2];\n\n for (int i = 0; i < AccesoFichero.lPComunes.size(); i++) {\n matriz[i][0] = AccesoFichero.lPComunes.get(i).getPalabra();\n matriz[i][1] = AccesoFichero.lPComunes.get(i).getCodigo();\n\n }\n\n jTableComun.setModel(new javax.swing.table.DefaultTableModel(\n matriz,\n new String[]{\n \"Palabra\", \"Morse\"\n }\n ) {// Bloquea que las columnas se puedan editar, haciendo doble click en ellas\n @SuppressWarnings(\"rawtypes\")\n Class[] columnTypes = new Class[]{\n String.class, String.class\n };\n\n @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n @Override\n public Class getColumnClass(int columnIndex) {\n return columnTypes[columnIndex];\n }\n boolean[] columnEditables = new boolean[]{\n false, false\n };\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return columnEditables[column];\n }\n });\n\n }", "private void limparTabela() {\n while (tmLivro.getRowCount() > 0) {\n tmLivro.removeRow(0);\n }\n }", "private void tablesice() {\n //Modificamos los tamaños de las columnas.\n tablastock.getColumnModel().getColumn(0).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(1).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(2).setMinWidth(100);\n tablastock.getColumnModel().getColumn(3).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(4).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(5).setMaxWidth(70);\n }", "public Doublet[] doubleTabExtraction(){\n\t\tDoublet[] tab = doubleTab();\n\t\tDoublet[] tab2 = new Doublet[4];\n\t\ttab2[0] = tab[4];\n\t\ttab2[1] = tab[5];\n\t\ttab2[2] = tab[7];\n\t\ttab2[3] = tab[9];\n\t\treturn tab2;\n\t}", "public final void detalleTabla()\n {\n \n try\n {\n ResultSet obj=nueva.executeQuery(\"SELECT cli_nit,cli_razon_social FROM clientes.cliente ORDER BY cli_razon_social ASC\");\n \n while (obj.next()) \n {\n \n Object [] datos = new Object[2];\n \n \n for (int i=0;i<2;i++)\n {\n datos[i] =obj.getObject(i+1);\n }\n\n modelo.addRow(datos);\n \n }\n tabla_cliente.setModel(modelo);\n nueva.desconectar();\n \n \n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "private void limparTabela() { \n while (tmLivro.getRowCount() > 0) { \n tmLivro.removeRow(0);\n }\n }", "public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }", "public void testColumnaIzquierdaLlena( )\n {\n setupEscenario2( );\n triqui.limpiarTablero( );\n triqui.marcarCasilla( 1, marcaJugador1 );\n triqui.marcarCasilla( 4, marcaJugador1 );\n triqui.marcarCasilla( 7, marcaJugador1 );\n assertTrue( triqui.columnaIzquierdaLlena( marcaJugador1 ) );\n assertTrue( triqui.ganoJuego( marcaJugador1 ) );\n }", "public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }", "private void pintarTabla() {\r\n ArrayList<Corredor> listCorredors = gestion.getCorredores();\r\n TableModelCorredores modelo = new TableModelCorredores(listCorredors);\r\n jTableCorredores.setModel(modelo);\r\n TableRowSorter<TableModel> elQueOrdena = new TableRowSorter<>(modelo);\r\n jTableCorredores.setRowSorter(elQueOrdena);\r\n\r\n }", "public DefaultTableModel buscarlotes() {\n \n String encabezados[]= {\"Nombre\",\"Codigo\",\"Lote\",\"Vencimiento\",\"Dias Restantes\"};\n Control.ControlLote c = new Control.ControlLote();\n List<Modelo.Lotes> lotes = null;\n \n try {\n lotes = c.buscarlote();\n \n } catch (ClassNotFoundException ex) {\n Logger.getLogger(AgregarStock.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n Long resta;//para saber cuanto queda de vencimiento\n java.util.Date fechaActual = new Date(); \n \n String [][] data = new String[lotes.size()][5];\n for (int i = 0; i < lotes.size(); i++) {\n \n resta=lotes.get(i).getVencimiento().getTime()-fechaActual.getTime();\n long dias = (resta / (1000 * 60 * 60 * 24))+1;\n \n \n data[i][0] = lotes.get(i).getNombre();\n data[i][1] = Long.toString(lotes.get(i).getCodigo());\n data[i][2] = lotes.get(i).getLote();\n data[i][3] = lotes.get(i).getVencimiento().toString();\n if(dias<1)\n data[i][4] = (\"Vencido\");\n else{\n data[i][4] = Long.toString(dias);\n }\n\n }\n\n jTable1.setDefaultRenderer (Object.class, new MiRender());\n \n return new DefaultTableModel(data,encabezados);\n }", "@Override\n\tpublic int horas_trabajo() {\n\t\treturn 1000;\n\t}", "@Override\n public String getGenericLabel() {\n return \"Počet sloupců v každé tabulce\";\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void funkcie() {\n\t\tTableColumn<Znamka, String> datumColumn = new TableColumn<>(\"Datum pisomky\");\n\t\tdatumColumn.setMinWidth(velkostPolickaX - 1);\n\t\tdatumColumn.setCellValueFactory(new PropertyValueFactory<>(\"datumS\"));\n\n\t\tTableColumn<Znamka, Double> hodnotaColumn = new TableColumn<Znamka, Double>(\"Hodnota\");\n\t\thodnotaColumn.setMinWidth(velkostPolickaX - 1);\n\t\thodnotaColumn.setCellValueFactory(new PropertyValueFactory<>(\"hodnotaS\"));\n\n\t\tTableColumn<Znamka, Double> maxHodnotaColumn = new TableColumn<Znamka, Double>(\"Max. Hodnota\");\n\t\tmaxHodnotaColumn.setMinWidth(velkostPolickaX - 1);\n\t\tmaxHodnotaColumn.setCellValueFactory(new PropertyValueFactory<>(\"maxHodnotaS\"));\n\n\t\ttabulkaZiak.getColumns().addAll(hodnotaColumn, maxHodnotaColumn, datumColumn);\n\n\t\tvyberPredmetov.setItems(((Ziak) aktualnyPouzivatel).vratMenoPredmetov());\n\t\tvyberPredmetov.getSelectionModel().selectedIndexProperty()\n\t\t\t\t.addListener((ChangeListener<Number>) (ov, value, new_value) -> {\n\t\t\t\t\ttabulkaZiak.setItems(((Ziak) aktualnyPouzivatel).vratZnamkyPredmetu((int) new_value));\n\t\t\t\t});\n\t\tvyberPredmetov.getSelectionModel().selectFirst();\n\t}", "private void tabelaFevereiroMouseClicked(java.awt.event.MouseEvent evt) {\n \n Compromisso.setText(this.indexesToString());\n \n }", "public void imprimirTabuleiro() { \n\t\t\n\t\tfor(int i = 0; i < this.linhas; i++) {\n\t\t\tfor(int j = 0; j < this.colunas; j++) { \t\t\t\t\n\t\t\t\tSystem.out.print(this.tabuleiro[i][j] + \"\\t\"); \n\t\t\t}\n\t\t\tSystem.out.println(); \t\t\t\n\t\t}\n\t}", "static void pritlnSouSuoBiaoToWindow()\n {\n System.out.println(\"\");\n System.out.println(\"方向状态到状态路径表 outToATable\");\n \n String[]tableHeads=\n {\n \"编号\",\"矩阵\",\"0号\",\"1号\",\"2号\",\"3号\",\"4号\",\"5号\",\"6号\",\"7号\",\"8号\",\"9号\",\"10号\",\"11号\",\"12号\",\"13号\",\"14号\",\"15号\",\"16号\",\"17号\",\"18号\",\"19号\",\"20号\",\"21号\",\"22号\",\"23号\" \n }\n ;\n Vector tableHeadName=new Vector();\n \n for(int l=0;l<tableHeads.length;l++)\n {\n tableHeadName.add(tableHeads[l]);\n }\n \n \n Vector row=new Vector();\n //row.add(tableHeadName);\n for(int i=0;i<statusJuZhenList.size();i++)\n {\n //if(statusJuZhenList.size ()==24){System.out.println(\"24个状态\");}\n Vector cell=new Vector();\n \n cell.add(String.valueOf(i));\n \n int[][]intArray ;\n intArray=(int[][])(statusJuZhenList.get(i));\n String statusJuZhenToString=\"\" ;\n for(int j=0;j<3;j++)\n {\n statusJuZhenToString+=\"[ \" ;\n for(int k=0;k<3;k++)\n {\n statusJuZhenToString+=String.valueOf(intArray[k][j])+\",\" ;\n }\n statusJuZhenToString+=\" ],\" ;\n }\n cell.add(statusJuZhenToString);\n \n //public static Vector[][]souSuoBiao=new Vector[24][24];\n for(int j=0;j<statusJuZhenList.size();j++)\n {\n Vector luJingArray=(Vector)souSuoBiao[i][j];\n String iToJAllLuJing=luJingArray.toString();\n cell.add(iToJAllLuJing);\n }\n \n \n \n \n row.add(cell);\n }\n \n \n DefaultTableModel tableModel=new DefaultTableModel();\n tableModel.setDataVector(row,tableHeadName);\n \n \n MoFang.theMainFrame.totlePanel.table2.setModel(tableModel);\n MoFang.theMainFrame.totlePanel.table2.setGridColor(Color.cyan);\n \n \n }", "public void limpiarcarrito() {\r\n setTotal(0);//C.P.M limpiamos el total\r\n vista.jTtotal.setText(\"0.00\");//C.P.M limpiamos la caja de texto con el formato adecuado\r\n int x = vista.Tlista.getRowCount() - 1;//C.P.M inicializamos una variable con el numero de columnas\r\n {\r\n try {\r\n DefaultTableModel temp = (DefaultTableModel) vista.Tlista.getModel();//C.P.M obtenemos el modelo actual de la tabla\r\n while (x >= 0) {//C.P.M la recorremos\r\n temp.removeRow(x);//C.P.M vamos removiendo las filas de la tabla\r\n x--;//C.P.M y segimos disminuyendo para eliminar la siguiente \r\n }\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al limpiar la venta\");\r\n }\r\n }\r\n }", "public void verTablero(){\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\" 1 2 3 4 5 6 \\n\");\n\t\tfor(int i = 0; i < tablero.length; i++){\n\t\t\t\n\t\t\tfor(int j = 0; j < tablero[1].length; j++){\n\t\t\t\t\n\t\t\t\tif(tablero[i][j] == 0){\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.print(\" - \");\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.print(\" \" + tablero[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "protected int getTableCondtion()\n\t\t{\n\t\t\treturn Condtion ;\n\t\t}", "@Override\n\t\t\tpublic int getCount() {\n\t\t\t\treturn 2;\n\t\t\t}", "public static String printSelectRow2() {\n return \"Choose card 2 and write the corresponding row (Only choose Ints between 1 - 4 or 0 to quit) : \";\n }", "Table getTable();", "public int row();", "@Override\n\tpublic int getColumnCount() {\n\t\treturn 2;\n\t}", "@org.junit.jupiter.api.Test\n void drop2ColisionesJuntos() {\n String key = \"0\";\n String value =\"David\";\n String key2 = \"11\";\n String value2 =\"ferrero\";\n HashTable hashTable = new HashTable();\n hashTable.put(key,value);\n hashTable.put(key2,value2);\n hashTable.put(\"22\",\"hola\");\n\n hashTable.drop(\"0\");\n hashTable.drop(\"11\");\n\n String esperado =\"bucket[0] = [22, hola]\\n\";\n Assertions.assertEquals(esperado,hashTable.toString());\n\n }", "public void mostrarTablero(){\n for(int fila = 0; fila < FILAS; fila++){\n for(int columna : tablero[fila]){\n System.out.printf(\"%2d \", columna);\n }\n System.out.println();\n }\n }", "private void UpdateTable() {\n\t\t\t\t\n\t\t\t}", "String getTabela();", "private RoundTable( IntSList knsBefore, IntSList knsAfter, int n ) {\n \n //knights = kns;\n numeroCompl = n;\n knightsBefore = knsBefore;\n knightsAfter = knsAfter;\n lunghezza = knsBefore.length();\n \n }", "private void llenarCuadrosTablero() {\n tmp = new JLabel();\n tmp.setBounds(-100, -100, 56, 56);\n add(tmp);\n tablero = new CuadroPieza[8][8];\n setLayout(null);\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n tablero[x][y] = new CuadroPieza(x, y);\n add(tablero[x][y]);// para agregar los elementos\n }\n }\n rePintarTablero();\n }", "@Override\r\n\t\t\tpublic int getCount() {\n\t\t\t\treturn 2;\r\n\t\t\t}", "@Override\n public void tableRows(int[] arg0, boolean arg1)\n {\n }", "public StrTab() {\n maxIndex = 1;\n }", "public TempTableHeader getHeader2() { return header2; }", "public void setRows () {\n\t\t\n\t}", "public HTMLTableSectionElement getElementTablaTablero() { return this.$element_TablaTablero; }", "private JTable itensNaoPagos() {\n\t\tinitConexao();\n\t\t\n try {\t \n\t String select = \"SELECT cod_item_d, nome_item_d, valor_item_d, data_vencimento_item_d FROM Item_despesa WHERE vencimento_item_d = '0'\";\n\t PreparedStatement ptStatement = c.prepareStatement(select);\n\t rs = ptStatement.executeQuery();\n\t \n\t Object[] colunas = {\"Item de despesa\", \"Valor total\", \"Data do vencimento\", \"\", \"code\"}; \t\t\n\t\t\t DefaultTableModel model = new DefaultTableModel();\t\t \n\t\t\t model.setColumnIdentifiers(colunas); \t\t \n\t\t\t Vector<Object[]> linhas = new Vector<Object[]>(); \n\t\t\t \n\t\t\t \n\t while (rs.next()){\n\t\t linhas.add(new Object[]{rs.getString(\"nome_item_d\"),rs.getString(\"valor_item_d\"),rs.getString(\"data_vencimento_item_d\"), \"Pagar\", rs.getString(\"cod_item_d\")}); \t \t\n\t \t } \n\t \n\t\t\t for (Object[] linha : linhas) { \n\t\t model.addRow(linha); \n\t\t } \t\t \n\t\t\t final JTable tarefasTable = new JTable(); \t\t \n\t\t\t tarefasTable.setModel(model); \t\t\n\t\t\t \n\t\t\t ButtonColumn buttonColumn = new ButtonColumn(tarefasTable, 3, \"itemPedido\");\n\t\t\t \n\t\t\t tarefasTable.removeColumn(tarefasTable.getColumn(\"code\")); \t \n\t return tarefasTable; \n } catch (SQLException ex) {\n System.out.println(\"ERRO: \" + ex);\n }\n\t\treturn null; \n\t}", "@Test\r\n\t\t\tpublic void testDosFilasDespuesDeQuinta() {\n\t\t\t\tList<WebElement> tabla= driver.findElement(By.xpath(\"//table[@id='customers']\")).findElements(By.xpath(\".//tr[position() >5]\"));\r\n\t\t\t\tSystem.out.println(tabla.size());\t\r\n\t\t\t\tassertEquals(tabla.size(),2);\r\n\t\t\t}", "protected void ucitajSortiranoPoBrojRez() {\n\t\tObject[]redovi=new Object[9];\r\n\t\tdtm.setRowCount(0);\r\n\t\t\r\n\t\tfor(Rezervacije r:alSort) {\r\n\t\t\t\r\n\t\t\tredovi[0]=r.getID_Rez();\r\n\t\t\tredovi[1]=r.getImePrezime();\r\n\t\t\tredovi[2]=r.getImePozorista();\r\n\t\t\tredovi[3]=r.getNazivPredstave();\r\n\t\t\tredovi[4]=r.getDatumIzvodjenja();\r\n\t\t\tredovi[5]=r.getVremeIzvodjenja();\r\n\t\t\tredovi[6]=r.getScenaIzvodjenja();\r\n\t\t\tredovi[7]=r.getBrRezUl();\r\n\t\t\tredovi[8]=r.getCenaUlaznica();\r\n\t\t\tdtm.addRow(redovi);\r\n\t\t}\r\n\t}", "public int[][] turfu() {\r\n\t\tint[][] tab = new int[matrice[0].length][matrice.length]; \r\n\t\tint n =0; \r\n\t\tfor(int i=0; i<tab.length; i++) {\r\n\t\t\tfor(int j=0; j< tab[0].length; j++) {\r\n\t\t\t\ttab[i][j] = matrice[j][n]; \r\n\t\t\t}\r\n\t\t\tn++;\r\n\t\t}\r\n\t\treturn tab; \r\n\t}", "public void echantillon_zone(){\n\n JLabel lbl_Echantillon = new JLabel(\"Offre d'\\u00E9chantillons :\");\n lbl_Echantillon.setBounds(340, 170, 119, 16);\n add(lbl_Echantillon);\n\n // MODEL\n final DefaultTableModel model = new DefaultTableModel();\n final DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();\n rightRenderer.setHorizontalAlignment(JLabel.RIGHT);\n Object[][] o = new Object[sizeVector][2];\n for(int i = 0; i < sizeVector; i++){\n o[i][0] = medicaments.get(i)[0];\n o[i][1] = medicaments.get(i)[1];\n }\n // TABLE DATA\n model.setDataVector(o, new Object[]{\"M\\u00E9dicament\",\"Qt\\u00E9\"});\n\n\n // TABLE\n result_table = new JTable(model);\n result_table.setBounds(475, 170, 200, 150);\n result_table.getColumnModel().getColumn(1).setMaxWidth(40);\n result_table.getColumnModel().getColumn(1).setCellRenderer(rightRenderer);\n result_table.setEnabled(false);\n add(result_table);\n\n\n // SCROLLPANE\n JScrollPane apne= new JScrollPane(result_table);\n apne.setBounds(475, 170, 200, 150);\n add(apne);\n\n\n }", "int getRows();", "int getRows();", "@Override\r\n\t\tpublic int getCount() {\n\t\t\treturn 2;\r\n\t\t}", "int tableSize();", "public Complementos() {\n initComponents();\n String cabecera []={\"Producto\",\"Precio\"};\nString datos[][]={};\nboolean t=true;\nboolean f=false;\nmodelo = new Tablachida(datos,cabecera);\ntabla.setModel(modelo);\nTableColumnModel columnModel = tabla.getColumnModel();\ncolumnModel.getColumn(0).setPreferredWidth(250);\ntabla.setRowHeight(40);\n\n }", "private void tampilkan() {\n int row = table.getRowCount();\n for(int a= 0; a<row;a++){\n model.removeRow(0);\n }\n \n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tabla2 = new javax.swing.JTable();\n jButton4 = new javax.swing.JButton();\n jButton5 = new javax.swing.JButton();\n jButton6 = new javax.swing.JButton();\n jButton7 = new javax.swing.JButton();\n jPanel1 = new javax.swing.JPanel();\n txtNombre = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n txtCodigo = new javax.swing.JTextField();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu2 = new javax.swing.JMenu();\n jMenu1 = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n tabla2.setFont(new java.awt.Font(\"Verdana\", 0, 12)); // NOI18N\n tabla2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Codigo\", \"Nombre Historial\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tabla2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tabla2MouseClicked(evt);\n }\n });\n tabla2.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n tabla2KeyPressed(evt);\n }\n });\n jScrollPane1.setViewportView(tabla2);\n if (tabla2.getColumnModel().getColumnCount() > 0) {\n tabla2.getColumnModel().getColumn(0).setMinWidth(0);\n tabla2.getColumnModel().getColumn(0).setMaxWidth(0);\n tabla2.getColumnModel().getColumn(1).setResizable(false);\n }\n\n jButton4.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Iconos/1434664469_edit-clear.png\"))); // NOI18N\n jButton4.setText(\"Nuevo\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n jButton5.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Iconos/1434608001_save_as-2.png\"))); // NOI18N\n jButton5.setText(\"Guardar\");\n jButton5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton5ActionPerformed(evt);\n }\n });\n\n jButton6.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Iconos/1434857547_001_45.png\"))); // NOI18N\n jButton6.setText(\"Modificar\");\n jButton6.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton6ActionPerformed(evt);\n }\n });\n\n jButton7.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Iconos/1434841655_f-cross_256.png\"))); // NOI18N\n jButton7.setText(\"Eliminar\");\n jButton7.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton7ActionPerformed(evt);\n }\n });\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Tipos de historial\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Verdana\", 3, 14), new java.awt.Color(255, 255, 255))); // NOI18N\n jPanel1.setOpaque(false);\n jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n jPanel1.add(txtNombre, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 80, 130, 20));\n\n jLabel3.setFont(new java.awt.Font(\"Verdana\", 3, 14)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(255, 255, 255));\n jLabel3.setText(\"Nombre:\");\n jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 80, -1, 20));\n\n jLabel2.setFont(new java.awt.Font(\"Verdana\", 3, 14)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(255, 255, 255));\n jLabel2.setText(\"Codigo:\");\n jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 50, -1, 20));\n\n txtCodigo.setEditable(false);\n jPanel1.add(txtCodigo, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 50, 85, 20));\n\n jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Iconos/1434854150_exit.png\"))); // NOI18N\n jMenu2.setText(\"Cerrar sesion\");\n jMenu2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenu2ActionPerformed(evt);\n }\n });\n jMenuBar1.add(jMenu2);\n\n jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Iconos/1434853539_go-back.png\"))); // NOI18N\n jMenu1.setText(\"Regresar\");\n jMenu1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jMenu1MouseClicked(evt);\n }\n });\n jMenu1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenu1ActionPerformed(evt);\n }\n });\n jMenuBar1.add(jMenu1);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton6)\n .addComponent(jButton7)\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jButton5)\n .addGap(9, 9, 9)\n .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10)\n .addComponent(jButton7)\n .addGap(9, 9, 9)\n .addComponent(jButton4)\n .addGap(0, 1, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(33, 33, 33))\n );\n\n pack();\n }", "public void readTableData2() {\n\t\tint colCount = driver.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr[1]/th\"))\n\t\t\t\t.size();\n\t\tSystem.out.println(\"colCount\" + colCount);\n\t\t// Find row size\n\t\tint rowCount = driver\n\t\t\t\t.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td/parent::*\")).size();\n\t\tSystem.out.println(\"rowCount\" + rowCount);\n\t\t// Find xpath for 1st row and 1st column. Break into multiple parts such\n\t\t// that row and column no can be iterated.\n\t\tString firstPart = \"(//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td[2]/parent::tr)[\";\n\t\tString secondPart = \"]\";\n\t\t// Loop through rows one by one. Start from 1st row till row count.\n\t\tfor (int i = 1; i <= rowCount; i++) {\n\t\t\t\tString finalPart = firstPart + i + secondPart;\n\t\t\t\tSystem.out.println(finalPart);\n\t\t\t\tString text = driver.findElement(By.xpath(finalPart)).getText();\n\t\t\t\tSystem.out.print(text + \" | \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void main(String[] args) {\n int modulus = 9;\n for(int a = 0; a < modulus; a++ ) {\n if(a!=modulus-1) {\n tableRow(a, modulus, false);\n } else{\n tableRow(a,modulus,true);\n }\n }\n }", "void piede() {\n try {\n\n Cell c;\n c = new Cell();\n set2(c);\n c.setColspan(4);\n datatable.addCell(c);\n c = new Cell(new Phrase(\"Totale \\u20ac \" + Db.formatValuta(totale), new Font(Font.HELVETICA, 8, Font.BOLD)));\n set2(c);\n c.setColspan(2);\n c.setHorizontalAlignment(c.ALIGN_RIGHT);\n datatable.addCell(c);\n document.add(datatable);\n } catch (Exception err) {\n err.printStackTrace();\n javax.swing.JOptionPane.showMessageDialog(null, err.toString());\n }\n }", "private void MembentukListHuruf(){\n for(int i = 0; i < Panjang; i ++){\n Huruf Hrf = new Huruf();\n Hrf.CurrHrf = Kata.charAt(i);\n if(!IsVertikal){\n //horizontal\n Hrf.IdX = StartIdxX;\n Hrf.IdY = StartIdxY+i;\n }else{\n Hrf.IdX = StartIdxX+i;\n Hrf.IdY = StartIdxY;\n }\n // System.out.println(\"iniii \"+Hrf.IdX+\" \"+Hrf.IdY+\" \"+Hrf.CurrHrf+\" \"+NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].AddNoSoal(NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].Huruf=Hrf.CurrHrf;\n \n }\n }", "private void tampil() {\n int row=tabmode.getRowCount();\n for (int i=0;i<row;i++){\n tabmode.removeRow(0);\n }\n try {\n Connection koneksi=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/medica\",\"root\",\"\");\n ResultSet rs=koneksi.createStatement().executeQuery(\"select rawat_inap_bayi.no, pasien_bayi.tgl_lahir, rawat_inap_bayi.tgl_masuk, rawat_inap_bayi.tgl_pulang, rawat_inap_bayi.lama, kamar.nm_kamar, penyakit.nama_penyakit, dokter.nm_dokter, tindakan.nama_tindakan, rawat_inap_bayi.suhu_tubuh, rawat_inap_bayi.resusitas, rawat_inap_bayi.hasil, rawat_inap_bayi.keterangan, rawat_inap_bayi.apgar \"+\n \" from rawat_inap_bayi inner join pasien_bayi on rawat_inap_bayi.no_rm_bayi=pasien_bayi.no_rm_bayi inner join kamar on rawat_inap_bayi.kd_kamar=kamar.kd_kamar inner join penyakit on rawat_inap_bayi.kd_icd = penyakit.kd_icd inner join dokter on rawat_inap_bayi.kd_dokter = dokter.kd_dokter inner join tindakan on rawat_inap_bayi.kode_tindakan = tindakan.kode_tindakan \");\n while(rs.next()){\n String[] data={rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getString(6),rs.getString(7),rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11),rs.getString(12),rs.getString(13),rs.getString(14)};\n tabmode.addRow(data);\n }\n } catch (SQLException ex) {\n System.out.println(ex);\n }\n \n }", "void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }", "public void achoo(){\n for(int i = 0;i<12;i++){\n for(int j = 0;j<12;j++){\n System.out.print(\"\\t\"+(i+1)*(j+1));\n }\n System.out.print(\"\\n\");\n }\n }", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 2;\n\t\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 2;\n\t\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 2;\n\t\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 2;\n\t\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 2;\n\t\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 2;\n\t\t}", "public int getRows();", "public int getRows();", "public void init2(){\n dateTextField.setText(String.valueOf(dateFormat.format(d)));\n Object [][] temp = new Object[realizarVenda.compra.size()][9];\n finalPurchaseTable.setModel(new javax.swing.table.DefaultTableModel(\n temp,\n new String [] {\n \"Pct#\", \"Nome\", \"Descrição\", \"Tamanho\", \"Valor\", \"Qntd\", \"Gênero\", \"Departamento\", \"Loja\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n finalPurchaseTable.setToolTipText(\"Pacote, Nome, Descrição, Tamanho, Valor, Quantidade, Gênero, Departamento, Loja\");\n finalPurchaseTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(finalPurchaseTable);\n if (finalPurchaseTable.getColumnModel().getColumnCount() > 0) {\n finalPurchaseTable.getColumnModel().getColumn(0).setPreferredWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(0).setMaxWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(3).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(3).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(4).setPreferredWidth(75);\n finalPurchaseTable.getColumnModel().getColumn(4).setMaxWidth(95);\n finalPurchaseTable.getColumnModel().getColumn(5).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(5).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(6).setPreferredWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(6).setMaxWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(7).setPreferredWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(7).setMaxWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(8).setPreferredWidth(60);\n finalPurchaseTable.getColumnModel().getColumn(8).setMaxWidth(60);\n }\n for(int row = 0, col = 1;row<realizarVenda.compra.size();row++){\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).remessa, row, 0);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).nome, row, col);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).desc, row, col+1);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).tamanho, row, col+2);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).valor.valor_final, row, col+ 3);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).quantidade, row, col+4);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).sexo, row, col+5);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).dept, row, col+6);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).loja, row, col+7);\n }\n percentLabel.setText(String.valueOf(taxa)+\"%\");\n }", "private void MontarTabela(String where) {\n \n int linha = 0;\n int coluna = 0;\n \n String offset = String.valueOf(getPaginacao());\n \n while(linha < 10){\n while(coluna < 7){\n tbConFin.getModel().setValueAt(\"\", linha, coluna);\n coluna++;\n }\n linha++;\n coluna = 0;\n }\n \n linha = 0;\n \n String rd_id\n ,rd_codico\n ,rd_nome\n ,rd_receita_despesa\n ,rd_grupo\n ,rd_fixa\n ,rd_ativo;\n \n \n \n try{\n ResultSet rsConFin = cc.stm.executeQuery(\"select * from v_receitadespesa \"+where+\" order by rd_codico limit 10 offset \"+offset);\n \n while ( rsConFin.next() ) {\n rd_id = rsConFin.getString(\"RD_ID\");\n rd_codico = rsConFin.getString(\"rd_codico\");\n rd_nome = rsConFin.getString(\"rd_nome\");\n rd_receita_despesa = getRecDesp(rsConFin.getString(\"rd_receita_despesa\"));\n rd_grupo = getSimNao(rsConFin.getString(\"rd_grupo\"));\n rd_fixa = getSimNao(rsConFin.getString(\"rd_fixa\"));\n rd_ativo = getSimNao(rsConFin.getString(\"rd_ativo\"));\n \n tbConFin.getModel().setValueAt(rd_id, linha, 0);\n tbConFin.getModel().setValueAt(rd_codico, linha, 1);\n tbConFin.getModel().setValueAt(rd_nome, linha, 2);\n tbConFin.getModel().setValueAt(rd_receita_despesa, linha, 3);\n tbConFin.getModel().setValueAt(rd_grupo, linha, 4);\n tbConFin.getModel().setValueAt(rd_fixa, linha, 5);\n tbConFin.getModel().setValueAt(rd_ativo, linha, 6);\n \n linha++;\n }\n \n \n if(linha <= 10){\n setMensagem(\"A Busca retornou \"+linha+\" registros!\");\n }\n \n if(linha < 10){\n setFimConsulta(true);\n }else{\n setFimConsulta(false);\n }\n \n }catch(SQLException e){\n JOptionPane.showMessageDialog(this, \"Erro ao Carregar informações de contas financeiras!\\n\"+e.getMessage());\n }\n \n }", "private void srediTabelu() {\n ModelTabeleStavka mts = new ModelTabeleStavka();\n mts.setLista(n.getLista());\n tblStavka.setModel(mts);\n }", "public void readTable() {\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setRowCount(0);\n\n }", "private JTable fontesNaoPagas() {\n\t\tinitConexao();\n\t\t\n try {\t \n\t String select = \"SELECT data_ultimo_vencimento_fonte_r, cod_fonte_d, nome_fonte_d, valor_fonte_d, tipo_valor_fonte_d, data_abertura_fonte_d, periodo_fonte_d FROM Fonte_despesa WHERE vencimento_fonte_d = '0'\";\n\t \n\t PreparedStatement ptStatement = c.prepareStatement(select);\n\t rs = ptStatement.executeQuery();\n\t \n\t Object[] colunas = {\"Fonte de despesa\", \"Valor previsto\", \"Data do vencimento\", \"\", \"code\"}; \t\t\n\t\t\t DefaultTableModel model = new DefaultTableModel();\t\t \n\t\t\t model.setColumnIdentifiers(colunas); \t\t \n\t\t\t Vector<Object[]> linhas = new Vector<Object[]>(); \n\t\t\t \n\t\t\t select = \"select DATE_ADD(?,INTERVAL ? day)\";\n\t while (rs.next()){\n\t \t \n\t \tptStatement = c.prepareStatement(select);\n\t\t\t\tptStatement.setString(1, rs.getString(\"data_ultimo_vencimento_fonte_r\"));\n\t\t\t\tptStatement.setString(2, rs.getString(\"periodo_fonte_d\"));\n\t\t\t\trs2 = ptStatement.executeQuery();\n\t\t\t\trs2.next();\n\t\t linhas.add(new Object[]{rs.getString(\"nome_fonte_d\"),rs.getString(\"valor_fonte_d\"),rs2.getString(1), \"Pagar\", rs.getString(\"cod_fonte_d\")}); \t \t\n\t \t } \n\t \n\t\t\t for (Object[] linha : linhas) { \n\t\t model.addRow(linha); \n\t\t } \t\t \n\t\t\t final JTable tarefasTable = new JTable(); \t\t \n\t\t\t tarefasTable.setModel(model); \t\t\n\t\t\t \n\t\t\t ButtonColumn buttonColumn = new ButtonColumn(tarefasTable, 3, \"fonteNaoPaga\");\n\t\t\t \n\t\t\t tarefasTable.removeColumn(tarefasTable.getColumn(\"code\")); \t \n\t return tarefasTable; \n } catch (SQLException ex) {\n System.out.println(\"ERRO: \" + ex);\n }\n\t\treturn null; \n\t}", "private void preencherTabelaVeiculoCarga() {\n\n ArrayList dados = new ArrayList();\n cargaDao = new CargaDao();\n Carga carga;\n String[] colunas = new String[]{\"ID\", \"DESCRICAO\", \"STATUS\"};\n\n try {\n final List<Object> listaCarga = cargaDao.listarCargasDoVeiculo(idVeiculoSelecionado);\n\n if (listaCarga != null && listaCarga.size() > 0) {\n for (Object cargaAtual : listaCarga) {\n carga = (Carga) cargaAtual;\n dados.add(new Object[]{carga.getIdCarga(), carga.getDescricao(), carga.getStatus()});\n }\n }\n\n ModeloTabela modTabela = new ModeloTabela(dados, colunas);\n jTB_VeiculoCarga.setModel(modTabela);\n jTB_VeiculoCarga.getColumnModel().getColumn(0).setPreferredWidth(100);\n jTB_VeiculoCarga.getColumnModel().getColumn(0).setResizable(false);\n jTB_VeiculoCarga.getColumnModel().getColumn(1).setPreferredWidth(300);\n jTB_VeiculoCarga.getColumnModel().getColumn(1).setResizable(false);\n jTB_VeiculoCarga.getColumnModel().getColumn(2).setPreferredWidth(150);\n jTB_VeiculoCarga.getColumnModel().getColumn(2).setResizable(false);\n\n jTB_VeiculoCarga.getTableHeader().setReorderingAllowed(false);\n jTB_VeiculoCarga.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n jTB_VeiculoCarga.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n jTB_VeiculoCarga.addMouseListener(new MouseAdapter() {\n\n @Override\n public void mouseClicked(MouseEvent e) {\n try {\n List<Object> lista = cargaDao.listarCargasDoVeiculo(idVeiculoSelecionado);\n cargaSelecionada = (Carga) lista.\n get(jTB_VeiculoCarga.convertRowIndexToModel(jTB_VeiculoCarga.getSelectedRow()));\n\n // if (veiculoDao.listarVeiculosAtivos().size() > 0 && veiculoDao.listarVeiculosAtivos() != null) {}\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(FormVeiculoCargas.this, \"Erro genérico1: \" + ex.getMessage());\n ex.printStackTrace(System.err);\n }\n }\n\n });\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Erro genérico2: \" + e.getMessage());\n }\n }", "@SuppressWarnings(\"unchecked\")\n \n \n private void table(){\n \n int c;\n \n try{\n \n Connection con1 = ConnectionProvider.getConn();\n Statement stm = con1.createStatement();\n ResultSet rst = stm.executeQuery(\"select * from sales\");\n ResultSetMetaData rstm = rst.getMetaData();\n \n c = rstm.getColumnCount();\n \n DefaultTableModel dtm2 = (DefaultTableModel)jTable1.getModel();\n dtm2.setRowCount(0);\n \n while (rst.next()){\n \n Vector vec = new Vector();\n \n for(int a =1 ; a<=c; a++)\n {\n vec.add(rst.getString(\"CustomerName\"));\n vec.add(rst.getString(\"OrderNo\"));\n vec.add(rst.getString(\"TypeOfService\"));\n vec.add(rst.getString(\"OrderType\"));\n vec.add(rst.getString(\"Descript\"));\n vec.add(rst.getString(\"OrderConfirmation\"));\n vec.add(rst.getString(\"OrderHandledBy\"));\n vec.add(rst.getString(\"OrderDate\"));\n vec.add(rst.getString(\"WarrantyExpireDate\"));\n vec.add(rst.getString(\"FullAmount\"));\n vec.add(rst.getString(\"AmountPaid\"));\n vec.add(rst.getString(\"Balance\"));\n }\n \n dtm2.addRow(vec);\n }\n \n }\n catch(Exception e)\n {\n \n }\n \n \n }", "public static void testTalletLige() {\n\n if (20 % 2 == 0) {\n System.out.println(\"** \" + 20 + \" er et lige tal.\");\n }\n else\n System.out.println(\"** \" + 20 + \" er et ulige tal.\");\n }" ]
[ "0.6655999", "0.6379017", "0.6325476", "0.617449", "0.6173534", "0.5924942", "0.5911897", "0.58391774", "0.5821561", "0.58205146", "0.58139694", "0.57840437", "0.5699222", "0.56223816", "0.56059587", "0.5560049", "0.55512834", "0.5532831", "0.5501958", "0.54997903", "0.54979104", "0.54971284", "0.54929864", "0.54926866", "0.54902107", "0.54699004", "0.54626715", "0.5442806", "0.5439645", "0.543725", "0.54249877", "0.54243684", "0.54242426", "0.54229045", "0.5408789", "0.5408609", "0.5406278", "0.5395007", "0.5394341", "0.53936636", "0.5392631", "0.5380916", "0.53797776", "0.53750736", "0.53742564", "0.53715134", "0.53615785", "0.5352334", "0.53515506", "0.5349616", "0.53426915", "0.5339898", "0.5331978", "0.53294975", "0.53271747", "0.53254783", "0.53252864", "0.5308626", "0.53077", "0.53011084", "0.5295804", "0.5294611", "0.52933973", "0.5293126", "0.5292818", "0.5266102", "0.5265932", "0.52658045", "0.52648276", "0.5261495", "0.52586395", "0.5257891", "0.5257891", "0.5256693", "0.52564144", "0.52545524", "0.5253911", "0.5250928", "0.52506167", "0.52503973", "0.5245034", "0.52395576", "0.52348924", "0.5234342", "0.5233072", "0.5226294", "0.5226294", "0.5226294", "0.5226294", "0.5226294", "0.5226294", "0.5223867", "0.5223867", "0.52236927", "0.521827", "0.5216913", "0.5215269", "0.521497", "0.52101964", "0.5203889", "0.5202826" ]
0.0
-1
/ Here you're not overriding Super.foo because it's declared private. If
public void foo() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "@Override\n public boolean isPrivate() {\n return true;\n }", "public void method_6349() {\r\n super.method_6349();\r\n }", "public void method_6191() {\r\n super.method_6191();\r\n }", "@Override\n protected void checkSubclass() {\n }", "private abstract void privateabstract();", "public void method_1449() {\r\n super.method_1449();\r\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "public boolean isSetSuper_priv() {\n return this.__isset.super_priv;\n }", "public void c(int paramInt)\r\n/* 101: */ {\r\n/* 102:122 */ this.b = false;\r\n/* 103:123 */ super.c(paramInt);\r\n/* 104: */ }", "public int b()\r\n/* 45: */ {\r\n/* 46: 58 */ g();\r\n/* 47: */ \r\n/* 48: 60 */ return super.b();\r\n/* 49: */ }", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "private static interface Derived extends Base {\n\n public void foo();\n }", "public void override() {\n isOverridden = true;\n }", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "private static interface Base {\n\n public void foo();\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "public void doSomething() {\n Outer.this.doSomething();\r\n // this stops the pretty printer and gives an\r\n //parser exception (stumbling over the .super)\r\n Outer.super.doSomething();\r\n }", "@Override\n\t\tpublic void visit(int version, int access, String name, String signature, String superName, String[] interfaces) \n\t\t{\n\t\t\tsuper.visit(version, Constants.ACC_PUBLIC, className, (String)null, this.superType.getInternalName(), interfaces);\n\t\t}", "protected void method_3848() {\r\n super.method_3848();\r\n }", "public void doGeneralThings() {\n logger.debug(\"Overrided or implememted method - doGeneralThings!\");\n }", "@Override\r\n protected void checkSubclass() {\n }", "@Override\r\n protected void checkSubclass() {\n }", "@Override\r\n protected void checkSubclass() {\n }", "void fun() {\n\t\tSystem.out.println(\"Overriden Normal Method\");\n\t}", "public static void foo() {\n\t\t\tSystem.out.println(\"Sub foo....\");\n\t\t}", "_ExtendsNotAbstract() {\n super(\"s\"); // needs this if not default ctor;\n }", "@Override\r\n\tpublic void method() {\n\t\tsuper.method();\r\n\t\tSystem.out.println(\"Iam in a subclass\");\r\n\t}", "@Override\n\tpublic void foo() {\n\t\tSystem.out.println(\"Foo from B\");\n\t}", "private Foo() {\n\t\tSystem.out.println(\"Private Constructor.\");\n\t}", "public static void main(String[] args) {\n System.out.println(super.x);\r\n }", "public void myMethod(){\n\t\t\tsuper.myMethod();\n\t\t\tSystem.out.println(\"Overriding method\");\n\t\t }", "@Test\n public void testProtectedAccessForProperties14() {\n test(\n srcs(\n lines(\n \"/** @constructor */ var Foo = function() {};\",\n \"Foo.prototype = { /** @protected */ bar: function() {} }\"),\n lines(\n \"/** @constructor @extends {Foo} */\",\n \"var OtherFoo = function() { this.bar(); };\",\n \"OtherFoo.prototype = { moo() { new Foo().bar(); }};\")));\n }", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\n public void m1() {\n Left.super.m1();\n Right.super.m1();\n System.out.println(\"Over ridden\");\n }", "@Override\n public boolean getAllowPrivateConstructors()\n {\n \treturn allowPrivateConstructors;\n }", "private PropertyAccess() {\n\t\tsuper();\n\t}", "protected void checkSubclass() {\n }", "@Test\n public void testNoPrivateAccessForProperties7() {\n testError(\n srcs(\n \"/** @constructor */ function Foo() {} \"\n + \"/** @private */ Foo.prototype.bar_ = function() {};\"\n + \"/** @constructor \\n * @extends {Foo} */ \"\n + \"function SubFoo() {};\"\n + \"SubFoo.prototype.bar_ = function() {};\",\n \"SubFoo.prototype.baz = function() { this.bar_(); }\"),\n BAD_PRIVATE_PROPERTY_ACCESS);\n }", "@Override\n public void pub() {\n // can only be public\n }", "protected void checkSubclass() {\n }", "protected void checkSubclass() {\n }", "protected void checkSubclass() {\n }", "boolean overrides(MethodDeclaration sub, MethodDeclaration sup);", "@Override\n\tpublic void dosomething2() {\n\t\t\n\t}", "public abstract boolean foo();", "@Override\n\tpublic void some() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tPrivateOverride po = new PrivateOverride();\n\t\t//po.f();\n\t}", "@Override\r\n\tprotected void parentMethod() {\n\t\tsuper.parentMethod();\r\n\t\tSystem.out.println(\"ChildParentMethod\");\r\n\t}", "@Override\n\tpublic void aaa() {\n\t\t\n\t}", "void method() throws RuntimeException \n { \n System.out.println(\"SuperClass\"); \n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "protected void h() {}", "String superGetterCode() {\n return isPrivate ? String.format(\"super.%s()\", getterMethodName) : fieldName;\n }", "public void meow()\n {\n System.out.println(\"I'm little\");\n super.meow();\n }", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void realFun() {\n\n\t}", "private ChainingMethods() {\n // private constructor\n\n }", "@Test\n public void testProtectedAccessForProperties16() {\n test(\n srcs(\n lines(\n \"/** @constructor */ var Foo = function() {};\",\n \"/** @protected */ Foo.prototype.bar = function() {};\"),\n lines(\n \"/** @constructor @extends {Foo} */\",\n \"var OtherFoo = function() { var f = () => this.bar(); };\",\n \"OtherFoo.prototype.baz = function() { return () => this.bar(); };\")));\n }", "public void printSuperValuesWithoutGetters() {\n log.info(super.phone);\n log.info(super.lastName);\n log.info(super.firstName);\n }", "public void avvia() {\n /** invoca il metodo sovrascritto della superclasse */\n super.avvia();\n }", "public /* bridge */ /* synthetic */ void mo55094a() {\n super.mo55094a();\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "public /* bridge */ /* synthetic */ void mo55097d() {\n super.mo55097d();\n }", "private boolean canOverride(MethodJavaSymbol overridee) {\n if (overridee.isPackageVisibility()) {\n return overridee.outermostClass().owner().equals(outermostClass().owner());\n }\n return !overridee.isPrivate();\n }", "protected abstract void _extends( ClassOutlineImpl derived, ClassOutlineImpl base );", "private static boolean needsPrivateLookup(Member m) {\n int classModifiers = m.getDeclaringClass().getModifiers();\n return !((Modifier.isPublic(classModifiers) || Modifier.isProtected(classModifiers)) && Modifier.isPublic(m.getModifiers()));\n }" ]
[ "0.61750126", "0.6150714", "0.60442376", "0.59639025", "0.59120643", "0.5906105", "0.59037155", "0.59037155", "0.59037155", "0.58973086", "0.5872851", "0.58453345", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5837402", "0.5830495", "0.5814369", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5814101", "0.5808891", "0.5805123", "0.5805123", "0.5805123", "0.57819444", "0.5772342", "0.57536155", "0.5749619", "0.574944", "0.574944", "0.574944", "0.57476825", "0.5738232", "0.57022864", "0.56999564", "0.5673536", "0.5639305", "0.56379825", "0.56352365", "0.5633355", "0.5618793", "0.56030387", "0.55840594", "0.55615413", "0.55283904", "0.5523393", "0.55132574", "0.5510947", "0.5510947", "0.5510947", "0.549308", "0.5490257", "0.54872656", "0.54854393", "0.548225", "0.54796416", "0.54537535", "0.5439945", "0.5418631", "0.5410235", "0.5405944", "0.54039", "0.53951204", "0.53946877", "0.53780794", "0.5366569", "0.5361849", "0.5354889", "0.53544414", "0.5337785", "0.5334831", "0.53306216", "0.53294307", "0.53262603", "0.5314457" ]
0.58780134
10
TODO Autogenerated method stub
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try(PrintWriter out= response.getWriter()){ String user=request.getParameter("user"); String pass=request.getParameter("pass"); SessionFactory sf = new Configuration().configure().buildSessionFactory(); Session session = sf.openSession(); session.beginTransaction(); Query query = session.createQuery("select count(*) from details where login.username=:user and login.password=:pass"); session.close(); } }
{ "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
Method to check if the current credit card transaction is fraud
private boolean isFraudTransaction(final CreditCardTransactionDTO currentCCTransaction, final TransactionSummary previousTransactionSummary) { removeOutdatedTransactions(currentCCTransaction, previousTransactionSummary); final BigDecimal newTransactionsAmount = previousTransactionSummary.getTotalAmount().add(currentCCTransaction.getAmount()); return newTransactionsAmount.compareTo(fraudConfig.getAmount()) > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isBankrupt() {\n\t\tif (money < 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean isCreditCardIsSingleAvailablePayment();", "public boolean fundTransfer(int accountNumber, float amount) {\n\t\treturn dao.fundTransfer(accountNumber,amount);\r\n\t}", "public boolean getIsValidInquiryAttempt() {\r\n if (getInvalidCardErrorCount() >= getMaxNumErrorsPerSession()) {\r\n if (getInvalidCardErrorCount() == getMaxNumErrorsPerSession()) {\r\n getGiftCardLogger().logActivity(getCurrentUserIP(), \"GIFT CARD INQUIRY\");\r\n setInvalidCardErrorCount(getInvalidCardErrorCount() + 1);\r\n }\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public boolean verifyChargesRow(){\n\t\tboolean isPatientResponsible=false;\n\t\tSeleniumUtil.switchToFrame(driver, \"fraCharges_Frame\");\n\t\tString textval=SeleniumUtil.getElementWithFluentWait(responsibleValue).getText();\n\t\tif(textval.equalsIgnoreCase(\"Patient\")){\n\t\t\tSystem.out.println(\"patient is responsible for charges\");\n\t\t\tisPatientResponsible=true;\n\t\t}\n\t\treturn isPatientResponsible;\t\n\t}", "public boolean isPendingAcctSufficientFundsIndicator() {\n return pendingAcctSufficientFundsIndicator;\n }", "public boolean isDisbVchrDepositAccount() {\n return disbVchrDepositAccount;\n }", "boolean hasAlreadCheckCard();", "public boolean hasAmountF() {\n return amountF_ != null;\n }", "protected boolean isTransferTransactionValidEx(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// to account can be added to the state, asset type logic is questionable\n\t\t\t\n\t\t\tAccountBase account = new AccountBase(\n\t\t\t\t\t((StateTransferTransaction)tr).from,\n\t\t\t\t\t((StateTransferTransaction)tr).getNonce(),\n\t\t\t\t\t\"\",\n\t\t\t\t\t((StateTransferTransaction)tr).amount,\n\t\t\t\t\taccountFromModify.getAssetType());\t\n\t\t\taccounts.add(account);\n\t\t\t\n\t\t\taccountToIsGood = true;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "protected boolean isTransferTransactionValid(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The to account does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "boolean hasAllowedCredit();", "public boolean isBalanced ();", "boolean hasAccountBudget();", "boolean investmentIsBondListFull() throws BankException {\n logger.warning(\"This account does not support this feature\");\n throw new BankException(\"This account does not support this feature\");\n }", "boolean hasPlainRedeem();", "public boolean getAccountHasWithdrawLimit(){\n if (currentAccount instanceof SavingAccount){\n return ((SavingAccount)currentAccount).getHasWithdrawLimit();\n \n }\n else if (currentAccount instanceof NetSavingAccount){\n return ((NetSavingAccount)currentAccount).getHasWithdrawLimit();\n }\n else if (currentAccount instanceof ChequeAccount){\n return ((ChequeAccount)currentAccount).getHasWithdrawLimit(); \n }\n else if (currentAccount instanceof FixedAccount){\n return ((FixedAccount)currentAccount).getHasWithdrawLimit();\n }\n else{\n System.out.println(\"Get Account WithdrawLimit (Bool) Account not found\");\n return false;\n }\n }", "public boolean getIsInValidGiftCardAttempts() {\r\n if (getInvalidCardErrorCount() > getMaxInvalidGiftCardAttempts()) {\r\n getGiftCardLogger().logActivity(getCurrentUserIP(), \"INVALID GIFT CARD ATTEMPT\");\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean isFinPreencumSufficientFundIndicator() {\n return finPreencumSufficientFundIndicator;\n }", "@Override\r\n\tpublic boolean fundTransfer(FundTransferBean fb, double amount) {\n\t\tboolean isValid = true;\r\n\t\tfor (CustomerBean cb1 : customerList) {\r\n\t\t\tif(cb1.getPhoneNum()== fb.getSourcePhoneNum()) {\r\n\t\t\t\tfor (CustomerBean cb2 : customerList) {\r\n\t\t\t\t\tif(cb2.getPhoneNum()==fb.getDesPhoneNum()) {\r\n\t\t\t\t\t\twithdraw(cb1,amount);\r\n\t\t\t\t\t\tdeposit(cb2,amount);\r\n\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\t\telse {\r\n\t\t\t\tthrow new WalletException();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "public boolean hasFundCode() {\n return result.hasFundCode();\n }", "boolean hasLedger();", "boolean hasAlreadFoldCard();", "public boolean isAccountsFringesBnftIndicator() {\n return accountsFringesBnftIndicator;\n }", "boolean isAutoRedeem();", "public boolean isDeclined()\n\t{\n\t\tif(response.containsKey(\"Result\")) {\n\t\t\tif(response.get(\"Result\").equals(\"DECLINED\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isBancrupt(){\r\n \treturn _budget <= 0;\r\n }", "public boolean isPaymentMethodCodeBankTransfer() {\n AppCDef.PaymentMethod cdef = getPaymentMethodCodeAsPaymentMethod();\n return cdef != null ? cdef.equals(AppCDef.PaymentMethod.BankTransfer) : false;\n }", "public boolean isNonFundedBuyer(Integer buyerId);", "public boolean checkBalance() {\n checkBalanceHelper(root);\n if (unbalanced == null) {\n return true;\n } else {\n return false;\n }\n }", "public abstract boolean isBalanced();", "public boolean verifyPatientBalance(){\n\t\tboolean ispatientbalance=false;\n\t\tdriver.switchTo().frame(\"panProfile_Frame\");\n\t\tsleep(5000);\n\t\tString patienttext =SeleniumUtil.getElementWithFluentWait(patientBalance).getText();\n\t\tSystem.out.println(patienttext);\n\t\tString text =SeleniumUtil.getElementWithFluentWait(patientBalanceValue).getText();\n\t\tSystem.out.println(text);\n\t\tif(patienttext!=null && text!=null ){\n\t\t\tispatientbalance=true;\n\t\t}\n\t\treturn ispatientbalance;\n\t}", "private boolean isOutdatedTransaction(final TransactionModel transactionToBeChecked, final CreditCardTransactionDTO currentCCTransaction) {\n final long difference = DateTimeUtil.getTimeDifference(fraudConfig.getChronoUnit(), transactionToBeChecked.getTimestamp(), currentCCTransaction.getTimestamp());\n return difference > fraudConfig.getWindow();\n }", "@ApiModelProperty(value = \"Was order made within a fraud zone\")\n public Boolean isInFraudZone() {\n return inFraudZone;\n }", "boolean CanBuyDevCard();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "public Boolean isPrimaryCreditCard();", "public boolean isValidTransfer(double amount) {\n boolean amt = amount >= 0;\n boolean bal = false;\n if (amount <= this.balance + 100 && this.balance > 0) {\n bal = true;\n }\n return amt && bal && !isFreeze();\n }", "boolean hasFump();", "boolean hasPayment();", "boolean hasPayment();", "public boolean canTakeCharge();", "public boolean isFurnace() {\n return this.type == Type.FURNACE;\n }", "public boolean hasAmountF() {\n return amountFBuilder_ != null || amountF_ != null;\n }", "public boolean hasBlackjack()\n {\n return getSumOfCards(false) == 21;\n }", "public boolean hasBust()\n {\n return getSumOfCards(false) > 21;\n }", "boolean isAccepting();", "Boolean getFixedSettlement();", "boolean isAccountNonExpired();", "boolean isAccountNonExpired();", "boolean hasPassCardsResponse();", "public boolean checkIfEnough(Account account, float amount) {\n float remaining = account.getBalance() - amount;\n if (remaining >= 0) {\n return true;\n }\n return false;\n }", "public boolean hasLedger() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean hasLedger() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean isOverdrawn() {\n return balance < 0;\n }", "boolean hasAlreadShowCard();", "private boolean checkIfTransactionIsPossible(Account sender, Account receiver){\n if ((sender.getType() == Account.TypeEnum.SAVING) || (receiver.getType() == Account.TypeEnum.SAVING) ){\n // one cannot directly transfer from a savings account to an account that is not of the same customer\n if (sender.getOwnerId() == receiver.getOwnerId()) {\n if (!sender.getIBAN().equals(receiver.getIBAN())) {\n return true;\n } else {\n throw new IllegalArgumentException(\"Accounts sender and receiver cannot be the same account\");\n }\n } else {\n throw new IllegalArgumentException(\"Saving Accounts sender or receiver cannot belong to different customers\");\n }\n }\n //if senderAccount is Checking, can send money to other checking account or his own saving account\n else if(sender.getType() == Account.TypeEnum.CHECKING){\n if (!sender.getIBAN().equals(receiver.getIBAN())) {\n return true;\n } else {\n throw new IllegalArgumentException(\"Accounts sender and receiver cannot be the same account\");\n }\n }\n return false;\n }", "boolean hasAccountBudgetProposal();", "public boolean withdrawAmount(float amount) {\n\t\treturn dao.withdrawAmount(amount);\r\n\t}", "boolean hasReqardTypeFifteen();", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkBluetooth() {\n\t\tboolean flag = oTest.checkBluetooth();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "boolean hasCardType();", "public boolean depositAmount(float amount) {\n\t\treturn dao.depositAmount(amount);\r\n\t}", "private boolean DeriveStockWith_FundIsAvailable() {\n\t\tif (getFunds() > 0) {\n\t\t\tif (calculateInputStock_Items() > getFunds()) {\n\t\t\t\tSystem.err.println(\"Insufficient Funds, Cannot restock\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t\t// available funds can accommodate input stock requirement\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.err.println(\"Insufficient Funds\");\n\t\t}\n\t\treturn false;\n\t}", "boolean hasDidcommInvitation();", "protected abstract boolean isCardActivatable(Card card);", "public boolean isExpired(){\r\n float empty = 0.0f;\r\n return empty == getAmount();\r\n \r\n }", "@Override\r\n\tpublic boolean deopsit(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tbalance = (float) (balance + amount);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "public boolean disattiva_account()\n {\n boolean d=true;//variabile per disattivare l'account\n //già messa a true in quanto l'account viene attualmente usato\n int scelta;\n \n System.out.println(\"--Vuoi disattivare l'account?\\n[1] si [0] no\");\n scelta=input.nextInt();\n \n if(scelta==1)\n { \n d=false;\n System.out.println(\"--Attenzione account disattivato--\");\n }\n \n else if(scelta==0)\n { \n System.out.println(\"--Puoi usare ancora il tuo account--\");\n }\n \n else \n System.out.println(\"Impossibile eseguire l'operazione scelta\");\n \n return d;\n }", "boolean hasAmount();", "boolean hasAmount();", "public boolean hasDefense() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "public void checkCreditCard() throws BusinessException;", "@Override\r\n\t@Transactional\r\n\tpublic boolean disapproveCreditCard(BigInteger cardNumber) throws IBSExceptions {\n\t\tboolean result = false;\r\n\t\tif (bankRepresentativeDAO.decliningCreditCardDetails(cardNumber)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private static boolean isValidBalance(float balance) {\n\t\tif(balance < 0) {\r\n\t\t\tSystem.out.println(\"Not a valid balance\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse return true;\r\n\t}", "public boolean hasDefense() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "boolean isConfirmed();", "@Override\n public boolean deposit(Account account, BigDecimal amount) {\n return false;\n }", "@Override\r\n\tpublic boolean withdraw(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tif (balance > amount) {\r\n\t\t\t\t\tbalance = (float) (balance - amount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InsufficientBalanceException(\"You'er Balance is insufficient to make this transation !\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean hasDefense() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "boolean hasTransactionAmountMicros();", "public boolean canWithdraw(double withdrawalAmount){\n double potentialAmountOwed = withdrawalAmount + Math.abs(super.getCurrentBalance());\n if(potentialAmountOwed < creditLine) return true;\n \n return false;\n }", "public boolean hasDefense() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean isFine();", "boolean hasTradingAccount();", "boolean hasCampaignBudget();", "public boolean isApplicable(DevelopmentCard card) {\n\t\treturn (this.familyMember.getActionValue()\n\t\t\t\t+ this.getPlayer().getBonuses().getActivationVariation(card.getCardType())\n\t\t\t\t+ paidServants >= card.getActivationCost());\n\t}", "boolean check(double amount) {\n\t\treturn (balance >= amount);\n\t}", "public boolean withdraw(float amount) {\r\n\t\tif (amount > 0.0f) {\t\t\r\n\t\t\t// KG: incorrect, last balance check should be >=\r\n\t\t\tif (getState() == State.OPEN || (getState() == State.OVERDRAWN && balance > -100.0f)) {\r\n\t\t\t\tbalance = balance - amount;\r\n\t\t\t\t_numWithdraws++;\r\n\t\t\t\tif (_numWithdraws > 10)\r\n\t\t\t\t\tbalance = balance - 2.0f;\r\n\t\t\t\tif (balance < 0.0f) {\r\n\t\t\t\t\tsetState(State.OVERDRAWN);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean checkAccountClosed() {\n return this.accountStatus == \"Closed\";\n }", "public boolean debit(double amount) throws InsufficientFundsException,InvalidAmountException {\r\n\t\tif (getAmount() + overdraftBalance < amount){\r\n\t\t\tthrow new InsufficientFundsException(\"Insufficient funds to withdraw the amount.\");\r\n\t\t}\r\n\t\tif (amount <= 0){\r\n throw new InvalidAmountException(\"Amount can't be negative or 0.\");\r\n }\r\n\t\tsetAmount(getAmount() - amount);\r\n\t\tthis.setCountVal(this.getCountVal() + 1);\r\n return true;\r\n\t}", "boolean hasBidrequest();", "public int checkEND(int amount, boolean burnStun);", "boolean CanBuySettlement();" ]
[ "0.6535635", "0.6382978", "0.6312592", "0.6249548", "0.6248146", "0.62092245", "0.61255795", "0.612452", "0.6123794", "0.6111298", "0.60954446", "0.60906565", "0.6080113", "0.60429806", "0.6031177", "0.60106605", "0.6008507", "0.600629", "0.59960264", "0.5990319", "0.5965502", "0.59643096", "0.5944119", "0.5931684", "0.59187376", "0.59121865", "0.5910536", "0.5884398", "0.58763516", "0.58726615", "0.5849439", "0.5828786", "0.5828151", "0.5820048", "0.57906747", "0.5787598", "0.5787598", "0.5787598", "0.5787598", "0.5787598", "0.5787598", "0.57871175", "0.5785376", "0.57843053", "0.5777422", "0.5777422", "0.57640404", "0.5757742", "0.57300967", "0.57117325", "0.57063615", "0.56792724", "0.5677729", "0.56685084", "0.56685084", "0.5655308", "0.5652223", "0.56455207", "0.56256485", "0.5622527", "0.56170774", "0.5607123", "0.5597664", "0.5595621", "0.5594511", "0.5594424", "0.55930126", "0.559075", "0.55872345", "0.5575924", "0.557575", "0.5575117", "0.5567985", "0.5562698", "0.55584586", "0.55472994", "0.55472994", "0.55466074", "0.5540324", "0.5539775", "0.55383795", "0.55313545", "0.5530806", "0.5522894", "0.5519597", "0.5512866", "0.5510633", "0.55070037", "0.5494893", "0.54855156", "0.5484058", "0.54828155", "0.5481417", "0.5479452", "0.5473309", "0.54711974", "0.5466529", "0.5464002", "0.54639345", "0.5463459" ]
0.7261946
0
Method to remove the outdated transactions which are out of the fraud window from the previous transaction list captured. This will ensure only the transactions relevant to the fraud window are stored and used for the fraud detection for efficient memory usage and performance.
private void removeOutdatedTransactions(final CreditCardTransactionDTO currentCCTransaction, final TransactionSummary previousTransactionSummary) { final SortedSet<TransactionModel> transactions = previousTransactionSummary.getTransactions(); BigDecimal amountToBeReduced = BigDecimal.valueOf(Constants.ZERO); for (final Iterator<TransactionModel> iterator = transactions.iterator(); iterator.hasNext(); ) { final TransactionModel transaction = iterator.next(); if (isOutdatedTransaction(transaction, currentCCTransaction)) { amountToBeReduced = amountToBeReduced.add(transaction.getAmount()); iterator.remove(); } else { break; } } if (amountToBeReduced.compareTo(BigDecimal.valueOf(Constants.ZERO)) != 0) { updateTransactionSummary(currentCCTransaction, transactions, previousTransactionSummary.getTotalAmount().subtract(amountToBeReduced)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void cleanUpOlderRevisions() {\n\n // We're no longer using the source revision.\n final long priorOldestRevisionInUse = sourceRevisionsInUse.peek();\n sourceRevisionsInUse.remove( this.sourceRevisionNumber );\n\n // Determine the oldest revision still needed.\n Long oldestRevisionInUse = sourceRevisionsInUse.peek();\n if ( oldestRevisionInUse == null ) {\n oldestRevisionInUse = priorOldestRevisionInUse;\n }\n\n // Remove each transaction awaiting clean up that has a target revision number older than needed.\n AtomicReference<StmTransaction> tref = firstTransactionAwaitingCleanUp;\n StmTransaction t = tref.get();\n if ( t == null ) {\n return;\n }\n\n AtomicReference<StmTransaction> trefNext = t.nextTransactionAwaitingCleanUp;\n StmTransaction tNext = trefNext.get();\n\n while ( true ) {\n if ( t.targetRevisionNumber.get() <= oldestRevisionInUse ) {\n if ( tref.compareAndSet( t, tNext ) ) {\n // Remove revisions older than the now unused revision number.\n t.removeUnusedRevisions();\n t.nextTransactionAwaitingCleanUp.set( null );\n }\n }\n else {\n tref = trefNext;\n }\n\n // Advance through the list of transactions awaiting clean up.\n t = tref.get();\n if ( t == null ) {\n return;\n }\n trefNext = t.nextTransactionAwaitingCleanUp;\n tNext = trefNext.get();\n }\n\n }", "synchronized public List<StickyRecord> removeExpired()\n {\n List<StickyRecord> removed = new ArrayList();\n long now = System.currentTimeMillis();\n Iterator<StickyRecord> i = _records.values().iterator();\n while (i.hasNext()) {\n StickyRecord record = i.next();\n if (!record.isValidAt(now)) {\n i.remove();\n removed.add(record);\n }\n }\n return removed;\n }", "private void getDetailedDebitAgingOLDEST(List<DebtorsDetailedAgingHelper> agingList, Date atDate, EMCUserData userData) {\n getDetailedDebitAgingNONE(agingList, atDate, userData);\n\n //Aging lines to remove\n //List<DebtorsDetailedAgingLineDS> toRemove = new ArrayList<DebtorsDetailedAgingLineDS>();\n\n //All credits\n List<DebtorsDetailedAgingLineDS> credits = new ArrayList<DebtorsDetailedAgingLineDS>();\n //All debits\n List<DebtorsDetailedAgingLineDS> debits = new ArrayList<DebtorsDetailedAgingLineDS>();\n\n for (DebtorsDetailedAgingHelper agingHelper : agingList) {\n for (DebtorsDetailedAgingLineDS agingLine : agingHelper.getAgingLines()) {\n if (agingLine.getAmount().compareTo(BigDecimal.ZERO) < 0) {\n //Credit\n credits.add(agingLine);\n } else {\n //Debit\n debits.add(agingLine);\n }\n }\n }\n\n//Start allocating from oldest credits.\ncredit: for (DebtorsDetailedAgingLineDS credit : credits) {\n if (credit.getBalance().compareTo(BigDecimal.ZERO) != 0) {\n//Loop through debits\ndebit: for (DebtorsDetailedAgingLineDS debit : debits) {\n if (debit.getBalance().compareTo(BigDecimal.ZERO) != 0) {\n //Get difference between debit and credit balances.\n BigDecimal difference = debit.getBalance().add(credit.getBalance());\n if (difference.compareTo(BigDecimal.ZERO) > 0) {\n //Debit greater than credit. Allocate credit in full.\n debit.setBalance(debit.getBalance().add(credit.getBalance()));\n credit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(credit);\n\n //Credit consumed. Continue outer loop.\n continue credit;\n } else if (difference.compareTo(BigDecimal.ZERO) < 0) {\n //Credit greater than debit.\n credit.setBalance(credit.getBalance().add(debit.getBalance()));\n debit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(debit);\n\n //Debit consumed\n continue;\n } else {\n //Debit == credit. Consume both.\n debit.setBalance(BigDecimal.ZERO);\n credit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(credit);\n //toRemove.add(debit);\n\n //Credit consumed. Continue outer loop.\n continue credit;\n }\n } else {\n //Credit, continue to next line.\n continue;\n }\n }\n } else {\n //Debit, continue to next line\n continue;\n }\n }\n\n //Try to remove all records from all bins.\n //TODO: Is there a more efficient way?\n //for (DebtorsDetailedAgingHelper agingHelper : agingList) {\n // agingHelper.getAgingLines().removeAll(toRemove);\n //}\n }", "public void removeFinArFundsInActionAppliedHistory(FinArFundsInActionAppliedHistory finArFundsInActionAppliedHistory);", "private void cleanUpConsumedEsnRecords() {\n\t\tesnInfoRepository.findAllByIsConsumed(true).removeIf(item -> (Days\n\t\t\t\t.daysBetween(new DateTime(item.getDateImported()), new DateTime()).isGreaterThan(Days.days(30))));\n\t}", "public void removeFinArFundsInActionAppliedHistoryList(List<FinArFundsInActionAppliedHistory> finArFundsInActionAppliedHistoryList);", "public void cleanUp() {\n logger.info(\"clean up...\");\n this.sequenceNo = calculateSequenceNumber();\n if (this.prevoteStore != null) {\n this.prevoteStore = this.prevoteStore.stream()\n .filter(i -> i.sequence_no >= this.sequenceNo)\n .collect(Collectors.toCollection(ArrayList::new));\n } else {\n this.prevoteStore = new ArrayList<>();\n }\n }", "@Override\n public List<PooledTransaction> removeTxsWithNonceLessThan(Map<AionAddress, BigInteger> accNonce) {\n\n List<ByteArrayWrapper> bwList = new ArrayList<>();\n for (Map.Entry<AionAddress, BigInteger> en1 : accNonce.entrySet()) {\n AccountState as = this.getAccView(en1.getKey());\n lock.writeLock().lock();\n Iterator<Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>>>\n it = as.getMap().entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>> en =\n it.next();\n if (en1.getValue().compareTo(en.getKey()) > 0) {\n bwList.add(en.getValue().getKey());\n it.remove();\n } else {\n break;\n }\n }\n lock.writeLock().unlock();\n\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (this.getPoolStateView(en1.getKey()) != null) {\n this.getPoolStateView(en1.getKey())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(en1.getKey()));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n as.setDirty();\n }\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n bwList.parallelStream()\n .forEach(\n bw -> {\n if (this.getMainMap().get(bw) != null) {\n PooledTransaction pooledTx = this.getMainMap().get(bw).getTx();\n removedTxl.add(pooledTx);\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n synchronized (this.getTimeView().get(timestamp)) {\n if (this.getTimeView().get(timestamp) == null) {\n LOG.error(\n \"Txpool.remove can't find the timestamp in the map [{}]\",\n pooledTx.toString());\n return;\n }\n\n this.getTimeView().get(timestamp).remove(bw);\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n\n lock.writeLock().lock();\n this.getMainMap().remove(bw);\n lock.writeLock().unlock();\n }\n });\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"TxPoolA0.remove {} TX\", removedTxl.size());\n }\n\n return removedTxl;\n }", "private void removeOutOfDateData(List<DetailedData> detailedDatas)\n {\n for (Iterator<DetailedData> it = detailedDatas.iterator(); it.hasNext();)\n {\n DetailedData data = it.next();\n if (TuvState.OUT_OF_DATE.getName().equalsIgnoreCase(data.getState()))\n {\n it.remove();\n }\n }\n }", "public void deleteCopiedPendingLedgerEntries();", "private void removeUnusedRevisions() {\n\n // Remove all revisions older than the one written by this transaction.\n final long oldestUsableRevisionNumber = this.targetRevisionNumber.get();\n for ( AbstractVersionedItem versionedItem : this.versionedItemsWritten ) {\n versionedItem.removeUnusedRevisions( oldestUsableRevisionNumber );\n }\n\n // Stop referencing the versioned items.\n this.versionedItemsWritten.clear();\n\n }", "public void removeOldRecords();", "protected void removeOldData() {\n if (!storage.isEmpty()) {\n long timeLowerbound = storage.lastKey() - maxStorageTime;\n while (!storage.isEmpty() && storage.firstKey() < timeLowerbound) {\n storage.pollFirstEntry();\n } \n }\n }", "public void clean() {\n Long now = System.currentTimeMillis();\n for (Iterator<Long> iterator = this.deleted.iterator(); iterator.hasNext();) {\n Long l = iterator.next();\n if (l < now) {\n iterator.remove();\n }\n }\n }", "protected void removeIneffectiveRecords(List<BusRecord> busRecords) {\n List<BusRecord> recordsToRemove = new ArrayList<>();\n BusRecord firstRecord = busRecords.get(0);\n\n for (BusRecord secondRecord : busRecords.subList(1, busRecords.size())) {\n if (!firstRecord.getBusCompany().equals(secondRecord.getBusCompany())) {\n firstRecord = secondRecord;\n continue;\n }\n // If it starts at the same time and reaches earlier\n if (isStartsAtSameTime(firstRecord, secondRecord)) {\n if (isArriveEarlier(firstRecord, secondRecord)) {\n recordsToRemove.add(secondRecord);\n } else {\n recordsToRemove.add(firstRecord);\n firstRecord = secondRecord;\n }\n continue;\n }\n // If it starts later and reaches at the same time\n if (isStartsLater(secondRecord, firstRecord) && isArriveAtSameTime(secondRecord, firstRecord)) {\n recordsToRemove.add(firstRecord);\n }\n // If it starts later and reaches earlier\n if (isStartsLater(secondRecord, firstRecord) && isArriveEarlier(secondRecord, firstRecord)) {\n recordsToRemove.add(firstRecord);\n }\n firstRecord = secondRecord;\n }\n busRecords.removeAll(recordsToRemove);\n }", "@Override\n public List<PooledTransaction> remove(List<PooledTransaction> pooledTxs) {\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n Set<AionAddress> checkedAddress = Collections.synchronizedSet(new HashSet<>());\n\n for (PooledTransaction pooledTx : pooledTxs) {\n ByteArrayWrapper bw = ByteArrayWrapper.wrap(pooledTx.tx.getTransactionHash());\n lock.writeLock().lock();\n try {\n if (this.getMainMap().remove(bw) == null) {\n continue;\n }\n } finally {\n lock.writeLock().unlock();\n }\n\n removedTxl.add(pooledTx);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"TxPoolA0.remove:[{}] nonce:[{}]\",\n ByteUtil.toHexString(pooledTx.tx.getTransactionHash()),\n pooledTx.tx.getNonceBI().toString());\n }\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n if (this.getTimeView().get(timestamp) != null) {\n if (this.getTimeView().get(timestamp).remove(bw)) {\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n }\n\n // remove the all transactions belong to the given address in the feeView\n AionAddress address = pooledTx.tx.getSenderAddress();\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (!checkedAddress.contains(address)) {\n\n if (this.getPoolStateView(pooledTx.tx.getSenderAddress()) != null) {\n this.getPoolStateView(pooledTx.tx.getSenderAddress())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(address));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n checkedAddress.add(address);\n }\n\n AccountState as = this.getAccView(pooledTx.tx.getSenderAddress());\n\n lock.writeLock().lock();\n as.getMap().remove(pooledTx.tx.getNonceBI());\n lock.writeLock().unlock();\n\n as.setDirty();\n }\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"TxPoolA0.remove TX remove [{}] removed [{}]\", pooledTxs.size(), removedTxl.size());\n }\n\n return removedTxl;\n }", "private void reallocateUnConsumedEsnRecords() {\n\t\tesnInfoRepository\n\t\t\t\t.findAllByIsConsumed(false).stream().filter(item -> (Days\n\t\t\t\t\t\t.daysBetween(new DateTime(item.getDateClaimed()), new DateTime()).isGreaterThan(Days.days(2))))\n\t\t\t\t.forEach(item -> {\n\t\t\t\t\titem.setUserClaimed(null);\n\t\t\t\t\titem.setDateClaimed(null);\n\t\t\t\t});\n\t}", "public static void getTransactionsAndDeleteAfterCancel() {\n // get DB helper\n mDbHelper = PointOfSaleDb.getInstance(context);\n\n // Each row in the list stores amount and date of transaction -- retrieves history from DB\n SQLiteDatabase db = mDbHelper.getReadableDatabase();\n\n // get the following columns:\n String[] tableColumns = { PointOfSaleDb.TRANSACTIONS_COLUMN_CREATED_AT,\n \"_ROWID_\"};// getting also _ROWID_ to delete the selected tx\n\n String sortOrder = PointOfSaleDb.TRANSACTIONS_COLUMN_CREATED_AT + \" DESC\";\n Cursor c = db.query(PointOfSaleDb.TRANSACTIONS_TABLE_NAME, tableColumns, null, null, null, null, sortOrder);\n //moving to first position to get last created transaction\n if(c.moveToFirst()) {\n int rowId = Integer.parseInt(c.getString(1));\n\n String selection = \"_ROWID_\" + \" = ? \";\n String[] selectionArgs = {String.valueOf(rowId)};\n int count = db.delete(PointOfSaleDb.TRANSACTIONS_TABLE_NAME, selection, selectionArgs);\n\n //send broadcast to update view\n sendBroadcast();\n }\n\n }", "private void DeleteBurnInsOnPreviousSamples() {\n\t\tif (gibbs_sample_num <= num_gibbs_burn_in + 1 && gibbs_sample_num >= 2){\n\t\t\tgibbs_samples_of_bart_trees[gibbs_sample_num - 2] = null;\n\t\t}\n\t}", "private void clearTransactions() {\n transactions_ = emptyProtobufList();\n }", "private void cleanSweep(){\n // Corrects the reminder dates for those reminders which will be repeating.\n refreshAllRepeatReminderDates();\n\n // Starts removing expired reminders.\n Calendar timeRightNow = Calendar.getInstance();\n boolean cleanList;\n for (int outerCounter=0; outerCounter<reminderItems.size();outerCounter++) {\n cleanList=true;\n for (int counter = 0; counter < reminderItems.size(); counter++) {\n int year = reminderItems.get(counter).getReminderYear();\n int month = reminderItems.get(counter).getReminderMonth();\n int day = reminderItems.get(counter).getReminderDay();\n int hour = reminderItems.get(counter).getReminderHour();\n int minute = reminderItems.get(counter).getReminderMinute();\n int second = 0;\n\n Calendar timeOfDeletion = Calendar.getInstance();\n timeOfDeletion.set(year, month, day, hour, minute, second);\n\n if (timeOfDeletion.before(timeRightNow)) {\n deleteReminderItem(counter);\n cleanList=false;\n break;\n }\n }\n if(cleanList){\n break;\n }\n }\n\n // Refreshes the reminder date descriptions (correcting \"Today\" and \"Tomorrow\" depending on the date).\n refreshAllDateDescriptions();\n }", "private boolean isOutdatedTransaction(final TransactionModel transactionToBeChecked, final CreditCardTransactionDTO currentCCTransaction) {\n final long difference = DateTimeUtil.getTimeDifference(fraudConfig.getChronoUnit(), transactionToBeChecked.getTimestamp(), currentCCTransaction.getTimestamp());\n return difference > fraudConfig.getWindow();\n }", "private void removeExistingMeasurementsFromCurrentDate(Treatment treatment, Vital vitalToSync) {\n logger.info(String.format(CLEANING_EXISTING_MEASUREMENTS_FOR_TODAY_S, getCurrentDate()));\n final VitalsSynchronization vitalsSynchronization = getVitalsSynchronization(treatment);\n final VitalMeasurement vitalMeasurement = getVitalMeasurement(vitalToSync, vitalsSynchronization);\n if (vitalMeasurement.getMeasurements() != null && !vitalMeasurement.getMeasurements().isEmpty()) {\n final List<Measurement> measurementsFromCurrentDate = vitalMeasurement.getMeasurements().stream().filter(measurement -> measurement.getDate().compareTo(getCurrentDate()) == 0).collect(Collectors.toList());\n for (Measurement measurementToDelete : measurementsFromCurrentDate) {\n logger.info(String.format(REMOVING_MEASUREMENT_S, measurementToDelete.toString()));\n vitalMeasurement.getMeasurements().remove(measurementToDelete);\n }\n }\n }", "public void removeVenTransactionFeeList(List<VenTransactionFee> venTransactionFeeList);", "private void pruneExpiredQueries()\n {\n if (expirationQueue.size() <= maxQueryHistory) {\n return;\n }\n\n int count = 0;\n // we're willing to keep full info for up to maxQueryHistory queries\n for (QueryExecution query : expirationQueue) {\n if (expirationQueue.size() - count <= maxQueryHistory) {\n break;\n }\n query.pruneInfo();\n count++;\n }\n }", "private void checkReservationValidityAndRemove(){\n\t\t\n\t\tfor (Reservation r: reservationArray){\n\t\t\tif (r.getBookingDateAndTime().get(Calendar.DAY_OF_MONTH)==Calendar.getInstance().get(Calendar.DAY_OF_MONTH)){\n\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MONTH)==Calendar.getInstance().get(Calendar.MONTH)){\n\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.HOUR_OF_DAY)==Calendar.getInstance().get(Calendar.HOUR_OF_DAY)){\n\t\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MINUTE) > 30 + r.getBookingDateAndTime().get(Calendar.MINUTE) ){\n\t\t\t\t\t\t\treservationArray.remove(r);\n\t\t\t\t\t\t\ttablemanager.increaseAvailable();;\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}", "private void getDetailedDebitAgingDATE(List<DebtorsDetailedAgingHelper> agingList, Date atDate, EMCUserData userData) {\n getDetailedDebitAgingNONE(agingList, atDate, userData);\n\n for (DebtorsDetailedAgingHelper agingHelper : agingList) {\n//Lines to be removed from aging helper. (Transactions allocated in full) These should be ignored while processing.\n//List<DebtorsDetailedAgingLineDS> toRemove = new ArrayList<DebtorsDetailedAgingLineDS>();\n\n//Get all debit and credit transactions in date range and allocate. Allocate credits to debits.\n//The list of aging lines will be ordered by date.\ncredit: for (DebtorsDetailedAgingLineDS agingLine : agingHelper.getAgingLines()) {\n if (agingLine.getAmount().compareTo(BigDecimal.ZERO) < 0 && agingLine.getBalance().compareTo(BigDecimal.ZERO) != 0) {\n DebtorsDetailedAgingLineDS credit = agingLine;\n\n//Loop again, looking for debits\ndebit: for (DebtorsDetailedAgingLineDS otherAgingLine : agingHelper.getAgingLines()) {\n if (otherAgingLine.getAmount().compareTo(BigDecimal.ZERO) < 0 && otherAgingLine.getBalance().compareTo(BigDecimal.ZERO) != 0) {\n DebtorsDetailedAgingLineDS debit = otherAgingLine;\n\n //Get difference between debit and credit balances.\n BigDecimal difference = debit.getBalance().add(credit.getBalance());\n if (difference.compareTo(BigDecimal.ZERO) > 0) {\n //Debit greater than credit. Allocate credit in full.\n credit.setBalance(BigDecimal.ZERO);\n debit.setBalance(debit.getBalance().add(credit.getBalance()));\n\n //toRemove.add(credit);\n\n //Credit consumed. Continue outer loop.\n continue credit;\n } else if (difference.compareTo(BigDecimal.ZERO) < 0) {\n //Credit greater than debit.\n debit.setBalance(BigDecimal.ZERO);\n credit.setBalance(credit.getBalance().subtract(debit.getBalance()));\n\n //toRemove.add(debit);\n\n //Debit consumed\n continue;\n } else {\n //Debit == credit. Consume both.\n debit.setBalance(BigDecimal.ZERO);\n credit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(credit);\n //toRemove.add(debit);\n\n //Credit consumed. Continue outer loop.\n continue credit;\n }\n } else {\n //Credit, continue to next line.\n continue;\n }\n }\n } else {\n //Debit, continue to next line\n continue;\n }\n }\n\n //Remove balanced lines.\n //agingHelper.getAgingLines().removeAll(toRemove);\n }\n }", "void combineAndCollectSnapshotBlocks(\n INode.ReclaimContext reclaimContext, INodeFile file, FileDiff removed) {\n BlockInfo[] removedBlocks = removed.getBlocks();\n if (removedBlocks == null) {\n FileWithSnapshotFeature sf = file.getFileWithSnapshotFeature();\n assert sf != null : \"FileWithSnapshotFeature is null\";\n if(sf.isCurrentFileDeleted())\n sf.collectBlocksAndClear(reclaimContext, file);\n return;\n }\n int p = getPrior(removed.getSnapshotId(), true);\n FileDiff earlierDiff = p == Snapshot.NO_SNAPSHOT_ID ? null : getDiffById(p);\n // Copy blocks to the previous snapshot if not set already\n if (earlierDiff != null) {\n earlierDiff.setBlocks(removedBlocks);\n }\n BlockInfo[] earlierBlocks =\n (earlierDiff == null ? new BlockInfoContiguous[]{} : earlierDiff.getBlocks());\n // Find later snapshot (or file itself) with blocks\n BlockInfo[] laterBlocks = findLaterSnapshotBlocks(removed.getSnapshotId());\n laterBlocks = (laterBlocks == null) ? file.getBlocks() : laterBlocks;\n // Skip blocks, which belong to either the earlier or the later lists\n int i = 0;\n for(; i < removedBlocks.length; i++) {\n if(i < earlierBlocks.length && removedBlocks[i] == earlierBlocks[i])\n continue;\n if(i < laterBlocks.length && removedBlocks[i] == laterBlocks[i])\n continue;\n break;\n }\n // Check if last block is part of truncate recovery\n BlockInfo lastBlock = file.getLastBlock();\n BlockInfo dontRemoveBlock = null;\n if (lastBlock != null && lastBlock.getBlockUCState().equals(\n HdfsServerConstants.BlockUCState.UNDER_RECOVERY)) {\n dontRemoveBlock = lastBlock.getUnderConstructionFeature()\n .getTruncateBlock();\n }\n // Collect the remaining blocks of the file, ignoring truncate block\n for (;i < removedBlocks.length; i++) {\n if(dontRemoveBlock == null || !removedBlocks[i].equals(dontRemoveBlock)) {\n reclaimContext.collectedBlocks().addDeleteBlock(removedBlocks[i]);\n }\n }\n }", "@Synchronized\r\n public void cleanTransferModelRecordsPeriodically() {\r\n try {\r\n ArrayList<Long> arrayList = getTransferModelsListIds();\r\n ArrayList<String> arrayListToDelete = new ArrayList<>();\r\n if (!arrayList.isEmpty() && arrayList.size() > 20) {\r\n for (int i = 19; i < arrayList.size(); i++) {\r\n arrayListToDelete.add(arrayList.get(i) + \"\");\r\n }\r\n String[] itemIds = arrayListToDelete.toArray(new String[arrayListToDelete.size()]);\r\n if (itemIds != null && itemIds.length > 0) {\r\n databaseHandler.getWritableDatabase();\r\n databaseHandler.deleteData(TableTransferModel.TABLE_NAME, TableTransferModel.id + \"=?\", itemIds);\r\n }\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n FirebaseCrashlytics.getInstance().recordException(e);\r\n }\r\n }", "private void removeExpired() {\n Map<K,CacheableObject> removeMap = new HashMap<K,CacheableObject>(valueMap.size()/2);\n List<CacheListener<K>> tempListeners = new ArrayList<CacheListener<K>>();\n\n // Retrieve a list of everything that's to be removed\n synchronized(theLock) {\n for (Map.Entry<K,CacheableObject> entry : valueMap.entrySet()) {\n if (isExpired(entry.getValue())) {\n removeMap.put(entry.getKey(), entry.getValue());\n }\n }\n tempListeners.addAll(listeners);\n }\n\n // Remove the entries one-at-a-time, notifying the listener[s] in the process\n for (Map.Entry<K,CacheableObject> entry : removeMap.entrySet()) {\n synchronized(theLock) {\n currentCacheSize -= entry.getValue().containmentCount;\n valueMap.remove(entry.getKey());\n }\n Thread.yield();\n\n for (CacheListener<K> listener : tempListeners) {\n listener.expiredElement(entry.getKey());\n }\n }\n }", "private void deletePastEvents() {\n Date now = new Date(); //gets the current date\n ArrayList<Integer> listofEventIDS = eventManager.getListOfEventIDs(); //gets list of all eventIDs in the system\n //checks every eventID, and if its in the past, then deletes everything related to that event\n for (Integer eventID: listofEventIDS) {\n //if the event happened before right now, delete the event, and remove all attendees that are attending that event, organizer, speaker and free up the room.\n if (eventManager.getEvent(eventID).getTime().before(now)){\n ArrayList<String> peopleAttending = eventManager.getEvent(eventID).getAttendees(); //list of userid of all people attending\n\n for (String attendeeID: peopleAttending){\n //check if attendee is a organizer attending the event\n if (organizerManager.userExist(attendeeID)){\n organizerManager.removeEvent(eventID, attendeeID);\n }\n //if its not a organizer, it must be a attendee\n else {\n attendeeManager.removeEvent(eventID,attendeeID);\n }\n }\n //NOTE: THIS WORKS RIGHT NOW BECAUSE WE ONLY HAVE 1 SPEAKER, IN PHASE 2 WE WILL HAVE MULTIPLE SPEAKERS\n speakerManager.getSpeaker(eventManager.getEvent(eventID).getSpeakerID()).removeAssignEvent(eventID);\n String organizerOfThisEvent = eventManager.getEvent(eventID).getOrganizerID(); //gets the userid of the organizer of this event\n //in the organizer's list of events that he/she created, this event is removed.\n organizerManager.removeEvent(eventID, organizerOfThisEvent);\n //removes the event from the room. NOTE THIS IS NOT NECESSARY AS YOU WILL NEVER BE ABLE TO ASSIGN A ROOM IN THE PAST, BUT JUST AS A SAFETY MEASURE.\n roomManager.removeEventFromRoom(eventManager.getEvent(eventID).getLocation(), eventID, eventManager.getTime(eventID));\n // and finally removes the event object itself from the event manager.\n eventManager.removeEvent(eventID);\n }\n }\n }", "public void clearUpToDateStatus() {\n\t\tif(upToDateIds != null) {\n\t\t\tSystem.out.println(\"Clearing Up To Date Status.\");\n\t\t\tupToDateIds.clear();\n\t\t}\n\t}", "protected void cleanup() {\n synchronized (tokenToDeleteQueue) {\n long now = getCurrentTimeMillis();\n Pair<Long, String> item = tokenToDeleteQueue.peek();\n if (item == null || item.getLeft() > now) {\n return;\n }\n do {\n item = tokenToDeleteQueue.poll();\n if (item == null) {\n return;\n }\n if (item.getLeft() > now) { // put it back since first one isn't timed out yet, stop.\n tokenToDeleteQueue.add(item);\n return;\n }\n store.remove(item.getRight());\n } while (!tokenToDeleteQueue.isEmpty());\n }\n }", "private void removeOlderGigs() {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tint currentHr = cal.get(Calendar.HOUR_OF_DAY);\r\n\t\t\r\n\t\tif ((currentHr >= 0 && currentHr <= 7)) {\r\n\t\t\t//Log.d(TAG, \"deleting older gigs\");\r\n\t\t\tmGigsDbHelper.deleteOlderGigs();\r\n\t\t}\r\n\t\t\r\n\t}", "public void removeExpiredAuctions(){\r\n ArrayList <String> expiredAuction = new ArrayList <String>(super.size());\r\n for(String expiredKey: keySet()){\r\n if(getAuction(expiredKey).getTimeRemaining() == 0){\r\n expiredAuction.add(expiredKey);\r\n }\r\n } \r\n for(String expiredKey: expiredAuction){\r\n super.remove(expiredKey);\r\n }\r\n }", "public void removeExistingAppTokensIfPossible() {\n for (int i = this.mChildren.size() - 1; i >= 0; i--) {\n AppTokenList appTokens = ((TaskStack) this.mChildren.get(i)).mExitingAppTokens;\n for (int j = appTokens.size() - 1; j >= 0; j--) {\n AppWindowToken token = (AppWindowToken) appTokens.get(j);\n if (!token.hasVisible && !DisplayContent.this.mClosingApps.contains(token) && (!token.mIsExiting || token.isEmpty())) {\n cancelAnimation();\n Slog.v(DisplayContent.TAG, \"performLayout: App token exiting now removed\" + token);\n token.removeIfPossible();\n }\n }\n }\n }", "private void removeUnfundedInvestors(Loan l, List<Investor> investorList) {\n\t\tList<Investor> investorsToRemoveList = new ArrayList<Investor>();\n\t\t\n\t\tfor(Investor i : l.getInvestorList().keySet()) {\n\t\t\tfor(Investor investor : investorList) {\n\t\t\t\t\n\t\t\t\tif(i.getName().equals(investor.getName())) {\n\t\t\t\t\ti.setInvestmentAmount(temporaryInvestors.get(i));\n\t\t\t\t\tinvestorsToRemoveList.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(investorsToRemoveList.size() > 0) {\n\t\t\tfor(Investor i : investorsToRemoveList) {\n\t\t\t\tl.getInvestorList().remove(i);\n\t\t\t\ti.getInvestmentsMap().remove(l);\n\t\t\t}\n\t\t}\n\t}", "private synchronized void removeOld() {\r\n long days = settings.getLong(\"channelHistoryKeepDays\");\r\n Map<String, Long> h = settings.getMap(HISTORY_SETTING);\r\n long keepAfter = System.currentTimeMillis() - days * DAY;\r\n Iterator<String> it = h.keySet().iterator();\r\n while (it.hasNext()) {\r\n String channel = it.next();\r\n long time = h.get(channel);\r\n if (time < keepAfter) {\r\n it.remove();\r\n }\r\n }\r\n settings.putMap(HISTORY_SETTING, h);\r\n settings.setSettingChanged(\"channelHistory\");\r\n }", "public synchronized void dropChanges() {\n\t\tmPendingDeleteCount = 0;\n\t}", "private boolean isFraudTransaction(final CreditCardTransactionDTO currentCCTransaction, final TransactionSummary previousTransactionSummary) {\n removeOutdatedTransactions(currentCCTransaction, previousTransactionSummary);\n final BigDecimal newTransactionsAmount = previousTransactionSummary.getTotalAmount().add(currentCCTransaction.getAmount());\n return newTransactionsAmount.compareTo(fraudConfig.getAmount()) > 0;\n }", "private void removeObsoleteFishes() {\n for (Piranha piranha : piranhas) {\n if (piranha.isOnRemoval()) {\n toRemove.add(piranha);\n }\n }\n if (!toRemove.isEmpty()) {\n for (Piranha piranha : toRemove) {\n piranhas.remove(piranha);\n }\n }\n toRemove.clear();\n }", "private synchronized void removeStreams() {\n Iterator<Map.Entry<Query, Long>> it = sheduledRemovals.entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<Query, Long> entry = it.next();\n if (entry.getValue() < System.currentTimeMillis()) {\n it.remove();\n Closeable stream = streams.get(entry.getKey());\n try {\n stream.close();\n }catch (IOException e){\n // TweetStreams can not throw IO-Exceptions on close.\n // Nothing to do here\n }\n streams.remove(entry.getKey());\n counts.remove(entry.getKey());\n }\n }\n }", "private void deleteTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n boolean isDebtValid = true;\n if(mDbHelper.getCategory(mTransaction.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n List<Debt> debts = mDbHelper.getAllDebts();\n\n Double repayment = 0.0, borrow = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) { // Repayment\n repayment += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n borrow += debt.getAmount();\n }\n }\n\n if(borrow - mTransaction.getAmount() < repayment) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_delete_invalid));\n }\n }\n\n if(isDebtValid) {\n mDbHelper.deleteTransaction(mTransaction.getId());\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n\n cleanup();\n\n // Return to FragmentListTransaction\n getFragmentManager().popBackStackImmediate();\n LogUtils.logLeaveFunction(Tag);\n }\n }", "protected void discard()\n {\n if (!isDiscarded())\n {\n OldOldCache map = OldOldCache.this;\n synchronized (map)\n {\n int cUnits = m_cUnits;\n if (cUnits == -1)\n {\n // entry is discarded; avoid repetitive events\n return;\n }\n\n if (cUnits > 0)\n {\n map.adjustUnits(-cUnits);\n }\n\n m_cUnits = -1;\n }\n\n // issue remove notification\n if (map.hasListeners())\n {\n map.dispatchEvent(map.instantiateMapEvent(\n MapEvent.ENTRY_DELETED, getKey(), getValue(), null));\n }\n }\n }", "public void removePrevCardList(){\n for (int i = 0; i < playerCardList.getPlayerCardListSize(); i++){\n playerCardPuzzle.getChildren().remove(playerCardList.getPlayerCardByNo(i));\n }\n }", "public void purgeQueue() {\r\n\t\tfDirtyRegions.clear();\r\n\t}", "public void cleanInvalidSession() {\n\t\tIterator<Entry<String, Session>> it = this.entrySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tEntry<String, Session> entry = it.next();\n\t\t\tif(entry.getValue().getExpirationTS().before(new Date())) {\n\t\t\t\tit.remove();\n\t\t\t}\n\t\t}\n\t}", "void removeDebts(int i);", "private void calculateDebitAgingNONE(List<EMCQuery> periodQueries, List<DebtorsAgingHelper> agingList, Date atDate, String customerId, EMCUserData userData) {\n for (int i = 0; i < periodQueries.size(); i++) {\n //Only sum over debits\n Object[] debitTotals = (Object[]) util.executeSingleResultQuery(periodQueries.get(i), userData);\n\n if (debitTotals != null) {\n BigDecimal debitTotal = (BigDecimal) debitTotals[0] == null ? BigDecimal.ZERO : (BigDecimal) debitTotals[0];\n BigDecimal debitSettledTotal = (BigDecimal) debitTotals[1] == null ? BigDecimal.ZERO : (BigDecimal) debitTotals[1];\n\n BigDecimal binAmount = debitTotal.subtract(debitSettledTotal);\n agingList.get(i).setBinAmount(binAmount);\n } else {\n agingList.get(i).setBinAmount(BigDecimal.ZERO);\n }\n }\n\n //If atDate less than today, ignore updates made to transactions between atDate and today.\n //Only check dates, not time\n Calendar atCalendar = Calendar.getInstance();\n atCalendar.setTime(atDate);\n atCalendar.set(Calendar.HOUR, 0);\n atCalendar.set(Calendar.HOUR_OF_DAY, 0);\n atCalendar.set(Calendar.MINUTE, 0);\n atCalendar.set(Calendar.SECOND, 0);\n atCalendar.set(Calendar.MILLISECOND, 0);\n\n Calendar nowCalendar = Calendar.getInstance();\n nowCalendar.setTime(Functions.nowDate());\n nowCalendar.set(Calendar.HOUR, 0);\n nowCalendar.set(Calendar.HOUR_OF_DAY, 0);\n nowCalendar.set(Calendar.MINUTE, 0);\n nowCalendar.set(Calendar.SECOND, 0);\n nowCalendar.set(Calendar.MILLISECOND, 0);\n\n if (atCalendar.compareTo(nowCalendar) < 0) {\n //For each bin, revert transaction history\n for (DebtorsAgingHelper binHelper : agingList) {\n EMCQuery settledQuery = new EMCQuery(enumQueryTypes.SELECT, DebtorsTransactionSettlementHistory.class);\n settledQuery.addFieldAggregateFunction(\"debitSettled\", \"SUM\");\n //Check that transaction existed at atDate. Bev requested that we remove this check.\n //settledQuery.addAnd(\"transactionCreatedDate\", atDate, EMCQueryConditions.LESS_THAN_EQ);\n settledQuery.openConditionBracket(EMCQueryBracketConditions.NONE);\n settledQuery.addAnd(\"debitTransactionDate\", binHelper.getBinEndDate(), EMCQueryConditions.LESS_THAN_EQ);\n //settledQuery.addAnd(\"creditTransactionDate\", binHelper.getBinEndDate(), EMCQueryConditions.LESS_THAN_EQ);\n settledQuery.closeConditionBracket();\n\n //Customer is optional\n if (customerId != null) {\n settledQuery.addAnd(\"customerId\", customerId);\n }\n\n //Only include transactions settled after atDate.\n settledQuery.addAnd(\"createdDate\", atDate, EMCQueryConditions.GREATER_THAN);\n\n if (binHelper.getBinStartDate() != null) {\n settledQuery.openConditionBracket(EMCQueryBracketConditions.AND);\n settledQuery.addAnd(\"debitTransactionDate\", binHelper.getBinStartDate(), EMCQueryConditions.GREATER_THAN_EQ);\n //settledQuery.addAnd(\"creditTransactionDate\", binHelper.getBinStartDate(), EMCQueryConditions.GREATER_THAN_EQ);\n settledQuery.closeConditionBracket();\n }\n\n BigDecimal totalSettled = (BigDecimal) util.executeSingleResultQuery(settledQuery, userData);\n if (totalSettled == null) {\n totalSettled = BigDecimal.ZERO;\n }\n\n //Add settled amount & discount back to bin\n //binHelper.setBinAmount(binHelper.getBinAmount().add(totalSettled).add(totalDiscount));\n binHelper.setBinAmount(binHelper.getBinAmount().add(totalSettled));\n }\n }\n }", "private void removeExpiredQueries()\n {\n DateTime timeHorizon = DateTime.now().minus(minQueryExpireAge.toMillis());\n\n // we're willing to keep queries beyond timeHorizon as long as we have fewer than maxQueryHistory\n while (expirationQueue.size() > maxQueryHistory) {\n QueryInfo queryInfo = expirationQueue.peek().getQueryInfo();\n\n // expirationQueue is FIFO based on query end time. Stop when we see the\n // first query that's too young to expire\n if (queryInfo.getQueryStats().getEndTime().isAfter(timeHorizon)) {\n return;\n }\n\n // only expire them if they are older than minQueryExpireAge. We need to keep them\n // around for a while in case clients come back asking for status\n QueryId queryId = queryInfo.getQueryId();\n\n log.debug(\"Remove query %s\", queryId);\n queries.remove(queryId);\n expirationQueue.remove();\n }\n }", "public void cleanup() {\n\n\t\tfinal long now = System.currentTimeMillis();\n\n\t\tsynchronized (this.recentlyRemovedChannels) {\n\n\t\t\tfinal Iterator<Map.Entry<ChannelID, Long>> it = this.recentlyRemovedChannels.entrySet().iterator();\n\t\t\twhile (it.hasNext()) {\n\n\t\t\t\tfinal Map.Entry<ChannelID, Long> entry = it.next();\n\t\t\t\tif ((entry.getValue().longValue() + CLEANUP_INTERVAL) < now) {\n\t\t\t\t\tit.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void removeOOSBalas() {\n balasToRemove = new ArrayList<>();\n balas.forEach(bala -> {\n if(bala.getState() == Enums.BulletState.TO_REMOVE) {\n if(!balasToRemove.contains(bala)) {\n balasToRemove.add(bala);\n }\n }\n });\n balasToRemove.forEach(bala -> balas.remove(bala));\n }", "public void removeOldRoutes()\n\t{\n\t\tList<RouteTableEntry> safeList = Collections.synchronizedList(getList());\n\t\t\n\t\ttable.clear(); // clear the table\n\t\t\n\t\tfor (RouteTableEntry entry : safeList)\n\t\t{\n\t\t\tif (entry.getCurrentAgeInSeconds() > NetworkConstants.ROUTE_TABLE_TIMEOUT)\n\t\t\t{\n\t\t\t\t// do nothing, the entry expired so leave it out of the table\n\t\t\t} // end if\n\t\t\telse\n\t\t\t{\n\t\t\t\ttable.add(entry); // put it back in the table\n\t\t\t} // end else\n\t\t} // end for each loop\n\t\t\n\t\t/*addOrUpdate(Utilities.getLL3PIntFromLL3PString(NetworkConstants.MY_LL3P_ADDRESS), \n\t\t\t\tnew NetworkDistancePair(Utilities.getLL3PIntFromLL3PString(NetworkConstants.MY_LL3P_ADDRESS), \n\t\t\t\t0), // I am zero away from myself\n\t\t\t\tUtilities.getLL3PIntFromLL3PString(NetworkConstants.MY_LL3P_ADDRESS));*/\n\t\t\n\t\tparentActivity.runOnUiThread(new Runnable()\n\t\t{ \n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tuiManager.resetRoutingListAdapter();\n\t\t\t\tuiManager.resetForwardingListAdapter();\n\t\t\t} // end public method run\n\t\t}); // end runOnUiThread\n\t}", "private static void cleanLeaseSetCache(RouterContext ctx, Map<HashPair, LeaseSet> tc) {\n long now = ctx.clock().now();\n for (Iterator<LeaseSet> iter = tc.values().iterator(); iter.hasNext(); ) {\n LeaseSet l = iter.next();\n if (l.getEarliestLeaseDate() < now)\n iter.remove();\n }\n }", "public void dropWaitingStates() {\n waitlist.clear();\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "void cleanUpExpiredSessions() {\n try (TarantoolClient client = clientSource.getClient()) {\n client.select(getSpace(client), SPACE_EXPIRY_INDEX, Integer.MAX_VALUE, 0, Iter.LE);\n client.setLong(System.currentTimeMillis());\n Result result = client.execute();\n Set<UUID> ids = new HashSet<>();\n while (result.next()) {\n ids.add(new UUID(result.getLong(2), result.getLong(3)));\n }\n ids.forEach(id -> deleteById(id, client));\n if (logger.isDebugEnabled()) {\n logger.debug(\"Cleaned up \" + ids.size() + \" expired sessions\");\n }\n }\n }", "public static void clear() {\r\n\t\tload();\r\n\t\tif (transList.size() == 0) {\r\n\t\t\tSystem.out.println(\"No transaction now....\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor (int i = 0; i < transList.size(); i++) {\r\n\t\t\tif (transList.get(i).toFile().charAt(0) == 'd') {\r\n\t\t\t\tDeposit trans = (Deposit) transList.get(i);\r\n\t\t\t\tif (!trans.isCleared()) {\r\n\t\t\t\t\ttrans.setCleared(AccountControl.deposit(trans.getAcc(), trans.getAmount()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsave();\r\n\t}", "@Override\n public void purgeFlows() {\n setOfFlowsToAdd.clear();\n setOfFlowsToDelete.clear();\n }", "public void cleanupDead() {\n\t\tIterator<Entity> it = entities.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tEntity e = it.next();\n\t\t\t\n\t\t\tif (!e.isDead()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Remove from entities list\n\t\t\tit.remove();\n\t\t\t\n\t\t\t//Remove from other lists.\n\t\t\tremove(e);\n\t\t\t\n\t\t\t//Log action.\n\t\t\tlogger.log(LogLevel.DEBUG, \"Removed entity\");\n\t\t}\n\t}", "public void removeDeadVampires() {\n\n for (int i = 0; i < Vampiro.getNumVamp(); i++) {\n if (lista[i].getVida() <= 0)\n delVampire(i);\n }\n }", "public void removeOverTime(){\r\n\t\tlong latest = timeQueue.getLast();\r\n\t\twhile( !timeQueue.isEmpty() && overlapRatioQueue.isEmpty() ){\r\n\t\t\tlong temp = timeQueue.getFirst();\r\n\t\t\tif( latest - temp > SMOOTING_INTERVAL ){\r\n\t\t\t\ttimeQueue.removeFirst();\r\n\t\t\t\toverlapRatioQueue.removeFirst();\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void calculateDebitAgingOLDEST(String customerId, List<EMCQuery> periodQueries, List<DebtorsAgingHelper> agingList, Date atDate, EMCUserData userData) {\n //First calculate total outstanding debits\n calculateDebitAgingNONE(periodQueries, agingList, atDate, customerId, userData);\n\n //Bev requested that we remove this check. This will now include all unallocated credits, regardless of\n //whether or not they existed at atDate.\n //query.addAnd(\"createdDate\", atDate, EMCQueryConditions.LESS_THAN_EQ);\n\n BigDecimal unallocatedCredit = getTotalUnallocatedCredit(customerId, atDate, userData);\n\n //Start allocating credits to oldest debits\n for (int i = agingList.size() - 1; i >= 0; i--) {\n BigDecimal currentBinAmount = agingList.get(i).getBinAmount();\n if (currentBinAmount.compareTo(BigDecimal.ZERO) > 0) {\n //Debit amount found\n if (currentBinAmount.compareTo(unallocatedCredit) > 0) {\n //Outstanding debit is more than outstanding credit.\n //Allocate credit in full.\n agingList.get(i).setBinAmount(currentBinAmount.subtract(unallocatedCredit));\n unallocatedCredit = BigDecimal.ZERO;\n } else {\n //Outstanding debit is less than or equal to outstanding credit.\n //Allocate bin debit amount.\n unallocatedCredit = unallocatedCredit.subtract(currentBinAmount);\n agingList.get(i).setBinAmount(BigDecimal.ZERO);\n }\n\n if (unallocatedCredit.compareTo(BigDecimal.ZERO) == 0) {\n //Consumed credit, exit loop.\n break;\n }\n }\n }\n\n //If credit remains, allocate all of it to the current bin.\n if (unallocatedCredit.compareTo(BigDecimal.ZERO) > 0 && !agingList.isEmpty()) {\n agingList.get(0).setBinAmount(agingList.get(0).getBinAmount().subtract(unallocatedCredit));\n }\n\n// This code removed. As the getTotalUnallocatedCredit() method already returned the full credit amount outstanding at the specified\n// date, this caused double the outstanding credit to be allocated.\n// //If atDate less than today, ignore updates made to transactions between atDate and today.\n// //Only check dates, not time\n// Calendar atCalendar = Calendar.getInstance();\n// atCalendar.setTime(atDate);\n// atCalendar.set(Calendar.HOUR, 0);\n// atCalendar.set(Calendar.MINUTE, 0);\n// atCalendar.set(Calendar.SECOND, 0);\n// atCalendar.set(Calendar.MILLISECOND, 0);\n//\n// Calendar nowCalendar = Calendar.getInstance();\n// nowCalendar.setTime(Functions.nowDate());\n// nowCalendar.set(Calendar.HOUR, 0);\n// nowCalendar.set(Calendar.MINUTE, 0);\n// nowCalendar.set(Calendar.SECOND, 0);\n// nowCalendar.set(Calendar.MILLISECOND, 0);\n//\n// if (atCalendar.compareTo(nowCalendar) < 0) {\n// EMCQuery creditQuery = new EMCQuery(enumQueryTypes.SELECT, DebtorsTransactionSettlementHistory.class);\n// creditQuery.addFieldAggregateFunction(\"creditSettled\", \"SUM\");\n// //Only include transactions that existed on atDate. Bev requested that we remove this check.\n// //creditQuery.addAnd(\"transactionCreatedDate\", atDate, EMCQueryConditions.LESS_THAN_EQ);\n//\n// //Customer is optional\n// if (customerId != null) {\n// creditQuery.addAnd(\"customerId\", customerId);\n// }\n//\n// //Only include transactions settled after atDate\n// creditQuery.addAnd(\"createdDate\", atDate, EMCQueryConditions.GREATER_THAN);\n//\n// BigDecimal creditSettled = (BigDecimal) util.executeSingleResultQuery(creditQuery, userData);\n// if (creditSettled == null) {\n// creditSettled = BigDecimal.ZERO;\n// }\n//\n// //Start allocating credits to oldest debits\n// for (int i = agingList.size() - 1; i >= 0; i--) {\n// BigDecimal currentBinAmount = agingList.get(i).getBinAmount();\n// if (currentBinAmount.compareTo(BigDecimal.ZERO) > 0) {\n// //Debit amount found\n// if (currentBinAmount.compareTo(creditSettled) > 0) {\n// //Outstanding debit is more than outstanding credit.\n// //Allocate credit in full.\n// agingList.get(i).setBinAmount(currentBinAmount.subtract(creditSettled));\n// creditSettled = BigDecimal.ZERO;\n// } else {\n// //Outstanding debit is less than or equal to outstanding credit.\n// //Allocate bin debit amount.\n// creditSettled = creditSettled.subtract(currentBinAmount);\n// agingList.get(i).setBinAmount(BigDecimal.ZERO);\n// }\n//\n// if (creditSettled.compareTo(BigDecimal.ZERO) == 0) {\n// //Consumed credit, exit loop.\n// break;\n// }\n// }\n// }\n//\n// //If credit remains, allocate all of it to the current bin.\n// if (creditSettled.compareTo(BigDecimal.ZERO) > 0 && !agingList.isEmpty()) {\n// agingList.get(0).setBinAmount(agingList.get(0).getBinAmount().subtract(creditSettled));\n// }\n// }\n }", "private void getUnsettledTransactionListRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_UNSETTLED_TRANSACTION_LIST.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "private void removeInconsistency(LPGInconsistency inconsistency, Set<LPGInconsistency> currentInconsistencies){\n\t\tcurrentInconsistencies.remove(inconsistency);\n\t\tinconsistencyCount--;\n\t}", "private ArrayList<Task> removeNoTimeTask(ArrayList<Task> toFilter) {\n ArrayList<Integer> toDelete = new ArrayList<Integer>();\n\n //remove all without dates (ToDos and Lasts)\n for (int i = 0; i < toFilter.size(); i++) {\n if (toFilter.get(i).getClass().equals(ToDo.class)) {\n toDelete.add(i);\n }\n if (toFilter.get(i).getClass().equals(Last.class)) {\n toDelete.add(i);\n }\n }\n\n for (int i = toDelete.size() - 1; i >= 0; ) {\n toFilter.remove((int) toDelete.get(i));\n i--;\n }\n return toFilter;\n }", "void clearUndo() {\r\n while (!listOfBoards.isEmpty()) {\r\n listOfMoves.pop();\r\n listOfBoards.pop();\r\n }\r\n }", "@Override\n public void onChildRemoved(DataSnapshot dataSnapshot) {\n int removedBooking = Integer.parseInt(dataSnapshot.getKey());\n try {\n ObservableLists.bookingsList.forEach(b -> {\n if(b.getBookingNumber() == removedBooking){\n ObservableLists.bookingsList.remove(b);\n }\n });\n } catch (ConcurrentModificationException ex){\n //This occurs because I am removing an from a list while I am iterating through that list\n //functions properly and works well however if I have time I will look at alternative ways\n }\n\n }", "public static void purgeExpired()\n {\n Date now = new Date();\n List<DealWatchRecord> allRecords = getAllRecords(null);\n for (int i = 0; i < allRecords.size(); i++)\n {\n DealWatchRecord record = allRecords.get(i);\n if (record != null && record.expiration != null)\n {\n if (record.expiration.getTime() < now.getTime())\n {\n record.delete();\n }\n }\n }\n }", "public abstract void detatchHistoricalWrapper();", "private void cleanup() {\n\t\tTreeSet<CacheEntry> entries = new TreeSet<CacheEntry>(map.values());\n\t\tint i = region.getItemsToEvict();\n\t\tIterator<CacheEntry> it = entries.iterator();\n\t\twhile (it.hasNext() && i > 0) {\n\t\t\tremoveEntry(it.next());\n\t\t\ti--;\n\t\t}\n\t}", "public void pruneCooldowns() {\n HashMap<String, Long> cooldownsTempList = new HashMap<>();\n cooldownsList.keySet().forEach(key -> {\n long timeRemaining = cooldownDuration - (System.currentTimeMillis() - cooldownsList.get(key));\n if(timeRemaining > 0) {\n cooldownsTempList.put(key, cooldownsList.get(key));\n }\n });\n cooldownsList.clear();\n cooldownsList.putAll(cooldownsTempList);\n }", "public synchronized static void cleanOldFiles() {\n\t\tGregorianCalendar yesterday = new GregorianCalendar();\n\t\tyesterday.roll(GregorianCalendar.HOUR_OF_DAY,-4);\n\t\tcleanOldFiles(yesterday.getTime());\n\t}", "public void deleteFurniture(List<HomePieceOfFurniture> deletedFurniture) {\n final boolean basePlanLocked = this.home.isBasePlanLocked();\n final boolean allLevelsSelection = this.home.isAllLevelsSelection();\n final List<Selectable> oldSelection = this.home.getSelectedItems(); \n List<HomePieceOfFurniture> homeFurniture = this.home.getFurniture(); \n\n // Replace pieces by their group when they have to be all deleted\n deletedFurniture = new ArrayList<HomePieceOfFurniture>(deletedFurniture);\n List<HomeFurnitureGroup> homeGroups = new ArrayList<HomeFurnitureGroup>(); \n searchGroups(homeFurniture, homeGroups);\n boolean updated;\n do {\n updated = false;\n for (HomeFurnitureGroup group : homeGroups) {\n List<HomePieceOfFurniture> groupFurniture = group.getFurniture();\n if (deletedFurniture.containsAll(groupFurniture)) {\n deletedFurniture.removeAll(groupFurniture);\n deletedFurniture.add(group);\n updated = true;\n }\n }\n } while (updated);\n \n // Sort the deletable furniture in the ascending order of their index in home or their group\n Map<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>> deletedFurnitureMap =\n new HashMap<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>>();\n int deletedFurnitureCount = 0;\n for (HomePieceOfFurniture piece : deletedFurniture) {\n // Check piece is deletable and doesn't belong to a group\n if (isPieceOfFurnitureDeletable(piece)) {\n HomeFurnitureGroup group = getPieceOfFurnitureGroup(piece, null, homeFurniture);\n Map<Integer, HomePieceOfFurniture> sortedMap = deletedFurnitureMap.get(group);\n if (sortedMap == null) {\n sortedMap = new TreeMap<Integer, HomePieceOfFurniture>();\n deletedFurnitureMap.put(group, sortedMap);\n }\n if (group == null) {\n sortedMap.put(homeFurniture.indexOf(piece), piece);\n } else {\n sortedMap.put(group.getFurniture().indexOf(piece), piece);\n }\n deletedFurnitureCount++;\n }\n }\n final HomePieceOfFurniture [] furniture = new HomePieceOfFurniture [deletedFurnitureCount]; \n final int [] furnitureIndex = new int [furniture.length];\n final Level [] furnitureLevels = new Level [furniture.length];\n final HomeFurnitureGroup [] furnitureGroups = new HomeFurnitureGroup [furniture.length];\n int i = 0;\n for (Map.Entry<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>> sortedMapEntry : deletedFurnitureMap.entrySet()) {\n for (Map.Entry<Integer, HomePieceOfFurniture> pieceEntry : sortedMapEntry.getValue().entrySet()) {\n furniture [i] = pieceEntry.getValue();\n furnitureIndex [i] = pieceEntry.getKey(); \n furnitureLevels [i] = furniture [i].getLevel();\n furnitureGroups [i++] = sortedMapEntry.getKey();\n }\n } \n doDeleteFurniture(furniture, basePlanLocked, false); \n if (this.undoSupport != null) {\n UndoableEdit undoableEdit = new AbstractUndoableEdit() {\n @Override\n public void undo() throws CannotUndoException {\n super.undo();\n doAddFurniture(furniture, furnitureGroups, furnitureIndex, null, furnitureLevels, basePlanLocked, allLevelsSelection); \n home.setSelectedItems(oldSelection);\n }\n \n @Override\n public void redo() throws CannotRedoException {\n super.redo();\n home.setSelectedItems(Arrays.asList(furniture));\n doDeleteFurniture(furniture, basePlanLocked, false); \n }\n \n @Override\n public String getPresentationName() {\n return preferences.getLocalizedString(FurnitureController.class, \"undoDeleteSelectionName\");\n }\n };\n this.undoSupport.postEdit(undoableEdit);\n }\n }", "public void resetSaleAndCostTracking() {\n for (int i = 0; i < stockList.size(); i++) {\r\n // If the beanBag object at the current position is \"isSold\" bool is true.\r\n if (((BeanBag) stockList.get(i)).isSold()) {\r\n // Remove beanBag object at that position from the \"stockList\".\r\n stockList.remove(i);\r\n }\r\n }\r\n }", "private Stream<Data> removeInvalidData(SystemNode node) {\n final Map<Integer, Double> scores = node.getData()\n .stream()\n .filter(Objects::nonNull)\n .map(Data::getFromId)\n .collect(Collectors.toMap(Data::getId, x -> this.computeScores(node, Arrays\n .stream(this.getUsers())\n .filter(user -> arrayContains(user.getInterests(), x.getId()))\n .toArray(User[]::new)\n )));\n\n Selection result = new KnapSack(scores, new LinkedHashSet<>(node.getData()), node.getCapacity()).startCompute();\n\n return node.getData()\n .stream()\n .filter(x -> !result.selected.contains(x))\n .peek(node::removeFromStorage)\n .map(Data::getFromId);\n\n\n }", "protected void applyPendingDeletes ()\n {\n while (!m_aDeleteStack.isEmpty ())\n removeMonitoredFile (m_aDeleteStack.pop ());\n }", "public ChameleonDirtyRegion removeNextDirtyRegion() {\r\n\t\tif (fDirtyRegions.size() == 0)\r\n\t\t\treturn null;\r\n\t\tChameleonDirtyRegion dr= fDirtyRegions.get(0);\r\n\t\tfDirtyRegions.remove(0);\r\n\t\treturn dr;\r\n\t}", "private void purgeObsoleteExposureIDs( long now) {\n\t\tassert( this.getAppType() == Beacon.AppType.APPLE_GOOGLE_CONTACT_TRACING);\n\t\tlong beforeTS = now - getDurationKeepExposureIDs();\n\t\tif ( !this.idStore.purge( new Date( beforeTS))) {\n\t\t\tlogger.warning( \"failure to purge old exposures\");\n\t\t} else {\n\t\t\tsetPurgedObsoleteExposureIDsTS( now);\n\t\t}\n\t}", "private void removeStoppedRecords(String pkgName) {\n if (pkgName != null) {\n boolean isPkgHasRecord = false;\n synchronized (this.mUtil.getmLock()) {\n Iterator<Map.Entry<String, ArrayList<LocationManagerService.UpdateRecord>>> it = this.mUtil.getRecordsByProvider().entrySet().iterator();\n while (true) {\n if (!it.hasNext()) {\n break;\n }\n ArrayList<LocationManagerService.UpdateRecord> records = it.next().getValue();\n if (records != null) {\n Iterator<LocationManagerService.UpdateRecord> it2 = ((ArrayList) records.clone()).iterator();\n while (true) {\n if (!it2.hasNext()) {\n break;\n } else if (pkgName.equals(it2.next().mReceiver.mCallerIdentity.mPackageName)) {\n LBSLog.i(TAG, \"package stopped,remove updateRecords and receivers:\" + pkgName);\n isPkgHasRecord = true;\n break;\n }\n }\n if (isPkgHasRecord) {\n break;\n }\n }\n }\n }\n if (isPkgHasRecord) {\n removeNotRunAndNotExistRecords();\n }\n }\n }", "public void removeTopRewardAndContinue() {\n inventoryEntityToRetrieve.pop();\n if (inventoryEntityToRetrieve.isEmpty()) incrementStateIndex();\n }", "public void deleteOldAlarms(){\r\n\t\tfor(int i = 0; i < alarmList.size(); i++){\r\n\t\t\tAlarmTime current = alarmList.get(i);\r\n\t\t\tif(current.getYear() == cal.get(Calendar.YEAR) && current.getMonth() == cal.get(Calendar.MONTH)\r\n\t\t\t\t\t&& current.getDay() == cal.get(Calendar.DAY_OF_MONTH) && current.getHour() < cal.get(Calendar.HOUR_OF_DAY)){\r\n\t\t\t\t//delete alarm from XML\r\n\t\t\t\txmanager.delete(current.toString());\r\n\t\t\t}\r\n\t\t\telse if(current.getYear() == cal.get(Calendar.YEAR) && current.getMonth() == cal.get(Calendar.MONTH)\r\n\t\t\t\t\t&& current.getDay() < cal.get(Calendar.DAY_OF_MONTH)){\r\n\t\t\t\t//delete alarm from XML\r\n\t\t\t\txmanager.delete(current.toString());\r\n\t\t\t}\r\n\t\t\telse if(current.getYear() == cal.get(Calendar.YEAR) && current.getMonth() < cal.get(Calendar.MONTH)){\r\n\t\t\t\t//delete alarm from XML\r\n\t\t\t\txmanager.delete(current.toString());\r\n\t\t\t}\r\n\t\t\telse if(current.getYear() < cal.get(Calendar.YEAR)){\r\n\t\t\t\t//delete alarm from XML\r\n\t\t\t\txmanager.delete(current.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void removeFromSavedScheduleList() {\n if (!yesNoQuestion(\"This will print every schedule, are you sure? \")) {\n return;\n }\n\n showAllSchedules(scheduleList.getScheduleList());\n\n System.out.println(\"What is the number of the one you want to remove?\");\n int removeIndex = obtainIntSafely(1, scheduleList.getScheduleList().size(), \"Number out of bounds\");\n scheduleList.getScheduleList().remove(removeIndex - 1);\n System.out.println(\"Removed!\");\n }", "public static void removeAll() {\r\n\t\tfor (final Block block : new HashSet<>(instances_.keySet())) {\r\n\t\t\trevertBlock(block, Material.AIR);\r\n\t\t}\r\n\t\tfor (final TempBlock tempblock : REVERT_QUEUE) {\r\n\t\t\ttempblock.state.update(true, applyPhysics(tempblock.state.getType()));\r\n\t\t\tif (tempblock.revertTask != null) {\r\n\t\t\t\ttempblock.revertTask.run();\r\n\t\t\t}\r\n\t\t}\r\n\t\tREVERT_QUEUE.clear();\r\n\t}", "public void interestCachePurge()\n\t{\n\t\tdouble currentTime = getTime() ;\n\t\tfor(InterestCacheEntry entry:interestCache.values()){\n\t\t\tentry.setPayable(macroLearner.calcPayable(entry.getInterest(),entry.getMaxGradient().getPayment()));\n\t\t\tentry.gradientListPurge(currentTime) ;\n\t\t\t//microLearner.updateTaskExpectedPrice(entry.getInterest().getTaskId());\n\t\t\t/*if ( entry.IsGradientListEmpty() == true ){\n\t\t\t\tit.remove();\n\t\t\t}\t*/\t\t\n\t\t}\n\t}", "void abort() {\n\n // Revision number = 0 indicates an aborted transaction.\n this.targetRevisionNumber.set( 0L );\n\n // Clean up aborted revisions ...\n for ( AbstractVersionedItem versionedItem : this.versionedItemsWritten ) {\n versionedItem.removeAbortedRevision();\n }\n\n this.versionedItemsRead.clear();\n this.versionedItemsWritten.clear();\n\n // Trigger any clean up that is possible from no longer needing our source version.\n this.cleanUpOlderRevisions();\n\n }", "void clearFunds() {\n\t\tbalance += cheque;\n\t\tcheque = 0;\n\t}", "protected final void undo() {\n requireAllNonNull(model, previousResidentBook, previousEventBook);\n model.resetData(previousResidentBook, previousEventBook);\n model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);\n model.updateFilteredEventList(PREDICATE_SHOW_ALL_EVENTS);\n\n }", "public void restorePreviousDeletion(){\n int cachePosition = deletedEntry.cachePosition;\n sortedFilesArrList.add(cachePosition, deletedEntry.cacheFileName);\n tag1ArrList.add(cachePosition, deletedEntry.cacheTag1);\n tag2ArrList.add(cachePosition, deletedEntry.cacheTag2);\n tag3ArrList.add(cachePosition, deletedEntry.cachetTag3);\n favArrList.add(cachePosition, deletedEntry.cacheFileIsFavorite);\n deletedEntry = null;\n\n notifyItemInserted(cachePosition);\n notifyItemRangeChanged(cachePosition, this.getItemCount());\n }", "public void undo() {\n\t\tstate = null;\n\t\tfor (Row r : containingRows)\n\t\t\tr.undo(this);\n\t}", "public void removeLastEntry(){\r\n\t\tboards.remove(boards.size() -1 );\r\n\t}", "public synchronized void resetBMessageReceiptList() {\n bMessageReceiptList = null;\n }", "public void removeCurrent( )\n {\n // Implemented by student.\n }", "private void cleanUpAfterMove(Unit unit){\n\t\t\t//add current location\n\t\t\tpastLocations.add(unit.location().mapLocation());\n\t\t\t//get rid of oldest to maintain recent locations\n\t\t\tif (pastLocations.size()>9)\n\t\t\t\tpastLocations.remove(0);\t\n\t}", "public void removeInvalidAddRemoveItemRequests()\n \t{\n \t\t/* ignore attempts to remove and add the same tag */\n \t\tif (this.getItems() != null)\n \t\t{\n \t\t\tfinal List<T> removeChildren = new ArrayList<T>();\n \n \t\t\t/* on the first loop, remove any items that are marked for both add a remove in the same item, or are not marked for any processing at all */\n \t\t\tfor (final T child1 : this.getItems())\n \t\t\t{\n \t\t\t\tfinal boolean add1 = child1.getAddItem();\n \t\t\t\tfinal boolean remove1 = child1.getRemoveItem();\n \n \t\t\t\tif ((add1 && remove1) || (!add1 && !remove1))\n \t\t\t\t{\n \t\t\t\t\tif (!removeChildren.contains(child1))\n \t\t\t\t\t\tremoveChildren.add(child1);\n \t\t\t\t}\n \t\t\t}\n \n \t\t\tfor (final T removeChild : removeChildren)\n \t\t\t\tthis.getItems().remove(removeChild);\n \n \t\t\tignoreDuplicatedAddRemoveItemRequests();\n \n \t\t}\n \t}", "private void removeExpiredContacts() {\n int numContactsExpired = 0;\n Date dateToday = new Date();\n for (Iterator<User> it = contacts.iterator(); it.hasNext();) {\n User contact = it.next();\n Date contactExpiryDate = contact.getContactExpiryDate();\n if (dateToday.after(contactExpiryDate) || DateUtils.isToday(contactExpiryDate.getTime())) {\n boolean result = SharedPrefsUtils.removeTravelContact(context, contact);\n if (result) {\n it.remove();\n numContactsExpired++;\n }\n }\n }\n if (numContactsExpired > 0) {\n Toast.makeText(context, \"Removed \" + numContactsExpired + \" expired contacts\", Toast.LENGTH_LONG).show();\n }\n }", "private void removeEvicted() {\n Map<K,CacheableObject> removeMap = new HashMap<K,CacheableObject>(valueMap.size()/2);\n List<CacheListener<K>> tempListeners = new ArrayList<CacheListener<K>>();\n\n // Retrieve a list of everything that's to be removed\n synchronized(theLock) {\n removeMap.putAll(toEvictMap);\n toEvictMap.clear();\n tempListeners.addAll(listeners);\n }\n\n // Remove the entries one-at-a-time, notifying the listener[s] in the process\n for (Map.Entry<K,CacheableObject> entry : removeMap.entrySet()) {\n synchronized(theLock) {\n currentCacheSize -= entry.getValue().containmentCount;\n valueMap.remove(entry.getKey());\n }\n Thread.yield();\n\n for (CacheListener<K> listener : tempListeners) {\n listener.evictedElement(entry.getKey());\n }\n }\n }", "void clearUnactivatedAccounts(int unactivatedDays);", "@Override\n public void abortTx() {\n \tfor (VBox vbox : overwrittenAncestorWriteSet) {\n \t // revert the in-place entry that had overwritten\n \t vbox.inplace = vbox.inplace.next;\n \t}\n \n this.orec.version = OwnershipRecord.ABORTED;\n for (OwnershipRecord mergedLinear : linearNestedOrecs) {\n mergedLinear.version = OwnershipRecord.ABORTED;\n }\n \tfor (ParallelNestedTransaction mergedTx : mergedTxs) {\n \t mergedTx.orec.version = OwnershipRecord.ABORTED;\n \t}\n \t\n\t// give the read set arrays, which were used exclusively by this nested or its children, back to the thread pool\n\tCons<VBox[]> parentArrays = this.getRWParent().bodiesRead;\n\tCons<VBox[]> myArrays = this.bodiesRead;\n\twhile (myArrays != parentArrays) {\n\t returnToPool(myArrays.first());\n\t myArrays = myArrays.rest();\n\t}\n\t\n \tbodiesRead = null;\n \tboxesWritten = null;\n \tboxesWrittenInPlace = null;\n \tperTxValues = null;\n \toverwrittenAncestorWriteSet = null;\n \tmergedTxs = null;\n \tlinearNestedOrecs = null;\n \tcurrent.set(this.getParent());\n }", "@Override\n public List<SMREntry> remainingUpTo(long maxGlobal) {\n if (TransactionalContext.getTransactionStack().size()\n > contexts.size()) {\n contexts = TransactionalContext.getTransactionStackAsList();\n } else if (TransactionalContext.getTransactionStack().size()\n < contexts.size()) {\n mergeTransaction();\n }\n List<SMREntry> entryList = new LinkedList<>();\n\n\n for (int i = currentContext; i < contexts.size(); i++) {\n final List<SMREntry> writeSet = contexts.get(i)\n .getWriteSetEntryList(id);\n long readContextStart = i == currentContext ? currentContextPos + 1 : 0;\n for (long j = readContextStart; j < writeSet.size(); j++) {\n entryList.add(writeSet.get((int) j));\n writePos++;\n }\n if (writeSet.size() > 0) {\n currentContext = i;\n currentContextPos = writeSet.size() - 1;\n }\n }\n return entryList;\n }" ]
[ "0.6400428", "0.5901569", "0.58609116", "0.5858331", "0.58316785", "0.5790765", "0.5765707", "0.5760935", "0.57368064", "0.57027406", "0.5690794", "0.567432", "0.5631695", "0.56274474", "0.56238323", "0.5585608", "0.5579778", "0.55754185", "0.5573876", "0.55631876", "0.5518608", "0.54456556", "0.5441398", "0.5402411", "0.5396068", "0.5386097", "0.5359826", "0.5322462", "0.5290659", "0.5285519", "0.5270011", "0.5269301", "0.5252894", "0.52324647", "0.5230883", "0.5227286", "0.522374", "0.5207072", "0.51933193", "0.51812524", "0.51786697", "0.517357", "0.5173159", "0.5162347", "0.5141011", "0.51338494", "0.512879", "0.51097614", "0.51051176", "0.5097472", "0.5083387", "0.5067175", "0.5062392", "0.5041101", "0.50329876", "0.5026692", "0.5025053", "0.5024924", "0.50226194", "0.5015363", "0.4993315", "0.49926347", "0.49779877", "0.4973374", "0.4966282", "0.4956931", "0.49464354", "0.49401742", "0.49366987", "0.49356887", "0.49268258", "0.49205783", "0.49201787", "0.49122366", "0.4907909", "0.49078348", "0.48987374", "0.48939648", "0.48898274", "0.4889018", "0.48870295", "0.4881806", "0.48798472", "0.48779637", "0.48731926", "0.48662847", "0.4863186", "0.48584026", "0.48500735", "0.48455417", "0.48428512", "0.48258626", "0.48236963", "0.48216295", "0.48139304", "0.48104364", "0.48034227", "0.48006362", "0.47987634", "0.47958532" ]
0.67695296
0
Method to check if the transaction is outdated i.e. out of the fraud window in comparison to current transaction record
private boolean isOutdatedTransaction(final TransactionModel transactionToBeChecked, final CreditCardTransactionDTO currentCCTransaction) { final long difference = DateTimeUtil.getTimeDifference(fraudConfig.getChronoUnit(), transactionToBeChecked.getTimestamp(), currentCCTransaction.getTimestamp()); return difference > fraudConfig.getWindow(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isUpToDate() {\n return false;\n }", "boolean hasTransactionChangesPending() {\n// System.out.println(transaction_mod_list);\n return transaction_mod_list.size() > 0;\n }", "boolean hasTransactionDateTime();", "boolean hasTsUpdate();", "private boolean isFraudTransaction(final CreditCardTransactionDTO currentCCTransaction, final TransactionSummary previousTransactionSummary) {\n removeOutdatedTransactions(currentCCTransaction, previousTransactionSummary);\n final BigDecimal newTransactionsAmount = previousTransactionSummary.getTotalAmount().add(currentCCTransaction.getAmount());\n return newTransactionsAmount.compareTo(fraudConfig.getAmount()) > 0;\n }", "public boolean isStale()\n {\n return (_iMdChecksum != TypeSystem.getRefreshChecksum() && !isProxy());\n }", "public boolean isLate(){\n Date d = givenBack != null ? givenBack : new Date();\n return expirationDate.before(d);\n }", "boolean hasUpdateTriggerTime();", "boolean hasDepositEndTime();", "public boolean isUpToDate(int id) {\n\t\tSystem.out.print(\"Checking if ID \" + id + \" is up to date\");\n\t\tboolean upToDate = upToDateIds.contains(id);\n\t\tSystem.out.println(\" \\tUp To Date: \" + upToDate);\n\t\treturn upToDate;\n\t}", "@Override\n public boolean isOutdated() {\n return false;\n }", "boolean hasUpdate();", "boolean hasUpdate();", "public boolean hasExpired() {\n return (time.milliseconds() - this.lastRecordTime) > this.inactiveSensorExpirationTimeMs;\n }", "public boolean isExpired(){\r\n float empty = 0.0f;\r\n return empty == getAmount();\r\n \r\n }", "public boolean hasChanges();", "public boolean checkLegitTrans(JsonObject block){\n HashMap<String, Integer> balance = compute_balance(block);\n return Update_by_block(balance, block);\n }", "private static boolean checkIfToUpdateAfterCreateFailed(LocalRegion rgn, EntryEventImpl ev) {\n boolean doUpdate = true;\n if (ev.oldValueIsDestroyedToken()) {\n if (rgn.getVersionVector() != null && ev.getVersionTag() != null) {\n rgn.getVersionVector().recordVersion(\n (InternalDistributedMember) ev.getDistributedMember(), ev.getVersionTag());\n }\n doUpdate = false;\n }\n if (ev.isConcurrencyConflict()) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"basicUpdate failed with CME, not to retry:\" + ev);\n }\n doUpdate = false;\n }\n return doUpdate;\n }", "private boolean isTransactionAlreadySeen(Transaction tx){\n return allTransactions.contains(tx);\n }", "boolean hasTxnresponse();", "boolean updateDeathsTillForget() {\n\t\tdeathsTillForget -= 1;\n\t\treturn (deathsTillForget < 1);\n\t}", "boolean hasLedger();", "@Override\n\tpublic boolean isExpired() {\n\t\treturn model.isExpired();\n\t}", "@Override\n public boolean isAccountNonExpired() {\n return !locked;\n }", "@Override\n public boolean isUpToDate(String s, @Nullable Long oldValue) {\n return true;\n }", "public boolean isExpired() {\n\t\treturn this.maturityDt.before(Calendar.getInstance().getTime());\n\t}", "public boolean checkNewTrans(JsonObject block){\n \tJsonArray transactions = block.get(\"Transactions\").getAsJsonArray();\n \tint N = transactions.size();\n \tfor (int i=0; i<N; i++) {\n \t\tJsonObject Tx = transactions.get(i).getAsJsonObject();\n \t\tif (TxPool_used.contains(Tx))\n \t\t\treturn false;\n }\n return true;\n }", "boolean hasChangeStatus();", "private boolean isChangedOdoReading(MaintenanceRequest po){\n\t\tboolean isDiff = false;\n\t\tOdometerReading odoReading = null;\n\t\t\n\t\tif(!MALUtilities.isEmpty(po.getCurrentOdo())){\n\t\t\todoReading = odometerService.getOdometerReading(po);\t\t\t\n\t\t\tif(MALUtilities.isEmpty(odoReading)){\n\t\t\t\tisDiff = true;\n\t\t\t} else {\n\t\t\t\tif(po.getCurrentOdo() != odoReading.getReading() || !po.getActualStartDate().equals(odoReading.getReadingDate())){\n\t\t\t\t\tisDiff = true;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isDiff;\n\t}", "private boolean checkIfTransferHasBeenLongerThanAWeek(String lastTimeStamp, String currentTimeStamp) {\n // should be in same format now\n\n String[] previousDate = getDateFormatToCompare(lastTimeStamp);\n String[] currentDate = getDateFormatToCompare(currentTimeStamp);\n\n //2020-01-01T12:34:56.000Z\n //2020-01-07T13:14:52.777Z\n\n LOGGER.debug(\"Check for over week since last transfer default false\");\n return false;\n }", "public boolean hasTsUpdate() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "boolean hasTxnrequest();", "public boolean hasExpired() {\n return this.getOriginalTime() + TimeUnit.MINUTES.toMillis(2) < System.currentTimeMillis();\n }", "private void checkOcspResponseFresh(SingleResp resp) throws OCSPException\n {\n\n Date curDate = Calendar.getInstance().getTime();\n\n Date thisUpdate = resp.getThisUpdate();\n if (thisUpdate == null)\n {\n throw new OCSPException(\"OCSP: thisUpdate field is missing in response (RFC 5019 2.2.4.)\");\n }\n Date nextUpdate = resp.getNextUpdate();\n if (nextUpdate == null)\n {\n throw new OCSPException(\"OCSP: nextUpdate field is missing in response (RFC 5019 2.2.4.)\");\n }\n if (curDate.compareTo(thisUpdate) < 0)\n {\n LOG.error(curDate + \" < \" + thisUpdate);\n throw new OCSPException(\"OCSP: current date < thisUpdate field (RFC 5019 2.2.4.)\");\n }\n if (curDate.compareTo(nextUpdate) > 0)\n {\n LOG.error(curDate + \" > \" + nextUpdate);\n throw new OCSPException(\"OCSP: current date > nextUpdate field (RFC 5019 2.2.4.)\");\n }\n LOG.info(\"OCSP response is fresh\");\n }", "public boolean isOverdrawn() {\n return balance < 0;\n }", "@Override\n\t\tpublic boolean update(AccountTransaction t) {\n\t\t\treturn false;\n\t\t}", "@Override\r\n\tboolean hasUnsavedChanges();", "public boolean isTimeStampReached(long _timeStamp) {\n return (_timeStamp - getTime())<=0;\n }", "public boolean isDeletable() {\n \t\t\n \t\tlong currentAge = (new Date()).getTime() - timestamp;\n \t\t\n \t\tboolean retval = Math.abs(lat) > 89 || Math.abs(lon) > 179 || !inService || currentAge >= 1000*60*10;\n \t\t\n \t\t/*if (retval) {\n \t\t\tSystem.out.println(\"[\"+uid+\"] \"+\n \t\t\t\t\t\" Math.abs(lat) > 89:\"+(Math.abs(lat) > 89)+\n \t\t\t\t\t\" Math.abs(lon) > 179:\"+(Math.abs(lon) > 179) +\n \t\t\t\t\t\" !inService:\"+!inService+\n \t\t\t\t\t\" age >= 1000*60*10:\"+(age >= 1000*60*10));\n \t\t}*/\n \t\t\n \t\treturn retval;\n \t}", "public boolean expired(){\n return !Period.between(dateOfPurchase.plusYears(1), LocalDate.now()).isNegative();\n }", "public boolean isTransactionRunning();", "@java.lang.Override\n public boolean hasUpdateTime() {\n return updateTime_ != null;\n }", "public boolean hasTransaction() {\n\t\treturn (this.transactionStatus != null);\n\t}", "private boolean transactionCanBeEnded(Transaction tx) {\n return tx != null && !(tx.getStatus() != null && tx.getStatus().isOneOf(TransactionStatus.COMMITTED, TransactionStatus.ROLLED_BACK));\n }", "public boolean isOverdrawn() {\n return this.getBalance().compareTo(new BigDecimal(\"0\")) < 0;\n }", "private boolean checkTimeStamp(File file) {\n // uses sharedpreferences\n return (lastUpdate < file.getModifiedDate().getValue());\n }", "public final boolean hasChangeDateTime() {\n \treturn m_changeDate != 0L ? true : false;\n }", "private void doneUpdate(long transaction) throws RequestIsOutException {\n\t\t\tassert this.lastSentTransaction == null || transaction > this.lastSentTransaction;\n\t\t\t\n\t\t\tthis.sendLock.readLock().unlock();\n\t\t}", "public boolean isValid_ToBuyTicket() {\n if (this.tktSold < this.museum.getMaxVisit() && isNowTime_in_period()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean isStale() {\r\n\t\tfor( IFormPart part : _parts ) {\r\n\t\t\tif ( part.isStale() ) return true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isTooOld(){\n\t\tgetOlder();\n\t\treturn age >= maxAge;\n\t}", "public boolean hasPast();", "public boolean hasUpdate(VehicleState change) {\n\n return !this.equals(change);\n }", "public boolean wasDataUpdated() {\n\t\treturn true;\n\t}", "boolean hasCurrentStateTime();", "public boolean hasLedger() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "@Override\r\n public boolean isAccountNonExpired() {\r\n return true;\r\n }", "boolean hasUpdateTime();", "boolean hasUpdateTime();", "boolean hasUpdateTime();", "private boolean isOutdatedDate(LocalDate date) {\n return date.isBefore(LocalDate.now());\n }", "private static boolean updateRequired(Context context) {\r\n\t\tSharedPreferences pref = context.getSharedPreferences(\r\n\t\t\t\tUSER_ID_SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);\r\n\r\n\t\tif (pref.contains(LAST_UPDATE)) {\r\n\r\n\t\t\tLong lastUpdate = pref.getLong(LAST_UPDATE, -1);\r\n\t\t\tLong now = new Date().getTime();\r\n\r\n\t\t\treturn (now - lastUpdate) > TIME_IN_MILLIS;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public boolean checkEpochIsStale(final WorkContainer<K, V> workContainer) {\n return pm.checkEpochIsStale(workContainer);\n }", "public boolean isInvalidated() {\n\t\treturn invalidated;\n\t}", "boolean hasSettlementDate();", "public boolean hasUpdateTriggerTime() {\n return instance.hasUpdateTriggerTime();\n }", "protected boolean isTransactionRollback()\n {\n try\n {\n UMOTransaction tx = TransactionCoordination.getInstance().getTransaction();\n if (tx != null && tx.isRollbackOnly())\n {\n return true;\n }\n }\n catch (TransactionException e)\n {\n // TODO MULE-863: What should we really do?\n logger.warn(e.getMessage());\n }\n return false;\n }", "@Override\n public boolean isAccountNonExpired() {\n return true;\n }", "@Override\n public boolean isAccountNonExpired() {\n return true;\n }", "@Override\n public boolean isAccountNonExpired() {\n return true;\n }", "@Override\n public boolean isAccountNonExpired () {\n return true;\n }", "public boolean hasChanges() {\n return !(changed.isEmpty() && defunct.isEmpty());\n }", "@Override\n public boolean isTransActionAlive() {\n Transaction transaction = getTransaction();\n return transaction != null && transaction.isActive();\n }", "boolean isAccountNonExpired();", "boolean isAccountNonExpired();", "public boolean isNew() {\n return this.lastUpdateTime == NOT_YET;\n }", "protected void checkUpdate() {\n \t\t// only update from remote server every so often.\n \t\tif ( ( System.currentTimeMillis() - lastUpdated ) > refreshInterval ) return;\n \t\t\n \t\tClusterTask task = getSessionUpdateTask();\n \t\tObject o = CacheFactory.doSynchronousClusterTask( task, this.nodeId );\n \t\tthis.copy( (Session) o );\n \t\t\n \t\tlastUpdated = System.currentTimeMillis();\n \t}", "public Boolean isExpired() {\n\t\tCalendar today = Calendar.getInstance();\n\t\treturn today.get(Calendar.DAY_OF_YEAR) != date.get(Calendar.DAY_OF_YEAR);\n\t}", "public boolean isExpired() {\n return System.currentTimeMillis() > this.expiry;\n }", "public boolean hasLedger() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "@Override\n\tfinal public boolean hasDoneChanges() {\n\t\treturn false;\n\t}", "public boolean getStaleCheckingEnabled() {\n \t\treturn false;\n \t}", "boolean checkForExpiration() {\n boolean expired = false;\n\n // check if lease exists and lease expire is not MAX_VALUE\n if (leaseId > -1 && leaseExpireTime < Long.MAX_VALUE) {\n\n long currentTime = getCurrentTime();\n if (currentTime > leaseExpireTime) {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[checkForExpiration] Expiring token at {}: {}\",\n currentTime, this);\n }\n noteExpiredLease();\n basicReleaseLock();\n expired = true;\n }\n }\n\n return expired;\n }", "@Override\n public boolean isAccountNonExpired() {\n return false;\n }", "@Override\n public boolean isAccountNonExpired() {\n return false;\n }", "@Override\n public boolean isAccountNonExpired() {\n return false;\n }", "private boolean xmlGenerationRequired() {\r\n boolean xmlOutOfSync = false;\r\n BudgetSubAwardBean budgetSubAwardBean;\r\n for(int index = 0; index < data.size(); index++) {\r\n budgetSubAwardBean = (BudgetSubAwardBean)data.get(index);\r\n if(budgetSubAwardBean.getXmlAcType()!=null || budgetSubAwardBean.getXmlUpdateTimestamp() == null) {\r\n xmlOutOfSync = true;\r\n break;\r\n }\r\n }\r\n \r\n return xmlOutOfSync;\r\n }", "public boolean hasTsUpdate() {\n return ((bitField0_ & 0x00000200) == 0x00000200);\n }", "boolean hasStatusChanged();", "private boolean isDeltaValid() {\n\t\treturn deltaValid;\n\t}", "public boolean isRefreshRequired(Date lastDataRefresh) {\n Date cachedLastDataRefresh = (Date) mMemcache.get(MEMKEY_LASTDATAREFRESH);\n if (null != cachedLastDataRefresh && cachedLastDataRefresh.equals(lastDataRefresh)) {\n return false; \n } else {\n return true; \n }\n }", "boolean hasTradeDate();", "public boolean isEnd() { return (_dateExpiration - System.currentTimeMillis()) <= 0; }", "public boolean hasPassed(final long delta){\n return stamp + delta <= System.currentTimeMillis();\n }", "protected boolean isTransferTransactionValidEx(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// to account can be added to the state, asset type logic is questionable\n\t\t\t\n\t\t\tAccountBase account = new AccountBase(\n\t\t\t\t\t((StateTransferTransaction)tr).from,\n\t\t\t\t\t((StateTransferTransaction)tr).getNonce(),\n\t\t\t\t\t\"\",\n\t\t\t\t\t((StateTransferTransaction)tr).amount,\n\t\t\t\t\taccountFromModify.getAssetType());\t\n\t\t\taccounts.add(account);\n\t\t\t\n\t\t\taccountToIsGood = true;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "public boolean isAccountNonExpired() {\n\t\treturn true;\r\n\t}", "private boolean isTimeToDumpAgain() {\n return (!getSettings().isSituationChangeOnly() || !isPreviousCheckFailed()) && (getLastThreadDumpTime() == 0 ||\n getLastThreadDumpTime() + TimeUnit.MINUTES.toMillis(getSettings().getMinutesBetweenThreadDumps()) <\n System.currentTimeMillis());\n }", "public boolean isAccountNonExpired() {\n\t\treturn false;\r\n\t}", "public boolean isExpired() {\n return getExpiration() <= System.currentTimeMillis() / 1000L;\n }", "@Override\n\t\t\t\tpublic boolean isAccountNonExpired() {\n\t\t\t\t\treturn false;\n\t\t\t\t}" ]
[ "0.65731865", "0.62769204", "0.626305", "0.6258961", "0.6217091", "0.60436463", "0.59959173", "0.59612876", "0.59579027", "0.5956288", "0.590881", "0.59045553", "0.59045553", "0.58967334", "0.58233994", "0.580845", "0.5779026", "0.57550097", "0.5751448", "0.57498294", "0.5746451", "0.57382584", "0.57376635", "0.5728683", "0.5691448", "0.56893826", "0.5671058", "0.566173", "0.56570166", "0.56550616", "0.5651255", "0.56460744", "0.56455666", "0.56441975", "0.56362826", "0.5626304", "0.56181955", "0.5616271", "0.560975", "0.5595264", "0.55925137", "0.55909336", "0.55899876", "0.55773216", "0.55637604", "0.55618703", "0.555922", "0.5551276", "0.55484873", "0.55467886", "0.55234104", "0.55188304", "0.5516131", "0.55104595", "0.55097795", "0.5507909", "0.55061764", "0.5505923", "0.5505923", "0.5505923", "0.5504067", "0.55018157", "0.5500667", "0.5499061", "0.54982966", "0.5497122", "0.5494224", "0.5484699", "0.5484699", "0.5484699", "0.5483016", "0.54824984", "0.54822135", "0.54760563", "0.54760563", "0.54741156", "0.5473731", "0.5472336", "0.547103", "0.5458094", "0.5456917", "0.5454951", "0.5448759", "0.54463124", "0.54463124", "0.54463124", "0.5445767", "0.5436427", "0.5430596", "0.5426725", "0.54211724", "0.54184514", "0.5415729", "0.5414326", "0.5413157", "0.54020447", "0.5400509", "0.5397279", "0.53939426", "0.5393674" ]
0.76991117
0
Method to update the transaction summary for the new credit card record
private void updateTransactionSummary(final CreditCardTransactionDTO creditCardTransaction, final SortedSet<TransactionModel> transactions, final BigDecimal totalAmount) { final TransactionSummary updatedTransactionsData = new TransactionSummary(transactions, totalAmount); creditCardTransactionDao.updateTransactionSummary(creditCardTransaction.getHashedCreditCard(), updatedTransactionsData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testUpdateSummary() throws Exception {\r\n System.out.println(\"updateSummary\");\r\n LocalDate date = null;\r\n Summarizer instance = null;\r\n instance.updateSummary(date);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "private void updateSummary() {\n Bitmap cardBack;\n\n int selectedBackground = prefs.getSavedCardBackground();\n int selectedBackgroundColor = prefs.getSavedCardBackgroundColor();\n\n cardBack = bitmaps.getCardBack(selectedBackground, selectedBackgroundColor);\n\n image.setImageBitmap(cardBack);\n setSummary(String.format(Locale.getDefault(), \"%s %s\",\n context.getString(R.string.settings_background), selectedBackground + 1));\n }", "public void UpdateTransaction() {\n\t\tgetUsername();\n\t\tcol_transactionID.setCellValueFactory(new PropertyValueFactory<Account, Integer>(\"transactionID\"));\n\t\tcol_date.setCellValueFactory(new PropertyValueFactory<Account, Date>(\"date\"));\n\t\tcol_description.setCellValueFactory(new PropertyValueFactory<Account, String>(\"description\"));\n\t\tcol_category.setCellValueFactory(new PropertyValueFactory<Account, String>(\"category\"));\n\t\tcol_amount.setCellValueFactory(new PropertyValueFactory<Account, Double>(\"amount\"));\n\t\tmySqlCon.setUsername(username);\n\t\tlists = mySqlCon.getAccountData();\n\t\ttableTransactions.setItems(lists);\n\t}", "private void updateSummaryValues(SummaryValues sumValue) throws NbaDataAccessException {\n setSumValuesKeys(sumValue); //SPR2741\n copyPreviousSummaryValues(sumValue);\n nbaAcdb.updateSummaryValues(sumValue);\n }", "public void setSummary(String summary) {\n this.summary = summary;\n }", "private void updateTransactionFields() {\n if (transaction == null) {\n descriptionText.setText(\"\");\n executionDateButton.setText(dateFormat.format(new Date()));\n executionTimeButton.setText(timeFormat.format(new Date()));\n valueText.setText(\"\");\n valueSignToggle.setNegative();\n addButton.setText(R.string.add);\n // If we are editing a node, fill fields with current information\n } else {\n try {\n transaction.load();\n descriptionText.setText(transaction.getDescription());\n executionDateButton.setText(dateFormat.format(\n transaction.getExecutionDate()));\n executionTimeButton.setText(timeFormat.format(\n transaction.getExecutionDate()));\n BigDecimal value = transaction.getValue();\n valueText.setText(value.abs().toString());\n valueSignToggle.setToNumberSign(value);\n addButton.setText(R.string.edit);\n } catch (DatabaseException e) {\n Log.e(\"TMM\", \"Error loading transaction\", e);\n }\n }\n \n if (currentMoneyNode != null) {\n currencyTextView.setText(currentMoneyNode.getCurrency());\n }\n \n updateCategoryFields();\n updateTransferFields();\n }", "@Override\n public void updateDescription() {\n if(this.amount == 1) {\n this.description = DESCRIPTIONS[0];\n }\n else\n {\n this.description = DESCRIPTIONS[1] + this.amount + DESCRIPTIONS[2] + this.amount + DESCRIPTIONS[3];\n }\n\n }", "public void setSummary(String summary) {\n this.summary = summary;\n }", "private void updateTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(inputtedAmount);\n int categoryId = mCategory != null ? mCategory.getId() : 0;\n String description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n // Less: Repayment, More: Lend\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n\n boolean isDebtValid = true;\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n\n } // End DebtType() == Category.EnumDebt.LESS\n if(isDebtValid) {\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n Debt debt = mDbHelper.getDebtByTransactionId(mTransaction.getId());\n debt.setCategoryId(mCategory.getId());\n debt.setAmount(amount);\n debt.setPeople(tvPeople.getText().toString());\n\n int debtRow = mDbHelper.updateDebt(debt);\n if(debtRow == 1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } else {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) mTransaction.getId());\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } // End create new Debt\n\n } // End Update transaction OK\n } // End isDebtValid\n\n } else { // CATEGORY NORMAL\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n LogUtils.logLeaveFunction(Tag);\n }", "public VoucherSummary(CurrencyUnit currencyUnit) {\n this.currencyCode = currencyUnit;\n\t\tresetValues();\n\t}", "private void SummaryProfile() {\n //format the date & number\n DateFormat df = DateFormat.getDateInstance( DateFormat.LONG, Locale.ENGLISH );\n NumberFormat nf = NumberFormat.getCurrencyInstance( new Locale(\"id\",\"id\"));\n \n GregorianCalendar gregorian = new GregorianCalendar( );\n \n String[] displayMonths = new DateFormatSymbols().getMonths();\n \n //month and year variable ( month start from 0, so 0 is january, 11 is december )\n int gregorianmonth = gregorian.get(Calendar.MONTH);\n int gregorianyear = gregorian.get(Calendar.YEAR);\n \n \n //the title of the summary\n //ok, we must use temporary variable because of missmatch with db standard date\n int displaygregorianmonth = gregorianmonth;\n int displaygregorianyear = gregorianyear;\n \n //december watchout\n //if the current month is january ( 0 ) then we must display summary for \n //dec ( 11 ) last year ( current year - 1 )\n if(displaygregorianmonth==0) {\n displaygregorianmonth = 11;\n displaygregorianyear = gregorianyear - 1;\n }\n //if the current month is not january, then just minus it with one, current year is \n //same\n else {\n displaygregorianmonth -= 1;\n }\n DateLB.setText(\"Summary of the Company in \" + \n displayMonths[displaygregorianmonth] + \" \" + displaygregorianyear );\n \n //the summary report ( month start from 1 so no need minus anymore )\n SummarySaleLB.setText( \"Total Value of Sale Transaction : \" +\n nf.format( reportdb.TotalSaleValue( gregorianmonth,\n gregorianyear ) ) );\n SummaryPurchaseLB.setText( \"Total Value of Purchase Transaction : \" +\n nf.format( reportdb.TotalPurchaseValue( gregorianmonth,\n gregorianyear ) ) );\n SummarySalesmanCommisionLB.setText( \"Total Value of Salesman Commision Transaction : \" +\n nf.format( reportdb.TotalSalesmanCommisionValue( gregorianmonth,\n gregorianyear ) ) );\n SummarySalaryPaymentLB.setText( \"Total Value of Salary Payment Transaction : \" + \n nf.format( reportdb.TotalSalaryPaymentValue( gregorianmonth,\n gregorianyear ) ) );\n SummaryChargesLB.setText( \"Total Value of Outcome Payment Transaction : \" +\n nf.format( reportdb.TotalOutcomeValue( gregorianmonth,\n gregorianyear ) ) );\n \n }", "@Override\n public void updateDescription() {\n if (amount == 1) {\n description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[1];\n } else {\n description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[2];\n }\n }", "public void setSummary(String summary) {\n\t\tthis.summary = summary;\n\t}", "protected void updateSummaries() { }", "protected void updateSummaries() { }", "void setSummary(java.lang.String summary);", "public static Card summaryCard(String summary) {\n Card card = baseCard();\n card.setSummary(summary);\n return card;\n }", "@Override\n public void updateDescription() {\n if (amount == 1) {\n description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[1];\n } else if (amount > 1) {\n description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[2];\n }\n }", "@Test\n public void testSummaryChange() throws Exception {\n String changedSumamry = \"New summary\";\n EventData deltaEvent = prepareDeltaEvent(createdEvent);\n deltaEvent.setSummary(changedSumamry);\n updateEventAsOrganizer(deltaEvent);\n\n /*\n * Check that summary has been updated\n */\n AnalyzeResponse analyzeResponse = receiveUpdateAsAttendee(PartStat.ACCEPTED, CustomConsumers.ALL, changedSumamry, 1);\n AnalysisChange change = assertSingleChange(analyzeResponse);\n assertSingleDescription(change, changedSumamry);\n }", "int updateByPrimaryKey(CGcontractCredit record);", "@Test(groups = \"Transactions Tests\", description = \"Edit transaction\")\n\tpublic void editTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickEditBtnFromTransactionItem(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionDescription(\"Bonus\");\n\t\tTransactionsScreen.typeTransactionAmount(\"600\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Bonus\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$600\"));\n\t\ttest.log(Status.PASS, \"Sub-account edited successfully and the value is correct\");\n\n\t\t//Testing if the edited transaction was edited in the 'Double Entry' account, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"Bonus\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$600\"));\n\t\ttest.log(Status.PASS, \"Transaction in the 'Double Entry' account was edited too and the value is correct\");\n\n\t}", "@Override\n public void updateDescription() {\n description = DESCRIPTIONS[0]+ ReceiveBlockAmount + DESCRIPTIONS[1];\n }", "@Override\n public void updateDescription() {\n if(this.amount == 1) {\n this.description = DESCRIPTIONS[0] + DESCRIPTIONS[1];\n }\n else {\n this.description = DESCRIPTIONS[0] + DiminishingStacks + DESCRIPTIONS[2];\n }\n\n }", "public int update(FCouncilSummaryDO FCouncilSummary) throws DataAccessException {\n \tif (FCouncilSummary == null) {\n \t\tthrow new IllegalArgumentException(\"Can't update by a null data object.\");\n \t}\n\n\n return getSqlMapClientTemplate().update(\"MS-F-COUNCIL-SUMMARY-UPDATE\", FCouncilSummary);\n }", "@Override\r\n\tpublic void updateDetailsTable(Kit kitToUpdate) {\n\t\tTableItem tblItems[]= tblCinCoutDetails.getItems();\r\n\t\tfor(TableItem tblItem:tblItems){\r\n\t\t\tif(tblItem.getText(0).equalsIgnoreCase(kitToUpdate.getKitSerialNum())){\r\n\t\t\t\t//tblItem.setText(0, kitToUpdate.getKitSerialNum());\r\n\t\t\t\ttblItem.setText(1, kitToUpdate.getKitCheckInDate().toString());\r\n\t\t\t\t//tblItem.setText(2, kitToUpdate.getKitCheckOutDate().toString());\r\n\t\t\t\t//tblItem.setText(3, kitToUpdate.getKitCourse().getCourseName());\r\n\t\t\t\t//tblItem.setText(4, kitToUpdate.getKitPenalty()+\"\");\r\n\t\t\t\t//tblItem.setText(5, kitToUpdate.getKitType());\r\n\t\t\t\t//tblItem.setText(6, kitToUpdate.getStudentEmailKit());\r\n\t\t\t\t//tblItem.setText(7, kitToUpdate.getStudentNameForKit());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void updateMetaData() {\r\n System.out.println(\"RefactoringAction.updateMetaData()\");\r\n System.out.flush();\r\n CurrentSummary.get().updateMetaData();\r\n }", "void update(Card card) throws PersistenceCoreException;", "private void generatedNewCredits(Locale locale, PdfPTable paymentMethodTable, BigDecimal newCreditAmount) {\n if (newCreditAmount != null && newCreditAmount.intValue() != new BigDecimal(0).intValue()) {\n String message = getMessage(locale, \"pdf.receipt.newCreditsIssued\");\n Font font = getFont(GREEN_COLOR, FONT_SIZE_12, Font.NORMAL);\n PdfPCell generatedCreditsCell = new PdfPCell(new Phrase(message, font));\n PdfPCell generatdCreditAmountCell = new PdfPCell(new Phrase(getFormattedAmount(newCreditAmount), font));\n cellAlignment(generatedCreditsCell, Element.ALIGN_LEFT, GRAY_COLOR, 0);\n cellAddingToTable(paymentMethodTable, generatedCreditsCell, Rectangle.NO_BORDER, 0, 0);\n\n cellAlignment(generatdCreditAmountCell, Element.ALIGN_RIGHT, GRAY_COLOR, 0);\n cellAddingToTable(paymentMethodTable, generatdCreditAmountCell, Rectangle.NO_BORDER, 0, 0);\n }\n }", "private static void recalculateSummary(Sheet sheet, Payment payment) {\r\n BigDecimal income =(BigDecimal) sheet.getCellAt(\"B1\").getValue();\r\n BigDecimal expense = (BigDecimal) sheet.getCellAt(\"B2\").getValue();\r\n BigDecimal sum = (BigDecimal) sheet.getCellAt(\"B3\").getValue();\r\n \r\n if (payment.getType() == PaymentType.INCOME){\r\n sum = sum.add(payment.getAmount());\r\n income = income.add(payment.getAmount());\r\n } else if (payment.getType() == PaymentType.EXPENSE){\r\n sum = sum.subtract(payment.getAmount());\r\n expense = expense.add(payment.getAmount());\r\n }\r\n \r\n sheet.getCellAt(\"B1\").setValue(income);\r\n sheet.getCellAt(\"B2\").setValue(expense);\r\n sheet.getCellAt(\"B3\").setValue(sum);\r\n }", "private void updateFields(){\n\n updateTotalPay();\n updateTotalTip();\n updateTotalPayPerPerson();\n }", "public void updateTransaction(Transaction trans);", "@Override\n\tpublic void updateTotalCost(String card, double cost) {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = DbcpConnectionPool.getConnection();\n\t\t\tCallableStatement cstmt = conn.prepareCall(\"{call Member_updateTotalCost(?,?)}\");\n\t\t\tcstmt.setString(1, card);\n\t\t\tcstmt.setDouble(2, cost);\n\t\t\tcstmt.executeUpdate();\n\t\t\tcstmt.close();\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void updateCardInventory() {\n try {\n if (cardInventoryDataBean != null) {\n String response = cardInventoryTransformerBean.updateCardInventory(cardInventoryDataBean);\n if (SystemConstantUtil.SUCCESS.equals(response)) {\n messageDataBean.setMessage(\"CardInventory updated successfully.\");\n messageDataBean.setIsSuccess(Boolean.TRUE);\n retrieveCardInventoryList();\n cardInventoryDataBean.setNull();\n } else {\n System.out.println(\"CardInventory not created\");\n messageDataBean.setMessage(response);\n messageDataBean.setIsSuccess(Boolean.FALSE);\n }\n }\n } catch (Exception e) {\n System.out.println(e);\n messageDataBean.setMessage(\"Error =>\" + e.toString());\n messageDataBean.setIsSuccess(Boolean.FALSE);\n }\n }", "public static void updateSummaryTable() {\n tableModel.fireTableDataChanged();\n tableModel.fireTableStructureChanged();\n window.resetSize();\n\n window.setComboBox();\n showWindow();\n }", "@Override\r\n\tpublic void updateTranCode(Purchase Purchase) throws Exception {\n\t\t\r\n\t}", "public void update(PaymentSummary object)\n throws SQLException {\n List params = fromObjectToBean(object).toList();\n params.add(object.getId());\n this.execute(new ParametricStatement[] {\n new ParametricStatement(updateSql, params)\n });\n }", "public void setSummary(String summary) {\r\n this.summary = summary == null ? null : summary.trim();\r\n }", "public void setSummary(String summary) {\n this.summary = summary == null ? null : summary.trim();\n }", "private void updateNutritionRecord(Context ctx, ResultSet rs) throws SQLException, ParseException {\r\n Date timestamp = ctx.getTimestamp(\"date\", \"time\");\r\n String item = ctx.getParameter(\"item\");\r\n String source = ctx.getParameter(\"source\");\r\n String quantity = ctx.getParameter(\"quantity\");\r\n String abv = ctx.getParameter(\"abv\");\r\n \r\n if (rs.next()) {\r\n if (ctx.getAppDb().getProtocol().equalsIgnoreCase(\"sqlserver\")) {\r\n rs.moveToCurrentRow();\r\n rs.updateString(\"Quantity\", quantity);\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.updateRow(); \r\n } else {\r\n SQLUpdateBuilder sql = ctx.getUpdateBuilder(\"NutritionRecord\");\r\n \r\n sql.addField(\"Quantity\", quantity);\r\n \r\n if (abv.length() != 0) sql.addField(\"ABV\", abv);\r\n \r\n sql.addAnd(\"Timestamp\", \"=\", timestamp);\r\n sql.addAnd(\"Item\", \"=\", item);\r\n sql.addAnd(\"Source\", \"=\", source);\r\n executeUpdate(ctx, sql);\r\n }\r\n } else {\r\n rs.moveToInsertRow();\r\n rs.updateString(\"Timestamp\", ctx.getDbTimestamp(timestamp));\r\n rs.updateString(\"Item\", ctx.getParameter(\"item\"));\r\n rs.updateString(\"Source\", ctx.getParameter(\"source\"));\r\n rs.updateString(\"Quantity\", quantity);\r\n rs.updateString(\"IsComposite\", ctx.getParameter(\"simple\").equalsIgnoreCase(\"c\") ? \"Y\" : \"N\");\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.insertRow();\r\n }\r\n }", "void fillEditTransactionForm(Transaction transaction);", "private void updateCardBalanceUI() {\n exactAmount.setText(decimalFormat.format(cardBalance));\n }", "private void refreshDetails() {\r\n\t\tdetailsLabel.setText( getSummary() );\r\n\t\tdetailsLabel.repaint();\r\n\t}", "public void updateTotalSpentLabel() {\n totalSpentLabel.setText(\"Total: $\" + duke.expenseList.getTotalAmount());\n }", "public void setSummary(boolean summary) {\n\n this.summary = summary;\n }", "public void credit() {\n\t\tSystem.out.println(\"HSBC---credit\");\n\t}", "public void credit() {\n\t\tSystem.out.println(\"HSBC---credit\");\n\t}", "public void showCustomSummary() {\n editSummaryFragment.show();\n }", "public void editContestPayment(ContestPayment contestPayment) throws ContestManagementException {\n \r\n }", "public void editContestPayment(ContestPayment contestPayment) throws ContestManagementException {\n \r\n }", "public String getSummary() {\r\n return summary;\r\n }", "protected void updateSummary() {\n int index = tabbedPane.getSelectedIndex();\n int modGroesse = 0;\n int modEntfernung = 0;\n int modBewegung = 0;\n int modSicht = 0;\n int modModifikatoren = 0;\n int modGezielt = 0;\n int resultat = 0;\n \n if(index == 6) {\n modGroesse = berechneErschwerungGroesse();\n modEntfernung = berechneErschwerungEntfernung();\n modBewegung = berechneErschwerungBewegung();\n modSicht = berechneErschwerungSicht();\n modModifikatoren = berechneErschwerungModifikatoren();\n modGezielt = berechneErschwerungGezielterSchuss();\n \n resultat = modGroesse + modEntfernung + modBewegung + modSicht + modModifikatoren + modGezielt;\n erschwernis = resultat;\n }\n \n lblErschwernisZielgroesseValue.setText(String.valueOf(modGroesse));\n lblErschwernisEntfernungValue.setText(String.valueOf(modEntfernung));\n lblErschwernisBewegungValue.setText(String.valueOf(modBewegung));\n lblErschwernisSichtValue.setText(String.valueOf(modSicht));\n lblErschwernisModifikatorenValue.setText(String.valueOf(modModifikatoren));\n lblErschwernisGezielterSchussValue.setText(String.valueOf(modGezielt));\n \n lblKompletteErschwernisValue.setText(String.valueOf(resultat));\n }", "public void printPaymentSummary() {\n System.out.print(\"+========================+\\n\");\n System.out.print(\"| Payment Summary |\\n\");\n System.out.print(\"+========================+\\n\");\n System.out.printf(\"Payment_ID: %s\\n\", payment_id);\n System.out.printf(\"STAFF_NAME: %s\\t\\t\\tSTAFF_ID : %s\\n\", order_staff.getName().toUpperCase(),\n order_staff.getId());\n System.out.printf(\"CUST_NAME : %s\\t\\tCurrent_Date: %s\\n\", order_member.getName().toUpperCase(),\n java.time.LocalDate.now());\n System.out.printf(\"CUST_ICNO : %s\\t\\tCurrent_Time: %s\\n\", order_member.getMemberIC(),\n java.time.LocalTime.now());\n System.out.print(\"----------------------------------------------------------------\\n\");\n System.out.printf(\"Total : %.2f\\n\", total_sales_of_transaction);\n System.out.printf(\"Payment Type Used : %s\\n\", payment_used);\n System.out.printf(\"Bike Brand : %s\\n\", order.getBike().getBrand());\n System.out.printf(\"Bike Price : %.2f\\n\", order.getBike().getPrice());\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n }", "private void updrec() {\n\t\tsavedata();\n\t\tcontractDetail.retrieve(stateVariable.getXwordn(), stateVariable.getXwabcd());\n\t\tnmfkpinds.setPgmInd36(! lastIO.isFound());\n\t\tnmfkpinds.setPgmInd66(isLastError());\n\t\t// BR00011 Product found on Contract_Detail and NOT ERROR(CONDET)\n\t\tif (! nmfkpinds.pgmInd36() && ! nmfkpinds.pgmInd66()) {\n\t\t\trestoredata();\n\t\t\tcontractDetail.update();\n\t\t\tnmfkpinds.setPgmInd99(isLastError());\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"Y2U0007\", \"\", msgObjIdx, messages);\n\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t}\n\t}", "public void credit() {\n \tSystem.out.println(\"HSBC--Credit--from US Bank\");\n }", "public String getSummary() {\n return summary;\n }", "private void updateCustomerCredit(BusinessPartner businessPartner, BigDecimal amount, boolean add) {\n OBDal.getInstance().refresh(businessPartner);\n BigDecimal creditUsed = businessPartner.getCreditUsed();\n if (add) {\n creditUsed = creditUsed.add(amount);\n } else {\n creditUsed = creditUsed.subtract(amount);\n }\n businessPartner.setCreditUsed(creditUsed);\n OBDal.getInstance().save(businessPartner);\n OBDal.getInstance().flush();\n }", "private void updateTotal() {\n int total = table.getTotal();\n vip.setConsumption(total);\n if (total > 0)\n payBtn.setText(PAY + RMB + total);\n else if (total == 0)\n payBtn.setText(PAY);\n }", "@Override\n\tpublic void wrapSummary(Customer model, HttpServletRequest request) {\n\t\t\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewCapitalPayed();", "@JsonProperty(\"summary\")\n public void setSummary(String summary) {\n this.summary = summary;\n }", "@Override\r\n\tpublic int editReportByStudent(ReportAndSummary reportAndSummary) {\n\t\tStudent s = studentDao.findById(reportAndSummary.getStudent().getId());\r\n\t\tList<ClassTeacherRelationship> c = allocateClassDao.findByClassId(s.getClassId().getId());\r\n\t\treportAndSummary.setTrainningTeacher(c.get(0).getTrainningTeacher());\r\n\t\tint result = reportAndSummaryDao.editReportByStudent(reportAndSummary);\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic int updateInventory(int tranNo, int amount) throws Exception {\n\t\treturn 0;\n\t}", "private void editUserCard() {\n getUserCard();\n }", "public void setCredit(int credit) {\n this.credit = credit;\n }", "void updateCustomerDDPay(CustomerDDPay cddp);", "protected void updateCartInfoUI() {\n SharedPref.putCartitesmQty(getContext(), mCartInfo.getSummaryQty());\n this.updateCartTotal();\n// updateMenu();\n }", "public void setSummary(java.lang.String summary)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SUMMARY$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SUMMARY$18);\n }\n target.setStringValue(summary);\n }\n }", "void onAddEditCardSuccess(long rowID);", "public java.lang.String getSummary(){\r\n return this.summary;\r\n }", "public void updateScoreCard(){\n scoreCard.setText(correct+\"/\"+total);\n }", "public void credit() {\n\t System.out.println(\"HSBC--Credit\");\t\t\n\t}", "int updateBalance(CardVO cv) throws RemoteException;", "@Override\r\n public void update() {\r\n this.total = calculateTotal();\r\n }", "private void creditFundingSection(Locale locale, PdfPTable paymentMethodTable, BigDecimal amount) {\n String message = getMessage(locale, \"pdf.receipt.creditsApplied\");\n Font font = getFont(null, FONT_SIZE_12, Font.NORMAL);\n PdfPCell pinLabelCell = new PdfPCell(new Phrase(message, font));\n PdfPCell amountLabelCell = new PdfPCell(new Phrase(getFormattedAmount(amount), font));\n cellAlignment(pinLabelCell, Element.ALIGN_LEFT, GRAY_COLOR, 0);\n cellAddingToTable(paymentMethodTable, pinLabelCell, Rectangle.NO_BORDER, 0, 15);\n cellAlignment(amountLabelCell, Element.ALIGN_RIGHT, GRAY_COLOR, Element.ALIGN_BOTTOM);\n cellAddingToTable(paymentMethodTable, amountLabelCell, Rectangle.NO_BORDER, 0, 0);\n }", "private void setCard(@NonNull Card card) {\n Debug.trace(\"CardDetails\", card.toString());\n etCardNumber.setText(card.getCardNumber());\n etCardHolderName.setText(card.getCardHolderName());\n// etCardExpiryDate.removeTextListener();\n etCardExpiryDate.setText(DateFormatUtils.stringToStringConversion(card.getExpirationDate(), \"MM/yy\", \"MM/yyyy\"));\n// etCardExpiryDate.addDateSlash(etCardExpiryDate.getEditableText());\n// etCardExpiryDate.addTextListener();\n }", "public void updatebal(String cname, String amt1) {\nString countQuery = \"SELECT Balance FROM \" + DATABASE_TABLE1+\" WHERE Name='\"+cname+\"'\";\n\t \n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t int d=cursor.getColumnIndex(\"Balance\");\n\t\tString cbal=null;\n\t\tfor(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()){\n\t\t\tcbal=cursor.getString(d);\n\t\t\t\n\t\t}\n\t\tint cur=Integer.parseInt(cbal);\n\t\tcur=cur+Integer.parseInt(amt1);\n\t ContentValues up=new ContentValues();\n\t up.put(Com_Balance, cur);\n\t\tourDatabase.update(DATABASE_TABLE1, up, Com_Name+\" = '\"+cname+\"'\", null);\n\t\t\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewCapital();", "public void credit() {\n\t\tSystem.out.println(\"HSBC Credit\");\n\t}", "public void onClick(View v) {\n dbHandler.addEntry(\"credit\",creditamount.getText().toString(),creditreason.getText().toString());\n creditamount.setText(\"\");\n creditreason.setText(\"\");\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewAmount();", "public void credit(){\n\t\tSystem.out.println(\"HSBC BANK :: CREDIT\");\n\t}", "private void updateRecord(){\r\n\t\tgameStats.setVictory(victory);\r\n\t\tgameStats.setDays(days);\r\n\t\tgameStats.setBuildings(buildingCount);\r\n\t\tgameStats.setResources(wood + stone + food);\r\n\t}", "public String getSummary() {\n\t\treturn summary;\n\t}", "public String getSummary() {\n\t\treturn summary;\n\t}", "public void setCreditCardAccount(CreditCardAccount newCreditCard) {\n this.creditCardAccount = newCreditCard;\n }", "public void companyPayRoll(){\n calcTotalSal();\n updateBalance();\n resetHoursWorked();\n topBudget();\n }", "public void credit(){\n\t\tSystem.out.println(\"hsbc --- credit\");\n\t}", "public void updateReportCard(ReportCardModel inputModel) {\n System.out.println(\"ReportCardDao.updateReportCard \" + \"start\");\n // TODO: Implement this function.\n Transaction trans = Datastore.beginTransaction();\n \n Datastore.put(trans, inputModel);\n \n trans.commit();\n System.out.println(\"ReportCardDao.updateReportCard \" + \"end\");\n }", "Transfer updateTransactionNumber(Long id, String transactionNumber);", "private void checkTheSummaryInformation(int slots) {\n int newSlotTotal = Integer.valueOf(driverWrapper.getData(\"slotsBalance\")) + slots;\n assertTrue(\"The slot balance total is incorrect\",\n driverWrapper.getElementText(\"successMessage\").contains(String.valueOf(newSlotTotal)));\n\n //And I check the slots are correct\n assertTrue(\"The slots purchased are incorrect\",\n driverWrapper.getElementText(\"amountOrdered\").contains(String.valueOf(slots)));\n\n //And I check the total cost is correct\n DecimalFormat df = new DecimalFormat(\"#,###.00\");\n String totalCost = df.format(slots * slotCost);\n assertTrue(\"The total cost was incorrect\",\n driverWrapper.getElementText(\"totalCost\").contains(totalCost));\n }", "int updateAccountInfo(Account account);", "public void setSummary(java.lang.Boolean summary) {\n this.summary = summary;\n }", "private void returnCardFundingSourceInfo(PdfPTable paymentSectionTable, PdfPCell cardNumberCell, Locale locale\n , BigDecimal amount, Date date) {\n PdfPCell amountSectionCell =\n new PdfPCell(new Phrase(getFormattedAmount(amount), getFont(null, FONT_SIZE_12, Font.NORMAL)));\n cellAlignment(cardNumberCell, Element.ALIGN_LEFT, GRAY_COLOR, 0);\n cellAddingToTable(paymentSectionTable, cardNumberCell, Rectangle.NO_BORDER, 2, 15);\n\n cellAlignment(amountSectionCell, Element.ALIGN_RIGHT, GRAY_COLOR, 0);\n cellAddingToTable(paymentSectionTable, amountSectionCell, Rectangle.NO_BORDER, 0, 0);\n String message = getMessage(locale, \"pdf.receipt.refunded\", convertToDate(date.getTime()));\n PdfPCell amountChangedOnCell = new PdfPCell(new Phrase(message, getFont(null, FONT_SIZE_10, Font.ITALIC)));\n cellAlignment(amountChangedOnCell, Element.ALIGN_LEFT, GRAY_COLOR, 0);\n cellAddingToTable(paymentSectionTable, amountChangedOnCell, Rectangle.NO_BORDER, 3, 15);\n PdfPCell localBlankSpaceCell = new PdfPCell(new Phrase(\" \", getFont(WHITE_COLOR, 8, Font.BOLD)));\n cellAlignment(localBlankSpaceCell, 0, GRAY_COLOR, 0);\n cellAddingToTable(paymentSectionTable, localBlankSpaceCell, Rectangle.NO_BORDER, 3, 0);\n }", "public void creditCard() {\n\t\tSystem.out.println(\"hsbc --- credit card\");\n\t\t\n\t}", "public void displayTotalCash(int tc) {\n\t\tString stc;\n\n\t\tstc = new String(tc + \" C\");\n\t\ttotalCash.setValue(stc);\n\t}", "private void submitTransaction() {\n String amountGiven = amount.getText().toString();\n double decimalAmount = Double.parseDouble(amountGiven);\n amountGiven = String.format(\"%.2f\", decimalAmount);\n String sourceGiven = source.getText().toString();\n String descriptionGiven = description.getText().toString();\n String clientId = mAuth.getCurrentUser().getUid();\n String earnedOrSpent = \"\";\n\n if(amountGiven.isEmpty()){\n amount.setError(\"Please provide the amount\");\n amount.requestFocus();\n return;\n }\n\n if(sourceGiven.isEmpty()){\n source.setError(\"Please provide the source\");\n source.requestFocus();\n return;\n }\n\n if(descriptionGiven.isEmpty()){\n descriptionGiven = \"\";\n }\n\n int selectedRadioButton = radioGroup.getCheckedRadioButtonId();\n\n if(selectedRadioButton == R.id.radioSpending){\n Log.d(\"NewTransactionActivity\", \"Clicked on Spending\");\n earnedOrSpent = \"Spent\";\n }\n else{\n Log.d(\"NewTransactionActivity\", \"Clicked on Earning\");\n earnedOrSpent = \"Earned\";\n }\n\n storeTransactionToDatabase(clientId, earnedOrSpent, amountGiven, sourceGiven, descriptionGiven);\n\n }", "public void updateStats(int credit, int winProgress,int score) {\n creditLabel.setText(\"<html><b> \" + \"$$$: </b>\" +Integer.toString(credit)\n + \"</html>\");\n\n winProgressLabel.setText(\"<html><b> \" + \"WinProgress: </b>\" +\n winProgress + \"/\" + winCondition);\n //add(winProgressLabel);\n\n scoreLabel.setText(\"<html><b> \" + \"Score: </b>\" +Integer.toString(score)\n + \"</html>\");\n //add(scoreLabel);\n }", "@Override\r\n public String showConsumerLoanInfo(Credit credit) {\n return credit.getCredit();\r\n }", "public void setPaymentInfoInCart(CreditCard cc);", "public void updateCard(Card card) {\n this.card.setValue(card);\n }" ]
[ "0.60972077", "0.59916", "0.5979963", "0.59292924", "0.5833098", "0.5824401", "0.5814446", "0.58008033", "0.57731235", "0.577135", "0.5720736", "0.56711745", "0.56541365", "0.5652553", "0.5652553", "0.56183493", "0.5594638", "0.55840755", "0.55704165", "0.55402386", "0.55258524", "0.55204767", "0.5520168", "0.5512119", "0.54983616", "0.5486871", "0.5476081", "0.54324377", "0.54248047", "0.53876895", "0.5365593", "0.5331322", "0.5327961", "0.5320671", "0.5308821", "0.530747", "0.52669597", "0.5264526", "0.52603567", "0.52542317", "0.5237792", "0.52361286", "0.52344584", "0.52215624", "0.52024984", "0.52024984", "0.5196087", "0.5193242", "0.5193242", "0.5190297", "0.5182176", "0.51821095", "0.51774836", "0.517026", "0.5170242", "0.5159964", "0.515888", "0.5157095", "0.515402", "0.5152928", "0.5149125", "0.5146756", "0.51410407", "0.5140047", "0.5130504", "0.51294714", "0.51227504", "0.5122544", "0.5099114", "0.5094659", "0.5092819", "0.50825846", "0.50786394", "0.5073488", "0.50719047", "0.50712264", "0.5063919", "0.50627923", "0.50568473", "0.50527394", "0.50454426", "0.50355786", "0.5034357", "0.5034357", "0.5032228", "0.50097305", "0.5007963", "0.5004125", "0.50018644", "0.49984875", "0.49857694", "0.4984477", "0.4980931", "0.49779755", "0.4974669", "0.49710727", "0.49665076", "0.4963968", "0.4962328", "0.49594015" ]
0.74603134
0
This function will place the block in the top residual space
public void placeBlockInTopResSpace(Block block, TT tt){ ResidualSpace res = rs_stack.pop(); // Place the block, this also updates the locations of the parcels inside it block.setLocation(res.getLocation().clone()); block_placements.add(block.getId()); // Add the id of the placed block for(Parcel p:block.getPacking()){ packing.addParcel(p); } this.total_value = packing.getTotalValue(); // Update the hashkey // hashKey = tt.updateHash(hashKey, block_placements.size(), block.getId()); // Remove parcels from the availability removeFromBres(block); // Calculate the new residual spaces generateDaughterResSpaces(block, res); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CLIJ2_ResliceRadialTopBlock() {\n super(new ResliceRadialTop());\n }", "public void updateMainBlock() {\n\t\tthis.mainblock = player.getWorld().getBlockAt(player.getLocation().add(0, -1, 0));\n\t}", "Tetrisblock()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "Tetrisblock2()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "private void prepare()\n {\n Block block = new Block(10);\n addObject(block,372,150);\n Wall wall = new Wall();\n addObject(wall,52,167);\n Wall wall2 = new Wall();\n addObject(wall2,160,167);\n Wall wall3 = new Wall();\n addObject(wall3,550,167);\n Wall wall4 = new Wall();\n addObject(wall4,650,167);\n Wall wall5 = new Wall();\n addObject(wall5,750,167);\n block.setLocation(306,171);\n Robot robot = new Robot();\n addObject(robot,48,51);\n Pizza pizza = new Pizza();\n addObject(pizza,550,60);\n Pizza pizza2 = new Pizza();\n addObject(pizza2,727,53);\n Pizza pizza3 = new Pizza();\n addObject(pizza3,364,303);\n Pizza pizza4 = new Pizza();\n addObject(pizza4,224,400);\n Pizza pizza5 = new Pizza();\n addObject(pizza5,622,395);\n ScorePanel scorePanel = new ScorePanel();\n addObject(scorePanel,106,525);\n Home home = new Home();\n addObject(home,717,521);\n\n block.setLocation(344,173);\n pizza3.setLocation(394,297);\n Pizza pizza6 = new Pizza();\n addObject(pizza6,711,265);\n Pizza pizza7 = new Pizza();\n addObject(pizza7,68,276);\n\n }", "private void prepare()\n {\n MazeBlock mazeBlock = new MazeBlock();\n addObject(mazeBlock,25,25);\n MazeBlock mazeBlock1 = new MazeBlock();\n addObject(mazeBlock1,25,75);\n MazeBlock mazeBlock2= new MazeBlock();\n addObject(mazeBlock2,75,75);\n MazeBlock mazeBlock3= new MazeBlock();\n addObject(mazeBlock3,75,125);\n MazeBlock mazeBlock4= new MazeBlock();\n addObject(mazeBlock4,125,125);\n MazeBlock mazeBlock5= new MazeBlock();\n addObject(mazeBlock5,175,125);\n MazeBlock mazeBlock6= new MazeBlock();\n addObject(mazeBlock6,225,125);\n MazeBlock mazeBlock7= new MazeBlock();\n addObject(mazeBlock7,275,125);\n MazeBlock mazeBlock8= new MazeBlock();\n addObject(mazeBlock8,275,175);\n MazeBlock mazeBlock9= new MazeBlock();\n addObject(mazeBlock9,275,225);\n MazeBlock mazeBlock10= new MazeBlock();\n addObject(mazeBlock10,275,275);\n MazeBlock mazeBlock11= new MazeBlock();\n addObject(mazeBlock11,275,325);\n MazeBlock mazeBlock12= new MazeBlock();\n addObject(mazeBlock12,325,325);\n MazeBlock mazeBlock13= new MazeBlock();\n addObject(mazeBlock13,375,325);\n MazeBlock mazeBlock14= new MazeBlock();\n addObject(mazeBlock14,425,275);\n MazeBlock mazeBlock15= new MazeBlock();\n addObject(mazeBlock15,475,275);\n MazeBlock mazeBlock16= new MazeBlock();\n addObject(mazeBlock16,125,325);\n MazeBlock mazeBlock17= new MazeBlock();\n addObject(mazeBlock17,125,375);\n MazeBlock mazeBlock18= new MazeBlock();\n addObject(mazeBlock18,125,425);\n MazeBlock mazeBlock19= new MazeBlock();\n addObject(mazeBlock19,175,425);\n MazeBlock mazeBlock20= new MazeBlock();\n addObject(mazeBlock20,225,425);\n\n EnemyFlyer enemyFlyer = new EnemyFlyer();\n addObject(enemyFlyer,29,190);\n EnemyFlyer enemyFlyer3 = new EnemyFlyer();\n addObject(enemyFlyer3,286,389);\n WalkingEnemy walkingEnemy = new WalkingEnemy(true);\n addObject(walkingEnemy,253,293);\n walkingEnemy.setLocation(125,275);\n WalkingEnemy walkingEnemy2 = new WalkingEnemy(false);\n addObject(walkingEnemy2,28,81);\n walkingEnemy2.setLocation(170,82);\n FinalLevel finalLevel = new FinalLevel();\n addObject(finalLevel, 508, 45);\n Hero hero = new Hero();\n addObject(hero,62,499);\n }", "public void createSideBlocks() {\n Fill fill = new FillColor(Color.darkGray);\n Block topB = new Block(new Rectangle(new Point(0, 0), 800, 45), fill);\n Block rightB = new Block(new Rectangle(new Point(775, 25), 25, 576), fill);\n Block leftB = new Block(new Rectangle(new Point(0, 25), 25, 576), fill);\n //add each screen-side block to game and set 1 hitpoint.\n topB.addToGame(this);\n topB.setHitPoints(1);\n rightB.addToGame(this);\n rightB.setHitPoints(1);\n leftB.addToGame(this);\n leftB.setHitPoints(1);\n }", "private void addStackBlocks() {\n\n for (int x = numBlocks; x > 0; x--) {\n\n double blockHeight = totalBLockHeight / numBlocks;\n double blockWidthChange = (maxBlockWidth - minBlockWidth) / numBlocks;\n double blockWidth = minBlockWidth + ((x - 1) * blockWidthChange);\n\n TowerBlock newBlock = new TowerBlock(blockWidth, blockHeight, x);\n towerOne.push(newBlock);\n\n }\n addBlocks = false;\n\n }", "RclBlock createRclBlock();", "private static void craftSlab(Block block)\r\n\t{\r\n\t\tBlockExtraSlab input = ((BlockExtraSlab)block);\r\n\t\tBlock parent = input.getParent();\r\n\t\tint parentMeta = input.getParentMeta();\r\n\t\t\r\n\t\tGameRegistry.addRecipe(new ItemStack(block, 6, 0), new Object[] { \"###\", '#', new ItemStack(parent, 1, parentMeta) });\r\n\t\tGameRegistry.addRecipe(new ItemStack(parent, 1, parentMeta), new Object[] { \"#\", \"#\", '#', new ItemStack(block) });\r\n\t}", "public void preSetup(){\n // Any of your pre setup before the loop starts should go here\n \n // border\n blocks[0] = new Rectangle(0, 0, 25, 600);\n blocks[1] = new Rectangle(775, 0, 25, 600);\n blocks[2] = new Rectangle(0, 0, 800, 25);\n blocks[3] = new Rectangle(0, 575, 800, 25);\n \n // starting room\n // right wall\n blocks[5] = new Rectangle(WIDTH / 2 + 75, 400, 25, 150);\n // left wall\n blocks[10] = new Rectangle(WIDTH / 2 - 100, 400, 25, 150);\n // centre\n blocks[7] = new Rectangle(WIDTH / 2 - 10, 450, 20, 150);\n // top wall\n blocks[11] = new Rectangle(WIDTH / 2 - 50, 400, 100, 25);\n \n \n // remember to copy to the other side\n // cover (west)\n blocks[4] = new Rectangle(200, 200, 25, 75);\n blocks[6] = new Rectangle(200 , 400, 25, 75);\n blocks[8] = new Rectangle(200, 310, 25, 50);\n blocks[9] = new Rectangle(200, 0, 25, 170);\n blocks[17] = new Rectangle(200 - 50, 145, 70, 25);\n blocks[23] = new Rectangle(0, 60, 100, 24);\n blocks[24] = new Rectangle(70, 500, 24, 100);\n blocks[25] = new Rectangle(70, 500, 80, 24);\n blocks[26] = new Rectangle();\n \n \n // cover (east)\n blocks[15] = new Rectangle(WIDTH - 225, 200, 25, 75);\n blocks[14] = new Rectangle(WIDTH - 225 , 400, 25, 75);\n blocks[13] = new Rectangle(WIDTH - 225, 310, 25, 50);\n blocks[12] = new Rectangle(WIDTH - 225, 0, 25, 170);\n blocks[16] = new Rectangle(WIDTH - 225, 145, 70, 25);\n blocks[27] = new Rectangle(WIDTH - 100, 60, 100, 24);\n blocks[28] = new Rectangle(WIDTH - 94, 500, 24, 100);\n blocks[29] = new Rectangle(WIDTH - 94 - (80-24), 500, 80, 24);\n blocks[30] = new Rectangle();\n \n // cover (middle)\n // vertical\n blocks[18] = new Rectangle(WIDTH/ 2 - 10, 150, 20, 125);\n blocks[22] = new Rectangle(WIDTH/ 2 - 10, 300, 20, 50);\n // horizontal\n blocks[19] = new Rectangle(WIDTH/ 2 - 100, 175, 200, 20);\n blocks[20] = new Rectangle(WIDTH/ 2 - 100, 225, 200, 20);\n blocks[21] = new Rectangle(WIDTH/ 2 - 100, 350, 200, 20);\n \n \n // extras\n blocks[31] = new Rectangle();\n blocks[32] = new Rectangle();\n \n // flag on the level\n flag[0] = new Rectangle((int)(Math.random()*((WIDTH - 40) - 40 + 1)) + 40, (int)(Math.random()*((HEIGHT - 40) - 40 + 1)) + 40, 35, 26);\n flagPole[0] = new Rectangle(flag[0].x, flag[0].y, 4, 45);\n flagLogo[0] = new Rectangle(flag[0].x + 15, flag[0].y + (13/2), 20, 15);\n \n }", "protected int[][][] fillOuterBlock(RescueMap rm, int[] block, int density,Random rand){\n\t\treturn new int[0][][];\n\t}", "public void fillBlock(Block block) {\n\n\t\tfor (int j = block.UpperLeft().x; j <= block.LowerRight().x; j++) { \n\t\t\tfor (int k = block.UpperLeft().y; k <= block.LowerRight().y; k++) { \n\t\t\t\tblocksPosition.put(new Point(j,k), block); \n\t\t\t\t//Blocks.add(block); \n\t\t\t} \n\t\t} \n\t}", "public void putBlock(Block block){\n\t \n\t BlockPosX = 5;\n\t BlockPosY = 0;\n\t int posX = 5;\n\t int posY = 0;\n\t BlockInControl = block;\n\t \n\t int x = 0;\n\t for(int i=0;i<MAX_COL;i++){\n\t\tif(board[posY+1][i] == 1)\n\t\t x = 1;\n\t }\n\t if(x==1)\n\t\tthis.clearBoard();\n\t \n\t \n\t for(int r=0;r<4;r++){\n\t\tfor(int c=0;c<4;c++){\n\t\t if(block.getRowCol(r,c) == 1)\n\t\t\t{\n\t\t\t board[posY][posX]=1;\n\t\t\t \n\t\t\t switch(whichType){\n\t\t\t case 1: color[posY][posX] = 1;\n\t\t\t\tbreak;\n\t\t\t case 2: color[posY][posX] = 2;\n\t\t\t\tbreak;\n\t\t\t case 3: color[posY][posX] = 3;\n\t\t\t\tbreak;\n\t\t\t case 4: color[posY][posX] = 4;\n\t\t\t\tbreak;\n\t\t\t case 5: color[posY][posX] = 5;\n\t\t\t\tbreak;\n\t\t\t case 6: color[posY][posX] = 6;\n\t\t\t\tbreak;\n\t\t\t case 7: color[posY][posX] = 7;\n\t\t\t break;\n\t\t\t }\n\t\t\t}\n\t\t \n\t\t posX++;\n\t\t}\n\t posY++;\n\t posX-=4;\n\t }\n\t}", "public Point3D getpoint_BlockTopRight() {\r\n\t\treturn point_BlockTopRight;\r\n\t}", "public boolean addComponentParts(World world, Random random, StructureBoundingBox boundingBox)\n {\n if (this.field_143015_k < 0)\n {\n this.field_143015_k = this.getAverageGroundLevel(world, boundingBox);\n\n if (this.field_143015_k < 0)\n {\n return true;\n }\n\n this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 5 - 1, 0);\n }\n\n this.fillWithBlocks(world, boundingBox, 1, 1, 1, 10, 4, 10, Blocks.air, Blocks.air, false);\n this.fillWithBlocks(world, boundingBox, 0, 0, 0, 10, 0, 10, Blocks.cobblestone, Blocks.cobblestone, false);\n /*this.fillWithBlocks(world, boundingBox, 0, 0, 0, 10, 0, 0, Blocks.cobblestone, Blocks.cobblestone, false);\n this.fillWithBlocks(world, boundingBox, 10, 0, 0, 10, 0, 10, Blocks.cobblestone, Blocks.cobblestone, false);\n this.fillWithBlocks(world, boundingBox, 10, 0, 10, 0, 0, 10, Blocks.cobblestone, Blocks.cobblestone, false);\n this.fillWithBlocks(world, boundingBox, 0, 0, 10, 0, 0, 0, Blocks.cobblestone, Blocks.cobblestone, false);*/\n this.fillWithBlocks(world, boundingBox, 1, 0, 1, 9, 0, 9, plankBlock, plankBlock, false);\n this.fillWithBlocks(world, boundingBox, 0, 4, 0, 10, 4, 10, Blocks.cobblestone, Blocks.cobblestone, false);\n \n //RIGHT WALL\n this.fillWithBlocks(world, boundingBox, 0, 1, 0, 0, 1, 10, plankBlock, plankBlock, false);\n this.fillWithBlocks(world, boundingBox, 0, 3, 0, 0, 3, 10, plankBlock, plankBlock, false);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 0, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 0, 2, 1, boundingBox);\n this.fillWithBlocks(world, boundingBox, 0, 2, 2, 0, 2, 4, Blocks.glass, Blocks.glass, false);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 0, 2, 5, boundingBox);\n this.fillWithBlocks(world, boundingBox, 0, 2, 6, 0, 2, 8, Blocks.glass, Blocks.glass, false);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 0, 2, 9, boundingBox);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 0, 2, 10, boundingBox);\n \n //LEFT WALL\n this.fillWithBlocks(world, boundingBox, 10, 1, 0, 10, 1, 10, plankBlock, plankBlock, false);\n this.fillWithBlocks(world, boundingBox, 10, 3, 0, 10, 3, 10, plankBlock, plankBlock, false);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 10, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 10, 2, 1, boundingBox);\n this.fillWithBlocks(world, boundingBox, 10, 2, 2, 10, 2, 4, Blocks.glass, Blocks.glass, false);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 10, 2, 5, boundingBox);\n this.fillWithBlocks(world, boundingBox, 10, 2, 6, 10, 2, 8, Blocks.glass, Blocks.glass, false);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 10, 2, 9, boundingBox);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 10, 2, 10, boundingBox);\n \n //FRONT WALL\n this.fillWithBlocks(world, boundingBox, 0, 1, 0, 5, 1, 0, plankBlock, plankBlock, false);\n this.fillWithBlocks(world, boundingBox, 7, 1, 0, 10, 1, 0, plankBlock, plankBlock, false);\n this.fillWithBlocks(world, boundingBox, 0, 3, 0, 10, 3, 0, plankBlock, plankBlock, false);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 0, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 1, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 2, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 3, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 4, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 5, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 7, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 8, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 9, 2, 0, boundingBox);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 10, 2, 0, boundingBox);\n \n //BACK WALL\n this.fillWithBlocks(world, boundingBox, 0, 1, 10, 10, 1, 10, plankBlock, plankBlock, false);\n this.fillWithBlocks(world, boundingBox, 0, 3, 10, 10, 3, 10, plankBlock, plankBlock, false);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 0, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 1, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 2, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 3, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 4, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 5, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 6, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 7, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.glass, 0, 8, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 9, 2, 10, boundingBox);\n this.placeBlockAtCurrentPosition(world, plankBlock, 0, 10, 2, 10, boundingBox);\n \n \n //DECO\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 3, 1, 4, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 3, 1, 5, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 3, 1, 6, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 3, 1, 7, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 4, 1, 4, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 4, 1, 5, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 4, 1, 6, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 4, 1, 7, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 5, 1, 4, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 5, 1, 5, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 5, 1, 6, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 5, 1, 7, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 6, 1, 4, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 6, 1, 5, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 6, 1, 6, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 6, 1, 7, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 7, 1, 4, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 7, 1, 5, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 7, 1, 6, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.carpet, ((carpetMeta == -1) ? random.nextInt(15) : carpetMeta), 7, 1, 7, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.crafting_table, 0, 9, 1, 9, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 9, 1, 8, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 9, 1, 7, boundingBox);\n this.placeBlockAtCurrentPosition(world, logBlock, 0, 8, 1, 9, boundingBox);\n this.placeBlockAtCurrentPosition(world, Blocks.furnace, this.getMetadataWithOffset(Blocks.furnace, 1), 8, 1, 9, boundingBox);\n this.generateStructureChestContents(world, boundingBox, random, 7, 1, 9, workshopChestContents, getCount(random, 5, 7));\n this.generateStructureChestContents(world, boundingBox, random, 6, 1, 9, workshopChestContents, getCount(random, 5, 7));\n this.placeDoorAtCurrentPosition(world, boundingBox, random, 6, 1, 0, this.getMetadataWithOffset(Blocks.wooden_door, 1));\n //this.placeBlockAtCurrentPosition(world, Blocks.torch, this.getMetadataWithOffset(Blocks.torch, 1), 5, 3, 9, boundingBox);\n\n if (this.getBlockAtCurrentPosition(world, 6, 0, -1, boundingBox).getMaterial() == Material.air && this.getBlockAtCurrentPosition(world, 6, -1, -1, boundingBox).getMaterial() != Material.air)\n {\n this.placeBlockAtCurrentPosition(world, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 6, 0, -1, boundingBox);\n }\n\n /* for (l = 0; l < 6; ++l)\n {\n for (int i1 = 0; i1 < 9; ++i1)\n {\n this.clearCurrentPositionBlocksUpwards(p_74875_1_, i1, 9, l, p_74875_3_);\n this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, i1, -1, l, p_74875_3_);\n }\n }*/\n\n this.spawnVillagers(world, boundingBox, 2, 1, 2, 1);\n return true;\n }", "public void prepareToPlaceOnCurrentRow(Box box) {\n\t\tbox.y = getCurrentY();\n\t\tbox.x = getCurrentX();\n\t}", "public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)\n {\n return par9;\n }", "private void CreatingBeautyContentTopK() {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \tbestBranches=objGrapB.relativePositionDepthSearchTopK(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,maxScreens,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \r\n\t \tBranch objBranch=new Branch();\r\n\t \t//bestBranches=objBranch.sortBranches(bestBranches);\r\n\t \t\r\n\t \t//System.out.print( \"CounterStates\"+objGrapB.getCounterIDs() );\r\n\t \r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branches foundeded\r\n\t \r\n\t Iterator<Branch> nombreIterator = bestBranches.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBranch elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getHeuristicValue()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t \t//Just here to implement the n screens!\r\n\t for(int i=0;i<maxScreens;i++)\r\n\t {//block from Lelis and Reis (>class GeradorDeFasses)\r\n/*\t \ttry {\r\n\t \t\tLevel levelScreen=PaintElements(((Branch)bestBranches.get(i)).getStates(),this.clone());\t\t\t\t\t\r\n\t\t\t\t\tScreen objScreen=new Screen();\r\n\t\t\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n\t \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t\t\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t\t\t \r\n\t\t\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\t\t\tcopiador.copy(\"\" + i, \"Screens/\");\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (CloneNotSupportedException 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} catch (ClassNotFoundException 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} 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 }\r\n\t \r\n\t\t\t\r\n\t\t}", "private void initialize() {\n\n this.levelName = \"Green 3\";\n this.numberOfBalls = 2;\n int ballsRadius = 5;\n Color ballsColor = Color.white;\n this.paddleHeight = (screenHeight / 27);\n this.paddleWidth = (screenWidth / 8);\n this.paddleSpeed = 11;\n int surroundingBlocksWidth = 30;\n this.paddleColor = new Color(1.0f, 0.699f, 0.000f);\n this.paddleUpperLeft = new Point(screenWidth / 2.2, screenHeight - surroundingBlocksWidth\n - this.paddleHeight);\n Color backgroundColor = new Color(0.000f, 0.420f, 0.000f);\n this.background = new Block(new Rectangle(new Point(0, 0), screenWidth + 1\n , screenHeight + 2), backgroundColor);\n this.background.setNumber(-1);\n\n Color[] colors = {Color.darkGray, Color.red, Color.yellow, Color.blue, Color.white};\n int blocksRowsNum = 5;\n int blocksInFirstRow = 10;\n int blocksWidth = screenWidth / 16;\n int blockHeight = screenHeight / 20;\n int firstBlockYlocation = screenHeight / 4;\n int removableBlocks = 0;\n Block[][] stairs = new Block[blocksRowsNum][];\n //blocks initialize.\n for (int i = 0; i < blocksRowsNum; i++, blocksInFirstRow--) {\n int number;\n for (int j = 0; j < blocksInFirstRow; j++) {\n if (i == 0) {\n number = 2; //top row.\n } else {\n number = 1;\n }\n stairs[i] = new Block[blocksInFirstRow];\n Point upperLeft = new Point(screenWidth - (blocksWidth * (j + 1)) - surroundingBlocksWidth\n , firstBlockYlocation + (blockHeight * i));\n stairs[i][j] = new Block(new Rectangle(upperLeft, blocksWidth, blockHeight), colors[i % 5]);\n if (stairs[i][j].getHitPoints() != -2 && stairs[i][j].getHitPoints() != -3) { // not death or live block\n stairs[i][j].setNumber(number);\n removableBlocks++;\n }\n this.blocks.add(stairs[i][j]);\n }\n\n }\n this.numberOfBlocksToRemove = (int) (removableBlocks * 0.5); //must destroy half of them.\n this.ballsCenter.add(new Point(screenWidth / 1.93, screenHeight * 0.9));\n this.ballsCenter.add(new Point(screenWidth / 1.93, screenHeight * 0.9));\n List<Velocity> v = new ArrayList<>();\n v.add(Velocity.fromAngleAndSpeed(45, 9));\n v.add(Velocity.fromAngleAndSpeed(-45, 9));\n this.ballsFactory = new BallsFactory(this.ballsCenter, ballsRadius, ballsColor,\n screenWidth, screenHeight, v);\n\n //bodies.\n //tower.\n Block base = new Block(new Rectangle(new Point(surroundingBlocksWidth + screenWidth / 16, screenHeight * 0.7)\n , screenWidth / 6, screenHeight * 0.3), Color.darkGray);\n base.setNumber(-1);\n this.bodies.add(base);\n Block base2 = new Block(new Rectangle(new Point(base.getCollisionRectangle().getUpperLine()\n .middle().getX() - base.getWidth() / 6\n , base.getCollisionRectangle().getUpperLeft().getY() - base.getHeight() / 2.5), base.getWidth() / 3\n , base.getHeight() / 2.5), Color.gray);\n base2.setNumber(-1);\n this.bodies.add(base2);\n Block pole = new Block(new Rectangle(new Point(base2.getCollisionRectangle().getUpperLine().middle().getX()\n - base2.getWidth() / 6, base2.getCollisionRectangle().getUpperLeft().getY() - screenHeight / 3)\n , base2.getWidth() / 3, screenHeight / 3), Color.lightGray);\n pole.setNumber(-1);\n this.bodies.add(pole);\n\n double windowWidth = base.getWidth() / 10;\n double windowHeight = base.getHeight() / 7;\n double b = base.getWidth() / 12;\n double h = base.getHeight() / 20;\n for (int i = 0; i < 6; i++) { //windows of tower.\n for (int j = 0; j < 5; j++) {\n Block window = new Block(new Rectangle(new Point(base.getCollisionRectangle().getUpperLeft().getX() + b\n + (windowWidth + b) * j,\n base.getCollisionRectangle().getUpperLeft().getY() + h + (windowHeight + h) * i), windowWidth\n , windowHeight), Color.white);\n window.setNumber(-1);\n this.bodies.add(window);\n }\n }\n\n //circles on the top of the tower.\n Circle c1 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 17, Color.black, \"fill\");\n Circle c2 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 12, Color.darkGray, \"fill\");\n Circle c3 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 7, Color.red, \"fill\");\n this.bodies.add(c1);\n this.bodies.add(c2);\n this.bodies.add(c3);\n\n\n }", "public void updateTopBorder(){\n\n\n //Go up until reach maximum border height and then go down, so zig zag, maximum will increase when score increases.\n //Every 100 points insert random blocks\n\n for (int i = 0; i < topborder.size(); i++){\n topborder.get(i).update();\n\n //Remove top border if off map and replace by adding a new one\n if (topborder.get(i).getX()<-25){\n topborder.remove(i);\n\n //Retrieves the last element in the array list\n if (topborder.get(topborder.size()-1).getHeight()>=maxBorderHeight){\n top = false;\n }\n if (topborder.get(topborder.size()-1).getHeight()<=minBorderHeight){\n top = true;\n }\n\n //New border will have a larger height, else smaller height\n if (top){\n topborder.add(new TopBorder(BitmapFactory.decodeResource(getResources(),R.drawable.newborder), topborder.get(topborder.size()-1).getX()+25, 0, topborder.get(topborder.size()-1).getHeight()+1));\n }\n else {\n topborder.add(new TopBorder(BitmapFactory.decodeResource(getResources(),R.drawable.newborder), topborder.get(topborder.size()-1).getX()+25, 0, topborder.get(topborder.size()-1).getHeight()-1));\n }\n }\n }\n\n }", "Block createBlock();", "private void setUpBlocks() {\n\t\tdouble xStart=0;\n\t\tdouble midPoint = getWidth()/2;\n\t\tint yStart = BRICK_Y_OFFSET;\t\n\t\t\n\t\tfor(int i = 0; i < NBRICK_ROWS; i++) {\n\t\t\t\n\t\t\txStart = midPoint - (NBRICKS_PER_ROW/2 * BRICK_WIDTH) - BRICK_WIDTH/2;\n\t\t\tlayRowOfBricks(xStart, yStart, i);\n\t\t\tyStart += BRICK_HEIGHT + BRICK_SEP;\n\t\t}\t\n\t}", "@Override\n public void reset() {\n Material[] materials = sortBlockValues();\n for(int y = getMinY(); y <= getMaxY(); y++){\n for(int z = getMinZ(); z <= getMaxZ(); z++){\n for(int x = getMinX(); x <= getMaxX(); x++){\n for(Material mat : materials){\n int percent = blockValues.get(mat);\n if(random.nextInt(100) + 1 <= percent){\n final int xf = x;\n final int yf = y;\n final int zf = z;\n Bukkit.getScheduler().scheduleSyncDelayedTask(QuadPrison.getInstance(), ()->\n getWorld().getBlockAt(xf,yf,zf).setType(mat)\n );\n }\n }\n }\n }\n }\n for(Player player : Bukkit.getOnlinePlayers()){\n if(isInsideRegion(player.getLocation())) {\n Location loc = player.getLocation();\n loc.setY(getMaxY() + 1);\n player.teleport(loc);\n player.sendMessage(ChatColor.AQUA + \"The mine reset! You were teleported to the top!\");\n }\n }\n }", "public void renderInvBlock(bbb renderblocks, int md)\r\n/* 73: */ {\r\n/* 74: 72 */ this.block.f();\r\n/* 75: */ \r\n/* 76: 74 */ this.context.setDefaults();\r\n/* 77: 75 */ this.context.setPos(-0.5D, -0.5D, -0.5D);\r\n/* 78: 76 */ this.context.useNormal = true;\r\n/* 79: 77 */ this.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);\r\n/* 80: */ \r\n/* 81: 79 */ RenderLib.bindTexture(\"/eloraam/machine/machine1.png\");\r\n/* 82: 80 */ baz tessellator = baz.a;\r\n/* 83: */ \r\n/* 84: 82 */ tessellator.b();\r\n/* 85: 83 */ this.context.useNormal = true;\r\n/* 86: */ \r\n/* 87: */ \r\n/* 88: 86 */ this.context.setTex(28, 28, 26, 26, 26, 26);\r\n/* 89: */ \r\n/* 90: 88 */ this.context.renderBox(60, 0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D);\r\n/* 91: 89 */ this.context.renderBox(60, 0.6240000128746033D, 0.9990000128746033D, 0.6240000128746033D, 0.3759999871253967D, 0.001000000047497451D, 0.3759999871253967D);\r\n/* 92: 90 */ renderFlanges(3, 27);\r\n/* 93: */ \r\n/* 94: 92 */ tessellator.a();\r\n/* 95: 93 */ RenderLib.unbindTexture();\r\n/* 96: 94 */ this.context.useNormal = false;\r\n/* 97: */ }", "public abstract void generateNextBlock();", "private boolean UpdateWithCarriedBlock()\r\n {\r\n \tint iCarriedBlockID = getCarried();\r\n \t\r\n \tif ( worldObj.provider.dimensionId == 1 ) \r\n \t{\r\n\t\t\t// we're in the end dimension with a block, and should attempt to place it\r\n\t\t\t\r\n int i = MathHelper.floor_double( posX ) + rand.nextInt( 5 ) - 2;\r\n int j = MathHelper.floor_double( posY ) + rand.nextInt( 7 ) - 3;\r\n int k = MathHelper.floor_double( posZ ) + rand.nextInt( 5 ) - 2;\r\n \r\n\t\t\tint iWeight = GetPlaceEndstoneWeight( i, j, k );\r\n\t\t\t\r\n if ( rand.nextInt( m_iMaxEnstonePlaceWeight >> 9 ) < iWeight )\r\n {\r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderBlockPlaceAuxFXID, i, j, k, iCarriedBlockID + ( getCarryingData() << 12 ) );\r\n\t\t \r\n worldObj.setBlockAndMetadataWithNotify( i, j, k, getCarried(), getCarryingData());\r\n \r\n setCarried(0);\r\n }\r\n \t}\r\n \telse\r\n \t{\r\n\t\t\t// \teventually the enderman should teleport away to the end with his block\r\n\t\t\t\r\n \t\tif ( rand.nextInt( 2400 ) == 0 )\r\n \t\t{\r\n \t\t\t// play dimensional travel effects\r\n \t\t\t\r\n int i = MathHelper.floor_double( posX );\r\n int j = MathHelper.floor_double( posY ) + 1;\r\n int k = MathHelper.floor_double( posZ );\r\n \r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderChangeDimensionAuxFXID, i, j, k, 0 );\r\n\t\t \r\n setDead();\r\n \r\n return false;\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn true;\r\n }", "@Test public void testPreBlock() {\n int[][] preBlockTopLeft = {{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}};\n int[][] preBlockTopRight = {{0, 0, 0, 0}, {0, 1, 0, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}};\n int[][] preBlockBottomLeft = {{0, 0, 0, 0}, {0, 1, 1, 0}, {0, 0, 1, 0}, {0, 0, 0, 0}};\n int[][] preBlockBottomRight = {{0, 0, 0, 0}, {0, 1, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 0}};\n int[][] block = {{0, 0, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}};\n\n GameOfLife gameOfLife = createGame();\n\n gameOfLife.seed(preBlockTopLeft);\n Assert.assertArrayEquals(block, gameOfLife.next());\n Assert.assertArrayEquals(block, gameOfLife.next());\n\n gameOfLife.seed(preBlockTopRight);\n Assert.assertArrayEquals(block, gameOfLife.next());\n Assert.assertArrayEquals(block, gameOfLife.next());\n\n gameOfLife.seed(preBlockBottomLeft);\n Assert.assertArrayEquals(block, gameOfLife.next());\n Assert.assertArrayEquals(block, gameOfLife.next());\n\n gameOfLife.seed(preBlockBottomRight);\n Assert.assertArrayEquals(block, gameOfLife.next());\n Assert.assertArrayEquals(block, gameOfLife.next());\n }", "public Block(){\r\n\t\tthis.altitude = 0;\r\n\t\tthis.river = false;\t\r\n\t\tthis.ocean = false;\r\n\t\tthis.river = false;\r\n\t\tborder = false;\r\n\t}", "public Block() {\n this.xPos = 0;\n this.yPos = 0;\n this.width = 0;\n this.height = 0;\n this.color = Color.MINTCREAM;\n }", "public void breakBlock(World world, int x, int y, int z, Block par5, int par6)\r\n/* 186: */ {\r\n/* 187:209 */ if ((world.getBlock(x, y, z) != FMPBase.getFMPBlockId()) && \r\n/* 188:210 */ ((world.getTileEntity(x, y, z) instanceof TileEntityTransferNode)))\r\n/* 189: */ {\r\n/* 190:211 */ TileEntityTransferNode tile = (TileEntityTransferNode)world.getTileEntity(x, y, z);\r\n/* 191:213 */ if (!tile.getUpgrades().isEmpty()) {\r\n/* 192:214 */ for (int i = 0; i < tile.getUpgrades().size(); i++)\r\n/* 193: */ {\r\n/* 194:215 */ ItemStack itemstack = (ItemStack)tile.getUpgrades().get(i);\r\n/* 195:216 */ float f = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 196:217 */ float f1 = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 197: */ EntityItem entityitem;\r\n/* 198:220 */ for (float f2 = this.random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem))\r\n/* 199: */ {\r\n/* 200:221 */ int k1 = this.random.nextInt(21) + 10;\r\n/* 201:223 */ if (k1 > itemstack.stackSize) {\r\n/* 202:224 */ k1 = itemstack.stackSize;\r\n/* 203: */ }\r\n/* 204:227 */ itemstack.stackSize -= k1;\r\n/* 205:228 */ entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));\r\n/* 206:229 */ float f3 = 0.05F;\r\n/* 207:230 */ entityitem.motionX = ((float)this.random.nextGaussian() * f3);\r\n/* 208:231 */ entityitem.motionY = ((float)this.random.nextGaussian() * f3 + 0.2F);\r\n/* 209:232 */ entityitem.motionZ = ((float)this.random.nextGaussian() * f3);\r\n/* 210:234 */ if (itemstack.hasTagCompound()) {\r\n/* 211:235 */ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());\r\n/* 212: */ }\r\n/* 213: */ }\r\n/* 214: */ }\r\n/* 215: */ }\r\n/* 216:241 */ if ((tile instanceof TileEntityTransferNodeInventory))\r\n/* 217: */ {\r\n/* 218:242 */ TileEntityTransferNodeInventory tileentity = (TileEntityTransferNodeInventory)tile;\r\n/* 219: */ \r\n/* 220:244 */ ItemStack itemstack = tileentity.getStackInSlot(0);\r\n/* 221:246 */ if (itemstack != null)\r\n/* 222: */ {\r\n/* 223:247 */ float f = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 224:248 */ float f1 = this.random.nextFloat() * 0.8F + 0.1F;\r\n/* 225: */ EntityItem entityitem;\r\n/* 226:251 */ for (float f2 = this.random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem))\r\n/* 227: */ {\r\n/* 228:252 */ int k1 = this.random.nextInt(21) + 10;\r\n/* 229:254 */ if (k1 > itemstack.stackSize) {\r\n/* 230:255 */ k1 = itemstack.stackSize;\r\n/* 231: */ }\r\n/* 232:258 */ itemstack.stackSize -= k1;\r\n/* 233:259 */ entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));\r\n/* 234:260 */ float f3 = 0.05F;\r\n/* 235:261 */ entityitem.motionX = ((float)this.random.nextGaussian() * f3);\r\n/* 236:262 */ entityitem.motionY = ((float)this.random.nextGaussian() * f3 + 0.2F);\r\n/* 237:263 */ entityitem.motionZ = ((float)this.random.nextGaussian() * f3);\r\n/* 238:265 */ if (itemstack.hasTagCompound()) {\r\n/* 239:266 */ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());\r\n/* 240: */ }\r\n/* 241: */ }\r\n/* 242: */ }\r\n/* 243:271 */ world.func_147453_f(x, y, z, par5);\r\n/* 244: */ }\r\n/* 245: */ }\r\n/* 246:276 */ super.breakBlock(world, x, y, z, par5, par6);\r\n/* 247: */ }", "Block create(int xpos, int ypos);", "@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)\n\tpublic void onPlaceBlock(BlockPlaceEvent e) {\n\t\tBlock block = e.getBlock();\n\n\t\tMaterial blockMaterial = block.getType();\n\t\tint x = block.getX();\n\t\tint y = block.getY();\n\t\tint z = block.getZ();\n\t\tWorldChunk chunk = CropControl.getDAO().getChunk(block.getChunk());\n\n\t\tif (CropControl.getDAO().isTracked(block) == true) {\n\t\t\t// We've got a replacement\n\t\t\tCropControl.getPlugin().debug(\"Ghost object? Placement is overtop a tracked object at {0}, {1}, {2}\", x, y, z);\n\t\t\thandleRemoval(block, chunk);\n\t\t}\n\t\tif (harvestableCrops.containsKey(blockMaterial)) {\n\t\t\t// we placed a block overtop an existing crop. Will be handled by a break event?\n\t\t\t/*Crop crop = chunk.getCrop(x, y, z);\n\t\t\tif (crop != null) {\n\t\t\t\tcrop.setRemoved();\n\t\t\t\tCropControl.getPlugin().debug(\"Missed an event? Replacing a Crop at {0}, {1}, {2}\", x, y, z);\n\t\t\t\t//return;\n\t\t\t}*/\n\t\t\t\n\t\t\t// We've placed a crop!\n\t\t\tCrop.create(chunk, x, y, z, blockMaterial.toString(), getBaseCropState(blockMaterial),\n\t\t\t\t\te.getPlayer().getUniqueId(), System.currentTimeMillis(), harvestableCrops.get(blockMaterial));\n\t\t} else if (blockMaterial == Material.SAPLING) {\n\t\t\t// we placed a block overtop an existing sapling. TODO: Do I need to remove sapling here, or will there be a break event?\n\t\t\t/*Sapling sapling = chunk.getSapling(x, y, z);\n\t\t\tif (sapling != null) {\n\t\t\t\tsapling.setRemoved();\n\t\t\t\tCropControl.getPlugin().debug(\"Missed an event? Replacing a Sapling at {0}, {1}, {2}\", x, y, z);\n\t\t\t\t//return;\n\t\t\t}*/\n\t\t\t// We've placed a sapling!\n\t\t\tSapling.create(chunk, x, y, z, getSaplingType(block.getData()),\n\t\t\t\t\te.getPlayer().getUniqueId(), System.currentTimeMillis(), false);\n\t\t} else if (blockMaterial == Material.CHORUS_FLOWER) {\n\t\t\t/*if (CropControl.getDAO().isTracked(block) == true) {\n\t\t\t\tCropControl.getPlugin().debug(\"Ghost object? Placement is overtop a tracked object at {0}, {1}, {2}\", x, y, z);\n\t\t\t\t//return;\n\t\t\t}*/\n\t\t\t\n\t\t\t// TODO: Check if connected to an existing chorus tree.\n\n\t\t\t// First register the \"tree\"\n\t\t\tTree chorusPlant = Tree.create(chunk, x, y, z, Material.CHORUS_PLANT.toString(),\n\t\t\t\t\te.getPlayer().getUniqueId(), System.currentTimeMillis());\n\n\t\t\t// Then the component in the tree.\n\t\t\tTreeComponent.create(chorusPlant, chunk, x, y, z, Material.CHORUS_PLANT.toString(),\n\t\t\t\t\te.getPlayer().getUniqueId(), false);\n\t\t} else if (blockMaterial.isSolid()){ // check for cactus.\n\t\t\tfor (BlockFace face : CropControlEventHandler.directions) {\n\t\t\t\tBlock adj = block.getRelative(face);\n\t\t\t\tif (Material.CACTUS == adj.getType()) {\n\t\t\t\t\tLocation loc = adj.getLocation();\n\t\t\t\t\tif (!pendingChecks.contains(loc)) {\n\t\t\t\t\t\tpendingChecks.add(loc);\n\t\t\t\t\t\thandleBreak(adj, BreakType.PLAYER, e.getPlayer().getUniqueId(), null);\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void adjustInitialPosition() {\n\n //TelemetryWrapper.setLine(1,\"landFromLatch...\");\n runtime.reset();\n double maxLRMovingDist = 200.0; //millimeters\n double increamentalDist = 50.0;\n while ( runtime.milliseconds() < 5000 ) {\n int loops0 = 0;\n while ((loops0 < 10) && ( mR.getNumM() == 0 )) {\n mR.update();\n loops0 ++;\n }\n if (mR.getNumM() <= 1) {\n int loops = 0;\n while ( mR.getNumM() <= 1 )\n driveTrainEnc.moveLeftRightEnc(increamentalDist, 2000);\n continue;\n } else if ( mR.getHAlignSlope() > 2.0 ) {\n driveTrainEnc.spinEnc(AUTO_DRIVE_SPEED,Math.atan(mR.getHAlignSlope()),2000);\n continue;\n } else if (! mR.isGoldFound()) {\n\n driveTrainEnc.moveLeftRightEnc(increamentalDist,2000);\n continue;\n } else if ( mR.getFirstGoldAngle() > 1.5 ) {\n driveTrainEnc.spinEnc(AUTO_DRIVE_SPEED, mR.getFirstGoldAngle(),2000);\n continue;\n }\n }\n driveTrainEnc.stop();\n }", "void block(Directions dir);", "private void createBlock() {\n\t\tblock = new Block(mouseX, mouseY, 25, 25);\r\n\t\tblock.addObserver(this);\r\n\t\tblock.start();\r\n\t\t// System.out.println(\"Block created (at Model.createBlock)\");\r\n\t}", "public Block() {\r\n\t\t// TODO Auto-generated constructor stub\r\n\t\tthis.point_BlockTopRight = null;\r\n\t\tthis.point_BlockDownleft = null;\r\n\t\tthis.setpoint_BlockTopLeft(null);\r\n\t\tthis.IDBloack = 0;\r\n\t\tthis.type = \"\";\r\n\t}", "public boolean isBlockTopSlab(Point3d position){\r\n\t\tIBlockState state = world.getBlockState(new BlockPos(position.x, position.y, position.z));\r\n\t\tBlock block = state.getBlock();\r\n\t\treturn block instanceof BlockSlab && !((BlockSlab) block).isDouble() && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP;\r\n\t}", "void updateBlock(Block block) ;", "private void Management_Block(Block block){\n\t\t\n\t\t switch(block.BlockState){\n\t\t \n\t\t case 0: // player is not lost game. continue with tile micro managment\n\t\t\t \n\t\t\t for (Tile tile : block.Wall){\t\t\n\t\t\t\t \n\t\t\t\t Rectangle rectTile = new Rectangle();\n\t\t\t\t rectTile = tile.getRectTile();\n\t\t\t\t boolean CoinCollision = CollisionDetection(playerUser.bounds,rectTile);\n\t\t\t\t \n\t\t\t\t switch(tile.state)\n\t\t\t\t {\n\t\t\t\t \n\t\t\t\t case 0: // no collision, show the block\n\t\t\t\t\t \n\t\t\t\t\t batch.draw(tile.getBlockImg(), rectTile.x,rectTile.y,rectTile.width,rectTile.height);\t\n\t\t\t\t\t \n\t\t\t\t\t if (PauseGame) \n\t\t\t\t\t\t continue;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if (CoinCollision==true){\n\t\t\t\t\t\t\t tile.state++; \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 }\t\t\t\t\t\t \n\t\t\t\t\t\t else if (ThisGameRound==GameState.Running){\t \n\t\t\t\t\t\t\t if (block.Passed==false){\n\t\t\t\t\t\t\t\t if (playerUser.position.x > block.Wall.get(0).rectTile.x){\n\t\t\t\t\t\t\t\t\t levelbuilder.gamePoints = levelbuilder.gamePoints + 1;\n\t\t\t\t\t\t\t\t\t fntScore.setBitmapText(\"Score: \" + String.valueOf(levelbuilder.gamePoints));\n\t\t\t\t\t\t\t\t\t block.Passed=true;\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 else if (block.Passed==true){\n\t\t\t\t\t\t\t\t //do nothing.\n\t\t\t\t\t\t\t }\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 break;\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t case 1: \n\t\t\t\t\t \n\t\t\t\t\t batch.draw(tile.getBlockImg(),rectTile.x,rectTile.y,rectTile.width,rectTile.height);\t\t\t\t\t\t \n\t\t\t\t\t // if there is a collotion, draw it one time only \t\t\t \t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t\t// collision, but player has key\n\t\t\t\t\t\t PhoneDevice.Vibrate();\t\n\t\t\t\t\t\t if ((playerUser.color==block.color) || (playerUser.color==Color.ALL)){\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\ttile.setBlockImg(tile.BlockType);\t\n\t\t\t\t\t \t\ttile.PlayBreakThoughSound();\t\n\t\t\t\t\t\t }\n\t\t\t\t\t\t // collision, but player dont have a key: break from tile loop and \n\t\t\t\t\t \t // draw block crash effect\n\t\t\t\t\t\t else if (DEBUG==false){\n\t\t\t\t\t\t\t block.BlockState=1;\n\t\t\t\t\t\t\t ThisGameRound = GameState.GameOver;\t\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t tile.pe = Effects.setNewEffect(enumEffects.TileDistruction, block.color);\t\t\t\t\t\t \n\t\t\t\t\t tile.pe.setPosition(tile.getRectTile().x,\n\t\t\t \t\t\t\ttile.getRectTile().y+tile.Height/2);\t\n\t\t\t\t\t tile.pe.start();\t\n\t\t\t\t\t tile.state++;\t\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t break;\n\t\t\t\t\t \n\t\t\t\t case 2:\n\t\t\t\t\t // continue to draw the effect: no matter collision result\n\t\t\t\t\t tile.pe.setPosition(tile.getRectTile().x,\n\t\t\t \t\t\t\ttile.getRectTile().y+tile.Height/2);\t\n\t\t\t\t\t \n\t\t\t\t\t tile.pe.update(Gdx.graphics.getDeltaTime());\n\t\t\t\t tile.pe.draw(batch,Gdx.graphics.getDeltaTime());\t\t\t\t \t\t\t\t\t\n\t\t\t\t\t break;\n\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 break;\n\t\t case 1: // player hit the wall without key\t\t\n\t\t\t \n\t\t\t for (Tile tile : block.Wall){\t\t\n\t\t\t\t \n\t\t\t\t Rectangle rectTile = new Rectangle();\n\t\t\t\t rectTile = tile.getRectTile();\t\t\t\t\n\t\t\t\t batch.draw(tile.getBlockImg(), rectTile.x,rectTile.y,rectTile.width,rectTile.height);\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t block.PlayCrashSound();\t\t\n\t\t\t block.pe = Effects.setNewEffect(enumEffects.Crash, block.color);\t\t\t\t\t\t \n\t\t\t block.pe.setPosition(playerUser.bounds.x + playerUser.bounds.width,\n\t\t\t\t\t playerUser.bounds.y + playerUser.bounds.height/2);\t\n\t\t\t block.pe.start();\n\t\t\t block.BlockState++;\n\t\t\t break;\n\t\t\t \n\t\t case 2:\n\t\t\t \n\t\t\t for (Tile tile : block.Wall){\t\t\n\t\t\t\t \n\t\t\t\t Rectangle rectTile = new Rectangle();\n\t\t\t\t rectTile = tile.getRectTile();\t\t\t\t\n\t\t\t\t batch.draw(tile.getBlockImg(), rectTile.x,rectTile.y,rectTile.width,rectTile.height);\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t block.pe.update(Gdx.graphics.getDeltaTime());\n\t\t\t block.pe.draw(batch,Gdx.graphics.getDeltaTime());\t\n\t\t\t break;\n\t\t }\t\t\n\t }", "private void findNextBlock(MatrixIndex cursor) {\n while (isFreeBlock(cursor) || !inBounds(cursor)){\n incrementMatrixIndex(cursor);\n }\n }", "public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)\r\n/* 171: */ {\r\n/* 172:193 */ if (par9 < 12) {\r\n/* 173:194 */ return ForgeDirection.OPPOSITES[par5] + par9 & 0xF;\r\n/* 174: */ }\r\n/* 175:196 */ return par9 & 0xF;\r\n/* 176: */ }", "public void collapseBlocks() {\n // Create it if it's null\n if (graph_bcc == null) {\n // Create graph parametrics (Only add linear time algorithms here...)\n graph_bcc = new BiConnectedComponents(graph);\n graph2p_bcc = new BiConnectedComponents(new UniTwoPlusDegreeGraph(graph));\n }\n BiConnectedComponents bcc = graph_bcc, bcc_2p = graph2p_bcc; if (bcc != null && bcc_2p != null) {\n // Get the vertex to block lookup\n Map<String,Set<MyGraph>> v_to_b = bcc.getVertexToBlockMap();\n // Go through the entities and accumulate the positions\n Map<MyGraph,Double> x_sum = new HashMap<MyGraph,Double>(), y_sum = new HashMap<MyGraph,Double>();\n Iterator<String> it_e = entity_to_wxy.keySet().iterator();\n while (it_e.hasNext()) {\n String entity = it_e.next(); Point2D pt = entity_to_wxy.get(entity);\n\tif (v_to_b.containsKey(entity)) {\n\t Iterator<MyGraph> it_mg = v_to_b.get(entity).iterator();\n\t while (it_mg.hasNext()) {\n\t MyGraph mg = it_mg.next();\n\t if (x_sum.containsKey(mg) == false) { x_sum.put(mg,0.0); y_sum.put(mg,0.0); }\n\t x_sum.put(mg,x_sum.get(mg)+pt.getX()); y_sum.put(mg,y_sum.get(mg)+pt.getY());\n\t }\n } else System.err.println(\"Vertex To Block Lookup missing \\\"\" + entity + \"\\\"\");\n }\n // Now position those entities that aren't cut vertices at the center of the graph\n it_e = entity_to_wxy.keySet().iterator();\n while (it_e.hasNext()) {\n String entity = it_e.next(); Point2D pt = entity_to_wxy.get(entity);\n\tif (v_to_b.containsKey(entity) && bcc.getCutVertices().contains(entity) == false) {\n MyGraph mg = v_to_b.get(entity).iterator().next();\n\t entity_to_wxy.put(entity, new Point2D.Double(x_sum.get(mg)/mg.getNumberOfEntities(),y_sum.get(mg)/mg.getNumberOfEntities()));\n\t transform(entity);\n\t}\n }\n // Re-render\n zoomToFit(); repaint();\n }\n }", "private List<BlockPoint> getTopPlattforms(BlockType[][] chunk){\n\t// Find the upmost row with atleast one plattform in it\n\t// and save the position of all plattforms in said row.\n\tList<BlockPoint> topPlattforms = new ArrayList<>(boardWidth);\n\tfor(int r = 0; r < chunk.length; r++){\n boolean foundTopRow = false;\n for(int c = 0; c < boardWidth; c++){\n if(chunk[r][c].solid){\n \t\t topPlattforms.add(new BlockPoint(c,r));\n \t\t foundTopRow = true;\n \t\t}\n \t }\n \t if(foundTopRow) break;\n \t}\n return topPlattforms;\n }", "public abstract void removeBlock();", "public void addBlock(int row, int col, Block block, GameplayState gps) {\n if (row < 4) {\n gps.setGameIsLost(true);\n }\n\n cells[row][col] = block;\n }", "public void fillBlock(TYPE typeOfBlock){\n isFull=true;\n type=typeOfBlock;\n return;\n }", "public void b(World paramaqu, Random paramRandom, BlockPosition paramdt, Block parambec)\r\n/* 77: */ {\r\n/* 78: 93 */ BlockPosition localdt1 = paramdt.up();\r\n/* 79: */ label260:\r\n/* 80: 95 */ for (int i = 0; i < 128; i++)\r\n/* 81: */ {\r\n/* 82: 96 */ BlockPosition localdt2 = localdt1;\r\n/* 83: 97 */ for (int j = 0; j < i / 16; j++)\r\n/* 84: */ {\r\n/* 85: 98 */ localdt2 = localdt2.offset(paramRandom.nextInt(3) - 1, (paramRandom.nextInt(3) - 1) * paramRandom.nextInt(3) / 2, paramRandom.nextInt(3) - 1);\r\n/* 86: 99 */ if ((paramaqu.getBlock(localdt2.down()).getType() != BlockList.grass) || (paramaqu.getBlock(localdt2).getType().blocksMovement())) {\r\n/* 87: */ break label260;\r\n/* 88: */ }\r\n/* 89: */ }\r\n/* 90:104 */ if (paramaqu.getBlock(localdt2).getType().material == Material.air)\r\n/* 91: */ {\r\n/* 92: */ Object localObject;\r\n/* 93:108 */ if (paramRandom.nextInt(8) == 0)\r\n/* 94: */ {\r\n/* 95:109 */ localObject = paramaqu.b(localdt2).a(paramRandom, localdt2);\r\n/* 96:110 */ avy localavy = ((EnumFlowerVariant)localObject).a().a();\r\n/* 97:111 */ Block localbec = localavy.instance().setData(localavy.l(), (Comparable)localObject);\r\n/* 98:112 */ if (localavy.f(paramaqu, localdt2, localbec)) {\r\n/* 99:113 */ paramaqu.setBlock(localdt2, localbec, 3);\r\n/* 100: */ }\r\n/* 101: */ }\r\n/* 102: */ else\r\n/* 103: */ {\r\n/* 104:116 */ localObject = BlockList.tallgrass.instance().setData(bbh.a, bbi.b);\r\n/* 105:117 */ if (BlockList.tallgrass.f(paramaqu, localdt2, (Block)localObject)) {\r\n/* 106:118 */ paramaqu.setBlock(localdt2, (Block)localObject, 3);\r\n/* 107: */ }\r\n/* 108: */ }\r\n/* 109: */ }\r\n/* 110: */ }\r\n/* 111: */ }", "public void reset()\n\t{ removeAll();\n\t\t int center_y=(getHeight()/2);\n int center_x=(getWidth()/2);\n\t\tScaffoldEnd=new GPoint((center_x-BEAM_LENGTH),ARM_OFFSET_FROM_HEAD+(2*HEAD_RADIUS)+ROPE_LENGTH);\n\t\tGLine scaffold=new GLine((center_x-BEAM_LENGTH),ScaffoldEnd.getY()+SCAFFOLD_HEIGHT,ScaffoldEnd.getX(),ScaffoldEnd.getY());\n\t\tadd(scaffold);\n\t\tBeamEnd=new GPoint((center_x),ScaffoldEnd.getY());\n\t\tGLine beam=new GLine(ScaffoldEnd.getX(),ScaffoldEnd.getY(),BeamEnd.getX(),BeamEnd.getY());\n\t\tadd(beam);\n\t\tRopeEnd=new GPoint((center_x),(BeamEnd.getY()+ROPE_LENGTH));\n\t\tGLine rope=new GLine(BeamEnd.getX(),BeamEnd.getY(),RopeEnd.getX(),RopeEnd.getY());\n\t\tadd(rope);\n\t\tguessedLabel=new GLabel(\"-----\",20,20);\n\t\twrongLabel=new GLabel(\"-----\",20,40);\n\t\ti=1;\n\t\twrong=\"\";\n\t}", "private void controlMechanismOptimisedC(int barHeights[], int blockHeights[]) {\n //Setting cranes initial position as variables\n int[] position;\n position = new int[3];\n position[0] = 2; // Initial height of arm 1\n position[1] = 1; // Initial width of arm 2\n position[2] = 0; // Initial drop of arm 3\n int numberOfBlocks = blockHeights.length; //How many blocks need to be moved.\n int maxHeight = 0; //Maximum height of bars or stack.\n int stackHeight = 0; //Height of stacked blocks.\n int maxBlockSize = 0; //Maximum size of blocks. Used to determine if code is necessary\n int firstOne = 100; //Position of first one high block\n int firstTwo = 100; //Position of first two high block\n int firstThree = 100; //Position of first three high block in stack\n int numberOfThreeBlocks = 0; //Number of blocks to be placed on bars\n int maxStackedHeight = 0; //Expected maximum height\n int topBlockNumber = blockHeights.length - 1; //Array index of the current top block\n int barOneHeight = 0; //Height of the first bar - where the one high blocks are placed\n int barTwoHeight = 0; //Height of the second bar - where the two high blocks are placed\n int barThreesPosition = 0; //This is used to keep track of what bar we are working on - refers to array index of barOptimised\n // Count the number of blocks that need to be put on bars\n for (int blockRuns = blockHeights.length; blockRuns > 0; blockRuns--) {//A loop that runs code for analysing the blocks. Run the loop for as many times as there are blocks.\n stackHeight += blockHeights[blockRuns - 1];// Add the current block onto the running total\n if (blockHeights[blockRuns - 1] == 2 && firstTwo == 100) { //If current block is equal to 2 and firstTwo has not been changed since declaration, the current block must be the fist one that is two high.\n firstTwo = blockRuns - 1;\n }\n if (blockHeights[blockRuns - 1] == 1 && firstOne == 100) {//Same as above, but for blocks one high.\n firstOne = blockRuns - 1;\n }\n if (maxBlockSize < blockHeights[blockRuns - 1]) { //If current block is larger than all previous blocks, set the largest block to the current one.\n maxBlockSize = blockHeights[blockRuns - 1];\n }\n if (blockHeights[blockRuns - 1] == 3 && firstThree == 100) {//Same as above, but for blocks one high.\n firstThree = blockRuns - 1;\n }\n if (blockHeights[blockRuns - 1] == 3) { //If the current block been examined is 3 high, increment the counter.\n numberOfThreeBlocks++;\n }\n }// End blocks loop\n\n //Start Bars loop\n for (int barRuns = 6; barRuns != 0; barRuns--) {\n if (maxHeight < barHeights[barRuns - 1]) { //Is the bar been examined larger than all bars previously?\n maxHeight = barHeights[barRuns - 1];// If it is, it is now that largest bar.\n }//End if\n }//End for\n\n int[] barOptimised;\n barOptimised = new int[numberOfThreeBlocks + 1];\n if (maxBlockSize == 3) {//We only need to optimise for Bars if there are blocks to be placed on them.\n barOptimised = optimisePathing(barHeights, numberOfThreeBlocks, maxHeight, blockHeights); //Find more efficient ways of placing blocks on bars, and return an array that contains them in ascending order (Generalisation for most efficient)\n /*\n Finding the maximum height that the blocks will reach when placed on bars\n Height of all one and two high blocks is not needed, as stackHeight will always be larger.\n */\n for (int x = numberOfThreeBlocks; x != 0; x--) { //Setting the maximum height blocks will take up.\n if (maxStackedHeight < barHeights[barOptimised[x - 1]] + 3) {\n maxStackedHeight = barHeights[barOptimised[x - 1]] + 3;\n }//End if\n }//End for\n }//End if\n if (maxHeight < maxStackedHeight) { //Finding maximum expected height.\n maxHeight = maxStackedHeight;\n }//End if\n\n if (maxHeight >= stackHeight) { //Move to the highest expected point.\n position = moveVerticalPositionTo(maxHeight, position);\n } else position = moveVerticalPositionTo(stackHeight, position);\n /* ****************MOVEMENT LOOP ******************* */\n while (numberOfBlocks != 0) {\n int currentBlock = blockHeights[topBlockNumber];\n topBlockNumber--;\n //Move to the stack\n position[1] = moveHorizontalTo(10, position[1]);\n //Drop to the top position of the stack\n position = moveVerticalPositionTo(stackHeight, position);\n r.pick();\n //We have removed a block, recalculate stack height\n stackHeight -= currentBlock;\n //Move to the stack for free vertical movement\n position[1] = moveHorizontalTo(9, position[1]);\n int MoveTo;\n int currentBarHeight;\n //Pick what to do based on the block been placed.\n switch (currentBlock) {\n case 1:\n MoveTo = 1; //If the block is one high, place it on the first bar.\n currentBarHeight = barOneHeight; //Set our vertical height to that of the first bar.\n break;\n case 2:\n MoveTo = 2; //If the block is two high, place it on the second bar.\n currentBarHeight = barTwoHeight;//Set our vertical height to that of the second bar.\n break;\n\n case 3:\n MoveTo = barOptimised[barThreesPosition] + 3; //If the block is three high, place it on the bar calculated by the optimisation algorithm for our current block.\n currentBarHeight = barHeights[barOptimised[barThreesPosition]]; //Set the height to that of the bar chosen\n break;\n default:\n MoveTo = barOptimised[barThreesPosition] + 3; //Should never be called. Same as condition 3\n currentBarHeight = barHeights[barOptimised[barThreesPosition]];\n break;\n\n }\n //Calculating the minimum height we can move to get to the chosen position\n int minMoveHeight = checkMaxPathingHeightToBars(barHeights, MoveTo, barOneHeight, barTwoHeight);\n //Move to our vertical position to prepare for horizontal movement.\n position = moveVerticalPositionTo(minMoveHeight + currentBlock /* To take bar height + crane height into account */, position);\n //Move horizontally to our target\n position[1] = moveHorizontalTo(MoveTo, position[1]);\n //Drop to the top of the chosen bar\n position = moveVerticalPositionTo(currentBarHeight + currentBlock, position);\n r.drop();\n //Set the bar position to move the stack to based on the current block\n switch (currentBlock) {\n case 3:\n barHeights[barOptimised[barThreesPosition]] += 3; //Ensure heights remain up to date for pathing.\n barThreesPosition++;\n break;\n case 2:\n barTwoHeight += 2;\n break;\n case 1:\n barOneHeight++;//Set the stack height\n break;\n default:\n }\n numberOfBlocks--;\n if (numberOfBlocks > 0) { //If we still have blocks to move move back to the stack.\n minMoveHeight = checkMaxPathingHeightToBars(barHeights, MoveTo, barOneHeight, barTwoHeight);\n if (stackHeight > minMoveHeight) { //If the stack height is larger than our calculated minimum, vertical move to stack height\n position = moveVerticalPositionTo(stackHeight, position); //Move to the top of the stack\n } else //Otherwise, as minMoveHeight is larger, move to that vertical position.\n position = moveVerticalPositionTo(minMoveHeight, position); //Move to the min move height.\n }//End if\n }//End while\n }", "public void landPiece() {\n\t\t// current rotation of piece\n\t\tint rot = currentPiece.getPieceRotation();\n\t\t\n\t\t// x coordinate of current piece's northwest corner\n\t\tint row = currentPieceGridPosition[0];\n\t\t\n\t\t// y coordinate of current piece's northwest corner\n\t\tint col = currentPieceGridPosition[1];\t\n\n\t\t// adds currentPiece's landing positions to be true in blockMatrix\n\t\tfor(int i = 0; i < 4; i++) { \n\t\t\tfor(int j = 0; j < 4; j++) { \n\t\t\t\tif(currentPiece.isFilled(rot, i, j)) {\n\t\t\t\t\tblockMatrix[i + row][j + col] = true; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//add up scores\n\t\tnumLines += numberOfFormedLines(); \n\t\tif(numberOfFormedLines() >= 4) {\n\t\t\tnumTetrises++; \n\t\t}\n\t\t\n\t\t//clear out full lines\n\t\tfor(int i = 0; i < blockMatrix.length; i++) { \n\t\t\tif(fullLine(i)) { \n\t\t\t\tremoveLine(i);\n\t\t\t\t//find rows with blocks filled above cleared line to drop those down\n\t\t\t\tfor(int m = i-1; m >= 0; m--) { \n\t\t\t\t\tfor(int n = 0; n < NUM_COLS; n++) {\n\t\t\t\t\t\t// fill in space below, clear out current row \n\t\t\t\t\t\tif(hasBlock(m, n)) { \n\t\t\t\t\t\t\tblockMatrix[m][n] = false;\n\t\t\t\t\t\t\tblockMatrix[m+1][n] = true;\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\t// ready for next piece\n\t\taddNewPiece();\n\t}", "void loopy() {\n if (position.y < -50) {\n position.y = Constants.height + 50;\n } else\n if (position.y > Constants.height + 50) {\n position.y = -50;\n }\n if (position.x< -50) {\n position.x = Constants.width +50;\n } else if (position.x > Constants.width + 50) {\n position.x = -50;\n }\n }", "void buildBlock(Tile t);", "public void begin(){\n\t\tTransaction block = new Transaction();\n\t\tblock.setPrev(blocks.getLast());\n\t\tblocks.add(block);\n\t}", "void randomBlock() {\n\t\t// map generate (int map)\n\t\tfor (int i = 0; i < mapX; i += 2) {\n\t\t\tfor (int j = 0; j < mapY; j += 2) {\n\t\t\t\tint r = (int) Math.random() * 4;\n\t\t\t\tif (r == 0) {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 1);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 1);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 1);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 1);\n\n\t\t\t\t} else {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 0);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 0);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 0);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 0);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic int getBlockNum() {\n\t\treturn 0;\n\t}", "public static Geometry assembleBlock(Block block, Vector3f location) {\n Geometry g = createLimb(block.collisionShapeType, block.width, block.height, block.length, location, block.mass, block.rotation, block.rotationForYRP);\n block.applyProperties(g);\n return g;\n }", "private void addUpBlock(Position p, TETile te,\n int len, int leftWid, int rightWid) {\n int x = p.x;\n int y = p.y;\n for (int j = y; j < y + len; j += 1) {\n for (int i = x - leftWid; i < x + rightWid + 1; i += 1) {\n world[i][j] = te;\n }\n }\n }", "public Block( ) {\r\n _offSetRow = 0;\r\n _offSetCol = 0;\r\n _noOfRows = 0;\r\n _noOfCols = 0;\r\n }", "void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }", "LocalMaterialData getSurfaceBlock();", "public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)\n {\n int var7 = ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;\n p_149689_1_.setBlock(p_149689_2_, p_149689_3_ + 1, p_149689_4_, this, 8 | var7, 2);\n }", "public void PlantMe(Block block){\n \tplugin.getReplant().add(block);\r\n \t\t//run the timer to load the block\r\n \t\r\n \tif(plugin.getTreeplant_Timer().getPoolSize() < plugin.getTreeplant_Timer().getMaximumPoolSize()){\r\n \t\tplugin.getTreeplant_Timer().schedule(new Runnable() {\r\n \t\t\t\tpublic void run() {\r\n \t\t\t\t\tif(!(plugin.getReplant().isEmpty())){\r\n \t\t\t\t\t\tBlock loadedBlock = plugin.getReplant().get(0);\r\n \t\t\t\t\t\t//remove it from the list\r\n \t\t\t\t\t\tplugin.getReplant().remove(0);\r\n \t\t\t\t\t\t//protect it\r\n \t\t\t\t\t\tProtectMe(loadedBlock);\r\n \t\t\t\t\t\t//made into a sap\r\n \t\t\t\t\t\tif( (loadedBlock.getType().equals(Material.AIR)) || (loadedBlock.getType().equals(Material.FIRE)) ) //just incase it was on fire\r\n \t\t\t\t\t\t\tloadedBlock.setType(Material.SAPLING);\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\t/* No longer needed! Didn't realized leaves light blocking changed way back when.\r\n \t\t\t\t\t\t * for(int i=loadedBlock.getY(); i < 128; i++){\r\n \t\t\t\t\t\t\t//delete all the leaves in a line to the sky limit\r\n \t\t\t\t\t\t\tif(loadedBlock.getType()==Material.LEAVES){\r\n \t\t\t\t\t\t\t\t//it's a leaf delete it\r\n \t\t\t\t\t\t\t\tloadedBlock.setType(Material.AIR);\r\n \t\t\t\t\t\t\t\t//update on server | Not needed?\r\n \t\t\t\t\t\t\t\t//etc.getServer().setBlock(leafToDelete);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t//go up one\r\n \t\t\t\t\t\t\tloadedBlock = loadedBlock.getFace(BlockFace.UP);\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}, plugin.getdelayTime(), TimeUnit.MILLISECONDS);\r\n \t}\r\n \t}", "public void originalSpace() {\n\t\tpos.x = 65;\n\t\tpos.y = p.height/2 + 100;\n\t\t\n\t}", "@Test\n public void testSafeBlocks() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n /* use 0 and 1 position because the margin blocks are inserted initially*/\n assertEquals(new Position(3 * TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE, \n TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE), terrain.getBlocks().get(0).getPosition());\n assertEquals(new Position(TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n 3 * TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE), terrain.getBlocks().get(1).getPosition());\n level.levelUp();\n });\n }", "private void scanForBlockFarAway() {\r\n\t\tList<MapLocation> locations = gameMap.senseNearbyBlocks();\r\n\t\tlocations.removeAll(stairs);\r\n\t\tif (locations.size() == 0) {\r\n\t\t\tblockLoc = null;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/* remove blocks that can be sensed */\r\n\t\tIterator<MapLocation> iter = locations.iterator();\r\n\t\twhile(iter.hasNext()) {\r\n\t\t\tMapLocation loc = iter.next();\r\n\t\t\tif (myRC.canSenseSquare(loc))\r\n\t\t\t\titer.remove();\r\n\t\t} \r\n\t\t\r\n\t\tlocations = navigation.sortLocationsByDistance(locations);\r\n\t\t//Collections.reverse(locations);\r\n\t\tfor (MapLocation block : locations) {\r\n\t\t\tif (gameMap.get(block).robotAtLocation == null){\r\n\t\t\t\t/* this location is unoccupied */\r\n\t\t\t\tblockLoc = block;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tblockLoc = null;\r\n\t}", "private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }", "LocalMaterialData withDefaultBlockData();", "public void preyMovement(WallBuilding wb, int x1, int x2, int y1, int y2){\r\n int b1 = wb.block.get(wb.block.stx(x1), wb.block.sty(y1));//one away\r\n int b2 = wb.block.get(wb.block.stx(x2), wb.block.sty(y2));//two away\r\n if(b1 == 0){//if there are no blocks, we can move normally\r\n if(wb.food.getObjectsAtLocation(x1, y1) == null){//if there is no food in that space\r\n wb.prey.setObjectLocation(this, wb.prey.stx(x1),wb.prey.sty(y1));\r\n }\r\n }else if(b1 == 1){//if there is one block\r\n if(b2 == 0){//if the space after is empty, we can move too!\r\n if(wb.food.getObjectsAtLocation(x2, y2) == null){//if there is no food in that space\r\n wb.block.set(wb.block.stx(x2), wb.block.sty(y2), b2+1);\r\n wb.block.set(wb.block.stx(x1), wb.block.sty(y1), b1-1);\r\n wb.prey.setObjectLocation(this, wb.prey.stx(x1),wb.prey.sty(y1));\r\n }\r\n }else if(b2 < 3){//there is space to move the block\r\n wb.block.set(wb.block.stx(x2), wb.block.sty(y2), b2+1);\r\n wb.block.set(wb.block.stx(x1), wb.block.sty(y1), b1-1);\r\n }\r\n }else{//if there are 2 or 3 blocks\r\n if(b2 < 3){//there is space to move the block\r\n if(wb.food.getObjectsAtLocation(x2, y2) == null){//if there is no food in that space\r\n wb.block.set(wb.block.stx(x2), wb.block.sty(y2), b2+1);\r\n wb.block.set(wb.block.stx(x1), wb.block.sty(y1), b1-1);\r\n }\r\n }\r\n }\r\n }", "public void reset(){\n\n boxPositions = new HashMap<>();\n boxWeights = new ArrayList<Stack<Box>>();\n for(int i = 0; i < 16; i++) {\n boxPositions.put(i*40, i);\n }\n for ( int i = 0; i < 16; i++){\n boxWeights.add( new Stack< Box >());\n }\n boxGen = new BoxGenerator();\n\n timeCounter = 100;\n mc.resetLazarusPosition();\n\n }", "public static ItemFrame addItemFrame(Block block, BlockFace face) {\n\t\tfinal Material mat = Material.GLASS;\n\t\tBlock northBlock = block.getWorld().getBlockAt(block.getX(), block.getY(), block.getZ() - 1);\n\t\tBlock southBlock = block.getWorld().getBlockAt(block.getX(), block.getY(), block.getZ() + 1);\n\t\tBlock eastBlock = block.getWorld().getBlockAt(block.getX() - 1, block.getY(), block.getZ());\n\t\tBlock westBlock = block.getWorld().getBlockAt(block.getX() + 1, block.getY(), block.getZ());\n\n\t\tif (northBlock.getType() == Material.AIR) {\n\t\t\tnorthBlock.setType(mat);\n\t\t}\n\t\tif (southBlock.getType() == Material.AIR) {\n\t\t\tsouthBlock.setType(mat);\n\t\t}\n\t\tif (eastBlock.getType() == Material.AIR) {\n\t\t\teastBlock.setType(mat);\n\t\t}\n\t\tif (westBlock.getType() == Material.AIR) {\n\t\t\twestBlock.setType(mat);\n\t\t}\n\n\t\tif (face == BlockFace.NORTH) {\n\t\t\tnorthBlock.setType(Material.AIR);\n\t\t} else if (face == BlockFace.SOUTH) {\n\t\t\tsouthBlock.setType(Material.AIR);\n\t\t} else if (face == BlockFace.EAST) {\n\t\t\teastBlock.setType(Material.AIR);\n\t\t} else if (face == BlockFace.WEST) {\n\t\t\twestBlock.setType(Material.AIR);\n\t\t}\n\n\t\tItemFrame itemFrame = (ItemFrame) block.getWorld().spawnEntity(block.getLocation(), EntityType.ITEM_FRAME);\n\n\t\tif (northBlock.getType() == mat) {\n\t\t\tnorthBlock.setType(Material.AIR);\n\t\t}\n\t\tif (southBlock.getType() == mat) {\n\t\t\tsouthBlock.setType(Material.AIR);\n\t\t}\n\t\tif (eastBlock.getType() == mat) {\n\t\t\teastBlock.setType(Material.AIR);\n\t\t}\n\t\tif (westBlock.getType() == mat) {\n\t\t\twestBlock.setType(Material.AIR);\n\t\t}\n\n\t\treturn itemFrame;\n\t}", "@ActionTrigger(action=\"KEY-PRVBLK\", function=KeyFunction.PREVIOUS_BLOCK)\n\t\tpublic void spriden_PreviousBlock()\n\t\t{\n\t\t\t\n\t\t\t\texecuteAction(\"INVALID_FUNCTION_MSG\");\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t}", "private void addLeftBlock(Position p, TETile te,\n int len, int leftWid, int rightWid) {\n\n int x = p.x;\n int y = p.y;\n for (int i = x; i > x - len; i -= 1) {\n for (int j = y - leftWid; j < y + rightWid + 1; j += 1) {\n world[i][j] = te;\n }\n }\n }", "private void layoutRingSystem(Point3d originalCoord, IAtom placedRingAtom, IRingSet ringSet, Point3d centerPlacedMolecule, IAtom atomB, AtomPlacer3D ap3d) {\n\t\t//logger.debug(\"****** Layout ring System ******\");System.out.println(\">around atom:\"+molecule.getAtomNumber(placedRingAtom));\n\t\tIAtomContainer ac = RingSetManipulator.getAllInOneContainer(ringSet);\n\t\tPoint3d newCoord = placedRingAtom.getPoint3d();\n\t\tVector3d axis = new Vector3d(atomB.getPoint3d().x - newCoord.x, atomB.getPoint3d().y - newCoord.y, atomB.getPoint3d().z - newCoord.z);\n\t\ttranslateStructure(originalCoord, newCoord, ac);\n\t\t//Rotate Ringsystem to farthest possible point\n\t\tVector3d startAtomVector = new Vector3d(newCoord.x - atomB.getPoint3d().x, newCoord.y - atomB.getPoint3d().y, newCoord.z - atomB.getPoint3d().z);\n\t\tIAtom farthestAtom = ap3d.getFarthestAtom(placedRingAtom.getPoint3d(), ac);\n\t\tVector3d farthestAtomVector = new Vector3d(farthestAtom.getPoint3d().x - newCoord.x, farthestAtom.getPoint3d().y - newCoord.y, farthestAtom.getPoint3d().z - newCoord.z);\n\t\tVector3d n1 = new Vector3d();\n\t\tn1.cross(axis, farthestAtomVector);\n\t\tn1.normalize();\n\t\tdouble lengthFarthestAtomVector = farthestAtomVector.length();\n\t\tVector3d farthestVector = new Vector3d(startAtomVector);\n\t\tfarthestVector.normalize();\n\t\tfarthestVector.scale((startAtomVector.length() + lengthFarthestAtomVector));\n\t\tdouble dotProduct = farthestAtomVector.dot(farthestVector);\n\t\tdouble angle = Math.acos(dotProduct / (farthestAtomVector.length() * farthestVector.length()));\n\t\tVector3d ringCenter = new Vector3d();\n\n\t\tfor (int i = 0; i < ac.getAtomCount(); i++) {\n\t\t\tif (!(ac.getAtom(i).getFlag(CDKConstants.ISPLACED))) {\n\t\t\t\tringCenter.x = (ac.getAtom(i).getPoint3d()).x - newCoord.x;\n\t\t\t\tringCenter.y = (ac.getAtom(i).getPoint3d()).y - newCoord.y;\n\t\t\t\tringCenter.z = (ac.getAtom(i).getPoint3d()).z - newCoord.z;\n\t\t\t\tringCenter = AtomTetrahedralLigandPlacer3D.rotate(ringCenter, n1, angle);\n\t\t\t\tac.getAtom(i).setPoint3d(\n\t\t\t\t\tnew Point3d(\n\t\t\t\t\t\tringCenter.x + newCoord.x,\n\t\t\t\t\t\tringCenter.y + newCoord.y,\n\t\t\t\t\t\tringCenter.z + newCoord.z\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t//ac.getAtomAt(i).setFlag(CDKConstants.ISPLACED, true);\n\t\t\t}\n\t\t}\n\n\t\t//Rotate Ring so that geometric center is max from placed center\n\t\t//logger.debug(\"Rotate RINGSYSTEM\");\n\t\tPoint3d pointRingCenter = GeometryTools.get3DCenter(ac);\n\t\tdouble distance = 0;\n\t\tdouble rotAngleMax = 0;\n\t\tangle = 1 / 180 * Math.PI;\n\t\tringCenter = new Vector3d(pointRingCenter.x, pointRingCenter.y, pointRingCenter.z);\n\t\tringCenter.x = ringCenter.x - newCoord.x;\n\t\tringCenter.y = ringCenter.y - newCoord.y;\n\t\tringCenter.z = ringCenter.z - newCoord.z;\n\t\tfor (int i = 1; i < 360; i++) {\n\t\t\tringCenter = AtomTetrahedralLigandPlacer3D.rotate(ringCenter, axis, angle);\n\t\t\tif (centerPlacedMolecule.distance(new Point3d(ringCenter.x, ringCenter.y, ringCenter.z)) > distance) {\n\t\t\t\trotAngleMax = i;\n\t\t\t\tdistance = centerPlacedMolecule.distance(new Point3d(ringCenter.x, ringCenter.y, ringCenter.z));\n\t\t\t}\n\t\t}\n\n\t\t//rotate ring around axis with best angle\n\t\trotAngleMax = (rotAngleMax / 180) * Math.PI;\n\t\tfor (int i = 0; i < ac.getAtomCount(); i++) {\n\t\t\tif (!(ac.getAtom(i).getFlag(CDKConstants.ISPLACED))) {\n\t\t\t\tringCenter.x = (ac.getAtom(i).getPoint3d()).x;\n\t\t\t\tringCenter.y = (ac.getAtom(i).getPoint3d()).y;\n\t\t\t\tringCenter.z = (ac.getAtom(i).getPoint3d()).z;\n\t\t\t\tringCenter = AtomTetrahedralLigandPlacer3D.rotate(ringCenter, axis, rotAngleMax);\n\t\t\t\tac.getAtom(i).setPoint3d(\n\t\t\t\t\tnew Point3d(\n\t\t\t\t\t\tringCenter.x,\n\t\t\t\t\t\tringCenter.y,\n\t\t\t\t\t\tringCenter.z\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tac.getAtom(i).setFlag(CDKConstants.ISPLACED, true);\n\t\t\t}\n\t\t}\n\t}", "private void setBlock(Block block) {\r\n this.block = block;\r\n }", "protected int[][][] fillBlock(RescueMap rm, int[] block,int density, Random rand){\n\t\t//make a building filling the whole block\n\t\tint[][] build = new int[block.length+1][2];\n\t\tfor(int i = 0; i < block.length; i++){\n\t\t\tbuild[i][0] = rm.getX(block[i]);\n\t\t\tbuild[i][1] = rm.getY(block[i]);\n\t\t\tif(i > 0 && i < block.length-1)\n\t\t\t\tshift(rm,block[i-1],block[i],block[i+1],build[i]);\n\t\t}\n\t\tshift(rm,block[block.length-1],block[0],block[1],build[0]);\n\t\tshift(rm,block[block.length-2],block[block.length-1],block[0],build[build.length-2]);\n\t\tbuild[build.length-1][0] = build[0][0];\n\t\tbuild[build.length-1][1] = build[0][1];\n\t\t//now break it up\n\t\tint minArea = 500000/(density+1);\n\t\tArrayList builds = processBuilding(build,minArea,rand);\n\t\tint[][][] bs = new int[builds.size()][][];\n\t\tfor(int i = 0; i < bs.length; i++) {\n\t\t\tbs[i] = (int[][])builds.get(i);\n\t\t\tshrink(bs[i],rand.nextDouble()*0.4);\n\t\t}\n\t\treturn bs;\n\t}", "private synchronized void loadSecondaryBlock(boolean next) {\n int step = (next) ? 1 : -2;\n if ((currentBlock + step) < 0) return;//return early if we are already at the beginning\n Controller.INSTANCE.run(() -> {\n String content = fullContent.get(currentBlock) + fullContent.get(currentBlock + step);\n mine.setContent(content);\n return Unit.INSTANCE;\n });\n }", "public abstract void makeSafeZone(float renderHeight);", "public synchronized Buffer pin(Block blk) {\n //=====================================CS4432-Project1=====================\n Buffer buff = findExistingBuffer(blk);\n if (buff == null) {\n buff = chooseUnpinnedBuffer();\n if (buff == null)\n return null;\n buff.assignToBlock(blk);\n }\n if (!buff.isPinned()) {\n //because we have the buffer pinned, that buffer is no longer available\n numAvailable--;\n\n //if we have a replacement policy of LRU, we know that this buffer is no longer valid for\n //replacement, so we can remove it from the array of frame numbers\n if (replacementPolicy.equalsIgnoreCase(\"LRU\")){\n //if we had previously added this buffer to the LRU array, we should remove\n int location = leastRecentlyUsedArray.indexOf(buff.getFrameNumber());\n if (location != -1){\n //remove it\n leastRecentlyUsedArray.remove(location);\n }\n }\n }\n //pin the block to the buffer\n buff.pin();\n return buff;\n }", "@Override\n public void relocatedWithinBounds() {\n x = random.nextInt(maxX - width);\n y = random.nextInt(maxY - height);\n }", "@Override\r\n protected void generateRavine(long seed, int chunkX, int chunkZ, byte[] chunkData, double blockX, double blockY, double blockZ, float scale, float leftRightRadian, float upDownRadian, int currentY, int targetY, double scaleHeight) {\r\n final int worldHeight = chunkData.length / (16 * 16); // 128 or 256\r\n final Random random = new SecureRandom();\r\n random.setSeed(seed);\r\n\r\n final double chunkCenterX = (double) (chunkX * 16 + 8);\r\n final double chunkCenterZ = (double) (chunkZ * 16 + 8);\r\n float leftRightChange = 0.0F;\r\n float upDownChange = 0.0F;\r\n\r\n if (targetY <= 0) {\r\n final int blockRangeY = this.range * 16 - 16;\r\n targetY = blockRangeY - random.nextInt(blockRangeY / 4);\r\n }\r\n\r\n boolean createFinalRoom = false;\r\n\r\n if (currentY == -1) {\r\n currentY = targetY / 2;\r\n createFinalRoom = true;\r\n }\r\n\r\n float nextIntersectionHeight = 1.0F;\r\n\r\n for (int k1 = 0; k1 < worldHeight; ++k1) {\r\n if (k1 == 0 || random.nextInt(3) == 0) {\r\n nextIntersectionHeight = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F;\r\n }\r\n\r\n this.field_75046_d[k1] = nextIntersectionHeight * nextIntersectionHeight;\r\n }\r\n\r\n for (; currentY < targetY; ++currentY) {\r\n double roomWidth = 1.5D + (double) (MathHelper.sin((float) currentY * (float) Math.PI / (float) targetY) * scale * 1.0F);\r\n double roomHeight = roomWidth * scaleHeight;\r\n roomWidth *= (double) random.nextFloat() * 0.25D + 0.75D;\r\n roomHeight *= (double) random.nextFloat() * 0.25D + 0.75D;\r\n float f6 = MathHelper.cos(upDownRadian);\r\n float f7 = MathHelper.sin(upDownRadian);\r\n blockX += (double) (MathHelper.cos(leftRightRadian) * f6);\r\n blockY += (double) f7;\r\n blockZ += (double) (MathHelper.sin(leftRightRadian) * f6);\r\n upDownRadian *= 0.7F;\r\n upDownRadian += upDownChange * 0.05F;\r\n leftRightRadian += leftRightChange * 0.05F;\r\n upDownChange *= 0.8F;\r\n leftRightChange *= 0.5F;\r\n upDownChange += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;\r\n leftRightChange += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;\r\n\r\n if (createFinalRoom || random.nextInt(4) != 0) {\r\n double d8 = blockX - chunkCenterX;\r\n double d9 = blockZ - chunkCenterZ;\r\n double d10 = (double) (targetY - currentY);\r\n double d11 = (double) (scale + 2.0F + 16.0F);\r\n\r\n if (d8 * d8 + d9 * d9 - d10 * d10 > d11 * d11) {\r\n return;\r\n }\r\n\r\n if (blockX >= chunkCenterX - 16.0D - roomWidth * 2.0D && blockZ >= chunkCenterZ - 16.0D - roomWidth * 2.0D && blockX <= chunkCenterX + 16.0D + roomWidth * 2.0D && blockZ <= chunkCenterZ + 16.0D + roomWidth * 2.0D) {\r\n final int xLow = TwoMath.withinBounds(MathHelper.floor_double(blockX - roomWidth) - chunkX * 16 - 1, 0, 16);\r\n final int xHigh = TwoMath.withinBounds(MathHelper.floor_double(blockX + roomWidth) - chunkX * 16 + 1, 0, 16);\r\n final int yLow = TwoMath.withinBounds(MathHelper.floor_double(blockY - roomHeight) - 1, 1, worldHeight - 8);\r\n final int yHigh = TwoMath.withinBounds(MathHelper.floor_double(blockY + roomHeight) + 1, 1, worldHeight - 8);\r\n final int zLow = TwoMath.withinBounds(MathHelper.floor_double(blockZ - roomWidth) - chunkZ * 16 - 1, 0, 16);\r\n final int zHigh = TwoMath.withinBounds(MathHelper.floor_double(blockZ + roomWidth) - chunkZ * 16 + 1, 0, 16);\r\n\r\n boolean underWater = false;\r\n for (int x = xLow; !underWater && x < xHigh; ++x) {\r\n for (int z = zLow; !underWater && z < zHigh; ++z) {\r\n for (int y = yHigh + 1; !underWater && y >= yLow - 1; --y) {\r\n final int index = (x * 16 + z) * worldHeight + y;\r\n\r\n if (y >= 0 && y < worldHeight) {\r\n if (isOceanBlock(chunkData, index, x, y, z, chunkX, chunkZ)) {\r\n underWater = true;\r\n }\r\n\r\n if (y != yLow - 1 && x != xLow && x != xHigh - 1 && z != zLow && z != zHigh - 1) {\r\n y = yLow;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!underWater) {\r\n for (int x = xLow; x < xHigh; ++x) {\r\n double d12 = ((double) (x + chunkX * 16) + 0.5D - blockX) / roomWidth;\r\n\r\n for (int z = zLow; z < zHigh; ++z) {\r\n double d13 = ((double) (z + chunkZ * 16) + 0.5D - blockZ) / roomWidth;\r\n int index = (x * 16 + z) * worldHeight + yHigh;\r\n boolean flag2 = false;\r\n\r\n if (d12 * d12 + d13 * d13 < 1.0D) {\r\n for (int y = yHigh - 1; y >= yLow; --y) {\r\n double yScale = ((double) y + 0.5D - blockY) / roomHeight;\r\n\r\n if ((d12 * d12 + d13 * d13) * (double) this.field_75046_d[y] + yScale * yScale / 6.0D < 1.0D) {\r\n if (isTopBlock(chunkData, index, x, y, z, chunkX, chunkZ)) {\r\n flag2 = true;\r\n }\r\n\r\n digBlock(chunkData, index, x, y, z, chunkX, chunkZ, flag2);\r\n }\r\n\r\n --index;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (createFinalRoom) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "static void hardDrop(Block b) {\n int[] pos = b.pos;\n char[][] piece = b.piece;\n\n while (canPlace(pos[0] + 1, pos[1], piece))\n pos[0]++;\n\n place(pos[0], pos[1], piece);\n }", "public Block( Block block ) {\r\n _offSetRow = block._offSetRow;\r\n _offSetCol = block._offSetCol;\r\n _noOfRows = block._offSetRow;\r\n _noOfCols = block._noOfCols;\r\n }", "public static void blockMove(Player player) {\n Location location1 = (Location) plugin.getConfig().get(\"region1\");\n Location location2 = (Location) plugin.getConfig().get(\"region2\");\n\n int y = (location1.getBlockY() < location2.getBlockY() ? location2.getBlockY() : location1.getBlockY());\n\n for (Location location : blockPlace.redblockloc) {\n int x = location.getBlockX();\n int z = location.getBlockZ();\n new Location(player.getWorld(), x, y + 1, z).getBlock().setType(location.getBlock().getType());\n player.sendMessage(String.valueOf(location.getBlock().getType()));\n if(location.getBlock().getType()==Material.AIR) {\n blockPlace.redblock.remove(location.getBlock().getType());\n }\n if(location.getBlock().getType()==Material.WATER) {\n blockPlace.redblock.remove(location.getBlock().getType());\n }\n if(location.getBlock().getType()== Material.IRON_BLOCK) {\n blockPlace.redblock.add(location.getBlock());\n }\n location.getBlock().setType(Material.AIR);\n }\n\n for (Location location : blockPlace.blueblockloc) {\n int xb = location.getBlockX();\n int zb = location.getBlockZ();\n new Location(player.getWorld(), xb, y + 1, zb).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n if(location.getBlock().getType()==Material.AIR) {\n blockPlace.blueblock.remove(location.getBlock().getType());\n }\n }\n\n for (Location location : blockPlace.greenblockloc) {\n int xg = location.getBlockX();\n int zg = location.getBlockZ();\n new Location(player.getWorld(), xg, y + 1, zg).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n }\n for (Location location : blockPlace.yellowblockloc) {\n int xy = location.getBlockX();\n int zy = location.getBlockZ();\n new Location(player.getWorld(), xy, y + 1, zy).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n }\n }", "private void cutoutBlocks(MetropolisGenerator generator, Cartesian v, Cartesian s, Material floor) {\n int xdir, ydir, zdir;\n xdir = s.X < 0 ? -1 : 1;\n ydir = s.Y < 0 ? -1 : 1;\n zdir = s.Z < 0 ? -1 : 1;\n \n for (int x = 0; Math.abs(x) < Math.abs(s.X); x += xdir) {\n for (int z = 0; Math.abs(z) < Math.abs(s.Z); z += zdir) {\n for (int y = 0; Math.abs(y) < Math.abs(s.Y); y += ydir) {\n generator.getWorld().getBlockAt(v.X + x, v.Y + y, v.Z + z).setType(Material.AIR);\n }\n Block below = generator.getWorld().getBlockAt(v.X + x, v.Y - 1, v.Z + z);\n if (!below.isEmpty()) {\n generator.getWorld().getBlockAt(v.X + x, v.Y - 1, v.Z + z).setType(floor);\n }\n }\n }\n }", "void removeBlock(Block block);", "@Override\n public void returnBlock(Block b) {\n b.reset();\n blocks.add(b);\n if (blocks.size() > highReservedBlocks) { // too many unused blocks\n synchronized (BlocksPool.class) { // can be easily changed to lock-free\n while (blocks.size() > lowReservedBlocks) {\n this.blocks.poll().clean();\n }\n }\n }\n }", "private boolean UpdateWithoutCarriedBlock()\r\n {\r\n if ( rand.nextInt(20) == 0 )\r\n {\r\n int i = MathHelper.floor_double( ( posX - 3D ) + rand.nextDouble() * 6D );\r\n int j = MathHelper.floor_double( posY - 1D + rand.nextDouble() * 7D );\r\n int k = MathHelper.floor_double( ( posZ - 3D ) + rand.nextDouble() * 6D );\r\n \r\n int l1 = worldObj.getBlockId( i, j, k );\r\n\r\n if ( CanPickUpBlock( i, j, k ) )\r\n {\r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderBlockCollectAuxFXID, i, j, k, l1 + ( worldObj.getBlockMetadata( i, j, k ) << 12 ) );\r\n\t\t \r\n setCarried( worldObj.getBlockId( i, j, k ) );\r\n setCarryingData( worldObj.getBlockMetadata( i, j, k ) );\r\n worldObj.setBlockToAir( i, j, k );\r\n }\r\n }\r\n else if ( worldObj.provider.dimensionId == 1 )\r\n {\r\n \t// Endermen in the end without a block in hand will eventually teleport back to the overworld\r\n \t\r\n \t\tif ( rand.nextInt( 9600 ) == 0 )\r\n \t\t{\r\n \t\t\t// play dimensional travel effects\r\n \t\t\t\r\n int i = MathHelper.floor_double( posX );\r\n int j = MathHelper.floor_double( posY ) + 1;\r\n int k = MathHelper.floor_double( posZ );\r\n \r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderChangeDimensionAuxFXID, i, j, k, 0 );\r\n\t\t \r\n setDead();\r\n \r\n return false;\r\n \t\t}\r\n }\r\n \r\n return true;\r\n }", "protected void warp() {\n\t\tRandom r = new Random();\n\t\t\n\t\t// Get random index from coordinates list\n\t\tint nextPos = r.nextInt(this.coords.length);\n\t\t\n\t\t// Set new position for monster\n\t\tthis.setBounds(this.coords[nextPos].width, this.coords[nextPos].height, mWidth, mHeight);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)\n public void onBlockPlace(BlockPlaceEvent event) {\n if (event.getBlock().getType() == Material.IRON_BLOCK) {\n\n running = true;\n\n Location location = event.getBlock().getLocation();\n int size = Options.ARENA_SIZE;\n\n // Set our Y to where we won't collide with anything.\n location.setY(location.getWorld().getHighestBlockYAt(location));\n\n for (int x = -size / 2; x <= size / 2; x++) {\n for (int z = -size / 2; z <= size / 2; z++) {\n int maxY = (x == -size / 2 || z == -size / 2 || x == size / 2 || z == size / 2) ? 5 : 1;\n\n for (int y = 0; y < maxY; y++) {\n Block block = location.clone().add(x, y, z).getBlock();\n\n if (y == 0) {\n block.setType(Material.NETHERRACK);\n } else {\n block.setType(Material.IRON_FENCE);\n }\n }\n }\n }\n\n Player player = event.getPlayer();\n\n player.getInventory().clear();\n player.getActivePotionEffects().clear();\n player.setGameMode(GameMode.ADVENTURE);\n player.teleport(location.clone().add(5, 1, 0));\n\n player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.RED + \"An arena appears...\"));\n\n Options.KIT_ITEMS.forEach(itemStack -> player.getInventory().addItem(itemStack.clone()));\n \n updateArmor(player);\n\n Bukkit.getScheduler().scheduleSyncDelayedTask(Plugin.getInstance(), () -> {\n Location spawnLocation = location.clone().add(0, 1, 0);\n\n SpawnControl point = new SpawnControl(spawnLocation);\n NPCController controller = new NPCController(player.getUniqueId(), point);\n\n NPCRegistry.getInstance().register(controller);\n });\n\n event.setBuild(false);\n }\n }", "LocalMaterialData withBlockData(int newData);", "public void clearAreaReset() {\n for(int x = 0; x < buildSize; x++) {\n for(int y = 4; y < 7; y++) {\n for(int z = 0; z < buildSize; z++) {\n myIal.removeBlock(x, y, z);\n }\n }\n }\n\n myIal.locx = 0; myIal.locy = 0; myIal.locz = 0;\n my2Ial.locx = 0; my2Ial.locy = 0; my2Ial.locz = 0;\n }", "@Override\n public void tileOnTop(CoverFlowOpenGL view, int position) {\n }", "public void SetBlockList() {\r\n int width = ScreenWidth / MatrixWidth;\r\n int hight = ScreenHeight / MatrixHeight;\r\n this.blockList = new BlockList();\r\n Bitmap blocks = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.blocks), width * 5, hight * 10, false);\r\n for (int i = 0; i < map.length; i++) {\r\n for (int j = 0; j < map[i].length; j++) {\r\n if(i==0 && j<3){//if its true so its wall or button so the type of block is 0\r\n this.blockList.AddBlock(i, j, 0, j, blocks, width, hight);\r\n }\r\n if (map[i][j] != '0')\r\n this.blockList.AddBlock(i, j, Integer.valueOf(String.valueOf(map[i][j])), 0, blocks, width, hight);\r\n }\r\n }\r\n }", "public void reset() {\n\t\tif (getElementCount()!=0) {\n\t\t\tremoveAll();\n\t\t}\n\t\tint rightX=getWidth()/2;\t\t\n\t\tint leftX=rightX-BEAM_LENGTH;\n\t\tint midY=(getHeight()-BODY_LENGTH)/2-2*HEAD_RADIUS-DIFF;\n\t\tint upY=midY-ROPE_LENGTH;\n\t\tint lowY=upY+SCAFFOLD_HEIGHT;\n\t\tGLine scaffold=new GLine(leftX, upY, leftX, lowY);\n\t\tadd(scaffold);\n\t\tGLine beam=new GLine(leftX, upY, rightX, upY);\n\t\tadd(beam);\n\t\tGLine rope=new GLine(rightX, upY, rightX, midY);\n\t\tadd(rope);\n\t}", "public SlabReinforcement(List<Integer> topDiameters,\n List<Integer> additionalTopDiameters,\n List<Integer> topSpacings,\n List<Integer> topVerticalSpacings,\n List<Integer> bottomDiameters,\n List<Integer> additionalBottomDiameters,\n List<Integer> bottomSpacings,\n List<Integer> bottomVerticalSpacings) {\n this(topDiameters, additionalTopDiameters, topSpacings, topVerticalSpacings, bottomDiameters, additionalBottomDiameters, bottomSpacings, bottomVerticalSpacings, null, null, null, null, 0);\n }", "public ArrayList<Block> generateRsBlocklist(ResidualSpace res, ArrayList<Block> bll, int n){\n ArrayList<Block> bll_rs = new ArrayList<>();\n\n if(res == null){\n // No more residual space left\n return bll_rs;\n }\n\n // Find all the boxes that fit\n for(int i = 0; i < bll.size(); i++){\n Block block = bll.get(i);\n if(block.getX_size() <= res.getX_size()\n && block.getY_size() <= res.getY_size()\n && block.getZ_size() <= res.getZ_size()) {\n // Block fits in the residual space, check if all the parcels are still available\n int[] bres_copy = bres.clone();\n\n boolean available = true;\n\n ArrayList<Integer> needed_parcel_ids = block.getNeeded_parcel_ids();\n for(int j = 0; j < needed_parcel_ids.size(); j++){\n int id = needed_parcel_ids.get(j);\n if(bres_copy[id] > 0){\n bres_copy[id] -= 1;\n }\n else{\n // Not enough left\n available = false;\n break;\n }\n }\n\n if(available){\n // save it to te bll_rs, make sure to clone it\n bll_rs.add(block.clone());\n if(bll_rs.size() >= n){\n return bll_rs;\n }\n }\n }\n }\n\n return bll_rs;\n }", "@Override\n \t/**\n \t * Called when the block is placed in the world.\n \t */\n \tpublic void auxiliaryOnBlockPlacedBy(TECarpentersBlock TE, World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack)\n \t{\n \t\tif (!entityLiving.isSneaking())\n \t\t{\n \t\t\t/* Match adjacent collapsible quadrant heights. */\n \t\t\t\n \t\t\tTECarpentersBlock TE_XN = world.getBlockId(x - 1, y, z) == blockID ? (TECarpentersBlock)world.getBlockTileEntity(x - 1, y, z) : null;\n \t\t\tTECarpentersBlock TE_XP = world.getBlockId(x + 1, y, z) == blockID ? (TECarpentersBlock)world.getBlockTileEntity(x + 1, y, z) : null;\n \t\t\tTECarpentersBlock TE_ZN = world.getBlockId(x, y, z - 1) == blockID ? (TECarpentersBlock)world.getBlockTileEntity(x, y, z - 1) : null;\n \t\t\tTECarpentersBlock TE_ZP = world.getBlockId(x, y, z + 1) == blockID ? (TECarpentersBlock)world.getBlockTileEntity(x, y, z + 1) : null;\n \n \t\t\tif (TE_XN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZNN, Collapsible.getQuadHeight(TE_XN, Collapsible.QUAD_XZPN));\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZNP, Collapsible.getQuadHeight(TE_XN, Collapsible.QUAD_XZPP));\n \t\t\t}\n \t\t\tif (TE_XP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZPN, Collapsible.getQuadHeight(TE_XP, Collapsible.QUAD_XZNN));\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZPP, Collapsible.getQuadHeight(TE_XP, Collapsible.QUAD_XZNP));\n \t\t\t}\n \t\t\tif (TE_ZN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZNN, Collapsible.getQuadHeight(TE_ZN, Collapsible.QUAD_XZNP));\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZPN, Collapsible.getQuadHeight(TE_ZN, Collapsible.QUAD_XZPP));\n \t\t\t}\n \t\t\tif (TE_ZP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZNP, Collapsible.getQuadHeight(TE_ZP, Collapsible.QUAD_XZNN));\n \t\t\t\tCollapsible.setQuadHeight(TE, Collapsible.QUAD_XZPP, Collapsible.getQuadHeight(TE_ZP, Collapsible.QUAD_XZPN));\n \t\t\t}\n \t\t}\n \t}", "protected void processBlock() {\n\t\t// expand 16 word block into 64 word blocks.\n\t\t//\n\t\tfor (int t = 16; t <= 63; t++) {\n\t\t\tX[t] = Theta1(X[t - 2]) + X[t - 7] + Theta0(X[t - 15]) + X[t - 16];\n\t\t}\n\n\t\t//\n\t\t// set up working variables.\n\t\t//\n\t\tint a = H1;\n\t\tint b = H2;\n\t\tint c = H3;\n\t\tint d = H4;\n\t\tint e = H5;\n\t\tint f = H6;\n\t\tint g = H7;\n\t\tint h = H8;\n\n\t\tint t = 0;\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\t// t = 8 * i\n\t\t\th += Sum1(e) + Ch(e, f, g) + K[t] + X[t];\n\t\t\td += h;\n\t\t\th += Sum0(a) + Maj(a, b, c);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 1\n\t\t\tg += Sum1(d) + Ch(d, e, f) + K[t] + X[t];\n\t\t\tc += g;\n\t\t\tg += Sum0(h) + Maj(h, a, b);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 2\n\t\t\tf += Sum1(c) + Ch(c, d, e) + K[t] + X[t];\n\t\t\tb += f;\n\t\t\tf += Sum0(g) + Maj(g, h, a);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 3\n\t\t\te += Sum1(b) + Ch(b, c, d) + K[t] + X[t];\n\t\t\ta += e;\n\t\t\te += Sum0(f) + Maj(f, g, h);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 4\n\t\t\td += Sum1(a) + Ch(a, b, c) + K[t] + X[t];\n\t\t\th += d;\n\t\t\td += Sum0(e) + Maj(e, f, g);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 5\n\t\t\tc += Sum1(h) + Ch(h, a, b) + K[t] + X[t];\n\t\t\tg += c;\n\t\t\tc += Sum0(d) + Maj(d, e, f);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 6\n\t\t\tb += Sum1(g) + Ch(g, h, a) + K[t] + X[t];\n\t\t\tf += b;\n\t\t\tb += Sum0(c) + Maj(c, d, e);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 7\n\t\t\ta += Sum1(f) + Ch(f, g, h) + K[t] + X[t];\n\t\t\te += a;\n\t\t\ta += Sum0(b) + Maj(b, c, d);\n\t\t\t++t;\n\t\t}\n\n\t\tH1 += a;\n\t\tH2 += b;\n\t\tH3 += c;\n\t\tH4 += d;\n\t\tH5 += e;\n\t\tH6 += f;\n\t\tH7 += g;\n\t\tH8 += h;\n\n\t\t//\n\t\t// reset the offset and clean out the word buffer.\n\t\t//\n\t\txOff = 0;\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tX[i] = 0;\n\t\t}\n\t}", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }" ]
[ "0.62672085", "0.605987", "0.60095835", "0.59236276", "0.58400136", "0.5766632", "0.5747479", "0.57316387", "0.56367904", "0.56155473", "0.5584509", "0.55289996", "0.55239767", "0.5501349", "0.54961514", "0.5458564", "0.54282755", "0.53953356", "0.53643125", "0.5337127", "0.5310059", "0.5304864", "0.52837205", "0.52684", "0.5263802", "0.524782", "0.5235549", "0.5228936", "0.5224868", "0.5224576", "0.5223739", "0.52220976", "0.5211037", "0.5199267", "0.5198335", "0.5191349", "0.5188536", "0.5183783", "0.51779836", "0.51696473", "0.5168309", "0.5158908", "0.515365", "0.51475817", "0.5142002", "0.5139905", "0.51374984", "0.51371694", "0.5133336", "0.51263094", "0.51179355", "0.510823", "0.5107686", "0.510744", "0.50990313", "0.50927955", "0.5091008", "0.50888526", "0.5087966", "0.5087721", "0.5086642", "0.5085569", "0.5078448", "0.50717694", "0.50686145", "0.50653607", "0.50541794", "0.5049468", "0.5045349", "0.504389", "0.50346106", "0.5033926", "0.5028559", "0.5022636", "0.50193965", "0.5015022", "0.50147426", "0.5011295", "0.5007818", "0.50057966", "0.5001521", "0.49979997", "0.49973413", "0.4979767", "0.49780086", "0.4975898", "0.49738255", "0.497055", "0.49655107", "0.49629816", "0.49627337", "0.49618348", "0.49598366", "0.49579346", "0.4946978", "0.4939959", "0.49374408", "0.4934805", "0.49255025", "0.49243578" ]
0.7612878
0
bll for the possible blocks, n the number of blocks to return
public ArrayList<Block> generateRsBlocklist(ResidualSpace res, ArrayList<Block> bll, int n){ ArrayList<Block> bll_rs = new ArrayList<>(); if(res == null){ // No more residual space left return bll_rs; } // Find all the boxes that fit for(int i = 0; i < bll.size(); i++){ Block block = bll.get(i); if(block.getX_size() <= res.getX_size() && block.getY_size() <= res.getY_size() && block.getZ_size() <= res.getZ_size()) { // Block fits in the residual space, check if all the parcels are still available int[] bres_copy = bres.clone(); boolean available = true; ArrayList<Integer> needed_parcel_ids = block.getNeeded_parcel_ids(); for(int j = 0; j < needed_parcel_ids.size(); j++){ int id = needed_parcel_ids.get(j); if(bres_copy[id] > 0){ bres_copy[id] -= 1; } else{ // Not enough left available = false; break; } } if(available){ // save it to te bll_rs, make sure to clone it bll_rs.add(block.clone()); if(bll_rs.size() >= n){ return bll_rs; } } } } return bll_rs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int numOfBlocks() {\n return ni * nj * nk;\n }", "abstract public int getNumberOfBlocks();", "int process(int maxBlocks);", "public int getNumberOfBlocks(ImagePlus img, int m, int n);", "public void initializeBlocks(final int baseIndex, final Block startBlock, int n) {\n /* Fill in the rest of the blocks in the current nursery. */\n final int remaining = numBlocks - baseIndex;\n final int m = Math.min(remaining, n);\n initializeWithBlock(baseIndex, m, startBlock, false);\n n -= m;\n if (n > 0) {\n Nursery nursery = next;\n /* Fill in the remaining nurseries. */\n while (n > 0) {\n final int blocks = Math.min(n, numBlocks);\n nursery.initializeWithBlock(0, blocks, startBlock, true);\n n -= numBlocks;\n nursery = nursery.next;\n }\n }\n }", "protected abstract void allocateBlocks(int numBlocks);", "int getBlockNumbers(int index);", "private static long BBT(int n, long[] strg) {\n\t\tif (n == 0 || n == 1)\n\t\t\treturn 1;\n\t\tif (strg[n] != 0)\n\t\t\treturn strg[n];\n\t\tstrg[n] = ((BBT(n - 1, strg) % mod) * (2 * (BBT(n - 2, strg) % mod + BBT(n - 1, strg) % mod) % mod)) % mod;\n\t\treturn strg[n];\n\n\t}", "int getBlockNums(int index);", "int getBlockNums(int index);", "int getTotalBlockNum();", "public List<Integer> getBlockAsList(int b){\n\t\tList<Integer> block = new ArrayList<Integer>(size*size);\n\t\tfor (int i = size*(b/size); i < size*(b/size+1); i++){\n\t\t\tfor (int j = size*(b%size); j < size*(b%size+1); j++){\n\t\t\t\tblock.add(numbers[i][j]);\n\t\t\t}\n\t\t}\n\t\treturn block;\n\t}", "public int[][] getBlock(int b){\n\t\tint[][] block = new int[size][size];\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\tblock[i][j] = numbers[i+size*(b/size)]\n\t\t\t\t\t\t [j+size*(b%size)];\n\t\t\t}\n\t\t}\n\t\treturn block;\n\t}", "int getBlocksAmount();", "public static void allBlocks(int input) {\n int y;\n\n for (y = 1; y < input + 1; y++) { //makes the block() method repeat for input number of times\n block(input, y);\n }\n\n }", "private static int neededBlocks(int bytes) {\n\t\tint ret = bytes / BLOCK_SIZE;\n\t\tif (bytes % BLOCK_SIZE != 0) {\n\t\t\tret++;\n\t\t}\n\t\treturn ret;\n\t}", "List<Block> blocks();", "void scanblocks() {\n\t\tint oldline, newline;\n\t\tint oldfront = 0; // line# of front of a block in old, or 0\n\t\tint newlast = -1; // newline's value during prev. iteration\n\n\t\tfor (oldline = 1; oldline <= oldinfo.maxLine; oldline++)\n\t\t\tblocklen[oldline] = 0;\n\t\tblocklen[oldinfo.maxLine + 1] = UNREAL; // starts a mythical blk\n\n\t\tfor (oldline = 1; oldline <= oldinfo.maxLine; oldline++) {\n\t\t\tnewline = oldinfo.other[oldline];\n\t\t\tif (newline < 0)\n\t\t\t\toldfront = 0; /* no match: not in block */\n\t\t\telse { /* match. */\n\t\t\t\tif (oldfront == 0)\n\t\t\t\t\toldfront = oldline;\n\t\t\t\tif (newline != (newlast + 1))\n\t\t\t\t\toldfront = oldline;\n\t\t\t\t++blocklen[oldfront];\n\t\t\t}\n\t\t\tnewlast = newline;\n\t\t}\n\t}", "public static int bell(int n) {\n\n int[][] bell = new int[n + 1][];\n bell[0] = new int[1];\n bell[0][0] = 1;\n\n for (int i = 1; i <= n; i++) {\n bell[i] = new int[i + 1];\n bell[i][0] = bell[i - 1][i - 1];\n for (int j = 1; j <= i; j++)\n bell[i][j] = bell[i - 1][j - 1] + bell[i][j - 1];\n }\n return bell[n][0];\n }", "public void addBlockList(int n) {\n BlockList.add(n);\r\n }", "public int NextMbAddress(int n) {\n\t\tint PicSizeInMapUnits= (sps0.pic_width_in_mbs_minus_1+1)*(sps0.pic_height_in_map_units_minus_1+1);\n\t\t// int FrameHeightInMbs = (2-(sps0.frame_mbs_only_flag ? 1:0))*(sps0.pic_height_in_map_units_minus_1+1);\n \t\t// int PicHeightInMbs = FrameHeightInMbs / (1+(field_pic_flag ? 1:0));\n\n \t\tint PicSizeInMbs = (sps0.pic_width_in_mbs_minus_1+1) * (PicHeightInMbs);\n\t\t// (7-34)\n\t\tint MapUnitsInSliceGroup0 = Math.min(((pps0.slice_group_change_rate_minus1 + 1) * slice_group_change_cycle), \n\t\t\t(PicSizeInMapUnits));\n\t\t// System.out.println(MapUnitsInSliceGroup0);\n\t\tint sizeOfUpperLeftGroup;\n\t\tif(pps0.num_slice_groups_minus1==1&&(pps0.slice_group_map_type==4||pps0.slice_group_map_type==5)){\n\n\t\t\tsizeOfUpperLeftGroup=(pps0.slice_group_change_direction_flag ? (PicSizeInMapUnits - MapUnitsInSliceGroup0)\n\t\t\t\t: MapUnitsInSliceGroup0);\n\t\t}\n\t\tint [] mapUnitToSliceGroupMap=new int[PicSizeInMapUnits];\n\t\tif(pps0.num_slice_groups_minus1==0){\n\t\t\t// System.out.println(\"zero \");\n\t\t\tfor(int i=0;i<pps0.pic_size_in_map_units_minus1+1;i++){\n\t\t\t\tmapUnitToSliceGroupMap[i]=0;\n\t\t\t}\t\t\t\n\t\t}\n\n\t\telse if(pps0.num_slice_groups_minus1!=0){\n\t\t\tif(pps0.slice_group_map_type==0){\n\t\t\t\t// 8.2.2.1\n\t\t\t}\n\t\t\telse if(pps0.slice_group_map_type==1){\n\t\t\t\t// 8.2.2.2\n\t\t\t}else if(pps0.slice_group_map_type==2){\n\t\t\t\t// 8.2.2.3\n\t\t\t}else if(pps0.slice_group_map_type==3){\n\t\t\t\t// 8.2.2.4\n\t\t\t}else if(pps0.slice_group_map_type==4){\n\t\t\t\t// 8.2.2.5\n\t\t\t}\n\t\t\telse if(pps0.slice_group_map_type==5){\n\t\t\t\t// 8.2.2.6\n\t\t\t}\n\t\t\telse if(pps0.slice_group_map_type==6){\n\t\t\t\t// 8.2.2.7\n\t\t\t}\n\t\t}\n\n\n\t\t\t\t\t\t\t\t\t/* 8.2.2.8 */\n \t\tint[] MbToSliceGroupMap=new int[PicSizeInMbs];\n \t\tfor(int i=0;i<PicSizeInMbs;i++){\n \t\t\tif(sps0.frame_mbs_only_flag==true||field_pic_flag==true){\n \t\t\t\t// System.out.println(PicSizeInMbs+\" \"+PicSizeInMapUnits);\n \t\t\t\tMbToSliceGroupMap[i]=mapUnitToSliceGroupMap[i];\n \t\t\t} else if(MbaffFrameFlag){\n \t\t\t\tMbToSliceGroupMap[i]=mapUnitToSliceGroupMap[(int)i/2];\n\n \t\t\t}else if(sps0.frame_mbs_only_flag==false&&sps0.mb_adaptive_frame_field_flag==false&&field_pic_flag==false){\n \t\t\t\tMbToSliceGroupMap[i]=mapUnitToSliceGroupMap[(int)(i/(2*sps0.pic_width_in_mbs_minus_1+1))\n \t\t\t\t*sps0.pic_width_in_mbs_minus_1+1+(i%sps0.pic_width_in_mbs_minus_1+1)];\n \t\t\t}\n\n \t\t}\n\t\t// i = n + 1 \n\t\t// while( i < PicSizeInMbs && MbToSliceGroupMap[ i ] != MbToSliceGroupMap[ n ] )\n\t\t // i++; \n\t\t// nextMbAddress = i\n\t\tint i = n + 1;\n\t\t// int nextMbAddress = i;\n\n\t\twhile(i<PicSizeInMbs &&( MbToSliceGroupMap[i]!=MbToSliceGroupMap[n])) {\n\t\t\ti++;\n\t\t\t// System.out.println(\"here mb address\");\n\t\t\t// nextMbAddress = i;\n\t\t}\n\t\t// System.out.println(\"nextMbAddress \"+i);\n\t\treturn i;\n\t}", "Block getBlockByNumber(long number);", "public abstract int getNextBlock(int block) throws IOException;", "private static ArrayList<Integer> createNodes(int bBit, int n) {\r\n\t\tHashSet<Integer> addNodes = new HashSet<Integer>();\r\n\t\tint maxNode = (int) Math.pow(2, bBit);\r\n\t\tRandom random = new Random();\r\n\t\twhile (addNodes.size() < n) {\r\n\t\t\tint randomNode = random.nextInt((maxNode - 1) + 1) + 1;\r\n\t\t\taddNodes.add(randomNode);\r\n\t\t}\r\n\t\tArrayList<Integer> sortedNodes = new ArrayList<Integer>(addNodes);\r\n\t\tCollections.sort(sortedNodes);\r\n\t\treturn sortedNodes;\r\n\t}", "java.util.List<java.lang.Integer> getBlockNumsList();", "java.util.List<java.lang.Integer> getBlockNumsList();", "public abstract void generateNextBlock();", "MultipleBranchingBlock createMultipleBranchingBlock();", "private static Optional<Board> calculateBlocksForCellsWithoutClues(Board inputBoard, int cellIndex) {\n\n if (cellIndex < 0)\n throw new IllegalArgumentException();\n if (inputBoard.allCellsInitialized() || cellIndex > 15)\n return Optional.of(inputBoard);\n\n int index = cellIndex;\n Board board = new Board(inputBoard);\n\n //find first uninitialized cell from given index\n while (index < 16) {\n if (board.getCell(index) == 0)\n break;\n index++;\n }\n\n if(index >= 16)\n //could not find uninitialized cell\n return Optional.of(board);\n\n //uninitialized cell at index\n //seek right block\n for(int block = 1; block <= 4; block++) {\n if(board.isUniqueInRowAndCol(index, block)) {\n //set new block value\n board.setCell(index, block);\n //now try and seek right block for next index\n Optional<Board> opt = calculateBlocksForCellsWithoutClues(board, index+1);\n if(opt.isPresent())\n //SUCCESS\n return opt;\n //else - try next block\n }\n }\n\n //if got here it means could not find right Permutation of block\n return Optional.empty();\n }", "int getBlockNumbersCount();", "public void testFetchBlocks() throws IOException {\n\t\tLocalRawDataBlockList list = new LocalRawDataBlockList();\r\n\t\tbyte[] data = new byte[512];\r\n\t\tint offset = 0;\r\n\r\n\t\tLittleEndian.putInt(data, offset, -3); // for the BAT block itself\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 1: is at end of file already; start block = -2\r\n\t\t// document 2: has only one block; start block = 1\r\n\t\tLittleEndian.putInt(data, offset, -2);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 3: has a loop in it; start block = 2\r\n\t\tLittleEndian.putInt(data, offset, 2);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 4: peeks into document 2's data; start block = 3\r\n\t\tLittleEndian.putInt(data, offset, 4);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, 1);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 5: includes an unused block; start block = 5\r\n\t\tLittleEndian.putInt(data, offset, 6);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, -1);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 6: includes a BAT block; start block = 7\r\n\t\tLittleEndian.putInt(data, offset, 8);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, 0);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 7: includes an XBAT block; start block = 9\r\n\t\tLittleEndian.putInt(data, offset, 10);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, -4);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 8: goes off into space; start block = 11;\r\n\t\tLittleEndian.putInt(data, offset, 1000);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 9: no screw ups; start block = 12;\r\n\t\tint index = 13;\r\n\r\n\t\tfor (; offset < 508; offset += LittleEndianConsts.INT_SIZE) {\r\n\t\t\tLittleEndian.putInt(data, offset, index++);\r\n\t\t}\r\n\t\tLittleEndian.putInt(data, offset, -2);\r\n\t\tlist.add(new RawDataBlock(new ByteArrayInputStream(data)));\r\n\t\tlist.fill(1);\r\n\t\tint[] blocks = { 0 };\r\n\t\tBlockAllocationTableReader table = new BlockAllocationTableReader(\r\n\t\t POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS, 1, blocks, 0, -2, list);\r\n\t\tint[] start_blocks = { -2, 1, 2, 3, 5, 7, 9, 11, 12 };\r\n\t\tint[] expected_length = { 0, 1, -1, -1, -1, -1, -1, -1, 116 };\r\n\r\n\t\tfor (int j = 0; j < start_blocks.length; j++) {\r\n\t\t\ttry {\r\n\t\t\t\tListManagedBlock[] dataBlocks = table.fetchBlocks(start_blocks[j], -1, list);\r\n\r\n\t\t\t\tif (expected_length[j] == -1) {\r\n\t\t\t\t\tfail(\"document \" + j + \" should have failed, but found a length of \"\r\n\t\t\t\t\t\t\t+ dataBlocks.length);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassertEquals(expected_length[j], dataBlocks.length);\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tif (expected_length[j] == -1) {\r\n\r\n\t\t\t\t\t// no problem, we expected a failure here\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void processBlock() {\n\t\t// expand 16 word block into 64 word blocks.\n\t\t//\n\t\tfor (int t = 16; t <= 63; t++) {\n\t\t\tX[t] = Theta1(X[t - 2]) + X[t - 7] + Theta0(X[t - 15]) + X[t - 16];\n\t\t}\n\n\t\t//\n\t\t// set up working variables.\n\t\t//\n\t\tint a = H1;\n\t\tint b = H2;\n\t\tint c = H3;\n\t\tint d = H4;\n\t\tint e = H5;\n\t\tint f = H6;\n\t\tint g = H7;\n\t\tint h = H8;\n\n\t\tint t = 0;\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\t// t = 8 * i\n\t\t\th += Sum1(e) + Ch(e, f, g) + K[t] + X[t];\n\t\t\td += h;\n\t\t\th += Sum0(a) + Maj(a, b, c);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 1\n\t\t\tg += Sum1(d) + Ch(d, e, f) + K[t] + X[t];\n\t\t\tc += g;\n\t\t\tg += Sum0(h) + Maj(h, a, b);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 2\n\t\t\tf += Sum1(c) + Ch(c, d, e) + K[t] + X[t];\n\t\t\tb += f;\n\t\t\tf += Sum0(g) + Maj(g, h, a);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 3\n\t\t\te += Sum1(b) + Ch(b, c, d) + K[t] + X[t];\n\t\t\ta += e;\n\t\t\te += Sum0(f) + Maj(f, g, h);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 4\n\t\t\td += Sum1(a) + Ch(a, b, c) + K[t] + X[t];\n\t\t\th += d;\n\t\t\td += Sum0(e) + Maj(e, f, g);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 5\n\t\t\tc += Sum1(h) + Ch(h, a, b) + K[t] + X[t];\n\t\t\tg += c;\n\t\t\tc += Sum0(d) + Maj(d, e, f);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 6\n\t\t\tb += Sum1(g) + Ch(g, h, a) + K[t] + X[t];\n\t\t\tf += b;\n\t\t\tb += Sum0(c) + Maj(c, d, e);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 7\n\t\t\ta += Sum1(f) + Ch(f, g, h) + K[t] + X[t];\n\t\t\te += a;\n\t\t\ta += Sum0(b) + Maj(b, c, d);\n\t\t\t++t;\n\t\t}\n\n\t\tH1 += a;\n\t\tH2 += b;\n\t\tH3 += c;\n\t\tH4 += d;\n\t\tH5 += e;\n\t\tH6 += f;\n\t\tH7 += g;\n\t\tH8 += h;\n\n\t\t//\n\t\t// reset the offset and clean out the word buffer.\n\t\t//\n\t\txOff = 0;\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tX[i] = 0;\n\t\t}\n\t}", "public abstract int[] findEmptyBlock(int processSize);", "int getBlockNumsCount();", "int getBlockNumsCount();", "int getBlockNumber(int x, int y);", "void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }", "@Test\n public void testNumberBlock() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n assertTrue(terrain.getBlocks().size() <= level.getBlocksNumber());\n level.levelUp();\n });\n }", "private void linbcg( int n, double b[], double x[], int itol, double tol, int itmax,\n double sa[], int ija[] ) {\n // FIXME check itol and those numbers that start from 1 in here\n double ak, akden, bk, bkden = 0, bknum, bnrm = 0, dxnrm, xnrm, zm1nrm, znrm = 0;\n\n double[] p = new double[n];\n double[] pp = new double[n];\n double[] r = new double[n];\n double[] rr = new double[n];\n double[] z = new double[n];\n double[] zz = new double[n];\n\n int iter = 0;\n double err = 0;\n atimes(n, x, r, false, sa, ija);\n for( int j = 0; j < n; j++ ) {\n r[j] = b[j] - r[j];\n rr[j] = r[j];\n }\n if (itol == 1) {\n bnrm = snrm(n, b, itol);\n asolve(n, r, z, sa);\n } else if (itol == 2) {\n asolve(n, b, z, sa);\n bnrm = snrm(n, z, itol);\n asolve(n, r, z, sa);\n } else if (itol == 3 || itol == 4) {\n asolve(n, b, z, sa);\n bnrm = snrm(n, z, itol);\n asolve(n, r, z, sa);\n znrm = snrm(n, z, itol);\n } else\n System.out.println(\"illegal itol in linbcg\"); //$NON-NLS-1$\n\n while( iter <= itmax ) {\n ++iter;\n asolve(n, rr, zz, sa);\n bknum = 0.0;\n for( int j = 0; j < n; j++ )\n bknum += z[j] * rr[j];\n if (iter == 1) {\n for( int j = 0; j < n; j++ ) {\n p[j] = z[j];\n pp[j] = zz[j];\n }\n } else {\n bk = bknum / bkden;\n for( int j = 0; j < n; j++ ) {\n p[j] = bk * p[j] + z[j];\n pp[j] = bk * pp[j] + zz[j];\n }\n }\n bkden = bknum;\n atimes(n, p, z, false, sa, ija);\n akden = 0.0;\n for( int j = 0; j < n; j++ )\n akden += z[j] * pp[j];\n ak = bknum / akden;\n atimes(n, pp, zz, true, sa, ija);\n for( int j = 0; j < n; j++ ) {\n x[j] += ak * p[j];\n r[j] -= ak * z[j];\n rr[j] -= ak * zz[j];\n }\n asolve(n, r, z, sa);\n if (itol == 1)\n err = snrm(n, r, itol) / bnrm;\n else if (itol == 2)\n err = snrm(n, z, itol) / bnrm;\n else if (itol == 3 || itol == 4) {\n zm1nrm = znrm;\n znrm = snrm(n, z, itol);\n if (Math.abs(zm1nrm - znrm) > EPS * znrm) {\n dxnrm = Math.abs(ak) * snrm(n, p, itol);\n err = znrm / Math.abs(zm1nrm - znrm) * dxnrm;\n } else {\n err = znrm / bnrm;\n continue;\n }\n xnrm = snrm(n, x, itol);\n if (err <= 0.5 * xnrm)\n err /= xnrm;\n else {\n err = znrm / bnrm;\n continue;\n }\n }\n if (err <= tol)\n break;\n }\n }", "public List<Integer> findMinHeightTrees(int n, int[][] edges) {\n List<Integer> ans = new ArrayList<>();\n if (n == 0) return ans;\n if (n == 1) {\n ans.add(0);\n return ans;\n }\n if (n == 2) {\n ans.add(0);\n ans.add(1);\n return ans;\n }\n\n //build graph\n List<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n graph[i] = new ArrayList<>();\n }\n for (int i = 0; i < edges.length; i++) {\n int v1 = edges[i][0];\n int v2 = edges[i][1];\n\n graph[v1].add(v2);\n graph[v2].add(v1);\n }\n\n //initial leaves\n List<Integer> leaves = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n if (graph[i].size() == 1) {\n leaves.add(i);\n }\n }\n\n int count = n;\n\n while (count > 2) {\n int leasize = leaves.size();\n count -= leasize;\n List<Integer> newleaves = new ArrayList<Integer>();\n for (int i = 0; i < leasize; i++) {\n int leavenode = leaves.get(i);\n int verToleave = graph[leavenode].get(0);\n graph[verToleave].remove(Integer.valueOf(leavenode));\n if (graph[verToleave].size() == 1) {\n newleaves.add(verToleave);\n }\n }\n\n leaves = newleaves;\n }\n return leaves;\n\n\n }", "int getBlockNumber();", "int getBlockNumber();", "NBLK(int[][] origMap) {\r\n\r\n\t\t\r\n\t\t// suppose it's a matrix for numberlink\r\n\t\tn_row = origMap.length;\r\n\t\tn_col = origMap[0].length;\r\n\t\tlength = n_row * n_col;\r\n\t\tadjaMatrix=new int[length][length];\r\n\t\tStartPoint=new HashMap<Integer, Node>();\r\n\t\tEndPoint=new HashMap<Integer, Node>();\r\n\t\tnowMap= new HashMap<Integer,LinkedList<Integer>>();\r\n\t\t\r\n\t\tpaths=new HashMap<Integer, Stack<Node>>();\r\n\t\tallNodes= new HashMap<Integer,Node>();\r\n\t\t\r\n\t\t\r\n\t\tlastPath=0;\r\n\t\t\r\n\t\tcount=0;\r\n\t\tfor (int i = 0; i < n_row; i++) {\r\n\t\t\tfor (int j = 0; j < n_col; j++) {\r\n\t\t\t\tif (origMap[i][j] > -1) {\r\n\t\t\t\t\t//we can use that point to represent a blocked point (i,j) as matrix[i][j]=-1\r\n\t\t\t\t\tint index = i * n_col + j;\r\n\t\t\t\t\tNode n = new Node(i, j, index, origMap[i][j]);\r\n\t\t\t\t\tallNodes.put(index, n);\r\n\t\t\t\t\tLinkedList<Integer> neibors = new LinkedList<Integer>();\r\n\r\n\t\t\t\t\tif (i > 0 && origMap[i-1][j] > -1) {\r\n\t\t\t\t\t\t//left\r\n\t\t\t\t\t\tadjaMatrix[index][(i - 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i - 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i - 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < n_row - 1 && origMap[i+1][j] > -1) {\r\n\t\t\t\t\t\t//right\r\n\t\t\t\t\t\tadjaMatrix[index][(i + 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i + 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i + 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j > 0 && origMap[i][j-1] > -1) {\r\n\t\t\t\t\t\t//top\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j - 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j - 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j < n_col - 1 && origMap[i][j+1] > -1) {\r\n\t\t\t\t\t\t//bottom\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j + 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j + 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j + 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnowMap.put(index, neibors);\r\n\t\t\t\t\tif (origMap[i][j] > 0) {\r\n\r\n\t\t\t\t\t\tif (!StartPoint.containsKey(origMap[i][j])) {\r\n\t\t\t\t\t\t\tStartPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t\tStack<Node> tp = new Stack<Node>();\r\n\t\t\t\t\t\t\ttp.push(n);\r\n\t\t\t\t\t\t\tpaths.put(origMap[i][j], tp);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tEndPoint.put(origMap[i][j], n);\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\r\n\t}", "public static BigRat splits(int n, int[] p) {\n\t\t\t BigInteger num = BI1;\n\t\t\t BigInteger denom = BI1;\n\n\t\t\t int psum = 0;\n\t\t\t int last_elt = 0;\n\t\t\t int multiplicity = 1;\n\t\t\t for (int i=0; i < p.length; i++) {\n\t\t\t num = num.multiply(choose(n - psum, p[i]));\n\t\t\t psum += p[i];\n\t\t\t if (p[i] == last_elt) {\n\t\t\t multiplicity++;\n\t\t\t denom = denom.multiply(BigInteger.valueOf(multiplicity));\n\t\t\t }\n\t\t\t else {\n\t\t\t multiplicity = 1;\n\t\t\t }\n\t\t\t last_elt = p[i];\n\t\t\t }\n\n\t\t\t return new BigRat(num, denom);\n\t\t\t }", "public BloomFilter(int n){\n\t\tflags = new boolean[4*n]; // initialize the boolean array by the size of 4n\n\t\tfor(int i=0; i<flags.length; i++){\n\t\t\tflags[i]=false; // initializing the fields with false value\n\t\t}\n\t\ta = (int) (Math.random()*100); // 1-100\n\t\tb = (int) (Math.random()*100);// 1-100\n\t}", "public List<Block> blocks() {\r\n List<Block> list = new ArrayList<Block>();\r\n double width = 50;\r\n for (int i = 0; i < 7; ++i) {\r\n Color c = new Color(0, 0, 0);\r\n switch (i) {\r\n case 0:\r\n c = Color.gray;\r\n break;\r\n case 1:\r\n c = Color.red;\r\n break;\r\n case 2:\r\n c = Color.yellow;\r\n break;\r\n case 3:\r\n c = Color.green;\r\n break;\r\n case 4:\r\n c = Color.white;\r\n break;\r\n case 5:\r\n c = Color.pink;\r\n break;\r\n default:\r\n c = Color.cyan;\r\n break;\r\n }\r\n for (int j = 0; j < 15; ++j) {\r\n Block b = new Block(new Rectangle(new Point(\r\n 25 + j * width, 100 + i * 20), width, 20));\r\n if (i == 0) {\r\n b.setHitPoints(2);\r\n } else {\r\n b.setHitPoints(1);\r\n }\r\n list.add(b);\r\n }\r\n }\r\n return list;\r\n }", "Block (int start, int size)\n {\n this.start = start;\n this.size = size;\n }", "public void collapseBlocks() {\n // Create it if it's null\n if (graph_bcc == null) {\n // Create graph parametrics (Only add linear time algorithms here...)\n graph_bcc = new BiConnectedComponents(graph);\n graph2p_bcc = new BiConnectedComponents(new UniTwoPlusDegreeGraph(graph));\n }\n BiConnectedComponents bcc = graph_bcc, bcc_2p = graph2p_bcc; if (bcc != null && bcc_2p != null) {\n // Get the vertex to block lookup\n Map<String,Set<MyGraph>> v_to_b = bcc.getVertexToBlockMap();\n // Go through the entities and accumulate the positions\n Map<MyGraph,Double> x_sum = new HashMap<MyGraph,Double>(), y_sum = new HashMap<MyGraph,Double>();\n Iterator<String> it_e = entity_to_wxy.keySet().iterator();\n while (it_e.hasNext()) {\n String entity = it_e.next(); Point2D pt = entity_to_wxy.get(entity);\n\tif (v_to_b.containsKey(entity)) {\n\t Iterator<MyGraph> it_mg = v_to_b.get(entity).iterator();\n\t while (it_mg.hasNext()) {\n\t MyGraph mg = it_mg.next();\n\t if (x_sum.containsKey(mg) == false) { x_sum.put(mg,0.0); y_sum.put(mg,0.0); }\n\t x_sum.put(mg,x_sum.get(mg)+pt.getX()); y_sum.put(mg,y_sum.get(mg)+pt.getY());\n\t }\n } else System.err.println(\"Vertex To Block Lookup missing \\\"\" + entity + \"\\\"\");\n }\n // Now position those entities that aren't cut vertices at the center of the graph\n it_e = entity_to_wxy.keySet().iterator();\n while (it_e.hasNext()) {\n String entity = it_e.next(); Point2D pt = entity_to_wxy.get(entity);\n\tif (v_to_b.containsKey(entity) && bcc.getCutVertices().contains(entity) == false) {\n MyGraph mg = v_to_b.get(entity).iterator().next();\n\t entity_to_wxy.put(entity, new Point2D.Double(x_sum.get(mg)/mg.getNumberOfEntities(),y_sum.get(mg)/mg.getNumberOfEntities()));\n\t transform(entity);\n\t}\n }\n // Re-render\n zoomToFit(); repaint();\n }\n }", "BranchingBlock createBranchingBlock();", "public List<Integer> findMinHeightTrees(int n, int[][] edges) {\n List<Integer> res = new ArrayList<Integer>();\n if (n == 1) {\n res.add(0);\n return res;\n }\n\n List<List<Integer>> adjList = new ArrayList<List<Integer>>();\n for (int i=0; i<n; i++) {\n adjList.add(new ArrayList<Integer>());\n }\n int[] degree = new int[n];\n for (int i=0; i<edges.length; i++) {\n adjList.get(edges[i][0]).add(edges[i][1]);\n adjList.get(edges[i][1]).add(edges[i][0]);\n degree[edges[i][0]]++;\n degree[edges[i][1]]++;\n }\n\n Queue<Integer> queue = new ArrayDeque<Integer>();\n for (int i = 0; i < n; i++) {\n if (degree[i] == 1) {\n queue.offer(i);\n }\n }\n\n while (!queue.isEmpty()) {\n List leaves = new ArrayList<Integer>();\n int size = queue.size();\n for (int i = 0; i < size; i++){\n int curr = queue.poll();\n leaves.add(curr);\n for(int next : adjList.get(curr)) {\n degree[next]--;\n if (degree[next]==1) {\n queue.offer(next);\n }\n }\n }\n res = leaves;\n }\n return res;\n }", "public static BigRat arrangements(int n) {\n\t\t\t if (n < 3) return BR1;\n\t\t\t if (!arrangements_cache.containsKey(n)) {\n\t\t\t BigInteger sum = BigInteger.valueOf(0);\n\t\t\t for (int k = 1; k < n; k++) {\n\t\t\t sum = sum.add(\n\t\t\t choose(n, k)\n\t\t\t .multiply(BigInteger.valueOf(n-k).pow(n-k))\n\t\t\t .multiply(BigInteger.valueOf(k).pow(k))\n\t\t\t );\n\t\t\t }\n\t\t\t arrangements_cache.put(n, new BigRat(sum, BigInteger.valueOf(n)));\n\t\t\t }\n\t\t\t return arrangements_cache.get(n);\n\t\t\t }", "public int[] getBlockAsArray(int b){\n\t\tint n = 0;\n\t\tint[] block = new int[size*size];\n\t\tfor (int i = size*(b/size); i < size*(b/size+1); i++){\n\t\t\tfor (int j = size*(b%size); j < size*(b%size+1); j++){\n\t\t\t\tblock[n] = numbers[i][j];\n\t\t\t\tn++;\n\t\t\t}\n\t\t}\n\t\treturn block;\n\t}", "private void setUpBlocks() {\n\t\tdouble xStart=0;\n\t\tdouble midPoint = getWidth()/2;\n\t\tint yStart = BRICK_Y_OFFSET;\t\n\t\t\n\t\tfor(int i = 0; i < NBRICK_ROWS; i++) {\n\t\t\t\n\t\t\txStart = midPoint - (NBRICKS_PER_ROW/2 * BRICK_WIDTH) - BRICK_WIDTH/2;\n\t\t\tlayRowOfBricks(xStart, yStart, i);\n\t\t\tyStart += BRICK_HEIGHT + BRICK_SEP;\n\t\t}\t\n\t}", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "public static int bulbFlipper(int n) {\n\t\tif (n < 1) {\n\t\t\tthrow new IllegalArgumentException(\"cannot accept less than 1\");\n\t\t}\n\t\tboolean bulbs[] = new boolean[n];\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tflipWithGap(bulbs, i);\n\t\t}\n\t\tint count = 0;\n\t\tfor (int i = 0; i < bulbs.length; i++) {\n\t\t\tif (bulbs[i]) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "private int computeRowBlocks(LinkedList<MergedDescendentFileContentRow> baseFileLinkedList, int panelNumber) {\n // Make sure to start with an empty list of row blocks.\n coloredRowBlocks.clear();\n\n Iterator<MergedDescendentFileContentRow> it = baseFileLinkedList.iterator();\n int blockSize = 0;\n int rowCount = 0;\n int rowType = -1;\n while (it.hasNext()) {\n int currentRowType;\n MergedDescendentFileContentRow mergedRow = it.next();\n rowCount++;\n if (blockSize == 0) {\n // This path for the very first row...\n if (panelNumber == 1) {\n rowType = translateRowType(mergedRow.getFirstDecendentRowType());\n } else {\n rowType = translateRowType(mergedRow.getSecondDecendentRowType());\n }\n currentRowType = rowType;\n } else {\n // This path for every row after the first row.\n if (panelNumber == 1) {\n currentRowType = translateRowType(mergedRow.getFirstDecendentRowType());\n } else {\n currentRowType = translateRowType(mergedRow.getSecondDecendentRowType());\n }\n }\n\n if (currentRowType == rowType) {\n blockSize++;\n } else {\n coloredRowBlocks.add(new ColoredRowBlock(rowType, blockSize));\n blockSize = 1;\n rowType = currentRowType;\n }\n }\n\n if (blockSize > 0) {\n coloredRowBlocks.add(new ColoredRowBlock(rowType, blockSize));\n }\n return rowCount;\n }", "abstract public ByteString getBlocksBuffer();", "public Percolation(int N) {\n\t\tif(N<=0)System.out.println(\"N should>0\");//throw new IndexOutOfBoundsException();\n\t\tuf = new WUnionFind(N*N+2); //use WeightedUnionFind\n\t\t\n\t\tfor(int i=1;i<=N;i++){//connect the upper wall to 0 to simplify the model\n\t\t\tuf.union(i, 0);\n\t\t}\n\t\tfor(int i=N*N;i>N*(N-1);i--){\n\t\t\tuf.union(i, N*N+1);\n\t\t}\n\t\tthis.N = N;\n\t\tblocks = new boolean[N+1][N+1];//N*N blocks but 0 row and 0 colum is not used\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tfor(int j=1;j<=N;j++){\n\t\t\t\tthis.blocks[i][j] = false;\n\t\t\t}\n\t\t}\n\t\tthis.uf = uf;\t\n\t}", "private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }", "public Percolation(int n){\n\t\tif (n <= 0)\n\t\t\tthrow new IllegalArgumentException(\"input must be greater than 0\");\n\t\tstoreVar = n; \n\t\tgrid = new boolean[n*n + 2]; \n\t\tfullgrid = new boolean[n*n + 2];\n\t\tvirtualTop = 0; \n\t\tvirtualBottom = grid.length-1; \n\t\tgrid[0] = true; \n\t\tgrid[grid.length-1] = true; \n\t\tfullgrid[0] = true;\n\t\tunionFind = new WeightedQuickUnionUF(grid.length);\n\t\tbackwash = new WeightedQuickUnionUF(n*n + 1);\n\t\topenSites = 0;\n\n\t}", "public int getBlockNumbers(int index) {\n return blockNumbers_.get(index);\n }", "public static int getBruteForce(int n){\n\t\t\n\t\tif(n<=2) \n\t\t\treturn n;\n\t\telse \n\t\t\treturn getBruteForce(n-1) + getBruteForce(n-2);\n\t}", "public int getNumberOfBlockGroups(int blocks, int blocksPerGroup){\n int blockGroups = blocks / blocksPerGroup; //get number of block groups\n return (blockGroups % blocksPerGroup) == 0 ? blockGroups : blockGroups+1; //inline if statemnt to check if the modulo value of block groups and blocks per group is 0\n }", "public List<List<Integer>> combinationSum3(int k, int n) {\n List<List<Integer>> res = new ArrayList<>();\n int min = 0, max = 0;\n for (int i = 1; i <= k; i++) {\n min += i;\n max += (10 - i);\n }\n if (n > max || n < min) return res;\n List<Integer> list = new ArrayList<>();\n dfs(k, n, res, list, 1);\n return res;\n }", "public int getBlockNumbers(int index) {\n return blockNumbers_.get(index);\n }", "private static ArrayList<ArrayList<Integer>> generatePartition(int n) {\n \tArrayList<ArrayList<Integer>> partitions = new ArrayList<>();\n \t// store the partition in non-increasing order, each value should be larger than 1\n \tInteger[] partition = new Integer[n];\n \t// the first partition is n itself\n \tpartition[0] = n;\n \tpartitions.add(new ArrayList<Integer>(Arrays.asList(Arrays.copyOf(partition, 1))));\n \t// if all value are 2, then it can not partition any further\n \tint k = 0;\n \twhile (partition[0] > 2) {\n \t\t// generate next partition\n \t\tint remain = 0;\n \t\t// find the rightmost value which is larger than 2\n \t\twhile (partition[k] < 3) {\n \t\t\tremain += partition[k];\n \t\t\tk--;\n \t\t}\n \t\tpartition[k]--;\n \t\tremain++;\n \t\t// if remain is more, divide it in different values of size partition[k]\n \t\twhile (remain > partition[k]) {\n \t\t\tpartition[k + 1] = partition[k];\n \t\t\tremain -= partition[k];\n \t\t\tk++;\n \t\t}\n \t\tpartition[k + 1] = remain;\n \t\tk++;\n \t\t// ignore all partitions contain value 1\n \t\tif (partition[k] > 1) {\n \t\t\tpartitions.add(new ArrayList<Integer>(Arrays.asList(Arrays.copyOf(partition, k + 1))));\n \t\t}\n \t}\n \treturn partitions;\n }", "public static int calculateBlocks(int[][] matrix) throws IOException {\n int blockNumber = 0;\n for (int i = 0; i < x; i++) {\n for (int j = 0; j < y; j++) {\n if (matrix[i][j] > 0) {\n if (isStartBlock(i, j, matrix, true)) {\n blockNumber++;\n matrix[i][j] = blockNumber;\n }\n }\n }\n }\n return blockNumber;\n }", "public static long binom(int n, int k) {\n if (k > n || n < 0 || k < 0) {\n return 0;\n }\n\n if (bin == null)\n bin = new ArrayList<ArrayList<Long>>();\n\n if (bin.size() <= n) {\n for (int i = bin.size(); i <= n; i++) {\n ArrayList<Long> newList = new ArrayList<Long>();\n bin.add(newList);\n }\n }\n\n if (bin.get(n).size() <= k) {\n for (int i = 0; i <= n; i++) {\n if (bin.get(i).size() <= k && bin.get(i).size() <= i) {\n for (int j = bin.get(i).size(); j <= k && j <= i; j++) {\n bin.get(i).add(Long.valueOf(0));\n }\n }\n }\n }\n\n return recBinom(n, k);\n }", "public static long sb(long a[], long n, long x) {\n long len = Long.MAX_VALUE;\n int p1 = 0;\n int p2 = 0;\n long sum = 0l;\n while(p1<=p2 && p2<n) {\n sum = sum + a[p2];\n p2++;\n while(sum >= x) {\n len = len > (p2-p1) ? (p2-p1) : len;\n sum = sum - a[p1];\n p1++;\n }\n }\n return len == Long.MAX_VALUE ? -1 : len;\n }", "Bolsa(int n) {\r\n\t\tbolsa = new int[n];\r\n\t\tRandom rnd=new Random();\r\n\t\tbolsa[n-1] = 1;\r\n\t}", "private boolean bfs(int[] pos, int[][] dis, int[][] grid,int m, int n,int bcnt){\n Queue<int[]> q = new LinkedList<>();\n int curx=0, cury=0, curlevel=0 ;\n int newx = 0, newy=0, newlevel = 0;\n int[] cur;\n boolean availableplace = false;\n boolean[][] vd = new boolean[m][n];\n int res =0;\n vd[pos[0]][pos[1]] = true;\n q.offer(pos);\n while(!q.isEmpty()){\n cur = q.poll();\n curx = cur[0];\n cury = cur[1];\n curlevel = cur[2];\n vd[curx][cury]=true;\n for(int[] mm : M){\n newx = curx+mm[0];\n newy = cury+mm[1];\n if(newx >=0 && newx <m && newy >=0 && newy <n && !vd[newx][newy] &&grid[newx][newy]!=2){\n vd[newx][newy] = true;\n if(grid[newx][newy]==1) res++;\n else if(grid[newx][newy]==0){\n availableplace = true;\n dis[newx][newy]+=curlevel;\n q.offer(new int[]{newx,newy,curlevel+1});\n }\n }\n }\n }\n return res==bcnt-1&&availableplace;\n }", "public long getBlockCount ( ) {\r\n\t\treturn 436;\r\n\t}", "@Override\n public List<Block> blocks() {\n int columns = 15, width = 51, height = 30;\n Color darkGreen = new Color(29, 101, 51);\n List<Block> blocks = new ArrayList<>();\n for (int j = 0; j < columns; j++) {\n blocks.add(new Block(new arkanoid.geometry.Rectangle(new Point(20 + width * j, 110 + height),\n width, height), darkGreen));\n }\n return blocks;\n }", "RclBlock createRclBlock();", "private void BScreate() {\n\n\t\tint sum=0;//全枝数のカウント\n\t\tfor(int i=0;i<banknode;i++) sum+=Bank.get(i).deg;\n\n\t\t//e,d,nの決定\n\t\tif(NW==\"BA\"){\n\t\tfor(int i=0;i<banknode;i++) {\n\t\t\tBank.get(i).totalassets=E*((double)Bank.get(i).deg/(double)sum);\n\t\t\tBank.get(i).n=Bank.get(i).totalassets*Bank.get(i).CAR;\n\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t}\n\t\t}\n\n\t\tif(NW==\"CM\"){\n\t\t\tfor(int i=0;i<banknode;i++){\n\t\t\t\tBank.get(i).totalassets=E/banknode;\n\t\t\t\tBank.get(i).n=Bank.get(i).totalassets*asyCAR;\n\t\t\t\tBank.get(i).forcelev=megaCAR;\n\t\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t\t}\n\n\t\t}\n\n\t}", "private static CurveBuildingBlock toBlock(CurveGroupDefinition groupDefn) {\n ImmutableList.Builder<CurveParameterSize> builder = ImmutableList.builder();\n for (CurveGroupEntry entry : groupDefn.getEntries()) {\n NodalCurveDefinition defn = entry.getCurveDefinition();\n builder.add(CurveParameterSize.of(defn.getName(), defn.getParameterCount()));\n }\n return CurveBuildingBlock.of(builder.build());\n }", "void makeNborLists(){\n\t\t\tfor (int i = 0; i < N; i++){\n\t\t\t\tint ct = 0;\n\t\t\t\tint boundsCt = 0;\n\t\t\t\tfor (int j = 0; j < maxNbors; j++){\n\t\t\t\t\tint nborSite = nborList[i][j];\n\t\t\t\t\tif(nborSite>=1){\n\t\t\t\t\t\tif (aliveLattice[nborSite]){\n\t\t\t\t\t\t\tct += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tboundsCt += 1;\n\t\t\t\t\t}\n\t\t\t\t\tint noDead = maxNbors - ct;\n\t\t\t\t\tfracDeadNbors[i] = (double)noDead/maxNbors;\n\t\t\t\t\tif(deadDissipation==true) noNborsForSite[i] = noNbors; \n\t\t\t\t\telse if (deadDissipation==false){\n\t\t\t\t\t\tif(boundaryConditions==\"Open\")\n\t\t\t\t\t\t\tnoNborsForSite[i]=ct+boundsCt;\n\t\t\t\t\t\telse if(boundaryConditions == \"Periodic\")\n\t\t\t\t\t\t\tnoNborsForSite[i]=ct;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(deadDissipation==true){\n\t\t\t\tfor (int i = 0; i < N; i++)\tnoNborsForSite[i] = noNbors; \n\t\t\t\tfor (int i = 0; i < N; i++){\n\t\t\t\t\tint ct = 0;\n\t\t\t\t\tfor (int j = 0; j < maxNbors; j++){\n\t\t\t\t\t\tif (aliveLattice[nborList[i][j]]){\n\t\t\t\t\t\t\tct += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tint noDead = maxNbors - ct;\n\t\t\t\t\t\tfracDeadNbors[i] = (double)noDead/maxNbors;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if (deadDissipation==false){\n\t\t\t\tfor (int i = 0; i < N; i++){\n\t\t\t\t\tint ct = 0;\n\t\t\t\t\tfor (int j = 0; j < maxNbors; j++){\n\t\t\t\t\t\tif (aliveLattice[nborList[i][j]]){\n\t\t\t\t\t\t\tct += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tint noDead = maxNbors - ct;\n\t\t\t\t\t\tfracDeadNbors[i] = (double)noDead/maxNbors;\n\t\t\t\t\t\tnoNborsForSite[i]=ct;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "java.util.List<java.lang.Integer> getBlockNumbersList();", "public List<Integer> findMinHeightTrees(int n, int[][] edges) {\n if (n == 1)\n return Collections.singletonList(0);\n List<Set<Integer>> graph = new ArrayList<>(n);\n for (int i = 0; i < n; i++)\n graph.add(new HashSet<>());\n for (int[] edge : edges) {\n graph.get(edge[0]).add(edge[1]);\n graph.get(edge[1]).add(edge[0]);\n }\n\n List<Integer> oneDegreeNodes = new LinkedList<>();\n for (int i = 0; i < n; i++)\n if (graph.get(i).size() == 1)\n oneDegreeNodes.add(i);\n\n while (n > 2) {\n n -= oneDegreeNodes.size();\n List<Integer> oneDegreeNodes0 = new LinkedList<>();\n for (Integer oneDegreeNode : oneDegreeNodes) {\n Integer neighbor = graph.get(oneDegreeNode).iterator().next();\n graph.get(neighbor).remove(oneDegreeNode);\n if (graph.get(neighbor).size() == 1)\n oneDegreeNodes0.add(neighbor);\n }\n oneDegreeNodes = oneDegreeNodes0;\n }\n return oneDegreeNodes;\n }", "public abstract int neighboursInBlock(Set<Integer> block, int vertexIndex);", "public long getBlockCount() {\n \t\tint coords[] = getCoords();\n \t\treturn \n \t\t(coords[3]-coords[0]+1)*\n \t\t(coords[4]-coords[1]+1)*\n \t\t(coords[5]-coords[2]+1);\n \t}", "@Override\n public List<Block> blocks() {\n List<Block> blocksList = new ArrayList<Block>();\n\n //Setting the blocks\n for (int j = 0; j <= 14; j++) {\n if (j == 0 || j == 1) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.CYAN));\n } else if (j == 2 || j == 3) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.PINK));\n } else if (j == 4 || j == 5) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.BLUE));\n } else if (j == 6 || j == 7 || j == 8) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.GREEN));\n } else if (j == 9 || j == 10) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.YELLOW));\n } else if (j == 11 || j == 12) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.ORANGE));\n } else if (j == 13 || j == 14) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.RED));\n }\n }\n\n return blocksList;\n }", "void split(Node n,Stack<Long> nodes);", "private int bepaalByes(int[] arr, int n) {\r\n\t\tint tot = 0;\r\n\t\tfor (int v : arr)\r\n\t\t\ttot += v;\r\n\t\treturn (tot - n);\r\n\t}", "public List<List<Integer>> combine(int n, int k) {\n List<List<Integer>> res = new ArrayList<>();\n dfs(res,1,k,new ArrayList<>(),n);\n return res;\n }", "@Override\n\tpublic long getFreeBlocks() {\n\t\treturn 0;\n\t}", "public int arrangeCoinsApprach3(int n) {\n long nLong = (long)n;\n \n long st = 0;\n long ed = nLong;\n \n long mid = 0;\n \n while (st <= ed){\n mid = st + (ed - st) / 2;\n \n if (mid * (mid + 1) <= 2 * nLong){\n st = mid + 1;\n }else{\n ed = mid - 1;\n }\n }\n \n return (int)(st - 1);\n }", "private void helper(int n, List<Integer> cur, List<List<Integer>> result) {\n\t\tif (cur.size() == n) {\n\t\t\tresult.add(new ArrayList<Integer>(cur));\n\t\t\treturn;\n\t\t}\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// check if putting a queen at column i at current row is valid.\n\t\t\tif (valid(cur, i)) {\n\t\t\t\tcur.add(i);\n\t\t\t\thelper(n, cur, result);\n\t\t\t\tcur.remove(cur.size() - 1);\n\t\t\t}\n\t\t} // end for\n\t}", "private void generate () {\n\t\t\n\t\tArrayList<Integer[]> copyToCheck = new ArrayList<Integer[]> ();\n\t\tfor (int i = 0; i < Math.pow(size, 3); i++) { // Filling up the maze with blocks\n\t\t\tint x, y, z;\n\t\t\tx = i / (size * size); // Get the x, y, and z\n\t\t\ty = i % (size * size) / size;\n\t\t\tz = i % (size * size) % size;\n\t\t\t// spaces each block out by 1\n\t\t\tif (x%2 == 1 && y%2 == 1 && z%2 == 1) {\n\t\t\t\tmaze.add(new Block (x, y, z, ' ')); // 'w' means wall\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tmaze.add(new Block (x, y, z, 'w'));\n\t\t\t\tif (x > 0 && y > 0 && z > 0 && x < size-1 && y < size-1 && z < size-1) { // if the blocks are within the outer shell, add the blocks to the list of walls to check\n\t\t\t\t\tif (x%2+y%2+z%2 == 2)copyToCheck.add(new Integer[] {x, y, z});\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if (x > 0 && y > 0 && z > 0 && x < size-1 && y < size-1 && z < size-1) { // checks if the coordinates are within the smaller cube that is below the first layer.\n\t\t\t\t//copyToCheck.add(new Integer[] { x, y, z });\t// the Block coords left to check\n\t\t\t//}\n\t\t}\n\t\t\n\t\tint starty, startx, startz; // x, y and z of current block\n\t\tstartz = 0; // the starting block will be at z = 0 because that is the bottom-most layer\n\n\t\tstartx = ((int)(Math.random() * (size/2)))*2 + 1; \n\t\tstarty = ((int)(Math.random() * (size/2)))*2 + 1;\n\t\tstart = get(startx, starty, startz);\n\t\t\n\t\tint endx, endy, endz; // x, y and z of end block\n\t\tendx = ((int)(Math.random() * (size/2)))*2 + 1; \n\t\tendy = ((int)(Math.random() * (size/2)))*2 + 1;\n\t\tendz = size-1;\n\t\tend = get(endx, endy, endz);\n\t\t\n\t\tArrayList<Integer[]> toCheck;\n\t\tboolean removed = true;\n\t\twhile (removed) {\n\t\t\tremoved = false;\n\t\t\ttoCheck = new ArrayList<Integer[]> ();\n\t\t\tfor (Integer[] thing : copyToCheck) {\n\t\t\t\ttoCheck.add(thing);\n\t\t\t}\n\t\t\tCollections.shuffle(toCheck); // Randomizes the order of the list of coordinates to check.\n\t\t\tfor (Integer[] coords : toCheck) {\n\t\t\t\tBlock curr = get(coords[0], coords[1], coords[2]);\n\t\t\t\tArrayList<Block> neighbors = getAdj(curr);\n\t\t\t\tboolean isJoint = false;\n\t\t\t\t\tfor (int i = 0; i < neighbors.size() - 1 && !isJoint; i++) {\n\t\t\t\t\t\tfor (int j = i+1; j < neighbors.size(); j++) {\n\t\t\t\t\t\t\tif (neighbors.get(j).t == ' ')\n\t\t\t\t\t\t\t\tif (neighbors.get(i).tree == neighbors.get(j).tree) {\n\t\t\t\t\t\t\t\t\tisJoint = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isJoint) { // Even if it doesn't matter too much, don't want to spend a bunch of time iterating through the stuff unless I have too.\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\tif (!isJoint) {\n\t\t\t\t\t\tremoved = true;\n\t\t\t\t\t\tcopyToCheck.remove(coords);\n\t\t\t\t\t\tjoin(curr); // Joins all of the sets, changes the type of the block.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tArrayList<Block> t = new ArrayList<Block>();\n\t\tfor (int i = 0; i < 5*size; i++) {\n\t\t\tArrayList<Block> b = getWalls();\n\t\t\t\n\t\t\tint rand = (int)(Math.random()*b.size());\n\t\t\tint x = b.get(rand).x;\n\t\t\tint y = b.get(rand).y;\n\t\t\tint z = b.get(rand).z;\n\t\t\tset(x, y, z, new Trap (x, y, z));\n\t\t}\n\t\tstart.t = ' '; // sets the type of the start and end blocks\n\t\tend.t = 'e';\n\t}", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "public static void block(int input, int y) {\n int x;\n int z;\n int a;\n\n for (z = 0; z < y; z++) { //makes the number repeat for n number of lines\\\n line(input, y);\n\n }\n\n for (a = input; a > y; a--) {\n System.out.print(\" \");\n }\n for (x = 0; x < y - 1; x++) { //prints out \"-\" 2n-1 number of times depending on the number, after each number is printed 2n-1 times for n amount of lines\n System.out.print(\"--\");\n\n }\n System.out.println(\"-\");\n\n\n\n\n }", "public int getBlockNums(int index) {\n return blockNums_.get(index);\n }", "public int getBlockNums(int index) {\n return blockNums_.get(index);\n }", "public static int GetTotalBlocks()\n {\n return totalBlocks;\n }", "protected void processBlock(byte[] paramArrayOfByte)\r\n/* 150: */ {\r\n/* 151:236 */ int i5 = decodeBEInt(paramArrayOfByte, 0);\r\n/* 152:237 */ int i6 = decodeBEInt(paramArrayOfByte, 4);\r\n/* 153:238 */ int i7 = decodeBEInt(paramArrayOfByte, 8);\r\n/* 154:239 */ int i8 = decodeBEInt(paramArrayOfByte, 12);\r\n/* 155:240 */ int i9 = decodeBEInt(paramArrayOfByte, 16);\r\n/* 156:241 */ int i10 = decodeBEInt(paramArrayOfByte, 20);\r\n/* 157:242 */ int i11 = decodeBEInt(paramArrayOfByte, 24);\r\n/* 158:243 */ int i12 = decodeBEInt(paramArrayOfByte, 28);\r\n/* 159:244 */ int j = this.V00 ^ this.V10;\r\n/* 160:245 */ int k = this.V01 ^ this.V11;\r\n/* 161:246 */ int m = this.V02 ^ this.V12;\r\n/* 162:247 */ int n = this.V03 ^ this.V13;\r\n/* 163:248 */ int i1 = this.V04 ^ this.V14;\r\n/* 164:249 */ int i2 = this.V05 ^ this.V15;\r\n/* 165:250 */ int i3 = this.V06 ^ this.V16;\r\n/* 166:251 */ int i4 = this.V07 ^ this.V17;\r\n/* 167:252 */ j ^= this.V20;\r\n/* 168:253 */ k ^= this.V21;\r\n/* 169:254 */ m ^= this.V22;\r\n/* 170:255 */ n ^= this.V23;\r\n/* 171:256 */ i1 ^= this.V24;\r\n/* 172:257 */ i2 ^= this.V25;\r\n/* 173:258 */ i3 ^= this.V26;\r\n/* 174:259 */ i4 ^= this.V27;\r\n/* 175:260 */ int i = i4;\r\n/* 176:261 */ i4 = i3;\r\n/* 177:262 */ i3 = i2;\r\n/* 178:263 */ i2 = i1;\r\n/* 179:264 */ i1 = n ^ i;\r\n/* 180:265 */ n = m ^ i;\r\n/* 181:266 */ m = k;\r\n/* 182:267 */ k = j ^ i;\r\n/* 183:268 */ j = i;\r\n/* 184:269 */ this.V00 = (j ^ this.V00);\r\n/* 185:270 */ this.V01 = (k ^ this.V01);\r\n/* 186:271 */ this.V02 = (m ^ this.V02);\r\n/* 187:272 */ this.V03 = (n ^ this.V03);\r\n/* 188:273 */ this.V04 = (i1 ^ this.V04);\r\n/* 189:274 */ this.V05 = (i2 ^ this.V05);\r\n/* 190:275 */ this.V06 = (i3 ^ this.V06);\r\n/* 191:276 */ this.V07 = (i4 ^ this.V07);\r\n/* 192:277 */ this.V00 = (i5 ^ this.V00);\r\n/* 193:278 */ this.V01 = (i6 ^ this.V01);\r\n/* 194:279 */ this.V02 = (i7 ^ this.V02);\r\n/* 195:280 */ this.V03 = (i8 ^ this.V03);\r\n/* 196:281 */ this.V04 = (i9 ^ this.V04);\r\n/* 197:282 */ this.V05 = (i10 ^ this.V05);\r\n/* 198:283 */ this.V06 = (i11 ^ this.V06);\r\n/* 199:284 */ this.V07 = (i12 ^ this.V07);\r\n/* 200:285 */ i = i12;\r\n/* 201:286 */ i12 = i11;\r\n/* 202:287 */ i11 = i10;\r\n/* 203:288 */ i10 = i9;\r\n/* 204:289 */ i9 = i8 ^ i;\r\n/* 205:290 */ i8 = i7 ^ i;\r\n/* 206:291 */ i7 = i6;\r\n/* 207:292 */ i6 = i5 ^ i;\r\n/* 208:293 */ i5 = i;\r\n/* 209:294 */ this.V10 = (j ^ this.V10);\r\n/* 210:295 */ this.V11 = (k ^ this.V11);\r\n/* 211:296 */ this.V12 = (m ^ this.V12);\r\n/* 212:297 */ this.V13 = (n ^ this.V13);\r\n/* 213:298 */ this.V14 = (i1 ^ this.V14);\r\n/* 214:299 */ this.V15 = (i2 ^ this.V15);\r\n/* 215:300 */ this.V16 = (i3 ^ this.V16);\r\n/* 216:301 */ this.V17 = (i4 ^ this.V17);\r\n/* 217:302 */ this.V10 = (i5 ^ this.V10);\r\n/* 218:303 */ this.V11 = (i6 ^ this.V11);\r\n/* 219:304 */ this.V12 = (i7 ^ this.V12);\r\n/* 220:305 */ this.V13 = (i8 ^ this.V13);\r\n/* 221:306 */ this.V14 = (i9 ^ this.V14);\r\n/* 222:307 */ this.V15 = (i10 ^ this.V15);\r\n/* 223:308 */ this.V16 = (i11 ^ this.V16);\r\n/* 224:309 */ this.V17 = (i12 ^ this.V17);\r\n/* 225:310 */ i = i12;\r\n/* 226:311 */ i12 = i11;\r\n/* 227:312 */ i11 = i10;\r\n/* 228:313 */ i10 = i9;\r\n/* 229:314 */ i9 = i8 ^ i;\r\n/* 230:315 */ i8 = i7 ^ i;\r\n/* 231:316 */ i7 = i6;\r\n/* 232:317 */ i6 = i5 ^ i;\r\n/* 233:318 */ i5 = i;\r\n/* 234:319 */ this.V20 = (j ^ this.V20);\r\n/* 235:320 */ this.V21 = (k ^ this.V21);\r\n/* 236:321 */ this.V22 = (m ^ this.V22);\r\n/* 237:322 */ this.V23 = (n ^ this.V23);\r\n/* 238:323 */ this.V24 = (i1 ^ this.V24);\r\n/* 239:324 */ this.V25 = (i2 ^ this.V25);\r\n/* 240:325 */ this.V26 = (i3 ^ this.V26);\r\n/* 241:326 */ this.V27 = (i4 ^ this.V27);\r\n/* 242:327 */ this.V20 = (i5 ^ this.V20);\r\n/* 243:328 */ this.V21 = (i6 ^ this.V21);\r\n/* 244:329 */ this.V22 = (i7 ^ this.V22);\r\n/* 245:330 */ this.V23 = (i8 ^ this.V23);\r\n/* 246:331 */ this.V24 = (i9 ^ this.V24);\r\n/* 247:332 */ this.V25 = (i10 ^ this.V25);\r\n/* 248:333 */ this.V26 = (i11 ^ this.V26);\r\n/* 249:334 */ this.V27 = (i12 ^ this.V27);\r\n/* 250:335 */ this.V14 = (this.V14 << 1 | this.V14 >>> 31);\r\n/* 251:336 */ this.V15 = (this.V15 << 1 | this.V15 >>> 31);\r\n/* 252:337 */ this.V16 = (this.V16 << 1 | this.V16 >>> 31);\r\n/* 253:338 */ this.V17 = (this.V17 << 1 | this.V17 >>> 31);\r\n/* 254:339 */ this.V24 = (this.V24 << 2 | this.V24 >>> 30);\r\n/* 255:340 */ this.V25 = (this.V25 << 2 | this.V25 >>> 30);\r\n/* 256:341 */ this.V26 = (this.V26 << 2 | this.V26 >>> 30);\r\n/* 257:342 */ this.V27 = (this.V27 << 2 | this.V27 >>> 30);\r\n/* 258:343 */ for (int i13 = 0; i13 < 8; i13++)\r\n/* 259: */ {\r\n/* 260:344 */ i = this.V00;\r\n/* 261:345 */ this.V00 |= this.V01;\r\n/* 262:346 */ this.V02 ^= this.V03;\r\n/* 263:347 */ this.V01 ^= 0xFFFFFFFF;\r\n/* 264:348 */ this.V00 ^= this.V03;\r\n/* 265:349 */ this.V03 &= i;\r\n/* 266:350 */ this.V01 ^= this.V03;\r\n/* 267:351 */ this.V03 ^= this.V02;\r\n/* 268:352 */ this.V02 &= this.V00;\r\n/* 269:353 */ this.V00 ^= 0xFFFFFFFF;\r\n/* 270:354 */ this.V02 ^= this.V01;\r\n/* 271:355 */ this.V01 |= this.V03;\r\n/* 272:356 */ i ^= this.V01;\r\n/* 273:357 */ this.V03 ^= this.V02;\r\n/* 274:358 */ this.V02 &= this.V01;\r\n/* 275:359 */ this.V01 ^= this.V00;\r\n/* 276:360 */ this.V00 = i;\r\n/* 277:361 */ i = this.V05;\r\n/* 278:362 */ this.V05 |= this.V06;\r\n/* 279:363 */ this.V07 ^= this.V04;\r\n/* 280:364 */ this.V06 ^= 0xFFFFFFFF;\r\n/* 281:365 */ this.V05 ^= this.V04;\r\n/* 282:366 */ this.V04 &= i;\r\n/* 283:367 */ this.V06 ^= this.V04;\r\n/* 284:368 */ this.V04 ^= this.V07;\r\n/* 285:369 */ this.V07 &= this.V05;\r\n/* 286:370 */ this.V05 ^= 0xFFFFFFFF;\r\n/* 287:371 */ this.V07 ^= this.V06;\r\n/* 288:372 */ this.V06 |= this.V04;\r\n/* 289:373 */ i ^= this.V06;\r\n/* 290:374 */ this.V04 ^= this.V07;\r\n/* 291:375 */ this.V07 &= this.V06;\r\n/* 292:376 */ this.V06 ^= this.V05;\r\n/* 293:377 */ this.V05 = i;\r\n/* 294:378 */ this.V04 ^= this.V00;\r\n/* 295:379 */ this.V00 = ((this.V00 << 2 | this.V00 >>> 30) ^ this.V04);\r\n/* 296:380 */ this.V04 = ((this.V04 << 14 | this.V04 >>> 18) ^ this.V00);\r\n/* 297:381 */ this.V00 = ((this.V00 << 10 | this.V00 >>> 22) ^ this.V04);\r\n/* 298:382 */ this.V04 = (this.V04 << 1 | this.V04 >>> 31);\r\n/* 299:383 */ this.V05 ^= this.V01;\r\n/* 300:384 */ this.V01 = ((this.V01 << 2 | this.V01 >>> 30) ^ this.V05);\r\n/* 301:385 */ this.V05 = ((this.V05 << 14 | this.V05 >>> 18) ^ this.V01);\r\n/* 302:386 */ this.V01 = ((this.V01 << 10 | this.V01 >>> 22) ^ this.V05);\r\n/* 303:387 */ this.V05 = (this.V05 << 1 | this.V05 >>> 31);\r\n/* 304:388 */ this.V06 ^= this.V02;\r\n/* 305:389 */ this.V02 = ((this.V02 << 2 | this.V02 >>> 30) ^ this.V06);\r\n/* 306:390 */ this.V06 = ((this.V06 << 14 | this.V06 >>> 18) ^ this.V02);\r\n/* 307:391 */ this.V02 = ((this.V02 << 10 | this.V02 >>> 22) ^ this.V06);\r\n/* 308:392 */ this.V06 = (this.V06 << 1 | this.V06 >>> 31);\r\n/* 309:393 */ this.V07 ^= this.V03;\r\n/* 310:394 */ this.V03 = ((this.V03 << 2 | this.V03 >>> 30) ^ this.V07);\r\n/* 311:395 */ this.V07 = ((this.V07 << 14 | this.V07 >>> 18) ^ this.V03);\r\n/* 312:396 */ this.V03 = ((this.V03 << 10 | this.V03 >>> 22) ^ this.V07);\r\n/* 313:397 */ this.V07 = (this.V07 << 1 | this.V07 >>> 31);\r\n/* 314:398 */ this.V00 ^= RC00[i13];\r\n/* 315:399 */ this.V04 ^= RC04[i13];\r\n/* 316: */ }\r\n/* 317:401 */ for (i13 = 0; i13 < 8; i13++)\r\n/* 318: */ {\r\n/* 319:402 */ i = this.V10;\r\n/* 320:403 */ this.V10 |= this.V11;\r\n/* 321:404 */ this.V12 ^= this.V13;\r\n/* 322:405 */ this.V11 ^= 0xFFFFFFFF;\r\n/* 323:406 */ this.V10 ^= this.V13;\r\n/* 324:407 */ this.V13 &= i;\r\n/* 325:408 */ this.V11 ^= this.V13;\r\n/* 326:409 */ this.V13 ^= this.V12;\r\n/* 327:410 */ this.V12 &= this.V10;\r\n/* 328:411 */ this.V10 ^= 0xFFFFFFFF;\r\n/* 329:412 */ this.V12 ^= this.V11;\r\n/* 330:413 */ this.V11 |= this.V13;\r\n/* 331:414 */ i ^= this.V11;\r\n/* 332:415 */ this.V13 ^= this.V12;\r\n/* 333:416 */ this.V12 &= this.V11;\r\n/* 334:417 */ this.V11 ^= this.V10;\r\n/* 335:418 */ this.V10 = i;\r\n/* 336:419 */ i = this.V15;\r\n/* 337:420 */ this.V15 |= this.V16;\r\n/* 338:421 */ this.V17 ^= this.V14;\r\n/* 339:422 */ this.V16 ^= 0xFFFFFFFF;\r\n/* 340:423 */ this.V15 ^= this.V14;\r\n/* 341:424 */ this.V14 &= i;\r\n/* 342:425 */ this.V16 ^= this.V14;\r\n/* 343:426 */ this.V14 ^= this.V17;\r\n/* 344:427 */ this.V17 &= this.V15;\r\n/* 345:428 */ this.V15 ^= 0xFFFFFFFF;\r\n/* 346:429 */ this.V17 ^= this.V16;\r\n/* 347:430 */ this.V16 |= this.V14;\r\n/* 348:431 */ i ^= this.V16;\r\n/* 349:432 */ this.V14 ^= this.V17;\r\n/* 350:433 */ this.V17 &= this.V16;\r\n/* 351:434 */ this.V16 ^= this.V15;\r\n/* 352:435 */ this.V15 = i;\r\n/* 353:436 */ this.V14 ^= this.V10;\r\n/* 354:437 */ this.V10 = ((this.V10 << 2 | this.V10 >>> 30) ^ this.V14);\r\n/* 355:438 */ this.V14 = ((this.V14 << 14 | this.V14 >>> 18) ^ this.V10);\r\n/* 356:439 */ this.V10 = ((this.V10 << 10 | this.V10 >>> 22) ^ this.V14);\r\n/* 357:440 */ this.V14 = (this.V14 << 1 | this.V14 >>> 31);\r\n/* 358:441 */ this.V15 ^= this.V11;\r\n/* 359:442 */ this.V11 = ((this.V11 << 2 | this.V11 >>> 30) ^ this.V15);\r\n/* 360:443 */ this.V15 = ((this.V15 << 14 | this.V15 >>> 18) ^ this.V11);\r\n/* 361:444 */ this.V11 = ((this.V11 << 10 | this.V11 >>> 22) ^ this.V15);\r\n/* 362:445 */ this.V15 = (this.V15 << 1 | this.V15 >>> 31);\r\n/* 363:446 */ this.V16 ^= this.V12;\r\n/* 364:447 */ this.V12 = ((this.V12 << 2 | this.V12 >>> 30) ^ this.V16);\r\n/* 365:448 */ this.V16 = ((this.V16 << 14 | this.V16 >>> 18) ^ this.V12);\r\n/* 366:449 */ this.V12 = ((this.V12 << 10 | this.V12 >>> 22) ^ this.V16);\r\n/* 367:450 */ this.V16 = (this.V16 << 1 | this.V16 >>> 31);\r\n/* 368:451 */ this.V17 ^= this.V13;\r\n/* 369:452 */ this.V13 = ((this.V13 << 2 | this.V13 >>> 30) ^ this.V17);\r\n/* 370:453 */ this.V17 = ((this.V17 << 14 | this.V17 >>> 18) ^ this.V13);\r\n/* 371:454 */ this.V13 = ((this.V13 << 10 | this.V13 >>> 22) ^ this.V17);\r\n/* 372:455 */ this.V17 = (this.V17 << 1 | this.V17 >>> 31);\r\n/* 373:456 */ this.V10 ^= RC10[i13];\r\n/* 374:457 */ this.V14 ^= RC14[i13];\r\n/* 375: */ }\r\n/* 376:459 */ for (i13 = 0; i13 < 8; i13++)\r\n/* 377: */ {\r\n/* 378:460 */ i = this.V20;\r\n/* 379:461 */ this.V20 |= this.V21;\r\n/* 380:462 */ this.V22 ^= this.V23;\r\n/* 381:463 */ this.V21 ^= 0xFFFFFFFF;\r\n/* 382:464 */ this.V20 ^= this.V23;\r\n/* 383:465 */ this.V23 &= i;\r\n/* 384:466 */ this.V21 ^= this.V23;\r\n/* 385:467 */ this.V23 ^= this.V22;\r\n/* 386:468 */ this.V22 &= this.V20;\r\n/* 387:469 */ this.V20 ^= 0xFFFFFFFF;\r\n/* 388:470 */ this.V22 ^= this.V21;\r\n/* 389:471 */ this.V21 |= this.V23;\r\n/* 390:472 */ i ^= this.V21;\r\n/* 391:473 */ this.V23 ^= this.V22;\r\n/* 392:474 */ this.V22 &= this.V21;\r\n/* 393:475 */ this.V21 ^= this.V20;\r\n/* 394:476 */ this.V20 = i;\r\n/* 395:477 */ i = this.V25;\r\n/* 396:478 */ this.V25 |= this.V26;\r\n/* 397:479 */ this.V27 ^= this.V24;\r\n/* 398:480 */ this.V26 ^= 0xFFFFFFFF;\r\n/* 399:481 */ this.V25 ^= this.V24;\r\n/* 400:482 */ this.V24 &= i;\r\n/* 401:483 */ this.V26 ^= this.V24;\r\n/* 402:484 */ this.V24 ^= this.V27;\r\n/* 403:485 */ this.V27 &= this.V25;\r\n/* 404:486 */ this.V25 ^= 0xFFFFFFFF;\r\n/* 405:487 */ this.V27 ^= this.V26;\r\n/* 406:488 */ this.V26 |= this.V24;\r\n/* 407:489 */ i ^= this.V26;\r\n/* 408:490 */ this.V24 ^= this.V27;\r\n/* 409:491 */ this.V27 &= this.V26;\r\n/* 410:492 */ this.V26 ^= this.V25;\r\n/* 411:493 */ this.V25 = i;\r\n/* 412:494 */ this.V24 ^= this.V20;\r\n/* 413:495 */ this.V20 = ((this.V20 << 2 | this.V20 >>> 30) ^ this.V24);\r\n/* 414:496 */ this.V24 = ((this.V24 << 14 | this.V24 >>> 18) ^ this.V20);\r\n/* 415:497 */ this.V20 = ((this.V20 << 10 | this.V20 >>> 22) ^ this.V24);\r\n/* 416:498 */ this.V24 = (this.V24 << 1 | this.V24 >>> 31);\r\n/* 417:499 */ this.V25 ^= this.V21;\r\n/* 418:500 */ this.V21 = ((this.V21 << 2 | this.V21 >>> 30) ^ this.V25);\r\n/* 419:501 */ this.V25 = ((this.V25 << 14 | this.V25 >>> 18) ^ this.V21);\r\n/* 420:502 */ this.V21 = ((this.V21 << 10 | this.V21 >>> 22) ^ this.V25);\r\n/* 421:503 */ this.V25 = (this.V25 << 1 | this.V25 >>> 31);\r\n/* 422:504 */ this.V26 ^= this.V22;\r\n/* 423:505 */ this.V22 = ((this.V22 << 2 | this.V22 >>> 30) ^ this.V26);\r\n/* 424:506 */ this.V26 = ((this.V26 << 14 | this.V26 >>> 18) ^ this.V22);\r\n/* 425:507 */ this.V22 = ((this.V22 << 10 | this.V22 >>> 22) ^ this.V26);\r\n/* 426:508 */ this.V26 = (this.V26 << 1 | this.V26 >>> 31);\r\n/* 427:509 */ this.V27 ^= this.V23;\r\n/* 428:510 */ this.V23 = ((this.V23 << 2 | this.V23 >>> 30) ^ this.V27);\r\n/* 429:511 */ this.V27 = ((this.V27 << 14 | this.V27 >>> 18) ^ this.V23);\r\n/* 430:512 */ this.V23 = ((this.V23 << 10 | this.V23 >>> 22) ^ this.V27);\r\n/* 431:513 */ this.V27 = (this.V27 << 1 | this.V27 >>> 31);\r\n/* 432:514 */ this.V20 ^= RC20[i13];\r\n/* 433:515 */ this.V24 ^= RC24[i13];\r\n/* 434: */ }\r\n/* 435: */ }", "@Override\r\n public List<Block> blocks() {\r\n List<Block> blockList = new ArrayList<Block>();\r\n java.awt.Color[] colors = new Color[5];\r\n colors[0] = Color.decode(\"#c1b8b2\");\r\n colors[1] = Color.decode(\"#ef1607\");\r\n colors[2] = Color.decode(\"#ffff1e\");\r\n colors[3] = Color.decode(\"#211ed8\");\r\n colors[4] = Color.decode(\"#fffff6\");\r\n int y = 150;\r\n int[] hitPoints = {2, 1, 1, 1, 1};\r\n for (int i = 0; i < colors.length; i++) {\r\n for (int j = i + 5; j < 15; j++) {\r\n blockList.add(new Block(j * 50 + 25, y, 50, 20, colors[i], hitPoints[i]));\r\n }\r\n y += 20;\r\n }\r\n return blockList;\r\n }", "public InstructionBlock split(int index) throws IllegalArgumentException {\n int arraySplitPosition = 0;\n\n final int originalArraySize = mHolders.size();\n for (int i=0; i<originalArraySize; i++) {\n InstructionHolder holder = mHolders.get(i);\n if (holder.index == index) {\n arraySplitPosition = i;\n\n break;\n }\n }\n\n if (arraySplitPosition <= 0) {\n throw new IllegalArgumentException();\n }\n\n final int subListSize = originalArraySize - arraySplitPosition;\n List<InstructionHolder> subList = new ArrayList<InstructionHolder>(subListSize);\n for (int i=arraySplitPosition; i<originalArraySize; i++) {\n subList.add(mHolders.get(i));\n }\n\n mHolders.removeAll(subList);\n\n for (InstructionHolder holder : subList) {\n holder.index -= index;\n }\n mKnownBlockOffsets.clear();\n mKnownBlockOffsets.addAll(extractKnownBlockOffsets(mHolders));\n mByteCodeSize = extractByteCodeSize(index, mHolders);\n\n // This is assuming the only reason for a block to be invalid is that\n // the last instruction connot be resolved. If this is not true the next\n // piece of code may fail.\n final String invalidReason = mInvalidReason;\n mInvalidReason = null;\n\n return new InstructionBlock(index, subList, invalidReason);\n }", "static void readBlock(Scanner s) throws Exception {\n for (int i = 0; i < 16; i++) {\n int n = s.nextInt();\n for (int j = 0; j < 8; j++) {\n block[8 * i + j] = (n >> (7 - j)) & 1;\n }\n }\n }", "public long countFriendsPairings(int n) \n {\n if(n<3){\n return n;\n }\n else{\n long mod=(long)Math.pow(10,9)+7;\n long b=1;\n long a=2;\n long curr=0;\n for(int i=3;i<n+1;i++){\n curr=(a+(i-1)*b)%mod;\n b=a;\n a=curr;\n \n } \n \n \n \n return curr; } \n }", "private Block findFreeBlock(int size) {\n\n // iteration is ordered min ~ max\n for (Block b : freeSpace) {\n if (b.length >= size) \n return b;\n }\n return null;\n }" ]
[ "0.69621813", "0.67223686", "0.66320246", "0.6619817", "0.6331878", "0.63075364", "0.6210403", "0.6160318", "0.6023458", "0.6023458", "0.5966852", "0.59628433", "0.59610933", "0.5910404", "0.59010607", "0.58863056", "0.58846414", "0.5870533", "0.5868186", "0.58650947", "0.58516186", "0.5797499", "0.5738186", "0.5731323", "0.5717578", "0.5717578", "0.5709523", "0.5695199", "0.56531996", "0.5648498", "0.56070167", "0.5591898", "0.5589517", "0.55632997", "0.55632997", "0.55404496", "0.55370754", "0.5521677", "0.5521385", "0.5510856", "0.55011636", "0.55011636", "0.5480342", "0.54756033", "0.5461015", "0.54523367", "0.5448141", "0.54366", "0.5435947", "0.5422749", "0.5417386", "0.54162484", "0.53989977", "0.53910184", "0.5378998", "0.536792", "0.53634894", "0.53618246", "0.5351731", "0.53447914", "0.53435284", "0.53405935", "0.5338874", "0.533073", "0.5317301", "0.53017664", "0.53001356", "0.52900875", "0.5288667", "0.52774745", "0.526642", "0.5264716", "0.5261785", "0.52606004", "0.52480924", "0.5246013", "0.5234227", "0.52313906", "0.52289826", "0.52227336", "0.52206945", "0.5218706", "0.52112955", "0.521105", "0.52022654", "0.5196519", "0.51945955", "0.5191299", "0.5187789", "0.5179771", "0.5177822", "0.5157292", "0.5157292", "0.51564676", "0.51524854", "0.51505125", "0.51486874", "0.51459146", "0.5143386", "0.51227915" ]
0.6803226
1
Generates the daughter res spaces as specified in the paper and places them in the residual stack First get all the variables we need
private void generateDaughterResSpaces(Block b, ResidualSpace res){ int blx = b.getX_size(); int bly = b.getY_size(); int blz = b.getZ_size(); int rsx = res.getX_size(); int rsy = res.getY_size(); int rsz = res.getZ_size(); int rmx = rsx - blx; int rmy = rsy - bly; int rmz = rsz - blz; // Check if the smallest available parcel has smaller dimensions than one of the potential res spaces // There are six possible cases here (see table 2) int case_num = 1; if(rmx >= rmy && rmy >= rmz){ case_num = 1; } else if(rmy >= rmx && rmx >= rmz){ case_num = 2; } else if(rmx >= rmz && rmz >= rmy){ case_num = 3; } else if(rmz >= rmx && rmx >= rmy){ case_num = 4; } else if(rmy >= rmz && rmz >= rmx){ case_num = 5; } else if(rmz >= rmy && rmy >= rmx){ case_num = 6; } else{ try { throw new Exception("Something went wrong in generateDaughterResSpaces, " + "else case should not be triggered"); } catch (Exception e) { e.printStackTrace(); } } Coordinate drs_x_loc = new Coordinate(b.getLocation().getX() + blx, b.getLocation().getY(), b.getLocation().getZ()); int drs_x_x = rmx; int drs_x_y = -1; //To be done int drs_x_z = -1; //To be done Coordinate drs_y_loc = new Coordinate(b.getLocation().getX(), b.getLocation().getY() + bly, b.getLocation().getZ()); int drs_y_x = -1; //To be done int drs_y_y = rmy; int drs_y_z = -1; //To be done Coordinate drs_z_loc = new Coordinate(b.getLocation().getX(), b.getLocation().getY(), b.getLocation().getZ() + blz); int drs_z_x = -1; //To be done int drs_z_y = -1; //To be done int drs_z_z = rmz; // drs_x = 0, drs_y = 1, drs_z = 0 int max_order = -1; //To be done int med_order = -1; //To be done int min_order = -1; //To be done // Apply the cases switch (case_num){ case 1: max_order = 0; med_order = 1; min_order = 2; drs_x_y = rsy; drs_x_z = rsz; drs_y_x = blx; drs_y_z = rsz; drs_z_x = blx; drs_z_y = bly; break; case 2: max_order = 1; med_order = 0; min_order = 2; drs_x_y = bly; drs_x_z = rsz; drs_y_x = rsx; drs_y_z = rsz; drs_z_x = blx; drs_z_y = bly; break; case 3: max_order = 0; med_order = 2; min_order = 1; drs_x_y = rsy; drs_x_z = rsz; drs_y_x = blx; drs_y_z = blz; drs_z_x = blx; drs_z_y = rsy; break; case 4: max_order = 2; med_order = 0; min_order = 1; drs_x_y = rsy; drs_x_z = blz; drs_y_x = blx; drs_y_z = blz; drs_z_x = rsx; drs_z_y = rsy; break; case 5: max_order = 1; med_order = 2; min_order = 0; drs_x_y = bly; drs_x_z = blz; drs_y_x = rsx; drs_y_z = rsz; drs_z_x = rsx; drs_z_y = bly; break; case 6: max_order = 2; med_order = 1; min_order = 0; drs_x_y = bly; drs_x_z = blz; drs_y_x = rsx; drs_y_z = blz; drs_z_x = rsx; drs_z_y = rsy; break; } int drs_x_type = 0; // 0 = min, 1 = med, 2 = max int drs_y_type = 0; int drs_z_type = 0; if(min_order == 0){ drs_x_type = 0; } else if(min_order == 1){ drs_y_type = 0; } else{ drs_z_type = 0; } if(med_order == 0){ drs_x_type = 1; } else if(med_order == 1){ drs_y_type = 1; } else{ drs_z_type = 1; } if(max_order == 0){ drs_x_type = 2; } else if(max_order == 1){ drs_y_type = 2; } else{ drs_z_type = 2; } // Create the residual spaces ResidualSpace drs_x = new ResidualSpace(drs_x_loc, drs_x_x, drs_x_y, drs_x_z, drs_x_type); ResidualSpace drs_y = new ResidualSpace(drs_y_loc, drs_y_x, drs_y_y, drs_y_z, drs_y_type); ResidualSpace drs_z = new ResidualSpace(drs_z_loc, drs_z_x, drs_z_y, drs_z_z, drs_z_type); boolean add_drs_x = aParcelFitsInRes(drs_x); boolean add_drs_y = aParcelFitsInRes(drs_y); boolean add_drs_z = aParcelFitsInRes(drs_z); // Check if something fits in the med and max res spaces, if not transfer all possible space to the min res space if(drs_x_type == 1 || drs_x_type == 2){ if(!add_drs_x){ // Nothing fits in x space but it is med or max transfer possible to min state if(drs_y_type == 0){ drs_y = transfer_space(drs_x, drs_y); } else{ drs_z = transfer_space(drs_x, drs_z); } } } if(drs_y_type == 1 || drs_y_type == 2){ if(!add_drs_y){ // Nothing fits in x space but it is med or max transfer possible to min state if(drs_x_type == 0){ drs_x = transfer_space(drs_y, drs_x); } else{ drs_z = transfer_space(drs_y, drs_z); } } } if(drs_z_type == 1 || drs_z_type == 2){ if(!add_drs_z){ // Nothing fits in x space but it is med or max transfer possible to min state if(drs_x_type == 0){ drs_x = transfer_space(drs_z, drs_x); } else{ drs_y = transfer_space(drs_z, drs_y); } } } // Add the boxes in "min - max - med" order // drs_x = 0, drs_y = 1, drs_z = 0 if(min_order == 0){ if(add_drs_x){ rs_stack.add(drs_x); } } else if(min_order == 1){ if(add_drs_y) { rs_stack.add(drs_y); } } else{ if(add_drs_z) { rs_stack.add(drs_z); } } if(med_order == 0){ if(add_drs_x) { rs_stack.add(drs_x); } } else if(med_order == 1){ if(add_drs_y) { rs_stack.add(drs_y); } } else{ if(add_drs_z) { rs_stack.add(drs_z); } } if(max_order == 0){ if(add_drs_x) { rs_stack.add(drs_x); } } else if(max_order == 1){ if(add_drs_y) { rs_stack.add(drs_y); } } else{ if(add_drs_z) { rs_stack.add(drs_z); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "public void setup() {\n\t\tsize(1300, 800);\n\t\tint seed = 4346;\n\t\tran = new Random(seed);\n\t\trandompolys = randomPolygons(210);// prepare the input polygons\n\n\t\tDouble segment_len = useAbey ? null : segment_max_length;\n\t\tPack pack = new Pack(randompolys, margin, segment_len, rotSteps, WID, HEI, preferX);\n\t\tpack.packOneSheet(useAbey);\n\t\tpacks.add(pack);\n\n\t\tfor (int i = 0; i < 100; i++) { // packing one sheet after another, 100 is estimated\n\t\t\tint size = packs.size();\n\t\t\tif (packs.get(size - 1).isEmpty()) {\n\t\t\t\tprintln(size + \" sheets\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpack = packs.get(size - 1).clone();\n\t\t\tpack.packOneSheet(useAbey);\n\t\t\tpacks.add(pack);\n\t\t}\n\t\treport();\n\t}", "private Graph<SwingVertex> prepareResidualNetwork() {\n\t\tGraph<SwingVertex> residualNetwork = new SimpleGraph<SwingVertex>();\n\t\tresidualNetwork.setDirected(true);\n\t\tCollection<Edge> edges = graph.getEdges();\n\t\t\n\t\tfor (Edge edge: edges) {\n\t\t\tEdgeDataModel edgeDataModel;\n\t\t\ttry {\n\t\t\t\tedgeDataModel = (EdgeDataModel)edge.getDataModel().clone();\n\n\t\t\t\tList<SwingVertex> vertexes = new ArrayList<SwingVertex>();\n\t\t\t\t\n\t\t\t\tSwingVertex startVertex = (SwingVertex)edgeDataModel.getStartingVertex();\n\t\t\t\tSwingVertex endVertex = (SwingVertex)edgeDataModel.getEndingVertex();\n\t\t\t\tif(!residualNetwork.contains(startVertex)) {\n\t\t\t\t\tvertexes.add(startVertex); //klonowanie datamodelu dla sieci residualnej\n\t\t\t\t} else {\n\t\t\t\t\tedgeDataModel.setStartingVertex(residualNetwork.getVertexByIndex(startVertex.getIndex()));\n\t\t\t\t}\n\t\t\t\tif (!residualNetwork.contains(endVertex)) {\n\t\t\t\t\tvertexes.add(endVertex);\t\n\t\t\t\t} else {\n\t\t\t\t\tedgeDataModel.setEndingVertex(residualNetwork.getVertexByIndex(endVertex.getIndex()));\n\t\t\t\t}\t\t\t\t\n\t\t\t\tresidualNetwork.insertNodes(vertexes);\n\t\t\t\tEdge newEdge = new SwingEdge();\n\t\t\t\tnewEdge.setDataModel(edgeDataModel);\n\t\t\t\tresidualNetwork.addEdge(newEdge);\n\t\t\t\t\n\t\t\t} catch (CloneNotSupportedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t\t\n\t\t}\n\t\t\n\t\treturn residualNetwork;\n\t}", "private void resetVarD() {\n width = 0;\n height = 0;\n sizeY = 0;\n sizeCB = 0;\n sizeCR = 0;\n sizeYc = 0;\n sizeCBc = 0;\n sizeCRc = 0;\n iteradorFreq = 0;\n i = 0;\n FreqY = new HashMap<>();\n FreqCB = new HashMap<>();\n FreqCR = new HashMap<>();\n Ydes = new ArrayList<>();\n CBdes = new ArrayList<>();\n CRdes = new ArrayList<>();\n }", "public void setup(){\r\n\t\t\r\n\r\n\t\tsuper.setup();\r\n\t\t\r\n\t\tparams = new String[] {\"numLocations\",\"numFirms\",\"timeHorizon\",\"enteringCosts\",\r\n\t\t\t\t \"reservationPrice\", \"productDifferentiation\",\r\n\t\t\t\t \"adjustEnteringCosts\",\r\n\t\t\t\t \"sdNoiseImitationKnowledge\",\r\n\t\t\t\t \"sdNoiseImitationConcept\",\r\n\t\t\t\t \"sigma\",\"discontFactor\",\"initialInnoEff\",\"fractionEffectivityImitators\",\r\n\t\t\t\t \"initialImiEff\",\"exitingCosts\",\"fractionEffectivityInnovators\",\r\n\t\t\t\t \"locationCosts\",\"isolatedLocation\", \"maxQualityConceptProgress\",\"heterogeneityMode\",\"randomAllocation\", \"numMontecarloRuns\",\r\n\t\t\t\t \"maxQualityConceptProgress\",\"rateLocationDecision\", \"marketEntryCosts\",\r\n\t\t\t\t \"marketEntryHazardRate\", \"parTimeToMarket\",\"ModelModeTimeToMarket\",\"scrapValueParameterInno\",\"scrapValueParameterImi\",\"strategyParameter\",\"targetNumFirms\"};\r\n\r\n\t\r\n\r\n\t\t\r\n\t\tif(graphOutput!=null)\r\n\t\t\tgraphOutput.dispose();\r\n\t\t\r\n\t\tif(graphPrice!=null)\r\n\t\t\tgraphPrice.dispose();\r\n\t\t\r\n\t\tif(graphQuality!=null)\r\n\t\t\tgraphQuality.dispose();\r\n\t\tif(graphNumFirms!=null)\r\n\t\t\tgraphNumFirms.dispose();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif(graphFirmLocations!=null)\r\n\t\t\tgraphFirmLocations.dispose();\r\n\t\t\r\n\t\tif(graphEnteringCosts!=null)\r\n\t\t\tgraphEnteringCosts.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphAverageProbability!=null)\r\n\t\t\tgraphAverageProbability.dispose();\r\n\t\t\r\n\t\tif(graphTotalProfit!=null)\r\n\t\t\tgraphTotalProfit.dispose();\r\n\t\t\r\n\t\tif(graphClusteringCoefficient!=null)\r\n\t\t\tgraphClusteringCoefficient.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphSingleOutput!=null)\r\n\t\tgraphSingleOutput.dispose();\r\n\t\t\r\n\t\tif(graphSinglePrice!=null)\r\n\t\tgraphSinglePrice.dispose(); \r\n\t\t\r\n\t\tif(graphSingleQuality!=null)\r\n\t\tgraphSingleQuality.dispose(); \r\n\t\t\r\n\t\tif(graphSingleFirmLocations!=null)\r\n\t\tgraphSingleFirmLocations.dispose();\r\n\t\t\r\n\t\tif(graphSingleProbability!=null)\r\n\t\t graphSingleProbability.dispose(); \r\n\t\t\r\n\t\tif(graphSinglelProfit!=null)\r\n\t\tgraphSinglelProfit.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphSingleQualityConcept!=null)\r\n\t\t\tgraphSingleQualityConcept.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphCumProfit!=null)\r\n\t\t\tgraphCumProfit.dispose();\r\n\t\t\r\n\t\t\r\n\t \r\n\t if(dsurfList!=null){\r\n\t\t for(int i=0; i<dsurfList.size();i++){\r\n\t\t \t\t\r\n\t\t \t\tdsurfList.get(i).dispose();\r\n\t\t \r\n\t\t }\r\n\t}\r\n\t \r\n\t gridList = null;\r\n\t dsurfList = null;\r\n\t \r\n\t gridList = new ArrayList<Object2DGrid>() ;\r\n\t dsurfList\t= new\tArrayList<DisplaySurface>() ;\r\n\t \r\n\t \r\n\t dimX = ((int) Math.sqrt(numFirms))+5;\r\n\t dimY=dimX;\r\n\t \r\n\t \r\n\t \r\n\t if (surface != null)\r\n\t surface.dispose ();\r\n\t surface = null;\r\n\t \r\n\t surface = new DisplaySurface (this, \"Firm network\");\r\n\t registerDisplaySurface (\"Firm network\", surface);\r\n\t\t\r\n\t\t\r\n\t}", "public void setupDryadCloudDataSets(){\n\t\ttry{\n\t\t\t\n\t\t\t// A Dryad \n\t\t\tDryadDataSet ds = new DryadDataSet(_DRYAD_D1_TREEBASE);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D1_TREEBASE_F1);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D3_POPULAR);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D3_POPULAR_F1);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D4_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D4_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D4_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D6_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D6_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D6_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D2_GENBANK);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F1);\t\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F2);\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F3);\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F4);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D5_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D5_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D5_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tSystem.out.println(\"ERROR: Exception \"+ex.getMessage());\n\t\t}\n\t}", "public String getX3D(boolean snipet) {\r\n\t\t\r\n\t\t// Assemble the Arm\r\n\t\tString header = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\" +\r\n\t\t\"<!DOCTYPE X3D PUBLIC \\\"ISO//Web3D//DTD X3D 3.0//EN\\\" \\\"http://www.web3d.org/specifications/x3d-3.0.dtd\\\">\\n \" +\r\n\t\t\"<X3D profile='Immersive' >\\n\" +\r\n\t\t\"<head>\\n\" +\r\n\t\t \"<meta name='BioMightImage' content='Arm.jpg'/>\\n\" +\r\n\t\t \"<meta name='ExportTime' content='7:45:30'/>\\n\" +\r\n\t\t \"<meta name='ExportDate' content='08/15/2008'/>\\n\" +\r\n\t\t \"<meta name='BioMight Version' content='1.0'/>\\n\" + \r\n\t\t\"</head>\\n\" +\r\n\t\t\"<Scene>\\n\" +\r\n\t\t\"<WorldInfo\\n\" +\r\n\t\t\"title='Arm'\\n\" +\r\n\t\t\"info='\\\"BioMight Generated X3D\\\"'/>\\n\";\t\t\r\n\t\t\r\n\t\tString body = \r\n\t\t\tepithelium.getX3D(true) + \r\n\t\t\thumerus.getX3D(true) + \r\n\t\t\tbrachialArtery.getX3D(true) +\r\n\t\t\tdeepBrachialArtery.getX3D(true) +\r\n\t\t\tanteriorCircumflexHumeralArtery.getX3D(true) +\r\n\t\t\tposteriorCircumflexHumeralArtery.getX3D(true) +\r\n\t\t\tsuperiorUlnarCollateralArtery.getX3D(true) +\r\n\t\t\tinferiorUlnarCollateralArtery.getX3D(true) +\r\n\t\t\tmiddleCollateralArtery.getX3D(true) +\r\n\t\t\tradialCollateralArtery.getX3D(true) +\r\n\t\t\tbrachialVein.getX3D(true) +\r\n\t\t\tbasilicVein.getX3D(true) +\r\n\t\t\tcephalicVein.getX3D(true) +\r\n\t\t\tbrachialisMuscle.getX3D(true) +\r\n\t\t\tbicepsBrachiiMuscle.getX3D(true) + \r\n\t\t\ttricepsBrachiiMuscle.getX3D(true) +\r\n\t\t\tbrachioradialisMuscle.getX3D(true) +\r\n\t\t\textensorCarpiRadialisBrevisMuscle.getX3D(true) +\r\n\t\t\textensorCarpiRadialisLongusMuscle.getX3D(true) +\r\n\t\t\textensorCarpiUlnarisMuscle.getX3D(true) +\r\n\t\t\tpalmarisLongusMuscle.getX3D(true) ;\r\n\t\t\t/***\r\n\t\t\textensorDigitiMinimiMuscle.getX3D(true) +\r\n\t\t\textensorDigitorumMuscle.getX3D(true) +\r\n\t\t\textensorPollicisLongusMuscle.getX3D(true) +\r\n\t\t\tflexorDigitorumProfundusMuscle.getX3D(true) +\r\n\t\t\tflexorDigitorumSuperficialisMuscle.getX3D(true) +\r\n\t\t\tflexorPollicisLongusMuscle.getX3D(true) +\r\n\t\t\tflexorPollicisBrevisMuscle.getX3D(true)+\r\n\t\t\tannularLigament.getX3D(true) ; \r\n\t\t\t****/\r\n\t\r\n\t\t//System.out.println(\"Arm X3D: \" + body);\t\t\r\n\t\r\n\t\tString footer = \"</Scene>\" + \"</X3D>\\n\";\r\n\t\t\r\n\t\tif (snipet)\r\n\t\t\treturn body;\t\t\t\r\n\t\telse\t\r\n\t\t\treturn header + body + footer;\r\n\t}", "public void dormrq_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);", "protected Double[] allocateVariables() {\n\t\tDouble[] _variables = new Double[size];\n\t\treturn _variables;\n\t}", "public Stack<ResidualSpace> getRs_stack() {\n return (Stack<ResidualSpace>) rs_stack.clone();\n }", "private void fillPRStack() {\n for (int i = 0; i < PRToVR.length - 1; i++) {\n PRStack.push(i);\n }\n }", "public static ResourceGraph solveResourceFlow(final RecipeGraph graph, List<GraphSolver.Constraint> constraints) {\n ArrayList<Recipe> recipes = new ArrayList<>();\n recipes.addAll(graph.vertexSet());\n\n ArrayList<RecipeEdge> edges = new ArrayList<>();\n edges.addAll(graph.edgeSet());\n\n int width = edges.size() + recipes.size();\n\n List<double[]> matrix = new ArrayList<>();\n List<Double> rhs = new ArrayList<>();\n\n for (Recipe recipe : recipes) {\n for (String item : recipe.inputItems.keySet()) {\n double[] line = new double[width];\n\n int r = recipes.indexOf(recipe);\n line[edges.size() + r] = -1.0 * recipe.inputRate(item);\n\n int edgesFound = 0;\n for(RecipeEdge edge : graph.incomingEdgesOf(recipe)) {\n if (!item.equals(edge.getItem())) {\n continue;\n }\n\n int e = edges.indexOf(edge);\n line[e] = 1.0;\n\n edgesFound++;\n }\n\n if (edgesFound == 0) {\n continue;\n }\n\n matrix.add(line);\n rhs.add(0.0);\n }\n }\n\n // need variables in solution for proportion of output in monosplit situation!\n // create a line per (vertex, item) pair\n // add 1.0 for all edges that consume or produce resource\n // add -1.0 for vertex input/output rate\n for (Recipe recipe : recipes) {\n for (String item : recipe.outputItems.keySet()) {\n double[] line = new double[width];\n\n int r = recipes.indexOf(recipe);\n line[edges.size() + r] = -1.0 * recipe.outputRate(item);\n\n int edgesFound = 0;\n for(RecipeEdge edge : graph.outgoingEdgesOf(recipe)) {\n if (!item.equals(edge.getItem())) {\n continue;\n }\n\n int e = edges.indexOf(edge);\n line[e] = 1.0;\n\n edgesFound++;\n }\n\n if (edgesFound == 0) {\n continue;\n }\n\n matrix.add(line);\n rhs.add(0.0);\n }\n }\n\n for (int c = 0; c < constraints.size(); c++) {\n double[] line = new double[width];\n GraphSolver.Constraint constraint = constraints.get(c);\n\n Recipe r = graph.getRecipe(constraint.recipe);\n if (r == null) {\n throw new NullPointerException(\"Unknown recipe from constraint \" + constraint.recipe);\n }\n\n double rate = 0;\n if (constraint.type == GraphSolver.ConstraintType.INPUT) {\n String item = constraint.item;\n if (item == null && r.inputItems.size() == 1) {\n item = r.inputItems.keySet().iterator().next();\n }\n\n if (!r.inputItems.containsKey(item)) {\n throw new NullPointerException(\"Unknown item \" + constraint.item + \" from constraint on recipe \" + constraint.recipe);\n }\n\n rate = constraint.flow / r.inputRate(item);\n } else if (constraint.type == GraphSolver.ConstraintType.OUTPUT) {\n String item = constraint.item;\n if (item == null && r.outputItems.size() == 1) {\n item = r.outputItems.keySet().iterator().next();\n }\n\n if (!r.outputItems.containsKey(item)) {\n throw new NullPointerException(\"Unknown item from constraint on recipe \" + constraint.recipe);\n }\n\n rate = constraint.flow / r.outputRate(item);\n }\n\n int recipeIndex = recipes.indexOf(r);\n line[edges.size() + recipeIndex] = 1.0;\n\n matrix.add(line);\n rhs.add(rate);\n }\n\n double[][] matrixArray = matrix.toArray(new double[0][0]);\n RealMatrix coefficientsSmall = new Array2DRowRealMatrix(matrixArray, false);\n\n // we need a square matrix so we can use LU decomposition, which provides exact results\n // create an identity matrix, and overwrite the equations.\n int n = Math.max(matrix.size(), width);\n double[][] finalMatrix = new double[n][n];\n for(int i = 0; i < n; i++) {\n finalMatrix[i][i] = 1.0;\n }\n\n double[] rhsArray = new double[n];\n for (int i = 0; i < rhs.size(); i++) {\n rhsArray[i] = rhs.get(i);\n }\n\n coefficientsSmall.copySubMatrix(0, matrix.size() - 1, 0, width - 1, finalMatrix);\n RealMatrix coefficentsSquare = new Array2DRowRealMatrix(finalMatrix);\n\n DecompositionSolver solver = new LUDecomposition(coefficentsSquare).getSolver();\n RealVector constants = new ArrayRealVector(rhsArray, false);\n RealVector solution = solver.solve(constants);\n System.out.println(solution);\n\n ResourceGraph rg = new BasicGraphStream<>(graph).map(new ResourceGraph(),\n (g, v) -> new ResourceVertex(v, solution.getEntry(edges.size() + recipes.indexOf(v))),\n (g, e) -> {\n ResourceEdge edge = new ResourceEdge();\n g.setEdgeResource(edge, e.getItem(), solution.getEntry(edges.indexOf(e)));\n return edge;\n }\n );\n\n return rg;\n }", "void resDiagonale(){ \r\n for (int i = 0; i<N; i=i+nCarre) \r\n \tresCarre(i, i); \r\n }", "public void randomlySetAllQR() {\n\t\tfor (int q = -3; q <=3; q++) {\r\n\t\t\tfor (int r = -3; r <=3; r++) {\r\n\t\t\t\tsetHexFromQR(q,r, new HexModel(HexModel.TileType.DesertTile));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void createOriginalCSP (int[][] variables){\n\t\t\n\t\tnumberOfVariables = variables[0].length;\n\t\tchocoModel = new Model(\"OriginalCSP\");\n\t\tnumberOfProducts = variables.length;\n\t\tcreateNewVar(); // FIRST VAR is PRODUCT ID , varID = 0\n\t\t\n\t\tint varID =0;\n\t\t\n\t\tfor(int i=0;i<variables[0].length;i++){\n\t\t\tcreateNewVar(); // ADD FEATURE SET OF CAMERAS\n\t\t}\n\t\tallVarsAreCreated = true;\n\t\t\n\t\taddProductConstraints(variables);\n\t\t\n\t\t\n\t}", "public void SteadyStepReproductionDNF (TableVar Variables) {\r\n\r\n int i, j, k, pos;\r\n int[] indices = new int[long_poblacion];\r\n float[] fit = new float[long_poblacion];\r\n\r\n for (i=0; i<long_poblacion; i++) {\r\n fit[i]= poblac.getIndivFitness(i);\r\n indices[i] = i;\r\n }\r\n\r\n // Sort the fitness array of actual population and store the values at \"indices\"\r\n Utils.OrDecIndex (fit,0,long_poblacion-1,indices); // To maximise\r\n\r\n for (i=0; i<descendientes; i++) {\t// For each descendant\r\n pos = indices[long_poblacion-1-i];\r\n for (j=0; j<Variables.getNVars(); j++) {\r\n for (k=0; k<=Variables.getNLabelVar(j); k++)\r\n poblac.setCromElemGene(pos, j, k, Des.getCromElemGene(i,j,k));\r\n }\r\n poblac.setIndivEvaluated(pos,false);\r\n }\r\n\r\n }", "private void prepare()\n {\n addObject(new TempoLimite(), 432, 207);\n addObject(new NumeroVidas(), 395, 278);\n\n Cliqueparajogar clique = new Cliqueparajogar();\n addObject(clique, getWidth()/2, getHeight()/2);\n\n Som som = new Som();\n addObject(som, getWidth() - 37, getHeight()-57);\n \n umMin ummin = new umMin();\n addObject(ummin,630,206);\n\n doisMin doismin = new doisMin();\n addObject(doismin,670,206);\n \n tresMin tresmin = new tresMin();\n addObject(tresmin,710,206);\n \n quatroMin quatromin = new quatroMin();\n addObject(quatromin,750,206);\n \n cincoMin cincomin = new cincoMin();\n addObject(cincomin,790,206);\n \n umaVida umavida = new umaVida();\n addObject(umavida,630,280);\n \n duasVidas duasvidas = new duasVidas();\n addObject(duasvidas,670,280);\n \n tresVidas tresvidas = new tresVidas();\n addObject(tresvidas,710,280);\n \n quatroVidas quatrovidas = new quatroVidas();\n addObject(quatrovidas,750,280);\n \n cincoVidas cincovidas = new cincoVidas();\n addObject(cincovidas,790,280);\n \n voltaratras voltar = new voltaratras();\n addObject(voltar, getWidth() -37, 428);\n }", "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 }", "public static void initializeVariables() {\n // System.out.println(\"initializeVariables()\");\n for (int i = 1; i <= 20; i++) {\n\n\n List<Variable> variablecopies = new LinkedList<Variable>();\n List<Integer> siteList = new LinkedList<Integer>();\n\n Variable var = null;\n if (i % 2 == 0) {\n for (int j = 1; j <= 10; j++) {\n sites.get(j).addVariable(i, 10 * i);\n var = sites.get(j).getVariable(i);\n siteList.add(j);\n variablecopies.add(var);\n }\n } else {\n for (int j = 1; j <= 10; j++) {\n if (j == 1 + i % 10) {\n sites.get(j).addVariable(i, 10 * i);\n var = sites.get(j).getVariable(i);\n variablecopies.add(var);\n siteList.add(j);\n }\n }\n }\n variable_site_map.put(i, siteList);\n variable_copies_map.put(i, variablecopies);\n }\n }", "public void dorm22_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER N1,INTEGER N2,double[] Q,INTEGER LDQ,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);", "private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n Volver volver = new Volver();\n addObject(volver,198,401);\n }", "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 void dormhr_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER ILO,INTEGER IHI,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);", "protected void create() {\n\t\t_segments = _geneticCode.getNGenes() * _geneticCode.getSymmetry();\n\t\t_segColor = new Color[_segments];\n\t\tfor (int i = 0; i < _segments; i++)\n\t\t\t_segColor[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getColor();\n\t\t_segBranch = new int[_segments];\n\t\tfor (int j = 0; j < _segments; j++)\n\t\t\t_segBranch[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getBranch();\n\t\t_segredReaction = new int[_segments];\n\t\tfor (int a = 0; a < _segments; a++)\n\t\t\t_segredReaction[a] = _geneticCode.getGene(a%_geneticCode.getNGenes()).getredReaction();\n\t\t_seggreenReaction = new int[_segments];\n\t\tfor (int b = 0; b < _segments; b++)\n\t\t\t_seggreenReaction[b] = _geneticCode.getGene(b%_geneticCode.getNGenes()).getgreenReaction();\n\t\t_segblueReaction = new int[_segments];\n\t\tfor (int c = 0; c < _segments; c++)\n\t\t\t_segblueReaction[c] = _geneticCode.getGene(c%_geneticCode.getNGenes()).getblueReaction();\n\t\t_segplagueReaction = new int[_segments];\n\t\tfor (int d = 0; d < _segments; d++)\n\t\t\t_segplagueReaction[d] = _geneticCode.getGene(d%_geneticCode.getNGenes()).getplagueReaction();\n\t\t_segwhiteReaction = new int[_segments];\n\t\tfor (int e = 0; e < _segments; e++)\n\t\t\t_segwhiteReaction[e] = _geneticCode.getGene(e%_geneticCode.getNGenes()).getwhiteReaction();\n\t\t_seggrayReaction = new int[_segments];\n\t\tfor (int f = 0; f < _segments; f++)\n\t\t\t_seggrayReaction[f] = _geneticCode.getGene(f%_geneticCode.getNGenes()).getgrayReaction();\n\t\t_segdefaultReaction = new int[_segments];\n\t\tfor (int g = 0; g < _segments; g++)\n\t\t\t_segdefaultReaction[g] = _geneticCode.getGene(g%_geneticCode.getNGenes()).getdefaultReaction();\n\t\t_segmagentaReaction = new int[_segments];\n\t\tfor (int h = 0; h < _segments; h++)\n\t\t\t_segmagentaReaction[h] = _geneticCode.getGene(h%_geneticCode.getNGenes()).getmagentaReaction();\n\t\t_segpinkReaction = new int[_segments];\n\t\tfor (int i = 0; i < _segments; i++)\n\t\t\t_segpinkReaction[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getpinkReaction();\n\t\t_segcoralReaction = new int[_segments];\n\t\tfor (int j = 0; j < _segments; j++)\n\t\t\t_segcoralReaction[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getcoralReaction();\n\t\t_segorangeReaction = new int[_segments];\n\t\tfor (int k = 0; k < _segments; k++)\n\t\t\t_segorangeReaction[k] = _geneticCode.getGene(k%_geneticCode.getNGenes()).getorangeReaction();\n\t\t_segbarkReaction = new int[_segments];\n\t\tfor (int l = 0; l < _segments; l++)\n\t\t\t_segbarkReaction[l] = _geneticCode.getGene(l%_geneticCode.getNGenes()).getbarkReaction();\n\t\t_segvioletReaction = new int[_segments];\n\t\tfor (int m = 0; m < _segments; m++)\n\t\t\t_segvioletReaction[m] = _geneticCode.getGene(m%_geneticCode.getNGenes()).getvioletReaction();\n\t\t_segvirusReaction = new int[_segments];\n\t\tfor (int n = 0; n < _segments; n++)\n\t\t\t_segvirusReaction[n] = _geneticCode.getGene(n%_geneticCode.getNGenes()).getvirusReaction();\n\t\t_segmaroonReaction = new int[_segments];\n\t\tfor (int o = 0; o < _segments; o++)\n\t\t\t_segmaroonReaction[o] = _geneticCode.getGene(o%_geneticCode.getNGenes()).getmaroonReaction();\n\t\t_segoliveReaction = new int[_segments];\n\t\tfor (int p = 0; p < _segments; p++)\n\t\t\t_segoliveReaction[p] = _geneticCode.getGene(p%_geneticCode.getNGenes()).getoliveReaction();\n\t\t_segmintReaction = new int[_segments];\n\t\tfor (int q = 0; q < _segments; q++)\n\t\t\t_segmintReaction[q] = _geneticCode.getGene(q%_geneticCode.getNGenes()).getmintReaction();\n\t\t_segcreamReaction = new int[_segments];\n\t\tfor (int r = 0; r < _segments; r++)\n\t\t\t_segcreamReaction[r] = _geneticCode.getGene(r%_geneticCode.getNGenes()).getcreamReaction();\n\t\t_segspikeReaction = new int[_segments];\n\t\tfor (int s = 0; s < _segments; s++)\n\t\t\t_segspikeReaction[s] = _geneticCode.getGene(s%_geneticCode.getNGenes()).getspikeReaction();\n\t\t_seglightblueReaction = new int[_segments];\n\t\tfor (int t = 0; t < _segments; t++)\n\t\t\t_seglightblueReaction[t] = _geneticCode.getGene(t%_geneticCode.getNGenes()).getlightblueReaction();\n\t\t_segochreReaction = new int[_segments];\n\t\tfor (int u = 0; u < _segments; u++)\n\t\t\t_segochreReaction[u] = _geneticCode.getGene(u%_geneticCode.getNGenes()).getochreReaction();\n\t\t_seglightbrownReaction = new int[_segments];\n\t\tfor (int v = 0; v < _segments; v++)\n\t\t\t_seglightbrownReaction[v] = _geneticCode.getGene(v%_geneticCode.getNGenes()).getlightbrownReaction();\n\t\t_segbrownReaction = new int[_segments];\n\t\tfor (int w = 0; w < _segments; w++)\n\t\t\t_segbrownReaction[w] = _geneticCode.getGene(w%_geneticCode.getNGenes()).getbrownReaction();\n\t\t_segsickReaction = new int[_segments];\n\t\tfor (int x = 0; x < _segments; x++)\n\t\t\t_segsickReaction[x] = _geneticCode.getGene(x%_geneticCode.getNGenes()).getsickReaction();\n\t\t_segskyReaction = new int[_segments];\n\t\tfor (int y = 0; y < _segments; y++)\n\t\t\t_segskyReaction[y] = _geneticCode.getGene(y%_geneticCode.getNGenes()).getskyReaction();\n\t\t_seglilacReaction = new int[_segments];\n\t\tfor (int z = 0; z < _segments; z++)\n\t\t\t_seglilacReaction[z] = _geneticCode.getGene(z%_geneticCode.getNGenes()).getlilacReaction();\n\t\t_segiceReaction = new int[_segments];\n\t\tfor (int a = 0; a < _segments; a++)\n\t\t\t_segiceReaction[a] = _geneticCode.getGene(a%_geneticCode.getNGenes()).geticeReaction();\n\t\t_segsilverReaction = new int[_segments];\n\t\tfor (int b = 0; b < _segments; b++)\n\t\t\t_segsilverReaction[b] = _geneticCode.getGene(b%_geneticCode.getNGenes()).getsilverReaction();\n\t\t_segfireReaction = new int[_segments];\n\t\tfor (int c = 0; c < _segments; c++)\n\t\t\t_segfireReaction[c] = _geneticCode.getGene(c%_geneticCode.getNGenes()).getfireReaction();\n\t\t_segfriendReaction = new int[_segments];\n\t\tfor (int d = 0; d < _segments; d++)\n\t\t\t_segfriendReaction[d] = _geneticCode.getGene(d%_geneticCode.getNGenes()).getfriendReaction();\n\t\t_seggreenbrownReaction = new int[_segments];\n\t\tfor (int e = 0; e < _segments; e++)\n\t\t\t_seggreenbrownReaction[e] = _geneticCode.getGene(e%_geneticCode.getNGenes()).getgreenbrownReaction();\n\t\t_segspikepointReaction = new int[_segments];\n\t\tfor (int f = 0; f < _segments; f++)\n\t\t\t_segspikepointReaction[f] = _geneticCode.getGene(f%_geneticCode.getNGenes()).getspikepointReaction();\n\t\t_startPointX = new int[_segments];\n\t\t_startPointY = new int[_segments];\n\t\t_endPointX = new int[_segments];\n\t\t_endPointY = new int[_segments];\n\t\t_m1 = new double[_segments];\n\t\t_m2 = new double[_segments];\n\t\t_m = new double[_segments];\n\t\t_mphoto = new double[_segments];\n\t\tx1 = new int[_segments];\n\t\ty1 = new int[_segments];\n\t\tx2 = new int[_segments];\n\t\ty2 = new int[_segments];\n\t}", "public void fillHeuristicData(){\n int[] temp;\n initHeuristic();\n for(int i = 0; i< variableLength; i++){\n temp=variables.clone();\n temp[i]=0;\n validateClauses(i,temp);\n temp[i]=1;\n validateClauses(i,temp);\n }\n }", "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 static void main(String[] args) throws FileNotFoundException, IOException {\nfor (double b = 0.5; b < 0.51; b+=0.1) {\n for (double k = 4.40; k < 4.5; k+=0.5) {\n Machine.b = 0.5; //0.2 - ATCnon-delay\n Machine.k = 1.5; //1.4 - ATCnon delay\n int hits = 0;\n engineJob = new cern.jet.random.engine.MersenneTwister(99999);\n noise = new cern.jet.random.Normal(0, 1, engineJob);\n SmallStatistics[] result = new SmallStatistics[5];\n result[0] = new SmallStatistics();\n result[1] = new SmallStatistics();\n for (int ds = 0; ds < 2; ds++) {\n JSPFramework[] jspTesting = new JSPFramework[105];\n for (int i = 0; i < jspTesting.length; i++) {\n jspTesting[i] = new JSPFramework();\n jspTesting[i].getJSPdata(i*2 + 1);\n }\n //DMU - instances (1-80)//la - instances (81-120)\n //mt - instances (121/-123)//orb - instances (124-133)//ta -instances (134-173)\n //////////////////////////////////////////////\n for (int i = 0; i < jspTesting.length; i++) {\n double countEval = 0;\n double tempObj = Double.POSITIVE_INFINITY;\n double globalBest = Double.POSITIVE_INFINITY;\n boolean[] isApplied_Nk = new boolean[2]; //Arrays.fill(isApplied_Nk, Boolean.TRUE);\n int Nk = 0; // index of the Iterative dispatching rule to be used\n jspTesting[i].resetALL();\n boolean firstIteration = true;\n double countLargeStep = 0;\n do{\n countEval++;\n //start evaluate schedule\n jspTesting[i].reset();\n int N = jspTesting[i].getNumberofOperations();\n jspTesting[i].initilizeSchedule();\n int nScheduledOp = 0;\n\n //choose the next machine to be schedule\n while (nScheduledOp<N){\n\n Machine M = jspTesting[i].Machines[jspTesting[i].nextMachine()];\n\n jspTesting[i].setScheduleStrategy(Machine.scheduleStrategy.HYBRID );\n jspTesting[i].setPriorityType(Machine.priorityType.ATC);\n jspTesting[i].setNonDelayFactor(0.3);\n //*\n jspTesting[i].setInitalPriority(M);\n for (Job J:M.getQueue()) {\n double RJ = J.getReadyTime();\n double RO = J.getNumberRemainingOperations();\n double RT = J.getRemainingProcessingTime();\n double PR = J.getCurrentOperationProcessingTime();\n double W = J.getWeight();\n double DD = J.getDuedate();\n double RM = M.getReadyTime();\n double RWT = J.getCurrentOperationWaitingTime();\n double RFT = J.getFinishTime();\n double RNWT = J.getNextOperationWaitingTime();\n int nextMachine = J.getNextMachine();\n\n if (nextMachine==-1){\n RNWT=0;\n } else {\n RNWT = J.getNextOperationWaitingTime();\n if (RNWT == -1){\n RNWT = jspTesting[i].getMachines()[nextMachine].getQueueWorkload()/2.0;\n }\n }\n if (RWT == -1){\n RWT = M.getQueueWorkload()/2.0;\n }\n //J.addPriority((W/PR)*Math.exp(-maxPlus((DD-RM-PR-(RT-PR+J.getRemainingWaitingTime(M)))/(3*M.getQueueWorkload()/M.getNumberofJobInQueue())))); //iATC\n //J.addPriority((PR*PR*0.614577*(-RM-RM/W)-RT*PR*RT/W)\n // -(RT*PR/(W-0.5214191)-RM/W*PR*0.614577+RT*PR/(W-0.5214191)*2*RM/W));\n //J.addPriority(((W/PR)*((W/PR)/(RFT*RFT)))/(max(div((RFT-RT),(RWT/W)),IF(RFT/W-max(RFT-RT,DD),DD,RFT))+DD/RFT+RFT/W-max(RFT-RFT/W,DD))); //best TWT priorityIterative\n if (Nk==0)\n //J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((min(RT,RNWT-RFT)/(RJ-min(RWT,RFT*0.067633785)))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((div(min(RT,RNWT-RFT),(RJ-min(RWT,RFT*0.067633785))))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n else\n J.addPriority(min((((W/PR)/RFT)/(2*RNWT+max(RO,RFT)))/(PR+RNWT+max(RO,RFT)),((W/PR)/RFT)/PR)/RFT);\n }\n //jspTesting[i].calculatePriority(M);\n jspTesting[i].sortJobInQueue(M);\n Job J = M.completeJob();\n if (!J.isCompleted()) jspTesting[i].Machines[J.getCurrentMachine()].joinQueue(J);\n nScheduledOp++;\n }\n double currentObj = -100;\n currentObj = jspTesting[i].getTotalWeightedTardiness();\n if (tempObj > currentObj){\n tempObj = currentObj;\n jspTesting[i].recordSchedule();\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n //System.out.println(\"Improved!!!\");\n }\n else {\n isApplied_Nk[Nk] = true;\n if (!isNextApplied(Nk, isApplied_Nk)) Nk = circleShift(Nk, isApplied_Nk.length);\n else {\n if (globalBest>tempObj) {\n globalBest = tempObj;\n jspTesting[i].storeBestRecordSchedule();\n } jspTesting[i].restoreBestRecordSchedule();\n if (countLargeStep<1) {\n tempObj = Double.POSITIVE_INFINITY;\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n jspTesting[i].shakeRecordSchedule(noise, engineJob, globalBest);\n countLargeStep++;\n }\n else break;\n }\n }\n firstIteration = false;\n \n } while(true);\n result[ds].add(jspTesting[i].getDevREFTotalWeightedTardiness(globalBest));\n if (jspTesting[i].getDevLBCmax()==0) hits++;\n System.out.println(jspTesting[i].instanceName + \" & \"+ globalBest + \" & \" + countEval);\n }\n }\n //jsp.schedule();\n //*\n System.out.println(\"*************************************************************************\");\n System.out.println(\"[ & \" + formatter.format(result[0].getMin()) + \" & \"\n + formatter.format(result[0].getAverage()) + \" & \" + formatter.format(result[0].getMax()) +\n \" & \" + formatter.format(result[1].getMin()) + \" & \"\n + formatter.format(result[1].getAverage()) + \" & \" + formatter.format(result[1].getMax()) + \"]\");\n //*/\n System.out.print(\"\"+formatter.format(result[0].getAverage()) + \" \");\n }\n System.out.println(\"\");\n}\n }", "public void setup() \n { \n \tsize(400,400);\n \tbac = new Bacteria[15];\n \tfor (int i = 0; i<bac.length; i++)\n \t{\n \t\tbac[i]= new Bacteria(200,200);\n \t\tbac[i].c();\n \t} //initialize bacteria variables here \n }", "public void doRegressionAnalysis()\r\n {\n n = Y.getRowDimension();\r\n p = X.getColumnDimension(); \r\n k = p - 1; // k is number of explanatory variables\r\n Resids = new Matrix(n, 1);\r\n StandResids = new Matrix(n, 1);\r\n StudResids = new Matrix(n, 1);\r\n Cooks_D = new Matrix(n, 1);\r\n R_Student = new Matrix(n, 1);\r\n\r\n // MVP, p73\r\n X_Prime = X.transpose();\r\n X_Prime_X = X_Prime.times(X);\r\n X_Prime_X_Inv = X_Prime_X.inverse(); \r\n HatMatrix = X.times(X_Prime_X_Inv.times(X_Prime)); \r\n BetaHats = X_Prime_X_Inv.times(X_Prime.times(Y)); \r\n YHats = HatMatrix.times(Y);\r\n BXY = (BetaHats.transpose()).times(X_Prime.times(Y));\r\n Y_Prime_Y = (Y.transpose()).times(Y); \r\n ssRegression = BXY.get(0,0) - sumY_Squared_Over_n;\r\n SSRes = Y_Prime_Y.minus(BXY);\r\n ssResiduals = SSRes.get(0,0);\r\n ssTotal = Y_Prime_Y.get(0,0) - sumY_Squared_Over_n;\r\n \r\n r2 = ssRegression / ssTotal;\r\n s = Math.sqrt(ssResiduals / (n - k - 1));\r\n adj_r2 = 1.0 - (ssResiduals / (n - k - 1)) / (ssTotal / (n - 1));\r\n \r\n dfReg = k;\r\n dfResid = n - k - 1;\r\n dfTotal = n - 1;\r\n msReg = ssRegression / (double)k;\r\n msResid = ssResiduals / (double)(n - k - 1);\r\n fStatistic = msReg / msResid;\r\n fDist = new FDistribution(k, n - k - 1);\r\n pValue_F = fDist.getRightTailArea(fStatistic);\r\n Resids = Y.minus(YHats);\r\n\r\n tempDouble_01 = 1.0 / Math.sqrt(msResid);\r\n\r\n StandResids = Resids.times(tempDouble_01); \r\n for (int jj = 0; jj < n; jj++)\r\n { \r\n tempDouble_02 = HatMatrix.get(jj, jj);\r\n StudResids.set(jj, 0, Resids.get(jj, 0) * tempDouble_01 / Math.sqrt(1.0 - tempDouble_02));\r\n tempDouble_03 = StudResids.get(jj, 0) * StudResids.get(jj, 0) / (double)p;\r\n tempDouble_04 = tempDouble_02 / (1.0 - tempDouble_02);\r\n Cooks_D.set(jj, 0, tempDouble_03 * tempDouble_04);\r\n \r\n // Student-R calculations from 4.12, 4.13, p135\r\n jjResid = Resids.get(jj, 0);\r\n double e_i_sq = jjResid * jjResid; \r\n double oneMinus_hii = 1.0 - HatMatrix.get(jj, jj);\r\n double s_i_sq = ((n - p)*msResid - e_i_sq/oneMinus_hii) / (n - p - 1);\r\n R_Student.set(jj, 0, jjResid / Math.sqrt(s_i_sq * oneMinus_hii)); \r\n }\r\n\r\n StErrCoef = new Matrix(k + 1, 1); // Explanatory variables + intercept \r\n TStat = new Matrix(k + 1, 1); \r\n PValue_T = new Matrix(k + 1, 1); \r\n tDist = new TDistribution (n - k - 1);\r\n\r\n for (int preds = 0; preds <= k; preds++)\r\n {\r\n StErrCoef.set(preds, 0, Math.sqrt(msResid * X_Prime_X_Inv.get(preds, preds)));\r\n TStat.set(preds, 0, BetaHats.get(preds, 0) / StErrCoef.get(preds, 0));\r\n PValue_T.set(preds, 0, 2.0 * tDist.getRightTailArea(Math.abs(TStat.get(preds, 0))));\r\n }\r\n }", "public ResultSlotFillingHeuristic(long dataRandomSeed, String modusName, int fold) throws Exception {\n\n\t\tSystemScope.Builder.getScopeHandler()\n\t\t\t\t.addScopeSpecification(DataStructureLoader.loadSlotFillingDataStructureReader(\"Result\")).apply()\n\t\t\t\t.registerNormalizationFunction(new WeightNormalization())\n\t\t\t\t.registerNormalizationFunction(new AgeNormalization())\n\t\t\t\t//\n\t\t\t\t.registerNormalizationFunction(new DosageNormalization())\n\t\t\t\t.registerNormalizationFunction(new DurationNormalization())\n\t\t\t\t.registerNormalizationFunction(new VolumeNormalization())\n\t\t\t\t.registerNormalizationFunction(new ForceNormalization())\n\t\t\t\t.registerNormalizationFunction(new ThicknessNormalization())\n\t\t\t\t.registerNormalizationFunction(new PressureNormalization())\n\t\t\t\t.registerNormalizationFunction(new LengthNormalization())\n\t\t\t\t.registerNormalizationFunction(new DistanceNormalization())\n\t\t\t\t//\n\t\t\t\t.build();\n\n\t\tthis.instanceDirectory = SlotFillingCorpusBuilderBib\n\t\t\t\t.getDefaultInstanceDirectoryForEntity(SCIOEntityTypes.result);\n\n//\t\tthis.objectiveFunction = new SlotFillingObjectiveFunction(scoreType,\n//\t\t\t\tnew CartesianEvaluator(EEvaluationDetail.ENTITY_TYPE, EEvaluationDetail.DOCUMENT_LINKED));\n\n\t\tthis.objectiveFunction = new SlotFillingObjectiveFunction(scoreType,\n\t\t\t\tnew BeamSearchEvaluator(EEvaluationDetail.ENTITY_TYPE, 10));\n\n\t\tthis.fold = fold;\n\t\tthis.dataRandomSeed = dataRandomSeed;\n\t\tmodus = ENERModus.valueOf(modusName.split(\"_\")[0]);\n\n\t\tboolean isCoverage = modusName.contains(\"COVERAGE\");\n\n\t\treadData();\n//\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n//\t\tanalyze();\n\n\t\tboolean includeFastTextAnnotations = true;\n\t\tboolean includeIDFAnnotations = false;\n\t\tboolean addDicitionaryBasedAnnotations = false;\n\t\tboolean includeRegexData = false;\n\n\t\tMap<Instance, Set<EntityTemplate>> expGroups;\n//\t\tString rand = String.valueOf(new Random(dataRandomSeed).nextLong());\n\n\t\tmodelName = modus + \"_Result_FinalDiss_\" + dataRandomSeed + \"_fold_\" + fold;\n//\t\tmodelName = \"Result_PREDICT\";\n\t\tlog.info(\"Model name = \" + modelName);\n\n\t\tMap<Instance, Set<DocumentLinkedAnnotation>> annotations = new HashMap<>();\n\n\t\tMap<Instance, Set<DocumentLinkedAnnotation>> goldAnnotations = readAnnotations(\n\t\t\t\tnew File(\"data/annotations/result/\"));\n\n//\n\n\t\tif (modus == ENERModus.GOLD) {\n\n\t\t\tfor (Instance instance : goldAnnotations.keySet()) {\n\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\n\t\t\t\tfor (DocumentLinkedAnnotation instance2 : goldAnnotations.get(instance)) {\n//\t\t\t\t\tif (!EntityType.get(\"InvestigationMethod\").getRelatedEntityTypes()\n//\t\t\t\t\t\t\t.contains(instance2.getEntityType()))\n\t\t\t\t\tannotations.get(instance).add(instance2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//\t\t{\n//\t\t\tFastTextSentenceClassification invest = new FastTextSentenceClassification(modelName, false,\n//\t\t\t\t\tSCIOEntityTypes.investigationMethod, trainingInstances, false);\n//\t\t\tMap<Instance, Set<DocumentLinkedAnnotation>> annotationsInvFT = invest.predictNerlasEvaluate(testInstances);\n//\n//\t\t\tfor (Instance instance : annotationsInvFT.keySet()) {\n//\t\t\t\tSystem.out.println(annotationsInvFT.get(instance).size());\n//\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n//\t\t\t\tannotations.get(instance).addAll(annotationsInvFT.get(instance));\n//\t\t\t}\n//\t\t}\n\n//\t\t{\n//\t\t\t\n//\n//\t\t\tFastTextSentenceClassification trend = new FastTextSentenceClassification(modelName, false,\n//\t\t\t\t\tSCIOEntityTypes.trend, trainingInstances, false);\n//\t\t\tMap<Instance, Set<DocumentLinkedAnnotation>> annotationsTredFT = trend\n//\t\t\t\t\t.predictNerlasEvaluate(testInstances);\n//\t\t\tfor (Instance instance : annotationsTredFT.keySet()) {\n//\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n//\t\t\t\tSystem.out.println(annotationsTredFT.get(instance).size());\n//\t\t\t\tannotations.get(instance).addAll(annotationsTredFT.get(instance));\n//\t\t\t}\n//\n//\t\t}\n\t\t/*\n\t\t * TEST ALL GOLD BUT IDF PREDICT FOR TREND AND INV M\n\t\t */\n//\t\tannotations.values().stream().forEach(a -> {\n//\t\t\tfor (Iterator<DocumentLinkedAnnotation> iterator = a.iterator(); iterator.hasNext();) {\n//\t\t\t\tDocumentLinkedAnnotation documentLinkedAnnotation = (DocumentLinkedAnnotation) iterator.next();\n//\t\t\t\tif (documentLinkedAnnotation.getEntityType() != SCIOEntityTypes.groupName) {\n//\t\t\t\t\titerator.remove();\n//\t\t\t\t}\n//\t\t\t}\n//\t\t});\n\n//\t\tif (includeIDFAnnotations) {\n//\t\t\tExtractSentencesWithResults r = new ExtractSentencesWithResults(trainingInstanceNames,\n//\t\t\t\t\ttestInstanceNames);\n//\n//\t\t\tMap<Instance, Map<Integer, Set<DocumentLinkedAnnotation>>> trends = r.predictTrendInstances();\n//\t\t\tMap<Instance, Map<Integer, Set<DocumentLinkedAnnotation>>> investigationMethods = r\n//\t\t\t\t\t.predictInvestigationMethodInstances();\n//\n//\t\t\tr.filter();\n//\n//\t\t\tfor (Instance instance : trends.keySet()) {\n//\t\t\t\tAutomatedSectionifcation sectionification = AutomatedSectionifcation.getInstance(instance);\n//\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n//\n//\t\t\t\tfor (Set<DocumentLinkedAnnotation> trendAnnotations : trends.get(instance).values()) {\n//\t\t\t\t\tfor (DocumentLinkedAnnotation trendAnnotation : trendAnnotations) {\n//\n//\t\t\t\t\t\tif (sectionification.getSection(trendAnnotation) != ESection.RESULTS) {\n//\t\t\t\t\t\t\tcontinue;\n//\t\t\t\t\t\t}\n//\n//\t\t\t\t\t\tannotations.get(instance).add(trendAnnotation);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tfor (Instance instance : investigationMethods.keySet()) {\n//\t\t\t\tAutomatedSectionifcation sectionification = AutomatedSectionifcation.getInstance(instance);\n//\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n//\n//\t\t\t\tfor (Set<DocumentLinkedAnnotation> invMAnnotations : investigationMethods.get(instance).values()) {\n//\t\t\t\t\tfor (DocumentLinkedAnnotation invMAnnotation : invMAnnotations) {\n//\n//\t\t\t\t\t\tif (sectionification.getSection(invMAnnotation) != ESection.RESULTS) {\n//\t\t\t\t\t\t\tcontinue;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tannotations.get(instance).add(invMAnnotation);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t}\n\n\t\tScore invmScore = new Score();\n\t\tScore trendmScore = new Score();\n\n\t\tif (modus == ENERModus.PREDICT) {\n\t\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\t\t\t\tannotations.get(instance).addAll(getGroupNameCandidates(instance));\n\t\t\t}\n\n\t\t\tif (includeRegexData) {\n\t\t\t\tMap<Instance, Set<DocumentLinkedAnnotation>> regexp = readAnnotations(\n\t\t\t\t\t\tnew File(\"data/slot_filling/result/regex_nerla\"));\n\t\t\t\tfor (Instance instance : regexp.keySet()) {\n\t\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\t\t\t\t\tannotations.get(instance).addAll(regexp.get(instance));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (includeFastTextAnnotations) {\n\t\t\t\tFastTextSentenceClassification invest = new FastTextSentenceClassification(modelName, false,\n\t\t\t\t\t\tSCIOEntityTypes.investigationMethod, trainingInstances, true);\n\t\t\t\tMap<Instance, Set<DocumentLinkedAnnotation>> annotationsInvFT = invest\n\t\t\t\t\t\t.predictNerlasEvaluate(testInstances);\n\n\t\t\t\tinvmScore = invest.score(testInstances).toMacro();\n\n\t\t\t\tfor (Instance instance : annotationsInvFT.keySet()) {\n\t\t\t\t\tSystem.out.println(annotationsInvFT.get(instance).size());\n\t\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\t\t\t\t\tannotations.get(instance).addAll(annotationsInvFT.get(instance));\n\t\t\t\t}\n\n\t\t\t\tFastTextSentenceClassification trend = new FastTextSentenceClassification(modelName, false,\n\t\t\t\t\t\tSCIOEntityTypes.trend, trainingInstances, true);\n\t\t\t\ttrendmScore = trend.score(testInstances).toMacro();\n\n\t\t\t\tMap<Instance, Set<DocumentLinkedAnnotation>> annotationsTredFT = trend\n\t\t\t\t\t\t.predictNerlasEvaluate(testInstances);\n\t\t\t\tfor (Instance instance : annotationsTredFT.keySet()) {\n\t\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\t\t\t\t\tSystem.out.println(annotationsTredFT.get(instance).size());\n\t\t\t\t\tannotations.get(instance).addAll(annotationsTredFT.get(instance));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (includeIDFAnnotations) {\n\t\t\t\tExtractSentencesWithResults r = new ExtractSentencesWithResults(trainingInstanceNames,\n\t\t\t\t\t\ttestInstanceNames);\n\n\t\t\t\tMap<Instance, Map<Integer, Set<DocumentLinkedAnnotation>>> trends = r.predictTrendInstances();\n\t\t\t\tMap<Instance, Map<Integer, Set<DocumentLinkedAnnotation>>> investigationMethods = r\n\t\t\t\t\t\t.predictInvestigationMethodInstances();\n\n\t\t\t\tr.filter();\n\n\t\t\t\tfor (Instance instance : trends.keySet()) {\n\t\t\t\t\tAutomatedSectionifcation sectionification = AutomatedSectionifcation.getInstance(instance);\n\t\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\n\t\t\t\t\tfor (Set<DocumentLinkedAnnotation> trendAnnotations : trends.get(instance).values()) {\n\t\t\t\t\t\tfor (DocumentLinkedAnnotation trendAnnotation : trendAnnotations) {\n\n\t\t\t\t\t\t\tif (sectionification.getSection(trendAnnotation) != ESection.RESULTS) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tannotations.get(instance).add(trendAnnotation);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Instance instance : investigationMethods.keySet()) {\n\t\t\t\t\tAutomatedSectionifcation sectionification = AutomatedSectionifcation.getInstance(instance);\n\t\t\t\t\tannotations.putIfAbsent(instance, new HashSet<>());\n\n\t\t\t\t\tfor (Set<DocumentLinkedAnnotation> invMAnnotations : investigationMethods.get(instance).values()) {\n\t\t\t\t\t\tfor (DocumentLinkedAnnotation invMAnnotation : invMAnnotations) {\n\n\t\t\t\t\t\t\tif (sectionification.getSection(invMAnnotation) != ESection.RESULTS) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tannotations.get(instance).add(invMAnnotation);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (addDicitionaryBasedAnnotations)\n\t\t\t\taddDictionaryBasedAnnotations(annotations);\n\t\t}\n\n\t\tif (modus == ENERModus.GOLD)\n\t\t\texpGroups = getGoldGroups();\n\t\telse {\n\t\t\texpGroups = getPredictedGroups();\n\t\t}\n\n\t\tLocalSentenceHeuristic heuristic = new LocalSentenceHeuristic(annotations, expGroups, trainingInstances);\n\n\t\tMap<Instance, State> results = new HashMap<>();\n\t\tif (!isCoverage)\n\t\t\tresults = heuristic.predictInstancesByHeuristic(testInstances);\n\n\t\tif (isCoverage)\n\t\t\tresults = computeCoverage(annotations, expGroups, testInstances);\n\n\t\tSCIOSlotTypes.hasGroupName.exclude();\n\n\t\tScore score = evaluate(log, results, this.objectiveFunction);\n\t\tlog.info(\"inv performance: \" + invmScore);\n\t\tlog.info(\"trend performance: \" + trendmScore);\n\t\tlog.info(\"Unsorted Score: \" + score);\n\n\t\tscoreDetailed(EvalPair.toListOf(results), this.objectiveFunction);\n\n//\t\tSystem.out.println(countInvest);\n\n\t\tScore coarseGrained = CoarseGrainedResultEvaluation.evaluateCoarsGrained(objectiveFunction, results);\n\t\tlog.info(\"CoarseGrainedResultEvaluation Score: \" + coarseGrained);\n\n\t\tMap<Instance, Set<AbstractAnnotation>> goldTrends = new HashMap<>();\n\t\tMap<Instance, Set<AbstractAnnotation>> predictTrends = new HashMap<>();\n\n\t\tfor (Entry<Instance, State> instance : results.entrySet()) {\n\t\t\tpredictTrends.put(instance.getKey(), new HashSet<>());\n\t\t\tfor (AbstractAnnotation result : instance.getValue().getCurrentPredictions().getAnnotations()) {\n\t\t\t\tResult r = new Result(result);\n\t\t\t\tAbstractAnnotation t = r.getTrend();\n\t\t\t\tif (t != null)\n\t\t\t\t\tpredictTrends.get(instance.getKey()).add(t);\n\t\t\t}\n\n\t\t}\n\t\tfor (Entry<Instance, State> instance : results.entrySet()) {\n\t\t\tgoldTrends.put(instance.getKey(), new HashSet<>());\n\t\t\tfor (AbstractAnnotation result : instance.getValue().getGoldAnnotations().getAnnotations()) {\n\t\t\t\tResult r = new Result(result);\n\t\t\t\tAbstractAnnotation t = r.getTrend();\n\t\t\t\tif (t != null)\n\t\t\t\t\tgoldTrends.get(instance.getKey()).add(t);\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.exit(1);\n\t\t/**\n\t\t * TREND EVALUATION\n\t\t */\n\n\t\tSlotType.excludeAll();\n\n\t\tSet<SlotType> slotTypesToConsider = new HashSet<>();\n\t\tslotTypesToConsider.add(SCIOSlotTypes.hasSignificance);\n\t\tslotTypesToConsider.add(SCIOSlotTypes.hasPValue);\n\t\tslotTypesToConsider.add(SCIOSlotTypes.hasDifference);\n\n\t\tfor (SlotType slotType : slotTypesToConsider) {\n\t\t\tslotType.include();\n\t\t}\n\n\t\tMap<Instance, State> finalStates = new HashMap<>();\n\t\tMap<Instance, State> coverageStates = new HashMap<>();\n\n\t\tfor (Instance instance : results.keySet()) {\n\n\t\t\tList<AbstractAnnotation> coverageTrends = new ArrayList<>();\n\t\t\tList<AbstractAnnotation> trends = new ArrayList<>(predictTrends.get(instance));\n\n\t\t\tList<AbstractAnnotation> gt = new ArrayList<>(goldTrends.get(instance));\n\n\t\t\tlog.info(\"########PREDICTED########\");\n\t\t\tfor (AbstractAnnotation string : trends) {\n\t\t\t\tlog.info(string.toPrettyString());\n\t\t\t}\n\n\t\t\tlog.info(\"########GOLD########\");\n\t\t\tfor (AbstractAnnotation string : gt) {\n\t\t\t\tlog.info(string.toPrettyString());\n\t\t\t}\n\n\t\t\tInstance instanceT = new Instance(instance.getOriginalContext(), instance.getDocument(), new Annotations(gt));\n\n\t\t\tAnnotations currentPredictions = new Annotations(trends);\n\t\t\tfinalStates.put(instanceT, new State(instanceT, currentPredictions));\n\n\t\t\tAnnotations coveragePredictions = new Annotations(coverageTrends);\n\t\t\tcoverageStates.put(instanceT, new State(instanceT, coveragePredictions));\n\n\t\t}\n\n\t\tAbstractEvaluator eval = new BeamSearchEvaluator(EEvaluationDetail.ENTITY_TYPE, 20);\n\n\t\tScore allScore = new Score();\n\t\tMap<String, Score> scoreMap = new HashMap<>();\n//\n\t\tPerSlotEvaluator.evalRoot(EScoreType.MACRO, finalStates, coverageStates, eval, scoreMap);\n\n\t\tPerSlotEvaluator.evalProperties(EScoreType.MACRO, finalStates, coverageStates, slotTypesToConsider, eval,\n\t\t\t\tscoreMap);\n\n\t\tPerSlotEvaluator.evalCardinality(EScoreType.MACRO, finalStates, coverageStates, scoreMap);\n\n\t\tPerSlotEvaluator.evalOverall(EScoreType.MACRO, finalStates, coverageStates, eval, scoreMap);\n\n\t\tlog.info(\"\\n\\n\\n*************************\");\n\n\t\tfor (Entry<String, Score> sm : scoreMap.entrySet()) {\n\t\t\tlog.info(sm.getKey() + \"\\t\" + sm.getValue().toTSVString());\n\t\t}\n\n\t\tlog.info(\"*************************\");\n\n\t\tlog.info(allScore);\n\n\t}", "private void createGeneralScene(Group root3D){\n generateRunways(root3D);\n for(String runwayId: controller.getRunways()){\n genRunwayName(root3D, runwayId, runwayElevation);\n }\n generateLighting(root3D);\n pointCameraAt(new Point3D(0,0,0),root3D);\n }", "public void creation(){\n\t for(int i=0; i<N;i++) {\r\n\t\t for(int j=0; j<N;j++) {\r\n\t\t\t tab[i][j]=0;\r\n\t\t }\r\n\t }\r\n\t resDiagonale(); \r\n \r\n\t //On remplit le reste \r\n\t conclusionRes(0, nCarre); \r\n \t\t\r\n\t \r\n\t isDone=true;\r\n }", "public static void main(String[] args) throws SubDesbordamientoMateriales{\n\tSystem.out.println(\"B I E N V E N I D O\\n\"+\r\n\t\t\t\"----BIG SHIP----- \");\t\r\n\t//herramientas\r\n\tboolean Mesa=false;\r\n\tboolean Barco=false;\r\n\tboolean Baston=false;\r\n\tboolean Cana_p=false;\r\n\tboolean Cuerda=false;\r\n\t//crear una variable aleatoria para definir los materiales\r\n\tint tipAl=0;//Tipo Aleatorio\r\n\tint al=0;//aleatorio\r\n\t// SE CREAN LAS CLASES GENERICAS PARA CADA MATERIAL\r\n\t//se crea la clase generica HILO\r\n\t PilaMaterial<Integer> PH = new PilaMaterial<>(4);//numero max que puede llegar a tener\r\n\t//se crea la clase generica RESINA\r\n\t PilaMaterial<Integer> PR = new PilaMaterial<>(1);//numero max que puede llegar a tener\r\n\t //se crea la clase generica MADERA\r\n\t PilaMaterial<Integer> PM = new PilaMaterial<>(5);//numero max que puede llegar a tener\r\n\t\r\n\t //primero crear un arreglo para que se guarden todos los materiales para despues utilizarlos\r\n\t //----> Vector auxiliar----> Quitar int mat[]=new int[30];\r\n\t //Crear una variable para guardar el tipo de material que se ira modificando \r\n\t int VarTM=0;\r\n\tboolean ResinaC=false;\r\n\t//--------------Empieza el juego-----------------\r\n\tfor(int x=0;x<30;x++) {\r\n\t\t//Definir el tipo de material\r\n\t\tVarTM=(int)(Math.random()*(2-(-1)));\r\n\t\t//se define lo que se va apilar (Numero aleatorio)\r\n\t\tal=(int)(Math.random()*(10-1));\r\n\t\t//MADERA\r\n\t\tif(VarTM==0) { \r\n\t\t\t try {\r\n\t\t\t\t PM.apilar(al);\r\n\t\t\t\t // System.out.println(\"M\");//Conteo de las Maderas\r\n\t\t\t\t if((PM.cantidad()==4)&(Mesa==false)) { \r\n\t\t\t\t\t Mesa=true;\r\n\t\t\t\t\t System.out.println(\"Mesa adquirida\");\r\n\t\t\t\t\t //vaciar la pila\r\n\t\t\t\t\t PM.vaciarComple(); \r\n\t\t\t\t }if((PM.cantidad()==2)&(Baston==false)&(Mesa)) {\r\n\t\t\t\t\t Baston=true;\r\n\t\t\t\t\t System.out.println(\"Baston adquirido\");\r\n\t\t\t\t\t//vaciar la pila\r\n\t\t\t\t\t PM.vaciarComple(); \r\n\t\t\t\t }\r\n\t\t\t }catch(DesbordamientoMateriales E) {\r\n\t\t\t\t System.out.println(E.getMessage()+\" Madera esta completa\");\r\n\t\t\t\t if((Barco==false)&(Mesa)&(Baston)&(Cuerda)&(Cana_p)) {\r\n\t\t\t\t\t Barco=true;\r\n\t\t\t\t\t System.out.println(\"Barco adquirido!!\\n--- B I G S H I P :) ---\");\r\n\t\t\t\t\t //Vaciar la pila\r\n\t\t\t\t\t PM.vaciarComple();\r\n\t\t\t\t\t //impresion de vector con materiales\r\n\t\t\t\t\t //System.out.println(\" MATERIALES EN EL MAPA:\");\r\n\t\t\t\t\t // PilaMaterial.impVectorM(mat);\r\n\t\t\t\t\t //Termina el programa con gane\r\n\t\t\t\t\t System.exit(0);\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t //RESINA\r\n\t\t}if(VarTM==1) {\r\n\t\t\t try {\r\n\t\t\t PR.apilar(al);\r\n\t\t }catch(DesbordamientoMateriales E) {\r\n\t\t\t System.out.println(E.getMessage()+\" Resina esta Completa :v\");\r\n\t\t\t //condicion aquí\r\n\t\t if(ResinaC==false) {\r\n\t\t\t ResinaC=true;\r\n\t\t\t //Vaciar pila de Resina\r\n\t\t\t PR.vaciarComple();\r\n\t\t\t }\r\n\t\t\t } \r\n\t\t }//HILO\r\n\t\t if(VarTM==2){\r\n\t\t\t try {\r\n\t\t\t PH.apilar(al);\r\n\t\t }catch(DesbordamientoMateriales E) {\r\n\t\t\t System.out.println(E.getMessage()+\" Hilo esta completa \");\r\n\t\t\t if((Cuerda==false)&(Mesa)&(ResinaC)&(Baston)) { //solo que aquí no evaluamos la cantidad que hay en la pila ya que esta desbordada\r\n\t\t\t\t Cuerda=true;\r\n\t\t\t\t System.out.println(\"Cuerda adquirida\");\r\n\t\t\t\t //vaciar la Pila de Hilo\r\n\t\t\t\t PH.vaciarComple();\r\n\t\t\t }\r\n\t\t\t\t //inmediatamente comparar si se cumple lo necesario para la caña\r\n\t\t\t if((Cana_p==false)&(Mesa)&(Baston)&(Cuerda)) {\r\n\t\t \t Cana_p=true;\r\n\t\t \t System.out.println(\"Cana de Pescar Adquirida\");\r\n\t\t\t }\r\n\t\t }\r\n\t\t } \r\n\t }\r\n\t//imprimir el vector para ver los materiales en el mapa\r\n\t//System.out.println(\" MATERIALES EN EL MAPA:\");\r\n //PilaMaterial.impVectorM(mat);\r\n\t}", "public void populateDeck(){\n\n //Add everything to r\n for(int i=0;i<LUMBER;i++){\n deck.add(new ResourceCard(container, Resource.WOOD, cardStartPoint));\n }\n\n for(int i=0;i<WOOL;i++){\n deck.add(new ResourceCard(container, Resource.WOOL, cardStartPoint));\n }\n\n for(int i=0;i<GRAIN;i++){\n deck.add(new ResourceCard(container, Resource.WHEAT, cardStartPoint));\n }\n\n for(int i=0;i<BRICK;i++){\n deck.add(new ResourceCard(container, Resource.BRICKS, cardStartPoint));\n }\n\n for(int i=0;i<ORE;i++){\n deck.add(new ResourceCard(container, Resource.ORE, cardStartPoint));\n }\n //Collections.shuffle(deck);\n\n }", "private void fillNCFile() {\n\n List<GradsVariable> vars = gradsDDF.getVariables();\n List<GradsAttribute> attrs = gradsDDF.getAttributes();\n // TODO: ensembles\n List<GradsDimension> dims = gradsDDF.getDimensions();\n Variable v;\n int numZ = 0;\n HashMap<String, Dimension> zDims = new HashMap<>();\n for (GradsDimension dim : dims) {\n String name = getVarName(dim);\n int size = dim.getSize();\n Dimension ncDim = new Dimension(name, size);\n ncFile.addDimension(null, ncDim);\n if (name.equals(ENS_VAR)) {\n v = new Variable(ncFile, null, null, name, DataType.STRING, name);\n v.addAttribute(new Attribute(\"standard_name\", \"ensemble\"));\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Ensemble.toString()));\n List<String> names = gradsDDF.getEnsembleDimension().getEnsembleNames();\n String[] nameArray = new String[names.size()];\n for (int i = 0; i < nameArray.length; i++) {\n nameArray[i] = names.get(i);\n }\n Array dataArray = Array.factory(DataType.STRING, new int[] {nameArray.length}, nameArray);\n v.setCachedData(dataArray, false);\n } else {\n double[] vals = dim.getValues();\n v = new Variable(ncFile, null, null, name, DataType.DOUBLE, name);\n v.addAttribute(new Attribute(CDM.UNITS, dim.getUnit()));\n switch (name) {\n case Y_VAR:\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"latitude\"));\n v.addAttribute(new Attribute(\"standard_name\", \"latitude\"));\n v.addAttribute(new Attribute(\"axis\", \"Y\"));\n sizeY = dim.getSize();\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lat.toString()));\n break;\n case X_VAR:\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"longitude\"));\n v.addAttribute(new Attribute(\"standard_name\", \"longitude\"));\n v.addAttribute(new Attribute(\"axis\", \"X\"));\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lon.toString()));\n sizeX = dim.getSize();\n break;\n case Z_VAR:\n numZ = size;\n zDims.put(name, ncDim);\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"level\"));\n addZAttributes(dim, v);\n break;\n case TIME_VAR:\n v.addAttribute(new Attribute(CDM.LONG_NAME, \"time\"));\n v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Time.toString()));\n break;\n }\n ArrayDouble.D1 varArray = new ArrayDouble.D1(size);\n for (int i = 0; i < vals.length; i++) {\n varArray.set(i, vals[i]);\n }\n v.setCachedData(varArray, false);\n }\n ncFile.addVariable(null, v);\n }\n if (numZ > 0) {\n GradsDimension zDim = gradsDDF.getZDimension();\n double[] vals = zDim.getValues();\n for (GradsVariable var : vars) {\n int nl = var.getNumLevels();\n if ((nl > 0) && (nl != numZ)) {\n String name = Z_VAR + nl;\n if (zDims.get(name) == null) {\n Dimension ncDim = new Dimension(name, nl);\n ncFile.addDimension(null, ncDim);\n Variable vz = new Variable(ncFile, null, null, name, DataType.DOUBLE, name);\n vz.addAttribute(new Attribute(CDM.LONG_NAME, name));\n vz.addAttribute(new Attribute(CDM.UNITS, zDim.getUnit()));\n addZAttributes(zDim, vz);\n ArrayDouble.D1 varArray = new ArrayDouble.D1(nl);\n for (int i = 0; i < nl; i++) {\n varArray.set(i, vals[i]);\n }\n vz.setCachedData(varArray, false);\n ncFile.addVariable(null, vz);\n zDims.put(name, ncDim);\n }\n }\n }\n }\n for (GradsVariable var : vars) {\n String coords = \"latitude longitude\";\n int nl = var.getNumLevels();\n if (nl > 0) {\n if (nl == numZ) {\n coords = \"level \" + coords;\n } else {\n coords = Z_VAR + nl + \" \" + coords;\n }\n }\n coords = \"time \" + coords;\n if (gradsDDF.getEnsembleDimension() != null) {\n coords = \"ensemble \" + coords;\n }\n v = new Variable(ncFile, null, null, var.getName(), DataType.FLOAT, coords);\n v.addAttribute(new Attribute(CDM.LONG_NAME, var.getDescription()));\n if (var.getUnitName() != null) {\n v.addAttribute(new Attribute(CDM.UNITS, var.getUnitName()));\n }\n v.addAttribute(new Attribute(CDM.FILL_VALUE, (float) gradsDDF.getMissingValue()));\n v.addAttribute(new Attribute(CDM.MISSING_VALUE, (float) gradsDDF.getMissingValue()));\n for (GradsAttribute attr : attrs) {\n if (attr.getVariable().equalsIgnoreCase(var.getName())) {\n // TODO: what to do about a UINT16/32\n if (attr.getType().equalsIgnoreCase(GradsAttribute.STRING)) {\n v.addAttribute(new Attribute(attr.getName(), attr.getValue()));\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.BYTE)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Byte(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.INT16)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Short(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.INT32)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Integer(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.FLOAT32)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Float(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n } else if (attr.getType().equalsIgnoreCase(GradsAttribute.FLOAT64)) {\n try {\n v.addAttribute(new Attribute(attr.getName(), new Double(attr.getValue())));\n } catch (NumberFormatException nfe) {\n }\n }\n }\n }\n ncFile.addVariable(null, v);\n }\n // Global Attributes\n ncFile.addAttribute(null, new Attribute(CDM.CONVENTIONS, \"CF-1.0\"));\n ncFile.addAttribute(null, new Attribute(CDM.HISTORY, \"Direct read of GrADS binary grid into NetCDF-Java 4 API\"));\n String title = gradsDDF.getTitle();\n if ((title != null) && !title.isEmpty()) {\n ncFile.addAttribute(null, new Attribute(\"title\", title));\n }\n for (GradsAttribute attr : attrs) {\n if (attr.getVariable().equalsIgnoreCase(GradsAttribute.GLOBAL)) {\n ncFile.addAttribute(null, new Attribute(attr.getName(), attr.getValue()));\n }\n }\n\n }", "public void SteadyStepReproductionCAN (TableVar Variables) {\r\n\r\n int i, j, pos;\r\n int[] indices = new int[long_poblacion];\r\n float[] fit = new float[long_poblacion];\r\n \r\n for (i=0; i<long_poblacion; i++) {\r\n fit[i]= poblac.getIndivFitness(i);\r\n indices[i] = i; \r\n }\r\n \r\n // Sort the fitness array of actual population and store the values at \"indices\"\r\n Utils.OrDecIndex (fit,0,long_poblacion-1,indices); // To maximise\r\n \r\n for (i=0; i<descendientes; i++) {\t// For each descendant\r\n pos = indices[long_poblacion-1-i];\t\t\r\n for (j=0; j<Variables.getNVars(); j++) {\r\n poblac.setCromElem(pos, j, Des.getCromElem(i,j));\r\n }\r\n poblac.setIndivEvaluated(pos,false);\r\n }\r\n\r\n }", "Variables createVariables();", "public void prepare() {\n this.shifts = new ArrayList<>();\n this.rates = new ArrayList<>();\n // bootstrap shifts and rates\n this.prepareShifts();\n this.prepareRates();\n }", "public void generate() {\n\t\tint randNum;\n\n\t\t// Generates variables.\n\t\tfor (int i = 0; i < variables.length; i++) {\n\t\t\trandNum = rand.nextInt(9) + 1;\n\t\t\twhile (!checkDuplicate(variables, i, randNum)) {\n\t\t\t\trandNum = rand.nextInt(9) + 1;\n\t\t\t}\n\t\t\tvariables[i] = randNum;\n\t\t}\n\n\t\t// Example sudoku.\n\t\trandNum = rand.nextInt(3) + 1;\n\t\tswitch (randNum) {\n\t\tcase 1:\n\t\t\tint[][] array1 = { { 4, 7, 1, 3, 2, 8, 5, 9, 6 },\n\t\t\t\t\t{ 6, 3, 9, 5, 1, 4, 7, 8, 2 },\n\t\t\t\t\t{ 5, 2, 8, 6, 7, 9, 1, 3, 4 },\n\t\t\t\t\t{ 1, 4, 2, 9, 6, 7, 3, 5, 8 },\n\t\t\t\t\t{ 8, 9, 7, 2, 5, 3, 4, 6, 1 },\n\t\t\t\t\t{ 3, 6, 5, 4, 8, 1, 2, 7, 9 },\n\t\t\t\t\t{ 9, 5, 6, 1, 3, 2, 8, 4, 7 },\n\t\t\t\t\t{ 2, 8, 4, 7, 9, 5, 6, 1, 3 },\n\t\t\t\t\t{ 7, 1, 3, 8, 4, 6, 9, 2, 5 } };\n\t\t\tcopy(array1, answer); // Copies example to answer.\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tint[][] array2 = { { 8, 3, 5, 4, 1, 6, 9, 2, 7 },\n\t\t\t\t\t{ 2, 9, 6, 8, 5, 7, 4, 3, 1 },\n\t\t\t\t\t{ 4, 1, 7, 2, 9, 3, 6, 5, 8 },\n\t\t\t\t\t{ 5, 6, 9, 1, 3, 4, 7, 8, 2 },\n\t\t\t\t\t{ 1, 2, 3, 6, 7, 8, 5, 4, 9 },\n\t\t\t\t\t{ 7, 4, 8, 5, 2, 9, 1, 6, 3 },\n\t\t\t\t\t{ 6, 5, 2, 7, 8, 1, 3, 9, 4 },\n\t\t\t\t\t{ 9, 8, 1, 3, 4, 5, 2, 7, 6 },\n\t\t\t\t\t{ 3, 7, 4, 9, 6, 2, 8, 1, 5 } };\n\t\t\tcopy(array2, answer);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tint[][] array3 = { { 5, 3, 4, 6, 7, 8, 9, 1, 2 },\n\t\t\t\t\t{ 6, 7, 2, 1, 9, 5, 3, 4, 8 },\n\t\t\t\t\t{ 1, 9, 8, 3, 4, 2, 5, 6, 7 },\n\t\t\t\t\t{ 8, 5, 9, 7, 6, 1, 4, 2, 3 },\n\t\t\t\t\t{ 4, 2, 6, 8, 5, 3, 7, 9, 1 },\n\t\t\t\t\t{ 7, 1, 3, 9, 2, 4, 8, 5, 6 },\n\t\t\t\t\t{ 9, 6, 1, 5, 3, 7, 2, 8, 4 },\n\t\t\t\t\t{ 2, 8, 7, 4, 1, 9, 6, 3, 5 },\n\t\t\t\t\t{ 3, 4, 5, 2, 8, 6, 1, 7, 9 } };\n\t\t\tcopy(array3, answer);\n\t\t\tbreak;\n\t\t}\n\n\t\treplace(answer); // Randomize once more.\n\t\tcopy(answer, problem); // Copies answer to problem.\n\t\tgenProb(); // Generates problem.\n\n\t\tshuffle();\n\t\tcopy(problem, player); // Copies problem to player.\n\n\t\t// Checking for shuffled problem\n\t\tcopy(problem, comp);\n\n\t\tif (!solve(0, 0, 0, comp)) {\n\t\t\tgenerate();\n\t\t}\n\t\tif (!unique()) {\n\t\t\tgenerate();\n\t\t}\n\t}", "MagLegendre( int nt ) \n {\n nTerms = nt;\n Pcup = new double[ nTerms + 1 ];\n dPcup = new double[ nTerms + 1 ];\n }", "public void movR(){\r\n\t\t\r\n\t\tint aux1[][]= new int [3][1];\r\n\t\tint aux2[][]= new int [3][1];\r\n\t\tint aux3[][]= new int [3][1];\r\n\t\tint aux4[][]= new int [3][1];\r\n\t\t\r\n\t\tint aux5[][]= new int [3][1];\r\n\t\t\r\n\t\tint aux6[][]= new int [3][1];\r\n\t\t\r\n\t\tint aux7[][]= new int [3][1];\r\n\t\t\r\n\t\taux1=cloneC(5,2);\r\n\t\taux2=cloneC(1,2);\r\n\t\taux3=cloneC(4,2);\r\n\t\taux4=cloneC(3,0);\r\n\t\t\r\n\t\taux5=cloneF(2,0);\r\n\t\taux6=cloneF(2,1);\r\n\t\taux7=cloneF(2,2);\r\n\t\t\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaColumna(aux1, 1, 2);\r\n\t\tthis.copiaEnColumnaUnaColumna(aux2, 4, 2);\r\n\t\tthis.copiaEnColumnaUnaColumnaReves(aux3, 3, 0);\r\n\t\tthis.copiaEnColumnaUnaColumnaReves(aux4, 5, 2);\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux5, 2, 2);\r\n\t\tthis.copiaEnColumnaUnaFila(aux6, 2, 1);\r\n\t\tthis.copiaEnColumnaUnaFila(aux7, 2, 0);\r\n\t\t\r\n\t}", "VectorArray getResHar();", "protected abstract StackManipulation preparation();", "DS (int size) {sz = size; p = new int [sz]; for (int i = 0; i < sz; i++) p[i] = i; R = new int[sz];}", "private static SnowyScheme constructSnowyScheme() {\n\t\t/* Setup a basic dam scheme */\n\t\t\n\t\t/*Dam setup \n\t\t * Used ML for water and MW for power, didn't add outflow as it depends on the dam, coeff wasn't changed\n\t\t */\t\t\n\t\t/**dam\n\t\t * @param count - Variable used as an identifier.\n\t\t * @param capacity - The maximum water capacity of the dam.\n\t\t * @param initialLevel - The water level of the dam starts with this value.\n\t\t * @param downstream - Variable representing where water flows when the dam is overflowing.\n\t\t * @param coeff - Coefficient of the power-water equation (used to determine power generated per litre of water).\n\t\t * @param maxPwr - max power the generator in the dam can produce \n\t\t */\n\t\t\n\t /** river\n\t * @param count - An id\n\t * @param max - A max value before flooding\n\t * @param min - A min value before drought\n\t * @param initialFlow - What the river starts at\n\t * @param length - Length of the river\n\t * @param out - Where the water flow goes.\n\t */\n\t\t\n\t\t// Dams\n\t\tDam blowering = new Dam(\"Blowering\", 1628000, 1628000/2, null , (float)0.3, 80); \n\t\tDam talbingo = new Dam(\"Talbingo\", 921400, 921400/2, null, (float)0.3, 1500); \t\t\n\t\tDam tumut2 = new Dam(\"Tumut 2\", 2677, 2677/2, null, (float)0.3, 286); \t\t\n\t\tDam tumut1 = new Dam(\"Tumut 1\", 52793, 52793/2, null, (float)0.3, 330); \t\t\n\t\tDam guthega = new Dam(\"Guthega\", 1604, 1604/2, null, (float)0.3, 60);\n\t\tDam murray = new Dam(\"Murray\", 2344, 2344/2, null, (float)0.3, 1500);\n\t\tDam jounama = new Dam(\"Jounama\", 43542, 43542/2, null, (float)0.3, 0);\n\t\tDam tooma = new Dam(\"Tooma\", 28124, 28124/2, null, (float)0.3, 0);\n\t\tDam happyJacks = new Dam(\"Happy Jacks\", 271, 271/2, null, (float)0.3, 0);\n\t\tDam tangara = new Dam(\"Tangara\", 254099, 254099/2, null, (float)0.3, 0);\n\t\tDam eucumbene = new Dam(\"Eucumbene\", 4798400, 4798400/2, null, (float)0.3, 0);\n\t\tDam jindabyne = new Dam(\"Jindabyne\", 688287, 688287/2, null, (float)0.3, 0);\n\t\tDam islandBendDam = new Dam(\"Island Bend\", 3084, 3084/2, null, (float)0.3, 0);\n\t\tDam geehi = new Dam(\"Geehi\", 21093, 21093/2, null, (float)0.3, 0);\n\t\tDam khancoban = new Dam(\"Khancoban\", 26643, 26643/2, null, (float)0.3, 0);\n\n\t\tSnowyScheme scheme = new SnowyScheme(murray);\n\t\tscheme.addDam(blowering);\n\t\tscheme.addDam(talbingo);\n\t\tscheme.addDam(tumut2);\n\t\tscheme.addDam(tumut1);\n\t\tscheme.addDam(guthega);\n\t\tscheme.addDam(murray);\n\t\tscheme.addDam(jounama);\n\t\tscheme.addDam(tooma);\n\t\tscheme.addDam(happyJacks);\n\t\tscheme.addDam(tangara);\n\t\tscheme.addDam(eucumbene);\n\t\tscheme.addDam(jindabyne);\n\t\tscheme.addDam(islandBendDam);\n\t\tscheme.addDam(geehi);\n\t\tscheme.addDam(khancoban);\n\t\t\n\t\t// Rivers\n\t\tRiver hightoBlowering = new River(\"Blowering to Ocean\", 100, 10 , 50, 10, scheme.getOcean()); // From blowering to ocean\n\t\tblowering.connectTo(hightoBlowering);\n\t\tscheme.addRiver(hightoBlowering);\n\t\tRiver junamaToblowering = new River(\"Junama To Blowering\", 54, 5 , 25, (float) 17.857, blowering);\n\t\tjounama.connectTo(junamaToblowering);\n\t\tscheme.addRiver(junamaToblowering);\n\t\tRiver talbingoTojunama = new River(\"Talbingo to Junama\", 27, 3 , 10, (float) 8.923, jounama);\n\t\ttalbingo.connectTo(talbingoTojunama);\n\t\tscheme.addRiver(talbingoTojunama);\n\t\tRiver tumutToTalbingo = new River(\"Tumut to Talbingo\", 89, 9 , 40, (float) 29.762, talbingo);\n\t\ttumut2.connectTo(tumutToTalbingo);\n\t\tscheme.addRiver(tumutToTalbingo);\n\t\tRiver tumutToTamut = new River(\"Tumut 1 to Tumut 2\", 27, 3 , 15, (float) 8.929, tumut2);\n\t\ttumut1.connectTo(tumutToTamut);\n\t\tscheme.addRiver(tumutToTamut);\n\t\tRiver toomaToTumut = new River(\"Tooma to Tumut 1\", 45, 5, 25, (float) 14.881, tumut1);\n\t\ttooma.connectTo(toomaToTumut);\n\t\tscheme.addRiver(toomaToTumut);\n\t\tRiver happyJToTumut = new River(\"Happy Jacks to Tumut 1\", 45, 5, 25, (float) 14.881, tumut1);\n\t\thappyJacks.connectTo(happyJToTumut);\n\t\tscheme.addRiver(happyJToTumut);\n\t\tPipe eucumbeneToHappyJ = new Pipe(\"Eucumbene to Happy Jacks\", 50 , 100, (float) 0.5, eucumbene, happyJacks);\n\t\tscheme.addPipe(eucumbeneToHappyJ);\n\t\tRiver tangaraToEucumbene = new River(\"Tangara to Eucumbene\", 107, 10 , 50, (float) 35.714, eucumbene);\n\t\ttangara.connectTo(tangaraToEucumbene);\n\t\tscheme.addRiver(tangaraToEucumbene);\n\t\tRiver eucumbeneToJindabyne = new River(\"Eucumbene To Jinabyne\", 928, 93 , 400, (float) 32.738, jindabyne);\n\t\teucumbene.connectTo(eucumbeneToJindabyne);\n\t\tscheme.addRiver(eucumbeneToJindabyne);\n\t\tRiver snowyRiver = new River(\"Snowy River\", 1000, 10 , 500, 100, scheme.getOcean());\n\t\tjindabyne.connectTo(snowyRiver);\n\t\tscheme.addRiver(snowyRiver);\n\t\tPipe jindabyneToIsland = new Pipe(\"JindaByne to Island Bend\", 50, 100, (float) 0.5, islandBendDam, jindabyne);\n\t\tscheme.addPipe(jindabyneToIsland);\n\t\tPipe eucumbeneToIsland = new Pipe(\"Eucumbene to Island\", 50, 100, (float) 0.5, islandBendDam, eucumbene);\n\t\tscheme.addPipe(eucumbeneToIsland);\n\t\tRiver guthegaToIsland = new River(\"Guthega to Island Bend\", 54, 5 , 20, (float) 17.857, islandBendDam);\n\t\tguthega.connectTo(guthegaToIsland);\n\t\tscheme.addRiver(guthegaToIsland);\n\t\tRiver islandToGeehi = new River(\"Island Bend to Geehi\", 48, 5 , 20, (float) 16.071, geehi);\n\t\tislandBendDam.connectTo(islandToGeehi);\n\t\tscheme.addRiver(islandToGeehi);\n\t\tRiver geehiToMurray = new River(\"Geehi to Murray\", 45, 5 , 20, (float) 14.881, murray);\n\t\tgeehi.connectTo(geehiToMurray);\n\t\tscheme.addRiver(geehiToMurray);\n\t\tRiver murrayToKhancoban = new River(\"Murray to Khancoban\", 31, 3 , 10, (float) 10.119, khancoban);\n\t\tmurray.connectTo(murrayToKhancoban);\n\t\tscheme.addRiver(murrayToKhancoban);\n\t\tRiver khancobanRiver = new River(\"Khancoban to Ocean\", 100, 0 , 50, 100, scheme.getOcean());\n\t\tkhancoban.connectTo(khancobanRiver);\n\t\tscheme.addRiver(khancobanRiver);\n\n\t\tSystem.out.print(\"The model is \");\n\t\t\n\t\tif(scheme.validateModel())\n\t\t\tSystem.out.println(\"valid\");\n\t\telse{\n\t\t\tSystem.out.println(\"invalid\");\n\t\t}\n\t\t\n\t\treturn scheme;\n\t}", "public void setup() {\n space = null;\n rabbitList = new ArrayList<>();\n schedule = new Schedule(1);\n\n //recreate main window\n if (displaySurf != null) {\n displaySurf.dispose();\n }\n displaySurf = null;\n displaySurf = new DisplaySurface(this, \"Rabbits Grass Simulation 1\");\n registerDisplaySurface(\"Rabbits Grass Simulation 1\", displaySurf);\n\n //recreate population plot\n if (populationPlot != null) {\n populationPlot.dispose();\n }\n populationPlot = null;\n populationPlot = new OpenSequenceGraph(\"Population Plot\", this);\n populationPlot.setYAutoExpand(false);\n populationPlot.setYRange(0, 200);\n this.registerMediaProducer(\"Plot\", populationPlot);\n }", "private void calculateRecForces(){\n\t\t\n\t\t\n\t\tfor(Particle p : this){\n\t\t\t//Pg 183 Lee[05]\n\t\t\t//For each grid point that this particle has been interpolated to\n\t\t\tfor(int dx = -ASSIGNMENT_SCHEME_ORDER; dx < ASSIGNMENT_SCHEME_ORDER; dx++)\n\t\t\t{\n\t\t\t\tfor(int dy = -ASSIGNMENT_SCHEME_ORDER; dy < ASSIGNMENT_SCHEME_ORDER; dy++)\n\t\t\t\t{\n\t\t\t\t\tdouble uX = p.getPosition().re()/1.0 * CELL_SIDE_COUNT;//Scaled fractional coordinate\n\t\t\t\t\tdouble uY = p.getPosition().im()/1.0 * CELL_SIDE_COUNT;//Scaled fractional coordinate\n\t\t\t\t\tint particleCellX = (int)Math.round(p.getPosition().re()/1.0 * CELL_SIDE_COUNT);\n\t\t\t\t\tint particleCellY = (int)Math.round(p.getPosition().im()/1.0 * CELL_SIDE_COUNT);\n\t\t\t\t\tint thisX = particleCellX + dx;\n\t\t\t\t\tint thisY = particleCellY + dy;\n\t\t\t\t\tif(thisX >= 0 && thisY >= 0 && thisX < CELL_SIDE_COUNT && thisY < CELL_SIDE_COUNT)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble dQdx = p.getCharge() * M.evaluateDerivative(uX - thisX) * M.evaluate(uY - thisY);\n\t\t\t\t\t\tdouble dQdy = p.getCharge() * M.evaluate(uX - thisX) * M.evaluateDerivative(uY - thisY);\n\t\t\t\t\t\tp.addToForce(-dQdx * convolutedMatrix[thisX][thisY].re(), -dQdy * convolutedMatrix[thisX][thisY].re()); //FIXME .re()?\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "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 float[] splCramer(){\n float [] solX = new float[(this.NKolEff) - 1];\n\n Matriks temp, temp1;\n float d,dx;\n temp = BuatMatriks(this.NBrsEff, this.NKolEff - 1);\n //mengisi temp dengan matriks koefisien variabel\n for (int i = 0 ; i<this.NBrsEff;i++){\n for (int j = 0; j<(this.NKolEff) -1 ; j++){\n temp.M[i][j] = this.M[i][j];\n }\n }\n \n d = temp.DeterminanOBE();\n if (d == 0){\n if (!this.isSolutionExist()) {\n System.out.println(\"SPL tidak memiliki solusi.\");\n this.Solusi = \"SPL tidak memiliki solusi.\";\n } else {\n System.out.println(\"SPL memiliki banyak solusi. Untuk melihat solusi parametrik gunakan eliminasi Gauss atau Gauss-Jordan\");\n this.Solusi = \"SPL memiliki banyak solusi. Untuk melihat solusi parametrik gunakan eliminasi Gauss atau Gauss-Jordan\";\n }\n }\n else{\n temp1 = BuatMatriks(this.NBrsEff, this.NKolEff - 1);\n for (int i = 0; i<temp1.NKolEff; i++){\n for (int j = 0; j<this.NBrsEff;j++){\n for (int k = 0; k<temp1.NKolEff;k++){\n if (k!=i){\n temp1.M[j][k] = this.M[j][k];\n }\n else{\n temp1.M[j][k] = this.M[j][this.NKolEff -1];\n }\n }\n }\n dx = temp1.DeterminanOBE();\n solX[i] = dx/d;\n int counter = i+1;\n System.out.println(\"x\" + counter +\" = \" + solX[i]);\n this.Solusi += \"x\" + counter +\" = \" + solX[i] + \"\\n\";\n }\n }\n return solX;\n }", "public void dorm2r_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);", "public void printResiduals(double t, double resid1, double resid2);", "private void prepare()\n {\n AmbulanceToLeft ambulanceToLeft = new AmbulanceToLeft();\n addObject(ambulanceToLeft,717,579);\n Car2ToLeft car2ToLeft = new Car2ToLeft();\n addObject(car2ToLeft,291,579);\n Car3 car3 = new Car3();\n addObject(car3,45,502);\n CarToLeft carToLeft = new CarToLeft();\n addObject(carToLeft,710,262);\n Car car = new Car();\n addObject(car,37,190);\n AmbulanceToLeft ambulanceToLeft2 = new AmbulanceToLeft();\n addObject(ambulanceToLeft2,161,264);\n }", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }", "private void computeSets(DLProgram datalogGlobal){\n\t\t\n\t\tDLVInvocation invocation = DLVWrapper.getInstance().createInvocation(dlvPath);\n\t\tDLVInputProgram inputProgram = new DLVInputProgramImpl();\n\n\t\ttry {\t\t\t\n\t\t\tDLProgramStorer storer = new DLProgramStorerImpl();\n\t\t\tStringBuilder target = new StringBuilder();\n\t\t\tstorer.store(datalogGlobal, target);\n \n\t\t\t//Add to DLV input program the contents of global program. \n\t\t\tString datalogGlobalText = target.toString();\n\t\t\tinputProgram.addText(datalogGlobalText);\n\t\t\t\n\t\t\t//inputProgram.addText(\"triple(c1,\\\"hasModule\\\",m1,\\\"g\\\").\" + \n\t\t\t// \" inst(c1,\\\"Context\\\",\\\"g\\\").\"+ \n\t\t\t// \"triple(c1,\\\"hasModule\\\",m2,\\\"g\\\").\" + \n\t\t\t// \"triple(X, \\\"hasModule\\\", m3, \\\"g\\\") :- inst(X,\\\"Context\\\",\\\"g\\\").\");\n\t\t\t\n\t\t\t//Set input program for current invocation.\n\t\t\tinvocation.setInputProgram(inputProgram);\n\t\t\t\n\t\t\t//Filter for \\triple and \\inst predicates. \n\t\t\t//System.out.println(inputProgram.getCompleteText());\n\t\t\tList<String> filters = new LinkedList<String>();\n\t\t\tfilters.add(\"tripled\");\n\t\t\tfilters.add(\"instd\");\n\t\t\tinvocation.setFilter(filters, true);\n\t\t\t\n\t\t\t//List of computed models, used to check at least a model is computed.\n\t\t\tfinal List<Model> models = new ArrayList<Model>();\n\t\t\t\n\t\t\t//Model handler: retrieves contexts and associations in the computed model(s).\n\t\t\tinvocation.subscribe(new ModelHandler() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void handleResult(DLVInvocation paramDLVInvocation,\n\t\t\t\t\t\tModelResult modelResult) {\n\t\t\t\t\t\n\t\t\t\t\t//System.out.print(\"{ \");\n\t\t\t\t\tModel model = (Model) modelResult;\n\t\t\t\t\tmodels.add(model);\n\n\t\t\t\t\t//model.beforeFirst();\n\t\t\t\t\t//while (model.hasMorePredicates()) {}\n\n\t\t\t\t\t//Predicate predicate = model.nextPredicate();\n\t\t\t\t\tPredicate predicate = model.getPredicate(\"instd\");\n\t\t\t\t\tif (predicate != null){\n\t\t\t\t\t\t//System.out.println(predicate.name() + \": \");\n\t\t\t\t\t\twhile (predicate.hasMoreLiterals()) {\n\n\t\t\t\t\t\t\tLiteral literal = predicate.nextLiteral();\n\t\t\t\t\t\t\tif (literal.getAttributeAt(1).toString().equals(\"\\\"Context\\\"\")) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Add context to list of inferred contexts.\n\t\t\t\t\t\t\t\tcontextsSet.add(literal.getAttributeAt(0).toString());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//System.out.print(literal);\n\t\t\t\t\t\t\t\t//System.out.println(\", \");\t\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\t\n\t\t\t\t\tpredicate = model.getPredicate(\"tripled\");\n\t\t\t\t\tif (predicate != null){\n\t\t\t\t\t\t//System.out.println(predicate.name() + \": \");\n\t\t\t\t\t\twhile (predicate.hasMoreLiterals()) {\n\n\t\t\t\t\t\t\t//Add module association for each context.\n\t\t\t\t\t\t\tLiteral literal = predicate.nextLiteral();\n\t\t\t\t\t\t\tif (literal.getAttributeAt(1).toString().equals(\"\\\"hasModule\\\"\")) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString[] association = new String[2];\n\t\t\t\t\t\t\t\tassociation[0] = literal.getAttributeAt(0).toString();\n\t\t\t\t\t\t\t\tassociation[1] = literal.getAttributeAt(2).toString();\n\t\t\t\t\t\t\t\thasModuleAssociations.add(association);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//System.out.print(literal);\n\t\t\t\t\t\t\t\t//System.out.println(\", \");\t\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\t\n\t\t\t\t\t//System.out.println(\"}\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\t\n\t\t\tinvocation.run();\n\t\t\tinvocation.waitUntilExecutionFinishes();\n\t\t\t\n\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\tglobalModelComputationTime = endTime - startTime;\n\t\t\t\n\t\t\t//System.out.println(\"Global computation time: \" + globalModelComputationTime + \" ms.\");\n\t\t\t\n\t\t\tList<DLVError> k = invocation.getErrors();\n\t\t\tif (k.size() > 0)\n\t\t\t\tSystem.err.println(k);\n\t\t\t\n\t\t\t//System.out.println(\"Number of computed models: \" + models.size());\n\t\t\tif(models.size() == 0) \n\t\t\t\tSystem.err.println(\"[!] No models for global context program.\");\n\t\t\t\n\t\t\t//for (String[] a : hasModuleAssociations) {\n\t\t\t//\tSystem.out.println(a[0] + \" -> \" + a[1]);\n\t\t\t//}\n\t\t\t\n\t\t\t//System.out.println(\"Contexts: \");\n\t\t\t//for (String s : contextsSet) {\n\t\t\t//\tSystem.out.println(s);\n\t\t\t//\tfor(String[] a : hasModuleAssociations){\n\t\t\t//\t\tif(a[0].equals(s))\n\t\t\t//\t\tSystem.out.println(\" -> \" + a[1]);\t\n\t\t\t//\t}\n\t\t\t//}\n\t\t} catch (DLVInvocationException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void reconstruct ()\n\t{\n\t\tsuper.reconstruct ();\t//calls the superclass's reconstruct method\n\t\txDimension1 = rXD1;\n\t\txDimension2 = rXD2;\n\t\txDimension3 = rXD3;\n\t\t\n\t\tyDimension1 = rYD1;\n\t\tyDimension2 = rYD2;\n\t\tyDimension3 = rYD3;\n\t\t\n\t\tturnInt = 0;\n\t}", "public void initVariables() {\n\tif (CL_Initializer.headerTemplateFile == null) {\n\n\t if (ImageHeader.imageExists(CL_Initializer.inputFile)) {\n\t\tCL_Initializer.headerTemplateFile = CL_Initializer.inputFile;\n\t }\n\t else if (imageType == imageType.BEDPOSTX || imageType == imageType.BEDPOSTX_DYAD) {\n\n\t\tString bedpostxRoot = BedpostxTractographyImage.getBedpostxInputRoot(bedpostxDir);\n\t\tString ext = BedpostxTractographyImage.getBedpostxImageExtension(bedpostxRoot);\n\t\t\n\t\tCL_Initializer.headerTemplateFile = bedpostxRoot + \"dyads1\" + ext;\n\t \n\t }\n\t \n\t}\n\n\t\n if (CL_Initializer.headerTemplateFile != null) { \n logger.info(\"Defining input physical space from \" + CL_Initializer.headerTemplateFile);\n CL_Initializer.initInputSpaceAndHeaderOptions();\n }\n else if (CL_Initializer.voxelDims[0] > 0.0) { \n CL_Initializer.initInputSpaceAndHeaderOptions();\n }\n else if (seedFile != null) {\n logger.info(\"Defining input physical space from seed file\");\n CL_Initializer.headerTemplateFile = seedFile;\n CL_Initializer.initInputSpaceAndHeaderOptions();\n }\n \n\n\n xDataDim = CL_Initializer.dataDims[0];\n yDataDim = CL_Initializer.dataDims[1];\n zDataDim = CL_Initializer.dataDims[2];\n \n xVoxelDim = CL_Initializer.voxelDims[0];\n yVoxelDim = CL_Initializer.voxelDims[1];\n zVoxelDim = CL_Initializer.voxelDims[2];\n\n if (xVoxelDim == 0.0) {\n // failed to get a definition of input space from anywhere\n throw new LoggedException(\"Definition of input space required, use -header\");\n }\n\n\n voxelToPhysicalTrans = CL_Initializer.headerTemplate.getVoxelToPhysicalTransform();\n\n\n\tif (anisThresh > 0.0) {\n\t switch(imageType) {\n\t\t\n\t case DT : case MULTITENSOR : case BEDPOSTX : case BEDPOSTX_DYAD :\n\t\t// No problem since these input formats have anisotropy information built in\n\t\tbreak;\n\t\t\n\t default: \n\t\t\n\t\tif (anisMapFile == null) {\n\t\t throw new LoggedException(\"Input data does not contain anisotropy, anisotropy map (-anisfile) must be \" +\n\t\t\t\t\t \"supplied when -anisthresh is used\");\n\t\t}\n\t }\n\t}\n\n\n // no interpolation with FACT, by definition\n if (trackingAlgorithm == TrackingAlgorithm.FACT) {\n\n if (dataInterpolation != DataInterpolation.NEAREST_NEIGHBOUR) { \n logger.warning(\"Interpolation is not compatible with FACT tracking, using Euler tracker with step size \" + stepSize + \" mm\");\n }\n\n trackingAlgorithm = TrackingAlgorithm.EULER;\n }\n\n \n ran = new MTRandom(seed);\n \n \n // get seeds\n if (seedFile != null) {\n \n VoxelROI imageROIs = new VoxelROI(seedFile, CL_Initializer.headerTemplate);\n\n allROIs = imageROIs.getAllRegions();\n \n }\n else if (seedList != null) {\n allROIs = new RegionOfInterest[] {PointListROI.readPoints(seedList, CL_Initializer.headerTemplate)};\n }\n\telse {\n\t throw new LoggedException(\"No seed points specified\");\n\t}\n \n \n }", "private void generateData(){\n generateP50boys();\n generateP50girls();\n generateP97boys();\n generateP97girls();\n }", "private void init_normal() {\n\t\t//data structure initialization\n\t\tthis.single_all_the_way = this.d > this.single_limit;\n\t\t//data structure initialization\n\n\t\tthis.relation = new int[d][d];\n\t\tthis.danced = new int[d][d];\n\t\tfor (int i = 0; i < d; ++i){\n\t\t\tfor (int j = 0; j < d; ++j) {\n\t\t\t\trelation[i][j] = -1;\n\t\t\t}\n\t\t}\n\n\n\t\tthis.connected = true;\n\t\tthis.pits = new Pit[normal_limit];\n\t\tthis.dancers = new Dancer[d];\n\t\tthis.stay_and_dance = new Point[d];\n\n\t\tfor(int i = 0; i < d; i++){\n\t\t\tthis.stay_and_dance[i] = new Point(0,0);\n\t\t} \n\n\n\t\tdouble x = this.delta;\n\t\tdouble y = this.delta;\n\t\tdouble increment = 0.5 + this.delta;\n\t\tint i = 0;\n\t\tint old_i = -1;\n\t\tint sign = 1;\n\n\t\tdouble x_min = this.delta - safeDis;\n\t\tdouble x_max = this.room_side + safeDis;\n\t\tdouble y_min = this.delta;\n\t\tdouble y_max = this.room_side + safeDis;\n\n\t\t//create the pits in a spiral fashion\n\t\twhile(old_i != i){\n\t\t\t//go right\n\t\t\told_i = i;\n\t\t\twhile(x + safeDis < x_max){\n\t\t\t\tthis.pits[i] = new Pit(i,new Point(x,y));\n\t\t\t\ti++;\n\t\t\t\tx += increment;\n\t\t\t}\n\t\t\tx = this.pits[i-1].pos.x;\n\t\t\ty += increment;\n\t\t\tx_max = x;\n\n\t\t\t//go down\n\t\t\twhile(y + safeDis < y_max){\n\t\t\t\tthis.pits[i] = new Pit(i,new Point(x,y));\n\t\t\t\ti++;\n\t\t\t\ty += increment;\n\t\t\t}\n\t\t\ty = this.pits[i-1].pos.y; \n\t\t\tx -= increment;\n\t\t\ty_max = y;\n\n\t\t\t//go left\n\t\t\twhile(x - safeDis > x_min){\n\t\t\t\tthis.pits[i] = new Pit(i,new Point(x,y));\n\t\t\t\ti++;\n\t\t\t\tx -= increment;\n\t\t\t}\n\t\t\tx = this.pits[i-1].pos.x; \n\t\t\ty -= increment;\n\t\t\tx_min = x;\n\n\t\t\t//go up\n\t\t\twhile(y - safeDis > y_min){\n\t\t\t\tthis.pits[i] = new Pit(i,new Point(x,y));\n\t\t\t\ti++;\n\t\t\t\ty -= increment;\n\n\t\t\t}\n\t\t\ty = this.pits[i-1].pos.y;\n\t\t\tx += increment;\n\t\t\ty_min = y;\n\t\t}\n\n\t\t//put players in pits\n\t\tfor(int j = 0; j < d; j++){\n\t\t\tthis.dancers[j] = new Dancer(j,j);\n\t\t\tPoint my_pos = this.pits[j].pos;\n\t\t\tPoint partner_pos = j%2 == 0? getNext(this.pits[j]).pos : getPrev(this.pits[j]).pos;\n\t\t\tthis.dancers[j].next_pos = findNearestActualPoint(my_pos,partner_pos);\n\t\t}\n\t\tthis.state = 2;\n\n\t\tif(single_all_the_way) this.boredTime = 120;\n\t}", "public void dormr2_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);", "public void mostrarVariablesForrester(){\n System.out.println(\"\");\n for (int i = 0; i < tam; i++) {\n if(matrizTipos[i][i].equals(\"P\")){\n System.out.println(\"[\"+i+\"] es un parametro\"); // parametro = constante\n }\n else if(matrizTipos[i][i].equals(\"V\")){\n System.out.println(\"[\"+i+\"] es un auxiliar\"); // auxiliar = constante * auxiliar (?) ó constante +/- auxiliar\n }\n else if(matrizTipos[i][i].equals(\"R\")){\n System.out.println(\"[\"+i+\"] es un flujo\"); // flujo = constante * auxiliar * nivel\n }\n else if(matrizTipos[i][i].equals(\"X\")){\n System.out.println(\"[\"+i+\"] es un nivel\");// xi(t + Δt) = xi(t) + Δt{rj - rk} rj = entrada y rk = salida, \"el - es por la salida\" (creo) \n }\n }\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\n }", "public void rewriteMRCKR(){\n\t\t\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\t\n\t\t//Rewriting for global context.\n\t\tMRGlobal2DatalogRewriter globalrewriter = new MRGlobal2DatalogRewriter();\n\t\tdatalogGlobal = globalrewriter.rewrite(inputCKR.getGlobalOntology());\n\t\t//System.out.println(\"Rewriting program for global context complete.\");\n\t\t\t\t\n\t\t//Get set of contexts and associations to modules from globalrewriter\n\t\tcontextsSet = globalrewriter.getContextsSet();\n\t\thasModuleAssociations = globalrewriter.getHasModuleAssociations();\n\t\t//System.out.println(\"Set of contexts and modules associations computed.\");\n\t\t\n\t\t//Computation of local contexts knowledge bases.\n\t\tcomputeLocalKB();\n\t\t\t\t\n\t\t//Rewriting for local contexts knowledge bases.\n\t\tMRLocal2DatalogRewriter localrewriter = new MRLocal2DatalogRewriter();\n\t\t\t\t\n\t\tdatalogLocal = new LinkedList<DLProgram>();\n\t\tfor (String c : contextsSet) {\n\t\t\t//System.out.println(\"Rewriting program for \" + c.replaceAll(\"\\\"\", \"\"));\n\t\t\tlocalrewriter.setContextID(c.replaceAll(\"\\\"\", \"\"));\n\t\t\t\n\t\t\tdatalogLocal.add(localrewriter.rewrite(contextsOntologies.get(c)));\n\t\t}\n\t\t\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\trewritingTime = endTime - startTime;\n \n\t\t//System.out.println(\"Rewriting completed in \" + rewritingTime + \" ms.\");\n\t\t//System.out.println(datalogGlobal.getStatements().size());\n\t\t\n\t\t//Compute CKR Program.\n\t\tdatalogCKR = new DLProgram();\n\t \n\t\tdatalogCKR.addAll(datalogGlobal.getStatements());\n\t\t\n\t\tfor (DLProgram dlProgram : datalogLocal) {\n\t\t\tdatalogCKR.addAll(dlProgram.getStatements());\t\n\t\t}\n\t\t\n\t\t//Add local inference rules.\n\t\tdatalogCKR.addAll(MRDeductionRuleset.getPrl());\n\t\tdatalogCKR.addAll(MRDeductionRuleset.getPeval());\n\t\t\n\t\t//Add local propagation rules.\n\t\tdatalogCKR.addAll(MRDeductionRuleset.getPd());\t\t\n\t}", "private static void initResources() {\n\t\tString[] res = new String[4];\r\n\t\tres[0] = \"res/entity/spaceshipv1.png\";\r\n\t\tres[1] = \"res/entity/prob.png\";\r\n\t\tres[2] = \"res/dot.png\";\r\n\t\tres[3] = \"res/entity/spaceshipv2.png\";\r\n\t\tSResLoader.addSpriteArray(res);\r\n\t}", "public void initialization() {\n iterations_ = 1;\n\n swarm_ = new SolutionSet(swarmSize_);\n best_ = new Solution[swarmSize_];\n\n dominance_ = new DominanceComparator();\n crowdingDistanceComparator_ = new CrowdingDistanceComparator();\n distance_ = new Distance();\n\n speed_ = new double[swarmSize_][problem_.getNumberOfVariables()];\n\n deltaMax_ = new double[problem_.getNumberOfVariables()];\n deltaMin_ = new double[problem_.getNumberOfVariables()];\n for (int i = 0; i < problem_.getNumberOfVariables(); i++) {\n deltaMax_[i] = (problem_.getUpperLimit(i) -\n problem_.getLowerLimit(i)) / 2.0;\n deltaMin_[i] = -deltaMax_[i];\n }\n\n for (int i = 0; i < swarmSize_; i++) {\n for (int j = 0; j < problem_.getNumberOfVariables(); j++) {\n speed_[i][j] = 0.0;\n }\n }\n }", "public static int [][][] buildMat3d() {\n //defines array to be 3 X 7X 9 dimensioned\n int mat3d [][][]= new int [3][7][9];\n //for loop which runs 3 times\n for(int s=0; s<3; s++) {\n //for loop which runs a different amount of times\n for(int j=0; j<(3+2*s); j++) {\n //for loop which does the same\n for(int c=0; c<(s+j+1); c++) {\n //defines values based on raondom generation\n mat3d[s][j][c]= (int)(Math.random()*99);\n \n }\n }\n }\n //returns the resulting array\n return mat3d;\n }", "private static double[] getSurfaces(final ImageStack aInputStack, final int[] aLables, final double[] aResol)\r\n\t{\r\n\t\tfinal double[] surfaces = GeometricMeasures3D.surfaceAreaCrofton(aInputStack, aLables, aResol, surfaceAreaDirs);\r\n\t\treturn surfaces;\r\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}", "void EvolutionWithElitism(){\n\t\t \tint i, j, l, k;\n\t\t\t//individual[] temp;\n\t\t\tbyte _flippc=0,_flippm=0;\n//\t\t\tString _temp1=\"\", _temp2=\"\";\n\t\t\tint[] _cp;\n\t\t\tnode[] _nd,_nm;\n\t\t\t// Khoi tao quan the dau tien \n\t\t\tRampedInit(6, 0.5);\n\t\t\t//RampedInitOffLine(6, 0.5,15);\n\t\t\t\n//\t\t\tconstructiveRate = new double[NUMGEN];\n//\t\t\tsemanticDistance = new double[NUMGEN];\n\t\t\t\n\t\t\tgen = 0;\n\t\t\twhile(gen < generation) {\n\t\t\t\t\n\t\t\t\tComputeFitness();\n\t\t\t\t\n//\t\t\t\tint g_ncross = 0;\n//\t\t\t\tdouble g_sd = 0;\n//\t\t\t\tPrintToFile();\n\t//----------------------\n//\t\t\t\tFileInputStream instream = null;\n//\t\t\t\tPrintStream outstream = null;\n//\t\t\t\tPrintStream console = System.out;\n//\t\t\t\ttry {\n//\t\t\t\t\toutstream = new PrintStream(new FileOutputStream(\"c:/result/\" + \"detail_\"+ gen + \".txt\"));\n//\t\t\t\t\tSystem.setOut(outstream);\n//\t\t\t\t} catch(Exception e) {\n//\t\t\t\t\tSystem.err.println(\"Error Occurred.\");\n//\t\t\t\t}\n//\t\t\t\tfor(i = 0; i < poplen; i++) {\n//\t\t\t\t\tSystem.out.printf(\"%3.5f \",oldpop[i].fitness);\n//\t\t\t\t\tif((i+1) % 10 == 0) {\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(oldpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// copy anh tot nhat sang the he sau\t \t\n\t\t\t\tnewpop[0].CopyIndividual(bestcurrent[gen], TRUE);\n\t\t\t\t// dot bien anh thu 2\n\t\t\t \n\t\t\t\tl=1;\t\n\t\t\t\ti = TourSelect(TOURSIZE);\n//\t\t\t\t\n\t\t\t\t\n\t\t\t newpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\tindividual[] m_individual0=new individual[1];\n\t\t\t\tint[] _mt0=new int[1];\n\t\t\t\t_nm=new node[1];\n\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual0, 15, TRUE,_mt0,_nm);\n\t\t\t\tnewpop[l]=new individual();\n\t\t\t\tnewpop[l].CopyIndividual(m_individual0[0], TRUE);\t\t\t\n\t\t\t\tnewpop[l].evaluated=FALSE;\t\t\n//\t\t\t\t\n//\t\t\t\tm_individual0=null;\n\t\t\t\t\n\t//------------------------\t\t\n\t\t\t\tl = 2;\t\t\t\n\t\t\t\twhile(l < poplen) {\n\t\t\t\t//\tSystem.out.println(\"Generation \"+ String.valueOf(gen)+\":\");\n\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\n\t\t\t\t\ti = TourSelect(TOURSIZE);\n\t\t\t\t\tj = TourSelect(TOURSIZE);\n\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t\t\n\t\t\t\t _flippc=Flip(pcross);\n//\t\t\t\t System.out.printf(\"pcross:%d\", _flippc);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippc == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] i_temp=new individual[2];\n\t\t\t\t\t\t_cp=new int[2];\n\t\t\t\t\t\t_nd=new node[2];\n\t\t\t\t//\t\n\t\t\t\t//\t\tif(SubTreeSwapWithTTest(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(SubTreeSwap(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(i_temp[0],TRUE);\n\t\t\t\t\t\t\tnewpop[l+1].CopyIndividual(i_temp[1],TRUE);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tncross++;\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// semantic distance\n//\t\t\t\t\t\t\tg_sd += newpop[l].getSemanticDistance(oldpop[i]);\n//\t\t\t\t\t\t\tg_sd += newpop[l+1].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tg_sd += oldpop[i].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\n\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\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\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\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// mutation test\n\t\t\t\t\t_flippm=Flip(pmutate);\n//\t\t\t\t\tSystem.out.printf(\"pmutation:%d\", _flippm);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippm == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] m_individual=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l]=new individual();\n\t\t\t\t\t\tnewpop[l].CopyIndividual(m_individual[0], TRUE);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+l+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual=null;\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_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(Flip(pmutate) == 1) {\n\t\t\t\t\t\tindividual[] m_individual1=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l + 1], m_individual1, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l+1]=new individual();\n\t\t\t\t\t\tnewpop[l+1].CopyIndividual(m_individual1[0], TRUE);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+(l+1)+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual1=null;\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_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\tl += 2;\n\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(newpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n//\t\t\t\toutstream.close();\n//\t\t\t\tSystem.setOut(console);\n\t\t\t\t// Thống kê tỷ lệ tTest\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t//\t\t\tsemanticDistance[gen] = g_sd / (2.0 * g_ncross);\n//\t\t\t\tsemanticDistance[gen] = g_sd /g_ncross;\n\t\t\t\t\n\t\t\t\tgen++;\n\t\t\t\tfor(k = 0; k < poplen; k++)\n\t\t\t\t{\n\t\t\t\t\toldpop[k]=null;\n\t\t\t\t\toldpop[k]=new individual();\n\t\t\t\t\toldpop[k].CopyIndividual(newpop[k], TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void inicializarVariablesControlRonda() {\n\t\ttieneAs = new int[4];\n\t\tfor(int i=0;i<tieneAs.length;i++) {\n\t\t\ttieneAs[i]=0;\n\t\t}\n\t\tidJugadores = new String[3];\n\t\tvalorManos = new int[4];\n\t\t\n\t\tmazo = new Baraja();\n\t\tCarta carta;\n\t\tganador = new ArrayList<String>();\n\t\tapuestasJugadores = new int[3];\n\t\tmanoJugador1 = new ArrayList<Carta>();\n\t\tmanoJugador2 = new ArrayList<Carta>();\n\t\tmanoJugador3 = new ArrayList<Carta>();\n\t\tmanoDealer = new ArrayList<Carta>();\n\t\tparejaNombreGanancia = new ArrayList<Pair<String,Integer>>(); \n\t\t\n\t\t// gestiona las tres manos en un solo objeto para facilitar el manejo del hilo\n\t\tmanosJugadores = new ArrayList<ArrayList<Carta>>(4);\n\t\tmanosJugadores.add(manoJugador1);\n\t\tmanosJugadores.add(manoJugador2);\n\t\tmanosJugadores.add(manoJugador3);\n\t\tmanosJugadores.add(manoDealer);\n\t\t// reparto inicial jugadores 1 y 2\n\t\tfor (int i = 1; i <= 2; i++) {\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador1.add(carta);\n\t\t\tcalcularValorMano(carta, 0);\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador2.add(carta);\n\t\t\tcalcularValorMano(carta, 1);\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador3.add(carta);\n\t\t\tcalcularValorMano(carta, 2);\n\t\t}\n\t\t// Carta inicial Dealer\n\t\tcarta = mazo.getCarta();\n\t\tmanoDealer.add(carta);\n\t\tcalcularValorMano(carta, 3);\n\n\t\t\n\t}", "public static void reci(){\n\n GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(generatorBase, 1),\"XXX\", \"XXX\", \"XXX\", 'X', ItemHandler.ironHard));\n GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(generatorCombust, 1), \"XYX\", \"DFD\", \"XXX\", 'X', generatorBase, 'Y', \"gemDiamond\", 'D', \"dustRedstone\", 'F', Blocks.furnace));\n GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(tank, 1), \"XXX\", \"XYX\", \"XXX\", 'X', ItemHandler.ironHard, 'Y', \"blockGlass\"));\n GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(charcoalBlock, 1), \"CCC\", \"CCC\", \"CCC\", 'C', new ItemStack(Items.coal, 1, 1)));\n GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.coal, 9, 1), new ItemStack(charcoalBlock)));\n }", "public void diagrafiSintagis() {\n\t\t// Elegxw an yparxoun syntages\n\t\tif(numOfPrescription != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA SYNTAGWN\");\n\t\t\t// Emfanizw oles tis syntages \n\t\t\tfor(int j = 0; j < numOfPrescription; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA SYNTAGHS: \");\n\t\t\t\tSystem.out.println();\n\t \t \tprescription[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttmp_1 = sir.readPositiveInt(\"DWSTE TON ARITHMO THS SYNTAGHS POU THELETAI NA DIAGRAFEI: \");\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos egkyrotitas tou ari8mou pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfPrescription)\n\t\t\t{\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"KSANAEISAGETAI ARITHMO SYNTAGHS: \");\n\t\t\t}\n\t\t\t// Metakinw tis epomenes syntages mia 8esi pio aristera\n\t\t\tfor(int k = tmp_1; k < numOfPrescription - 1; k++)\n\t\t\t{\n\t\t\t\tprescription[k] = prescription[k+1]; // Metakinw thn syntagh sti 8esi k+1 pio aristera\n\t\t\t}\n\t\t\tnumOfPrescription--; // Meiwse ton ari8mo twn syntagwn\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.print(\"\\nDEN YPARXOUN DIATHESIMES SYNTAGES PROS DIAGRAFH!\\n\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void fillTreasureDeck() {\n\t\t// create 20 treasure cards\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tthis.addCard(new Card(\"The Earth Stone\", CardType.TREASURE));\n\t\t\tthis.addCard(new Card(\"The Ocean's Chalice\", CardType.TREASURE));\n\t\t\tthis.addCard(new Card(\"The Statue of the Wind\", CardType.TREASURE));\n\t\t\tthis.addCard(new Card(\"The Crystal of Fire\", CardType.TREASURE));\n\t\t}\n\n\t\t// create 3 helicopter lift cards\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tthis.addCard(new Card(\"Helicopter Lift\", CardType.HELI));\n\t\t}\n\n\t\t// create 2 sandbag cards\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tthis.addCard(new Card(\"Sandbag\", CardType.SANDBAG));\n\t\t}\n\n\t\t// create 3 water rise cards\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tthis.addCard(new Card(\"Water Rise\", CardType.WATER_RISE));\n\t\t}\n\t}", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\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}", "private void loadRecipes() {\n\t\tGameRegistry.addRecipe(new ItemStack(RamsesMod.ramsesHelmet),\n\t\t\t\t\"XXX\",\n\t\t\t\t\"X X\",\n\t\t\t\t\" \", 'X', Blocks.lapis_ore);\n\n\t\tGameRegistry.addRecipe(new ItemStack(RamsesMod.ramsesChestplate),\n\t\t\t\t\"X X\",\n\t\t\t\t\"XXX\",\n\t\t\t\t\"XXX\", 'X', Blocks.lapis_ore);\n\n\t\tGameRegistry.addRecipe(new ItemStack(RamsesMod.ramsesLeggings),\n\t\t\t\t\"XXX\",\n\t\t\t\t\"X X\",\n\t\t\t\t\"X X\", 'X', Blocks.lapis_ore);\n\n\t\tGameRegistry.addRecipe(new ItemStack(RamsesMod.ramsesBoots),\n\t\t\t\t\" \",\n\t\t\t\t\"X X\",\n\t\t\t\t\"X X\", 'X', Blocks.lapis_ore);\n\t}", "double[] ComputeNew(node st){\n\tnode p;\n\tdouble[] l;\n\tdouble[] r;\n\tdouble[] result=new double[NUMFITCASE];\n\t\n\tfor(int j=0;j<NUMVAR;j++){\t\t\n\t\t\n\t\tif(st.name.equals(\"X\"+String.valueOf(j+1))){\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]=fitcase[i].x[j];\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\t\n\tif(st.name.equals(\"C\")){\n\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t{\n\t\t\tresult[i]=st.value;\n\t\t}\n\t\treturn result;\n\t}\n\telse\n\t\tif(st.name.equals(\"ERC\")) {\n\t\t\tif(st.value==VOIDVALUE) //if it has not been initialized then initialized and return the value\n\t\t\t st.value=GenerateER(st.name); \n\t\t//\t st.att[i]=st.value;\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]=st.value; \n\t\t\t}\n\t\t\treturn result;\t\t\t \n\t\t}\t\n\telse // st.name=\"EXP\"\n\t{\n\t\tp = st.children;\n\t\tif(st.name.equals(\"add\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tr = ComputeNew(p.sibling);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]=PVAL(l[i] + r[i]);\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if(st.name.equals(\"sub\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tr = ComputeNew(p.sibling);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]=PVAL(l[i] - r[i]);\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if(st.name.equals(\"mul\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tr = ComputeNew(p.sibling);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]=PVAL(l[i] * r[i]);\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if(st.name.equals(\"div\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tr = ComputeNew(p.sibling);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tif(r[i] == 0) \n\t\t\t\t\t{result[i]= 1;}\n\t\t\t\telse {result[i]= PVAL(l[i]/r[i]);}\t\t\t\t\n\t\t\t}\n\t\t\treturn result;\n\t\t\n\t\t} else if(st.name.equals(\"sin\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= Math.sin(l[i]);\t\t\t\t\n\t\t\t}\n\t\t\treturn result;\n\t\t\t\n\t\t\t\n\t\t} else if(st.name.equals(\"cos\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= Math.cos(l[i]);\t\t\t\t\n\t\t\t}\n\t\t\treturn result;\n\t\t\t\n\t\t} else if(st.name.equals(\"sqrt\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= Math.sqrt(Math.abs(l[i]));\t\t\t\n\t\t\t}\n\t\t\treturn result;\t\t\t\n\t\t} else if(st.name.equals(\"sqr\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= PVAL(l[i]*l[i]);\t\t\t\n\t\t\t}\n\t\t\treturn result;\n\t\t\t\n\t\t} else if(st.name.equals(\"ep\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= PVAL(Math.exp(l[i]));\t\n\t\t\t}\n\t\t\treturn result;\t\t\t\n\t\t} else if(st.name.equals(\"divE\")) {\n\t\t\tl = ComputeNew(p);\n\t\t\tr = ComputeNew(p.sibling);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= PVAL(l[i]/Math.sqrt(1+ r[i]*r[i]));\t\t\t\t\n\t\t\t}\n\t\t\treturn result;\t\t\t\n\t\t\t} \n\t\telse {\n\t\t\tl = ComputeNew(p);\n\t\t\tfor(int i=0; i<NUMFITCASE; i++)\n\t\t\t{\n\t\t\t\tresult[i]= PVAL(Math.exp(l[i]));\n\t\t\t\tif(l[i] == 0) result[i]= 0;\n\t\t\t\telse result[i]= PVAL(Math.log(Math.abs(l[i])));// fido fabs\n\t\t\t}\n\t\t\treturn result;\t\n\t\t\t\n\t\t}\n\t}\n}", "private void declareArrays() {\n int iNumTimesteps = m_oLegend.getNumberOfTimesteps(),\n i, j, k;\n \n //Create arrays to hold raw data.\n mp_fLiveTreeVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fSnagVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses]; \n mp_iLiveTreeCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_iSnagCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fLiveTreeDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fSnagDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fTallestLiveTrees = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n mp_fTallestSnags = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n \n //Initialize all values with 0s\n for (i = 0; i < mp_fTallestLiveTrees.length; i++) {\n for (j = 0; j < mp_fTallestLiveTrees[i].length; j++) {\n for (k = 0; k < mp_fTallestLiveTrees[i][j].length; k++) {\n mp_fTallestLiveTrees[i][j][k] = 0;\n mp_fTallestSnags[i][j][k] = 0;\n }\n }\n }\n \n for (i = 0; i < m_iNumSpecies; i++) {\n for (j = 0; j <= iNumTimesteps; j++) {\n mp_fLiveTreeDBHTotal[i][j] = 0;\n mp_fSnagDBHTotal[i][j] = 0;\n for (k = 0; k < m_iNumSizeClasses; k++) {\n mp_iLiveTreeCounts[i][j][k] = 0;\n mp_iSnagCounts[i][j][k] = 0;\n mp_fLiveTreeVolumeTotals[i][j][k] = 0;\n mp_fSnagVolumeTotals[i][j][k] = 0;\n }\n }\n }\n }", "void recompute () {\n current_part.t_Cl = current_part.t_Cd = current_part.t_Cm = null;\n computeFlowAndRegenPlot();\n }", "public void rewriteDLR(){\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\t\n\t\t//Rewriting for global context.\n\t\tDLRGlobal2DatalogRewriter globalrewriter = new DLRGlobal2DatalogRewriter();\n\t\tdatalogGlobal = globalrewriter.rewrite(inputCKR.getGlobalOntology());\n\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\trewritingTime = endTime - startTime;\n\t\t\n\t\t//Compute DKB Program.\n\t\tdatalogCKR = new DLProgram();\n\t\n\t\tdatalogCKR.addAll(datalogGlobal.getStatements());\n\n\t\t//Add local propagation rules.\n\t\tdatalogCKR.addAll(DLRDeductionRuleset.getPd());\n\t}", "public pr3s1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1280, 720, 1); \n prepare();\n }", "public void prepare(){\n\n\t\t/* For every cell in the cell space */\n\t\tfor (int i=0;i<GlobalAttributes.xCells;i++){\n\t\t\tfor(int j=0;j<GlobalAttributes.yCells;j++){\n\n\t\t\t\t/* Set the cell state to the starting configuration */\n\t\t\t\tgrid[i][j].topSubcellValue=source[i][j].topSubcellValue;\n\t\t\t\tgrid[i][j].bottomSubcellValue=source[i][j].bottomSubcellValue;\n\t\t\t\tgrid[i][j].leftSubcellValue=source[i][j].leftSubcellValue;\n\t\t\t\tgrid[i][j].rightSubcellValue=source[i][j].rightSubcellValue;\n\n\t\t\t\t/* Set the \"current\" difference matrix value to\n\t\t\t\t * the value in the fixed initial matrix */\n\t\t\t\tdifferent[i][j]=fixeddifferent[i][j];\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t/* Reset the differences counter to the fixed version */\n\t\tdifferences=fixeddifferences;\n\t}", "private void applyFlow(List<Edge> edges, int capacity) {\n\t\t\n\t\tfor (Edge edge : edges) {\t\n\t\t\tint startVertexIndex = edge.getStartVertex().getIndex();\n\t\t\tint endVertexIndex = edge.getEndVertex().getIndex();\n\t\t\t//ustawienie przeplywu we wlasciwym grafie\n\t\t\tEdge graphEdge = graph.findEdge(startVertexIndex, endVertexIndex, EdgeType.DIRECTED);\n\t\t\tint graphEdgeFlow = graphEdge.getFlow();\n\t\t\tint resultFlow = graphEdgeFlow+capacity;\n\t\t\tgraphEdge.setFlow(resultFlow);\n\t\t\t\n\t\t\tEdge residualEdge = residualNetwork.findEdge(startVertexIndex, endVertexIndex, EdgeType.DIRECTED);\n\t\t\tif(residualEdge!=null) {\n\t\t\t\tint residualEdgeCapacity = residualEdge.getCapacity();\n\t\t\t\tresidualEdge.setCapacity(residualEdgeCapacity-capacity); //odjecie\n\t\t\t\tif (residualEdge.getCapacity() == 0){\n\t\t\t\t\tresidualNetwork.removeEdge(residualEdge);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresidualEdge = residualNetwork.findEdge(endVertexIndex, startVertexIndex, EdgeType.DIRECTED);\n\t\t\tif(residualEdge!=null){\n\t\t\t\tint residualEdgeCapacity = residualEdge.getCapacity();\n\t\t\t\tresidualEdge.setCapacity(residualEdgeCapacity+capacity); //dodanie \n\t\t\t} else {\n\t\t\t\tEdge tmpEdge= new SwingEdge(); //kanal przeciwyny\n\t\t\t\ttmpEdge.getDataModel().setStartingVertex(edge.getEndVertex());\n\t\t\t\ttmpEdge.getDataModel().setEndingVertex(edge.getStartVertex());\n\t\t\t\ttmpEdge.setCapacity(capacity);\n\t\t\t\tresidualNetwork.addEdge(tmpEdge);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void initializeSubScenes(){\n paycheckController.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c00Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c10Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c20Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c01Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c11Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c21Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c02Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c12Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c22Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c03Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c13Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c23Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n\n c00Controller.setPositionInGrid(1, 1);\n c10Controller.setPositionInGrid(2, 1);\n c20Controller.setPositionInGrid(3, 1);\n c01Controller.setPositionInGrid(1, 2);\n c11Controller.setPositionInGrid(2, 2);\n c21Controller.setPositionInGrid(3, 2);\n c02Controller.setPositionInGrid(1, 3);\n c12Controller.setPositionInGrid(2, 3);\n c22Controller.setPositionInGrid(3, 3);\n c03Controller.setPositionInGrid(1, 4);\n c13Controller.setPositionInGrid(2, 4);\n c23Controller.setPositionInGrid(3, 4);\n }", "private void fillArrays(){\n\t\tdouble tIncrement = (endT-startT) / (double)plotPoints;\n\t\t\n\t\t//burn in\n\t\tfor(int i=0; i<burnIn; i++){\n\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\tising.update();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k=0; k<plotPoints+1 && !simulationThread.isInterrupted(); k++){\n\t\t\tising.reset();\n\t\t\tising.setTemperature(startT + k*tIncrement);\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<sweeps; i++){\n\t\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\t\tising.update();\n\t\t\t\t}\n\t\t\t\tising.updateSums();\n\t\t\t}\n\t\t\t\n\t\t\t//add values to arrays\n\t\t\ttemp[k] = ising.getTemperature();\n\t\t\t\n\t\t\t\n\t\t\tif(this.plotM){\n\t\t\t\tabsM[k] = ising.averageAbsM();\n\t\t\t\tsusceptibility[k][0] = ising.susceptibility();\n\t\t\t\tsusceptibility[k][1] = ising.errorSusceptibility();\n\t\t\t}\n\t\t\tif(this.plotE){\n\t\t\t\tE[k] = ising.averageE();\n\t\t\t\theatCapacity[k][0] = ising.heatCapacity();\n\t\t\t\theatCapacity[k][1] = ising.errorHearCapacity();\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t}", "public static void main(String[] args) {\n // write your code here\n initialize();\n\n\n Sort(profile.getProfile());\n Integer[][][] mas = new Integer[11][11][1];\n\n R.add(Q.pollFirst());\n\n for (Integer[] e : Q) {\n if (DiskCover(e, R, Rant)) {\n R.add(e);\n // Rtmp.add(Q.pollFirst());\n }\n }\n\n FindMaxAngle(R, 0);\n\n Rg = R;\n //Rtmp-R add Q\n list_r.add(R);\n int j = 0;\n boolean flag = false;\n while (!Q.isEmpty()) {\n\n\n list_r.add(FindMaxPolygonCover(Rg));\n\n }\n\n MakePolygon(list_r);\n\n boolean work = true;\n\n do {\n R.clear();\n Gr.getEdge().clear();\n // algorithmConnectivity.setMarketVertexFirst();\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n\n AlgorithmConnectivity algorithmConnectivity = new AlgorithmConnectivity();\n algorithmConnectivity.initializated(Gr.getVertex().size());\n algorithmConnectivity.setMarketVertexFirst();\n algorithmConnectivity.setMarketVertexSecond(i);\n while (algorithmConnectivity.findSecond() != 100) {\n //int a= iterator.next();\n int index = algorithmConnectivity.findSecond();\n algorithmConnectivity.setMarketVertexThird(index);\n algorithmConnectivity = MakeConnection(index, algorithmConnectivity);\n }\n R.add(algorithmConnectivity.getMarket());\n }\n if (!checkConnectionGraf(R)) {\n //MakeConnection(Gr);\n ArrayList<Integer[]> result = new ArrayList<Integer[]>();\n ArrayList<Integer> ver = new ArrayList<Integer>();\n ArrayList<ArrayList<Integer>> v = new ArrayList<ArrayList<Integer>>();\n for (Integer[] p : R) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n ver.clear();\n for (int i = 0; i < p.length; i++) {\n if (p[i] != 1) {\n ver.add(Gr.getVertex().get(i));\n }\n }\n if (ver.size() != 1) {\n // result.add(AddNewRoute(ver));\n // v.add(ver);\n result.addAll(AddNewRoute(ver));\n }\n }\n int minumum = 1000;\n Integer[] place = new Integer[3];\n for (int i = 0; i < result.size(); i++) {\n Integer[] ma = result.get(i);\n if (ma[2] == null) {\n System.out.print(\"\");\n }\n if ((minumum > ma[2]) && (ma[2]) != 0) {\n minumum = ma[2];\n place = ma;\n }\n }\n if (minumum == 1000) {\n for (Integer[] p : R) {\n ver.clear();\n for (int i = 0; i < p.length - 1; i++) {\n if (p[i] == 1) {\n ver.add(Gr.getVertex().get(i));\n }\n }\n result.addAll(AddNewRoute(ver));\n // result.add(AddNewRoute(ver));\n for (int i = 0; i < result.size(); i++) {\n Integer[] ma = result.get(i);\n if (ma[2] == null) {\n System.out.print(\"\");\n }\n if ((minumum > ma[2]) && (ma[2]) != 0) {\n minumum = ma[2];\n place = ma;\n }\n }\n AddNewVertex(place);\n }\n } else {\n AddNewVertex(place);\n }\n } else {\n work = false;\n }\n\n } while (work);\n\n MobileProfile prof = new MobileProfile();\n prof.initialization(Gr.getVertex().size());\n int sum = 0;\n int[][][] massive = profile.getProfile();\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n // sum=sum+massive;\n }\n\n\n zcd = new ZCD();\n\n zcd.setGraphR(Gr);\n\n Iterator<Edges> it = Gr.getEdgeses().iterator();\n boolean fla = false;\n while (it.hasNext()) {\n Edges d = it.next();\n LinkedList<Integer[]> graph_edges = g.getSort_index();\n\n for (int i = 0; i < graph_edges.size(); i++) {\n Integer[] mass = graph_edges.get(i);\n if (checkLine(g.getCoordinate().get(mass[0]), g.getCoordinate().get(mass[1]), Gr.getCoordinate().get(d.getX()), Gr.getCoordinate().get(d.getY()))) {\n if (!fla) {\n Integer[] wr = new Integer[3];\n wr[0] = d.getX();\n wr[1] = d.getY();\n wr[2] = mass[2];\n fla = true;\n zcd.addWrEdges(wr);\n }\n }\n }\n if (!fla) {\n\n Integer[] wr = new Integer[3];\n wr[0] = d.getX();\n wr[1] = d.getY();\n wr[2] = 2;\n\n zcd.addWrEdges(wr);\n\n }\n fla = false;\n }\n\n Edges e = null;\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n int sumwr = 0;\n HashSet<Edges> item = Gr.getEdgeses();\n Iterator<Edges> iterator = item.iterator();\n for (int k = 0; k < zcd.getWrEdges().size(); k++) {\n\n e = iterator.next();\n if (e.checkEdge(i)) {\n Integer[] m = zcd.getWrEdges().get(k);\n sumwr = sumwr + m[2];\n\n }\n\n }\n wr.add(sumwr);\n\n }\n\n int max = 0;\n int count = 0;\n for (int i = 0; i < wr.size(); i++) {\n if (max < wr.get(i)) {\n max = wr.get(i);\n count = i;\n }\n }\n Integer[] a = new Integer[2];\n a[0] = count;\n a[1] = max;\n zcd.setRoot_vertex(a);\n\n\n int number_vertex = 5;\n //ZTC ztc = new ZTC();\n neig = new int[Gr.getVertex().size()][Gr.getVertex().size()];\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n HashSet<Edges> item = Gr.getEdgeses();\n Iterator<Edges> iterator = item.iterator();\n while (iterator.hasNext()) {\n e = iterator.next();\n if (e.checkEdge(i)) {\n\n neig[i][e.getY()] = 1;\n }\n }\n }\n ztc.setNeigboor(neig);\n ztc.addTVertex(a[0]);\n Integer[] zero = new Integer[3];\n zero[0] = a[0];\n zero[1] = 0;\n zero[2] = 0;\n verLmtest.add(zero);\n vertex_be = new boolean[Gr.getVertex().size()];\n int root_number = 5;\n while (ztc.getTvertex().size() != Gr.getVertex().size()) {\n\n LinkedList<Edges> q = new LinkedList<Edges>();\n\n\n count_tree++;\n\n\n LinkedList<Integer> vertext_t = new LinkedList<Integer>(ztc.getTvertex());\n while (vertext_t.size() != 0) {\n // for(int i=0; i<count_tree;i++){\n\n number_vertex = vertext_t.pollFirst();\n weight_edges.clear();\n if (!vertex_be[number_vertex]) {\n vertex_be[number_vertex] = true;\n } else {\n continue;\n }\n\n // if(i<vertext_t.size())\n\n\n HashSet<Edges> item = Gr.getEdgeses();\n Iterator<Edges> iterator = item.iterator();\n // while (iterator.hasNext()) {\n for (int k = 0; k < item.size(); k++) {\n e = iterator.next();\n\n if (e.checkEdge(number_vertex)) {\n\n weight_edges.add(zcd.getWrEdges().get(k));\n q.add(e);\n }\n\n if (q.size() > 1)\n q = sort(weight_edges, q);\n\n\n while (!q.isEmpty()) {\n e = q.pollFirst();\n Integer[] lm = new Integer[3];\n\n\n lm[0] = e.getY();\n lm[1] = 1;\n lm[2] = 0;\n boolean add_flag = true;\n for (int i = 0; i < verLmtest.size(); i++) {\n Integer[] mess = verLmtest.get(i);\n if (e.getY() == mess[0]) {\n add_flag = false;\n }\n }\n if (add_flag) {\n for (int i = 0; i < verLmtest.size(); i++) {\n Integer[] mess = verLmtest.get(i);\n if (e.getX() == mess[0]) {\n mess[2] = mess[2] + 1;\n /* if (e.getX() == root_number) {\n mess[1] = 1;\n } else {\n mess[1] = mess[1] + 1;\n lm[1]=mess[1];\n\n }*/\n verLmtest.set(i, mess);\n break;\n }\n\n }\n for (int i = 0; i < verLmtest.size(); i++) {\n Integer[] mess = verLmtest.get(i);\n if (e.getX() == mess[0]) {\n lm[1] = mess[1] + 1;\n }\n\n }\n\n verLmtest.add(lm);\n } else {\n continue;\n }\n // }\n if (ztc.getTvertex().size() == 1) {\n edgesesTestHash.add(e);\n int x = e.getX();\n int y = e.getY();\n Edges e1 = new Edges(y, x);\n edgesesTestHash.add(e1);\n\n ztc.addEdges(e);\n ztc.addEdges(e1);\n\n ztc.addTVertex(lm[0]);\n // q.removeFirst();\n\n\n } else {\n // edgesTest.add(e);\n int x = e.getX();\n int y = e.getY();\n Edges e1 = new Edges(y, x);\n // disable.add(e);\n // disable.add(e1);\n\n edgesesTestHash.add(e1);\n edgesesTestHash.add(e);\n\n int[][] ad = getNeighboor();\n\n\n if (checkLegal(e, ad)) {\n ztc.addEdges(e);\n ztc.addEdges(e1);\n\n ztc.addTVertex(lm[0]);\n\n // if(q.size()!=0)\n // q.removeFirst();\n } else {\n // q.removeFirst();\n\n Iterator<Edges> edgesIterator = edgesesTestHash.iterator();\n while (edgesIterator.hasNext()) {\n Edges eo = edgesIterator.next();\n if ((eo.getY() == e.getY()) && (eo.getX() == e.getX())) {\n edgesIterator.remove();\n }\n if ((eo.getY() == e1.getY()) && (eo.getX() == e1.getX())) {\n edgesIterator.remove();\n }\n }\n\n verLmtest.removeLast();\n }\n\n\n }\n\n\n }\n\n\n }\n }\n }\n\n ztc.setEdgesesTree(edgesesTestHash);\n ztc.setGr(Gr);\n ConvertDataToJs convertDataToJs=new ConvertDataToJs();\n try {\n convertDataToJs.save(ztc);\n } catch (FileNotFoundException e1) {\n e1.printStackTrace();\n }\n\n System.out.print(\"\");\n\n }", "public void createRevenueGraph()\n\t{\n\t\tASPManager mgr = getASPManager();\n\n\t\tint woGraphPoints;\n\t\tString costTyptemp;\n\t\tString costGraph_Ext;\n\t\tdouble woRevenueTemp; \n\t\tdouble strRevenueTemp;\n\t\tString sGraphTitle;\n\t\tString sLeftTitle; \n\n\t\tint noOfRows = itemset0.countRows(); \n\t\trevGraphInNewWind = false;\n\t\tint wono = sWorkOrderNoTree;\n\n\t\tString[] woCostType = new String[noOfRows]; \n\t\tdouble[] woRevenue = new double[noOfRows];\n\t\tdouble[] structureRevenue = new double[noOfRows];\n\n\t\titemset0.first();\n\n\t\tfor (int i = 0; i < noOfRows; i++)\n\t\t{\n\t\t\twoRevenue[i] = itemset0.getRow().getNumberValue(\"NACCUMULATEDREVENUESINGLE\");\n\t\t\twoCostType[i] = itemset0.getRow().getValue(\"SWOCOSTTYPE\");\n\t\t\tstructureRevenue[i] = itemset0.getRow().getNumberValue(\"NACCUMULATEDREVENUE\");\n\n\t\t\titemset0.forward(1);\n\t\t}\n\n\t\twoGraphPoints = 6;\n\n\t\tfor (int i = 0; i < noOfRows; i++)\n\t\t{\n\t\t\tif (woRevenue[i]>0 || structureRevenue[i]>0)\n\t\t\t\tgraphflagWo = 1;\n\t\t}\n\n\t\tsGraphTitle = mgr.translate(\"PCMWWORKORDERCOSTTABLESMWOREVTITLE: Work Order Revenue\");\n\t\tsLeftTitle = mgr.translate(\"PCMWWORKORDERCOSTTABLESMAMOUNTTR: Amount\");\n\n\t\trevGraphInNewWind = true;\n\n\t\tdrawGraphPic(wono,sGraphTitle,sLeftTitle,noOfRows,woCostType,woRevenue,structureRevenue); \n\t}", "private static double [][] exe_helper (double [] rf) throws Exception {\r\n\t\r\n\t\tint p1 = rf.length; // [nf,p1]=size(rf);\r\n\t\tint p0 = p1-1;\r\n\t\tdouble [] rr = null;\r\n\t\tdouble [] ar = null;\r\n\t\t\r\n\t\tif (p0!=0)\r\n\t\t{\r\n\t\t\tdouble [] a = new double [] {rf[1]}; //a = rf(:,2); // array eith a single elemtne, at the moment\r\n\r\n\t\t\t// rr=[ones(nf,1) -a zeros(nf,p0-1)];\r\n\t\t\trr = new double[p0+1];\r\n\t\t\tArrays.fill(rr, 0.0);\r\n\t\t\trr[0] = 1;\r\n\t\t\trr[1] = -a[0];\r\n\r\n\t\t\t// e = (a.^2-1);\r\n\t\t\tdouble e = a[0]*a[0]-1;\r\n\r\n\t\t\tfor (int n = 2; n<=p0; n++) // for n = 2:p0\r\n\t\t\t{\r\n\t\t\t\tdouble k = rf[n]; // k=rf(:,n+1); // It s a column vector\r\n\r\n\t\t\t\t// rr(:,n+1) =k.*e - sum(rr(:,n:-1:2).*a,2);\r\n\t\t\t\trr[n] = k*e - MyMath.sum(MyMath.arrayTimes(MyMath.select(rr, n-1, 1, -1), a));\r\n\r\n\t\t\t\t// a = [a+k(:,ones(1,n-1)).*a(:,n-1:-1:1) k];\r\n\t\t\t\tdouble [] aa = new double[a.length +1];\r\n\t\t\t\tfor (int i=0; i<a.length; i++)\r\n\t\t\t\t\taa[i] = a[i] + k*a[n-2-i];\r\n\t\t\t\taa[aa.length-1] = k;\r\n\t\t\t\ta = aa;\r\n\r\n\t\t\t\t// e = e.*(1-k.^2);\r\n\t\t\t\te *= (1-k*k);\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\t// ar = [ones(nf,1) a];\r\n\t\t\tar = new double [1+a.length];\r\n\t\t\tar[0] = 1;\r\n\t\t\tSystem.arraycopy(a, 0, ar, 1, a.length);\r\n\t\t\t\r\n\t\t\tdouble r0 = 1.0/MyMath.sum(MyMath.arrayTimes(rr, ar)); // r0=sum(rr.*ar,2).^(-1);\r\n\t\t\t\r\n\t\t\tMyMath.timesSelf(rr, r0); // rr=rr.*r0(:,ones(1,p1));\r\n\t\t\t\r\n\t\t\t// if nargin>1 && ~isempty(p)\r\n\t\t\t// if p<p0\r\n\t\t\t// rr(:,p+2:p1)=[];\r\n\t\t\t// else\r\n\t\t\t//\r\n\t\t\t// rr=[rr zeros(nf,p-p0)];\r\n\t\t\t// af=-ar(:,p1:-1:2);\r\n\t\t\t// for i=p0+1:p\r\n\t\t\t// rr(:,i+1)=sum(af.*rr(:,i-p0+1:i),2);\r\n\t\t\t// end\r\n\t\t\t// end\r\n\t\t\t// end\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\trr = new double [] {1.0}; // rr=ones(nf,1);\r\n\t\t\tar = new double [] {1.0}; // ar=rr;\r\n\t\t}\r\n\r\n\t\treturn new double [][] {rr, ar};\r\n\t}", "public void prepareSorpresas(){\n\t\tfor( int x= 0 ; x < game.getAmountSorpresas();x++){\n\t\t\tSorpresa s = game.getSorpresa(x);\n\t\t\timage = s.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(s.getAncho(), s.getAlto(), Image.SCALE_SMOOTH);\n\t\t\ts.setImage(new ImageIcon(temporal));\n\t\t}\n\t}", "public void InitializeVariable(double[] x, PipesVector pvector, boundkey[] bkx, double[] blx, double[] bux,\n\t\t\tDiametersVector dvector, NodesVector nvector, double outflow) {\n\t\tPipes pipes;\n\t\tDiameters diam;\n\t\tNodes nodes;\n\n\t\t/* les variables de longeurs */\n\t\tfor (int i = 0; i < NbPipes; i++) {\n\t\t\tpipes = (Pipes) pvector.elementAt(i);\n\t\t\tnodes = (Nodes) nvector.elementAt(nvector.getPosition(pipes.nodes_end));\n\n\t\t\tfor (int j = 0; j < NbDiam; j++) {\n\t\t\t\tdiam = (Diameters) dvector.elementAt(j);\n\n\t\t\t\t/* control du SDR */\n\t\t\t\tif ((-nodes.height < diam.pression) && (diam.diam > pipes.imposdiammin)\n\t\t\t\t\t\t&& (diam.diam < pipes.imposdiammax)) {\n\t\t\t\t\tblx[(i * NbDiam) + j] = 0;\n\t\t\t\t\tbux[(i * NbDiam) + j] = pipes.length;\n\t\t\t\t\tbkx[(i * NbDiam) + j] = mosek.boundkey.ra;\n\n\t\t\t\t} else {\n\t\t\t\t\tblx[(i * NbDiam) + j] = 0;\n\t\t\t\t\tbux[(i * NbDiam) + j] = 0;\n\t\t\t\t\tbkx[(i * NbDiam) + j] = mosek.boundkey.fx;\n\t\t\t\t}\n\n\t\t\t\tif (pipes.imposdiam1 == diam.diam) {\n\t\t\t\t\tbux[(i * NbDiam) + j] = pipes.imposlength1;\n\t\t\t\t\tblx[(i * NbDiam) + j] = bux[(i * NbDiam) + j];\n\t\t\t\t\tbkx[(i * NbDiam) + j] = mosek.boundkey.fx;\n\t\t\t\t}\n\n\t\t\t\tif (pipes.imposdiam2 == diam.diam) {\n\t\t\t\t\tbux[(i * NbDiam) + j] = pipes.length - pipes.imposlength1;\n\t\t\t\t\tblx[(i * NbDiam) + j] = bux[(i * NbDiam) + j];\n\t\t\t\t\tbkx[(i * NbDiam) + j] = mosek.boundkey.fx;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Slack variables\n\t\tfor (int i = NbPipes * NbDiam; i < (((NbPipes * NbDiam) + NbNodes) - 1); i++) {\n\t\t\tbux[i] = 1.0e30; // borne superieure infinie\n\t\t\tblx[i] = 0; // borne inferieure finie\n\t\t\tbkx[i] = mosek.boundkey.lo; /* bornee inferieurement */\n\t\t}\n\t}", "public void setup() {\n //our playing field size\n int theGroundWidth = 800;\n int theGroundHeight = 800;\n\n //our pouplation of rabbits\n entitiesOfRabbits = new Entities();\n //our grass population\n entitiesOfGrass = new Entities();\n //array of dead rabbits\n entitiesOfDeadRabbits = new Entities();\n //Array of foxes\n entitiesOfFoxes = new Entities();\n\n //creating an interactive object that is able to open the graph by the push of a button\n openGraph = new InteractiveObject();\n openGraph.createInteractiveObject(this, 875, 100, 50, 50, \"Square\",true);\n\n //Instantiating the object that allow us to start the program\n startTheProgram = new InteractiveObject();\n startTheProgram.createInteractiveObject(this,400,400,50,50,\"Square\", true);\n\n //instatiating the environment, with the sizes from above\n theEnvironment = new Environment(this, theGroundWidth, theGroundHeight);\n\n //createPopulation comes from the entities (population) class, and holds all the rabbits in an arraylist\n entitiesOfRabbits.createEntities(this, 20, Rabbit.class);\n entitiesOfGrass.createEntities(this, 35, Grass.class);\n entitiesOfFoxes.createEntities(this,3,Fox.class);\n\n //AllEntities list, which holds all the different population lists\n allEntities = new ArrayList<>();\n allDeadEntities = new ArrayList<>();\n\n //putting all the rabbits into the AllEntities list, in the main class\n //keeps all the moving parts together, making it easier to compare objects fx rabbits finding food or other rabbits\n allEntities.add(0,entitiesOfRabbits);\n allEntities.add(1,entitiesOfGrass);\n allEntities.add(2,entitiesOfFoxes);\n allDeadEntities.add(entitiesOfDeadRabbits);\n }", "public void rgs() {\n\t\tArrayList<int[]> front = this.unknown;\n\t\tRandom rand = new Random();\n\t\tint index = rand.nextInt(front.size());\n\t\tint loc[] = front.get(index);\n\t\tprobe(loc[0], loc[1]);\n\t\trgsCount++;\n\t\tSystem.out.println(\"RGS: probe[\" +loc[0] + \",\" + loc[1] + \"]\");\n\t\tshowMap();\n\t}", "public void ris_sistema( double d[], double ds[], double di[], double b[], double x[], int n ) {\n double[][] A = vett_mat(d, ds, di, n);\n /*\n * Alloco i vettori che memorizzano la matrice tridiagonale come una matrice sparsa alla\n * maniera di N.R.\n */\n double[] sa = new double[((3 * n) - 1)];\n int[] ija = new int[((3 * n) - 1)];\n\n /* Definisco gli elementi dei vettori sa[] e ija[] */\n sprsin(A, THRESH, sa, ija);\n\n /* Calcolo la soluzione del sistema lineare */\n linbcg(n, b, x, ITOL, TOL, ITMAX, sa, ija);\n }", "public void generete() {\n int minQuantFig = 1,\r\n maxQuantFig = 10,\r\n minNum = 1,\r\n maxNum = 100,\r\n minColor = 0,\r\n maxColor = (int)colors.length - 1,\r\n\r\n // Initialize figures property for random calculations\r\n randomColor = 0,\r\n randomFigure = 0,\r\n\r\n // Squere property\r\n randomSideLength = 0,\r\n\r\n // Circle property\r\n randomRadius = 0,\r\n \r\n // IsoscelesRightTriangle property \r\n randomHypotenus = 0,\r\n \r\n // Trapizoid properties\r\n randomBaseA = 0,\r\n randomBaseB = 0,\r\n randomAltitude = 0;\r\n\r\n // Generate random number to set figueres's quantaty\r\n setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) );\r\n\r\n for( int i = 0; i < getFigureQuantaty(); i++ ) {\r\n\r\n // Convert double random value to int and close it in range from 1 to number of elements in array\r\n randomFigure = (int)( Math.random() * figures.length );\r\n \r\n randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array\r\n\r\n // Create new figure depending on randomFigure \r\n switch (figures[randomFigure]) {\r\n\r\n case \"Circle\":\r\n\r\n randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius;\r\n\r\n Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters\r\n\r\n newCircle.drawFigure();\r\n \r\n break;\r\n\r\n case \"Squere\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters\r\n\r\n newSquere.drawFigure();\r\n\r\n break;\r\n\r\n case \"Triangle\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus;\r\n\r\n IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters\r\n\r\n newTriangle.drawFigure();\r\n\r\n break;\r\n\r\n case \"Trapezoid\":\r\n\r\n randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A;\r\n\r\n randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B;\r\n\r\n randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude;\r\n\r\n Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters\r\n\r\n newTrapezoid.drawFigure();\r\n\r\n break;\r\n\r\n };\r\n };\r\n }", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "public void dormbr_(CHARACTER VECT,CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);", "public void dormr3_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,INTEGER L,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);", "private void createFullPackOfCards()\r\n {\r\n // Todo\r\n\r\n // Using a for-loop, add all the Card instances to cards.\r\n for ( int i = 0; i < NOOFCARDSINFULLPACK; i ++) {\r\n addTopCard( new Card(i));\r\n }\r\n }", "private List<Region> experimentFullRegions() {\n\t\tList<Region> rs = new ArrayList<Region>();\n\t\tRegion r;\n\n\t\t// Vassar St\n\t\tr = new Region(\"Vassar-1\");\n\t\tr.addVertex(42.36255147026933, -71.09034599930573);\n\t\tr.addVertex(42.36240877523236, -71.08975591332245);\n\t\tr.addVertex(42.36013353836458, -71.09434785515595);\n\t\tr.addVertex(42.360442721730834, -71.0948091951065);\n\t\trs.add(r);\n\n\t\t// Windsor-1\n\t\tr = new Region(\"Windsor-1\");\n\t\tr.addVertex(42.36302711805193, -71.09707297951508);\n\t\tr.addVertex(42.36297955343571, -71.09641852051544);\n\t\tr.addVertex(42.3615288153431, -71.09657945305634);\n\t\tr.addVertex(42.36186970216797, -71.09723391205597);\n\t\trs.add(r);\n\n\t\t// Mass-1\n\t\tr = new Region(\"Mass-1\");\n\t\tr.addVertex(42.362678310030105, -71.0995620694809);\n\t\tr.addVertex(42.3629954083118, -71.09918656021881);\n\t\tr.addVertex(42.36179042632724, -71.09720172554779);\n\t\tr.addVertex(42.361322696830854, -71.09736265808868);\n\t\trs.add(r);\n\n\t\t// Mass-2\n\t\tr = new Region(\"Mass-2\");\n\t\tr.addVertex(42.36114036066024, -71.09588207871246);\n\t\tr.addVertex(42.360791542163774, -71.09660091072845);\n\t\tr.addVertex(42.36106901157985, -71.0969335046463);\n\t\tr.addVertex(42.36156052582344, -71.09657945305634);\n\t\trs.add(r);\n\n\t\t// Mass-3\n\t\tr = new Region(\"Mass-3\");\n\t\tr.addVertex(42.36035551632001, -71.09489502579498);\n\t\tr.addVertex(42.3601731773427, -71.09523834854889);\n\t\tr.addVertex(42.360577493491306, -71.095978638237);\n\t\tr.addVertex(42.36077568673155, -71.0955816713028);\n\t\trs.add(r);\n\n\t\t/*\n\t\t * Albany-1-full r = new Region(\"Albany-1\");\n\t\t * r.addVertex(42.36087874696942, -71.09530272156525);\n\t\t * r.addVertex(42.361227564981775, -71.0956353154831);\n\t\t * r.addVertex(42.362678310030105, -71.092556139534);\n\t\t * r.addVertex(42.362527687785665, -71.09185876519012); rs.add(r);\n\t\t */\n\n\t\t// Albany-1\n\t\tr = new Region(\"Albany-1\");\n\t\tr.addVertex(42.36172700558263, -71.09442295700836);\n\t\tr.addVertex(42.3614891772202, -71.09410109192658);\n\t\tr.addVertex(42.360823253016186, -71.09553875595856);\n\t\tr.addVertex(42.361084866938036, -71.09590353638458);\n\t\trs.add(r);\n\n\t\t// Albany-2\n\t\tr = new Region(\"Albany-2\");\n\t\tr.addVertex(42.362678310030105, -71.09243812233734);\n\t\tr.addVertex(42.36253561528121, -71.09191240937042);\n\t\tr.addVertex(42.36180628150339, -71.09342517525482);\n\t\tr.addVertex(42.36223436974708, -71.09344663292694);\n\t\trs.add(r);\n\n\t\t// Portland-1\n\t\tr = new Region(\"Portland-1\");\n\t\tr.addVertex(42.362757584750575, -71.09386505753326);\n\t\tr.addVertex(42.36273380234492, -71.09342517525482);\n\t\tr.addVertex(42.36217887699113, -71.09354319245148);\n\t\tr.addVertex(42.36198861574153, -71.09409036309052);\n\t\trs.add(r);\n\n\t\t// Main-2\n\t\tr = new Region(\"Main-1\");\n\t\tr.addVertex(42.36321737615673, -71.09918656021881);\n\t\tr.addVertex(42.36356618118581, -71.09917583138275);\n\t\tr.addVertex(42.36342348845344, -71.0969335046463);\n\t\tr.addVertex(42.363042972916034, -71.09699787766266);\n\t\trs.add(r);\n\n\t\t// Main-2\n\t\tr = new Region(\"Main-2\");\n\t\tr.addVertex(42.36318566651262, -71.09384359986115);\n\t\tr.addVertex(42.36278929461076, -71.09392943054962);\n\t\tr.addVertex(42.36297162599619, -71.09643997818756);\n\t\tr.addVertex(42.36336799674776, -71.09641852051544);\n\t\trs.add(r);\n\n\t\t// Main-3\n\t\tr = new Region(\"Main-3\");\n\t\tr.addVertex(42.36300333574834, -71.09216990143585);\n\t\tr.addVertex(42.36271794740286, -71.09249176651764);\n\t\tr.addVertex(42.36277343968266, -71.09333934456635);\n\t\tr.addVertex(42.363106392332284, -71.09324278504181);\n\t\trs.add(r);\n\n\t\t// Main-4\n\t\tr = new Region(\"Main-4\");\n\t\tr.addVertex(42.36289235154579, -71.09035672814178);\n\t\tr.addVertex(42.36259110772208, -71.09038891464996);\n\t\tr.addVertex(42.36264660011392, -71.09166564614105);\n\t\tr.addVertex(42.36303504548448, -71.09157981545258);\n\t\trs.add(r);\n\n\t\tLocation l;\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36035940296916);\n\t\tl.setLongitude(-71.0944926738739);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36081921192526);\n\t\tl.setLongitude(-71.09338760375977);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36160405047349);\n\t\tl.setLongitude(-71.0919177532196);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3619370093201);\n\t\tl.setLongitude(-71.09123110771179);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36234924163794);\n\t\tl.setLongitude(-71.09039425849915);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3631736981596);\n\t\tl.setLongitude(-71.09626293182373);\n\t\tlog(String.format(\"Test point on Main-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36303893196785);\n\t\tl.setLongitude(-71.09436392784119);\n\t\tlog(String.format(\"Test point on Main-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362935875273244);\n\t\tl.setLongitude(-71.09288334846497);\n\t\tlog(String.format(\"Test point on Main-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362785253646265);\n\t\tl.setLongitude(-71.09100580215454);\n\t\tlog(String.format(\"Test point on Main-3 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362476081807);\n\t\tl.setLongitude(-71.0936987400055);\n\t\tlog(String.format(\"Test point on Portland-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36099362133876);\n\t\tl.setLongitude(-71.09561920166016);\n\t\tlog(String.format(\"Test point on Albany-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36154855716084);\n\t\tl.setLongitude(-71.0943853855133);\n\t\tlog(String.format(\"Test point on Albany-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362008357414815);\n\t\tl.setLongitude(-71.093430519104);\n\t\tlog(String.format(\"Test point on Albany-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362610849206014);\n\t\tl.setLongitude(-71.09221816062927);\n\t\tlog(String.format(\"Test point on Albany-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3611521749309);\n\t\tl.setLongitude(-71.09653115272522);\n\t\tlog(String.format(\"Test point on Mass-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3604862471552);\n\t\tl.setLongitude(-71.09537243843079);\n\t\tlog(String.format(\"Test point on Mass-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36238887921827);\n\t\tl.setLongitude(-71.09683156013489);\n\t\tlog(String.format(\"Test point on Windsor-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\treturn rs;\n\t}", "public static void main(final x10.core.Rail<java.lang.String> argv) {\r\n \r\n //#line 14 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n final x10.util.Random r = ((x10.util.Random)(new x10.util.Random((java.lang.System[]) null).x10$util$Random$$init$S()));\r\n \r\n //#line 15 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n final x10.io.Printer t$22597 = ((x10.io.Printer)(x10.io.Console.get$OUT()));\r\n \r\n //#line 15 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n t$22597.println(((java.lang.Object)(\"Los elementos del Rail son inicializados a numero aleatorio\")));\r\n \r\n //#line 17 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n final x10.io.Printer t$22598 = ((x10.io.Printer)(x10.io.Console.get$OUT()));\r\n \r\n //#line 17 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n t$22598.print(((java.lang.String)(\"r1= \")));\r\n \r\n //#line 19 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n final x10.io.Printer t$22599 = ((x10.io.Printer)(x10.io.Console.get$OUT()));\r\n \r\n //#line 19 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n t$22599.println(((java.lang.Object)(\"Borrando los elementos 6,7,8\")));\r\n \r\n //#line 22 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n final x10.io.Printer t$22600 = ((x10.io.Printer)(x10.io.Console.get$OUT()));\r\n \r\n //#line 22 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n t$22600.println(((java.lang.Object)(\"Borrrando todos los elementos\")));\r\n \r\n //#line 25 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n final x10.io.Printer t$22601 = ((x10.io.Printer)(x10.io.Console.get$OUT()));\r\n \r\n //#line 25 \"C:/Users/GERALD/Desktop/distribuido/x10dt/workspace/ppp/src/ppp/p1.x10\"\r\n t$22601.println(((java.lang.Object)(\"Completando todo el rail con 7\")));\r\n }", "public void dormrz_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,INTEGER L,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);" ]
[ "0.57498634", "0.5268696", "0.52585703", "0.51432", "0.50949234", "0.50391227", "0.50332874", "0.5029394", "0.50227374", "0.500205", "0.49965048", "0.49852085", "0.49616718", "0.49309027", "0.49107042", "0.48977295", "0.48846442", "0.48706225", "0.48633313", "0.486298", "0.48535797", "0.48519486", "0.48362416", "0.483125", "0.4818747", "0.48062867", "0.48001763", "0.47985274", "0.4794131", "0.47938246", "0.47774976", "0.4776938", "0.47677562", "0.47648302", "0.47647032", "0.47502178", "0.4741148", "0.47278172", "0.4720983", "0.47065535", "0.4696837", "0.46965992", "0.46822432", "0.46650538", "0.46643105", "0.46471736", "0.46379477", "0.46369225", "0.46250212", "0.46180457", "0.45914498", "0.4589318", "0.4579734", "0.45776784", "0.45766684", "0.45662326", "0.4557835", "0.4554901", "0.45547158", "0.4554016", "0.4548592", "0.45395494", "0.4535296", "0.4527221", "0.45231918", "0.4520219", "0.45093644", "0.4504141", "0.45009774", "0.4486941", "0.44851533", "0.44786444", "0.4474923", "0.44729665", "0.4472867", "0.44699988", "0.44633922", "0.44631648", "0.44599986", "0.44452912", "0.4443531", "0.44435242", "0.4439737", "0.44384235", "0.44379246", "0.44370627", "0.44274938", "0.44241083", "0.44239312", "0.44235408", "0.44220352", "0.44191292", "0.44181314", "0.44156536", "0.441451", "0.44119546", "0.44080794", "0.440532", "0.44050765", "0.44046518" ]
0.68359774
0
Check if any parcel fits in the residual space, start at the smallest volume to be fast
private boolean aParcelFitsInRes(ResidualSpace res){ for(int i = bres.length - 1; i >= 0; i--){ if(bres[i] > 0){ if(parcel_types[i].getX_size() <= res.getX_size() && parcel_types[i].getY_size() <= res.getY_size() && parcel_types[i].getZ_size() <= res.getZ_size()) { // Fits return true; } } } // At this point nothing fits return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean checkRemainingRes() {\n for (int i = 0; i < playingField.getPlayingField().length; i++) {\n for (int j = 0; j < playingField.getPlayingField()[i].length; j++) {\n if (playingField.getPlayingField()[i][j].getResources() > 0) {\n return true;\n }\n }\n }\n return false;\n }", "boolean fit(Vehicle v) {\n\t\t\tif (currentVehicle == null) {\n\t\t\t\treturn v.getSize().rank() <= size.rank();\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "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 boolean fitVehicle(Vehicle veh){\r\n // return true value if the vehicle fits\r\n // return statement\r\n return veh.canFitSpot(this) && isAvailable();\r\n }", "public int getPartialMatches(PegArray master) {\n\t\tPegArray copy = new PegArray(pegs.length);\n\t\tint sum = 0; \t// number of matches\n\t\tboolean inputNeeded = true;\n\t\tfor (int i = 0; i < pegs.length; i++)\n\t\t\tcopy.getPeg(i).setLetter(pegs[i].getLetter());\n\t\t// loop through the peg array twice\n\t\tfor (int i = 0; i < pegs.length; i++) {\n\t\t\tfor (int j = 0; j < pegs.length; j++) {\n\t\t\t\t// if the initial peg in master (in index i) is equal to any peg in guesses\n\t\t\t\tif (inputNeeded && copy.pegs[j].getLetter() == master.getPeg(i).getLetter()) {\n\t\t\t\t\tsum++;\n\t\t\t\t\tinputNeeded = false;\n\t\t\t\t\tcopy.getPeg(j).setLetter('X');\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tinputNeeded = true; // reset when it finishes one value\n\t\t}\n\t\t// set private instance variable to local variable to hold value\n\t\tpartialMatches = sum - getExactMatches(master);\t\n\t\treturn partialMatches;\n\t}", "private void detectParkingSlot()\r\n\t{\t\t\r\n\t\tPoint PosS = new Point(0,0);\r\n\t\tPoint PosE = new Point(0,0);\r\n\t\t\r\n\t\tdouble sum_F = 0;\r\n\t\tdouble sum_B = 0;\r\n\t\t\r\n\t\tdouble distance_F = 0;\r\n\t\tdouble distance_B = 0;\r\n\t\t\r\n\t\tint SlotID = Pk_counter;\r\n\t\tINavigation.ParkingSlot.ParkingSlotStatus SlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\t\r\n\t\tshort axe = getHeadingAxe();\r\n\t\t\r\n\t\tfor (int i = 1; i <= 4; i++)\r\n\t\t{\r\n\t\t\tPk_DIST_FS[i] = Pk_DIST_FS[i-1];\r\n\t\t\tsum_F = Pk_DIST_FS[i] + sum_F;\r\n\t\t\t\r\n\t\t\tPk_DIST_BS[i] = Pk_DIST_BS[i-1];\r\n\t\t\tsum_B = Pk_DIST_BS[i] + sum_B;\r\n\t\t}\r\n\t\t\r\n\t\tPk_DIST_FS[0] = frontSensorDistance;\r\n\t\t//distance_F = (sum_F + Pk_DIST_FS[0])/5;\r\n\t\tdistance_F = frontSensorDistance;\r\n\t\t\r\n\t\tPk_DIST_BS[0] = backSideSensorDistance;\r\n\t\t//distance_B = (sum_B + Pk_DIST_BS[0])/5;\r\n\t\tdistance_B = backSideSensorDistance;\r\n\t\t\r\n\t\t//LCD.drawString(\"Dist_F: \" + (distance_F), 0, 6);\r\n\t\t//LCD.drawString(\"Dist_B: \" + (distance_B), 0, 7);\r\n\t\t\r\n\t\t// Saving the begin point of the PS\r\n\t\tif ((distance_F <= TRSH_SG) && (Pk_burstFS == 0))\r\n\t\t{\r\n\t\t\tPk_PosF1.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstFS = 1;\r\n\t\t\tPk_burstFE = 0;\r\n\t\t\t//Sound.beep();\r\n\t\t}\r\n\t\t\r\n\t\tif ((distance_B <= TRSH_SG) && (Pk_burstRS == 0))\r\n\t\t{\r\n\t\t\tPk_PosR1.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstRS = 1;\r\n\t\t\tPk_burstRE = 0;\r\n\t\t\t//Sound.twoBeeps();\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// Saving the end point of the PS\r\n\t\tif ((distance_F >= TRSH_SG) && (Pk_burstFE == 0))\r\n\t\t{\r\n\t\t\tPk_PosF2.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstFS = 0;\r\n\t\t\tPk_burstFE = 1;\r\n\t\t\t//Sound.beep();\r\n\t\t}\r\n\t\t\r\n\t\tif ((distance_B >= TRSH_SG) && (Pk_burstRE == 0))\r\n\t\t{\r\n\t\t\tPk_PosR2.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstRS = 0;\r\n\t\t\t//burstRE = 1;\r\n\t\t\t//Sound.twoBeeps();\r\n\t\t}\r\n\t\t\r\n\t\tif (Po_RoundF == 0)\t\t\t// Saving new parking slots\r\n\t\t{\t\r\n\t\t\tif ((Pk_burstRS == 0) && (Pk_burstRE == 0) && (Pk_counter < 10))\r\n\t\t\t{\r\n\t\t\t\tPosS.setLocation(((Pk_PosF1.getX() + Pk_PosR1.getX())/2), ((Pk_PosF1.getY() + Pk_PosR1.getY())/2));\r\n\t\t\t\tPosE.setLocation(((Pk_PosF2.getX() + Pk_PosR2.getX())/2), ((Pk_PosF2.getY() + Pk_PosR2.getY())/2));\r\n\t\t\t\t\r\n\t\t\t\t// Evaluation of the slot\r\n\t\t\t\tif (axe == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((PosE.getX() - PosS.getX()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\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\tif ((PosE.getY() - PosS.getY()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPk_slotList[Pk_counter] = new INavigation.ParkingSlot(SlotID, PosE, PosS, SlotStatus, 0);\r\n\t\t\t\tPk_counter ++;\r\n\t\t\t\t\r\n\t\t\t\tPk_burstRE = 1;\r\n\t\t\t\t\r\n\t\t\t\tSound.beepSequence();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\t\t\t\t\t// Updating the old slots\r\n\t\t{\r\n\t\t\tif ((Pk_burstRS == 0) && (Pk_burstRE == 0) && (Pk_update <= Pk_counter))\r\n\t\t\t{\r\n\t\t\t\tPosS.setLocation(((Pk_PosF1.getX() + Pk_PosR1.getX())/2), ((Pk_PosF1.getY() + Pk_PosR1.getY())/2));\r\n\t\t\t\tPosE.setLocation(((Pk_PosF2.getX() + Pk_PosR2.getX())/2), ((Pk_PosF2.getY() + Pk_PosR2.getY())/2));\r\n\t\t\t\t\r\n\t\t\t\t// Evaluation of the slot\r\n\t\t\t\tif (axe == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((PosE.getX() - PosS.getX()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\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\tif ((PosE.getY() - PosS.getY()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPk_slotList[Pk_update] = new INavigation.ParkingSlot(SlotID, PosE, PosS, SlotStatus, 0);\r\n\t\t\t\t\r\n\t\t\t\tif (Pk_update < Pk_counter)\r\n\t\t\t\t{\r\n\t\t\t\t\tPk_update ++;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tPk_update = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPk_burstRE = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn; // data are saved in the shared variable\r\n\t}", "public boolean isSolvable() {\n int inversions = 0;\n int zrow = 0;\n int beg;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n if (tiles[i][j] == 0)\n zrow = i;\n else {\n for (int k = i; k < n; k++) {\n beg = (k == i)? j+1 : 0;\n for (int l = beg; l < n; l++) {\n if (tiles[i][j] != 0 && tiles[k][l] != 0 && tiles[i][j] > tiles[k][l])\n inversions++;\n }\n }\n }\n }\n }\n if (n%2 == 1)\n return (inversions%2 == 0);\n return ((inversions+zrow)%2 == 1);\n }", "public boolean carParkFull() {\r\n\t\tif (getNumCars() >= totalSpaces) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "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 }", "public boolean isSolutionExist() {\n // Mengecek apakah sebuah matriks SPL memiliki solusi\n boolean ada_solusi = true;\n\n int i = this.NBrsEff - 1;\n\n while(ada_solusi && i >= 0){\n int j = 0;\n boolean found = false;\n\n while(!found && j <= this.NKolEff) {\n if(this.M[i][j] != 0 && j != this.NKolEff - 1) {\n found = true;\n }\n j += 1;\n }\n\n if(!found) {\n boolean all_zero_brs = false;\n\n for(int k = 0; k < this.NBrsEff; k++){\n if(this.isAllZeroBrs(k)) {\n all_zero_brs = true;\n }\n }\n\n if(!all_zero_brs) {\n ada_solusi = false;\n }\n }\n\n i -= 1;\n }\n\n return ada_solusi;\n }", "public boolean work() {\n // get the next block so the cart knows where to mine\n Vec3 next = getNextblock();\n // save thee coordinates for easy access\n int x = (int) next.xCoord;\n int y = (int) next.yCoord;\n int z = (int) next.zCoord;\n\n // loop through the blocks in the \"hole\" in front of the cart\n\n for (int i = -getRange(); i <= getRange(); i++) {\n for (int j = -getRange(); j <= getRange(); j++) {\n // calculate the coordinates of this \"hole\"\n int coordX = x + i;\n int coordY = y - 1;\n int coordZ = z + j;\n\n if (farm(coordX, coordY, coordZ)) {\n return true;\n } else if (till(coordX, coordY, coordZ)) {\n return true;\n } else if (plant(coordX, coordY, coordZ)) {\n return true;\n }\n }\n }\n\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 }", "public int[] isScale(Region r) {\n\t\tint[] res=new int[2];\n\t\tint t=0;\n\t\tif (nearlyEquals(sizeX,r.sizeX) && nearlyEquals(sizeY,r.sizeY))\n\t\t\treturn res;\n\t\tif (!nearlyEquals(this.sizeX, r.sizeX) && !nearlyEquals(this.sizeY, r.sizeY)) {\n\t\t\tdouble factor=(double)r.sizeX/sizeX;\n\t\t\tif (Math.abs((double)r.sizeY/sizeY-factor)>0.2)\n\t\t\t\treturn res;\n\t\t\tfor (int i=0;i<sizeX/2;i++) {\n\t\t\t\tfor (int j=0;j<sizeY/2;j++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (info[i][j]!=r.get((int)(r.sizeX/2-Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[sizeX-1-i][j]!=r.get((int)(r.sizeX/2+Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[i][sizeY-1-j]!=r.get((int)(r.sizeX/2-Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2+Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[sizeX-1-i][sizeY-1-j]!=r.get((int)(r.sizeX/2+Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2+Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (t<square/5) {\n\t\t\t\tres[0]=3;\n\t\t\t\tres[1]=(r.sizeX-sizeX)/2;\n\t\t\t} \n\t\t\treturn res;\n\t\t}\n\t\t\n\t\tif (!nearlyEquals(sizeX,r.sizeX)) {\n\t\t\tdouble factor=(double)r.sizeX/sizeX;\n\t\t\tfor (int i=0;i<sizeX/2;i++) {\n\t\t\t\tfor (int j=0;j<sizeY;j++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (info[i][j]!=r.get((int)(r.sizeX/2-Math.abs(sizeX/2-i)*factor), j)) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[sizeX-i-1][j]!=r.get((int)(r.sizeX/2+Math.abs(sizeX/2-i)*factor), j)) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (t<square/5) {\n\t\t\t\tres[0]=1;\n\t\t\t\tres[1]=(r.sizeX-sizeX)/2;\n\t\t\t}\n\t\t} else {\n\t\t\tdouble factor=(double)r.sizeY/sizeY;\n\t\t\tfor (int i=0;i<sizeX;i++) {\n\t\t\t\tfor (int j=0;j<sizeY/2;j++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (info[i][j]!=r.get(i, (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[i][sizeY-1-j]!=r.get(i, (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (t<square/5) {\n\t\t\t\tres[0]=2;\n\t\t\t\tres[1]=(r.sizeY-sizeY)/2;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "public boolean checkNotDone() {\n boolean notDone = false;\n blocksPut = 0;\n \n for(int y = 0; y < buildHeight+1; y++) {\n for(int z = 0; z < buildSize; z++) {\n for(int x = 0; x < buildSize; x++) {\n if(myIal.lookBlock(x, y, z).equals(\"air\")) {\n notDone = true;\n } else {\n blocksPut++;\n }\n }\n }\n }\n\n return notDone;\n }", "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 }", "boolean hasScaler();", "private boolean isHeavyEnough(Double mass) throws CDKException, Exception\n {\n \tboolean candidate = false;\n \t\n \t//only if peaks are supplied\n \tif (this.givenPeaks)\n \t{\n \t\t//positive or negative mode!?\n \t\tprotonMass = protonMass * (double)mode;\n \t\tdouble min = (this.minWeight - (mzabs + PPMTool.getPPM(this.minWeight, this.mzppm)));\n\t \tif((mass + protonMass) > min)\n\t \t{\n\t \t\t//check if fragment is a possible hit\n\t \t\tif((mass + protonMass) > (this.minWeight - (mzabs + PPMTool.getPPM(this.minWeight, this.mzppm))) && (mass + protonMass) < (this.minWeight + (mzabs + PPMTool.getPPM(this.minWeight, this.mzppm))))\n\t \t\t{\n\t \t\t\t//remove peak from list so the fragments are not split up anymore...set new minWeight\n\t \t\t\tif(this.removePeak)\n\t \t\t\t{\n\t \t\t\t\tdeletePeak(this.minWeight);\n\t \t\t\t}\n\t \t\t}\n\t \t\t\n\t \t\tcandidate = true;\n\t \t\t\n\t \t}\n \t}\n \telse\n \t{\n \t\t//no peaks given\n \t\treturn true;\n \t}\n \n \treturn candidate;\n \t\n }", "public void checkCollision(){\r\n\r\n\t\t\t\tsmile.updateVelocity();\r\n\r\n\t\t\t\tsmile.updatePosition();\r\n\r\n\t\t\t\tif (smile.updateVelocity() > 0){\r\n\r\n\t\t\t\t\tfor (int k = 0; k < arrayPlat.size(); k++){\r\n\r\n\t\t\t\t\t\tif (smile.getNode().intersects(arrayPlat.get(k).getX(), arrayPlat.get(k).getY(), Constants.PLATFORM_WIDTH, Constants.PLATFORM_HEIGHT)){\r\n\r\n\t\t\t\t\t\t\tsmile.setVelocity(Constants.REBOUND_VELOCITY);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t}", "boolean checkCandidate(DoubleMatrix1D y){\n if(checkValidPt(y)){\n if(adaptiveScale){\n double qforward = Q(x,y,samplingScale);\n DoubleMatrix1D ySamplingScale = getScaleAdaptive(y);\n double qback = Q(y,x,ySamplingScale);\n if(qback/qforward > Math.random())//going to accept\n samplingScale = ySamplingScale;\n else\n return false;\n }\n x=y;\n return true;\n }\n else\n return false;\n }", "@Test public void findPentagonalPyramidWithSmallestVolumeNTest()\n {\n PentagonalPyramid[] pArray = new PentagonalPyramid[100];\n PentagonalPyramidList2 pList = new PentagonalPyramidList2(\"ListName\", \n pArray, 0);\n Assert.assertEquals(null, \n pList.findPentagonalPyramidWithSmallestVolume());\n }", "private int containerFit(QuadNode node, PrimitiveCuboid c){\n long minSize = Math.abs(c.xyzA[0] - c.xyzB[0]);\n long minSizeB = Math.abs(c.xyzA[2] - c.xyzB[2]);\n if(minSize < minSizeB){\n minSize = minSizeB;\n }\n if(node.size < minSize){\n return -1;\n }else if(node.size == 1 || (node.size >> 1) < minSize){\n return 0;\n }else{\n return 1;\n }\n }", "private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}", "private boolean isFound(int remaingingMarbles) {\n\n return (Math.log(remaingingMarbles) / Math.log(2)) % 1 == 0 ;\n\n }", "public boolean willVehicleFit(double size)\n\t{\n\t\tif(unitSpaceAvailable - size >= 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean blocks(Point3d S, Ray3d c) {\n double A = c.getX() * c.getX() + c.getY() * c.getY() + c.getZ() * c.getZ();\n\n double bx = (this.x - S.getX()); //Account for the Sphere's position\n double by = (this.y - S.getY());\n double bz = (this.z - S.getZ());\n double B = -(c.getX() * bx + c.getY() * by + c.getZ() * bz);\n double r = this.radius * this.radius;\n double C = bx * bx + by * by + bz * bz - r;\n\n double D = (B * B - A * C);\n if (D < 0) //no intersection\n {\n return false;\n }\n\n if (D == 0) //'graze' the sphere\n {\n /****/return false;\n }\n\n double t1 = (-B - Math.sqrt(D)) / A;\n if (t1 > 0.00001 && t1 < 1.0) //The first hit\n {\n return true; //But need to check if it's less than 1, also!\n }\n\n double t2 = (-B / A) + Math.sqrt(D) / A;\n if (t2 > 0.00000001 && t2 < 1.0) {\n return true;\n }\n\n return false;\n }", "private static double[] getVolumes(final ImageStack aInputStack, final int[] aLables, final double[] aResol)\r\n\t{\r\n\t\tfinal double[] volumes = GeometricMeasures3D.volume(aInputStack, aLables, aResol);\r\n\t\treturn volumes;\r\n\t}", "private boolean isResolvable() {\n\t\tfinal int sourceParity = board.calculateParity() % 2;\n\t\tfinal int targetParity = goal.calculateParity() % 2;\n\t\treturn (((sourceParity != 0) && (targetParity != 0)) || ((sourceParity == 0) && (targetParity == 0)));\n\t}", "public int trapRainWater(int[][] arr) {\n if(arr.length==0||arr[0].length==0) return 0;\n int n=arr.length;\n int m=arr[0].length;\n PriorityQueue<Integer> pq=new PriorityQueue<>((a,b)->{\n return arr[a/m][a%m]-arr[b/m][b%m];\n });\n boolean vis[][]=new boolean[n][m];\n int ans=0;\n int bound=0;\n for(int i=0;i<n;i++){\n for(int j=0;j<m;j++){\n if(i==0||i==n-1||j==0||j==m-1){\n pq.add(i*m+j);\n vis[i][j]=true;\n }\n }\n }\n int dir[][]={{1,0},{-1,0},{0,1},{0,-1}};\n while(pq.size()>0){\n int idx=pq.remove();\n int r=idx/m;\n int c=idx%m;\n bound=Math.max(bound,arr[r][c]);\n if(arr[r][c]<bound) ans+=bound-arr[r][c];\n for(int d=0;d<4;d++){\n int x=r+dir[d][0];\n int y=c+dir[d][1];\n if(x>=0&&y>=0&&x<n&&y<m&& !vis[x][y]){\n vis[x][y]=true;\n pq.add(x*m+y);\n }\n }\n }\n return ans;\n }", "private void checkRep() {\n for (Ball ball : balls) {\n assert ball.getPosition().d1 >= 0\n && ball.getPosition().d1 <= WIDTH - 1;\n assert ball.getPosition().d2 >= 0\n && ball.getPosition().d2 <= HEIGHT - 1;\n }\n for (Gadget gadget : gadgets) {\n assert gadget.getPosition().d1 >= 0\n && gadget.getPosition().d1 <= WIDTH - 1;\n assert gadget.getPosition().d2 >= 0\n && gadget.getPosition().d2 <= HEIGHT - 1;\n }\n\n assert GRAVITY > 0 && MU2 > 0 && MU > 0;\n }", "private boolean checkCollisions()\n {\n for (int i = 1; i < numFigs; i++)\n if (figures[0].collidedWith(figures[i]))\n return true;\n return false;\n }", "private Boolean esSolucion() {\n if(debug) {\n System.out.println(\"**********************esSolucion\");\n printSol(); \n }\n \n return (this.sol.numVerticesEmparejados == (this.G.numVertices()-1));\n }", "boolean isNilFractionalMinimum();", "public boolean solvable() {\n // TODO: Your code here\n // TODO: NICK\n\n\n int parity = 0;\n int blankRow = 0; // the row with the blank tile\n\n\n for (int i = 0; i < n*n; i++){\n if(tiles[i/n][i%n] == 0){\n blankRow = i/3;\n continue;\n }\n for (int j = i + 1; j < n*n; j++) {\n if (tiles[i/n][i%n] > tiles[j/n][j%n] && tiles[j/n][j%n] != 0) {\n parity++;\n }\n }\n }\n\n\n\n // solvability conditions:\n if (n % 2 == 0) { // even grid\n if (blankRow % 2 == 0) { // blank on odd row; counting from bottom\n return parity % 2 == 0;\n } else { // blank on even row; counting from bottom\n return parity % 2 != 0;\n }\n } else { // odd grid\n return parity % 2 == 0;\n }\n }", "public int[] findHorizontalSeam() {\n int[][] matrixTo = new int[height()][width()];\n double[][] energyMatrix = new double[height()][width()];\n //reset(energyMatrix);\n\n for(int i = 0; i < energyMatrix.length; i++) {\n for(int j = 0; j < energyMatrix[i].length; j++) {\n energyMatrix[i][j] = Double.MAX_VALUE;\n }\n }\n\n for (int row = 0; row < height(); row++) {\n energyMatrix[row][0] = 1000;\n }\n // this is for relaxation.\n for (int col = 0; col < width() - 1; col++) {\n for (int row = 0; row < height(); row++) {\n //relaxH(row, col, matrixTo, energyMatrix);\n int nextcol = col + 1;\n for (int i = -1; i <= 1; i++) {\n int nextrow = row + i;\n if (nextrow < 0 || nextrow >= height()) continue;\n if(i == 0) {\n if(energyMatrix[nextrow][nextcol] >= energyMatrix[row][col] + energy(nextcol, nextrow)) {\n energyMatrix[nextrow][nextcol] = energyMatrix[row][col] + energy(nextcol, nextrow);\n matrixTo[nextrow][nextcol] = i;\n }\n }\n if (energyMatrix[nextrow][nextcol] > energyMatrix[row][col] + energy(nextcol, nextrow)) {\n energyMatrix[nextrow][nextcol] = energyMatrix[row][col] + energy(nextcol, nextrow);\n matrixTo[nextrow][nextcol] = i;\n }\n }\n\n }\n }\n\n double minDist = Double.MAX_VALUE;\n int minRow = 0;\n for (int row = 0; row < height(); row++) {\n if (minDist > energyMatrix[row][width() - 1]) {\n minDist = energyMatrix[row][width() - 1];\n minRow = row;\n }\n }\n\n int[] indices = new int[width()];\n for (int col = width() - 1, row = minRow; col >= 0; col--) {\n indices[col] = row;\n row -= matrixTo[row][col];\n }\n return indices;\n }", "public boolean isManySolution() {\n\n boolean all_zero_brs = false;\n\n for(int i = 0; i < this.NBrsEff; i++){\n if(this.isAllZeroBrs(i)) {\n all_zero_brs = true;\n }\n }\n\n return all_zero_brs;\n }", "private int[] bestFitModified(int[] chromosome) {\n\t\tint[] bins = new int[binCount];\n\t\tArrayList<Integer> cannotPackList = new ArrayList<Integer>();\n\n\t\t//honor chromosome listing when possible\n\t\tfor (int i = 0; i < chromosome.length; i++) {\n\t\t\t//if this bin isnt full & won't be after placement & this chrom hasnt gone off the end \n\t\t\t//(VERY RARE, only happens when binCount is reduced w/ elitism)\n\t\t\tif (chromosome[i] < bins.length && bins[chromosome[i]] + packageWeights[i] <= binSize) {\n\t\t\t\tbins[chromosome[i]] += packageWeights[i]; //put package into bin\n\t\t\t} else { //store those we can't honor\n\t\t\t\tchromosome[i] = -1;\n\t\t\t\tcannotPackList.add(new Integer(i)); //save all those packages whos original bins were full\n\t\t\t}\n\t\t}\n\n\t\t//best fit on all the rest whos bins were full up\n\t\tint tries = 0;\n\t\tfor (int j = 0; j < cannotPackList.size(); j++) {\n\t\t\tint i = cannotPackList.get(j);\n\t\t\tint bestBinIndex = -1;\n\n\t\t\twhile (bestBinIndex < 0 && tries < bins.length * 2) { //while we still havent found a bin to put this in and time isn't up\n\n\t\t\t\tint bestBinLeftOverSpace = binSize * 100; //how much space is left in the bin when the packages is placed in it (ideally 0 = full bin)\n\n\t\t\t\tfor (int bin = 0; bin < bins.length; bin++) {\n\t\t\t\t\t//if this bin is closer to full than the best bin and not overfilled save it\n\t\t\t\t\tif ((binSize - (bins[bin] + packageWeights[i])) >= 0 && (binSize - (bins[bin] + packageWeights[i])) < bestBinLeftOverSpace) {\n\t\t\t\t\t\tbestBinIndex = bin;\n\t\t\t\t\t\tbestBinLeftOverSpace = binSize - (bins[bin] + packageWeights[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (bestBinIndex < 0) { //if could not pack, dump out a bin (mutation)\n\t\t\t\t\tj = 0;\n\t\t\t\t\tint dumpBin = rand.nextInt(binCount);\n\t\t\t\t\tfor (int binIndex = dumpBin; binIndex < binCount; binIndex++) {\n\t\t\t\t\t\tbins[binIndex] = 0;\n\t\t\t\t\t\tfor (int chromIndex = 0; chromIndex < chromosome.length; chromIndex++) {\n\t\t\t\t\t\t\tif (chromosome[chromIndex] == binIndex) {\n\t\t\t\t\t\t\t\tchromosome[chromIndex] = -1;\n\t\t\t\t\t\t\t\tcannotPackList.add(new Integer(chromIndex));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\ttries++;\n\t\t\t}\n\n\t\t\tif (tries >= bins.length * 2) {\n\t\t\t\treturn null; //this chromosome is unsalvageable because it is impossible to fit the packages in the bins\n\t\t\t}\n\n\n\t\t\tbins[bestBinIndex] += packageWeights[i];\n\t\t\tchromosome[i] = bestBinIndex;\n\t\t\tcannotPackList.remove(j);\n\t\t\tj--;\n\t\t}\n\n\t\treturn chromosome;\n\t}", "boolean isNilMultipleBetMinimum();", "@Override\n protected void search() {\n \n obtainProblem();\n if (prioritizedHeroes.length > maxCreatures){\n frame.recieveProgressString(\"Too many prioritized creatures\");\n return;\n }\n bestComboPermu();\n if (searching){\n frame.recieveDone();\n searching = false;\n }\n }", "boolean isNilSingleBetMinimum();", "@Test\n public void intersectsWithAutoCarPolygon() {\n // creating the needed movement vector\n radar.loop();\n radar.loop();\n List<WorldObject> list = radar.getRelevantObjectsForAEB();\n assertTrue(list.stream().anyMatch(t -> t.getId().equals(\"roadsign_speed_40_1\")));\n radar.loop();\n list = radar.getRelevantObjectsForAEB();\n assertEquals(0, list.size());\n }", "private boolean estSurPlateau(Coordonnees emplacement) {\n return emplacement.getLigne() >= 0 && emplacement.getColonne() >= 0 && emplacement.getLigne() < Plateau.NOMBRE_COLONNE && emplacement.getColonne() < Plateau.NOMBRE_LIGNE;\n }", "private boolean isMomentOfRegret(int p, int[] stepV) {\n\t\tif (p > r + 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// we can go back k step and choose r out of k\n return (p <= r + 1) && (stepV[p] != ConstantValue.IMPOSSIBLE_VALUE);\n\n }", "public static float normalize(float res, float parcResistance[])\n\t{\n\t\tfloat ecart = 0.0f;\n\t\tfloat old_ecart = 100000000000000000.0f;\n\t\tfloat bestVN = 0.0f;\n\t\t\n\t\tfor (float vn : parcResistance)\n\t\t{\n\t\t\tecart = Math.abs(res - vn);\n\t\t\tif (ecart < old_ecart)\n\t\t\t{\n\t\t\t\tbestVN = vn;\n\t\t\t\told_ecart = ecart;\n\t\t\t}\n\t\t}\n\t\treturn bestVN;\n\t}", "private boolean isEligibleForRealMin() {\n return eligibleForRealMin;\n }", "public static void CheckPressure()\n {\n //Only start the compressor if we neeed air\n if(_isRuning && _compressor.getPressureSwitchValue())\n {\n _compressor.stop();\n _isRuning = false;\n }\n else if (!_isRuning && !_compressor.getPressureSwitchValue())\n {\n _compressor.start();\n _isRuning = true;\n }\n }", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "private boolean isFeasible(double[][] poly) {\n\t\tfor (double[] p : poly) {\n\t\t\tif (p[0] < 0 || p[0] > binWidth || p[1] < 0 || p[1] > binHeight) {\n\t\t\t\t// out of bounds -- infeasible!\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tfinal double[] bb = MathUtil.boundBox(poly);\n\n\t\tfor (PackedPoly fixed : packedPolys) {\n\t\t\tif (overlapFast(poly, bb, fixed)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean hasResidues();", "public boolean test(FluidVolume volume) {\n\t\treturn volume.test(getFluid()) && volume.hasAvailable(getAmount());\n\t}", "private boolean checkGreedyIronCurtain() {\r\n return (myself.health < 30 || enTotal.get(0) >= 8 || opponent.isIronCurtainActive || this.myTotal.get(0) < this.enTotal.get(0));\r\n }", "private boolean isSolvable() {\n\t\tshort permutations = 0; // the number of incorrect orderings of tiles\n\t\tshort currentTileViewLocationScore;\n\t\tshort subsequentTileViewLocationScore;\n\n\t\t// Start at the first tile\n\t\tfor (int i = 0; i < tiles.size() - 2; i++) {\n\t\t\tTile tile = tiles.get(i);\n\n\t\t\t// Determine the tile's location value\n\t\t\tcurrentTileViewLocationScore = computeLocationValue(tile\n\t\t\t\t\t.getCorrectLocation());\n\n\t\t\t// Compare the tile's location score to all of the tiles that\n\t\t\t// follow it\n\t\t\tfor (int j = i + 1; j < tiles.size() - 1; j++) {\n\t\t\t\tTile tSub = tiles.get(j);\n\n\t\t\t\tsubsequentTileViewLocationScore = computeLocationValue(tSub\n\t\t\t\t\t\t.getCorrectLocation());\n\n\t\t\t\t// If a tile is found to be out of order, increment the number\n\t\t\t\t// of permutations.\n\t\t\t\tif (currentTileViewLocationScore > subsequentTileViewLocationScore) {\n\t\t\t\t\tpermutations++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return whether number of permutations is even\n\t\treturn permutations % 2 == 0;\n\t}", "boolean isNilWagerMinimum();", "private boolean checkResolution(double tar_LonDPP) {\n double LonDPP = (this.lrlon - this.ullon) / 256;\n return LonDPP <= tar_LonDPP;\n }", "private boolean checkCurrentPlanarRegion()\n {\n FrameConvexPolygon2D captureRegion = captureRegionCalculator.getCaptureRegion();\n captureRegion.changeFrameAndProjectToXYPlane(worldFrame);\n\n icpControlPlane.scaleAndProjectPlanarRegionConvexHullOntoControlPlane(activePlanarRegion, tempProjectedPolygon, distanceFromEdgeForSwitching);\n\n double intersectionArea = convexPolygonTools.computeIntersectionAreaOfPolygons(captureRegion, tempProjectedPolygon);\n\n if (intersectionArea > minimumAreaForSearch)\n {\n activePlanarRegionConvexHull.setIncludingFrame(planeReferenceFrame, activePlanarRegion.getConvexHull());\n activePlanarRegionConvexHull.changeFrameAndProjectToXYPlane(worldFrame);\n\n yoActivePlanarRegion.set(activePlanarRegionConvexHull);\n\n icpControlPlane.projectPlanarRegionConvexHullOntoControlPlane(activePlanarRegion, activePlanarRegionConvexHullInControlFrame);\n yoActivePlanarRegionInControlPlane.set(activePlanarRegionConvexHullInControlFrame);\n return false;\n }\n\n return true;\n }", "private boolean check(int[] bestPoint) {\n\t\tif (bestPoint[0] > Mirror.spec || bestPoint[1] > Mirror.spec || bestPoint[0] < width - Mirror.spec\n\t\t\t\t|| bestPoint[1] < width - Mirror.spec) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}", "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 boolean checkRapelState () { return noOfRapels > 0; }", "public ArrayList getEqkRupturesNearSite() {\n\n //initializing the list for containing the EqkRuptures\n ArrayList probEqkList = new ArrayList();\n int numSources = eqkRupForecast.getNumSources();\n\n //Going over each and every source in the forecast\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex) {\n // get the ith source\n ProbEqkSource source = eqkRupForecast.getSource(sourceIndex);\n int numRuptures = source.getNumRuptures();\n\n //going over all the ruptures in the source\n for (int rupIndex = 0; rupIndex < numRuptures; ++rupIndex) {\n ProbEqkRupture rupture = source.getRupture(rupIndex);\n\n AbstractEvenlyGriddedSurface rupSurface = new EvenlyGridCenteredSurface((EvenlyGriddedSurface)rupture.getRuptureSurface());\n\n\n //getting the iterator for all points on the rupture\n ListIterator it = rupSurface.getAllByRowsIterator();\n //looping over all the rupture pt locations and if any of those lies\n //within the provided distance range then include the rupture in the list.\n while (it.hasNext()) {\n Location ptLoc = (Location) it.next();\n if (region.contains(ptLoc)) {\n probEqkList.add(rupture.clone());\n break;\n }\n }\n }\n }\n return probEqkList;\n }", "int gas_station() {\n int sol = 0; // numar minim de opriri\n int fuel = m; // fuel este cantitatea curenta de combustibil din rezervor (a.k.a cat a ramas)\n\n for (int i = 1; i <= n; ++i) {\n fuel -= (dist[i] - dist[i - 1]); // ma deplasez de la locatia anterioara la cea curenta\n // intotdeauna cand ajung intr-o benzinarie ma asigur am suficient\n // combustibil sa ajung la urmatoarea - initial pot sa ajung de la A la dist[1]\n\n // daca nu am ajuns in ultima benziarie\n // verifica daca trebuie sa reincarc (rezervor gol sau cantitate insuficienta pentru a ajunge la benzinaria urmatoare)\n if (i < n && (fuel == 0 || dist[i+1] - dist[i] > fuel)) {\n ++sol;\n fuel = m;\n }\n }\n\n return sol;\n }", "private boolean searchOptimalBox(Secret secretA, Secret secretB) {\n\n\t\tArrayList<Time> timesA = secretA.getTimes();\n\t\tArrayList<Time> timesB = secretB.getTimes();\n\n\t\t// first step: search optimal box\n\t\tTimeline timeline = new Timeline(\"timeline-\" + FileId.getId() + \"-\" + secretA.getFileName() + \"-smaller-\" +secretB.getFileName() + \".png\");\n\t\tthis.timelines.add(timeline);\n\t\tthis.optimalBox = BoxTest.optimalBox(timesA, timesB, timeline);\n\n\t\tif(this.optimalBox[0] != 0 || this.optimalBox[1] != 0) { \t\n\t\t\t// if a optimal box found, there are significant different results!\n\t\t\tlogger.info(secretA.getName() + \" < \" + secretB.getName() + \": optimal box \" + optimalBox[0] + \"-\" + optimalBox[1]);\n\t\t\tplotPool.plot(\"Filtered Measurments: Optimal Box (\" + secretA.getName() + \"-\" + secretB.getName() + \")\", this.optimalBox[0], this.optimalBox[1]);\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// there is no significant different result found! The user needs\n\t\t\t// to measure more times.\n\t\t\tlogger.warning(secretA.getName() + \" < \" + secretB.getName() + \": no significant different result found! You need to measure more times.\");\n\t\t\treturn false;\n\t\t}\n\t}", "@Test public void findPentagonalPyramidWithSmallestVolume()\n {\n PentagonalPyramid[] pArray = new PentagonalPyramid[100];\n PentagonalPyramid p1 = new PentagonalPyramid(\"PP1\", 10, 15);\n PentagonalPyramid p2 = new PentagonalPyramid(\"PP1\", 6, 3);\n PentagonalPyramid p3 = new PentagonalPyramid(\"PP1\", 17, 19);\n pArray[0] = p1;\n pArray[1] = p2;\n pArray[2] = p3;\n \n PentagonalPyramidList2 pList = new PentagonalPyramidList2(\"ListName\", \n pArray, 3);\n \n Assert.assertEquals(p2, \n pList.findPentagonalPyramidWithSmallestVolume());\n \n \n }", "public boolean fits(Point p) {\n\t\treturn boundary.contains(p);\n\t}", "boolean sprawdz_przegrana(){\n for(int i=0;i<figura_jakas.getWspolzedne_figorki().size();i++)\n if(sprawdz_kolizje_z_innymi_klockami(0))\n return true;\n return false;\n }", "public boolean canReproduce() {\r\n ArrayList<Cell> neighbours = getNeighbours(FIRSTLAYER);\r\n\r\n int numOfSameT = 0;\r\n int numOfEmpty = 0;\r\n int numOfFoodC = 0;\r\n\r\n for (Cell cell : neighbours) {\r\n if (isSameType(cell.getInhabit())) {\r\n numOfSameT++;\r\n } else if (cell.getInhabit() == null && isTerrainAccessiable(cell)) {\r\n numOfEmpty++;\r\n } else if (isEdible(cell.getInhabit())) {\r\n numOfFoodC++;\r\n }\r\n }\r\n\r\n return (numOfSameT >= numOfSameTypeNeighbourToReproduce() \r\n && numOfEmpty >= numOfEmptyToReproduce()\r\n && numOfFoodC >= numOfFoodCellToReproduce());\r\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 static boolean isLocalMaximum(Integer pid, double searchRadius) {\n\t\tdouble[] coordinates = points.get(pid);\n\t\tint density = pointID_Density.get(pid) == null ? 0 : pointID_Density.get(pid);\n\t\tEnvelope itemEnv;\n\t\t;\n\t\tList<Integer> result;\n\t\titemEnv = new Envelope(coordinates[0] - searchRadius, coordinates[0] + searchRadius,\n\t\t\t\tcoordinates[1] - searchRadius, coordinates[1] + searchRadius);\n\t\tresult = tree.query(itemEnv);\n\t\tfor (Integer nid : result) {\n\t\t\tdouble[] coordinates2 = points.get(nid);\n\t\t\tdouble dist = calculateDistanceBetweenPoints(coordinates, coordinates2);\n\t\t\tif (dist <= searchRadius) {\n\t\t\t\tdouble density_near = pointID_Density.get(nid) == null ? 0 : pointID_Density.get(nid);\n\t\t\t\tif (density_near > density)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public int findPartials(PegArray master, PegArray[] pegArray, int col, int totalPegs) {\r\n\t\tpartialMatch=-1;\r\n\t\tif(pegArray[col].getPeg(1).getLetter()!='X') partialMatch=0; \r\n\t\tif(partialMatch==0) {\r\n\t\t\tString key=\"\", guesses=\"\";\r\n\t\t\tfor(int y=0; y<totalPegs; y++) {\r\n\t\t\t\tkey+=master.getPeg(y).getLetter();\r\n\t\t\t\tguesses+=pegArray[col].getPeg(y).getLetter();\r\n\t\t\t}\r\n\t\t\tfor(int z=0; z<totalPegs; z++) {\r\n\t\t\t\tif(matched[z]==false) {\r\n\t\t\t\t\tint i=guesses.indexOf(key.charAt(z));\r\n\t\t\t\t\tif(i!=-1) { // match found\r\n\t\t\t\t\t\tif(i!=z) {\r\n\t\t\t\t\t\t\tpartialMatch++;\r\n\t\t\t\t\t\t\tguesses=guesses.substring(0, i)+\" \"+guesses.substring(i+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}\r\n\t\treturn partialMatch;\r\n\t}", "public void searchNearFreePark() {\n\t\tthis.generalRequest(LocalRequestType.PARK);\n\t}", "private void generateDaughterResSpaces(Block b, ResidualSpace res){\n int blx = b.getX_size();\n int bly = b.getY_size();\n int blz = b.getZ_size();\n\n int rsx = res.getX_size();\n int rsy = res.getY_size();\n int rsz = res.getZ_size();\n\n int rmx = rsx - blx;\n int rmy = rsy - bly;\n int rmz = rsz - blz;\n\n // Check if the smallest available parcel has smaller dimensions than one of the potential res spaces\n // There are six possible cases here (see table 2)\n int case_num = 1;\n if(rmx >= rmy && rmy >= rmz){\n case_num = 1;\n }\n else if(rmy >= rmx && rmx >= rmz){\n case_num = 2;\n }\n else if(rmx >= rmz && rmz >= rmy){\n case_num = 3;\n }\n else if(rmz >= rmx && rmx >= rmy){\n case_num = 4;\n }\n else if(rmy >= rmz && rmz >= rmx){\n case_num = 5;\n }\n else if(rmz >= rmy && rmy >= rmx){\n case_num = 6;\n }\n else{\n try {\n throw new Exception(\"Something went wrong in generateDaughterResSpaces, \" +\n \"else case should not be triggered\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n Coordinate drs_x_loc = new Coordinate(b.getLocation().getX() + blx,\n b.getLocation().getY(),\n b.getLocation().getZ());\n int drs_x_x = rmx;\n int drs_x_y = -1; //To be done\n int drs_x_z = -1; //To be done\n\n Coordinate drs_y_loc = new Coordinate(b.getLocation().getX(),\n b.getLocation().getY() + bly,\n b.getLocation().getZ());\n int drs_y_x = -1; //To be done\n int drs_y_y = rmy;\n int drs_y_z = -1; //To be done\n\n Coordinate drs_z_loc = new Coordinate(b.getLocation().getX(),\n b.getLocation().getY(),\n b.getLocation().getZ() + blz);\n int drs_z_x = -1; //To be done\n int drs_z_y = -1; //To be done\n int drs_z_z = rmz;\n\n // drs_x = 0, drs_y = 1, drs_z = 0\n int max_order = -1; //To be done\n int med_order = -1; //To be done\n int min_order = -1; //To be done\n\n\n // Apply the cases\n switch (case_num){\n case 1:\n max_order = 0;\n med_order = 1;\n min_order = 2;\n\n drs_x_y = rsy;\n drs_x_z = rsz;\n\n drs_y_x = blx;\n drs_y_z = rsz;\n\n drs_z_x = blx;\n drs_z_y = bly;\n break;\n case 2:\n max_order = 1;\n med_order = 0;\n min_order = 2;\n\n drs_x_y = bly;\n drs_x_z = rsz;\n\n drs_y_x = rsx;\n drs_y_z = rsz;\n\n drs_z_x = blx;\n drs_z_y = bly;\n break;\n case 3:\n max_order = 0;\n med_order = 2;\n min_order = 1;\n\n drs_x_y = rsy;\n drs_x_z = rsz;\n\n drs_y_x = blx;\n drs_y_z = blz;\n\n drs_z_x = blx;\n drs_z_y = rsy;\n break;\n case 4:\n max_order = 2;\n med_order = 0;\n min_order = 1;\n\n drs_x_y = rsy;\n drs_x_z = blz;\n\n drs_y_x = blx;\n drs_y_z = blz;\n\n drs_z_x = rsx;\n drs_z_y = rsy;\n break;\n case 5:\n max_order = 1;\n med_order = 2;\n min_order = 0;\n\n drs_x_y = bly;\n drs_x_z = blz;\n\n drs_y_x = rsx;\n drs_y_z = rsz;\n\n drs_z_x = rsx;\n drs_z_y = bly;\n break;\n case 6:\n max_order = 2;\n med_order = 1;\n min_order = 0;\n\n drs_x_y = bly;\n drs_x_z = blz;\n\n drs_y_x = rsx;\n drs_y_z = blz;\n\n drs_z_x = rsx;\n drs_z_y = rsy;\n break;\n }\n\n int drs_x_type = 0; // 0 = min, 1 = med, 2 = max\n int drs_y_type = 0;\n int drs_z_type = 0;\n\n if(min_order == 0){\n drs_x_type = 0;\n }\n else if(min_order == 1){\n drs_y_type = 0;\n }\n else{\n drs_z_type = 0;\n }\n\n if(med_order == 0){\n drs_x_type = 1;\n }\n else if(med_order == 1){\n drs_y_type = 1;\n }\n else{\n drs_z_type = 1;\n }\n\n if(max_order == 0){\n drs_x_type = 2;\n }\n else if(max_order == 1){\n drs_y_type = 2;\n }\n else{\n drs_z_type = 2;\n }\n\n // Create the residual spaces\n ResidualSpace drs_x = new ResidualSpace(drs_x_loc, drs_x_x, drs_x_y, drs_x_z, drs_x_type);\n ResidualSpace drs_y = new ResidualSpace(drs_y_loc, drs_y_x, drs_y_y, drs_y_z, drs_y_type);\n ResidualSpace drs_z = new ResidualSpace(drs_z_loc, drs_z_x, drs_z_y, drs_z_z, drs_z_type);\n\n boolean add_drs_x = aParcelFitsInRes(drs_x);\n boolean add_drs_y = aParcelFitsInRes(drs_y);\n boolean add_drs_z = aParcelFitsInRes(drs_z);\n\n // Check if something fits in the med and max res spaces, if not transfer all possible space to the min res space\n if(drs_x_type == 1 || drs_x_type == 2){\n if(!add_drs_x){\n // Nothing fits in x space but it is med or max transfer possible to min state\n if(drs_y_type == 0){\n drs_y = transfer_space(drs_x, drs_y);\n }\n else{\n drs_z = transfer_space(drs_x, drs_z);\n }\n }\n }\n\n if(drs_y_type == 1 || drs_y_type == 2){\n if(!add_drs_y){\n // Nothing fits in x space but it is med or max transfer possible to min state\n if(drs_x_type == 0){\n drs_x = transfer_space(drs_y, drs_x);\n }\n else{\n drs_z = transfer_space(drs_y, drs_z);\n }\n }\n }\n\n if(drs_z_type == 1 || drs_z_type == 2){\n if(!add_drs_z){\n // Nothing fits in x space but it is med or max transfer possible to min state\n if(drs_x_type == 0){\n drs_x = transfer_space(drs_z, drs_x);\n }\n else{\n drs_y = transfer_space(drs_z, drs_y);\n }\n }\n }\n\n // Add the boxes in \"min - max - med\" order\n // drs_x = 0, drs_y = 1, drs_z = 0\n if(min_order == 0){\n if(add_drs_x){\n rs_stack.add(drs_x);\n }\n }\n else if(min_order == 1){\n if(add_drs_y) {\n rs_stack.add(drs_y);\n }\n }\n else{\n if(add_drs_z) {\n rs_stack.add(drs_z);\n }\n }\n\n if(med_order == 0){\n if(add_drs_x) {\n rs_stack.add(drs_x);\n }\n }\n else if(med_order == 1){\n if(add_drs_y) {\n rs_stack.add(drs_y);\n }\n }\n else{\n if(add_drs_z) {\n rs_stack.add(drs_z);\n }\n }\n\n if(max_order == 0){\n if(add_drs_x) {\n rs_stack.add(drs_x);\n }\n }\n else if(max_order == 1){\n if(add_drs_y) {\n rs_stack.add(drs_y);\n }\n }\n else{\n if(add_drs_z) {\n rs_stack.add(drs_z);\n }\n }\n }", "public void checkRecipe() {\n \t\tIStationRecipe previous = currentRecipe;\n \t\tif ((currentRecipe == null) || !currentRecipe.matches(crafting)) {\n \t\t\tcurrentRecipe = BetterStorageCrafting.findMatchingStationRecipe(crafting);\n \t\t\tif (currentRecipe == null)\n \t\t\t\tcurrentRecipe = VanillaStationRecipe.findVanillaRecipe(this);\n \t\t}\n \t\tif ((previous != currentRecipe) || !recipeOutputMatches()) {\n \t\t\tprogress = 0;\n \t\t\tcraftingTime = ((currentRecipe != null) ? currentRecipe.getCraftingTime(crafting) : 0);\n \t\t\texperience = ((currentRecipe != null) ? currentRecipe.getExperienceDisplay(crafting) : 0);\n \t\t\tif (!outputIsReal)\n \t\t\t\tfor (int i = 0; i < output.length; i++)\n \t\t\t\t\toutput[i] = null;\n \t\t}\n \t\tArrays.fill(requiredInput, null);\n \t\tif (currentRecipe != null)\n \t\t\tcurrentRecipe.getCraftRequirements(crafting, requiredInput);\n \t\tupdateLastOutput();\n \t}", "static boolean parkingSpot(int[] carDimensions, int[][] parkingLot, int[] luckySpot){\n if (!is_spot_fit_car(carDimensions, luckySpot)) return false;\n\n // does the spot is empty\n if (!is_lucky_spot_empty(parkingLot, luckySpot)) return false;\n\n //does a free entry large enough to the spot\n if (!is_entrance_exist(parkingLot, luckySpot)) return false;\n\n return true;\n }", "public boolean carParkEmpty() {\r\n\t\tif (getNumCars() == 0 && getNumMotorCycles() == 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "boolean isSetFractionalMinimum();", "private boolean checkGreedyEnergy() {\r\n return myTotal.get(2) < 10 || (myTotal.get(2) < 13 && myTotal.get(2) <= enTotal.get(2));\r\n }", "public void checkRockets() {\n for (Rocket rocket : rockets) {\n for (Ufo ufo : ufos) {\n if (ufo.intersects(rocket)) {\n ufo.die();\n rocket.die();\n }\n }\n\n if (rocket.getY() <= 0)\n rocket.die();\n }\n }", "public boolean land() {\n\t\treturn ( Math.random() > this.crashProb);\r\n\t}", "public void isSafe() {\n\t\tsafetyLog = new boolean[proc];\r\n\r\n\t\tfor (int i = 0; i < proc; i++) {\r\n\t\t\tsafetyLog[i] = true;\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < proc; i++) {\r\n\t\t\tfor (int j = 0; j < res; j++) {\r\n\t\t\t\tif (need[i][j] > available[0][j]) {\r\n\t\t\t\t\tsafetyLog[i] = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/*System.out\r\n\t\t\t\t.println(\"Following processes are safe and unsafe to start with\");\r\n\r\n\t\tfor (int i = 0; i < proc; i++) {\r\n\t\t\tif (safetyLog[i]) {\r\n\t\t\t\tSystem.out.println(\"P\" + i + \": Safe\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"P\" + i + \": Un-Safe\");\r\n\t\t\t}\r\n\t\t}*/\r\n\r\n\t}", "public static void scanDirty(List<Intersection> sections){\n for(int i = 0; i<sections.size(); i++){\n Intersection section = sections.get(i);\n if(section.dirty != 0){\n int startI = i;\n double min = Double.MAX_VALUE;\n for(int j = 0; j<sections.size(); j++){\n if(j == startI){\n continue;\n }\n Intersection other = sections.get(j);\n\n double m = Vector3DOps.mag(Vector3DOps.difference(other.location, section.location));\n if(m < min){\n min = m;\n }\n if( m < Math.abs(section.dirty) ){\n System.out.println(\"should take it: \" + other.dirty);\n //System.out.println(\"removing: \" + i + \", \" + m + \" < \" + section.dirty);\n //System.out.println(\"\\t by: \" + j + \" , \" + other.dirty);\n if(startI > i){\n continue;\n }\n sections.remove(i);\n i--;j--;\n }\n }\n if( startI > i){\n System.out.println(\"removed\");\n } else{\n System.out.println(\"left\");\n }\n }\n }\n\n\n }", "public abstract boolean canFit(ParkingSpot spot);", "@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 checkSolutions() {\n\t\tfor (int i = 0; i < population; ++i) {\n\t\t\tif (populationArray.get(i).getFitness() == 0) {\n\t\t\t\tsolution = populationArray.get(i);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkSubBoundary(Index3D idx, Index3D center) {\n if (idx.i1() - center.i1() <= subVolumeSizeRadius &&\n idx.i2() - center.i2() <= subVolumeSizeRadius &&\n idx.i3() - center.i3() <= subVolumeSizeRadius &&\n center.i1() - idx.i1() <= subVolumeSizeRadius &&\n center.i2() - idx.i2() <= subVolumeSizeRadius &&\n center.i3() - idx.i3() <= subVolumeSizeRadius\n ) {\n return true;\n } else {\n return false;\n }\n }", "public boolean checkIfCarsLeftOverlap(Car [] carsLeft, int maxWidth, int minWidth, int carStartY, int carStepsize)\n\t{\n\t\tif(x > minWidth && x < maxWidth && y >= carStartY && y <= carStartY + carStepsize * 2)\n\t\t{\n\t\t\tanyCarLeftOverlap = false;\n\t\t\tfor(int i = 0; i < carsLeft.length; i++)\n\t\t\t{\n\t\t\t\tint bottomRightCarY = carsLeft[i].getY() + Frogger.CAR_LENGTH;\n\t\t\t\tint bottomRightFrogY = y + frogSize;\n\t\t\t\tint bottomRightCarX = carsLeft[i].getX() + Frogger.CAR_LENGTH;\n\t\t\t\tint bottomRightFrogX = x + frogSize;\n\t\t\t\tint topLeftCarY = carsLeft[i].getY() + Frogger.LOG_ACTUAL_START_Y;\n\t\t\t\tint topLeftCarX = carsLeft[i].getX();\n\t\t\t\t\n\t\t\t\tif(bottomRightCarY < y || topLeftCarY > bottomRightFrogY\n\t\t\t\t\t|| bottomRightCarX < x || topLeftCarX > bottomRightFrogX)\n\t\t\t\t{\n\t\t\t\t\tcarLeftOverlap = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcarLeftOverlap = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(carLeftOverlap == false)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tanyCarLeftOverlap = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn anyCarLeftOverlap;\n\t}", "public boolean sps() {\n\t\tupdateFrontUnknown();\n\t\tboolean successful = false;\n\t\tfor (int i = 0; i < frontUnknown.size(); i++) {\n\t\t\tint x = frontUnknown.get(i)[0];\n\t\t\tint y = frontUnknown.get(i)[1];\n\t\t\tArrayList<int[]> knownNeighbors = findAdjacentSafe(frontUnknown.get(i));\n\t\t\tfor (int[] j: knownNeighbors) {\n\t\t\t\t//all clear neighbours\n\t\t\t\tif (answerMap[j[0]][j[1]] == findAdjacentMark(j).size()) {\n\t\t\t\t\tprobe(x, y);\n\t\t\t\t\tsuccessful = true;\n\t\t\t\t\tSystem.out.println(\"SPS: probe[\" + x + \",\" + y + \"]\");\n\t\t\t\t\tspsCount++;\n\t\t\t\t\tshowMap();\n\t\t\t\t\ti--;\n\t\t\t\t\tupdateFrontUnknown();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//all marked neighbours\n\t\t\t\t\tif (answerMap[j[0]][j[1]] == findAdjacentRisk(j).size()) {\n\t\t\t\t\t\tmark(x, y);\n\t\t\t\t\t\tsuccessful = true;\n\t\t\t\t\t\tSystem.out.println(\"SPS: probe[\" + x + \",\" + y + \"]\");\n\t\t\t\t\t\tspsCount++;\n\t\t\t\t\t\tshowMap();\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tupdateFrontUnknown();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn successful;\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 boolean isVampire(int i, int a1000, int a100, int a10, int a1) {\n boolean[] vars = new boolean[12];\n vars[0] = (a1000 * 10 + a100) * (a10 * 10 + a1) == i;\n vars[1] = (a1000 * 10 + a100) * (a10 + a1 * 10) == i;\n vars[2] = (a1000 + a100 * 10) * (a10 * 10 + a1) == i;\n vars[3] = (a1000 + a100 * 10) * (a10 + a1 * 10) == i;\n vars[4] = (a1000 * 10 + a10) * (a100 * 10 + a1) == i;\n vars[5] = (a1000 * 10 + a10) * (a100 + a1 * 10) == i;\n vars[6] = (a1000 + a10 * 10) * (a100 * 10 + a1) == i;\n vars[7] = (a1000 + a10 * 10) * (a100 + a1 * 10) == i;\n vars[8] = (a1000 * 10 + a1) * (a100 * 10 + a10) == i;\n vars[9] = (a1000 + a1 * 10) * (a100 * 10 + a10) == i;\n vars[10] = (a1000 * 10 + a1) * (a100 + a10 * 10) == i;\n vars[11] = (a1000 + a1 * 10) * (a100 + a10 * 10) == i;\n for (int j = 0; j < vars.length; j++) {\n if (vars[j] == true) {\n return true;\n }\n }\n return false;\n }", "private void estimateFlatEarthPolynomial() {\n int minLine = 0;\n int maxLine = sourceImageHeight;\n int minPixel = 0;\n int maxPixel = sourceImageWidth;\n \n Rectangle rectangle = new Rectangle();\n rectangle.setSize(maxPixel, maxLine);\n \n // int srpPolynomialDegree = 5; // for flat earth phase\n int numberOfCoefficients = numberOfCoefficients(srpPolynomialDegree);\n \n double[][] position = distributePoints(srpNumberPoints, rectangle);\n \n // setup observation and design matrix\n DoubleMatrix y = new DoubleMatrix(srpNumberPoints);\n DoubleMatrix A = new DoubleMatrix(srpNumberPoints, numberOfCoefficients);\n \n double masterMinPi4divLam = (-4 * Math.PI * Constants.lightSpeed) / masterMetadata.radar_wavelength;\n double slaveMinPi4divLam = (-4 * Math.PI * Constants.lightSpeed) / slaveMetadata.radar_wavelength;\n \n // Loop throu a vector or distributedPoints()\n for (int i = 0; i < srpNumberPoints; ++i) {\n \n double line = position[i][0];\n double pixel = position[i][1];\n \n // compute azimuth/range time for this pixel\n final double masterTimeRange = pix2tr(pixel, masterMetadata);\n \n // compute xyz of this point : sourceMaster\n Point3d xyzMaster = lp2xyz(line, pixel, masterMetadata, masterOrbit);\n \n final Point2d slaveTimeVector = xyz2t(xyzMaster, slaveMetadata, slaveOrbit);\n final double slaveTimeRange = slaveTimeVector.x;\n \n // observation vector\n y.put(i, (masterMinPi4divLam * masterTimeRange) - (slaveMinPi4divLam * slaveTimeRange));\n \n // set up a system of equations\n // ______Order unknowns: A00 A10 A01 A20 A11 A02 A30 A21 A12 A03 for degree=3______\n double posL = normalize(line, minLine, maxLine);\n double posP = normalize(pixel, minPixel, maxPixel);\n \n int index = 0;\n \n for (int j = 0; j <= srpPolynomialDegree; j++) {\n for (int k = 0; k <= j; k++) {\n // System.out.println(\"A[\" + i + \",\" + index + \"]: \"\n // + Math.pow(posL, (float) (j - k)) * Math.pow(posP, (float) k));\n A.put(i, index, (Math.pow(posL, (double) (j - k)) * Math.pow(posP, (double) k)));\n index++;\n }\n }\n }\n \n // Fit polynomial through computed vector of phases\n DoubleMatrix Atranspose = A.transpose();\n DoubleMatrix N = Atranspose.mmul(A);\n DoubleMatrix rhs = Atranspose.mmul(y);\n \n // TODO: validate Cholesky decomposition of JBLAS: see how it is in polyfit and reuse!\n \n // this should be the coefficient of the reference phase\n flatEarthPolyCoefs = Solve.solve(N, rhs);\n \n /*\n System.out.println(\"*******************************************************************\");\n System.out.println(\"_Start_flat_earth\");\n System.out.println(\"*******************************************************************\");\n System.out.println(\"Degree_flat:\" + polyDegree);\n System.out.println(\"Estimated_coefficients_flatearth:\");\n int coeffLine = 0;\n int coeffPixel = 0;\n for (int i = 0; i < numberOfCoefficients; i++) {\n if (flatEarthPolyCoefs.get(i, 0) < 0.) {\n System.out.print(flatEarthPolyCoefs.get(i, 0));\n } else {\n System.out.print(\" \" + flatEarthPolyCoefs.get(i, 0));\n }\n \n System.out.print(\" \\t\" + coeffLine + \" \" + coeffPixel + \"\\n\");\n coeffLine--;\n coeffPixel++;\n if (coeffLine == -1) {\n coeffLine = coeffPixel;\n coeffPixel = 0;\n }\n }\n System.out.println(\"*******************************************************************\");\n System.out.println(\"_End_flat_earth\");\n System.out.println(\"*******************************************************************\");\n */\n \n // TODO: test inverse : when cholesky is finished\n // // ______Test inverse______\n // for (i=0; i<Qx_hat.lines(); i++)\n // for (j=0; j<i; j++)\n // Qx_hat(j,i) = Qx_hat(i,j);// repair Qx_hat\n // const real8 maxdev = max(abs(N*Qx_hat-eye(real8(Qx_hat.lines()))));\n // INFO << \"flatearth: max(abs(N*inv(N)-I)) = \" << maxdev;\n // INFO.print();\n // if (maxdev > .01)\n // {\n // ERROR << \"Deviation too large. Decrease degree or number of points?\";\n // PRINT_ERROR(ERROR.get_str())\n // throw(some_error);\n // }\n // else if (maxdev > .001)\n // {\n // WARNING << \"Deviation quite large. Decrease degree or number of points?\";\n // WARNING.print();\n // }\n // else\n // {\n // INFO.print(\"Deviation is OK.\");\n // }\n // // ______Some other stuff, scale is ok______\n // matrix<real8> y_hat = A * rhs;\n // matrix<real8> e_hat = y - y_hat;\n }", "private boolean needXray() {\n\t\treturn Math.random() < XRAY_PROBABILITY;\n\t}", "private static ArrayList<Map> checkAvailability(ArrayList<Map> res) {\n\t\tArrayList<Map> availableSlot = new ArrayList<Map>();\r\n\t\tfor (Map center : res) {\r\n\t\t\tint age = (int) center.get(\"min_age_limit\");\r\n\t\t\tif(age == AGE) {\r\n\t\t\t\tint dose1 = (int) center.get(\"available_capacity_dose1\");\r\n\t\t\t\tif(dose1>0) {\r\n\t\t\t\t\tSystem.out.println(\"available for 45+ :\" + center);\r\n\t\t\t\t\tavailableSlot.add(center);\r\n\t\t\t\t\t//END = true;\r\n\t\t\t\t}\r\n\t\t\t}else if( age == 18) {\r\n\t\t\t\tint dose1 = (int) center.get(\"available_capacity_dose1\");\r\n\t\t\t\tif(dose1>0) {\r\n\t\t\t\t\tSystem.out.println(\"available for 18+ :\" +center);\r\n\t\t\t\t\tavailableSlot.add(center);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn availableSlot;\r\n\t}", "public boolean finished(){\n for (int i = 0; i < dimensions[0]; i++){\n for (int j = 0; j<dimensions[0]; j++){\n if (grids[i][j].getValue() == 0)\n return false;\n }\n \n }\n return true;\n \n }", "public void onlyValidationPhase(int smallestSize) {\n\t\t// iterate over all secret combination\n\t\tfor (Secret secretA : this.dataSet.getSecrets()) {\n\t\t\tfor (Secret secretB : this.dataSet.getSecrets()) {\n\t\t\t\tif(secretA != secretB) {\n\t\t\t\t\tif(this.optimalBox[0] == 0.0 && this.optimalBox[1] == 0.0) {\n\t\t\t\t\t\tif(searchOptimalBox(secretA, secretB)) {\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.optimalBox = new double[2];\n\t\t\t\t\t\tthis.optimalBox[0] = 0.0;\n\t\t\t\t\t\tthis.optimalBox[1] = 0.0;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(smallestSize != 0) {\n\t\t\t\t\t\t\tplotPool.plot(\"Filtered Measurments: User Input Optimal Box (\" + secretA.getName() + \"-\" + secretB.getName() + \")\", this.optimalBox[0], this.optimalBox[1]);\n\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.warning(secretA.getName() + \" < \" + secretB.getName() + \": no significant different result found! You need to measure more times.\");\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}", "private boolean growSapling(World world, int x, int y, int z, Random rand)\r\n {\r\n \t// Total value of this crop\r\n \tfloat value = 0;\r\n \t\r\n \t// Not bright enough for the sapling to grow.\r\n \tif (world.getBlockLightValue(x, y + 1, z) < SaplingMinimumLight) \r\n \t\treturn true;\r\n \t\r\n \t// Radius to check nearby ground blocks.\r\n \tint r = 2;\r\n \tfor (int i = -r + x; i <= r + x; i++)\r\n \tfor (int k = -r + z; k <= r + z; k++)\r\n \tfor (int j = -2 + y; j <= 0 + y; j++)\r\n \t{\r\n \t\t// Ignore corners, sapling block and mounds next to sapling. Maintain surface gradient!\r\n \t\tif (Math.abs(i - x) <= 1 && j == y && Math.abs(k - z) <= 1) continue;\r\n \t\tif (i == x && j == (y - 1) && k == z) continue;\r\n \t\tif (Math.abs(i - x) == r && Math.abs(k - z) == r) continue;\r\n \t\t\r\n \t\tBlock block = world.getBlock(i, j, k);\r\n \t\tMaterial above = world.getBlock(i, j + 1, k).getMaterial();\r\n \t\tif (SaplingSoilBlocks.contains(block) && (above == Material.air || above == Material.vine || above == Material.plants || above == Material.snow || above == Material.leaves)) \r\n \t\t{\r\n \t\t\t// Light level above soil\r\n \t\t\tint light = world.getBlockLightValue(i, j + 1, k);\r\n\r\n \t\t\t// Light is \"natural\" if consistent over 4 y levels\r\n \t\t\tboolean natural = true;\r\n \t\t\tfor (int l = 2; l <= 4; l++)\r\n \t\t\t\tif (world.getBlockLightValue(i, j + 1, k) != light) \r\n \t\t\t\t\tnatural = false;\r\n \t\t\t\r\n \t\t\tvalue += (float)light * (natural ? 1.0f : 0.75f) * (above == Material.plants || above == Material.snow ? 0.75f : 1.0f) * (above == Material.vine || above == Material.leaves ? 0.5f : 1.0f);\r\n \t\t}\r\n \t}\r\n \t\r\n \tif (rand.nextDouble() < (GrowthMultiplierSapling * 0.25d / Math.pow(2.0d, (300.0d - value) / 75.0d)))\r\n \t\treturn !(new WorldGenKawaiiTree(this)).generate(world, rand, x, y, z);\r\n \t\r\n \treturn true;\r\n }", "public static boolean allElmtColUnderIs0(Matriks m, int iBrs, int iKol) {\n boolean is0 = true;\n int i=iBrs;\n while (i<m.baris && is0) {\n is0 = m.ELMT[i][iKol] == 0;\n i++;\n }\n return is0;\n }", "public boolean checkWithFragmentingWarheadRocketJump ()\n {\n Map<Square, List<Player>> squarePlayerListMap = checkRocketJump();\n List<Player> playerList;\n\n for (Square squareIterate : squarePlayerListMap.keySet())\n {\n\n for (Player playerIterate : squarePlayerListMap.get(squareIterate))\n {\n playerList = new ArrayList<>();\n\n playerList.addAll(playerIterate.getSquare().getPlayerList());\n playerList.remove(player);\n\n if (playerList.size()>1)\n return true;\n\n }\n }\n\n return false;\n }", "public boolean land() {\n\t\treturn (Math.random() > this.crashProb);\r\n\t}", "public static void testFreezeDiverged(){\n\t\t\n\t\t\n\t\t\n\t\tImageJ ij = new ImageJ();\n\t\t\n\t\tString outputDir = \"E:\\\\testing\\\\Java Backbone Fitting\\\\test interpolation fix\\\\\";\n\t\tString inputFileName = outputDir+\"Berlin@Berlin_2NDs_B_Square_SW_96-160_201411201541.prejav\";\n\t\t\t\n\t\tFittingParameters spp = FittingParameters.getSinglePassParams();\n\t\tspp.freezeDiverged = true;\n\t\tspp.leaveFrozenBackbonesAlone = true;\n\t\t\n\n\t\tExperiment ex = new Experiment(inputFileName);\n\t\tVector<Track> newTracks = new Vector<Track>();\n//\t\tint trackInd = 47;\n\t\tfor (int trackInd=67; trackInd<75; trackInd++){\n\t\t\t\n\t\t\tBackboneFitter bbf = new BackboneFitter(ex.getTrackFromInd(trackInd), spp);\n\t\t\tbbf.fitTrack();\n\t\t\tif (bbf.getTrack()!=null) newTracks.add(bbf.getTrack());\n\t\t}\n\t\tExperiment newExperiment = new Experiment(ex, newTracks);\n\t\tnewExperiment.showEx();\n\t\t\n\t\t\n\t\t\n\t\tij.quit();\n\t\t\n\t}", "public void calibrationPhase() {\n\t\t// iterate over all secret combination\n\t\tfor (Secret secretA : this.dataSet.getSecrets()) {\n\t\t\tfor (Secret secretB : this.dataSet.getSecrets()) {\n\t\t\t\tif(secretA != secretB) {\n\t\t\t\t\tif(this.optimalBox[0] == 0.0 && this.optimalBox[1] == 0.0) {\n\t\t\t\t\t\tif(searchOptimalBox(secretA, secretB)) {\n\t\t\t\t\t\t\tint smallestSize = searchSmallestSize(secretA, secretB);\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.optimalBox = new double[2];\n\t\t\t\t\t\tthis.optimalBox[0] = 0.0;\n\t\t\t\t\t\tthis.optimalBox[1] = 0.0;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint smallestSize = searchSmallestSize(secretA, secretB);\n\t\t\t\t\t\tif(smallestSize != 0) {\n\t\t\t\t\t\t\tplotPool.plot(\"Filtered Measurments: User Input Optimal Box (\" + secretA.getName() + \"-\" + secretB.getName() + \")\", this.optimalBox[0], this.optimalBox[1]);\n\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.warning(secretA.getName() + \" < \" + secretB.getName() + \": no significant different result found! You need to measure more times.\");\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "private boolean usesies(ActivePokemon p) {\n boolean used = false;\n for (Stat stat : Stat.BATTLE_STATS) {\n if (p.getStage(stat) < 0) {\n p.getStages().setStage(stat, 0);\n used = true;\n }\n }\n return used;\n }", "@Override\n public int match(LocalAbstractObject object) {\n // The GH-partitioning is defined that object (<=) fall in 0 partition and the others in 1 partition.\n // includeUsingPrecompDist used <= as well, so calling it against leftPivot and then against rightPivot is correct.\n if (object.includeUsingPrecompDist(leftPivot, halfPivotDistance))\n return PART_ID_LEFT;\n if (object.includeUsingPrecompDist(rightPivot, halfPivotDistance))\n return PART_ID_RIGHT;\n\n // Definition of GH partitioning.\n if (leftPivot.getDistance(object) <= rightPivot.getDistance(object))\n return PART_ID_LEFT;\n else \n return PART_ID_RIGHT;\n }", "public void search() {\r\n\t\tfloat dist = getDistance(permutationPrev);\r\n\t\tfloat delta = 0;\r\n\t\tfloat prob = 0;\r\n\r\n\t\tboolean accept = false;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\twhile ((temperature > minTemperature) || (nIter > 0)) {\r\n\t\t\tdisturbPermut(permutationPrev);\r\n\t\t\tdelta = getDistance(permutation) - dist;\r\n\r\n\t\t\tprob = (float) Math.exp(-delta / temperature);\r\n\t\t\taccept = ((delta < 0) || (delta * (prob - rand.nextFloat()) >= 0));\r\n\r\n\t\t\tif (accept) {\r\n\t\t\t\tacceptPermution(permutation);\r\n\t\t\t\tdist = delta + dist;\r\n\t\t\t}\r\n\r\n\t\t\ttemperature *= cBoltzman;\r\n\t\t\tnIter--;\r\n\r\n\t\t\ttrace.add(dist);\r\n\t\t}\r\n\t\tshortestDist = dist;\r\n\t}" ]
[ "0.5525171", "0.5482735", "0.52922565", "0.5201062", "0.51645607", "0.5155019", "0.5119507", "0.51106244", "0.5107735", "0.5105647", "0.50790095", "0.5036587", "0.5030676", "0.5005828", "0.5003468", "0.49984375", "0.49844527", "0.49720505", "0.49585342", "0.49469712", "0.49334535", "0.49156094", "0.49092388", "0.4898662", "0.48935333", "0.48903543", "0.48873186", "0.48849127", "0.4884892", "0.48658976", "0.48627022", "0.4859518", "0.48560053", "0.4848539", "0.48419064", "0.48286185", "0.48197085", "0.48115265", "0.47967175", "0.47917184", "0.47782806", "0.47754768", "0.47751215", "0.47701475", "0.47685546", "0.47643253", "0.47597522", "0.47591475", "0.47580078", "0.47530615", "0.47451168", "0.47418866", "0.47373286", "0.4733828", "0.4729501", "0.4724519", "0.47212827", "0.47178334", "0.4714086", "0.47139817", "0.4712241", "0.4711446", "0.4705372", "0.46986237", "0.46983668", "0.46946332", "0.46852225", "0.4685107", "0.46830514", "0.46810088", "0.46807253", "0.46775427", "0.4675847", "0.46741423", "0.4673553", "0.4672424", "0.46717566", "0.46694803", "0.4666883", "0.46644035", "0.46621263", "0.46598986", "0.46597", "0.46563944", "0.46536732", "0.46517152", "0.46503356", "0.46472546", "0.4639308", "0.46356723", "0.46318218", "0.46232077", "0.462228", "0.4622162", "0.46165168", "0.46091923", "0.46089488", "0.46040028", "0.45998454", "0.45987913" ]
0.6977575
0
TODO: not sure if this makes a deep copy
public Stack<ResidualSpace> getRs_stack() { return (Stack<ResidualSpace>) rs_stack.clone(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Object clone() {\n return super.clone();\n }", "public void copy() {\n\n\t}", "private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException { // semi-copy\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}", "@Override\n protected Object clone() throws CloneNotSupportedException {\n\n return super.clone();\n }", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\n\tpublic void copyReferences() {\n\t\tlateCopies = new LinkedHashMap<>();\n\n\t\tsuper.copyReferences();\n\n\t\tputAll(lateCopies);\n\t\tlateCopies = null;\n\t}", "static void setCopying(){isCopying=true;}", "@Override\n public FieldEntity copy()\n {\n return state.copy();\n }", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "private Object[] deepCopy()\n {\n Object[] newList = new Object[size];\n\n int newListPosition = 0;\n for (int i =0; i < size; i++)\n {\n if (list[i] != null)\n {\n newList[newListPosition++] = list[i];\n }\n }\n\n return newList;\n }", "Prototype makeCopy();", "ArrayList deepCopyShapeList(List aShapeList){\n ArrayList newList = new ArrayList();\r\n\r\n if (aShapeList.size() > 0) {\r\n Iterator iter = aShapeList.iterator();\r\n\r\n while (iter.hasNext())\r\n newList.add(((TShape)iter.next()).copy());\r\n }\r\n return\r\n newList;\r\n}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\t\r\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tpublic Buffer copy() {\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\treturn super.clone();\n\t}", "public CFExp deepCopy(){\r\n return this;\r\n }", "public Expression deepCopy()\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}", "public abstract INodo copy();", "protected Factorization copy(){\n Factorization newFactor = new Factorization(this.mdc);\n //shallow copy\n newFactor.setRecipes(recipes);\n newFactor.setIngredients(ingredients);\n newFactor.setUserMap(userMap);\n newFactor.setUserMapReversed(userMap_r);\n newFactor.setRecipeMap(recipeMap);\n newFactor.setRecipeMapReversed(recipeMap_r);\n newFactor.setIngredientMap(ingredientMap);\n newFactor.setIngredientMapReversed(ingredientMap_r);\n \n //deep copy\n List<User> userCopy = new ArrayList<User>();\n for(User curr: this.users){\n userCopy.add(new User(curr.getId()));\n }\n newFactor.setUsers(userCopy);\n newFactor.setDataset(dataset.copy());\n newFactor.updateInitialSpace();\n return newFactor;\n }", "@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }", "private final State copy( State state)\n {\n State copy = new State();\n copy.index = counter++;\n copy.stackOps = Arrays.copyOf( state.stackOps, state.stackOps.length);\n copy.gotos = Arrays.copyOf( state.gotos, state.gotos.length);\n itemSetMap.put( copy, itemSetMap.get( state));\n return copy;\n }", "@Override\n public Object clone() throws CloneNotSupportedException{\n return super.clone();\n }", "Object clone();", "Object clone();", "@Override\n\tpublic Object clone() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\n public String getObjectCopy() {\n return null;\n }", "public void copy(DataRequest original){\n\t\t//potential problems with object sharing\n\t\tfilters = \toriginal.get_filters();\n\t\tsort_by = \toriginal.get_sort_by();\n\t\tcount = \toriginal.get_count();\n\t\tstart = \toriginal.get_start();\n\t\tsource = \toriginal.get_source();\n\t\tfieldset =\toriginal.get_fieldset();\n\t\trelation = \toriginal.get_relation();\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Object clone() {\r\n try {\r\n OCRSet<E> newSet = (OCRSet<E>) super.clone();\r\n newSet.map = (HashMap<Integer, E>) map.clone();\r\n return newSet;\r\n } catch (CloneNotSupportedException e) {\r\n throw new InternalError();\r\n }\r\n }", "@Override \n public Object clone() {\n try {\n Resource2Builder result = (Resource2Builder)super.clone();\n result.self = result;\n return result;\n } catch (CloneNotSupportedException e) {\n throw new InternalError(e.getMessage());\n }\n }", "public static void copyConstructor(){\n\t}", "public void testCopyConstructor() throws EdmException {\n entity = new EdmEntity(\"example.edl\");\n EdmAttribute a1 = setupAttribute(val1);\n EdmAttribute a2 = setupAttribute(val2);\n entity.addAttribute(id1, a1);\n entity.addAttribute(id2, a2);\n // add subEntity\n EdmEntity subE = new EdmEntity(\"SUBexample.edl\");\n EdmAttribute a3 = setupAttribute(val3);\n subE.addAttribute(id3, a3);\n entity.addSubEntity(subE);\n\n assertEquals(\"example.edl\", entity.getType());\n assertEquals(2, entity.getAttributeCount());\n assertEquals(a1, entity.getAttribute(id1));\n assertEquals(a2, entity.getAttribute(id2));\n\n assertEquals(1, entity.getSubEntityCount());\n assertEquals(\"SUBexample.edl\", entity.getSubEntity(0).getType());\n assertEquals(1, entity.getSubEntity(0).getAttributeCount());\n assertEquals(0, entity.getSubEntity(0).getSubEntityCount());\n assertEquals(a3, entity.getSubEntity(0).getAttribute(id3));\n\n\n EdmEntity copy = new EdmEntity(entity);\n\n assertEquals(entity.getType(), copy.getType());\n assertEquals(entity.getAttributeCount(), copy.getAttributeCount());\n for (String key : copy.getAttributeIdSet())\n assertEquals(entity.getAttribute(key), copy.getAttribute(key));\n\n assertEquals(entity.getSubEntityCount(), copy.getSubEntityCount());\n for (int i = 0; i < copy.getSubEntityCount(); i++) {\n assertEquals(entity.getSubEntity(i).getType(), copy.getSubEntity(i).getType());\n assertEquals(entity.getSubEntity(i).getAttributeCount(),\n copy.getSubEntity(i).getAttributeCount());\n for (String key : copy.getSubEntity(i).getAttributeIdSet())\n assertEquals(entity.getSubEntity(i).getAttribute(key),\n copy.getSubEntity(i).getAttribute(key));\n }\n }", "@Override\n public Object clone() {\n try {\n IdentificationSet<X> newSet = (IdentificationSet<X>) super.clone();\n newSet.map = (HashMap<X, Identification>) map.clone();\n return newSet;\n } catch (CloneNotSupportedException e) {\n throw new InternalError();\n }\n }", "public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "public ProcessedDynamicData deepCopy( ) {\r\n\r\n ProcessedDynamicData copy = new ProcessedDynamicData( this.channelId );\r\n\r\n copy.channelId = this.channelId;\r\n copy.dateTimeStamp = new java.util.Date( this.dateTimeStamp.getTime() );\r\n copy.samplingRate = this.samplingRate;\r\n copy.eu = this.eu;\r\n\r\n copy.min = this.min;\r\n copy.max = this.max;\r\n\r\n copy.measurementType = this.measurementType;\r\n copy.measurementUnit = this.measurementUnit;\r\n\r\n // data and labels\r\n List<Double> dataCopy = new Vector<Double>();\r\n for( int i = 0; i < this.data.size(); i++ ) {\r\n dataCopy.add( new Double( this.data.get( i ) ) );\r\n }\r\n copy.setData( dataCopy );\r\n\r\n List<Double> dataLabels = new Vector<Double>();\r\n for( int i = 0; i < this.dataLabels.size(); i++ ) {\r\n dataLabels.add( new Double( this.dataLabels.get( i ) ) );\r\n }\r\n copy.setDataLabels( dataLabels );\r\n\r\n // create a deep copy of overalls\r\n if( overalls != null ) {\r\n copy.overalls = new OverallLevels( this.overalls.getChannelId() );\r\n copy.overalls.setDateTimeStampMillis( this.getDateTimeStampMillis() );\r\n Vector<String> overallKeys = this.overalls.getKeys();\r\n for( int i = 0; i < overallKeys.size(); i++ ) {\r\n copy.overalls.addOverall( new String( overallKeys.elementAt( i ) ),\r\n new Double( this.overalls.getOverall( overallKeys.elementAt( i ) ) ) );\r\n }\r\n }\r\n\r\n copy.xEUnit = this.xEUnit;\r\n copy.yEUnit = this.yEUnit;\r\n\r\n copy.xSymbol = this.xSymbol;\r\n copy.ySymbol = this.ySymbol;\r\n copy.xPhysDomain = this.xPhysDomain;\r\n copy.yPhysDomain = this.yPhysDomain;\r\n \r\n copy.noOfAppendedZeros = this.noOfAppendedZeros;\r\n\r\n return copy;\r\n }", "public CMObject copyOf();", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "@Override\r\n public NumericObjectArrayList makeDeepCopy() {\r\n NumericObjectArrayList list = new NumericObjectArrayList();\r\n for (int i = 0; i < this.getCount(); i++) {\r\n try {\r\n list.insert(i, this.getValueAt(i));\r\n } catch (IndexRangeException ex) {\r\n //Shouldn't happen\r\n }\r\n }\r\n return list;\r\n }", "Component deepClone();", "private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "static void setNotCopying(){isCopying=false;}", "private Instances deepCopy(Instances data) {\n Instances newInst = new Instances(data);\n\n newInst.clear();\n\n for (int i = 0; i < data.size(); i++) {\n Instance ni = new DenseInstance(data.numAttributes());\n for (int j = 0; j < data.numAttributes(); j++) {\n ni.setValue(newInst.attribute(j), data.instance(i).value(data.attribute(j)));\n }\n newInst.add(ni);\n }\n\n return newInst;\n }", "public Object clone() {\n return this.copy();\n }", "public MappingInfo copy()\r\n\t{\r\n\t\tArrayList<MappingCell> mappingCells = new ArrayList<MappingCell>();\r\n\t\tfor(MappingCell mappingCell : mappingCellHash.get())\r\n\t\t\tmappingCells.add(mappingCell);\r\n\t\treturn new MappingInfo(mapping.copy(),mappingCells);\r\n\t}", "@Override\n BinaryArrayReadWrite clone();", "@Override\n public ExpressionNode deepCopy(BsjNodeFactory factory);", "public Object clone ()\n\t{\n\t\ttry \n\t\t{\n\t\t\treturn super.clone();\n\t\t}\n\t\tcatch (CloneNotSupportedException e) \n\t\t{\n throw new InternalError(e.toString());\n\t\t}\n\t}", "public JsonFactory copy()\n/* */ {\n/* 324 */ _checkInvalidCopy(JsonFactory.class);\n/* */ \n/* 326 */ return new JsonFactory(this, null);\n/* */ }", "public Object clone() {\n \ttry {\n \tMyClass1 result = (MyClass1) super.clone();\n \tresult.Some2Ob = (Some2)Some2Ob.clone(); ///IMPORTANT: Some2 clone method called for deep copy without calling this Some2.x will be = 12\n \t\n \treturn result;\n \t} catch (CloneNotSupportedException e) {\n \treturn null; \n \t}\n\t}", "@Override\n public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }", "public O copy() {\n return value();\n }", "Model copy();", "public Object clone()\n/* */ {\n/* 835 */ return super.clone();\n/* */ }", "@Override\r\npublic int getNumcopy() {\n\treturn super.getNumcopy();\r\n}", "protected void deepCloneReferences(uka.transport.DeepClone _helper)\n throws CloneNotSupportedException\n {\n //Cloning the byte array\n\t this.value = _helper.doDeepClone(this.value);\n //byte[] value_clone = new byte[this.value.length]; \n //System.arraycopy(this.value, 0, value_clone, 0, this.value.length);\n //this.value = value_clone;\n }", "public HttpParams copy() {\n/* 268 */ return (HttpParams)this;\n/* */ }", "public abstract Type treeCopyNoTransform();", "public Object clone()\n {\n PSRelation copy = new PSRelation(new PSCollection(m_keyNames.iterator()),\n new PSCollection(m_keyValues.iterator()));\n \n copy.m_componentState = m_componentState;\n copy.m_databaseComponentId = m_databaseComponentId;\n copy.m_id = m_id;\n\n return copy;\n }", "public Object clone() throws CloneNotSupportedException { return super.clone(); }", "public abstract B copy();", "public Object clone()\n {\n Object o = null;\n try\n {\n o = super.clone();\n }\n catch (CloneNotSupportedException e)\n {\n e.printStackTrace();\n }\n return o;\n}", "DSGeneMarker deepCopy();", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "@Override\n public void copyProperties(Object dest, Object orig)\n throws IllegalAccessException, InvocationTargetException {\n try {\n // if we have an object in our list, that means we hit some sort of recursion, stop\n // here.\n if (lookingAt.stream().anyMatch(o -> o == dest)) {\n return; // recursion detected\n }\n lookingAt.add(dest);\n super.copyProperties(dest, orig);\n } finally {\n lookingAt.remove(dest);\n }\n }", "@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }", "public Function clone();", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\n\t}", "private Object copy ( Object record )\n\t{\n\t try\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream ();\n ObjectOutputStream oos = new ObjectOutputStream (baos);\n oos.writeObject (record);\n \n ByteArrayInputStream bais = new ByteArrayInputStream ( baos.toByteArray () );\n ObjectInputStream ois = new ObjectInputStream (bais);\n return ois.readObject ();\n }\n catch (Exception e)\n {\n throw new RuntimeException (\"Cannot copy record \" + record.getClass() + \" via serialization \" );\n }\n\t}", "private LinkgrabberFilterRule getCurrentCopy() {\r\n LinkgrabberFilterRule ret = this.rule.duplicate();\r\n save(ret);\r\n return ret;\r\n }", "protected abstract Set method_1559();", "private static Object deepClone(Object object) {\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);\n objectOutputStream.writeObject(object);\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());\n ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);\n return objectInputStream.readObject();\n }\n catch (Exception e) {\n return null;\n }\n }", "@Override\r\n\tpublic void copy(Property p) {\n\t\t\r\n\t}", "@Override\n\tpublic SecuredRDFList copy();", "@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }", "public Object clone()\n {\n try {\n Object newObj = super.clone();\n ((LDAPUrl)newObj).url = (com.github.terefang.jldap.ldap.LDAPUrl)this.url.clone();\n return newObj;\n } catch( CloneNotSupportedException ce) {\n throw new RuntimeException(\"Internal error, cannot create clone\");\n }\n }", "private void copy()\n\t{\n\t\t//for loop for row\n\t\tfor (int row =0; row<nextVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor (int column =0; column<nextVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//assigning values for currentVersion to nextVersion array\n\t\t\t\tnextVersion[row][column] = currentVersion[row][column];\n\t\t\t}\n\t\t}\n\t\n\t}", "protected Node deepCopyInto(Node n) {\n\t\tsuper.deepCopyInto(n);\n\t\tRCPOMDocument sd = (RCPOMDocument) n;\n\t\tsd.localizableSupport = new LocalizableSupport(RESOURCES, getClass()\n\t\t\t\t.getClassLoader());\n\t\tsd.url = url;\n\t\treturn n;\n\t}", "public abstract Type treeCopy();", "@Override\n public Data clone() {\n final Data data = new Data(name, code, numeric, symbol, fractionSymbol, fractionsPerUnit, rounding, formatString,\n triangulated.clone());\n return data;\n }", "public ParticleRenderData copy()\n\t{\n\t\tRenderData copy = super.copy();\n\t\tParticleRenderData pcopy = new ParticleRenderData(new Vector3f(), new Euler(), new Vector3f());\n\t\tpcopy.transform = copy.transform;\n\t\tpcopy.postStage = this.postStage;\n\t\tpcopy.currStage = this.currStage;\n\t\tpcopy.particleColor = this.particleColor;\n\t\treturn pcopy;\n\t}", "@Override\r\n\tpublic LogicalValue copy() {\r\n\t\treturn new Pointer(target);\r\n\t}", "private void selfClone() {\n stroke = stroke.clone();\n }", "@Test\n\tpublic void testCopy2() {\n\n\t\tint[] arr = { 1, 2, 3, 7, 8 }; // this list\n\t\tSLLSet listObj2 = new SLLSet(arr);\n\t\tSLLSet copied = listObj2.copy();\n\t\tcopied.add(-1);\n\t\tString expectedObj2 = \"1, 2, 3, 7, 8\";\n\t\tString expectedCopied = \"-1, 1, 2, 3, 7, 8\";\n\t\tint expectedObj2Size = 5;\n\t\tint expectedCopiedSize = 6;\n\n\t\tassertEquals(expectedObj2Size, listObj2.getSize());\n\t\tassertEquals(expectedObj2, listObj2.toString());\n\n\t\tassertEquals(expectedCopiedSize, copied.getSize());\n\t\tassertEquals(expectedCopied, copied.toString());\n\n\t}" ]
[ "0.6197055", "0.6139835", "0.59858996", "0.598241", "0.5970244", "0.594691", "0.59236455", "0.59236455", "0.59236455", "0.5894638", "0.5880122", "0.585104", "0.58497983", "0.58497983", "0.58497983", "0.58497983", "0.58497983", "0.58497983", "0.58497983", "0.58497983", "0.58497983", "0.58483547", "0.5844798", "0.5783186", "0.5780265", "0.57733214", "0.57708937", "0.57695866", "0.57665753", "0.5753297", "0.5743945", "0.5734151", "0.5721885", "0.5718489", "0.57115287", "0.5705954", "0.5680213", "0.5680213", "0.5672475", "0.5660107", "0.5658399", "0.5656605", "0.5640981", "0.5639799", "0.5637954", "0.5637163", "0.56267345", "0.56064826", "0.5605153", "0.5605153", "0.5605153", "0.5594823", "0.558826", "0.5582876", "0.5580193", "0.55752176", "0.5558262", "0.55530703", "0.5531928", "0.5528385", "0.55245286", "0.5522652", "0.5518397", "0.55094695", "0.54904693", "0.54824865", "0.54748565", "0.5470031", "0.5469709", "0.54569817", "0.545632", "0.54506016", "0.5449971", "0.54477125", "0.544466", "0.54433334", "0.544265", "0.5438763", "0.54335725", "0.54328847", "0.54306656", "0.54204243", "0.5405542", "0.5401305", "0.5400201", "0.5397871", "0.53956395", "0.53935933", "0.5388408", "0.5382654", "0.5376021", "0.5371343", "0.5371046", "0.53695774", "0.536437", "0.5363561", "0.536183", "0.53494275", "0.53467244", "0.53465426", "0.5345354" ]
0.0
-1
get a resource item matching the given type and name
@Override protected void load(ScanningContext context) { ResourceItem item = getRepository().getResourceItem(mType, mResourceName); // add this file to the list of files generating this resource item. item.add(this); // Ask for an ID refresh since we're adding an item that will generate an ID context.requestFullAapt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object get(String itemName);", "CatalogItem getCatalogItemByName(String name);", "public Item getItem(String typeItem){\r\n if(typeItem.equals(\"coeur\")){\r\n Item coeur = new Coeur();\r\n return coeur;\r\n } else if(typeItem.equals(\"potionvie\")){\r\n Item potion = new Potion();\r\n return potion;\r\n } else if(typeItem.equals(\"hexaforce\")){\r\n Item hexa = new Hexaforce();\r\n return hexa;\r\n } else {\r\n return null;\r\n }\r\n }", "ResourceRequirement getRequirementFor(AResourceType type);", "public Resource takeResource( Resource.Type type, int amount );", "Food getByType(String type);", "public static Item getItemByName(String name)\n\t{\n\t\tfor(Item i : itemCollections)\n\t\t{\n\t\t\tif(i.getName() == name)\n\t\t\t\treturn i;\n\t\t}\n\t\tfor(Equipment equ : equipmentCollections)\n\t\t{\n\t\t\tif(equ.getName() == name)\n\t\t\t\treturn equ;\n\t\t}\n\t\treturn null;\n\t}", "Type<?> get(String name);", "SyncRecord findObject(String name, int type) throws NotFoundException\r\n\t{\r\n\t\tfor (int i=0; i<syncTable.size(); i++)\r\n\t\t{\r\n\t\t\tSyncRecord myrec = (SyncRecord)syncTable.elementAt(i);\r\n\t\t\tif ((myrec.name).equals(name) && (myrec.type)==type)\r\n\t\t\t\treturn myrec;\r\n\t\t}\r\n\t\tthrow new NotFoundException();\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\t\t@Override\n\t\tpublic <T extends ResourceData<T>> FlexoResource<T> retrieveResource(String uri, FlexoVersion version, Class<T> type) {\n\t\t\treturn (FlexoResource<T>) retrieveResource(uri);\n\t\t}", "public static Item getItem(String itemName)\n {\n Item temp = null;\n for (Item inventory1 : inventory) {\n if (inventory1.getName().equals(itemName)) {\n temp = inventory1;\n }\n }\n return temp;\n }", "public List<Resource> findByType(ResourceType type) {\n\t\tMap<String, Object> typeFilter = new HashMap<>(1);\n\n\t\ttypeFilter.put(\"type\", new ValueParameter(type));\n\n\t\treturn this.filter(typeFilter);\n\t}", "public static Item getItemByName(String name) {\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(String.format(\"http://localhost:8080/item/name/%s\", name))).setHeader(\"Cookie\", Authenticator.SESSION_COOKIE).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(request, HttpResponse.BodyHandlers.ofString());\n } catch (Exception e) {\n e.printStackTrace();\n //return \"Communication with server failed\";\n }\n if (response.statusCode() != 200) {\n System.out.println(\"Status: \" + response.statusCode());\n }\n\n ObjectMapper mapper = new ObjectMapper();\n mapper.registerModule(new JavaTimeModule());\n Item item = null;\n // TODO handle exception\n try {\n item = mapper.readValue(response.body(), new TypeReference<Item>() {\n });\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return item;\n }", "public static Object get(String name) {\r\n\t\treturn getInstance().addResource(name);\r\n\t}", "public Item getItem(String name) {\r\n \t\treturn persistenceManager.getItem(name);\r\n \t}", "public Resource getResource(final String name) {\n return resourceRegistry.getEntryValue(name);\n }", "public Objects getObject(String itemName)\n {\n return items.get(itemName);\n }", "public static int getResourceByString( Context context, String resourceType, String name ) {\n int resource = 0;\n\n try {\n resource = context.getResources()\n .getIdentifier( name, resourceType, context.getPackageName() );\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n\n return resource;\n }", "private TreeObject find(String name, int type) {\n\t return widgetRoots[type - 1].find(name);\n\t}", "public XQItemType lookForType(QName typeName)\n {\n return XQType.findItemType(typeName);\n }", "public static ResponseType getByName(String name) {\n if (name == null || name.length() < 1) {\n return ResponseType.INVALID;\n }\n name = name.trim();\n for (int i = 0; i < list.size(); i++) {\n ResponseType temp = (ResponseType) list.get(i);\n if (temp.getName().equalsIgnoreCase(name)) {\n return temp;\n }\n }\n return ResponseType.INVALID;\n }", "public FileObject findResource(String name) {\n Enumeration en = getFileSystems ();\n while (en.hasMoreElements ()) {\n FileSystem fs = (FileSystem)en.nextElement ();\n FileObject fo = fs.findResource(name);\n if (fo != null) {\n // object found\n return fo;\n }\n }\n return null;\n }", "public Item getItem(String itemName)\n {\n Item currentItem = items.get(0);\n // get each item in the items's array list.\n for (Item item : items){\n if (item.getName().equals(itemName)){\n currentItem = item;\n }\n }\n return currentItem;\n }", "Object find(String name);", "<T> T get(String id, TypeReference<T> type);", "public ItemType getType();", "protected <K extends Resource> K doGetResource(String uri, Class<K> resourceType) {\n\t\tif (negCache.containsKey(uri)) {\n\t\t\t// System.out.println(\"in negative cache \" + uri);\n\t\t\treturn null;\n\t\t}\n\t\tString objectUri = uri;\n\t\tif (uri.startsWith(\"repo:\")) { //$NON-NLS-1$\n\t\t\tobjectUri = uri.substring(5);\n\t\t\tK r = getFromParent(objectUri, resourceType);\n\t\t\tif (r != null)\n\t\t\t\treturn addToCache(r, uri);\n\t\t}\n\t\tif (c != null)\n\t\t\ttry {\n\t\t\t\tIProgressMonitor monitor = new NullProgressMonitor();\n\t\t\t\t// System.out.println(\"get from server \" + uri);\n\t\t\t\tif (objectUri.contains(\"/\")) { //$NON-NLS-1$\n\t\t\t\t\t// Locate the resource inside the repository...\n\t\t\t\t\tResourceDescriptor r = new ResourceDescriptor();\n\t\t\t\t\tr.setUriString(objectUri);\n\t\t\t\t\tr = c.get(monitor, r, null);\n\t\t\t\t\tif (r.getIsReference())\n\t\t\t\t\t\tr = ReferenceResolver.resolveReference(c, r, null);\n\t\t\t\t\tif (rpath == null)\n\t\t\t\t\t\tinitRPath();\n\t\t\t\t\tString fpath = Misc.nvl(rpath);\n\t\t\t\t\tif (!objectUri.startsWith(\"/\")) //$NON-NLS-1$\n\t\t\t\t\t\tfpath += \"/\"; //$NON-NLS-1$\n\t\t\t\t\tfpath += objectUri;\n\t\t\t\t\tFile f = new File(fpath);\n\t\t\t\t\tif (f.getParentFile() != null)\n\t\t\t\t\t\tf.getParentFile().mkdirs();\n\t\t\t\t\tif (f.createNewFile()) {\n\t\t\t\t\t\tif (!r.getIsReference() && r.getHasData() && r.getData() != null) {\n\t\t\t\t\t\t\torg.apache.commons.io.FileUtils.writeByteArrayToFile(f, r.getData());\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tc.get(monitor, r, f);\n\t\t\t\t\t}\n\t\t\t\t\tfileTypes.put(f, r.getWsType());\n\t\t\t\t} else if (runitUri != null) {\n\t\t\t\t\t// Locate the resource inside the report unit, if any...\n\t\t\t\t\tif (reportUnitResources == null) {\n\t\t\t\t\t\tResourceDescriptor rd = new ResourceDescriptor();\n\t\t\t\t\t\trd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT);\n\t\t\t\t\t\trd.setUriString(runitUri);\n\t\t\t\t\t\trd = c.get(monitor, rd, null);\n\t\t\t\t\t\treportUnitResources = c.list(monitor, rd);\n\t\t\t\t\t\tif (reportUnitResources == null)\n\t\t\t\t\t\t\treportUnitResources = new ArrayList<ResourceDescriptor>();\n\t\t\t\t\t}\n\n\t\t\t\t\t// find the resource...\n\t\t\t\t\tfor (ResourceDescriptor r : reportUnitResources) {\n\t\t\t\t\t\tif (r.getName() == null || !r.getName().equals(objectUri))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (r.getIsReference())\n\t\t\t\t\t\t\tr = ReferenceResolver.resolveReference(c, r, monitor);\n\t\t\t\t\t\tif (ResourceFactory.isFileResourceType(r)) {\n\t\t\t\t\t\t\tIFile file = (IFile) jConfig.get(FileUtils.KEY_FILE);\n\n\t\t\t\t\t\t\tFile fp = null;\n\t\t\t\t\t\t\tIContainer pf = file.getParent();\n\t\t\t\t\t\t\tif (pf.getRawLocation() != null)\n\t\t\t\t\t\t\t\tfp = pf.getRawLocation().toFile();\n\t\t\t\t\t\t\telse if (pf.getLocationURI() != null)\n\t\t\t\t\t\t\t\tfp = new File(pf.getLocationURI());\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn addToCache(null, uri);\n\n\t\t\t\t\t\t\tFile f = new File(fp, objectUri);\n\t\t\t\t\t\t\tif (f.getParentFile() != null && !f.getParentFile().mkdirs() && f.createNewFile())\n\t\t\t\t\t\t\t\tc.get(monitor, r, f);\n\t\t\t\t\t\t\tfileTypes.put(f, r.getWsType());\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}\n\t\t\t\trefresh();\n\t\t\t\tString u = uri;\n\t\t\t\tif (u.startsWith(\"repo:\"))\n\t\t\t\t\tu = u.substring(5);\n\t\t\t\treturn addToCache(getFromParent(u, resourceType), uri);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\treturn addToCache(null, uri);\n\t}", "protected <K extends Resource> K getFromParent(String uri, Class<K> resourceType) {\n\t\tfor (RepositoryService rs : parent.getRepositoryServices()) {\n\t\t\tif (rs == this)\n\t\t\t\tcontinue;\n\t\t\ttry {\n\t\t\t\tK r = parent.doGetResource(uri, resourceType, rs);\n\t\t\t\tif (r != null)\n\t\t\t\t\treturn r;\n\t\t\t} catch (JRRuntimeException e) {\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\"get from server not found \" + uri);\n\t\treturn null;\n\t}", "E find(final ID identifier) throws ResourceNotFoundException;", "List<Item> findByName(String name);", "public int getContents( Resource.Type type );", "@Override\n\tpublic synchronized <K extends Resource> K getResource(String uri, Class<K> resourceType) {\n\t\tif (hasServerUrl(uri, resourceType) && c != null) {\n\t\t\tif (uri.startsWith(\"repo:\")) {\n\t\t\t\t// it's possible to have a resource with id=repo:something (from\n\t\t\t\t// practice)\n\t\t\t\tK r = doGetResource(uri.startsWith(\"repo:\") ? uri : \"repo:\" + uri, resourceType);\n\t\t\t\tif (r != null)\n\t\t\t\t\treturn r;\n\t\t\t}\n\t\t\treturn doGetResource(uri, resourceType);\n\t\t}\n\t\tif (c == null && uri.startsWith(\"repo:\")) {\n\t\t\tK r = doGetResource(uri.startsWith(\"repo:\") ? uri : \"repo:\" + uri, resourceType);\n\t\t\tif (r != null)\n\t\t\t\treturn r;\n\t\t}\n\t\treturn repService != null ? repService.getResource(uri, resourceType) : null;\n\t}", "@SuppressWarnings(\"unchecked\")\t\r\n\tpublic S[] getResourceByName(String name) {\r\n\t\tList<S> returnResourcesList = new LinkedList<S>();\r\n\t\tfor (S resource : this.resourcesList) {\r\n\t\t\tif (resource.getName().equals(name)) {\r\n\t\t\t\treturnResourcesList.add(resource);\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn (S[])returnResourcesList.toArray(new Resource[0]);\t\t\t\t\r\n\t}", "@Override\n\t\tpublic <T extends IBaseResource> T load(Class<T> theType, IIdType theId) throws ResourceNotFoundException {\n\t\t\tif (\"ValueSet\".equals(theType.getSimpleName())) {\n\t\t\t\tIFhirResourceDao<ValueSet> dao = getDao(ValueSet.class);\n\t\t\t\tValueSet in = dao.read(theId, null);\n\t\t\t\tString encoded = getContext().newJsonParser().encodeResourceToString(in);\n\n\t\t\t\t// TODO: this is temporary until structures-dstu2 catches up to structures-hl7org.dstu2\n\t\t\t\tencoded = encoded.replace(\"\\\"define\\\"\", \"\\\"codeSystem\\\"\");\n\n\t\t\t\treturn myRefImplCtx.newJsonParser().parseResource(theType, encoded);\n\t\t\t} else if (\"Questionnaire\".equals(theType.getSimpleName())) {\n\t\t\t\tIFhirResourceDao<Questionnaire> dao = getDao(Questionnaire.class);\n\t\t\t\tQuestionnaire vs = dao.read(theId, null);\n\t\t\t\treturn myRefImplCtx.newJsonParser().parseResource(theType, getContext().newJsonParser().encodeResourceToString(vs));\n\t\t\t} else {\n\t\t\t\t// Should not happen, validator will only ask for these two\n\t\t\t\tthrow new IllegalStateException(\"Unexpected request to load resource of type \" + theType);\n\t\t\t}\n\n\t\t}", "static ResourceItem getResource(@NonNull Node node, @Nullable File from) {\n ResourceType type = getType(node, from);\n String name = getName(node);\n\n if (name != null) {\n if (type != null) {\n return new ResourceItem(name, type, node);\n }\n }\n\n return null;\n }", "default PathItem getPathItem(String name) {\n Map<String, PathItem> map = getPathItems();\n if (map == null) {\n return null;\n }\n return map.get(name);\n }", "public ResourceType getResourceType(final String id);", "public IResourceType getType();", "RiceCooker getByName(String name);", "Item findById(String id);", "String getResourceType();", "public Item(String name, ItemType type)\n {\n\tthis.name = name;\n\tthis.type = type;\n }", "public T lookup( String name )\r\n {\r\n T result = null;\r\n \r\n for( HashMap<String,T> table : tables )\r\n {\r\n result = table.get( name );\r\n if( result!=null ) break;\r\n }\r\n \r\n return result;\r\n }", "Class<? extends Resource> getResourceType();", "E getByName(String name);", "protected ResourceReference getItem()\n\t{\n\t\treturn ITEM;\n\t}", "public abstract T findByName(String name) ;", "public static ItemStack item(XMaterial type, String name, String... lore) {\r\n\t\tItemStack is = type.parseItem();\r\n\t\tItemMeta im = is.getItemMeta();\r\n\t\tim.addItemFlags(ItemFlag.values());\r\n\t\tis.setItemMeta(applyMeta(im, name, lore));\r\n\t\treturn is;\r\n\t}", "public Items[] findWhereTypeEquals(String type) throws ItemsDaoException;", "public Items getItem(String name)\n {\n return Inventory.get(name);\n }", "public static Object getThingByName (String name) {\n \n Object thing = Item.getByNameOrId(name);\n \n if (thing != null)\n return thing;\n \n thing = Block.getBlockFromName(name);\n \n if (thing != null)\n return thing;\n \n return null;\n }", "public Object getItem(String key);", "public static Resource_kind getByName(String name) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tResource_kind result = VALUES_ARRAY[i];\n\t\t\tif (result.getName().equals(name)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public int getResources(Type type) {\n \t\treturn resources[type.ordinal()];\n \t}", "public T get(String name) {\n\t\treturn get(name, 0);\n\t}", "public Item getItemByName(String itemName) {\n\t\t\n\t\tfor (Item item : itemsInStock) {\n\t\t\tif (item.name.equals(itemName)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public <T extends Base> T findByName(Class<T> T, String name)\n\t\t\tthrows IOException, ClassNotFoundException {\n\t\tT result = null;\n\t\tfor (T t : list(T)) {\n\t\t\tif (t.getName().equals(name)) {\n\t\t\t\tresult = t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public InventoryItem findItem(String itemName)\n\t{\n\t\t\n\t\t\tfor (int k = 0; k < items.size(); k++)\n\t\t\t\tif (itemName.equals(items.get(k).getName()))\t\t\n\t\t\t\t\treturn items.get(k);\t\t\n\t\t\treturn null;\t\t\t\t\t\t\n\t}", "<E> E get(String key, Class<E> type);", "public ItemEntry getItem(String itemName) {\n ItemEntry entry = null;\n \n for(ItemEntry i: itemList) {\n if (i.getItemName().equals(itemName)) {\n entry = i;\n }\n }\n \n return entry;\n }", "public ResourceType getResouceType() {\n return type;\n }", "public static RegionStatisticsResourcesData get(RegionStatistics statistics, RegionStatisticsData data, String type) {\r\n try {\r\n Criteria criteria = new Criteria();\r\n criteria.add(REGION_ID,statistics.getID());\r\n criteria.add(TURN_ID, data.getID());\r\n criteria.add(ITEM_TYPE, type);\r\n criteria.setLimit(1);\r\n List<RegionStatisticsResourcesData> resources = doSelect(criteria);\r\n if (resources != null && resources.size()>0) return resources.get(0);\r\n } catch (Exception exception) {\r\n log.error(exception);\r\n }\r\n return null;\r\n }", "public Item getItemById(Integer itemId);", "public Cursor loadRecipesByType(String typeR) {\r\n Cursor c = db.query(recipes.TABLENAME, new String[]{recipes.TITLE, recipes.IMAGE, recipes.INGREDIENTS, recipes.STEPS, recipes.TYPE, recipes.TIME, recipes.PEOPLE, recipes.IDRECIPE}, recipes.TYPE + \"=\" + \"'\" + typeR + \"'\", null, null, null, null);\r\n if (c != null) c.moveToFirst();\r\n return c;\r\n }", "public static Texture get(String name){\n for(TextureHandler t : textures){\n if(t.getName().toLowerCase().equals(name.toLowerCase())){\n return t.getTexture();\n }\n }\n return error;\n }", "public ResourceType type() {\n return type;\n }", "public ItemType getItemType(TypeHierarchy th) {\n return argument[0].getItemType(th); //AUTO\n }", "public static ItemStack item(XMaterial type, String name, List<String> lore) {\r\n\t\tItemStack is = type.parseItem();\r\n\t\tItemMeta im = is.getItemMeta();\r\n\t\tim.addItemFlags(ItemFlag.values());\r\n\t\tis.setItemMeta(applyMeta(im, name, lore));\r\n\t\treturn is;\r\n\t}", "public T get(String name) {\n for (int i = maps.size() - 1; i >= 0; i--) {\n HashMap<String, T> scope = maps.get(i);\n T t = scope.get(name);\n if (t != null) return t; // Found it!\n }\n return null; // Not found\n }", "@Override\n public SystemResourcePojo getByName(String name) throws DataNotFoundException {\n SystemResource entity = systemResourceRepository.findByName(name);\n if (entity == null){\n throw new DataNotFoundException(\"System resource is not found by name\");\n }\n\n return this.entityToPojo(entity);\n }", "public AssetClass findAssetClassByName(String name_);", "public Object getResource(String id) {\n\t\tint idx = rks.indexOf(id);\n\t\tif (idx < 0) throw new NoSuchElementException(id);\n\t\telse return rvs.get(idx);\n\t}", "public static <T extends Searchable> T lookup(final String nameOrIndex, final List<T> items) {\n final String name = nameOrIndex;\n int index = -1;\n try {\n index = Integer.parseInt(nameOrIndex) - 1;\n } catch (final NumberFormatException e) {\n Entity.LOGGER.log(Level.FINE, e.getMessage(), e);\n }\n if (index >= 0 && index < items.size()) {\n return items.get(index);\n }\n\n return items.stream().filter(i -> i.getNameLookup().equals(name)).findFirst().orElse(null);\n }", "public static Item getRepairItem(String name) {\n\n if (Item.itemRegistry.getObject(name) != null) {\n\n return (Item) Item.itemRegistry.getObject(name);\n }\n\n else if (Block.blockRegistry.getObject(name) != null) {\n\n return Item.getItemFromBlock((Block) Block.blockRegistry.getObject(name));\n }\n\n Constants.LOGGER.info(\"Null was provided for repair material. There may be issues. \" + name);\n return null;\n }", "Product getProductByName(String name) throws EntityNotFoundException;", "public static ECayenneItem parse(int type) throws CayenneException {\r\n \tECayenneItem item = LOOKUP.get(type);\r\n \tif (item == null) {\r\n throw new CayenneException(\"Invalid cayenne type \" + type);\r\n \t}\r\n \treturn item;\r\n }", "List<ResourcePojo> selectByBktName(String bktName);", "ResourceType getResource();", "public ItemType getItemType(TypeHierarchy th) {\n\t return reqItemType;\n\t}", "public AbsenceType findByName(String name);", "public InventoryItem lookupItem(int serialNum){\n //loop through all Inventory\n for(int i=0; i<this.items.size(); i++){\n //check if inventoryItem has matching serialNumber with specified serialNum\n if(this.items.get(i).getSerialNum()==serialNum){\n //if serial numbers match, return the inventoryItem\n return this.items.get(i);\n }\n }\n \n //in the case all inventory items are searched and no serial number matches- return first InventoryItem***************************************\n return this.items.get(0);\n }", "public Equip getEquip(int type)\r\n {\r\n if (type==Equip.WEAPON)\r\n return weapon;\r\n else if (type == Equip.ARMOR)\r\n return armor;\r\n return null;\r\n }", "protected abstract T getResource(ItemVariant currentVariant);", "public Item checkForItem(String name) {\r\n Item output = null;\r\n for (Item item : inventory) {\r\n String check = item.getName().replaceAll(\" \", \"\");\r\n if (name.equals(check.toLowerCase())) {\r\n output = item;\r\n }\r\n }\r\n for (Item item : potionInventory) {\r\n String check = item.getName().replaceAll(\" \", \"\");\r\n if (name.equals(check.toLowerCase())) {\r\n output = item;\r\n }\r\n }\r\n return output;\r\n }", "public FieldIdItem lookupField(final Class<?> clazz, final String name, final Class<?> type) {\n\t\treturn lookupField(TypeUtils.getTypeDescriptor(clazz), name, TypeUtils.getTypeDescriptor(type));\n\t}", "public HexType giveResourceCard(HexType type){\n return type;\n }", "private Object retrieveObject(String name)\r\n {\r\n Object retVal = null;\r\n\r\n // retrieve the object that the weak reference refers to, if any\r\n WeakReference ref = (WeakReference) nameObjects.get(name);\r\n if (ref != null)\r\n {\r\n retVal = ref.get();\r\n }\r\n \r\n return retVal;\r\n }", "public Artist getByName(String name);", "public static DataType get(String type)\n {\n return lookup.get(type);\n }", "CodeableConcept getItem();", "private String getResourceName(ResourceType type) {\n // get the name from the filename.\n String name = getFile().getName();\n\n int pos = name.indexOf('.');\n if (pos != -1) {\n name = name.substring(0, pos);\n }\n\n return name;\n }", "public MenuItem getMenuItemByName(String name){\n for (MenuItem item: menuItems){\n if (item.getFoodName().equals(name)){\n return item;\n }\n }\n return null;\n }", "public static APIVersionType getByName(String name) {\n for (int i = 0; i < VALUES_ARRAY.length; ++i) {\n APIVersionType result = VALUES_ARRAY[i];\n if (result.getName().equals(name)) {\n return result;\n }\n }\n return null;\n }", "static ResourceType getType(@NonNull Node node, @Nullable File from) {\n String nodeName = node.getLocalName();\n String typeString = null;\n\n if (TAG_ITEM.equals(nodeName)) {\n Attr attribute = (Attr) node.getAttributes().getNamedItemNS(null, ATTR_TYPE);\n if (attribute != null) {\n typeString = attribute.getValue();\n }\n } else if (TAG_EAT_COMMENT.equals(nodeName) || TAG_SKIP.equals(nodeName)) {\n return null;\n } else {\n // the type is the name of the node.\n typeString = nodeName;\n }\n\n if (typeString != null) {\n ResourceType type = ResourceType.getEnum(typeString);\n if (type != null) {\n return type;\n }\n\n if (from != null) {\n throw new RuntimeException(String.format(\"Unsupported type '%s' in file %s\", typeString, from));\n }\n throw new RuntimeException(String.format(\"Unsupported type '%s'\", typeString));\n }\n\n if (from != null) {\n throw new RuntimeException(String.format(\"Unsupported node '%s' in file %s\", nodeName, from));\n }\n throw new RuntimeException(String.format(\"Unsupported node '%s'\", nodeName));\n }", "public static Type getByHttpName(String httpName) {\n/* 126 */ if (httpName == null) return null; \n/* 127 */ return byName.get(httpName.toUpperCase(Locale.ROOT));\n/* */ }", "InventoryItem getInventoryItem();", "public UrlObject getItem(Context context, String url) {\n GlobalContextWrapper.bindContext(context);\n if (context == null || url == null) {\n throw new RuntimeException(\"parameter can't be null!\");\n }\n DatabaseConnectivity connectivity =\n new DatabaseConnectivity(context,\n mAuthority,\n mClass);\n Query query = new Query(mClass);\n ExpressionToken selToken =\n UrlObject.COLUMN_URL_PATTERN.eq(url);\n String str = selToken.toString();\n if (selToken != null) {\n query.setSelection(selToken);\n }\n List<DatabaseObject> objects = connectivity.query(query);\n if (objects == null || objects.size() <= 0) {\n throw new RuntimeException(\"query result is null!\");\n }\n\n GlobalContextWrapper.unbindContext(context);\n return (UrlObject) objects.get(0);\n }", "public <T> T fetchObject(String url, Class<T> type) {\n\t\tObjects.requireNonNull(type, \"A type must provided\");\n\t\tLog.info(\"fetch {} object GET /{}\", type.getSimpleName(), url);\n\t\ttry {\n\t\t\tT result =\n\t\t\t\tcreateGetRequest(url)\n\t\t\t\t.execute()\n\t\t\t\t.handleResponse(createResponseHandler(new TypeReference<T>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Type getType() {\n\t\t\t\t\t\treturn type;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\tLog.info(\"Received 1 entry of {}\", type.getSimpleName());\n\t\t\treturn result;\n\t\t} catch (IOException e) {\n\t\t\tLog.error(format(\"Failed to fetch {0} object from {1}\", type.getSimpleName(), url), e);\n\t\t}\n\t\tLog.info(\"Received no entry of {}\", type.getSimpleName());\n\t\treturn null;\n\t}", "public String getResourceType( )\r\n {\r\n return _strResourceType;\r\n }", "ResourceInstance createResource(String type) {\n Map<Resource.Type, String> mapIds = new HashMap<>();\n mapIds.put(Resource.Type.Cluster, clusterName);\n mapIds.put(Resource.Type.ClusterKerberosDescriptor, type);\n return createResource(Resource.Type.ClusterKerberosDescriptor, mapIds);\n }", "@NonNull\n public static CacheStorage instance(Context context, int type, String name) {\n // find storage in the map and create it if not found\n CacheStorage cache = map.get(name);\n if (cache == null) {\n synchronized (CacheStorageManager.class) {\n cache = map.get(name);\n if (cache == null) {\n cache = newInstance(context, type, name);\n map.put(name, cache);\n return cache;\n }\n }\n }\n\n // check the type of the found storage\n if (cache.getType() != type) {\n throw new IllegalArgumentException(String.format(\"Persistent cache storage with \" +\n \"name = %s has been already created with the different type = %d\", name, type));\n }\n\n return cache;\n }" ]
[ "0.6749929", "0.6670118", "0.66439134", "0.65450007", "0.64957726", "0.6419021", "0.63469416", "0.6288552", "0.6210463", "0.6071113", "0.6017809", "0.6007457", "0.59848833", "0.5968173", "0.59053665", "0.5895032", "0.58827114", "0.5872538", "0.58627933", "0.58540434", "0.58020055", "0.5801089", "0.579896", "0.57971805", "0.57936394", "0.5791208", "0.5789818", "0.5780038", "0.57636243", "0.5748296", "0.5746794", "0.57351017", "0.57298404", "0.5721555", "0.5720228", "0.5697688", "0.5696347", "0.5691025", "0.56674546", "0.5657517", "0.5651464", "0.5646075", "0.56232417", "0.56230986", "0.5618851", "0.5610329", "0.5604911", "0.56000227", "0.5595053", "0.5584629", "0.55827564", "0.5577016", "0.5560838", "0.5560161", "0.5557544", "0.55439067", "0.5520018", "0.5513516", "0.5502544", "0.54974234", "0.5486673", "0.5484881", "0.5482408", "0.54823613", "0.5454612", "0.5452938", "0.5452616", "0.544338", "0.544308", "0.5431954", "0.5431091", "0.54292786", "0.54102004", "0.5408743", "0.5388998", "0.53807735", "0.5371884", "0.5370335", "0.5362906", "0.53583", "0.5355469", "0.53496975", "0.53437996", "0.5334443", "0.53332776", "0.5331682", "0.5331661", "0.5322273", "0.5304165", "0.5301936", "0.52949", "0.5293941", "0.52919483", "0.5289072", "0.5283873", "0.5282003", "0.5274358", "0.52713895", "0.5266464", "0.5266211", "0.52652645" ]
0.0
-1
when this happens, nothing needs to be done since the file only generates a single resources that doesn't actually change (its content is the file path) However, we should check for newly introduced errors
@Override protected void update(ScanningContext context) { validateAttributes(context); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initialize() throws ResourceInitializationException {\n\n String oPath = (String) getUimaContext().getConfigParameterValue(\"outputFile\");\n if (oPath == null) {\n throw new ResourceInitializationException(\n ResourceInitializationException.CONFIG_SETTING_ABSENT, new Object[] { \"outputFile\" });\n }\n outFile = new File(oPath.trim());\n \n try {\n if(outFile.exists()){\n outFile.delete();\n }\n outFile.createNewFile();\n fileWriter = new FileWriter(outFile,true);\n \n } catch (IOException e) {\n throw new ResourceInitializationException(e);\n }\n }", "private void saveResourceFile()\r\n\t{\t\r\n\t\tFile file = null;\r\n\t\tFileWriter fw = null;\r\n\t\t//File complete = null;//New file for the completed list\r\n\t\t//FileWriter fw2 = null;//Can't use the same filewriter to do both the end task and the complted products.\r\n\t\ttry{\r\n\t\t\tfile = new File(outFileName);\r\n\t\t\tfile.createNewFile();\r\n\t\t\tfw = new FileWriter(outFileName,true);\r\n\t\t\tfor(FactoryObject object : mFObjects)\r\n\t\t\t{\r\n\t\t\t\tif(object instanceof FactoryReporter) {\r\n\t\t\t\t\t((FactoryReporter)object).report(fw);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.out.println(ioe.getMessage());\r\n\t\t\tif(file != null) {\r\n\t\t\t\tfile.delete();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tif(fw != null) {\r\n\t\t\t\ttry{\r\n\t\t\t\t\tfw.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tSystem.out.println(\"Failed to close the filewriter!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void handleNewResource() {\n System.out.println(\"Here at VMLeaseProcessor#handleNewResource\");\n callForBackup();\n resourceManager.createRedundant();\n }", "public static void testResourceFile() {\n\t\tArrayList l = new ArrayList();\n\t\tl.add(\"http://www.google.it\");\n\t\tl.add(\"http://www.microsoft.com\");\n\t\t/*\n\t\tDownloader d = new Downloader(1);\n\t\tlogger\n\t\t\t\t.log(\n\t\t\t\t\t\tLevel.INFO,\n\t\t\t\t\t\"TEST ResourceFile implementation. Url downloaded will be temporary saved to system temp directory.\");\n\n\t\t// Listener\n\t\td.addListener(new DebugListener());\n\n\t\td.setFollowRedirect(true);\n\t\td.setMaxSize(2000);\n\t\td.addURLs(l);\n\t\td.start();\n\t\td.waitDone();\n\n\t\t// Derby DBMS should be shutdown every times application goes down\n\t\tDerbyLinkQueueDB.shutdown();\n\t\t*/\n\t}", "private void validateITResource() {\n // TODO Auto-generated method stub\n \n }", "ResourceFilesHandler() throws MissingResourceException {\n\t\tLocale locale = Locale.getDefault();\n\t\tif (!SUPPORTED_LOCALES.contains(locale)) {\n\t\t\tlocale = DEFAULT_LOCALE;\n\t\t}\n\n\t\t// generate the path to the *.properties files\n\t\tfinal String path = getClass().getPackage().getName().replaceAll(\"\\\\.\", ESCAPED_FILE_SEPERATOR);\n\n\t\t// create the ResourceBundle\n\t\tbundleConstants = ResourceBundle.getBundle(path + ESCAPED_FILE_SEPERATOR + DOMINION_CARD);\n\t\tbundleI18N = ResourceBundle.getBundle(path + ESCAPED_FILE_SEPERATOR + DOMINION_LANGUAGE, locale);\n\t}", "public JhoveResources() {\n\t\tsuper();\n\t}", "protected void validateFile() {\r\n\t\tFile f = new File(FileUltil.joinPath(dOutputFolder, dFileName));\r\n\t\tif (f.exists() && !f.isDirectory()) {\r\n\t\t\tdFileName = \"Copy of \" + dFileName;\r\n\t\t\tvalidateFile();\r\n\t\t}\r\n\t}", "private void adjustFactory(IFile iFile, ResourceSet resourceSet) {\n\t\tIJavaProject javaProject = JavaCore.create(iFile.getProject());\r\n\t\ttry {\r\n\t\t\tfor (IClasspathEntry cpEntry : javaProject.getRawClasspath()) {\r\n\t\t\t\tif (cpEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {\r\n\t\t\t\t\t//to register newly generated code;\r\n\t\t\t\t\tupdateClaspath(new File(iFile.getWorkspace().getRoot().getLocation().toString() + \r\n\t\t\t\t\t\t\tcpEntry.getPath().toString()), \"\", resourceSet);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (JavaModelException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private JarToUMLResources() {\n\t\tsuper();\n\t}", "private static void _printResource (final String filename)\n {\n try\n {\n // find the file resource\n final InputStream is = Main.class.getResourceAsStream (filename);\n if (is == null)\n throw new java.io.FileNotFoundException (filename);\n final BufferedReader br = new BufferedReader (new InputStreamReader (is));\n boolean doOutput = true;\n String line;\n while ((line = br.readLine ()) != null)\n {\n if (line.startsWith (\"@@@ \"))\n {\n // special control line\n if (line.equals (\"@@@ START DEBUG ONLY\"))\n doOutput = CSTX.DEBUG;\n else\n if (line.equals (\"@@@ END DEBUG ONLY\"))\n doOutput = true;\n // else: ignore\n continue;\n }\n if (doOutput)\n System.err.println (line);\n }\n System.err.println (\"\");\n }\n catch (final IOException ex)\n {\n log.error (\"Exception\", ex);\n }\n }", "private void setTemplateFile() throws IOException, BusinessException, ObjectNotFoundException, JackrabbitException,\n CertitoolsAuthorizationException, BadElementException {\n super.setFolder(folder);\n if (fileTemplate1 != null) {\n String folderPath;\n if (insertFolderFlag) {\n folderPath = folderId + \"/folders/\" + folder.getName();\n } else {\n folderPath = PlanUtils.getParentPath(folderId) + \"/folders/\" + folder.getName();\n }\n\n Template1Diagram template1Diagram = new Template1Diagram(new Resource(\"/\" + fileTemplate1.getFileName(),\n fileTemplate1.getFileName(),\n fileTemplate1.getContentType(), fileTemplate1.getInputStream(),\n \"\" + fileTemplate1.getSize(), true),\n PlanUtils.convertResourceToHTML(folderPath, getContext().getRequest().getContextPath(),\n getModuleTypeFromEnum()));\n if (replaceImageMap == null) {\n replaceImageMap = Boolean.FALSE;\n }\n if (!insertFolderFlag && !replaceImageMap) {\n\n Folder previousVersion =\n planService.findFolder(folderId, true, getUserInSession(), getModuleTypeFromEnum());\n try {\n TemplateWithImage previousTemplate = (TemplateWithImage) previousVersion.getTemplate();\n String htmlContent = template.getImageMap();\n Image newImage = TemplateWithImageUtils.getImage(fileTemplate1.getInputStream());\n Image oldImage = TemplateWithImageUtils.getImage(previousTemplate.getResource().getData());\n\n String unescapedHtml = StringEscapeUtils.unescapeHtml(htmlContent);\n\n String htmlResultContent = TemplateWithImageUtils.resizeImageMap(unescapedHtml, oldImage, newImage);\n\n if(htmlResultContent != null){\n template1Diagram.setImageMap(htmlResultContent);\n }\n } catch (ClassCastException ex) {\n //Do nothing\n }\n }\n super.setTemplateToFolder(template1Diagram);\n\n } else {\n Folder dbFolder = planService.findFolder(folderId, false, getUserInSession(), getModuleTypeFromEnum());\n //User does not changed template\n if (dbFolder.getTemplate().getName().equals(Template.Type.TEMPLATE_DIAGRAM.getName())) {\n Template1Diagram dbTemplate1Diagram = (Template1Diagram) dbFolder.getTemplate();\n //set old resource and update image Map\n super.setTemplateToFolder(\n new Template1Diagram(dbTemplate1Diagram.getResource(), template.getImageMap()));\n } else {\n //User changed template to this one, and do not upload image, so create empty template\n super.setTemplateToFolder(new Template1Diagram());\n }\n }\n }", "private void getFileAsResourceNewLineDelineated(Class c){\n try{\n s = new Scanner(c.getResourceAsStream(resourceName)); \n while (s.hasNextLine())\n this.input.add(s.nextLine());\n\n setHeaderLine(this.input.get(0));\n \n } catch(Exception e){\n e.printStackTrace();\n }\n }", "private void getFileAsResourceSpaceDelineated(Class c){\n try{\n s = new Scanner(c.getResourceAsStream(resourceName)); \n while (s.hasNext())\n this.input.add(s.next());\n\n setHeaderLine(this.input.get(0));\n \n } catch(Exception e){\n e.printStackTrace();\n }\n }", "@Override\n public void refreshResources() {\n\n }", "public static void generateLocalizedFile() throws IOException {\n GenerateFile generateFile = new GenerateFile();\n Stream<String> fileStream1 = createStreamFromPath(\"src\"+File.separator+\"test.properties\");\n Stream<String> fileStream2 = createStreamFromPath(\"src\"+File.separator+\"test.txt\");\n Map<String, String> with_key_values = convertTomap(fileStream1, \"=\");\n Map<String, String> with_only_values = convertTomap(fileStream2, \"\\\\|\");\n if (!with_key_values.isEmpty() && with_key_values != null && !with_only_values.isEmpty() && with_only_values != null) {\n generateFile.createFileFromList(findAndAppendkeyWithValue(with_key_values, with_only_values),\"file.properties\");\n } else {\n logger.info(\"Either one of your files are not following the rules\");\n }\n }", "public void setResourcefile (File file)\n {\n _resourcefile = file;\n }", "protected void handleChangedResources() {\r\n\t\tif (!changedResources.isEmpty()\r\n\t\t\t\t&& (!isDirty() || handleDirtyConflict())) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (isDirty()) {\r\n\t\t\t\tchangedResources.addAll(editingDomain.getResourceSet()\r\n\t\t\t\t\t\t.getResources());\r\n\t\t\t}\r\n\t\t\teditingDomain.getCommandStack().flush();\r\n\r\n\t\t\tupdateProblemIndication = false;\r\n\t\t\tfor (Resource resource : changedResources) {\r\n\t\t\t\tif (resource.isLoaded()) {\r\n\t\t\t\t\tresource.unload();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tresource.load(Collections.EMPTY_MAP);\r\n\t\t\t\t\t} catch (IOException exception) {\r\n\t\t\t\t\t\tif (!resourceToDiagnosticMap.containsKey(resource)) {\r\n\t\t\t\t\t\t\tresourceToDiagnosticMap\r\n\t\t\t\t\t\t\t\t\t.put(resource, analyzeResourceProblems(\r\n\t\t\t\t\t\t\t\t\t\t\tresource, exception));\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\r\n\t\t\tif (AdapterFactoryEditingDomain.isStale(editorSelection)) {\r\n\t\t\t\tsetSelection(StructuredSelection.EMPTY);\r\n\t\t\t}\r\n\r\n//\t\t\tupdateProblemIndication = true;\r\n//\t\t\tupdateProblemIndication();\r\n\t\t}\r\n\t}", "@Test( expected = IllegalStateException.class )\n public void testSetResource()\n {\n PathBuilder.instance().forReleaseIndexFile().setResource( resource );\n }", "private void handleMissingResource(MissingResourceException e) {\r\n System.err.println();\r\n System.err.println(\"Can't find the properties file \"\r\n + \"that contains the image names.\");\r\n System.err.println(\"Its name should be imagenames.properties, \"\r\n + \"and it should\");\r\n System.err.println(\"contain a single line that specifies \"\r\n + \"one or more image\");\r\n System.err.println(\"files to be found in a directory \"\r\n + \"named images. Example:\");\r\n System.err.println();\r\n System.err.println(\" images=Bird.gif Cat.gif Dog.gif\");\r\n System.err.println();\r\n throw (e); //Used to be exit(1), but that causes the console to\r\n //go away under Java Web Start; this way, you're\r\n //more likely to see a relevant error message.\r\n }", "@Override\n public void onLoadResources() {\n }", "private void handleResources() throws MojoExecutionException {\n List<Resource> resources = project.getResources();\n if (resources.isEmpty()) {\n return;\n }\n Plugin resourcesPlugin = project.getPlugin(ORG_APACHE_MAVEN_PLUGINS + \":\" + MAVEN_RESOURCES_PLUGIN);\n if (resourcesPlugin == null) {\n return;\n }\n executeMojo(\n plugin(\n groupId(ORG_APACHE_MAVEN_PLUGINS),\n artifactId(MAVEN_RESOURCES_PLUGIN),\n version(resourcesPlugin.getVersion()),\n resourcesPlugin.getDependencies()),\n goal(\"resources\"),\n getPluginConfig(resourcesPlugin),\n executionEnvironment(\n project,\n session,\n pluginManager));\n }", "public static void setupResourcePack() {\n try {\n FileWriter writer = new FileWriter(Paths.get(FMLPaths.CONFIGDIR.get().toAbsolutePath().toString(),WingTech.MODID, \"resources\", \"pack.mcmeta\").toFile());\n writer.write(\"{\\\"pack\\\":{\\\"pack_format\\\":6,\\\"description\\\":\\\"WingTech resource pack used for lang purposes for the user to add lang for teas.\\\"}}\");\n writer.close();\n }\n catch (Exception e){\n WingTech.LOGGER.error(\"Error creating pack.mcmeta\", e);\n }\n Minecraft.getInstance().getResourcePackRepository().addPackFinder((consumer, factory) -> {\n final ResourcePackInfo packInfo = ResourcePackInfo.create(\n WingTech.MODID,\n true,\n () -> new FolderPack(Paths.get(FMLPaths.CONFIGDIR.get().toAbsolutePath().toString(),WingTech.MODID, \"resources\").toFile()) {\n @Override\n public boolean isHidden() {\n return true;\n }\n },\n factory,\n ResourcePackInfo.Priority.TOP,\n IPackNameDecorator.BUILT_IN\n );\n if (packInfo == null) {\n WingTech.LOGGER.error(\"Failed to load tea resource pack!\");\n return;\n }\n consumer.accept(packInfo);\n });\n }", "private void initResources() {\n resources = ResourceBundle.getBundle(\"bundles.ChangeTBRFrameResources\");\n }", "public void hardWareResources() {\n\t\tSystem.out.println(\"HadwareResources\");\r\n\t}", "protected void addMissingResources()\n {\n WebLogicResourceRules.addMissingJmsResources(this);\n }", "public void setResourceFile(File fileName) {\n resourceFile = fileName;\n }", "private void loadResource() {\n\t\ttry {\n\t\t\ttarmacTexture = scaleResourceImagePaint(\"/textures/tarmac2.jpg\", 300, 300);\n\t\t\tgrassTexture = scaleResourceImagePaint(\"/textures/grass.jpg\", 300, 300);\n\t\t\tstopwayTexture = scaleResourceImagePaint(\"/textures/stopway.jpg\", 300, 300);\n\t\t} catch (IOException e) {\n\t\t\tsetUsingTextures(false);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void updateFiles() {\n\t}", "public void softwareResources() {\n\t\t\r\n\t}", "@Experimental\n default Collection<String> getGeneratedResources() {\n info(\"EXPERIMENTAL: Compile time resource contribution to the context is experimental\", null);\n return Collections.emptyList();\n }", "static void writePublicResources(File moduleOutputDir, ModuleDef module,\n TreeLogger compileLogger) throws UnableToCompleteException, IOException {\n ResourceOracleImpl publicResources = module.getPublicResourceOracle();\n for (String pathName : publicResources.getPathNames()) {\n File file = new File(moduleOutputDir, pathName);\n File parent = file.getParentFile();\n if (!parent.isDirectory() && !parent.mkdirs()) {\n compileLogger.log(Type.ERROR, \"cannot create directory: \" + parent);\n throw new UnableToCompleteException();\n }\n Files.asByteSink(file).writeFrom(publicResources.getResourceAsStream(pathName));\n }\n }", "@Override\r\n public void loadResources() {\n\r\n }", "private void validateResourceMap(ObjectFormat format, InputStream sciMetaStream) throws UnsupportedType, InsufficientResources {\n\n logger.debug(task.taskLabel() + \" entering validateResourceMap...\");\n boolean attemptValidation = false;\n\n if (format != null && format.getFormatType().equalsIgnoreCase(\"RESOURCE\")) {\n for (int i = 0; i < VALIDATING_RESOURCE_FORMATS.length; i++) {\n if (format.getFormatId().getValue().contentEquals(VALIDATING_RESOURCE_FORMATS[i])) {\n attemptValidation = true;\n }\n }\n }\n\n if (attemptValidation) {\n\n // first clone the inputStream so it can be used later\n byte[] resourceBytes = null;\n try {\n resourceBytes = IOUtils.toByteArray(sciMetaStream);\n } catch (IOException e) {\n throw new InsufficientResources(\"413\",\n \"Could not validate Resource Map: Unable to create ByteArrayInputStream for pid: \"\n + task.getPid() + \" with message: \"\n + e.getMessage());\n } finally {\n IOUtils.closeQuietly(sciMetaStream);\n }\n\n if (resourceBytes == null) {\n throw new UnsupportedType(\"Invalid Resource Map\", \"input byte[] was null\");\n }\n\n sciMetaStream = new ByteArrayInputStream(resourceBytes);\n\n InputStream resourceStream = null;\n try {\n resourceStream = new ByteArrayInputStream(resourceBytes);\n ResourceMapFactory.getInstance().parseResourceMap(resourceStream);\n } catch (UnsupportedEncodingException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } catch (OREException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } catch (URISyntaxException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } catch (OREParserException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } finally {\n IOUtils.closeQuietly(resourceStream);\n }\n }\n }", "public static void settleTsFilesAndMods(Map<String, TsFileResource> resourcesToBeSettled) {\n int successCount = 0;\n Map<String, List<TsFileResource>> newTsFileResources = new HashMap<>();\n SettleLog.createSettleLog();\n for (Map.Entry<String, TsFileResource> entry : resourcesToBeSettled.entrySet()) {\n TsFileResource resourceToBeSettled = entry.getValue();\n List<TsFileResource> settledTsFileResources = new ArrayList<>();\n try {\n TsFileAndModSettleTool tsFileAndModSettleTool = TsFileAndModSettleTool.getInstance();\n logger.info(\"Start settling for tsFile : {}\", resourceToBeSettled.getTsFilePath());\n if (tsFileAndModSettleTool.isSettledFileGenerated(resourceToBeSettled)) {\n settledTsFileResources = tsFileAndModSettleTool.findSettledFile(resourceToBeSettled);\n newTsFileResources.put(resourceToBeSettled.getTsFile().getName(), settledTsFileResources);\n } else {\n // Write Settle Log, Status 1\n SettleLog.writeSettleLog(\n resourceToBeSettled.getTsFilePath()\n + SettleLog.COMMA_SEPERATOR\n + SettleCheckStatus.BEGIN_SETTLE_FILE);\n tsFileAndModSettleTool.settleOneTsFileAndMod(resourceToBeSettled, settledTsFileResources);\n // Write Settle Log, Status 2\n SettleLog.writeSettleLog(\n resourceToBeSettled.getTsFilePath()\n + SettleLog.COMMA_SEPERATOR\n + SettleCheckStatus.AFTER_SETTLE_FILE);\n newTsFileResources.put(resourceToBeSettled.getTsFile().getName(), settledTsFileResources);\n }\n\n moveNewTsFile(resourceToBeSettled, settledTsFileResources);\n // Write Settle Log, Status 3\n SettleLog.writeSettleLog(\n resourceToBeSettled.getTsFilePath()\n + SettleLog.COMMA_SEPERATOR\n + SettleCheckStatus.SETTLE_SUCCESS);\n logger.info(\n \"Finish settling successfully for tsFile : {}\", resourceToBeSettled.getTsFilePath());\n successCount++;\n } catch (Exception e) {\n logger.info(\n \"Meet error while settling the tsFile : {}\", resourceToBeSettled.getTsFilePath());\n e.printStackTrace();\n }\n }\n if (resourcesToBeSettled.size() == successCount) {\n SettleLog.closeLogWriter();\n logger.info(\"Finish settling all tsfiles Successfully!\");\n } else {\n logger.info(\n \"Finish Settling, {} tsfiles meet errors.\", (resourcesToBeSettled.size() - successCount));\n }\n }", "@Override\n public void prepare() {\n //Caching as file resource.\n File file = this.getResource().file;\n logger.info(\"Preparing {} streams for file: {}\", this.getTransferType(), file.getName());\n\n if (this.getTransferType() == ResourceTransferType.OUTBOUND) {\n //Sending\n try {\n buffer = new byte[BUFFER_SIZE];\n sent = 0;\n inputChannel = new FileInputStream(file).getChannel();\n inputBuffer = inputChannel.map(FileChannel.MapMode.READ_ONLY, 0, inputChannel.size());\n } catch (FileNotFoundException e) { //File doesn't exist.\n //Calling a transfer error.\n callError(e);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n //Receiving\n //Checking if file already exists.\n written = 0;\n saved = 0;\n if (getResource().isLocal()) {\n getResource().calcNetworkId();\n if (getResource().getNetworkID().equals(getTunnel().getDestination())) {\n //The file is already stored locally.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), -2));\n this.close();\n return;\n }\n }\n\n //Creating or replacing the file.\n buffer = new byte[BUFFER_SIZE * 16];\n if (file.exists()) {\n file.delete();\n }\n try { //Creating new file.\n file.createNewFile();\n outputStream = new FileOutputStream(file);\n } catch (IOException e) {\n //Calling a transfer error.\n callError(e);\n return;\n }\n\n //Requesting the first chunk.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), 0));\n }\n }", "public void errorFileEscenario() {\n\t\tvisorEscenario.errorFileEscenario();\t\n\t}", "private void prepareRuleFiles() {\n\n if (IronSyslog.class.getResource(RULE_FOLDER) == null\n || IronSyslog.class.getResource(RULE_FOLDER + \"service/\") == null\n || IronSyslog.class.getResource(RULE_FOLDER + \"publish/\") == null\n || IronSyslog.class.getResource(RULE_FOLDER + \"other/\") == null) {\n LOGGER.error(\"Error while preparing rule files. Broken file system folder structure. \\n\"\n + \"Make sure that: rules/drools/ and its subfolders service/, publish/ and other/ exist\");\n System.exit(1);\n }\n\n // Prepare Configuration\n Yaml yaml = new Yaml();\n InputStream input = IronSyslog.class.getResourceAsStream(RULE_FOLDER\n + \"config.yml\");\n RulesConfiguration config = yaml\n .loadAs(input, RulesConfiguration.class);\n\n try {\n // Add only the service rules (in the service folder) specified in\n // the configuration\n for (String service : config.getServiceInclude()) {\n String fileName = RULE_FOLDER + \"service/\" + service + \".drl\";\n if (IronSyslog.class.getResource(fileName) != null) {\n LOGGER.debug(\"Adding rule file: \" + fileName);\n mRuleFiles.add(RULE_FOLDER + \"service/\" + service + \".drl\");\n } else {\n LOGGER.warn(\"Failed to add rule file: \" + fileName);\n }\n }\n\n // Add all publish rules (in the \"publish\" folder) excluding the one\n // specified on the\n // configuration\n File publishFolder = new File(IronSyslog.class.getResource(\n RULE_FOLDER + \"publish/\").toURI());\n File[] publishFiles = publishFolder.listFiles();\n for (int i = 0; i < publishFiles.length; i++) {\n String fileName = publishFiles[i].getName();\n if (fileName.endsWith(\".drl\")\n && !config.getPublishExclude().contains(\n fileName.substring(0, fileName.length() - 4))) {\n LOGGER.debug(\"Adding rule file: \" + RULE_FOLDER\n + \"publish/\" + fileName);\n mRuleFiles.add(RULE_FOLDER + \"publish/\" + fileName);\n }\n }\n\n // Add all other rules (\"other\" folder, including subfolders)\n addAllRuleFilesInFolder(RULE_FOLDER + \"other/\");\n } catch (URISyntaxException e) {\n LOGGER.debug(\"Error while searching for rule files. \" + e);\n }\n }", "public void execute() throws BuildException {\n super.execute();\n\n // minimal Renew logging configuration that forwards messages\n // to the Ant logging system\n Logger logger = Logger.getLogger(\"CH.ifa.draw\");\n AntTaskLogAppender appender = AntTaskLogAppender.getInstance(this);\n logger.addAppender(appender);\n logger.setLevel(Level.INFO);\n logger = Logger.getLogger(\"de.renew\");\n logger.addAppender(appender);\n logger.setLevel(Level.INFO);\n\n // get all files - out of the vector full of filesets -> 2 loops\n Iterator<FileSet> filesetIterator = filesets.iterator();\n while (filesetIterator.hasNext()) {\n FileSet elementFileSet = filesetIterator.next();\n DirectoryScanner dirScan = elementFileSet.getDirectoryScanner(getProject());\n String[] fileNames = dirScan.getIncludedFiles();\n log(\"filenames: \" + fileNames.length, Project.MSG_VERBOSE);\n\n for (int i = 0; i < fileNames.length; i++) {\n String fileName = fileNames[i];\n File inFile = new File(dirScan.getBasedir() + \"/\" + fileName);\n log(\"File: \" + inFile.getAbsolutePath(), Project.MSG_VERBOSE);\n\n // get drawing from file\n Drawing netDrawing = DrawingFileHelper.loadDrawing(inFile,\n new StatusDisplayer() {\n public void showStatus(String message) {\n log(message);\n }\n }); //rnw-Object\n log(\"Drawing: \" + netDrawing, Project.MSG_VERBOSE);\n\n if (netDrawing == null) {\n throw new BuildException(\"Could not read drawing file: \"\n + inFile);\n }\n\n // Export netDrawing\n try {\n File helpFile = new File(destdir + \"/\" + fileName); // helps to get the right directory path\n File outFile = new File(helpFile.getParent() + \"/\"\n + netDrawing.getName() + \".\"\n + defaultExtension);\n\n //create directories\n outFile.getParentFile().mkdirs();\n exportFormat.export(netDrawing, outFile);\n } catch (Exception e) {\n throw new BuildException(e);\n }\n }\n }\n }", "public File transform(final Swagger swagger) throws Exception {\n\t\tapplication.getDoc().add(addDoc(swagger.getInfo().getTitle(), swagger.getInfo().getDescription()));\n\t\tResources resources = objectFactory.createResources();\n\t\tapplication.getResources().add(resources);\n\n\t\t/**\n\t\t * look for end point URL This is required for AI\n\t\t */\n\t\tString protocol = \"\";\n\n\t\tString baseURI = null;\n\t\tif (swagger.getHost() != null) {\n\t\t\tbaseURI = swagger.getHost();\n\t\t}\n\t\tif (null != baseURI && (!baseURI.contains(ParserConstants.http.toString()) || !baseURI.contains(ParserConstants.https.toString()))) {\n\t\t\tif (null != swagger.getSchemes() && swagger.getSchemes().size() > 0) {\n\t\t\t\tprotocol = swagger.getSchemes().get(0).toString() + \"://\";\n\t\t\t\tprotocol = protocol.toLowerCase();\n\t\t\t} else {\n\t\t\t\tprotocol = ParserConstants.http.value();\n\t\t\t}\n\t\t}\n\t\tString basePath = \"\";\n\t\tif (null != swagger.getBasePath() && !swagger.getBasePath().isEmpty()) {\n\t\t\tbasePath = swagger.getBasePath();\n\t\t}\n\n\t\tif (null != baseURI) {\n\t\t\tresources.setBase(protocol + baseURI + basePath);\n\t\t}\n\t\t\n\t\tif(null!=resources.getBase()){\n\t\t\tlogger.info(\"end point : \" + resources.getBase());\n\t\t}else{\n\t\t\tthrow new Exception(\"End point URL not present\");\n\t\t}\n\t\t/**\n\t\t * enumerates different parameters type such as headers,query\n\t\t */\n\t\tfor (Map.Entry<String, Path> path : swagger.getPaths().entrySet()) {\n\t\t\tResource resource = objectFactory.createResource();\n\t\t\tresource.setId(path.getKey().replace('/', '_').replace('{', '_').replace('}', '_'));\n\t\t\tresource.setPath(path.getKey());\n\n\t\t\tif (path.getValue().getParameters() != null) {\n\t\t\t\tfor (Parameter param : path.getValue().getParameters()) {\n\t\t\t\t\tParam params = objectFactory.createParam();\n\t\t\t\t\tparams.setName(param.getName());\n\t\t\t\t\tparams.getDoc().add(addDoc(param.getName(), param.getDescription()));\n\t\t\t\t\tparams.setStyle(ParamStyle.fromValue(param.getIn()));\n\t\t\t\t\tparams.setRequired(param.getRequired());\n\t\t\t\t\tparams.setType(new QName(\"\"));\n\t\t\t\t\tresource.getParam().add(params);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * check for operation name, resource base etc.\n\t\t\t */\n\t\t\tfor (Entry<HttpMethod, Operation> op : path.getValue().getOperationMap().entrySet()) {\n\t\t\t\tMethod method = objectFactory.createMethod();\n\t\t\t\tmethod.getDoc().add(addDoc(op.getValue().getOperationId(), op.getValue().getSummary()));\n\t\t\t\tmethod.setId(op.getValue().getOperationId());\n\t\t\t\tmethod.setName(op.getKey().name().toUpperCase());\n\n\t\t\t\tRequest req = objectFactory.createRequest();\n\t\t\t\t/**\n\t\t\t\t * check tyoe of request, namespace etc.\n\t\t\t\t */\n\t\t\t\tif (op.getValue().getConsumes() != null) {\n\t\t\t\t\tfor (String mime : op.getValue().getConsumes()) {\n\t\t\t\t\t\tRepresentation representation = objectFactory.createRepresentation();\n\t\t\t\t\t\trepresentation.setElement(new QName(ParserConstants.tns_prefix.value() + path.getKey()));\n\t\t\t\t\t\trepresentation.setMediaType(mime);\n\t\t\t\t\t\treq.getRepresentation().add(representation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (op.getValue().getParameters() != null) {\n\t\t\t\t\tfor (Parameter param : op.getValue().getParameters()) {\n\t\t\t\t\t\tParam parameter = null;\n\t\t\t\t\t\tparameter = objectFactory.createParam();\n\t\t\t\t\t\tparameter.setName(param.getName());\n\t\t\t\t\t\tparameter.getDoc().add(addDoc(param.getName(), param.getDescription()));\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * check input parameter type like header, query etc.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (null != param.getIn() && (param.getIn().equalsIgnoreCase(ParserConstants.query.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.header.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.template.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.matrix.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.plain.toString()))) {\n\t\t\t\t\t\t\tparameter.setStyle(ParamStyle.fromValue(param.getIn()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameter.setRequired(param.getRequired());\n\t\t\t\t\t\tparameter.setType(new QName(\"\"));\n\t\t\t\t\t\treq.getParam().add(parameter);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//set the request\n\t\t\t\tmethod.setRequest(req);\n\n\t\t\t\t//set the response\n\t\t\t\tResponse res = objectFactory.createResponse();\n\t\t\t\tfor (String mime : op.getValue().getProduces()) {\n\t\t\t\t\tRepresentation representation = objectFactory.createRepresentation();\n\t\t\t\t\trepresentation.setElement(new QName(ParserConstants.tns_prefix.value() + path.getKey()));\n\t\t\t\t\trepresentation.setMediaType(mime);\n\t\t\t\t\tres.getRepresentation().add(representation);\n\t\t\t\t}\n\t\t\t\tfor (Entry<String, io.swagger.models.Response> response : op.getValue().getResponses().entrySet()) {\n\t\t\t\t\tres.getDoc().add(addDoc(response.getKey(), response.getValue().getDescription()));\n\t\t\t\t}\n\t\t\t\tmethod.getResponse().add(res);\n\t\t\t\tresource.getMethodOrResource().add(method);\n\t\t\t}\n\t\t\tresources.getResource().add(resource);\n\t\t}\n\n\t\tfor (Entry<String, Model> def : swagger.getDefinitions().entrySet()) {\n\t\t\tif (null != def.getValue().getProperties())\n\t\t\t\tschema.appendChild(js2wadl(def.getKey(), def.getValue().getProperties()));\n\t\t}\n\n\t\t/**\n\t\t * by default store the converted swagger into file\n\t\t */\n\t\tJAXBContext jaxbContext = JAXBContext.newInstance(ParserConstants.jaxb_tns.value());\n\t\tMarshaller marshaller = jaxbContext.createMarshaller();\n\t\tmarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));\n\t\tFile file = new File(ParserConstants.File_Name.value());\n\t\tmarshaller.marshal(application, file);\n\t\treturn file;\n\t}", "@Before\n public void initCommon() {\n try {\n ResourceSetImpl _resourceSetImpl = new ResourceSetImpl();\n this.rs = _resourceSetImpl;\n String _basePath = this.getBasePath();\n String _translatePath = this.translatePath(\"ISML-MDE/tool/co.edu.javeriana.isml.common/model/common/primitives/Primitives.isml\");\n String _plus = (_basePath + _translatePath);\n final URI uri = URI.createURI(_plus);\n final Resource resource = this.rs.createResource(uri);\n resource.load(CollectionLiterals.<Object, Object>emptyMap());\n String _basePath_1 = this.getBasePath();\n String _translatePath_1 = this.translatePath(\"ISML-MDE/tool/co.edu.javeriana.isml.common/model/common/primitives/Constraints.isml\");\n String _plus_1 = (_basePath_1 + _translatePath_1);\n this.rs.createResource(URI.createURI(_plus_1)).load(CollectionLiterals.<Object, Object>emptyMap());\n String _basePath_2 = this.getBasePath();\n String _translatePath_2 = this.translatePath(\"ISML-MDE/tool/co.edu.javeriana.isml.common/view/common/widgets/PrimitiveWidgets.isml\");\n String _plus_2 = (_basePath_2 + _translatePath_2);\n this.rs.createResource(URI.createURI(_plus_2)).load(CollectionLiterals.<Object, Object>emptyMap());\n String _basePath_3 = this.getBasePath();\n String _translatePath_3 = this.translatePath(\"ISML-MDE/tool/co.edu.javeriana.isml.common/services/common/services/Persistence.isml\");\n String _plus_3 = (_basePath_3 + _translatePath_3);\n this.rs.createResource(URI.createURI(_plus_3)).load(CollectionLiterals.<Object, Object>emptyMap());\n } catch (Throwable _e) {\n throw Exceptions.sneakyThrow(_e);\n }\n }", "protected void resourceSet(String resource)\r\n {\r\n // nothing to do\r\n }", "private void removeOldFiles() {\n Set<File> existingFiles = new HashSet<File>();\n collectFiles(existingFiles);\n for (ResourceResponse r : cacheResponseProcessor.getResources()) {\n String remotePathId = r.pathId;\n String remotePath = localClasspathProcessor.getLocalClasspath().get(remotePathId);\n String localPath = localPathTranslation.get(remotePath);\n File localFile = new File(localPath);\n File file = new File(localFile, r.name);\n existingFiles.remove(file);\n }\n }", "private static void isFileExistOrCreatIt(String fileName) {\n if (!fileName.endsWith(\".json\")){\n throw new IllegalArgumentException(\"Invalid file name\");\n }\n File file = new File(\"src//main//resources\"+\"//\"+fileName);\n if(!file.exists()){\n try{\n file.createNewFile();\n }catch (IOException e){\n e.printStackTrace();\n }\n\n }\n }", "private boolean shouldBuild(IResource resource) {\n \t\treturn resource.getType() == IResource.FILE && resource.getFileExtension().equals(\"gf\");\n \t}", "@Experimental\n default void addGeneratedResource(String resource) {\n info(\"EXPERIMENTAL: Compile time resource contribution to the context is experimental\", null);\n }", "protected abstract String getResourcePath();", "public static void handleFileNotFoundException() {\n System.out.println(\"\\tUnfortunately, I could not detect any files in the database!\");\n System.out.println(\"\\tBut don't worry sir.\");\n System.out.println(\"\\tI will create the files you might be needing later.\");\n Duke.jarvis.printDivider();\n }", "@Override\n protected void load(ScanningContext context) {\n ResourceItem item = getRepository().getResourceItem(mType, mResourceName);\n\n // add this file to the list of files generating this resource item.\n item.add(this);\n\n // Ask for an ID refresh since we're adding an item that will generate an ID\n context.requestFullAapt();\n }", "private Assets (){}", "public void execute() throws XDocletException {\n\t\tsetPublicId(DD_PUBLICID_20);\n\t\tsetSystemId(DD_SYSTEMID_20);\n\n\t\t// will not work .... dumper.xdt does not exist\n\t\t/*\n\t\tsetTemplateURL(getClass().getResource(\"resources/dumper.xdt\"));\n\t\tsetDestinationFile(\"dump\");\n\t\tSystem.out.println(\"Generating dump\");\n\t\tstartProcess();\n\t\t*/\n\n\n\t\tsetTemplateURL(getClass().getResource(WEBSPHERE_EJB_JAR_XML_TEMPLATE_FILE));\n\t\tsetDestinationFile(\"ejb-jar.xml\");\n\t\tSystem.out.println(\"Generating ejb-jar.xml\");\n\t\tstartProcess();\n\n setTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_BND_TEMPLATE_FILE));\n setDestinationFile(WEBSPHERE_DD_BND_FILE_NAME);\n System.out.println(\"Generating \" + WEBSPHERE_DD_BND_FILE_NAME);\n startProcess();\n\n setTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_EXT_TEMPLATE_FILE));\n setDestinationFile(WEBSPHERE_DD_EXT_FILE_NAME);\n System.out.println(\"Generating \" + WEBSPHERE_DD_EXT_FILE_NAME);\n startProcess();\n \n setTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_EXT_PME_TEMPLATE_FILE));\n setDestinationFile(WEBSPHERE_DD_EXT_PME_FILE_NAME);\n System.out.println(\"Generating \" + WEBSPHERE_DD_EXT_PME_FILE_NAME);\n startProcess();\n\n /*\n setTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_ACCESS_BEAN_TEMPLATE_FILE));\n setDestinationFile(WEBSPHERE_DD_ACCESS_FILE_NAME);\n System.out.println(\"Generating \" + WEBSPHERE_DD_ACCESS_FILE_NAME);\n startProcess();\n */\n \n\t\tsetTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_MAPXMI_TEMPLATE_FILE));\n\t\tsetDestinationFile(\"backends/\" + getDb() + \"/Map.mapxmi\");\n\t\tSystem.out.println(\"Generating backends/\" + getDb() + \"/Map.mapxmi\");\n\t\tstartProcess();\n \n setTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_DBXMI_TEMPLATE_FILE));\n setDestinationFile(\"backends/\" + getDb() + \"/\" + getSchema() + \".dbxmi\");\n System.out.println(\"Generating backends/\" + getDb() + \"/\" + getSchema() + \".dbxmi\");\n startProcess();\n \n\t\tsetTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_SCHXMI_TEMPLATE_FILE));\n\t\tsetDestinationFile(\"backends/\" + getDb() + \"/\" + getSchema() + \"_\" + getUser() + \"_sql.schxmi\");\n\t\tSystem.out.println(\"Generating backends/\" + getDb() + \"/\" + getSchema() + \"_\" + getUser() + \"_sql.schxmi\");\n\t\tstartProcess();\n\t\t\n\t\tCollection classes = getXJavaDoc().getSourceClasses();\n\t\tfor (ClassIterator i = XCollections.classIterator(classes); i.hasNext();) {\n\t\t\tXClass clazz = i.next();\n\t\t\t//System.out.print(\">> \" + clazz.getName());\n\t\t\t// check tag ejb:persistence + sub tag table-name\n\t\t\tXTag tag = clazz.getDoc().getTag(\"ejb:persistence\");\n\t\t\tif (tag != null) {\n\t\t\t\tString tableName = tag.getAttributeValue(\"table-name\");\n\t\t\t\t//System.out.println(\"ejb:persistence table-name = '\" + tableName + \"'\");\n\t\t\t\tString destinationFileName = \"backends/\" + getDb() + \"/\" + getSchema() + \"_\" + getUser() + \"_sql_\" + tableName + \".tblxmi\";\n\t\t\t\tSystem.out.println(\"Generating \" + destinationFileName);\n\t\t\t\t\n\t\t\t\tsetTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_TBLXMI_TEMPLATE_FILE));\n\t\t\t\tsetDestinationFile(destinationFileName);\n\t\t\t\tsetHavingClassTag(\"ejb:persistence\");\n\t\t\t\tsetCurrentClass(clazz);\n\t\t\t\tstartProcess();\n\t\t\t}\n\t\t\t// Now, check for relationships \n\t\t\tfor (Iterator methods = clazz.getMethods().iterator(); methods.hasNext();) {\n\t\t\t\tXMethod method = (XMethod)methods.next();\n\t\t\t\tif (method.getDoc().hasTag(\"websphere:relation\")) {\n\t\t\t\t\tString tableName = method.getDoc().getTagAttributeValue(\"websphere:relation\",\"table-name\");\n\t\t\t\t\tsetTemplateURL(getClass().getResource(WEBSPHERE_DEFAULT_RELATIONSHIP_TBLXMI_TEMPLATE_FILE));\n\t\t\t\t\tString destinationFileName = \"backends/\" + getDb() + \"/\" + getSchema() + \"_\" + getUser() + \"_sql_\" + tableName + \".tblxmi\";\n\t\t\t\t\tsetDestinationFile(destinationFileName);\n\t\t\t\t\tsetCurrentClass(clazz);\n\t\t\t\t\tsetCurrentMethod(method);\n\t\t\t\t\tSystem.out.println(\"\\tGenerating M-M Relationship table: \" + destinationFileName);\n\t\t\t\t\tstartProcess();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t}\n\n/*\n if (atLeastOneCmpEntityBeanExists()) {\n setTemplateURL(getClass().getResource(WEBSPHERE_SCHEMA_TEMPLATE_FILE));\n setDestinationFile(WEBSPHERE_DD_SCHEMA_FILE_NAME);\n startProcess();\n }\n*/\n }", "public String getResPath()\n/* */ {\n/* 138 */ return this.resPath;\n/* */ }", "private File extractResources() {\r\n\t\tif (org.opensourcephysics.display.OSPRuntime.appletMode)\r\n\t\t\treturn null;\r\n\t\tFile descTempDirectory = new File(getTemporaryDir() + \"DescriptionPages/\");\r\n\t\tif (!descTempDirectory.exists()) {\r\n\t\t\tif (!descTempDirectory.mkdirs()) {\r\n\t\t\t\tSystem.err.println(\r\n\t\t\t\t\t\t\"DescriptionPages : Could not create directory : \" + descTempDirectory.getAbsolutePath());\r\n\t\t\t\tJOptionPane.showMessageDialog(openPageButton, Memory.getResource(\"DescriptionPages.CannotExtractFiles\"),\r\n\t\t\t\t\t\tMemory.getResource(\"Error\"), JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// System.err.println (\"Extracting description pages to folder :\r\n\t\t// \"+descTempDirectory.getAbsolutePath());\r\n\t\tfor (String filename : model._getClassEjsResources()) {\r\n\t\t\tif (extractToDirectory(filename, descTempDirectory, false) == null)\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t\textractToDirectory(\"/_ejs_library/css/ejss.css\", descTempDirectory, false); // New in %.3Failure to do this does\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// not invalidate the process\r\n\t\treturn descTempDirectory;\r\n\t}", "void oR() {\n if (this.aqt == null) {\n throw new IllegalStateException(\"Callback must be set before execute\");\n }\n this.aqt.ob();\n bh.V(\"Attempting to load resource from disk\");\n if ((ce.oJ().oK() == ce.a.aqi || ce.oJ().oK() == ce.a.aqj) && this.aoc.equals(ce.oJ().getContainerId())) {\n this.aqt.a(bg.a.apM);\n return;\n }\n try {\n var1_1 = new FileInputStream(this.oS());\n }\n catch (FileNotFoundException var1_2) {\n bh.S(\"Failed to find the resource in the disk\");\n this.aqt.a(bg.a.apM);\n return;\n }\n var2_7 = new ByteArrayOutputStream();\n cr.b(var1_1, (OutputStream)var2_7);\n var2_7 = ol.a.l(var2_7.toByteArray());\n this.d((ol.a)var2_7);\n this.aqt.l((ol.a)var2_7);\n try {\n var1_1.close();\n }\n catch (IOException var1_3) {\n bh.W(\"Error closing stream for reading resource from disk\");\n }\n ** GOTO lbl52\n catch (IOException var2_8) {\n this.aqt.a(bg.a.apN);\n bh.W(\"Failed to read the resource from disk\");\n {\n catch (Throwable var2_10) {\n try {\n var1_1.close();\n }\n catch (IOException var1_6) {\n bh.W(\"Error closing stream for reading resource from disk\");\n throw var2_10;\n }\n throw var2_10;\n }\n }\n try {\n var1_1.close();\n }\n catch (IOException var1_4) {\n bh.W(\"Error closing stream for reading resource from disk\");\n }\n ** GOTO lbl52\n catch (IllegalArgumentException var2_9) {\n this.aqt.a(bg.a.apN);\n bh.W(\"Failed to read the resource from disk. The resource is inconsistent\");\n try {\n var1_1.close();\n }\n catch (IOException var1_5) {\n bh.W(\"Error closing stream for reading resource from disk\");\n }\nlbl52: // 6 sources:\n bh.V(\"The Disk resource was successfully read.\");\n return;\n }\n }\n }", "private void generate() throws FileNotFoundException {\n if (clazz.isInterface())\n generateInterface();\n writer.close();\n }", "@Test\n public void loadFromFileWithWrongConnects() throws Exception{\n fileInOut.setFilePath(\"src/wrongConnects\");\n fileInOut.loadFromFile();\n }", "public void generate(String fileName) throws ApplicationException {\r\n\t// first of all, initialize templates\r\n\ttemplateManager.initTemplates();\r\n\r\n\tFile file = new File(fileName);\r\n\tif (file.isDirectory()) {\r\n\t File[] files = file.listFiles(new FilenameFilter() {\r\n\t\t public boolean accept(File dir, String name) {\r\n\t\t\tif (name.endsWith(INPUT_FILE_EXT)) {\r\n\t\t\t return true;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t }\r\n\t\t});\r\n\r\n\t for (int i = 0; i < files.length; i++) {\r\n\t\ttry {\r\n\t\t generateUsing(files[i]);\r\n\t\t} catch (ApplicationException e) {\r\n\t\t logger.log(Level.SEVERE, \"batch job failed while using input file \"\r\n\t\t\t + files[i].getAbsolutePath(), e);\r\n\t\t}\r\n\t }\r\n\t} else {\r\n\t try {\r\n\t\tgenerateUsing(file);\r\n\t } catch (ApplicationException e) {\r\n\t\tlogger.log(Level.SEVERE, \"batch job failed while using input file \"\r\n\t\t\t + file.getAbsolutePath(), e);\r\n\t }\r\n\t}\r\n }", "public void locateResources() {\n\t\t\n\t\t// Locate resource for tips.txt\n\t\ttipsLocation = Facts.class.getResource(\"tips.txt\");\n\t\t\n\t\t// Throw IllegalArgumentException if resource could not be located\n\t\tif (tipsLocation == null) throw new IllegalArgumentException(\"tipsLocation is null.\"\n\t\t\t\t+ \"Could not locate resource for tips.txt\");\n\t\t\n\t\t\n\t\t// Locate resource for facts.txt\n\t\tfactsLocation = Facts.class.getResource(\"facts.txt\");\n\t\t\n\t\t// Throw IllegalArgumentException if resource could not be located\n\t\tif (factsLocation == null) throw new IllegalArgumentException(\"factsLocation is null.\"\n\t\t\t\t+ \"Could not locate resource for facts.txt\");\n\t\t\n\t}", "public boolean isSettledFileGenerated(TsFileResource oldTsFileResource) {\n String oldFilePath = oldTsFileResource.getTsFilePath();\n return TsFileAndModSettleTool.getInstance().recoverSettleFileMap.containsKey(oldFilePath)\n && TsFileAndModSettleTool.getInstance().recoverSettleFileMap.get(oldFilePath)\n == SettleCheckStatus.AFTER_SETTLE_FILE.getCheckStatus();\n }", "@Override protected void succeeded(String fileContents) {\n app.setFile(getFile());\n }", "public void generate(File file) throws IOException;", "private void prepareREADME() {\n\t\ttry {\n\t\t\tInputStream is = getClass().getResourceAsStream(\"/demo/README.txt\");\n\t\t\tInputStreamReader isr = new InputStreamReader(is);\n\t\t\tBufferedReader br = new BufferedReader(isr);\n\t\t\tString readme = \"\";\n\t\t\twhile ((readme = br.readLine()) != null)\n\t\t\t\tview.appendTextREADME(readme += \"\\n\");\n\t\t\tbr.close();\n\t\t\tisr.close();\n\t\t\tis.close();\n\t\t} catch (IOException e) {\n\t\t\tview.displayErrorMessage(\"ERROR: README creation failed.\");\n\t\t}\n\t}", "@Override\n\tpublic void pathGenerated() {\n\n\t}", "private void validate()\n throws TaskException\n {\n if( null == m_destfile )\n {\n final String message =\n REZ.getString( \"manifest.missing-file.error\" );\n throw new TaskException( message );\n }\n if( m_destfile.exists() && !m_destfile.isFile() )\n {\n final String message =\n REZ.getString( \"manifest.bad-file.error\", m_destfile );\n throw new TaskException( message );\n }\n }", "private void createValidationExceptionFile(final Class Class_, final String simpleName) throws Exception {\n final SessionFactory SessionFactory = HibernateUtil.getSingleton().getSessionFactoryLocal();\n final ClassMetadata classMetadata = SessionFactory.getClassMetadata(Class_);\n final String[] propertyNames = classMetadata.getPropertyNames();\n \n //Create the path\n final String className = simpleName + \"sValidatorsExceptions\";\n final String path = \"../era_easyretail/src/main/java/com/era/easyretail/validators/exceptions\";\n final String finalClassPath = path + \"/\" + className + \".java\"; \n \n //Get file content\n final String fileContent = this.getValidationExceptionContent(Class_,simpleName,propertyNames);\n \n //If the file exists delete it\n final File File = new File(finalClassPath); \n if(File.exists()){\n File.delete();\n }\n \n //Create the file\n File.createNewFile();\n \n //Write to the file\n try ( //Write the class\n FileWriter writer = new FileWriter(File)) { \n writer.write(fileContent);\n }\n }", "private void tooManyDefinitions() {\n throw new BuildException(\n \"Only one of the attributes name, file and resource can be set\",\n getLocation());\n }", "@Override\r\n\tpublic void update(Resources resources) {\n\t\t\r\n\t}", "public static Resource loadFromFile() {\n File file = new File(saveFilePath);\n // create a new file if it doesn't exist\n if (!file.exists()) {\n // save an empty resource object\n Resource resource = new Resource();\n resource.saveToFile();\n }\n\n Resource resource = null;\n try {\n resource = (Resource) loadObjFromFile(saveFilePath);\n } catch (InvalidClassException e) {\n // if resource file is outdated or corrupted reset file\n resource = new Resource();\n resource.saveToFile();\n staticLog(\"resource file was corrupted, cleared with new one\");\n// e.printStackTrace();\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n resource.activeUsers = new HashMap<>();\n resource.activeProjects = new HashMap<>();\n return resource;\n }", "private void scanProject() {\n ProjectResources resources = ResourceManager.getInstance().getProjectResources(mProject);\n if (resources != null) {\n Collection<ResourceItem> layouts = resources.getResourceItemsOfType(LAYOUT);\n for (ResourceItem layout : layouts) {\n List<ResourceFile> sources = layout.getSourceFileList();\n for (ResourceFile source : sources) {\n updateFileIncludes(source, false);\n }\n }\n\n return;\n }\n }", "public void generateAndwriteToFile() {\n List<GeneratedJavaFile> gjfs = generate();\n if (gjfs == null || gjfs.size() == 0) {\n return;\n }\n for (GeneratedJavaFile gjf : gjfs) {\n writeToFile(gjf);\n }\n }", "public void corruptedFileErrorMessage() {\n System.out.println(\"The file (\" + INVENTORY_FILE_PATH + \") is corrupted!\\n\"\n + \"Please exit the program and delete the corrupted file before trying to access Inventory Menu!\");\n }", "private Map<String, String> generateNewResources(VitroRequest vreq) {\n\t\t\tHashMap<String, String> newResources = new HashMap<String, String>();\n\t\t\tnewResources.put(\"conceptNode\", null);\n\t\t\t//There are no new resources here, the concept node uri doesn't\n\t\t\t//get created but already exists, and vocab uri should already exist as well\n\t\t\treturn newResources;\n\t\t}", "private void createResource(IResource resource) throws CoreException {\n \t\tif (resource.exists()) {\n \t\t\treturn;\n \t\t}\n \n \t\tcreateResource(resource.getParent());\n \n \t\tint type = resource.getType();\n \n \t\tif (type == IResource.FOLDER) {\n \t\t\t((IFolder) resource).create(true, true, null);\n \t\t} else if (type == IResource.FILE) {\n \t\t\t((IFile) resource).create(null, true, null);\n \t\t} else {\n \t\t\tthrow new ResourceException(IResourceStatus.RESOURCE_WRONG_TYPE, null, \"Wrong resource type\", null);\n \t\t}\n \t}", "private void checkHeaderGeneration() {\r\n\t\tif (headerGenerated) {\r\n\t\t\tthrow new RuntimeException(\"Header already generated using previous value.\");\r\n\t\t}\r\n\t}", "@Override\n public void initialize() {\n // TODO Auto-generated method stub\n String name = (String)getConfigParameterValue(\"OutputPath\");\n File file = new File(name);\n try {\n bout = new BufferedWriter(new FileWriter(file));\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n throw new UIMARuntimeException(e);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n throw new UIMARuntimeException(e);\n }\n output = new HashSet<String>();\n }", "@Test\n\tpublic void testGenerateCodeAndOverwriteFormattedButUnchangedFile() throws IOException {\n\t\tFile tmpFile = File.createTempFile(\"junit\", \".tmp\");\n\t\ttmpFile.deleteOnExit();\n\n\t\tFile tmpDir = new File(tmpFile.getParentFile(), UUID.randomUUID().toString());\n\t\ttry {\n\t\t\tString filename = \"sample.xml\";\n\t\t\tFile realDir = new File(tmpDir, \"real\");\n\t\t\tFile targetDir = new File(tmpDir, \"target\");\n\t\t\tFile realFile = new File(realDir, filename);\n\n\t\t\t// generate sample1\n\t\t\tcodeGenerator.generateCode(CodeOverwritePolicy.OVERWRITE_IF_UNCHANGED, new HashMap<String, Object>(),\n\t\t\t\t\trealDir, targetDir, \"sample1.vm\", filename);\n\n\t\t\t// assert that sample1 was written\n\t\t\tAssert.assertTrue(FileUtils.readFileToString(realFile).contains(\"This is sample1\"),\n\t\t\t\t\t\"Sample 1 was not written successfully, expected text not found in the written file\");\n\n\t\t\tlong creationTime = realFile.lastModified();\n\n\t\t\tcodeGenerator.generateCode(CodeOverwritePolicy.OVERWRITE_IF_UNCHANGED, new HashMap<String, Object>(),\n\t\t\t\t\trealDir, targetDir, \"sample1-formatted.vm\", filename);\n\n\t\t\tlong lastModified = realFile.lastModified();\n\n\t\t\t// assert that sample1 was not written\n\t\t\tAssert.assertTrue(lastModified == creationTime,\n\t\t\t\t\t\"File should not have been changed because only formatting changed\");\n\t\t} finally {\n\t\t\tFileUtils.deleteDirectory(tmpDir);\n\t\t}\n\t}", "private void cleanResources() {\r\n// return;\r\n placeholder = DEFAULT_PLACEHOLDER;\r\n errorImage = DEFAULT_PLACEHOLDER;\r\n imageUri = null;\r\n tag = null;\r\n imageResourceId = DEFAULT_PLACEHOLDER;\r\n simple = false;\r\n withScaling = false;\r\n widthResId = DEFAULT_PLACEHOLDER;\r\n heigthResId = DEFAULT_PLACEHOLDER;\r\n transformation = null;\r\n callback = null;\r\n fit = false;\r\n centerCrop = false;\r\n centerInside = false;\r\n }", "public void inici() {\n\t\n if (filename == null) {\n \t//System.err.println(Resources.getResource(\"./modelo/cube.obj\"));\n \t filename = Resources.getResource(\"./modelo/cube.obj\");\n if (filename == null) {\n System.err.println(\"modelo/cube.obj nots found\");\n System.exit(1);\n }\n\t}\n\t}", "@Override\r\n\tpublic void updateResourceInformation() {\n\t}", "private void init() {\n\n DateFormat dateFormatter = new SimpleDateFormat(\"YYYY_MM_dd-HH_mm_ss_SSS\");\n String timeString = dateFormatter.format(new Date(System.currentTimeMillis()));\n urlsFile = new File(\"urls_\" + timeString + \".txt\");\n emailsFile = new File(\"emails_\" + timeString + \".txt\");\n\n try {\n urlsFile.createNewFile();\n emailsFile.createNewFile();\n urlsWriter = new PrintWriter(urlsFile.getPath(), \"UTF-8\");\n emailsWriter = new PrintWriter(emailsFile.getPath(), \"UTF-8\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private MyResource() {\n System.out.printf(\"[%s] has been created \\n\", MyResource.class.getSimpleName());\n }", "protected abstract void generateProfileFiles() throws Exception;", "protected JsManifestationFile() {\n\n\t}", "public void generate() throws FileNotFoundException, UnsupportedEncodingException {\n\t\twriter = new PrintWriter(outputFile, \"UTF-8\");\n\t\tFile file = new File(inputFile);\n\t\treader = new Scanner(file);\n\t\tinitializeFile();\n\t\t\n\t\tString line = readLine();\n\t\twhile (line != null) {\n\t\t\tprocess(line);\n\t\t\tline = readLine();\n\t\t}\n\t\t\n\t\tfinishFile();\n\t\twriter.close();\n\t}", "void resourceChanged(IPath workspacePath);", "@Override\n protected void setUp() throws Exception {\n super.setUp();\n\n m_TestHelper.copyResourceToTmp(\"regression.arff\");\n }", "@Override\n\tpublic void updateResourceInformation() {\n\t}", "@Override\n public StepExecutionResult execute(ExecutionContext context) {\n Path rDotTxtPath = rDotTxtDir.resolve(\"R.txt\");\n try {\n CompileStringsStep.buildResourceNameToIdMap(\n filesystem,\n rDotTxtPath,\n stringResourceNameToIdMap,\n pluralsResourceNameToIdMap,\n arrayResourceNameToIdMap);\n } catch (FileNotFoundException ex) {\n context.logError(ex,\n \"The '%s' file is not present.\",\n rDotTxtPath);\n return StepExecutionResult.ERROR;\n } catch (IOException ex) {\n context.logError(ex, \"Failure parsing R.txt file.\");\n return StepExecutionResult.ERROR;\n }\n\n Map<String, Map<String, NativeResourceInfo>> nativeStrings = parseStringFiles(context);\n\n // write nativeStrings out to a file\n Path outputPath = destinationPath.resolve(\"strings.json\");\n try {\n ObjectMappers.WRITER.writeValue(\n filesystem.getPathForRelativePath(outputPath).toFile(),\n nativeStrings);\n } catch (IOException ex) {\n context.logError(\n ex, \"Failed when trying to save the output file: '%s'\", outputPath.toString());\n return StepExecutionResult.ERROR;\n }\n\n return StepExecutionResult.SUCCESS;\n }", "App () throws Exception {\n timelines = new LinkedList<>();\n deleteElements = new LinkedList<>();\n file.createNewFile();\n }", "public static boolean validateResources(IResource[] resources, Shell shell, String title) {\n \t\t\n \t\t// get all readonly files\n \t\tList readOnlyFiles= getReadonlyFiles(resources);\n \t\tif (readOnlyFiles.size() == 0)\n \t\t\treturn true;\n \t\t\n \t\t// get timestamps of readonly files before validateEdit\n \t\tMap oldTimeStamps= createModificationStampMap(readOnlyFiles);\n \t\t\n \t\tIFile[] files= (IFile[]) readOnlyFiles.toArray(new IFile[readOnlyFiles.size()]);\n \t\tIStatus status= ResourcesPlugin.getWorkspace().validateEdit(files, shell);\n \t\tif (! status.isOK()) {\n \t\t\tString message= getString(\"ValidateEdit.error.unable_to_perform\"); //$NON-NLS-1$\n \t\t\tErrorDialog.openError(shell, title, message, status);\n \t\t\treturn false;\n \t\t}\n \t\t\t\n \t\tIStatus modified= null;\n \t\tMap newTimeStamps= createModificationStampMap(readOnlyFiles);\n \t\tfor (Iterator iter= oldTimeStamps.keySet().iterator(); iter.hasNext();) {\n \t\t\tIFile file= (IFile) iter.next();\n \t\t\tif (file.isReadOnly()) {\n \t\t\t\tIStatus entry= new Status(IStatus.ERROR,\n \t\t\t\t\t\t\t\tCompareUIPlugin.getPluginId(),\n \t\t\t\t\t\t\t\tVALIDATE_EDIT_PROBLEM,\n \t\t\t\t\t\t\t\tgetFormattedString(\"ValidateEdit.error.stillReadonly\", file.getFullPath().toString()), //$NON-NLS-1$\n \t\t\t\t\t\t\t\tnull);\n \t\t\t\tmodified= addStatus(modified, entry);\n \t\t\t} else if (! oldTimeStamps.get(file).equals(newTimeStamps.get(file))) {\n \t\t\t\tIStatus entry= new Status(IStatus.ERROR,\n \t\t\t\t\t\t\t\tCompareUIPlugin.getPluginId(),\n \t\t\t\t\t\t\t\tVALIDATE_EDIT_PROBLEM,\n \t\t\t\t\t\t\t\tgetFormattedString(\"ValidateEdit.error.fileModified\", file.getFullPath().toString()), //$NON-NLS-1$\n \t\t\t\t\t\t\t\tnull);\n \t\t\t\tmodified= addStatus(modified, entry);\n \t\t\t}\n \t\t}\n \t\tif (modified != null) {\n \t\t\tString message= getString(\"ValidateEdit.error.unable_to_perform\"); //$NON-NLS-1$\n \t\t\tErrorDialog.openError(shell, title, message, modified);\n \t\t\treturn false;\n \t\t}\n \t\treturn true;\n \t}", "private void initResource(final ResourceReference ref) throws ResourceStreamNotFoundException {\n\t\tfinal boolean gzip = Application.get().getResourceSettings().getDisableGZipCompression();\n\t\ttry {\n\t\t\tApplication.get().getResourceSettings().setDisableGZipCompression(true);\n\t\t\tref.getResource().getResourceStream().getInputStream();\n\t\t} finally {\n\t\t\tApplication.get().getResourceSettings().setDisableGZipCompression(gzip);\n\t\t}\n\t}", "private void initResources(ServletContext servletContext) {\n if (pathnames != null) {\n ActionContext ctx = ActionContext.getContext();\n try {\n \n ValidatorResources resources = this.loadResources(servletContext);\n \n \n String prefix = ctx.getActionInvocation().getProxy().getNamespace();\n \n \n servletContext.setAttribute(ValidatorPlugIn.VALIDATOR_KEY + prefix, resources);\n \n servletContext.setAttribute(ValidatorPlugIn.STOP_ON_ERROR_KEY + '.'\n + prefix,\n (this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));\n } catch (Exception e) {\n throw new StrutsException(\n \"Cannot load a validator resource from '\" + pathnames + \"'\", e);\n }\n }\n }", "private void ensureFile(File destFile) {\n\t\tif (destFile.exists()) {\n\t\t\tLog.i(\"[\" + destFile.getName() + \"]\"\n\t\t\t\t\t+ \" has already exsited, previous content cleared\");\n\t\t}\n\n\t\ttry {\n\t\t\tdestFile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeResource(String name, byte[] data) throws IOException {\n URL url = Thread.currentThread().getContextClassLoader().getResource(\"des-example.png\");\n File projectDir = (new File(url.getPath()))\n .getParentFile()\n .getParentFile()\n .getParentFile();\n File resourceDir = new File(projectDir, \"src/test/resources\");\n\n // Sanity check that resource dir exists\n if (!resourceDir.isDirectory()) {\n throw new IOException(\"cannot find resource directory: \" + resourceDir);\n }\n\n // Write data to file\n try (OutputStream out = new FileOutputStream(new File(resourceDir, name))) {\n out.write(data);\n }\n }", "@Override\n @Experimental\n Optional<GeneratedFile> visitGeneratedFile(String path);", "private void exercise4() throws IOException {\n final Path resourcePath = retrieveResourcePath();\n try (BufferedReader reader = newBufferedReader(resourcePath)) {\n long count = reader.lines()\n .count();\n System.out.println(count);\n }\n }", "public MyResource() {\n System.out.println(\"creating Resource\");\n }", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "private void showInformationAboutBrokenFile(Shell shell) {\n\t\tMessageDialog\n \t.openInformation(\n \t\t shell, \n \t\t \"Info\",\n \t\t \"There was error during test cases generation, make sure selected file is correct!\");\n\t}", "private void updateFile(CrowdinFile _file) {\n String fileN = _file.getFile().getName();\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Initializing: \" + fileN);\n // Making sure the file is a master file and not a translation\n if (_file.getClass().equals(CrowdinFile.class)) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Init dir\");\n initDir(_file.getCrowdinPath());\n try {\n if (_file.getFile().exists()) {\n \n //escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersBeforeSyncFromCodeToCrowdin\");\n \n if (!getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Add file: \" + _file.getCrowdinPath());\n String result = getHelper().addFile(_file);\n if (result.contains(\"success\")) {\n getLog().info(\"File \" + fileN + \" created succesfully.\");\n initTranslations(_file);\n } else {\n getLog().warn(\"Cannot create file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n }\n } else {\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"*** Update file: \" + _file.getCrowdinPath());\n }\n String result = getHelper().updateFile(_file);\n System.out.println(result);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" updated succesfully.\");\n else\n getLog().warn(\"Cannot update file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n \n //remove escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersAfterSyncFromCodeToCrowdin\");\n \n }\n } else {\n if (getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Delete file: \" + _file.getCrowdinPath());\n String result = getHelper().deleteFile(_file);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" deleted succesfully.\");\n else\n getLog().warn(\"Cannot delete file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n }\n }\n } catch (MojoExecutionException e) {\n getLog().error(\"Error while updating file '\" + _file.getFile().getPath() + \"'. Exception:\\n\" + e.getMessage());\n }\n }\n }", "@Test\n\tpublic void testMainValidFile() throws Exception {\n\t\tString testPathResource = System.getProperty(\"user.dir\") + \"/src/test/resources/instructions-file\";\n\t\tString[] arguments = { testPathResource };\n\t\tAutomaticMowerMain.main(arguments);\n\t}" ]
[ "0.634401", "0.602526", "0.5942337", "0.59234476", "0.5913943", "0.5871779", "0.57600576", "0.5746317", "0.5717775", "0.56772554", "0.56536955", "0.5642808", "0.5636709", "0.5632977", "0.559489", "0.5586957", "0.55734557", "0.5572734", "0.5550931", "0.552854", "0.55104494", "0.55014515", "0.5452929", "0.54223895", "0.5411408", "0.54002", "0.53973275", "0.5394131", "0.5370436", "0.53497285", "0.53495526", "0.5342982", "0.5334859", "0.53348553", "0.5332811", "0.5326041", "0.53257346", "0.5323916", "0.53216517", "0.53066504", "0.52755624", "0.526836", "0.5255307", "0.52509934", "0.52311444", "0.5218338", "0.52164364", "0.52111125", "0.5202749", "0.52016455", "0.5201492", "0.51955014", "0.51952815", "0.5194327", "0.5189193", "0.5182093", "0.51793694", "0.51748836", "0.5165987", "0.5158936", "0.51571", "0.51496565", "0.51495516", "0.51451176", "0.5141043", "0.5123702", "0.5111817", "0.51073986", "0.510308", "0.5099493", "0.50975764", "0.50949764", "0.5094164", "0.50872886", "0.5086628", "0.5083242", "0.50827944", "0.5063062", "0.5060553", "0.50575274", "0.50564885", "0.5056004", "0.5037824", "0.5036711", "0.5035544", "0.50348824", "0.50313044", "0.50262403", "0.50228345", "0.5020643", "0.5011017", "0.5009805", "0.5003582", "0.49922743", "0.49898246", "0.49891904", "0.49843436", "0.4980389", "0.49772987", "0.497716", "0.4977067" ]
0.0
-1
only remove this file from the existing ResourceItem.
@Override protected void dispose(ScanningContext context) { getFolder().getRepository().removeFile(mType, this); // Ask for an ID refresh since we're removing an item that previously generated an ID context.requestFullAapt(); // don't need to touch the content, it'll get reclaimed as this objects disappear. // In the mean time other objects may need to access it. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteResource() {\n }", "void delete(InformationResourceFile file);", "private static void deleteResource(ProjectElement element) {\r\n \t\tResource resource = element.eResource();\r\n \t\tif (resource != null) {\r\n resource.getContents().remove(element);\r\n resource.unload();\r\n } \r\n \t}", "public void removeResource(ResourceInterface resource) {\n if (this.resources.contains(resource)) {\n this.resources.remove(resource);\n forceUpdate();\n }\n }", "public void remove(String pResourceName) {\n\t\t\n\t}", "public void removeResource(Resource resource) {\n\t\tif (this.getResources().contains(resource)) {\n\t\t\tthis.getResources().remove(resource);\n\t\t\tresource.setSystem(null);\n\t\t}\n\t}", "public void removeFileInstance()\n {\n this.source = null;\n this.data = null;\n }", "public void removeResourceCollection()\r\n {\r\n getSemanticObject().removeProperty(swb_resourceCollectionInv);\r\n }", "@Override\n public void removeResource(String resourceKey)\n {\n synchronized(InProcessCache.class) {\n if(hasResource(resourceKey)) {\n _cache.remove(resourceKey);\n }\n }\n }", "@Override\r\n\tpublic void removeItem(String absPath) throws VersionException,\r\n\t\t\tLockException, ConstraintViolationException, AccessDeniedException,\r\n\t\t\tRepositoryException {\n\t\t\r\n\t}", "private void deleteFile() {\r\n actionDelete(dataModelArrayList.get(position));\r\n }", "public void removeAllUniqueFileIdentifier() {\r\n\t\tBase.removeAll(this.model, this.getResource(), UNIQUEFILEIDENTIFIER);\r\n\t}", "void deleteTranslatedFiles(InformationResourceFile irFile);", "public void removeItem(){\n\t\tthis.item = null;\n\t}", "private void deleteResource(IResource resource) throws CoreException {\n \t\tif (!resource.exists()) {\n \t\t\treturn;\n \t\t}\n \n \t\tint type = resource.getType();\n \n \t\tif (type == IResource.FOLDER) {\n \t\t\tIFolder folder = (IFolder) resource;\n \t\t\tIResource[] members = folder.members();\n \t\t\tfor (int i = 0; i < members.length; i++) {\n \t\t\t\tdeleteResource(members[i]);\n \t\t\t}\n \t\t\tfolder.delete(true, null);\n \t\t} else if (type == IResource.FILE) {\n \t\t\t((IFile) resource).delete(true, null);\n \t\t} else {\n \t\t\tthrow new ResourceException(IResourceStatus.RESOURCE_WRONG_TYPE, null, \"Wrong resource type\", null);\n \t\t}\n \t}", "protected synchronized void delete()\n {\n if (this.file.exists())\n {\n this.file.delete();\n }\n }", "public void removeResource(TIdentifiable resource) {\r\n\t int column = m_resources.getIndex(resource);\r\n\t if (column >= 0) {\r\n\t m_resources.removeID(resource);\r\n\t m_current_resources_count--;\r\n\t // shift the right columns left:\r\n\t for (int a=column; a < m_current_resources_count; a++)\r\n\t for (int b=0; b < m_current_users_count; b++) \r\n\t m_associations[a][b] = m_associations[a + 1][b];\r\n // clean up that last column:\t \r\n for (int b=0; b < m_current_users_count; b++)\r\n m_associations[m_current_resources_count][b] = null;\r\n\t }\t \r\n }", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "protected abstract void removeItem();", "protected void remove(String filename) throws IOException {\n\t\tthrow new IOException( \"not implemented\" ); //TODO map this to the FileSystem\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 remove(ResourceLocation name) {\n data.remove(name.toString());\n }", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "public void removeFileUploaderItem(FileUploaderItem item) {\n m_items.removeView(item);\n }", "public abstract boolean deleteResource(String name);", "public void remFile(){\n ((MvwDefinitionDMO) core).remFile();\n }", "public /*virtual*/ void RemoveFromDictionary() \r\n {\r\n if (_dictionary != null) \r\n {\r\n _dictionary.DeferredResourceReferences.Remove(this);\r\n _dictionary = null;\r\n } \r\n }", "@Override\n\tpublic void itemRemove(final HomeItem item)\n\t{\n\t\tfileService().removeExcept(item.getReference(), null);\n\n\t\tsqlService().transact(new Runnable()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\titemRemoveTx(item);\n\t\t\t}\n\t\t}, \"remove\");\n\t}", "public ImageFile removeImageFile(int f) { return imageFiles.remove(f); }", "@Override\n\tpublic synchronized void remove(String key) {\n\t\tboolean deleted = getFileForKey(key).delete();\n\t\tremoveEntry(key);\n\t\tif (!deleted) {\n\t\t\tVolleyLog.d(\n\t\t\t\t\t\"Could not delete cache entry for key=%s, filename=%s\",\n\t\t\t\t\tkey, getFilenameForKey(key));\n\t\t}\n\t}", "@Override\n\tpublic void delete()\n\t{\n\t\tcachedContent = null;\n\t\tFile outputFile = getStoreLocation();\n\t\tif ((outputFile != null) && outputFile.exists())\n\t\t{\n\t\t\tif (Files.remove(outputFile) == false)\n\t\t\t{\n\t\t\t\tlog.error(\"failed to delete file: \" + outputFile.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t}", "public Resource removeResource(final Resource resource) {\n return resourceRegistry.removeEntry(resource.getName());\n }", "private OIDataFile removeOIDataFile(final String id) {\n return Identifiable.removeIdentifiable(id, getOIDataFileList());\n }", "public void removeResources() {\n\t\tresources.clear();\n\t}", "public void removeFileFromList(ChatFile file){\n\t\tfilelist.remove(file);\t\t\t\n\t}", "void delistResource(ExoResource xares) throws RollbackException, SystemException;", "public void remove(File file) throws IOException {\n String fileName = file.getName();\n File realFile = new File(INDEX, fileName);\n boolean isStaged = realFile.exists();\n Commit curCommit = getHeadCommit();\n if (isStaged) {\n realFile.delete();\n }\n HashMap<String, Blob> filesInHeadCommit = curCommit.getFile();\n boolean trackedByCurrCommit = filesInHeadCommit.containsKey(fileName);\n if (trackedByCurrCommit) {\n if (file.exists()) {\n file.delete();\n }\n String content = filesInHeadCommit.get(fileName).getContent();\n File fileInRemovingStage = new File(REMOVAL, fileName);\n if (!fileInRemovingStage.exists()) {\n fileInRemovingStage.createNewFile();\n }\n Utils.writeContents(fileInRemovingStage, content);\n }\n if (!isStaged && !trackedByCurrCommit) {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n\n }", "public void resourceDeleted(Resource item)\n\t{\n\t\tevent(\"ResourceDeletion\",\n\t\t\t item.getId(),\n\t\t\t -1,\n\t\t\t -1,\n\t\t\t false);\n\t}", "@Override\n public void delete(File file) {\n }", "@Override\r\n public void onConfirmation(String callerTag) {\r\n ComponentsGetter cg = (ComponentsGetter)getSherlockActivity();\r\n FileDataStorageManager storageManager = cg.getStorageManager();\r\n if (storageManager.getFileById(mTargetFile.getFileId()) != null) {\r\n cg.getFileOperationsHelper().removeFile(mTargetFile, false);\r\n }\r\n }", "private void removefromstore()\r\n\t{\r\n\t\tFile inputFile = new File(\"InventoryItems.csv\");\r\n\t\tFile tempFile = new File(\"temp.csv\");\r\n\t\tString cvsSplitBy = \",\";\r\n\t\t\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(inputFile));\r\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(tempFile));\r\n\t\t\tString currentLine;\r\n\t\t\t\r\n\t\t\twhile((currentLine = reader.readLine()) != null) {\r\n\t\t\t // trim newline when comparing with lineToRemove\r\n\t\t\t\tString[] tempItem = currentLine.split(cvsSplitBy);\r\n\t\t\t if(tempItem[0].equals(this.id)) \r\n\t\t\t \tcontinue;\r\n\t\t\t writer.write(currentLine + System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\t\t\twriter.close(); \r\n\t\t\treader.close(); \r\n\t\t\t\r\n\t\t\t//clear the file\r\n\t\t\tPrintWriter pwriter = new PrintWriter(inputFile);\r\n\t\t\tpwriter.print(\"\");\r\n\t\t\tpwriter.close();\r\n\t\t\t\r\n\t\t\t//copy back the data\r\n\t\t\treader = new BufferedReader(new FileReader(tempFile));\r\n\t\t writer = new BufferedWriter(new FileWriter(inputFile));\r\n\t\t\t\r\n\t\t\twhile((currentLine = reader.readLine()) != null) {\r\n\t\t\t writer.write(currentLine + System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\t\t\twriter.close(); \r\n\t\t\treader.close(); \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}\r\n\t\t\r\n\r\n\r\n\t\t\r\n\t}", "public void deleteFile() {\n String newName = playerList.getSelectionModel().getSelectedItem();\n File user = new File(\"SaveData\\\\UserData\\\\\" + newName + \".txt\");\n if (user.delete()) {\n input.setStyle(\"-fx-border-color: default\");\n playerList.getItems().remove(newName);\n\n MAIN_MENU_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n\n } else {\n ERROR_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n input.setStyle(\"-fx-border-color: red\");\n }\n }", "@Override\r\n\t\tpublic boolean deleteItem() {\n\t\t\treturn false;\r\n\t\t}", "public static void removeUniqueFileIdentifier(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.remove(model, instanceResource, UNIQUEFILEIDENTIFIER, value);\r\n\t}", "@Override\n public Item removeItem(int itemNum) throws VendingMachinePersistenceException {\n loadItemFile();\n Item itemToRemove = itemMap.remove(itemNum);\n writeItemFile();\n\n return itemToRemove;\n }", "public static void removeUniqueFileIdentifier( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, UNIQUEFILEIDENTIFIER, value);\r\n\t}", "@Override\r\n\tpublic String removeItem(String id, String filePath) {\r\n\t\treturn productDetailsRepository.removeItem(id, filePath);\r\n\t}", "public void removeRlsSourceFile(IAstRlsSourceFile rlsFile);", "public void removeAllOriginalFilename() {\r\n\t\tBase.removeAll(this.model, this.getResource(), ORIGINALFILENAME);\r\n\t}", "private void actionRemoveFile ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//---- Get currently selected file index in the combo box\r\n\t\t\tint index = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t//---- Remove the file from the project by its index\r\n\t\t\tDataController.scenarioRemoveFile(index);\r\n\r\n\t\t\thelperDisplayProjectFiles();\r\n\t\t\thelperDisplaySamplesCombobox();\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}", "public void remove(AudioFile object) {\n if (mOriginalValues != null) {\n synchronized (mLock) {\n mOriginalValues.remove(object);\n }\n } else {\n mObjects.remove(object);\n }\n if (mNotifyOnChange) notifyDataSetChanged();\n }", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmFiles.remove(index);\n\t\t}", "void deleteFile(FileReference fileReferece);", "public E remove() throws FileQueueClosedException;", "public void removeChildFile(IFile child) {\n childFiles.remove(child);\n }", "private void removeOldFiles() {\n Set<File> existingFiles = new HashSet<File>();\n collectFiles(existingFiles);\n for (ResourceResponse r : cacheResponseProcessor.getResources()) {\n String remotePathId = r.pathId;\n String remotePath = localClasspathProcessor.getLocalClasspath().get(remotePathId);\n String localPath = localPathTranslation.get(remotePath);\n File localFile = new File(localPath);\n File file = new File(localFile, r.name);\n existingFiles.remove(file);\n }\n }", "public void doRemoveItem() {\n doRemoveItem(this.mSrcPos - getHeaderViewsCount());\n }", "public void removePath(PathItem pathItem) {\r\n pathItems.remove(pathItem);\r\n }", "public boolean deleteFile(String inKey) throws NuxeoException;", "@Override\r\n\tpublic void unsetResource(ResourceType resource) {\n\t\t\r\n\t}", "@Test\n public void testRemove() {\n System.out.println(\"remove\");\n RecordFile instance = new RecordFile();\n \n String first = \"hello\";\n String second = \"hello 2\";\n String third = \"hello 3\";\n \n instance.write(first.getBytes(), 0);\n instance.write(second.getBytes(), 1);\n instance.write(third.getBytes(), 2);\n \n Assert.assertEquals(first, new String(instance.read(0)));\n Assert.assertEquals(second, new String(instance.read(1)));\n Assert.assertEquals(third, new String(instance.read(2)));\n \n instance.write(third.getBytes(), 1);\n \n Assert.assertEquals(first, new String(instance.read(0)));\n Assert.assertEquals(third, new String(instance.read(1)));\n Assert.assertEquals(third, new String(instance.read(2)));\n \n instance.remove(0);\n \n Assert.assertEquals(third, new String(instance.read(0)));\n Assert.assertEquals(third, new String(instance.read(1)));\n }", "private void onDeleteResourceClicked(ResourceDeleteClickedEvent event) throws ROSRSException {\n\t\tif (currentResource != null) {\n\t\t\tboolean isSketch = updateSketch(event);\n\t\t\tcurrentResource.delete();\n\t\t\tif (currentResource != currentFolder) {\n\t\t\t\tcurrentResource = currentFolder;\n\t\t\t} else {\n\t\t\t\tList<Folder> list = folderHierarchyModel.getObject();\n\t\t\t\tlist.remove(currentFolder);\n\t\t\t\tif (list.isEmpty()) {\n\t\t\t\t\tchangeFolder(null, event.getTarget());\n\t\t\t\t} else {\n\t\t\t\t\tchangeFolder(list.get(list.size() - 1), event.getTarget());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isSketch)\n\t\t\t\tsend(getPage(), Broadcast.BREADTH, new SketchEvent(event.getTarget()));\n\t\t}\n\t\tsend(getPage(), Broadcast.BREADTH, new ResourceDeletedEvent(event.getTarget()));\n\t}", "public static synchronized void removeResourceManager(final Path file, final ResourceManager<?, ?> resourceManager) {\n final Set<ResourceManager<?, ?>> resourceManagers = Databases.RESOURCE_MANAGERS.get(file);\n\n LOGGER.debug(\"Removed resource manager (get): \" + resourceManagers);\n\n if (resourceManagers == null) {\n return;\n }\n\n resourceManagers.remove(resourceManager);\n LOGGER.debug(\"Removed resource manager: \" + file);\n LOGGER.debug(\"Resource Managers left: \" + resourceManagers);\n\n if (resourceManagers.isEmpty()) {\n LOGGER.debug(\"Removed resource file to resource manager mapping: \" + file);\n Databases.RESOURCE_MANAGERS.remove(file);\n }\n }", "public void rmItem(Item item) {\n\t\titems.remove(item);\n\t}", "public void excluir(Filme f) {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Iniciar a transação\r\n gerenciador.getTransaction().begin();\r\n\r\n //Para excluir tem que dar o merge primeiro para \r\n //sincronizar o ator do BD com o ator que foi\r\n //selecionado na tela\r\n f = gerenciador.merge(f);\r\n\r\n //Mandar sincronizar as alterações \r\n gerenciador.remove(f);\r\n\r\n //Commit na transação\r\n gerenciador.getTransaction().commit();\r\n\r\n }", "void handleResourceRemoval(String resourceName) {\n boolean lowestInstanceState = resourceRepository.countAllByAvailableIsTrueAndIsRedundantIsFalse() <= 1\n && resourceRepository.countAllByAvailableIsTrueAndIsRedundantIsTrue() <= 1;\n if (!lowestInstanceState) {\n Optional<Resource> resource = resourceRepository.findByName(resourceName);\n if (resource.isPresent()) {\n resource.get().setAvailable(false);\n resource.get().setMarkedForKill(true);\n resourceRepository.save(resource.get());\n }\n }\n }", "public void delete() {\r\n if (this.selectedTag != null) {\r\n for (int i = uploads.size() -1; i >= 0 ; i--) {\r\n if (this.selectedTag.equals(uploads.get(i).getTag())) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n uploads.remove(i);\r\n break;\r\n }\r\n }\r\n }\r\n }", "public void unsetComparesource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(COMPARESOURCE$2, 0);\r\n }\r\n }", "public void remove(Bitstream bitstream) throws IOException {\n try {\n File file = getFile(bitstream);\n if (file != null) {\n if (file.delete()) {\n deleteParents(file);\n }\n } else {\n log.warn(\"Attempt to remove non-existent asset. ID: \" + bitstream.getInternalId());\n }\n } catch (Exception e) {\n log.error(\"remove(\" + bitstream.getInternalId() + \")\", e);\n throw new IOException(e);\n }\n }", "public void resourceTreeDeleted(Resource item)\n {\n event(\"ResourceTreeDeletion\",\n item.getId(),\n -1,\n -1,\n false);\n }", "public OIFitsFile removeOIFitsFile(final OIFitsFile oiFitsFile) {\n final OIFitsFile previous = this.oiFitsCollection.removeOIFitsFile(oiFitsFile);\n\n if (previous != null) {\n // Remove OiDataFile from user collection\n final String filePath = oiFitsFile.getAbsoluteFilePath();\n\n for (final Iterator<OIDataFile> it = getOIDataFileList().iterator(); it.hasNext();) {\n final OIDataFile dataFile = it.next();\n if (filePath.equals(dataFile.getFile())) {\n it.remove();\n }\n }\n\n fireOIFitsCollectionChanged();\n }\n\n return previous;\n }", "public void removeItem(Product p) throws IOException {\n for(Product l: this.cartContents)\n System.out.println(l.getProductName());\n this.cartContents.remove(p);\n this.saveCart();\n }", "@Override\r\n public void remove() {\n ArrayList<String>Lines=new ArrayList<>();\r\n String Path = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n \r\n String RID=id.getText();\r\n String Taskname = name.getText();\r\n String startDate = date_start.getText();\r\n String EndDate = date_finish.getText();\r\n String LocalStatus = status.getText();\r\n String MemberID = MemberId.getText();\r\n \r\n Lines.add(RID);\r\n Lines.add(Taskname);\r\n Lines.add(startDate);\r\n Lines.add(EndDate);\r\n Lines.add(LocalStatus);\r\n Lines.add(MemberID);\r\n \r\n FileFacade facade = new FileFacade();\r\n facade.remove(Path, Lines);\r\n \r\n }", "@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}", "public String removeFile() throws NoIndexFoundException {\r\n\t\tlog.debug(\"Remove FileId = \" + itemObjectId);\r\n\r\n\t\tIrUser user = userService.getUser(userId, false);\r\n\t\tif( !item.getOwner().equals(user) && !user.hasRole(IrRole.ADMIN_ROLE) && \r\n\t\t\t\t!institutionalCollectionPermissionHelper.isInstitutionalCollectionAdmin(user, genericItemId))\r\n\t\t{\r\n\t\t return \"accessDenied\";\r\n\t\t}\r\n\t\tItemObject removeItemObject = item.getItemObject(itemObjectId, itemObjectType);\r\n\t\t\r\n\t\tif (itemObjectType.equalsIgnoreCase(ItemFile.TYPE)) {\r\n\t\t\tSet<Long> irFileId = new HashSet<Long>();\r\n\t\t\tItemFile itemFile = (ItemFile) removeItemObject;\r\n\t\t\tirFileId.add(itemFile.getIrFile().getId());\r\n\t\t\t\r\n\t\t\titem.removeItemFile(itemFile);\r\n\t\t\t\r\n\t\t\titemService.makePersistent(item);\r\n\t\t\t\r\n\t\t\t// Delete irFile if not used by PersonalFile, ItemFile or ResearcherFile\r\n\t\t\titemService.deleteUnUsedIrFiles(irFileId);\r\n\t\t} else {\r\n\t\t\tItemLink itemLink = (ItemLink) removeItemObject;\r\n\t\t\t\r\n\t\t\titem.removeLink(itemLink);\r\n\t\t\t\r\n\t\t\titemService.makePersistent(item);\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t// Update personal item index\r\n\t\tPersonalItem personalItem = userPublishingFileSystemService.getPersonalItem(item);\r\n\r\n\t\t// Check if personal item exist for this generic item - if not it means that user is editing the institutional item\r\n\t\t// in which case we don't have to update personal item index\r\n\t\tif (personalItem != null) {\r\n\t\t\tuserWorkspaceIndexProcessingRecordService.save(personalItem.getOwner().getId(), personalItem, \r\n\t \t\t\tindexProcessingTypeService.get(IndexProcessingTypeService.UPDATE));\r\n\t\t}\r\n\t\t\r\n\t\tinstitutionalItemService.markAllInstitutionalItemsForIndexing(genericItemId, indexProcessingTypeService.get(IndexProcessingTypeService.UPDATE));\r\n\t\tinstitutionalItemVersionService.setAllVersionsAsUpdated(user, genericItemId, \"one or more files changed\");\r\n\r\n\t\treturn getFiles();\r\n\t}", "public void removeUniqueFileIdentifier( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), UNIQUEFILEIDENTIFIER, value);\r\n\t}", "public InterceptorType<T> removeAllResourceRef()\n {\n childNode.remove(\"resource-ref\");\n return this;\n }", "public synchronized void removeFile(@Nonnull final VirtualFile file) {\n final HistoryEntry entry = getEntry(file);\n if (entry != null) {\n removeEntry(entry);\n }\n }", "@Test\r\n\tpublic void deleteResourceTest() {\n\t\tLibraryNode ln = ml.createNewLibrary(\"http://example.com/resource\", \"RT\", pc.getDefaultProject());\r\n\t\tBusinessObjectNode bo = ml.addBusinessObjectToLibrary(ln, \"MyBo\");\r\n\t\tResourceNode rn = ml.addResource(bo);\r\n\t\tcheck(rn);\r\n\r\n\t\t// Given\r\n\t\tCollection<TypeUser> l1 = bo.getWhereAssigned();\r\n\t\tCollection<TypeUser> l2 = bo.getWhereUsedAndDescendants();\r\n\t\tassertTrue(\"Resource must be in subject's where assigned list.\", bo.getWhereAssigned().contains(rn));\r\n\t\tassertTrue(\"Resource must have a subject.\", rn.getSubject() == bo);\r\n\t\tassertTrue(\"Resource must be in subject's where-used list.\", bo.getWhereUsedAndDescendants().contains(rn));\r\n\r\n\t\t// When - the resource is deleted\r\n\t\trn.delete();\r\n\r\n\t\t// Then\r\n\t\tassertTrue(\"Resource must be deleted.\", rn.isDeleted());\r\n\t\tassertTrue(\"Resource must NOT be in subject's where-used list.\", !bo.getWhereUsedAndDescendants().contains(rn));\r\n\t}", "@Override\n public <L> void resourcesRemoved(InventoryEvent<L> event) {\n List<Resource<L>> removedResources = event.getPayload();\n for (Resource<L> removedResource : removedResources) {\n if (removedResource.getParent() == null) {\n try {\n log.debugf(\"Removing root resource: %s\", removedResource);\n\n MonitoredEndpoint<EndpointConfiguration> endpoint = event.getSamplingService()\n .getMonitoredEndpoint();\n String endpointTenantId = endpoint.getEndpointConfiguration().getTenantId();\n String tenantIdToUse = (endpointTenantId != null) ? endpointTenantId : config.getTenantId();\n\n // The final URL should be in the form: entity/<resource_canonical_path>\n // for example: entity/t;hawkular/f;myfeed/r;resource_id\n\n CanonicalPath resourceCanonicalPath = CanonicalPath.of()\n .tenant(tenantIdToUse)\n .feed(feedId)\n .resource(removedResource.getID().getIDString())\n .get();\n\n StringBuilder deleteUrl = Util.getContextUrlString(config.getUrl(), config.getInventoryContext());\n deleteUrl.append(\"entity\")\n .append(resourceCanonicalPath.toString());\n\n Request request = httpClientBuilder.buildJsonDeleteRequest(deleteUrl.toString(),\n getTenantHeader(tenantIdToUse));\n\n long start = System.currentTimeMillis(); // we don't store this time in our diagnostics\n Response response = httpClientBuilder.getHttpClient().newCall(request).execute();\n\n try {\n final long duration = System.currentTimeMillis() - start;\n\n if (response.code() != 204 && response.code() != 404) {\n // 204 means successfully deleted, 404 means it didn't exist in the first place.\n // In either case, the resource no longer exists which is what we want;\n // any other response code means it is an error and we didn't remove the resource.\n throw new Exception(\"status-code=[\" + response.code() + \"], reason=[\"\n + response.message() + \"], url=[\" + request.urlString() + \"]\");\n }\n\n log.debugf(\"Took [%d]ms to remove root resource [%s]\", duration, removedResource);\n } finally {\n response.body().close();\n }\n } catch (InterruptedException ie) {\n log.errorFailedToStoreInventoryData(ie);\n Thread.currentThread().interrupt(); // preserve interrupt\n } catch (Exception e) {\n log.errorFailedToStoreInventoryData(e);\n diagnostics.getStorageErrorRate().mark(1);\n }\n\n }\n }\n return;\n }", "public void remove() {\n\n }", "@Override\n\t\tpublic void unregisterResource(FlexoResource<?> resource, InJarResourceImpl serializationArtefact) {\n\t\t\tunregisterResource(resource);\n\t\t}", "abstract public void remove( String path )\r\n throws Exception;", "public void remove(String key) throws IOException;", "public static void doRemove(String fileName) {\n Stage fromSave = Utils.readObject(STAGED_FILES,\n Stage.class);\n HashSet<String> stagedFiles = fromSave.getStagedFiles();\n Commit currHead = Utils.readObject(TREE_DIR, Tree.class).\n getCurrHead();\n if (stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (stagedFiles.contains(fileName) && !currHead.getBlobs().\n containsKey(fileName)) {\n File stagedFile = Utils.join(STAGE_DIR, fileName);\n stagedFile.delete();\n\n stagedFiles.remove(fileName);\n Stage.save(fromSave);\n } else if (!stagedFiles.contains(fileName) && currHead.getBlobs().\n containsKey(fileName)) {\n if (!Utils.filesSet(WORKING_DIR).contains(fileName)) {\n File removedFile = Utils.join(STAGE_RM_DIR, fileName);\n try {\n removedFile.createNewFile();\n } catch (IOException ignored) {\n return;\n }\n String contents = currHead.getBlobs().get(fileName).\n getContents();\n Utils.writeContents(removedFile, contents);\n } else {\n addToStageRemoval(fileName);\n removeFromWorking(fileName);\n }\n } else {\n System.out.println(\"No reason to remove the file.\");\n System.exit(0);\n }\n }", "@Override\r\n public void onNeutral(String callerTag) {\r\n ComponentsGetter cg = (ComponentsGetter)getSherlockActivity();\r\n cg.getFileOperationsHelper()\r\n .removeFile(mTargetFile, true);\r\n \r\n FileDataStorageManager storageManager = cg.getStorageManager();\r\n \r\n boolean containsKeepInSync = false;\r\n if (mTargetFile.isFolder()) {\r\n Vector<OCFile> files = storageManager.getFolderContent(mTargetFile);\r\n for(OCFile file: files) {\r\n containsKeepInSync = file.keepInSync() || containsKeepInSync;\r\n\r\n if (containsKeepInSync)\r\n break;\r\n }\r\n }\r\n\r\n // Remove etag for parent, if file is a keep_in_sync \r\n // or is a folder and contains keep_in_sync \r\n if (mTargetFile.keepInSync() || containsKeepInSync) {\r\n OCFile folder = null;\r\n if (mTargetFile.isFolder()) {\r\n folder = mTargetFile;\r\n } else {\r\n folder = storageManager.getFileById(mTargetFile.getParentId());\r\n }\r\n \r\n folder.setEtag(\"\");\r\n storageManager.saveFile(folder);\r\n }\r\n }", "public void deleteFile(File f);", "@Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n Assert.assertFalse(start.equals(file));\n // Delete the file.\n Files.delete(file);\n logger.output(\"Deleted file \" + file);\n return FileVisitResult.CONTINUE;\n }", "public void removeItem() {\r\n\t\tlog.info(\"Remove item\");\r\n\t\tsu.waitElementClickableAndClick(LocatorType.Xpath, CartSplitViewField.Remove.getName());\r\n\t}", "@Override\n public void removeFromFileMap(String uuid) {\n if (this.fileMap.containsKey(uuid)) {\n this.fileMap.remove(uuid);\n }\n }", "public void delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }", "private boolean removeResource(ContactJabberImpl contact, FullJid fullJid)\n {\n Map<FullJid, ContactResourceJabberImpl> resources =\n contact.getResourcesMap();\n\n if (resources.containsKey(fullJid))\n {\n ContactResource removedResource = resources.remove(fullJid);\n\n contact.fireContactResourceEvent(\n new ContactResourceEvent(contact, removedResource,\n ContactResourceEvent.RESOURCE_REMOVED));\n return true;\n }\n\n return false;\n }", "public static void removeOriginalFilename( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, ORIGINALFILENAME, value);\r\n\t}", "public final GetHTTP removeFilename() {\n properties.remove(FILENAME_PROPERTY);\n return this;\n }", "public void removeImage() {\n setFileImage(null);\n getSelected().setUrlImage(null);\n RequestContext.getCurrentInstance().update(\"image\");\n }", "boolean removAble(InputItem item);", "@Override\n public void remove() {\n }", "public final ListS3 removeCredentialsFile() {\n properties.remove(CREDENTIALS_FILE_PROPERTY);\n return this;\n }", "public static void removeRitualTargetItem(Item ritualItem) {\n/* 118 */ if (ritualTargetItems.contains(ritualItem)) {\n/* 119 */ ritualTargetItems.remove(ritualItem);\n/* */ }\n/* */ }", "@Test\n\tpublic void deletingAReferencedResourceRemovesReference() {\n\t\tfinal PhysicalElement pe = resMan.createResource(newResourceName(), PhysicalElement.class);\n\t\tfinal PhysicalElement pe2 = resMan.createResource(newResourceName(), PhysicalElement.class);\n\n\t\tpe2.location().create();\n\t\tpe.location().setAsReference(pe2.location());\n\n\t\tassertExists(pe2.location());\n\t\tassertFalse(pe2.location().isReference(false));\n\t\tassertExists(pe.location());\n\t\tassertTrue(pe.location().isReference(false));\n\n\t\tpe2.location().delete();\n\t\tassertDeleted(pe2.location());\n\t\tassertDeleted(pe.location());\n\t\tassertFalse(pe.location().isReference(false));\n\t}" ]
[ "0.6488948", "0.6399518", "0.6178032", "0.6173817", "0.6163518", "0.6106382", "0.60311955", "0.60269356", "0.60135615", "0.59968567", "0.5964891", "0.5946549", "0.5932535", "0.5929129", "0.5927367", "0.59214526", "0.590933", "0.5896907", "0.5882115", "0.58627933", "0.5862406", "0.5823357", "0.5805446", "0.5787569", "0.5782115", "0.57674676", "0.57390517", "0.5697309", "0.56953186", "0.56767106", "0.56755644", "0.56717485", "0.56643105", "0.5661181", "0.5654579", "0.565335", "0.56334436", "0.56186897", "0.5588598", "0.55844295", "0.5571062", "0.55629885", "0.55581594", "0.5549251", "0.55482394", "0.5545688", "0.55414575", "0.5539328", "0.5531471", "0.5523264", "0.55227494", "0.5514013", "0.55040514", "0.5498836", "0.5492293", "0.5487265", "0.5466894", "0.5465751", "0.54652077", "0.5460493", "0.5460073", "0.5455736", "0.5449478", "0.54200053", "0.54094917", "0.5408214", "0.54043424", "0.5400903", "0.53950924", "0.53848803", "0.5355288", "0.5352393", "0.53505653", "0.5343008", "0.5337935", "0.53329706", "0.5332198", "0.5330096", "0.53283525", "0.531746", "0.53170806", "0.5309092", "0.53086734", "0.5303506", "0.5295618", "0.52951956", "0.5276072", "0.5272954", "0.5271765", "0.5269539", "0.5265643", "0.5263726", "0.5251704", "0.52505696", "0.5247493", "0.52447426", "0.52425027", "0.52373403", "0.5236978", "0.5235598" ]
0.5514942
51
Returns the name of the resources.
private String getResourceName(ResourceType type) { // get the name from the filename. String name = getFile().getName(); int pos = name.indexOf('.'); if (pos != -1) { name = name.substring(0, pos); } return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getResourceNames(int index) {\n return resourceNames_.get(index);\n }", "public java.lang.String getResourceNames(int index) {\n return resourceNames_.get(index);\n }", "public String getResourceName() {\n return getBaseName() + getNameSuffix();\n }", "String getResourceName();", "public String getResourceName();", "public List<String> getDistinctResourceIdName(){\n\t\treturn jtemp.queryForList(\"SELECT DISTINCT resource_id||' '||resource_type_id||' '||resource_name FROM resources\", String.class);\n\t}", "public List<String> getDistinctResourceName(){\n\t\treturn jtemp.queryForList(\"SELECT DISTINCT resource_type_id||resource_name FROM resources\", String.class);\n\t}", "public com.google.protobuf.ByteString\n getResourceNamesBytes(int index) {\n return resourceNames_.getByteString(index);\n }", "public com.google.protobuf.ProtocolStringList\n getResourceNamesList() {\n return resourceNames_;\n }", "String getResourceBundleName() {\n return getPackageName() + \".\" + getShortName();\n }", "public com.google.protobuf.ByteString\n getResourceNamesBytes(int index) {\n return resourceNames_.getByteString(index);\n }", "public int getResourceNamesCount() {\n return resourceNames_.size();\n }", "public int getResourceNamesCount() {\n return resourceNames_.size();\n }", "public String getName(){\n StringBuilder name = new StringBuilder();\n for (int value : names) {\n name.append(\"> \").append(strings.get(value));\n }\n return name.toString();\n }", "public java.lang.String getResources(int index) {\n return resources_.get(index);\n }", "public java.lang.String getResources(int index) {\n return resources_.get(index);\n }", "public String getResourceName() {\n\treturn this.resrcName;\n }", "public String getName(Class<? extends Resource> resourceType, OgemaLocale locale, boolean useDefaultLanguage);", "public com.google.protobuf.ProtocolStringList\n getResourceNamesList() {\n return resourceNames_.getUnmodifiableView();\n }", "public List<String> ResourceTypeName(int resourceTypeId) {\n\t\treturn jtemp.queryForList(\"SELECT resource_type_name FROM resource_type WHERE resource_type_id=?\", String.class, resourceTypeId );\n\t}", "public String getName(String name) {\n return myResources.getString(name);\n }", "@Nonnull String getName();", "public List<String> getResources() {\n return resources;\n }", "public String getResourceName() {\n return this.resourceName;\n }", "public java.lang.String getName();", "List<Resource> resources();", "public String getResourceName() {\n return resourceName;\n }", "public String getResourceName() {\n return resourceName;\n }", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "public String resource_name () throws BaseException {\n throw new BaseException(\"Not implemented\");\n }", "@Nonnull\n String getName();", "@ApiModelProperty(value = \"The name of the resource or array element.\")\n @JsonProperty(\"Name\")\n public String getName() {\n return name;\n }", "public String getName(Resource resource, OgemaLocale locale, boolean useRelativePathAsAlias, boolean useDefaultLanguage);", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();", "public String getName();" ]
[ "0.71488327", "0.7132112", "0.70938915", "0.68926984", "0.677383", "0.67407274", "0.66861415", "0.6678346", "0.66675645", "0.6629816", "0.6620299", "0.65669304", "0.6547359", "0.6514297", "0.63799566", "0.63751334", "0.63432765", "0.62964416", "0.62956554", "0.6206383", "0.6185415", "0.6170221", "0.61688066", "0.61465037", "0.6130279", "0.61131144", "0.60920113", "0.6089785", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6086993", "0.6079899", "0.60756904", "0.60588884", "0.60341316", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016", "0.59909016" ]
0.0
-1
Validates the associated resource file to make sure the attribute references are valid
private boolean validateAttributes(ScanningContext context) { // We only need to check if it's a non-framework file (and an XML file; skip .png's) if (!isFramework() && SdkUtils.endsWith(getFile().getName(), DOT_XML)) { ValidatingResourceParser parser = new ValidatingResourceParser(context, false); try { IAbstractFile file = getFile(); return parser.parse(file.getOsLocation(), file.getContents()); } catch (Exception e) { context.needsFullAapt(); } return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateITResource() {\n // TODO Auto-generated method stub\n \n }", "public void validate() throws org.apache.thrift.TException {\n if (File != null) {\n File.validate();\n }\n }", "public boolean readAttributeFile(File file);", "public void validate() {\n if (valid) return;\n \n layer = getAttValue(\"layer\").getString();\n hasFrame = getAttValue(\"hasframe\").getBoolean();\n\n valid = true;\n }", "public void validateResource(boolean strictValidation) throws SentryConfigurationException;", "private void validate()\n throws TaskException\n {\n if( null == m_destfile )\n {\n final String message =\n REZ.getString( \"manifest.missing-file.error\" );\n throw new TaskException( message );\n }\n if( m_destfile.exists() && !m_destfile.isFile() )\n {\n final String message =\n REZ.getString( \"manifest.bad-file.error\", m_destfile );\n throw new TaskException( message );\n }\n }", "private static boolean verifyXML(String fileName) throws IOException {\n\t\tSchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA);\n\t\tStreamSource xsdFile = new StreamSource(ResourceUtils.getResourceStream(XSD_FILE_PATH));\n\t\tStreamSource xmlFile = new StreamSource(new File(fileName));\n\t\tboolean validXML = false;\n\t\ttry {\n\t\t\tSchema schema = sf.newSchema(xsdFile);\n\t\t\tValidator validator = schema.newValidator();\n\t\t\ttry {\n\t\t\t\tvalidator.validate(xmlFile);\n\t\t\t\tvalidXML = true;\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (!validXML) {\n\t\t\t\tnew IOException(\"File isn't valid against the xsd\");\n\t\t\t}\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\txsdFile.getInputStream().close();\n\t\t\t// When using a file, this may be null\n\t\t\tif (xmlFile.getInputStream() != null)\n\t\t\t\txmlFile.getInputStream().close();\n\t\t}\n\t\treturn validXML;\n\t}", "protected void validateFile() {\r\n\t\tFile f = new File(FileUltil.joinPath(dOutputFolder, dFileName));\r\n\t\tif (f.exists() && !f.isDirectory()) {\r\n\t\t\tdFileName = \"Copy of \" + dFileName;\r\n\t\t\tvalidateFile();\r\n\t\t}\r\n\t}", "private void validateSource(SourcePointer.FileSource src) {\n File f = src.path.toFile();\n if (!f.exists() || !f.canRead()) {\n throw new SolrException(\n ErrorCode.BAD_REQUEST,\n String.format(\n Locale.US, \"File at %s either does not exist or cannot be read.\", src.path));\n }\n }", "private void validateInput () throws IOException, Exception {\n\t\t\n\t\t// Check that the properties file exists\n\t\tFile propFile = new File(propertiesFile);\n\t\tif (!propFile.exists()) { \n\t\t\tthrow new IOException(\"Unable to open properties file \" + propertiesFile);\t\n\t\t}\n\t\t\n\t\t// Check that the list of register files is not empty\n\t\tif (inputFiles == null || inputFiles.isEmpty()) {\n\t\t\tthrow new Exception(\"No files to process\");\n\t\t}\n\t}", "public void validateComponent() throws org.apache.ant.common.util.ExecutionException {\n if (refId == null) {\n throw new org.apache.ant.common.util.ExecutionException(\"\\\"refid\\\" attribute of \" + \"<reference> must be supplied\");\n }\n }", "public void validate() throws ValidationException {\r\n\r\n // unmapped request and image dirs are only used by LC, no validation needed\r\n\r\n // mapped image dir validation\r\n\r\n File useDir = (mapImageDir != null) ? mapImageDir : imageDir;\r\n\r\n // expand file into ascending list of files\r\n LinkedList list = new LinkedList();\r\n while (useDir != null) {\r\n list.addFirst(useDir);\r\n useDir = useDir.getParentFile();\r\n }\r\n\r\n // the first must be the UNC marker; cf. FileMapper.getRoot\r\n if ( ! ((File) list.removeFirst()).getPath().equals(\"\\\\\\\\\") ) throw new ValidationException(Text.get(this,\"e6\"));\r\n\r\n // the second is the UNC share name\r\n if (list.isEmpty()) throw new ValidationException(Text.get(this,\"e7\"));\r\n list.removeFirst();\r\n // no validation here; it can contain at least IP dots, possibly more\r\n\r\n // the rest must satisfy the strict rule\r\n while ( ! list.isEmpty() ) {\r\n File file = (File) list.removeFirst();\r\n if (ruleStrict.matcher(file.getName()).find()) throw new ValidationException(Text.get(this,\"e8\"));\r\n }\r\n\r\n // other validations\r\n\r\n if (ruleAlpha.matcher(prefix).find()) throw new ValidationException(Text.get(this,\"e3\"));\r\n\r\n if (useDigits < NDIGIT_ORDER_MIN) throw new ValidationException(Text.get(this,\"e4\",new Object[] { Convert.fromInt(NDIGIT_ORDER_MIN) }));\r\n\r\n if (prefix.length() + useDigits > NDIGIT_TOTAL_MAX) throw new ValidationException(Text.get(this,\"e5\",new Object[] { Convert.fromInt(NDIGIT_TOTAL_MAX) }));\r\n\r\n MappingUtil.validate(mappings);\r\n }", "private void validateProperties() throws BuildException {\r\n if (this.port == null || this.port.length() == 0) {\r\n throw new BuildException(\"Attribute 'port' must be set.\");\r\n }\r\n if (this.depotPath == null || this.depotPath.length() == 0) {\r\n throw new BuildException(\"Attribute 'repositoryUrl' must be set.\");\r\n }\r\n if (this.userName == null || this.userName.length() == 0) {\r\n throw new BuildException(\"Attribute 'userName' must be set.\");\r\n }\r\n if (this.password == null || this.password.length() == 0) {\r\n throw new BuildException(\"Attribute 'password' must be set.\");\r\n }\r\n if (this.depotPath == null || this.depotPath.length() == 0) {\r\n throw new BuildException(\"Attribute 'repositoryUrl' must be set.\");\r\n }\r\n if (this.p4ExecutablePath == null || this.p4ExecutablePath.length() == 0) {\r\n throw new BuildException(\"Attribute 'p4ExecutablePath' must be set.\");\r\n }\r\n File p4Executable = new File(this.p4ExecutablePath);\r\n if (!p4Executable.exists()) {\r\n throw new BuildException(\"Attribute 'p4ExecutablePath' \" + this.p4ExecutablePath +\r\n \" does not appear to point to an actual file.\");\r\n }\r\n \r\n // If default* is specified, then all should be specified. \r\n if (((this.defaultHackystatAccount != null) || \r\n (this.defaultHackystatPassword != null) ||\r\n (this.defaultHackystatSensorbase != null)) &&\r\n ((this.defaultHackystatAccount == null) || \r\n (this.defaultHackystatPassword == null) ||\r\n (this.defaultHackystatSensorbase == null))) {\r\n throw new BuildException (\"If one of default Hackystat account, password, or sensorbase \" +\r\n \"is specified, then all must be specified.\");\r\n }\r\n \r\n // Check to make sure that defaultHackystatAccount looks like a real email address.\r\n if (!ValidateEmailSyntax.isValid(this.defaultHackystatAccount)) {\r\n throw new BuildException(\"Attribute 'defaultHackystatAccount' \" + this.defaultHackystatAccount\r\n + \" does not appear to be a valid email address.\");\r\n }\r\n \r\n // If fromDate and toDate not set, we extract commit information for the previous day.\r\n if (this.fromDateString == null && this.toDateString == null) {\r\n Day previousDay = Day.getInstance().inc(-1);\r\n this.fromDate = new Date(previousDay.getFirstTickOfTheDay() - 1);\r\n this.toDate = new Date(previousDay.getLastTickOfTheDay());\r\n }\r\n else {\r\n try {\r\n if (this.hasSetToAndFromDates()) {\r\n this.fromDate = new Date(Day.getInstance(this.dateFormat.parse(this.fromDateString))\r\n .getFirstTickOfTheDay() - 1);\r\n this.toDate = new Date(Day.getInstance(this.dateFormat.parse(this.toDateString))\r\n .getLastTickOfTheDay());\r\n }\r\n else {\r\n throw new BuildException(\r\n \"Attributes 'fromDate' and 'toDate' must either be both set or both not set.\");\r\n }\r\n }\r\n catch (ParseException ex) {\r\n throw new BuildException(\"Unable to parse 'fromDate' or 'toDate'.\", ex);\r\n }\r\n\r\n if (this.fromDate.compareTo(this.toDate) > 0) {\r\n throw new BuildException(\"Attribute 'fromDate' must be a date before 'toDate'.\");\r\n }\r\n }\r\n }", "public boolean validateResource (Resource resource, ProgressObserver obs)\n {\n try {\n String cmd5 = resource.computeDigest(getMessageDigest(), obs);\n String emd5 = (String)_digests.get(resource.getPath());\n if (cmd5.equals(emd5)) {\n return true;\n }\n Log.info(\"Resource failed digest check [rsrc=\" + resource +\n \", computed=\" + cmd5 + \", expected=\" + emd5 + \"].\");\n } catch (IOException ioe) {\n Log.info(\"Resource failed digest check [rsrc=\" + resource +\n \", error=\" + ioe + \"].\");\n }\n return false;\n }", "@Override\n public void ensureValid() throws IOException {\n }", "public boolean validate(FileObject subject) {\n\t\t\r\n\t\treturn false;\r\n\t}", "void btnValidateFile(File file);", "private static boolean validate(JAXBContext jaxbCongtext, File file, URL xsdUrl) {\n SchemaFactory schemaFactory = null;\n Schema schema = null;\n Source xmlFile = new StreamSource(file);\n try {\n schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n schema = schemaFactory.newSchema(xsdUrl);\n Validator validator = schema.newValidator();\n DocumentBuilderFactory db = newSecuDocBuilderFactory();\n db.setNamespaceAware(true);\n\n DocumentBuilder builder = db.newDocumentBuilder();\n Document doc = builder.parse(file);\n\n DOMSource source = new DOMSource(doc);\n DOMResult result = new DOMResult();\n\n validator.validate(source, result);\n LOGGER.debug(xmlFile.getSystemId() + \" is valid\");\n } catch(Exception ex) {\n LOGGER.error(xmlFile.getSystemId() + \" is NOT valid\", ex);\n return false;\n }\n return true;\n }", "private void checkAttributes() throws JellyTagException\n {\n if (getField() == null)\n {\n throw new MissingAttributeException(\"field\");\n }\n if (getVar() == null)\n {\n if (!(getParent() instanceof ValueSupport))\n {\n throw new JellyTagException(\n \"No target for the resolved value: \"\n + \"Specify the var attribute or place the tag \"\n + \"in the body of a ValueSupport tag.\");\n }\n }\n }", "public boolean isValidResource(String resource)\r\n {\r\n // check for illegal combinations of characters\r\n // this is probably not a complete check, but hopefully it is good enough\r\n if ( (resource == null) ||\r\n (resource.equals(\"\")) ||\r\n (resource.startsWith(TIGHT_BINDING)) ||\r\n (resource.endsWith(TIGHT_BINDING)) ||\r\n (resource.endsWith(LOOSE_BINDING)) ||\r\n containsSubString(resource, TIGHT_BINDING+TIGHT_BINDING) ||\r\n containsSubString(resource, SINGLE_MATCH+SINGLE_MATCH) ||\r\n containsSubString(resource, \" \") ||\r\n containsSubString(resource, \"\\t\") ||\r\n containsSubString(resource, \"\\n\") )\r\n {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "private boolean isValid() throws BadInputException {\n try {\n if( ! br.ready() ) \t\t\t\t\t\t//Is the reader ready?\n throw new BadInputException();\t\t//Must be a problem with the file, throw exception\n }\n catch(java.io.IOException e) {\n System.out.println(\"Error validating readability of file: \" + e.toString() );\n }\n\n return true;\n }", "private void validate(Path path) {\n }", "private void validate() {\r\n if (cmtFileSetList.size() == 0) {\r\n throw new BuildException(\"Nested Element 'fileset' missing for task 'cmt'.\");\r\n }\r\n if (output == null) {\r\n throw new BuildException(\"Parameter 'output' missing for task 'cmt'.\");\r\n }\r\n }", "private void preprocessAttributes()\n {\n Project project = getProject();\n // project can be null only on tests\n File projectDir = project != null ? project.getBaseDir() : new File(\".\");\n\n if(hostName == null) {\n Utils.badArgument(this, \"Host name is missing. Please set <host> attribute.\");\n }\n\n if(sourceDir == null) {\n Utils.badArgument(this, \"Source directory is mandatory. Please set <source> attribute.\");\n }\n if(!sourceDir.isAbsolute()) {\n sourceDir = new File(projectDir, sourceDir.getPath());\n }\n if(!sourceDir.exists()) {\n Utils.badArgument(this, \"Source directory does not exist. Please fix <source> attribute.\");\n }\n if(!sourceDir.isDirectory()) {\n Utils.badArgument(this, \"Source directory is in fact a file. Please fix <source> attribute.\");\n }\n\n if(targetDir == null) {\n targetDir = hostName;\n }\n }", "@Test\n\tpublic void testValidateResourceWithResourceElements() {\n\t\tTestPatientFor327 patient = new TestPatientFor327();\n\t\tpatient.setBirthDate(new Date());\n\t\tpatient.setId(\"123\");\n\t\tpatient.getText().setDivAsString(\"<div>FOO</div>\");\n\t\tpatient.getText().setStatus(Narrative.NarrativeStatus.GENERATED);\n\t\tpatient.getLanguageElement().setValue(\"en\");\n\t\tpatient.addExtension().setUrl(\"http://foo\").setValue(new StringType(\"MOD\"));\n\t\tpatient.getMeta().setLastUpdated(new Date());\n\n\t\tList<Reference> conditions = new ArrayList<Reference>();\n\t\tCondition condition = new Condition();\n\t\tcondition.getSubject().setReference(\"Patient/123\");\n\t\tcondition.addBodySite().setText(\"BODY SITE\");\n\t\tcondition.getCode().setText(\"CODE\");\n\t\tcondition.setClinicalStatus(Condition.ConditionClinicalStatus.ACTIVE);\n\t\tcondition.setVerificationStatus(Condition.ConditionVerificationStatus.CONFIRMED);\n\t\tconditions.add(new Reference(condition));\n\t\tpatient.setCondition(conditions);\n\t\tpatient.addIdentifier().setSystem(\"http://foo\").setValue(\"123\");\n\n\t\tString encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient);\n\t\tourLog.info(encoded);\n\n\t\tFhirValidator val = ourCtx.newValidator();\n\t\tval.registerValidatorModule(new SchemaBaseValidator(ourCtx));\n\t\tif (ValidationConstants.SCHEMATRON_ENABLED) {\n\t\t\tval.registerValidatorModule(new SchematronBaseValidator(ourCtx));\n\t\t}\n\t\tval.registerValidatorModule(new FhirInstanceValidator());\n\n\t\tValidationResult result = val.validateWithResult(encoded);\n\n\t\tOperationOutcome operationOutcome = (OperationOutcome) result.toOperationOutcome();\n\t\tString ooencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(operationOutcome);\n\t\tourLog.info(ooencoded);\n\n\t\tassertTrue(result.isSuccessful());\n\n\t\tassertThat(ooencoded, containsString(\"Unknown extension http://foo\"));\n\t}", "private void tooManyDefinitions() {\n throw new BuildException(\n \"Only one of the attributes name, file and resource can be set\",\n getLocation());\n }", "private static void validate(String fileName, String xSchema) throws Exception {\n \t\ttry {\n\t // parse an XML document into a DOM tree\n\t DocumentBuilder parser =\n\t DocumentBuilderFactory.newInstance().newDocumentBuilder();\n\t Document document = parser.parse(new File(fileName));\n\t\n\t // create a SchemaFactory capable of understanding WXS schemas\n\t SchemaFactory factory =\n\t SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n\t\n\t // load a WXS schema, represented by a Schema instance\n\t Source schemaFile = new StreamSource(new File(xSchema));\n\t Schema schema = factory.newSchema(schemaFile);\n\t\n\t // create a Validator object, which can be used to validate\n\t // an instance document\n\t Validator validator = schema.newValidator();\n\t\n\t // validate the DOM tree\n\t\n\t validator.validate(new DOMSource(document));\n \t\t} catch(Exception e) {\n \t\t\tXMLValidate.file = fileName.substring(fileName.lastIndexOf(\"/\") + 1).replaceAll(\".xml\", \"\");\n \t\t\tthrow e;\n \t\t}\n \n }", "public static boolean validateRelationModel(JAXBContext jaxbCongtext, File file) {\n if(null == jaxbCongtext || null == file) {\n LOGGER.error(\"jaxbCongtext or file cannt be null\");\n return false;\n }\n\n return validate(jaxbCongtext, file,\n SchemaUtil.class.getClassLoader().getResource(\"META-INF/models/relationmodel-1.0.xsd\"));\n }", "public void checkSchema(ResourceSchema schema) throws IOException\n {\n }", "private File validateFile(String filename)\n {\n if (filename == null)\n {\n throw new IllegalArgumentException(\"Filename is null\");\n }\n File f = new File(filename);\n //if (!f.exists()) sometimes this throws false even if the program does exist.\n //{\n // throw new IllegalArgumentException(\"Path \"+filename+\" does not refer to a file\");\n //}\n return f;\n }", "public static void testValidity(File xmlFile, StreamSource schemaFileSource) throws SAXException, IOException{\n\n SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n\n\t\tSchema schema = factory.newSchema(schemaFileSource);\n\n Validator validator = schema.newValidator();\n\n Source xmlFileSource = new StreamSource(xmlFile);\n\n validator.validate(xmlFileSource);\n\n\t \n\t}", "@Override public boolean checkResourceFieldsCorrect(final String param,\n final String[] params) {\n return checkResourceFieldsCorrect(param, params, false);\n }", "@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}", "public void validateAttributes() {\n if ((totalNumBuckets <= 0)) {\n throw new IllegalStateException(\n String.format(\n \"TotalNumBuckets %s is an illegal value, please choose a value greater than 0\",\n totalNumBuckets));\n }\n if ((redundancy < 0) || (redundancy >= 4)) {\n throw new IllegalStateException(\n String.format(\n \"RedundantCopies %s is an illegal value, please choose a value between 0 and 3\",\n redundancy));\n }\n for (final Object value : getLocalProperties().keySet()) {\n String propName = (String) value;\n if (!PartitionAttributesFactory.LOCAL_MAX_MEMORY_PROPERTY.equals(propName)) {\n throw new IllegalStateException(\n String.format(\"Unknown local property: '%s'\",\n propName));\n }\n }\n for (final Object o : getGlobalProperties().keySet()) {\n String propName = (String) o;\n if (!PartitionAttributesFactory.GLOBAL_MAX_BUCKETS_PROPERTY.equals(propName)\n && !PartitionAttributesFactory.GLOBAL_MAX_MEMORY_PROPERTY.equals(propName)) {\n throw new IllegalStateException(\n String.format(\"Unknown global property: '%s'\",\n propName));\n }\n }\n if (recoveryDelay < -1) {\n throw new IllegalStateException(\"RecoveryDelay \" + recoveryDelay\n + \" is an illegal value, please choose a value that is greater than or equal to -1\");\n }\n if (startupRecoveryDelay < -1) {\n throw new IllegalStateException(\"StartupRecoveryDelay \" + startupRecoveryDelay\n + \" is an illegal value, please choose a value that is greater than or equal to -1\");\n }\n if (fixedPAttrs != null) {\n List<FixedPartitionAttributesImpl> duplicateFPAattrsList =\n new ArrayList<>();\n Set<FixedPartitionAttributes> fpAttrsSet = new HashSet<>();\n for (FixedPartitionAttributesImpl fpa : fixedPAttrs) {\n if (fpa == null || fpa.getPartitionName() == null) {\n throw new IllegalStateException(\n \"Fixed partition name cannot be null\");\n }\n if (fpAttrsSet.contains(fpa)) {\n duplicateFPAattrsList.add(fpa);\n } else {\n fpAttrsSet.add(fpa);\n }\n }\n if (duplicateFPAattrsList.size() != 0) {\n throw new IllegalStateException(\n String.format(\"Partition name %s can be added only once in FixedPartitionAttributes\",\n duplicateFPAattrsList));\n }\n }\n }", "protected void validateAttribute(FactAttribute[] param) {\r\n\r\n }", "public void check() throws XMLBuildException {\r\n\t\tif (this.attribute == null) \r\n\t\t\tthrow new XMLBuildException(\"you must set the attribute\", this);\r\n\t}", "private void initResources(ServletContext servletContext) {\n if (pathnames != null) {\n ActionContext ctx = ActionContext.getContext();\n try {\n \n ValidatorResources resources = this.loadResources(servletContext);\n \n \n String prefix = ctx.getActionInvocation().getProxy().getNamespace();\n \n \n servletContext.setAttribute(ValidatorPlugIn.VALIDATOR_KEY + prefix, resources);\n \n servletContext.setAttribute(ValidatorPlugIn.STOP_ON_ERROR_KEY + '.'\n + prefix,\n (this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));\n } catch (Exception e) {\n throw new StrutsException(\n \"Cannot load a validator resource from '\" + pathnames + \"'\", e);\n }\n }\n }", "@Test\n public void testValidateManifest() {\n KicIngester.validateManifest(new File(SCP_DATA_DIR), \"Manifest\",\n KicIngester.getScpFiles(new File(SCP_DATA_DIR),\n SCP_FILENAME_PATTERN));\n }", "private boolean validateXmlFileWithSchema(String xmlFilePath, String xsdFilePath) { \n \tassert xmlFilePath != null && !xmlFilePath.isEmpty();\n \tassert xsdFilePath != null && !xsdFilePath.isEmpty();\n \tassert _schemaFactory != null;\n \tassert _loggerHelper != null;\n \t\n try {\n Schema schema = _schemaFactory.newSchema(new File(xsdFilePath));\n Validator validator = schema.newValidator();\n validator.validate(new StreamSource(new File(xmlFilePath)));\n } catch (IOException | SAXException e) {\n \t_loggerHelper.logError(e.getMessage());\n return false;\n }\n return true;\n }", "public static boolean validateDataModel(JAXBContext jaxbCongtext, File file) {\n if(null == jaxbCongtext || null == file) {\n LOGGER.error(\"jaxbCongtext or file cannt be null\");\n return false;\n }\n\n return validate(jaxbCongtext, file,\n SchemaUtil.class.getClassLoader().getResource(\"META-INF/models/datamodel-1.0.xsd\"));\n }", "private void validateResourceMap(ObjectFormat format, InputStream sciMetaStream) throws UnsupportedType, InsufficientResources {\n\n logger.debug(task.taskLabel() + \" entering validateResourceMap...\");\n boolean attemptValidation = false;\n\n if (format != null && format.getFormatType().equalsIgnoreCase(\"RESOURCE\")) {\n for (int i = 0; i < VALIDATING_RESOURCE_FORMATS.length; i++) {\n if (format.getFormatId().getValue().contentEquals(VALIDATING_RESOURCE_FORMATS[i])) {\n attemptValidation = true;\n }\n }\n }\n\n if (attemptValidation) {\n\n // first clone the inputStream so it can be used later\n byte[] resourceBytes = null;\n try {\n resourceBytes = IOUtils.toByteArray(sciMetaStream);\n } catch (IOException e) {\n throw new InsufficientResources(\"413\",\n \"Could not validate Resource Map: Unable to create ByteArrayInputStream for pid: \"\n + task.getPid() + \" with message: \"\n + e.getMessage());\n } finally {\n IOUtils.closeQuietly(sciMetaStream);\n }\n\n if (resourceBytes == null) {\n throw new UnsupportedType(\"Invalid Resource Map\", \"input byte[] was null\");\n }\n\n sciMetaStream = new ByteArrayInputStream(resourceBytes);\n\n InputStream resourceStream = null;\n try {\n resourceStream = new ByteArrayInputStream(resourceBytes);\n ResourceMapFactory.getInstance().parseResourceMap(resourceStream);\n } catch (UnsupportedEncodingException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } catch (OREException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } catch (URISyntaxException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } catch (OREParserException e) {\n throw new UnsupportedType(\"Invalid Resource Map\",\n \"Unable to parse document as a resource map: \" + e.getMessage());\n } finally {\n IOUtils.closeQuietly(resourceStream);\n }\n }\n }", "@Override\n\tpublic void validate()\n\t{\n\n\t}", "@Override\n\tpublic boolean validate() throws ValidateException {\n\n\t\tif(experimentID == null) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Specify an experiment name.\");\n\t\t}\n\t\tif(fileName == null) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Specify a file name.\");\n\t\t}\n\t\tif(type == null) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Specify a type.\");\n\t\t}\n\t\t//\t\tif(uploader == null) {\n\t\t//\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Specify an uploader name.\");\n\t\t//\t\t}\n\t\tif(grVersion == null) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Specify a genome release.\");\n\t\t}\n\t\t//\t\tif(author == null) {\n\t\t//\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Specify author.\");\n\t\t//\t\t}\n\t\tif(experimentID.length() > MaxSize.EXPID || experimentID.length() < 1) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Experiment name: \" + experimentID + \" has to be between 1 and \"\n\t\t\t\t\t+ database.constants.MaxSize.EXPID + \" characters long.\");\n\t\t}\n\t\tif(fileName.length() > MaxSize.FILE_FILENAME || fileName.length() < 1) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"File name: \" + fileName + \" has to be between 1 and \"\n\t\t\t\t\t+ database.constants.MaxSize.FILE_FILENAME + \" characters long.\");\n\t\t}\n\t\tif(type.length() > MaxSize.FILE_FILETYPE || type.length() < 1) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"File type: \" + type + \" has to be between 1 and \"\n\t\t\t\t\t+ database.constants.MaxSize.FILE_FILETYPE + \" characters long.\");\n\t\t}\n\t\tif(uploader != null){\n\t\t\tif(uploader.length() > MaxSize.FILE_UPLOADER || uploader.length() < 1) {\n\t\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Uploader name: \" + uploader + \" has to be between 1 and \"\n\t\t\t\t\t\t+ database.constants.MaxSize.FILE_UPLOADER + \" characters long.\");\n\t\t\t}\n\t\t\tif(!hasOnlyValidCharacters(uploader)) {\n\t\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Invalid characters in uploader name. Valid characters are: \" + validCharacters);\n\t\t\t}\n\t\t}\n\t\tif(grVersion.length() > MaxSize.FILE_GRVERSION || grVersion.length() < 1) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Genome version: \" + grVersion + \" has to be between 1 and \"\n\t\t\t\t\t+ database.constants.MaxSize.FILE_GRVERSION + \" characters long.\");\n\t\t}\n\t\tif(metaData != null){\n\t\t\tif(metaData.length() > MaxSize.FILE_METADATA || metaData.length() < 1) {\n\t\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Metadata has to be between 1 and \"\n\t\t\t\t\t\t+ database.constants.MaxSize.FILE_GRVERSION + \" characters long.\");\n\t\t\t}\n\t\t\tif(metaData.contains(\"/\")) {\n\t\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Metadata can not contain slash.\");\n\t\t\t}\n\t\t}\n\t\tif(author != null){\n\t\t\tif(author.length() > MaxSize.FILE_AUTHOR || author.length() < 1) {\n\t\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Author has to be between 1 and \"\n\t\t\t\t\t\t+ database.constants.MaxSize.FILE_AUTHOR + \" characters long.\");\n\t\t\t}\n\t\t\tif(!hasOnlyValidCharacters(author)) {\n\t\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Invalid characters in author name. Valid characters are: \" + validCharacters);\n\t\t\t}\n\t\t}\n\t\tif(!hasOnlyValidCharacters(experimentID)) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Invalid characters in experiment name. Valid characters are: \" + validCharacters);\n\t\t}\n\t\tif(!hasOnlyValidCharacters(type)) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Invalid characters in file type name. Valid characters are: \" + validCharacters);\n\t\t}\n\n\t\tif(!hasOnlyValidCharacters(grVersion)) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"Invalid characters in genome version name. Valid characters are: \" + validCharacters);\n\t\t}\n\n\t\tif(fileName.contains(\"/\")) {\n\t\t\tthrow new ValidateException(StatusCode.BAD_REQUEST, \"File name can not contain slash.\");\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\r\n\tprotected void validate() {\n\t}", "private boolean checkAttributes(ExportPkg ep, ImportPkg ip) {\n /* Mandatory attributes */\n if (!ip.checkMandatory(ep.mandatory)) {\n return false;\n }\n /* Predefined attributes */\n if (!ip.okPackageVersion(ep.version) ||\n (ip.bundleSymbolicName != null &&\n !ip.bundleSymbolicName.equals(ep.bpkgs.bundle.symbolicName)) ||\n !ip.bundleRange.withinRange(ep.bpkgs.bundle.version)) {\n return false;\n }\n /* Other attributes */\n for (Iterator i = ip.attributes.entrySet().iterator(); i.hasNext(); ) {\n Map.Entry e = (Map.Entry)i.next();\n String a = (String)ep.attributes.get(e.getKey());\n if (a == null || !a.equals(e.getValue())) {\n return false;\n }\n }\n return true;\n }", "@Override\r\n public void validate() {\r\n }", "@Override\n\tpublic void validate() {\n\t}", "public void validateRpd4s3()\n {\n // URL guidelines can't be automatically tested, this validator allow to validate content only.\n }", "public void validate() throws org.apache.thrift.TException {\n if (dkFileConf != null) {\n dkFileConf.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (dkFileConf != null) {\n dkFileConf.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (dkFileConf != null) {\n dkFileConf.validate();\n }\n }", "private void validateReflexMapFile(String mapToCheck) throws FileNotFoundException\n {\n //Initialize the map scanner\n reflexValidator = new Scanner(new File(mapToCheck));\n\n if (reflexValidator.next().contains(\"reflex\"))\n {\n reflexValidated = true;\n System.out.println(\"\\nThis is a valid Reflex Arena map file\");\n }\n\n else\n {\n System.out.println(\"\\nThis is not a Reflex Arena map file\");\n }\n }", "public void validate () throws ModelValidationException\n\t\t\t{\n\t\t\t\tkeyClassName = validateKeyClassName(className);\n\t\t\t\t// initilialize keyClass field \n\t\t\t\tkeyClass = getModel().getClass(keyClassName, getClassLoader());\n\t\t\t\tvalidateClass();\n\t\t\t\tvalidateConstructor();\n\t\t\t\tvalidateFields();\n\t\t\t\tvalidateMethods();\n\t\t\t}", "@Test(expected = PipelineException.class)\n public void testValidateManifestWithMungedFiles() {\n KicIngester.validateManifest(new File(SCP_DATA_DIR),\n \"Manifest.munged-files\", KicIngester.getScpFiles(new File(\n SCP_DATA_DIR), SCP_FILENAME_PATTERN));\n }", "@Test\n public void filesValidateTest() throws ApiException {\n String owner = null;\n String repo = null;\n FilesValidate data = null;\n api.filesValidate(owner, repo, data);\n\n // TODO: test validations\n }", "public interface Validatable {\n\n void setStyleRequired(String tooltip);\n\n void setStyleInvalid(String tooltip);\n \n void setStyleValid();\n \n void setStyleNormal();\n \n ResourceMap getResourceMap();\n}", "public void validate() {\n\t\tthis.invalidated = false;\n\t}", "public boolean isValidFile(RandomAccessFile raf) throws IOException {\n // need a fast failure for non-GRADS files\n if (GradsDataDescriptorFile.failFast(raf))\n return false;\n raf.seek(0);\n\n // we think its a GRADS file, but we have lots of restrictions on what we can handle\n try {\n gradsDDF = new GradsDataDescriptorFile(raf.getLocation(), 5000);\n if (gradsDDF.error)\n return false;\n\n GradsDimension x = gradsDDF.getXDimension();\n GradsDimension y = gradsDDF.getYDimension();\n // J-\n\n return gradsDDF.getDataType() == null && // only handle raw binary\n gradsDDF.getDataFile() != null && !gradsDDF.hasProjection() && // can't handle projections\n !gradsDDF.getVariables().isEmpty() && // must have valid entries\n !gradsDDF.getDimensions().isEmpty() && (x.getSize() > 1) && (y.getSize() > 1); // can't handle cross sections\n // J+\n } catch (Exception ioe) {\n return false;\n }\n }", "public void validate() {}", "@Test\n public void testRemainingResourceStringValid() {\n Matcher mtch = filter.getMatcher(FULL_URI);\n\n filter.isResourceAccess(mtch);\n\n assertEquals(\"resource string differs\", REMAINING_RES_STRING, filter.getRootResourceString(mtch));\n }", "private void validateDatasetId() {\n\n Dataset dataset = getGenericService().find(Dataset.class, mappedDatasetId);\n boolean isValid = getResourceCollection().getResourceIds().contains(mappedDatasetId);\n if(!isValid) {\n addActionError(\"Invalid mapped dataset\");\n }\n\n }", "@Then(\"^Validate the fields present in the result page$\") // Move to UserStep Definition\r\n\tpublic void attribute_validation(){\r\n\t\tenduser.attri_field();\r\n\t}", "@Override\r\n public boolean validate() {\n return true;\r\n }", "@Test\n public void shouldNotParseCamundaFormDefinitionAndFormKey() {\n String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), \"shouldNotParseCamundaFormDefinitionAndFormKey\");\n\n // when/then expect parse exception\n assertThatThrownBy(() -> repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy())\n .isInstanceOf(ParseException.class)\n .hasMessageContaining(\"Invalid element definition: only one of the attributes formKey and formRef is allowed.\");\n }", "private boolean validateFile(String path) {\n return !path.equals(AppStrings.NO_FILE_PATH);\n }", "private void validateData() {\n }", "@Override\n\tpublic void validate() {\n\t\tsuper.validate();\n\t}", "public void setResourcefile (File file)\n {\n _resourcefile = file;\n }", "protected void validateElement() throws InvalidTagException {\r\n super.validateElement();\r\n\r\n // Retrieve the anchor tag\r\n Tag tag = getTag();\r\n if (!XmlConstants.NAMESPACE_URI.equals(anchor.getNamespaceURI()))\r\n throw new InvalidTagException(\"Cannot find element: \" + tag + \".\");\r\n }", "protected void validateConfiguration() {}", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "@Override\n\tprotected boolean isFileValid(List<String> lines) {\n\t\treturn lines.size() == SAVE_FILE_LENGTH && lines.get(0).length() > 0 && lines.get(1).length() > 0; // id and first name is required\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}", "public void validate() throws org.apache.thrift.TException {\n if (!isSetResourcePlanName()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'resourcePlanName' is unset! Struct:\" + toString());\n }\n\n if (!isSetPoolPath()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'poolPath' is unset! Struct:\" + toString());\n }\n\n // check for sub-struct validity\n }", "@Override\r\n\tpublic boolean validate() {\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean validate() {\n\t\treturn true;\r\n\t}", "protected void validate() throws ConfigurationException\n {\n\n }", "private void validate() {\n Validate.notNull(uriLocatorFactory);\n Validate.notNull(preProcessorExecutor);\n }", "public void checkAttribute(String arg1) {\n\t\t\n\t}", "public void checkValid() throws StyxException\n {\n if (this.getJSAPParameter() instanceof Option)\n {\n Option op = (Option)this.getJSAPParameter();\n if (this.valueSet)\n {\n if (this.param.getInputFile() != null)\n {\n // This parameter represents an input file. See if this is a URL\n // and if so, download it\n // TODO: if this is not a URL, check that it exists\n String str = this.getParameterValue();\n if (str.startsWith(URL_PREFIX))\n {\n // This could be a URL\n String urlStr = str.substring(URL_PREFIX.length());\n try\n {\n URL url = new URL(urlStr);\n File urlPath = new File(url.getPath());\n // TODO: be cleverer about file names, particularly\n // watching out for name clashes\n String name = urlPath.getName().equals(\"\") ? \"random.dat\" : urlPath.getName();\n this.instance.downloadFrom(url, name);\n // Now set the contents of this file to the new file name\n this.setParameterValue(name);\n }\n catch(MalformedURLException mue)\n {\n throw new StyxException(urlStr + \" is not a valid URL\");\n }\n }\n }\n }\n else\n {\n // A value hasn't been set\n if (op.required())\n {\n throw new StyxException(this.name + \" is a required parameter:\" +\n \" a value must be set\");\n }\n }\n }\n }", "private void validateBagFile(File bagFile) throws IOException {\n\t\tZipFile zf = new ZipFile(bagFile);\n\t\t// Check files calculates the hashes and file sizes and reports on\n\t\t// whether hashes are correct\n\t\t// The file sizes are added to totalDataSize which is compared with the\n\t\t// stats sent in the request\n\t\tcheckFiles(sha1Map, zf);\n\n\t\tlog.info(\"Data Count: \" + dataCount);\n\t\tlog.info(\"Data Size: \" + totalDataSize);\n\t\t// Check stats\n\t\tif (pubRequest.getJSONObject(\"Aggregation Statistics\").getLong(\n\t\t\t\t\"Number of Datasets\") != dataCount) {\n\t\t\tlog.warn(\"Request contains incorrect data count: should be: \"\n\t\t\t\t\t+ dataCount);\n\t\t}\n\t\t// Total size is calced during checkFiles\n\t\tif (pubRequest.getJSONObject(\"Aggregation Statistics\").getLong(\n\t\t\t\t\"Total Size\") != totalDataSize) {\n\t\t\tlog.warn(\"Request contains incorrect Total Size: should be: \"\n\t\t\t\t\t+ totalDataSize);\n\t\t}\n\n\t\tzf.close();\n\t}", "private boolean shouldBuild(IResource resource) {\n \t\treturn resource.getType() == IResource.FILE && resource.getFileExtension().equals(\"gf\");\n \t}", "@Test(expected = PipelineException.class)\n public void testValidateManifestWithMissingFiles() {\n KicIngester.validateManifest(new File(SCP_DATA_DIR),\n \"Manifest.missing-files\", KicIngester.getScpFiles(new File(\n SCP_DATA_DIR), SCP_FILENAME_PATTERN));\n }", "@Override\n protected void update(ScanningContext context) {\n validateAttributes(context);\n }", "private static boolean isValid(File dbFile) {\n Validate.notNull(dbFile);\n if (!dbFile.isFile()) {\n return false;\n }\n if (!isValidFileName(dbFile.getName())) {\n return false;\n }\n return Archiver.hasEntryName(dbFile, LIB_INFO_NAME);\n }", "@Override\n public boolean verify(Verificator verificator) {\n return verificator.verifyResources(this);\n }", "public static void validate(List<AttributeDefinition>\n attributeDefinitions,\n ProductDraft productDraft) {\n List<String> requireAttributeNames = attributeDefinitions.stream()\n .filter(\n attributeDefinition -> attributeDefinition.getIsRequired().equals(true)\n ).map(\n attributeDefinition -> {\n return attributeDefinition.getName();\n })\n .collect(Collectors.toList());\n\n if (requireAttributeNames.isEmpty()) {\n return;\n }\n\n if (productDraft.getMasterVariant() == null) {\n throwExceptionForRequire();\n }\n\n validateRequireAttribute(requireAttributeNames,\n productDraft.getMasterVariant().getAttributes());\n\n if (productDraft.getVariants() != null && !productDraft.getVariants().isEmpty()) {\n productDraft.getVariants().stream().forEach(\n productVariantDraft -> {\n validateRequireAttribute(requireAttributeNames, productVariantDraft\n .getAttributes());\n }\n );\n }\n }", "private void validateRequest( DownloadRequest dreq )\n throws ErrorResponseException\n {\n String path = dreq.getPath();\n if ( path.endsWith( ResourceCatalog.VERSION_XML_FILENAME ) || path.indexOf( \"__\" ) != -1 )\n {\n throw new ErrorResponseException( DownloadResponse.getNoContentResponse() );\n }\n }", "public void check() {\n\t\tif (!hasAnimVal) {\n\t\t\tif (baseVal == null) {\n\t\t\t\tbaseVal = new BaseSVGPointList();\n\t\t\t}\n\t\t\tbaseVal.revalidate();\n\t\t\tif (baseVal.missing) {\n\t\t\t\tthrow new LiveAttributeException(element, localName, LiveAttributeException.ERR_ATTRIBUTE_MISSING,\n\t\t\t\t\t\tnull);\n\t\t\t}\n\t\t\tif (baseVal.malformed) {\n\t\t\t\tthrow new LiveAttributeException(element, localName, LiveAttributeException.ERR_ATTRIBUTE_MALFORMED,\n\t\t\t\t\t\tbaseVal.getValueAsString());\n\t\t\t}\n\t\t}\n\t}", "@Required\n\tpublic void setResource(final String filename) {\n\t\ttry {\n\t\t\tthis.validDocStr = ResourceUtil.getTextResource(\n\t\t\t\t\tthis.applicationContext, filename);\n\t\t} catch (final IOException e) {\n\t\t\tthrow new RuntimeException(\"Loading of text resource failed: \" + e);\n\t\t}\n\t}", "private void validate(Document document) {\n try {\n SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n URL schemaUrl = this.getClass().getResource(\"/edu/mit/blocks/codeblocks/codeblocks.xsd\");\n Schema schema = schemaFactory.newSchema(schemaUrl);\n Validator validator = schema.newValidator();\n validator.validate(new DOMSource(document));\n }\n catch (MalformedURLException e) {\n throw new RuntimeException(e);\n }\n catch (SAXException e) {\n throw new RuntimeException(e);\n }\n catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "protected void validateWikiFile(WikiFile wikiFile) throws WikiException {\r\n\t\tcheckLength(wikiFile.getFileName(), 200);\r\n\t\tcheckLength(wikiFile.getUrl(), 200);\r\n\t\tcheckLength(wikiFile.getMimeType(), 100);\r\n\t}", "private void processRelationshipsFile(String filename) throws Throwable\n {\n URL url = this.getClass().getResource(filename);\n File file = Paths.get(url.toURI()).toFile();\n\n LineNumberReader lr = new LineNumberReader(new FileReader(file));\n String line;\n String trimmed;\n while ((line = lr.readLine()) != null)\n {\n if (line.isEmpty()) { continue; }\n\n trimmed = line.trim();\n\n if (line.startsWith(\"//\")) { continue; }\n\n String[] parts = line.split(\", | \");\n if (parts.length != 6) {\n throw new Exception(\"Invalid line: \" + trimmed);\n }\n createRelationships(parts);\n }\n }", "public static boolean validateResources(IResource[] resources, Shell shell, String title) {\n \t\t\n \t\t// get all readonly files\n \t\tList readOnlyFiles= getReadonlyFiles(resources);\n \t\tif (readOnlyFiles.size() == 0)\n \t\t\treturn true;\n \t\t\n \t\t// get timestamps of readonly files before validateEdit\n \t\tMap oldTimeStamps= createModificationStampMap(readOnlyFiles);\n \t\t\n \t\tIFile[] files= (IFile[]) readOnlyFiles.toArray(new IFile[readOnlyFiles.size()]);\n \t\tIStatus status= ResourcesPlugin.getWorkspace().validateEdit(files, shell);\n \t\tif (! status.isOK()) {\n \t\t\tString message= getString(\"ValidateEdit.error.unable_to_perform\"); //$NON-NLS-1$\n \t\t\tErrorDialog.openError(shell, title, message, status);\n \t\t\treturn false;\n \t\t}\n \t\t\t\n \t\tIStatus modified= null;\n \t\tMap newTimeStamps= createModificationStampMap(readOnlyFiles);\n \t\tfor (Iterator iter= oldTimeStamps.keySet().iterator(); iter.hasNext();) {\n \t\t\tIFile file= (IFile) iter.next();\n \t\t\tif (file.isReadOnly()) {\n \t\t\t\tIStatus entry= new Status(IStatus.ERROR,\n \t\t\t\t\t\t\t\tCompareUIPlugin.getPluginId(),\n \t\t\t\t\t\t\t\tVALIDATE_EDIT_PROBLEM,\n \t\t\t\t\t\t\t\tgetFormattedString(\"ValidateEdit.error.stillReadonly\", file.getFullPath().toString()), //$NON-NLS-1$\n \t\t\t\t\t\t\t\tnull);\n \t\t\t\tmodified= addStatus(modified, entry);\n \t\t\t} else if (! oldTimeStamps.get(file).equals(newTimeStamps.get(file))) {\n \t\t\t\tIStatus entry= new Status(IStatus.ERROR,\n \t\t\t\t\t\t\t\tCompareUIPlugin.getPluginId(),\n \t\t\t\t\t\t\t\tVALIDATE_EDIT_PROBLEM,\n \t\t\t\t\t\t\t\tgetFormattedString(\"ValidateEdit.error.fileModified\", file.getFullPath().toString()), //$NON-NLS-1$\n \t\t\t\t\t\t\t\tnull);\n \t\t\t\tmodified= addStatus(modified, entry);\n \t\t\t}\n \t\t}\n \t\tif (modified != null) {\n \t\t\tString message= getString(\"ValidateEdit.error.unable_to_perform\"); //$NON-NLS-1$\n \t\t\tErrorDialog.openError(shell, title, message, modified);\n \t\t\treturn false;\n \t\t}\n \t\treturn true;\n \t}", "@Override\n public void validateEntity() {\n if ((Strings.isNullOrEmpty(this.getIdentity()) &&\n Strings.isNullOrEmpty(this.getFileSystemPath())) ||\n Strings.isNullOrEmpty(this.getSourceId())) {\n throw new IllegalArgumentException(\n \"Either the Entity Id or file system path used\" +\n \" to generate the id must be present along with the source id\");\n }\n }", "public ValidFile(URI uri) throws IOException\r\n\t{\r\n\t\tsuper(uri);\r\n\t\tinit();\r\n\t}", "public void validateSource() {\n\t\t// Set the mode to recording\n\t\tmode = RECORD;\n\t\t// Traverse the source and record the architectures structure\n\t\tinspect();\n\t\t// Set the mode to validation\n\t\tmode = VALIDATE;\n\t\t// Traverses the\n\t\tinspect();\n\t\t// System.out.println(tree);\n\t\t// Report the source files that are missing\n\t\tArrayList<TagNode> tags = tree.getAllUnvisited();\n\t\treportMissing(tags);\n\t}", "void validateProperties() {\n super.validateProperties();\n validatePropertySet(\"token\", getToken());\n }" ]
[ "0.64758915", "0.5916937", "0.5898589", "0.5890217", "0.585321", "0.58173424", "0.5759666", "0.57587034", "0.57460576", "0.5696913", "0.56428826", "0.56034577", "0.55937487", "0.5578835", "0.55700123", "0.551257", "0.54740494", "0.5457336", "0.54506505", "0.54465604", "0.543902", "0.5420382", "0.5398848", "0.5392277", "0.53858614", "0.53814644", "0.5377871", "0.53525877", "0.5352219", "0.53487366", "0.5343212", "0.5338176", "0.53294396", "0.5318568", "0.53079176", "0.5299298", "0.5279489", "0.5264641", "0.5258758", "0.5252902", "0.5236821", "0.52198344", "0.5213943", "0.520963", "0.520273", "0.52004755", "0.51814896", "0.5165743", "0.51616305", "0.51616305", "0.51616305", "0.5154897", "0.51526386", "0.51507205", "0.5149889", "0.5147702", "0.5146297", "0.5144171", "0.5132048", "0.5124667", "0.51239854", "0.51202255", "0.5109187", "0.5099449", "0.509618", "0.5095079", "0.50948256", "0.5085441", "0.50790167", "0.5073502", "0.5070653", "0.50702494", "0.5068385", "0.5068385", "0.5068385", "0.5066714", "0.5059535", "0.5059535", "0.5057738", "0.5055924", "0.5052266", "0.50414616", "0.50347656", "0.50190794", "0.5012631", "0.50080234", "0.5002267", "0.50011843", "0.49768543", "0.49632642", "0.49614462", "0.49568513", "0.49533835", "0.49529842", "0.49474072", "0.49471855", "0.4940085", "0.49364153", "0.4935577", "0.49328983" ]
0.68359256
0
/ On compte combien de fois on croise un segment
private boolean intersection(Point2D p1,Point2D p2, Point2D p3, Point2D p4 ){ if(p1.equals(p3)||p1.equals(p4)||p2.equals(p3)||p2.equals(p4)){ // Point en commun cas particulier return true; } double pv1=produitVectoriel(p1,p2,p3,p4); if(pv1==0){ // droite parallele return false; } double pv2=produitVectoriel(p1,p2,p1,p4); double pv3=produitVectoriel(p1,p2,p1,p3); double pv4=produitVectoriel(p3,p4,p3,p2); double pv5=produitVectoriel(p3,p4,p3,p1); if(!(pv2*pv3<=0)){ return false; } if(!(pv4*pv5<=0)){ return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\r\n private void JCATsegmentSubcutaneousFat2D() {\r\n \r\n // a buffer to store a slice from the source Image\r\n short[] srcBuffer;\r\n try {\r\n srcBuffer = new short [sliceSize];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"JCATsegmentVisceralFat2D(): Can NOT allocate srcBuffer\");\r\n return;\r\n }\r\n \r\n // get the data from the segmented abdomenImage and the srcImage\r\n try {\r\n abdomenImage.exportData(0, sliceSize, sliceBuffer);\r\n srcImage.exportData(0, sliceSize, srcBuffer);\r\n } catch (IOException ex) {\r\n// System.err.println(\"JCATsegmentVisceralFat2D(): Error exporting data\");\r\n MipavUtil.displayError(\"JCATsegmentVisceralFat2D(): Error exporting data\");\r\n return;\r\n }\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n\r\n // Use the CM, the abdomenImage, and the srcImage to define points on the\r\n // abdomen and visceral VOI's\r\n ArrayList<Integer> xArrAbdom = new ArrayList<Integer>();\r\n ArrayList<Integer> yArrAbdom = new ArrayList<Integer>();\r\n ArrayList<Integer> xArrVis = new ArrayList<Integer>();\r\n ArrayList<Integer> yArrVis = new ArrayList<Integer>();\r\n findVOIs(centerOfMass, xArrAbdom, yArrAbdom, srcBuffer, xArrVis, yArrVis);\r\n \r\n int[] x1 = new int[xArrAbdom.size()];\r\n int[] y1 = new int[xArrAbdom.size()];\r\n int[] z1 = new int[xArrAbdom.size()];\r\n for(int idx = 0; idx < xArrAbdom.size(); idx++) {\r\n x1[idx] = xArrAbdom.get(idx);\r\n y1[idx] = yArrAbdom.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n \r\n\r\n for(int idx = 0; idx < xArrVis.size(); idx++) {\r\n x1[idx] = xArrVis.get(idx);\r\n y1[idx] = yArrVis.get(idx);\r\n }\r\n\r\n subcutaneousVOI = new VOI((short)0, \"Subcutaneous area\");\r\n subcutaneousVOI.importCurve(x1, y1, z1);\r\n \r\n/*\r\n ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n sliceBuffer[ycm * xDim + xcm] = 20;\r\n for (int idx = 0; idx < xArr.size(); idx++) {\r\n sliceBuffer[yArr.get(idx) * xDim + xArr.get(idx)] = 20;\r\n sliceBuffer[yArrVis.get(idx) * xDim + xArrVis.get(idx)] = 30;\r\n }\r\n // save the sliceBuffer into the abdomenImage\r\n try {\r\n abdomenImage.importData(0, sliceBuffer, false);\r\n } catch (IOException ex) {\r\n System.err.println(\"segmentThighTissue(): Error importing data\");\r\n }\r\n*/\r\n// ShowImage(srcImage, \"Segmented Abdomen\");\r\n\r\n\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Abdomen VOI points:\");\r\n// for (int idx = 0; idx < xArr.size(); idx++) {\r\n// ViewUserInterface.getReference().getMessageFrame().append(xArr.get(idx) +\" \" + yArr.get(idx));\r\n// }\r\n\r\n }", "@SuppressWarnings(\"unused\")\r\n private void JCATsegmentVisceralFat2D01() {\r\n \r\n // get the VOI for the external boundary of the abdomen\r\n VOIVector vois = abdomenImage.getVOIs();\r\n if(vois.size() != 1) {\r\n System.err.println(\"segmentVisceralFat2D() Error, did not get 1 VOI\");\r\n return;\r\n }\r\n\r\n // abdomenImage has one VOI, lets get it\r\n VOI theVOI = vois.get(0);\r\n \r\n // find the center-of-mass of the contour\r\n VOIContour maxContour = ((VOIContour)theVOI.getCurves().get(0));\r\n int[] xVals = new int [maxContour.size()];\r\n int[] yVals = new int [maxContour.size()];\r\n int[] zVals = new int [maxContour.size()];\r\n maxContour.exportArrays(xVals, yVals, zVals);\r\n \r\n int xcm = 0, ycm = 0, zcm = 0;\r\n for (int idx = 0; idx < maxContour.size(); idx++) {\r\n xcm += xVals[idx];\r\n ycm += yVals[idx];\r\n zcm += zVals[idx];\r\n }\r\n \r\n xcm /= maxContour.size();\r\n ycm /= maxContour.size();\r\n zcm /= maxContour.size();\r\n \r\n ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm +\" Zcm: \" +zcm+\"\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // This point should be inside the abdomen\r\n // walk right until you find the external border of the abdomen\r\n \r\n // update the volumeBitSet to match the closed abdomenImage\r\n short[] srcSliceBuffer = new short[sliceSize];\r\n short[] profile = new short[xDim];\r\n try {\r\n abdomenImage.exportData(0, sliceSize, sliceBuffer);\r\n srcImage.exportData(0, sliceSize, srcSliceBuffer);\r\n } catch (IOException ex) {\r\n System.err.println(\"Error exporting data\");\r\n return;\r\n }\r\n\r\n int x = xcm;\r\n int elementCount = 0;\r\n int yOffset = ycm * xDim;\r\n while (x < xDim && sliceBuffer[x + yOffset] == abdomenTissueLabel) {\r\n profile[elementCount] = srcSliceBuffer[x + yOffset];\r\n x++;\r\n elementCount++;\r\n } // end while(...)\r\n \r\n // profile has an intensity profile of the pixels along the ray from the \r\n // contour CM to the external skin boundary. \r\n \r\n \r\n }", "@SuppressWarnings(\"unused\")\r\n private void makeSubcutaneousFat2DVOI() {\r\n\r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n \r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n // there should be only one VOI and one curve\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n int[] xVals = new int [curve.size()];\r\n int[] yVals = new int [curve.size()];\r\n int[] zVals = new int [curve.size()];\r\n curve.exportArrays(xVals, yVals, zVals);\r\n \r\n int[] xValsSubcutaneousVOI = new int [curve.size()];\r\n int[] yValsSubcutaneousVOI = new int [curve.size()];\r\n \r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n\r\n try {\r\n srcImage.exportData(0, sliceSize, sliceBuffer);\r\n } catch (IOException ex) {\r\n System.err.println(\"JCATsegmentAbdomen2D(): Error exporting data\");\r\n return;\r\n }\r\n\r\n\r\n // find a subcutaneous fat contour point for each abdominal contour point\r\n // we know the abdominal contour points are located at three degree increments\r\n double angleRad;\r\n int count;\r\n int contourPointIdx = 0;\r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = xcm;\r\n int y = ycm;\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = sliceBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n\r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU && profile[idx] > airThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsSubcutaneousVOI[contourPointIdx] = xLocs[idx];\r\n yValsSubcutaneousVOI[contourPointIdx] = yLocs[idx];\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > yVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = sliceBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU&& profile[idx] > airThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsSubcutaneousVOI[contourPointIdx] = xLocs[idx];\r\n yValsSubcutaneousVOI[contourPointIdx] = yLocs[idx];\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > xVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = sliceBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU&& profile[idx] > airThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsSubcutaneousVOI[contourPointIdx] = xLocs[idx];\r\n yValsSubcutaneousVOI[contourPointIdx] = yLocs[idx];\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = sliceBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU&& profile[idx] > airThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsSubcutaneousVOI[contourPointIdx] = xLocs[idx];\r\n yValsSubcutaneousVOI[contourPointIdx] = yLocs[idx];\r\n\r\n }\r\n \r\n contourPointIdx++;\r\n } // end for (angle = 0; ...\r\n\r\n\r\n // make the VOI's and add the points to them\r\n subcutaneousVOI = new VOI((short)0, \"Subcutaneous area\");\r\n subcutaneousVOI.importCurve(xValsSubcutaneousVOI, yValsSubcutaneousVOI, zVals);\r\n\r\n }", "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "public void checaColision() {\n //Si el proyectil colisiona con la barra entonces..\n if (objBarra.colisiona(objProyectil)) {\n //Guardo el centro x del proyectil para no facilitar su comparacion\n int iCentroProyectil = objProyectil.getX()\n + objProyectil.getAncho() / 2;\n //Si el nivel de Y del lado inferior del proyectil es el mismo que\n //el nivel de Y del lado superior de la barra...\n if (objProyectil.getY() + objProyectil.getAlto()\n >= objBarra.getY()) {\n //Dividimos el ancho de la barra en 2 secciones que otorgan \n //diferente velocidad dependiendo que seccion toque el proyectil\n //Si el centro del proyectil toca la primera parte de la \n //barra o el lado izquierdo del proyectil esta mas a la \n //izquierda que el lado izquierdo de la barra...\n if ((iCentroProyectil > objBarra.getX() && iCentroProyectil\n < objBarra.getX() + objBarra.getAncho() / 2)\n || (objProyectil.getX() < objBarra.getX())) {\n bDireccionX = false; // arriba\n bDireccionY = false; // izquierda\n } //Si el centro del proyectil toca la ultima parte de la barra o\n //el lado derecho del proyectil esta mas a la derecha que el \n //lado derecho de la barra\n else if ((iCentroProyectil > objBarra.getX()\n + (objBarra.getAncho() / 2) && iCentroProyectil\n < objBarra.getX() + (objBarra.getAncho()\n - objBarra.getAncho() / 18)) || (objProyectil.getX()\n + objProyectil.getAncho() > objBarra.getX()\n + objBarra.getAncho())) {\n bDireccionX = true; // arriba\n bDireccionY = false; // derecha\n }\n }\n\n }\n for (Object objeBloque : lnkBloques) {\n Objeto objBloque = (Objeto) objeBloque;\n //Checa si la barra choca con los bloques (Choca con el poder)\n if(objBarra.colisiona(objBloque)) {\n bPoderes[objBloque.getPoder()] = true;\n }\n // Checa si el proyectil choca contra los bloques\n if (objBloque.colisiona(objProyectil)) {\n iScore++; // Se aumenta en 1 el score\n iNumBloques--; //Se resta el numero de bloques\n //Se activa el bloque con el poder para que se mueva para abajo\n if (objBloque.getPoder() != 0) {\n URL urlImagenPoder\n = this.getClass().getResource(\"metanfeta.png\");\n objBloque.setImagen(Toolkit.getDefaultToolkit()\n .getImage(urlImagenPoder));\n objBloque.setVelocidad(2);\n bAvanzaBloque = true;\n }\n if(objProyectil.colisiona(objBloque.getX(), \n objBloque.getY()) ||\n objProyectil.colisiona(objBloque.getX(), \n objBloque.getY()+objBloque.getAlto())) {\n objBloque.setX(getWidth() + 50);\n bDireccionX = false; //va hacia arriba\n }\n if(objProyectil.colisiona(objBloque.getX()+objBloque.getAncho(), \n objBloque.getY()) ||\n objProyectil.colisiona(objBloque.getX()+objBloque.getAncho(), \n objBloque.getY()+objBloque.getAlto())) {\n objBloque.setX(getWidth() + 50);\n bDireccionX = true; //va hacia arriba\n }\n //Si la parte superior de proyectil es mayor o igual a la parte\n //inferior del bloque(esta golpeando por abajo del bloque...\n if((objProyectil.getY() <= objBloque.getY() \n + objBloque.getAlto()) && (objProyectil.getY() \n + objProyectil.getAlto() > objBloque.getY() \n + objBloque.getAlto())) {\n objBloque.setX(getWidth() + 50);\n bDireccionY = true; //va hacia abajo\n \n \n }\n //parte inferior del proyectil es menor o igual a la de la parte\n //superior del bloque(esta golpeando por arriba)...\n else if(( objProyectil.getY() + objProyectil.getAlto()\n >= objBloque.getY())&&( objProyectil.getY() \n < objBloque.getY())) {\n objBloque.setX(getWidth() + 50);\n bDireccionY = false; //va hacia arriba\n }\n //Si esta golpeando por algun otro lugar (los lados)...\n else {\n objBloque.setX(getWidth()+50);\n bDireccionX = !bDireccionX;\n }\n }\n }\n //Si la barra choca con el lado izquierdo...\n if (objBarra.getX() < 0) {\n objBarra.setX(0); //Se posiciona al principio antes de salir\n } //Si toca el lado derecho del Jframe...\n else if (objBarra.getX() + objBarra.getAncho() - objBarra.getAncho() / 18\n > getWidth()) {\n objBarra.setX(getWidth() - objBarra.getAncho() + objBarra.getAncho()\n / 18);// Se posiciciona al final antes de salir\n }\n //Si el Proyectil choca con cualquier limite de los lados...\n if (objProyectil.getX() < 0 || objProyectil.getX()\n + objProyectil.getAncho() > getWidth()) {\n //Cambias su direccion al contrario\n bDireccionX = !bDireccionX;\n } //Si el Proyectil choca con la parte superior del Jframe...\n else if (objProyectil.getY() < 0) {\n //Cambias su direccion al contrario\n bDireccionY = !bDireccionY;\n } //Si el proyectil toca el fondo del Jframe...\n else if (objProyectil.getY() + objProyectil.getAlto() > getHeight()) {\n iVidas--; //Se resta una vida.\n // se posiciona el proyectil en el centro arriba de barra\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n }\n }", "public static Image segmentarImagen(Image imagen, int u1, int u2){\n BufferedImage bi = AbrirImagen.toBufferedImage(imagen);\n Color color, colorFondo;\n colorFondo = new Color(255,255,255);\n for(int x=0; x<bi.getWidth();x++)\n for(int y=0; y<bi.getHeight();y++){\n color = new Color(bi.getRGB(x, y));\n int prom = (color.getRed()+ color.getGreen()+color.getBlue())/3;\n if (!(prom>= u1 && prom<=u2)){\n bi.setRGB(x,y,colorFondo.getRGB());\n }\n\n }\n return AbrirImagen.toImage(bi);\n }", "private void resampleAbdomenVOI() {\r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n \r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n int x = xcm;\r\n int y = ycm;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && curve.contains(x, y)) {\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && curve.contains(x, y)) {\r\n\r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && curve.contains(x, y)) {\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && curve.contains(x, y)) {\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n }\r\n } // end for (angle = 0; ...\r\n \r\n// ViewUserInterface.getReference().getMessageFrame().append(\"resample VOI number of points: \" +xValsAbdomenVOI.size());\r\n curve.clear();\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n curve.add( new Vector3f( xValsAbdomenVOI.get(idx), yValsAbdomenVOI.get(idx), 0 ) );\r\n }\r\n }", "int getSegment();", "public Segment GetFirstSegment() { return cs1; }", "private void paintCourbeCroix() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\tint k, l;\n\t\t\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) { //Une croix pour chaque x entier dans le repere\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) { //Si le point est dans le repere\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\tfor(k=i-2, l=j-2; l<=j+2; k++, l++)\t// * *\n\t\t\t\t\tpaintPointInColor(k, l);\t\t// * *\n\t\t\t\t\t\t\t\t\t\t\t\t\t// *\n\t\t\t\tfor(k=i+2, l=j-2; l<=j+2; k--, l++)\t// * *\n\t\t\t\t\tpaintPointInColor(k, l);\t\t// * *\n\t\t\t}\n\t\t}\t\n\t}", "public static void obtenerInfoColisionJugador(Jugador jugador, Objeto col,String[] direccion, ArrayList<Objeto> obj_colision) {\n Rectangle[] lados_ente = jugador.objeto_ente.getRectangle();\n Rectangle[] lados_col = col.getRectangle();\n\n \n if (col.getTag().compareToIgnoreCase(Objeto.Tag.COMIDA) == 0 || col.getTag().compareToIgnoreCase(Objeto.Tag.MONEDA) == 0) {\n //System.out.println(\"COMIDA\");\n for(int i=0;i<4;i++)\n if (lados_ente[i].intersects(lados_col[0])) {\n obj_colision.add(col);\n return;\n }\n }\n\n \n \n if (col.getTag().compareToIgnoreCase(Objeto.Tag.ENEMIGO) == 0) {\n\n //System.out.println(lados_ente[0].x + \" con \" + lados_col[0].x + \" tag: \" + col.getId());\n if (lados_ente[0].intersects(lados_col[2])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"enemigo_arriba\";\n }\n //else\n // System.out.println(lados_ente[0].y + \" con \" + lados_col[2].y + \" tag: \" + col.getId());\n if (lados_ente[1].intersects(lados_col[3])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"enemigo_derecha\";\n\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"enemigo_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[1])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"enemigo_izquierda\";\n }\n\n }\n \n if (col.getTag().compareToIgnoreCase(Objeto.Tag.NPC) == 0) {\n\n //System.out.println(lados_ente[0].x + \" con \" + lados_col[0].x + \" tag: \" + col.getId());\n if (lados_ente[0].intersects(lados_col[0])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"npc_arriba\";\n }\n //else\n // System.out.println(lados_ente[0].y + \" con \" + lados_col[2].y + \" tag: \" + col.getId());\n if (lados_ente[1].intersects(lados_col[0])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"npc_derecha\";\n\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"npc_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[0])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"npc_izquierda\";\n }\n\n }\n\n if (lados_ente[0].intersects(lados_col[0])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"entorno_arriba\";\n }\n if (lados_ente[1].intersects(lados_col[0])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"entorno_derecha\";\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"entorno_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[0])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"entorno_izquierda\";\n }\n }", "private void compruebaColisiones()\n {\n // Comprobamos las colisiones con los Ufo\n for (Ufo ufo : ufos) {\n // Las naves Ufo chocan con la nave Guardian\n if (ufo.colisionaCon(guardian) && ufo.getVisible()) {\n mensajeDialogo(0);\n juego = false;\n }\n // Las naves Ufo llegan abajo de la pantalla\n if ((ufo.getPosicionY() - ufo.getAlto() > altoVentana)) {\n mensajeDialogo(0);\n juego = false;\n }\n // El disparo de la nave Guardian mata a una nave Ufo\n if (ufo.colisionaCon(disparoGuardian) && ufo.getVisible()) {\n ufo.setVisible(false);\n disparoGuardian.setVisible(false);\n disparoGuardian.setPosicion(0, 0);\n ufosMuertos++;\n }\n }\n\n // El disparo de las naves Ufo mata a la nave Guardian\n if (guardian.colisionaCon(disparoUfo)) {\n disparoUfo.setVisible(false);\n mensajeDialogo(0);\n juego = false;\n }\n\n // Si el disparo Guardian colisiona con el disparo de los Ufo, se\n // eliminan ambos\n if (disparoGuardian.colisionaCon(disparoUfo)) {\n disparoGuardian.setVisible(false);\n disparoGuardian.setPosicion(0, 0);\n disparoUfo.setVisible(false);\n }\n }", "private void createCentipede() {\n\t\tcentipede = new ArrayList<>();\n\t\tfor(int i = 0; i < centipedeSize; i ++) {\n\t\t\tcentipede.add(new Segment(304 + 16 * i, 0));\n\t\t}\n\t}", "private void fixSubcutaneousFatVOIs() {\r\n VOI theVOI = subcutaneousVOI;\r\n \r\n if (theVOI.getName() != \"Subcutaneous area\") {\r\n MipavUtil.displayError(\"fixSubcutaneousFatVOIs(): SubcutaneousVOI is not properly set\");\r\n return;\r\n }\r\n \r\n // make a 2D image to hold one slice and curve from the VOI\r\n int[] extents = new int[2];\r\n extents[0] = xDim;\r\n extents[1] = yDim;\r\n ModelImage sliceImage = new ModelImage(ModelStorageBase.UBYTE, extents, \"tmpSliceImage\");\r\n\r\n // There should be one curve on each slice and\r\n // each curve should have the same number of points since each was resampled\r\n int numPoints = ((VOIContour)theVOI.getCurves().get(0)).size();\r\n int[] xVals;\r\n int[] yVals;\r\n int[] zVals;\r\n try {\r\n xVals = new int [numPoints];\r\n yVals = new int [numPoints];\r\n zVals = new int [numPoints];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"fixSubcutaneousFatVOIs(): Can NOT allocate the subcutaneous fat VOI arrays\");\r\n return;\r\n } \r\n\r\n int numCurves;\r\n VOIContour curve;\r\n for (int sliceIdx = 0; sliceIdx < zDim; sliceIdx++) {\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Extracting VOI for slice: \" +sliceIdx +\" \", ViewJFrameMessage.DEBUG);\r\n long time = System.currentTimeMillis();\r\n\r\n // make a new VOI\r\n VOI sliceVOI = new VOI((short)0, \"SliceVOI\");\r\n \r\n // copy and remove a curve from the 3D image into the 2D image\r\n curve = ((VOIContour)theVOI.getCurves().remove(0));\r\n sliceVOI.importCurve(curve);\r\n sliceImage.registerVOI(sliceVOI);\r\n \r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n\r\n \r\n // make a binary image out of the subcutaneousVOI on the 2D VOI\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Making a binary image from the VOI: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n ModelImage binImage = sliceImage.generateBinaryImage(); \r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Smoothing Image with \"+sliceVOI.getNumPoints()+\"points: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n new AlgorithmBSmooth(binImage, sliceVOI, sliceVOI.getNumPoints()/3, true);\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // close the binaryImage with a huge structuring element to fill in all the major gaps\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Morphology to the image: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n closeImage(binImage, 61.0f);\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // convert the binary image into a VOI\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Extracting the new VOI: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n AlgorithmVOIExtraction VOIExtractionAlgo = new AlgorithmVOIExtraction(binImage);\r\n VOIExtractionAlgo.setRunningInSeparateThread(false);\r\n VOIExtractionAlgo.run();\r\n VOIExtractionAlgo.setCompleted(true);\r\n\r\n\r\n // make sure we got one VOI with one curve\r\n VOIVector vois = binImage.getVOIs();\r\n if(vois.size() != 1) {\r\n System.err.println(\"fixSubcutaneousFatVOIs() Error, did not get 1 VOI for the subcutaneous fat VOI\");\r\n return;\r\n }\r\n \r\n // binImage has one VOI, lets get it\r\n VOI theFixedVOI = vois.get(0);\r\n \r\n // Keep only the largest VOI as the subcutaneous fat\r\n numCurves = theFixedVOI.getCurves().size();\r\n \r\n int maxIdx = 0;\r\n int maxNumPoints = ((VOIContour)theFixedVOI.getCurves().get(maxIdx)).size();\r\n for (int idx = 1; idx < numCurves; idx++) {\r\n if (((VOIContour)theFixedVOI.getCurves().get(idx)).size() > maxNumPoints) {\r\n maxIdx = idx;\r\n }\r\n } // end for (int idx = 0; ...)\r\n for (int idx = numCurves-1; idx >= 0; idx--) {\r\n if (idx != maxIdx) {\r\n theFixedVOI.getCurves().remove(idx);\r\n }\r\n } // end for (int idx = 0; ...)\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Copying the new VOI: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n // copy a curve from the 2D image into the 3D image\r\n // new arrays need to be made for each slice because the array size\r\n // is used when importing the curve to the VOI. The extracted VOI\r\n // cannot be determined, unless we resample the subcutaneous VOI\r\n \r\n // resample the subcutaneous fat VOI so it has the same number of\r\n // sampes as the abdomen VOI. Furthermore, the samples will be on a\r\n // throught the center of mass of the abdomen and the abdomen VOI samples\r\n resampleCurve(theFixedVOI, sliceIdx);\r\n curve = ((VOIContour)theFixedVOI.getCurves().get(0));\r\n/*\r\n int[] newXVals;\r\n int[] newYVals;\r\n int[] newZVals;\r\n numPoints = curve.size(); try {\r\n newXVals = new int [numPoints];\r\n newYVals = new int [numPoints];\r\n newZVals = new int [numPoints];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"fixSubcutaneousFatVOIs(): Can NOT allocate the subcutaneous fat VOI arrays\");\r\n return;\r\n } \r\n \r\n curve.exportArrays(newXVals, newYVals, newZVals);\r\n theVOI.importCurve(newXVals, newYVals, newZVals, sliceIdx);\r\n*/\r\n curve.exportArrays(xVals, yVals, zVals);\r\n theVOI.importCurve(xVals, yVals, zVals);\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // need to remove the curve because registering a VOI makes a copy of it\r\n sliceVOI.removeCurves();\r\n sliceImage.unregisterAllVOIs();\r\n\r\n } // end for (int sliceIdx = 0; ...)\r\n\r\n //ShowImage(sliceImage, \"sliceImage\");\r\n\r\n }", "private Punto getPuntoCercano(Punto puntoini, List<Punto> puntos ){\n\t\t\t\n\t\t List<Segmento> segmentos = new ArrayList<Segmento>();\n\t\t\t// todos contra todos\n\t\t\tfor (Punto punto : puntos) {\n\t\t\t\tif( (puntoini!=null && punto!=null) && !puntoini.equals(punto) ){\n\t\t\t\t\t\tdouble d = Geometria.distanciaDeCoordenadas(puntoini, punto);\n\t\t\t\t\t\tsegmentos.add(new Segmento(puntoini, punto, d));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tCollections.sort(segmentos);\n\t\t\tPunto puntocerano = segmentos.get(0).getPunto2();\n\t\t \n\t\t return puntocerano;\n\t\t \n\t }", "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "public void setDatossolicitudBfsegmentacionVc(int value) {\n this.datossolicitudBfsegmentacionVc = value;\n }", "public double Baricentro() {\n if (puntos.size() <= 2) {\n return 0;\n } else {\n // Inicializacion de las areas\n double areaPonderada = 0;\n double areaTotal = 0;\n double areaLocal;\n // Recorrer la lista conservando 2 puntos\n Punto2D antiguoPt = null;\n for (Punto2D pt : puntos) {\n if (antiguoPt != null) {\n // Cálculo deñ baricentro local\n if (antiguoPt.y == pt.y) {\n // Es un rectángulo, el baricentro esta en\n // centro\n areaLocal = pt.y * (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n } else {\n // Es un trapecio, que podemos descomponer en\n // un reactangulo con un triangulo\n // rectangulo adicional\n // Separamos ambas formas\n // Primer tiempo: rectangulo\n areaLocal = Math.min(pt.y, antiguoPt.y) + (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n //Segundo tiempo: triangulo rectangulo\n areaLocal = (pt.x - antiguoPt.x) * Math.abs(pt.y - antiguoPt.y) / 2.0;\n areaTotal += areaLocal;\n if (pt.y > antiguoPt.y) {\n // Baricentro a 1/3 del lado pt\n areaPonderada += areaLocal * (2.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n } else {\n // Baricentro a 1/3 dek lado antiguoPt\n areaPonderada += areaLocal * (1.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n }\n }\n }\n antiguoPt = pt;\n }\n // Devolvemos las coordenadas del baricentro\n return areaPonderada / areaTotal;\n }\n }", "public static void obtenerInfoColisionEnemigo(Enemigo enemigo, Objeto col,String[] direccion, ArrayList<Objeto> obj_colision) {\n Rectangle[] lados_ente = enemigo.objeto_ente.getRectangle();\n Rectangle[] lados_col = col.getRectangle();\n\n if (col.getTag().compareToIgnoreCase(Objeto.Tag.JUGADOR) == 0) {\n if (lados_ente[0].intersects(lados_col[2])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"jugador_arriba\";\n }\n if (lados_ente[1].intersects(lados_col[3])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"jugador_derecha\";\n\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"jugador_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[1])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"jugador_izquierda\";\n }\n }\n\n if (lados_ente[0].intersects(lados_col[0])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"entorno_arriba\";\n }\n if (lados_ente[1].intersects(lados_col[0])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"entorno_derecha\";\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"entorno_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[0])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"entorno_izquierda\";\n }\n }", "private final void segmentsFrameEffects() {\n\t\tif (alive) {\n\t\t\tint i;\n\t\t\t// Energy obtained through photosynthesis\n\t\t\tdouble photosynthesis = 0;\n\t\t\t_nChildren = 1;\n\t\t\t_indigo =0;\n\t\t\t_lowmaintenance =0;\n\t\t\tint fertility =0;\n\t\t\tint yellowCounter =0;\n\t\t\tint reproduceearly =0;\n\t\t\tdouble goldenage =0;\n\t\t\t_isfrozen =false;\n\t\t\tboolean trigger =false;\n\t\t\tfor (i=_segments-1; i>=0; i--) {\n\t\t\t\t// Manteniment\n\t\t\t\tswitch (getTypeColor(_segColor[i])) {\n\t\t\t\t// \tMovement\n\t\t\t\tcase CYAN:\n\t\t\t\t\tif (Utils.random.nextInt(100)<8 && useEnergy(Utils.CYAN_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\tdx=Utils.between(dx+12d*(x2[i]-x1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\tdy=Utils.between(dy+12d*(y2[i]-y1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\tdtheta=Utils.between(dtheta+Utils.randomSign()*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEAL:\n\t\t\t\t\tif (_geneticCode.getPassive()) {\n\t\t\t\t\t\tif (_hasdodged == false) {\n\t\t\t\t\t\t\t_dodge =true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\t} else \n\t\t\t\t\t if (Utils.random.nextInt(100)<8 && useEnergy(Utils.CYAN_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t dx=Utils.between(dx+12d*(x2[i]-x1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\t dy=Utils.between(dy+12d*(y2[i]-y1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\t dtheta=Utils.between(dtheta+Utils.randomSign()*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Photosynthesis\n\t\t\t\tcase SPRING:\n\t\t\t\t\t if (_geneticCode.getClockwise()) {\n\t\t\t\t\t\t dtheta=Utils.between(dtheta+0.1*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t\t photosynthesis += Utils.SPRING_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t dtheta=Utils.between(dtheta-0.1*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t photosynthesis += Utils.SPRING_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIME:\n\t\t\t\t\tif (trigger == false) {\n\t\t\t\t\t\ttrigger =true;\n\t\t\t\t\t if (_world.fastCheckHit(this) != null) {\n\t\t\t\t\t \t_crowded =true;\n\t\t\t\t\t } else {\n\t\t\t\t\t \t_crowded =false;\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\tif (_crowded == true) {\n\t\t\t\t\t photosynthesis += Utils.CROWDEDLIME_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tphotosynthesis += Utils.LIME_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase JADE:\n\t\t\t\t\t_isjade =true;\n\t\t\t\t\tphotosynthesis += Utils.JADE_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase GREEN:\n\t\t\t\t\tphotosynthesis += Utils.GREEN_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase FOREST:\n\t\t\t\t\tphotosynthesis += Utils.FOREST_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase BARK:\n\t\t\t\t\tphotosynthesis += Utils.BARK_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRASS:\n\t\t\t\t\tphotosynthesis += Utils.GRASS_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase C4:\n\t\t\t\t\t_lowmaintenance += _m[i];\n\t\t\t\t\tphotosynthesis += Utils.C4_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// is a consumer\n\t\t\t\tcase RED:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FIRE:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ORANGE:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase MAROON:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase PINK:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tif (_isakiller < 2) {\n\t\t\t\t\t\t_lowmaintenance += 0.8 * _m[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase CREAM:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with yellow segments have more children\n\t\t\t\tcase YELLOW:\n\t\t\t\t\tyellowCounter++;\n\t\t\t\t\tfertility += _m[i];\n\t\t\t\t break;\n\t\t\t\t// Experienced parents have more children\n\t\t\t\tcase SILVER:\n\t\t\t\t\tif (_isaconsumer == false) {\n\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t\tcase GRAY:\n\t\t\t\t\t\tcase LILAC:\n\t\t\t\t\t\tcase SPIKE:\n\t\t\t\t\t\tcase PLAGUE:\n\t\t\t\t\t\tcase CORAL:\n\t\t\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t}}}\n\t\t\t\t\t if (_nTotalChildren >= 1 && _nTotalChildren < 5) {\n\t\t\t\t\t\t_nChildren = 2; \n\t\t\t\t\t} else if (_nTotalChildren >= 5 && _nTotalChildren < 14) {\n\t\t\t\t\t\t_nChildren = 3; \n\t\t\t\t\t} else if (_nTotalChildren >= 14 && _nTotalChildren < 30) {\n\t\t\t\t\t\t_nChildren = 4; \n\t\t\t\t\t} else if (_nTotalChildren >= 30 && _nTotalChildren < 55) {\n\t\t\t\t\t\t_nChildren = 5;\n\t\t\t\t\t} else if (_nTotalChildren >= 55 && _nTotalChildren < 91) {\n\t\t\t\t\t _nChildren = 6;\n\t\t\t\t\t} else if (_nTotalChildren >= 91 && _nTotalChildren < 140) {\n\t\t\t\t\t\t_nChildren = 7; \n\t\t\t\t\t} else if (_nTotalChildren >= 140) {\n\t\t\t\t\t\t_nChildren = 8;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Auburn always has one real child if infected\n\t\t\t\tcase AUBURN:\n\t\t\t\t\t_isauburn =true;\n\t\t\t\t\t_lowmaintenance += _m[i] - (Utils.AUBURN_ENERGY_CONSUMPTION * _m[i]);\n\t\t\t\t\tif (_infectedGeneticCode != null && _nChildren == 1) {\n\t\t\t\t\t\t_nChildren = 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with blond segments reproduce earlier\n\t\t\t\tcase BLOND:\n\t\t\t\t\treproduceearly += 3 + _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with indigo segments reduce the energy the new born virus receives\n\t\t\t\tcase INDIGO:\n\t\t\t\t\t_indigo += _m[i];\n\t\t\t\t\t_lowmaintenance += 0.8 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Plague forces an organism to reproduce the virus\n\t\t\t\tcase PLAGUE:\n\t\t\t\t\t_isplague =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Coral transforms particles and viruses\n\t\t\t\tcase CORAL:\n\t\t\t\t\t_iscoral =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Mint immunity against infections\t\n\t\t\t\tcase MINT:\n\t\t\t\t\t_isantiviral =true;\n\t\t\t\t\tif (_infectedGeneticCode != null && Utils.random.nextInt(Utils.IMMUNE_SYSTEM)<=_m[i] && useEnergy(Utils.MINT_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_infectedGeneticCode = null;\n\t\t\t\t\t\tsetColor(Utils.ColorMINT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Healing\n\t\t\t\tcase MAGENTA:\n\t\t\t\t _isregenerative =true;\n\t\t\t\t for (int j = 0; j < _segments; j++) {\n\t\t\t\t if ((_segColor[j] == Utils.ColorLIGHTBROWN) || (_segColor[j] == Utils.ColorGREENBROWN) || (_segColor[j] == Utils.ColorPOISONEDJADE)\n\t\t\t\t\t\t|| (_segColor[j] == Utils.ColorBROKEN) || (_segColor[j] == Utils.ColorLIGHT_BLUE) || (_segColor[j] == Utils.ColorICE)\n\t\t\t\t\t\t|| (_segColor[j] == Utils.ColorDARKJADE) || (_segColor[j] == Utils.ColorDARKFIRE)) {\n\t\t\t\t\tif (Utils.random.nextInt(Utils.HEALING)<=_m[i] && useEnergy(Utils.MAGENTA_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t _segColor[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getColor(); \n\t\t\t\t\t}}}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKFIRE:\n\t\t\t\t\tif (Utils.random.nextInt(100)<_geneticCode.getSymmetry() && useEnergy(Utils.MAGENTA_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_segColor[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getColor(); \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKJADE:\n\t\t\t\t\t_isjade =true;\n\t\t\t\t\tif (Utils.random.nextInt(Utils.DARKJADE_DELAY * _geneticCode.getSymmetry() * _geneticCode.getSymmetry())<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorJADE; \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Normalize spike\n\t\t\t\tcase SPIKEPOINT:\n\t\t\t\t\t_segColor[i] = Utils.ColorSPIKE;\n\t\t\t\t\tbreak;\n\t\t\t\t// is a killer\n\t\t\t\tcase SPIKE:\n\t\t\t\t\tif (_isenhanced) {\n\t\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t}\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LILAC:\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRAY:\n\t\t\t\t\tif (_isakiller < 2) {\n\t\t\t\t\t _isakiller = 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// is poisonous\n\t\t\t\tcase VIOLET:\n\t\t\t\t\t_ispoisonous =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// is a freezer\n\t\t\t\tcase SKY:\n\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// is enhanced\n\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t_isenhanced =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Energy transfer\n\t\t\t\tcase ROSE:\n\t\t\t\t\t_lowmaintenance += 0.99 * _m[i];\n\t\t\t\t\tif (_transfersenergy == false) {\n\t\t\t\t\t\t_transfersenergy =true;\n\t\t\t\t\t _lengthfriend = _geneticCode.getGene(i%_geneticCode.getNGenes()).getLength();\n\t\t\t\t\t _thetafriend = _geneticCode.getGene(i%_geneticCode.getNGenes()).getTheta();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Low maintenance\n\t\t\t\tcase DARK:\n\t\t\t\t\t_lowmaintenance += 0.99 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with gold segments live longer\n\t\t\t\tcase GOLD:\n\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\tgoldenage += (_m[i]/Utils.GOLD_DIVISOR);\n\t\t\t\t\t_geneticCode._max_age = Utils.MAX_AGE + ((_geneticCode.getNGenes() * _geneticCode.getSymmetry())/Utils.AGE_DIVISOR) + (int)goldenage;\n\t\t\t\t\tbreak;\n\t\t\t\t// is weakened\n\t\t\t\tcase LIGHTBROWN:\n\t\t\t\tcase GREENBROWN:\n\t\t\t\tcase POISONEDJADE:\n\t\t\t\t\tif (_remember) {\n\t\t\t\t\t\t_isjade =false;\n\t\t\t\t\t\t_isenhanced =false;\n\t\t\t\t\t\t_isantiviral =false;\n\t\t\t\t\t\t_isregenerative =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase JADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKJADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t\t\t\t_isenhanced =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase MINT:\n\t\t\t\t\t\t\t\t_isantiviral =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase MAGENTA:\n\t\t\t\t\t\t\t\t_isregenerative =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t _geneticCode._max_age = Utils.MAX_AGE + ((_geneticCode.getNGenes() * _geneticCode.getSymmetry())/Utils.AGE_DIVISOR) + (int)goldenage;\n\t\t\t\t\t _remember =false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIGHT_BLUE:\n\t\t\t\t\tif (_isafreezer) {\n\t\t\t\t\t\t_isafreezer =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase SKY:\n\t\t\t\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DEEPSKY:\n\t\t\t\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\t\t\t\t// is frozen\n\t\t\t\tcase ICE:\n\t\t\t\t\t_isfrozen =true;\n\t\t\t\t\tif (_isjade) {\n\t\t\t\t\t\t_isjade =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase JADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKJADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\t\t\t\tcase DEADBARK:\n\t\t\t\t\t_isfrozen =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Restore abilities\n\t\t\t\tcase DARKLILAC:\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (Utils.random.nextInt(100)<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorLILAC;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DEEPSKY:\n\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\tif (Utils.random.nextInt(100)<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorSKY;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKOLIVE:\n\t\t\t\t\tif (Utils.random.nextInt(100)<8 && useEnergy(Utils.OLIVE_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorOLIVE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Reset dodging\n\t\t\tif (_hasdodged == true) {\n\t\t\t\t_dodge =false;\n\t\t\t\t_hasdodged =false;\n\t\t\t}\n\t\t\t//Get sun's energy\n\t\t\tif (photosynthesis > 0) {\n\t\t\t\t_isaplant =true;\n\t\t\t _energy += _world.photosynthesis(photosynthesis);\t\t\t\n\t\t\t}\n\t\t\t// Calculate number of children\n\t\t\tif (fertility > 0) {\n\t\t\t\tif (_geneticCode.getSymmetry() != 3) {\n\t\t\t\t _nChildren += (yellowCounter / _geneticCode.getSymmetry()) + (fertility / 23);\n\t\t\t } else {\n\t\t\t \t_nChildren += (yellowCounter / _geneticCode.getSymmetry()) + (fertility / 34);\n\t\t\t }\n\t\t\t}\n\t\t\t// Calculate reproduction energy for blond segments\n\t\t\tif ((reproduceearly > 0) && (_infectedGeneticCode == null)) {\n\t\t\t\tif (_energy > _geneticCode.getReproduceEnergy() - reproduceearly + Utils.YELLOW_ENERGY_CONSUMPTION*(_nChildren-1)) {\n\t\t\t\t\tif ((!_isaplant) && (!_isaconsumer)) {\n\t\t\t\t\t\tif ((_energy >= 10) && (_growthRatio<16) && (useEnergy(Utils.BLOND_ENERGY_CONSUMPTION))) {\n\t\t\t\t\t\t\t_nChildren = 1;\n\t\t\t\t\t _geneticCode._reproduceEnergy = Math.max((40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry()) - reproduceearly, 10);\n\t\t\t\t\t reproduce();\n\t\t\t\t\t _geneticCode._reproduceEnergy = 40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry();\t\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\tif ((_energy >= 30) && (_growthRatio==1) && (_timeToReproduce==0) && (useEnergy(Utils.BLOND_ENERGY_CONSUMPTION))) {\n\t\t\t\t\t\t _geneticCode._reproduceEnergy = Math.max((40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry()) - reproduceearly, 30);\n\t\t\t\t\t\t reproduce();\n\t\t\t\t\t\t _geneticCode._reproduceEnergy = 40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry();\t\t\t\t\t\t\t\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t}\n\t}", "private void resampleAbdomenVOI( int sliceIdx, VOIContour curve ) {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM(sliceIdx);\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n \r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n int x = xcm;\r\n int y = ycm;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && curve.contains(x, y)) {\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && curve.contains(x, y)) {\r\n\r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && curve.contains(x, y)) {\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && curve.contains(x, y)) {\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n }\r\n } // end for (angle = 0; ...\r\n \r\n// ViewUserInterface.getReference().getMessageFrame().append(\"resample VOI number of points: \" +xValsAbdomenVOI.size());\r\n\r\n curve.clear();\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n curve.add( new Vector3f( xValsAbdomenVOI.get(idx), yValsAbdomenVOI.get(idx), sliceIdx ) );\r\n }\r\n }", "public ArrayList<TessSeg> splitAtIsect(TessSeg s1)\r\n {\r\n if (!isLineHit(s1))\r\n {\r\n return null;\r\n }\r\n \r\n //Check for point-line hits\r\n double t00 = -1, t01 = -1, t10 = -1, t11 = -1;\r\n boolean pointMidlineHit = false;\r\n \r\n if (isPointOnLine(s1.c0))\r\n {\r\n double t = pointOnLineT(s1.c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t00 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (isPointOnLine(s1.c1))\r\n {\r\n double t = pointOnLineT(s1.c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t01 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c0))\r\n {\r\n double t = s1.pointOnLineT(c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t10 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c1))\r\n {\r\n double t = s1.pointOnLineT(c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t11 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n\r\n if (pointMidlineHit)\r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n if (t00 > 0 && t01 > 0)\r\n {\r\n if (t00 < t01)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n }\r\n else if (t00 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n else if (t01 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(this);\r\n }\r\n \r\n if (t10 > 0 && t11 > 0)\r\n {\r\n if (t10 < t11)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n }\r\n else if (t10 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n else if (t11 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(s1);\r\n }\r\n \r\n return list;\r\n }\r\n \r\n if (c0.equals(s1.c0) \r\n || c0.equals(s1.c1)\r\n || c1.equals(s1.c0)\r\n || c1.equals(s1.c1))\r\n {\r\n //No point-midline hits. If we only meet at verts,\r\n // do not split.\r\n return null;\r\n }\r\n \r\n// if (!isParallelTo(s1))\r\n {\r\n //Midpoint crossing for both segments.\r\n // Solve system of linear eqns\r\n double s0x0 = c0.x;\r\n double s0y0 = c0.y;\r\n double s0x1 = c1.x;\r\n double s0y1 = c1.y;\r\n double s1x0 = s1.c0.x;\r\n double s1y0 = s1.c0.y;\r\n double s1x1 = s1.c1.x;\r\n double s1y1 = s1.c1.y;\r\n\r\n double[] t = Math2DUtil.lineIsectFractions(\r\n s0x0, s0y0, s0x1 - s0x0, s0y1 - s0y0,\r\n s1x0, s1y0, s1x1 - s1x0, s1y1 - s1y0,\r\n null);\r\n\r\n if (t == null || t[0] < 0 || t[0] > 1 || t[1] < 0 || t[1] > 1)\r\n {\r\n Logger.getLogger(TessSeg.class.getName()).log(Level.WARNING, \r\n \"Line segments do not overlap\");\r\n }\r\n// assert (t[0] > 0 && t[0] < 1 && t[1] > 0 && t[1] < 1)\r\n// : \"Line segments do not overlap\";\r\n \r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n \r\n Coord c = new Coord(\r\n (int)Math2DUtil.lerp(s1x0, s1x1, t[1]),\r\n (int)Math2DUtil.lerp(s1y0, s1y1, t[1]));\r\n\r\n list.add(new TessSeg(c0, c));\r\n list.add(new TessSeg(c, c1));\r\n list.add(new TessSeg(s1.c0, c));\r\n list.add(new TessSeg(c, s1.c1));\r\n \r\n return list;\r\n }\r\n }\r\n \r\n// return null;\r\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n ArrayList<Integer> shape_index = new ArrayList<Integer>();\r\n if(selected_shape.length()==0){\r\n instruction.setText(\"Please select an object before cutting operation\");\r\n }else{\r\n switch(selected_shape){\r\n case \"rec\":\r\n int begin_index = selected_object.get(0);\r\n if(rec_points.size()>4){\r\n for (int i = 0; i < 4; i++) {\r\n rec_points.remove(begin_index);\r\n }\r\n }else{\r\n rec_points.clear();\r\n }\r\n\r\n rec_colors.remove(selected_element_index);\r\n for (int i = 0; i < progress_stack.size(); i++) {\r\n if(progress_stack.get(i).equals(\"rec\")){\r\n shape_index.add(i);\r\n }\r\n }\r\n int cut_shape_index = shape_index.get(selected_element_index);\r\n progress_stack.remove(cut_shape_index);\r\n break;\r\n\r\n case \"squ\":\r\n begin_index = selected_object.get(0);\r\n if(squ_points.size()>4){\r\n for (int i = 0; i < 4; i++) {\r\n squ_points.remove(begin_index);\r\n }\r\n }else{\r\n squ_points.clear();\r\n }\r\n squ_colors.remove(selected_element_index);\r\n for (int i = 0; i < progress_stack.size(); i++) {\r\n if(progress_stack.get(i).equals(\"squ\")){\r\n shape_index.add(i);\r\n }\r\n }\r\n cut_shape_index = shape_index.get(selected_element_index);\r\n progress_stack.remove(cut_shape_index);\r\n break;\r\n\r\n case \"ell\":\r\n begin_index = selected_object.get(0);\r\n if(ell_points.size()>4){\r\n for (int i = 0; i < 4; i++) {\r\n ell_points.remove(begin_index);\r\n }\r\n }else{\r\n ell_points.clear();\r\n }\r\n ell_colors.remove(selected_element_index);\r\n for (int i = 0; i < progress_stack.size(); i++) {\r\n if(progress_stack.get(i).equals(\"ell\")){\r\n shape_index.add(i);\r\n }\r\n }\r\n cut_shape_index = shape_index.get(selected_element_index);\r\n progress_stack.remove(cut_shape_index);\r\n break;\r\n\r\n case \"cir\":\r\n begin_index = selected_object.get(0);\r\n if(cir_points.size()>4){\r\n for (int i = 0; i < 4; i++) {\r\n cir_points.remove(begin_index);\r\n }\r\n }else{\r\n cir_points.clear();\r\n }\r\n cir_colors.remove(selected_element_index);\r\n for (int i = 0; i < progress_stack.size(); i++) {\r\n if(progress_stack.get(i).equals(\"cir\")){\r\n shape_index.add(i);\r\n }\r\n }\r\n cut_shape_index = shape_index.get(selected_element_index);\r\n progress_stack.remove(cut_shape_index);\r\n break;\r\n\r\n case \"str\":\r\n begin_index = selected_object.get(0);\r\n if(str_points.size()>4){\r\n for (int i = 0; i < 4; i++) {\r\n str_points.remove(begin_index);\r\n }\r\n }else{\r\n str_points.clear();\r\n }\r\n str_colors.remove(selected_element_index);\r\n for (int i = 0; i < progress_stack.size(); i++) {\r\n if(progress_stack.get(i).equals(\"str\")){\r\n shape_index.add(i);\r\n }\r\n }\r\n cut_shape_index = shape_index.get(selected_element_index);\r\n progress_stack.remove(cut_shape_index);\r\n break;\r\n\r\n }\r\n }\r\n\r\n\r\n //repaint all shapes\r\n\r\n g.setColor(Color.WHITE);\r\n g.fillRect(0,0,1200, 800);\r\n canvas.repaint();\r\n System.out.println(progress_stack);\r\n System.out.println(rec_points);\r\n repaint_shapes(\"rec\", rec_colors, rec_points);\r\n repaint_shapes(\"squ\", squ_colors, squ_points);\r\n repaint_shapes(\"ell\", ell_colors, ell_points);\r\n repaint_shapes(\"cir\", cir_colors, cir_points);\r\n repaint_shapes(\"str\", str_colors, str_points);\r\n\r\n canvas.repaint();\r\n }", "public Vector performSegmentation(Stroke theStroke)\n\t{\n\t\tsetPixelInfo(theStroke);\n\t\t// this vector stores vectors of segment points detected through various methods\n\t\tVector segVectorList = new Vector();\n\t\tint segScheme=0;\n\t\tswitch (segScheme = Prefs.getSegScheme())\n\t\t{\n\t\t//PRATEEK: Is this the place where ALL the segmentation decisions are made??\n\t\tcase GConstants.SEG_SCHEME_ALL:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tsegVectorList.add(getTimeSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tcase GConstants.SEG_SCHEME_SPEED:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tcase GConstants.SEG_SCHEME_CURVATURE:\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\n\t\tcase GConstants.SEG_SCHEME_TIME:\n\t\t\tsegVectorList.add(getTimeSeg(theStroke));\n\t\t\tbreak;\n\n\t\tcase GConstants.SEG_SCHEME_SPEED_CURVATURE:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\t\t}\n/*We now have a list of segment-points to work with*/\n\t\t// get the common segment points\n\t\tSystem.out.println(\"Modified Hybrid fits\");\n\t\tVector selectedSegPos;\n\t/*\n\t\tselectedSegPos = returnRelevantVector(segVectorList);\n\t\t\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tCollections.sort(selectedSegPos);\n\t\tIterator iter = selectedSegPos.iterator();\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\t Integer index = (Integer) iter.next();\n\t\t\t PixelInfo pixel = (PixelInfo)ptList.get(index.intValue());\n\t\t\t System.out.println(\"Index: \"+index+\", \"+pixel);\n\t\t}*/\n\t\t/*if(segScheme == 1 || segScheme == 3){\n\t\t\t\n\t\t}\n\t\telse{*/\n\t\tselectedSegPos = detectCommonSegPt(segVectorList, theStroke);\n\t\t//selectedSegPos = combinationAlgorithm(theStroke);\n\t\t//}\n//\t\tVector selectedSegPos = detectCommonSegPt(segVectorList, theStroke);\n\n\t\t// TODO: DONE: remove this code, This is just to print the common segments points\n\t/*\tSystem.out.println(\"Combination algorithm\");\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tCollections.sort(selectedSegPos);\n\t\tIterator iter = selectedSegPos.iterator();\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\t Integer index = (Integer) iter.next();\n\t\t\t PixelInfo pixel = (PixelInfo)ptList.get(index.intValue());\n\t\t\t System.out.println(\"Index: \"+index+\", \"+pixel);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n\\n\");\n\t\t*/\n\t\t\n\t\treturn selectedSegPos;\n\t}", "public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}", "public void detect_lines(float[] image,long width, long height, Lines contours, MutableLong num_result, double sigma, double low, double high, long mode, boolean compute_width, boolean correct_pos,boolean extend_lines, Junctions junctions)\r\n\t{\r\n\t byte[] ismax;\r\n\t float[] ev, n1, n2, p1, p2;\r\n\t float[][] k = new float[5][(int) (width*height)];\r\n\t \r\n\t// for (i=0;i<5;i++)\r\n\t// k[i] = xcalloc(width*height,sizeof(float));\r\n\t Convol convol = new Convol();\r\n\t convol.convolve_gauss(image,k[0],width,height,sigma,LinesUtil.DERIV_R);\r\n\t convol.convolve_gauss(image,k[1],width,height,sigma,LinesUtil.DERIV_C);\r\n\t convol.convolve_gauss(image,k[2],width,height,sigma,LinesUtil.DERIV_RR);\r\n\t convol.convolve_gauss(image,k[3],width,height,sigma,LinesUtil.DERIV_RC);\r\n\t \r\n\t convol.convolve_gauss(image,k[4],width,height,sigma,LinesUtil.DERIV_CC);\r\n\t\r\n\t ismax = new byte[(int) (width*height)];\r\n\t ev = new float[(int) (width*height)];\r\n\t n1 = new float[(int) (width*height)];\r\n\t n2 = new float[(int) (width*height)];\r\n\t p1 = new float[(int) (width*height)];\r\n\t p2 = new float[(int) (width*height)];\r\n\t /*\r\n\t * The C library function void *memset(void *str, int c, size_t n) \r\n\t * copies the character c (an unsigned char) to the first n characters \r\n\t * of the string pointed to by the argument str.\r\n\t */\r\n\t // memset(ismax,0,width*height*sizeof(*ismax));\r\n\t // memset(ev,0,width*height*sizeof(*ev));\r\n\t for(int j = 0; j < ismax.length; j++){\r\n\t\t ev[j] = 0;\r\n\t\t ismax[j] = 0;\r\n\t }\r\n\r\n\t compute_line_points(k,ismax,ev,n1,n2,p1,p2,width,height,low,high,mode);\r\n\t \r\n\t Link l = new Link();\r\n\t l.compute_contours(ismax,ev,n1,n2,p1,p2,k[0],k[1],contours,num_result,sigma,\r\n\t extend_lines,(int)mode,low,high,width,height,junctions);\r\n\t Width w = new Width();\r\n\t if (compute_width)\r\n\t w.compute_line_width(k[0],k[1],width,height,sigma,mode,correct_pos,contours,\r\n\t num_result);\r\n\r\n\t}", "private void prepare()\n {\n addObject(new TempoLimite(), 432, 207);\n addObject(new NumeroVidas(), 395, 278);\n\n Cliqueparajogar clique = new Cliqueparajogar();\n addObject(clique, getWidth()/2, getHeight()/2);\n\n Som som = new Som();\n addObject(som, getWidth() - 37, getHeight()-57);\n \n umMin ummin = new umMin();\n addObject(ummin,630,206);\n\n doisMin doismin = new doisMin();\n addObject(doismin,670,206);\n \n tresMin tresmin = new tresMin();\n addObject(tresmin,710,206);\n \n quatroMin quatromin = new quatroMin();\n addObject(quatromin,750,206);\n \n cincoMin cincomin = new cincoMin();\n addObject(cincomin,790,206);\n \n umaVida umavida = new umaVida();\n addObject(umavida,630,280);\n \n duasVidas duasvidas = new duasVidas();\n addObject(duasvidas,670,280);\n \n tresVidas tresvidas = new tresVidas();\n addObject(tresvidas,710,280);\n \n quatroVidas quatrovidas = new quatroVidas();\n addObject(quatrovidas,750,280);\n \n cincoVidas cincovidas = new cincoVidas();\n addObject(cincovidas,790,280);\n \n voltaratras voltar = new voltaratras();\n addObject(voltar, getWidth() -37, 428);\n }", "public Cromosoma[] generarSegmentos(Cromosoma[] poblacion, Evaluador evaluador, boolean mejora) {\r\n\t\tdouble puntAcumulada = 0.0; //puntuacion acumulada\r\n\t\tdouble sumaAptitud = 0.0; //suma de la aptitud\r\n\t\tint tamañoPoblacion = poblacion.length;\r\n\t\t\r\n\t\t//ordenamos la poblacion de peor a mejor aptitud.\r\n\t\tpoblacion = Ordenacion.sortSelectionIndividuals(poblacion, evaluador);\r\n\t\t\t\t\r\n\t\tdouble[] aptitudesEscaladas = new double[poblacion.length];\r\n\t\tdouble a = (C-1)*Poblacion.mediaPoblacionInstantanea(poblacion)/(Poblacion.mejorPoblacionInstantanea(poblacion, evaluador).getAptitud()-Poblacion.mediaPoblacionInstantanea(poblacion));\r\n\t\tdouble b = Poblacion.mediaPoblacionInstantanea(poblacion)*(1-a);\r\n\t\t\r\n\t\tfor(int i = 0; i<tamañoPoblacion; i++){\r\n\t\t\taptitudesEscaladas[i] = a*poblacion[i].getAptitud()+b;\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\tdouble[] aptitudesPositivas = new double[tamañoPoblacion];\r\n\t\tfor (int i = 0; i< tamañoPoblacion; i++){\r\n\t\t\t\tdouble aptitudPositivaI = poblacion[i].getAptitud();\r\n\t\t\t\taptitudesPositivas[i] = aptitudPositivaI;\r\n\t\t}\r\n\t\t\r\n\t\t//si el problema es de minimizacion, debemos asignar mejores puntuaciones a los individuos con\r\n\t\t//menor aptitud luego transformamos el problema de minimizacion en un problema de maximizacion\r\n\t\tdouble[] aptitudesMaximizadas = new double[aptitudesPositivas.length];\r\n\t\tif(mejora)\r\n\t\t\taptitudesMaximizadas = evaluador.transformarAptitudesAMaximizacion(aptitudesEscaladas);\r\n\t\telse \r\n\t\t\taptitudesMaximizadas = evaluador.transformarAptitudesAMaximizacion(aptitudesPositivas);\r\n\t\taptitudesPositivas = aptitudesMaximizadas;\r\n\t\t\r\n\t\t//calculamos la suma de las aptitudes\r\n\t\tfor (int i = 0; i< aptitudesPositivas.length; i++){\r\n\t\t\tsumaAptitud += aptitudesPositivas[i];\r\n\t\t}\r\n\t\t//calculo de puntuaciones y puntuaciones acumuladas\r\n\t\tfor (int i = 0; i< tamañoPoblacion; i++){\r\n\t\t\t\r\n\t\t\tdouble aptitudI = aptitudesPositivas[i];\r\n\t\t\t\r\n\t\t\tpoblacion[i].setPuntuacion(aptitudI/sumaAptitud);\r\n\t\t\tdouble acumulacion = poblacion[i].getPuntuacion() + puntAcumulada;\r\n\t\t\tpoblacion[i].setPuntuacionAcumulada(acumulacion);\r\n\t\t\tpuntAcumulada = acumulacion;\r\n\t\t}\r\n\t\treturn poblacion;\r\n\t}", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public void updateSegment() {\n\t\tint i = curSeg * 2;\n\t\tint iChange = 2;\n\t\tint seg = i;\n\t\toldSeg = curSeg;\n\t\t\n\t\t// This variable is needed to keep looking even though a segment change\n\t\t// has been found. This is needed since the car could possibly pass\n\t\t// through multiple segments in one frame.\n\t\tboolean intersectionFound = false;\n\t\t// The algorithm needs to look at the start segment and the one before it.\n\t\tboolean startDone = false;\n\t\t\n\t\twhile (true) {\n\t\t\tif (i < 0) i = segments.size() + i;\n\t\t\telse if (i >= segments.size()) i = 0;\n\t\t\t\n\t\t\tif (Intersector.intersectSegments(oldPos, pos,\n\t\t\t\t\t segments.get(i), segments.get(i+1), null)) {\n\t\t\t\tintersectionFound = true;\n\t\t\t\tseg = i;\n\t\t\t} else {\n\t\t\t\t// Even though this segment didn't intersect, the previous one did.\n\t\t\t\tif (intersectionFound) break;\n\t\t\t\t// Change direction and check the segment before this one next iteration.\n\t\t\t\telse if (!startDone){\n\t\t\t\t\tstartDone = true;\n\t\t\t\t\tiChange = -2;\n\t\t\t\t} \n\t\t\t\t// No new segment was found.\n\t\t\t\telse break;\n\t\t\t}\n\t\t\ti += iChange;\n\t\t}\n\t\t\n\t\tif (intersectionFound && !startDone) {\n\t\t\tseg +=2;\n\t\t\tif (seg >= segments.size()) seg = 0;\n\t\t}\n\t\tcurSeg = seg/2;\n\t\t\n\t\t// Update the distance to segment.\n\t\tdistToSeg = Intersector.distanceSegmentPoint(segments.get(seg), segments.get(seg+1), pos);\n\t\t\n\t\tif (oldSeg != curSeg || longestDist == 0) {\n\t\t\tlongestDist = distToSeg;\n\t\t}\n\t}", "private interface Segment {\n\t\tpublic Type type();\n\t\tpublic GJPoint2D[] controlPoints();\n\t\tpublic GJSmoothCurve2D asCurve(GJPoint2D lastControl, GJPoint2D lastStart);\n\t\t/**\n\t\t * Returns the last control point of the segment, or null if the\n\t\t * segment type is CLOSE.\n\t\t */\n\t\tpublic GJPoint2D lastControl();\n\t\tpublic void updatePath(Path2D path);\n\t}", "public void borra() {\n dib.borra();\n dib.dibujaImagen(limiteX-60,limiteY-60,\"tierra.png\");\n dib.pinta(); \n }", "interface Segment {\n /**\n * @return the start value.\n */\n Object[] getStart();\n\n /**\n * @return set end value.\n */\n Object[] getEnd();\n\n /**\n * Computes this segment's length\n */\n float getLength();\n\n /**\n * Collapses this segment with the one passed as a parameter.\n * Note that if the input segment is not of the same class\n * as this one, an IllegalArgumentException is thrown. The \n * method also throws an exception if the input segment's\n * end does not have the same number of components as this \n * segment's end.\n *\n * After this method is called, this segment's end value\n * is the one of the input <code>seg</code> parameter.\n *\n * @param seg the Segment to collapse with this one.\n * @param anim the Animation this segment is part of.\n */\n void collapse(Segment seg, Animation anim);\n\n /**\n * Adds the input value to this Segment's end value.\n * \n * @param by the value to add. Throws IllegalArgumentException if this\n * Segment type is not additive or if the input value is incompatible (e.g.,\n * different number of components or different number of dimensions on a\n * component).\n */\n void addToEnd(Object[] by);\n\n /**\n * @return true if this segment type supports addition. false\n * otherwise.\n */\n boolean isAdditive();\n\n /**\n * Sets the start value to its notion of 'zero'\n */\n void setZeroStart();\n\n /**\n * Sets the start value. \n *\n * @param newStart the new segment start value.\n */\n void setStart(Object[] newStart);\n\n /**\n * Should be called after the segment's configuration is complete\n * to give the segment's implementation a chance to initialize \n * internal data and cache values.\n */\n void initialize();\n}", "@Override\r\n public void moverAyuda() {\n System.out.println(\"La reina puede mover hacia cualquier dirección en linea recta / diagonal\");\r\n }", "protected void create() {\n\t\t_segments = _geneticCode.getNGenes() * _geneticCode.getSymmetry();\n\t\t_segColor = new Color[_segments];\n\t\tfor (int i = 0; i < _segments; i++)\n\t\t\t_segColor[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getColor();\n\t\t_segBranch = new int[_segments];\n\t\tfor (int j = 0; j < _segments; j++)\n\t\t\t_segBranch[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getBranch();\n\t\t_segredReaction = new int[_segments];\n\t\tfor (int a = 0; a < _segments; a++)\n\t\t\t_segredReaction[a] = _geneticCode.getGene(a%_geneticCode.getNGenes()).getredReaction();\n\t\t_seggreenReaction = new int[_segments];\n\t\tfor (int b = 0; b < _segments; b++)\n\t\t\t_seggreenReaction[b] = _geneticCode.getGene(b%_geneticCode.getNGenes()).getgreenReaction();\n\t\t_segblueReaction = new int[_segments];\n\t\tfor (int c = 0; c < _segments; c++)\n\t\t\t_segblueReaction[c] = _geneticCode.getGene(c%_geneticCode.getNGenes()).getblueReaction();\n\t\t_segplagueReaction = new int[_segments];\n\t\tfor (int d = 0; d < _segments; d++)\n\t\t\t_segplagueReaction[d] = _geneticCode.getGene(d%_geneticCode.getNGenes()).getplagueReaction();\n\t\t_segwhiteReaction = new int[_segments];\n\t\tfor (int e = 0; e < _segments; e++)\n\t\t\t_segwhiteReaction[e] = _geneticCode.getGene(e%_geneticCode.getNGenes()).getwhiteReaction();\n\t\t_seggrayReaction = new int[_segments];\n\t\tfor (int f = 0; f < _segments; f++)\n\t\t\t_seggrayReaction[f] = _geneticCode.getGene(f%_geneticCode.getNGenes()).getgrayReaction();\n\t\t_segdefaultReaction = new int[_segments];\n\t\tfor (int g = 0; g < _segments; g++)\n\t\t\t_segdefaultReaction[g] = _geneticCode.getGene(g%_geneticCode.getNGenes()).getdefaultReaction();\n\t\t_segmagentaReaction = new int[_segments];\n\t\tfor (int h = 0; h < _segments; h++)\n\t\t\t_segmagentaReaction[h] = _geneticCode.getGene(h%_geneticCode.getNGenes()).getmagentaReaction();\n\t\t_segpinkReaction = new int[_segments];\n\t\tfor (int i = 0; i < _segments; i++)\n\t\t\t_segpinkReaction[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getpinkReaction();\n\t\t_segcoralReaction = new int[_segments];\n\t\tfor (int j = 0; j < _segments; j++)\n\t\t\t_segcoralReaction[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getcoralReaction();\n\t\t_segorangeReaction = new int[_segments];\n\t\tfor (int k = 0; k < _segments; k++)\n\t\t\t_segorangeReaction[k] = _geneticCode.getGene(k%_geneticCode.getNGenes()).getorangeReaction();\n\t\t_segbarkReaction = new int[_segments];\n\t\tfor (int l = 0; l < _segments; l++)\n\t\t\t_segbarkReaction[l] = _geneticCode.getGene(l%_geneticCode.getNGenes()).getbarkReaction();\n\t\t_segvioletReaction = new int[_segments];\n\t\tfor (int m = 0; m < _segments; m++)\n\t\t\t_segvioletReaction[m] = _geneticCode.getGene(m%_geneticCode.getNGenes()).getvioletReaction();\n\t\t_segvirusReaction = new int[_segments];\n\t\tfor (int n = 0; n < _segments; n++)\n\t\t\t_segvirusReaction[n] = _geneticCode.getGene(n%_geneticCode.getNGenes()).getvirusReaction();\n\t\t_segmaroonReaction = new int[_segments];\n\t\tfor (int o = 0; o < _segments; o++)\n\t\t\t_segmaroonReaction[o] = _geneticCode.getGene(o%_geneticCode.getNGenes()).getmaroonReaction();\n\t\t_segoliveReaction = new int[_segments];\n\t\tfor (int p = 0; p < _segments; p++)\n\t\t\t_segoliveReaction[p] = _geneticCode.getGene(p%_geneticCode.getNGenes()).getoliveReaction();\n\t\t_segmintReaction = new int[_segments];\n\t\tfor (int q = 0; q < _segments; q++)\n\t\t\t_segmintReaction[q] = _geneticCode.getGene(q%_geneticCode.getNGenes()).getmintReaction();\n\t\t_segcreamReaction = new int[_segments];\n\t\tfor (int r = 0; r < _segments; r++)\n\t\t\t_segcreamReaction[r] = _geneticCode.getGene(r%_geneticCode.getNGenes()).getcreamReaction();\n\t\t_segspikeReaction = new int[_segments];\n\t\tfor (int s = 0; s < _segments; s++)\n\t\t\t_segspikeReaction[s] = _geneticCode.getGene(s%_geneticCode.getNGenes()).getspikeReaction();\n\t\t_seglightblueReaction = new int[_segments];\n\t\tfor (int t = 0; t < _segments; t++)\n\t\t\t_seglightblueReaction[t] = _geneticCode.getGene(t%_geneticCode.getNGenes()).getlightblueReaction();\n\t\t_segochreReaction = new int[_segments];\n\t\tfor (int u = 0; u < _segments; u++)\n\t\t\t_segochreReaction[u] = _geneticCode.getGene(u%_geneticCode.getNGenes()).getochreReaction();\n\t\t_seglightbrownReaction = new int[_segments];\n\t\tfor (int v = 0; v < _segments; v++)\n\t\t\t_seglightbrownReaction[v] = _geneticCode.getGene(v%_geneticCode.getNGenes()).getlightbrownReaction();\n\t\t_segbrownReaction = new int[_segments];\n\t\tfor (int w = 0; w < _segments; w++)\n\t\t\t_segbrownReaction[w] = _geneticCode.getGene(w%_geneticCode.getNGenes()).getbrownReaction();\n\t\t_segsickReaction = new int[_segments];\n\t\tfor (int x = 0; x < _segments; x++)\n\t\t\t_segsickReaction[x] = _geneticCode.getGene(x%_geneticCode.getNGenes()).getsickReaction();\n\t\t_segskyReaction = new int[_segments];\n\t\tfor (int y = 0; y < _segments; y++)\n\t\t\t_segskyReaction[y] = _geneticCode.getGene(y%_geneticCode.getNGenes()).getskyReaction();\n\t\t_seglilacReaction = new int[_segments];\n\t\tfor (int z = 0; z < _segments; z++)\n\t\t\t_seglilacReaction[z] = _geneticCode.getGene(z%_geneticCode.getNGenes()).getlilacReaction();\n\t\t_segiceReaction = new int[_segments];\n\t\tfor (int a = 0; a < _segments; a++)\n\t\t\t_segiceReaction[a] = _geneticCode.getGene(a%_geneticCode.getNGenes()).geticeReaction();\n\t\t_segsilverReaction = new int[_segments];\n\t\tfor (int b = 0; b < _segments; b++)\n\t\t\t_segsilverReaction[b] = _geneticCode.getGene(b%_geneticCode.getNGenes()).getsilverReaction();\n\t\t_segfireReaction = new int[_segments];\n\t\tfor (int c = 0; c < _segments; c++)\n\t\t\t_segfireReaction[c] = _geneticCode.getGene(c%_geneticCode.getNGenes()).getfireReaction();\n\t\t_segfriendReaction = new int[_segments];\n\t\tfor (int d = 0; d < _segments; d++)\n\t\t\t_segfriendReaction[d] = _geneticCode.getGene(d%_geneticCode.getNGenes()).getfriendReaction();\n\t\t_seggreenbrownReaction = new int[_segments];\n\t\tfor (int e = 0; e < _segments; e++)\n\t\t\t_seggreenbrownReaction[e] = _geneticCode.getGene(e%_geneticCode.getNGenes()).getgreenbrownReaction();\n\t\t_segspikepointReaction = new int[_segments];\n\t\tfor (int f = 0; f < _segments; f++)\n\t\t\t_segspikepointReaction[f] = _geneticCode.getGene(f%_geneticCode.getNGenes()).getspikepointReaction();\n\t\t_startPointX = new int[_segments];\n\t\t_startPointY = new int[_segments];\n\t\t_endPointX = new int[_segments];\n\t\t_endPointY = new int[_segments];\n\t\t_m1 = new double[_segments];\n\t\t_m2 = new double[_segments];\n\t\t_m = new double[_segments];\n\t\t_mphoto = new double[_segments];\n\t\tx1 = new int[_segments];\n\t\ty1 = new int[_segments];\n\t\tx2 = new int[_segments];\n\t\ty2 = new int[_segments];\n\t}", "public void morir()\r\n\t{\r\n\t\tif(this.grafico != null)\t\r\n\t\t\tthis.mover(4);\r\n\t}", "private void paintCourbeLie() {\n\t\tfloat x, y, yPrec = parent.getY(0);\n\t\tint j=0, jPrec = (int) axis.getY();\n\t\t\n\t\tfor(int i=(int) axis.getX()-1; i>0; i--) { //Dessine la courbe precedant l'origine\n\t\t\tx = (float) ((i-axis.getX())/(pointsParX));\n\t\t\ty = parent.getY(x);\n\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\tj = convertY(y);\n\t\t\t\n\t\t\t\tpaintPointInColor(i, j);\n\t\t\t\t\n\t\t\t\tif(j != jPrec-1 && j != jPrec+1) //Si il y a un espacement entre ce point et le dernier point dessine\n\t\t\t\t\ttraceLink(i, j, i-1, jPrec); //on trace une ligne entre ces deux points\n\t\t\t\t\n\t\t\t\tjPrec = j;\n\t\t\t}\n\t\t\t\n\t\t\telse if(y > yMax && yPrec < yMax) //Trace la courbe jusqu'en haut si le point sort de l'affichage\n\t\t\t\ttraceLink(i, 1, i-1, jPrec);\n\t\t\t\t\n\t\t\telse if(y < yMin && yPrec > yMin) //Trace la courbe jusqu'en bas si le point sort de l'affichage\n\t\t\t\ttraceLink(i, height-1, i-1, jPrec);\n\n\t\t\tyPrec = y;\n\t\t}\n\t\t\n\t\tyPrec = parent.getY(0);\n\t\tjPrec = (int) axis.getY();\n\t\t\n\t\tfor(int i=(int) axis.getX(); i<width; i++) { //Dessine la courbe suivant l'origine\n\t\t\tx = (float) ((i-axis.getX())/(pointsParX));\n\t\t\ty = parent.getY(x);\n\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\tj = convertY(y);\n\t\t\t\n\t\t\t\tpaintPointInColor(i, j);\n\t\t\t\t\n\t\t\t\tif(j != jPrec-1 && j != jPrec+1)\n\t\t\t\t\ttraceLink(i, j, i-1, jPrec);\n\t\t\t\t\n\t\t\t\tjPrec = j;\n\t\t\t}\n\t\t\t\n\t\t\telse if(y > yMax && yPrec < yMax)\n\t\t\t\ttraceLink(i, 1, i-1, jPrec);\n\n\t\t\telse if(y < yMin && yPrec > yMin)\n\t\t\t\ttraceLink(i, height-1, i-1, jPrec);\n\t\t\t\t\n\t\t\tyPrec = y;\n\t\t}\n\t}", "@Override\n void drawShape(BufferedImage image, int color) {\n Point diem2 = new Point(diem.getX()+canh, diem.getY());\n Point td = new Point(diem.getX()+canh/2, diem.getY());\n \n \n Point dinh = new Point(td.getX(), td.getY()+h);\n \n Point diem_thuc = Point.convert(diem);\n Point diem_2_thuc = Point.convert(diem2);\n Point dinh_thuc = Point.convert(dinh);\n Point td_thuc = Point.convert(td);\n \n Line canh1=new Line(dinh_thuc, diem_thuc);\n canh1.drawShape(image, ColorConstant.BLACK_RGB);\n Line canh2=new Line(diem_thuc, diem_2_thuc);\n canh2.drawShape(image, ColorConstant.BLACK_RGB);\n Line canh3=new Line(diem_2_thuc, dinh_thuc);\n canh3.drawShape(image, ColorConstant.BLACK_RGB);\n int k =5;\n for(int i =canh1.getPoints().size()-5;i>=5;i--){\n \n for(int j = 0;j<canh*5/2-5;j++){\n \n Point ve = new Point(td_thuc.getX()-canh*5/2+j+5, td_thuc.getY()-k);\n if(ve.getX()>canh1.getPoints().get(i).getX()+5){\n Point.putPoint(ve, image, color);\n }\n }\n k++;\n }\n k=5;\n for(int i =canh3.getPoints().size()-5;i>=5;i--){\n \n for(int j = 0;j<canh*5/2-5;j++){\n Point ve = null;\n \n ve = new Point(td_thuc.getX()+canh*5/2-j-5, td_thuc.getY()-k);\n if(ve.getX()<canh3.getPoints().get(i).getX()-5){\n Point.putPoint(ve, image, color);\n }\n }\n k++;\n }\n }", "private void BajarPiezaRapido() {\n if (!Mover(piezaActual, posicionX, posicionY - 1)) {\r\n BajarPieza1posicion();\r\n }\r\n }", "private void addSegment(Point p0, Point p1) {\n resize(nOfSegs + 1);\n segments[nOfSegs++] = new LineSegment(p0, p1);\n }", "public void segment(int K) //K is the number of desired segments\n {\n if(K<2)\n {\n throw new IllegalArgumentException(new String(\"! Error: K should be greater than 1, current K=\"+K));\n }\n\n int width = this.image.getWidth();\n int height = this.image.getHeight();\n\n //Todo: Your code here (remove this line)\n \n //Hint: the algorithm is not fast and you are processing many pixels \n // (e.g., 10,000 pixel for a small 100 by 100 image)\n // output a \".\" every 100 unions so you get some progress updates.\n }", "private void aggiornaContiFiglioRicorsivamente(Conto contoPadre) {\n\t\tString methodName = \"aggiornaContiFiglioRicorsivamente\";\n\t\tcontoPadre.setDataInizioValiditaFiltro(this.conto.getDataInizioValidita());\n\t\t\n\t\tListaPaginata<Conto> contiFiglio = contoDad.ricercaSinteticaContoFigli(contoPadre, new ParametriPaginazione(0,Integer.MAX_VALUE));\n\t\tfor (Conto contoFiglio : contiFiglio) {\n\t\t\t\n\t\t\t//TODO aggiungere qui tutti i parametri da ribaltare sui conti figli.\n\t\t\tcontoFiglio.setAttivo(contoPadre.getAttivo()); //in analisi c'è solo questo parametro!\n\t\t\t\n\t\t\tif(isContoDiLivelloDiLegge()) {\n\t\t\t\tlog.debug(methodName, \"Conto di livello di legge: aggiorno tutti i campi del figlio \" + contoFiglio.getCodice());\n\t\t\t\t\n\t\t\t\t//TODO controllare eventuali altri parametri da ribaltare ai conti figlio.\n\t\t\t\tcontoFiglio.setElementoPianoDeiConti(contoPadre.getElementoPianoDeiConti());\n\t\t\t\tcontoFiglio.setCategoriaCespiti(contoPadre.getCategoriaCespiti());\n\t\t\t\tcontoFiglio.setTipoConto(contoPadre.getTipoConto());\n\t\t\t\tcontoFiglio.setTipoLegame(contoPadre.getTipoLegame());\n\t\t\t\tcontoFiglio.setContoAPartite(contoPadre.getContoAPartite());\n\t\t\t\tcontoFiglio.setContoDiLegge(contoPadre.getContoDiLegge());\n\t\t\t\tcontoFiglio.setCodiceBilancio(contoPadre.getCodiceBilancio());\n\t\t\t\tcontoFiglio.setContoCollegato(contoPadre.getContoCollegato());\n\t\t\t} else {\n\t\t\t\tlog.debug(methodName, \"Conto NON di livello di legge: aggiorno solo il flag Attivo del figlio \" + contoFiglio.getCodice());\n\t\t\t}\n\t\t\t\n\t\t\tcontoDad.aggiornaConto(contoFiglio);\n\t\t\tlog.debug(methodName, \"Aggiornato conto figlio: \"+ contoFiglio.getCodice());\n\t\t\taggiornaContiFiglioRicorsivamente(contoFiglio);\n\t\t}\n\t}", "private void paintCourbePoints() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) {\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\t//Utilisation d'un carre/losange pour simuler un point \n\t\t\t\t//de taille superieur a un pixel car celui-ci est peu visible.\n\t\t\t\tpaintPointInColor(i-2, j);\n\t\t\t\tpaintPointInColor(i-1, j-1);\t\t\t\t\n\t\t\t\tpaintPointInColor(i-1, j);\n\t\t\t\tpaintPointInColor(i-1, j+1);\n\t\t\t\tpaintPointInColor(i, j-2);\t//\t *\n\t\t\t\tpaintPointInColor(i, j-1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j);\t//\t* * * * *\n\t\t\t\tpaintPointInColor(i, j+1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j+2);\t//\t *\n\t\t\t\tpaintPointInColor(i+1, j-1);\n\t\t\t\tpaintPointInColor(i+1, j);\n\t\t\t\tpaintPointInColor(i+1, j+1);\n\t\t\t\tpaintPointInColor(i+2, j);\n\t\t\t}\n\t\t}\t\t\n\t}", "public Contrareloj(int opc,int min,int seg) {\r\n super.opc=opc;\r\n this.opc=opc;\r\n this.seg=seg;\r\n this.min=min;\r\n inicializar1();\r\n llenar();\r\n inicializar2();\r\n juego();\r\n }", "public int[][] RdB() {\t\t\t\t\t\t\t\t// cherche les 4 points noirs\n\t\tint[][] pixNoirs = new int[img.getWidth()*img.getHeight()][2];\n\n\t\tint i=0;\n\t\tint radius=8;\t\t\t\t\t\t\t\t\t// 19= limite de detection de checkCircle\n\t\tfor (int ty=0; ty<img.getHeight();ty++) {\n\t\t\tfor (int tx=0;tx<img.getWidth();tx++) {\n\n\t\t\t\tColor tmp=new Color(img.getRGB(tx, ty));\n\t\t\t\tif (tmp.getGreen()<20) { \t\t\t\t//si le pixel est noir\n\t\t\t\t\tif (checkCircle(tx,ty,radius) ) {\t//verifie si un cercle de radius entoure le pixel\n\t\t\t\t\t\tpixNoirs[i][0]=tx;\n\t\t\t\t\t\tpixNoirs[i][1]=ty;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"fin\");\n\t\tint tmp=1;\n\t\tint centreX[][]=new int [img.getWidth()*img.getHeight()][2];\n\t\tcentreX[0]=pixNoirs[0];\n\t\tfor (int l=0;l<img.getHeight()*img.getWidth() && (pixNoirs[l][1]!=0 || pixNoirs[l][0]!=0);l++) {\n\t\t\tif((pixNoirs[l][0]-centreX[tmp-1][0])<5 || pixNoirs[l][1]-centreX[tmp-1][1]<5 ){\t\t//x-(x-1)>5 ou y-(y-1)>5\n\t\t\t\tcentreX[tmp][0]=pixNoirs[l][0];\t\t\t//efface le precedent roar2 si il était a 1 pixel de diff\n\t\t\t\tcentreX[tmp][1]=pixNoirs[l][1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttmp++;\n\t\t\t\tcentreX[tmp]=pixNoirs[l];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//boucle de determination des points noirs\n\t\t//System.out.println(\"roar2debut\");\n\t\tint points[][]=new int [4][2];\n\t\tint centres[][]=new int [centreX.length][2]; int boucl=0; int lasti=0;\n\t\tint t=0;\n\t\tfor (int l=1;l<=img.getHeight()*img.getWidth() && (centreX[l-1][1]!=0 || centreX[l-1][0]!=0);l++) {\n\n\n\t\t\t\n\t\t\tint diffx=centreX[l][0]-centreX[l-1][0];\n\t\t\tint diffy=centreX[l][1]-centreX[l-1][1];\n\t\t\tint diff=Math.abs(diffx)+Math.abs(diffy);\n\t\t\tif (diff>img.getWidth()*0.85)\n\t\t\t{\n\t\t\t\tpoints[t]=centreX[l];\n\t\t\t\tt++;\n\t\t\t}\n\t\t\t\n\t\t\tif (diffx<10 && diffy<10) {\n\t\t\t\tboucl++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcentres[lasti][0]=centreX[l-boucl/2][0];\n\t\t\t\tcentres[lasti][1]=centreX[l-boucl/2][1];\n\t\t\t\tlasti++;boucl=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tfor (int l=0;l<=centres.length && (centres[l][1]!=0 || centres[l][0]!=0);l++) {\t\n\t\t\tboolean test=true;\n\t\t\tint maxPoint=0;\n\t\t\tfor (int li=0;li<=points.length && (points[li][1]!=0 || points[li][0]!=0);li++) {\n\t\t\t\tint diffx=\tMath.abs(centres[l][0]-points[li][0]);\n\t\t\t\tint diffy=\tMath.abs(centres[l][1]-points[li][1]);\n\t\t\t\tboolean testx=\t\tdiffx>img.getWidth()*0.85 \t|| diffx<img.getWidth()*0.2;\t//diff <0.1 ou >0.8 x la largeur de feuille\n\t\t\t\tboolean testy=\t\tdiffy>img.getHeight()*0.8 \t|| diffy<img.getWidth()*0.2;\n\t\t\t\tboolean Repeat=\tdiffx+diffy>img.getWidth()*0.2;\t //si point deja présent\n\n\t\t\t\tif (!Repeat || (!testx || !testy) )\t// si 0.2>diffx>0.8 ou \"diffy\" et \n\t\t\t\t{\n\t\t\t\t\ttest=false;\n\t\t\t\t}\n\t\t\t\tmaxPoint=li;\n\t\t\t}\n\t\t\t\n\t\t\tif(test && maxPoint<2) {\n\t\t\t\t//System.out.println(lastRoar[l][0]+\" \"+lastRoar[l][1]);\n\t\t\t\tpoints[maxPoint+1][0]=centres[l][0];\n\t\t\t\tpoints[maxPoint+1][1]=centres[l][1];\n\t\t\t}\n\t\t}\n\t\treturn points;\n\n\t}", "public void statoIniziale()\n {\n int r, c;\n for (r=0; r<DIM_LATO; r++)\n for (c=0; c<DIM_LATO; c++)\n {\n if (eNera(r,c))\n {\n if (r<3) // le tre righe in alto\n contenutoCaselle[r][c] = PEDINA_NERA;\n else if (r>4) // le tre righe in basso\n contenutoCaselle[r][c] = PEDINA_BIANCA;\n else contenutoCaselle[r][c] = VUOTA; // le 2 righe centrali\n }\n else contenutoCaselle[r][c] = VUOTA; // caselle bianche\n }\n }", "private void balancearElimina(Vertice<T> v){\n\t//Caso 1 RAIZ\n\tif(v.padre == null){\n\t this.raiz = v;\n\t v.color = Color.NEGRO;\n\t return;\n\t}\n\t//Vertice<T> hermano = getHermano(v);\n\t//Caso 2 HERMANO ROJO\n\tif(getHermano(v).color == Color.ROJO){\n\t v.padre.color = Color.ROJO;\n\t getHermano(v).color = Color.NEGRO;\n\t if(v.padre.izquierdo == v)\n\t\tsuper.giraIzquierda(v.padre);\n\t else\n\t\tsuper.giraDerecha(v.padre);\n\t //Actualizar V\n\t // hermano = getHermano(v);\n\t \n\t}\n\t//Caso 3 TODOS SON NEGROS\n\tif(v.padre.color == Color.NEGRO && existeNegro(getHermano(v)) && existeNegro(getHermano(v).izquierdo) && existeNegro(getHermano(v).derecho)){\n\t getHermano(v).color = Color.ROJO;\n\t //Checar color\n\t //v.color = Color.ROJO; //POR H DE HERMANO 20:00\n\t\tbalancearElimina(v.padre);\n\t\treturn;\n\t}\n\t//Caso 4 HERMANO Y SOBRINOS NEGROS Y PADRE ROJO\n\tif(existeNegro(getHermano(v)) && v.padre.color == Color.ROJO && existeNegro(getHermano(v).izquierdo)\n\t && existeNegro(getHermano(v).derecho)){\n\t v.padre.color = Color.NEGRO;\n\t getHermano(v).color = Color.ROJO;\n\t return;\n\t \n\t}\n\t//Caso 5 HERMANO NEGRO Y SOBRINOS BICOLORES\n\tif(getHermano(v).color == Color.NEGRO && (!(existeNegro(getHermano(v).izquierdo) && existeNegro(getHermano(v).derecho)))){\n\t if(v.padre.derecho == v){\n\t if(!existeNegro(getHermano(v).derecho)){\n\t\t getHermano(v).color = Color.ROJO;\n\t\t getHermano(v).derecho.color = Color.NEGRO;\n\t\t super.giraIzquierda(getHermano(v));\n\t }else{\n\t\t if(!existeNegro(getHermano(v).izquierdo)){\n\t\t getHermano(v).color = Color.ROJO;\n\t\t getHermano(v).izquierdo.color = Color.NEGRO;\t \n\t\t super.giraDerecha(getHermano(v));\n\t\t }\n\t }\n\t }\n\t}\n\t//Caso 6 SOBRINO INVERSO DE V ES ROJO\n\tif(v.padre.izquierdo == v){\n\t if(!existeNegro(getHermano(v).derecho)){\n\t\tgetHermano(v).color = v.padre.color;\n\t\t v.padre.color = Color.NEGRO;\n\t\t getHermano(v).derecho.color = Color.NEGRO;\n\t\t super.giraIzquierda(v.padre);\n\t }\n\t}else{\n\t if(!existeNegro(getHermano(v).izquierdo)){\n\t\tgetHermano(v).color = v.padre.color;\n\t\t v.padre.color = Color.NEGRO;\n\t\t getHermano(v).izquierdo.color = Color.NEGRO;\n\t\t super.giraDerecha(v.padre);\n\t }\n\t}\t\n }", "public void stampaScacchiera(String titolo)\n {\n System.out.println(titolo);\n System.out.println(\"=== Scacchiera \" +DIM_LATO+ \"x\" +DIM_LATO+ \" ===\");\n int r,c;\n for (r=0; r<DIM_LATO; r++)\n {\n for (c=0; c<DIM_LATO; c++) System.out.print(\"--\");\n System.out.println(\"-\");\n for (c=0; c<DIM_LATO; c++)\n {\n switch (contenuto(r,c))\n {\n case PEDINA_BIANCA: System.out.print(\"|b\"); break;\n case PEDINA_NERA: System.out.print(\"|n\"); break; \n case DAMA_BIANCA: System.out.print(\"|B\"); break; \n case DAMA_NERA: System.out.print(\"|N\"); break; \n case VUOTA: System.out.print(\"| \"); break;\n }\n }\n System.out.println(\"|\");\n }\n for (c=0; c<DIM_LATO; c++) System.out.print(\"--\");\n System.out.println(\"-\");\n }", "public static void CBD(GrafoMatriz G, GrafoMatriz Gaux, ArrayList<ListaEnlazadaAsignadas> lea, int[][] selectos, int capacidad){\n \n Utilitarios.cargarEnGrafo(G,Gaux,capacidad);\n for (int i=0; i<selectos.length; i++){\n Utilitarios.borrarCaminos(Gaux,selectos[i][1], lea, capacidad);\n }\n ListaEnlazada [] ksp;\n Resultado r;\n Resultado [] results = new Resultado[selectos.length];\n Demanda d;\n for (int i=0; i<selectos.length; i++){\n d = lea.get(selectos[i][1]).getDemanda();\n \n ksp = Utilitarios.KSP(Gaux, d.getOrigen(), d.getDestino(), 5);\n r = Utilitarios.buscarEspacioCBD(ksp, d, selectos[i][0], Gaux, capacidad);\n if (r!=null){\n Utilitarios.asignarFS_Defrag(ksp,r,Gaux,d,-1);\n results[i] = r;\n }else{\n results[i] = new Resultado();\n results[i].setCamino(-1);\n }\n }\n \n for (int i=0; i<results.length; i++){\n if (results[i].getCamino()!=-1){\n //Utilitarios.borrarCaminos(G, selectos[i], lea, capacidad);\n \n d = lea.get(selectos[i][1]).getDemanda();\n ksp = Utilitarios.KSP(G, d.getOrigen(), d.getDestino(), 5);\n Utilitarios.asignarFS_saveRoute(ksp,results[i],G,d,lea, -1);\n Utilitarios.limpiarCaminoAnterior(lea.get(selectos[i][1]), G, selectos[i][1], capacidad, lea);\n //System.out.println(\"Se movio \" + selectos[i][1] + \" ahora es \" + (lea.size()-1));\n \n }\n }\n }", "Segment createSegment();", "public static void MostrarPerroSegunEstadia(Perro BaseDeDatosPerros[], int codPerro){\n String razaDeceada, razaPerro;\r\n int diasDeEstadia; \r\n razaDeceada=IngresarRazaCorrecta();\r\n \r\n for (int i = 0; i < codPerro; i++) {\r\n razaPerro=BaseDeDatosPerros[i].getRaza();\r\n diasDeEstadia=BaseDeDatosPerros[i].getCantDias();\r\n if (razaDeceada.equalsIgnoreCase(razaPerro)&&(diasDeEstadia>20)) {\r\n System.out.println(\"____________________________________________\");\r\n System.out.println(BaseDeDatosPerros[i].toString());\r\n System.out.println(\"____________________________________________\");\r\n \r\n }\r\n }\r\n \r\n }", "@Override protected boolean drivePeriodic(double distanceInches, int i) {\r\n\r\n // add your drive code here\r\n\r\n // return true when this segment is completed\r\n return false;\r\n\r\n }", "public void calculosFicha(int ficha, int fila, int columna, String mov) {\r\n this.setseMovio(true);\r\n this.setContador(0);\r\n this.setContadorMov(this.getContadorMov() - 1);\r\n\r\n int diagonalP = ficha;\r\n int horizontal = ficha;\r\n int vertical = ficha;\r\n int diagonalS = ficha;\r\n boolean arriba = true;\r\n boolean abajo = true;\r\n boolean derecha = true;\r\n boolean izquierda = true;\r\n int num = 0;\r\n while (izquierda || derecha || arriba || abajo) {\r\n num++;\r\n if (fila - num == 0) {\r\n arriba = false;\r\n }\r\n if (fila + num == 9) {\r\n abajo = false;\r\n }\r\n if (columna + num == 10) {\r\n derecha = false;\r\n }\r\n if (columna - num == 0) {\r\n izquierda = false;\r\n }\r\n\r\n if (arriba) {\r\n vertical += tablero[fila - num][columna].getValor();\r\n }\r\n if (abajo) {\r\n vertical += tablero[fila + num][columna].getValor();\r\n }\r\n if (derecha) {\r\n horizontal += tablero[fila][columna + num].getValor();\r\n }\r\n if (izquierda) {\r\n horizontal += tablero[fila][columna - num].getValor();\r\n }\r\n if (arriba && izquierda) {\r\n diagonalP += tablero[fila - num][columna - num].getValor();\r\n }\r\n if (arriba && derecha) {\r\n diagonalS += tablero[fila - num][columna + num].getValor();\r\n }\r\n if (abajo && izquierda) {\r\n diagonalS += tablero[fila + num][columna - num].getValor();\r\n }\r\n if (abajo && derecha) {\r\n diagonalP += tablero[fila + num][columna + num].getValor();\r\n }\r\n\r\n }\r\n\r\n Arrays.fill(movimientos, false);\r\n if (vertical < 9 && vertical != ficha) {\r\n movimientos[vertical] = true;\r\n }\r\n if (horizontal < 9 && horizontal != ficha) {\r\n movimientos[horizontal] = true;\r\n }\r\n if (diagonalP < 9 && diagonalP != ficha) {\r\n movimientos[diagonalP] = true;\r\n }\r\n if (diagonalS < 9 && diagonalS != ficha) {\r\n movimientos[diagonalS] = true;\r\n }\r\n this.comprobarMov();\r\n }", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "private Vector detectCommonSegPt(Vector segVL, Stroke theStroke)\n\t{\n\t\t\n\t\tint len = theStroke.getM_ptList().size();\n\t\tint[] stk_Arr = new int[len];\n\t\tint methodCnt = segVL.size(); //number of methods used to detect seg-points. \n\n\t\t// check if accepable value is set to a reasonable vaule\n\t\tif((Prefs.getAcceptableVotes() >= 1) && (Prefs.getAcceptableVotes() <= methodCnt))\n\t\t{\n\t\t\t// set the method count to acceptable votes.\n\t\t\tmethodCnt = Prefs.getAcceptableVotes();\n\t\t}\n\t\t\n\t\t// TODO: is there a better way to do it? \n\t\t// init the array to all 0\n\t\tfor(int i=0; i<len; i++) stk_Arr[i]=0;\n\t\t\n\t\tint commonWindow = COMMON_SEG_WINDOW;\n\t\tdouble commonDistance = COMMON_SEG_DISTANCE+2;\n\t\t/* commonDistance size of anchor_point, which are end-points of segments.\n\t\t * We want to filter-out seg-points too close together and create 'large'\n\t\t * seg-points to replace them.\n\t\t */\n\t\tVector commonSegPts = new Vector();\n\t\tIterator iter = segVL.iterator();\n\t\t\n\t\t// repeat for each segmentation algorithm\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tVector element = (Vector) iter.next();\n\t\t\tIterator iterator = element.iterator();\n\t\t\tint lastUsedPos=-1;\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tInteger obj = (Integer) iterator.next(); //get the seg point index\n\t\t\t\tint index = obj.intValue();\n\t\t\t\tPixelInfo indexPt = (PixelInfo)theStroke.getM_ptList().get(index);\n\t\t\t\t\n\t\t\t\tint start = index - commonWindow;\n\t\t\t\tint end = index + commonWindow;\n\t\t\t\t// check if i is within the array bounds, if yes, increment the array,\n\t\t\t\t// make sure that one segmentation scheme increments one point only once\n\t\t\t\tstart = (start>lastUsedPos)? start:lastUsedPos+1;\n\t\t\t\tend = (end<len)? end:len-1;\n\t\t\t\tfor(int i=start; i<=end; i++)\n\t\t\t\t{\n\t\t\t\t\tPixelInfo pt = (PixelInfo)theStroke.getM_ptList().get(i);\n\t\t\t\t\tif(indexPt.distance(pt) <= commonDistance)\n\t\t\t\t\t{\n\t\t\t\t\t\tstk_Arr[i]++;\n\t\t\t\t\t\tlastUsedPos = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// find the points with more than methodCnt value\n\t\tint i = 0;\n\t\twhile(i<len)\n\t\t{\n\t\t\t// store the index as the segment point, if condition is met\n\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t{\n\t\t\t\t// find out the streak of continuous pixels\n\t\t\t\tint beginIdx = i;\n\t\t\t\tint endIdx = i;\n\t\t\t\ti++;\n\t\t\t\twhile(i<len)\n\t\t\t\t{\n\t\t\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t\t\t{\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\telse break;\n\t\t\t\t}\n\t\t\t\tendIdx = i-1;\n\t\t\t\t\n\t\t\t\t// find one point from that streak\n\t\t\t\tint segPt = 0;\n\t\t\t\t// check if the segment is very short\n\t\t\t\tif((beginIdx==0)&&(endIdx==(len-1)))\n\t\t\t\t{\n\t\t\t\t\tif(beginIdx==endIdx) commonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\telse\n\t\t\t\t\t{\t// segment is not just one point\n\t\t\t\t\t\tcommonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\t\tcommonSegPts.add(new Integer(endIdx));\n\t\t\t\t\t}\n\t\t\t\t\treturn commonSegPts;\n\t\t\t\t}\n\t\t\t\telse if(beginIdx==0) segPt = 0;\n\t\t\t\telse if(endIdx==(len-1)) segPt = endIdx;\n\t\t\t\telse segPt = (int)Math.floor((beginIdx+endIdx)/2);\n\t\t\t\t\n\t\t\t\t// add segPt to the list of detected segments.\n\t\t\t\tcommonSegPts.add(new Integer(segPt));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn commonSegPts;\n\t}", "private static int[] ubicarPosicionCero(int[][] estado) {\n\t\tfor(int i = 0 ; i < estado.length ; i++) {\n\t\t\tfor(int j = 0 ; j < estado.length ; j++) {\n\t\t\t\tif(estado[i][j]==0) {\n\t\t\t\t\tSystem.out.println(\"La posicion del espacio cero es: \"+ i +\",\"+j);\n\t\t\t\t\treturn new int[] {i,j};\n\t\t\t\t}\n\t\t\t\t//System.out.println(\"La posicion del espacio cero es: \"+ i +\",\"+j);\n\t\t\t\t//posicion[0]= i;\n\t\t\t\t//posicion[1]=j;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void disparo()\n {\n switch(this.posicion){\n case 0:\n setLocation(getX(),getY()-this.velocidadDisparo);\n break;\n case 1:\n setLocation(getX(),getY()+this.velocidadDisparo);\n break;\n case 2:\n setLocation(getX()+this.velocidadDisparo,getY());\n break;\n case 3:\n setLocation(getX()-this.velocidadDisparo,getY());\n break;\n }\n }", "private void findVOIs(short[] cm, ArrayList<Integer> xValsAbdomenVOI, ArrayList<Integer> yValsAbdomenVOI, short[] srcBuffer, ArrayList<Integer> xValsVisceralVOI, ArrayList<Integer> yValsVisceralVOI) {\r\n \r\n // angle in radians\r\n double angleRad;\r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n \r\n // the number of pixels along the radial line for a given angle\r\n int count;\r\n \r\n // The threshold value for muscle as specified in the JCAT paper\r\n int muscleThresholdHU = 16;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = cm[0];\r\n int y = cm[1];\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = cm[1] - (int)((x - cm[0]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // x, y is a candidate abdomen VOI point\r\n // if there are more abdomenTissueLabel pixels along the radial line,\r\n // then we stopped prematurely\r\n \r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = cm[0] + (int)((cm[1] - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = cm[1] - (int)((cm[0] - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = cm[0] - (int)((y - cm[1]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n }\r\n } // end for (angle = 0; ...\r\n\r\n }", "public static Solide octaedre (){\n\t\tPoint a = new Point(-25, 0,-25);\r\n\t\tPoint b = new Point(-25, 0,25);\r\n\t\tPoint c = new Point(25, 0,-25);\r\n\t\tPoint d = new Point(25,0,25);\r\n\t\t// La hauteur d'une des 2 pyramide vaut longueur d'un cote * (1/ racine de 2)\r\n\t\tfloat hauteur = (float) (50/Math.sqrt(2));\r\n\t\t// on se sert de la hauteur pour donnee les coordonees des sommets manquant\r\n\t\tPoint e = new Point(0, hauteur,0);\r\n\t\tPoint f = new Point(0,-hauteur,0);\r\n\r\n\r\n\t\tArrayList<Point> po = new ArrayList<Point>();\r\n\t\tArrayList<Arete> ar = new ArrayList<Arete>();\r\n\t\tArrayList<Face> lf = new ArrayList<Face>();\r\n\t\t\r\n\t\tPoint[][] pts = new Point[][] {\r\n\t\t\t{a, b, e}, \r\n\t\t\t{a, f, b}, \r\n\t\t\t{a, e, c},\r\n\t\t\t{a, c, f}, \r\n\t\t\t{d, c, e}, \r\n\t\t\t{d, f, c}, \r\n\t\t\t{b, d, e},\r\n\t\t\t{b, f, d}\r\n\t\t};\r\n\t\t\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\tFace h = new Face(ar);\r\n\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\tpo.add(pts[i][j]);\r\n\t\t\t}\r\n\t\t\th.face(po);\r\n\t\t\tpo.clear();\r\n\t\t\tlf.add(h);\r\n\t\t}\r\n\r\n\t\tSolide t= new Solide(lf);\r\n\t\treturn t;\r\n\t}", "public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\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}\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}", "public void checarColision()\n\t{\n\t\tListIterator <Entidad> iterator = handler.listaEntidades.listIterator();\n\t\twhile (iterator.hasNext())\n\t\t{\n\t\t\tEntidad aux = iterator.next();\n\t\t\t\n\n\t\t\t//Colision con un Enemigo\n\t\t\tif (aux instanceof Bala)\n\t\t\t{\n\t\t\t\tif (chocandoEn(x, y, aux))\n\t\t\t\t{\t\n\n\n\t\t\t\t\t\n\t\t\t\t\t//Si choca con bala eliminar bala y cambiar posicion de enemigo\n\t\t\t\t\tvelX = aux.getVelX();\n\t\t\t\t\tvelY = aux.getVelY();\n\t\t\t\t\thandler.quitarObjeto(aux);\n\t\t\t\t\tthis.vida -= 5;\n\t\t\t\t\t\n\t\t\t\t\tif(this.vida == 0)\n\t\t\t\t\t\thandler.quitarObjeto(this);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t}", "public void limpiarPuntos(Graphics g, int s){\n Color repaint = new Color(102, 102, 102);\n g.setColor(repaint);\n g.fillRect(0, 35, 550, 560);\n limpiarTabla();\n // btnSegmentos.setEnabled(false);\n if (s==1)DibujarPlano(jpPlano.getGraphics(), 1);\n else if (s==2) DibujarPlano(jpPlano.getGraphics(), 2);\n }", "public Scacchiera()\n {\n contenutoCaselle = new int[DIM_LATO][DIM_LATO];\n statoIniziale();\n }", "public void controlla_bersaglio() {\n\n if ((x[0] == bersaglio_x) && (y[0] == bersaglio_y)) {\n punti++;\n posiziona_bersaglio();\n }\n }", "public List<Integer> codificarDigitoASieteSegmentos(int numero) {\n\n\t\tList<Integer> segList = new ArrayList<>();\n\n\t\tswitch (numero) {\n\t\tcase 1:\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(4);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(2);\n\t\t\tsegList.add(7);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(4);\n\t\t\tsegList.add(7);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tsegList.add(1);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(4);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(1);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(4);\n\t\t\tsegList.add(7);\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(1);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(2);\n\t\t\tsegList.add(7);\n\t\t\tsegList.add(4);\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(4);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tsegList.add(1);\n\t\t\tsegList.add(2);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(4);\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(7);\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tsegList.add(1);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(4);\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(6);\n\t\t\tsegList.add(7);\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tsegList.add(1);\n\t\t\tsegList.add(2);\n\t\t\tsegList.add(3);\n\t\t\tsegList.add(4);\n\t\t\tsegList.add(5);\n\t\t\tsegList.add(7);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\treturn segList;\n\t}", "public void movimiento(Point inicio,Point llegada, String color, int nomFicha){\n \n /*if(this.tablero[inicio.x][inicio.y]==0){\n JOptionPane.showMessageDialog(null, \"no hay nada en esa posición\");\n }*/\n \n this.tablero[inicio.x][inicio.y]=0;\n this.tablero[llegada.x][llegada.y]=nomFicha;\n if (color==\"blanco\"){\n this.posiBlancas[inicio.x][inicio.y]=0;\n this.posiBlancas[llegada.x][llegada.y]=nomFicha;\n this.posiNegras[llegada.x][llegada.y]=0;\n }else{\n this.posiNegras[inicio.x][inicio.y]=0;\n this.posiNegras[llegada.x][llegada.y]=nomFicha;\n this.posiBlancas[llegada.x][llegada.y]=0;\n }\n\n }", "private boolean makeAbdomen2DVOI() {\r\n abdomenImage.setMask(volumeBitSet);\r\n \r\n // volumeBitSet should be set for the abdomen tissue\r\n short voiID = 0;\r\n AlgorithmVOIExtractionPaint algoPaintToVOI = new AlgorithmVOIExtractionPaint(abdomenImage,\r\n volumeBitSet, xDim, yDim, zDim, voiID);\r\n\r\n algoPaintToVOI.setRunningInSeparateThread(false);\r\n algoPaintToVOI.run();\r\n setCompleted(true);\r\n \r\n // make sure we got one VOI with one curve\r\n VOIVector vois = abdomenImage.getVOIs();\r\n if(vois.size() != 1) {\r\n System.err.println(\"makeAbdomen2DVOI() Error, did not get 1 VOI\");\r\n return false;\r\n }\r\n \r\n // abdomenImage has one VOI, lets get it\r\n VOI theVOI = vois.get(0);\r\n theVOI.setName(\"Abdomen\");\r\n\r\n // Keep only the largest VOI as the abdomen\r\n int numCurves, numRemoved = 0;\r\n numCurves = theVOI.getCurves().size();\r\n \r\n int maxIdx = 0;\r\n int maxNumPoints = ((VOIContour)theVOI.getCurves().get(maxIdx)).size();\r\n for (int idx = 1; idx < numCurves; idx++) {\r\n if (((VOIContour)theVOI.getCurves().get(idx)).size() > maxNumPoints) {\r\n maxIdx = idx;\r\n }\r\n } // end for (int idx = 0; ...)\r\n for (int idx = 0; idx < numCurves; idx++) {\r\n if (idx != maxIdx) {\r\n theVOI.getCurves().remove(idx - numRemoved);\r\n numRemoved++;\r\n }\r\n } // end for (int idx = 0; ...)\r\n \r\n abdomenVOI = theVOI;\r\n resampleAbdomenVOI();\r\n return true;\r\n }", "private void ActualizaPosicionesFondos() {\n xFondo-=10; //Es el cursor de la posición\n xFondoBase-=10; //Aqui se puede implementar metodo de modificacion de velocidad de fondo.\n xFondoApoyo-=10;\n if (xFondo == -texturaFondoBase.getWidth()){\n xFondoBase = xFondoApoyo+texturaFondoApoyo.getWidth();\n cambiosFondo++;\n }\n if (xFondo == -(texturaFondoApoyo.getWidth()+texturaFondoBase.getWidth())) {\n xFondoApoyo = xFondoBase+texturaFondoBase.getWidth();\n cambiosFondo++;\n }\n }", "private boolean colisionEstorbos(){\r\n\t\tif(game.estorbo1.getBounds().intersects(getBounds())){\r\n\t\t\tasignarVelocidad(game.estorbo1, rebotes1);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(game.estorbo2.getBounds().intersects(getBounds())){\r\n\t\t\tasignarVelocidad(game.estorbo2, rebotes2);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(game.estorbo3.getBounds().intersects(getBounds())){\r\n\t\t\tasignarVelocidad(game.estorbo3, rebotes3);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Before\n\tpublic void iniciaDisciplinaConvencional() {\n\t\tList<String> pos = new ArrayList<String>();\n\t\tList<String> pos1 = new ArrayList<String>();\n\t\tpos1.add(\"Disciplina 3\");\n\t\tpos1.add(\"Disciplina 4\");\n\t\tpos1.add(\"Disciplina 5\");\n\n\t\tminitElimBai_1 = new MinitestesEliminandoBaixa(\"Disciplina 1\", 5, pos,\n\t\t\t\t1);\n\t\tminitElimBai_2 = new MinitestesEliminandoBaixa(\"Disciplina 2\", 10,\n\t\t\t\tpos1, 2);\n\t}", "public void caricaCopione(Scena scena) {\n\t\t// recupera l'elenco delle battute\n\t\tArrayList<Battuta> copione = scena.getBattute();\n\t\taggiornaMappeColori(scena);\n\t\t// per ogni battuta\n\t\tfor (int i = 0; i < copione.size(); i++) {\n\t\t\tinvia(copione.get(i));\n\t\t}\n\t}", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "public void disparoDireccional(int tipo) {\n float x = super.getSprite().getPosicion().getX() + 48 - 58;\n float y = super.getSprite().getPosicion().getY() + 52 - 72;\n switch(tipo) {\n case 1: \n crearProyectilG(x, y, -1, -1);\n crearProyectilG(x, y, 0, -1); \n crearProyectilG(x, y, 1, -1);\n break;\n case 2:\n crearProyectilG(x, y, -1, -1);\n crearProyectilG(x, y, 0, -1); \n crearProyectilG(x, y, -1, 0);\n break;\n case 3: \n crearProyectilG(x, y, -1, -1);\n crearProyectilG(x, y, -1, 0);\n crearProyectilG(x, y, -1, 1); \n break;\n case 4:\n crearProyectilG(x, y, -1, 0); \n crearProyectilG(x, y, -1, 1);\n crearProyectilG(x, y, 0, 1);\n break;\n case 5:\n crearProyectilG(x, y, -1, 1); \n crearProyectilG(x, y, 0, 1);\n crearProyectilG(x, y, 1, 1);\n break;\n case 6:\n crearProyectilG(x, y, 0, 1); \n crearProyectilG(x, y, 1, 1);\n crearProyectilG(x, y, 1, 0);\n break;\n case 7:\n crearProyectilG(x, y, 1, -1); \n crearProyectilG(x, y, 1, 0);\n crearProyectilG(x, y, 1, 1);\n break;\n case 8:\n crearProyectilG(x, y, 0, -1); \n crearProyectilG(x, y, 1, -1);\n crearProyectilG(x, y, 1, 0);\n break;\n }\n }", "@Override\n protected List<Segment> getSegments() {\n return Arrays.asList(\n new Segment(55.2, 55.8, Color.rgb(238, 23, 104)),\n new Segment(56.2, 56.6, Color.rgb(238, 23, 104)),\n new Segment(58.4, 59.9, Color.rgb(184, 92, 184)));\n }", "boolean getSegmented();", "private void balancearAgrega(Vertice<T> v){\n\tif(v == this.raiz){\n\t v.color = Color.NEGRO;\n\t return;\n\t}else if(v.padre.getColor() == Color.NEGRO){\n\t return;\n\t}\n\tVertice<T> abuelo = v.padre.padre;\n\tif(v.padre == abuelo.derecho){\n\t if(abuelo.izquierdo != null &&\n\t abuelo.izquierdo.getColor() == Color.ROJO){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.izquierdo.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tbalancearAgrega(abuelo);\n\t\treturn;\t \n\t }else if(v.padre.izquierdo == v){\n\t\tVertice<T> v2 = v.padre;\n\t\tsuper.giraDerecha(v.padre);\n\t\tbalancearAgrega(v2); \n\t }else if(v.padre.derecho == v){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tsuper.giraIzquierda(abuelo);\n\t }\n\t}else if(v.padre == abuelo.izquierdo){\n\t if(abuelo.derecho != null &&\n\t abuelo.derecho.getColor() == Color.ROJO){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.derecho.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tbalancearAgrega(abuelo);\n\t\treturn;\n\t }else if(v.padre.derecho == v){\n\t\tVertice<T> v2 = v.padre;\n\t\tsuper.giraIzquierda(v.padre);\n\t\tbalancearAgrega(v2); \n\t \n\t }else if(v.padre.izquierdo == v){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tsuper.giraDerecha(abuelo);\n\t }\n\t} \t\n\t\n }", "private void cerca(int livello, List<Condiment> parziale, Condiment prescelto) {\n\t\tboolean trovato = false;\n\t\t\n\t\t//Prendiamo l'ultimo coindimento aggiunto\n\t\tCondiment ultimo = parziale.get(livello-1);\n\t\t\n\t\t//Cicliamo la lista dei vertici e aggiungiamo un condimento non adiacente ad ultimo\n\t\tfor (Condiment prossimo : grafo.vertexSet()) {\n\t\t\tif (!Graphs.neighborSetOf(grafo, ultimo).contains(prossimo) && !parziale.contains(prossimo)) {\n\t\t\t\tparziale.add(prossimo);\n\t\t\t\ttrovato = true;\n\t\t\t\tcerca(livello+1, parziale, prescelto);\n\t\t\t\tparziale.remove(livello);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t//Caso terminale \n\t\tif (!trovato) {\n\t\t\tdouble somma = 0.0;\n\t\t\tfor (Condiment c2 : parziale) {\n\t\t\t\tsomma += c2.getCondiment_calories();\n\t\t\t}\n\t\t\tif (somma > somma_best && parziale.contains(prescelto)) {\n\t\t\t\tsomma_best = somma;\n\t\t\t\tbest = new ArrayList<Condiment>(parziale);\n\t\t\t}\n\t\t\n\t\t}\n\t}", "protected abstract void clip();", "static int clipSegmentToLine(ClipVertex vOut[], ClipVertex vIn[],\n Vec2 normal, float offset) {\n int numOut = 0;\n\n // Calculate the distance of end points to the line\n float distance0 = Vec2.dot(normal, vIn[0].v) - offset;\n float distance1 = Vec2.dot(normal, vIn[1].v) - offset;\n\n // If the points are behind the plane\n if (distance0 <= 0.0f) {\n vOut[numOut] = new ClipVertex();\n vOut[numOut].id = new ContactID(vIn[0].id);\n vOut[numOut++].v = vIn[0].v.clone();\n }\n if (distance1 <= 0.0f) {\n vOut[numOut] = new ClipVertex();\n vOut[numOut].id = new ContactID(vIn[1].id);\n vOut[numOut++].v = vIn[1].v.clone();\n }\n\n // If the points are on different sides of the plane\n if (distance0 * distance1 < 0.0f) {\n // Find intersection point of edge and plane\n float interp = distance0 / (distance0 - distance1);\n vOut[numOut] = new ClipVertex();\n vOut[numOut].v.x = vIn[0].v.x + interp * (vIn[1].v.x - vIn[0].v.x);\n vOut[numOut].v.y = vIn[0].v.y + interp * (vIn[1].v.y - vIn[0].v.y);\n\n if (distance0 > 0.0f) {\n vOut[numOut].id = new ContactID(vIn[0].id);\n }\n else {\n vOut[numOut].id = new ContactID(vIn[1].id);\n }\n ++numOut;\n }\n\n return numOut;\n }", "int getStartSegment();", "private void subdivide(EChannel cod_info) {\n\t\tint scfb_anz = 0;\n\n\t\tif ( bigvalues_region == 0) {\n\t\t\t/* no big_values region */\n\t\t\tcod_info.region0_count = 0;\n\t\t\tcod_info.region1_count = 0;\n\t\t} else {\n\n\t\t\tif ( cod_info.window_switching_flag == 0 ) {\n\n\t\t\t\tint index0, index1;\n\n\t\t\t\t/* Calculate scfb_anz */\n\t\t\t\twhile (scalefac_band_long[scfb_anz] < bigvalues_region)\n\t\t\t\t\tscfb_anz++;\n\t\t\t\t/*\t\t\tassert (scfb_anz < 23); */\n\n\t\t\t\tindex0 = (cod_info.region0_count = subdv_table[scfb_anz][0]) + 1;\n\t\t\t\tindex1 = (cod_info.region1_count = subdv_table[scfb_anz][1]) + 1;\n\n\t\t\t\tcod_info.address1 = scalefac_band_long[index0];\n\t\t\t\tcod_info.address2 = scalefac_band_long[index0 + index1];\n\t\t\t\tcod_info.address3 = bigvalues_region;\n\t\t\t} else {\n\t\t\t\tif ( (cod_info.block_type == 2) && (cod_info.mixed_block_flag == 0) ) {\n\t\t\t\t\tcod_info.region0_count = 8;\n\t\t\t\t\tcod_info.region1_count = 12;\n\t\t\t\t\tcod_info.address1 = 36;\n\t\t\t\t} else {\n\t\t\t\t\tcod_info.region0_count = 7;\n\t\t\t\t\tcod_info.region1_count = 13;\n\t\t\t\t\tcod_info.address1 = scalefac_band_long[ cod_info.region0_count + 1 ];\n\t\t\t\t}\n\t\t\t\tcod_info.address2 = bigvalues_region;\n\t\t\t\tcod_info.address3 = 0;\n\n\t\t\t}\n\t\t}\n\t}", "private int pasarMilisegundoASegundo( long milisegundos )\n {\n return (int)(milisegundos/MILISEGUNDOS_EN_SEGUNDO);\n }", "void recorridoCero(){\n \n for(int i=0;i<8;i++)\n\t\t\tfor(int j=0;j<8;j++)\n\t\t\t\t{\n\t\t\t\t\t//marcar con cero todas las posiciones\n\t\t\t\t\trecorrido[i][j]=0;\n\t\t\t\t}\n }", "public boolean rayCrossesSegment(LatLng point, LatLng a, LatLng b) {\n double px = point.longitude,\n py = point.latitude,\n ax = a.longitude,\n ay = a.latitude,\n bx = b.longitude,\n by = b.latitude;\n if (ay > by) {\n ax = b.longitude;\n ay = b.latitude;\n bx = a.longitude;\n by = a.latitude;\n }\n // alter longitude to cater for 180 degree crossings\n if (px < 0 || ax < 0 || bx < 0) {\n px += 360;\n ax += 360;\n bx += 360;\n }\n // if the point has the same latitude as a or b, increase slightly py\n if (py == ay || py == by) py += 0.00000001;\n\n\n // if the point is above, below or to the right of the segment, it returns false\n if ((py > by || py < ay) || (px > Math.max(ax, bx))) {\n return false;\n }\n // if the point is not above, below or to the right and is to the left, return true\n else if (px < Math.min(ax, bx)) {\n return true;\n }\n // if the two above conditions are not met, you have to compare the slope of segment [a,b] (the red one here) and segment [a,p] (the blue one here) to see if your point is to the left of segment [a,b] or not\n else {\n double red = (ax != bx) ? ((by - ay) / (bx - ax)) : Double.POSITIVE_INFINITY;\n double blue = (ax != px) ? ((py - ay) / (px - ax)) : Double.POSITIVE_INFINITY;\n return (blue >= red);\n }\n\n }", "public void dividirDineroGobierno() {\n\n double dineroDividible = super.getMundo().getGobierno().getCapitalEconomico() / 2;\n double dineroPorPersona = super.getMundo().contarPersonas();\n\n if (dineroDividible > 0) {\n\n super.getMundo().gobiernoDarDinero(dineroDividible);\n\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n }\n }", "int getNumSegments();", "public void primera_parte(String path) {\r\n\t\tint aparece_dos_veces=0,aparece_tres_veces=0;\r\n\t\tint[] abecedario=new int[26];\r\n\t\tString linea;\r\n\t\tFile archivo=new File(path);\r\n\t\ttry {\r\n\t\t\tScanner sc=new Scanner(archivo);\r\n\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\tinicializar_vector(abecedario);\r\n\t\t\t\tlinea=sc.nextLine();\r\n\t\t\t\tprocesar_linea(abecedario,linea);\r\n\t\t\t\tfor(int j=0;j<abecedario.length;j++) {\r\n\t\t\t\t\tif(abecedario[j]==2) {\r\n\t\t\t\t\t\taparece_dos_veces++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor(int j=0;j<abecedario.length;j++) {\r\n\t\t\t\t\tif(abecedario[j]==3) {\r\n\t\t\t\t\t\taparece_tres_veces++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tsc.close();\r\n\t\t\tint resultado=(aparece_dos_veces*aparece_tres_veces);\r\n\t\t\tSystem.out.println(\"Our Checksum is: \"+resultado);\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\t\t\r\n\t\t\r\n\t}", "private void findAbdomenCM() {\r\n \r\n if (foundCenterOfMass) return;\r\n int xcm = 0, ycm = 0, pixCount = 0;\r\n for (int idx= 0, y = 0; y < yDim; y++) {\r\n for (int x = 0; x < xDim; x++, idx++) {\r\n if (sliceBuffer[idx] == abdomenTissueLabel) {\r\n xcm += x;\r\n ycm += y;\r\n pixCount++;\r\n }\r\n } // end for (int x = 0; ...)\r\n } // end for (int idx = 0, ...)\r\n \r\n if (pixCount == 0) {\r\n// System.err.println(\"findAbdomenCM(): No pixels with abdomenTissueLabel in segmented image\");\r\n MipavUtil.displayError(\"findAbdomenCM(): No pixels with abdomenTissueLabel in segmented image\");\r\n return;\r\n }\r\n \r\n centerOfMass[0] = (short)(xcm / pixCount);\r\n centerOfMass[1] = (short)(ycm / pixCount);\r\n foundCenterOfMass = true;\r\n }", "public void dirigirHaciaPunto(int x, int y){ \r\n\r\n\tint coordenadaXObjetivo;\r\n\tint coordenadaYObjetivo;\r\n\tint distanciaEnX;\r\n\tint distanciaEnY;\r\n\tint incrementoDesplazamiento = 1;\t\t\r\n\t\t\t\t\t\t\r\n\tcoordenadaXObjetivo = x;\t\r\n\tdistanciaEnX = coordenadaXObjetivo - this.x;\r\n\t\t\t\t\t\r\n\tcoordenadaYObjetivo = y;\t\r\n\tdistanciaEnY = coordenadaYObjetivo - this.y;\r\n\t\r\n\tif(distanciaEnX <= 0){\r\n\t\tif (distanciaEnX == 0){\r\n\t\t\tif(distanciaEnY < 0){\r\n\t\t\t\tthis.y -= incrementoDesplazamiento; \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\tif(distanciaEnY <= 0){\r\n\t\t\t\tif(distanciaEnY == 0){\r\n\t\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\t\tthis.y -= incrementoDesplazamiento;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\telse{\r\n\t\tif(distanciaEnY <= 0){\r\n\t\t\tif(distanciaEnY == 0){\r\n\t\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse{\r\n\t\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\t\tthis.y -= incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((this.x >= x - incrementoDesplazamiento) && (this.x <= x + incrementoDesplazamiento) && \r\n\t\t\t(this.y >= y - incrementoDesplazamiento) && (this.y <= y + incrementoDesplazamiento)){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.entroAlCirculo = true;\r\n\t\t\r\n\t\t}\t\t\t\t\t\t\t\t\t\r\n\t}", "protected void createSegmentAnnotations() {\n\t\tString source = \"http://www.polarsys.org/capella/2007/ImpactAnalysis/Segment\";\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedRequirementPkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_ParticipationsInCapabilityRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfacePkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ImplementorComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_UserComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_InterfaceImplementor(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_ImplementedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_InterfaceUser(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_UsedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getProvidedInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getRequiredInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeployableElement_DeployingLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeploymentTarget_DeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_DeployedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_Location(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Port(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Part(), \n\t\t source, \n\t\t new String[] {\n\t\t });\n\t}", "public void disparoDireccional(int tipo, float posX, float posY) {\n float x = posX - 58;\n float y = posY - 72;\n switch(tipo) {\n case 1: \n crearProyectilG2(x, y, -1, -1);\n crearProyectilG2(x, y, 0, -1); \n crearProyectilG2(x, y, 1, -1);\n break;\n case 2:\n crearProyectilG2(x, y, -1, -1);\n crearProyectilG2(x, y, 0, -1); \n crearProyectilG2(x, y, -1, 0);\n break;\n case 3: \n crearProyectilG2(x, y, -1, -1);\n crearProyectilG2(x, y, -1, 0);\n crearProyectilG2(x, y, -1, 1); \n break;\n case 4:\n crearProyectilG2(x, y, -1, 0); \n crearProyectilG2(x, y, -1, 1);\n crearProyectilG2(x, y, 0, 1);\n break;\n case 5:\n crearProyectilG2(x, y, -1, 1); \n crearProyectilG2(x, y, 0, 1);\n crearProyectilG2(x, y, 1, 1);\n break;\n case 6:\n crearProyectilG2(x, y, 0, 1); \n crearProyectilG2(x, y, 1, 1);\n crearProyectilG2(x, y, 1, 0);\n break;\n case 7:\n crearProyectilG2(x, y, 1, -1); \n crearProyectilG2(x, y, 1, 0);\n crearProyectilG2(x, y, 1, 1);\n break;\n case 8:\n crearProyectilG2(x, y, 0, -1); \n crearProyectilG2(x, y, 1, -1);\n crearProyectilG2(x, y, 1, 0);\n break;\n }\n }", "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 }", "private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }", "private void carregaAvisosGerais() {\r\n\t\tif (codWcagEmag == WCAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"12.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"9.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.7\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\t// comentado por n�o ter achado equi\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t} else if (codWcagEmag == EMAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.21\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.24\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.17\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.6\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.14\", AVISO, codWcagEmag, \"\"));\r\n\t\t}\r\n\r\n\t}", "private void avancaPessoa(int distancia, int velocidadeMin, int velocidadeMax) {\n\t\tint posicao = distancia;\n\t\tint velocidade;\n\t\t\n\t\twhile(posicao > 0) {\n\t\t\tvelocidade = sorteio(velocidadeMin, velocidadeMax);\n\t\t\tSystem.out.println(\"Pessoa \" + idPessoa + \" está a \" + posicao + \"m da porta.\");\n\t\t\tposicao -= velocidade;\n\t\t\tlblPessoa.setLocation(2*(200 - posicao), 70+30*idPessoa);\n\t\t\ttry {\n\t\t\t\tsleep(200);\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\t\t}\n\t\tposicao = (posicao < 0) ? 0 : posicao;\n\t\tlblPessoa.setLocation((200 - posicao) * 2, 70+30*idPessoa);\n\t\tSystem.out.println(\"Pessoa \" + idPessoa + \" foi a \" + (++chegou) + \"ª a chegar à porta.\");\n\t}", "private void colidiuBloco(Bloco[] linhaBloco) {\n\n\t\tfor (int i = 0; i < blocoArray; i++) {\n\t\t\tif (linhaBloco[i].bateu(bola)) {\n\t\t\t\tbola.invertVertical();\n\t\t\t\tscore = score + 100;\n\t\t\t} // fecha if\n\t\t} // fecha for\n\n\t}", "@SuppressWarnings(\"unused\")\r\n private void snakeSubcutaneousVOI() {\r\n \r\n // set the subcutaneous VOI as active\r\n subcutaneousVOI.setActive(true);\r\n subcutaneousVOI.getCurves().elementAt(0).setActive(true);\r\n \r\n float[] sigmas = new float[2];\r\n sigmas[0] = 1.0f;\r\n sigmas[1] = 1.0f;\r\n \r\n AlgorithmSnake snake = new AlgorithmSnake(srcImage, sigmas, 50, 2, subcutaneousVOI, AlgorithmSnake.OUT_DIR);\r\n snake.run();\r\n\r\n subcutaneousVOI = snake.getResultVOI();\r\n subcutaneousVOI.setName(\"Subcutaneous area\");\r\n \r\n }", "public static void smoothContour(List<PointIndex_I32> v, int minLength) {\n if(v.size() > 0){\n //if the distance between any two sequential points is < minLength, remove that point\n for (int i = v.size() - 2; i >= 0; i--) {\n if (v.get(i).distance(v.get(i + 1)) < minLength) {\n v.remove(i + 1);\n }\n }\n //test the distance between the last point and the first\n if (v.get(v.size() - 1).distance(v.get(0)) < minLength) {\n v.remove(v.size() - 1);\n }\n }\n }", "public static Resultado PCF(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n //*Definicion de variables las variables\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n \n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n double slotsDemanda = demanda.getNroFS();\n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n \n \n \n // double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n //FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n FcmtAux = ((saltos*slotsDemanda) + corte + desalineamiento)/capacidadLibre;\n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public void translateAllSegments()\n\t{\n\t\tCursor hglass = new Cursor(display, SWT.CURSOR_WAIT);\n\t\tCursor arrow = new Cursor(display, SWT.CURSOR_ARROW);\n\t\tshell.setCursor(hglass);\n\t\tProgressDialog progressDialog = new ProgressDialog(shell, message.getString(\"translateAllSegmentsMessage\"), message\n\t\t\t\t.getString(\"translateAllSegmentsMessage\"), ProgressDialog.SINGLE_BAR);\n\t\tprogressDialog.open();\n\t\tprogressDialog.updateProgressMessage(message.getString(\"translateAllSegmentsMessage\"));\n\t\tprogressDialog.setPdSupport(new ProgressDialogSupport(progressDialog));\n\t\tfor (int i = 0; i < this.getXliffEditorWindow().getIOverallSegmentNumber(); i++)\n\t\t{\n\t\t\tif (progressDialog.getPdSupport() != null)\n\t\t\t\tprogressDialog.getPdSupport().updateProgressIndication(i + 1, this.getXliffEditorWindow().getIOverallSegmentNumber());\n\t\t\ttranslateSegment(i);\n\t\t\t// this.gotoSegment(i);\n\t\t}\n\n\t\tthis.gotoSegment(getIOldSegmentPosition());\n\n\t\tprogressDialog.setPdSupport(null);\n\t\tprogressDialog.close();\n\t\tprogressDialog = null;\n\t\tshell.setCursor(arrow);\n\t\treturn;\n\t}", "public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n int changue=0;\n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i=0;i<numFilas;i++){\n auxListFila = (ArrayListFila)filas.get(i);\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n\n if(auxColor.getNumero() > 0){\n int contador=0;\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n contador++;\n }\n }\n }\n }\n \n if(auxColor.getNumero() == contador){\n changue=1;\n cambio=1;\n auxColor.setNumero(0);\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n \n auxColor1.setNumero(auxColor1.getNumero()-1);\n\n matriz = operadores.pintarPosicion(matriz, i, c, auxColor.getColor());\n\n nodo.setMatriz(matriz);\n }\n }\n }\n }\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n \n \n }\n }\n }\n }\n \n }\n if(changue==1) nodo.setCambio(1);\n System.out.println(\"----------------fin heuristica espaciosJustos-------------- \");\n return (Nodo)nodo;\n }" ]
[ "0.69678056", "0.68742865", "0.6206085", "0.60836595", "0.59208286", "0.58445007", "0.58358747", "0.5731312", "0.57178795", "0.57123095", "0.56338894", "0.5614397", "0.5593154", "0.5586612", "0.55858576", "0.5583819", "0.5545294", "0.55376285", "0.55108273", "0.55105454", "0.55001736", "0.5473552", "0.5452928", "0.544511", "0.5445062", "0.53892547", "0.53872216", "0.5386229", "0.5365318", "0.535695", "0.5352157", "0.5346154", "0.5343008", "0.5329795", "0.53238606", "0.5323359", "0.5319579", "0.53142303", "0.53102756", "0.5306227", "0.52922654", "0.5291504", "0.5280131", "0.5279398", "0.52755564", "0.5269535", "0.526402", "0.5263251", "0.5261692", "0.5256702", "0.5245008", "0.52332234", "0.5226831", "0.5225796", "0.52150106", "0.52143437", "0.521212", "0.5211673", "0.5208239", "0.5206547", "0.52050024", "0.5203851", "0.5197572", "0.5194695", "0.5189476", "0.51805663", "0.5164915", "0.516216", "0.51597404", "0.5158051", "0.5157928", "0.5156161", "0.51558834", "0.5152057", "0.5150975", "0.51442707", "0.5144178", "0.51422054", "0.51304716", "0.51298845", "0.5128034", "0.51257914", "0.5115474", "0.5110465", "0.51100075", "0.5109252", "0.5108747", "0.51083666", "0.51075345", "0.5104491", "0.5100903", "0.5100828", "0.50957745", "0.5095595", "0.5091796", "0.5083945", "0.508079", "0.5079544", "0.50775754", "0.50768304", "0.5070164" ]
0.0
-1
on prend que le dernier element du produit vectoriel car en 2D les deux premier =0
private double produitVectoriel(Point2D p1,Point2D p2, Point2D p3, Point2D p4) { double xv1 = p2.getX() - p1.getX(); double xv2 = p4.getX() - p3.getX(); double yv1 = p2.getY() - p1.getY(); double yv2 = p4.getY() - p3.getY(); return (xv1 * yv2) - (xv2 * yv1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void evoluer()\n {\n int taille = grille.length;\n int nbVivantes = 0;\n for(int i=-1; i<2; i++)\n {\n int xx = ((x+i)+taille)%taille; // si x+i=-1, xx=taille-1. si x+i=taille, xx=0\n for(int j=-1; j<2; j++)\n {\n if (i==0 && j==0) continue;\n int yy = ((y+j)+taille)%taille;\n if (grille[xx][yy].vivante) nbVivantes++;\n }\n }\n if (nbVivantes<=1 || nbVivantes>=4) {vientDeChanger = (vivante==true); vivante = false;}\n if (nbVivantes==3) {vientDeChanger = (vivante==false); vivante = true;}\n }", "void recorridoCero(){\n \n for(int i=0;i<8;i++)\n\t\t\tfor(int j=0;j<8;j++)\n\t\t\t\t{\n\t\t\t\t\t//marcar con cero todas las posiciones\n\t\t\t\t\trecorrido[i][j]=0;\n\t\t\t\t}\n }", "public Vector produitVectorielle(Vector vec){\n return new Vector(y * vec.z - z * vec.y, z * vec.x - x * vec.z, x * vec.y - y * vec.x);\t\t\n }", "public void muovi() {\n\n for (int i = punti; i > 0; i--) {\n x[i] = x[(i - 1)];\n y[i] = y[(i - 1)];\n }\n\n if (sinistra) {\n x[0] -= DIMENSIONE_PUNTO;\n }\n\n if (destra) {\n x[0] += DIMENSIONE_PUNTO;\n }\n\n if (su) {\n y[0] -= DIMENSIONE_PUNTO;\n }\n\n if (giu) {\n y[0] += DIMENSIONE_PUNTO;\n }\n }", "public abstract Vector4fc zero();", "void Death(){\r\n if (vie==0){\r\n this.plateau[this.x][this.y]='0';\r\n }\r\n }", "public Vector2d() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}", "Vector getZeroVector();", "private void arretes_fY(){\n\t\tthis.cube[49] = this.cube[46]; \n\t\tthis.cube[46] = this.cube[48];\n\t\tthis.cube[48] = this.cube[52];\n\t\tthis.cube[52] = this.cube[50];\n\t\tthis.cube[50] = this.cube[49];\n\t}", "public void aggiornaPropulsori(){\n xPropulsore1=new int[]{xCord[0],xCord[0]};\n yPropulsore1=new int[]{yCord[0],yCord[0]+15}; \n xPropulsore2=new int[]{xCord[2],xCord[2]}; \n yPropulsore2=new int[]{yCord[2],yCord[2]+15};\n \n }", "public void adaptProductVector() {\t\t\r\n\t\tHashMap<Integer, Integer> neighboursAdaption = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tdouble threshold = Parameters.adaptationThreshold / 100.0;\r\n\t\tint neighbours = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\tneighboursAdaption.put(i, 0);\r\n\t\t}\r\n\t\t\r\n\t\tfor (Object o: network.getAdjacent(this)) {\t\t\r\n\t\t\tif (o instanceof Customer) {\r\n\t\t\t\tCustomer c = (Customer)o;\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\t\t\tint count = neighboursAdaption.get(i);\r\n\t\t\t\t\tif (c.getDemandVector()[i] == 1) {\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tneighboursAdaption.put(i, count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tneighbours++;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\tif ((double)neighboursAdaption.get(i) / neighbours >= threshold ) {\r\n\t\t\t\tdemandVector[i] = 1;\r\n\t\t\t}\r\n\t\t}\t\t \r\n\t}", "public void update() {\n\n double[][] newU = new double[n][n];\n double[][] newV = new double[n][n];\n double[][] a = new double[n][n];\n long newTime = System.currentTimeMillis();\n int dt = (int) (newTime - currentTime);\n\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n\n //pogoji za rob\n //nastavljamo\n if (i == 0 || j == 0 || i == n - 1 || j == n - 1) {\n a[i][j] = edgeCondition;\n newU[i][j] = edgeCondition;\n newV[i][j] = edgeCondition;\n } \n\n //sicer\n else {\n a[i][j] = c * c / (h * h) * (u[i - 1][j] + u[i + 1][j] + u[i][j - 1] + u[i][j + 1] - 4 * u[i][j]) - ( k * v[i][j]);\n\n \n //nova hitrost je stara + sprememba\n newV[i][j] = v[i][j] + a[i][j] * (double)dt / 1000.0 ;\n\n //nova pozicija je stara + sprememba\n newU[i][j] = u[i][j] + v[i][j] * (double)dt / 1000.0;\n }\n }\n }\n \n currentTime = newTime;\n \n \n\n u = newU;\n v = newV;\n \n // printMatrix();\n \n \n \n try{\n image.colorImage(image.getHeight(), image.getWidth(), u);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner (System.in);\r\n\t\t\r\n\t\tint matriz[][]=new int[4][4];\r\n\t\tmatriz[0][0] = 1;\r\n\t\tmatriz[0][1] = 2;\r\n\t\tmatriz[0][2] = 3;\r\n\t\tmatriz[0][3] = 4;\r\n\t\tmatriz[1][0] = 5;\r\n\t\tmatriz[1][1] = 6;\r\n\t\tmatriz[1][2] = 7;\r\n\t\tmatriz[1][3] = 8;\r\n\t\tmatriz[2][0] = 9;\r\n\t\tmatriz[2][1] = 10;\r\n\t\tmatriz[2][2] = 11;\r\n\t\tmatriz[2][3] = 12;\r\n\t\tmatriz[3][0] = 13;\r\n\t\tmatriz[3][1] = 14;\r\n\t\tmatriz[3][2] = 15;\r\n\t\tmatriz[3][3] = 16;\r\n\t\t\r\n\t\t\r\n\t\tint vectorfila[]=new int[4];\r\n\t\tint vectorcolumna[]=new int[4];\r\n\t\t\r\n\t\t\r\n\t\tvectorfila[0]=matriz[0][0]+matriz[0][1]+matriz[0][2]+matriz[0][3];\r\n\t\tvectorfila[1]=matriz[1][0]+matriz[1][1]+matriz[1][2]+matriz[1][3];\r\n\t\tvectorfila[2]=matriz[2][0]+matriz[2][1]+matriz[2][2]+matriz[2][3];\r\n\t\tvectorfila[3]=matriz[3][0]+matriz[3][1]+matriz[3][2]+matriz[3][3];\r\n\t\t\r\n\t\tvectorcolumna[0]=matriz[0][0]+matriz[1][0]+matriz[2][0]+matriz[3][0];\r\n\t\tvectorcolumna[1]=matriz[0][1]+matriz[1][1]+matriz[2][1]+matriz[3][1];\r\n\t\tvectorcolumna[2]=matriz[0][2]+matriz[1][2]+matriz[2][2]+matriz[3][2];\r\n\t\tvectorcolumna[3]=matriz[0][3]+matriz[1][3]+matriz[2][3]+matriz[3][3];\r\n\t\t\r\n\t\tsc.close();\r\n\t}", "private void aretes_aO(){\n\t\tthis.cube[40] = this.cube[7]; \n\t\tthis.cube[7] = this.cube[25];\n\t\tthis.cube[25] = this.cube[46];\n\t\tthis.cube[46] = this.cube[34];\n\t\tthis.cube[34] = this.cube[40];\n\t}", "@Override\n\tpublic void ispisiPopulaciju(IVector[] populacija) {\n\n\t}", "private static void setQui(){\n int mX, mY;\n for (Integer integer : qList) {\n mY = (int) (Math.floor(1.f * integer / Data.meshRNx));\n mX = integer - Data.meshRNx * mY;\n if (Data.densCells[mX][mY] > Data.gwCap[mX][mY] * .75) {\n for (int j = 0; j < Data.densCells[mX][mY]; j++) {\n Cell cell = (Cell) cells.get(Data.idCellsMesh[mX][mY][j]);\n cell.vState = true;\n cell.quiescent = Data.densCells[mX][mY] >= Data.gwCap[mX][mY];\n }\n }\n }\n }", "public void matrizAdjunta (){\n float tablaA[][]= getMatriz();\n setMatrizAdjunta(new float[3][3]);\n getMatrizAdjunta()[0][0]=(tablaA[1][1]*tablaA[2][2]) - (tablaA[1][2]*tablaA[2][1]);\n getMatrizAdjunta()[0][1]=-((tablaA[0][1]*tablaA[2][2]) - (tablaA[0][2]*tablaA[2][1]));\n getMatrizAdjunta()[0][2]=(tablaA[0][1]*tablaA[1][2]) - (tablaA[0][2]*tablaA[1][1]);\n \n getMatrizAdjunta()[1][0]=-((tablaA[1][0]*tablaA[2][2]) - (tablaA[1][2]*tablaA[2][0]));\n getMatrizAdjunta()[1][2]=-((tablaA[0][0]*tablaA[1][2]) - (tablaA[0][2]*tablaA[1][0]));\n getMatrizAdjunta()[1][1]=(tablaA[0][0]*tablaA[2][2]) - (tablaA[0][2]*tablaA[2][0]);\n \n getMatrizAdjunta()[2][0]=(tablaA[1][0]*tablaA[2][1]) - (tablaA[1][1]*tablaA[2][0]);\n getMatrizAdjunta()[2][1]=-((tablaA[0][0]*tablaA[2][1]) - (tablaA[0][1]*tablaA[2][0]));\n getMatrizAdjunta()[2][2]=(tablaA[0][0]*tablaA[1][1]) - (tablaA[0][1]*tablaA[1][0]);\n mostrarMatriz(getMatrizAdjunta(),\"Matriz adjunta\");\n }", "public void setEqualTo(Vector v){ components = v.getVectorAsArray(); }", "float[][] getCameraVectorsNormal(int resX, int resY){\n float vectors[][]=new float[resX*resY][3];//first vector index, second the components of the vector\n float[] vect2=rotateYVector(dir);\n vect2[1]=0;\n vect2=normalize(vect2);\n float[] vect3=normalize(vectorProduct(dir, vect2));//dir, vect2, vect3 base vectors\n float[] x={0,0,0};\n float[] y={0,0,0};\n float[] temp={0,0,0};\n for(int i=0;i<3;i++){\n x[i]=(vect2[i])/(resX/2);\n y[i]=(vect3[i])/(resY/2);\n temp[i]=vect2[i];\n }\n \n for(int j=0;j<resY;j++){\n for(int i=0;i<resX;i++){\n vectors[j*resX+i][0]=dir[0]+vect2[0]+vect3[0];\n vectors[j*resX+i][1]=dir[1]+vect2[1]+vect3[1];\n vectors[j*resX+i][2]=dir[2]+vect2[2]+vect3[2];\n vectors[j*resX+i]=normalize(vectors[j*resX+i]);\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n if((vectorLength(vect2)>(-0.0001)&&vectorLength(vect2)<0.0001)&&(resX%2)==0){\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n }\n }\n //printVector(temp);\n vect2[0]=temp[0];\n vect2[1]=temp[1];\n vect2[2]=temp[2];\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n if((vectorLength(vect3)>(-0.0001)&&vectorLength(vect3)<0.0001)&&(resY%2)==0){\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n }\n }\n \n return vectors;\n }", "static void update(int[][] matrix){\n\t\tboolean rowFlag = false;\n\t\tboolean colFlag = false;\n\t\tint n = matrix.length;\n int m = matrix[0].length;\n for(int i=0;i<n;i++){\n for(int j=0;j<m;j++){\n if(i==0 && matrix[i][j]==0){\n rowFlag =true;\n }\n if(j==0 && matrix[i][j]==0){\n colFlag = true;\n }\n if(matrix[i][j]==0){\n matrix[0][j] = 0;\n matrix[i][0] = 0;\n }\n }\n }\n for(int i=1;i<n;i++){\n for(int j=1;j<m;j++){\n if(matrix[i][0]==0||matrix[0][j]==0){\n matrix[i][j]=0;\n }\n }\n }\n if(rowFlag){\n for(int i=0;i<m;i++){\n matrix[0][i] =0 ;\n }\n }\n if(colFlag){\n for(int j=0;j<n;j++){\n matrix[j][0] = 0;\n }\n }\n\n\t}", "private int[] actualizarDisp(int asignacion[][], int disponibles[]){\r\n \r\n //Vector auxiliar a ser actualizado\r\n int update[] = disponibles;\r\n \r\n //Proceso de actualizacion de vector\r\n for(int j = 0; j < update.length; j++){\r\n for(int i = 0; i < asignacion.length; i++){\r\n //Restar el valor almacenado en cada proceso para cada tipo de recurso respectivo\r\n update[j] = recursos[j] - asignacion[i][j];\r\n }\r\n }\r\n \r\n return update;\r\n }", "public void statoIniziale()\n {\n int r, c;\n for (r=0; r<DIM_LATO; r++)\n for (c=0; c<DIM_LATO; c++)\n {\n if (eNera(r,c))\n {\n if (r<3) // le tre righe in alto\n contenutoCaselle[r][c] = PEDINA_NERA;\n else if (r>4) // le tre righe in basso\n contenutoCaselle[r][c] = PEDINA_BIANCA;\n else contenutoCaselle[r][c] = VUOTA; // le 2 righe centrali\n }\n else contenutoCaselle[r][c] = VUOTA; // caselle bianche\n }\n }", "private void arretes_fO(){\n\t\tthis.cube[40] = this.cube[37]; \n\t\tthis.cube[37] = this.cube[39];\n\t\tthis.cube[39] = this.cube[43];\n\t\tthis.cube[43] = this.cube[41];\n\t\tthis.cube[41] = this.cube[40];\n\t}", "private void fillVector()\r\n {\r\n // The x and y coordinates of a point\r\n int xPoint;\r\n int yPoint;\r\n \r\n // The x and y coordinates of a point with the displacement of the plot \r\n // origin from the component origin taken into consideration\r\n int xPointOffset, yPointOffset;\r\n \r\n // The point to be stored in the vector\r\n SPlotPoint plotPoint;\r\n\r\n\r\n // Get the max of the data types to figure out how to scale plot\r\n maxX_ = (new Double(xData_.getMax())).intValue();\r\n maxY_ = (new Double(yData_.getMax())).intValue();\r\n \r\n // Want max axes to be max of 200. Need to calculate the scaling factor\r\n xFactor_ = maxX_/MAX_AXIS_LENGTH;\r\n yFactor_ = maxY_/MAX_AXIS_LENGTH;\r\n \r\n // Extract x and y values, generate SPlotPoints and store in vector\r\n for (int i = 0; i < xSize_; i++)\r\n {\r\n xPoint = (int)(xData_.getValue(i) / xFactor_);\r\n yPoint = (int)(yData_.getValue(i) / yFactor_); \r\n\r\n\r\n // The xy coordinates where to plot the point (after taking the \r\n // offset btn the plot origin and the component origin into account\r\n xPointOffset = xPoint+OFFSET;\r\n yPointOffset = yPoint+OFFSET;\r\n \r\n // Generate SPlotPoints and store in vector\r\n plotPoint = new SPlotPoint(xPointOffset,\r\n yPointOffset);\r\n \r\n // Set the id of the scatter plot point (corresponds to the row\r\n // number in the .dbf\r\n // Must add one to compensate for geodata starting at 1 and vector\r\n // index starting at 0\r\n plotPoint.setId(i+1);\r\n \r\n pointVector_.addElement(plotPoint);\r\n }\r\n }", "public void recalculateVector()\r\n {\r\n recalculateVector(destX, destY);\r\n }", "float[][] getCameraVectors(int resX, int resY){\n float vectors[][]=new float[resX*resY][3];//first vector index, second the components of the vector\n float[] vect2=rotateYVector(dir);\n vect2[1]=0;\n vect2=normalize(vect2);\n float[] vect3=normalize(vectorProduct(dir, vect2));//dir, vect2, vect3 base vectors\n float[] x={0,0,0};\n float[] y={0,0,0};\n float[] temp={0,0,0};\n for(int i=0;i<3;i++){\n x[i]=(vect2[i])/(resX/2);\n y[i]=(vect3[i])/(resY/2);\n temp[i]=vect2[i];\n }\n \n for(int j=0;j<resY;j++){\n for(int i=0;i<resX;i++){\n vectors[j*resX+i][0]=dir[0]+vect2[0]+vect3[0];\n vectors[j*resX+i][1]=dir[1]+vect2[1]+vect3[1];\n vectors[j*resX+i][2]=dir[2]+vect2[2]+vect3[2];\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n if((vectorLength(vect2)>(-0.0001)&&vectorLength(vect2)<0.0001)&&(resX%2)==0){\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n }\n }\n //printVector(temp);\n vect2[0]=temp[0];\n vect2[1]=temp[1];\n vect2[2]=temp[2];\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n if((vectorLength(vect3)>(-0.0001)&&vectorLength(vect3)<0.0001)&&(resY%2)==0){\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n }\n }\n \n return vectors;\n }", "private void rv2Elements(VectorN r, VectorN v)\n\t{\n\t\tr.checkVectorDimensions(3);\n\t\tv.checkVectorDimensions(3);\n\t\t//Constants c = new Constants();\n\t\tVectorN evec = new VectorN(3); // e vector\n\t\tVectorN k = new VectorN(3); // unit vector in z direction\n\n\t\tthis.rv = new VectorN(r, v);\n\n\t\tdouble rmag = r.mag();\n\t\tdouble vmag = v.mag();\n\t\tdouble energy = vmag * vmag / 2.0 - this.mu / rmag;\n\n\t\tk.x[0] = 0.0;\n\t\tk.x[1] = 0.0;\n\t\tk.x[2] = 1.0;\n\n\t\tVectorN h = r.crossProduct(v);\n\t\tVectorN n = k.crossProduct(h);\n\n\t\tdouble rdotv = r.dotProduct(v);\n\n\t\tdouble q1 = (vmag * vmag - this.mu / rmag) / this.mu;\n\t\tdouble q2 = rdotv / this.mu;\n\n\t\tevec.x[0] = q1 * r.x[0] - q2 * v.x[0];\n\t\tevec.x[1] = q1 * r.x[1] - q2 * v.x[1];\n\t\tevec.x[2] = q1 * r.x[2] - q2 * v.x[2];\n\n\t\tthis.e = evec.mag();\n\n\t\tif (e != 1.0)\n\t\t{\n\t\t\tthis.a = -this.mu / (2.0 * energy);\n\t\t} else\n\t\t{\n\t\t\tthis.a = 1.0E30;\n\t\t\tSystem.out.println(\"parabolic orbit\");\n\t\t}\n\n\t\tthis.i = Math.acos(h.x[2] / h.mag()); // inclination\n\n\t\tthis.raan = Math.acos(n.x[0] / n.mag()); // raan\n\t\tif (n.x[1] < 0.0)\n\t\t{\n\t\t\tthis.raan = 2.0 * Constants.pi - raan;\n\t\t}\n\n\t\tthis.w = Math.acos(n.dotProduct(evec) / (n.mag() * e));\n\t\tif (evec.x[2] < 0.0)\n\t\t{\n\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t}\n\n\t\tif (i == 0.0) // equatorial orbit, things blow up\n\t\t{\n\t\t\t//\t\t System.out.println(\"KeplerElements: equatorial orbit, RAAN no good\");\n\t\t\tthis.raan = 0.0;\n\t\t\tthis.w = Math.acos(evec.x[0] / e);\n\t\t\tif (evec.x[1] < 0.0)\n\t\t\t{\n\t\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t\t}\n\t\t}\n\n\t\tif (i == Constants.pi) // equatorial orbit, things blow up\n\t\t{\n\t\t\t//\t\t System.out.println(\"KeplerElements: equatorial orbit, RAAN no good\");\n\t\t\tthis.raan = 0.0;\n\t\t\tthis.w = Math.acos(evec.x[0] / e);\n\t\t\tif (evec.x[1] > 0.0)\n\t\t\t{\n\t\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t\t}\n\t\t}\n\n\t\tthis.ta = Math.acos(evec.dotProduct(r) / (e * rmag));\n\t\tif (rdotv < 0.0)\n\t\t{\n\t\t\tthis.ta = 2.0 * Constants.pi - this.ta;\n\t\t}\n\t}", "void imprimeValores(){\n System.out.println(\"coordenada del raton:(\"+pratonl[0][0]+\",\"+pratonl[0][1]+\")\");\n System.out.println(\"coordenada del queso:(\"+pquesol[0][0]+\",\"+pquesol[0][1]+\")\");\n imprimeCalculos();//imprime la diferencia entre las X y las Y de las coordenadas\n movimiento();\n }", "public VFunction2D() {\n \n \n }", "public void Z_pos(MyInteger verPos, MyInteger horPos, ArrayList<ArrayList<Integer>> cur)\n {\n for (int i = 0; i < 3; i++)\n {\n for (int k = 0; k < 3; k++)\n {\n if (cur.get(i).get(k) == 0) {\n verPos.value = i;\n horPos.value = k;\n }\n }\n }\n }", "public void SetVector(int[] v){ this.vector=v;}", "void setFullPelForwardVector(int value)\n {\n forwardVector.setFullPel(value);\n }", "void DropFood(){\r\n if (plateau[this.x][this.y]!='0' && this.charge!='0'){\r\n this.plateau[this.x][this.y]+=this.charge;\r\n this.charge=0;\r\n \r\n } \r\n }", "public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n int changue=0;\n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i=0;i<numFilas;i++){\n auxListFila = (ArrayListFila)filas.get(i);\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n\n if(auxColor.getNumero() > 0){\n int contador=0;\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n contador++;\n }\n }\n }\n }\n \n if(auxColor.getNumero() == contador){\n changue=1;\n cambio=1;\n auxColor.setNumero(0);\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n \n auxColor1.setNumero(auxColor1.getNumero()-1);\n\n matriz = operadores.pintarPosicion(matriz, i, c, auxColor.getColor());\n\n nodo.setMatriz(matriz);\n }\n }\n }\n }\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n \n \n }\n }\n }\n }\n \n }\n if(changue==1) nodo.setCambio(1);\n System.out.println(\"----------------fin heuristica espaciosJustos-------------- \");\n return (Nodo)nodo;\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 }", "public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}", "private void posicionInicial(int ancho){\r\n posicionX = ancho;\r\n Random aleatroio = new Random();\r\n int desplazamiento = aleatroio.nextInt(150)+100;\r\n \r\n \r\n cazaTie = new Rectangle2D.Double(posicionX, desplazamiento, anchoEnemigo, alturaEnemigo);\r\n }", "public static double[] produitVectoriel(double U[],double V[]){\r\n\t\tdouble[] produitVect;\r\n\t\tproduitVect = new double[3];\r\n\t\tproduitVect[0] = U[1]*V[2] - U[2]*V[1];\r\n\t\tproduitVect[1] = U[2]*V[0] - U[0]*V[2];\r\n\t\tproduitVect[2] = U[0]*V[1] - U[1]*V[0];\r\n\t\t//double n = norme(produitVect);\r\n\t\treturn\t produitVect;\t\r\n\t}", "public void vivir(){\r\n\t\r\n\tAtacable algo42tmp;\r\n\t\r\n\tif (!(this.muerto)){\r\n\t\tfor(int i = 0; i <= this.velY; i++){\r\n\t\t\tthis.mover();\r\n\t\t}\r\n\t\t\r\n\t\talgo42tmp = zonaDeCombate.comprobarColisionAlgo42(this);\r\n\t\tif (algo42tmp != null){\r\n\t\t\talgo42tmp.recibirDanio(20); /**hacer q se muera*/\r\n\t\t\tthis.muerto = true;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t}\r\n\t}", "private void aretes_aW(){\n\t\tthis.cube[4] = this.cube[16]; \n\t\tthis.cube[16] = this.cube[23];\n\t\tthis.cube[23] = this.cube[37];\n\t\tthis.cube[37] = this.cube[30];\n\t\tthis.cube[30] = this.cube[4];\n\t}", "private void arretes_fW(){\n\t\tthis.cube[4] = this.cube[1]; \n\t\tthis.cube[1] = this.cube[3];\n\t\tthis.cube[3] = this.cube[7];\n\t\tthis.cube[7] = this.cube[5];\n\t\tthis.cube[5] = this.cube[4];\n\t}", "private void laskeMatkojenPituus() {\n matkojenpituus = 0.0;\n\n for (Matka m : matkat) {\n matkojenpituus += m.getKuljettumatka();\n }\n\n }", "void iniciaMatriz() {\r\n int i, j;\r\n for (i = 0; i < 5; i++) {\r\n for (j = 0; j <= i; j++) {\r\n if (j <= i) {\r\n m[i][j] = 1;\r\n } else {\r\n m[i][j] = 0;\r\n }\r\n }\r\n }\r\n m[0][1] = m[2][3] = 1;\r\n\r\n// Para los parentesis \r\n for (j = 0; j < 7; j++) {\r\n m[5][j] = 0;\r\n m[j][5] = 0;\r\n m[j][6] = 1;\r\n }\r\n m[5][6] = 0; // Porque el m[5][6] quedo en 1.\r\n \r\n for(int x=0; x<7; x++){\r\n for(int y=0; y<7; y++){\r\n // System.out.print(\" \"+m[x][y]);\r\n }\r\n //System.out.println(\"\");\r\n }\r\n \r\n }", "public void fillVector(){\n int n = min.length;\n for (int i = 0; i < n; i++) {\n this.x[i] = min.x[i] + (max.x[i] - min.x[i])*rn.uniformDeviate();\n }\n }", "INDArray getBoardScores() {\n //creez un vector ce va contine aceste scoruri si va putea fi folosit la antrenare\n INDArray boardScores = Nd4j.zeros(1, size * size);\n\n //creez o copie a tablei pentru a o putea modifica\n Stone[][] boardCopy = Board.getBoard(), board = new Stone[size][size];\n\n //gasesc recursiv scorurile tablei curente\n float[][] boardScoresFloat = new float[size][size];\n //simulez o mutare a jucatorului\n int stonesNr = Board.getStonesNr();\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++){\n Chain chain = new Chain();\n Stone stone = new Stone(color ? \"black\" : \"white\", chain);\n stone.setPosition(i, j);\n for (int k = 0; k < boardCopy.length; k++) {\n board[k] = Arrays.copyOf(boardCopy[k], boardCopy[k].length);\n }\n int[] lib = Control.verifyLiberties(board, stone, i, j);\n if(board[i][j] == null && lib[0] + lib[1] != 0){\n int depth = 0;\n int dif = size / 2;\n boardScoresFloat[i][j] = getQScore(board, i, j, depth, depth)\n + new Random().nextInt(1000 / stonesNr) - (500 / stonesNr)\n - abs(i - dif) - abs(j - dif);\n }\n else{\n boardScoresFloat[i][j] = -5000;\n }\n }\n\n //normalizez vectorul\n //aflu norma vectorului de valori\n double sum = 0;\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++)\n sum += boardScoresFloat[i][j] * boardScoresFloat[i][j];\n sum = Math.sqrt(sum);\n //aplic norma\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++)\n boardScoresFloat[i][j] /= sum;\n\n //inserez rezultatele gasite intr-un INDArray\n int poz = 0;\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++){\n boardScores.putScalar(new int[]{0, poz}, boardScoresFloat[i][j]);\n poz++;\n }\n //System.out.println(boardScores);\n return boardScores;\n }", "Cellule(Cellule [][]grille, int x, int y, boolean vivante)\n {\n this.grille = grille;\n this.vivante = vivante;\n this.x = x; this.y = y;\n vientDeChanger = true;\n }", "public void balayer()\r\n {\r\n int tot=0;\r\n for (int i=0;i<LONGUEUR;i++ )\r\n {\r\n for (int j=0; j<LARGEUR; j++ )\r\n {\r\n tot=0;\r\n Haut = lignesHor[i][j];\r\n Droite = lignesVert[i+1][j];\r\n Bas = lignesHor[i][j+1];\r\n Gauche = lignesVert[i][j];\r\n\r\n if (Haut)\r\n {\r\n tot++;\r\n Vision[i][j][1]=1;\r\n }\r\n\r\n if (Droite)\r\n {\r\n tot++;\r\n Vision[i][j][2]=1;\r\n }\r\n\r\n if (Bas)\r\n {\r\n tot++;\r\n Vision[i][j][3]=1;\r\n }\r\n\r\n\r\n if (Gauche)\r\n {\r\n tot++;\r\n Vision[i][j][4]=1;\r\n }\r\n\r\n Vision[i][j][0]=Vision[i][j][1]+Vision[i][j][2]+Vision[i][j][3]+Vision[i][j][4];\r\n }\r\n }\r\n }", "private void f0() \n\t{\n\t\tint elements = 0;\n\t\t\n\t\tfor(int i=0;i<f2.length;i++)\n\t\t{\n\t\t\tfor(int j=0;j<f2[0].length;j++)\n\t\t\t{\n\t\t\t\tif(f2[i][j])\n\t\t\t\t\telements++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(elements > 0){\n\t\t\tneighbors = new Neighbor[elements];\n\t\t\tint cy = (f2.length-1)/2; \n\t\t\tint cx = (f2[0].length-1)/2;\n\t\t\tint index=0;\n\t\t\t\n\t\t\tfor(int i=0;i<f2.length;i++)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<f2[0].length;j++)\n\t\t\t\t{\n\t\t\t\t\tif(f2[i][j]){\n\t\t\t\t\t\tneighbors[index++] = new Neighbor(i-cy,j-cx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//No elements i.e all elements are false in the neighborhood buffer.\n\t\t\tneighbors = null;\n\t\t}\n\t\t\t\n\t}", "private Vector returnRelevantVector(Vector segVectorList){\n\t\tVector segPts = new Vector();\n\t\tIterator iter = segVectorList.iterator();\n\t\tVector element = (Vector) iter.next();\n\t\tIterator iterator = element.iterator();\n\t\twhile(iterator.hasNext()){\n\t\t\tInteger obj = (Integer) iterator.next();\n\t\t\tint index = obj.intValue();\n\t\t\tsegPts.add(new Integer(index));\n\t\t}\n\t\n\t\treturn segPts;\n\t}", "public Matrix P0 ();", "public void evaluaVisibilidad(int posX, int posY)\n {\n \n /** Contiene todas las posibles casillas visibles.\n * Si en el proceso una casilla tapa, pasa a modo 'oclusion, y ocluye las demás hasta que llega al punto final (Las quita del Array)\n */\n this.casillasVisibles=new TreeSet<>();\n \n //Realizar la interpolacion\n boolean visible=true;\n CoordCasilla origen=new CoordCasilla(posX , posY);\n CoordCasilla destino;\n List<CoordCasilla>camino;\n \n /* Cell cell = new Cell();\n cell.setTile(mapaActual.getTileSets().getTileSet(0).getTile(138));*/\n \n //Calcular las interpolaciones\n for(CoordCasilla cc:MATRIZ_INTERPOLACION)\n {\n visible=true;\n destino=new CoordCasilla(origen.x +cc.x,origen.y+cc.y);\n camino= Analizador.interpola(origen, destino);\n \n \n for(CoordCasilla casillaEstudio:camino)\n {\n //Si la celda está fuera de limites no tiene sentido realizar el analisis de las casillas siguientes\n if(casillaEstudio.x<0 || casillaEstudio.x>this.anchoMapa-1 || casillaEstudio.y<0 || casillaEstudio.y>this.altoMapa - 1)\n break;\n \n \n if(!visible ) //No hay visibilidad, quitamos la casilla si la hay del TreeSet\n {\n //posibleVisibilidad.remove(celdaEstudio);\n continue;\n }\n else if(visible && this.capaViibilidad.getCell(casillaEstudio.x,casillaEstudio.y)!=null) //La casilla es limite de visibilidad\n visible=false;\n \n //TEST: Marcamos esta casilla como visible\n //this.capaAux.setCell(celdaEstudio.x, celdaEstudio.y,cell);\n \n //Llegados a este punto, quitamos la niebla de guerra de la casilla\n quitaNieblaDeGuerra(casillaEstudio);\n \n this.casillasVisibles.add(casillaEstudio);\n }\n }\n }", "private int convertMatrixToVectorIndex(int row, int col){\n return ((row)*this.col)+col;\n }", "public Vector3D() {\n zero();\n }", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "void setFullPelBackwardVector(int value)\n {\n backwardVector.setFullPel(value);\n }", "public void initialisationGrille(){\n for(int i = 0; i < this.grille.length ; i++)\n {\n for(int j = 0 ; j < this.grille[i].length;j++)\n {\n this.grille[i][j] = \"0\";\n this.grilleObjectif[i][j] = \"0\";\n }\n }\n }", "static public ArrayList<Integer> SommerVecteur(ArrayList<Integer> vect1,ArrayList<Integer> vect2)throws TailleException\n {\n \n ArrayList<Integer> vect3 =new ArrayList<Integer>();//déclaration de la liste qui cintient le résultat de la somme\n int ind=0;//indice des éléments dans la nouvelle liste\n if(vect1.size()!= vect2.size())//test qui la taille des deux listes est différente\n {\n System.out.println(\"les deux vecteurs ont des tailles différentes ! vous pouvez pas faire la somme\");//afficher qu'on peut pas faire la somme des deux vecteurs\n throw new TailleException();//générer une excdeption si la taille est différente\n }\n else{//sinon on peut faire la somme\n int indice;//un indice pour parcourir les deux vecteurs\n \n for(indice=0;indice<vect1.size();indice++)//boucle pour parcourir les deux vecteurs\n { \n ind = vect1.get(indice)+vect2.get(indice);//effectuer la somme entre les deux éléments des deux vecteurs\n vect3.add(ind);//ajouter la somme obtenue a la nouvelle liste\n \n }\n return(vect3); //retourner la liste qui contient la somme \n }\n \n \n \n }", "public void calculEtatSuccesseur() { \r\n\t\tboolean haut = false,\r\n\t\t\t\tbas = false,\r\n\t\t\t\tgauche = false,\r\n\t\t\t\tdroite = false,\r\n\t\t\t\thautGauche = false,\r\n\t\t\t\tbasGauche = false,\r\n\t\t\t\thautDroit = false,\r\n\t\t\t\tbasDroit = false;\r\n\t\t\r\n\t\tString blanc = \" B \";\r\n\t\tString noir = \" N \";\r\n\t\tfor(Point p : this.jetonAdverse()) {\r\n\t\t\tString [][]plateau;\r\n\t\t\tplateau= copieEtat();\r\n\t\t\tint x = (int) p.getX();\r\n\t\t\tint y = (int) p.getY();\r\n\t\t\tif(this.joueurActuel.getCouleur() == \"noir\") { //dans le cas ou le joueur pose un pion noir\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) { //on regarde uniquement le centre du plateaau \r\n\t\t\t\t\t//on reinitialise x,y et plateau a chaque étape\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tdroite = getDroite(x,y,blanc);\r\n\t\t\t\t\thaut = getHaut(x, y, blanc);\r\n\t\t\t\t\tbas = getBas(x, y, blanc);\r\n\t\t\t\t\tgauche = getGauche(x, y, blanc);\r\n\t\t\t\t\thautDroit = getDiagHautdroite(x, y, blanc);\r\n\t\t\t\t\thautGauche = getDiagHautGauche(x, y, blanc);\r\n\t\t\t\t\tbasDroit = getDiagBasDroite(x, y, blanc);\r\n\t\t\t\t\tbasGauche = getDiagBasGauche(x, y, blanc);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y-1]==noir) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(droite) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//1\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==noir) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(bas) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==noir) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(gauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(haut) {\r\n\t\t\t\t\t\t\t//System.out.println(\"regarde en dessous\");\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==noir) {\r\n\t\t\t\t\t\tif(hautGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(basGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit : OK!\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(hautDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==noir) {\r\n\t\t\t\t\t\tif(basDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t//System.out.println(\"ajouté!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {//si le joueur actuel a les pions blanc\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x][y-1]==blanc) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(getDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\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\t}//1.1\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==blanc) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getBas(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2.2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==blanc) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getGauche(x, y, noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3.3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == blanc) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getHaut(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4.4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5.5\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//6.6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautdroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7.7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8.8\r\n\r\n\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}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void inicializarSolucion() {\n this.sol.numVerticesEmparejados = 0;\n this.sol.pesoEmparejamiento = 0;\n int size = this.G.numVertices();\n this.sol.emparejamientos = new int[size][size];\n for(int i = 0; i < size; ++i) {\n for(int j = 0; j < size; ++j) {\n if(i != j) this.sol.emparejamientos[i][j] = 0;\n else {\n this.sol.emparejamientos[i][j] = Integer.MAX_VALUE;\n }\n }\n }\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}", "void TakeFood(){\r\n if (plateau[this.x][this.y]!='0' && this.charge=='0'){\r\n this.charge+=this.plateau[this.x][this.y];\r\n this.plateau[this.x][this.y]='0';\r\n }\r\n }", "ArrayList<Float> pierwszaPredykcjaNormal()\n\t{\n\t\tif (Stale.cenyZGeneratora)\n\t\t{\n\t\t\tArrayList<Float> listaSumarycznejGeneracji = listaProsumentowWrap.getListaSumarycznejGeneracji(LokalneCentrum.getTimeIndex());\n\t\t\tArrayList<Float> listaSumarycznejKonsumpcji = listaProsumentowWrap.getListaSumarycznejKonsumpcji(LokalneCentrum.getTimeIndex());\n\n\t\t\treturn predictPrice(listaSumarycznejGeneracji,listaSumarycznejKonsumpcji);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tArrayList<Float> proposedPriceVector = pierwszaPredykcjaWezPredykcjeZListy();\n\t\t\t\n\t\t\t//jezeli brakuje elementow w plikyu do pelnej predykcji an horyzont czasowy to uuzplenij dnaymi z modelu\n\t\t\tif (proposedPriceVector.size()<Stale.horyzontCzasowy)\n\t\t\t{\n\t\t\t\tArrayList<Float> listaSumarycznejGeneracji = listaProsumentowWrap.getListaSumarycznejGeneracji(LokalneCentrum.getTimeIndex());\n\t\t\t\tArrayList<Float> listaSumarycznejKonsumpcji = listaProsumentowWrap.getListaSumarycznejKonsumpcji(LokalneCentrum.getTimeIndex());\n\t\t\t\tArrayList<Float> cenyZmodelu =predictPrice(listaSumarycznejGeneracji,listaSumarycznejKonsumpcji);\n\t\t\t\t\n\t\t\t\tproposedPriceVector = polaczListy(proposedPriceVector, cenyZmodelu);\n\t\t\t\t\n\t\t\t\tif (proposedPriceVector.size()!=Stale.horyzontCzasowy)\n\t\t\t\t{\n\t\t\t\t\tgetInput(\"ERROR in pierwszaPredykcjaNormal\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn proposedPriceVector;\n\t\t\t//podaj predykcje taka jak wynika z podanego pliku\n\t\t\t//getInput(\"Fill this part out - wczytaj rpedykcje z pliku!\");\n\t\t\t//return new ArrayList<Float>();\n\t\t}\n\t}", "VectorArray getNeutHar();", "public static int ruolette(ArrayList<Integer> fitvalores, ArrayList<int[]> poblacion, int semilla){ \n int totalfitnes = 0;\n int totalfitnesnuevo = 0;\n int indtablero = 0;\n int semi=semilla;\n int tpoblacion=poblacion.size();\n int []nuevofitness = new int [fitvalores.size()];\n double []nproporcion = new double [fitvalores.size()];\n ArrayList <Double> proporcion = new ArrayList<>();//proporcion j la ruleta\n ArrayList <Double> ruleta = new ArrayList<>();\n //obtener el max fitnes\n for(int i=0;i<fitvalores.size();i++){ //total de fitnes\n totalfitnes=totalfitnes+fitvalores.get(i);\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el nuevo fittnes inverso\n double pro=(tpoblacion*tpoblacion-tpoblacion)-fitvalores.get(i);\n nuevofitness[i]= (int) pro;\n // System.out.println(\"nuevo fitnes\"+nuevofitness[i]);\n } \n for(int i=0;i<fitvalores.size();i++){ //total de fitnes nuevo o inverso\n totalfitnesnuevo=(totalfitnesnuevo+nuevofitness[i]);//para que los mejores casos usen mas espacio\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n double var1=nuevofitness[i];\n double var2=totalfitnesnuevo;\n double pro=var1/var2;\n nproporcion[i]=pro;\n //System.out.println(\"nueva proporcion \"+nproporcion[i]);\n } \n ruleta.add(nproporcion[0]);\n // System.out.println(\"primera propporniaso \"+nproporcion[0]);\n for(int i=1;i<fitvalores.size();i++){ //poner datos en la ruleta\n double var1=ruleta.get(i-1);\n double var2=nproporcion[i];\n ruleta.add(var1+var2);\n //System.out.println(\"ruleta \"+ruleta.get(i));\n }\n double num=randomadec(0,1,semi);\n // System.out.println(\"numero random dec \"+num); \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n // System.out.println(ruleta.get(i));\n if(num<ruleta.get(i)){\n indtablero=i;\n //System.out.println(\"se guardo el tablero \"+indtablero);\n break;\n }\n }\n return indtablero;//esto devuelve el indice del tablero ganador en la ruleta\n }", "public void getVentasdeUNVendedor(int v) {\r\n double vVendedor[] = new double[nm];\r\n int j;\r\n for (j = 0; j < nm; j++) {\r\n vVendedor[j] = ventas[v][j];\r\n }\r\n getMostrarVec(vVendedor);\r\n }", "public void SiguienteCancion(View view){\n //Verificamos si nuestro indice esta en la posicion 0\n if(posicion < vector_mp.length -1){//-1 evita el desbordamiento de memoria\n // Si nuestro indice es menor al ancho de nuestro vector, permite que nuestro indice siga recorriendo el vector\n //Verifica que nuestro vector en tal posicion este reprodcuiendo una cancion\n if(vector_mp[posicion].isPlaying()){\n //Detiene la pista que se esta reproduciendo para poder reproducir la siguiente\n vector_mp[posicion].stop();\n //Ayudamos a nuestro indice a recorrer el vector\n posicion++;\n //La siguiente posicion/cancion debe empezar a reproducirse\n vector_mp[posicion].start();\n\n //cambio de portada\n if(posicion == 0){\n iv.setImageResource(R.drawable.portada1);;\n } else if(posicion == 1){\n iv.setImageResource(R.drawable.portada2);\n } else if(posicion == 2){\n iv.setImageResource(R.drawable.portada3);\n }\n\n } else {\n //Solo incrementa la posicion ya que al no estar reproduciendo no tiene caso detener\n posicion++;\n\n //cambio de portada\n if(posicion == 0){\n iv.setImageResource(R.drawable.portada1);;\n } else if(posicion == 1){\n iv.setImageResource(R.drawable.portada2);\n } else if(posicion == 2){\n iv.setImageResource(R.drawable.portada3);\n }\n\n }\n\n } else{\n //Si nuestro inidice posicion ya recorrio el vector indicara que no hay mas canciones y asi evitar un desbordamiento de memoria\n Toast.makeText(this, \"No hay mas canciones\", Toast.LENGTH_SHORT).show();\n }\n }", "Punto(){\r\n x=0;\r\n y=0;\r\n }", "public boolean isVector() {\n return mat.getNumRows() == 1 || mat.getNumCols() == 1;\n }", "int compteMonstres(Soldat unites[][]);", "PlateauGauffre(int largeur, int hauteur)\n {\n this(new Boolean[largeur][hauteur]);\n for (int x = 0; x < getLargeur(); x++)\n {\n for (int y = 0; y < getHauteur(); y++)\n {\n setAt(x, y, true);\n }\n }\n }", "public Coordinates unitVector(Coordinates vector);", "public void calcularPesos(){\r\n StructursDecisors.weightsDecisors=new ArrayList();\r\n double [][] matrizEigenvectors=createMatriz();\r\n for(int i=0; i<Structurs.names.size();i++)\r\n for(int j=0; j<StructursDecisors.names.size(); j++)\r\n System.out.println(\"MatrizEigenvector[\"+i+\"][\"+j+\"]\"+\"=\"+matrizEigenvectors[i][j]);\r\n double eigenvectorCriterios[]=new double[Structurs.eigenvector.size()];\r\n for(int i=0; i<Structurs.eigenvector.size(); i++)\r\n eigenvectorCriterios[i]=(double) Structurs.eigenvector.get(i);\r\n double []vectorPesos=createArrayPesos(matrizEigenvectors, eigenvectorCriterios);\r\n \r\n }", "ArrayList<Float> pierwszaPredykcja()\n\t{\n\t\tif (Stale.scenariusz<100)\n\t\t{\n\t\t\treturn pierwszaPredykcjaNormal();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//dla scenariusza testowego cnea predykcji jest ustawiana na 0.30\n\t\t\tArrayList<Float> L1 = new ArrayList<>();\n\t\t\tL1.add(0.30f);\n\t\t\treturn L1;\n\t\t}\n\t}", "void setupPointScaleFree() {\n\t\tbeginOffsetP.set(P);\n\n\t\tleftOppositeLine = neighborOppositeLinesFromPoint(selectedPoint)[0];\n\t\trightOppositeLine = neighborOppositeLinesFromPoint(selectedPoint)[1];\n\t\tleftOppositeLine.resetLockPoints(P);\n\t\trightOppositeLine.resetLockPoints(P);\n\t\tbeginP.set(P);\n\t\tbeginOffsetP.set(P);\n\n\t\tbeginOffset.set(P); // lock the beginning position of the\n\t\t\t\t\t\t\t// offset vector\n\t\tbeginOffsetP.set(point[selectedPoint].position); // lock the beginning\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of the vector to\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// be transformed\n\n\t\tleftOppositeLine.isOnThisSideOfLine = leftOppositeLine.checkLineSide(P); // check\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// on\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// which\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// side\n\t\t\t\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\t\t\t// the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// mirror\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// are\n\t\trightOppositeLine.isOnThisSideOfLine = rightOppositeLine.checkLineSide(P);\n\t}", "private void setPointsAs0() {\n\n for (int counter = 0; counter < countOfPoints; counter++) {\n points[counter] = new Point(0,0);\n }\n\n }", "private void pasar_a_matriz_adyacencia() {\n table_panel1.eliminar_All();//elimino todo los elemento de la matrices\n Grafo g = panel.getGrafo();//saco el grafo del panel\n data_fila[] dato = new data_fila[g.size_vertice()];//hago de una arreglo de vectores \n for (int i = 0; i < g.size_vertice(); i++) {//estructuras de datos\n dato[i] = new data_fila();\n }\n\n for (int i = 0; i < g.size_vertice(); i++) {\n Vertices A = g.get_vertices(i);\n dato[i].setNombre(A.getNombre());\n for (int j = 0; j < g.size_vertice(); j++) {\n if (j != i) {\n Vertices B = g.get_vertices(j);\n int peso =A.adyacencia(B);\n if (peso != Integer.MIN_VALUE) {\n dato[i].setArry(j, peso);\n }\n\n }\n }\n table_panel1.add(dato[i]);\n }\n }", "@Override\n\tpublic IVector mutiraj(IVector jedinka, Double p) {\n\t\treturn null;\n\t}", "public static double[] solve(double[][] matrix, double[] vector) {\r\n // Merken der Spalte, welche eine Zahl ungleich null besitzt\r\n int tmpColumn = -1;\r\n\r\n // Alle Zeilen durchgehen: Ziel der for-Schleife -> Matrix in\r\n // Zeilenstufenform bringen!\r\n // -> Alle Zahlen unterhalb der Diagonale sind null\r\n for (int line = 0; line < matrix.length; line++) {\r\n\r\n tmpColumn = -1;\r\n\r\n // Umformungsschritt 1: Finden einer Spalte mit einem Wert ungleich null\r\n for (int column = 0; column < matrix[line].length; column++) {\r\n\r\n for (int row = line; row < matrix.length; row++) {\r\n\r\n if (matrix[row][column] != 0) {\r\n tmpColumn = column;\r\n break;\r\n }\r\n }\r\n\r\n // Abbruch, zahl ungleich null wurde gefunden\r\n if (tmpColumn != -1) {\r\n break;\r\n }\r\n }\r\n\r\n // NullZeile(n) entdeckt!\r\n if (tmpColumn == -1) {\r\n\r\n for (int row = line; row < matrix.length; row++) {\r\n\r\n // Gleichungssystem hat keine Loesung!\r\n if (vector[line] != 0) {\r\n System.out.println(\"Gleichungssystem besitzt keine Loesung!\");\r\n return null;\r\n }\r\n }\r\n // Nullzeile(n) vorhanden -> Ist das System noch eindeutig loesbar?\r\n if (matrix[0].length - 1 >= line) {\r\n // System nicht eindeutig loesbar.\r\n System.out.println(\"Gleichungssystem nicht eindeutig loesbar!\");\r\n return null;\r\n }\r\n break;\r\n }\r\n\r\n // Umformungsschritt 2: Die Zahl matrix[line][tmpColumn] soll UNgleich\r\n // null sein\r\n if (matrix[line][tmpColumn] == 0) {\r\n\r\n for (int row = line + 1; row < matrix.length; row++) {\r\n\r\n if (matrix[row][tmpColumn] != 0) {\r\n // Vertauschen von Zeilen -> matrix[line][tmpColumn] wird dann\r\n // ungleich null\r\n swapTwoLines(line, row, matrix, vector);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Umformungsschritt 3: matrix[line][tmpColumn] soll gleich 1 sein.\r\n if (matrix[line][tmpColumn] != 0) {\r\n\r\n // Division der Zeile mit matrix[line][tmpColumn]\r\n divideLine(line, matrix[line][tmpColumn], matrix, vector);\r\n }\r\n\r\n // Umformungsschritt 4: Alle Zahlen unter matrix[line][tmpColumn] sollen\r\n // null sein.\r\n for (int row = line + 1; row < matrix.length; row++) {\r\n // Subtraktion damit unter der Zahl im Umformungsschritt 3 nur nullen\r\n // stehen\r\n removeRowLeadingNumber(matrix[row][tmpColumn], line, row, matrix,\r\n vector);\r\n }\r\n }\r\n\r\n // Umformungsschritt 6: Matrix in Normalform bringen (Zahlen oberhalb der\r\n // Diagonale werden ebenfalls zu null)\r\n for (int column = matrix[0].length - 1; column > 0; column--) {\r\n\r\n // Alle Werte oberhalb von \"column\" werden zu null\r\n for (int row = column; row > 0; row--) {\r\n\r\n // Dazu wird Subtraktion angewandt\r\n removeRowLeadingNumber(matrix[row - 1][column], column, row - 1,\r\n matrix, vector);\r\n }\r\n }\r\n\r\n // Unser ehemaliger Loesungsvektor ist jetzt zu unserem Zielvektor geworden\r\n // :)\r\n return vector;\r\n }", "public static int[][] trabalhaMatriz(QRCode qr, BitVector vector){\n \tint versao = qr.getVersion().getBits();\n \tint ecLevel = qr.getErrorCorrectionLevel().getBits();\n int[][] a = new int[largura][altura];\n\n //instanciacao elemento a elemento dos arrays\n int m=0, n=0;\n for(m=0; m<largura; m++)\n for(n=0; n<altura; n++)\n a[m][n]=3; //valor de iniciacao = indica disponibilidade de uso\n\n //System.err.println(\"Debugando em 2\");\n \n //Desenha os Detectores de Posicao da Mascara\n int aX=3, aY=3;\n\n //formando os quadrados de dentro pra fora\n //quadrado superior esquerdo\n a[aX][aY]=1;\n a[aX-1][aY-1]=1; a[aX][aY-1]=1;a[aX+1][aY-1]=1;a[aX+1][aY]=1;a[aX+1][aY+1]=1;a[aX][aY+1]=1;a[aX-1][aY+1]=1;a[aX-1][aY]=1;\n a[aX-2][aY-2]=0;a[aX-1][aY-2]=0;a[aX][aY-2]=0;a[aX+1][aY-2]=0;a[aX+2][aY-2]=0;a[aX+2][aY-1]=0;a[aX+2][aY]=0;a[aX+2][aY+1]=0;a[aX+2][aY+2]=0;a[aX+1][aY+2]=0;a[aX][aY+2]=0;a[aX-1][aY+2]=0;a[aX-2][aY+2]=0;a[aX-2][aY+1]=0;a[aX-2][aY]=0;a[aX-2][aY-1]=0;\n a[aX-3][aY-3]=1;a[aX-2][aY-3]=1;a[aX-1][aY-3]=1;a[aX][aY-3]=1;a[aX+1][aY-3]=1;a[aX+2][aY-3]=1;a[aX+3][aY-3]=1;a[aX+3][aY-2]=1;a[aX+3][aY-1]=1;a[aX+3][aY]=1;a[aX+3][aY+1]=1;a[aX+3][aY+2]=1;a[aX+3][aY+3]=1;a[aX+2][aY+3]=1;a[aX+1][aY+3]=1;a[aX][aY+3]=1;a[aX-1][aY+3]=1;a[aX-2][aY+3]=1;a[aX-3][aY+3]=1;a[aX-3][aY+2]=1;a[aX-3][aY+1]=1;a[aX-3][aY]=1;a[aX-3][aY-1]=1;a[aX-3][aY-2]=1;\n for(int g=aX-3; g<8; g++)\n a[g][aY+4]=0;\n for(int f=aY+4; f>=0; f--)\n a[aX+4][f]=0;\n\n //quadrado inferior esquerdo\n aX=3; aY=altura-4;\n a[aX][aY]=1;\n a[aX-1][aY-1]=1; a[aX][aY-1]=1;a[aX+1][aY-1]=1;a[aX+1][aY]=1;a[aX+1][aY+1]=1;a[aX][aY+1]=1;a[aX-1][aY+1]=1;a[aX-1][aY]=1;\n a[aX-2][aY-2]=0;a[aX-1][aY-2]=0;a[aX][aY-2]=0;a[aX+1][aY-2]=0;a[aX+2][aY-2]=0;a[aX+2][aY-1]=0;a[aX+2][aY]=0;a[aX+2][aY+1]=0;a[aX+2][aY+2]=0;a[aX+1][aY+2]=0;a[aX][aY+2]=0;a[aX-1][aY+2]=0;a[aX-2][aY+2]=0;a[aX-2][aY+1]=0;a[aX-2][aY]=0;a[aX-2][aY-1]=0;\n a[aX-3][aY-3]=1;a[aX-2][aY-3]=1;a[aX-1][aY-3]=1;a[aX][aY-3]=1;a[aX+1][aY-3]=1;a[aX+2][aY-3]=1;a[aX+3][aY-3]=1;a[aX+3][aY-2]=1;a[aX+3][aY-1]=1;a[aX+3][aY]=1;a[aX+3][aY+1]=1;a[aX+3][aY+2]=1;a[aX+3][aY+3]=1;a[aX+2][aY+3]=1;a[aX+1][aY+3]=1;a[aX][aY+3]=1;a[aX-1][aY+3]=1;a[aX-2][aY+3]=1;a[aX-3][aY+3]=1;a[aX-3][aY+2]=1;a[aX-3][aY+1]=1;a[aX-3][aY]=1;a[aX-3][aY-1]=1;a[aX-3][aY-2]=1;\n for(int g=aX-3; g<8; g++)\n a[g][aY-4]=0;\n for(int f=aY-4; f<altura; f++)\n a[aX+4][f]=0;\n\n //quadrado superior direito\n aX=largura-4; aY=3;\n a[aX][aY]=1;\n a[aX-1][aY-1]=1; a[aX][aY-1]=1;a[aX+1][aY-1]=1;a[aX+1][aY]=1;a[aX+1][aY+1]=1;a[aX][aY+1]=1;a[aX-1][aY+1]=1;a[aX-1][aY]=1;\n a[aX-2][aY-2]=0;a[aX-1][aY-2]=0;a[aX][aY-2]=0;a[aX+1][aY-2]=0;a[aX+2][aY-2]=0;a[aX+2][aY-1]=0;a[aX+2][aY]=0;a[aX+2][aY+1]=0;a[aX+2][aY+2]=0;a[aX+1][aY+2]=0;a[aX][aY+2]=0;a[aX-1][aY+2]=0;a[aX-2][aY+2]=0;a[aX-2][aY+1]=0;a[aX-2][aY]=0;a[aX-2][aY-1]=0;\n a[aX-3][aY-3]=1;a[aX-2][aY-3]=1;a[aX-1][aY-3]=1;a[aX][aY-3]=1;a[aX+1][aY-3]=1;a[aX+2][aY-3]=1;a[aX+3][aY-3]=1;a[aX+3][aY-2]=1;a[aX+3][aY-1]=1;a[aX+3][aY]=1;a[aX+3][aY+1]=1;a[aX+3][aY+2]=1;a[aX+3][aY+3]=1;a[aX+2][aY+3]=1;a[aX+1][aY+3]=1;a[aX][aY+3]=1;a[aX-1][aY+3]=1;a[aX-2][aY+3]=1;a[aX-3][aY+3]=1;a[aX-3][aY+2]=1;a[aX-3][aY+1]=1;a[aX-3][aY]=1;a[aX-3][aY-1]=1;a[aX-3][aY-2]=1;\n for(int g=aX-3; g<largura; g++)\n a[g][aY+4]=0;\n for(int f=aY-3; f<8; f++)\n a[aX-4][f]=0;\n\n //Adjustment Pattern = ajuste padronizado\n int auxilia0[]=getListaAdjustmentPattern(versao);\n if(auxilia0[0]!=0){\n for(int hi=0; hi<auxilia0.length; hi++){\n aX=auxilia0[hi];\n for(int hj=0; hj<auxilia0.length; hj++){\n aY=auxilia0[hj];\n if(a[aX][aY]==3){\n a[aX][aY]=1;\n a[aX-1][aY-1]=0;a[aX][aY-1]=0;a[aX+1][aY-1]=0;a[aX+1][aY]=0;a[aX+1][aY+1]=0;a[aX][aY+1]=0;a[aX-1][aY+1]=0;a[aX-1][aY]=0;\n a[aX-2][aY-2]=1;a[aX-1][aY-2]=1;a[aX][aY-2]=1;a[aX+1][aY-2]=1;a[aX+2][aY-2]=1;a[aX+2][aY-1]=1;a[aX+2][aY]=1;a[aX+2][aY+1]=1;a[aX+2][aY+2]=1;a[aX+1][aY+2]=1;a[aX][aY+2]=1;a[aX-1][aY+2]=1;a[aX-2][aY+2]=1;a[aX-2][aY+1]=1;a[aX-2][aY]=1;a[aX-2][aY-1]=1;\n }\n }\n }\n }\n\n //System.err.println(\"Debugando em 3\");\n\n //Caminho dos Timing Patterns\n // *Horizontal\n int x=0, y=0;\n for(x=3+5, y=6; x<largura-8; x++){\n if(x%2==0){\n a[x][y]=1;//infoTimingH[x-8];}\n } else {\n a[x][y]=0;}\n }\n // *Vertical\n for(x=3+3, y=3+5; y<largura-8; y++){\n if(y%2==0){\n a[x][y]=1;//infoTimingV[x-8];}\n } else {\n a[x][y]=0;}\n }\n\n //Desenha o Black pixel\n a[8][altura-8]=1;\n\n\n int z=0;\n //Type Version Information = Tipo de Informacao\n int[] typeInformationMask = getTypeInformationMask(ecLevel, 0);\n\n // *bit 0 a 7\n x=0; y=0;\n for(x=largura-1, y=8, z=14; x>largura-9; x--, z--)\n a[x][y]=typeInformationMask[z];\n for(x=8, y=0, z=14; y<9; y++)\n if(a[x][y]==3){\n a[x][y]=typeInformationMask[z];\n z--;\n }\n // *bit 8 a 14\n for(x=7, y=8, z=6; x>=0; x--)\n if(a[x][y]==3){\n a[x][y]=typeInformationMask[z];\n z--;\n }\n for(x=8, y=altura-7, z=6; y<altura; y++, z--)\n a[x][y]=typeInformationMask[z];\n\n //System.err.println(\"Debugando em 4\");\n\n //Version Information\n if(versao>=7){\n int[] versionInformation = getVersionInformation(versao);\n // *Vertical\n x=0; y=0; z=0;\n for(y=0, x=largura-11, z=0; y<7 && z<18; y++)\n for(x=largura-11; x<largura-8; x++, z++)\n a[x][y]=versionInformation[z];\n\n // *Horizontal\n x=0; y=0; z=0;\n for(x=0, y=altura-11, z=0; x<7 && z<18; x++)\n for(y=altura-11; y<largura-8; y++, z++)\n a[x][y]=versionInformation[z];\n }\n\n //System.err.println(\"Debugando em 5\");\n \n //Insercao do Vetor Data de Binario\n int loop=largura-1;\n int aI=0;\n x=largura-1; y=altura-1;\n int teste=0;\n int itera=0;\n do{\n \t System.out.println(vector.getBitWise(itera));\n for(y=largura-1, x=loop; y>=0 && (x==loop || x==loop-1) && loop>=0; y--){\n x=loop;\n if(UseMaskPatt(x,y,0)==1 && a[x][y]==3) {\n if(vector.getBitWise(itera)==1)\n a[x][y]=0;\n else\n a[x][y]=1;\n itera++;\n aI=itera;\n } else if(UseMaskPatt(x,y,0)==0 && a[x][y]==3){\n a[x][y]=vector.getBitWise(itera);\n itera++;\n aI=itera;\n }\n if(loop>0){\n x=loop-1;\n if(UseMaskPatt(x,y,0)==1 && a[x][y]==3) {\n if(vector.getBitWise(itera)==1)\n a[x][y]=0;\n else\n a[x][y]=1;\n itera++;\n aI=itera;\n } else if(UseMaskPatt(x,y,0)==0 && a[x][y]==3){\n a[x][y]=vector.getBitWise(itera);\n itera++;\n aI=itera;\n }\n }\n }\n if(aI!=0)\n loop=loop-2;\n for(y=0, x=loop; y<=largura-1 && (x==loop || x==loop-1) && loop>=0; y++){\n x=loop;\n if(UseMaskPatt(x,y,0)==1 && a[x][y]==3) {\n if(vector.getBitWise(itera)==1)\n a[x][y]=0;\n else\n a[x][y]=1;\n itera++;\n aI=itera;\n } else if(UseMaskPatt(x,y,0)==0 && a[x][y]==3){\n a[x][y]=vector.getBitWise(itera);\n itera++;\n aI=itera;\n }\n if(loop>0){\n x=loop-1;\n if(UseMaskPatt(x,y,0)==1 && a[x][y]==3) {\n if(vector.getBitWise(itera)==1)\n a[x][y]=0;\n else\n a[x][y]=1;\n itera++;\n aI=itera;\n } else if(UseMaskPatt(x,y,0)==0 && a[x][y]==3){\n a[x][y]=vector.getBitWise(itera);\n itera++;\n aI=itera;\n }\n }\n }\n if(aI!=0)\n loop=loop-2;\n aI=0;\n if(x<=0 && y<=0) break;\n //System.err.println(\"Debugando em 6... com itera: \"+itera+\" e aI: \"+aI+\" e x: \"+x+\" e y: \"+y);\n }while(itera<(vector.getOffset()));\n\n\n System.err.println(\"[1] Matriz de inteiros como representacao do QR Code gerada com sucesso!\");\n System.out.println(\"Ultimo valor do itera: \"+itera);\n\n System.err.println(\"[1.5] Testando Penalizar Máscara!\");\n System.out.println(\"Valor de penalização: \"+PenalizeMask.TestMask(a, largura));\n\n return a;\n }", "public ArrayList<Integer> mutariPosibile(int[][] tabla) {\r\n\t\tArrayList<Integer> mutari = new ArrayList<Integer>();\r\n\t\tint x = this.x;\r\n\t\tint y = this.y;\r\n\t\t\r\n\t\tif (tabla[x][y - 1] == 1)\r\n\t\t\tmutari.add(4);\r\n\t\tif (tabla[x][y + 1] == 1)\r\n\t\t\tmutari.add(2);\r\n\t\tif (tabla[x - 1][y] == 1)\r\n\t\t\tmutari.add(1);\r\n\t\tif (tabla[x + 1][y] == 1)\r\n\t\t\tmutari.add(3);\r\n\t\t\r\n\t\treturn mutari;\r\n\t}", "public Vector mapPseudoDocument(Vector doc) {\n //logger.info(\"lsm.mapPseudoDocument \" + doc);\n // N = Uk.rows();\n float[] pdoc = new float[Uk[0].length];\n\n //logger.info(\"Uk.size \" + Uk.length + \" X \" + Uk[0].length);\n //logger.info(\"doc.size \" + doc.size());\n //logger.info(\"pdoc.size \" + pdoc.length);\n\n //for (int j=0;j<doc.size();j++)\n //\tlogger.info(j + \" \" + doc.get(j));\n\n for (int i = 0; i < Uk[0].length; i++) {\n Iterator<Integer> it = doc.nonZeroElements();\n for (int j = 0; it.hasNext(); j++) {\n Integer index = it.next().intValue();\n //logger.info(i + \", i: \" + index);\n //logger.info(i + \", v:\" + doc.get(index));\n //logger.info(i + \", Uk: \" + Uk[index][i]);\n pdoc[i] += Uk[index][i] * doc.get(index);\n\n } // end for j\n } // end for i\n\n //logger.info(\"pdoc.size \" + pdoc.length);\n return new DenseVector(pdoc);\n }", "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "public void limpiarMesa() {\n for (int i = 0; i < mesa.length; i++) {\n mesa[i][1] = 0;\n }\n }", "@org.junit.Test\n public void inverser_vector() throws Exception {\n //voici un commentaire\n Vector<Integer> inppuut = new Vector<Integer>();\n inppuut.add(1);\n inppuut.add(2);\n inppuut.add(3);\n inppuut.add(4);\n\n Vector<Integer> expec = new Vector<Integer>();\n expec.add(4);\n expec.add(3);\n expec.add(2);\n expec.add(1);\n\n VectorHelper.inverser_vector(inppuut);\n assertEquals(expec, inppuut);\n\n }", "private void aretes_aY(){\n\t\tthis.cube[49] = this.cube[43]; \n\t\tthis.cube[43] = this.cube[21];\n\t\tthis.cube[21] = this.cube[10];\n\t\tthis.cube[10] = this.cube[32];\n\t\tthis.cube[32] = this.cube[49];\n\t}", "public void insertar2(){\n for (int i = 0; i < tamano; i++) {\n vectorpila2[i]=(int) (Math.random() *100+1);\n \n cima++;\n }\n }", "public boolean isVector() {\n\t\treturn numeros.length == 1 || numeros[0].length == 1;\n\t}", "public void determined0d1() {\n\n\t\tint upperBound = (int) (Math.log(this.numNVertices + this.numWVertices)); // pg 184 in paper\n\n\t\tthis.d0 = upperBound / 2;\n\t\tthis.d1 = upperBound;\n\n\t}", "public int[] choisir(int[] coord)\r\n {\r\n int[] res = new int[3]; //tableau a rendre\r\n int x = coord[0];\r\n int y = coord[1]; //récupération des coordonnées\r\n int[] voisinage= new int[4]; //tableau qui regardera les cases adjacentes à la case cherchée\r\n voisinage[0] = getValHaut(x,y);\r\n voisinage[1] = getValDroite(x,y);\r\n voisinage[2] = getValBas(x,y);\r\n voisinage[3] = getValGauche(x,y);\r\n System.out.println(\"je choisis la case \"+x+\" \"+y+\"\");\r\n for(int i = 0; i<voisinage.length; i++ ) //parcours des possibilités si on joue sans créer d'opportunités adverses\r\n {\r\n if (Vision[x][y][i+1] == 0) //si il n'y a pas de trait déja tracé\r\n {\r\n if (voisinage[i] != 2) //si la case adjacente n'a pas déja deux traits dessinés\r\n {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n //fin du si la case adjacente a déja 2 traits dessinés\r\n }\r\n //si il n'y a pas de trait déja tracé\r\n }\r\n //fin du for de parcours des possibilités de jouers sans créer d'opportunités adverses\r\n\r\n for(int i=0; i<voisinage.length ; i++ ) //Parcours des possibilités sans recherche d'opportunités\r\n {\r\n if (Vision[x][y][i+1] == 0) {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n }\r\n //fin du parcours de possibilité sans recherche\r\n return tabVide;\r\n }", "public Celda[][] getestadosiguientejardin(){\n\t\treturn vectorjardin;\r\n\t}", "public ArrayList<Point> projection(Camera camera) {\n\t\tArrayList<Point> arr4 = new ArrayList<>();\n\n\t\tArrayList<Point> arr1 = new ArrayList<>();\n\t\tarr1.add(A2);\n\t\tarr1.add(B2);\n\t\tarr1.add(C2);\n\t\tarr1.add(D2);\n\n\t\tArrayList<Point> arr2 = intersection(camera); // array dung de duyet\n\t\tArrayList<Point> arr3 = inVision(camera);\n\n\t\tPlane oxy = new Plane(new Point(), new Point(0, 1, 0), new Point(1, 0, 0));\n\t\tPoint camPos = camera.getPosition();\n\n\t\tPoint first = arr2.remove(0);\n\t\tif (arr3.contains(first)) {\n\t\t\tLine l = new Line(first, camPos);\n\t\t\tarr4.add(l.intersection(oxy));\n\t\t} else {\n\t\t\tarr4.add(first);\n\t\t}\n\n\t\tif (arr1.size() == arr3.size()) { // Ca 4 dinh cua vat the nam trong tam nhin cua camera\n\t\t\tfor (Point element : arr1) {\n\t\t\t\tarr4.add(oxy.intersection(new Line(element, camPos)));\n\t\t\t}\n\t\t}\n\t\t// else if(arr3.size() == 0) {\n\t\t// arr4 = arr1;\n\t\t// }\n\t\telse {\n\t\t\t// duyet arr2\n\t\t\tfor (Point element : arr2) {\n\t\t\t\tif (arr1.contains(element)) {\n\t\t\t\t\tif (arr3.contains(element)) {\n\t\t\t\t\t\tPoint lastOfArr4 = arr4.get(arr4.size() - 1);\n\t\t\t\t\t\tPoint interPoint = oxy.intersection(new Line(element, camPos)); // Giao diem cua mp Oxy voi\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// duong thang noi giua camera\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// va element\n\n\t\t\t\t\t\tif (arr2.contains(lastOfArr4)) {\n\t\t\t\t\t\t\tarr4.add(element);\n\t\t\t\t\t\t\tarr4.add(interPoint);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tint nextElementIndex = arr2.indexOf(element) + 1;\n\t\t\t\t\t\t\tif (nextElementIndex < arr2.size()) {\n\t\t\t\t\t\t\t\tPoint nextELement = arr2.get(nextElementIndex);\n\t\t\t\t\t\t\t\tif (arr1.contains(nextELement) && !arr3.contains(nextELement)) {\n\t\t\t\t\t\t\t\t\tarr4.add(interPoint);\n\t\t\t\t\t\t\t\t\tarr4.add(element);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tarr4.add(interPoint);\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\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarr4.add(element);\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tPoint lastOfArr4 = arr4.get(arr4.size() - 1);\n\t\t\t\t\tPoint interPoint = oxy.intersection(new Line(element, camPos)); // Giao diem cua mp Oxy voi duong\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// thang noi giua camera va element\n\n\t\t\t\t\tif (arr2.contains(lastOfArr4)) {\n\t\t\t\t\t\tarr4.add(element);\n\t\t\t\t\t\tarr4.add(interPoint);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint nextElementIndex = arr2.indexOf(element) + 1;\n\t\t\t\t\t\tif (nextElementIndex < arr2.size()) {\n\t\t\t\t\t\t\tPoint nextELement = arr2.get(nextElementIndex);\n\t\t\t\t\t\t\tif (arr1.contains(nextELement) && !arr3.contains(nextELement)) {\n\t\t\t\t\t\t\t\tarr4.add(interPoint);\n\t\t\t\t\t\t\t\tarr4.add(element);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tarr4.add(interPoint);\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\n\t\tfor (Point element : arr4) {\n\t\t\telement.setZ(0);\n\t\t}\n\n\t\tif (arr4.get(0).compare(arr4.get(arr4.size() - 1))) {\n\t\t\tarr4.remove(arr4.size() - 1);\n\t\t}\n\n\t\treturn arr4;\n\t}", "public void setVectorCurrentRow(double[] data) {\r\n int i = getCurrentRow();\r\n for (int j = 0; j < data.length; j++) {\r\n if (j < this.getColumnCount()) {\r\n this.setLogicalValue(i, j, data[j], false);\r\n }\r\n }\r\n fireTableDataChanged();\r\n }", "private void m1do() {\n for (int i = 0; i < 2; i++) {\n this.my[i] = null;\n }\n for (int i2 = 0; i2 < 2; i2++) {\n this.mz[i2] = 0;\n }\n this.mC = 0.0d;\n this.lf = 0;\n }", "public abstract double[] getVector(int[] location);", "public void punishment(){\n\t\tthis.cell = 0;\n\t}", "@Override\r\n\tpublic vec3 minus() {\n\t\treturn null;\r\n\t}", "private void actualizarEnConsola() {\n\t\tfor(int i=0; i<elementos.size();i++){\n\t\t\tElemento e = elementos.get(i);\n\t\t\tSystem.out.println(e.getClass().getName()+\"- Posicion: , X: \"+e.getPosicion().getX()+\", Y: \"+ e.getPosicion().getY());\n\t\t}\n\t\t\n\t}", "public void moverIzquierda() {\n estado = EstadosPersonaje.IZQUIERDA;\n mover(new Vector2(-1, 0));\n }", "public int[] proximoBranco(){\n for(int i = 0; i < 9; i++){\n for (int j = 0; j < 9; j++){\n if(matriz[i][j] == 0){\n int [] aux = {i, j};\n return aux;\n }\n }\n }\n return null;\n }", "public Matriz( int lin, int col )\n {\n if(lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Quantidade invalida. \" );\n } //end\n else\n {\n table = new Object[lin][col];\n } //end se\n }" ]
[ "0.61636084", "0.61373365", "0.6100417", "0.6079218", "0.6071711", "0.5905865", "0.5896231", "0.58815116", "0.58164775", "0.5763077", "0.57402515", "0.56913203", "0.56845766", "0.5676095", "0.5639688", "0.5633557", "0.5631038", "0.5619166", "0.5596813", "0.55916774", "0.5548586", "0.55176467", "0.5517504", "0.55096966", "0.5509521", "0.54973394", "0.5490491", "0.54837954", "0.54744226", "0.5461914", "0.5452736", "0.54516006", "0.5437125", "0.5434968", "0.5413584", "0.5412273", "0.5412204", "0.5411118", "0.54090244", "0.54020536", "0.54002476", "0.53900176", "0.53874135", "0.53853583", "0.5383952", "0.5383508", "0.5375733", "0.53696454", "0.53684634", "0.5357635", "0.5353733", "0.5352918", "0.53487307", "0.53436315", "0.5343136", "0.534288", "0.5341305", "0.534079", "0.533832", "0.5329886", "0.532759", "0.5325423", "0.5324786", "0.5318752", "0.5315819", "0.5311246", "0.5309406", "0.5303979", "0.5303869", "0.53025377", "0.52971554", "0.5297081", "0.5295483", "0.5288651", "0.5286401", "0.5282609", "0.5282569", "0.5280052", "0.5278508", "0.52784085", "0.5273776", "0.5273437", "0.52724767", "0.526938", "0.52682906", "0.52648205", "0.52644193", "0.52518785", "0.52514887", "0.52511054", "0.5247542", "0.524705", "0.52467567", "0.5241177", "0.5237667", "0.5236409", "0.52351695", "0.52345973", "0.52309877", "0.5230145" ]
0.54976004
25
A function that returns the paths of the parts of a folder or the file in a list
protected static Path[] globInternal(Path folderOrFile, FileSystem fs) throws IOException { Path input = folderOrFile; Path[] files; if (fs != null && fs.exists(input)) { if (fs.isDirectory(input)) { input = new Path(input.toUri().toString() + "/part-*"); FileStatus[] fStatus= fs.globStatus(input); files = FileUtil.stat2Paths(fStatus); } else { Path[] temp = {input}; files = temp; } return files; } else return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<String> getListPaths();", "public abstract List<String> path();", "List<Path> getFiles();", "java.util.List<java.lang.String>\n getPathsList();", "abstract public List<S> getPath();", "protected abstract String[] getFolderList() throws IOException;", "public abstract List<String> getDirs( );", "public List<Path> getAllPaths();", "@Override\r\n\tpublic String[] listFolders() throws FileSystemUtilException {\r\n\t\t// getting all the files and folders in the given file path\r\n\t\tString[] files = listFiles();\r\n\t\tList foldersList = new ArrayList();\r\n\t\tfor (int i = 0; i < files.length; i++) {\r\n\t\t\t// all the folder are ends with '/'\r\n\t\t\tif (files[i].endsWith(\"/\") && isValidString(files[i])) {\r\n\t\t\t\tfoldersList.add(files[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tString[] folders = new String[foldersList.size()];\r\n\t\t// getting only folders from returned array of files and folders\r\n\t\tfor (int i = 0; i < foldersList.size(); i++) {\r\n\t\t\tfolders[i] = foldersList.get(i).toString();\r\n\t\t}\r\n\t\treturn folders;\r\n\r\n\t}", "public abstract List<String> getControlledPaths();", "List<String> getDirectories(String path) throws IOException;", "private String[] nlstHelper(String args) {\n // Construct the name of the directory to list.\n String filename = currDirectory;\n if (args != null) {\n filename = filename + fileSeparator + args;\n }\n\n // Now get a File object, and see if the name we got exists and is a\n // directory.\n File f = new File(filename);\n\n if (f.exists() && f.isDirectory()) {\n return f.list();\n } else if (f.exists() && f.isFile()) {\n String[] allFiles = new String[1];\n allFiles[0] = f.getName();\n return allFiles;\n } else {\n return null;\n }\n }", "public String[] list() {\n String[] list = _file.list();\n if (list == null) {\n return null;\n }\n for (int i = list.length; i-- > 0; ) {\n if (new File(_file, list[i]).isDirectory() && !list[i].endsWith(\"/\")) {\n list[i] += \"/\";\n }\n }\n return list;\n }", "public abstract List<String> getFiles( );", "public List<File> getFiles(List<String> stringlist);", "public void showDirPath(String[] list);", "public List<String> paths(String path) throws SystemException;", "public String listPath(List<String> arg) {\n String output = \"\";\n for (int path = 0; path < arg.size(); path++) {\n Directory tDir = Directory.getDir(arg.get(path));\n if (tDir == null) {\n output +=\n \"Error: The input path \" + arg.get(path) + \" doesn't exist!\\n\\n\";\n } else if (tDir.isFile) {\n output += tDir.getName();\n } else {\n for (int j = 0; j < tDir.getSubContent().size(); j++) {\n if (!tDir.getSubContent().get(j).isFile) {\n output += tDir.getSubContent().get(j).getName();\n Directory dir = tDir.getSubContent().get(j);\n if (!dir.getSubContent().isEmpty()) {\n output += \" : \";\n for (int k = 0; k < tDir.getSubContent().get(j).getSubContent()\n .size(); k++) {\n if (k != tDir.getSubContent().get(j).getSubContent().size()\n - 1) {\n output += tDir.getSubContent().get(j).getSubContent().get(k)\n .getName() + \", \";\n } else {\n output += tDir.getSubContent().get(j).getSubContent().get(k)\n .getName() + \"\\n\";\n }\n }\n } else {\n output += \"\\n\";\n }\n } else {\n output += tDir.getSubContent().get(j).getName() + \"\\n\";\n }\n }\n }\n }\n return output;\n }", "private void searchDFS(File[] files, ArrayList<String> list) {\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tif (file.getAbsolutePath().endsWith(GIT)) {\n\t\t\t\t\tgitDir = file.getAbsolutePath();\n\t\t\t\t}\n\t\t\t\tsearchDFS(file.listFiles(), list);\n\t\t\t} else {\n\t\t\t\tif (file.getName().endsWith(EXTENSION)) {\n\t\t\t\t\tlist.add(file.getAbsolutePath());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "List<IDirectory> getSourcePath();", "java.lang.String getPaths(int index);", "public abstract ScaledPathArray getPathList();", "public List listFiles(String path);", "public List<String> getFiles();", "List<String> getFiles(String path) throws IOException;", "protected abstract String[] getBaseFolders();", "List<String> getDirectories(String path, String searchPattern) throws IOException;", "public static String[] getFilePaths(String path, String parameter){\n\t\tString[] filePaths=null;\n\t\tif(parameter.trim().equals(\"-f\")){\n\t\t\tfilePaths=new String[1];\n\t\t\tfilePaths[0]=path;\n\t\t}\n\t\telse if(parameter.trim().equals(\"-d\")){\n\t\t\tfilePaths=new File(path).list();\n\t\t\tif(filePaths==null){\n\t\t\t\tfilePaths=new String[0];\n\t\t\t}\n\t\t\tString[] tmp=new String[filePaths.length];\n\t\t\tfor(int i=0;i<tmp.length;i++){\n\t\t\t\ttmp[i]=path+'/'+filePaths[i];\n\t\t\t}\n\t\t\tfilePaths=tmp;\n\t\t}\n\t\treturn filePaths;\n\t}", "List<File> list(String directory) throws FindException;", "public List<Node> findPath(Node start);", "private static void listChildren(Path p, List<String> list)\n throws IOException {\n for (Path c : p.getDirectoryEntries()) {\n list.add(c.getPathString());\n if (c.isDirectory()) {\n listChildren(c, list);\n }\n }\n }", "List<String> getDirectories(String path, String searchPattern, String searchOption) throws IOException;", "public void listFiles(String path) {\r\n String files;\r\n File folder = new File(path);\r\n File[] listOfFiles = folder.listFiles();\r\n\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n\r\n if (listOfFiles[i].isFile()) {\r\n files = listOfFiles[i].getName();\r\n if (files.endsWith(\".png\") || files.endsWith(\".PNG\")\r\n || files.endsWith(\".gif\") || files.endsWith(\".GIF\")) {\r\n //System.out.println(files);\r\n pathList.add(path+\"\\\\\");\r\n fileList.add(files);\r\n }\r\n }\r\n \r\n else {\r\n listFiles(path+\"\\\\\"+listOfFiles[i].getName());\r\n }\r\n }\r\n }", "private ArrayList<String> getTrackPathList() {\n String MEDIA_TRACKS_PATH = \"CuraContents/tracks\";\n File fileTracks = new File(Environment.getExternalStorageDirectory(), MEDIA_TRACKS_PATH);\n if (fileTracks.isDirectory()) {\n File[] listTracksFile = fileTracks.listFiles();\n ArrayList<String> trackFilesPathList = new ArrayList<>();\n for (File file1 : listTracksFile) {\n trackFilesPathList.add(file1.getAbsolutePath());\n }\n return trackFilesPathList;\n }\n return null;\n }", "public String[] getFolders() throws FileSystemUtilException\r\n\t{\r\n\t\t//getting all the files and folders in the given file path\r\n\t\tString[] files = listFiles();\r\n\t\tList<String> foldersList = new ArrayList<String>();\r\n\t\tfor(int i=0;i<files.length;i++){\r\n\t\t\t//all the folder are ends with '/'\r\n\t\t\tif(files[i].endsWith(\"/\") && isValidString(files[i])){\r\n\t\t\t\tfoldersList.add(files[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tString[] folders = new String[foldersList.size()];\r\n\t\t//getting only folders from returned array of files and folders\r\n\t\tfor(int i=0;i<foldersList.size();i++){\r\n\t\t\tfolders[i] = foldersList.get(i).toString();\r\n\t\t}\r\n\t\treturn folders;\r\n\t}", "private List<String> getFiles(String path){\n workDir = Environment.getExternalStorageDirectory().getAbsolutePath() + path;\n List<String> files = new ArrayList<String>();\n File file = new File(workDir);\n File[] fs = file.listFiles();\n for(File f:fs)\n if (f.isFile())\n files.add(String.valueOf(f).substring(workDir.length()));\n return files;\n }", "java.util.List<org.openxmlformats.schemas.drawingml.x2006.main.CTPath2D> getPathList();", "String folderPath();", "@Override\r\n\tpublic String globFilesDirectories(String[] args) {\r\n\t\treturn globHelper(args);\r\n\t}", "public List<String> getListFilePath() throws AncestryException {\n\t\tList<String> listFormKey = new ArrayList<String>();\n\t\tConnection con = null;\n\t\tString sql = \"\";\n\t\ttry {\n\t\t\tsql = \"SELECT filepath FROM \" + management + \" WHERE step =4 GROUP BY filepath ORDER BY filepath\";\n\t\t\tcon = db.getConnectByProject(project);\n\t\t\tlistFormKey = JdbcHelper.queryToSingleList(con, sql , true);\n\t\t} catch (Exception e) {\n\t\t\tthrow new AncestryException(\"getListFilePath : \" + e.toString() ,e);\n\t\t}\n\t\tfinally {\n\t\t\tJdbcHelper.close(con);\n\t\t}\n\t\treturn listFormKey;\n\t}", "java.util.List<java.lang.String>\n getProcessorpathList();", "private void get_file_List() {\n\tString file_name=null;\r\n\tfor (int i = 0; i < listOfFiles.length; i++) \r\n\t {\r\n\t \r\n\t if (listOfFiles[i].isFile()) \r\n\t {\r\n\t\t file_name = listOfFiles[i].getName();\r\n\t if (file_name.endsWith(\".xml\") || file_name.endsWith(\".XML\"))\r\n\t {\r\n\t file_list.add(file_name) ;\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n}", "java.util.List<ds.hdfs.generated.FileMetadata> \n getFilesList();", "public File[] CreateListFiles() {\n\t\tif (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n\t\t\tToast.makeText(this, \"Error! No SDCARD Found!\", Toast.LENGTH_LONG).show();\n\t\t} else {\n\t\t\tfile = new File(Environment.getExternalStorageDirectory(), File.separator + \"/MelanomaPics/\" + File.separator + MelanomaActivity.pacientSelected);\n\t\t\tfile.mkdirs();\n\t\t}\n\t\t// pega todas as imagens do diretorio MelanomaPics e coloca dentro de\n\t\t// uma lista\n\t\tif (file.isDirectory()) {\n\t\t\tlistFile = file.listFiles();\n\t\t}\n\t\treturn listFile;\n\t}", "public String[] listDirectory( String directory, FileType type );", "private List<String> getNotComputedFilesPath(String absolutePath) {\r\n\t\tList<String> res = new ArrayList<String>();\r\n\t\tFile f = new File(absolutePath);\r\n\t\tString[] list = f.list();\r\n\t\t\r\n\t\tfor(String s : list) {\r\n\t\t\tString elemPath = AppUtil.createFilePath(new String[]{absolutePath, s});\r\n\t\t\tif(!s.contains(COMPUTED_FILES_FOLDER_NM)) {\r\n\t\t\t\tFile f2 = new File(elemPath);\r\n\t\t\t\tif(f2.isDirectory()) {\r\n\t\t\t\t\tres.addAll(getNotComputedFilesPath(elemPath));\r\n\t\t\t\t} else if(f2.isFile()) {\r\n\t\t\t\t\tres.add(elemPath);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t}", "public static List<String> getFile(String path){\n File file = new File(path);\n // get the folder list\n File[] array = file.listFiles();\n\n List<String> fileName = new ArrayList<>();\n\n for(int i=0;i<array.length;i++){\n if(array[i].isFile()){\n // only take file name\n fileName.add(array[i].getName());\n }else if(array[i].isDirectory()){\n getFile(array[i].getPath());\n }\n }\n return fileName;\n }", "private static String files()\n\t{\n\t\tString path = dirpath + \"\\\\Server\\\\\";\n\t\tFile folder = new File(path);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tString msg1 = \"\";\n\n\t\tfor (int i = 0; i < listOfFiles.length; i++)\n\t\t{\n\t\t\tif (listOfFiles[i].isFile())\n\t\t\t{\n\t\t\t\tmsg1 = msg1 + \"&\" + listOfFiles[i].getName();\n\t\t\t}\n\t\t}\n\t\tmsg1 = msg1 + \"#\" + path + \"\\\\\";\n\t\treturn msg1;\n\t}", "private List<String> returnFiles(int selection) {\n\t\tString path = System.getProperty(\"user.dir\");\n\t\tList<String> allImages = new ArrayList<String>();\n\t\tpath += this.setFolderPath(selection);\n\t\tFile[] files = new File(path).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isFile() && isCorrectFile(file)) {\n\t\t\t\tallImages.add(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\treturn allImages;\n\t}", "private List<File> getFileList(File root){\n\t List<File> returnable = new ArrayList<File>();\n\t if(root.exists()){\n\t\t for(File currentSubFile : root.listFiles()){\n\t\t\t if(currentSubFile.isDirectory()){\n\t\t\t\t returnable.addAll(getFileList(currentSubFile));\n\t\t\t } else {\n\t\t\t\t returnable.add(currentSubFile);\n\t\t\t }\n\t\t }\n\t }\n\t return returnable;\n }", "public static List<String> getFiles(String path) {\n\t try {\n\t\t\tURI uri = getResource(path).toURI();\n\t\t String absPath = getResource(\"..\").getPath();\n\t\t\tPath myPath;\n\t\t\tif (uri.getScheme().equals(\"jar\")) {\n\t\t\t FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.<String, Object>emptyMap());\n\t\t\t myPath = fileSystem.getPath(path);\n\t\t\t \n\t\t\t} else {\n\t\t\t myPath = Paths.get(uri);\n\t\t\t}\n\t\t\t\n\t\t\t List<String> l = Files.walk(myPath)\t\n\t\t\t \t\t\t\t\t .map(filePath -> pathAbs2Rel(absPath, filePath))\n\t\t\t \t .collect(Collectors.toList());\n\t\t\t return l;\n\t\t} catch (URISyntaxException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return null;\n\t \n\t}", "public List<File> getFiles();", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "java.util.List<java.lang.String>\n getSourcepathList();", "private File[] getFiles() {\n\n if (mPPTFilePath == null) {\n mPPTFilePath = getArguments().getString(PPTPathString);\n }\n\n String Path = mPPTFilePath;\n File mFile = new File(Path);\n if (mFile.exists() && mFile.isDirectory() && mFile.listFiles()!=null) {\n\n return mFile.listFiles();\n } else {\n Log.d(TAG, \"File==null\");\n return null;\n }\n }", "public List<String> paths(TreeNode root){\r\n List<String> result = new ArrayList<>();\r\n if(root!=null){\r\n binaryTreePath(root, \"\", result);\r\n }\r\n for(String s: result){\r\n System.out.println(s);\r\n }\r\n return result;\r\n }", "public static List<File> goFolder(File file) {\n File[] files = file.listFiles();\n for (File f : files) {\n if (!f.isDirectory()) {\n if (isCondition(f)) {\n fileList.add(f);\n }\n } else {\n goFolder(f);\n }\n }\n return fileList;\n }", "public static List<String> getDrives(){\n root = new ArrayList<>();\n for(String temp : rootDir){\n File file = new File(temp);\n if(file.isDirectory()){\n root.add(temp);\n }\n }\n return root;\n }", "Path getRequestListFilePath();", "@Override\r\n public List<File> getValues(final String term) throws IOException {\n {\r\n File file = new File(term);\r\n // is a directory -> get all children\r\n if (file.exists() && file.isDirectory()) {\r\n return children(file, fileFilter);\r\n }\r\n File parent = file.getParentFile();\r\n // is not a directory but has parent -> get siblings\r\n if (parent != null && parent.exists()) {\r\n return children(parent, normalizedFilter(term));\r\n }\r\n }\r\n // case 2: relative path\r\n {\r\n for (File path : paths) {\r\n File file = new File(path, term);\r\n // is a directory -> get all children\r\n if (file.exists() && file.isDirectory()) {\r\n return toRelativeFiles(children(file, fileFilter), path);\r\n }\r\n File parent = file.getParentFile();\r\n // is not a directory but has parent -> get siblings\r\n if (parent != null && parent.exists()) {\r\n return toRelativeFiles(children(parent, normalizedFilter(file.getAbsolutePath())), path);\r\n }\r\n }\r\n }\r\n return Collections.emptyList();\r\n }", "File[] getFilesInFolder(String path) {\n return new File(path).listFiles();\n }", "java.util.List<java.lang.String>\n getSourcepathList();", "public static List<String> getFilesFromDirectory(){\n File wordTextFolder = new File(FOLDER_OF_TEXT_FILES.toString());\n File[] filesInsideFolder = wordTextFolder.listFiles();\n List<String> paths = new ArrayList<>();\n String name;\n\n for (File txtFile : filesInsideFolder){\n paths.add( txtFile.getPath() );\n name = txtFile.getName();\n name = name.substring(0, name.lastIndexOf('.'));\n\n if(name.length() > Table.maxFileNameLength){\n Table.setMaxFileNameLength(name.length());\n }\n }\n return paths;\n }", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public abstract List<LocalFile> getAllFiles();", "public List<Resource> getFileLocations() throws IOException;", "public ArrayList<File> getFileList(File file){\r\n\t\tFile dir = new File(file.getParent());\r\n\t\r\n\t\tString filename = file.getName();\r\n\t\t//get all files with the same beginning and end\r\n\t\tint index = filename.indexOf(\"Version\");\r\n\t\tString stringStart = filename.substring(0, index-1);\r\n\t\t\r\n\t\tArrayList<File> files = new ArrayList<File>();\r\n\t\t\r\n\t\tfor(File f:dir.listFiles()){\r\n\t\t\tif(f.getName().contains(stringStart))files.add(f);\r\n\t\t}\r\n\t\t\r\n\t\treturn files;\t\r\n\t}", "public List<PartialPath> getAllStorageGroupPaths() {\n List<PartialPath> res = new ArrayList<>();\n Deque<IMNode> nodeStack = new ArrayDeque<>();\n nodeStack.add(root);\n while (!nodeStack.isEmpty()) {\n IMNode current = nodeStack.pop();\n if (current.isStorageGroup()) {\n res.add(current.getPartialPath());\n } else {\n nodeStack.addAll(current.getChildren().values());\n }\n }\n return res;\n }", "private List<DMTFile> listFilesRecursive(String path) {\n\t\tList<DMTFile> list = new ArrayList<DMTFile>();\n\t\tDMTFile file = getFile(path); //Get the real file\n\t\t\n\t\tif (null != file ){ //It checks if the file exists\n\t\t\tif (! file.isDirectory()){\n\t\t\t\tlist.add(file);\n\t\t\t} else {\n\t\t\t\tDMTFile[] files = listFilesWithoutConsoleMessage(file.getPath());\n\t\t\t\tfor (int x = 0; x < files.length; x++) {\n\t\t\t\t\tDMTFile childFile = files[x];\t\t \n\t\t\t\t\tif (childFile.isDirectory()){\n\t\t\t\t\t\tlist.addAll(listFilesRecursive(childFile.getPath()));\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist.add(childFile);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public ArrayList<String> getDirFiles(String filePath){\n ArrayList<String> results = new ArrayList<String>();\n File[] files = new File(filePath).listFiles();\n\n for (File file : files){\n if (file.isFile()) {\n results.add(file.getName());\n }\n }\n return results;\n }", "@NonNull\n Single<List<String>> getFolderNames();", "public List<String> getPaths() {\n List<String> result;\n synchronized (this.paths) {\n result = this.paths;\n }\n return result;\n }", "private List<File> getSearchFiles() {\n\t\tif (searchDirs == null || searchDirs.size() <= 0) {\n\n\t\t\tsearchDirs = new ArrayList<File>();\n\t\t\t\n\t\t\tsearchDirs.add(StorageUtils.getLocalCacheDir(this));\n//\t\t\tsearchDirs.add(StorageUtils.getExternalCacheDir(this));\n\t\t\tsearchDirs.add(StorageUtils.getFavorDir(this));\n\t\t}\n\t\treturn searchDirs;\n\t}", "private List<String> processDirectory(Path path) {\n\t\treturn null;\r\n\t}", "List<String> getFiles(String path, String searchPattern) throws IOException;", "private File[] getFilesInDirectory() {\n\t\t//Show Directory Dialog\n\t\tDirectoryChooser dc = new DirectoryChooser();\n\t\tdc.setTitle(\"Select Menu File Directory\");\n\t\tString folderPath = dc.showDialog(menuItemImport.getParentPopup().getScene().getWindow()).toString();\n\t\t\n\t\t//Update Folder location text\n\t\ttxtFolderLocation.setText(\"Import Folder: \" + folderPath);\n\t\t//Now return a list of all the files in the directory\n\t\tFile targetFolder = new File(folderPath);\n\t\t\n\t\treturn targetFolder.listFiles(); //TODO: This returns the names of ALL files in a dir, including subfolders\n\t}", "private static Stream<Path> listRecur(Path p) {\n if (Files.isDirectory(p)) {\n try {\n return Files.list(p).flatMap(DirectoryClassPath::listRecur);\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n } else {\n return Stream.of(p);\n }\n }", "public static String[] getFolders() throws IOException {\n\t\tString[] paths = new String[2];\n\t\tif ((new File(PATHS)).exists()) {\n\t\t\tpaths = readPaths();\n\t\t} else {\n\t\t\tpaths[0] = checkSaveGameFolder();\n\t\t\tpaths[1] = checkInstallFolder();\n\t\t}\n\t\treturn paths;\n\t}", "public String getPathAsString() {\n if (list.isEmpty()) {\n return \"\";\n }\n StringBuilder buf = new StringBuilder();\n\n for (String dir : list) {\n buf.append(dir);\n buf.append(pathSeparator());\n }\n return buf.substring(0, buf.length() - 1); // remove the trailing pathSeparator...\n }", "public String pathList()\n {\n StringBuilder pathString = new StringBuilder();\n for (Location accessibleLocation : accessibleLocations) {\n pathString.append(accessibleLocation.getName()).append(\"\\n\");\n }\n return pathString.toString();\n }", "java.util.List<java.lang.String>\n getClasspathList();", "private void listFiles(JSONArray parameter) {\n String response = \"Files and Directorys to list: \";\n if (parameter.size() == 1) {\n File file = new File((String) parameter.get(0));\n for (String s : file.list()) {\n response = response + \"\\n\" + s;\n }\n clientResponse(response);\n } else {\n failedClientResponse(\"Wrong Parameters! -400\");\n }\n }", "List<String> getFiles(String path, String searchPattern, String searchOption) throws IOException;", "public abstract ArrayList<CustomPath> getAnnotationPathList();", "java.util.List<java.lang.String>\n getClasspathList();", "public List<File> listCacheDirs() {\n List<File> cacheDirs = new ArrayList<File>();\n File file = new File(parent);\n if(file.exists()) {\n File[] files = file.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n // TODO Auto-generated method stub\n return pathname.isDirectory() && \n pathname.getName().startsWith(CacheDirectory.cacheDirNamePrefix(identity));\n }\n \n });\n cacheDirs = Arrays.asList(files);\n }\n return cacheDirs;\n }", "java.util.List<java.lang.String>\n getFileNamesList();", "java.util.List<entities.Torrent.FileInfo>\n getFilesList();", "public List <WebFile> getChildFiles()\n{\n if(_type==FileType.SOURCE_DIR) return getSourceDirChildFiles();\n return _file.getFiles();\n}", "java.util.List<java.lang.String>\n getFileNamesList();", "public ArrayList<Integer> findPathList() {\n ArrayList<Integer> pathList = new ArrayList<>();\n for (int i = 0; i < cells.size() ; i++) {\n if (cells.get(i) == CellState.Path) { // PATH -> pathList\n pathList.add(i);\n }\n }\n return pathList;\n }", "protected abstract String childFolderPath();", "String[] ls(String path) throws NoSuchPathException;", "@Test\n public void testGetDirectoryList() {\n System.out.println(\"getDirectoryList for existing folder with subfolders\");\n String entriesPath = folder.toString();\n FilesDao instance = new FilesDao();\n String[] expResult = new String[4];\n expResult[0]=\"EmptyFolder\";\n expResult[1]=\"Images\";\n expResult[2]=\"Texts\";\n expResult[3]=\"Videos\";\n Arrays.sort(expResult);\n String[] result;\n try{\n result = instance.getDirectoryList(entriesPath);\n Arrays.sort(result);\n }catch(EntryException ex){\n result = null;\n }\n \n assertArrayEquals(expResult, result);\n }", "private ArrayList<char[]> subdirectoriesToFiles(ArrayList<char[]> currentList, ArrayList<char[]> fullFileList) throws IOException {\t\t\n\t\tfor (File file: currentList) {\n\t\t\tif (isJavaFile(file)) \n\t\t\t\tfullFileList.add(file);\n\t\t\telse if (file.isDirectory()){\n\t\t\t\t$.log(file.toString());\n\t\t\t\tsubdirectoriesToFiles(file.getAbsolutePath(), fullFileList);\n\t\t\t}\n\t\t\telse if (isJarFile(file))\n\t\t\t\tsubdirectoriesToFiles(jarToFile(file), fullFileList);\n\t\t}\n\t\treturn fullFileList;\n\t}", "@Test\n public void testGetFilesList() {\n System.out.println(\"getFilesList from existing folder with existing subfiles\");\n String entryPath = folder.toString()+fSeparator+\"Images\";\n FilesDao instance = new FilesDao();\n String[] expResult = new String[2];\n expResult[0] = \"testImg.jpg\";\n expResult[1] = \"testImg2.jpg\";\n String[] result;\n try{\n result = instance.getFilesList(entryPath);\n }catch(EntryException ex){\n result = null;\n }\n assertArrayEquals(expResult, result);\n }", "List<IFileSpec> getDirectories(@Nonnull List<IFileSpec> fileSpecs,\n boolean clientOnly, boolean deletedOnly, boolean haveListOnly)\n throws ConnectionException, AccessException;", "protected abstract int[] getPathElements();", "public static void showListOfDirectory(String filePath) {\n File f1 = new File(filePath);\n if (f1.isDirectory()) {\n System.out.println(\"Directory: \" + filePath);\n String[] arr = f1.list();\n for (int i = 0; i < arr.length; i++) {\n File f = new File(filePath + \"/\" + arr[i]);\n if (f.isDirectory()) {\n System.out.println(arr[i] + \" is a directory\");\n } else {\n System.out.println(arr[i] + \" is a file\");\n }\n }\n } else {\n System.out.println(\"It is not a directory\");\n }\n }" ]
[ "0.7248371", "0.70836556", "0.6954715", "0.69417137", "0.68278295", "0.6696576", "0.6643863", "0.6642655", "0.6635866", "0.6526202", "0.6469014", "0.6443006", "0.64426506", "0.6423468", "0.64091086", "0.64048016", "0.63840526", "0.63802516", "0.636147", "0.6337335", "0.63321185", "0.6298028", "0.6277096", "0.62668765", "0.6230189", "0.61892587", "0.61401594", "0.60883075", "0.60765725", "0.6063861", "0.60612404", "0.60460716", "0.60388255", "0.60334754", "0.6018286", "0.5988393", "0.5984691", "0.59619033", "0.5938261", "0.5914761", "0.59119916", "0.591169", "0.5897239", "0.5896862", "0.589096", "0.5890418", "0.58699894", "0.586717", "0.58642334", "0.58594036", "0.5853019", "0.5848362", "0.58443266", "0.58426905", "0.5837023", "0.58251494", "0.58041877", "0.57980794", "0.57924354", "0.57869947", "0.5769281", "0.576825", "0.57465005", "0.5744657", "0.574196", "0.56998515", "0.5692363", "0.5677636", "0.56642747", "0.56601393", "0.565912", "0.5655457", "0.56375897", "0.5637502", "0.5617978", "0.56163114", "0.5613887", "0.56026036", "0.55849946", "0.5570996", "0.55662036", "0.5556092", "0.5550106", "0.5539528", "0.55308187", "0.5530179", "0.5529665", "0.55281603", "0.55248284", "0.5515465", "0.5513197", "0.55090123", "0.55020434", "0.54970926", "0.5492733", "0.5490066", "0.54853666", "0.5482348", "0.54726803", "0.546964" ]
0.5770455
60
Function to read in data from a file in the following structure: \n and place it in a HashMap
protected static void readIn(Path p, HashMap<String, Double> myMap, FileSystem fs) throws IOException { FSDataInputStream inputStream = fs.open(p); BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); // Read in all the lines and push into hashmap String line; while((line = br.readLine()) != null) { String[] sectors = line.trim().split("\t"); if (sectors.length != 2) throw new Error("Parsing of file does not match specified input -- readIn"); if (myMap.containsKey(sectors[0])) throw new Error("Node is trying to be added more than once"); myMap.put(sectors[0], Double.parseDouble(sectors[1])); } br.close(); fs.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HashMap<String, String> convertToString() throws IOException\n\t{\n\t HashMap<String, String> map = new HashMap<String, String>();\n\n\t String line;\n\t BufferedReader reader;\n\t String multiple_line=null;\n\t\ttry {\n\t\t\treader = new BufferedReader(new FileReader(filePath));\n\t\t\t\n\t\t\twhile ((line = reader.readLine()) != null)\n\t\t {\n\t\t String[] parts = (line.replaceAll(\"\\\"\", \"\").split(\"=\", 2)); //tolto replaceAll\n\t\t if (parts.length >= 2)\n\t\t {\n\t\t String key = parts[0];\n\t\t multiple_line=key;\n\t\t String value = parts[1];\n\t\t map.put(key, value);\n\t\t } else {\n\t\t \n\t\t String line2=map.get(multiple_line);\n\t\t map.put(multiple_line, line2+\"\\n\"+line);\n\t\t }\n\t\t }\n\t\t\t\n\t\t\t//for (String key : map.keySet())\n\t\t //{\n\t\t // System.out.println(key + \":\" + map.get(key));\n\t\t // }\n\t\t reader.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 \n\t \n\t return map;\n\t}", "public static Map readingFilesMap(String file) {\n\n Stream<String> lines = null;\n try {\n lines = Files.lines(Paths.get(file));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /* lines = lines.filter(line -> line.trim().length() > 0)\n .map(line -> line.substring(line.lastIndexOf(\" \")));\n*/\n Map map = lines.collect(Collectors.toMap(\n line -> line.substring(line.lastIndexOf(\" \")),\n line -> line.substring(0, line.lastIndexOf(\" \"))\n ));//.forEach(System.out::print);\n //lines.forEach(Collections.list());\n\n map.forEach((k, v) -> {\n System.out.println(\"key:\"+k+ \" Value=\"+v);\n } );\n return map;\n\n //set.forEach(System.out::print);\n\n\n }", "private static String[][] getMap(String inputFile, String[][] Map) {\n\t\tFile text = new File(inputFile);\t\r\n\t\tint j = 0;\r\n\r\n\t\ttry {\r\n\t\t\tScanner s = new Scanner(text);\r\n\t\t\tString nex = s.nextLine();\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine())\r\n\t\t\t{\r\n\t\t\tnex = s.nextLine();\r\n\t\t\tfor (int i = 0; i < nex.length(); i++)\r\n\t\t\t{\r\n\t\t\t\tchar c = nex.charAt(i);\r\n\t\t\t\tString d = Character.toString(c);\r\n\t\t\t\tMap[j][i] = d;\t\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\t}\t\r\n\t\t\ts.close();\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}\t\t\r\n\t\treturn Map;\r\n}", "public void readFile(String fileName)\r\n {\n String key = new String();\r\n String value = new String();\r\n\r\n boolean readInfo = false;\r\n String out =\"\";\r\n String infoTag = \"\";\r\n String infoTagContent = \"\";\r\n\r\n try{\r\n System.out.println(\"Readig file \"+fileName+\" ...\");\r\n BufferedReader filereader = new BufferedReader(new FileReader(fileName));\r\n\r\n String line = new String();\r\n line = filereader.readLine();\r\n\r\n while(line != null){\r\n infoTag = \"\";\r\n infoTagContent = \"\";\r\n\r\n if((line.indexOf(\"=\") != -1) && (line.indexOf(\"#\") == -1))\r\n {\r\n key = line.substring(0, line.indexOf(\"=\"));\r\n value = line.substring(line.indexOf(\"=\")+1);\r\n\r\n key = key.trim();\r\n value = value.trim();\r\n\r\n if(key.equals(\"PREFIX\")){\r\n this.tagPrefix = value;\r\n } else {\r\n value = tagPrefix+\".\"+value;\r\n tagHash.put(key, value);\r\n }\r\n\r\n readInfo = false;\r\n infoHash.put(key, out);\r\n out = \"\";\r\n }\r\n\r\n\r\n if((line.indexOf(\"#\") == 0) && (line.indexOf(\"@\") != -1) && (line.indexOf(\"=\") != -1))\r\n {\r\n readInfo = true;\r\n infoTag = line.substring(line.indexOf(\"@\"), line.indexOf(\"=\"));\r\n infoTag.trim();\r\n infoTagContent = line.substring(line.indexOf(\"=\")+1);\r\n if(infoTagContent.trim().length() > 0) infoTagContent = infoTagContent+NL;\r\n out = out+infoTag+\": \"+NL+infoTagContent;\r\n }else if((line.indexOf(\"#\") == 0) && readInfo){\r\n // alreadey reading a tagInfo, means NL between entries\r\n out = out+line.substring(line.indexOf(\"#\")+1)+NL;\r\n }\r\n\r\n line = filereader.readLine();\r\n }\r\n\r\n filereader.close();\r\n\r\n //System.out.println(tagHash);\r\n\r\n }catch (Exception e){\r\n System.out.println(\"Exception in readFile: \"+e);\r\n }\r\n }", "public HashMap<String, String[]> convertToArray() throws IOException\n\t{\n\t HashMap<String, String[]> map = new HashMap<String, String[]>();\n\t String[] list;\n\t \n\t String line;\n\t BufferedReader reader;\n\t\t\n\t try {\n\t\t\treader = new BufferedReader(new FileReader(filePath));\n\t\t\t\n\t\t\twhile ((line = reader.readLine()) != null)\n\t\t {\n\t\t\t\tString key = line;\n\t\t\t\tString value = \"\";\n\t\t\t\tString tmp;\n\t\t\t\t\n\t\t\t\twhile(!(tmp=reader.readLine()).equals(\"$\"))\n\t\t\t\t{\t\n\t\t\t\t\tvalue = value+tmp; \n\t\t\t\t}\n\t\t\t\tString values = value.replaceAll(\"\\\"\", \"\");\n\t\t\t\t\n\t\t\t\tString[] parts = values.split(\",\");\n\t\t map.put(key, parts);\n\t\t }\n\t\t\t\n\t\t\t/*for (String key : map.keySet())\n\t\t {\n\t\t System.out.println(key);\n\t\t for(int i=0; i < map.get(key).length; i++)\n\t\t {\n\t\t \tSystem.out.println(map.get(key)[i]);\n\t\t }\n\t\t }*/\n\t\t\t\n\t\t reader.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 \n\t \n\t return map;\n\t}", "Map <String, List <String> > parse (List <String> keys, List <String> lines);", "static Map<Integer, Map<String, Object>> readTxt(BufferedReader in) throws IOException {\n\t\t\n\t\t// reads the key names (column names) and stores them\n\t\tString colString = in.readLine();\n\t\tString[] col = colString.split(\"\\t\");\n\n\t\t//instantiates the object being returned so we can add in objects\n\t\tMap<Integer, Map<String, Object>> dict = new HashMap<Integer, Map<String, Object>>();\n\t\t\n\t\t//loops while there is still more data to read\n\t\twhile (in.ready()) {\n\t\t\t\n\t\t\t//pulls the next line and splits it apart by the delimiter\n\t\t\tString valString = in.readLine();\n\t\t\tString[] val = valString.split(\"\\t\");\n\t\t\t\n\t\t\t//instantiates the object to be put in the list\n\t\t\tMap<String, Object> map = new HashMap<String, Object>();\n\t\t\t\n\t\t\t//loops per amount of columns\n\t\t\tfor (int i = 0; i < col.length; i++) {\n\t\t\t\t\n\t\t\t\t//instantiates to be put into the map and checks if it is a numeric data type\n\t\t\t\tObject value = val[i];\n\t\t\t\tif (isDouble((String) value)) {\n\t\t\t\t\tvalue = Double.parseDouble((String) value);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//puts the object into the map\n\t\t\t\tmap.put(col[i], value);\n\t\t\t\t\n\t\t\t}\t//end for\n\n\t\t\t//since map.get(\"StudentID\") is a double, we cast it to an int so we can have a Integer Key for the outside map\n\t\t\tint i = ((Double) map.get(\"StudentID\")).intValue();\n\t\t\t\n\t\t\t//puts the map into the outside container\n\t\t\tdict.put(i, map);\n\t\t\t\n\t\t}\t//end while\n\n\t\t//closes the BufferedReader\n\t\tin.close();\n\n\t\t//returns our data structure\n\t\treturn dict;\n\t}", "private void load(Path fileName) throws IOException {\n try(BufferedReader reader = Files.newBufferedReader(fileName)) {\n String line = \"\";\n\n // Matches lines with the format:\n // key=value\n // where the key is any sequence of lowercase letters. (a to z)\n // where value may be any letters from a to z (case insensitive) 0 to 9 or the letters '-' and '.'.\n Pattern validLine = Pattern.compile(\"^(?<key>[a-z]+)=(?<value>[a-zA-Z0-9-.]+)$\");\n\n // Read the file line by line\n while((line = reader.readLine()) != null) {\n if(line.startsWith(\";\")) { // Ignore lines that start with ;\n continue;\n }\n\n // Remove any whitespace\n line = line.trim();\n\n // Continue if our line is empty\n if(\"\".equals(line)) {\n continue;\n }\n\n Matcher matcher = validLine.matcher(line);\n\n if(!matcher.matches() || matcher.groupCount() != 2) {\n System.err.println(\"Unable to parse line: \" + line);\n continue;\n }\n\n String key = matcher.group(\"key\");\n String value = matcher.group(\"value\");\n\n map.put(key, value);\n }\n }\n }", "public static int[][] loadMap(String fileName) throws Exception{\n FileReader fr=new FileReader(fileName);\n int c;\n String str=\"\";\n List<String> strA=new ArrayList<>(); //list of lines\n //process out newlines from midline\n while((c=fr.read())!=-1){\n System.out.print((char)c); //show map\n if(!(((char)c=='\\n') || ((char)c=='\\r'))){str=str+(char)c;}\n else if(((char)c=='\\n' || (char)c=='\\r')){\n if(strA.size()<1) {strA.add(str);str=\"\";}\n else if(strA.size()>0 && strA.get(0).length()>str.length()){} //newline char found midline\n else {strA.add(str);str=\"\";}\n }\n else System.out.println(\"Err: \"+(char)c);\n }\n strA.add(str);\n System.out.println(\"\\nWidth: \"+str.length()+\"\\nHeight: \"+strA.size());\n //now that size is known, fill info array\n int[][] map=fillMap(strA);\n \n return map;\n }", "private HashMap<Object, Object> HashMapTransform(List<String> lines) {\n\n HashMap<Object, Object> keypair = new HashMap<>();\n\n for (String line : lines) {\n if (line.contains(pairDelimiter)) {\n String[] intermediate = line.split(pairDelimiter, maxSplitSize);\n keypair.put(intermediate[0], intermediate[1]);\n }\n }\n return keypair;\n }", "@Override\r\n public Map getData(String fileName) {\r\n Map<String, Integer> map = new HashMap<>();\r\n \r\n File file = new File(fileName);\r\n \r\n try (BufferedReader bufferedReader =\r\n new BufferedReader(new FileReader(file))) {\r\n \r\n String line;\r\n while ((line = bufferedReader.readLine()) != null) {\r\n \r\n //if the word have already been in the map,\r\n //increases the number of occurances,\r\n //otherwise sets this number to 1\r\n //and puts a new value to the map\r\n String[] words = line.split(\" \");\r\n for (String word : words) {\r\n Integer value = map.get(word);\r\n if (value == null) {\r\n value = 1;\r\n } else {\r\n value++;\r\n }\r\n map.put(word, value);\r\n }\r\n }\r\n } catch(IOException e) {\r\n System.out.println(e.getMessage());\r\n return null;\r\n }\r\n \r\n return map;\r\n }", "public HashMap<String,String> readMapFile(String filename) throws IOException {\n\t\tHashMap<String,String> valueMap = new HashMap<String,String>();\t\t\n List<String> cols = new ArrayList<String>(); \n\t\t\n try{\n \t buf = new BufferedReader(new FileReader(filename)); \n\t String strRead; \n\t while ((strRead=buf.readLine())!=null) {\n\t \tcols = Arrays.asList(strRead.split(\"\\t\")); \t\n\t \tif(cols.size() != 2)\n\t \t\tcontinue; \t\n\t \tvalueMap.put(cols.get(0),cols.get(1)); \t\n\t \t }\n\t } catch(IOException e){\n\t e.printStackTrace();\n\t } finally {\n\t \tbuf.close(); \n\t }\n\t\t\t\n\t\treturn valueMap;\n\t}", "public static Map<String, String> parse(File file) throws IOException {\n List<String> configs = Files.readAllLines(file.toPath());\n return configs.stream()\n .map(it -> it.split(\"\\t\"))\n .collect(toMap(splitted -> splitted[0], splitted -> splitted[1]));\n }", "private static HashMap<String, String> buildHashMap() {\n HashMap<String, String> capitals;\n Scanner fileReader;\n String states;\n \n capitals = new HashMap<>();\n \n // Load the file\n try {\n fileReader = new Scanner(\n new BufferedReader(\n new FileReader(FILEPATH)\n )\n );\n } catch(FileNotFoundException ex) {\n System.out.println(FILEPATH + \" not found\");\n System.exit(-1);\n return null;\n }\n \n // Unmarchal the data\n System.out.println(\"=====\\nHERE ARE THE STATES:\");\n states = \"\";\n while (fileReader.hasNextLine()) {\n String currentLine, state, capital;\n String[] data;\n \n currentLine = fileReader.nextLine();\n data = currentLine.split(\"::\");\n if (data.length != 2) {\n System.out.println(\"Invalid file format\");\n System.exit(-1);\n return null;\n }\n \n state = data[0];\n capital = data[1];\n capitals.put(state, capital);\n states += state + \" \";\n }\n System.out.println(states);\n \n return capitals;\n }", "public static Map<String, String> readMap(File inFile, String kColumn, String vColumn) throws IOException {\n Map<String, String> retVal = new HashMap<String, String>();\n try (TabbedLineReader inStream = new TabbedLineReader(inFile)) {\n int kCol = inStream.findField(kColumn);\n int vCol = inStream.findField(vColumn);\n for (Line line : inStream)\n retVal.put(line.get(kCol), line.get(vCol));\n }\n return retVal;\n }", "public static Map<String, String> readMap() {\n\n\n // take resource from jar file (in the project they are in the \"target\" folder)\n InputStream playlist =\n PlaylistPrepare.class.getClassLoader()\n .getResourceAsStream(\"playlist.txt\");\n\n InputStreamReader reader = new InputStreamReader(playlist);\n BufferedReader br = new BufferedReader(reader);\n\n Map<String, String> map = new HashMap<>();\n\n try {\n String line;\n while ((line = br.readLine()) != null) {\n String[] split = line.split(\"¦\");\n// System.out.println(split[1] + \"; \" + split[2]);\n map.put(split[1], split[2]);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n return map;\n }", "public static Map<String, String> stringToHashtable(String file) {\r\n if (file == null) {\r\n return null;\r\n }\r\n\r\n String sansComments = eraseComments(file);\r\n int pos = 0, count = sansComments.length();\r\n Map<String, String> retval = new HashMap<String, String>();\r\n\r\n // Split the file, line by line, into key/value pairs\r\n while (pos < count) {\r\n int eol = offsetToEOL(sansComments, pos);\r\n int next = offsetToNextLine(sansComments, pos);\r\n if (eol > 0) {\r\n String line = sansComments.substring(pos, pos + eol);\r\n StringTokenizer st = new StringTokenizer(line, \"=\");\r\n String key = st.nextToken();\r\n String value = \"\";\r\n if (st.hasMoreTokens()) {\r\n value = st.nextToken();\r\n }\r\n\r\n // Place scalar values in the hashtable directly\r\n // otherwise break comma separated ones into Vectors.\r\n // If they can be, items are inserted as Doubles, failing\r\n // that, as Strings.\r\n // int comma = value.indexOf(\",\");\r\n // if (comma == -1) {\r\n // try {\r\n // retval.put(key, new Double(value));\r\n // } catch (NumberFormatException nfe) {\r\n retval.put(key, value);\r\n // } // endtry\r\n // } else {\r\n // Vector<Comparable> v = new Vector<Comparable>();\r\n // StringTokenizer values = new StringTokenizer(value, \",\");\r\n // while (values.hasMoreTokens()) {\r\n // String s = values.nextToken();\r\n // try {\r\n // v.addElement(new Double(s));\r\n // } catch (NumberFormatException nfe) {\r\n // v.addElement(s.trim());\r\n // } // endtry\r\n // } // endwhile\r\n // retval.put(key, v);\r\n // } // endif\r\n } // endif\r\n pos += next;\r\n } // endwhile\r\n\r\n return retval;\r\n }", "public static HashMap readVF(String mapF) throws IOException{\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(new FileInputStream(mapF)));\n\t\tString line = input.readLine();//pair\n\t\tHashMap map = new HashMap();\n\t\twhile(line!=null){\n\t\t\tString vector = input.readLine();\n\t\t\tmap.put(line.substring(1), vector);\n\t\t\tline = input.readLine();\n\t\t}\n\t\tinput.close();\n\t\treturn map;\n\t}", "private void openAndReadFile() throws IOException {\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textreader = new BufferedReader(fr);\n\t\tString line;\n\t\tString[] parsedLine;\n\t\twhile ((line = textreader.readLine()) != null) {\n\t\t\tparsedLine = pattern.split(line);\n\t\t\tif (parsedLine.length == 2) {\n\t\t\t\tfileData.put(parsedLine[0], parsedLine[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Couldn't read line \" + line + \" in \" + path);\n\t\t\t}\n\t\t}\n\t\ttextreader.close();\n\t\tfr.close();\n\t}", "private void populateDictionary() {\n Scanner scanner = null;\n try {\n scanner = new Scanner(new FileInputStream(filePath));\n while(scanner.hasNextLine()) {\n String word = scanner.nextLine();\n rwDictionary.put(reducedWord(word), word);\n lcDictionary.put(word.toLowerCase(), word);\n }\n } catch(IOException e) {\n System.err.println(e.toString());\n e.printStackTrace();\n } finally {\n if(scanner != null) {\n scanner.close();\n }\n }\n }", "private HashMap parseMap(String localData){\n int localPointer = 0;\n HashMap temp = new HashMap();\n char c = localData.charAt(localPointer++);\n while (c != '}'){\n String entry = \"\";\n entry_loop :\n while (c != '}'){\n switch (c){\n case ',' :\n c = localData.charAt(localPointer++);\n break entry_loop;\n case '{' :\n String tempEntry = this.getFull(localData.substring(localPointer),0);\n entry += tempEntry;\n localPointer += tempEntry.length();\n break ;\n case '[' :\n String tempEntry2 = this.getFull(localData.substring(localPointer),1);\n entry += tempEntry2;\n localPointer += tempEntry2.length();\n break ;\n default :\n entry += c;\n break ;\n }\n c = localData.charAt(localPointer++);\n }\n entry = entry.trim();\n String[] entryArray = entry.split(\":\",2);\n String key = entryArray[0].trim();\n String value = entryArray[1].trim();\n Object keyObj = null;\n Object valueObj = null;\n\n switch (this.getDataType(key.trim())){\n case String:\n keyObj = key.trim().replace(\"\\\"\",\"\");\n break ;\n case Integer:\n keyObj = Long.parseLong(key.trim());\n break ;\n case Float:\n keyObj = Float.parseFloat(key.trim());\n break ;\n case Boolean:\n keyObj = Boolean.parseBoolean(key.trim());\n break ;\n case Map:\n keyObj = this.parseMap(key.trim());\n break ;\n case List:\n keyObj = this.parseList(key.trim());\n }\n\n switch (this.getDataType(value.trim())){\n case String:\n valueObj = value.trim().replace(\"\\\"\",\"\");\n break ;\n case Integer:\n valueObj = Long.parseLong(value.trim());\n break ;\n case Float:\n valueObj = Float.parseFloat(value.trim());\n break ;\n case Boolean:\n valueObj = Boolean.parseBoolean(value.trim());\n break ;\n case Map:\n valueObj = this.parseMap(value.trim());\n break ;\n case List:\n valueObj = this.parseList(value.trim());\n }\n temp.put(keyObj,valueObj);\n }\n return temp;\n }", "private static void fillDataMapFromFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedReader frequencyReader = new BufferedReader(new FileReader(frequencyFile));\n\n\t\tList<String> lines = frequencyReader.lines()\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tfrequencyReader.close();\n\n\t\tfor(int i = 0, size = lines.size(); i < size; i++) { // Split each line at the delimiter, into word & frequency - put them in the data map\n\n\t\t\tfinal String[] dataSplit = lines.get(i).split(WORD_FREQUENCY_DELIMITER);\n\t\t\tfinal String word = dataSplit[0];\n\t\t\tfinal long frequency = Long.parseLong(dataSplit[1]);\n\n\t\t\tdataMap.put(word, frequency);\n\t\t}\n\t}", "protected synchronized Hashtable getMappingsFromFile() throws Exception {\n\n \t\n\t\tInputStream path = null;\n\n\t\tpath = getClass().getResourceAsStream(\"../../../config/mappings.txt\");\n\n\t\tSystem.out.println(\"Path is - \" + path);\n\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(path));\n/*\t\tStringBuilder sb = new StringBuilder();\n\t\tString line1 = null;\n\t\twhile ((line1 = reader.readLine()) != null) {\n\t\t\tsb.append(line1 + \"\\n\");\n\t\t}\n*/\t\t//System.out.println(\"String is - \" + sb.toString());\n\t\t\n/* \tFile f = new File(\"src/edu/ucsd/crbs/incf/components/services/emage/mappings.txt\");\n System.out.println(\"Mapping - \" + f.getAbsolutePath());\n\n*/ /*if(sb.toString().trim().equals(\"\") || sb.toString() == null ) {\n System.err.println(\"bisel.ReadMappings cannot find mapping file\");\n System.exit(1);\n }*/\n\n Hashtable mappings = new Hashtable(17, new Float(1.25).floatValue());\n\n\n //BufferedReader br = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n while(line != null) { \n StringTokenizer st = new StringTokenizer(line, \"*\");\n String aba = st.nextToken();\n String emap = st.nextToken();\n mappings.put(aba, emap);\n line = reader.readLine();\n }\n\n reader.close();\n return mappings;\n }", "public void createIDMap()\n {\n IDMap = new HashMap<>();\n idFile.open(\"idpassword.txt\");\n String line = idFile.getNextLine();\n\n\n\n while(line!=null) {\n String[] fields = line.split(\",\");\n IDMap.put(fields[0], fields[1]);\n\n line = idFile.getNextLine();\n\n }\n\n }", "public static void readLines(String line, Map<String, List<String>> keyToLines,String dateString) {\n\t\t\n\t\tString tokens[] = line.split(\",\");\n\t\t\n\t\tdouble lat = Double.valueOf(tokens[0]);\n\t\tdouble lng = Double.valueOf(tokens[1]);\n\t\t\n\t\t\n\t\tString geohash = GeoHash.encode((float)lat, (float)lng, 2);\n\t\t//System.out.println(geohash);\n\t\t\n\t\tString key = dateString+\"-\"+geohash;\n\t\t\n\t\t\n\t\tList<String> recs = null;\n\t\tif(keyToLines.get(key) == null) {\n\t\t\trecs = new ArrayList<String>();\n\t\t\tkeyToLines.put(key, recs);\n\t\t} else {\n\t\t\trecs = keyToLines.get(key);\n\t\t}\n\t\trecs.add(line);\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t}", "public static void readFileToMap(Map<String, List<Integer>> hashMap, String path, int numFiles, int thisFileNum){\n try{\n FileReader file = new FileReader(path);\n BufferedReader textFile = new BufferedReader(file);\n\n String fileLine = \"\";\n String[] wordsInLine;\n List<Integer> occurences;\n List<Integer> temp;\n\n while((fileLine = textFile.readLine()) != null){\n wordsInLine = fileLine.split(\" \");\n cleanLine(wordsInLine);\n //add them to map\n for(String word : wordsInLine){\n\n if(word.length() > Table.maxWordLength){ //keeps track of the longest character\n Table.setMaxWordLength(word.length());\n }\n\n if(!hashMap.containsKey(word)){\n occurences = new ArrayList<>(); //creating a new value makes it so that one change wont affect every HashMap element\n occurences = setZerosList(numFiles);\n occurences.set(thisFileNum, 1);\n hashMap.put(word, occurences);\n }\n else{\n temp = hashMap.get(word); //this code makes a new list, and increments the word appearance by 1\n temp.set(thisFileNum, temp.get(thisFileNum)+1);\n hashMap.put(word, temp );\n }\n }\n }\n }\n catch (Exception e){\n //e.printStackTrace();\n return;\n }\n }", "public HashMap readFile(String filePath, HashMap source){\n\t\tArrayList<String> temp1 = new ArrayList<String>();\n\t\tArrayList<String> temp2 = new ArrayList<String>();\n\t\tBufferedReader br = null;\n\t\t\n\t\ttry {\n\t\t\tString sCurrentLine;\n\t\t\t\n\t\t\t// \"Users/Jasmine/Documents/Eclipse/CacheDictionary/src/english.txt\"\n\t\t\tbr = new BufferedReader(new FileReader(filePath)); \n\t\t\t\n\t\t\t//str.matches(\".*\\\\d+.*\"); ==> string that contains numbers\n\t\t\t//.matches(\"[a-zA-Z]+\"); ==> string that only contains letter\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * if the source file itself is not one word per line, we need to split the string\n\t\t\t\t * only letter(not single) will be stored in the array\n\t\t\t\t */\n\t\t\t\t//\n\t\t\t\tif(sCurrentLine.matches(\".*([ \\t]).*\")){ //check if the current line is a single word or not\n\t\t\t\t\ttemp1.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t\telse if(sCurrentLine.matches(\"[a-zA-Z]+\") && sCurrentLine.length()>1){\n\t\t\t\t\ttemp2.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t}// end of while loop\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)br.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif(!temp1.isEmpty()){\n\t\t\tfor(int i = 0; i< temp1.size(); i++){\n\t\t\t\tString thisLine[] = temp1.get(i).split(\" \");\n\t\t\t\t//for each word in this line\n\t\t\t\tfor(int j = 0; j < thisLine.length; j++){\n\t\t\t\t\t//if it is a valid word\n\t\t\t\t\tif(thisLine[j].matches(\"[a-zA-Z]+\") && thisLine[j].length()>1 ){\n\t\t\t\t\t\tif( source.get(thisLine[j]) == null){\n\t\t\t\t\t\t\tsource.put(thisLine[j].toLowerCase(),thisLine[j].toLowerCase());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t} // end of if current word i valid\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t} // end of temp1\n\t\t\n\t\tif(!temp2.isEmpty()){\n\t\t\tfor(int i = 0; i< temp2.size(); i++){\n\t\t\t\tif(temp2.get(i).matches(\"[a-zA-Z]+\") && temp2.get(i).length()>1){\n\t\t\t\t\tif(source.get(temp2.get(i)) == null){\n\t\t\t\t\t\tsource.put(temp2.get(i).toLowerCase(),temp2.get(i).toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn source;\n\t}", "void readMap()\n {\n try {\n FileReader\t\tmapFile = new FileReader(file);\n StringBuffer\tbuf = new StringBuffer();\n int\t\t\t\tread;\n boolean\t\t\tdone = false;\n \n while (!done)\n {\n read = mapFile.read();\n if (read == -1)\n done = true;\n else\n buf.append((char) read);\n }\n \n mapFile.close();\n \n parseMap(buf.toString());\n \n } catch (Exception e) {\n ErrorHandler.displayError(\"Could not read the map file data.\", ErrorHandler.ERR_OPEN_FAIL);\n }\n }", "public static Map readMap(File f)\n {\n Map map = new Map(1);\n try\n {\n MapReader run = new MapReader();\n Scanner mapReader = new Scanner(f);\n ArrayList<String[]> numberLines = new ArrayList<String[]>();\n int dim = mapReader.nextInt();\n mapReader.nextLine();\n for(int gh = 0 ; gh < dim; gh++)\n {\n String[] nums = mapReader.nextLine().split(\" \");\n numberLines.add(nums);\n }\n int[][] newMap = new int[numberLines.size()][numberLines.size()];\n \n for(int i = 0; i < numberLines.size();i++)\n {\n for(int h = 0; h < numberLines.get(i).length;h++)\n {\n newMap[i][h] = Integer.parseInt(numberLines.get(i)[h]);\n }\n }\n map.loadMap(newMap);\n \n TreeMap<Integer,ArrayList<Integer>> spawn1 = map.getSpawn1();\n TreeMap<Integer,ArrayList<Integer>> spawn2 = map.getSpawn2();\n \n String line = \"\";\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn1\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn1.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn1.get(x).add(in.nextInt());\n }\n }\n \n if(!line.equals(\"\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn2\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n }\n catch (Exception ex)\n {\n JOptionPane.showMessageDialog(null, \"Corrupted file!\");\n }\n return map;\n }", "public void readKey(File file) throws FileNotFoundException {\n key = new double[CHAR_SET_SIZE][CHAR_SET_SIZE];\n Scanner in = new Scanner(file);\n int i = 0;\n while (in.hasNextLine()) {\n String line = in.nextLine();\n String [] vals = line.split(\" \");\n for (int j = 0; j < vals.length; j++) {\n key[i][j] = Double.parseDouble(vals[j]);\n }\n i++;\n }\n }", "public static Map loadMap(String MapFile){\n int Bottle =0;\n int Bottle1= 0;\n Map Object = new Map(0,0);\n \n try {\n \n Scanner scan = new Scanner(new File(MapFile));\n FileReader fr = new FileReader(MapFile);\n while(scan.hasNextLine()){\n if (scan.hasNextInt()){\n Bottle = scan.nextInt();\n Bottle1 = scan.nextInt();\n\n }\n Object = new Map(Bottle,Bottle1);\n }\n fr.close();\n }\n \n catch (Exception e){\n System.out.println(\"Sorry Nothing Found\");\n System.out.println(e.toString());\n e.printStackTrace(); \n } \n \n return Object;\n }", "public static void readMap(Scanner scanner) {\n // getting the pair of nodes from the input until an empty line is found\n while (true) {\n // read the current line of input\n String line = scanner.nextLine();\n // break the loop when the line is empty\n if (line.equals(\"\")) {\n break;\n }\n readLine(line);\n }\n }", "public void insertFromFile() throws IOException {\n File file = new File(Main.DATA_FILE_PATH);\n Scanner sc = new Scanner(file);\n\n dictionary = new Dictionary();\n TreeMap<String, ArrayList<String>> wordList = new TreeMap<>();\n String target = sc.nextLine().substring(1).trim();\n ArrayList<String> explain = new ArrayList<>();\n while (sc.hasNextLine()) {\n String str = sc.nextLine();\n if (str.indexOf(\"@\") == 0) {\n wordList.put(target, explain);\n target = str.substring(1).trim();\n explain = new ArrayList<>();\n } else if (str.indexOf(\"=\") == 0) {\n str = str.replace(\"+\", \" : \");\n String word = \" = \" + str.substring(1);\n explain.add(word);\n } else if (str.indexOf(\"#\") == 0 || str.indexOf(\"*\") == 0) {\n explain.add(str);\n } else {\n explain.add(\" \" + str);\n }\n }\n dictionary.setWordList(wordList);\n sc.close();\n }", "Map(String input) {\n row = 0;\n col = 0;\n\n String line;\n Scanner fin = null;\n try\n {\n fin = new Scanner(new File(input));\n }\n catch (FileNotFoundException x)\n {\n System.out.println(\"Error: \" + x);\n System.exit(0);\n }\n // Take first line and get mapLength and mapHeight. Initialize map array\n line = fin.nextLine();\n String[] temp = line.split(\" \");\n maxR = Integer.parseInt(temp[0].toString());\n maxC = Integer.parseInt(temp[1].toString());\n map = new String[maxR][maxC];\n\n for(int j = 0; j < maxR; j++) {\n line = fin.nextLine();\n for(int i = 0; i < maxC; i++){\n map[j][i] = (line.charAt(i)) + \"\";\n }\n }\n }", "public Map<String, List<String>> processIncidenceFile(String fileName) throws AggregateFileInitializationException {\n \t\t\tFile file = new File(fileName);\n \t\t\tHashMap<String, List<String>> data = new HashMap<String,List<String>>();\n \t\t\t\n \t\t\ttry {\n \t\t String record; \n \t\t String header;\n \t\t int recCount = 0;\n \t\t List<String> headerElements = new ArrayList<String>();\n \t\t FileInputStream fis = new FileInputStream(file); \n \t\t BufferedReader d = new BufferedReader(new InputStreamReader(fis));\n \t\t \n \t\t //\n \t\t // Read the file header\n \t\t //\n \t\t if ( (header=d.readLine()) != null ) { \n \t\t \t\n \t\t\t StringTokenizer st = new StringTokenizer(header );\n \t\t\t \n \t\t\t while (st.hasMoreTokens()) {\n \t\t\t \t String val = st.nextToken(\",\");\n \t\t\t \t headerElements.add(val.trim());\n \t\t\t }\n \t\t } // read the header\n \t\t /////////////////////\n \t\t \n \t\t // set up the empty lists\n \t\t int numColumns = headerElements.size();\n \t\t for (int i = 0; i < numColumns; i ++) {\n \t\t \tString key = headerElements.get(i);\n \t\t \tdata.put(key, new ArrayList<String>());\n \t\t }\n \t\t \n \t\t // Here we check the type of the data file\n \t\t // by checking the header elements\n \t\t \n \t\t \n \t\t \n \t\t \n \t //////////////////////\n \t // Read the data\n \t //\n \t while ( (record=d.readLine()) != null ) { \n \t recCount++; \n \t \n \t StringTokenizer st = new StringTokenizer(record );\n \t int tcount = 0;\n \t\t\t\t\twhile (st.hasMoreTokens()) {\n \t\t\t\t\t\tString val = st.nextToken(\",\");\n \t\t\t\t\t\tString key = headerElements.get(tcount);\n \t\t\t\t\t\t(data.get(key)).add(val.trim());\n \t\t\t\t\t\ttcount ++;\n \t\t\t\t\t}\n \t\t\t\t} // while file has data\n \t } catch (IOException e) { \n \t // catch io errors from FileInputStream or readLine()\n \t \t Activator.logError(\" IOException error!\", e);\n \t \t throw new AggregateFileInitializationException(e);\n \t }\n \t return data;\n \t\t }", "@Override\n\tpublic void load(Reader reader)\n\t{\n\t\tString os = System.getProperty(\"os.name\", \"?\").toLowerCase();\n\t\tif (os.startsWith(\"linux\"))\n\t\t\tos = \"linux\";\n\t\telse if (os.startsWith(\"windows\"))\n\t\t\tos = \"windows\";\n\t\telse if (os.startsWith(\"sun\"))\n\t\t\tos = \"sun\";\n\t\telse if (os.startsWith(\"mac\"))\n\t\t\tos = \"mac\";\n\t\t\n\t\t\n\t\tString line, key, value;\n\t\tint i,j;\n\t\tScanner input = new Scanner(reader);\n\t\twhile (input.hasNext())\n\t\t{\n\t\t\tline = getNextLine(input);\n\t\t\tif (line.length() > 0)\n\t\t\t{\n\t\t\t\twhile (line.endsWith(\" \\\\\") || line.endsWith(\"\\t\\\\\"))\n\t\t\t\t\tline = line.substring(0, line.length()-1) + getNextLine(input);\n\t\t\t\t\n\t\t\t\t// find index of the first occurrence of either '=' or ':'\n\t\t\t\ti=line.indexOf('=');\n\t\t\t\tj=line.indexOf(':');\n\t\t\t\tif (j >= 0 && j < i)\n\t\t\t\t\ti = j;\n\t\t\t\t\n\t\t\t\t// split line into key and value substrings.\n\t\t\t\t// Note: key must have at least one character.\n\t\t\t\tif (i > 0)\n\t\t\t\t{\n\t\t\t\t\tkey = line.substring(0, i).trim();\n\t\t\t\t\t\n\t\t\t\t\tboolean skip = false;\n\t\t\t\t\tfor (String op : new String[] {\"linux\", \"windows\", \"sun\", \"mac\"})\n\t\t\t\t\t{\n\t\t\t\t\t\tif (key.startsWith(\"<\"+op+\">\"))\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif (os.equals(op))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = key.substring((\"<\"+op+\">\").length()).trim();\n\t\t\t\t\t\t\t\tskip = 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\telse \n\t\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (skip)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvalue = line.substring(i+1).trim();\n\t\t\t\t\n\t\t\t\t\t// The following two if statements provide backward compatibility for old GMP property files\n\t\t\t\t\t// that added double '\\' characters in file names and directory names. As soon as all of \n\t\t\t\t\t// our property files no longer contain double backslash characters, we should get rid of this.\n\t\t\t\t\t// if value starts with 4 backslash characters, eg., \\\\\\\\fig2\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., \\\\fig2\\GMPSys\\filename\n\t\t\t\t\tif (value.startsWith(\"\\\\\\\\\\\\\\\\\"))\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = \"\\\\\"+value;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if value starts with a character followed by \":\\\\\", eg., c:\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., c:\\GMPSys\\filename\n\t\t\t\t\tif (value.length() >= 4 && value.charAt(1)==':' && value.charAt(2) == '\\\\' && value.charAt(3) == '\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsetProperty(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (getProperty(\"includePropertyFile\") != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile includeFile = getFile(\"includePropertyFile\");\n\t\t\t\tremove(\"includePropertyFile\");\n\t\t\t\tload(new FileReader(includeFile));\n\t\t\t} \n\t\t\tcatch (PropertiesPlusException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} \n\t\t\tcatch (FileNotFoundException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "private List<KeyFileEntry> convertLinesIntoInMemoryObjectList(List<String> lines) {\n List<KeyFileEntry> retList = new ArrayList<>(1250);\n\n int i = 0;\n\n // Ignore the header lines and information\n for (; i < lines.size(); i++) {\n String lineIgnore = lines.get(i);\n if (lineIgnore.startsWith(\"______\")) {\n break;\n }\n }\n\n // Ignore underscore ___ line\n i++;\n\n // reached entries lines\n KeyFileEntry entry = new KeyFileEntry();\n\n // create in memory list of objects\n while (i < lines.size()) {\n String line = lines.get(i);\n\n // For terminating line no need to complete loop\n if (line.equals(\"//\")) {\n retList.add(entry);\n entry = new KeyFileEntry();\n i++;\n continue;\n }\n\n String[] tokens = line.split(SPLIT_SPACES);\n switch (tokens[0]) {\n case \"ID\":\n entry.id = tokens[1];\n break;\n case \"IC\":\n entry.ic = tokens[1];\n break;\n case \"AC\":\n entry.ac = tokens[1];\n break;\n case \"DE\":\n entry.de.add(tokens[1]);\n break;\n case \"SY\":\n entry.sy.add(tokens[1]);\n break;\n case \"HI\":\n entry.hi.add(tokens[1]);\n break;\n case \"GO\":\n entry.go.add(tokens[1]);\n break;\n case \"CA\":\n entry.ca = tokens[1];\n break;\n case \"WW\":\n entry.ww.add(tokens[1]);\n break;\n default:\n LOG.info(\"Unhandle line found while parsing file: {}\", line);\n\n }\n\n // read and save next line\n i++;\n }\n return retList;\n }", "public static List<Map<String, String>> loadData(String filename) throws IOException {\n\t\tList<Map<String, String>> data = new ArrayList<>();\n\t\tPath dataFile = Paths.get(filename);\n\t\t\n\t\t// Files.readAllLines only accepts Path and returns a List\n\t\t// it reads the whole file in one shot\n\t\tList<String> linesList = Files.readAllLines(dataFile);\n\t\t// header row to attributes array\n\t\tString[] attributes = linesList.get(0).split(\",\");\n\t\t\n\t\t// process data rows\n\t\tfor (int i = 1; i < linesList.size(); i++) {\n\t\t\tString[] values = linesList.get(i).split(\",\");\n\t\t\tif (values.length == 0 && values[0].length() == 0) break;\n\t\t\t// create a map for each row\n\t\t\tMap<String, String> row = new HashMap<>();\n\t\t\t//fill the row\n\t\t\tfor (int j = 0; j < attributes.length; j++)\n\t\t\t\trow.put(attributes[j], values[j]);\n\t\t\tdata.add(row);\t\t// add data to row\n\t\t}\t\n\n\t\t// do the same with a Stream, but use the iterator of the stream\n\t\t// instead of dealing with it directly\n\t\tStream<String> linesStream = Files.lines(dataFile);\n\t\tIterator<String> it = linesStream.iterator();\n\t\tattributes = it.next().split(\",\");\n\t\twhile (it.hasNext()) {\n\t\t\tString[] values = it.next().split(\",\");\n\t\t\tif (values.length > 0 && values[0].length() > 0) {\n\t\t\t\tMap<String, String> row = new HashMap<>();\n\t\t\t\tfor (int i = 0; i < attributes.length; i++)\n\t\t\t\t\trow.put(attributes[i], values[i]);\n\t\t\t\t// data.add(row);\n\t\t\t}\n\t\t}\n\t\tlinesStream.close();\n\n\t\treturn data;\n\t}", "public static char[][] ReadMap(String fileName)\r\n {\n String pathName=System.getProperty(\"user.dir\")+\"\\\\FilesToLoad\\\\Maps\\\\\"+fileName+\".txt\";\r\n File file = new File(pathName); \r\n List<String> list = new ArrayList<String>();\r\n try \r\n {\r\n Scanner sc = new Scanner(file);\r\n \r\n while (sc.hasNextLine()) \r\n {\r\n list.add(sc.nextLine());\r\n }\r\n }\r\n catch (FileNotFoundException ex) \r\n {\r\n Logger.getLogger(TxtReader.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n int x=list.get(0).length();\r\n int y=list.size();\r\n char[][] map=new char[x][y];\r\n \r\n for (int i = 0; i < list.size(); i++) \r\n {\r\n String line=list.get(i);\r\n for (int j = 0; j < line.length(); j++) \r\n {\r\n map[j][i]=line.charAt(j);\r\n }\r\n }\r\n return map;\r\n }", "public static boolean loadMap(String path) throws FileNotFoundException {\n\n// System.out.println(\" Enter map file address\");\n// String path = sc.next();\n\n // ---------------- Reading file-------------------------------\n File file_map = new File(path.trim());\n HashMap<String, List<String>> neighborsList = new HashMap<>();\n\n if (file_map.exists()) {\n Scanner myReader = new Scanner(file_map);\n\n while (myReader.hasNextLine()) {\n\n String data = myReader.nextLine();\n\n if (\"[Continents]\".equals(data.trim())) {\n System.out.println(\"==>\" + data.trim());\n data = myReader.nextLine();\n\n while (!data.equals(\"[Territories]\")) {\n System.out.println(data);\n String split[] = data.split(\"=\");\n String continent_name = split[0];\n String no_of_countries = split[1];\n continents.put(continent_name, Integer.parseInt(no_of_countries));\n data = myReader.nextLine();\n }\n }\n\n System.out.println(\"continents: \" + continents.toString());\n board.setContinents(continents);\n\n if (\"[Territories]\".equals(data)) {\n\n while (myReader.hasNextLine()) {\n String country_input = myReader.nextLine();\n\n String split[] = country_input.split(\",\");\n String country = split[0];\n int x = Integer.parseInt(split[1]);\n int y = Integer.parseInt(split[2]);\n String continent = split[3];\n List<String> neighbours = new ArrayList<>();\n\n for (int i = 4; i < split.length; i++) {\n neighbours.add(split[i]);\n }\n\n board.createTile(country, x, y, continent);\n neighborsList.put(country, neighbours);\n\n }\n }\n\n for (Map.Entry entry : neighborsList.entrySet()) {\n board.setNeighbourTile((List<String>) entry.getValue(), (String) entry.getKey());\n }\n\n\n }\n System.out.println(\"Risk Map Loaded!\");\n HashMap<String, Tile> map = board.getTiles();\n\n System.out.println(\"Map\" + map.keySet().toString());\n\n if (board.getContinents().size() == 0 || board.getTiles().size() == 0)\n return false;\n return true;\n\n } else {\n System.out.println(\"File does not exist! \");\n return false;\n }\n\n }", "private Map<String, Integer> createRootNotes(String file) throws FileNotFoundException {\n Map<String, Integer> tempNotes = new HashMap<String, Integer>();\n Scanner noteScan = new Scanner(new File(file));\n while (noteScan.hasNextLine()) {\n Scanner line = new Scanner(noteScan.nextLine());\n String note = line.next();\n int value = line.nextInt();\n tempNotes.put(note, value);\n }\n return tempNotes;\n }", "static Map.Entry<String, String> splitLine(String line) {\n // TODO: Make this method less gross!\n int count = 0;\n int cur = 0;\n do {\n cur = line.indexOf(' ', cur+1); // Move cursor to next space character.\n count++;\n } while (0 <= cur && count < 4);\n\n String key, value;\n if (0 <= cur && cur < line.length()) {\n // Don't include the separating space in either `key` or `value`:\n key = line.substring(0, cur); //\n value = line.substring(cur+1, line.length());\n } else {\n key = line;\n value = \"\";\n }\n\n return new Map.Entry<String, String>() {\n @Override public String getKey() {\n return key;\n }\n @Override public String getValue() {\n return value;\n }\n @Override public String setValue(String value) {\n throw new UnsupportedOperationException();\n }\n };\n }", "private void loadCSVFileIntoHashmap(){\n try {\n postCodesFileReader = new FileReader(postCodesFileLocation);\n String line;\n //Open up the buffered reader so we can start looping through our CSV file\n BufferedReader br = new BufferedReader(postCodesFileReader);\n while ((line = br.readLine()) != null) {\n String[] country = line.split(fieldSeperator);\n if(country.length<=3){\n //Add the region code and matching country to the hashmap\n postCodesMap.put(country[0].trim(), country[2].trim());\n }\n }\n br.close();\n } \n catch (Exception e) {\n //Ideally we would use a custom log file, but for the sake of a quick demo use the stderr \n e.printStackTrace();\n } \n }", "public static Dictionary readInDictionary(String fileName) {\r\n Dictionary d = new Dictionary();\r\n Scanner fileScanner;\r\n\r\n try {\r\n // use a FileInputStream to ensure correct reading end-of-file\r\n fileScanner = new Scanner(new FileInputStream(\"data\" + File.separator +fileName));\r\n\r\n while (fileScanner.hasNextLine()) {\r\n String nextLine = fileScanner.nextLine();\r\n // System.out.println(\"nextLine: \" + nextLine); uncomment if you want to see what is read in\r\n DictionaryData data = new DictionaryData(nextLine);\r\n\r\n // TODO: call insert() here to insert the data object into the dictionary!\r\n d.insert(data.word.toUpperCase(),data);\r\n }\r\n\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"could not find the file \" +fileName+ \"in the data directory!\");\r\n return null;\r\n }\r\n\r\n return d;\r\n }", "private void initMapData() {\n\n\t\ttry {\n\n\t\t\t@SuppressWarnings(\"resource\")\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(mapFile));\n\t\t\t\n\t\t\tfor (int row = 0; row < height; row++) {\n\t\t\t\t\n\t\t\t\t// read a line\n\t\t\t\tString line = br.readLine();\n\t\t\t\t\n\t\t\t\t// if length of this line is different from width, then throw\n\t\t\t\tif (line.length() != width)\n\t\t\t\t\tthrow new InvalidLevelFormatException();\n\t\t\t\t\n\t\t\t\t// split all single characters of this string into array\n\t\t\t\tchar[] elements = line.toCharArray();\n\t\t\t\t\n\t\t\t\t// save these single characters into mapData array\n\t\t\t\tfor (int col = 0; col < width; col++) {\n\t\t\t\t\tmapElementStringArray[row][col] = String.valueOf(elements[col]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static HashMap<String,String> topics(){\n HashMap<String,String> temp = new HashMap<String,String>();\n Scanner topicer;\n try {\n topicer = new Scanner(new File(\"Topics.txt\"));\n topicer.useDelimiter(\",~ *\\n*\");\n while (topicer.hasNext()){\n String key = \" \"+topicer.next()+\" \";\n String value = \"\";\n if(topicer.hasNext())\n value = topicer.next();\n temp.put(key, value);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "public static Map<Long, Book> readToMap() throws ApplicationException {\r\n ArrayList<String> bookList = readFile();\r\n Map<Long, Book> books = new HashMap<>();\r\n\r\n for (int i = 0; i < bookList.size(); i++) {\r\n String[] rows = bookList.get(i).split(COMMA_DELIMITER, -1);\r\n Book book = readBookString(rows);\r\n books.put(book.getId(), book);\r\n LOG.debug(String.format(\"%s has been added to the Map\", book.getAuthor()));\r\n\r\n }\r\n\r\n return books;\r\n\r\n }", "public static HashMap<String, String> getNamesMap(File uniprotNamesFile) throws IOException {\n\n HashMap<String, String> namesMap = new HashMap<>();\n\n InputStream fileStream = new FileInputStream(uniprotNamesFile);\n InputStream gzipStream = new GZIPInputStream(fileStream);\n Reader decoder = new InputStreamReader(gzipStream, encoding);\n\n char[] separators = {'[', '('};\n\n try (BufferedReader br = new BufferedReader(decoder)) {\n\n String line = br.readLine();\n while ((line = br.readLine()) != null) {\n\n String[] lineSplit = line.split(\"\\t\");\n\n String accession = lineSplit[0];\n String proteinName = lineSplit[1];\n\n int separatorIndex = indexOf(proteinName, separators, 7);\n\n if (separatorIndex > -1) {\n\n proteinName = proteinName.substring(0, separatorIndex - 1);\n\n }\n\n namesMap.put(accession, proteinName);\n }\n }\n\n return namesMap;\n }", "private void processFileEntries(final File filePath, Map<String, Integer> bigramHistogramMap) {\n\n BufferedInputStream bis = null;\n FileInputStream fis = null;\n\n try {\n\n // create FileInputStream object\n fis = new FileInputStream(filePath);\n\n // create object of BufferedInputStream\n bis = new BufferedInputStream(fis);\n\n String stringLine;\n\n BufferedReader br = new BufferedReader(new InputStreamReader(bis));\n\n String previousWord = \"\";\n\n while ((stringLine = br.readLine()) != null) {\n previousWord = addBigramHistogramEntry(stringLine, previousWord, bigramHistogramMap);\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found - \" + e);\n } catch (IOException ioe) {\n System.out.println(\"Exception while reading file - \" + ioe);\n } catch (Exception e) {\n System.out.println(\"Unable to load: \" + filePath.getName());\n } finally {\n // close the streams using close method\n try {\n if (fis != null) {\n fis.close();\n }\n if (bis != null) {\n bis.close();\n }\n } catch (IOException ioe) {\n System.out.println(\"Error while closing stream : \" + ioe);\n }\n }\n }", "public abstract void readFromFile(String key, String value);", "public static HashMap<String, HashMap<String, Double>> fileToObv(String wordsPathName, String posPathName) throws IOException{\n //initialize BufferedReaders and ap to put observations in\n BufferedReader wordsInput = null;\n BufferedReader posInput = null;\n HashMap<String, HashMap<String, Double>> observations = new HashMap<String, HashMap<String, Double>>();\n try{\n //try to open files\n posInput = new BufferedReader(new FileReader(posPathName));\n wordsInput = new BufferedReader(new FileReader(wordsPathName));\n String posLine = posInput.readLine();\n String wordsLine = wordsInput.readLine();\n //While there are more lines in each of the given files\n while (wordsLine != null && posLine != null){\n //Lowercase the sentence file, and split both on white space\n wordsLine = wordsLine.toLowerCase();\n //posLine = posLine.toLowerCase();\n String[] wordsPerLine = wordsLine.split(\" \");\n String[] posPerLine = posLine.split(\" \");\n //Checks for the '#' character, if it's already in the map,\n //checks if the first word in the sentence is already in the inner map\n //if it is, then add 1 to the integer value associated with it, if not,\n //add it to the map with an integer value of 1.0\n if (observations.containsKey(\"#\")){\n HashMap<String, Double> wnc = new HashMap<String, Double>();\n wnc = observations.get(\"#\");\n if (wnc.containsKey(wordsPerLine[0])){\n Double num = wnc.get(wordsPerLine[0]) +1;\n wnc.put(wordsPerLine[0], num);\n observations.put(\"#\", wnc);\n }\n else{\n wnc.put(wordsPerLine[0], 1.0);\n observations.put(\"#\", wnc);\n }\n }\n else{\n HashMap<String, Double> map = new HashMap<String, Double>();\n map.put(wordsPerLine[0], 1.0);\n observations.put(\"#\", map);\n }\n //for each word in line of the given string\n for (int i = 0; i < wordsPerLine.length-1; i ++){\n HashMap<String, Double> wordsAndCounts = new HashMap<String, Double>();\n //if the map already contains the part of speech\n if (observations.containsKey(posPerLine[i])){\n //get the inner map associated with that part of speech\n wordsAndCounts = observations.get(posPerLine[i]);\n //if that inner map contains the associated word\n //add 1 to the integer value\n if (wordsAndCounts.containsKey(wordsPerLine[i])){\n Double num = wordsAndCounts.get(wordsPerLine[i]) + 1;\n wordsAndCounts.put(wordsPerLine[i], num);\n }\n //else, add the word to the inner map with int value of 1\n else{\n wordsAndCounts.put(wordsPerLine[i], 1.0);\n }\n }\n //else, add the word to an empty map with the int value of 1\n else{\n wordsAndCounts.put(wordsPerLine[i], 1.0);\n }\n //add the part of speech and associated inner map to the observations map.\n observations.put(posPerLine[i], wordsAndCounts);\n }\n //read the next lines in each of the files\n posLine = posInput.readLine();\n wordsLine = wordsInput.readLine();\n }\n }\n //Catch exceptions\n catch (IOException e){\n e.printStackTrace();\n }\n //close files\n finally{\n wordsInput.close();\n posInput.close();\n }\n //return created map\n return observations;\n }", "private void readFile(Path file, Charset charset) {\n\n BufferedReader reader = null;\n try {\n log.info(\"Reading file \" + file.getFileName().toString());\n reader = Files.newBufferedReader(file, charset);\n\n String line = null;\n while ((line = reader.readLine()) != null) {\n\n String[] splitLine = line.split(\",\");\n LocalDateTime ldt = LocalDateTime.parse(splitLine[0], DateTimeFormatter.ISO_DATE_TIME);\n\n /**\n * Creation of new map filtered to get all lines before the current date got from the current file line\n */\n Map<LocalDateTime, String> filteredMap = mapLines.entrySet().stream()\n .filter(entry -> entry.getKey().isBefore(ldt))\n .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n (v1,v2) ->{ throw new RuntimeException(String.format(\"Duplicate key for values %s and %s\", v1, v2));},\n TreeMap::new));\n\n /**\n * Printing each line from filter map, also we delete those objects to maintain memory.\n */\n filteredMap.forEach((localDateTime, s) -> {\n System.out.println(s);\n mapLines.remove(localDateTime, s);\n });\n filteredMap.clear();\n\n mapLines.put(ldt, line);\n TimeUnit.SECONDS.sleep(1);\n }\n } catch (MalformedInputException m) {\n readFile(file, Charset.forName(\"Windows-1252\"));\n } catch (IOException e) {\n log.error(e, e);\n }\n catch (InterruptedException ie) {\n log.error(ie, ie);\n }\n }", "@Override\n protected void read(){\n try(BufferedReader bufferedReader = new BufferedReader(new FileReader(getPath()));) {\n\n String frequencyString;\n\n String frequencyFileFormat = \"([a-z]\\\\s\\\\d+\\\\.\\\\d+)\";\n Pattern pattern = Pattern.compile(frequencyFileFormat);\n Matcher matcher;\n\n String[] frequency;\n\n // Read in each line of the frequencies file\n while ((frequencyString = bufferedReader.readLine()) != null) {\n // Match the frequency format to a individual frequency\n matcher = pattern.matcher(frequencyString);\n if(matcher.find()){\n\n // Split the string into the character and its frequency\n frequency = matcher.group(1).split(\" \");\n\n // Add the string and its corresponding frequency to the frequencies hash map\n frequencies.put(frequency[0], Double.parseDouble(frequency[1]));\n \n }\n }\n\n // Only set to true if it successfully reads the whole file\n setFileRead();\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }", "private HashMap<String, SubsetElement> LoadFile(String fileName) {\n final HashMap<String, SubsetElement> tempMap = new HashMap<String, SubsetElement>();\r\n try {\r\n final Scanner input = new Scanner(new File(fileName));\r\n String line = input.nextLine();\r\n final String[] headers = line.split(\"\\t\");\r\n\r\n Integer i = 1;\r\n while (input.hasNext()) {\r\n line = input.nextLine();\r\n final String[] values = line.split(\"\\t\");\r\n // if(values.length!=headers.length){\r\n // System.out.println(\"Missing values in data row \"+ i);\r\n // break;\r\n // }\r\n\r\n final SubsetElement element = new SubsetElement(headers,\r\n values, this.subsetIdName, this.conceptIdName);\r\n tempMap.put(element.getHash(), element);\r\n i++;\r\n }\r\n input.close();\r\n\r\n } catch (final FileNotFoundException e) {\r\n System.err.println(\"Unable to open and parse file \" + fileName);\r\n e.printStackTrace();\r\n }\r\n\r\n return tempMap;\r\n }", "private void loadData () {\n try {\n File f = new File(\"arpabet.txt\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n vowels = new HashMap<String, String>();\n consonants = new HashMap<String, String>();\n phonemes = new ArrayList<String>();\n String[] data = new String[3];\n for (String line; (line = br.readLine()) != null; ) {\n if (line.startsWith(\";\")) {\n continue;\n }\n data = line.split(\",\");\n phonemes.add(data[0]);\n if (data[1].compareTo(\"v\") == 0) {\n vowels.put(data[0], data[2]);\n } else {\n consonants.put(data[0], data[2]);\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void readData() {\n try (BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) {\n String line;\n while ((line = br.readLine()) != null) {\n String[] parts = line.split(\",\");\n int zip = Integer.parseInt(parts[0]);\n String name = parts[1];\n\n zipMap.put(zip, name);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static HashMap<String, IRI> processCSVGoTHash(String path) throws FileNotFoundException {\n BufferedReader in = null;\n in = new java.io.BufferedReader(new java.io.FileReader(path));\n String currentLine;\n int lineN = 0;\n String value=\"\";\n String term=\"\";\n HashMap<String, IRI> got = new HashMap<String, IRI>();\n try {\n while ((currentLine = in.readLine()) != null) {\n if (lineN == 0) {\n lineN++; //get rid of the headers\n } else {\n //process each vocab\n String[] info = currentLine.split(\";\");\n if(info.length==2) {\n value = info[0];\n term = info[1];\n }\n got.put(value, IRI.create(term));\n\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n try {\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return got ;\n }", "@Nullable\n private static Map<Integer, String> readNwsoSubCenter(String path) {\n Map<Integer, String> result = new HashMap<>();\n\n try (InputStream is = GribResourceReader.getInputStream(path);\n BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n while (true) {\n String line = br.readLine();\n if (line == null) {\n break;\n }\n if ((line.isEmpty()) || line.startsWith(\"#\")) {\n continue;\n }\n\n StringBuilder lineb = new StringBuilder(line);\n StringUtil2.removeAll(lineb, \"'+,/\");\n String[] flds = lineb.toString().split(\"[:]\");\n\n int val = Integer.parseInt(flds[0].trim()); // must have a number\n String name = flds[1].trim() + \": \" + flds[2].trim();\n\n result.put(val, name);\n }\n return Collections.unmodifiableMap(result); // all at once - thread safe\n\n } catch (IOException ioError) {\n logger.warn(\"An error occurred in Grib1Tables while trying to open the table \" + path + \" : \" + ioError);\n return null;\n }\n }", "public static void load(Context context) throws IOException {\n // read the file\n String raw = File.readFile(\"vaccine.txt\", context);\n\n // clear the map and load contents of file into the map\n map.clear();\n for (String line : raw.split(\"\\n\")) {\n if (line.equals(\"\")) {\n continue;\n }\n String[] data = line.split(\",\");\n if (data[0].equals(\"\") || data.length != 3) {\n continue;\n }\n map.put(data[0], Boolean.getBoolean(data[1]));\n dateMap.put(data[0], data[2]);\n }\n }", "private void read(String filename) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(filename));\n\t\t\n\t\t//a variable that will increase by one each time another element is added to the array\n\t\t//to ensure array size is correct\n\t\tint numStation = 0;\n\t\t\n\t\t//ignores first 6 lines\n\t\tfor(int i = 0; i < 3; ++i){\n\t\t\tbr.readLine();\n\t\t}\n\t\t\n\t\t//sets String equal readline\n\t\tString lineOfData = br.readLine();\n\n\t\twhile(lineOfData != null)\n\t\t{\n\t\t\tString station = new String();\n\t\t\tstation = lineOfData.substring(10,14);\n\t\t\tMesoAsciiCal asciiAverage = new MesoAsciiCal(new MesoStation(station));\n\t\t\tint asciiAvg = asciiAverage.calAverage();\t\t\n\n\t\t\tHashMap<String, Integer> asciiVal = new HashMap<String, Integer>();\n\t\t\t//put the keys and values into the hashmap\n\t\t\tasciiVal.put(station, asciiAvg);\n\t\t\t//get ascii interger avg value\n\t\t\tInteger avg = asciiVal.get(station);\n\t\t\t\n\t\t\thashmap.put(station,avg);\n\t\t\t\n\t\t\tlineOfData = br.readLine();\n\t\t\t\n\t\t}\n\t\t\n\t\tbr.close();\n\t}", "private void readKeyDataToIdentifyTransactions(){\n\t\t\n\t\tBufferedReader reader = null;\n\t\t\n\t\ttry{\n\t\t\treader = new BufferedReader(new FileReader(keyFile));\n\t\t\tString line;\n\t\t\twhile((line = reader.readLine()) != null){\n\t\t\t\tif((line.startsWith(\"#\")) || (line.equals(\"\")))\n\t\t\t\t\tcontinue;\n\t\t\t\telse{\n\t\t\t\t\tString transacName = line.split(\";\")[0];\n\t\t\t\t\tchar transacType = line.split(\";\")[1].charAt(0);\n\t\t\t\t\ttypeTransData.put(transacName,transacType);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Sorry!! \"+ keyFile +\" required for processing!!!\");\n\t\t\tSystem.out.println(\"Please try again !!!\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t/**\n\t * Read data and store\n\t * @param data\n\t * \t\t\t\tThe map to store data read from ser file\n\t * @return Map<String, T>\n\t * \t\t\ta map of data that has all the ser file data\n\t * @throws ClassNotFoundException\n\t * @throws IOException\n\t */\n\tprotected Map<String, T> readFromFile(Map<String, T> data) throws ClassNotFoundException, IOException {\n\t\t\n\t\tInputStream file = new FileInputStream(filePath);\n\t\tInputStream buffer = new BufferedInputStream(file);\n\t\tObjectInput input = new ObjectInputStream(buffer);\n\n\t\t//deserialize the Map\n\t\tdata = (HashMap<String, T>) input.readObject();\n\t\tinput.close();\n\t\treturn data;\n\t}", "public static void buildDictionary() throws IOException {\n\t\t\n \tSystem.out.println(\"Loading dictionary...\");\n \t\n \tBufferedReader input = new BufferedReader( new FileReader(entities) );\n \tMapDictionary<String> dictionary = new MapDictionary<String>();\t\n \tString aux = null;\n \t\n\t\twhile ((aux=input.readLine())!=null) {\t\t\t\n\t\t\tif (aux.length()==0)\n\t\t\t\tcontinue;\n\n\t\t\taux.replaceAll(\"([A-Z])\",\" $1\").trim();\t\t\t\n\t\t\tdictionary.addEntry(new DictionaryEntry<String>(aux,aux,CHUNK_SCORE));\n\t \n\t\t}\n\t\t\n chunker = new ExactDictionaryChunker(dictionary,IndoEuropeanTokenizerFactory.INSTANCE,true,true);\n System.out.println(\"Dictionary contains \" + dictionary.size() + \" entries.\");\n }", "public static Map readMap(MapName s)\n {\n Map map = new Map(1);\n try\n {\n MapReader run = new MapReader();\n System.out.println(s.toString());\n Scanner mapReader = new Scanner(run.getClass().getResourceAsStream(\"/\"+s.toString()+\".jwmap\"));\n ArrayList<String[]> numberLines = new ArrayList<String[]>();\n int dim = mapReader.nextInt();\n mapReader.nextLine();\n for(int gh = 0 ; gh < dim; gh++)\n {\n String[] nums = mapReader.nextLine().split(\" \");\n numberLines.add(nums);\n }\n int[][] newMap = new int[numberLines.size()][numberLines.size()];\n \n for(int i = 0; i < numberLines.size();i++)\n {\n for(int h = 0; h < numberLines.get(i).length;h++)\n {\n newMap[i][h] = Integer.parseInt(numberLines.get(i)[h]);\n }\n }\n map.loadMap(newMap);\n \n TreeMap<Integer,ArrayList<Integer>> spawn1 = map.getSpawn1();\n TreeMap<Integer,ArrayList<Integer>> spawn2 = map.getSpawn2();\n \n String line = \"\";\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn1\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn1.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn1.get(x).add(in.nextInt());\n }\n }\n \n if(!line.equals(\"\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn2\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n }\n catch (Exception ex)\n {\n JOptionPane.showMessageDialog(null, \"Corrupted file!\");\n }\n return map;\n }", "public static void addtoHashMap (File filename){\n\t\tFileInputStream fin;\n\t\ttry{\n\t\t\tfin = new FileInputStream(filename);\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(fin));\n\t\t\tString n;\n\t\t\ttry{\n\t\t\t\twhile ((n = br.readLine()) != null){\n\t\t\t\t\tif(h.containsKey(n)){\n\t\t\t\t\t\tint i = (Integer) h.get(n);\n\t\t\t\t\t\th.put(n, (i+1));\n\t\t\t\t\t}else{\n\t\t\t\t\t\th.put(n, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "protected void readCSVToMap(String filename) throws Exception{ // IMPORTANT FUNCTION\n db = new HashMap<String, List<String>>();\n keys = new ArrayList<String>();\n InputStream is = getAssets().open(\"ABBREV_2.txt\");\n //File f = new File(path.toURI());\n //File f = new File(path.getFile());\n BufferedReader in = new BufferedReader(new InputStreamReader(is));//new BufferedReader(new FileReader(\"ABBREV_2.txt\"));\n String line = \"\";\n while ((line = in.readLine()) != null) {\n String parts[] = line.split(\"\\t\");\n List<String> nutrition = new ArrayList();\n for (int i = 1; i < parts.length; i++){\n nutrition.add(parts[i]);\n }\n db.put(parts[0], nutrition);\n keys.add(parts[0]);\n }\n in.close();\n\n }", "public void fileReader2(String fin) throws IOException {\r\n Decoder decoder = new Decoder();\r\n\r\n Map<String,String> dicionario = new HashMap<String,String>();\r\n Map<String,Integer> colecaoMetais = new HashMap<String,Integer>();\r\n BufferedReader br;\r\n String alien_Sound_1,alien_Sound_2,alien_Sound_3,alien_Sound_4;\r\n\r\n try { \r\n br = new BufferedReader(new FileReader(fin));\r\n \r\n int numLinhas = 0;\r\n String line = null;\r\n while ((line = br.readLine()) != null) {\r\n\r\n /*\r\n Read up to 7 lines of Notations\r\n and saves it on a HashMap.\r\n */\r\n if(((line.substring(5,6)).equals(\"is\")) && numLinhas<7){ \r\n String AlienLang = line.substring(0,4);\r\n String RomanNumeral = line.substring(8);\r\n dicionario.put(AlienLang,RomanNumeral);\r\n System.out.println(AlienLang+\" \"+RomanNumeral);\r\n }\r\n \r\n \r\n /*\r\n Read the info given: unidades, creditos and the type of the metal.\r\n And it saves the metal and its value in a HashMap.\r\n */\r\n else if(line.charAt(line.length()-1) != '?' && (line.substring(0,6).equals(\"quanto \")==false) || line.substring(0,6).equals(\"quantos\")==false){\r\n int unidadesInt = decoder.romanToInt((dicionario.get(line.substring(0,3)) + dicionario.get(line.substring(5,8))));\r\n String metal = dicionario.get(line.substring(10,13));\r\n int creditos = decoder.romanToInt(dicionario.get(line.substring(20,21))); \r\n int metalValor = creditos/unidadesInt;\r\n\r\n colecaoMetais.put(metal,metalValor);\r\n System.out.println(metal +\" \"+ metalValor);\r\n }\r\n\r\n /*\r\n Recongnizes that this a question \"quanto vale\"\r\n and calculates it with the numbers given.\r\n if the alien numbers given are not known it will print an error messege.\r\n */\r\n else if(numLinhas>7 && (line.substring(0,6).equals(\"quanto \"))){\r\n alien_Sound_1 = line.substring(12,15);\r\n alien_Sound_2 = line.substring(17,20);\r\n alien_Sound_3 = line.substring(22,25);\r\n alien_Sound_4 = line.substring(27,30);\r\n\r\n if(((dicionario.containsKey(alien_Sound_1) == false || \r\n (dicionario.containsKey(alien_Sound_2)) == false) || \r\n (dicionario.containsKey(alien_Sound_3)) == false) ||\r\n (dicionario.containsKey(alien_Sound_4)) == false){\r\n System.out.println(\"I have no idea what you are talking about\");\r\n\r\n }\r\n\r\n int finalCreditos = decoder.romanToInt(dicionario.get(alien_Sound_1)\r\n + (dicionario.get(alien_Sound_2))\r\n + (dicionario.get(alien_Sound_3)\r\n + (dicionario.get(alien_Sound_4))));\r\n\r\n System.out.println(alien_Sound_1 +\" \"+ alien_Sound_2 +\" \"+ alien_Sound_3 +\" \"+ alien_Sound_4 +\" is \"+ finalCreditos);\r\n }\r\n /*\r\n Recongnizes that this a question \"quantos créditos são\"\r\n and calculates it with the numbers and kind of metal given.\r\n if the alien numbers given or the metal are not known it will print an error messege.\r\n */\r\n if(line.charAt(line.length()-1) == '?' && (line.substring(0,6).equals(\"quantos\"))){\r\n alien_Sound_1 = line.substring(21,24);\r\n alien_Sound_2 = line.substring(26,29);\r\n alien_Sound_3 = line.substring(31,34);\r\n\r\n if(((dicionario.containsKey(alien_Sound_1) == false) || \r\n (dicionario.containsKey(alien_Sound_2) == false) || \r\n (colecaoMetais.containsKey(alien_Sound_3) == false))){\r\n System.out.println(\"I'm sorry Dave, I'm afraid I can't do that\");\r\n }\r\n\r\n int finalUnidades = decoder.romanToInt(dicionario.get(alien_Sound_1) + (dicionario.get(alien_Sound_2)));\r\n int valorMetal = colecaoMetais.get(alien_Sound_3);\r\n int finalMetalValue = finalUnidades * valorMetal;\r\n\r\n System.out.println(alien_Sound_1 +\" \"+ alien_Sound_2 +\" \"+ alien_Sound_3 +\" is \"+ finalMetalValue);\r\n }\r\n\r\n numLinhas++;\r\n \r\n }\r\n br.close();\r\n\r\n }\r\n catch(IOException e) \r\n { \r\n e.printStackTrace(); \r\n } \r\n \r\n }", "public static HashMap<String,String> read_json_file(String filepath){\n HashMap<String,String> map = new HashMap<String,String>();\n try{\n BufferedReader bufferedReader = new BufferedReader(new FileReader(filepath));\n Gson gson = new Gson();\n Object json = gson.fromJson(bufferedReader, Object.class);\n map = new Gson().fromJson(\n json.toString(), new TypeToken<HashMap<String, String>>() {}.getType()\n );\n } catch (FileNotFoundException e ) {\n e.printStackTrace();\n }\n return map;\n }", "private void process(String file, LinkedList<String> ll) {\r\n \ttry {\r\n \t\tFile currFile = openFile(file);\r\n \t\tStringBuilder sb;\r\n\r\n \t\tif (currFile == null) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tBufferedReader br = new BufferedReader(new FileReader(currFile));\r\n \t\tString line = null;\r\n \t\twhile ((line = br.readLine()) != null) {\r\n \t\t\tint length = line.length();\r\n \t\t\tif (length == 0) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tint index = 0;\r\n \t\t\tLinkedList<String> newLL;\r\n \t\t\twhile (index < length && line.charAt(index) == ' ') {\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tif (index > length-8 || line.substring(index, index+8).compareTo(\"#include\") != 0) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tindex += 8;\r\n \t\t\twhile (line.charAt(index) == ' ') {\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tif (line.charAt(index) != '\"') {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tindex++;\r\n \t\t\tint len = line.length();\r\n \t\t\tsb = new StringBuilder();\r\n \t\t\twhile (index < len) {\r\n \t\t\t\tif (line.charAt(index) == '\"') {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\tsb.append(line.charAt(index));\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tString currName = sb.toString();\r\n \t\t\tll.add(currName);\r\n \t\t\tif (hashM.containsKey(currName)) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tnewLL = new LinkedList<String>();\r\n \t\t\thashM.put(currName, newLL);\r\n \t\t\tworkQueue.add(currName);\r\n \t\t}\r\n \t}\r\n \tcatch (Exception x) {\r\n \t\tx.printStackTrace();\r\n \t}\r\n }", "private void createMap(File inFile)\r\n\t\tthrows Exception\r\n\t{\n\t\tBufferedReader in = new BufferedReader(new FileReader(inFile));\r\n\r\n\t\t// Chromosomes\r\n\t\tString[] chrms = in.readLine().split(\",\");\r\n\t\t// Marker positions\r\n\t\tString[] mrkrs = in.readLine().split(\",\");\r\n\t\tin.close();\r\n\r\n\r\n\t\t// Now rewrite it in Flapjack map format\r\n\t\tBufferedWriter out = new BufferedWriter(new FileWriter(new File(wrkDir, \"map\")));\r\n\t\tout.write(\"# fjFile = MAP\");\r\n\t\tout.newLine();\r\n\r\n\t\tfor (int i = 0; i < chrms.length; i++)\r\n\t\t{\r\n\t\t\tMarker m = new Marker(i, chrms[i], mrkrs[i]);\r\n\t\t\tmarkers.add(m);\r\n\r\n\t\t\tout.write(m.name + \"\\t\" + m.chr + \"\\t\" + m.pos);\r\n\t\t\tout.newLine();\r\n\t\t}\r\n\t\tout.close();\r\n\r\n\t\tmarkers.stream().forEach(marker -> {\r\n\r\n\t\t\tSystem.out.println(marker.name);\r\n\r\n\t\t});\r\n\t}", "public void loadEntities (File entitiesFile){\n BufferedReader br = null;\n int lineNum = 0;\n try {\n String term;\n br = new BufferedReader(new FileReader(entitiesFile));\n String line = \"\";\n while ((line = (br.readLine())) != null) {\n lineNum++;\n if (!line.contains(\"--noEntities--\")) {\n String docId = line.substring(0, line.indexOf(\":\"));\n String [] entitiesStr = line.split(\"; \");\n if (entitiesStr.length > 0){\n entitiesStr[0] = entitiesStr[0].substring(line.indexOf(\":\") + 2);\n }\n HashMap <String, Integer> entitiesInfo = new HashMap<>();\n for (int i = 0; i < entitiesStr.length ; i++){\n String [] entitiesRankStr = entitiesStr[i].split(\" - \");\n if (entitiesRankStr.length < 2){\n System.out.println(lineNum + \" \" + entitiesRankStr[0]);\n }\n entitiesInfo.put(entitiesRankStr[0], Integer.parseInt(entitiesRankStr[1]));\n }\n entities.put(docId, entitiesInfo);\n }\n }\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Map<String, Set<String>> loadDictionary(File dictionaryFile) throws IOException {\n // iterate through the input file lines\n try (Stream<String> lines = Files.lines(dictionaryFile.toPath())) {\n // create resulting map as per javadoc\n Map<String, Set<String>> result = new HashMap<>();\n // for each line in the input file\n lines.forEach(line -> {\n // convert to lower case and remove all non-mappable characters\n String filtered = filter(line);\n // get number that is result of decoding of the word in current line\n String decodedNumber = decode(filtered);\n // create empty set if there are no entries for the current decoded number\n if (!result.containsKey(decodedNumber)) {\n result.put(decodedNumber, new HashSet<>());\n }\n // put original word mapped to the decoded number\n result.get(decodedNumber).add(line);\n });\n return result;\n }\n }", "public static HashMap<String, String> readFromExcel() throws IOException, WriteException, BiffException {\n\t\t\t\tList<String> keyList = new ArrayList<String>(); \r\n\t\t\t\tList<String> list = new ArrayList<String>(); \r\n\t\t\t\tHashMap<String, String> map = new HashMap<String, String>(); \r\n\t\t\t\tString str = null;\r\n\t\t\t\r\n\t\t\t\ttry\r\n\t\t {\r\n\t\t File f1=new File(\"//ecs-9844/DoNotDelete/JenkinsData/input.xls\");\r\n\t\t //the excel sheet which contains data\r\n\t\t WorkbookSettings ws=new WorkbookSettings();\r\n\t\t ws.setLocale(new Locale(\"er\",\"ER\"));\r\n\t\t Workbook workbook=Workbook.getWorkbook(f1,ws);\r\n\t\t Sheet readsheet=workbook.getSheet(0);\r\n\t\t //Loop to read the KEYS from Excel i.e, 1st column of the Excel\r\n\t\t for(int i=0;i<readsheet.getColumns();i++) {\r\n\t\t \tstr=readsheet.getCell(i,0).getContents().toString();\r\n\t\t \tlist.add(str);\r\n\t\t }\r\n\t\t \tkeyList.addAll(list);\r\n\t\t \t// Hardcoding the first map (key, value) values \r\n\t\t \tmap.put(keyList.get(0), readsheet.getCell(0, 1).getContents().toString());\r\n\t\t \t// Loop to read TEST DATA from the Excel\r\n\t\t for(int i=1;i<readsheet.getRows();i++) {\r\n\t\t for(int j=1;j<readsheet.getColumns();j++) {\t\r\n\t\t str=readsheet.getCell(j,i).getContents().toString();\r\n\t\t list.add(str);\r\n\t\t System.out.println(str);\r\n\t\t map.put(keyList.get(j),str); \r\n\t\t \t}\r\n\t\t }\r\n\t\t //Print the map(key, value) \r\n\t\t System.out.println(\"Print map\");\r\n\t\t System.out.println(map);\r\n\t\t \r\n\t\t }\r\n\t\t catch(IOException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\r\n\t\t catch(BiffException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t } catch (Exception e) {\r\n\t\t e.printStackTrace(); \r\n\t\t }\r\n\t\t\t\t\treturn map;\r\n\t}", "public static String[][] ReadTestData(String pathToCSVfile) throws Exception{\n\t\t\t\n\t\t//\tHashMap<String,String> theMap = new HashMap<String,String>();\n\n\t\t \n //Create object of FileReader\n FileReader inputFile = new FileReader(pathToCSVfile);\n \n //Instantiate the BufferedReader Class\n BufferedReader bufferReader = new BufferedReader(inputFile);\n \n //Variable to hold one line data\n String line;\n int NumberOfLines = 0;\n \n String[][] data = new String[1000][25]; // set the max rows to 1000 and col to 100\n \n // Read file line by line and print on the console\n while ((line = bufferReader.readLine()) != null) {\n \t \n \t String[] lineArray = line.split(Pattern.quote(\",\")); //split the line up and save to array\n \t int lineSize = lineArray.length;\n \t int z;\n \t for (z = 0; z <= (lineSize-1);)\n \t {\n \t\t data[NumberOfLines][z] = lineArray[z].toString();\n \t\t z++;\n \t } \n \t \n \t if(z <= 25) // read in 25 cols to make sure the array does not have nulls that other areas of the code are looking in\n \t {\t \t\t \n \t\t while (z <= 24)\n\t \t {\t\t \n \t\t\t data[NumberOfLines][z] = \" \";\n\t \t\t z++;\n\t \t } \n \t }\n \t NumberOfLines++; \n \t \n }\n \n bufferReader.close();\n \n // for (int h=0; h< NumberOfLines; h++) {theMap.put(data[h][0],data[h][1]); }\n \n \n System.out.println(\"Test Data has been saved \"); \n \n \t \n return data;\n \n\t \n\t}", "private static void readWordsIntoMap(SimpleReader in,\n Map<String, Integer> wordMap, char[] seps) {\n String line = \"\";\n wordMap.clear();\n\n while (!in.atEOS()) {\n line = in.nextLine();\n for (char sep : seps) {\n line = line.replace(sep, ':');\n }\n\n String[] words = line.split(\":\");\n\n for (String word : words) {\n if (!wordMap.hasKey(word) && word != \" \") {\n wordMap.add(word, 1);\n } else {\n int count = wordMap.value(word);\n count++;\n wordMap.replaceValue(word, count);\n }\n }\n }\n\n }", "public static void readDictionary()\r\n\t{\r\n\t\t//It trys to read over the file using try-catch in case of an Exception\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"english.0\");\r\n\t\t\tScanner scan = new Scanner(file);\r\n\t\t\t//It reads over the file as long as there are words to read and we insert them into the given storage\r\n\t\t\twhile(scan.hasNext()) {\r\n\t\t\t\tdata.insert(scan.next());\r\n\t\t\t}\r\n\t\t\tscan.close(); \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\t\t}\r\n\t}", "public HashMap<String, Car> createCarsFromFile(String filename) throws FileNotFoundException {\n\t\t\n\n\t\tFile fh = new File(filename);\n\t\tScanner myScanner = new Scanner(fh);\n\t\twhile(myScanner.hasNextLine()){\n\t\t\tString line = myScanner.nextLine();\n\t\t\tString[] lineArr = line.split(\";\");\n\t\t\tString id = IdFactory.getRegNr();\n\t\t\tString make = lineArr[0];\n\t\t\tString[] makeStuff = lineArr[1].split(\" \");\n\t\t\tString model = lineArr[0];\n\t\t\tString type = makeStuff[0];\n\t\t\tint mpg = Integer.parseInt(lineArr[4]);\n\t\t\tint weight = Integer.parseInt(lineArr[6]);\n\t\t\tCar c = new Car(make,model,type,mpg,weight);\n\t\t\tmyCars.put(c.getRegNr(),c);\n\t\t\tSystem.out.println(\"CAR\" + c);\n\t\t}\n\t\treturn myCars;\n\t}", "public static void loadTargetTerm2IdMapping(File input) throws IOException {\n\t\t\tm_namesMap = new SimpleBidirectionalMap<String, Integer>();\n\t\t\tString encoding = FileUtils.getFileEncoding(input);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(input), encoding));\n\t\t\tString line = reader.readLine();\n\t\t\tint lineNum = 1;\n\t\t\tboolean testFormat = false;\n\t\t\tif(StringUtils.checkIfNumber(line.split(\"\\t\")[0]))\n\t\t\t\ttestFormat = true;\n\t\t\twhile(line!= null) {\n\t\t\t\tif(line.equals(\"@@@\"))\n\t\t\t\t\tbreak;\n\t\t\t\tif(testFormat) {\n\t\t\t\t\tString num = line.split(\"\\t\")[0];\n\t\t\t\t\tSystem.out.println(\"key: \"+line.trim().substring(num.length()+1) + \" value: \" + Integer.parseInt(num));\n\t\t\t\t\tm_namesMap.put(line.trim().substring(num.length()+1), Integer.parseInt(num));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"key????\" + lineNum + \"instead of \" + line.split(\"\\t\")[0]);\n\t\t\t\t\tm_namesMap.put(line.trim(), lineNum);\n\t\t\t\t}\n\t\t\t\tline = reader.readLine();\n\t\t\t\tlineNum ++;\n\t\t\t}\n\t\t}", "public WordMap generateWordMap(String filePath) {\n\n WordMap wm = new WordMap();\n Scanner sc;\n\n try {\n sc = new Scanner(new File(filePath));\n\n while (sc.hasNextLine()) {\n\n String line = sc.nextLine();\n String[] lineData = line.split(\" \");\n\n //Gets a string of the word we are currently parsing\n String word = lineData[colWord].split(\"=\")[1];\n\n wm.put(word, getWordFromLine(line));\n }\n\n } catch (Exception e) {\n System.err.println(\"Error in generateWordMap\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n return null;\n }\n\n sc.close();\n return wm;\n }", "private static Map<String, Map<String, Double>> readWeights(String fileName) throws IOException {\n\t\tMap<String, Map<String, Double>> weightMap = new HashMap<String, Map<String, Double>>();\n\n\t\tString line;\n\t\tBufferedReader br;\n\t\ttry {\n\t\t\tMap<String, Double> weight = new HashMap<String, Double>();\n\t\t\tString tempCategory = \"\";\n\n\t\t\tbr = new BufferedReader(new FileReader(fileName));\n\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\tif (line.isEmpty()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (line.contains(\"------:::::::::::::::::::::::::::::------\")) {\n\t\t\t\t\tString elem[] = line.split(\"------:::::::::::::::::::::::::::::------\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tweight.put(elem[0], Double.parseDouble(elem[1]));\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(line);\n\n\t\t\t\t\t\tSystem.out.println(elem[0] + \"--------\" + elem[1]);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (line.equalsIgnoreCase(\"------------------------------------\")) {\n\t\t\t\t\tweightMap.put(tempCategory, weight);\n\t\t\t\t\tweight = new HashMap<String, Double>();\n\t\t\t\t\ttempCategory = \"\";\n\t\t\t\t} else {\n\t\t\t\t\ttempCategory = line;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn weightMap;\n\n\t}", "public MapMessage processFile(File file) {\r\n\t\ttry {\r\n\r\n\t\t\tScanner input = new Scanner(file);\r\n\r\n\t\t\twhile (input.hasNext()) {\r\n\t\t\t\tString line = input.nextLine();\r\n\t\t\t\tif (!line.isEmpty()) {\r\n\t\t\t\t\tfileContent.append(line).append(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tinput.close();\r\n\r\n\t\t} catch (FileNotFoundException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\tMapMessage mapMessage = validateMap(fileContent.toString());\r\n\t\treturn mapMessage;\r\n\t}", "public void readFile() \n\t{\n\t\tArrayList<String> tempStations = new ArrayList<>();\n\t\t//create arraylist local variable tempStations which will hold the list of stations temporarily for a specific line to be added to the stations hashmap \n\n\t\tString mtrSystemFile = \"MTRsystem_partial.csv\";\n\t\t//store the csv file name in a string\n\t\tFile file = new File(mtrSystemFile);\n\t\t//create a file object for the MTRSystems csv file\n\n\t\ttry \n\t\t{\n\t\t\tScanner inputStream = new Scanner(file);\n\t\t\t//pass the file through to new scanner object to be scanned\n\n\t\t\twhile (inputStream.hasNext())\n\t\t\t//so long as the scanner object has another token to read from the csv file\n\t\t\t{\n\t\t\t\tString line = inputStream.nextLine();\n\t\t\t\t//store the next line in the string variable\n\t\t\t\tcells = line.split(\",\");\n\t\t\t\t//split each line into cells separated by a comma\n\t\t\t\tint celli = 1;\n\t\t\t\t//assign int index to 1, so that only stations are read excluding line name stored at position 0\n\n\t\t\t\twhile (celli <= cells.length - 1)\n\t\t\t\t//whilst the index is less than or equal the last position of the array\n\t\t\t\t{\n\t\t\t\t\tif (celli == 1 || celli == cells.length - 1)\n\t\t\t\t\t//if the index is at the second position in the array or at the last\n\t\t\t\t\t{\n\t\t\t\t\t\tallTermini.add((cells[celli]));\n\t\t\t\t\t\t//add termini to the ArrayList\n\t\t\t\t\t}\n\t\t\t\t\ttempStations.add(cells[celli]);\n\t\t\t\t\t//add station to the ArrayList\n\t\t\t\t\tcelli++;\n\t\t\t\t}\n\n\t\t\t\taddToStations(cells[0], tempStations);\n\t\t\t\t//add the line name and the list of stations for that line to the hashmap\n\t\t\t\ttempStations.clear();\n\t\t\t\t//Clear the temporary list for the next line\n\n\t\t\t\tcells = null;\n\t\t\t}\n\t\t\tinputStream.close();\n\t\t} catch (FileNotFoundException e) \n\t\t{\n\t\t\tSystem.out.println(\"file not found\");\n\t\t}\n\t}", "public static HashMap<String,String> details(String firstword) {\n\t\t\tif(firstword.charAt(firstword.length()-1) == ',')\n\t\t\t\tfirstword = firstword.substring(0, firstword.length()-1);\n\t\t\tHashMap<String,String> temp = new HashMap<String,String>();\n Scanner instructioner;\n try {\n instructioner = new Scanner(new File(\"Details/\"+firstword+\".txt\"));\n instructioner.useDelimiter(\",~ *\\n*\");\n while (instructioner.hasNext()){\n String key = \" \"+instructioner.next()+\" \";\n String value = \"\";\n if(instructioner.hasNext())\n value = instructioner.next();\n temp.put(key, value);\n }\n } catch (FileNotFoundException e) {\n temp = null;\n }\n return temp;\n\t\t}", "public void store(final File f) throws IOException {\n BufferedOutputStream fos = null;\n try {\n fos = new BufferedOutputStream(new FileOutputStream(f));\n final StringBuilder line = new StringBuilder(64);\n for (final Map.Entry<String, String> entry : entrySet()) {\n line.delete(0, line.length());\n line.append(entry.getKey());\n line.append(\"=\");\n line.append(patternNewline.matcher(entry.getValue()).replaceAll(\"\\\\\\\\n\"));\n line.append(\"\\r\\n\");\n\n fos.write(UTF8.getBytes(line.toString()));\n }\n } finally {\n if (fos != null) {\n try {\n fos.flush();\n fos.close();\n } catch (final Exception e){}\n }\n }\n }", "static Map<String, String> readPasswdFile (File pwdFile) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new FileReader(pwdFile));\n\t\tHashtable users = new Hashtable();\n\t\tString l = r.readLine();\n\t\twhile (l != null) {\n\t\t\tint hash = l.indexOf('#');\n\t\t\tif (hash != -1)\n\t\t\t\tl = l.substring(0, hash);\n\t\t\tl = l.trim();\n\t\t\tif (l.length() != 0) {\n\t\t\t\tStringTokenizer t = new StringTokenizer(l, \":\");\n\t\t\t\tString user = t.nextToken();\n\t\t\t\tString password = t.nextToken();\n\t\t\t\tusers.put(user, password);\n\t\t\t}\n\t\t\tl = r.readLine();\n\t\t}\n\t\tr.close();\n\t\treturn users;\n\t}", "public UPOSMapper(String mappingFile){\n map = new ConcurrentHashMap<>();\n try {\n for(String line: Files.readAllLines(Paths.get(mappingFile))){\n line = line.trim();\n if(line.isEmpty()) continue;\n String[] tags = line.split(\"\\t\");\n map.put(tags[0], tags[1]);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void parseFile() throws IOException {\r\n\t\tFileInputStream inputStream = new FileInputStream(FILE_PATH);\r\n\t\tScanner sc = new Scanner(inputStream, \"UTF-8\");\r\n\r\n\t\tString line = \"\";\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tif(line.indexOf(comment_char)==0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(header == true) {\r\n//\t\t\tline = sc.nextLine();\r\n\t\t\tString[] linee = line.split(delimiter);\r\n\t\t\tthis.fieldNames = linee;\r\n\t\t\tfor(int i = 0; i < linee.length; i++) {\r\n\t\t\t\tcolumnMapping.put(linee[i], i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tdf.add(line.split(delimiter, -1));\r\n//\t\t\tif(df.get(df.size()-1).length != this.fieldNames.length) {\r\n//\t\t\t\tSystem.out.println(this.FILE_PATH);\r\n//\t\t\t\tSystem.out.println(String.join(\" \", df.get(df.size()-1)));\r\n//\t\t\t}\r\n\t\t\tfor(int i = 0; i < df.get(df.size()-1).length; i++) {\r\n\t\t\t\tif(df.get(df.size()-1)[i].equals(\"\")) {\r\n\t\t\t\t\tdf.get(df.size()-1)[i] = \"0\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tinputStream.close();\r\n\t\tsc.close();\t\r\n\t}", "public void loadTroubleMarker(HashMap<Integer, TroubleMarker> TroubleMarker_HASH){\r\n \r\n try {\r\n Scanner scanner = new Scanner(new File(file_position+\"TroubleMarker.csv\"));\r\n Scanner dataScanner = null;\r\n int index = 0;\r\n \r\n while (scanner.hasNextLine()) {\r\n dataScanner = new Scanner(scanner.nextLine());\r\n \r\n if(TroubleMarker_HASH.size() == 0){\r\n dataScanner = new Scanner(scanner.nextLine());\r\n }\r\n \r\n dataScanner.useDelimiter(\",\");\r\n TroubleMarker troubleMarker = new TroubleMarker(-1, -1);\r\n \r\n while (dataScanner.hasNext()) {\r\n String data = dataScanner.next();\r\n if (index == 0) {\r\n troubleMarker.setId(Integer.parseInt(data));\r\n } else if (index == 1) {\r\n troubleMarker.setAreaNumber(Integer.parseInt(data));\r\n } else {\r\n System.out.println(\"invalid data::\" + data);\r\n }\r\n index++;\r\n }\r\n \r\n TroubleMarker_HASH.put(troubleMarker.getId(), troubleMarker);\r\n index = 0;\r\n }\r\n \r\n scanner.close();\r\n \r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"Error: FileNotFound - loadTroubleMarker\");\r\n }\r\n \r\n }", "private static BST readDataFile(Scanner in)\n\t{\n\t\tBST tree=new BST();\n\t\t\n\t\t//read the file line by line\n\t\twhile(in.hasNextLine())\n\t\t{\n\t\t\t// Scanner to read 1 line; closed before end of while loop\n\t\t\tString currentLine=in.nextLine();\n\t\t\tScanner line=new Scanner(currentLine);\n\t\t\t\n\t\t\t// makes the scanner separate the information in the line by \",\" and \";\"\n\t\t\tline.useDelimiter(\",|;\");\n\t\t\t\n\t\t\t// create a profile from the line and insert it into the tree\n\t\t\tProfile p=createProfile(line);\n\t\t\ttree.insertProfile(p);\t\n\t\t\t\t\t\n\t\t\tline.close();\n\t\t}\n\t\t\n\t\tin.close();\n\t\treturn tree;\n\t}", "public static void loadFileHash(String path) throws IOException{\n\t\t\n\t\tHashMap<String, List<String>> map = new HashMap<String, List<String>>();\n BufferedReader in = new BufferedReader(new FileReader(path));\n String line = \"\";\n while ((line = in.readLine()) != null) {\n String parts[] = line.split(\":\");\n List<String> docIdLen = new ArrayList<String>();\n docIdLen.add(parts[1]);\n docIdLen.add(parts[2]);\n map.put(parts[0], docIdLen);\n }\n in.close();\n \n printDocHash(map);\n\t}", "public void readFile(String filename) throws IOException {\n BufferedReader buffer = new BufferedReader(new FileReader(filename));\n\n String line;\n int row = 0;\n isFirstLine = true;\n\n while ((line = buffer.readLine()) != null) {\n String[] vals = line.trim().split(\"\\\\s+\");\n int length = vals.length;\n \n if(isFirstLine) {\n \tfor(int col = 0; col < 2; col++) {\n \t\tif(col == 0)\n \t\t\trowSize = Integer.parseInt(vals[col]);\n \t\telse\n \t\t\tcolSize = Integer.parseInt(vals[col]);\n \t}\n \tskiMap = new int[rowSize][colSize];\n \tisFirstLine = false;\n }\n else {\n \tfor (int col = 0; col < length; col++) {\n \tskiMap[row][col] = Integer.parseInt(vals[col]);\n }\n \t row++;\n }\n }\n \n if(buffer != null)\n \tbuffer.close();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void readMapFromFile() {\r\n\t\ttry {\r\n\t\t\tType type = new TypeToken<HashMap<String, Country>>() {}.getType();\r\n\t\t\tthis.daoMap = (HashMap<String, Country>) gson.fromJson(new FileReader(path), type);\r\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "static Map<Integer, Map<String, Object>> readCsv(BufferedReader in) throws IOException {\n\n\t\t// reads the key names (column names) and stores them\n\t\tString colString = in.readLine();\n\t\tString[] col = colString.split(\",\");\n\n\t\t//instantiates the object being returned so we can add in objects\n\t\tMap<Integer, Map<String, Object>> dict = new HashMap<Integer, Map<String, Object>>();\n\t\t\n\t\t//loops while there is still more data to read\n\t\twhile (in.ready()) {\n\t\t\t\n\t\t\t//pulls the next line and splits it apart by the delimiter\n\t\t\tString valString = in.readLine();\n\t\t\t\n\t\t\t/*code found for the regex expression found at \n\t\t\t* http://stackoverflow.com/questions/1757065/java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes\n\t\t\t* by user Bart Kiers\n\t\t\t*/\n\t\t\tString[] val = valString.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1);\n\n\t\t\t//instantiates the object to be put in the list\n\t\t\tMap<String, Object> map = new HashMap<String, Object>();\n\n\t\t\t//loops per amount of columns\n\t\t\tfor (int i = 0; i < col.length; i++) {\n\t\t\t\t\n\t\t\t\t//instantiates to be put into the map and checks if it is a numeric data type\n\t\t\t\tObject value = val[i];\n\t\t\t\tif (isDouble((String) value)) {\n\t\t\t\t\tvalue = Double.parseDouble((String) value);\n\t\t\t\t}\n\n\t\t\t\t//puts the object into the map\n\t\t\t\tmap.put(col[i], value);\n\t\t\t}\n\n\t\t\t//since map.get(\"StudentID\") is a double, we cast it to an int so we can have a Integer Key for the outside map\n\t\t\tint i = ((Double) map.get(\"StudentID\")).intValue();\n\t\t\t\n\t\t\t//puts the map into the list\n\t\t\tdict.put(i, map);\n\t\t\t\n\t\t}\n\n\t\t//closes the BufferedReader\n\t\tin.close();\n\n\t\t//returns our data structure\n\t\treturn dict;\n\t}", "public void initialilzeMapEntry(String file){\n\t\tmap.put(file, new LinkedList<HashMap<Integer, Integer>>());\n\t}", "private void readDataFromUserLog(HashMap<String,TransactionData> hmap , String filename){\n\t\t\n\t\tBufferedReader reader = null;\n\t\t\n\t\ttry{\n\t\t\treader = new BufferedReader(new FileReader(filename));\n\t\t\tString line;\n\t\t\twhile((line = reader.readLine()) != null){\n\t\t\t\tString transaction = line.split(\",\")[1];\n\t\t\t/*\tString transactionKey = (transaction.length() > keyLength ) ?\n\t\t\t\t\t\ttransaction.substring(0,keyLength):\n\t\t\t\t\t\t\ttransaction;*/\n\t\t\t\tString transactionKey = formTransactionKey(transaction);\n\t\t\t\tdouble amount = Double.parseDouble(line.split(\",\")[2]);\n\t\t\t\tif(hmap.containsKey(transactionKey)){\n\t\t\t\t\tTransactionData d = hmap.get(transactionKey);\n\t\t\t\t\td.addAnotherOccurence(amount);\n\t\t\t\t\thmap.put(transactionKey,d );\n\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tchar type = identifyTheTransactions(transaction);\n\t\t\t\t\tTransactionData d =new TransactionData(transaction,amount,type);\n\t\t\t\t\thmap.put(transactionKey,d);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Sorry!! File : \"+ filename +\" required for processing!!!\");\n\t\t\tSystem.out.println(\"\\n\\nPlease try again !!!\");\n\t\t\tSystem.exit(1);\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\tfinally{\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void createHisMap(Customer customer)\n {\n hisMap= new HashMap<>();\n idFile.open(\"history.txt\");\n String line=idFile.getNextLine();\n String name = customer.getUsername();\n specificLine=-1;\n int i=0;\n while (line!=null)\n {\n int j=0;\n String[] fields = line.split(\",\");\n if(fields[0].equals(name))\n {\n specificLine=i;\n }\n\n String[] fields2 = fields[1].split(\"%\");\n\n\n while (j<fields2.length)\n {\n if(hisMap.get(fields[0])==null)\n {\n hisMap.put(fields[0],new ArrayList<>());\n hisMap.get(fields[0]).add(fields2[j]);\n\n }\n else\n {\n hisMap.get(fields[0]).add(fields2[j]);\n }\n j++;\n }\n\n line=idFile.getNextLine();\n i++;\n }\n if(specificLine== -1)\n specificLine=i;\n }", "public void addToDictionary(InputStream f)\r\n throws IOException, FileNotFoundException {\r\n long t = System.currentTimeMillis();\r\n final int bufSize = 1000;\r\n int read;\r\n int numWords = 0;\r\n InputStreamReader fr = null;\r\n try {\r\n fr = new InputStreamReader(f);\r\n char[] buf = new char[bufSize];\r\n while ((read = fr.read(buf)) != -1) {\r\n // TODO modify this split regex to actually be useful\r\n String[] words = new String(buf, 0, read).split(\"\\\\W\");\r\n for (String s : words) {\r\n trie.insert(s);\r\n numWords++;\r\n }\r\n }\r\n } finally {\r\n if (fr != null) {\r\n try {\r\n fr.close();\r\n } catch (IOException e) {\r\n }\r\n }\r\n }\r\n System.out.println(\"Read from file and inserted \" + numWords + \" words into trie in \" +\r\n (System.currentTimeMillis() - t) / 1000.0 + \" seconds.\");\r\n }", "public void processFile(File rootFile) throws IOException {\n\t\tBufferedReader bf=new BufferedReader(new FileReader(rootFile));\r\n\t\tString lineTxt = null;\r\n\t\tint pos=1;\r\n\t\twhile((lineTxt = bf.readLine()) != null){\r\n String[] line=lineTxt.split(\" \");\r\n// System.out.println(line[0]);\r\n String hscode=line[0];\r\n \r\n \r\n TreeMap<String,Integer> word=null;\r\n if(!map.containsKey(hscode)){\r\n word=new TreeMap<String,Integer>();\r\n for(int i=1;i<line.length;i++){\r\n \tString key=line[i];\r\n \tif (word.get(key)!=null){\r\n \t\tint value= ((Integer) word.get(key)).intValue();\r\n \t\tvalue++;\r\n \t\tword.put(key, value);\r\n \t}else{\r\n \t\tword.put(key, new Integer(1));\r\n \t}\r\n }\r\n map.put(hscode, word);\r\n }\r\n else{\r\n //\tSystem.out.println(\"sss\");\r\n \tword = map.get(hscode);\r\n \tfor(int i=1;i<line.length;i++){\r\n \t\tString key=line[i];\r\n \tif (word.get(key)!=null){\r\n \t\tint value= ((Integer) word.get(key)).intValue();\r\n \t\tvalue++;\r\n \t\tword.put(key, value);\r\n \t}else{\r\n \t\tword.put(key, new Integer(1));\r\n \t}\r\n \t}\r\n \t\r\n \tmap.put(hscode, word);\r\n \t\r\n }\r\n\t\t}\r\n\t\tbf.close();\r\n//\t\tfor(Entry<String, TreeMap<String, Integer>> entry:map.entrySet()){\r\n//// \tSystem.out.println(\"hscode:\"+entry.getKey());\r\n// \tTreeMap<String, Integer> value = entry.getValue();\r\n// \tfor(Entry<String,Integer> e:value.entrySet()){\r\n//// \tSystem.out.println(\"单词\"+e.getKey()+\" 词频是\"+e.getValue());\r\n// \t}\r\n// }\r\n\t}", "public static Map<String, Currency> readCurrencyConfigFile(String filename) {\n\t\tlogger.info(\"Entering readCurrencyConfigFIle method -->\");\n\t\tint lineNumber = 1;\n\t\tMap<String, Currency> tempMap = new HashMap<>();\n\t\ttry(BufferedReader br = new BufferedReader(new FileReader(filename))) {\n\t\t\twhile (br.ready()) {\n\n\t\t\t\tString row = br.readLine();\n\t\t\t\tif (lineNumber++ < 2) continue;\n\n\t\t\t\tCurrency currency = parseInput(row);\n\n\t\t\t\ttempMap.putIfAbsent(currency.getCurrencyCode(), currency);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tlogger.log(Level.WARNING, \"Could not read CurrencyConfig file properly! \" + ioe);\n\t\t}\n\t\tlogger.info(\"Exiting readCurrencyConfigFIle method <--\");\n\t\treturn tempMap;\n\t}" ]
[ "0.7440526", "0.6602797", "0.64543086", "0.6453004", "0.63882035", "0.635895", "0.63341343", "0.6130336", "0.60703313", "0.6013837", "0.5998416", "0.59204125", "0.5916377", "0.5881632", "0.586732", "0.5841753", "0.5822183", "0.5783271", "0.57703227", "0.57569295", "0.57550275", "0.5738656", "0.5725012", "0.5699905", "0.569488", "0.5668706", "0.56601155", "0.56593066", "0.5654624", "0.5606572", "0.5598036", "0.559311", "0.5566191", "0.554585", "0.553915", "0.5520609", "0.5520439", "0.55189145", "0.5518333", "0.55139077", "0.5498938", "0.54983425", "0.54757875", "0.5475427", "0.54679406", "0.5457837", "0.54426646", "0.54352725", "0.54096794", "0.5405042", "0.5404389", "0.5391541", "0.5384355", "0.5367883", "0.5366365", "0.53568447", "0.53421706", "0.5331251", "0.5318501", "0.53159416", "0.531137", "0.53000456", "0.52986115", "0.52980196", "0.52978355", "0.5288218", "0.5286688", "0.52745193", "0.52502966", "0.52492946", "0.5231859", "0.52306134", "0.52259135", "0.5224568", "0.5202047", "0.51844424", "0.51781356", "0.5176032", "0.517477", "0.5167406", "0.5162791", "0.51552284", "0.51547", "0.5152222", "0.5150983", "0.51441437", "0.5143432", "0.5138", "0.51340634", "0.51167065", "0.51154464", "0.5115351", "0.51140106", "0.51104504", "0.51001817", "0.50950235", "0.5091142", "0.5089928", "0.50898534", "0.50877243" ]
0.56369746
29
Function to read in data from a file in the following structure: \n and compare it to the inside of a current hash
protected static void compareIn(Path p, HashMap<String, Double> myMap, FileSystem fs, Double tolerance) throws IOException { FSDataInputStream inputStream = fs.open(p); BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); // Read in all the lines and push into hash-map String line; while((line = br.readLine()) != null) { String[] sectors = line.trim().split("\t"); if (sectors.length != 2) throw new Error("Parsing of file does not match specified input -- readIn"); if (myMap.containsKey(sectors[0]) == false) throw new Error("Node doesn't exist that is said ot exist: " + sectors[0]); if (Math.abs(myMap.get(sectors[0]).compareTo(Double.parseDouble(sectors[1]))) < tolerance) { myMap.remove(sectors[0]); } else { throw new Error("One of the keys has two very different values: {" + sectors[0] + "| val1: " + myMap.get(sectors[0]) + ", val2: " + sectors[1]); } } br.close(); fs.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readFile(String fileName)\r\n {\n String key = new String();\r\n String value = new String();\r\n\r\n boolean readInfo = false;\r\n String out =\"\";\r\n String infoTag = \"\";\r\n String infoTagContent = \"\";\r\n\r\n try{\r\n System.out.println(\"Readig file \"+fileName+\" ...\");\r\n BufferedReader filereader = new BufferedReader(new FileReader(fileName));\r\n\r\n String line = new String();\r\n line = filereader.readLine();\r\n\r\n while(line != null){\r\n infoTag = \"\";\r\n infoTagContent = \"\";\r\n\r\n if((line.indexOf(\"=\") != -1) && (line.indexOf(\"#\") == -1))\r\n {\r\n key = line.substring(0, line.indexOf(\"=\"));\r\n value = line.substring(line.indexOf(\"=\")+1);\r\n\r\n key = key.trim();\r\n value = value.trim();\r\n\r\n if(key.equals(\"PREFIX\")){\r\n this.tagPrefix = value;\r\n } else {\r\n value = tagPrefix+\".\"+value;\r\n tagHash.put(key, value);\r\n }\r\n\r\n readInfo = false;\r\n infoHash.put(key, out);\r\n out = \"\";\r\n }\r\n\r\n\r\n if((line.indexOf(\"#\") == 0) && (line.indexOf(\"@\") != -1) && (line.indexOf(\"=\") != -1))\r\n {\r\n readInfo = true;\r\n infoTag = line.substring(line.indexOf(\"@\"), line.indexOf(\"=\"));\r\n infoTag.trim();\r\n infoTagContent = line.substring(line.indexOf(\"=\")+1);\r\n if(infoTagContent.trim().length() > 0) infoTagContent = infoTagContent+NL;\r\n out = out+infoTag+\": \"+NL+infoTagContent;\r\n }else if((line.indexOf(\"#\") == 0) && readInfo){\r\n // alreadey reading a tagInfo, means NL between entries\r\n out = out+line.substring(line.indexOf(\"#\")+1)+NL;\r\n }\r\n\r\n line = filereader.readLine();\r\n }\r\n\r\n filereader.close();\r\n\r\n //System.out.println(tagHash);\r\n\r\n }catch (Exception e){\r\n System.out.println(\"Exception in readFile: \"+e);\r\n }\r\n }", "private static void compareSha(String filename) {\n\n\t\tMessageDigest md = null;\n\n\t\ttry (InputStream is = new BufferedInputStream(new FileInputStream(filename))) {\n\n\t\t\tbyte[] data = new byte[4096];\n\t\t\tint nRead;\n\t\t\tmd = MessageDigest.getInstance(\"SHA-256\");\n\n\t\t\twhile ((nRead = is.read(data)) != -1) {\n\t\t\t\tmd.update(data, 0, nRead);\n\t\t\t}\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.out.println(\"No provider supports a MessageDigestSpi implementation for the specified algorithm.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tString sha256Digest = Util.bytetohex(md.digest());\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Please provide expected sha-256 digest for hw06part2.pdf: \");\n\t\tSystem.out.print(\">\");\n\t\tString expectedDigest = sc.nextLine();\n\t\tsc.close();\n\n\t\tif (sha256Digest.equals(expectedDigest)) {\n\t\t\tSystem.out.printf(\"Digesting completed. Digest of %s matches expected digest.\\n\", filename);\n\n\t\t} else {\n\t\t\tSystem.out.printf(\"Digesting completed. Digest of %s does not match the expected digest. Digest was: %s\\n\",\n\t\t\t\t\tfilename, sha256Digest);\n\t\t}\n\n\t}", "public static void main(String[] args) throws FileNotFoundException\n\t{\n\t\tFile inputfile = new File(\"Test4.java\"); //output for Test2.java: \"Unbalanced! Symbol } is mismatched\"; \n\t\t//File inputfile = new File(args[0]);\n\t\tScanner in = new Scanner(inputfile);\n\t\t//System.out.println(inputfile.exists());\n\t\tString lines = \"\"; \n\t\t\n\t\tint j=0; \n\t\twhile(in.hasNextLine()) //reading in the whole file and put them into the string. \n\t\t{\n\t\t\tString tempString = in.nextLine(); \n\t\t\t\n\t\t\t//HANDLGING COMMENT BLOCKS: \n\t\t\tif(tempString.contains(\"/*\")) //if the line read contains beginning of comment, discard this line. move on. \n\t\t\t{\n\t\t\t\tcontinue; //go to the next iteration of the loop. \n\t\t\t}\n\t\t\telse if (tempString.contains(\"*\\\\\")) //the line is the end of a comment \n\t\t\t{\n\t\t\t\tcontinue; //don't add this line to the \"lines\" string because it is a comment \n\t\t\t}\n\t\t\telse if(tempString.contains(\"//\")) //same reason as above \n\t\t\t{\n\t\t\t\t//splitting string from http://stackoverflow.com/questions/3481828/how-to-split-a-string-in-java\n\t\t\t\tString[] parts = tempString.split(\"//\"); //splits the string to BEFORE // and AFTER // \n\t\t\t\t//only using the BEFORE part because the rest is just comment --> index 0 in parts[] array \n\t\t\t\tlines=lines.concat(parts[0]);\n\t\t\t\tcontinue; \n\t\t\t}\n\t\t\t\n\t\t\t//HANDING QUOTATION MARKS:\n\t\t\telse if(tempString.contains(\"\\\"\")) //beginning of a quotation \n\t\t\t{\n\t\t\t\tint start = tempString.indexOf(\"\\\"\"); //returns the index of the first occurrence of \" \n\t\t\t\t//System.out.println(\"start is \"+start);\n\t\t\t\tint end = tempString.lastIndexOf(\"\\\"\"); //returns the index of the LAST occurrence of the \"\n\t\t\t\t//System.out.println(\"end is \"+end);\n\t\t\t\tif(start == end) //this means there's only 1 \" in the string-->mismatched\n\t\t\t\t{\n\t\t\t\t\t//lastIndexOf counts from the end of the string. if the end index is the same as the begin index of \" occurance\n\t\t\t\t\t//that means that there's only 1 \" in this line, which usually means that it is mismatched.. \n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \\\" is mismatched\");\n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t//By replacing the quotations, we ignore the literal string.\n\t\t\t\t\tSystem.out.println(\"This is before trimming: \" + tempString);\n\t\t\t\t\tString newstring = tempString.substring(start, end+1); //returns a new string that is a substring of tempString\n\t\t\t\t\ttempString = tempString.replace(newstring, \"IGNORE\"); //replaces each substring with a replacement string \n\t\t\t\t\tSystem.out.println(\"This is after trimming: \" + tempString); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//If the line is not a comment line, then concatenate the line to the whole string\n\t\t\tlines = lines.concat(tempString);\n\t\t\t\n\t\t}\n\t\t//System.out.print(lines);\n\t\t//////////////////////////////////////////////////////////////////////////\n\t\tint i=0; //counter as we traverse through the string \n\t\tchar temp = ' '; \n\t\t\n\t\tMyStack<Character> tempstack = new MyStack<Character>(); //NEED TO DECLARE A STACK HERER!!!!!!!! \n\t\t//System.out.println(lines);\n\t\twhile(i!=lines.length())\n\t\t{\n\t\t\t//READING in one character at a time from the string lines -->handle each char one at a time. \n\t\t\ttemp = lines.charAt(i); \n\t\t\t//System.out.print(temp); \n\t\t\tif(temp == '(' || temp=='[' || temp =='{')\n\t\t\t{\n\t\t\t\ttempstack.push(temp); //if the char is an opening symbol, then push onto the stack \n\t\t\t}\n\t\t\telse if ((temp == ')' || temp==']' || temp =='}')&& tempstack.isEmpty()) \n\t\t\t{\n\t\t\t\t//if the character is a closing symbol AND the stack is empty -->ERROR \n\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\tSystem.exit(0); \n\t\t\t}\n\t\t\telse if((temp == ')' || temp==']' || temp =='}')&& !tempstack.isEmpty()) \n\t\t\t{\n\t\t\t\t//if the character is a closing symbol BUT the stack is NOT empty, then pop the top \n\t\t\t\tchar c = tempstack.pop();\n\t\t\t\t\n\t\t\t\t//compare the top (c) to the temp (current character being read from the string) to see if matched. \n\t\t\t\tif(temp==')'&&(c!='('))\n\t\t\t\t{\n\t\t\t\t\t//unexpected pairing --> ERROR is reported \n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t\telse if(temp==']'&&(c!='['))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t\telse if(temp=='}'&&(c!='{'))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ti++; \n\t\t}\n\t\t\n\t\t//End of file (everything in lines string is read) \n\t\t//it needs to ignore the comment!!! System.out.println(\"Hey! --> \" + tempstack.pop()); \n\t\tif(tempstack.isEmpty()) // if the stack is NOT empty\n\t\t{\n\t\t\tSystem.out.println(\"This file is balanced!\"); \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Leftover \" + tempstack.pop() + \" in the stack\");\n\t\t\tSystem.out.println(\"File not balanced!\"); \n\t\t}\n\t\t\n\t\t\n\t}", "public int run() throws IOException {\n\n\t\t// The variable to be returned later as the answer\n\t\tint answer = 0;\n\n\t\t// Reading the file\n\t\twhile (reader.ready()) {\n\t\t\tString line = reader.readLine();\n\n\t\t\t// Calculates a 'hashcode' for the particular line (see the method\n\t\t\t// definition for more info)\n\t\t\tint noobHash = asciiCalc(line);\n\n\t\t\t// Generate an array of integer to represent the string\n\t\t\t// Each ascii character has a slot, thus the size of array 128 (the\n\t\t\t// fact that 10 and 13 being always 0 is ignored for simplicity)\n\t\t\tInteger[] chars = new Integer[128];\n\n\t\t\t// Converts the string into the array of integer\n\t\t\tfor (int i = 0; i < line.length(); i++) {\n\n\t\t\t\t// converts char to int\n\t\t\t\tint k = line.charAt(i);\n\n\t\t\t\t// Because of the usage of wrapper class Integer instead of int,\n\t\t\t\t// the default value is null instead of 0\n\t\t\t\tif (chars[k - 1] == null) {\n\t\t\t\t\t// If char with ascii value k is found the first time,\n\t\t\t\t\t// change the value of the respective slot in the array to 1\n\t\t\t\t\t// k-1 instead of kth slot is used because of the max index\n\t\t\t\t\t// being 127 instead of 128 in an array of size 128\n\t\t\t\t\tchars[k - 1] = 1;\n\t\t\t\t} else {\n\t\t\t\t\t// if a char with ascii value k is found again, just\n\t\t\t\t\t// increment the initial value\n\t\t\t\t\tchars[k - 1]++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Checks if the 'hashcode' is already in the hashmap\n\t\t\twhile (hashMap.get(noobHash) != null) {\n\n\t\t\t\t// if the array of int in the hashmap with noobhash hashcode is\n\t\t\t\t// the same as the array of int being checked, increment the\n\t\t\t\t// count on that element\n\t\t\t\tif (Arrays.deepEquals(hashMap.get(noobHash).getCharList(),\n\t\t\t\t\t\tchars)) {\n\t\t\t\t\tanswer += hashMap.get(noobHash).getTotal();\n\t\t\t\t\thashMap.get(noobHash).incrementTotal();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Linear probing is used\n\t\t\t\tnoobHash++;\n\n\t\t\t}\n\n\t\t\t// this branch is reached if either the hashcode is not in the\n\t\t\t// hashmap yet, or the hashcode is in the hashmap but actually of\n\t\t\t// different value (collision), so a new key is added to the hashmap\n\t\t\t// via linear probing method\n\t\t\tif (hashMap.get(noobHash) == null) {\n\t\t\t\thashMap.put(noobHash, new CustomPair(chars, 1));\n\t\t\t}\n\n\t\t}\n\t\treader.close();\n\n\t\treturn answer;\n\t}", "private static void checksha(String filePath) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.printf(\"Please provide password as hex-encoded text (16 bytes, i.e. 32 hex-digits):%n> \");\n\t\tString expectedDigest = sc.nextLine();\n\n\t\tsc.close();\n\n\t\tMessageDigest sha = null;\n\n\t\t// Get the digest\n\t\ttry {\n\t\t\tsha = MessageDigest.getInstance(\"SHA-256\");\n\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.out.println(\"Exception while obtaining message digest: \" + e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tPath p = Paths.get(filePath);\n\n\t\t// Open the file input stream\n\t\ttry (InputStream is = Files.newInputStream(p)) {\n\t\t\tbyte[] buff = new byte[4096];\n\t\t\twhile (true) {\n\t\t\t\tint r = is.read(buff);\n\t\t\t\tif (r == -1)\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Update digest\n\t\t\t\tsha.update(buff, 0, r);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception while opening the file: \" + e.getMessage());\n\t\t\tsc.close();\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\t// Return the digest and turn to hex string\n\t\tbyte[] hash = sha.digest();\n\t\tString actualDigest = Util.bytetohex(hash);\n\n\t\t// Compare digests\n\t\tif (expectedDigest.equals(actualDigest)) {\n\t\t\tSystem.out.println(\"Digesting completed. Digest of \" + filePath + \" matches expected digest.\");\n\n\t\t} else {\n\t\t\tSystem.out.println(\"Digesting completed. Digest of \" + filePath\n\t\t\t\t\t+ \" does not match the expected digest. Digest was: \" + actualDigest);\n\n\t\t}\n\n\t}", "@Test\n public void test() {\n bridge.chunk(\"file.txt\", new InputStreamReader(new ByteArrayInputStream(new byte[0]), StandardCharsets.UTF_8));\n List<TokensLine> lines = bridge.chunk(\"file.txt\", new InputStreamReader(new ByteArrayInputStream(new byte[0]), StandardCharsets.UTF_8));\n\n assertThat(lines.size(), is(3));\n\n TokensLine line = lines.get(0);\n // 2 tokens on 1 line\n assertThat(line.getStartUnit(), is(1));\n assertThat(line.getEndUnit(), is(2));\n\n assertThat(line.getStartLine(), is(1));\n assertThat(line.getEndLine(), is(1));\n assertThat(line.getHashCode(), is(\"t1t2\".hashCode()));\n\n line = lines.get(1);\n // 1 token on 2 line\n assertThat(line.getStartUnit(), is(3));\n assertThat(line.getEndUnit(), is(3));\n\n assertThat(line.getStartLine(), is(2));\n assertThat(line.getEndLine(), is(2));\n assertThat(line.getHashCode(), is(\"t3\".hashCode()));\n\n line = lines.get(2);\n // 3 tokens on 4 line\n assertThat(line.getStartUnit(), is(4));\n assertThat(line.getEndUnit(), is(6));\n\n assertThat(line.getStartLine(), is(4));\n assertThat(line.getEndLine(), is(4));\n assertThat(line.getHashCode(), is(\"t1t3t3\".hashCode()));\n }", "private String calculateCheckSum(File file2) {\n\t\tStringBuffer sb = new StringBuffer(\"\");\n\t\ttry {\n\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"SHA1\");\n\n\t\t\tFileInputStream finput = new FileInputStream(file2);\n\t\t\tbyte[] dataBytes = new byte[1024];\n\n\t\t\tint bytesRead = 0;\n\n\t\t\twhile ((bytesRead = finput.read(dataBytes)) != -1) {\n\t\t\t\tmessageDigest.update(dataBytes, 0, bytesRead);\n\t\t\t}\n\n\t\t\tbyte[] digestBytes = messageDigest.digest();\n\n\t\t\tfor (int i = 0; i < digestBytes.length; i++) {\n\t\t\t\tsb.append(Integer.toString((digestBytes[i] & 0xff) + 0x100, 16).substring(1));\n\t\t\t}\n\t\t\tSystem.out.println(\"file check sum value is \" + sb.toString());\n\t\t\tfinput.close();\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: handle exception\n\t\t\tLogger.getLogger(FileTransferClient.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\n\t\treturn sb.toString();\n\t}", "private static Hashtable<String, TruthInfo> ReadTruth(String path) {\n Hashtable<String, TruthInfo> oTruth = new Hashtable<String, TruthInfo>();\n \n FileReader fr = null;\n BufferedReader bf = null;\n \n try {\n fr = new FileReader(path);\n bf = new BufferedReader(fr);\n String sCadena = \"\";\n\n while ((sCadena = bf.readLine())!=null)\n {\n String []data = sCadena.split(\":::\");\n if (data.length==3) {\n String sAuthorId = data[0];\n if (!oTruth.containsKey(sAuthorId)) {\n TruthInfo info = new TruthInfo();\n info.country = data[1];\n info.gender = data[2];\n oTruth.put(sAuthorId, info);\n }\n }\n }\n } catch (Exception ex) {\n System.out.println(ex.toString());\n } finally {\n if (bf!=null) { try { bf.close(); } catch (Exception ignored) {} }\n if (fr!=null) { try { fr.close(); } catch (Exception ignored) {} }\n }\n \n return oTruth;\n }", "public abstract boolean read(String line);", "@Override\n public long resultPart2() throws Exception {\n Scanner sc = inputScanner();\n\n int valid = 0;\n\n while(sc.hasNextLine()) {\n StringBuilder line = new StringBuilder(sc.nextLine());\n \n int a = Integer.parseInt(line.substring(0, line.indexOf(\"-\")));\n int b = Integer.parseInt(line.substring(line.indexOf(\"-\") + 1, line.indexOf(\" \")));\n line.delete(0, line.indexOf(\" \") + 1);\n\n char c = line.charAt(0);\n line.delete(0, line.indexOf(\" \")); // No +1 means first character is automatically '1'\n \n if(line.length() <= a) continue;\n if(line.charAt(a) == c) {\n if(line.length() <= b || line.charAt(b) != c) valid++;\n }\n else if(line.length() > b && line.charAt(b) == c) valid++;\n }\n\n return valid;\n }", "private static String getFileChecksum(MessageDigest digest, File file) throws IOException {\n FileInputStream fis = new FileInputStream(file);\n\n //Create byte array to read data in chunks\n byte[] byteArray = new byte[1024];\n int bytesCount = 0;\n\n //Read file data and update in message digest\n while ((bytesCount = fis.read(byteArray)) != -1) {\n digest.update(byteArray, 0, bytesCount);\n }\n\n //close the stream; We don't need it now.\n fis.close();\n\n //Get the hash's bytes\n byte[] bytes = digest.digest();\n\n //This bytes[] has bytes in decimal format;\n //Convert it to hexadecimal format\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n\n //return complete hash\n return sb.toString();\n }", "private String readLine() throws IOException {\n/* 276 */ String line = null;\n/* */ \n/* */ \n/* 279 */ boolean isLastFilePart = (this.no == 1L);\n/* */ \n/* 281 */ int i = this.currentLastBytePos;\n/* 282 */ while (i > -1) {\n/* */ \n/* 284 */ if (!isLastFilePart && i < ReversedLinesFileReader.this.avoidNewlineSplitBufferSize) {\n/* */ \n/* */ \n/* 287 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ int newLineMatchByteCount;\n/* 292 */ if ((newLineMatchByteCount = getNewLineMatchByteCount(this.data, i)) > 0) {\n/* 293 */ int lineStart = i + 1;\n/* 294 */ int lineLengthBytes = this.currentLastBytePos - lineStart + 1;\n/* */ \n/* 296 */ if (lineLengthBytes < 0) {\n/* 297 */ throw new IllegalStateException(\"Unexpected negative line length=\" + lineLengthBytes);\n/* */ }\n/* 299 */ byte[] lineData = new byte[lineLengthBytes];\n/* 300 */ System.arraycopy(this.data, lineStart, lineData, 0, lineLengthBytes);\n/* */ \n/* 302 */ line = new String(lineData, ReversedLinesFileReader.this.encoding);\n/* */ \n/* 304 */ this.currentLastBytePos = i - newLineMatchByteCount;\n/* */ \n/* */ break;\n/* */ } \n/* */ \n/* 309 */ i -= ReversedLinesFileReader.this.byteDecrement;\n/* */ \n/* */ \n/* 312 */ if (i < 0) {\n/* 313 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* */ \n/* 319 */ if (isLastFilePart && this.leftOver != null) {\n/* */ \n/* 321 */ line = new String(this.leftOver, ReversedLinesFileReader.this.encoding);\n/* 322 */ this.leftOver = null;\n/* */ } \n/* */ \n/* 325 */ return line;\n/* */ }", "public static String verifyFile3(String in, InputStream keyIn) throws Exception {\n\t\tkeyIn = PGPUtil.getDecoderStream(keyIn);\n\n\t\tPGPObjectFactory pgpFact = new PGPObjectFactory(keyIn);\n\n\t\tPGPSignatureList p1 = (PGPSignatureList) pgpFact.nextObject();\n\n\t\tPGPSignature ops = p1.get(0);\n\n\t\tint ch;\n\n\t\t// kljuc iz prstena kljuceva sa id istim kao signIn\n\t\tPGPPublicKey key = PrstenKljuceva.getPublicKeyByID(ops.getKeyID()); \n\n\t\tops.init(new JcaPGPContentVerifierBuilderProvider().setProvider(\"BC\"), key);\n\n\t\tfor (int i = 0; in.charAt(i) != '\\r'; i++) {\n\t\t\tops.update((byte) in.charAt(i));\n\t\t}\n\n\t\tif (ops.verify()) {\n\t\t\treturn new PPGPPJavniKljuc(key).toString();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "private static String getFileChecksum(MessageDigest digest, File file) throws IOException\n\t {\n\t FileInputStream fis = new FileInputStream(file);\n\t \n\t //Create byte array to read data in chunks\n\t byte[] byteArray = new byte[1024];\n\t int bytesCount = 0;\n\t \n\t //Read file data and update in message digest\n\t while ((bytesCount = fis.read(byteArray)) != -1) {\n\t digest.update(byteArray, 0, bytesCount);\n\t };\n\t \n\t //close the stream; We don't need it now.\n\t fis.close();\n\t \n\t //Get the hash's bytes\n\t byte[] bytes = digest.digest();\n\t \n\t //This bytes[] has bytes in decimal format;\n\t //Convert it to hexadecimal format\n\t StringBuilder sb = new StringBuilder();\n\t for(int i=0; i< bytes.length ;i++)\n\t {\n\t sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n\t }\n\t \n\t //return complete hash\n\t return sb.toString();\n\t }", "public boolean readFile(){\n\t\tboolean counter=false;\n\t\t\ttry {\n\t FileReader reader = new FileReader(readFile);\n\t BufferedReader bufferedReader = new BufferedReader(reader);\n\t \n\t String line;\n\t \n\t while ((line = bufferedReader.readLine()) != null) {\n\t \tStringTokenizer st = new StringTokenizer(line,SEPARATOR);\n\t\t if (st.nextToken().equals(user) && st.nextToken().equals(password)) {\n\t\t \tcounter=true;\n\t\t \treturn counter;\n\t\t }\n\t\t else break;\n\t }\n\t reader.close();\n\t \n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\t\t return counter;\n\t}", "@Test\n public void whenReadFileThenResultLinesFromFile() {\n Cache cache = new Cache(\"c:/temp\");\n String result = cache.readFile(\"names.txt\");\n assertThat(result, is(String.format(\"Ivan%sVictor%sPetr%s\", sep, sep, sep)));\n }", "private void readKeyDataToIdentifyTransactions(){\n\t\t\n\t\tBufferedReader reader = null;\n\t\t\n\t\ttry{\n\t\t\treader = new BufferedReader(new FileReader(keyFile));\n\t\t\tString line;\n\t\t\twhile((line = reader.readLine()) != null){\n\t\t\t\tif((line.startsWith(\"#\")) || (line.equals(\"\")))\n\t\t\t\t\tcontinue;\n\t\t\t\telse{\n\t\t\t\t\tString transacName = line.split(\";\")[0];\n\t\t\t\t\tchar transacType = line.split(\";\")[1].charAt(0);\n\t\t\t\t\ttypeTransData.put(transacName,transacType);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Sorry!! \"+ keyFile +\" required for processing!!!\");\n\t\t\tSystem.out.println(\"Please try again !!!\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t}", "@Test\n void testRead() throws IOException, URISyntaxException {\n final String[] expectedResult = {\n \"-199\t\\\"hello\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"2017/06/20\\\"\t0.0\t1\t\\\"2\\\"\t\\\"823478788778713\\\"\",\n \"2\t\\\"Sdfwer\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"1100/06/20\\\"\tInf\t2\t\\\"NaN\\\"\t\\\",1,2,3\\\"\",\n \"0\t\\\"cjlajfo.\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"3000/06/20\\\"\t-Inf\t3\t\\\"inf\\\"\t\\\"\\\\casdf\\\"\",\n \"-1\t\\\"Mywer\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"06-20-2011\\\"\t3.141592653\t4\t\\\"4.8\\\"\t\\\"  \\\\\\\" \\\"\",\n \"266128\t\\\"Sf\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"06-20-1917\\\"\t0\t5\t\\\"Inf+11\\\"\t\\\"\\\"\",\n \"0\t\\\"null\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"03/03/1817\\\"\t123\t6.000001\t\\\"11-2\\\"\t\\\"\\\\\\\"adf\\\\0\\\\na\\\\td\\\\nsf\\\\\\\"\\\"\",\n \"-2389\t\\\"\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:72\t2017-06-20\t\\\"2017-03-12\\\"\tNaN\t2\t\\\"nap\\\"\t\\\"💩⌛👩🏻■\\\"\"};\n BufferedReader result;\n File file = getFile(\"csv/ingest/IngestCSV.csv\");\n try (FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream stream = new BufferedInputStream(fileInputStream)) {\n CSVFileReader instance = createInstance();\n File outFile = instance.read(Tuple.of(stream, file), null).getTabDelimitedFile();\n result = new BufferedReader(new FileReader(outFile));\n }\n\n assertThat(result).isNotNull();\n assertThat(result.lines().collect(Collectors.toList())).isEqualTo(Arrays.asList(expectedResult));\n }", "public static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "public static void loadFileHash(String path) throws IOException{\n\t\t\n\t\tHashMap<String, List<String>> map = new HashMap<String, List<String>>();\n BufferedReader in = new BufferedReader(new FileReader(path));\n String line = \"\";\n while ((line = in.readLine()) != null) {\n String parts[] = line.split(\":\");\n List<String> docIdLen = new ArrayList<String>();\n docIdLen.add(parts[1]);\n docIdLen.add(parts[2]);\n map.put(parts[0], docIdLen);\n }\n in.close();\n \n printDocHash(map);\n\t}", "List<String> shouldReadFile(BufferedReader file) throws IOException {\n List<String> payments = new ArrayList<>();\n while (true){\n String paymentLine = file.readLine();\n if(paymentLine == null){\n break;\n }\n payments.add(paymentLine);\n }\n file.close();\n return payments;\n }", "private int getFileContentHashCode(Path filePath) throws IOException {\n return Arrays.hashCode(Files.readAllBytes(filePath));\n }", "private static boolean equalFile(String expectedFileName, String actualFileName)\n\t{\n\t\tboolean equal;\n\t BufferedReader bExpected;\n\t BufferedReader bActual;\n\t String expectedLine ;\n\t String actualLine ;\n\n\t equal = false;\n\t bExpected = null ;\n\t bActual = null ;\n\n\t try {\n\t bExpected = new BufferedReader(new FileReader(expectedFileName));\n\t bActual = new BufferedReader(new FileReader(actualFileName));\n\n\t if ((bExpected != null) && (bActual != null)) {\n\t expectedLine = bExpected.readLine() ;\n\t actualLine = bActual.readLine() ;\n\n\t if(((expectedLine != null) && expectedLine.equals(actualLine)) || ((expectedLine == null) && (actualLine == null)) )\n\t \tequal=true;\n\n\t while(expectedLine != null && equal)\n\t {\n\t expectedLine = bExpected.readLine() ;\n\t actualLine = bActual.readLine() ; \n\t equal = expectedLine.equals(actualLine) ;\n\t }\n\t }\n\t } \n\t catch (Exception e) {} \n\t finally {\n\t try {\n\t if (bExpected != null) {\n\t bExpected.close();\n\t }\n\t if (bActual != null) {\n\t bActual.close();\n\t }\n\t } catch (Exception e) {}\n\t }\n\t return equal; \n\t}", "public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }", "@SuppressWarnings(\"unused\")\n private String readFile(File f) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n StringBuilder builder = new StringBuilder();\n while (line != null) {\n builder.append(line).append('\\n');\n line = reader.readLine();\n }\n reader.close();\n return builder.toString();\n }", "private void compareData(File testDatafileName, String goodResourceName) throws IOException\n {\n Reader testDataReaderRaw = new FileReader(testDatafileName);\n\n ClassLoader classLoader = this.getClass().getClassLoader();\n InputStream goodDataStream = classLoader.getResourceAsStream(goodResourceName);\n assertNotNull(\"good resource file not found: \" + goodResourceName, goodDataStream);\n Reader goodDataReaderRaw = new InputStreamReader(goodDataStream);\n\n BufferedReader testDataReader = new BufferedReader(testDataReaderRaw);\n BufferedReader goodDataReader = new BufferedReader(goodDataReaderRaw);\n\n try\n {\n int line = 0;\n for (;;)\n {\n ++line;\n String testLine = testDataReader.readLine();\n String goodLine = goodDataReader.readLine();\n \n if ((testLine == null) && (goodLine == null))\n {\n // success\n break;\n }\n else if (testLine == null)\n {\n fail(\"Test input \" + testDatafileName + \" has fewer lines than good file \" + goodResourceName);\n }\n else if (goodLine == null)\n {\n fail(\"Test input \" + testDatafileName + \" has more lines than good file \" + goodResourceName);\n }\n \n assertEquals(\n \"Test input \" + testDatafileName + \" and good file \" + goodResourceName +\n \" differ on line \" + line, \n goodLine, testLine);\n }\n }\n finally\n {\n testDataReaderRaw.close();\n goodDataStream.close();\n }\n }", "private static String getFileChecksum(File file) throws IOException, NoSuchAlgorithmException {\n FileInputStream fis = new FileInputStream(file);\n\n // Use MD5 algorithm\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n\n // Create byte array to read data in chunks\n byte[] byteArray = new byte[1024];\n int bytesCount = 0;\n\n // Read file data and update in message digest\n while ((bytesCount = fis.read(byteArray)) != -1) {\n digest.update(byteArray, 0, bytesCount);\n }\n ;\n\n // close the stream; We don't need it now.\n fis.close();\n\n // Get the hash's bytes\n byte[] bytes = digest.digest();\n\n // This bytes[] has bytes in decimal format;\n // Convert it to hexadecimal format\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n\n // return complete hash\n return sb.toString();\n }", "private void checkFileContents(String name) throws IOException {\n byte[] buff = \"some bytes\".getBytes();\n assertTrue(Arrays.equals(buff, readFile(name, buff.length)));\n }", "public static void main(String[] args) throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"3.in\"));\n\t\tint base = 26;\n\t\tlong subHash = 0;\n\t\tstring = br.readLine();\n\t\tsubstring = br.readLine();\n\t\tSystem.out.println(substring.length());\n\t\tfor (int i = 0; i < substring.length(); i++)\n\t\t{\n\t\t\tstring = \"`\" + string;\n\t\t\tsubHash += Math.pow(base, substring.length()-1-i)*(substring.charAt(i)-96);\n\t\t}\n\t\thashes = new long[string.length()];\n\t\t//rolling hash\n\t\tlong prevHash = 0;\n\t\tlong hash;\n\t\tlong subtract;\n\t\tfor (int i = 0; i < string.length()-substring.length(); i++)\n\t\t{\n\t\t\tsubtract = (long) ((string.charAt(i)-96)*Math.pow(base, substring.length()-1));\n\t\t\thash = (long) (26*(prevHash - subtract) + (string.charAt(i + substring.length())-96));\n\t\t\thashes[i+1] = hash;\n\t\t\tif (hash == subHash)\n\t\t\t{\n\t\t\t\tstring = string.substring(0, i+1) + string.substring(i+1+substring.length());\n\t\t\t\ti -= substring.length();\n\t\t\t\tif (i < 0) i = -1;\n\t\t\t}\n\t\t\tprevHash = hashes[i+1];\n\t\t\tSystem.out.println(hash);\n\t\t}\n\t\t\n\t\t/*for (long el: hashes)\n\t\t\tSystem.out.println(el);\n\t\tSystem.out.println(subHash);*/\n\t\tSystem.out.println(string.substring(substring.length()));\n\t\t\n\t\t\n\t\t//PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"censor.out\")));\n\t\t//pw.println(string.substring(substring.length()));\n\t\t//pw.close();\n\t}", "private boolean parseLine()\r\n\t{\r\n\t\tString delim = \"\\t\";\r\n\t\tm_tokenizer = new StringTokenizer(m_line, delim, true);\r\n\t\tString token;\r\n\t\t\r\n\t\tint tokCount = m_tokenizer.countTokens();\r\n\t\tif ((fieldIndexArray.length <= tokCount) &&\t(tokCount <= fieldIndexArray.length*2))\r\n\t\t{\r\n\t\t\tint lastDelim = -2; /** case when line has consecutive (>=2) tabs!*/\r\n\t\t\tint columnIndex = 0;\r\n\t\t\t/** Tokenise the chip data file's line to separate the data to be put in various columns*/\r\n\t\t\tfor (int i=0; i< tokCount; i++) \r\n\t\t\t{\r\n\t\t\t\ttoken = m_tokenizer.nextToken();\r\n\t\t\t\tif (token.equalsIgnoreCase(delim)) \r\n\t\t\t\t{\r\n\t\t\t\t\tif (lastDelim + 1 == i) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/** 2 consecutive tags - empty string value*/\r\n\t\t\t\t\t\tif(columnIndex<fieldIndexArray.length)\r\n\t\t\t\t\t\t\tbaseRecord.fields[fieldIndexArray[columnIndex++]].append(\"\");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastDelim = i;\r\n\t\t\t\t} \r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\t/** Each time when new token rrpresenting column data is encountered then columnIndex is \r\n\t\t\t\t\t * incremented and tokens are stored till the token number is less than total number\r\n\t\t\t\t\t * of tokens on one line according to fieldIndexArray */\r\n\t\t\t\t\tif(columnIndex < fieldIndexArray.length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/** If total description length exceeds the precision of that field in the table then \r\n\t\t\t\t\t\t * it will be truncated to load it in the description field*/\r\n\t\t\t\t\t\tif(columnIndex == (fieldIndexArray.length-1))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (token.length() > max)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tStringBuffer tokenbuffer = new StringBuffer(token);\r\n\t\t\t\t\t\t\t\ttokenbuffer.setLength(max);\r\n\t\t\t\t\t\t\t\tif(tokenbuffer.charAt(max-1) != '\"')\r\n\t\t\t\t\t\t\t\t\ttokenbuffer.append('\"');\r\n\t\t\t\t\t\t\t\ttoken=tokenbuffer.toString();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/** Here fieldIndexArray will give the actual location of particular token\r\n\t\t\t\t\t\t * in the chipinformation table. This mapping is already done in fieldIndexArray */\r\n\t\t\t\t\t\tbaseRecord.fields[fieldIndexArray[columnIndex++]].append(token);\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\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\tLogger.log(\"Invalid record: \"+ tokCount + \" fields. \",\r\n\t\t\t\t\tLogger.WARNING);\r\n\t\t\tLogger.log(\"Expected tokens = \"+ fieldIndexArray.length,\r\n\t\t\t\t\tLogger.WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private static String[] readFile(String file){\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(file));\n\t\t\tString line;\n\t\t\tString data = \"\";\n\t\t\twhile((line = in.readLine()) != null){\n\t\t\t\tdata = data + '\\n' + line;\t\t\t}\n\t\t\tin.close();\n\t\t\tString[] data_array = data.split(\"\\\\n\");\n\t\t\treturn data_array;\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tString[] shouldNeverReturn = new String[1];\n\t\treturn shouldNeverReturn;\n\t}", "private boolean parse(String name) {\r\n BufferedReader in;\r\n\r\n try {\r\n in = new BufferedReader(new InputStreamReader(new FileInputStream(name)));\r\n\r\n }\r\n catch (IOException e) {\r\n return false;\r\n }\r\n\r\n try {\r\n while (true) {\r\n String line = in.readLine();\r\n if (line != null) {\r\n\r\n // skip the commented lines\r\n if (!line.startsWith(\"//\") && !line.startsWith(\";\") &&\r\n !line.startsWith(\"#\")) {\r\n int i = line.indexOf('=');\r\n\r\n // we also skip lines without an equal sign\r\n if (i != -1)\r\n keyvaluepairs.put(line.substring(0, i).trim().toLowerCase(),\r\n line.substring(i + 1).trim());\r\n }\r\n\r\n }\r\n else\r\n break;\r\n }\r\n }\r\n catch (IOException e) {\r\n }\r\n\r\n return true;\r\n }", "public void readInPasswords(){\n String fileName = \"all_passwords.txt\";\n String nextLine = null;\n String [] temp;\n\n try{\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n \n while((nextLine = bufferedReader.readLine()) != null){\n temp = nextLine.split(\",\");\n if(temp[0].length() == 5)\n passwords.insertKey(temp[0], Double.parseDouble(temp[1]));\n }\n }catch(FileNotFoundException e){\n System.out.println(\"Unable to open file \" + fileName);\n }catch(IOException ex){\n System.out.println(\"Error reading file: \" + fileName);\n }\n \n }", "public static void main(String[] args) throws IOException {\n Path path = Paths.get(\"C:\\\\Users\\\\Pixie Waffle\\\\Desktop\\\\adventofcode2020\\\\adventofcode2020\\\\textfiles\\\\day6.txt\");\n String file = Files.readString(path);\n\n //The sum of the counts\n int yesPerGroup = 0;\n\n //Split the paragraphs into groups\n List<String> groups = Arrays.asList(file.split(\"\\n\\n\"));\n\n //The Hashset does not accept duplicates so we can check each group\n //by adding it to the hashset and clearing after we have counted the\n //unique characters\n Set set = new HashSet<>();\n for (int i = 0; i < groups.size(); i++){\n char[] group = groups.get(i).replace(\"\\n\", \"\").toCharArray();\n for (int j = 0; j < group.length; j++){\n if(set.add(group[j])){\n yesPerGroup++;\n }\n }\n set.clear();\n }\n System.out.println(yesPerGroup);\n }", "public void input(File inputFile){\n instantiateTable();\n try{\n String line = \"\";\n //method to scan certain words between 2 delimiting characters, usually blank lines or white spaces or tabs.\n Scanner read = new Scanner(inputFile).useDelimiter(\"\\\\W+|\\\\n|\\\\r|\\\\t|, \");\n //while there is a next word, keeps reading the file \n while (read.hasNext()){\n line = read.next().toLowerCase();\n LLNodeHash words = new LLNodeHash(line, 1, null);\n add(words);\n }\n read.close();\n }\n catch (FileNotFoundException e){\n System.out.print(\"Not found\");\n e.printStackTrace();\n }\n System.out.println(hashTable.length);\n System.out.println(space());\n System.out.println(loadFactor);\n System.out.println(collisionLength());\n print();\n }", "public String readLines() {\n\n String fileAsString;\n fileAsString = read();\n StringBuilder newString = new StringBuilder();\n if (fileAsString != null) {\n if (fromLine == toLine) {\n\n newString = new StringBuilder(fileAsString.split(\"\\n\")[fromLine - 1]);\n return newString.toString();\n } else {\n if (toLine > fileAsString.split(\"\\n\").length) {\n toLine = fileAsString.split(\"\\n\").length;\n }\n ;\n for (int i = fromLine - 1; i < toLine; i++) {\n\n newString.append(fileAsString.split(\"\\n\")[i]).append(\"\\n\");\n\n\n }\n }\n\n }\n\n\n return newString.toString();\n }", "@Test\n\tpublic void test7() throws IOException {\n\t\tboolean switch1 = false;\n\t\tHistoryStorage store = HistoryStorage.getInstance();\n\t\tstore.writeToHistory(HISTORY_TXT, LINE_1);\n\t\tstore.writeToHistory(HISTORY_TXT, LINE_2);\n\n\t\tString result = store.readFromHistory(HISTORY_TXT);\n\t\tif (result.split(\"\\n\")[1].equals(LINE_1)\n\t\t\t\t&& result.split(\"\\n\")[0].equals(LINE_2)) {\n\t\t\tswitch1 = true;\n\t\t}\n\t\tassertTrue(switch1);\n\t}", "@Test\n public void whenReadFileAndAddNewLineToFileThenSecondReadFromHashWithoutLine() {\n Cache cache = new Cache(\"c:/temp\");\n String before = cache.readFile(\"names2.txt\");\n String result = cache.select(\"names2.txt\");\n String path = \"c:/temp/names2.txt\";\n try (FileWriter writer = new FileWriter(path, true);\n BufferedWriter bufferWriter = new BufferedWriter(writer)) {\n bufferWriter.write(\"test\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n result = cache.select(\"names2.txt\");\n assertThat(result, is(before));\n }", "@Override\n public String readLine() throws IOException {\n\n String line = null;\n\n while (true) {\n\n line = super.readLine();\n\n if (line == null) {\n\n return null;\n }\n\n // Get rid of comments\n\n // VT: FIXME: not handling the escaped comments\n\n int hash = line.indexOf(\"#\");\n\n if (hash != -1) {\n\n // Check if the '#' is escaped\n\n if (hash > 0 && line.indexOf(\"\\\\#\") == hash - 1) {\n\n // Yes, it is\n\n // System.err.println( \"Raw: '\"+line+\"'\" );\n line = line.substring(0, hash - 1) + line.substring(hash, line.length());\n // System.err.println( \"Unescaped: '\"+line+\"'\" );\n\n } else {\n\n line = line.substring(0, hash);\n }\n }\n\n // Trim it\n\n line = line.trim();\n\n if (line.length() != 0) {\n\n return line;\n }\n }\n }", "private static int textCompare(final Resource r1, final Resource r2) throws IOException {\n try (BufferedReader in1 =\n new BufferedReader(new InputStreamReader(r1.getInputStream()));\n BufferedReader in2 = new BufferedReader(\n new InputStreamReader(r2.getInputStream()))) {\n\n String expected = in1.readLine();\n while (expected != null) {\n final String actual = in2.readLine();\n if (!expected.equals(actual)) {\n if (actual == null) {\n return 1;\n }\n return expected.compareTo(actual);\n }\n expected = in1.readLine();\n }\n return in2.readLine() == null ? 0 : -1; //NOSONAR\n }\n }", "public static void verifyFileContentsSame(String stream, @Nullable File actual, @Nullable File expected)\n throws IOException {\n LinkedList<String> actualLines =\n actual == null ? new LinkedList<String>() : readFileIntoLines(actual);\n LinkedList<String> expectedLines =\n expected == null ? new LinkedList<String>() : readFileIntoLines(expected);\n for (int lineNum = 1;; lineNum++) {\n String actualLine = actualLines.poll();\n String expectedLine = expectedLines.poll();\n if ((actualLine == null) && (expectedLine == null)) {\n break;\n }\n assertEquals(stream + \" line \" + lineNum + \" differs\", actualLine, expectedLine);\n }\n }", "private static String readFile(String file) throws IOException { //Doesn't work - possible error with FileReader\n //BufferedReader reader = new BufferedReader(new FileReader(file));\n //FileReader reader=new FileReader(file);\n\n\n FileReader file2 = new FileReader(file);\n System.out.println(\"Inside readFile\");\n BufferedReader buffer = new BufferedReader(file2);\n\n\n\n //String line = null;\n String line=\"\";\n\n StringBuilder stringBuilder = new StringBuilder();\n String ls = System.getProperty(\"line.separator\");\n try {\n while ((line = buffer.readLine()) != null) {\n System.out.println(line);\n stringBuilder.append(line);\n stringBuilder.append(ls);\n }\n return stringBuilder.toString();\n\n }finally{\n buffer.close();//https://stackoverflow.com/questions/326390/how-do-i-create-a-java-string-from-the-contents-of-a-file\n }\n /*Scanner scanner = null;\n scanner = new Scanner(file);\n StringBuilder stringBuilder = new StringBuilder();\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n stringBuilder.append(line);\n\n System.out.println(\"line: \"+line);\n }\n return stringBuilder.toString();*/\n\n }", "public HashMap<String, String> convertToString() throws IOException\n\t{\n\t HashMap<String, String> map = new HashMap<String, String>();\n\n\t String line;\n\t BufferedReader reader;\n\t String multiple_line=null;\n\t\ttry {\n\t\t\treader = new BufferedReader(new FileReader(filePath));\n\t\t\t\n\t\t\twhile ((line = reader.readLine()) != null)\n\t\t {\n\t\t String[] parts = (line.replaceAll(\"\\\"\", \"\").split(\"=\", 2)); //tolto replaceAll\n\t\t if (parts.length >= 2)\n\t\t {\n\t\t String key = parts[0];\n\t\t multiple_line=key;\n\t\t String value = parts[1];\n\t\t map.put(key, value);\n\t\t } else {\n\t\t \n\t\t String line2=map.get(multiple_line);\n\t\t map.put(multiple_line, line2+\"\\n\"+line);\n\t\t }\n\t\t }\n\t\t\t\n\t\t\t//for (String key : map.keySet())\n\t\t //{\n\t\t // System.out.println(key + \":\" + map.get(key));\n\t\t // }\n\t\t reader.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 \n\t \n\t return map;\n\t}", "private boolean readCompareResult()\t{\n\t\tFile resultFile = new File(this.dbDirectory + \"\\\\\"+ this.fileName.split(\".txt\")[0] + \"resultFile.txt\");\n\t\t\tif (resultFile.exists())\t{\n\t\t\t\tFileReader resultReader;\n\t\t\t\ttry {\n\t\t\t\t\tresultReader = new FileReader(this.dbDirectory + \"\\\\\"+ this.fileName.split(\".txt\")[0] + \"resultFile.txt\");\n\t\t\t\t\t// Save it to compareResult.\n\t\t\t\t\tthis.compareResult = resultReader.read();\n\t\t\t\t\tresultReader.close();\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t// Do nothing but get error code.\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t// Do nothing but get error code.\n\t\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "static Map<String, String> readPasswdFile (File pwdFile) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new FileReader(pwdFile));\n\t\tHashtable users = new Hashtable();\n\t\tString l = r.readLine();\n\t\twhile (l != null) {\n\t\t\tint hash = l.indexOf('#');\n\t\t\tif (hash != -1)\n\t\t\t\tl = l.substring(0, hash);\n\t\t\tl = l.trim();\n\t\t\tif (l.length() != 0) {\n\t\t\t\tStringTokenizer t = new StringTokenizer(l, \":\");\n\t\t\t\tString user = t.nextToken();\n\t\t\t\tString password = t.nextToken();\n\t\t\t\tusers.put(user, password);\n\t\t\t}\n\t\t\tl = r.readLine();\n\t\t}\n\t\tr.close();\n\t\treturn users;\n\t}", "private void processInput()\n{\n File f1 = input_file;\n\n try (BufferedReader br = new BufferedReader(new FileReader(f1))) {\n List<DylockLockEntry> ents = new ArrayList<DylockLockEntry>();\n List<DylockLockEntry> lents = new ArrayList<DylockLockEntry>();\n double ltime = 0;\n double ntime = 0;\n for ( ; ; ) {\n\t String ln = br.readLine(); \n\t if (ln == null) break;\n\t if (ln.startsWith(\"ENDBLOCK\")) {\n\t processBlock(lents);\n\t List<DylockLockEntry> xents = lents;\n\t lents = ents;\n\t ents = xents;\n\t ltime = ntime;\n\t ntime = 0;\n\t }\n\t else {\n\t DylockLockEntry ent = new DylockLockEntry(this,ln);\n\t double t0 = ent.getTime();\n\t if (t0 <= ltime) lents.add(ent);\n\t else {\n\t if (t0 > ntime) ntime = t0;\n\t ents.add(ent);\n\t }\n\t }\n }\n processBlock(ents);\n }\n catch (IOException e) {\n System.err.println(\"DYLOCK: Problem reading input file: \" + e);\n }\n}", "public static Sha256Hash hashFileContents(File f) throws IOException {\n FileInputStream in = new FileInputStream(f);\n try {\n return create(ByteStreams.toByteArray(in));\n } finally {\n in.close();\n }\n }", "protected String readFile(InputStream inStream) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(inStream));\r\n\t\tString text = \"\";\r\n\t\tString line = \"\";\r\n\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\tif (line.matches(\"\\\\s\")) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttext = text + \" \" + line;\r\n\t\t}\r\n\t\treader.close();\r\n\t\treturn text;\r\n\t}", "public String read() {\n\t\tString Line = \"\";\n\t\tInteger[] byteCodes = compressFileReader();\n\t\tif (byteCodes == null)\n\t\t\treturn null;\n\t\tint index = 0;\n\t\tint nextCode = byteCodes[index++];\n\t\tString val = readingMap[nextCode];\n\n\t\twhile (index < byteCodes.length - 1) {\n\t\t\tLine += val;\n\t\t\tnextCode = byteCodes[index++];\n\t\t\tString s = readingMap[nextCode];\n\t\t\tif (s == null) {\n\t\t\t\t@SuppressWarnings(\"unused\")\n\t\t\t\tint i = 0;\n\t\t\t}\n\t\t\tif (readingkeysCount == nextCode)\n\t\t\t\ts = val + val.charAt(0);\n\t\t\tif (readingkeysCount < 256 + keysPossible)\n\t\t\t\treadingMap[readingkeysCount++] = val + s.charAt(0);\n\t\t\tval = s;\n\t\t}\n\t\tLine += val;\n\t\treturn Line + '\\n';\n\t}", "public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void process(String file, LinkedList<String> ll) {\r\n \ttry {\r\n \t\tFile currFile = openFile(file);\r\n \t\tStringBuilder sb;\r\n\r\n \t\tif (currFile == null) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tBufferedReader br = new BufferedReader(new FileReader(currFile));\r\n \t\tString line = null;\r\n \t\twhile ((line = br.readLine()) != null) {\r\n \t\t\tint length = line.length();\r\n \t\t\tif (length == 0) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tint index = 0;\r\n \t\t\tLinkedList<String> newLL;\r\n \t\t\twhile (index < length && line.charAt(index) == ' ') {\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tif (index > length-8 || line.substring(index, index+8).compareTo(\"#include\") != 0) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tindex += 8;\r\n \t\t\twhile (line.charAt(index) == ' ') {\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tif (line.charAt(index) != '\"') {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tindex++;\r\n \t\t\tint len = line.length();\r\n \t\t\tsb = new StringBuilder();\r\n \t\t\twhile (index < len) {\r\n \t\t\t\tif (line.charAt(index) == '\"') {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\tsb.append(line.charAt(index));\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tString currName = sb.toString();\r\n \t\t\tll.add(currName);\r\n \t\t\tif (hashM.containsKey(currName)) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tnewLL = new LinkedList<String>();\r\n \t\t\thashM.put(currName, newLL);\r\n \t\t\tworkQueue.add(currName);\r\n \t\t}\r\n \t}\r\n \tcatch (Exception x) {\r\n \t\tx.printStackTrace();\r\n \t}\r\n }", "public static void readFromLongFile(){\n String line;\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(new File(\"longFile.txt\")));\n while ((line = readLine(br)) != null) {\n //nothing is done here\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws NoSuchAlgorithmException, FileNotFoundException, IOException {\n \r\n String hash = \"F5D080D4F4E185DECA8A8B24F72408D9\";\r\n String [] keys = {\"9A1BA7F38A3E8D8F9DDD55972868CB3F\",\"17185CEF199E1C89804EDEE9DCDD1B90\",\"F5D080D4F4E185DECA8A8B24F72408D9\"};\r\n String password = \"NoSuchPassword\";\r\n File file = null;\r\n JFileChooser ff = new JFileChooser();\r\n int a = ff.showOpenDialog(null);\r\n if(a == JFileChooser.APPROVE_OPTION){\r\n try {\r\n file = ff.getSelectedFile();\r\n JOptionPane.showMessageDialog(ff, a);\r\n \r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n System.out.println(file.getPath());\r\n }\r\n } \r\n BufferedReader fr = null;\r\n fr = new BufferedReader(new FileReader(file.getPath()));\r\n String line = null;\r\n int i = 0; \r\n //This is the funtion that Java implement in java.security.MessageDigest\r\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\r\n while((line = fr.readLine()) != null){\r\n System.out.println(line);\r\n md5.update(line.getBytes());\r\n byte [] digests = md5.digest();\r\n String hashs = DatatypeConverter.printHexBinary(digests).toUpperCase();\r\n if(keys[i].equals(hashs)){\r\n System.out.println(\"CORRECT!\\nThe hash created is the same as the hash saved \");\r\n }\r\n else{\r\n System.out.println(\"ERROR!\\nThere was a mistake, the hash create doesn't mach the hash saved\");\r\n }\r\n i++;\r\n } \r\n fr.close();\r\n /**In conclusion we can use the MD5 for digest a words and then same them\r\n * is a DataBase, this with the function that if the DB is committed the\r\n * passwords will not be there\r\n */\r\n }", "private int getNewLineMatchByteCount(byte[] data, int i) {\n/* 351 */ for (byte[] newLineSequence : ReversedLinesFileReader.this.newLineSequences) {\n/* 352 */ int k; boolean match = true;\n/* 353 */ for (int j = newLineSequence.length - 1; j >= 0; j--) {\n/* 354 */ int m = i + j - newLineSequence.length - 1;\n/* 355 */ k = match & ((m >= 0 && data[m] == newLineSequence[j]) ? 1 : 0);\n/* */ } \n/* 357 */ if (k != 0) {\n/* 358 */ return newLineSequence.length;\n/* */ }\n/* */ } \n/* 361 */ return 0;\n/* */ }", "private void ReadFile(String filePath) throws IOException{\n File file = new File(filePath);\n BufferedReader b = new BufferedReader(new FileReader(file));\n int lineNumber = 1;\n String line = \"\";\n line = b.readLine();\n while (line != null) {\n // analyze the line only when it is not empty and it is not a comment\n String trimLine = line.toString().trim();\n if(trimLine.length() != 0 && !trimLine.substring(0, 1).equals(\"/\") && !trimLine.substring(0, 1).equals(\"#\")){\n // line.toString().trim(): eliminate heading and tailing whitespaces\n // but add one whitespace to the end of the string to facilitate token manipulation\n // under the circumstances that there is only one token on one line, e.g. main\n AnalyzeByLine(line.toString().trim() + \" \", lineNumber);\n }\n lineNumber++;\n line = b.readLine();\n }\n arrL.add(new Token(\"end of file\", 255, lineNumber));\n// for(int i = 0; i < arrL.size(); i++){\n// System.out.println(arrL.get(i).getCharacters() + \" \" + arrL.get(i).getValue() + \" \" + arrL.get(i).getLineNum());\n// }\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n Path ruta = Paths.get(\"archivoDescargado.csv\");\n String texto_del_archivoCSV = Files.readString(ruta, StandardCharsets.UTF_8);\n \n // Dividir un archivo CSV en líneas\n String[] lineas_del_texto_del_archivoCSV = texto_del_archivoCSV.split(\"\\n\");\n\n // Generar una tabla de hash con el contenido dividido en lineas\n HashMap<String,String> tabla_de_hash = new HashMap<String, String>();\n int i = 0;\n for (String linea : lineas_del_texto_del_archivoCSV ){\n \tif (i != 0){ // Descarta la primera línea, ok? \n String[] columnas = linea.split(\",\");\n String nombre_y_apellido = columnas[1]+\" \"+columnas[0];\n String telefono = columnas[3];\n tabla_de_hash.put(nombre_y_apellido, telefono);\n }\n i++;\n }\n\n // Guardar una tabla de hash en un archivo\n FileOutputStream fos = new FileOutputStream(\"diccionario.txt\");\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(tabla_de_hash);\n oos.close();\n fos.close();\n\n // Cargar una tabla de hash desde un archivo\n FileInputStream fis = new FileInputStream(\"diccionario.txt\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n tabla_de_hash = (HashMap<String,String>) ois.readObject();\n ois.close();\n fis.close();\n\n // Imprimir una tabla de hash\n for ( String nombre_y_apellido : tabla_de_hash.keySet() ) \n System.out.println( nombre_y_apellido + \" \" + tabla_de_hash.get(nombre_y_apellido));\n }", "private void openAndReadFile() throws IOException {\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textreader = new BufferedReader(fr);\n\t\tString line;\n\t\tString[] parsedLine;\n\t\twhile ((line = textreader.readLine()) != null) {\n\t\t\tparsedLine = pattern.split(line);\n\t\t\tif (parsedLine.length == 2) {\n\t\t\t\tfileData.put(parsedLine[0], parsedLine[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Couldn't read line \" + line + \" in \" + path);\n\t\t\t}\n\t\t}\n\t\ttextreader.close();\n\t\tfr.close();\n\t}", "public static void main(String[] args) throws FileNotFoundException{ \n File file = new File(\"/Users/admin/NetBeansProjects/AlgoDataA3/src/algodataa3e3/output_interpret.txt\");\n Scanner input = new Scanner(file); \n \n SeparateChainingHash_A3E3<String, Integer> st = new SeparateChainingHash_A3E3<>(INTERVAL);\n //141491 words\n //9944 uniqe (with toLowerCase)\n \n //read file word by word and store in array\n while (input.hasNext()) {\n String key = input.next().toLowerCase();\n st.put(key, 1);\n }\n \n for(int i = 0; i < INTERVAL; i++){\n \n System.out.println(\"In hash #\" + (i+1) + \" there are \" + st.sizeOfList(i) + \" nodes\");\n }\n }", "public static void main(String[] args) {\n\t\tLinkedList<String> listData1 = new LinkedList<>();\n\t\tLinkedList<String> listData2 = new LinkedList<>();\n\n\t\topenTextFile();\n\n\t\tSystem.out.println(\"Read data from file 1\");\n\t\tlistData1 = readData(in1);\n\t\tSystem.out.println(\"Read data from file 2\");\n\t\tlistData2 = readData(in2);\n\n\t\tcheckDataMatch(listData1, listData2);\n\t\t\n\t}", "public static String getCRC32(File file) throws IOException, NoSuchAlgorithmException {\n FileInputStream input = new FileInputStream(file);\n byte[] buffer = new byte[BUFFER_SIZE];\n CRC32 crc32digest = new CRC32();\n int i = 0;\n while ((i = input.read(buffer, 0, BUFFER_SIZE)) > 0) {\n crc32digest.update(buffer, 0, i);\n }\n input.close();\n String rawtext = \"00000000\" + Long.toHexString(crc32digest.getValue());\n String crc32 = rawtext.substring(rawtext.length() - 8);\n return crc32.toUpperCase();\n }", "public static byte[] createCheckSum(String filename) throws Exception {\n InputStream fis = new FileInputStream(filename);\n\n byte[] buffer = new byte[1024];\n MessageDigest complete = MessageDigest.getInstance(\"MD5\");\n int numRead;\n\n do {\n numRead = fis.read(buffer);\n if (numRead > 0) {\n complete.update(buffer, 0, numRead);\n }\n } while (numRead != -1);\n\n fis.close();\n // Return MD5 Hash\n return complete.digest();\n }", "private static String[] readLines(InputStream f) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(f, \"US-ASCII\"));\n\t\tArrayList<String> lines = new ArrayList<String>();\n\t\tString line;\n\t\twhile ((line = r.readLine()) != null)\n\t\t\tlines.add(line);\n\t\treturn lines.toArray(new String[0]);\n\t}", "private static void readHistoryData()\n throws FileNotFoundException {\n File file = new File(HISTORY_FILE_PATH);\n Scanner scanner = new Scanner(file); // create a Scanner using the File as the source\n StringBuilder message = new StringBuilder();\n int index = 1;\n while (scanner.hasNext()) {\n String line = scanner.nextLine();\n message.append(\"\\n\\t\" + index + \". \" + line);\n index++;\n }\n scanner.close();\n\n history = message.toString();\n }", "private static void read(BufferedReader br, String field, String line, int pos, GameFile gameFile) throws IOException {\r\n\t\t\r\n\t\tGameFile f = gameFile;\r\n\t\t\r\n\t\tif(field.contains(\":\")) {\r\n\t\t\tfield = field.replace(\":\", \"\");\r\n\t\t\tf = new GameFile(field);\r\n\t\t\tgameFile.add(f);\r\n\t\t}\r\n\t\t\r\n\t\t//loops through all line in file\r\n\t\tfor(String l = (line.isEmpty())? br.readLine(): line; l != null; l = br.readLine()) {\r\n\t\t\t\r\n\t\t\tl = l.replaceAll(\"\\\\s+\",\"\"); //get rid of white spaces\r\n\t\t\t\r\n\t\t\tif(l.contains(\"{\") && l.contains(\"}\")) //if both currly brackets exist on the same line, replace end curlly bracket to prevent exiting the function premacherly\r\n\t\t\t\tl = l.replace(\"}\", \"\\\\}\");\r\n\t\t\tif(l.equals(\"}\")) //if the current line contanise only an end currly breaket then exit the function\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\treadLine(br, field, l, pos, f); //interpets the current line\r\n\t\t\t\r\n\t\t\tif(l.contains(\"}\") && !l.contains(\"\\\\}\")) //if the line containes an end currly breaket in it, exit the function\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn;\r\n\t\t\r\n\t}", "public static boolean compareFile(String fileOne, String fileTwo) throws Exception\n {\n File f1 = new File(fileOne);\n File f2 = new File(fileTwo);\n\n FileReader fR1 = new FileReader(f1);\n FileReader fR2 = new FileReader(f2);\n\n BufferedReader reader1 = new BufferedReader(fR1);\n BufferedReader reader2 = new BufferedReader(fR2);\n\n String line1 = null;\n String line2 = null;\n\n boolean flag = true;\n while((flag == true) && ((line1 = reader1.readLine()) != null)&&((line2 = reader2.readLine())!= null))\n {\n if(!line1.equals(line2))\n flag = false;\n else\n flag = true;\n }\n reader1.close();\n reader2.close();\n\n return flag;\n }", "public static void main(String[] args) { //modified from TextScan.Java\r\n\r\n //finds tokens, add h.add/h.display\r\n HashTable newHash1 = new HashTable();\r\n HashTable newHash2 = new HashTable();\r\n HashTable newHash3 = new HashTable();\r\n //^^hash 1-3\r\n args = new String[1];\r\n args[0] = \"keywords.txt\"; //enter file name here\r\n\r\n Scanner readFile = null;\r\n String s;\r\n int count = 0;\r\n\r\n System.out.println();\r\n System.out.println(\"Attempting to read from file: \" + args[0]);\r\n try {\r\n readFile = new Scanner(new File(args[0]));\r\n }\r\n catch (FileNotFoundException e) {\r\n System.out.println(\"File: \" + args[0] + \" not found\");\r\n System.exit(1);\r\n }\r\n\r\n System.out.println(\"Connection to file: \" + args[0] + \" successful\");\r\n System.out.println();\r\n\r\n while (readFile.hasNext()) {\r\n s = readFile.next();\r\n newHash1.add(s, 1);\r\n newHash2.add(s, 2);\r\n newHash3.add(s, 3);\r\n count++;\r\n }\r\n System.out.println(\"HASH FUNCTION 1\");\r\n newHash1.display();\r\n System.out.println();\r\n System.out.println(\"HASH FUNCTION 2\");\r\n newHash2.display();\r\n System.out.println();\r\n System.out.println(\"HASH FUNCTION 3\");\r\n newHash3.display();\r\n\r\n System.out.println();\r\n System.out.println(count + \" Tokens found\");\r\n System.out.println();\r\n//dabble:\r\n// String key = \"+\";\r\n// char newc = key.toString().charAt(0);\r\n// int a = newc;\r\n// System.out.println(\"KEY: \"+(key.toString().charAt(0)+1)+ \"WACK: \"+ a);\r\n\r\n\r\n\r\n }", "public static boolean parse(File fi){\n\t\ttry {\n\t\t\tScanner sc = new Scanner(fi);\n\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tname = sc.next();\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tprepositionLength = sc.nextLong();\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tprepositionDelay = sc.nextLong();\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tsetOfStrings = new MekString[sc.nextInt()];\n\t\t\tfor(int i = 0; i < setOfStrings.length; i++){\n\t\t\t\tsc.next();\n\t\t\t\tsc.next();\n\t\t\t\tint low = sc.nextInt();\n\t\t\t\tsc.next();\n\t\t\t\tsc.next();\n\t\t\t\tint high = sc.nextInt();\n\t\t\t\tlong[] time = new long[(high - low)];\n\t\t\t\tsc.nextLine();\n\t\t\t\tString[] values = sc.nextLine().split(\",\");\n\t\t\t\tfor(int j = 0; j < values.length-1; j++){\n\t\t\t\t\ttime[j] = Long.parseLong(values[j].trim());\n\t\t\t\t}\n\t\t\t\tsetOfStrings[i] = new MekString(low, high, time);\n\t\t\t\tmekStringCursor++;\n\t\t\t}\n\t\t\tsc.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }", "private boolean matchInputs(InputStream stream1, InputStream stream2) throws Exception {\n try (\n BufferedReader reader1 = new BufferedReader(new InputStreamReader(stream1));\n BufferedReader reader2 = new BufferedReader(new InputStreamReader(stream2))\n ) {\n\n String line;\n while ((line = reader1.readLine()) != null) {\n String otherLine = reader2.readLine();\n if (!(line.equals(otherLine))) {\n return false;\n }\n }\n\n //Check if other reader is empty aswell\n return reader2.readLine() == null;\n }\n }", "public byte[] calc_hash(File filename)\r\n {\r\n\tint digest_length = 512;\r\n\tbyte message[] = new byte[digest_length];\r\n\tbyte key[] = new byte[0];\r\n\tMessageDigest sha;\r\n\tint message_size;\r\n\tlong file_size = 0;\r\n\r\n\ttry{\r\n\t sha = MessageDigest.getInstance(algorithm, provider);\r\n\r\n\t try{\r\n\t\t/* Read file into byte array, and use array to update hash key */\r\n\t\tFileInputStream fin = new FileInputStream(filename);\r\n\t\twhile((message_size = fin.read(message)) != -1)\r\n\t\t {\r\n\t\t\tif(message_size < digest_length)\r\n\t\t\t sha.update(message, 0, message_size);\r\n\t\t\telse\r\n\t\t\t sha.update(message);\r\n\t\t }\r\n\t\tfin.close();\r\n\r\n\t\tkey = sha.digest();\r\n\t }\r\n\t catch(IOException ioe){\r\n\t\tSystem.out.println(\"Error (calc_hash): Unable to open and read file \" + filename.getName());\r\n\t\tioe.printStackTrace();\r\n\t\treturn null;\r\n\t }\r\n\t}\r\n\tcatch(NoSuchAlgorithmException nae){\r\n\t System.out.println(\"Error (calc_hash): hash algorithm \" + algorithm + \" not found\");\r\n\t nae.printStackTrace();\r\n\t return null;\r\n\t}\r\n\tcatch(NoSuchProviderException npe){\r\n\t System.out.println(\"Error (calc_hash): Security provider \" + provider + \" not found\");\r\n\t npe.printStackTrace();\r\n\t return null;\r\n\t}\r\n\r\n\treturn key;\r\n }", "public static void read8() {\n List<String> list = new ArrayList<>();\n\n try (Stream<String> stream = Files.lines(Paths.get(filePath))) {\n\n //1. filter line 3\n //2. convert all content to upper case\n //3. convert it into a List\n list = stream\n .filter(line -> !line.startsWith(\"line3\"))\n .map(String::toUpperCase)\n .collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }", "@Override\n\tpublic boolean readFile(String filename) {\n\t\ttry {\n\t\t\tScanner input = new Scanner(new File(filename));\n\t\t\tString row = input.nextLine();\n\t\t\tString[] sarr = row.split(\",\");\n\t\t\tString ingredientsWatch = \"\";\n\t\t\t// Gets the String type of ingredients to watch\n\t\t\t// Identify the gender and create the Female or Male object\n\t\t\tif (sarr[0].equals(\"Female\")) {\n\t\t\t\tStringBuilder sBuilder =new StringBuilder();\n\t\t\t\tfor(int j =5;j<sarr.length-1;j++) {\n\t\t\t\t\tsBuilder=sBuilder.append(sarr[j].trim()+\",\");\t\n\t\t\t\t}\n\t\t\t\tsBuilder=sBuilder.append(sarr[sarr.length-1]);\n\t\t\t\tingredientsWatch = sBuilder.toString();\n\t\t\t\tFemale female=new Female(Float.parseFloat(sarr[1]), Float.parseFloat(sarr[2]), \n\t\t\t\t\t\tFloat.parseFloat(sarr[3]), Float.parseFloat(sarr[4]), ingredientsWatch);\n\t\t\t\tNutriByte.person=female;\n\t\t\t}else {\n\t\t\t\tStringBuilder sBuilder =new StringBuilder();\n\t\t\t\tfor(int j =5;j<sarr.length-1;j++) {\t\n\t\t\t\t\tsBuilder=sBuilder.append(sarr[j].trim()+\",\");\n\t\t\t\t}\n\t\t\t\tsBuilder=sBuilder.append(sarr[sarr.length-1]);\n\t\t\t\tingredientsWatch = sBuilder.toString();\n\t\t\t\t// Creates the object using its constructor\n\t\t\t\tMale male=new Male(Float.parseFloat(sarr[1]), Float.parseFloat(sarr[2]), \n\t\t\t\t\t\tFloat.parseFloat(sarr[3]), Float.parseFloat(sarr[4]), ingredientsWatch);\n\t\t\t\tNutriByte.person=male;\n\t\t\t\tinput.close();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\t\n\t\treturn true;\n\t}", "public void traverse(int n) throws IOException {\n\t\tFile file = new File(\"assignment2-data.txt\");\n\t\tString lines = new String();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file),\"UTF-8\"));\n\t\tlines = br.readLine(); //first line ignored\n\t\tint i = 0, j = 0;\n\t\tString transaction;\n\t\tHashTreeNode htn = new HashTreeNode();\n\t\tStringTokenizer st;\n\t\tString s0;\n\t\t\n\t\thtn=((CandidateElement)candi.get(n-1)).hashTreeNode;\n\t\t\n\t\twhile(true) {\n\t\t\ttransaction = new String();\n\t\t\tString line = br.readLine();\n\t\t\tif (line == null)\n\t\t\t\tbreak;\n\t\t\tst = new StringTokenizer(line.trim());\n\t\t\tj = 0;\n\t\t\twhile(st.hasMoreTokens() && j<NUM) {\n\t\t\t\tj++;\n\t\t\t\ts0 = st.nextToken();\n\t\t\t\ti = Integer.valueOf(s0).intValue();\n\t\t\t\tif( i != 0) {\n\t\t\t\t\ttransaction = transaction.concat(\" \");\n\t\t\t\t\ttransaction = transaction.concat(Integer.toString(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\ttransaction = transaction.trim();\n\t\t\ttransactionHash(0, htn, transaction);\n\t\t}\t\t\n\t}", "public void readInput(String fileName){\n\n BufferedReader reader;\n try {\n reader = new BufferedReader(new FileReader(fileName));\n String line = reader.readLine(); //read first line\n int numLine =1; //keep track the number of line\n while (line != null) {\n String[] tokens = line.trim().split(\"\\\\s+\"); //split line into token\n if(numLine==1){ //for the first line\n intersection = Integer.parseInt(tokens[0]); //set the number of intersection\n roadways = Integer.parseInt(tokens[1]); // set the number of roadways\n coor = new Coordinates[intersection];\n g = new Graph(intersection);//create a graph\n line = reader.readLine();\n numLine++;\n }\n else if(numLine>1&&numLine<intersection+2){ //for all intersection\n while(numLine>1&&numLine<intersection+2){\n tokens = line.trim().split(\"\\\\s+\");\n coor[Integer.parseInt(tokens[0])] = new Coordinates(Integer.parseInt(tokens[1]),Integer.parseInt(tokens[2])); //add into coor array to keep track the coor of intersection\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine ==intersection+2){ //skip the space line\n line = reader.readLine();\n numLine++;\n while(numLine<roadways+intersection+3){ // for all the roadways, only include the number of roadways mention in the first line\n tokens = line.trim().split(\"\\\\s+\");\n int fst = Integer.parseInt(tokens[0]);\n int snd = Integer.parseInt(tokens[1]);\n g.addEgde(fst,snd,coor[fst].distTo(coor[snd]));\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine >= roadways+intersection+3)\n break;\n }\n reader.close();\n } catch (FileNotFoundException e){\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public boolean readDataFile();", "public static void Ultimocommit(File flee1, File flee2) throws IOException\n\t{\n\t\ttry\n\t\t{\n\t\t\tBufferedReader qlee1 = new BufferedReader(new FileReader(flee1));\n\t\t\tBufferedReader qlee2 = new BufferedReader(new FileReader(flee2));\n\t\t\tString l1=\"\";\n\t\t\tString l2=\"\";\n\t\t\tString linedis = \"\";\n\t\t\tint contador1=0;\n\t\t\tint contador2=0;\n\t\t\tint contador=0;\n\t\t\twhile((l1!=null) || (l2 != null))\n\t\t\t{\n\t\t\t\tl1=qlee1.readLine();\n\t\t\t\tl2=qlee2.readLine();\n\t\t\t\t// comparar que el contador de lineas no sea igual\n\t\t\t\tif(l1!=null)\n\t\t\t\t{\n\t\t\t\t\tcontador1++;\n\t\t\t\t}\n\t\t\t\tif(l2!=null)\n\t\t\t\t{\n\t\t\t\t\tcontador2++;\n\t\t\t\t}\t\t\n\t\t\t\tif((l1!=null)||(l2!=null)) {\n\t\t\t\t if (l1.equals(l2))\n\t\t\t\t {\n\t\t\t\t\t \tlinedis=l1;\n\t\t\t\t \t\tcontador++;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(contador1==contador2){\n\t\t\t\tSystem.out.println(\"El numero total de lineas son iguales\");\n\t\t\t}\n\t\t\t\n\t\t\tqlee1.close();\n\t\t\tqlee2.close();\n\t\t}finally{\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "private boolean compareFiles(String file1, String file2)\r\n throws IOException {\r\n \r\n BufferedReader reader1 = new BufferedReader(new FileReader(file1));\r\n BufferedReader reader2 = new BufferedReader(new FileReader(file2));\r\n \r\n\r\n String line1 = reader1.readLine();\r\n String line2 = reader2.readLine();\r\n\r\n boolean areEqual = true;\r\n\r\n int lineNum = 1;\r\n\r\n while (line1 != null || line2 != null) {\r\n if (line1 == null || line2 == null) {\r\n areEqual = false;\r\n break;\r\n }\r\n \r\n else if (!line1.equals(line2)) {\r\n areEqual = false;\r\n break;\r\n }\r\n\r\n line1 = reader1.readLine();\r\n line2 = reader2.readLine();\r\n\r\n lineNum++;\r\n }\r\n reader1.close();\r\n reader2.close();\r\n\r\n if (areEqual) { \r\n return true;\r\n }\r\n else { \r\n System.out.println(\r\n \"Two files have different content. They differ at line \"\r\n + lineNum);\r\n return false;\r\n }\r\n\r\n \r\n }", "@Override\n public long resultPart1() throws Exception {\n Scanner sc = inputScanner();\n \n int valid = 0;\n\n while(sc.hasNextLine()) {\n StringBuilder line = new StringBuilder(sc.nextLine());\n \n int min = Integer.parseInt(line.substring(0, line.indexOf(\"-\")));\n int max = Integer.parseInt(line.substring(line.indexOf(\"-\") + 1, line.indexOf(\" \")));\n line.delete(0, line.indexOf(\" \") + 1);\n\n char c = line.charAt(0);\n line.delete(0, line.indexOf(\" \") + 1);\n \n int count = 0;\n for(int i=0; i<line.length(); i++) {\n if(line.charAt(i) == c) count++;\n }\n\n if(count >= min && count <= max) valid++;\n }\n\n return valid;\n }", "public static String getFileChecksum(MessageDigest digest, String filePath) throws IOException {\n\t\tFileInputStream fis = new FileInputStream(filePath);\n\n\t\t// Create byte array to read data in chunks\n\t\tbyte[] byteArray = new byte[1024];\n\t\tint bytesCount = 0;\n\n\t\t// Read file data and update in message digest\n\t\twhile ((bytesCount = fis.read(byteArray)) != -1) {\n\t\t\tdigest.update(byteArray, 0, bytesCount);\n\t\t}\n\t\t;\n\n\t\t// close the stream; We don't need it now.\n\t\tfis.close();\n\n\t\t// Get the hash's bytes\n\t\tbyte[] bytes = digest.digest();\n\n\t\t// This bytes[] has bytes in decimal format;\n\t\t// Convert it to hexadecimal format\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < bytes.length; i++) {\n\t\t\tsb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n\t\t}\n\n\t\t// return complete hash\n\t\treturn sb.toString();\n\t}", "@Test\n void testShouldCalculateHashOfPresentContent() throws IOException {\n final String longContent = StringUtils.repeat(\"apachenifi \", 8192);\n\n for (final HashAlgorithm algorithm : HashAlgorithm.values()) {\n final String expectedContentHash = HashService.hashValueStreaming(algorithm, new ByteArrayInputStream(longContent.getBytes()));\n\n // Reset the processor\n runner.clearProperties();\n runner.clearProvenanceEvents();\n runner.clearTransferState();\n\n // Set the algorithm\n runner.setProperty(CryptographicHashContent.HASH_ALGORITHM, algorithm.getName());\n\n // Insert the content in the mock flowfile\n runner.enqueue(longContent.getBytes(StandardCharsets.UTF_8),\n Collections.singletonMap(\"size\", String.valueOf(longContent.length())));\n\n runner.run(1);\n\n runner.assertTransferCount(CryptographicHashContent.REL_FAILURE, 0);\n runner.assertTransferCount(CryptographicHashContent.REL_SUCCESS, 1);\n\n final List<MockFlowFile> successfulFlowfiles = runner.getFlowFilesForRelationship(CryptographicHashContent.REL_SUCCESS);\n\n // Extract the generated attributes from the flowfile\n MockFlowFile flowFile = successfulFlowfiles.get(0);\n String hashAttribute = String.format(\"content_%s\", algorithm.getName());\n flowFile.assertAttributeExists(hashAttribute);\n flowFile.assertAttributeEquals(hashAttribute, expectedContentHash);\n }\n }", "public String readFile(String filename) {\n\n String result = \"\";\n FileReader fileReader = null;\n BufferedReader bufferedReader = null;\n try {\n fileReader = new FileReader(filename);\n bufferedReader = new BufferedReader(fileReader);\n\n StringBuilder stringBuilder = new StringBuilder();\n String line = bufferedReader.readLine();\n while (line != null) {\n stringBuilder.append(line);\n line = bufferedReader.readLine();\n }\n result = stringBuilder.toString();\n } catch (Exception e) {\n Log.error(\"Error in reading Locator Repository file \" + e.getMessage());\n } finally {\n try {\n if (bufferedReader != null) {\n bufferedReader.close();\n }\n if (fileReader != null) {\n fileReader.close();\n }\n } catch (IOException e) {\n Log.error(\"Error in closing Locator Repository file \" + e.getMessage());\n } finally {\n CustomAssert\n .assertTrue(StringUtils.isNotEmpty(result), \"Error in reading file \" + filename);\n }\n }\n\n return result;\n }", "public byte[] getData(String h) {\n String[] CATF = {\"git\", \"cat-file\", \"-p\", h};\n return exec(CATF);\n }", "private boolean processGivenFile(HashMap<String, Blob> givenFile,\n Commit splitPt, Commit currCommit,\n Commit givenCommit) throws IOException {\n for (String fileName: givenFile.keySet()) {\n String contentInSp = splitPt.getFileContent(fileName);\n String contentInCur = currCommit.getFileContent(fileName);\n String contentInGiven = givenCommit.getFileContent(fileName);\n if (isInConflict(contentInCur, contentInGiven, contentInSp)) {\n generateConflict(fileName, contentInCur, contentInGiven);\n return true;\n } else if (bothNull(contentInCur, contentInGiven)\n || contentInGiven.equals(contentInCur)) {\n continue;\n }\n if (contentInSp != null && contentInSp.equals(contentInCur)\n && !contentInSp.equals(contentInGiven)) {\n commitIDCheckout(givenCommit.getShaCode(), fileName);\n File theNewFile = new File(Main.CWD, fileName);\n add(theNewFile);\n } else if (contentInCur == null && contentInSp == null) {\n commitIDCheckout(givenCommit.getShaCode(), fileName);\n File theNewFile = new File(Main.CWD, fileName);\n add(theNewFile);\n }\n }\n return false;\n }", "private static String[] readFile(String path) throws FileNotFoundException{\n\t\tjava.io.File file = new java.io.File(path);\n\t\tjava.util.Scanner sc = new java.util.Scanner(file); \n\t\tStringBuilder content = new StringBuilder();\n\t\twhile (sc.hasNextLine()) {\n\t\t String line = sc.nextLine();\n\t\t if (!line.startsWith(\"!--\")){\n\t\t \tline = line.trim();\n\t\t \tString[] lineContent = line.split(\"/\");\n\t\t \tfor (String entry : lineContent){\n\t\t \t\tcontent.append(entry);\n\t\t \t\tcontent.append(\"/\");\n\t\t \t}\n\t\t \tcontent.append(\"!\");\n\t\t }\n\t\t}\n\t\tsc.close();\n\t\treturn content.toString().split(\"!\");\n\t}", "private String getHeadings(File inputFile)\r\n throws Exception\r\n {\r\n String result = null;\r\n\r\n BufferedReader br = null;\r\n FileInputStream fis = null;\r\n try {\r\n fis = new FileInputStream(inputFile);\r\n br = new BufferedReader(new InputStreamReader(fis, \"utf8\"));\r\n result = br.readLine();\r\n } finally {\r\n if (br != null) { br.close(); }\r\n if (fis != null) { fis.close(); }\r\n }\r\n\r\n return result;\r\n }", "private boolean readFromIndex(){\n\t\tString file = \"./reverseIndex.txt\";\r\n\t\tFile reverseIndex = new File(file);\r\n\t\tif (reverseIndex.exists()){\r\n\t\t\ttry(\r\n\t\t\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\r\n\t\t\t){\r\n\t\t\t\tString readSchema = \"(\\\\{[^\\\\}]+)\";\r\n\t\t\t\tPattern readPattern = Pattern.compile(readSchema);\r\n\t\t\t\tString line;\r\n\t\t\t\twhile ((line = reader.readLine()) != null){\r\n\t\t\t\t\tint iden = 0;\r\n\t\t\t\t\tString[] pair = line.split(\" \\\\| \");\r\n\t\t\t\t\tString fileName = pair[0];\r\n\t\t\t\t\tString tokenList;\r\n\t\t\t\t if (pair.length > 1){\r\n\t\t\t\t\t\ttokenList = pair[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\ttokenList = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tHashMap<Term, Integer> tempMap = new HashMap<Term, Integer>();\r\n\t\t\t\t\tMatcher readMatcher = readPattern.matcher(tokenList);\r\n\t\t\t\t\tString[] readResults = readMatcher.results().map(MatchResult::group).toArray(String[]::new);\r\n\t\t\t\t\tfor (int i = 0;i<readResults.length;++i){\r\n\t\t\t\t\t\tString[] valuePair = readResults[i].split(\" : \");\r\n\t\t\t\t\t\tString term = valuePair[0];\r\n\t\t\t\t\t\tTerm temp = new Term(term.substring(1),iden);\r\n\t\t\t\t\t\tiden++;\r\n\t\t\t\t\t\ttempMap.put(temp, Integer.parseInt(valuePair[1]));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex.put(fileName, new IndexedDoc(tempMap));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void parseFileForInput(emailValidator sortingObject){\n File fileObj;\n try {\n fileObj = new File(sortingObject.getPath());\n Scanner scannerObj = new Scanner(fileObj);\n \n while(scannerObj.hasNextLine()){\n String currentEmail = scannerObj.nextLine();\n\n //for each email, call validate method on it\n if(isEmailValid(currentEmail) && !currentEmail.equals(\"end\")){\n String domainEnding = extractEmailEnding(currentEmail);\n sortingObject.allEmails.put(currentEmail, domainEnding);\n\n }\n else if(currentEmail.equals(\"end\")){\n scannerObj.close();\n break;\n }\n }\n scannerObj.close();\n } \n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n}", "com.google.protobuf.ByteString getFileHash();", "com.google.protobuf.ByteString getFileHash();", "public static void read7() {\n //read file into stream, try-with-resources\n try (Stream<String> stream = Files.lines(Paths.get(filePath))) {\n\n stream.forEach(System.out::println);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected abstract Object readFile(BufferedReader buf) throws IOException, FileParseException;", "private boolean readBin(String filePath) throws FileNotFoundException, IOException {\n try {\n BufferedReader dataIn = new BufferedReader(new FileReader(filePath + \".bin\"));\n\n String next = dataIn.readLine();\n int length = Integer.parseInt(next);\n next = dataIn.readLine();\n start = Integer.parseInt(next);\n for (int i = 0; i < memory.length; i++) {\n next = dataIn.readLine();\n if (next == null) {\n break;\n }\n memory[i] = Integer.parseInt(next);\n }\n dataIn.close();\n } catch (IOException ex) {\n print(\"File error: \" + ex.toString());\n return true;\n }\n return false;\n\n }", "private static String readTextFile(File file) throws IOException {\n return Files.lines(file.toPath()).collect(Collectors.joining(\"\\n\"));\n }", "public static void main(String[] args) {\n SecureRandom random = new SecureRandom();\n random.nextBytes(hash);\n data = new byte[hash.length + 1];\n System.arraycopy(hash, 0, data, 0, hash.length);\n long c = 0;\n while (true) {\n recalculateData();\n byte[] dataHash = crc32AsByteArray(data);\n if (c % 10000000 == 0) {\n System.out.println(\"Calculated \" + c + \" hashes\");\n System.out.println(\"Data: \" + byteArrayToHex(data));\n System.out.println(\"Original hash: \" + byteArrayToHex(hash) + \" new hash: \" + byteArrayToHex(dataHash));\n\n }\n if (Arrays.equals(hash, dataHash)) {\n System.out.println(\"Found a match!\");\n System.out.println(\"Data: \" + byteArrayToHex(data));\n System.out.println(\"Original hash: \" + byteArrayToHex(hash) + \" new hash: \" + byteArrayToHex(dataHash));\n break;\n }\n c++;\n }\n }", "private static boolean validateHashTag(String line) {\n\t\tif (\"\".equals(line.trim()))\n\t\t\treturn false;\n\t\treturn Pattern.matches(\"[a-zA-Z0-9]*\", line);\n\t}", "public static long[] calculateCheckSumOfLine(byte[] line, long[] anbn, long numberOfLine) {\r\n\t\tlong an = anbn[0];\r\n\t\tlong bn = anbn[1];\r\n\t\tlong offset = line.length * numberOfLine;\r\n\t\tlong[] results = new long[2];\r\n\t\tint x = 65513;\r\n\t\tfor (int i = 0; i < line.length; i++) {\r\n\t\t\tan = an + (Byte.toUnsignedInt(line[i])+i+1+offset);\r\n\t\t\tbn = (bn + an % x) % x;\r\n\t\t}\r\n\t\t\r\n\t\tresults[0] = an;\r\n\t\tresults[1] = bn;\r\n\t\t\r\n\t\treturn results;\r\n\t}", "@Override\n\tpublic void load(Reader reader)\n\t{\n\t\tString os = System.getProperty(\"os.name\", \"?\").toLowerCase();\n\t\tif (os.startsWith(\"linux\"))\n\t\t\tos = \"linux\";\n\t\telse if (os.startsWith(\"windows\"))\n\t\t\tos = \"windows\";\n\t\telse if (os.startsWith(\"sun\"))\n\t\t\tos = \"sun\";\n\t\telse if (os.startsWith(\"mac\"))\n\t\t\tos = \"mac\";\n\t\t\n\t\t\n\t\tString line, key, value;\n\t\tint i,j;\n\t\tScanner input = new Scanner(reader);\n\t\twhile (input.hasNext())\n\t\t{\n\t\t\tline = getNextLine(input);\n\t\t\tif (line.length() > 0)\n\t\t\t{\n\t\t\t\twhile (line.endsWith(\" \\\\\") || line.endsWith(\"\\t\\\\\"))\n\t\t\t\t\tline = line.substring(0, line.length()-1) + getNextLine(input);\n\t\t\t\t\n\t\t\t\t// find index of the first occurrence of either '=' or ':'\n\t\t\t\ti=line.indexOf('=');\n\t\t\t\tj=line.indexOf(':');\n\t\t\t\tif (j >= 0 && j < i)\n\t\t\t\t\ti = j;\n\t\t\t\t\n\t\t\t\t// split line into key and value substrings.\n\t\t\t\t// Note: key must have at least one character.\n\t\t\t\tif (i > 0)\n\t\t\t\t{\n\t\t\t\t\tkey = line.substring(0, i).trim();\n\t\t\t\t\t\n\t\t\t\t\tboolean skip = false;\n\t\t\t\t\tfor (String op : new String[] {\"linux\", \"windows\", \"sun\", \"mac\"})\n\t\t\t\t\t{\n\t\t\t\t\t\tif (key.startsWith(\"<\"+op+\">\"))\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif (os.equals(op))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = key.substring((\"<\"+op+\">\").length()).trim();\n\t\t\t\t\t\t\t\tskip = 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\telse \n\t\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (skip)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvalue = line.substring(i+1).trim();\n\t\t\t\t\n\t\t\t\t\t// The following two if statements provide backward compatibility for old GMP property files\n\t\t\t\t\t// that added double '\\' characters in file names and directory names. As soon as all of \n\t\t\t\t\t// our property files no longer contain double backslash characters, we should get rid of this.\n\t\t\t\t\t// if value starts with 4 backslash characters, eg., \\\\\\\\fig2\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., \\\\fig2\\GMPSys\\filename\n\t\t\t\t\tif (value.startsWith(\"\\\\\\\\\\\\\\\\\"))\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = \"\\\\\"+value;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if value starts with a character followed by \":\\\\\", eg., c:\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., c:\\GMPSys\\filename\n\t\t\t\t\tif (value.length() >= 4 && value.charAt(1)==':' && value.charAt(2) == '\\\\' && value.charAt(3) == '\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsetProperty(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (getProperty(\"includePropertyFile\") != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile includeFile = getFile(\"includePropertyFile\");\n\t\t\t\tremove(\"includePropertyFile\");\n\t\t\t\tload(new FileReader(includeFile));\n\t\t\t} \n\t\t\tcatch (PropertiesPlusException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} \n\t\t\tcatch (FileNotFoundException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "public HashMap readFile(String filePath, HashMap source){\n\t\tArrayList<String> temp1 = new ArrayList<String>();\n\t\tArrayList<String> temp2 = new ArrayList<String>();\n\t\tBufferedReader br = null;\n\t\t\n\t\ttry {\n\t\t\tString sCurrentLine;\n\t\t\t\n\t\t\t// \"Users/Jasmine/Documents/Eclipse/CacheDictionary/src/english.txt\"\n\t\t\tbr = new BufferedReader(new FileReader(filePath)); \n\t\t\t\n\t\t\t//str.matches(\".*\\\\d+.*\"); ==> string that contains numbers\n\t\t\t//.matches(\"[a-zA-Z]+\"); ==> string that only contains letter\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * if the source file itself is not one word per line, we need to split the string\n\t\t\t\t * only letter(not single) will be stored in the array\n\t\t\t\t */\n\t\t\t\t//\n\t\t\t\tif(sCurrentLine.matches(\".*([ \\t]).*\")){ //check if the current line is a single word or not\n\t\t\t\t\ttemp1.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t\telse if(sCurrentLine.matches(\"[a-zA-Z]+\") && sCurrentLine.length()>1){\n\t\t\t\t\ttemp2.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t}// end of while loop\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)br.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif(!temp1.isEmpty()){\n\t\t\tfor(int i = 0; i< temp1.size(); i++){\n\t\t\t\tString thisLine[] = temp1.get(i).split(\" \");\n\t\t\t\t//for each word in this line\n\t\t\t\tfor(int j = 0; j < thisLine.length; j++){\n\t\t\t\t\t//if it is a valid word\n\t\t\t\t\tif(thisLine[j].matches(\"[a-zA-Z]+\") && thisLine[j].length()>1 ){\n\t\t\t\t\t\tif( source.get(thisLine[j]) == null){\n\t\t\t\t\t\t\tsource.put(thisLine[j].toLowerCase(),thisLine[j].toLowerCase());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t} // end of if current word i valid\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t} // end of temp1\n\t\t\n\t\tif(!temp2.isEmpty()){\n\t\t\tfor(int i = 0; i< temp2.size(); i++){\n\t\t\t\tif(temp2.get(i).matches(\"[a-zA-Z]+\") && temp2.get(i).length()>1){\n\t\t\t\t\tif(source.get(temp2.get(i)) == null){\n\t\t\t\t\t\tsource.put(temp2.get(i).toLowerCase(),temp2.get(i).toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn source;\n\t}", "String[] getCoins(String fileName) throws IOException{\n\t\tString[] coinLines = new String(Files.readAllBytes(Paths.get(Main.fileDir + fileName))).split(\"\\r\\n\");\n\t\tfor(int i = 0; i < coinLines.length; i++){\n\t\t\tString thisLine = coinLines[i];\n\t\t\tcoinLines[i] = thisLine.substring(0, thisLine.indexOf(\":\")).replace(\" \", \"\");\n\t\t}\n\t\treturn coinLines;\n\t}", "private boolean checkingIfTheFileIsCurrent(AmazonS3 s3, String file) {\n String eTag = gettingETagOfTheFile(file);\n if (eTag == null) return true;\n System.out.println(eTag);\n FileReader inputFile = null;\n BufferedReader bufferReader = null;\n String line = null;\n try{\n inputFile = new FileReader(\"/home/ubuntu/\" + file + \".etag\");\n bufferReader = new BufferedReader(inputFile);\n line = bufferReader.readLine();\n bufferReader.close();\n }catch(Exception e){\n System.out.println(\"Error while reading file line by line:\" + e.getMessage());\n }\n if( eTag.equals(line)){\n return true;\n }\n return false;\n }", "public static void read6() {\n List<String> list = new ArrayList<>();\n\n try (BufferedReader br = Files.newBufferedReader(Paths.get(filePath))) {\n\n //br returns as stream and convert it into a List\n list = br.lines().collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }" ]
[ "0.59510434", "0.54468316", "0.5334012", "0.5311211", "0.5249559", "0.52322245", "0.5226519", "0.51859516", "0.5171897", "0.51625586", "0.5152765", "0.5122038", "0.50978106", "0.5096282", "0.5092463", "0.5077361", "0.506709", "0.5054771", "0.5052185", "0.5047832", "0.5040666", "0.50361156", "0.5028142", "0.5005262", "0.49643517", "0.49595648", "0.495186", "0.494452", "0.49333504", "0.4918467", "0.4917156", "0.48934767", "0.48747498", "0.4872827", "0.48706585", "0.4857736", "0.484313", "0.48387134", "0.48297736", "0.48289412", "0.47959706", "0.47859728", "0.4784836", "0.47705147", "0.47677982", "0.47608992", "0.47567627", "0.47467276", "0.47403437", "0.47386813", "0.47075143", "0.4704166", "0.4693235", "0.4689798", "0.46864882", "0.46821436", "0.4680679", "0.46790338", "0.467251", "0.4659834", "0.4654277", "0.46478754", "0.46462426", "0.4642376", "0.464155", "0.46373346", "0.463612", "0.46346843", "0.4630555", "0.46293056", "0.46268132", "0.46127233", "0.46123126", "0.4604421", "0.4602738", "0.46018142", "0.45986795", "0.4597334", "0.45908245", "0.4584689", "0.45824197", "0.45746136", "0.45713776", "0.4570894", "0.4569461", "0.4566737", "0.45621368", "0.45613387", "0.45613387", "0.45586118", "0.45582822", "0.45559806", "0.45550743", "0.45515546", "0.45493844", "0.45480663", "0.4546614", "0.45464367", "0.45432878", "0.45394146", "0.45381817" ]
0.0
-1
Main runner of this comparator
public static void main(String[] args) throws IOException { if (args.length != 2) throw new Error("Not enough arguments: bin 1 and bin 2 will be compared"); Configuration conf = new Configuration(); Path binLoc = new Path(args[0]); FileSystem fs = binLoc.getFileSystem(conf); // First import in bin 1 // Check if it's a folder, file, or nothing Path[] bin = globInternal(binLoc, fs); if (bin == null) throw new Error("Input File Doesn't Exist"); HashMap<String, Double> comparison_bin = new HashMap<String, Double>(); // Now read in all the files in the bucket for (Path p : bin) { readIn(p, comparison_bin, fs); } // Now close the filesystem fs.close(); // Then, import in bin 2, checking if they are indeed what's in the other fs binLoc = new Path(args[1]); fs = binLoc.getFileSystem(conf); bin = globInternal(binLoc, fs); // Now pull in the other and compare them for (Path p : bin) { compareIn(p, comparison_bin, fs, 0.001); } fs.close(); if (!comparison_bin.isEmpty()) throw new Error("Nodes were inadequitely addressed"); System.exit(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n try{\n File fileConfigPath;\n if(args.length==0) {\n fileConfigPath = new File(DEFAULT_CONFIG_FILE_PATH);\n }else{\n fileConfigPath = new File(args[0]);\n }\n FileReader fileReader=new FileReader(fileConfigPath);\n BufferedReader bufferedReader=new BufferedReader(fileReader);\n ArrayList<String> Contents = new ArrayList<>();\n String lineData;\n while((lineData=bufferedReader.readLine())!=null){\n Contents.add(lineData);\n }\n fileReader.close();\n runComparator(Contents.get(0),Contents.get(1),Contents.get(2));\n }catch(IOException e) {\n StatusLogger.addRecordWarningExec(e.getMessage());\n }\n }", "public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }", "@Test\n\tpublic void testComparator() {\n\t\tComparator<Integer> compare = (left, right) -> { return left > right ? 1: (left < right ? -1 : 0); };\n\t\t\n\t\tassertThat(compare.compare(1,1), is(0));\n\t\tassertThat(compare.compare(1,2), is(-1));\n\t\tassertThat(compare.compare(2,1), is(1));\n\t\t\n\t\t//Callable<String> \n\t\t// String call()\n\t\tCallable<String> sayHello = () -> \"Hello World\";\n\t\ttry {\n\t\t\tassertThat(sayHello.call(), is(\"Hello World\"));\n\t\t}catch(Exception e) { }\n\t\t\n\t\t/*\n\t\tRunnable runMe = () -> { System.out.println(\"Hello from run me!\"); };\n\t\trunMe.run();\n\t\t\n\t\tnew Thread(runMe).start();\n\t\t\n\t\tint test = 10;\n\t\tRunnable perhapsRun = () -> {\n\t\t\tif(test < 10) {\n\t\t\t\tSystem.out.println(\"Hello from run\");\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Good-bye from run\");\n\t\t\t}\n\t\t};\n\t\ttest = 6;\n\t\tnew Thread(perhapsRun).start();\n\t\t*/\n\t\t\n\t\tPredicate<Integer> odd = n -> n % 2 != 0;\n\t\tPredicate<Integer> positive = n -> n >= 0;\n\t\t\n\t\tPredicate<Integer> oddAndPositive = Predicates.<Integer>and( n -> n % 2 != 0, n -> n >= 0);\n\t\t\n\t\tassertThat(oddAndPositive.test(3), is(true));\n\t}", "public static void main(String[] args) {\n List<SortBase<Integer>> list = Arrays.asList(new Select<>(), new Insert<>(), new Shell<>(), new MergeImpl2<>(), new Quick<>(),new HeapSort<>());\n for (SortBase<Integer> sort : list) {\n StdOut.print(sort.getClass().getSimpleName()+\"\\n\");\n sort.testCorrectness(new Integer[]{3, 2, 1, 5, 7, 8, 32, 12, 0, -4, -12});\n }\n }", "public static void main(String[] args) {\n\t\tShirt r = new Shirt(\"Red\", 10);\r\n\t\tShirt b = new Shirt(\"Blue\", 465);\r\n\t\tShirt g = new Shirt(\"Green\", 3213456);\r\n\t\t// Creates some custom comparator object.\r\n\t\tSizeComp s = new SizeComp();\r\n\t\tColorComp c = new ColorComp();\r\n\t\t// Creates some tree sets using custom comparator. \r\n\t\tTreeSet<Shirt> mySizeSet = new TreeSet<>(s);\r\n\t\tmySizeSet.add(r);\r\n\t\tmySizeSet.add(g);\r\n\t\tmySizeSet.add(b);\r\n\t\tout.println(\"Sort by Size\");\r\n\t\tout.println(mySizeSet);\r\n\t\t\r\n\t\tTreeSet<Shirt> myCompSet = new TreeSet<>(c);\r\n\t\tmyCompSet.add(r);\r\n\t\tmyCompSet.add(g);\r\n\t\tmyCompSet.add(b);\r\n\t\tout.println(\"Sort by Color\");\r\n\t\tout.println(myCompSet);\r\n\t}", "public static void main(String[] args) {\n ContextSorting contextSorting = new ContextSorting();\r\n //set strategy sorting\r\n ConcreteStrategyBubbleSort b = new ConcreteStrategyBubbleSort();\r\n contextSorting.setStrategy(b);\r\n //perform sorting\r\n contextSorting.performSorting();\r\n }", "protected BaseComparator() {}", "public static void main(String[] args) {\n Supplier<BubbleSort> s = ()->new BubbleSort();\n s.get().sort();\n Sortting.print();\n }", "public static void main(String[] args) {\n Main mainInstance = new Main();\n mainInstance.oldSort();\n mainInstance.lambdaSort();\n mainInstance.oldFilter();\n mainInstance.lambdaFilter();\n }", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "public DoComparator()\n {\n this(true, false, false);\n }", "private void merge(int numRuns, exComparator myComp) throws IOException {\n\t\t// Pass 1 and any following\n\t\t// Read in the partial sorted runs from last pass; Merge; Write out;\n\t\tTupleReader[] mergeReader = new TupleReader[B - 1];\n\t\tint pass = 1;\n\t\tint numRunsToBuild = 0;\n\t\tPriorityQueue<Tuple> tempMerg = new PriorityQueue<Tuple>(myComp);\n\t\tInteger marker = null;\n\t\twhile(true) {\n\t\t\t// last pass: pass-1 , # runs: numRuns;\n\t\t\t// this pass: pass , # runs: numRunsToBuild;\n\t\t\tnumRunsToBuild = numRuns % (B - 1) == 0 ? numRuns / (B - 1) : (numRuns / (B - 1) + 1);\n\t\t\tMap<Tuple, Integer> findReader;\n\t\t\tfor(int i = 0; i < numRunsToBuild; i++) {\n\t\t\t\tfindReader = new HashMap<>();\n\t\t\t\tfor(int j = 0; j < B - 1; j++) {\n\t\t\t\t\tint runIndex = i * (B - 1) + j + 1; // index of the run to be read in last pass, which is (pass - 1)\n\t\t\t\t\tif(runIndex > numRuns) {\n\t\t\t\t\t\tmarker = j;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmergeReader[j] = new TupleReader(tempsubdir + String.valueOf(pass-1) + \"_\" + runIndex);\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.out.println(\"Pass\" + pass + \",\" + i + \"th Run\");\n\t\t\t\tint numReader = marker == null ? B - 1 : marker;\n\t\t\t\tfor(int k = 0; k < numReader; k++) {\n\t\t\t\t\tTuple temp = mergeReader[k].getNextTuple();\n\t\t\t\t\tif(temp == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\ttempMerg.offer(temp);\n\t\t\t\t\tfindReader.put(temp, k);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tTupleWriter TW;\n\t\t\t\tif(numRunsToBuild == 1) {\n\t\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t\t} else {\n\t\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + pass + \"_\" + String.valueOf(i + 1)));\n\t\t\t\t}\n\t\t\t\twhile(!tempMerg.isEmpty()) {\n\t\t\t\t\tTuple temp = tempMerg.poll();\n\t\t\t\t\tTW.setNextTuple(temp);\n\t\t\t\t\tTuple next = mergeReader[findReader.get(temp)].getNextTuple();\n\t\t\t\t\tif(next != null) {\n\t\t\t\t\t\ttempMerg.offer(next);\n\t\t\t\t\t\tfindReader.put(next, findReader.get(temp));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!TW.bufferEmpty()) {\n\t\t\t\t\tTW.fillFlush(); \n\t\t\t\t}\n\t\t\t\tTW.close();\n\t\t\t\tfor(int k = 0; k < numReader; k++) {\n\t\t\t\t\tmergeReader[k].close();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(numRunsToBuild == 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnumRuns = numRunsToBuild;\n\t\t\tpass++;\n\t\t\tmarker = null;\n\t\t}\n\t}", "public static void main(String[] args) {\n SortedSet<CompareObject> objects = new TreeSet<>(new ComparatorTest());\n\n objects.add(new CompareObject(1));\n objects.add(new CompareObject(3));\n objects.add(new CompareObject(5));\n objects.add(new CompareObject(-13));\n objects.add(new CompareObject(12));\n objects.add(new CompareObject(1100));\n objects.add(new CompareObject(1));\n\n for (CompareObject x : objects){\n System.out.println(x);\n }\n\n }", "public static void main(String arg []) {\r\n\t\tint n = 8; //problem size\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Insertion(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Selection(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Bubble(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortFateful(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortCentralElement(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortMedianOfThree(n));\r\n\t}", "public compare(){\r\n }", "@Test\n public void testGroupComparator() throws Exception {\n assertEquals(-1, runGroupComparator(\"LembosGroupComparatorTest-testGroupComparator\", 1, 3));\n }", "public static void main(String[] args) {\n \t\tsortTest(\"\");\n \t\tsortTest(\"A\");\n \t\tsortTest(\"HE\");\n \t\tsortTest(\"HEA\");\n \t\tsortTest(\"HEAPS\");\n \t\tsortTest(\"HEAPSORT\");\n\t\tsortTest(\"HEAPSORTEXAMPLE\");\n\t\tsortTest(\"QUICK\");\n\t\tsortTest(\"QUICKS\");\n\t\tsortTest(\"QUICKSO\");\n\t\tsortTest(\"QUICKSORT\");\n\t\tsortTest(\"QUICKSORTEXAMPLE\");\n\n\t\tsortTest(\"bottomupmergesortconsistsofasequenceofpassesoverthewholearray\");\n\t\tsortTest(\"thefirststepinastudyofcomplexityistoestablishamodelofcomputation.generally,researchersstrivetounderstandthesimplestmodelrelevanttoaproblem.\");\n }", "public static void main(String[] args) throws Exception{\n testSort();\n }", "public static void main(String[] args) {\n\t\t\n\t\tComparator<String> stringCompare = \n\t\t\t\t(String o1, String o2) -> {\n\t\t\t\t\tSystem.out.println(\"Lambda Block\");\n\t\t\t\t\treturn o1.compareTo(o2);\n\t\t\t\t};\n\t\t\t\t\n\t\tint result = stringCompare.compare(\"hello\", \"h2kStudents\");\n\t\tSystem.out.println(\"With Lambda :: \" + result);\n\n\t}", "public static void main(String[] args) {\n AlmostSorted sol1 = new AlmostSorted();\n sol1.process();\n }", "private void runBest() {\n }", "public static void main(String[] args) {\n\t\t\tshellSort(Util.getDummyArr());\n\t}", "public static void main(String[] args) throws IOException {\n\t\t\t\n\t\t\tReader.init(System.in);\n\t\t int x=Reader.nextInt();\n\t\t int y=Reader.nextInt();\n\t\t LabUnion1 obj1=new LabUnion1();\n\t\t LabUnion1 obj2=new LabUnion1();\n\t\t LabUnion1 curr1=obj1.header;\n\t\t LabUnion1 curr2=obj2.header;\n\t\t System.out.println(curr1.getLink());\n\t\t for(int i=0;i<x;i++)\n\t\t {\n\t\t \t int n=Reader.nextInt();\n\t\t \t System.out.println(1);\n\t\t \t LabUnion1 element=new LabUnion1(n);\n\t\t \t curr1.setLink(element);\n\t\t \t curr1=curr1.link; \n\t\t }\n\t\t for(int j=0;j<y;j++)\n\t\t {\n\t\t \t int n=Reader.nextInt();\n\t\t \t LabUnion1 element=new LabUnion1(n);\n\t\t \t curr2.setLink(element);\n\t\t \t curr2=curr2.link; \n\t\t }\n\t\t \n\t\t \n\t\t \n\t\t LabUnion1 z=obj1.MergeSort(obj1,obj2);\n\t\t obj1.display();\n\t\t System.out.println(z.comp);\n\t\t \n\t\t}", "public static void main(String[] args) {\n\n System.out.println(\"In this testrun the squenz has \" + ARRAY_SIZE + \" Elements.\\n\");\n // evaluate Mergesort Vogella\n evaluateMergesortVogella();\n\n // evaluate Mergesort Vogella with Java Threads\n evaluateMergesortVogellaThreaded();\n\n // evaluate Mergesort Vogella with openMP\n// evaluateMergesortVogellaOpenMP();\n\n // evaluate Mergesort University Washington\n evaluateMergesortUniversityWashington();\n\n // evaluate Mergesort University Washington with Java Threads\n evaluateMergesortUniversityWashingtonThreaded();\n\n // evaluate Mergesort University Washington with openMP\n// evaluateMergesortUniversityWashingtonOpenMP();\n }", "private PerfectMergeSort() {}", "public static void main(String[] args) throws Exception{\n\t\tint[] arr = { 3, 1, 7, 4, 9 };\n\t\tdisplay(arr);\n\t\t// bubbleSort(arr);\n\t\t// selectionSort(arr);\n\t\t// insertionSort(arr);\n\t\t// shellSort(arr);\n\t\t// mergeSort(arr, 0, arr.length - 1);\n\t\tquickSort(arr, 0, arr.length - 1);\n\t\tdisplay(arr);\n\t\t\n//\t\tAll_Sorting1 a = new All_Sorting1();\n//\t\ta.clone();\n//\t\ta.equals(a);\n//\t\ta.finalize();\n//\t\ta.hashCode();\n//\t\ta.notify();\n//\t\ta.notifyAll();\n//\t\ta.toString();\n//\t\ta.wait();\n\t\t\n\t}", "public static void main (String[] args)\n {\n Data_Sorter calculator = new Data_Sorter();\n calculator.display();\n }", "public static void main(String[] args) {\n\t\tArrayList al=new ArrayList();\n\t\tal.add(\"Hello\");\n\t\tal.add(\"Hi\");\n\t\tal.add(\"India\");\n\t\tal.add(\"Japan\");\n\t\tal.add(\"Usa\");\n\t\tal.add(\"China\");\n/**************************Insertion order preserved********************************************************************/\n\t\tSystem.out.println(al);\n/*************************default natural sorting order*****************************************************************/\n\t\tCollections.sort(al);\n\t\tSystem.out.println(al);\n/***************************Customized sorting order********************************************************************/\n\t\tCollections.sort(al, new MyComparator1());\n\t\tSystem.out.println(al);\n\n\n\t}", "public abstract void compare();", "public static void main(String[] args) {\n\t\tint cnt;\n\t\t\n\t\tcnt = text_cmp_util.cmp_core_count(text_cmp_util.cmp_core_len(10, 9));\n\t\tSystem.out.println(cnt);\n\n\t\t/*\n\t\tmerge_algo i = new merge_algo();\n\t\t\n\t\ti.add_val(0, 1);\n\t\ti.add_val(10, 11);\n\t\ti.add_val(5, 6);\n\t\ti.debug();\n\t\t//i.add_val(1, 6);\n\t\t\n\t\t\n\t\tSystem.out.println(i.check_out());\n\t\ti.purge();\n\t\ti.debug();*/\n\t}", "private SimplexComparator() {}", "public static void main(String[] args) {\r\n System.out.println(\"Searching and sorting algorithms\");\r\n \r\n \r\n // TO-DO: Add code that tests the searching and sorting\r\n // methods.\r\n System.out.println(\"Selection sort.\");\r\n List<Integer> data = makeList(12);\r\n printList(data);\r\n System.out.println(\" **** \");\r\n selectionSort(data);\r\n printList(data);\r\n\r\n System.out.println(\" **** \");\r\n\r\n System.out.println(\"Insertion sort.\");\r\n data = makeList(12);\r\n printList(data);\r\n System.out.println(\" **** \");\r\n insertionSort(data);\r\n printList(data);\r\n\r\n System.out.println(\" **** \");\r\n\r\n System.out.println(\"Merge sort.\");\r\n data = makeList(12);\r\n printList(data);\r\n System.out.println(\" **** \");\r\n mergeSort(data);\r\n printList(data);\r\n }", "public static void main(String[] args) throws IOException {\n\t\tsetup();\r\n\r\n\t\t// invoke method to sort (external multiway)\r\n\t\tsortInputExternalMerge();\r\n\r\n\t\t// invoke method to sort (external multiway)\r\n\t\t//sortInputBuiltIn();\r\n\r\n\t\t// visualize results\r\n\t\tmonitor.render(new SimpleTextRenderer());\r\n\r\n\t\t// shutdown measurement framework\r\n\t\ttearDown();\r\n\t}", "private Sort() { }", "public static void main(String[] args) throws InputMismatchException, FileNotFoundException \r\n\t{\t\t\r\n\t\t// \r\n\t\t// Conducts multiple sorting rounds. In each round, performs the following: \r\n\t\t// \r\n\t\t// a) If asked to sort random points, calls generateRandomPoints() to initialize an array \r\n\t\t// of random points. \r\n\t\t// b) Reassigns to elements in the array sorters[] (declared below) the references to the \r\n\t\t// four newly created objects of SelectionSort, InsertionSort, MergeSort and QuickSort. \r\n\t\t// c) Based on the input point order, carries out the four sorting algorithms in one for \r\n\t\t// loop that iterates over the array sorters[], to sort the randomly generated points\r\n\t\t// or points from an input file. \r\n\t\t// d) Meanwhile, prints out the table of runtime statistics.\r\n\t\t// \r\n\t\t// A sample scenario is given in Section 2 of the project description. \r\n\t\t// \t\r\n\t\tint round = 0;\r\n\t\tboolean end = false;\r\n\t\twhile(end == false)\r\n\t\t\t{\r\n\t\t\t\tround++;\t\r\n\t\t\t\tstartRound(round, end);\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// Within a sorting round, have each sorter object call the sort and draw() methods\r\n\t\t// in the AbstractSorter class. You can visualize the result of each sort. (Windows \r\n\t\t// have to be closed manually before rerun.) Also, print out the statistics table \r\n\t\t// (cf. Section 2). \r\n\t\t\r\n\t}", "public static void main(String... args) {\n\n TestWrkactjob_ actJob = new TestWrkactjob_(args[0], args[1], args[2]);\n\n actJob.initJobList();\n actJob.loadJobList();\n\n actJob.setSortOnCPUTime();\n\n actJob.getJobList(\"csv\");\n\n }", "private void sort() {\n\t\trunPassZero();\n\t\tList<TupleReaderBinary> buffers = new ArrayList<>();\n\t\tList<Tuple> sortStage = new ArrayList<>();\n\t\tassert (readerBucketID == 0);\n\t\tassert (writerBucketID == 0);\n\t\tassert (passNumber == 1);\n\t\tassert (currentGroup == 1);\n\t\toutputBuffer.clear();\n\n\t\t// assign buffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tbuffers.add(null);\n\t\t\tassignBuffer(buffers, i);\n\t\t\tsortStage.add(null);\n\t\t}\n\n\t\tassert (buffers.size() == numInputBuffers);\n\t\tassert (sortStage.size() == numInputBuffers);\n\n\t\t// read from buffers into list of size numInputBuffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t}\n\n\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\" + instanceHashcode\n\t\t\t\t+ \"_\" + passNumber + \"_\" + writerBucketID);\n\n\t\twhile (true) {\n\t\t\tif (!findAndReplaceSmallest(buffers, sortStage)) {\n\t\t\t\tprevPrevTotalBuckets = prevTotalBuckets;\n\t\t\t\tprevTotalBuckets = writerBucketID + 1;\n\t\t\t\tflushOutputBuffer();\n\t\t\t\toutputWriter.close();\n\n\t\t\t\t// We are done! Return\n\t\t\t\tif (prevTotalBuckets == 1) {\n\t\t\t\t\tdeleteTempFiles();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twriterBucketID = 0;\n\t\t\t\treaderBucketID = 0;\n\t\t\t\twriterFlushes = 0;\n\t\t\t\tdeleteTempFiles();\n\t\t\t\tpassNumber++;\n\t\t\t\tcurrentGroup = 1;\n\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tassignBuffer(buffers, i);\n\t\t\t\t\tsortStage.add(null);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t\t\t}\n\n\t\t\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\"\n\t\t\t\t\t\t+ instanceHashcode + \"_\" + passNumber + \"_\" + writerBucketID);\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n ArrayList<SortObjects> a = new ArrayList<SortObjects>();\n\n SortObjects o = new SortObjects(\"Latha\", 23, 26000);\n SortObjects o2= new SortObjects(\"Ramya\", 20, 11000);\n SortObjects o3= new SortObjects(\"Kalai\", 29, 30000);\n SortObjects o4= new SortObjects(\"Vidya\", 24, 25000);\n a.add(o);\n a.add(o2);\n a.add(o3);\n a.add(o4);\n SortComparator s = new SortComparator();\n a.sort(s);\n System.out.println(a);\n \n \n\n\t}", "public static void main(String[] args) throws Exception {\n\n\t\t// nodeProbeTester();\n\n\t\tpathSortTester();\n\n\t}", "public static void main(String[] args) {\n\t\tQueue<Integer> integerPriorityQueue = new PriorityQueue<>(7);\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\tintegerPriorityQueue.add(new Integer(rand.nextInt(100)));\r\n\t\t}\r\n\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\tInteger in = integerPriorityQueue.poll();\r\n\t\t\tSystem.out.println(\"Processing Integer:\" + in);\r\n\t\t}\r\n\r\n\t\t// PriorityQueue example with Comparator\r\n\t\tQueue<Customer> customerPriorityQueue = new PriorityQueue<>(7, idComparator);\r\n\t\taddDataToQueue(customerPriorityQueue);\r\n\r\n\t\tpollDataFromQueue(customerPriorityQueue);\r\n\r\n\t}", "public static void runComparator(String pathOriginalFile, String pathRoundtrippedFile, String outputPath) {\n DiffGenerator diffGenerator = new DiffGenerator(pathOriginalFile, pathRoundtrippedFile, outputPath);\n try {\n diffGenerator.prepareFolderRequired();\n diffGenerator.prepareFolderAndRun();\n } catch (Exception e) {\n StatusLogger.addRecordWarningExec(e.getMessage());\n }\n }", "public static void main(String[] args) {\n\t\tGeometricObject[] list = {new Circle(5), new Rectangle(4, 5),\n\t\t\tnew Circle(5.5), new Rectangle(2.4, 5), new Circle(0.5),\n\t\t\tnew Rectangle(4, 65), new Circle(4.5), new Rectangle(4.4, 1),\n\t\t\tnew Circle(6.5), new Rectangle(4, 5)};\n\n\t\t// Invoke selection sort using GeometricObjectComparator\n\t\tselectionSort(list, new GeometricObjectComparator());\n\t\t\n\t\t// Display the sorted elements\n\t\tSystem.out.print(\"Sorted elements: \");\n\t\tfor (GeometricObject e: list) {\n\t\t\t\tSystem.out.printf(\"%.2f \", e.getArea());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tString name = \"hello\";\r\n\t\tRunnable r1 = () -> System.out.println(name);\r\n\t\t\r\n\t\t//String name2 = \"\";\r\n\t\t String name2 = name.toUpperCase();\r\n\t\tRunnable r2 = () -> System.out.println(name2);\r\n\t\tr1.run();\t\r\n\t\t\r\n\t\t//avergeOfPlayer();\r\n\t\t\r\n\t\t//topNumberinArray();\r\n\t\t\r\n\t\ttestSpiltIterator();\r\n\t\t\r\n\t}", "public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }", "void updateSortingComparators(Comparator<ReadOnlyEntry> eventComparator,\n Comparator<ReadOnlyEntry> deadlineComparator,\n Comparator<ReadOnlyEntry> floatingTaskComparator);", "public void run(){\n ArrayList<ArrayList<Furniture>> all = getSubsets(getFoundFurniture());\n ArrayList<ArrayList<Furniture>> valid = getValid(all);\n ArrayList<ArrayList<Furniture>> ordered = comparePrice(valid);\n ArrayList<ArrayList<Furniture>> orders = produceOrder();\n checkOrder(orders, false);\n }", "public static void main(String[] args) {\n\t\t// Set up our seed\n\t\t//testAProblem( new Sort1Problem(),new Sort1Optimised());\n\t\t\n\t\ttestAProblem(new Sort1QuickProblem(),null);\n\t}", "public static void main( String[] args )\n {\n\tOrderedArrayList Franz = new OrderedArrayList();\n\n\t// testing binary search\n\tfor( int i = 0; i < 15; i++ )\n\t Franz.addBin( (int)( 50 * Math.random() ) );\n\tSystem.out.println( Franz );\n\n\t//check for sorted-ness\n\t//if msg does not appear, list was sorted\n\tfor( int i=0; i<Franz.size()-1; i++ ) {\n\t System.out.println(\"at i: \" + Franz.get(i) );\n\t if ( Franz.get(i).compareTo(Franz.get(i+1)) > 0 ) {\n\t\tSystem.out.println( \" *** NOT sorted *** \" );\n\t\tbreak;\n\t }\n\t}\n\n\t/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/\n }", "private Comparison() {\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic static void main(String[] args) {\n\t\t\r\n\t\tComparator integerComparator = (Object arg0, Object arg1) -> {\r\n\t\t\treturn ((Integer)arg0>(Integer)arg1)?-1:((Integer)arg0>(Integer)arg1)?1:0;\r\n\t\t};\r\n\t\t\r\n\t\tCollectionUtils utils = new CollectionUtils();\r\n\t\tList<Integer> list = utils.getIntegerList();\r\n\t\tSystem.out.println(\"Before sorting\");\r\n\t\tSystem.out.println(list);\r\n\t\tCollections.sort(list, integerComparator);\r\n\t\tSystem.out.println(\"After sorting in descending order:\");\r\n\t\tSystem.out.println(list);\r\n\t\t\r\n\t\tlist = utils.getIntegerList();\r\n\t\tSystem.out.println(\"Before sorting\");\r\n\t\tSystem.out.println(list);\r\n\t\tCollections.sort(list,(a,b)->(a>b)?-1:(a>b)?1:0);\r\n\t\tSystem.out.println(\"After sorting in descending order:\");\r\n\t\tSystem.out.println(list);\r\n\r\n\t\tlist = utils.getIntegerList();\r\n\t\tSystem.out.println(\"Before sorting\");\r\n\t\tSystem.out.println(list);\r\n\t\tCollections.sort(list);\r\n\t\tSystem.out.println(\"After sorting in ascending order:\");\r\n\t\tSystem.out.println(list);\r\n\r\n\t}", "public static void main(String[] args) {\n\t\ttestStreamMapReduce();\r\n\t\t//testMethodReference();\r\n\t}", "public DMSQueueEntryComparator()\n {\n\n }", "public static void main(String[] args)\n {\n // create an ArrayList of integers, then call mySort to sort it\n }", "protected abstract int doCompare(Object o1, Object o2);", "public static void main(String[] args) {\n\n Comparator<Integer> comparator = new Comparator<Integer>() {\n @Override\n public int compare(Integer o1, Integer o2) {\n return o1.compareTo(o2);\n }\n };\n\n System.out.println(\" result of comparator :\" + comparator.compare(3,2));\n\n\n /*\n After java8\n */\n\n Comparator<Integer> comparatorLambda = (a, b)-> a.compareTo(b);\n\n\n System.out.println(\" result of comparator lambda is : \"+ comparatorLambda.compare(3,2));\n\n }", "public static void main(String[] args) {\n\t\tList<Employee> list = new ArrayList<Employee>();\r\n\t\tlist.add(new Employee(\"Ashish\", new Integer(37), new Double(373727)));\r\n\t\tlist.add(new Employee(\"Ashish\", new Integer(37), new Double(373)));\r\n\t\tlist.add(new Employee(\"Rakesh\", new Integer(37), new Double(373727)));\r\n\r\n\t\tlist.add(new Employee(\"Sakal\", new Integer(25), new Double(3434737)));\r\n\t\tlist.add(new Employee(\"Manish\", new Integer(26), new Double(373727)));\r\n\t\tlist.add(new Employee(\"Manish\", new Integer(37), new Double(373727)));\r\n\r\n\t\t// In collections class one sort method is there which taking two\r\n\t\t// argument\r\n\t\t// one list one one comparator type so here\r\n\t\t// SortBasedOnNameAgeAndSalary is comparator type note: sortimg in\r\n\t\t// assending\r\n\r\n\t\tCollections.sort(list, new SortBasedOnNameAgeAndSalary());\r\n\t\tSystem.out.println(\"after Sorting\" + list);\r\n\t\t// Here i am iterating list and getting sorted result\r\n\t\tfor (Employee employee : list) {\r\n\t\t\tSystem.out.println(employee);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws Exception {\r\n if (args != null && args.length == 3) {\r\n BufferPool pool = new BufferPool(args[0],\r\n Integer.parseInt(args[1]));\r\n Sort sort = new Sort(pool);\r\n sort.sort();\r\n pool.flush();\r\n FileWriter fStream = new FileWriter(args[2], true);\r\n BufferedWriter buffWrite = new BufferedWriter(fStream);\r\n buffWrite.write(\"-----------------------------------\\n\");\r\n buffWrite.write(\"File: \" + args[0] + '\\n');\r\n buffWrite.write(\"Hits: \" + pool.hits() + '\\n');\r\n buffWrite.write(\"Reads: \" + pool.reads() + '\\n');\r\n buffWrite.write(\"Writes: \" + pool.writes() + '\\n');\r\n buffWrite.write(\"Time in ms: \" + sort.getRunTime() + '\\n');\r\n buffWrite.write(\"-----------------------------------\\n\");\r\n buffWrite.close();\r\n }\r\n else {\r\n System.out.println(\"Wrong args\");\r\n }\r\n }", "@Test \n public void compareFunctionalEquals() {\n HighScoreComparator comparator2 = new HighScoreComparator();\n int a;\n a = comparator2.compare(p1, p1);\n \n assertEquals(0, a);\n }", "public static void main(String[] args) {\n\t\tint[] arr = { 42, 96, 12, 18, -1, 53 };\n\t\tint[] sorted = mergesorting(arr,0,arr.length-1);\n\t\tdisplay(sorted);\n\t}", "public abstract void runAlgorithm();", "@Test\n public void compareFunctionalSmaller() {\n HighScoreComparator comparator2 = new HighScoreComparator();\n int a;\n a = comparator2.compare(p2, p1);\n \n assertEquals(1, a);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] arr = {11, 3, 7, 15, 25, 20, 55, 66, 30};\r\n\t\tsortAlmostSortedArray(arr, 2);\r\n\t}", "public static void main(String[] args) {\n\t\tint []arr={1,5,3,4,2,9,6,8};\n\t\tSort.selectSort(arr);\n\n\t}", "static void perform_cmp(String passed){\n\t\tint type = type_of_cmp(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcmp_with_reg(passed);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcmp_with_mem(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "@Test\n public void testCompare() {\n AantalGastenComparator instance = new AantalGastenComparator();\n int expResult;\n int result;\n \n //test 1\n Accommodatie a1 = new Accommodatie(\"je moeder\", 30.00, 2, 1);\n Accommodatie a2 = new Accommodatie(\"je vader\", 40.00, 3, 1);\n expResult = -1;\n result = instance.compare(a1, a2);\n assertEquals(expResult, result);\n \n \n //test 2\n Accommodatie a3 = new Accommodatie(\"je moeder2\", 30.00, 2, 1);\n Accommodatie a4 = new Accommodatie(\"je vader2\", 40.00, 2, 1);\n expResult = 0;\n result = instance.compare(a3, a4);\n assertEquals(expResult, result);\n \n \n //test 3\n Accommodatie a5 = new Accommodatie(\"je moeder3\", 30.00, 3, 1);\n Accommodatie a6 = new Accommodatie(\"je vader3\", 40.00, 2, 1);\n expResult = 1;\n result = instance.compare(a5, a6);\n assertEquals(expResult, result);\n }", "public static void main(String[] args) {\n\t\tint []array = {1,10,2,6,3,11,13,41};\r\n\t\tSystem.out.println(\"Before Sorting: \"+Arrays.toString(array));\r\n\t\tselectionSort(array);\r\n\t\tSystem.out.println(\"After Sorting: \"+Arrays.toString(array));\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tint[] data = { 6, 3, 3, 7, 1, 21, 3, 7, 2, 25 };\n\n\t\tSystem.out.print(\"origin :\");\n\t\tprint(data);\n\t\tmergeSort(data, 0, data.length - 1);\n\n\t\tSystem.out.print(\"result :\");\n\t\tprint(data);\n\t}", "public void testCompare1() throws Exception {\r\n ComponentCompetitionSituation situation = new ComponentCompetitionSituation();\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(1.5D,\r\n situation, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // predictions in range < predictions above the range\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "@Test\n\tpublic void testRunArgsSorted() throws SortException {\n\t\tString[] argsArr = new String[] { \"examples/sort2.txt\" };\n\t\tByteArrayOutputStream stdout = new ByteArrayOutputStream();\n\t\tsortApplication.run(argsArr, null, stdout);\n\t\tString expectedResult = \"\\\"\" + NEW_LINE + \">\" + NEW_LINE + \"{\" + NEW_LINE + \"3\" + NEW_LINE + \"9\" + NEW_LINE\n\t\t\t\t+ \"M\" + NEW_LINE + \"o\" + NEW_LINE;\n\t\tassertEquals(expectedResult, stdout.toString());\n\t}", "@Test\n public void compareFunctionalBigger() {\n HighScoreComparator comparator2 = new HighScoreComparator();\n int a;\n a = comparator2.compare(p1, p2);\n \n assertEquals(-1, a);\n\n }", "@Override public void run() {\n\t\t\t// Handle the base case:\n\t\t\tif(len - start < 2) {\n\t\t\t\t// Arrive at the base-case state & return:\n\t\t\t\tph.arrive();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO: Select an optimal pivot point:\n\t\t\tint pivot = start;\n\n\t\t\t// Perform the necessary swap operations:\n\t\t\tfor(int i = start; i < len; ++i) {\n\t\t\t\tif(data[i] < data[pivot]) {\n\t\t\t\t\tint tmp = data[pivot];\n\t\t\t\t\tdata[pivot] = data[i];\n\t\t\t\t\tdata[i] = data[pivot + 1];\n\t\t\t\t\tdata[pivot + 1] = tmp;\n\t\t\t\t\t++pivot;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle the single-threaded case:\n\t\t\tif(this.pool == null) {\n\t\t\t\t// Store local variables temporarily:\n\t\t\t\tint start = this.start;\n\t\t\t\tint len = this.len;\n\n\t\t\t\t// Do the first half:\n\t\t\t\tthis.len = pivot;\n\t\t\t\trun();\n\n\t\t\t\t// Prepare for the second half of the array:\n\t\t\t\tthis.len = len;\n\t\t\t} else {\n\t\t\t\t\t// Register a task to process the first half of the array:\n\t\t\t\t\t// TODO: Don't do this if that thread's base-case is met\n\t\t\t\t\tpool.submit(new Sorter(this.pool, this.ph, data, start, pivot));\n\t\t\t}\n\n\t\t\t// Recursively process the second half of the array:\n\t\t\tstart = pivot + 1;\n\t\t\trun();\n\t\t}", "public PeerGroupAdvComparator() {\n }", "public static void main(String[] args) {\n\n\t\tPriorityQueue pq = new PriorityQueue(15, new MyComparator());\n\t\t\n\t\tpq.offer(\"A\");\n\t\tpq.offer(\"B\");\n\t\tpq.offer(\"Z\");\n\t\tpq.offer(\"L\");\n\t\t\n\t\tSystem.out.println(pq);\n\t}", "public static void main(String[] args) {\n\t\tint [] a1= {10,4,5,6,34,46,7,23};\r\n\t\tSelection_Sort s=new Selection_Sort(a1);\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tint[] inputarray= {46,45,87,32,84};\r\n\t\tMergeSort MS = new MergeSort();\r\n\t\tMS.sort(inputarray);\r\n\t}", "@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 }", "public static void main(String[] args) {\n\t\t\n\t\tList<Card> listOfCards = new ArrayList<Card>();\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.DIAMOND, SuitValue.ACE));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.CLUB, SuitValue.FIVE));\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.HEART, SuitValue.FOUR));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.SPADE, SuitValue.THREE));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.CLUB, SuitValue.TWO));\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.DIAMOND, SuitValue.JACK));\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.ColorComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.TypeComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.ValueComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.CardComparator);\n\t\tSystem.out.println(listOfCards);\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] arr= {5,8,2,4,3};\r\n\t\t\r\n\t\tfor (int i:arr) {\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\t\t\r\n\t\tArrays.parallelSort(arr);\r\n\t\tSystem.out.println(\"Elements after sort\");\r\n\t\t\r\n\t\tfor (int i:arr) {\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }", "public CollectionComparator(Method attributeCaller, boolean descending)\n\t{\n\t\tthis.attributeCaller = attributeCaller;\n\t\tthis.descending = descending;\n\t}", "public static void main(String[] args) {\n\t\tint arr[]= {1,0,2,1,0,1,2,0};\n\t\tsort012(arr);\n\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> inputArray = new ArrayList<Integer>();\n\t\tinputArray.add(99);\n\t\tinputArray.add(44);\n\t\tinputArray.add(6);\n\t\tinputArray.add(2);\n\t\tinputArray.add(1);\n\t\tinputArray.add(5); \n\t\tinputArray.add(63);\n\t\tinputArray.add(87);\n\t\tinputArray.add(283);\n\t\tinputArray.add(4);\n\t\tinputArray.add(0);\n\t\t \n\t\tSystem.out.println(\"Merge Sort Input\");\n\t\tinputArray = mergeSort(inputArray);\n\t\tSystem.out.println(\"Sorted Array: \"+inputArray);\n\t}", "protected abstract Comparison getInstance();", "public static void main(String[] args) {\n ArrayList<BankAccount> accounts = makeBankingSystem();\n \n Collections.sort(accounts, BankAccount.createComparatorByBalance(false));\n for (BankAccount c: accounts){\n System.out.println(c.getName(c)+\", \"+c.getBalance(c));\n \n }\n \n}", "public static void main(String[] args) {\n\t\tSelectionSort ob=new SelectionSort();\n\t\tint i=0;\n\t\tint min=0;\n\t\tfor(int j=i+1;j<a.length;j++){\n\t\t\tmin=ob.mini(a, j);\n\t\t\tif(a[i]>a[min]){\n\t\t\t\tob.exch(a, i, min);\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tfor(int i1=0;i1<a.length;i1++){\n\t\t\tSystem.out.println(a[i1]);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tRandom rnd = new Random();\n\t\tList<SomeObjectToCompare> myList = new ArrayList<>();\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tmyList.add(new SomeObjectToCompare(rnd.nextInt(100), new Integer(rnd.nextInt(50)).toString()));\n\t\t}\n\t\tfor (SomeObjectToCompare someObjectToCompare : myList) {\n\t\t\tSystem.out.println(someObjectToCompare);\n\t\t}\n\t\tSystem.out.println();\n//\t\tCollections.sort(myList,new Comparator<SomeObjectToCompare>() {\n//\t\t\t@Override\n//\t\t\tpublic int compare(SomeObjectToCompare o1, SomeObjectToCompare o2) {\n//\t\t\t\t// TODO Auto-generated method stub\n//\t\t\t\treturn o1.getId()-o2.getId();\n//\t\t\t}\t\t\t\n//\t\t});\n\t\t\n//\t\tCollections.sort(myList, (o1,o2) -> o1.getId()-o2.getId());\n\n\t\tCollections.sort(myList, SomeObjectToCompare::compareById);\n\t\t\n\t\tmyList.forEach(System.out::println);\n\t}", "public static void main(String[] args) {\n\t\tSelectionSort ss = new SelectionSort();\n\t\tInsertionSort is = new InsertionSort();\n\t\tint [] listToSort = ss.listToSort();\n\t\tlong startTime = System.currentTimeMillis();\n\t\tis.insertionSort(listToSort);\n\t\tSystem.out.println(\"Time Taken to Sort :: \"+(System.currentTimeMillis()-startTime)+\"ms\");\n\t\tss.printList(listToSort);\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Counting Sort\\n\");\n\t\t\n\t\tint [] A = {14, 10, 13, 4, 7, 9, 3, 5, 3, 5};\n\t\tint [] B = new int [A.length + 1];\n\t\t\n\t\t//Gets the highest number in the array\n\t\tint k = 0;\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tif(A[i] > k)\n\t\t\t\tk = A[i];\n\t\t}\n\t\t\n\t\tCountingSort(A, B, k);\n\t\t/*\t\t\t\tCounting Sort Algorithm Starts Here\t\t\t*/\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"\\n\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\t\t\t\tBucket Sort Algorithm Starts Here\t\t\t*/\n\t\tint [] NewA = {14, 10, 13, 4, 7, 9, 3, 5};\n\t\t\n\t\t\n\t\t\n\t\tBucketSort(NewA);\n\t\t\n\t\t/*\t\t\t\tBucket Sort Algorithm Ends Here\t\t\t\t*/\n\t}", "public static void main(String[] args) {\n\t\tLinkedList list=new LinkedList();\n\t\tlist.insert(10);\n\t\tlist.insert(5);\n\t\tlist.insert(15);\n\t\tlist.insert(100);\n\t\tlist.insert(500);\n\t\tlist.insert(200);\n\t\tlist.show();\n\t\tlist.sort();\n\t\tSystem.out.println();\n\t\tlist.show();\n\t}", "public static void main(final String... args) {\n System.out.println(\"---- QuickSort ----\");\n System.out.println(\"Before: \" + Arrays.toString(ArrayGenerator()));\n QuickSort.sort(TEST_ARRAY);\n System.out.println(\"After: \" + Arrays.toString(TEST_ARRAY));\n System.out.println(\"Is Sorted: \" + sortingCheck(TEST_ARRAY));\n // END- QuickSort\n\n }", "public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}", "static public void main(String[] args) throws Throwable {\n /*\n Stream.of(mOneShotInputStrings)\n .parallel()\n .forEach(arrayOfStrings -> \n Stream.of(arrayOfStrings)\n .parallel()\n .forEach(string -> \n Stream.of(mWordList)\n .parallel()\n .map(word -> WordMatcher.search(word, string))\n .forEach(results -> results.print())));\n } */\n \n printDebugging(\"Starting SearchStreamGangTest\");\n \n // Create/run appropriate type of StreamGang to search for words.\n Stream.of(TestsToRun.values())\n .forEach(test -> {\n printDebugging(\"Starting \" + test); \n makeStreamGang(mWordList, test).run(); \n printDebugging(\"Ending \" + test);\n });\n \n printDebugging(\"Ending SearchStreamGangTest\"); \n\t}", "void runC() {\n\t\tArrayList<Link> links_s2 = new ArrayList<Link>(links_s);\n\t\tArrayList<Link> links_p2 = new ArrayList<Link>(links_p);\n\t\talgorithmC = new HashSet<Link>(algorithmC(links_p2, links_s2));\n\t}", "public static void main(String[] args) {\n\t\tint[] data = { 2, 5, 7, 10, 1, 3, 8 };\n\t\tSystem.out.print(\"排序前:\\t\");\n\t\tfor(int i=0;i<data.length;i++)\n\t\t{\n\t\t\tSystem.out.print(Integer.toString(data[i]));\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\n\t\tint[] sort=MergeSort(data, 0, data.length);\n\t\tSystem.out.print(\"排序后:\\t\");\n\t\tfor(int i=0;i<sort.length;i++)\n\t\t{\n\t\t\tSystem.out.print(Integer.toString(sort[i]));\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tString[] a = StdIn.readAllStrings();\n\t\tSelection.sort(a);\n\t\tAbstractSortHelper.show(a);\n\t}", "public static void main(String[] args) {\n\t\tTestingPerformanceCalculator obj= new TestingPerformanceCalculator(\"./data/gitInfoNew.txt\", \"data/Results/FinalResultSidTest1.txt\");\n\t\t//Read Gold set\n\t\tobj.goldStMap=obj.LoadGoldSet();\n\t\t//MiscUtility.showResult(10, obj.goldStMap);\n\t\t//Resd output file/ test result file\n\t\tobj.finalResult=obj.LoadTestingResult();\n\t\t//MiscUtility.showResult(20, obj.finalResult);\n\t\t\n\t\t\n\t\t//Create a ranked list\n\t\t//obj.produceRankedResult(10);\n\t\tArrayList<String> rankedFinalTestingResult=obj.produceRankedResult(10);\n\t\tContentWriter.writeContent(\"./data/testing1RankedResult.txt\", rankedFinalTestingResult);\n\t\t//call another class BLPerformanceCalc to compute\n\t\t\n\t\t\n\t}", "public void testCompare2() throws Exception {\r\n ComponentCompetitionSituation situation = new ComponentCompetitionSituation();\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(0.6D,\r\n situation, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // predictions in range < predictions below the range\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "@Override\n public int compare(T a, T b) {\n for (Comparator<T> comparator : comparators) {\n int cmp = comparator.compare(a, b);\n\n if (cmp != 0) {\n return cmp;\n }\n }\n return 0;\n }", "public static void main(String[] args) {\n //Q1\n String[] a = {\"S\", \"O\", \"R\", \"T\", \"E\", \"X\", \"A\", \"M\", \"P\", \"L\", \"E\"};\n //Integer[] a = {1, 3, 6, 7, 8, 9, 5, 4, 2};\n quicksortmid(a);\n //assert isSorted(a); //requires assertions enabled.\n show(a);\n \n //Q2\n String[] b = {\"S\", \"O\", \"R\", \"T\", \"E\", \"X\", \"A\", \"M\", \"P\", \"L\", \"E\"};\n //Integer[] b = {1, 2, 6, 7, 9, 5, 4, 8, 3, 0, 10};\n mergesort(b);\n //assert isSorted(b);\n show(b);\n }", "public static void main(String[] args) {\n\t\tint[] elements = {1,2,3,4,5};\n\t\t// get the Application context which contains all the beans\n\t\tApplicationContext applicationContext = SpringApplication.run(LearningSpringFrameWorkApplicationBinarySearch.class, args);\n\t\t// get the required bean from thBinary_Searche application context\n\t\tBinary_Search binarySearchBean1 = applicationContext.getBean(Binary_Search.class);\n\t\tBinary_Search binarySearchBean2 = applicationContext.getBean(Binary_Search.class);\n\t\tBinary_Search binarySearchBean3 = applicationContext.getBean(Binary_Search.class);\n\t\tSystem.out.println(binarySearchBean1);\n\t\tSystem.out.println(binarySearchBean2);\n\t\tSystem.out.println(binarySearchBean3);\n//\t\tint answer = binarySearchBean.sort(elements, 5);\n//\t\tSystem.out.println(\"Answer = \" + answer);\n\n\t}", "private CountingResult aggregateEvaluateAndCompareResults(\r\n\t\t\tString suffix,\r\n\t\t\tCountingResultCollector crCollector, \r\n\t\t\tList<CountingResult> countingResults) {\r\n // only see how many CountingResults a signature has in \"results\"\r\n\t\tthis.aggregateResultBySignature(countingResults);//TODO add comments\r\n\t\t\r\n\t\tlog.debug(\"CountingResult that is the sum of counts \" +\r\n\t\t\t\t\"reported using _inlined reporting methods: \\n\"+\r\n\t\t\t\tcrCollector.getInlined_countingResult());\r\n\t\t\r\n\t\tlong timestampToUse = System.nanoTime();\r\n\t\tCountingResult sumOfAllCountingResults = null; //\"Type 1\"\r\n\t\tCountingResult compressCR_evaluated = null; //\"Type 2\"\r\n\r\n\t\tif(countingResults.size()==0){\r\n\t\t\tlog.error(\"Zero counting results!\");\r\n\t\t}else{\r\n\t\t\t//6. add up (first approach)\r\n\t\t\tsumOfAllCountingResults = new CountingResult(\r\n\t\t\t\t\tUUID.randomUUID(),\r\n\t\t\t\t\tUUID.randomUUID(),\r\n\t\t\t\t\tUUID.randomUUID(),\r\n\t\t\t\t\t\r\n\t\t\t\t\t\"allCountingResults\", //ID\r\n\t\t\t\t\t\"spec.benchmarks.compress.Compressor.compress\", //results.get(0).getQualifyingMethodName(),//qualifyingMethodName\r\n\t\t\t\t\tcountingResults.get(0).getFileType(), //fileType\r\n\t\t\t\t\tcountingResults.get(0).getInputCharacterisation(), //inputCharacterisation\r\n\t\t\t\t\tcountingResults.get(0).getOutputCharacterisation(),//outputCharacterisation\r\n\t\t\t\t\t0L, //methodInvocationBeginning\r\n\t\t\t\t\t0L, //methodReportingTime\r\n\t\t\t\t\tnew long[202], //opcodeCounts\r\n\t\t\t\t\tnew TreeMap<String,Long>(), //methodCallCounts\r\n\t\t\t\t\tnew long[]{}, //arrayCreationCounts\r\n\t\t\t\t\tnew int[]{}, //arrayCreationDimensions\r\n\t\t\t\t\tnew String[]{}, //arrayCreationTypeInfo\r\n\t\t\t\t\tnew TreeMap<BytecodeSectionDescription, SortedMap<Integer,Long>>(), //sectionInstCounts\r\n\t\t\t\t\tnew TreeMap<BytecodeSectionDescription, SortedMap<String,Long>>()); //sectionMethCounts\r\n\t\t\t\t\t\r\n\t\t\tint currResultIndex = 0;\r\n\t\t\tCountingResult compressCR = null;\r\n\t\t\tfor(CountingResult r : countingResults) {\r\n\t\t\t\tif(r.getQualifyingMethodName().contains(\"compress\")){//TODO document this\r\n\t\t\t\t\tcompressCR = r;\r\n\t\t\t\t}\r\n\t\t\t\tsumOfAllCountingResults.add(r);//TODO\r\n\t//\t\t\tlog.debug(\"after adding CountingResult \"+currResultIndex+\":\");\r\n\t\t\t\tcurrResultIndex++;\r\n\t\t\t}\r\n\t\t\tif(compressCR!=null){\r\n\t\t\t\tsumOfAllCountingResults.setMethodInvocationBeginning(compressCR.getMethodInvocationBeginning());\r\n\t\t\t\tsumOfAllCountingResults.setMethodReportingTime(compressCR.getMethodReportingTime());\r\n\t\t\t}\r\n\t\t\tlog.info(\"Addition Type1 \\\"simply all, before adding the inlined\\\": \"+sumOfAllCountingResults);\r\n\t\t\t\r\n\t\t\tsumOfAllCountingResults.add_methodsInstructionsOnly(crCollector.getInlined_countingResult());\r\n\t\t\tlog.info(\"Addition Type1 \\\"simply all, after adding the inlined\\\", final result: \"+sumOfAllCountingResults);\r\n\t\t\t\r\n\t\t\tString[] splits = Harness.MK_FILES_NAMES[Harness.MK_getFileIndex()].split(\"/\");\r\n\t\t\tcsvrw = new CountingResultCSVWriter(\r\n\t\t\t\t\ttrue, //append grand total at the end\r\n\t\t\t\t\t';',//entriesSeparationChar\r\n\t\t\t\t\ttrue,//listInvokeOpcodes\r\n\t\t\t\t\ttrue,//performIntegrityCheckOnInvokeOpcodes\r\n\t\t\t\t\t\"CountingResult.Sum1\",//pieceFileNameCore\r\n\t\t\t\t\tsplits[splits.length-1]+\".\"+suffix+\".MK.csv\",//pieceFileNameExtension\r\n\t\t\t\t\t\"MK_results\",//pieceFilePath\r\n\t\t\t\t\ttrue,//writeBooleansAsIntegers\r\n\t\t\t\t\ttrue,//writeOpcodesAsIntegers\r\n\t\t\t\t\ttrue,//writeUnusedOpcodes\r\n\t\t\t\t\ttrue,//truncateUndefinedOpcodes\r\n\t\t\t\t\tfalse//writeArrayDetailsToSeparateFile\r\n\t\t\t\t);\r\n\t\t\tcsvrw.writeResultToCSV(\r\n\t\t\t\t\tsumOfAllCountingResults, \r\n\t\t\t\t\ttrue, //use previous timestamp \r\n\t\t\t\t\ttimestampToUse //previous timestamp to use\r\n\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t//8. serialise first CountingResult\r\n\t\t\tCountingResultPersistance.serialiseCountingResult(//TODO this used splits to map to file names...\r\n\t\t\t\t\tsumOfAllCountingResults, \r\n\t\t\t\t\t\".\", \r\n\t\t\t\t\tCountingResultPersistance.DEFAULT_COUNTING_RESULT_NAMECORE, \r\n\t\t\t\t\tsuffix, //CountingResultPersistance.DEFAULT_COUNTING_RESULT_NAME_SUFFIX, \r\n\t\t\t\t\tCountingResultPersistance.DEFAULT_COUNTING_RESULT_EXTENSION,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\ttimestampToUse);\r\n\r\n\t\t\t//7. try a different addition approach:\r\n\t\t\tif(compressCR==null){\r\n\t\t\t\tlog.error(\"There is no CountingResult for the compress() method !!!\");\r\n\t\t\t}else{\r\n\t\t\t\tlog.debug(\"The compress() method DOES have a CountingResult\");\r\n\t\t\t\tlong callerStartTime;\r\n\t\t\t\tcallerStartTime = compressCR.getMethodInvocationBeginning();\r\n\t\t\t\tcompressCR_evaluated = crCollector.retrieveCountingResultByStartTime_evaluateCallingTree(callerStartTime, true);\r\n\t\t\t\tlog.info(\"Addition Type2 \\\"within timespan, without inlined\\\"\"+compressCR_evaluated);\r\n\t\t\t\t\r\n\t\t\t\tcompressCR_evaluated.add_methodsInstructionsOnly(crCollector.getInlined_countingResult());\r\n\t\t\t\tlog.info(\"Addition Type2 \\\"within timespan, with inlined\\\", final result: \"+compressCR_evaluated);\r\n\r\n\t\t\t\tif(compressCR_evaluated.shallowEquals(sumOfAllCountingResults)){\r\n\t\t\t\t\tlog.info(\"Aggregated results are equal for both computation ways; not writing CountingResult as second time\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tlog.error(\"Aggregated results are different for both computation ways; writing the different CountingResult (as CSV only)\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tcsvrw = new CountingResultCSVWriter(\r\n\t\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t\t\t';',\r\n\t\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t\t\t\"CountingResult.Sum2\",\r\n\t\t\t\t\t\t\tsplits[splits.length-1]+\".\"+suffix+\".MK.csv\",\r\n\t\t\t\t\t\t\t\"MK_results\",\r\n\t\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t\t\tfalse,\r\n\t\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t\t\tfalse);\r\n\t\t\t\t\tcsvrw.writeResultToCSV(compressCR_evaluated, true, timestampToUse);//TODO use the timestamp!\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\r\n\t//\t\tfor(int i = 0; i < results.size(); i++) {\r\n\t//\t\t\tcallerStartTime = results.get(i).getMethodInvocationBeginning();\r\n\t//\t\t\tcalcResult.add(crc.getCountingResultByStartTime_evaluateCallingTree(callerStartTime));\r\n\t//\t\t}\r\n\t//\t\tTODO\r\n\t//\t\tfor(CountingResult c in calcResult) {\r\n\t//\t\t\tif c name is compress log\r\n\t//\t\t}\r\n\t\t}\r\n\t\treturn sumOfAllCountingResults;\r\n\t}" ]
[ "0.65303206", "0.64309597", "0.6316755", "0.62712663", "0.6113473", "0.61075306", "0.6091614", "0.6028801", "0.5957022", "0.59477067", "0.5917158", "0.5900379", "0.5898225", "0.5865191", "0.58644634", "0.58391297", "0.58122903", "0.5781467", "0.5777977", "0.5773166", "0.5726868", "0.56867695", "0.5685238", "0.56830794", "0.5658851", "0.56545526", "0.5645701", "0.5641681", "0.56343466", "0.563382", "0.56298393", "0.56203395", "0.55767494", "0.5576481", "0.55521137", "0.55113906", "0.5489697", "0.5475121", "0.5465139", "0.54499966", "0.544992", "0.5444291", "0.5437915", "0.54331166", "0.54190826", "0.5416199", "0.5397664", "0.53810817", "0.53660995", "0.536481", "0.53609174", "0.53601795", "0.5345663", "0.53445506", "0.53420705", "0.5327397", "0.5325601", "0.5311822", "0.5300647", "0.5295981", "0.5294976", "0.5290868", "0.5281767", "0.52781254", "0.52777994", "0.5271062", "0.52658296", "0.52571315", "0.5252541", "0.5251354", "0.5246563", "0.5246235", "0.5244415", "0.5241208", "0.5241082", "0.52406543", "0.52310044", "0.52308506", "0.5221903", "0.52216434", "0.5221593", "0.5221063", "0.521923", "0.52191216", "0.5214263", "0.52117544", "0.52098066", "0.5209318", "0.5208676", "0.520786", "0.520522", "0.5205158", "0.5203017", "0.5201749", "0.5199002", "0.5197475", "0.5194076", "0.5191883", "0.51905423", "0.51864576", "0.51844394" ]
0.0
-1
hashMap + bit manipulation solution, in this solution we use a mark 0xFFFFF to avoid building whole string boundary check
public List<String> findRepeatedDnaSequences(String s) { if(s.length() < 10) return new ArrayList<String>(); int[] map = new int[256]; map['A'] = 0; map['T'] = 1; map['C'] = 2; map['G'] = 3; List<String> result = new ArrayList<String>(); //this set contains string that occurs before Set<Integer> visited = new HashSet<Integer>(); //this set contains string that we have inserted into result Set<Integer> inResult = new HashSet<Integer>(); int key = 0; //Since we only partially modify the key, we need to firstly initialize it for(int i = 0; i < 9; i++){ key <<= 2; key |= map[s.charAt(i)]; } for(int i = 9; i < s.length(); i++){ key <<= 2; key |= map[s.charAt(i)]; //our valid key has 20 digits, we use 0xFFFFF to remove digits that beyong this range key &= 0xFFFFF; String temp = s.substring(i - 9, i+1); //if this is not the first time we visit this substring if(!visited.add(key)){ //if this is the first time we add this substring into result if(inResult.add(key)){ result.add(temp); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long BPHash(String str) {\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = hash << 7 ^ str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "public void testLong() throws Exception {\n String string = reverse(\"The quick brown fox jumps over the lazy dog.\");\n CharIndex idx = CharIndex.getInstance(string);\n\n long[] map = PatternBitmap.map(string, idx, new long[idx.size()]);\n\n /* Spot check some */\n long e = Long.parseLong(\"00100000000000000000000000001000010000000000\", 2);\n /* ............ The quick brown fox jumps over the lazy dog. */\n\n assertEquals(e, map[idx.lookup('e')]);\n\n long o = Long.parseLong(\"00000000000010000100000000100000000000000100\", 2);\n /* ............ The quick brown fox jumps over the lazy dog. */\n assertEquals(o, map[idx.lookup('o')]);\n\n /* Check all others for zero/non-zero */\n for (int i = 0; i < 0xffff; i++) {\n char c = (char)i;\n int where = string.indexOf(c);\n if (where >= 0) {\n assertTrue(\"Map for pattern character '\" + c + \"' should be non-zero\",\n (map[idx.lookup(c)] & (1L << where)) != 0);\n } else {\n assertEquals(\"Map for unused character '\" + c + \"' should be zero\",\n 0, map[idx.lookup(c)]);\n }\n }\n }", "public long APHash(String str) {\n\t\tlong hash = 0xAAAAAAAA;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tif ((i & 1) == 0) {\n\t\t\t\thash ^= ((hash << 7) ^ str.charAt(i) * (hash >> 3));\n\t\t\t} else {\n\t\t\t\thash ^= (~((hash << 11) + str.charAt(i) ^ (hash >> 5)));\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "private int hasher() {\n int i = 0;\n int hash = 0;\n while (i != length) {\n hash += hashableKey.charAt(i++);\n hash += hash << 10;\n hash ^= hash >> 6;\n }\n hash += hash << 3;\n hash ^= hash >> 11;\n hash += hash << 15;\n return getHash(hash);\n }", "private int hash(String string) {\n\t\tint hash = 0;\n\t\tint temp = 0;\n\n\t\tfor (byte b : string.toLowerCase().getBytes(StandardCharsets.US_ASCII)) {\n\t\t\thash = (hash << 4) + b;\n\t\t\ttemp = hash & 0xF0000000;\n\n\t\t\tif (temp != 0) {\n\t\t\t\thash = hash ^ (temp >>> 24);\n\t\t\t\thash = hash ^ temp;\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "private boolean m76078a(String str) {\n return str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAD7D27B8E9A0AAD39BD28E517\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAD7D27B8E9A0AAD39BD28E517\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF58E0ECD5D66A9A\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF58E0ECD5D66A9A\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAC2C77986D416E025BF24D91D9F5DE0E6C68A688DD108B039AF\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAC2C77986D416E025BF24D91D9F5DE0E6C68A688DD108B039AF\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668DEA0EA620AE\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668DEA0EA620AE\")) || str.contains(C6969H.m41409d(\"G738BDC12AA6AE466F51B9245FBF1FCD16C86D118BE33A0\")) || str.contains(Uri.encode(C6969H.m41409d(\"G738BDC12AA6AE466F51B9245FBF1FCD16C86D118BE33A0\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668D\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668D\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466E340C110ABABC0D92690D111F031AC3BE30B9D4DFCF18CD36C97D413B37EAF26B906994CF7F1CCC73497C70FBA\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466E340C110ABABC0D92690D111F031AC3BE30B9D4DFCF18CD36C97D413B37EAF26B906994CF7F1CCC73497C70FBA\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F10F8006F1E8D3D67A90C515AD24E52AE903DF5AF7F6CCC27B80D009F038BF24EA419347FCF1D1D66A979B12AB3DA7\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F10F8006F1E8D3D67A90C515AD24E52AE903DF5AF7F6CCC27B80D009F038BF24EA419347FCF1D1D66A979B12AB3DA7\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466EB1DDE52E8FD9A996A8D9A12AB3DA766E90F855CFAAAD3C56697DA19B03CF967EE1A9D44\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466EB1DDE52E8FD9A996A8D9A12AB3DA766E90F855CFAAAD3C56697DA19B03CF967EE1A9D44\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA27F2078358F3E88CC26781D915BC3B\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA27F2078358F3E88CC26781D915BC3B\")));\n }", "private int hash(String str, int h){\n int v=0;\n\n /* FILL IN HERE */\n v = Math.floorMod(MurmurHash.hash32(str, seeds[h]) >>> h, 1 << logNbOfBuckets);\n\n return v;\n }", "@Override\n\tpublic int hashCode() {\n\t\tint karprabin = 0;\n\t\tfinal int B = 31;\n\t\tfor (int k = 0; k < this.actualsizeinwords; ++k) {\n\t\t\tkarprabin += B * karprabin + (this.buffer[k] & ((1l << 32) - 1));\n\t\t\tkarprabin += B * karprabin + (this.buffer[k] >>> 32);\n\t\t}\n\t\treturn this.sizeinbits ^ karprabin;\n\t}", "public int hash(String w){\n return (Math.abs(w.hashCode()) % hashTable.length);\n }", "public int hashCode(String s){\r\n int length = s.length();\r\n int h = 0;\r\n for(int i = 0; i < length; i++){\r\n h = h + ((int)s.indexOf(i))*(37^(length - 1));\r\n }\r\n return h;\r\n }", "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}", "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 }", "private static int initHash() {\n return 0x811c9DC5; // unsigned 2166136261\n }", "public String doHash(String str) {\n String key = \"\";\n int offset = str.charAt(0) - 'a';\n for (int i=0; i<str.length(); i++) {\n char res = str.charAt(i) - offset;\n if (res < 'a') res += 26;\n key += res;\n }\n return key;\n }", "public long ELFHash(String str) {\n\t\tlong hash = 0;\n\t\tlong x = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = (hash << 4) + str.charAt(i);\n\n\t\t\tif ((x = hash & 0xF0000000L) != 0) {\n\t\t\t\thash ^= (x >> 24);\n\t\t\t}\n\t\t\thash &= ~x;\n\t\t}\n\n\t\treturn hash;\n\t}", "String getIndexBits();", "public long PJWHash(String str) {\n\t\tlong BitsInUnsignedInt = (long) (4 * 8);\n\t\tlong ThreeQuarters = (long) ((BitsInUnsignedInt * 3) / 4);\n\t\tlong OneEighth = (long) (BitsInUnsignedInt / 8);\n\t\tlong HighBits = (long) (0xFFFFFFFF) << (BitsInUnsignedInt - OneEighth);\n\t\tlong hash = 0;\n\t\tlong test = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = (hash << OneEighth) + str.charAt(i);\n\n\t\t\tif ((test = hash & HighBits) != 0) {\n\t\t\t\thash = ((hash ^ (test >> ThreeQuarters)) & (~HighBits));\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "public static long hashName(String name) {\n\t\t\tlong res = 123;\n\t\t\tfor (int i = 0; i < name.length(); ++i) {\n\t\t\t\tres = (res << 8) | (res >>> 56);\n\t\t\t\tres += name.charAt(i);\n\t\t\t\tif ((res & 1) == 0) {\n\t\t\t\t\tres ^= 0x00000000feabfeabL; // Some kind of feedback\n\t\t\t\t}\n\t\t\t}\n\t\t\tres |= 0x8000000000000000L; // Make sure the hash is negative (to distinguish it from database id's)\n\t\t\treturn res;\n\t\t}", "public static int murmur3A(CharSequence data, int offset, int len, int seed) {\n\n final int c1 = 0xcc9e2d51;\n final int c2 = 0x1b873593;\n\n int h1 = seed;\n\n int pos = offset;\n int end = offset + len;\n int k1 = 0;\n int shift = 0;\n int nBytes = 0; // length in UTF8 bytes\n\n\n while (pos < end) {\n int k2;\n int bits;\n int code = data.charAt(pos++);\n if (code < 0x80) {\n k2 = code;\n bits = 8;\n } else if (code < 0x800) {\n k2 = (0xC0 | (code >> 6))\n | ((0x80 | (code & 0x3F)) << 8);\n bits = 16;\n } else if (code < 0xD800 || code > 0xDFFF || pos >= end) {\n // we check for pos>=end to encode an unpaired surrogate as 3 bytes.\n k2 = (0xE0 | (code >> 12))\n | ((0x80 | ((code >> 6) & 0x3F)) << 8)\n | ((0x80 | (code & 0x3F)) << 16);\n bits = 24;\n } else {\n // surrogate pair\n // int utf32 = pos < end ? (int) data.charAt(pos++) : 0;\n int utf32 = data.charAt(pos++);\n utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF);\n k2 = (0xff & (0xF0 | (utf32 >> 18)))\n | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8\n | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16\n | (0x80 | (utf32 & 0x3F)) << 24;\n bits = 32;\n }\n\n\n k1 |= k2 << shift;\n\n // int used_bits = 32 - shift; // how many bits of k2 were used in k1.\n // int unused_bits = bits - used_bits; // (bits-(32-shift)) == bits+shift-32 == bits-newshift\n\n shift += bits;\n if (shift >= 32) {\n // mix after we have a complete word\n\n k1 *= c1;\n k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);\n k1 *= c2;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13);\n h1 = h1 * 5 + 0xe6546b64;\n\n shift -= 32;\n // unfortunately, java won't let you shift 32 bits off, so we need to check for 0\n if (shift != 0) {\n k1 = k2 >>> (bits - shift); // bits used == bits - newshift\n } else {\n k1 = 0;\n }\n nBytes += 4;\n }\n\n } // inner\n\n // handle tail\n if (shift > 0) {\n nBytes += shift >> 3;\n k1 *= c1;\n k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);\n k1 *= c2;\n h1 ^= k1;\n }\n\n // finalization\n h1 ^= nBytes;\n\n // fmix(h1);\n h1 ^= h1 >>> 16;\n h1 *= 0x85ebca6b;\n h1 ^= h1 >>> 13;\n h1 *= 0xc2b2ae35;\n h1 ^= h1 >>> 16;\n\n return h1;\n }", "private int hashFunc1(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n // Java can return negative vals with hashCode() it's biggg so need to check for this\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n return hashVal; // Idea index position we'd like to insert or search in\n }", "public long DJBHash(String str) {\n\t\tlong hash = 5381;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = ((hash << 5) + hash) + str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "public long JSHash(String str) {\n\t\tlong hash = 1315423911;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash ^= ((hash << 5) + str.charAt(i) + (hash >> 2));\n\t\t}\n\n\t\treturn hash;\n\t}", "public static boolean isUniqueSolInBits(String str){\n //init 32 bit int 0\n int checker = 0;\n for (int i = 0; i < str.length(); ++i){\n //map char 'a' to 'z' to 32 bit (only need 26 bits actually)\n int val = str.charAt(i) - 'a';\n if ((checker & (1 << val)) > 0) return false;\n checker |= (1 << val);\n }\n return true;\n }", "int computeHashCode(byte val);", "private String hash(){\r\n return Utility.SHA512(this.simplify());\r\n }", "int hash(String makeHash, int mod);", "private int hashFunc(String input) {\n\t\tBigInteger value = BigInteger.valueOf(0);\n\t\tBigInteger k2 = new BigInteger(\"27\");\n\t\tchar c = input.charAt(0);\n\t\tlong i1 = (int) c - 96;\n\t\tBigInteger k1 = new BigInteger(\"0\");\n\t\tk1 = k1.add(BigInteger.valueOf(i1));\n\t\tvalue = k1;\n\n\t\tfor (int i = 1; i < input.length(); i++) {\n\n\t\t\tchar c2 = input.charAt(i);\n\n\t\t\tvalue = value.multiply(k2);\n\n\t\t\tlong i2 = (int) c2 - 96;\n\t\t\tBigInteger k3 = new BigInteger(\"0\");\n\t\t\tk3 = k3.add(BigInteger.valueOf(i2));\n\n\t\t\tvalue = value.add(k3);\n\n\t\t}\n\t\tBigInteger size = new BigInteger(\"0\");\n\t\tsize = size.add(BigInteger.valueOf(this.size));\n\t\tvalue = value.mod(size);\n\n\t\treturn value.intValue();\n\t}", "private static boolean isUniqueM2(String str) {\n\n if (str.length() > 128) return false;\n\n boolean[] char_set = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i);\n System.out.println(\"str.charAt(i): \" + val);\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }", "public static String padBitsForHashing(String message) throws UnsupportedEncodingException {\n\n\t\tint rem = 0;\n\t\tint padCount = 0;\n\t\tint lengthOfMsg = message.getBytes(\"UTF-8\").length;\n\t\tString outputMessage = new String();\n\t\toutputMessage = message.toString();\n\t\toutputMessage = outputMessage.concat(\"1\"); // Padding done at least once\n\t\tint lengthOfUnpadedMsg = (lengthOfMsg + 8 + 1)*8; //64 is the size of the field L and 8 will be the size of the 1 that was appended\n\t\tif (lengthOfUnpadedMsg > 512) {\n\t\t\trem = lengthOfUnpadedMsg % 512;\n\t\t\tif (rem > 0) {\n\t\t\t\tpadCount = 512 - rem;\n\t\t\t}\n\n\t\t} else {\n\t\t\tpadCount = 512 - lengthOfUnpadedMsg;\n\t\t}\n\t\tfor (int i = 0; i < padCount;i += 8) {\n\t\t\toutputMessage = outputMessage .concat(\"0\"); \n\t\t}\n\t\toutputMessage = outputMessage .concat(String.format(\"%08d\", lengthOfMsg));//representing length of message into a 64bit value\n\t\treturn outputMessage ;\n\n\t}", "static int hash(int h) {\n\t\t // This function ensures that hashCodes that differ only by constant \n\t\t // multiples at each bit position have a bounded number of collisions \n\t\t // (approximately 8 at default load factor).\n\t\th ^= (h >>> 20) ^ (h >>> 12);\n\t\treturn h ^ (h >>> 7) ^ (h >>> 4);\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "static long m5599a(String str) {\n String[] split = str.split(\"\\\\:\");\n byte[] bArr = new byte[6];\n int i = 0;\n while (i < 6) {\n try {\n bArr[i] = (byte) Integer.parseInt(split[i], 16);\n i++;\n } catch (NumberFormatException unused) {\n return 0;\n }\n }\n return ((((long) bArr[0]) & 255) << 40) | ((((long) bArr[3]) & 255) << 16) | (((long) bArr[5]) & 255) | ((((long) bArr[4]) & 255) << 8) | ((((long) bArr[2]) & 255) << 24) | ((((long) bArr[1]) & 255) << 32);\n }", "public int hash2 ( String key )\n {\n int hashVal = 0;\n if(key != null){\n for( int i = 0; i < key.length(); i++ )\n hashVal = (37 * hashVal) + key.charAt(i);\n //if(hashVal != 0)\n return hashVal % tableSize;\n //else\n // return 0;\n }\n else{\n //System.out.println(\"Key is null\");\n return 0;\n }\n }", "private static char[] m7947z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 16);\n }\n return toCharArray;\n }", "public int hashCode() {\n/* 389 */ return this.m_str.hashCode();\n/* */ }", "int toHashKey(String s)\n\t{\n\t\tint A = 1952786893;\n\t\tint B = 367257;\n\t\tint v = B;\n\t\tfor (int j = 0; j < s.length(); j++)\n\t\t{\n\t\t\tchar c = s.charAt(j);\n\t\t\tv = A * (v + (int) c + j) + B;\n\t\t}\n\n\t\tif (v < 0) v = -v;\n\t\treturn v;\n\t}", "private int hash2(T key) { //first two char length\r\n\r\n if(key.toString().length() ==1){ //in the case that the key is only one char long\r\n return key.toString().charAt(0)%newTable.length;\r\n }\r\n return (26 * key.toString().charAt(0)+key.toString().charAt(1))% newTable.length;\r\n\r\n }", "static int findBinaryStringUsingHMap(int[] arr){\n Map<Integer, Integer> map = new HashMap<>();\n int count =0, maxLength =0;\n //need a default value in map (0,-1) i.e count is zero at index -1 because when we start travelling\n // (after +- counter and encounter zero at very first time (means 0==1) means from index 0 --> current 0=1\n // to calculate the length we need 0,-1\n //e.g 0 1 --> count will be like -1 --> 0 at 1 = 1 ( how to calculate i-(-1) => 2\n map.put(0, -1);\n for(int i=0; i<arr.length; i++){\n count = count + (arr[i]==1 ? 1 : -1);\n if(map.containsKey(count)){\n maxLength = Math.max(maxLength, i - map.get(count));\n }else{\n map.put(count, i);\n }\n }\n return maxLength;\n }", "public int hash1 ( String key )\n {\n int hashVal = 0;\n if(key != null){\n for( int i = 0; i < key.length(); i++ )\n hashVal += key.charAt(i);\n \n //if(hashVal != 0)\n return hashVal % tableSize;\n //else\n // return 0;\n }\n else{\n //System.out.println(\"Key is null\");\n return 0 ;\n }\n\n }", "public static boolean allUnique2(String s ){\n\t\tint value = 0;\n\t\tchar[] chars = s.toCharArray();\n\t\tfor(char c : chars) \n\t\t{\t\n\t\t\tint i = c -'a';\n\t\t\tif(((1<<i+1)&value)>0)\n\t\t\t\treturn false;\n\t\t\tvalue = value | (1<<i+1);\n\t\t}\n\t\treturn true;\n\t}", "java.lang.String getHashData();", "private String getOldPasswordHash(String password) {\n\t\tWhirlpool hasher = new Whirlpool();\n hasher.NESSIEinit();\n\n // add the plaintext password to it\n hasher.NESSIEadd(password);\n\n // create an array to hold the hashed bytes\n byte[] hashed = new byte[64];\n\n // run the hash\n hasher.NESSIEfinalize(hashed);\n\n // this stuff basically turns the byte array into a hexstring\n java.math.BigInteger bi = new java.math.BigInteger(hashed);\n String hashedStr = bi.toString(16); // 120ff0\n if (hashedStr.length() % 2 != 0) {\n // Pad with 0\n hashedStr = \"0\"+hashedStr;\n }\n return hashedStr;\n\t}", "private static int computeHash(int par0)\n {\n par0 ^= par0 >>> 20 ^ par0 >>> 12;\n return par0 ^ par0 >>> 7 ^ par0 >>> 4;\n }", "public static boolean checkPermutaionMap(String s1, String s2) {\n if (s1.length() != s2.length()) return false;\n\n int[] charMap = new int[128];\n for (int i = 0; i < s1.length(); ++i) {\n charMap[s1.charAt(i)]++;\n }\n\n for (int i = 0; i < s2.length(); ++i) {\n if (--charMap[s2.charAt(i)] < 0) return false;\n }\n\n return true;\n }", "private static String HashIt(String token) {\n\t\tStringBuffer hexString = new StringBuffer();\n\t\ttry {\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyte[] hash = digest.digest(token.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t// Convert to hex\n\t\t for (int i = 0; i < hash.length; i++) {\n\t\t\t String hex = Integer.toHexString(0xff & hash[i]);\n\t\t\t if(hex.length() == 1) {\n\t\t\t \thexString.append('0');\n\t\t\t }\n\t\t\t hexString.append(hex);\n\t\t }\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t\thexString.setLength(0);\n\t\t}\n\t return hexString.toString();\t\t\n\t}", "public void testIntegerArray() throws Exception {\n String string = \"x012345678901234567890123456789\"\n + \"01234567890123456789x0123456789\"\n + \"01234x567890123456789\";\n int wordSize = 31;\n\n CharIndex idx = CharIndex.getInstance(string);\n\n int[][] map = PatternBitmap.map(string, idx, new int[idx.size()][],\n wordSize);\n\n /* Spot check some */\n assertEquals(1 << 0, map[idx.lookup('x')][0]);\n assertEquals(1 << 20, map[idx.lookup('x')][1]);\n assertEquals(1 << 5, map[idx.lookup('x')][2]);\n\n /* Check all others for null element/not */\n int[] notThere = map[idx.lookup('\\u0000')];\n for (int i = 0; i < 0xffff; i++) {\n char c = (char)i;\n int where = string.indexOf(c);\n if (where >= 0) {\n assertTrue(\"Map for pattern character '\" + c + \"'\"\n + \" should be non-zero\",\n (map[idx.lookup(c)] != notThere));\n int bit = map[idx.lookup(c)][where / wordSize] & (1 << (where % wordSize));\n assertTrue(\"Map for pattern character '\" + c + \"'\"\n + \" should have \" + where + \" bit on\",\n (bit != 0));\n } else {\n assertEquals(\"Map for unused character '\" + c + \"' should be none\",\n notThere, map[idx.lookup(c)]);\n }\n }\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn map.hashCode() ^ y() << 16 ^ x();\n\t}", "public long DEKHash(String str) {\n\t\tlong hash = str.length();\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = ((hash << 5) ^ (hash >> 27)) ^ str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "public static byte[] hash(String str) {\n // MD5 has 16 bytes = 128 bits. The n'th dimension in the vector represents the n'th bit.\n int[] weightVector = new int[128];\n\n // Use 3-grams as tokens so that some context is maintained between individual words.\n // While not strictly necessary, it does improve accuracy.\n String[] words = ngram(str, 3);\n\n for (String word : words) {\n byte[] hash = DigestUtils.md5Digest(word.getBytes());\n\n // get bits of every byte of the hash and add them to the weight Vector\n for (int j = 0; j < hash.length; j++) {\n for (int k = 0; k < 8; k++) {\n if ((hash[j] >> (7 - k) & 0x01) == 1) {\n weightVector[(j * 8) + k] += 1;\n } else {\n weightVector[(j * 8) + k] -= 1;\n }\n }\n }\n }\n\n byte[] result = new byte[16];\n /*\n * Convert weightVector to hash number by setting every bit >0 to 1\n * and all the others to 0\n */\n for (int i = 0; i < result.length; i++) {\n for (int j = 0; j < 8; j++) {\n if (weightVector[(i << 3) + j] > 0) {\n result[i] |= 1 << (7 - j);\n }\n }\n }\n\n return result;\n// StringBuilder out = new StringBuilder(128);\n// for (int i : weightVector) {\n// if (i > 0) {\n// out.append('1');\n// } else {\n// out.append('0');\n// }\n// }\n// return new BigInteger(out.toString(), 2);\n }", "private int hash1(T key) {\n return (key.toString().charAt(0) + key.toString().length())%newTable.length;\r\n }", "static void method_1458() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"/\\fë%mwH]s,\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var4 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var5 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_1436 = (new String((char[])var4)).intern();\r\n String var2 = field_1436;\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var4)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 220;\r\n break;\r\n case 1:\r\n var10009 = 240;\r\n break;\r\n case 2:\r\n var10009 = 4;\r\n break;\r\n case 3:\r\n var10009 = 165;\r\n break;\r\n case 4:\r\n var10009 = 237;\r\n break;\r\n case 5:\r\n var10009 = 247;\r\n break;\r\n default:\r\n var10009 = 200;\r\n }\r\n\r\n ((Object[])var4)[var0] = (char)(var10007 ^ var5 ^ var10009);\r\n ++var0;\r\n }\r\n }", "@Override\n public int getHash(String name) {\n int x = 0;\n int sum = 0;\n while (x < name.length()) {\n sum += name.charAt(x);\n x++;\n }\n int result = sum % size;\n return result;\n }", "public long FNVHash(String str) {\n\t\tlong fnv_prime = 0x811C9DC5;\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash *= fnv_prime;\n\t\t\thash ^= str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "private long solve(List<String> input) {\n final Map<Long, Long> memory = new HashMap<>();\n\n String bitmask = \"\";\n for (String instruction : input) {\n final String valueString = instruction.substring(instruction.lastIndexOf(\" \") + 1).trim();\n if (instruction.startsWith(\"mask\")) {\n // extract the new bitmask from the instruction\n bitmask = leftPad(valueString, 64);\n\n } else if (instruction.startsWith(\"mem\")) {\n final long value = Long.parseLong(valueString);\n\n final int startOfAddress = instruction.indexOf(\"[\") + 1;\n final int endOfAddress = instruction.indexOf(\"]\");\n final String addressBits = leftPad(Long.toBinaryString(\n Long.parseLong(instruction.substring(startOfAddress, endOfAddress).trim())), 64);\n\n // count the number of \"floating\" x characters in the current bitmask\n final int numFloating = (int) Arrays.stream(bitmask.split(\"(?!^)\")).filter(\"x\"::equalsIgnoreCase).count();\n\n // transform baseBitmask to decode all possible address masks that it represents\n final String[] currentBitmaskBits = bitmask.split(\"(?!^)\");\n int numDecodedAddresses = (int) Math.pow(2, numFloating);\n IntStream.range(0, numDecodedAddresses)\n .mapToObj(i -> {\n // generates all address masks between 0 and 2^(numFloating - 1)\n final String binary = leftPad(Long.toBinaryString(i), numFloating);\n int offset = 0;\n final StringBuilder newBitmask = new StringBuilder();\n for (int j = 0; j < currentBitmaskBits.length; j++) {\n final String maskBit = currentBitmaskBits[j];\n if (\"x\".equalsIgnoreCase(maskBit)) {\n if ('1' == addressBits.charAt(j)) {\n newBitmask.append(\"1\");\n } else {\n newBitmask.append(binary.charAt(offset));\n }\n offset++;\n } else {\n newBitmask.append(maskBit);\n }\n }\n return newBitmask.toString();\n })\n .map(addressMask -> {\n // transforms baseBitmask into an address based on the incoming binary string\n final StringBuilder address = new StringBuilder();\n final String[] addressMaskBits = addressMask.split(\"(?!^)\");\n for (int i = 0; i < addressMaskBits.length; i++) {\n if (\"1\".equalsIgnoreCase(addressMaskBits[i])) {\n // any 1s in the bitmask are logically ORd with the address bits\n address.append(\"1\");\n } else {\n // otherwise, we get this bit from the base address\n address.append(addressBits.charAt(i));\n }\n }\n return address.toString();\n })\n .map(address -> new BigInteger(address, 2).longValue())\n .forEach(address -> memory.put(address, value));\n }\n }\n\n // return sum of all values in memory\n return memory.values().stream()\n .reduce(Long::sum)\n .get();\n }", "private static BigInteger Hash(String term, int printBits)\n {\n BigInteger baseHash = new BigInteger(\"14695981039346656037\");\n Long seed = 1099511628211L;\n long hash_mod = (long)java.lang.Math.pow(2, printBits);\n for(int i = 0; i < term.length(); i++) {\n baseHash = baseHash.multiply(new BigInteger(seed.toString())).remainder(new BigInteger(hash_mod+\"\"));\n baseHash = baseHash.xor(BigInteger.valueOf((long)term.charAt(i)));\n }\n return baseHash;\n }", "private int hash1(K key) {\n int h = 0;\n int seed = 31;//素数\n String s = key.toString();\n for (int i = 0; i != s.length(); ++i) {\n h = seed * h + s.charAt(i);\n }\n return h % length;\n }", "void fillLabelHash() {\n log.debug(\" begin fillLabelHash\");\n for (int v = 0; v < vertices.length; v++) {\n log.debug(\" ---- process vertex \" + v);\n System.err.println(\" ---- process vertex \" + v);\n\n HammingVertex vertex = vertices[v];\n\n // all users of the array MUST use exactly the same algorithm lookup sequence\n int missingBitsVertexMapsIndex = 0;\n\n for (int i = 0; i < (labelSize - 1); i++) {\n for (int j = (i + 1); j < labelSize; j++) {\n\n Map missingBitsVertexMap = missingBitsVertexMaps[missingBitsVertexMapsIndex];\n if (missingBitsVertexMap == null) {\n missingBitsVertexMap = new HashMap<Integer, List<Integer>>();\n missingBitsVertexMaps[missingBitsVertexMapsIndex] = missingBitsVertexMap;\n }\n int compressedLabel = vertex.labelWithoutMissingBitsAsInt(i, j);\n List<Integer> list = (List<Integer>) missingBitsVertexMap.get(compressedLabel);\n if (list == null) {\n list = new LinkedList<Integer>();\n missingBitsVertexMap.put(compressedLabel, list);\n }\n list.add(vertex.vertexNumber);\n\n // next missing bit hashMap in sequence\n missingBitsVertexMapsIndex++;\n }\n }\n }\n }", "@Test\n\tpublic void testGiveCode2() {\n\t\n\t\t\tfloat maxLF = (float) 0.5;\n\t\t\tHTableWords h = new HTableWords(maxLF);\n\t\t\tString word = \"z\";\n\t\t\tint hashCode = h.giveCode(word);\n\t\t\tassertTrue(hashCode == 3);\n\t}", "@Override\n\tpublic int hash(String str) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tint temp = (int) str.charAt(i);\n\t\t\tresult += (temp * (Math.pow(37, i)));\n\t\t}\n\t\treturn result;\n\t}", "public long SDBMHash(String str) {\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = str.charAt(i) + (hash << 6) + (hash << 16) - hash;\n\t\t}\n\n\t\treturn hash;\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 }", "public String doHash2(String str) {\n if(str.length() == 1) return \"-1\";\n\n String key = \"\";\n for (int i = 0; i < str.length() - 1; i++) {\n int val = str.charAt(i + 1) - str.charAt(i);\n if (val < 0) val = 26 + val;\n key += val + \"_\";\n }\n return key;\n }", "private void reHashAdd(String string){\r\n if(string != null && string != this.deleted) {\r\n // if the string is Deleted there is no need to put it in the new hash table\r\n int hash = string.hashCode(),index = 0;\r\n int i = 0;\r\n boolean found = false;\r\n while(!found){\r\n index = (hash + (i*i+i)/2) & (this.capacity()-1);\r\n if(this.hashTable[index] == null){\r\n found = true;\r\n this.hashTable[index] = string;\r\n }\r\n i ++;\r\n }\r\n }\r\n }", "public boolean isUnique(String s){\n // int[] visited = new int[256]; // O:256\n int[] visited = new int[8]; // int = 4 bytes = 32 bits, 8 ints = 32 bytes = 256 bits\n char[] array = s.toCharArray();\n for(char c:array){\n // for a value c in range of 0 - 256\n // it maps to the int at c/32 as index\n // it also maps the c%32 as the index of bits\n if(((visited[c/32] >>> (c%32)) & 1) != 0){\n // bit-tester of the k-th bits, k = c%32\n return false;\n }\n // bit-setter to 1 in the k-th bits\n visited[c/32] |= 1 << (c%32);\n }\n return true;\n }", "String getHash();", "String getHash();", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n HashMap<Integer, Character> hashMap = new HashMap<Integer, Character>();\n hashMap.put(0,'F');hashMap.put(1,'G');hashMap.put(2,'R');\n hashMap.put(3,'S');hashMap.put(4,'T');hashMap.put(5,'L');\n hashMap.put(6,'M');hashMap.put(7,'N');hashMap.put(8,'O');\n hashMap.put(9,'P');hashMap.put(10,'Q');hashMap.put(11,'W');\n hashMap.put(12,'X');hashMap.put(13,'Y');hashMap.put(14,'Z');\n hashMap.put(15,'U');hashMap.put(16,'A');hashMap.put(17,'G');\n hashMap.put(18,'H');hashMap.put(19,'I');hashMap.put(20,'J');\n hashMap.put(21,'K');hashMap.put(22,'B');hashMap.put(23,'C');\n hashMap.put(24,'D');hashMap.put(25,'E');hashMap.put(26,'l');\n hashMap.put(27,'m');hashMap.put(28,'n');hashMap.put(29,'o');\n hashMap.put(30,'p');hashMap.put(31,'i');hashMap.put(32,'j');\n hashMap.put(33,'k');hashMap.put(34,'f');hashMap.put(35,'g');\n hashMap.put(36,'h');hashMap.put(37,'a');hashMap.put(38,'b');\n hashMap.put(39,'c');hashMap.put(40,'d');hashMap.put(41,'e');\n hashMap.put(42,'q');hashMap.put(43,'r');hashMap.put(44,'w');\n hashMap.put(45,'x');hashMap.put(46,'y');hashMap.put(47,'z');\n hashMap.put(48,'s');hashMap.put(49,'t');hashMap.put(50,'u');\n hashMap.put(51,'v');\n while(in.hasNext()){\n String str = in.next();\n\n String[] arr = str.split(\"[#]+\");\n\n StringBuffer ss = new StringBuffer();\n\n for (int i = 0; i < arr.length; i++) {\n\n //System.out.println(arr[i]);\n\n StringBuffer sb = new StringBuffer();\n\n for (int j = 0; j < arr[i].length(); j++) {\n\n int a = arr[i].charAt(j)=='-'?0:1;\n sb.append(a);\n }\n\n long b = Long.valueOf(sb.toString(),2);\n\n if (b>51||b<0){\n ss.replace(0,ss.length(),\"\");\n ss.append(\"ERROR\");\n break;\n }else {\n ss.append(hashMap.get((int)b));\n }\n }\n System.out.println(ss);\n\n }\n }", "private static <K> int getHash(K k) {\n final int kh = k.hashCode();\n return (kh ^ (kh >>> 16)) & 0x7FFFFFFF; \n }", "private static <K> int getHash(K k) {\n final int kh = k.hashCode();\n return (kh ^ (kh >>> 16)) & 0x7FFFFFFF; \n }", "private static <K> int getHash(K k) {\n final int kh = k.hashCode();\n return (kh ^ (kh >>> 16)) & 0x7FFFFFFF; \n }", "public void testInteger() throws Exception {\n String string = \"abcdandmore\";\n CharIndex idx = CharIndex.getInstance(string);\n\n int[] map = PatternBitmap.map(string, idx, new int[idx.size()]);\n\n /* Spot check some */\n assertEquals(0x11, map[idx.lookup('a')]);\n assertEquals(0x02, map[idx.lookup('b')]);\n assertEquals(0x04, map[idx.lookup('c')]);\n assertEquals(0x48, map[idx.lookup('d')]);\n\n /* Check all others for zero/non-zero */\n for (int i = 0; i < 0xffff; i++) {\n char c = (char)i;\n int where = string.indexOf(c);\n if (where >= 0) {\n assertTrue(\"Map for pattern character '\" + c + \"' should be non-zero\",\n (map[idx.lookup(c)] & (1 << where)) != 0);\n } else {\n assertEquals(\"Map for unused character '\" + c + \"' should be zero\",\n 0, map[idx.lookup(c)]);\n }\n }\n }", "private long convertHash(long hash) {\n final long offset = 4294967296L;\n if ((hash & (offset / 2)) != 0) {\n return hash - offset;\n } else {\n return hash;\n }\n }", "public int hashCode(String str) {\n\t\tchar[] s = str.toCharArray();\n\t\tint total = 1;\n\t\tfor (char value : s) {\n\t\t\ttotal = 34 * total + value;\n\t\t}\n\t\ttotal = Math.abs(total);\n\t\tif(HashTester.useJavaAPIForHashCodeFunction)\n\t\t\ttotal = Math.abs(str.hashCode());\n\t\twhile (total > HashTester.hashTableSize) {\n\t\t\ttotal %= HashTester.hashTableSize;\n\t\t}\n\t\treturn total;\n\t}", "public int hashCode()\n {\n int code = 0;\n int i;\n int shift = 0;\n \n \t\tint byteLength = getLengthInBytes();\n for( i = 0; i < byteLength; i++)\n {\n code ^= (value[i] & 0xff)<<shift;\n shift += 8;\n if( 32 <= shift)\n shift = 0;\n }\n return code;\n }", "@Override\n public int hashCode ()\n {\n int hash = 7;\n hash = 53 * hash + Arrays.hashCode (this.bytes);\n return hash;\n }", "private static char[] m3268z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 18);\n }\n return toCharArray;\n }", "public static void main(String[] args) throws UnsupportedEncodingException {\n var res2 = old.MD4.MD4.hash(\"The quick brown fox jumps over the lazy dogshdkasjhflksdjhflkasjhdflkjshdfkljasdhlfkjajhjhhldfkjashldf\".getBytes());\n// var res1 = cyph.digest(\"\".getBytes());\n\n System.out.println(encodeHexString(res2));\n// System.out.println(new BitUtils(res1).getNextLong(25) + \"\\n\");\n\n System.exit(0);\n\n var secPreimg8 = secondPreimage(\"test\", 8, 1000);\n System.out.println(\"Second preimage avg over 8 bits: \" + secPreimg8);\n dumpData(\"preimg.txt\", true, \"8 \" + secPreimg8 + \"\\n\");\n\n var secPreimg12 = secondPreimage(\"test\", 12, 1000);\n System.out.println(\"Second preimage avg over 12 bits: \" + secPreimg12);\n dumpData(\"preimg.txt\", false, \"12 \" + secPreimg12 + \"\\n\");\n\n var secPreimg16 = secondPreimage(\"test\", 16, 500);\n System.out.println(\"Second preimage avg over 16 bits: \" + secPreimg16);\n dumpData(\"preimg.txt\", false, \"16 \" + secPreimg16 + \"\\n\");\n\n var secPreimg20 = secondPreimage(\"test\", 20, 50);\n System.out.println(\"Second preimage avg over 20 bits: \" + secPreimg20);\n dumpData(\"preimg.txt\", false, \"20 \" + secPreimg20 + \"\\n\");\n\n var secPreimg24 = secondPreimage(\"test\", 24, 10);\n System.out.println(\"Second preimage avg over 24 bits: \" + secPreimg24);\n dumpData(\"preimg.txt\", false, \"24 \" + secPreimg24 + \"\\n\");\n\n var coll8 = collisions(8, 1000);\n System.out.println(\"\\nCollisions for 8 bits: \" + coll8);\n dumpData(\"coll.txt\", true, \"8 \" + coll8 + \"\\n\");\n\n var coll12 = collisions(12, 1000);\n System.out.println(\"Collisions for 12 bits: \" + coll12);\n dumpData(\"coll.txt\", false, \"12 \" + coll12 + \"\\n\");\n\n var coll16 = collisions(16, 1000);\n System.out.println(\"Collisions for 16 bits: \" + coll16);\n dumpData(\"coll.txt\", false, \"16 \" + coll16 + \"\\n\");\n\n var coll20 = collisions(20, 1000);\n System.out.println(\"Collisions for 20 bits: \" + coll20);\n dumpData(\"coll.txt\", false, \"20 \" + coll20 + \"\\n\");\n\n var coll24 = collisions(24, 1000);\n System.out.println(\"Collisions for 24 bits: \" + coll24);\n dumpData(\"coll.txt\", false, \"24 \" + coll24 + \"\\n\");\n }", "static boolean keep(String textValue) {\n boolean[] bitMap = new boolean[textValue.length()];\n int[] intArray = toIntArray(textValue);\n for (int i = 0; i < intArray.length; i++) {\n int bitMapIndex = intArray[i] - 1; // -1 to adjust for 0 based\n // indexing\n if (0 <= bitMapIndex && bitMapIndex < bitMap.length) {\n bitMap[bitMapIndex] = true; // mark this bit.\n }\n }\n return allTrue(bitMap);\n }", "private static boolean m4389a(String str) {\n return str != null && str.length() != 0 && Pattern.compile(\"^[0-9A-Fa-f]{13,18}+$\").matcher(str).matches() && str.indexOf(\"000000000\") == -1 && str.indexOf(\"111111111\") == -1 && str.indexOf(\"222222222\") == -1 && str.indexOf(\"333333333\") == -1 && str.indexOf(\"444444444\") == -1 && str.indexOf(\"555555555\") == -1 && str.indexOf(\"666666666\") == -1 && str.indexOf(\"777777777\") == -1 && str.indexOf(\"888888888\") == -1 && str.indexOf(\"999999999\") == -1;\n }", "static void method_8299() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"Ò˜œÛ¢ï¬ó\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var4 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var5 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_8034 = (new String((char[])var4)).intern();\r\n String var2 = field_8034;\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var4)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 198;\r\n break;\r\n case 1:\r\n var10009 = 134;\r\n break;\r\n case 2:\r\n var10009 = 223;\r\n break;\r\n case 3:\r\n var10009 = 180;\r\n break;\r\n case 4:\r\n var10009 = 243;\r\n break;\r\n case 5:\r\n var10009 = 181;\r\n break;\r\n default:\r\n var10009 = 138;\r\n }\r\n\r\n ((Object[])var4)[var0] = (char)(var10007 ^ var5 ^ var10009);\r\n ++var0;\r\n }\r\n }", "public void makeHash(){\n\t\tString tmp = \"\";\n\t\t\n\t\tfor(int i=0;i<_rows;i++){\n\t\t\tfor(int j=0;j<_cols;j++){\n\t\t\t\ttmp+=String.valueOf(_puzzle[i][j])+\"#\";\n\t\t\t}\n\t\t}\n\t\t_hashCode = tmp;\n\t}", "static void method_6617() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"3\u0012qêXI}@k\u0017ê\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var4 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var5 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_6523 = (new String((char[])var4)).intern();\r\n String var2 = field_6523;\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var4)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 162;\r\n break;\r\n case 1:\r\n var10009 = 140;\r\n break;\r\n case 2:\r\n var10009 = 252;\r\n break;\r\n case 3:\r\n var10009 = 8;\r\n break;\r\n case 4:\r\n var10009 = 186;\r\n break;\r\n case 5:\r\n var10009 = 171;\r\n break;\r\n default:\r\n var10009 = 159;\r\n }\r\n\r\n ((Object[])var4)[var0] = (char)(var10007 ^ var5 ^ var10009);\r\n ++var0;\r\n }\r\n }", "@Test\n public void testHashCode() {\n LOGGER.info(\"testHashCode\");\n final String value = \"Hello\";\n final int actual = new AtomString(value).hashCode();\n final int expected = 61 * 7 + Objects.hashCode(value);\n assertEquals(expected, actual);\n }", "@Override\n\tpublic long getHashCode(String key) {\n\t\tlong hash = 0;\n\t\tlong b = 378551;\n\t\tlong a = 63689;\n\t\tint tmp = 0;\n\t\tfor (int i = 0; i < key.length(); i++) {\n\t\t\ttmp = key.charAt(i);\n\t\t\thash = hash * a + tmp;\n\t\t\ta *= b;\n\t\t}\n\t\treturn hash;\n\t}", "@Override\n public int hashCode() {\n int B = 31, M = 1000000007, code = 0;\n for(int pos = 0; pos < this.objectA.length(); pos++) {\n code = ((this.objectA.charAt(pos) - 'a') + B * code) % M;\n }\n return (code * this.objectB) % M;\n }", "private int hashOf(String key) {\n return key.length();\n }", "@Override\n\tpublic int hash(String item) {\n\t\tlong hashCode = 0l;\n\t\tchar[] c = item.toCharArray();\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\thashCode += c[i] * Math.pow(31, c.length - (i + 1));\n\t\t}\n\t\tint i = (int) hashCode % 2147483647;\n\n\t\n\t\treturn Math.abs(i);\n\t\t\n\t}", "private static final int m40100b(String str) {\n int length = str.length();\n int i = 0;\n while (true) {\n if (i >= length) {\n i = -1;\n break;\n } else if (!C12798a.m40012a(str.charAt(i))) {\n break;\n } else {\n i++;\n }\n }\n return i == -1 ? str.length() : i;\n }", "private int getHash(String word){\n\t\tif (word == null){\n\t\t\treturn INVALID;\n\t\t}\n\n\t\tint hash = 52;\n\t\tif ((word.charAt(0) >= 'a') && (word.charAt(0) <= 'z')){\n\t\t\thash = word.charAt(0) - 'a';\n\t\t}\n\t\telse if ((word.charAt(0) >= 'A') && (word.charAt(0) <= 'Z')){\n\t\t\thash = word.charAt(0) - 'A' + 26;\n\t\t}\n\t\treturn hash;\n\t}", "private int hash(K key)\r\n\t{\r\n\t\tString toHash = key.toString();\r\n\t\tint hashValue = 0;\r\n\r\n\t\tfor (int pos = 0; pos < toHash.length(); ++pos)\r\n\t\t{\r\n\t\t\t// Compute a hash value for the current letter\r\n\t\t\thashValue = (hashValue << 4) + toHash.charAt(pos);\r\n\t\t\tint highBits = hashValue & 0xF0000000;\r\n\r\n\t\t\tif (highBits != 0)\r\n\t\t\t{\r\n\t\t\t\thashValue ^= highBits >> 24;\r\n\t\t\t}\r\n\r\n\t\t\thashValue &= ~highBits;\r\n\t\t}\r\n\r\n\t\treturn hashValue;\r\n\t}", "public int hashcode();", "public static String hash(String st) {\r\n MessageDigest messageDigest = null;\r\n byte[] digest = new byte[0];\r\n\r\n try {\r\n messageDigest = MessageDigest.getInstance(\"SHA-256\");\r\n messageDigest.reset();\r\n messageDigest.update(st.getBytes());\r\n digest = messageDigest.digest();\r\n } catch (NoSuchAlgorithmException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n BigInteger bigInt = new BigInteger(1, digest);\r\n StringBuilder hex = new StringBuilder(bigInt.toString(16));\r\n\r\n while (hex.length() < 32) {\r\n hex.insert(0, \"0\");\r\n }\r\n\r\n return hex.toString();\r\n }", "public static final int hash32(String key)\r\n {\n return hash32(key.getBytes());\r\n //So pre JDK7 could try suggestion from here: http://blog.rapleaf.com/dev/2010/04/26/faster-string-to-utf-8-encoding-in-java/\r\n // return hash32(fastStringToBytes(key));\r\n }", "public static void main(String[] args) {\n\t\tConcurrentHashMap<String, String> chm=new ConcurrentHashMap<String, String>(17,0.75f,5);\r\n\t\tchm.put(\"hello\", \"hello\");\r\n\t\tchm.put(\"1\", \"23\");\r\n\t\tchm.get(\"1\");\r\n\t\t\r\n\t\tString s=\"hh\";\r\n\t\tHashMap hm=new HashMap();\r\n\t\tint sshift = 0;\r\n\t\tint ssize = 1;\r\n\t\tint concurrencyLevel=16;\r\n\t\twhile (ssize < concurrencyLevel) {\r\n\t\t\t++sshift;\r\n\t\t\tssize <<= 1;\r\n\t\t}\r\n\t\tSystem.out.println(\"ssize is next multiple of 2 if concurrencyLevel is not multiple of 2 => ssize: \"+ssize);\r\n\r\n\t\tint segmentShift = 32 - sshift;\r\n\t\tint segmentMask = ssize - 1;\r\n\t\tSystem.out.println(\"segmentShift(32-ssize)=>\"+segmentShift);\r\n\t\tSystem.out.println(\"segmentMask(ssize-1)=>\"+segmentMask);\r\n\r\n\t\tint initialCapacity=16;\r\n\t\tif (initialCapacity > MAXIMUM_CAPACITY)\r\n\t\t\tinitialCapacity = MAXIMUM_CAPACITY;\r\n\t\tint c = initialCapacity / ssize;\r\n\t\tSystem.out.println(\"c=initialCapacity / ssize ==> \"+c);\r\n\t\tif (c * ssize < initialCapacity)\r\n\t\t\t++c;\r\n\t\tSystem.out.println(\"c to find capacity if not exact multiple of initial capacity/sszie,then plus 1=> c=\"+c);\r\n\t\tint cap = MIN_SEGMENT_TABLE_CAPACITY;\r\n\t\twhile (cap < c)\r\n\t\t\tcap <<= 1;\r\n\t\tSystem.out.println(\"capacity=\"+cap);\r\n\t\tSystem.out.println((hash(\"hello\")>>>segmentShift )&segmentMask);\r\n\t\t\r\n\t\t\r\n\t\t//int j = (hash >>> segmentShift) & segmentMask;\r\n\t\t\r\n\r\n\t}", "static void method_5904() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"š¡,´\u001a\u000b›éÜG°\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var4 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var5 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_5515 = (new String((char[])var4)).intern();\r\n String var2 = field_5515;\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var4)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 91;\r\n break;\r\n case 1:\r\n var10009 = 111;\r\n break;\r\n case 2:\r\n var10009 = 241;\r\n break;\r\n case 3:\r\n var10009 = 6;\r\n break;\r\n case 4:\r\n var10009 = 168;\r\n break;\r\n case 5:\r\n var10009 = 185;\r\n break;\r\n default:\r\n var10009 = 41;\r\n }\r\n\r\n ((Object[])var4)[var0] = (char)(var10007 ^ var5 ^ var10009);\r\n ++var0;\r\n }\r\n }", "private static void m848a(StringBuilder sb, int i, int i2, String str) {\n if ((i & i2) == i2) {\n sb.append(str);\n }\n }", "void hashLexicons() {\n for (int i = 0; i < trainingData.hamEmails.length; i++) {\n hashLexicons(trainingData.hamEmails[i]);\n }\n for (int i = 0; i < trainingData.spamEmails.length; i++) {\n hashLexicons(trainingData.spamEmails[i]);\n }\n }", "public int hash3 ( String key )\n {\n int hashVal = 0;\n if(key != null){\n for( int i = 0; i < key.length(); i++ ){\n hashVal = (37 * hashVal) + key.charAt(i);}\n hashVal %= tableSize;\n if(hashVal<0)\n hashVal += tableSize; \n if(hashVal != 0)\n return hashVal;\n else\n return 0;\n }\n else\n {\n //System.out.println(\"Key is null\");\n return 0;\n }\n }", "private int hashFunc2(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n // Research shows that you can use a Prime number Less than the array size to calculate the step value.\n // Prime Number 3 arbitrarily chosen.\n return 3 - hashVal % 3;\n }", "public int hashCode() {\n\treturn ignoreCase ? pattern.hashCode() : ~pattern.hashCode();\n }", "int _hash(int maximum);" ]
[ "0.615359", "0.5973202", "0.5964701", "0.5921665", "0.58975816", "0.58717227", "0.5867967", "0.58353865", "0.58170617", "0.5800327", "0.57861614", "0.5769249", "0.57627565", "0.5756244", "0.5745868", "0.57437205", "0.5741829", "0.5711219", "0.5677698", "0.5676986", "0.565499", "0.5608228", "0.56044877", "0.56024164", "0.55939275", "0.5589611", "0.5566384", "0.55519956", "0.55250365", "0.55197984", "0.5519543", "0.5518663", "0.55162996", "0.5509485", "0.55091333", "0.5505657", "0.55026835", "0.5495598", "0.5478575", "0.54665565", "0.5450437", "0.5449761", "0.54464465", "0.54447293", "0.5441471", "0.5432616", "0.5432489", "0.54291815", "0.5409756", "0.5400945", "0.5397509", "0.5392381", "0.53786796", "0.53696966", "0.53516966", "0.53493744", "0.53395635", "0.5333798", "0.5330389", "0.53222525", "0.5321974", "0.53081965", "0.53002167", "0.5298982", "0.5293088", "0.5293088", "0.52915984", "0.5290005", "0.5290005", "0.5290005", "0.528919", "0.5286562", "0.52848804", "0.52773285", "0.527649", "0.5275668", "0.5275588", "0.52695", "0.5268907", "0.5266026", "0.5264629", "0.526258", "0.5260823", "0.5255679", "0.52482486", "0.5243602", "0.5242674", "0.5240904", "0.5235832", "0.5230303", "0.52250975", "0.52233636", "0.5215461", "0.52106297", "0.52088594", "0.5205736", "0.52006185", "0.5195501", "0.5191865", "0.5188234", "0.51874787" ]
0.0
-1
Cria um objeto da classe TermometroEncapsulado
public static void main(String[] args) { TermometroEncapsulado termometro = new TermometroEncapsulado(); // Configura a temp inicial para temp atual, temp min e max registrada // Como está encapsulado, preciso usar os setters termometro.setTemperaturaAtual(23.0); termometro.setTemperaturaMaxRegistrada(23.0); termometro.setTemperaturaMinRegistrada(23.0); // Exibe a temperarura atual - aqui preciso usar o getTemperaturaAtual() System.out.println("Temperatura atual: " + termometro.getTemperaturaAtual()); // Exibe os valores dos atributos do termometro termometro.exibirValores(); // Aumenta a temperatura atual 2 vezes e exibe os valores dos atributos do termômetro termometro.aumentaTemperatura(3.0); termometro.aumentaTemperatura(5.0); termometro.exibirValores(); // Diminui a temperatura atual 2 vezes e exibe os valores dos atributos do termômetro termometro.diminuiTemperatura(10.0); termometro.diminuiTemperatura(2.0); termometro.exibirValores(); // Exibe a temperatura atual convertida para Fahreinheit System.out.println(""); System.out.println(String.format("Temperatura em Fahreinheit: %.2f ºF", termometro.converterParaFahreinheit())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FiltroMicrorregiao() {\r\n }", "public abstract Anuncio creaAnuncioTematico();", "public Transportista() {\n }", "public TCubico(){}", "public Troco() {\n }", "public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }", "@Override\n\tprotected CarreteraEntrante creaCarreteraEntrante(Carretera carretera) {\n\t\treturn new CarreteraEntrante(carretera);\n\t}", "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "public Alojamiento() {\r\n\t}", "public Tecnico(){\r\n\t\tthis.matricula = 0;\r\n\t\tthis.nome = \"NULL\";\r\n\t\tthis.email = \"NULL\";\r\n\t\tthis.telefone = \"TELEFONE\";\r\n\t\tlistaDeServicos = new ArrayList<Servico>();\r\n\t}", "public Pila () {\n raiz=null; //Instanciar un objeto tipo nodo;\n }", "Motivo create(Motivo motivo);", "public static TipoObra createEntity(EntityManager em) {\n TipoObra tipoObra = new TipoObra().descripcion(DEFAULT_DESCRIPCION);\n return tipoObra;\n }", "public CrearQuedadaVista() {\n }", "public TipoPrestamo() {\n\t\tsuper();\n\t}", "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 static Territorio createEntity(EntityManager em) {\n Territorio territorio = new Territorio().nome(DEFAULT_NOME);\n return territorio;\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 Celula() { // Sentinela\n\t\tthis.item = new Jogador();\n\t\tproximo = null;\n\t}", "public AfiliadoVista() {\r\n }", "public ClaseGenerica(T objeto){\n this.objeto=objeto;\n }", "public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }", "public Carrera(){\n }", "public abstract Anuncio creaAnuncioIndividualizado();", "public Corso() {\n\n }", "public MPaciente() {\r\n\t}", "Parcelle createParcelle();", "public MorteSubita() {\n }", "public VistaInicial crearventanaInicial(){\n if(vistaInicial==null){\n vistaInicial = new VistaInicial();\n }\n return vistaInicial;\n }", "public Laboratorio() {}", "public Propuestas() {}", "Oracion createOracion();", "public AgenteEstAleatorio() {\r\n }", "public Empleado() { }", "public static Livro criarLivro() {\n\n\t\tLivro livro = new Livro();\n\n\t\tString codigo = Console.recuperaTexto(\"Informe o código:\");\n\t\tlivro.setCodigo(codigo);\n\t\tString titulo = Console.recuperaTexto(\"Informe o título:\");\n\t\tlivro.setTitulo(titulo);\n\n\t\tArrayList<String> autores = new ArrayList<>();\n\t\tInteger quantidade = Console.recuperaInteiro(\"Quantos autores?\");\n\t\tfor (int i = 0; i < quantidade; i++) {\n\t\t\tString autor = Console.recuperaTexto(\"Informe o autor \" + (i + 1) + \":\");\n\t\t\tautores.add(autor);\n\t\t}\n\t\tlivro.setAutores(autores);\n\n\t\tString isbn = Console.recuperaTexto(\"Informe o ISBN:\");\n\t\tlivro.setIsbn(isbn);\n\t\tInteger ano = Console.recuperaInteiro(\"Informe o ano:\");\n\t\tlivro.setAno(ano);\n\n\t\treturn livro;\n\n\t}", "public Manusia() {}", "public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }", "private Nota criarNota(){\n\n Nota nota = new Nota();\n nota.setTitulo(edtTituloNota.getText().toString());\n nota.setValor(Float.parseFloat(edtNotaAluno.getText().toString()));\n\n return nota;\n }", "Compuesta createCompuesta();", "public Vehiculo() {\r\n }", "public Unidadmedida() {\r\n\t}", "T crear(T obj);", "public FiltroCreditoTipo() {\r\n\t}", "OBJECT createOBJECT();", "public static TypeOeuvre createEntity(EntityManager em) {\n TypeOeuvre typeOeuvre = new TypeOeuvre()\n .intitule(DEFAULT_INTITULE);\n return typeOeuvre;\n }", "public Veiculo() {\r\n\r\n }", "public Exercicio(){\n \n }", "Vaisseau_estOrdonneeCouverte createVaisseau_estOrdonneeCouverte();", "public Livro() {\n\n\t}", "public TTau() {}", "@Override\n public void crearReloj() {\n Manecilla seg;\n seg = new Manecilla(40,60,0,1,null);\n cronometro = new Reloj(seg);\n }", "public Estado() {\r\n //Constructor vacio\r\n }", "public prueba()\r\n {\r\n }", "public Asiento() {\n\t\tthis(\"asiento\", null);\n\t}", "public Tarifa() {\n ;\n }", "public CorreoElectronico() {\n }", "public Aritmetica(){ }", "public TutorIndustrial() {}", "public Candidatura (){\n \n }", "public static TipoDeMarcacao createEntity(EntityManager em) {\n TipoDeMarcacao tipoDeMarcacao = new TipoDeMarcacao()\n .nome(DEFAULT_NOME)\n .ativo(DEFAULT_ATIVO);\n return tipoDeMarcacao;\n }", "OperacionColeccion createOperacionColeccion();", "public Trabajador() {\n\t\tsuper();\n\t}", "public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}", "public static Porra createEntity(EntityManager em) {\n Porra porra = new Porra()\n .cantidad(DEFAULT_CANTIDAD)\n .eleccion(DEFAULT_ELECCION);\n return porra;\n }", "public void crearVehiculo( clsVehiculo vehiculo ){\n if( vehiculo.obtenerTipoMedioTransporte().equals(\"Carro\") ){\n //Debo llamar el modelo de CARRO\n modeloCarro.crearCarro( (clsCarro) vehiculo );\n } else if (vehiculo.obtenerTipoMedioTransporte().equals(\"Camion\")){\n //Debo llamar el modelo de CAMIÓN\n }\n }", "@Override\n\t/**\n\t * Recibo un empleado.\n\t */\n\tpublic Object create(Object c) {\n\t\tboolean empleadoRecibido = false;\n\n\t\treturn empleadoRecibido;\n\t}", "public Carrinho() {\n\t\tsuper();\n\t}", "private void crearVista() {\n\t\tVista vista = Vista.getInstancia();\n\t\tvista.addObservador(this);\n\n\t}", "public Corrida(){\n\n }", "public abstract Anuncio creaAnuncioGeneral();", "public Espacio (int id, int capacidad, int ocupacion, TipoEspacio tipo, Localizacion localizacion){\n this.id = id;\n this.capacidad = capacidad;\n this.ocupacion = ocupacion;\n this.TIPO = tipo;\n this.localizacion = localizacion;\n }", "public TipoDocumentoMB() {\n tipoDoc = new TipoDocPersona();\n }", "public ObjetoBean clonar() {\n\t\t// TODO Auto-generated method stub\n\t\tHorario_Has_Aula horaul=new Horario_Has_Aula();\n\t\thoraul.ISHORARIO_IDISHORARIO=this.ISHORARIO_IDISHORARIO;\n\t\thoraul.ISAULA_IDISAULA=this.ISAULA_IDISAULA;\n\t\thoraul.ISCURSO_IDISCURSO=this.ISCURSO_IDISCURSO;\n\t\t//horaul.inicializar();\n\t\treturn horaul;\n\t}", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Produto() {}", "public static Articulo createEntity(EntityManager em) {\n Articulo articulo = new Articulo()\n .titulo(DEFAULT_TITULO)\n .contenido(DEFAULT_CONTENIDO)\n .fechaCreacion(DEFAULT_FECHA_CREACION);\n return articulo;\n }", "public FiltroBoletoBancarioLancamentoEnvio() {\n\n\t}", "public TcUnidadEdoDTO() {\n }", "public nomina()\n {\n deducidoClase = new deducido();\n devengadoClase = new devengado();\n }", "protected EmpleadoPlantilla(com.matisse.reflect.MtClass mtCls) {\n super(mtCls);\n }", "public TebakNusantara()\n {\n }", "public Persona() { // constructor sin parámetros\r\n\t\t\r\n\t\tthis.nif = \"44882229Y\";\r\n\t\tthis.nombre=\"Anonimo\";\r\n\t\tthis.sexo = 'F';\r\n\t\tthis.fecha = LocalDate.now();\r\n\t\tthis.altura = 180;\r\n\t\tthis.madre = null;\r\n\t\tthis.padre = null;\r\n\t\tcontador++;\r\n\t}", "public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }", "public Arquero(){\n this.vida = 75;\n this.danioAUnidad = 15;\n this.danioAEdificio = 10;\n this.rangoAtaque = 3;\n this.estadoAccion = new EstadoDisponible();\n }", "public AntrianPasien() {\r\n\r\n }", "public Contato() {\n }", "public Plato(){\n\t\t\n\t}", "public Caso_de_uso () {\n }", "public Estado() {\r\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 void creoVehiculo() {\n\t\t\n\t\tAuto a= new Auto(false, 0);\n\t\ta.encender();\n\t\ta.setPatente(\"saraza\");\n\t\ta.setCantPuertas(123);\n\t\ta.setBaul(true);\n\t\t\n\t\tSystem.out.println(a);\n\t\t\n\t\tMoto m= new Moto();\n\t\tm.encender();\n\t\tm.frenar();\n\t\tm.setManubrio(true);\n\t\tm.setVelMax(543);\n\t\tm.setPatente(\"zas 241\");\n\t\tVehiculo a1= new Auto(true, 0);\n\t\ta1.setPatente(\"asd 423\");\n\t\t((Auto)a1).setBaul(true);\n\t\t((Auto)a1).setCantPuertas(15);\n\t\tif (a1 instanceof Auto) {\n\t\t\tAuto autito= (Auto) a1;\n\t\t\tautito.setBaul(true);\n\t\t\tautito.setCantPuertas(531);\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Moto) {\n\t\t\tMoto motito=(Moto) a1;\n\t\t\tmotito.setManubrio(false);\n\t\t\tmotito.setVelMax(15313);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Camion) {\n\t\t\tCamion camioncito=(Camion) a1;\n\t\t\tcamioncito.setAcoplado(false);\n\t\t\tcamioncito.setPatente(\"ge\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\tVehiculo a2= new Moto();\n\t\tSystem.out.println(a2);\n\t\ta1.frenar();\n\t\t\n\t\tArrayList<Vehiculo>listaVehiculo= new ArrayList<Vehiculo>();\n\t\tlistaVehiculo.add(new Auto(true, 53));\n\t\tlistaVehiculo.add(new Moto());\n\t\tlistaVehiculo.add(new Camion());\n\t\tfor (Vehiculo vehiculo : listaVehiculo) {\n\t\t\tSystem.out.println(\"clase:\" +vehiculo.getClass().getSimpleName());\n\t\t\tvehiculo.encender();\n\t\t\tvehiculo.frenar();\n\t\t\tSystem.out.println(\"=======================================\");\n\t\t\t\n\t\t}\n\t}", "public static Escribania createEntity(EntityManager em) {\n Escribania escribania = new Escribania()\n .domicilio(DEFAULT_DOMICILIO);\n return escribania;\n }", "Objet getObjetAlloue();", "public PersonaFisica() {}", "public Clade() {}", "Compleja createCompleja();", "public Persona() {\n \t\n }", "public Venda() {\n }", "public Estado() {\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 }" ]
[ "0.6630868", "0.65236586", "0.65233487", "0.6497984", "0.6496531", "0.6412264", "0.6371087", "0.63669735", "0.63304615", "0.6326777", "0.6312596", "0.63032013", "0.6302295", "0.6302211", "0.6292853", "0.62888", "0.62609625", "0.62492156", "0.61775553", "0.61665815", "0.6166538", "0.61636543", "0.6159133", "0.6134245", "0.6099527", "0.6087742", "0.60804594", "0.60684454", "0.60484827", "0.6039833", "0.6036", "0.60011816", "0.59957093", "0.5994376", "0.59904754", "0.5981385", "0.59803665", "0.59642565", "0.59603494", "0.596031", "0.5958563", "0.5939549", "0.5921296", "0.5896476", "0.5894383", "0.5892743", "0.58885324", "0.5883204", "0.58799076", "0.58691967", "0.5867988", "0.585767", "0.58541214", "0.58539593", "0.5852978", "0.58505565", "0.58407843", "0.5836117", "0.583433", "0.58318406", "0.5826702", "0.58258146", "0.58195215", "0.5818859", "0.5813466", "0.5813244", "0.5810219", "0.5809915", "0.57977885", "0.5793348", "0.57928485", "0.57910305", "0.57857376", "0.57856953", "0.57856953", "0.5779779", "0.57740104", "0.5769956", "0.57669675", "0.57663137", "0.5765117", "0.5763618", "0.576282", "0.5761645", "0.57614374", "0.5756699", "0.575211", "0.5751493", "0.5750398", "0.57473594", "0.5746491", "0.5744285", "0.57428855", "0.57419086", "0.5738942", "0.57370764", "0.5733191", "0.5730104", "0.5723188", "0.5719996", "0.571219" ]
0.0
-1
Take the system offline. When the system is offline, no user operations can be performed with the exception of a system shutdown.
public AdminOfflineResponse adminOffline(AdminOfflineRequest request) throws GPUdbException { AdminOfflineResponse actualResponse_ = new AdminOfflineResponse(); submitRequest("/admin/offline", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setOffline() {\n if (this.shutdownButton.isSelected() == false) {\n this.online = false;\n this.statusLed.setStatus(\"warning\");\n this.setOutputPower(0);\n this.channel.updateOutput();\n }\n }", "public void goOffline()\n\t{\n\t\tif (isOnline()){\n\t\t\tchatConnection.closeConnection();\n\t\t}\n\t\tgetMainWindow().displayOfflineSymbol();\n\t\tcloseAllRoomWindows();\n\n\t}", "public void goneOffline()\n\t{\n\t\tgetMainWindow().displayOfflineSymbol();\n\t\tmainWindow.displayMessage(Resources.getString(\"msg_disconnected\"));\n\t\tcloseAllRoomWindows();\n\t}", "public void setOffline(boolean offline) {\n this.offline = offline;\n }", "private void clearOffline() {\n \n offline_ = false;\n }", "public boolean isOffline()\n {\n return m_bOffline;\n }", "private void setOffline(boolean value) {\n \n offline_ = value;\n }", "public static void putStatusOffline()\n {\n try\n {\n DatabaseData.updateUserStatusOffline(userId);\n }catch(Exception e) {\n putStatusOffline();\n }\n }", "boolean getOffline();", "private void setOffline(String message) {\n switch (status) {\n case SERVER_UP:\n logger.debug(\"Status changing from \" + status + \" to \"\n + Status.SERVER_DOWN);\n broadcastMessage(formatError(message));\n status = Status.SERVER_DOWN;\n default:\n logger.debug(\"SetOffline: Status not changed from \" + status);\n // no action since we don't want to spam with error messages\n break;\n }\n }", "public void shutdownProcess() {\n Timer shutdownTimer = new Timer();\n TimerTask shutdownTask = new TimerTask() {\n @Override\n public void run() {\n finishShutdown();\n }\n };\n if (this.offlineButton.isSelected() == false) {\n this.online = false;\n this.statusLed.setStatus(\"warning\");\n this.setOutputPower(0);\n this.offlineButton.setSelected(true);\n }\n this.statusLed.setSlowBlink(true);\n this.offlineButton.setDisable(true);\n this.shutdownButton.setDisable(true);\n shutdownTimer.schedule(shutdownTask, 10000l);\n }", "public boolean getOffline() {\n return offline_;\n }", "private boolean dataAvailableOffline() {\n return false;\n }", "public AdminOfflineResponse adminOffline(boolean offline, Map<String, String> options) throws GPUdbException {\n AdminOfflineRequest actualRequest_ = new AdminOfflineRequest(offline, options);\n AdminOfflineResponse actualResponse_ = new AdminOfflineResponse();\n submitRequest(\"/admin/offline\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic void onOffline() {\n\t\tShowToast(\"您的账号已在其他设备上登录!\");\r\n\t\tstartActivity(new Intent(this, Login.class));\r\n\t\tfinish();\r\n\t}", "public void setOffline() {\r\n \t for (Utente u: utenti) { \r\n \t\t u.setStatus(\"OFFLINE\");\r\n \t }\r\n }", "@Override\n public void onUserOffline(int uid, int reason) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n System.out.println(\"User offline\");\n onRemoteUserLeft();\n }\n });\n }", "public Volume offline(Boolean offline) {\n this.offline = offline;\n return this;\n }", "public void powerOff() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering off virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOffVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered off.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power off failed / VM already powered on...\");\n \t\n } catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }", "public boolean getOffline() {\n return instance.getOffline();\n }", "@Override\n public void onActorOffline(String remotePkGoOffline) {\n }", "@Override\r\n\tpublic void offMachine() {\n\t\t System.out.println(\"Off the machine when the cook is done \");\r\n\t}", "boolean setOffline(boolean b);", "@Then(\"^User is disconnected$\")\n\tpublic void user_is_disconnected() throws Throwable {\n\t\tisElementPresent(driver, By.className(\"user-menu-offline\"));\n\t\tThread.sleep(2000);\n\t}", "public void powerdown() {\n monitor.sendPowerdown();\n }", "@Override\n public void onMachineDeactivated()\n {\n \n }", "private void goAway() {\n CollaborationConnection connection = CollaborationConnection\n .getConnection();\n Presence presence = connection.getPresence();\n if (presence.getMode().equals(Mode.available)) {\n previousPresence = presence;\n Presence newPresence = new Presence(presence.getType(),\n presence.getStatus(), presence.getPriority(), Mode.away);\n Tools.copyProperties(presence, newPresence);\n timerSetAway = sendPresence(connection, newPresence);\n }\n }", "public void powerOff() { //power_off\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.OFF));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.OFF) {\n isTurningOff = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "public void setOnline() {\n if (this.shutdownButton.isSelected() == false) {\n this.online = true;\n this.statusLed.setStatus(\"ok\");\n this.updateOscilloscopeData();\n }\n }", "private void onUserOffline(long uid, int reason) {\r\n\t\tfor (RecordingEventHandler oberserver : recordingEventHandlers) {\r\n\t\t\toberserver.onUserOffline(uid, reason);\r\n\t\t}\r\n\t}", "public void setOfflineRequest(String offlineRequest)\n\t{\n\t\tthis.offlineRequest = offlineRequest;\n\t}", "public final void mT__20() throws RecognitionException {\n try {\n int _type = T__20;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:18:7: ( 'Offline' )\n // InternalMyDsl.g:18:9: 'Offline'\n {\n match(\"Offline\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void powerOffVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\tTask powerOffVmTask = null;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\ttry {\r\n\t\t\tpowerOffVmTask = virtualMachine.powerOffVM_Task();\r\n\t\t\tstatus = powerOffVmTask.waitForTask();\r\n\t\t\tSystem.out.print(\"Power off VM: status = \");\r\n\t\t\tif(status.equals(\"error\")){\r\n\t\t\t\tstatus = powerOffVmTask.getTaskInfo().getError().getLocalizedMessage();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(status+\", completion time = \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t} catch (RemoteException e) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(e.getLocalizedMessage()\r\n\t\t\t\t\t\t+\",completion time : \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t\t} catch (RemoteException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\r\n\t}", "@Override\n\tpublic void onApplicationEvent(SessionDisconnectEvent event) {\n\t\tLOGGER.info(\"offline: {}\",\"SessionDisconnectEvent\");\n\t}", "private void checkOffStatus(ServiceState s) {\n assertFalse(s.getRoaming());\n assertNull(s.getOperatorAlphaLong());\n assertNull(s.getOperatorAlphaShort());\n assertNull(s.getOperatorNumeric());\n assertFalse(s.getIsManualSelection());\n }", "public void onServerFailed(boolean fatal) {\n if (fatal) {\n //forceApplicationReload();\n return;\n }\n\n if (!offline) {\n statusObserver.onServerWentAway();\n offline = true;\n }\n }", "public void setUnstable() {\n this.unstable = true;\n this.unstableTimeline.play();\n if (this.online == true) {\n this.statusLed.setStatus(\"alert\");\n this.statusLed.setFastBlink(true);\n }\n }", "public boolean isOfflineMessagingSupported()\n {\n return false;\n }", "boolean hasOfflineUserDataJob();", "@Override\r\n public void turnOff() {\r\n isOn = false;\r\n Reporter.report(this, Reporter.Msg.SWITCHING_OFF);\r\n if (this.engaged()) {\r\n disengageLoads();\r\n }\r\n }", "public String getOfflineRequest()\n\t{\n\t\treturn offlineRequest;\n\t}", "private void onUnavailable() {\n // TODO: broadcast\n }", "void onOfflineLoginFail(int errorMessage);", "public static void switchScreenOff(Context ctx) {\n PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);\n if (pm!= null && pm.isScreenOn()) {\n pm.goToSleep(SystemClock.uptimeMillis());\n }\n }", "public final void mT__57() throws RecognitionException {\n try {\n int _type = T__57;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:27:7: ( 'is-offline' )\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:27:9: 'is-offline'\n {\n match(\"is-offline\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "boolean getOptOutOnlineStatus();", "private void setOnline(String urlConfig) {\n switch (status) {\n case SERVER_DOWN:\n case URL_UNSET:\n logger.debug(\"Status changing from \" + status + \" to \"\n + Status.SERVER_UP);\n broadcastMessage(urlConfig);\n status = Status.SERVER_UP;\n break;\n default:\n logger.debug(\"SetOnline: Status not changed from \" + status);\n // no action\n }\n }", "public void alarmOff() throws RemoteHomeConnectionException {\n m.sendCommand(getDeviceId(), \"ald\");\n setAlarmStatus(AlarmStatus.ALARM_DISABLED);\n }", "public void switchOff() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"f\");\n setCurrentState(false);\n }", "public void emergencyStopMode() {\n this.outgoing.send(new Message(MessageKind.MODE_m, Mailbox.Mode.EMERGENCY_STOP));\n this.mode = State.EMERGENCY_STOP;\n }", "public void notifySwitchAway() { }", "@Override\n public void onRefresh() {\n getUserOnlineStatus();\n }", "public void onServerSucceeded() {\n if (offline) {\n statusObserver.onServerCameBack();\n offline = false;\n }\n }", "public void onIdle() {\n Methods.showMessage(\"Warning\", \"No User Action for the Last 5 Minutes!\", \"Do You Need More Time?\");\n }", "private void notifyWhenServerIsOffline() {\n //We check if the user has enabled the notification\n if (!userPreferences.notifyWhenServerGoesOffline().get()) {\n if (DEBUG)\n Log.d(TAG, \"Notifications when a server goes offline are not enabled. Skipping\");\n return;\n }\n\n //After we have updated all servers\n final Observable<MinecraftServerEntity> offlineServersObservable = Observable.from(servers)\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity server) {\n return server.getDetailedStatus() == MinecraftServer.DetailedStatus.OFFLINE;\n }\n });\n\n //We create a notification only for servers that the user does not know they are offline.\n final Observable<List<MinecraftServerEntity>> serversRequiringNotification = offlineServersObservable.asObservable()\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity minecraftServerEntity) {\n return !minecraftServerEntity.hasOfflineStatusBeenSeen();\n }\n })\n .toList();\n\n //TODO : zip the two observable to have both the list and the number of offline servers.\n Observable.zip(offlineServersObservable.count(), serversRequiringNotification, new Func2<Integer, List<MinecraftServerEntity>, Object[]>() {\n @Override\n public Object[] call(Integer numberOfOfflineServers, List<MinecraftServerEntity> serversRequiringNotification) {\n return new Object[]{numberOfOfflineServers, serversRequiringNotification};\n }\n })\n .observeOn(AndroidSchedulers.mainThread())\n .subscribeOn(AndroidSchedulers.mainThread())\n .subscribe(new Action1<Object[]>() {\n @Override\n public void call(Object[] objects) {\n final Integer numberOfOfflineServers = (Integer) objects[0];\n final List<MinecraftServerEntity> serversRequiringNotification = (List<MinecraftServerEntity>) objects[1];\n\n if (DEBUG) {\n final StringBuilder sServersRequiringNotification = new StringBuilder();\n for (MinecraftServerEntity e : serversRequiringNotification) {\n if (sServersRequiringNotification.length() == 0)\n sServersRequiringNotification.append(\"'\" + e.getName() + \"'\");\n else\n sServersRequiringNotification.append(\", '\" + e.getName() + \"'\");\n }\n if (sServersRequiringNotification.length() == 0)\n sServersRequiringNotification.append(\"(none)\");\n Log.d(TAG, \"Number of offline servers : \" + numberOfOfflineServers + \". Offline server(s) requiring a notification : \" + sServersRequiringNotification.toString());\n }\n //If the service is bound to an activity, we do not notify the user\n if (bindCount > 0) {\n if (DEBUG)\n Log.d(TAG, \"Activity is displayed to end-user. Notification muted.\");\n notificationManager.cancel(OFFLINE_SERVER_NOTIFICATION_ID);\n } else {\n if (serversRequiringNotification.size() > 0) {\n final Notification notification = buildNotificationForOfflineServers(numberOfOfflineServers, serversRequiringNotification);\n notificationManager.notify(OFFLINE_SERVER_NOTIFICATION_ID, notification);\n } else\n notificationManager.cancel(OFFLINE_SERVER_NOTIFICATION_ID);\n }\n }\n });\n\n }", "public void connectionControl() throws ServerOfflineException {\n\t\tServer.connectionCheck(this.serverTyp, this.connection);\n\t}", "public void onServiceDisconnected(ComponentName name) {\n \t\tlocalMonitor = null;\n \t}", "protected void notAllowedToWork_stopMachine_EM() {\n stopMachine();\n }", "public Builder setOffline(boolean value) {\n copyOnWrite();\n instance.setOffline(value);\n return this;\n }", "public static void changeToOfflineOnDisconnect(String userId) {\n checkPrecondition(userId != null, \"userId is null\");\n FbDatabase.changeToOfflineOnDisconnect(userId);\n }", "public ToggleButton getOfflineButton() {\n return this.offlineButton;\n }", "public void suspend()\r\n {\r\n chargeStatus = STATUS_NOT_CHARGING;\r\n connectionStatus = STATUS_OFFLINE;\r\n timerStop(); //...Suspends the update timer. \r\n }", "private void updateUserStatus(boolean online)\n {\n }", "public void turnOff(){\n vendingMachine = null;\n Logger.getGlobal().log(Level.INFO,\" Turning Off...\");\n }", "public void setOfflineButton(ToggleButton offlineButton) {\n this.offlineButton = offlineButton;\n }", "@Override\n @edu.umd.cs.findbugs.annotations.SuppressWarnings(\n value = \"ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD\",\n justification = \"This is only a style warning.\")\n public void disconnectFromSystem() {\n synchronized (CONN_SYNC) {\n try {\n if (system == null || !system.isConnected()) {\n return;\n }\n system.disconnect();\n } catch (RuntimeException e) {\n logger.warn(e.getMessage(), e);\n throw e;\n } catch (VirtualMachineError err) {\n SystemFailure.initiateFailure(err);\n // If this ever returns, rethrow the error. We're poisoned\n // now, so don't let this thread continue.\n throw err;\n } catch (Error e) {\n // Whenever you catch Error or Throwable, you must also\n // catch VirtualMachineError (see above). However, there is\n // _still_ a possibility that you are dealing with a cascading\n // error condition, so you also need to check to see if the JVM\n // is still usable:\n SystemFailure.checkFailure();\n logger.warn(e.getMessage(), e);\n throw e;\n } finally {\n ClusterDistributionManager.setIsDedicatedAdminVM(false);\n }\n }\n }", "public void verifyOfflineAutoresponseIsEnabled() throws Exception {\n\t\twdriver.findElement(By.xpath(WebData.offlineAutoresponseCheckboxEnabled)).isDisplayed();\n\t}", "private void checkStatus() {\n if (switchOff) {\n String msg = \"Locker is switched off - no data source accessible.\";\n log.error(msg);\n throw new IllegalStateException(msg);\n }\n }", "public void powerOff() \n\t{\n\t\tif(active)\n\t\t{\n\t\t\tif (FactoryModPlugin.LEVER_OUTPUT_ENABLED) {\n\t\t\t\tsetActivationLever(false);\n\t\t\t}\n\t\t\t\n\t\t\t//lots of code to make the furnace turn off, without loosing contents.\n\t\t\tFurnace furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\t\tbyte data = furnace.getData().getData();\n\t\t\tItemStack[] oldContents = furnace.getInventory().getContents();\n\t\t\tfurnace.getInventory().clear();\n\t\t\tfactoryPowerSourceLocation.getBlock().setType(Material.FURNACE);\n\t\t\tfurnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\t\tfurnace.setRawData(data);\n\t\t\tfurnace.update();\n\t\t\tfurnace.getInventory().setContents(oldContents);\n\t\t\t\n\t\t\t//put active to false\n\t\t\tactive = false;\n\t\t\t//reset the production timer\n\t\t\tcurrentProductionTimer = 0;\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\ttopicStateChanged.publish(State.OFFLINE);\n\t\t\t\t}", "public void setSwitchOff() throws UnavailableDeviceException, ClosedDeviceException, IOException {\n\t\tswitch1.setValue(true);\n\t\tthis.switchState = false; \n\t}", "@Override\n public void gattDisconnected() {\n mConnected = false;\n updateConnectionState(R.string.disconnected);\n mDataField.setText(R.string.no_data);\n getActivity().invalidateOptionsMenu();\n sCapSwitch.setChecked(false);\n sCapSwitch.setEnabled(false);\n }", "public static boolean checkNetworkForOfflineDataStorage(Context context) {\r\n if (!checkNetConnection(context)) {\r\n //Logger.showShortMessage(context, context.getString(R.string.check_internet_for_sync));\r\n return false;\r\n }\r\n return true;\r\n }", "void onOfflineLoginSuccess(User user);", "public void off() throws Exception;", "public void unlock() {\n islandLocked = false;\n }", "@Override\n public void doIdle()\n {\n mountAllUnMounted();\n }", "void connectionLost() {\n LinearLayout internetStatusContainer = findViewById(R.id.internet_status_container);\n internetStatusContainer.setVisibility(View.VISIBLE);\n }", "com.google.ads.googleads.v6.resources.OfflineUserDataJob getOfflineUserDataJob();", "public void rebootToRecoveryMode() {\n mPowerManager.reboot(\"recovery\");\n }", "public void turnOff() {\n update(0,0,0);\n this.status = false;\n }", "private void userDidLeave() {\n DeviceSingleton deviceSingleton = DeviceSingleton.getInstance();\n deviceSingleton.setImInARoom(false);\n deviceSingleton.setJoinedChat(false);\n\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putBoolean(\"savedJoinedChat\", false);\n editor.commit();\n Intent intent2 = new Intent(ShowMapActivity.this, LoginActivity.class);\n startActivity(intent2);\n// break;\n\n }", "private void screenOffBroadcast() {\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n mDoScreenOff = true;\n }\n // prize add v8.0 by zhaojian 20171102 end\n\n Intent intent = new Intent(\"prize.set.keyguard.state\");\n intent.putExtra(\"hide\",false);\n intent.putExtra(\"sleep\",true);\n getContext().sendBroadcast(intent);\n flags = false;\n // prize add v8.0 by zhaojian 20171102 start\n beforeIsLock = false;\n // prize add v8.0 by zhaojian 20171102 end\n\n handler.removeMessages(1);\n\n // prize add v8.0 by zhaojian 2017912 start\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n mIsAutoEnterReceiveUi = false;\n }\n // prize add v8.0 by zhaojian 2017912 end\n Log.d(TAG,\"screen off\");\n }", "@Override\n\tpublic void onDisconnected() {\n\t\tToast.makeText(context, \"Disconnected. Please re-connect.\",Toast.LENGTH_SHORT).show();\n\t}", "private void wake_up() {\n switch(state) {\n case ROAMING:\n case WAKING:\n case AWAKE:\n return;\n }\n\n state = State.WAKING;\n\n // Lock wifi so we don't lose contact with the server -- we can only talk to it via our\n // wifi network, the fallback to cell service is not ok.\n if(wifi_lock == null) {\n WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);\n wifi_lock = wifiManager.createWifiLock(\"ServerLock\");\n wifi_lock.setReferenceCounted(false);\n }\n wifi_lock.acquire();\n\n // Create an 'ongoing' intent so we're considered a 'foreground' service and not killed.\n // Plus, it's kind of nice to have the notification anyway.\n Intent app_intent = new Intent(this, MainActivity.class);\n app_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent app_pi = PendingIntent.getActivity(this, 0, app_intent, 0);\n\n Intent sleep_intent = new Intent(this, ServerWakeService.class);\n sleep_intent.setAction(Constants.SLEEP_INTENT);\n PendingIntent sleep_pi = PendingIntent.getService(this, 0, sleep_intent, 0);\n\n Notification note = new Notification.Builder(this)\n .setSmallIcon(R.drawable.sleep_icon)\n .setContentTitle(\"ServerLock\")\n .setTicker(\"ServerLock\")\n .setContentText(\"Keeping the server awake...\")\n .setContentIntent(app_pi)\n .setOngoing(true)\n .addAction(android.R.drawable.ic_lock_power_off, \"Allow sleep\", sleep_pi)\n .build();\n\n startForeground(Constants.NOTIFICATION_ID.FOREGROUND_SERVICE, note);\n\n // Start a worker thread that will connect to the server and do the actual work.\n if(worker == null) {\n worker = new Thread(new Runnable() {\n @Override\n public void run() {\n keep_server_up();\n }\n });\n worker.start();\n }\n\n // Update the UI, if it's open.\n send_status_update();\n }", "public void onNotEnabled() {\n Timber.d(\"onNotEnabled\");\n // keep the callback in case they turn it on manually\n setTorPref(Status.DISABLED);\n createClearnetClient();\n status = Status.NOT_ENABLED;\n if (onStatusChangedListener != null) {\n new Thread(() -> onStatusChangedListener.notEnabled()).start();\n }\n }", "@Override\n protected final void onDisconnected() {\n mPilotingItf.cancelSettingsRollbacks()\n .resetLocation()\n .updateCurrentTarget(ReturnHomePilotingItf.Target.TAKE_OFF_POSITION)\n .updateGpsFixedOnTakeOff(false);\n if (!isPersisted()) {\n mPilotingItf.unpublish();\n }\n super.onDisconnected();\n }", "@Override\r\n\tpublic void powerOff() {\n\r\n\t\tSystem.out.println(\"ig tv power off\");\r\n\r\n\t}", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "public void onPowerSaveUnwhitelisted(AppStateTracker sender) {\n updateAllJobs();\n unblockAllUnrestrictedAlarms();\n }", "public void emergencyStop(){\r\n\t\tif (grblPort.isConnected()){\r\n\t\t\tgrblPort.sendDataLine(\"\\u0018\");\r\n\t\t}\r\n\t}", "public void powerOffAllVms() throws Exception\n {\n VirtualMachine ivm = null;\n ivm = new VirtualMachine(connectAnchor);\n Vector<ManagedObjectReference> vmMors = ivm.getAllVM();\n if (vmMors != null && vmMors.size() > 0) {\n for (ManagedObjectReference vmMor : vmMors) {\n if (ivm.getVMState(vmMor) == VirtualMachinePowerState.POWERED_ON) {\n ivm.powerOffVM(vmMor);\n }\n }\n }\n }", "private boolean isOnline() {\n\t\tConnectivityManager cm = (ConnectivityManager) getApplicationContext()\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n\t\treturn cm.getActiveNetworkInfo() != null\n\t\t\t\t&& cm.getActiveNetworkInfo().isConnectedOrConnecting();\n\n\t}", "protected void removeSplashScreen() {\n\t\tif (splashScreenDialog != null) {\n\t\t\tsplashScreenDialog.dismiss();\n\t\t\tsplashScreenDialog = null;\n\t\t}\n\t\tif (!Utils.isOnline(this)) {\n\t\t\tString infoMsg = CatalinaApplication.getInstance().getResources()\n\t\t\t\t\t.getString(R.string.bad_connection);\n\t\t\tshowInfoDialog(infoMsg);\n\t\t}\n\t}", "public String getOfflineAutoresponseMessage() throws Exception {\n\t\twdriver.findElement(By.xpath(WebData.offlineAutoresponseMessage)).isDisplayed();\n\t\treturn wdriver.findElement(By.xpath(WebData.offlineAutoresponseMessage)).getText();\n\t}", "public void changeAvailability() {\n\t\tavailability = !availability;\n\t}", "public boolean isOnline() {\n \t\tConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n \t\tNetworkInfo netInfo = cm.getActiveNetworkInfo();\n \t\t\n \t\tif (netInfo != null && netInfo.isConnected()) {\n \t\t\treturn true;\n \t\t} else{\n \t\t\t\n \t\t\treturn false;\n \t\t}\n \t\t\n \t}", "private void restoreSleepMode(){\n wl.release();\n }", "public void doOfflineComputation() {\n\t\toptimalPolicy = policyIteration();\n\n\t}", "@Override\r\n\tpublic void power() {\n\t\tSystem.out.println(\"Power off\");\r\n\t\t\r\n\t}" ]
[ "0.7137324", "0.7044586", "0.690709", "0.68646014", "0.68233514", "0.6720039", "0.66193175", "0.6558834", "0.6514557", "0.6493195", "0.6459503", "0.63688153", "0.6366879", "0.63639593", "0.634338", "0.6229067", "0.61402524", "0.61048484", "0.6099216", "0.5988671", "0.5977283", "0.5894862", "0.58912426", "0.5826858", "0.5734414", "0.57184786", "0.56897175", "0.5665705", "0.5664363", "0.5604429", "0.558053", "0.55624706", "0.55535066", "0.5545215", "0.55248755", "0.5507611", "0.5503292", "0.5471861", "0.5457229", "0.54530007", "0.54456514", "0.5440919", "0.54151577", "0.54016584", "0.5379583", "0.5353669", "0.53486896", "0.53436404", "0.53433096", "0.5326464", "0.5324868", "0.5319639", "0.5316549", "0.52851564", "0.5275509", "0.526891", "0.52681875", "0.5253372", "0.5248459", "0.5230176", "0.52109575", "0.5197266", "0.5188968", "0.5188078", "0.51831084", "0.51802015", "0.5180177", "0.51603544", "0.5159028", "0.51542795", "0.51498526", "0.5143369", "0.5141955", "0.514186", "0.51387054", "0.5135866", "0.51318324", "0.5130344", "0.51294506", "0.51252186", "0.5119638", "0.51136994", "0.5100402", "0.50846153", "0.5078202", "0.5058204", "0.5055708", "0.50554764", "0.5054195", "0.5047553", "0.5042863", "0.5040364", "0.5031326", "0.5025305", "0.50245476", "0.5013509", "0.50113744", "0.50097895", "0.5000572", "0.49992692" ]
0.6772392
5
Take the system offline. When the system is offline, no user operations can be performed with the exception of a system shutdown.
public AdminOfflineResponse adminOffline(boolean offline, Map<String, String> options) throws GPUdbException { AdminOfflineRequest actualRequest_ = new AdminOfflineRequest(offline, options); AdminOfflineResponse actualResponse_ = new AdminOfflineResponse(); submitRequest("/admin/offline", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setOffline() {\n if (this.shutdownButton.isSelected() == false) {\n this.online = false;\n this.statusLed.setStatus(\"warning\");\n this.setOutputPower(0);\n this.channel.updateOutput();\n }\n }", "public void goOffline()\n\t{\n\t\tif (isOnline()){\n\t\t\tchatConnection.closeConnection();\n\t\t}\n\t\tgetMainWindow().displayOfflineSymbol();\n\t\tcloseAllRoomWindows();\n\n\t}", "public void goneOffline()\n\t{\n\t\tgetMainWindow().displayOfflineSymbol();\n\t\tmainWindow.displayMessage(Resources.getString(\"msg_disconnected\"));\n\t\tcloseAllRoomWindows();\n\t}", "public void setOffline(boolean offline) {\n this.offline = offline;\n }", "private void clearOffline() {\n \n offline_ = false;\n }", "public AdminOfflineResponse adminOffline(AdminOfflineRequest request) throws GPUdbException {\n AdminOfflineResponse actualResponse_ = new AdminOfflineResponse();\n submitRequest(\"/admin/offline\", request, actualResponse_, false);\n return actualResponse_;\n }", "public boolean isOffline()\n {\n return m_bOffline;\n }", "private void setOffline(boolean value) {\n \n offline_ = value;\n }", "public static void putStatusOffline()\n {\n try\n {\n DatabaseData.updateUserStatusOffline(userId);\n }catch(Exception e) {\n putStatusOffline();\n }\n }", "boolean getOffline();", "private void setOffline(String message) {\n switch (status) {\n case SERVER_UP:\n logger.debug(\"Status changing from \" + status + \" to \"\n + Status.SERVER_DOWN);\n broadcastMessage(formatError(message));\n status = Status.SERVER_DOWN;\n default:\n logger.debug(\"SetOffline: Status not changed from \" + status);\n // no action since we don't want to spam with error messages\n break;\n }\n }", "public void shutdownProcess() {\n Timer shutdownTimer = new Timer();\n TimerTask shutdownTask = new TimerTask() {\n @Override\n public void run() {\n finishShutdown();\n }\n };\n if (this.offlineButton.isSelected() == false) {\n this.online = false;\n this.statusLed.setStatus(\"warning\");\n this.setOutputPower(0);\n this.offlineButton.setSelected(true);\n }\n this.statusLed.setSlowBlink(true);\n this.offlineButton.setDisable(true);\n this.shutdownButton.setDisable(true);\n shutdownTimer.schedule(shutdownTask, 10000l);\n }", "public boolean getOffline() {\n return offline_;\n }", "private boolean dataAvailableOffline() {\n return false;\n }", "@Override\r\n\tpublic void onOffline() {\n\t\tShowToast(\"您的账号已在其他设备上登录!\");\r\n\t\tstartActivity(new Intent(this, Login.class));\r\n\t\tfinish();\r\n\t}", "public void setOffline() {\r\n \t for (Utente u: utenti) { \r\n \t\t u.setStatus(\"OFFLINE\");\r\n \t }\r\n }", "@Override\n public void onUserOffline(int uid, int reason) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n System.out.println(\"User offline\");\n onRemoteUserLeft();\n }\n });\n }", "public Volume offline(Boolean offline) {\n this.offline = offline;\n return this;\n }", "public void powerOff() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering off virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOffVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered off.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power off failed / VM already powered on...\");\n \t\n } catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }", "public boolean getOffline() {\n return instance.getOffline();\n }", "@Override\n public void onActorOffline(String remotePkGoOffline) {\n }", "@Override\r\n\tpublic void offMachine() {\n\t\t System.out.println(\"Off the machine when the cook is done \");\r\n\t}", "boolean setOffline(boolean b);", "@Then(\"^User is disconnected$\")\n\tpublic void user_is_disconnected() throws Throwable {\n\t\tisElementPresent(driver, By.className(\"user-menu-offline\"));\n\t\tThread.sleep(2000);\n\t}", "public void powerdown() {\n monitor.sendPowerdown();\n }", "@Override\n public void onMachineDeactivated()\n {\n \n }", "private void goAway() {\n CollaborationConnection connection = CollaborationConnection\n .getConnection();\n Presence presence = connection.getPresence();\n if (presence.getMode().equals(Mode.available)) {\n previousPresence = presence;\n Presence newPresence = new Presence(presence.getType(),\n presence.getStatus(), presence.getPriority(), Mode.away);\n Tools.copyProperties(presence, newPresence);\n timerSetAway = sendPresence(connection, newPresence);\n }\n }", "public void powerOff() { //power_off\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.OFF));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.OFF) {\n isTurningOff = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "public void setOnline() {\n if (this.shutdownButton.isSelected() == false) {\n this.online = true;\n this.statusLed.setStatus(\"ok\");\n this.updateOscilloscopeData();\n }\n }", "private void onUserOffline(long uid, int reason) {\r\n\t\tfor (RecordingEventHandler oberserver : recordingEventHandlers) {\r\n\t\t\toberserver.onUserOffline(uid, reason);\r\n\t\t}\r\n\t}", "public void setOfflineRequest(String offlineRequest)\n\t{\n\t\tthis.offlineRequest = offlineRequest;\n\t}", "public final void mT__20() throws RecognitionException {\n try {\n int _type = T__20;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:18:7: ( 'Offline' )\n // InternalMyDsl.g:18:9: 'Offline'\n {\n match(\"Offline\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void powerOffVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\tTask powerOffVmTask = null;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\ttry {\r\n\t\t\tpowerOffVmTask = virtualMachine.powerOffVM_Task();\r\n\t\t\tstatus = powerOffVmTask.waitForTask();\r\n\t\t\tSystem.out.print(\"Power off VM: status = \");\r\n\t\t\tif(status.equals(\"error\")){\r\n\t\t\t\tstatus = powerOffVmTask.getTaskInfo().getError().getLocalizedMessage();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(status+\", completion time = \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t} catch (RemoteException e) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(e.getLocalizedMessage()\r\n\t\t\t\t\t\t+\",completion time : \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t\t} catch (RemoteException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\r\n\t}", "@Override\n\tpublic void onApplicationEvent(SessionDisconnectEvent event) {\n\t\tLOGGER.info(\"offline: {}\",\"SessionDisconnectEvent\");\n\t}", "private void checkOffStatus(ServiceState s) {\n assertFalse(s.getRoaming());\n assertNull(s.getOperatorAlphaLong());\n assertNull(s.getOperatorAlphaShort());\n assertNull(s.getOperatorNumeric());\n assertFalse(s.getIsManualSelection());\n }", "public void onServerFailed(boolean fatal) {\n if (fatal) {\n //forceApplicationReload();\n return;\n }\n\n if (!offline) {\n statusObserver.onServerWentAway();\n offline = true;\n }\n }", "public void setUnstable() {\n this.unstable = true;\n this.unstableTimeline.play();\n if (this.online == true) {\n this.statusLed.setStatus(\"alert\");\n this.statusLed.setFastBlink(true);\n }\n }", "public boolean isOfflineMessagingSupported()\n {\n return false;\n }", "boolean hasOfflineUserDataJob();", "@Override\r\n public void turnOff() {\r\n isOn = false;\r\n Reporter.report(this, Reporter.Msg.SWITCHING_OFF);\r\n if (this.engaged()) {\r\n disengageLoads();\r\n }\r\n }", "public String getOfflineRequest()\n\t{\n\t\treturn offlineRequest;\n\t}", "private void onUnavailable() {\n // TODO: broadcast\n }", "void onOfflineLoginFail(int errorMessage);", "public static void switchScreenOff(Context ctx) {\n PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);\n if (pm!= null && pm.isScreenOn()) {\n pm.goToSleep(SystemClock.uptimeMillis());\n }\n }", "public final void mT__57() throws RecognitionException {\n try {\n int _type = T__57;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:27:7: ( 'is-offline' )\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:27:9: 'is-offline'\n {\n match(\"is-offline\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "boolean getOptOutOnlineStatus();", "private void setOnline(String urlConfig) {\n switch (status) {\n case SERVER_DOWN:\n case URL_UNSET:\n logger.debug(\"Status changing from \" + status + \" to \"\n + Status.SERVER_UP);\n broadcastMessage(urlConfig);\n status = Status.SERVER_UP;\n break;\n default:\n logger.debug(\"SetOnline: Status not changed from \" + status);\n // no action\n }\n }", "public void alarmOff() throws RemoteHomeConnectionException {\n m.sendCommand(getDeviceId(), \"ald\");\n setAlarmStatus(AlarmStatus.ALARM_DISABLED);\n }", "public void switchOff() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"f\");\n setCurrentState(false);\n }", "public void emergencyStopMode() {\n this.outgoing.send(new Message(MessageKind.MODE_m, Mailbox.Mode.EMERGENCY_STOP));\n this.mode = State.EMERGENCY_STOP;\n }", "public void notifySwitchAway() { }", "@Override\n public void onRefresh() {\n getUserOnlineStatus();\n }", "public void onServerSucceeded() {\n if (offline) {\n statusObserver.onServerCameBack();\n offline = false;\n }\n }", "public void onIdle() {\n Methods.showMessage(\"Warning\", \"No User Action for the Last 5 Minutes!\", \"Do You Need More Time?\");\n }", "private void notifyWhenServerIsOffline() {\n //We check if the user has enabled the notification\n if (!userPreferences.notifyWhenServerGoesOffline().get()) {\n if (DEBUG)\n Log.d(TAG, \"Notifications when a server goes offline are not enabled. Skipping\");\n return;\n }\n\n //After we have updated all servers\n final Observable<MinecraftServerEntity> offlineServersObservable = Observable.from(servers)\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity server) {\n return server.getDetailedStatus() == MinecraftServer.DetailedStatus.OFFLINE;\n }\n });\n\n //We create a notification only for servers that the user does not know they are offline.\n final Observable<List<MinecraftServerEntity>> serversRequiringNotification = offlineServersObservable.asObservable()\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity minecraftServerEntity) {\n return !minecraftServerEntity.hasOfflineStatusBeenSeen();\n }\n })\n .toList();\n\n //TODO : zip the two observable to have both the list and the number of offline servers.\n Observable.zip(offlineServersObservable.count(), serversRequiringNotification, new Func2<Integer, List<MinecraftServerEntity>, Object[]>() {\n @Override\n public Object[] call(Integer numberOfOfflineServers, List<MinecraftServerEntity> serversRequiringNotification) {\n return new Object[]{numberOfOfflineServers, serversRequiringNotification};\n }\n })\n .observeOn(AndroidSchedulers.mainThread())\n .subscribeOn(AndroidSchedulers.mainThread())\n .subscribe(new Action1<Object[]>() {\n @Override\n public void call(Object[] objects) {\n final Integer numberOfOfflineServers = (Integer) objects[0];\n final List<MinecraftServerEntity> serversRequiringNotification = (List<MinecraftServerEntity>) objects[1];\n\n if (DEBUG) {\n final StringBuilder sServersRequiringNotification = new StringBuilder();\n for (MinecraftServerEntity e : serversRequiringNotification) {\n if (sServersRequiringNotification.length() == 0)\n sServersRequiringNotification.append(\"'\" + e.getName() + \"'\");\n else\n sServersRequiringNotification.append(\", '\" + e.getName() + \"'\");\n }\n if (sServersRequiringNotification.length() == 0)\n sServersRequiringNotification.append(\"(none)\");\n Log.d(TAG, \"Number of offline servers : \" + numberOfOfflineServers + \". Offline server(s) requiring a notification : \" + sServersRequiringNotification.toString());\n }\n //If the service is bound to an activity, we do not notify the user\n if (bindCount > 0) {\n if (DEBUG)\n Log.d(TAG, \"Activity is displayed to end-user. Notification muted.\");\n notificationManager.cancel(OFFLINE_SERVER_NOTIFICATION_ID);\n } else {\n if (serversRequiringNotification.size() > 0) {\n final Notification notification = buildNotificationForOfflineServers(numberOfOfflineServers, serversRequiringNotification);\n notificationManager.notify(OFFLINE_SERVER_NOTIFICATION_ID, notification);\n } else\n notificationManager.cancel(OFFLINE_SERVER_NOTIFICATION_ID);\n }\n }\n });\n\n }", "public void connectionControl() throws ServerOfflineException {\n\t\tServer.connectionCheck(this.serverTyp, this.connection);\n\t}", "public void onServiceDisconnected(ComponentName name) {\n \t\tlocalMonitor = null;\n \t}", "protected void notAllowedToWork_stopMachine_EM() {\n stopMachine();\n }", "public Builder setOffline(boolean value) {\n copyOnWrite();\n instance.setOffline(value);\n return this;\n }", "public static void changeToOfflineOnDisconnect(String userId) {\n checkPrecondition(userId != null, \"userId is null\");\n FbDatabase.changeToOfflineOnDisconnect(userId);\n }", "public ToggleButton getOfflineButton() {\n return this.offlineButton;\n }", "public void suspend()\r\n {\r\n chargeStatus = STATUS_NOT_CHARGING;\r\n connectionStatus = STATUS_OFFLINE;\r\n timerStop(); //...Suspends the update timer. \r\n }", "private void updateUserStatus(boolean online)\n {\n }", "public void turnOff(){\n vendingMachine = null;\n Logger.getGlobal().log(Level.INFO,\" Turning Off...\");\n }", "public void setOfflineButton(ToggleButton offlineButton) {\n this.offlineButton = offlineButton;\n }", "@Override\n @edu.umd.cs.findbugs.annotations.SuppressWarnings(\n value = \"ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD\",\n justification = \"This is only a style warning.\")\n public void disconnectFromSystem() {\n synchronized (CONN_SYNC) {\n try {\n if (system == null || !system.isConnected()) {\n return;\n }\n system.disconnect();\n } catch (RuntimeException e) {\n logger.warn(e.getMessage(), e);\n throw e;\n } catch (VirtualMachineError err) {\n SystemFailure.initiateFailure(err);\n // If this ever returns, rethrow the error. We're poisoned\n // now, so don't let this thread continue.\n throw err;\n } catch (Error e) {\n // Whenever you catch Error or Throwable, you must also\n // catch VirtualMachineError (see above). However, there is\n // _still_ a possibility that you are dealing with a cascading\n // error condition, so you also need to check to see if the JVM\n // is still usable:\n SystemFailure.checkFailure();\n logger.warn(e.getMessage(), e);\n throw e;\n } finally {\n ClusterDistributionManager.setIsDedicatedAdminVM(false);\n }\n }\n }", "public void verifyOfflineAutoresponseIsEnabled() throws Exception {\n\t\twdriver.findElement(By.xpath(WebData.offlineAutoresponseCheckboxEnabled)).isDisplayed();\n\t}", "private void checkStatus() {\n if (switchOff) {\n String msg = \"Locker is switched off - no data source accessible.\";\n log.error(msg);\n throw new IllegalStateException(msg);\n }\n }", "public void powerOff() \n\t{\n\t\tif(active)\n\t\t{\n\t\t\tif (FactoryModPlugin.LEVER_OUTPUT_ENABLED) {\n\t\t\t\tsetActivationLever(false);\n\t\t\t}\n\t\t\t\n\t\t\t//lots of code to make the furnace turn off, without loosing contents.\n\t\t\tFurnace furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\t\tbyte data = furnace.getData().getData();\n\t\t\tItemStack[] oldContents = furnace.getInventory().getContents();\n\t\t\tfurnace.getInventory().clear();\n\t\t\tfactoryPowerSourceLocation.getBlock().setType(Material.FURNACE);\n\t\t\tfurnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\t\tfurnace.setRawData(data);\n\t\t\tfurnace.update();\n\t\t\tfurnace.getInventory().setContents(oldContents);\n\t\t\t\n\t\t\t//put active to false\n\t\t\tactive = false;\n\t\t\t//reset the production timer\n\t\t\tcurrentProductionTimer = 0;\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\ttopicStateChanged.publish(State.OFFLINE);\n\t\t\t\t}", "public void setSwitchOff() throws UnavailableDeviceException, ClosedDeviceException, IOException {\n\t\tswitch1.setValue(true);\n\t\tthis.switchState = false; \n\t}", "@Override\n public void gattDisconnected() {\n mConnected = false;\n updateConnectionState(R.string.disconnected);\n mDataField.setText(R.string.no_data);\n getActivity().invalidateOptionsMenu();\n sCapSwitch.setChecked(false);\n sCapSwitch.setEnabled(false);\n }", "public static boolean checkNetworkForOfflineDataStorage(Context context) {\r\n if (!checkNetConnection(context)) {\r\n //Logger.showShortMessage(context, context.getString(R.string.check_internet_for_sync));\r\n return false;\r\n }\r\n return true;\r\n }", "void onOfflineLoginSuccess(User user);", "public void off() throws Exception;", "public void unlock() {\n islandLocked = false;\n }", "@Override\n public void doIdle()\n {\n mountAllUnMounted();\n }", "void connectionLost() {\n LinearLayout internetStatusContainer = findViewById(R.id.internet_status_container);\n internetStatusContainer.setVisibility(View.VISIBLE);\n }", "com.google.ads.googleads.v6.resources.OfflineUserDataJob getOfflineUserDataJob();", "public void rebootToRecoveryMode() {\n mPowerManager.reboot(\"recovery\");\n }", "public void turnOff() {\n update(0,0,0);\n this.status = false;\n }", "private void userDidLeave() {\n DeviceSingleton deviceSingleton = DeviceSingleton.getInstance();\n deviceSingleton.setImInARoom(false);\n deviceSingleton.setJoinedChat(false);\n\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putBoolean(\"savedJoinedChat\", false);\n editor.commit();\n Intent intent2 = new Intent(ShowMapActivity.this, LoginActivity.class);\n startActivity(intent2);\n// break;\n\n }", "private void screenOffBroadcast() {\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n mDoScreenOff = true;\n }\n // prize add v8.0 by zhaojian 20171102 end\n\n Intent intent = new Intent(\"prize.set.keyguard.state\");\n intent.putExtra(\"hide\",false);\n intent.putExtra(\"sleep\",true);\n getContext().sendBroadcast(intent);\n flags = false;\n // prize add v8.0 by zhaojian 20171102 start\n beforeIsLock = false;\n // prize add v8.0 by zhaojian 20171102 end\n\n handler.removeMessages(1);\n\n // prize add v8.0 by zhaojian 2017912 start\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n mIsAutoEnterReceiveUi = false;\n }\n // prize add v8.0 by zhaojian 2017912 end\n Log.d(TAG,\"screen off\");\n }", "@Override\n\tpublic void onDisconnected() {\n\t\tToast.makeText(context, \"Disconnected. Please re-connect.\",Toast.LENGTH_SHORT).show();\n\t}", "private void wake_up() {\n switch(state) {\n case ROAMING:\n case WAKING:\n case AWAKE:\n return;\n }\n\n state = State.WAKING;\n\n // Lock wifi so we don't lose contact with the server -- we can only talk to it via our\n // wifi network, the fallback to cell service is not ok.\n if(wifi_lock == null) {\n WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);\n wifi_lock = wifiManager.createWifiLock(\"ServerLock\");\n wifi_lock.setReferenceCounted(false);\n }\n wifi_lock.acquire();\n\n // Create an 'ongoing' intent so we're considered a 'foreground' service and not killed.\n // Plus, it's kind of nice to have the notification anyway.\n Intent app_intent = new Intent(this, MainActivity.class);\n app_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent app_pi = PendingIntent.getActivity(this, 0, app_intent, 0);\n\n Intent sleep_intent = new Intent(this, ServerWakeService.class);\n sleep_intent.setAction(Constants.SLEEP_INTENT);\n PendingIntent sleep_pi = PendingIntent.getService(this, 0, sleep_intent, 0);\n\n Notification note = new Notification.Builder(this)\n .setSmallIcon(R.drawable.sleep_icon)\n .setContentTitle(\"ServerLock\")\n .setTicker(\"ServerLock\")\n .setContentText(\"Keeping the server awake...\")\n .setContentIntent(app_pi)\n .setOngoing(true)\n .addAction(android.R.drawable.ic_lock_power_off, \"Allow sleep\", sleep_pi)\n .build();\n\n startForeground(Constants.NOTIFICATION_ID.FOREGROUND_SERVICE, note);\n\n // Start a worker thread that will connect to the server and do the actual work.\n if(worker == null) {\n worker = new Thread(new Runnable() {\n @Override\n public void run() {\n keep_server_up();\n }\n });\n worker.start();\n }\n\n // Update the UI, if it's open.\n send_status_update();\n }", "public void onNotEnabled() {\n Timber.d(\"onNotEnabled\");\n // keep the callback in case they turn it on manually\n setTorPref(Status.DISABLED);\n createClearnetClient();\n status = Status.NOT_ENABLED;\n if (onStatusChangedListener != null) {\n new Thread(() -> onStatusChangedListener.notEnabled()).start();\n }\n }", "@Override\n protected final void onDisconnected() {\n mPilotingItf.cancelSettingsRollbacks()\n .resetLocation()\n .updateCurrentTarget(ReturnHomePilotingItf.Target.TAKE_OFF_POSITION)\n .updateGpsFixedOnTakeOff(false);\n if (!isPersisted()) {\n mPilotingItf.unpublish();\n }\n super.onDisconnected();\n }", "@Override\r\n\tpublic void powerOff() {\n\r\n\t\tSystem.out.println(\"ig tv power off\");\r\n\r\n\t}", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "public void onPowerSaveUnwhitelisted(AppStateTracker sender) {\n updateAllJobs();\n unblockAllUnrestrictedAlarms();\n }", "public void emergencyStop(){\r\n\t\tif (grblPort.isConnected()){\r\n\t\t\tgrblPort.sendDataLine(\"\\u0018\");\r\n\t\t}\r\n\t}", "public void powerOffAllVms() throws Exception\n {\n VirtualMachine ivm = null;\n ivm = new VirtualMachine(connectAnchor);\n Vector<ManagedObjectReference> vmMors = ivm.getAllVM();\n if (vmMors != null && vmMors.size() > 0) {\n for (ManagedObjectReference vmMor : vmMors) {\n if (ivm.getVMState(vmMor) == VirtualMachinePowerState.POWERED_ON) {\n ivm.powerOffVM(vmMor);\n }\n }\n }\n }", "private boolean isOnline() {\n\t\tConnectivityManager cm = (ConnectivityManager) getApplicationContext()\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n\t\treturn cm.getActiveNetworkInfo() != null\n\t\t\t\t&& cm.getActiveNetworkInfo().isConnectedOrConnecting();\n\n\t}", "protected void removeSplashScreen() {\n\t\tif (splashScreenDialog != null) {\n\t\t\tsplashScreenDialog.dismiss();\n\t\t\tsplashScreenDialog = null;\n\t\t}\n\t\tif (!Utils.isOnline(this)) {\n\t\t\tString infoMsg = CatalinaApplication.getInstance().getResources()\n\t\t\t\t\t.getString(R.string.bad_connection);\n\t\t\tshowInfoDialog(infoMsg);\n\t\t}\n\t}", "public String getOfflineAutoresponseMessage() throws Exception {\n\t\twdriver.findElement(By.xpath(WebData.offlineAutoresponseMessage)).isDisplayed();\n\t\treturn wdriver.findElement(By.xpath(WebData.offlineAutoresponseMessage)).getText();\n\t}", "public void changeAvailability() {\n\t\tavailability = !availability;\n\t}", "public boolean isOnline() {\n \t\tConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n \t\tNetworkInfo netInfo = cm.getActiveNetworkInfo();\n \t\t\n \t\tif (netInfo != null && netInfo.isConnected()) {\n \t\t\treturn true;\n \t\t} else{\n \t\t\t\n \t\t\treturn false;\n \t\t}\n \t\t\n \t}", "private void restoreSleepMode(){\n wl.release();\n }", "public void doOfflineComputation() {\n\t\toptimalPolicy = policyIteration();\n\n\t}", "@Override\r\n\tpublic void power() {\n\t\tSystem.out.println(\"Power off\");\r\n\t\t\r\n\t}" ]
[ "0.7137324", "0.7044586", "0.690709", "0.68646014", "0.68233514", "0.6772392", "0.6720039", "0.66193175", "0.6558834", "0.6514557", "0.6493195", "0.6459503", "0.63688153", "0.6366879", "0.634338", "0.6229067", "0.61402524", "0.61048484", "0.6099216", "0.5988671", "0.5977283", "0.5894862", "0.58912426", "0.5826858", "0.5734414", "0.57184786", "0.56897175", "0.5665705", "0.5664363", "0.5604429", "0.558053", "0.55624706", "0.55535066", "0.5545215", "0.55248755", "0.5507611", "0.5503292", "0.5471861", "0.5457229", "0.54530007", "0.54456514", "0.5440919", "0.54151577", "0.54016584", "0.5379583", "0.5353669", "0.53486896", "0.53436404", "0.53433096", "0.5326464", "0.5324868", "0.5319639", "0.5316549", "0.52851564", "0.5275509", "0.526891", "0.52681875", "0.5253372", "0.5248459", "0.5230176", "0.52109575", "0.5197266", "0.5188968", "0.5188078", "0.51831084", "0.51802015", "0.5180177", "0.51603544", "0.5159028", "0.51542795", "0.51498526", "0.5143369", "0.5141955", "0.514186", "0.51387054", "0.5135866", "0.51318324", "0.5130344", "0.51294506", "0.51252186", "0.5119638", "0.51136994", "0.5100402", "0.50846153", "0.5078202", "0.5058204", "0.5055708", "0.50554764", "0.5054195", "0.5047553", "0.5042863", "0.5040364", "0.5031326", "0.5025305", "0.50245476", "0.5013509", "0.50113744", "0.50097895", "0.5000572", "0.49992692" ]
0.63639593
14
Exits the database server application.
public AdminShutdownResponse adminShutdown(AdminShutdownRequest request) throws GPUdbException { AdminShutdownResponse actualResponse_ = new AdminShutdownResponse(); submitRequest("/admin/shutdown", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void exitServer()\n\t{\n\t\tSystem.exit(1);\n\t}", "public void shutdown() {\r\n \t\tMsg.debugMsg(DB_REGULAR.class, \"Database is shutting down\");\r\n \t\tStatement st;\r\n \t\ttry {\r\n \t\t\tst = conn.createStatement();\r\n \t\t\tst.execute(\"SHUTDOWN\");\r\n \t\t} catch (SQLException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t} finally {\r\n \t\t\tif (conn != null) {\r\n \t\t\t\ttry {\r\n \t\t\t\t\tconn.close();\r\n \t\t\t\t} catch (SQLException e) {\r\n \t\t\t\t\te.printStackTrace();\r\n \t\t\t\t} // if there are no other open connection\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public void shutdown()\n\t{\n\t\ttry\n\t\t{\n\t\t\tsave();\n\t\t\tgetPreparedStatement(\"SHUTDOWN\").executeUpdate();\n\t\t\tgetConnection().close();\n\t\t} \n\t\tcatch (SQLException e)\n\t\t{\n\t\t\tm_logger.error(\"Couldn't cleanly shutdown.\", e);\n\t\t}\n\t}", "protected void onExit(){\n conMgr.closeDbDriver();\n }", "public static void shutdown(){\r\n\t//releases the connection to the dB\r\n\t\t try\r\n\t {\r\n\t if (statement != null)\r\n\t {\r\n\t statement.close();\r\n\t }\r\n\t if (connection != null)\r\n\t {\r\n\t DriverManager.getConnection(dbURL + \";shutdown=true\");\r\n\t connection.close();\r\n\t } \r\n\t }\r\n\t catch (SQLException sqle){\r\n\t //there will always be successful shutdown indicating that Derby has shutdown and that there is no connection. \r\n\t }\r\n\t}", "public void shutDown(){\n sequence128db.shutDown();\n }", "private void quitApp() {\n\t\tlogger.trace(\"quitApp() is called\");\n\t\t\n \tint answer = JOptionPane.showConfirmDialog(null, \"Exit App?\");\n \tif (answer == JOptionPane.YES_OPTION){\n \t\tstopServer(); \n \t\tsaveData();\n \t\tlogger.trace(\"Server app exits\");\n \t\tSystem.exit(0);\n \t}\n }", "private void exit()\n {\n try\n {\n connect.close();\n }\n catch (javax.jms.JMSException jmse)\n {\n jmse.printStackTrace();\n }\n\n System.exit(0);\n }", "public void shutdown()\r\n\t{\r\n\t\tgraphDb.shutdown();\r\n\t\tSystem.out.println(\"Shutdown-Done!\");\r\n\t}", "public final void exit() {\n if (this.serverSocket instanceof ServerSocket) {\n try {\n this.serverSocket.close();\n } catch (IOException ex) {\n Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "@Override\n public void shutdown() {\n log.debug(\"Shutting down Ebean ..\");\n\n // TODO: Verificar si es necesario des-registrar el driver\n this.ebeanServer.shutdown(true, false);\n }", "public void exitProgram() {\n\t\tgoOffline();\n\t\tmainWindow.dispose();\n\t\tif (config_ok)\n\t\t\tsaveConnectionConfiguration();\n\t\tSystem.exit(0);\n\t\t\n\t}", "public void exitApp() {\n\t\tSystem.out.println(\"Exiting PhoneBook\");\n\n\t}", "private void exitApplication()\r\n {\r\n System.exit(0);\r\n }", "public void shutdown() {\r\n System.exit(0);\r\n }", "private void exitApplication() {\n\t\tBPCC_Logger.logInfoMessage(classNameForLogger, logMessage_applicationFrameClosed);\r\n\t\tSystem.exit(0);\r\n\t}", "public void shutDownDB(){\n\t\ttry\n {\n // the shutdown=true attribute shuts down Derby\n\t\t\tDriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n\n // To shut down a specific database only, but keep the\n // engine running (for example for connecting to other\n // databases), specify a database in the connection URL:\n //DriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n }\n catch (SQLException se)\n {\n if (( (se.getErrorCode() == 45000)\n && (\"08006\".equals(se.getSQLState()) ))) {\n // we got the expected exception\n System.out.println(\"Derby shut down normally\");\n // Note that for single database shutdown, the expected\n // SQL state is \"08006\", and the error code is 45000.\n } else {\n // if the error code or SQLState is different, we have\n // an unexpected exception (shutdown failed)\n System.err.println(\"Derby did not shut down normally\");\n printSQLException(se);\n }\n }\n }", "public void exitClient()\n\t{\n\t\ttry{\n\t\t\tif(sock.isConnected()){\n\t\t\tsock.close();\n\t\t\t//listenerSock.close();\n\t\t\tSystem.out.println(\"restart your client.....\");\n\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t}\n\t}", "public void exit() {\n\t\tSystem.exit(0);\n\t}", "public void exit() {\n\t\tSystem.exit(0);\n\t}", "public void exit(ActionEvent actionEvent) {\r\n //Closes hibernate and then the program.\r\n controller.exit();\r\n System.exit(0);\r\n }", "public static void closeDatabase() {\n if (instance != null) {\n instance.kill();\n instance = null;\n }\n }", "public void Exit(){\n\t\t\t\tclose();\n\t\t\t}", "public void exit();", "public void ExitConection(){\n try {\n resultSet.close();\n preparedStatement.close();\n conection.close();\n } catch (Exception e) {\n// MessageEmergent(\"Fail ExitConection(): \"+e.getMessage());\n }\n }", "@After\n public void destroyDatabase() {\n dbService.closeCurrentSession();\n dbService.getDdlInitializer()\n .cleanDB();\n }", "public void shutdown() {\n try {\n infoServer.stop();\n } catch (Exception e) {\n }\n this.shouldRun = false;\n ((DataXceiveServer) this.dataXceiveServer.getRunnable()).kill();\n try {\n this.storage.closeAll();\n } catch (IOException ie) {\n }\n }", "public void notifyExit()\r\n {\r\n if (isClientConnected)\r\n sendDisconnectTag();\r\n bs.close(); // Announce termination to client\r\n bs.cancel(); // Shut down waiting server\r\n System.exit(0);\r\n }", "protected void exit() {\n\t\tSystem.exit(0);\n\t}", "public void shutdown()\n {\n // todo\n }", "public void closeAndDeleteDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tthis.deleteAllTable();\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n//\t\t\n//\t\tif (!gotSQLExc) {\n//\t \t System.out.println(\"Database did not shut down normally\");\n//\t } else {\n//\t System.out.println(\"Database shut down normally\");\t\n//\t }\n\t\t\n\t}", "public static void exit() {\n\t\t\n\t\t//\tlog out\n\t\tlogout();\n\t\t\n\t\t//\tclean up\n\t\taccountNames.clear();\n\t\taccountsByName.clear();\n\t\tdataProvider = null;\n\t\trememberedUserNames = null;\n\t}", "@Override\r\n public void onTerminate() {\n \r\n dataManager.closeDb();\r\n selectedBook = null;\r\n super.onTerminate();\r\n }", "public void shutdown() {\n\t\tserver.stop(0);\n\t}", "void dropDatabase();", "public void destroy() {\n closeSqlDbConnections();\n\n\n }", "public void exit() {\n loader.getApplet().stop();\n loader.getApplet().destroy();\n }", "public void exitAddressBook() {\n\t\tSystem.out.println(\"Exited from the Address book.\");\n\t\tSystem.exit(0);\n\n\t}", "@AfterClass(alwaysRun = true)\n public void stopGeth() {\n String db = System.getProperty(\"cakeshop.database.vendor\");\n if (db.equalsIgnoreCase(\"hsqldb\")) {\n ((EmbeddedDatabase) embeddedDb).shutdown();\n }\n }", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "public void exit() {\r\n\t\tsendReceiveSocket.close();\r\n\t}", "public void exit () {\r\n System.out.println(\"Desligando aplicação...\");\r\n this.stub.killStub();\r\n }", "public void ExitStatements() {\n try {\n preparedStatement.close();\n } catch (Exception e) {\n// MessageEmergent(\"Fail ExitStatements(): \"+e.getMessage());\n }\n }", "@Override\n\tpublic void contextDestroyed(ServletContextEvent arg0) {\n\t\tConnectionDB.destroy();\n\t}", "public static void quit() {\n // Put any network clean-up code you might have here.\n // (inform other implementations on the network that you have\n // left, etc.)\n try {\n IpPacket QuitPackat = new IpPacket(true, playerName);\n Socket NamingServer = new Socket(namingServerHost, namingServerPort);\n ObjectOutputStream toNS = new ObjectOutputStream(NamingServer.getOutputStream()); // cannot use that already create one!\n System.out.println(\"I am writting to the outputstream\");\n toNS.writeObject(QuitPackat);\n\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.exit(0);\n }", "public static void exit() {\n Context.exit(StackContext.class);\n }", "private void quit() {\n try {\n toServer.writeInt(QUIT);\n doQuit();\n report(\"Client --> server: QUIT \");\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "void shutDownServer() throws Exception;", "@Override\r\n\tpublic void exit() {\n\t\t\r\n\t}", "@OnClose\n public void end() {\n listener.connectionTerminated();\n Logger.getGlobal().info(\"Connection with \" \n + nickname + \" terminated.\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n }", "public void shutdown();", "public void shutdown();", "public void shutdown();", "public void shutdown();", "public void shutdown(){\n \tSystem.out.println(\"SHUTTING DOWN..\");\n \tSystem.exit(0);\n }", "@Override\n\tpublic void exit() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@AfterClass\n\tpublic static void tearDownClass() {\n\t\tTEST_ENVIRONMENT.stopServer();\n\t\tTEST_ENVIRONMENT.tearDownDb();\n\t}", "public static void End()\n\t{\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"End of java application\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final void destroy() {\n requestExit();\n }", "public void terminate() {\n config.closeConnection();\n }", "@Override\n public void onTerminate() {\n Log.i(\"Application\", \"application destory\");\n if (MySocket.getInstance().getConnected()) {\n MySocket.getInstance().stop();\n DataManager manager = DataManager.getInstance();\n manager.setSceneList(manager.getSceneList());\n manager.setEquipmentList(manager.getEquipmentList());\n for (Record record : manager.getCurrentRecords()) {\n if (record.getValues().size() == 0) {\n continue;\n }\n record.setEndTime(new Date());\n manager.addToEquipmentRecordsList(record.getId(), record.clone());\n }\n Log.i(\"Home\", \"destory\");\n Process.killProcess(Process.myPid());\n }\n super.onTerminate();\n }", "public void shutDown();", "void exit();", "public void windowClosing(WindowEvent e) {\n\t\t\tdb.closeConnection();\n\t\t\tSystem.exit(0);\n\t\t}", "public void closeDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void exit() {\n\t\t//do nothing\n\t}", "public void shutdown() {\n\t\t\n\t}", "public void destroy() {\n\t\ttry {\n\t\t\tdestroy(10000);\n\t\t}\n\t\tcatch(SQLException e) {}\n\t}", "public static void closeDatabase() {\n\t\ttry {\n\t\t\tif (status == OPEN_SUCCESS) {\n\t\t\t\tif (stmt != null)\n\t\t\t\t\tstmt.close();\n\t\t\t\tif (c != null)\n\t\t\t\t\tc.close();\n\t\t\t\tlogger.info(\"Closed database successfully\");\n\t\t\t} else {\n\t\t\t\tlogger.warn(\"Can not close: previous operation failed.\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tstatus = OPEN_FAILED;\n\t\t\tlogger.warn(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void stopSessie() throws BiffException, WriteException, IOException {\n this.spelVerloopPaneController.getSpelFacade().getSpelerDB().save();\n System.exit(0);\n }", "public static void shutdown() {\n\t}", "void shutDown();", "private static void removeDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n dropTable(\"myRooms\");\n dropTable(\"myReservations\");\n }", "@Override\n\tpublic void exit() {\n\t\t\n\t}", "@Override\n\tpublic void exit() {\n\t\t\n\t}", "public synchronized void shutdown() {\n server.stop();\n }", "private static void exit() {\n dvm.exit();\n stop = true;\n }", "public void exitTheProgram(){\n System.exit(0);\n }", "private void terminarJuego() {\n\t\tjugadores[0].cerrar();\n\t\tjugadores[1].cerrar();\n\t\tjugadores[2].cerrar();\n\t\ttry {\n\t\t\tserver.close();\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\tSystem.exit(0);\n\t}", "@Override\n public void exit() {\n super.exit();\n }", "@Override\n\tpublic void contextDestroyed(ServletContextEvent arg0) {\n\t\tserverAPP.quit();\n\t}", "void shutdown() throws SQLException;", "@Override\n\tpublic void exit() {\n\n\t}", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private void exitGame() {\n System.exit(0);\n }", "private void exit() {\n\n // Farewell message\n pOutput.println(\"Good Bye!\");\n pOutput.close();\n\n try {\n pClient.close();\n\n } catch (final IOException ex) {\n pShellService.error(\"Shell::exit()\", ex);\n }\n\n // Clean up\n pShellService = null;\n }", "public static String EXIT(){\n\t\tSystem.out.println(\"Shutting down client...\");\n\t\tSystem.exit(0);\n\t\treturn \"\";\n\t\t\n\t}", "public void stop( BundleContext bc ) throws Exception\n {\n logger.info( \"STOPPED Terminology DAO Service\" );\n }", "@Override\r\n\tpublic void contextDestroyed(ServletContextEvent m_event) {\n\t\tDataBaseConn.closeConn();\r\n\t\tArkService.getInstance().stop();\r\n\t\t//DataBaseConn.closeConn();\r\n\t}", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "@Override\n public void exit() {\n model.exit();\n }", "private static void disconnectDatabase(){\n\t\ttry{\n\t\t\tif (connection != null) connection.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void end() {\n \t\ttry {\n \t\t\tnameServerClient.leave();\n \t\t} catch (Exception e) {\n \t\t\t__.fwdAbort__(e);\n \t\t}\n \t}", "public void close() {\n System.exit(0);\n }", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();" ]
[ "0.6960293", "0.6956239", "0.67916197", "0.6791173", "0.6708261", "0.66425925", "0.66361284", "0.6536922", "0.65241677", "0.6515671", "0.65026116", "0.64376885", "0.64174837", "0.6408722", "0.6397314", "0.6389727", "0.638942", "0.6310961", "0.62751037", "0.62751037", "0.62737674", "0.6224715", "0.6205988", "0.6167277", "0.6156529", "0.61498773", "0.6130701", "0.61175525", "0.6113935", "0.61056143", "0.6104015", "0.61037356", "0.6093758", "0.6076582", "0.6066794", "0.60608894", "0.6053118", "0.6050328", "0.60502183", "0.6040477", "0.6037651", "0.6037219", "0.6016483", "0.6001155", "0.5987651", "0.59758043", "0.5966213", "0.5959871", "0.5958401", "0.5957858", "0.5948606", "0.5948606", "0.5948606", "0.5948606", "0.59478754", "0.59423476", "0.5937581", "0.5930879", "0.59259075", "0.5904838", "0.5901763", "0.59005564", "0.5896488", "0.5894659", "0.5893723", "0.58867484", "0.58865184", "0.5886165", "0.58861035", "0.58842605", "0.5883763", "0.5883714", "0.5877546", "0.5874261", "0.5874261", "0.5869878", "0.5856171", "0.5852506", "0.5849896", "0.5838187", "0.5835233", "0.58321077", "0.58307046", "0.5830184", "0.5829403", "0.5824723", "0.58244336", "0.5824352", "0.58201873", "0.5810072", "0.5809465", "0.58068174", "0.5804192", "0.58025527", "0.5801483", "0.5801483", "0.5801483", "0.5801483", "0.5801483", "0.5801483", "0.5801483" ]
0.0
-1
Exits the database server application.
public AdminShutdownResponse adminShutdown(String exitType, String authorization, Map<String, String> options) throws GPUdbException { AdminShutdownRequest actualRequest_ = new AdminShutdownRequest(exitType, authorization, options); AdminShutdownResponse actualResponse_ = new AdminShutdownResponse(); submitRequest("/admin/shutdown", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void exitServer()\n\t{\n\t\tSystem.exit(1);\n\t}", "public void shutdown() {\r\n \t\tMsg.debugMsg(DB_REGULAR.class, \"Database is shutting down\");\r\n \t\tStatement st;\r\n \t\ttry {\r\n \t\t\tst = conn.createStatement();\r\n \t\t\tst.execute(\"SHUTDOWN\");\r\n \t\t} catch (SQLException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t} finally {\r\n \t\t\tif (conn != null) {\r\n \t\t\t\ttry {\r\n \t\t\t\t\tconn.close();\r\n \t\t\t\t} catch (SQLException e) {\r\n \t\t\t\t\te.printStackTrace();\r\n \t\t\t\t} // if there are no other open connection\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public void shutdown()\n\t{\n\t\ttry\n\t\t{\n\t\t\tsave();\n\t\t\tgetPreparedStatement(\"SHUTDOWN\").executeUpdate();\n\t\t\tgetConnection().close();\n\t\t} \n\t\tcatch (SQLException e)\n\t\t{\n\t\t\tm_logger.error(\"Couldn't cleanly shutdown.\", e);\n\t\t}\n\t}", "protected void onExit(){\n conMgr.closeDbDriver();\n }", "public static void shutdown(){\r\n\t//releases the connection to the dB\r\n\t\t try\r\n\t {\r\n\t if (statement != null)\r\n\t {\r\n\t statement.close();\r\n\t }\r\n\t if (connection != null)\r\n\t {\r\n\t DriverManager.getConnection(dbURL + \";shutdown=true\");\r\n\t connection.close();\r\n\t } \r\n\t }\r\n\t catch (SQLException sqle){\r\n\t //there will always be successful shutdown indicating that Derby has shutdown and that there is no connection. \r\n\t }\r\n\t}", "public void shutDown(){\n sequence128db.shutDown();\n }", "private void quitApp() {\n\t\tlogger.trace(\"quitApp() is called\");\n\t\t\n \tint answer = JOptionPane.showConfirmDialog(null, \"Exit App?\");\n \tif (answer == JOptionPane.YES_OPTION){\n \t\tstopServer(); \n \t\tsaveData();\n \t\tlogger.trace(\"Server app exits\");\n \t\tSystem.exit(0);\n \t}\n }", "private void exit()\n {\n try\n {\n connect.close();\n }\n catch (javax.jms.JMSException jmse)\n {\n jmse.printStackTrace();\n }\n\n System.exit(0);\n }", "public void shutdown()\r\n\t{\r\n\t\tgraphDb.shutdown();\r\n\t\tSystem.out.println(\"Shutdown-Done!\");\r\n\t}", "public final void exit() {\n if (this.serverSocket instanceof ServerSocket) {\n try {\n this.serverSocket.close();\n } catch (IOException ex) {\n Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "@Override\n public void shutdown() {\n log.debug(\"Shutting down Ebean ..\");\n\n // TODO: Verificar si es necesario des-registrar el driver\n this.ebeanServer.shutdown(true, false);\n }", "public void exitProgram() {\n\t\tgoOffline();\n\t\tmainWindow.dispose();\n\t\tif (config_ok)\n\t\t\tsaveConnectionConfiguration();\n\t\tSystem.exit(0);\n\t\t\n\t}", "public void exitApp() {\n\t\tSystem.out.println(\"Exiting PhoneBook\");\n\n\t}", "private void exitApplication()\r\n {\r\n System.exit(0);\r\n }", "public void shutdown() {\r\n System.exit(0);\r\n }", "private void exitApplication() {\n\t\tBPCC_Logger.logInfoMessage(classNameForLogger, logMessage_applicationFrameClosed);\r\n\t\tSystem.exit(0);\r\n\t}", "public void shutDownDB(){\n\t\ttry\n {\n // the shutdown=true attribute shuts down Derby\n\t\t\tDriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n\n // To shut down a specific database only, but keep the\n // engine running (for example for connecting to other\n // databases), specify a database in the connection URL:\n //DriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n }\n catch (SQLException se)\n {\n if (( (se.getErrorCode() == 45000)\n && (\"08006\".equals(se.getSQLState()) ))) {\n // we got the expected exception\n System.out.println(\"Derby shut down normally\");\n // Note that for single database shutdown, the expected\n // SQL state is \"08006\", and the error code is 45000.\n } else {\n // if the error code or SQLState is different, we have\n // an unexpected exception (shutdown failed)\n System.err.println(\"Derby did not shut down normally\");\n printSQLException(se);\n }\n }\n }", "public void exitClient()\n\t{\n\t\ttry{\n\t\t\tif(sock.isConnected()){\n\t\t\tsock.close();\n\t\t\t//listenerSock.close();\n\t\t\tSystem.out.println(\"restart your client.....\");\n\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t}\n\t}", "public void exit() {\n\t\tSystem.exit(0);\n\t}", "public void exit() {\n\t\tSystem.exit(0);\n\t}", "public void exit(ActionEvent actionEvent) {\r\n //Closes hibernate and then the program.\r\n controller.exit();\r\n System.exit(0);\r\n }", "public static void closeDatabase() {\n if (instance != null) {\n instance.kill();\n instance = null;\n }\n }", "public void Exit(){\n\t\t\t\tclose();\n\t\t\t}", "public void exit();", "public void ExitConection(){\n try {\n resultSet.close();\n preparedStatement.close();\n conection.close();\n } catch (Exception e) {\n// MessageEmergent(\"Fail ExitConection(): \"+e.getMessage());\n }\n }", "@After\n public void destroyDatabase() {\n dbService.closeCurrentSession();\n dbService.getDdlInitializer()\n .cleanDB();\n }", "public void shutdown() {\n try {\n infoServer.stop();\n } catch (Exception e) {\n }\n this.shouldRun = false;\n ((DataXceiveServer) this.dataXceiveServer.getRunnable()).kill();\n try {\n this.storage.closeAll();\n } catch (IOException ie) {\n }\n }", "public void notifyExit()\r\n {\r\n if (isClientConnected)\r\n sendDisconnectTag();\r\n bs.close(); // Announce termination to client\r\n bs.cancel(); // Shut down waiting server\r\n System.exit(0);\r\n }", "protected void exit() {\n\t\tSystem.exit(0);\n\t}", "public void shutdown()\n {\n // todo\n }", "public void closeAndDeleteDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tthis.deleteAllTable();\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n//\t\t\n//\t\tif (!gotSQLExc) {\n//\t \t System.out.println(\"Database did not shut down normally\");\n//\t } else {\n//\t System.out.println(\"Database shut down normally\");\t\n//\t }\n\t\t\n\t}", "public static void exit() {\n\t\t\n\t\t//\tlog out\n\t\tlogout();\n\t\t\n\t\t//\tclean up\n\t\taccountNames.clear();\n\t\taccountsByName.clear();\n\t\tdataProvider = null;\n\t\trememberedUserNames = null;\n\t}", "@Override\r\n public void onTerminate() {\n \r\n dataManager.closeDb();\r\n selectedBook = null;\r\n super.onTerminate();\r\n }", "public void shutdown() {\n\t\tserver.stop(0);\n\t}", "void dropDatabase();", "public void destroy() {\n closeSqlDbConnections();\n\n\n }", "public void exit() {\n loader.getApplet().stop();\n loader.getApplet().destroy();\n }", "public void exitAddressBook() {\n\t\tSystem.out.println(\"Exited from the Address book.\");\n\t\tSystem.exit(0);\n\n\t}", "@AfterClass(alwaysRun = true)\n public void stopGeth() {\n String db = System.getProperty(\"cakeshop.database.vendor\");\n if (db.equalsIgnoreCase(\"hsqldb\")) {\n ((EmbeddedDatabase) embeddedDb).shutdown();\n }\n }", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "public void exit() {\r\n\t\tsendReceiveSocket.close();\r\n\t}", "public void exit () {\r\n System.out.println(\"Desligando aplicação...\");\r\n this.stub.killStub();\r\n }", "public void ExitStatements() {\n try {\n preparedStatement.close();\n } catch (Exception e) {\n// MessageEmergent(\"Fail ExitStatements(): \"+e.getMessage());\n }\n }", "@Override\n\tpublic void contextDestroyed(ServletContextEvent arg0) {\n\t\tConnectionDB.destroy();\n\t}", "public static void quit() {\n // Put any network clean-up code you might have here.\n // (inform other implementations on the network that you have\n // left, etc.)\n try {\n IpPacket QuitPackat = new IpPacket(true, playerName);\n Socket NamingServer = new Socket(namingServerHost, namingServerPort);\n ObjectOutputStream toNS = new ObjectOutputStream(NamingServer.getOutputStream()); // cannot use that already create one!\n System.out.println(\"I am writting to the outputstream\");\n toNS.writeObject(QuitPackat);\n\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.exit(0);\n }", "public static void exit() {\n Context.exit(StackContext.class);\n }", "private void quit() {\n try {\n toServer.writeInt(QUIT);\n doQuit();\n report(\"Client --> server: QUIT \");\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "void shutDownServer() throws Exception;", "@Override\r\n\tpublic void exit() {\n\t\t\r\n\t}", "@OnClose\n public void end() {\n listener.connectionTerminated();\n Logger.getGlobal().info(\"Connection with \" \n + nickname + \" terminated.\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n }", "public void shutdown();", "public void shutdown();", "public void shutdown();", "public void shutdown();", "public void shutdown(){\n \tSystem.out.println(\"SHUTTING DOWN..\");\n \tSystem.exit(0);\n }", "@Override\n\tpublic void exit() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@AfterClass\n\tpublic static void tearDownClass() {\n\t\tTEST_ENVIRONMENT.stopServer();\n\t\tTEST_ENVIRONMENT.tearDownDb();\n\t}", "public static void End()\n\t{\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"End of java application\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final void destroy() {\n requestExit();\n }", "public void terminate() {\n config.closeConnection();\n }", "@Override\n public void onTerminate() {\n Log.i(\"Application\", \"application destory\");\n if (MySocket.getInstance().getConnected()) {\n MySocket.getInstance().stop();\n DataManager manager = DataManager.getInstance();\n manager.setSceneList(manager.getSceneList());\n manager.setEquipmentList(manager.getEquipmentList());\n for (Record record : manager.getCurrentRecords()) {\n if (record.getValues().size() == 0) {\n continue;\n }\n record.setEndTime(new Date());\n manager.addToEquipmentRecordsList(record.getId(), record.clone());\n }\n Log.i(\"Home\", \"destory\");\n Process.killProcess(Process.myPid());\n }\n super.onTerminate();\n }", "public void shutDown();", "void exit();", "public void windowClosing(WindowEvent e) {\n\t\t\tdb.closeConnection();\n\t\t\tSystem.exit(0);\n\t\t}", "public void closeDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void exit() {\n\t\t//do nothing\n\t}", "public void shutdown() {\n\t\t\n\t}", "public void destroy() {\n\t\ttry {\n\t\t\tdestroy(10000);\n\t\t}\n\t\tcatch(SQLException e) {}\n\t}", "public static void closeDatabase() {\n\t\ttry {\n\t\t\tif (status == OPEN_SUCCESS) {\n\t\t\t\tif (stmt != null)\n\t\t\t\t\tstmt.close();\n\t\t\t\tif (c != null)\n\t\t\t\t\tc.close();\n\t\t\t\tlogger.info(\"Closed database successfully\");\n\t\t\t} else {\n\t\t\t\tlogger.warn(\"Can not close: previous operation failed.\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tstatus = OPEN_FAILED;\n\t\t\tlogger.warn(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void stopSessie() throws BiffException, WriteException, IOException {\n this.spelVerloopPaneController.getSpelFacade().getSpelerDB().save();\n System.exit(0);\n }", "public static void shutdown() {\n\t}", "void shutDown();", "private static void removeDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n dropTable(\"myRooms\");\n dropTable(\"myReservations\");\n }", "@Override\n\tpublic void exit() {\n\t\t\n\t}", "@Override\n\tpublic void exit() {\n\t\t\n\t}", "public synchronized void shutdown() {\n server.stop();\n }", "private static void exit() {\n dvm.exit();\n stop = true;\n }", "public void exitTheProgram(){\n System.exit(0);\n }", "private void terminarJuego() {\n\t\tjugadores[0].cerrar();\n\t\tjugadores[1].cerrar();\n\t\tjugadores[2].cerrar();\n\t\ttry {\n\t\t\tserver.close();\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\tSystem.exit(0);\n\t}", "@Override\n public void exit() {\n super.exit();\n }", "@Override\n\tpublic void contextDestroyed(ServletContextEvent arg0) {\n\t\tserverAPP.quit();\n\t}", "void shutdown() throws SQLException;", "@Override\n\tpublic void exit() {\n\n\t}", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private void exitGame() {\n System.exit(0);\n }", "private void exit() {\n\n // Farewell message\n pOutput.println(\"Good Bye!\");\n pOutput.close();\n\n try {\n pClient.close();\n\n } catch (final IOException ex) {\n pShellService.error(\"Shell::exit()\", ex);\n }\n\n // Clean up\n pShellService = null;\n }", "public static String EXIT(){\n\t\tSystem.out.println(\"Shutting down client...\");\n\t\tSystem.exit(0);\n\t\treturn \"\";\n\t\t\n\t}", "public void stop( BundleContext bc ) throws Exception\n {\n logger.info( \"STOPPED Terminology DAO Service\" );\n }", "@Override\r\n\tpublic void contextDestroyed(ServletContextEvent m_event) {\n\t\tDataBaseConn.closeConn();\r\n\t\tArkService.getInstance().stop();\r\n\t\t//DataBaseConn.closeConn();\r\n\t}", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "@Override\n public void exit() {\n model.exit();\n }", "private static void disconnectDatabase(){\n\t\ttry{\n\t\t\tif (connection != null) connection.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void end() {\n \t\ttry {\n \t\t\tnameServerClient.leave();\n \t\t} catch (Exception e) {\n \t\t\t__.fwdAbort__(e);\n \t\t}\n \t}", "public void close() {\n System.exit(0);\n }", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();" ]
[ "0.6960293", "0.6956239", "0.67916197", "0.6791173", "0.6708261", "0.66425925", "0.66361284", "0.6536922", "0.65241677", "0.6515671", "0.65026116", "0.64376885", "0.64174837", "0.6408722", "0.6397314", "0.6389727", "0.638942", "0.6310961", "0.62751037", "0.62751037", "0.62737674", "0.6224715", "0.6205988", "0.6167277", "0.6156529", "0.61498773", "0.6130701", "0.61175525", "0.6113935", "0.61056143", "0.6104015", "0.61037356", "0.6093758", "0.6076582", "0.6066794", "0.60608894", "0.6053118", "0.6050328", "0.60502183", "0.6040477", "0.6037651", "0.6037219", "0.6016483", "0.6001155", "0.5987651", "0.59758043", "0.5966213", "0.5959871", "0.5958401", "0.5957858", "0.5948606", "0.5948606", "0.5948606", "0.5948606", "0.59478754", "0.59423476", "0.5937581", "0.5930879", "0.59259075", "0.5904838", "0.5901763", "0.59005564", "0.5896488", "0.5894659", "0.5893723", "0.58867484", "0.58865184", "0.5886165", "0.58861035", "0.58842605", "0.5883763", "0.5883714", "0.5877546", "0.5874261", "0.5874261", "0.5869878", "0.5856171", "0.5852506", "0.5849896", "0.5838187", "0.5835233", "0.58321077", "0.58307046", "0.5830184", "0.5829403", "0.5824723", "0.58244336", "0.5824352", "0.58201873", "0.5810072", "0.5809465", "0.58068174", "0.5804192", "0.58025527", "0.5801483", "0.5801483", "0.5801483", "0.5801483", "0.5801483", "0.5801483", "0.5801483" ]
0.0
-1
Verify database is in a consistent state. When inconsistencies or errors are found, the verified_ok flag in the response is set to false and the list of errors found is provided in the error_list.
public AdminVerifyDbResponse adminVerifyDb(AdminVerifyDbRequest request) throws GPUdbException { AdminVerifyDbResponse actualResponse_ = new AdminVerifyDbResponse(); submitRequest("/admin/verifydb", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean verify();", "public void checkConsistency(List inconsistencies);", "public abstract boolean verify();", "public AdminVerifyDbResponse adminVerifyDb(Map<String, String> options) throws GPUdbException {\n AdminVerifyDbRequest actualRequest_ = new AdminVerifyDbRequest(options);\n AdminVerifyDbResponse actualResponse_ = new AdminVerifyDbResponse();\n submitRequest(\"/admin/verifydb\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n public void verifyDB_SIB_BID_Reg_Referral_Status(List<String> status, String table) {\n\n String condition;\n if (table.equals(\"purchase\")) {\n table = \"purchase_referral\";\n condition = \"create_date > sysdate -.01\";\n }\n else if (table.equals(\"registration\")) {\n table = \"registration_referral\";\n condition = \"customer_id =\" + this.getCustomerIDFromDB(authenticationParameters.getUsername());\n }\n else { //search_referral\n table = \"search_referral\";\n condition = \"search_id =\" + this.getSearchIDFromDB(authenticationParameters.getUsername());\n }\n\n String sql = \"select distinct referral_type, referrer_id, link_id, \" +\n \"version_id, keyword_id, match_type_id \" +\n \" from \" + table + \" where referral_type='\" + status.get(0) + \"'\" +\n \" and \" + condition;\n\n System.out.println(sql);\n Map<String, Object> sqlRowSet = jdbcTemplate.queryForMap(sql);\n\n System.out.println(\"Expected params in DB\" + status.toString());\n System.out.println(\"Actual param in DB\" + sqlRowSet.values().toString());\n assertThat(status.toString())\n .as(\"Transaction data stored in db\")\n .contains(sqlRowSet.values().toString());\n\n //check create date\n sql = \"select create_date \" +\n \" from \" + table + \" where \" + condition +\n \" and referral_type='\" + status.get(0) + \"'\" +\n \" and rownum <= 1\";\n\n\n sqlRowSet = jdbcTemplate.queryForMap(sql);\n DateFormat formatterDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date current_date = new Date();\n Date dateDB = (Date) sqlRowSet.get(\"CREATE_DATE\");\n assertThat(dateDB.toString())\n .as(\"Transaction data(CREATE_DATE) stored in db\")\n .contains(formatterDate.format(current_date));\n }", "boolean verifyJobDatabase();", "public static void verify() {\n\n\t\t\t\n\t\t\t\n\t\t\n\t}", "boolean checkVerification();", "public void verify() {\n lblTheDatabaseNameIsEmpty();\n lblDatabaseName();\n lblUserName();\n lblPassword();\n lblDatabaseLocation();\n txtPassword();\n txtUserName();\n txtDatabaseLocation();\n btSettings();\n txtDatabaseName();\n btCancel();\n btOK();\n }", "private void verifyChanges() {\n System.out.println(\"Verify changes\"); \n }", "@Override\n public boolean verifyJobDatabase() {\n try (Connection conn = getConnection()) {\n } catch (Exception e) {\n LOG.error(\"Failed to verify connection to the Job Database. \", e);\n return false;\n }\n return true;\n }", "public static Result makeConsistent() {\n\n\t\ttry {\n\t\t\tPromise<Boolean> p = Promise.promise(() -> ElasticReindexer.indexInconsistentDocs());\n\t\t} catch(Exception e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t\treturn internalServerError(e.getMessage());\n\t\t}\n\n\t\treturn ok();\n\t}", "public boolean isVerified() {\r\n return verified;\r\n }", "@Override\n\tvoid checkConsistency()\n\t{\n\t\t\n\t}", "public boolean isVerified() {\n return verified;\n }", "public void verifyConnectivity() {\n\n // Attempt to make a valid request to the VPLEX management server.\n URI requestURI = _baseURI.resolve(VPlexApiConstants.URI_CLUSTERS);\n ClientResponse response = null;\n try {\n response = get(requestURI);\n String responseStr = response.getEntity(String.class);\n s_logger.info(\"Verify connectivity response is {}\", responseStr);\n if (responseStr == null || responseStr.equals(\"\")) {\n s_logger.error(\"Response from VPLEX was empty.\");\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n int responseStatus = response.getStatus();\n if (responseStatus != VPlexApiConstants.SUCCESS_STATUS) {\n s_logger.info(\"Verify connectivity response status is {}\", responseStatus);\n if (responseStatus == VPlexApiConstants.AUTHENTICATION_STATUS) {\n // Bad user name and/or password.\n throw VPlexApiException.exceptions.authenticationFailure(_baseURI.toString());\n } else {\n // Could be a 404 because the IP was not that for a VPLEX.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n }\n } catch (VPlexApiException vae) {\n throw vae;\n } catch (Exception e) {\n // Could be a java.net.ConnectException for an invalid IP address\n // or a java.net.SocketTimeoutException for a bad port.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n } finally {\n if (response != null) {\n response.close();\n }\n }\n }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "@Test\n\tpublic void verifyStatusCode() {\n\t\tAssert.assertEquals(response.getStatusCode(), 200);\n\t}", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static void verifyPlaceStoreOrderResponse(Response response, long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) {\n verifySuccessStatusCodeInPlaceStoreOrderResponse(response);\n\n StoreOrderResponse storeOrderResponse = response.as(StoreOrderResponse.class);\n\n long actualId = storeOrderResponse.getId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - id, Actual: \" + actualId + \" , Expected: \" + expectedId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualId, expectedId, \"Place Store Order service response - id field error\");\n\n long actualPetId = storeOrderResponse.getPetId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - pet id, Actual: \" + actualPetId + \" , Expected: \" + expectedPetId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualPetId, expectedPetId, \"Place Store Order service response - pet id field error\");\n\n int actualQuantity = storeOrderResponse.getQuantity();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - quantity, Actual: \" + actualQuantity + \" , Expected: \" + expectedQuantity);\n MicroservicesEnvConfig.softAssert.assertEquals(actualQuantity, expectedQuantity, \"Place Store Order service response - quantity field error\");\n\n String actualShipDate = storeOrderResponse.getShipDate().substring(0,23);\n expectedShipDate = expectedShipDate.replace(\"Z\", \"\");\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - ship date, Actual: \" + actualShipDate + \" , Expected: \" + expectedShipDate);\n MicroservicesEnvConfig.softAssert.assertEquals(actualShipDate, expectedShipDate, \"Place Store Order service response - ship date field error\");\n\n String actualStatus = storeOrderResponse.getStatus();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status, Actual: \" + actualStatus + \" , Expected: \" + expectedStatus);\n MicroservicesEnvConfig.softAssert.assertEquals(actualStatus, expectedStatus, \"Place Store Order service response - status field error\");\n\n boolean actualCompleted = storeOrderResponse.isComplete();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - complete, Actual: \" + actualCompleted + \" , Expected: \" + expectedCompleted);\n MicroservicesEnvConfig.softAssert.assertEquals(actualCompleted, expectedCompleted, \"Place Store Order service response - complete field error\");\n }", "public static void verifySuccessStatusCodeInPlaceStoreOrderResponse(Response response) {\n int statusCode = response.then().extract().statusCode();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status code, Expected: 200, Actual: \" + statusCode);\n MicroservicesEnvConfig.softAssert.assertEquals(statusCode, 200, \"Place Store Order service response - status code error\");\n }", "public void validate() {\n for (Map.Entry<Integer, List<Message>> messagesOneId : messagesMap.entrySet()) {\n //get bank client\n int clientId = messagesOneId.getKey();\n BankClient bankClient = bankDatabase.get(clientId);\n\n //loop for each message with this ID\n for (Message messageData : messagesOneId.getValue()) {\n //check if this message is verified\n boolean isVerified = SignatureVerification.checkIsVerified(bankClient, messageData);\n //check if the request amount exceed limitation\n boolean isValid = checkIsValid(bankClient, messageData);\n //set the corresponding fields of message\n messageData.setVerified(isVerified);\n messageData.setValid(isValid);\n }\n }\n }", "public List<Message> verifyTransaction(Transaction t) {\n LOG.debug(\"verifyTransaction() started\");\n\n // List of error messages for the current transaction\n List<Message> errors = new ArrayList();\n\n // Check the chart of accounts code\n if (t.getChart() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_CHART_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the account\n if (t.getAccount() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ACCOUNT_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the object type\n if (t.getObjectType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the balance type\n if (t.getBalanceType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_BALANCE_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the fiscal year\n if (t.getOption() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_UNIV_FISCAL_YR_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the debit/credit code (only if we have a valid balance type code)\n if (t.getTransactionDebitCreditCode() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DEDIT_CREDIT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n else {\n if (t.getBalanceType() != null) {\n if (t.getBalanceType().isFinancialOffsetGenerationIndicator()) {\n if ((!OLEConstants.GL_DEBIT_CODE.equals(t.getTransactionDebitCreditCode())) && (!OLEConstants.GL_CREDIT_CODE.equals(t.getTransactionDebitCreditCode()))) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + \" '\" + OLEConstants.GL_DEBIT_CODE + \" or \" + OLEConstants.GL_CREDIT_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n else {\n if (!OLEConstants.GL_BUDGET_CODE.equals(t.getTransactionDebitCreditCode())) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + OLEConstants.GL_BUDGET_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n }\n }\n\n // KULGL-58 Make sure all GL entry primary key fields are not null\n if ((t.getSubAccountNumber() == null) || (t.getSubAccountNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_ACCOUNT_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialObjectCode() == null) || (t.getFinancialObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSubObjectCode() == null) || (t.getFinancialSubObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getUniversityFiscalPeriodCode() == null) || (t.getUniversityFiscalPeriodCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_FISCAL_PERIOD_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialDocumentTypeCode() == null) || (t.getFinancialDocumentTypeCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_TYPE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSystemOriginationCode() == null) || (t.getFinancialSystemOriginationCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ORIGIN_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getDocumentNumber() == null) || (t.getDocumentNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n \n // Don't need to check SequenceNumber because it sets in PosterServiceImpl, so commented out\n// if (t.getTransactionLedgerEntrySequenceNumber() == null) {\n// errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SEQUENCE_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n// }\n \n if (t.getBalanceType() != null && t.getBalanceType().isFinBalanceTypeEncumIndicator() && !t.getObjectType().isFundBalanceIndicator()){\n if (t.getTransactionEncumbranceUpdateCode().trim().equals(GeneralLedgerConstants.EMPTY_CODE)){\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ENCUMBRANCE_UPDATE_CODE_CANNOT_BE_BLANK_FOR_BALANCE_TYPE) + \" \" + t.getFinancialBalanceTypeCode(), Message.TYPE_FATAL));\n }\n }\n\n // The encumbrance update code can only be space, N, R or D. Nothing else\n if ((StringUtils.isNotBlank(t.getTransactionEncumbranceUpdateCode())) && (!\" \".equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_NO_ENCUMBRANCE_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_REFERENCE_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode()))) {\n errors.add(new Message(\"Invalid Encumbrance Update Code (\" + t.getTransactionEncumbranceUpdateCode() + \")\", Message.TYPE_FATAL));\n }\n\n \n\n return errors;\n }", "public void verifyMarkAsCompleteBackend(String engagementField, String engagementValue, String todoName,\n String status) throws SyncFactoryException {\n try {\n getLogger().info(\"Verify Completed field updated on database.\");\n // JSONObject jsonObject = MongoDB.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n if (jsonObject.get(\"completed\").toString().equals(status)) {\n NXGReports.addStep(\"Verify Completed field updated on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify Completed field updated on database.\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports\n .addStep(\"Verify Completed field updated on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "@Test(expected = org.apache.axis.AxisFault.class)\n\tpublic void testGetDatabaseStatus_3()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\t\tArrayOfDatabaseComponentHolder result = new ArrayOfDatabaseComponentHolder();\n\t\tDatabaseStatusHolder status = new DatabaseStatusHolder();\n\n\t\tfixture.getDatabaseStatus(aArguments, result, status);\n\n\t\t// add additional test code here\n\t}", "@Test\n public void testSuccess() throws Exception {\n\n client.makeBooking(\"Paul\", new Date(System.currentTimeMillis()), false);\n\n BookingStatus bookingStatus = client.getLastBookingStatus();\n Assert.assertTrue(\"Expected booking to be confirmed, but it wasn't: \" + bookingStatus, bookingStatus.equals(BookingStatus.CONFIRMED));\n }", "public void check() {\r\n logger.info(\"ADIT monitor - Checking database and application.\");\r\n\r\n checkApplication();\r\n\r\n checkDBConnection();\r\n checkDBRead(this.getMonitorConfiguration().getTestDocumentId());\r\n }", "private void verifyAuthWithServer() {\n mRegisterModel.connect(binding.personFirstName.getText().toString(),\n binding.personLastName.getText().toString(),\n binding.registerEmail.getText().toString(),\n binding.registerPassword.getText().toString());\n //this is an Asynchronous call no statements after should rely on the result of connect\n }", "public void setVerificationToSuccessful() {\n verificationSuccessful = true;\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\r\n success.validate();\r\n }\r\n }", "private void verifyAuthWithServer() {\n mResetModel.connect(\n myBinding.editResetEmail.getText().toString());\n //This is an Asynchronous call. No statements after should rely on the\n //result of connect().\n }", "private static void verifyMocksCalled(DataRequestResponse response) {\n for (ConnectionDetail entry : response.getResources().values()) {\n verify(((DataService) entry.createService()), times(1)).read(any());\n }\n }", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);", "public void verifyToDoCompleteBackend(String engagementField, String engagementValue, String todoName, String status) {\n try {\n getLogger().info(\"Verify To-Do complete status on database.\");\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n //TODO get from properties file\n if (jsonObject.get(\"completed\").toString().equals(status)) {\n NXGReports.addStep(\"Verify To-Do complete status on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify To-Do complete status on database.\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports.addStep(\"Verify To-Do complete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "public int verify() {\n\t\tint incorrect = 0; // Number of incorrect squares.\n\t\tint match = 0; // Number of matches in an array\n\n\t\t// Verify that the nonzero values in initialState\n\t\t// are the same numbers as in currentState.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.initialState[row][col] != 0) {\n\t\t\t\t\tif (this.initialState[row][col] != this.currentState[row][col]) {\n\t\t\t\t\t\tincorrect++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that there are no blank spots in the\n\t\t// sudoku. Blank spots, in this program, are\n\t\t// represented by zeroes. To do that, we'll\n\t\t// simply count the zeroes in the entire sudoku\n\t\t// and add them to 'incorrect'.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.currentState[col][row] == 0) {\n\t\t\t\t\tincorrect++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each row only has unique\n\t\t// numbers and that each number ranges\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[col][i]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each column only has unique\n\t\t// numbers and that each number range\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\tfor (int col = 0; col < 9; col++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[i][row]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each square has only unique\n\t\t// numbers and that each number range\n\t\t// from one through four.\n\t\t// First, I made four temporary 2x2 arrays,\n\t\t// then I basically put each square of the\n\t\t// sudoku into each array, then I checked\n\t\t// the validity of each square, incrementing\n\t\t// the incorrect variable by one for each\n\t\t// duplicate in each square.\n\n\t\t// từng hình vuông nhỏ\n\t\t// cho mục đích xác nhận\n\t\tint[][] tempOne = new int[3][3];\n\t\tint[][] tempTwo = new int[3][3];\n\t\tint[][] tempThree = new int[3][3];\n\t\tint[][] tempFour = new int[3][3];\n\t\tint[][] tempFive = new int[3][3];\n\t\tint[][] tempSix = new int[3][3];\n\t\tint[][] tempSeven = new int[3][3];\n\t\tint[][] tempEight = new int[3][3];\n\t\tint[][] tempNine = new int[3][3];\n\n\t\t// chia Sudoku thành 9 mảng nhỏ\n\t\t// 1 mảng cho 1 hình vuông\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t// chạy từng ô vuông nhỏ\n\t\t\tswitch (row) {\n\t\t\tcase 0:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"You shouldn't be here...\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// xác nhận mỗi hình vuông có duy nhất 1 số nguyên từ 1-9\n\t\tint matchOne = 0;\n\t\tint matchTwo = 0;\n\t\tint matchThree = 0;\n\t\tint matchFour = 0;\n\t\tint matchFive = 0;\n\t\tint matchSix = 0;\n\t\tint matchSeven = 0;\n\t\tint matchEight = 0;\n\t\tint matchNine = 0;\n\n\t\t// The first two for loops fix a number to be compared.\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int col = 0; col < 3; col++) {\n\n\t\t\t\t// These two for loops cycles through the square,\n\t\t\t\t// counting the number of matches along the way.\n\t\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\t\t\tif (tempOne[row][col] == tempOne[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchOne++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempTwo[row][col] == tempTwo[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchTwo++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempThree[row][col] == tempThree[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchThree++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFour[row][col] == tempFour[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFour++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFive[row][col] == tempFive[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFive++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSix[row][col] == tempSix[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSix++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSeven[row][col] == tempSeven[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSeven++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempEight[row][col] == tempEight[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchEight++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempNine[row][col] == tempNine[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchNine++;\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\n\t\t\t\t// If there is more than one match, the match variable\n\t\t\t\t// is decremented by one (so the original number isn't\n\t\t\t\t// counted) and added to the number of incorrect\n\t\t\t\t// squares in the sudoku.\n\t\t\t\tif (matchOne > 1) {\n\t\t\t\t\tincorrect += matchOne;\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t}\n\t\t\t\tif (matchTwo > 1) {\n\t\t\t\t\tincorrect += matchTwo;\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t}\n\t\t\t\tif (matchThree > 1) {\n\t\t\t\t\tincorrect += matchThree;\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t}\n\t\t\t\tif (matchFour > 1) {\n\t\t\t\t\tincorrect += matchFour;\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Returns the number of incorrect numbers in the array.\n\t\treturn incorrect;\n\t}", "boolean hasIsSuccess();", "@Override\r\n\tprotected void doVerify() {\n\t\t\r\n\t}", "public static List<HealthCheckVO> updateHealthCheckStatusInDB(List<HealthCheckVO> healthCheckVOs) throws SQLException {\n\t\t\n\t\tList<HealthCheckVO> returnStatusChangedList = new ArrayList<HealthCheckVO>();\n\t\tfor (HealthCheckVO healthCheckVO : healthCheckVOs) {\n\t\t\tif(healthCheckVO.getStatus() == null) {\n\t\t\t\tlogger.error(\"STATUS CHECK FAILED>> ComponentId : \" + healthCheckVO.getHealthCheckId()\n\t\t\t\t+ \"; RegionId : \" + healthCheckVO.getHealthCheckRegionId());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tStatus status = healthCheckVO.getStatus().getStatus();\n\t\t\tif (status == null) {\n\t\t\t\tlogger.error(\"STATUS CHECK FAILED>> ComponentId : \" + healthCheckVO.getHealthCheckId()\n\t\t\t\t\t\t+ \"; RegionId : \" + healthCheckVO.getHealthCheckRegionId());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(!status.equals(Status.UP)){\n\t\t\t\tlogger.info(\"STATUS CHECK SUCCESS>> HealthCheckId : \" + healthCheckVO.getHealthCheckId()\n\t\t\t\t\t\t+ \"; RegionId : \" + healthCheckVO.getHealthCheckRegionId()\n\t\t\t\t\t\t+ \"; isSuccess : \" + status.getStatusName()\n\t\t\t\t\t\t+ \"; Message : \" + status.getStatusDesc());\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tboolean isStatusChanged = updateStatus(healthCheckVO);\n\t\t\t\tif(isStatusChanged){\n\t\t\t\t\treturnStatusChangedList.add(healthCheckVO);\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tlogger.error(\"Exception in DB Update Doing Rollback\", ex);\n\t\t\t\tthrow ex;\n\t\t\t}\n\t\t}\n\t\tlogger.debug(\"DB Update Success - Doing commit\");\n\t\treturn returnStatusChangedList;\n\t}", "@Test\n\tpublic void testGetDatabaseStatus_1()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\t\tArrayOfDatabaseComponentHolder result = new ArrayOfDatabaseComponentHolder(new DatabaseComponent[] {});\n\t\tDatabaseStatusHolder status = new DatabaseStatusHolder(DatabaseStatus.fromString(\"\"));\n\n\t\tfixture.getDatabaseStatus(aArguments, result, status);\n\n\t\t// add additional test code here\n\t}", "@Test(expected = java.rmi.RemoteException.class)\n\tpublic void testGetDatabaseStatus_2()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\t\tArrayOfDatabaseComponentHolder result = new ArrayOfDatabaseComponentHolder();\n\t\tDatabaseStatusHolder status = new DatabaseStatusHolder();\n\n\t\tfixture.getDatabaseStatus(aArguments, result, status);\n\n\t\t// add additional test code here\n\t}", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }" ]
[ "0.5653011", "0.54916817", "0.5457542", "0.5404905", "0.53966284", "0.5365695", "0.53655475", "0.51522106", "0.51342165", "0.5054969", "0.50006235", "0.49968195", "0.4984771", "0.49754027", "0.49514732", "0.49449906", "0.49281567", "0.4915323", "0.49127832", "0.4889473", "0.4883374", "0.4860668", "0.48393282", "0.4837747", "0.48308754", "0.48263177", "0.48052138", "0.47558132", "0.47377256", "0.47338873", "0.47249845", "0.47224092", "0.47209108", "0.47204238", "0.47127116", "0.47010535", "0.46963006", "0.46903425", "0.46896395", "0.46891853", "0.46880296", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598" ]
0.5686271
0
Verify database is in a consistent state. When inconsistencies or errors are found, the verified_ok flag in the response is set to false and the list of errors found is provided in the error_list.
public AdminVerifyDbResponse adminVerifyDb(Map<String, String> options) throws GPUdbException { AdminVerifyDbRequest actualRequest_ = new AdminVerifyDbRequest(options); AdminVerifyDbResponse actualResponse_ = new AdminVerifyDbResponse(); submitRequest("/admin/verifydb", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AdminVerifyDbResponse adminVerifyDb(AdminVerifyDbRequest request) throws GPUdbException {\n AdminVerifyDbResponse actualResponse_ = new AdminVerifyDbResponse();\n submitRequest(\"/admin/verifydb\", request, actualResponse_, false);\n return actualResponse_;\n }", "public boolean verify();", "public void checkConsistency(List inconsistencies);", "public abstract boolean verify();", "@Override\n public void verifyDB_SIB_BID_Reg_Referral_Status(List<String> status, String table) {\n\n String condition;\n if (table.equals(\"purchase\")) {\n table = \"purchase_referral\";\n condition = \"create_date > sysdate -.01\";\n }\n else if (table.equals(\"registration\")) {\n table = \"registration_referral\";\n condition = \"customer_id =\" + this.getCustomerIDFromDB(authenticationParameters.getUsername());\n }\n else { //search_referral\n table = \"search_referral\";\n condition = \"search_id =\" + this.getSearchIDFromDB(authenticationParameters.getUsername());\n }\n\n String sql = \"select distinct referral_type, referrer_id, link_id, \" +\n \"version_id, keyword_id, match_type_id \" +\n \" from \" + table + \" where referral_type='\" + status.get(0) + \"'\" +\n \" and \" + condition;\n\n System.out.println(sql);\n Map<String, Object> sqlRowSet = jdbcTemplate.queryForMap(sql);\n\n System.out.println(\"Expected params in DB\" + status.toString());\n System.out.println(\"Actual param in DB\" + sqlRowSet.values().toString());\n assertThat(status.toString())\n .as(\"Transaction data stored in db\")\n .contains(sqlRowSet.values().toString());\n\n //check create date\n sql = \"select create_date \" +\n \" from \" + table + \" where \" + condition +\n \" and referral_type='\" + status.get(0) + \"'\" +\n \" and rownum <= 1\";\n\n\n sqlRowSet = jdbcTemplate.queryForMap(sql);\n DateFormat formatterDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date current_date = new Date();\n Date dateDB = (Date) sqlRowSet.get(\"CREATE_DATE\");\n assertThat(dateDB.toString())\n .as(\"Transaction data(CREATE_DATE) stored in db\")\n .contains(formatterDate.format(current_date));\n }", "boolean verifyJobDatabase();", "public static void verify() {\n\n\t\t\t\n\t\t\t\n\t\t\n\t}", "boolean checkVerification();", "public void verify() {\n lblTheDatabaseNameIsEmpty();\n lblDatabaseName();\n lblUserName();\n lblPassword();\n lblDatabaseLocation();\n txtPassword();\n txtUserName();\n txtDatabaseLocation();\n btSettings();\n txtDatabaseName();\n btCancel();\n btOK();\n }", "private void verifyChanges() {\n System.out.println(\"Verify changes\"); \n }", "@Override\n public boolean verifyJobDatabase() {\n try (Connection conn = getConnection()) {\n } catch (Exception e) {\n LOG.error(\"Failed to verify connection to the Job Database. \", e);\n return false;\n }\n return true;\n }", "public static Result makeConsistent() {\n\n\t\ttry {\n\t\t\tPromise<Boolean> p = Promise.promise(() -> ElasticReindexer.indexInconsistentDocs());\n\t\t} catch(Exception e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t\treturn internalServerError(e.getMessage());\n\t\t}\n\n\t\treturn ok();\n\t}", "public boolean isVerified() {\r\n return verified;\r\n }", "@Override\n\tvoid checkConsistency()\n\t{\n\t\t\n\t}", "public boolean isVerified() {\n return verified;\n }", "public void verifyConnectivity() {\n\n // Attempt to make a valid request to the VPLEX management server.\n URI requestURI = _baseURI.resolve(VPlexApiConstants.URI_CLUSTERS);\n ClientResponse response = null;\n try {\n response = get(requestURI);\n String responseStr = response.getEntity(String.class);\n s_logger.info(\"Verify connectivity response is {}\", responseStr);\n if (responseStr == null || responseStr.equals(\"\")) {\n s_logger.error(\"Response from VPLEX was empty.\");\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n int responseStatus = response.getStatus();\n if (responseStatus != VPlexApiConstants.SUCCESS_STATUS) {\n s_logger.info(\"Verify connectivity response status is {}\", responseStatus);\n if (responseStatus == VPlexApiConstants.AUTHENTICATION_STATUS) {\n // Bad user name and/or password.\n throw VPlexApiException.exceptions.authenticationFailure(_baseURI.toString());\n } else {\n // Could be a 404 because the IP was not that for a VPLEX.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n }\n } catch (VPlexApiException vae) {\n throw vae;\n } catch (Exception e) {\n // Could be a java.net.ConnectException for an invalid IP address\n // or a java.net.SocketTimeoutException for a bad port.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n } finally {\n if (response != null) {\n response.close();\n }\n }\n }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "@Test\n\tpublic void verifyStatusCode() {\n\t\tAssert.assertEquals(response.getStatusCode(), 200);\n\t}", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static void verifyPlaceStoreOrderResponse(Response response, long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) {\n verifySuccessStatusCodeInPlaceStoreOrderResponse(response);\n\n StoreOrderResponse storeOrderResponse = response.as(StoreOrderResponse.class);\n\n long actualId = storeOrderResponse.getId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - id, Actual: \" + actualId + \" , Expected: \" + expectedId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualId, expectedId, \"Place Store Order service response - id field error\");\n\n long actualPetId = storeOrderResponse.getPetId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - pet id, Actual: \" + actualPetId + \" , Expected: \" + expectedPetId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualPetId, expectedPetId, \"Place Store Order service response - pet id field error\");\n\n int actualQuantity = storeOrderResponse.getQuantity();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - quantity, Actual: \" + actualQuantity + \" , Expected: \" + expectedQuantity);\n MicroservicesEnvConfig.softAssert.assertEquals(actualQuantity, expectedQuantity, \"Place Store Order service response - quantity field error\");\n\n String actualShipDate = storeOrderResponse.getShipDate().substring(0,23);\n expectedShipDate = expectedShipDate.replace(\"Z\", \"\");\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - ship date, Actual: \" + actualShipDate + \" , Expected: \" + expectedShipDate);\n MicroservicesEnvConfig.softAssert.assertEquals(actualShipDate, expectedShipDate, \"Place Store Order service response - ship date field error\");\n\n String actualStatus = storeOrderResponse.getStatus();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status, Actual: \" + actualStatus + \" , Expected: \" + expectedStatus);\n MicroservicesEnvConfig.softAssert.assertEquals(actualStatus, expectedStatus, \"Place Store Order service response - status field error\");\n\n boolean actualCompleted = storeOrderResponse.isComplete();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - complete, Actual: \" + actualCompleted + \" , Expected: \" + expectedCompleted);\n MicroservicesEnvConfig.softAssert.assertEquals(actualCompleted, expectedCompleted, \"Place Store Order service response - complete field error\");\n }", "public static void verifySuccessStatusCodeInPlaceStoreOrderResponse(Response response) {\n int statusCode = response.then().extract().statusCode();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status code, Expected: 200, Actual: \" + statusCode);\n MicroservicesEnvConfig.softAssert.assertEquals(statusCode, 200, \"Place Store Order service response - status code error\");\n }", "public void validate() {\n for (Map.Entry<Integer, List<Message>> messagesOneId : messagesMap.entrySet()) {\n //get bank client\n int clientId = messagesOneId.getKey();\n BankClient bankClient = bankDatabase.get(clientId);\n\n //loop for each message with this ID\n for (Message messageData : messagesOneId.getValue()) {\n //check if this message is verified\n boolean isVerified = SignatureVerification.checkIsVerified(bankClient, messageData);\n //check if the request amount exceed limitation\n boolean isValid = checkIsValid(bankClient, messageData);\n //set the corresponding fields of message\n messageData.setVerified(isVerified);\n messageData.setValid(isValid);\n }\n }\n }", "public List<Message> verifyTransaction(Transaction t) {\n LOG.debug(\"verifyTransaction() started\");\n\n // List of error messages for the current transaction\n List<Message> errors = new ArrayList();\n\n // Check the chart of accounts code\n if (t.getChart() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_CHART_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the account\n if (t.getAccount() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ACCOUNT_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the object type\n if (t.getObjectType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the balance type\n if (t.getBalanceType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_BALANCE_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the fiscal year\n if (t.getOption() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_UNIV_FISCAL_YR_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the debit/credit code (only if we have a valid balance type code)\n if (t.getTransactionDebitCreditCode() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DEDIT_CREDIT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n else {\n if (t.getBalanceType() != null) {\n if (t.getBalanceType().isFinancialOffsetGenerationIndicator()) {\n if ((!OLEConstants.GL_DEBIT_CODE.equals(t.getTransactionDebitCreditCode())) && (!OLEConstants.GL_CREDIT_CODE.equals(t.getTransactionDebitCreditCode()))) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + \" '\" + OLEConstants.GL_DEBIT_CODE + \" or \" + OLEConstants.GL_CREDIT_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n else {\n if (!OLEConstants.GL_BUDGET_CODE.equals(t.getTransactionDebitCreditCode())) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + OLEConstants.GL_BUDGET_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n }\n }\n\n // KULGL-58 Make sure all GL entry primary key fields are not null\n if ((t.getSubAccountNumber() == null) || (t.getSubAccountNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_ACCOUNT_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialObjectCode() == null) || (t.getFinancialObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSubObjectCode() == null) || (t.getFinancialSubObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getUniversityFiscalPeriodCode() == null) || (t.getUniversityFiscalPeriodCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_FISCAL_PERIOD_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialDocumentTypeCode() == null) || (t.getFinancialDocumentTypeCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_TYPE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSystemOriginationCode() == null) || (t.getFinancialSystemOriginationCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ORIGIN_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getDocumentNumber() == null) || (t.getDocumentNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n \n // Don't need to check SequenceNumber because it sets in PosterServiceImpl, so commented out\n// if (t.getTransactionLedgerEntrySequenceNumber() == null) {\n// errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SEQUENCE_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n// }\n \n if (t.getBalanceType() != null && t.getBalanceType().isFinBalanceTypeEncumIndicator() && !t.getObjectType().isFundBalanceIndicator()){\n if (t.getTransactionEncumbranceUpdateCode().trim().equals(GeneralLedgerConstants.EMPTY_CODE)){\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ENCUMBRANCE_UPDATE_CODE_CANNOT_BE_BLANK_FOR_BALANCE_TYPE) + \" \" + t.getFinancialBalanceTypeCode(), Message.TYPE_FATAL));\n }\n }\n\n // The encumbrance update code can only be space, N, R or D. Nothing else\n if ((StringUtils.isNotBlank(t.getTransactionEncumbranceUpdateCode())) && (!\" \".equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_NO_ENCUMBRANCE_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_REFERENCE_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode()))) {\n errors.add(new Message(\"Invalid Encumbrance Update Code (\" + t.getTransactionEncumbranceUpdateCode() + \")\", Message.TYPE_FATAL));\n }\n\n \n\n return errors;\n }", "public void verifyMarkAsCompleteBackend(String engagementField, String engagementValue, String todoName,\n String status) throws SyncFactoryException {\n try {\n getLogger().info(\"Verify Completed field updated on database.\");\n // JSONObject jsonObject = MongoDB.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n if (jsonObject.get(\"completed\").toString().equals(status)) {\n NXGReports.addStep(\"Verify Completed field updated on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify Completed field updated on database.\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports\n .addStep(\"Verify Completed field updated on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "@Test(expected = org.apache.axis.AxisFault.class)\n\tpublic void testGetDatabaseStatus_3()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\t\tArrayOfDatabaseComponentHolder result = new ArrayOfDatabaseComponentHolder();\n\t\tDatabaseStatusHolder status = new DatabaseStatusHolder();\n\n\t\tfixture.getDatabaseStatus(aArguments, result, status);\n\n\t\t// add additional test code here\n\t}", "@Test\n public void testSuccess() throws Exception {\n\n client.makeBooking(\"Paul\", new Date(System.currentTimeMillis()), false);\n\n BookingStatus bookingStatus = client.getLastBookingStatus();\n Assert.assertTrue(\"Expected booking to be confirmed, but it wasn't: \" + bookingStatus, bookingStatus.equals(BookingStatus.CONFIRMED));\n }", "public void check() {\r\n logger.info(\"ADIT monitor - Checking database and application.\");\r\n\r\n checkApplication();\r\n\r\n checkDBConnection();\r\n checkDBRead(this.getMonitorConfiguration().getTestDocumentId());\r\n }", "private void verifyAuthWithServer() {\n mRegisterModel.connect(binding.personFirstName.getText().toString(),\n binding.personLastName.getText().toString(),\n binding.registerEmail.getText().toString(),\n binding.registerPassword.getText().toString());\n //this is an Asynchronous call no statements after should rely on the result of connect\n }", "public void setVerificationToSuccessful() {\n verificationSuccessful = true;\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\r\n success.validate();\r\n }\r\n }", "private void verifyAuthWithServer() {\n mResetModel.connect(\n myBinding.editResetEmail.getText().toString());\n //This is an Asynchronous call. No statements after should rely on the\n //result of connect().\n }", "private static void verifyMocksCalled(DataRequestResponse response) {\n for (ConnectionDetail entry : response.getResources().values()) {\n verify(((DataService) entry.createService()), times(1)).read(any());\n }\n }", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);", "public void verifyToDoCompleteBackend(String engagementField, String engagementValue, String todoName, String status) {\n try {\n getLogger().info(\"Verify To-Do complete status on database.\");\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n //TODO get from properties file\n if (jsonObject.get(\"completed\").toString().equals(status)) {\n NXGReports.addStep(\"Verify To-Do complete status on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify To-Do complete status on database.\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports.addStep(\"Verify To-Do complete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "public int verify() {\n\t\tint incorrect = 0; // Number of incorrect squares.\n\t\tint match = 0; // Number of matches in an array\n\n\t\t// Verify that the nonzero values in initialState\n\t\t// are the same numbers as in currentState.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.initialState[row][col] != 0) {\n\t\t\t\t\tif (this.initialState[row][col] != this.currentState[row][col]) {\n\t\t\t\t\t\tincorrect++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that there are no blank spots in the\n\t\t// sudoku. Blank spots, in this program, are\n\t\t// represented by zeroes. To do that, we'll\n\t\t// simply count the zeroes in the entire sudoku\n\t\t// and add them to 'incorrect'.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.currentState[col][row] == 0) {\n\t\t\t\t\tincorrect++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each row only has unique\n\t\t// numbers and that each number ranges\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[col][i]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each column only has unique\n\t\t// numbers and that each number range\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\tfor (int col = 0; col < 9; col++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[i][row]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each square has only unique\n\t\t// numbers and that each number range\n\t\t// from one through four.\n\t\t// First, I made four temporary 2x2 arrays,\n\t\t// then I basically put each square of the\n\t\t// sudoku into each array, then I checked\n\t\t// the validity of each square, incrementing\n\t\t// the incorrect variable by one for each\n\t\t// duplicate in each square.\n\n\t\t// từng hình vuông nhỏ\n\t\t// cho mục đích xác nhận\n\t\tint[][] tempOne = new int[3][3];\n\t\tint[][] tempTwo = new int[3][3];\n\t\tint[][] tempThree = new int[3][3];\n\t\tint[][] tempFour = new int[3][3];\n\t\tint[][] tempFive = new int[3][3];\n\t\tint[][] tempSix = new int[3][3];\n\t\tint[][] tempSeven = new int[3][3];\n\t\tint[][] tempEight = new int[3][3];\n\t\tint[][] tempNine = new int[3][3];\n\n\t\t// chia Sudoku thành 9 mảng nhỏ\n\t\t// 1 mảng cho 1 hình vuông\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t// chạy từng ô vuông nhỏ\n\t\t\tswitch (row) {\n\t\t\tcase 0:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"You shouldn't be here...\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// xác nhận mỗi hình vuông có duy nhất 1 số nguyên từ 1-9\n\t\tint matchOne = 0;\n\t\tint matchTwo = 0;\n\t\tint matchThree = 0;\n\t\tint matchFour = 0;\n\t\tint matchFive = 0;\n\t\tint matchSix = 0;\n\t\tint matchSeven = 0;\n\t\tint matchEight = 0;\n\t\tint matchNine = 0;\n\n\t\t// The first two for loops fix a number to be compared.\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int col = 0; col < 3; col++) {\n\n\t\t\t\t// These two for loops cycles through the square,\n\t\t\t\t// counting the number of matches along the way.\n\t\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\t\t\tif (tempOne[row][col] == tempOne[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchOne++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempTwo[row][col] == tempTwo[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchTwo++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempThree[row][col] == tempThree[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchThree++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFour[row][col] == tempFour[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFour++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFive[row][col] == tempFive[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFive++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSix[row][col] == tempSix[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSix++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSeven[row][col] == tempSeven[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSeven++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempEight[row][col] == tempEight[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchEight++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempNine[row][col] == tempNine[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchNine++;\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\n\t\t\t\t// If there is more than one match, the match variable\n\t\t\t\t// is decremented by one (so the original number isn't\n\t\t\t\t// counted) and added to the number of incorrect\n\t\t\t\t// squares in the sudoku.\n\t\t\t\tif (matchOne > 1) {\n\t\t\t\t\tincorrect += matchOne;\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t}\n\t\t\t\tif (matchTwo > 1) {\n\t\t\t\t\tincorrect += matchTwo;\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t}\n\t\t\t\tif (matchThree > 1) {\n\t\t\t\t\tincorrect += matchThree;\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t}\n\t\t\t\tif (matchFour > 1) {\n\t\t\t\t\tincorrect += matchFour;\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Returns the number of incorrect numbers in the array.\n\t\treturn incorrect;\n\t}", "boolean hasIsSuccess();", "@Override\r\n\tprotected void doVerify() {\n\t\t\r\n\t}", "public static List<HealthCheckVO> updateHealthCheckStatusInDB(List<HealthCheckVO> healthCheckVOs) throws SQLException {\n\t\t\n\t\tList<HealthCheckVO> returnStatusChangedList = new ArrayList<HealthCheckVO>();\n\t\tfor (HealthCheckVO healthCheckVO : healthCheckVOs) {\n\t\t\tif(healthCheckVO.getStatus() == null) {\n\t\t\t\tlogger.error(\"STATUS CHECK FAILED>> ComponentId : \" + healthCheckVO.getHealthCheckId()\n\t\t\t\t+ \"; RegionId : \" + healthCheckVO.getHealthCheckRegionId());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tStatus status = healthCheckVO.getStatus().getStatus();\n\t\t\tif (status == null) {\n\t\t\t\tlogger.error(\"STATUS CHECK FAILED>> ComponentId : \" + healthCheckVO.getHealthCheckId()\n\t\t\t\t\t\t+ \"; RegionId : \" + healthCheckVO.getHealthCheckRegionId());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(!status.equals(Status.UP)){\n\t\t\t\tlogger.info(\"STATUS CHECK SUCCESS>> HealthCheckId : \" + healthCheckVO.getHealthCheckId()\n\t\t\t\t\t\t+ \"; RegionId : \" + healthCheckVO.getHealthCheckRegionId()\n\t\t\t\t\t\t+ \"; isSuccess : \" + status.getStatusName()\n\t\t\t\t\t\t+ \"; Message : \" + status.getStatusDesc());\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tboolean isStatusChanged = updateStatus(healthCheckVO);\n\t\t\t\tif(isStatusChanged){\n\t\t\t\t\treturnStatusChangedList.add(healthCheckVO);\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tlogger.error(\"Exception in DB Update Doing Rollback\", ex);\n\t\t\t\tthrow ex;\n\t\t\t}\n\t\t}\n\t\tlogger.debug(\"DB Update Success - Doing commit\");\n\t\treturn returnStatusChangedList;\n\t}", "@Test\n\tpublic void testGetDatabaseStatus_1()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\t\tArrayOfDatabaseComponentHolder result = new ArrayOfDatabaseComponentHolder(new DatabaseComponent[] {});\n\t\tDatabaseStatusHolder status = new DatabaseStatusHolder(DatabaseStatus.fromString(\"\"));\n\n\t\tfixture.getDatabaseStatus(aArguments, result, status);\n\n\t\t// add additional test code here\n\t}", "@Test(expected = java.rmi.RemoteException.class)\n\tpublic void testGetDatabaseStatus_2()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\t\tArrayOfDatabaseComponentHolder result = new ArrayOfDatabaseComponentHolder();\n\t\tDatabaseStatusHolder status = new DatabaseStatusHolder();\n\n\t\tfixture.getDatabaseStatus(aArguments, result, status);\n\n\t\t// add additional test code here\n\t}", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (success != null) {\n success.validate();\n }\n }" ]
[ "0.5686271", "0.5653011", "0.54916817", "0.5457542", "0.53966284", "0.5365695", "0.53655475", "0.51522106", "0.51342165", "0.5054969", "0.50006235", "0.49968195", "0.4984771", "0.49754027", "0.49514732", "0.49449906", "0.49281567", "0.4915323", "0.49127832", "0.4889473", "0.4883374", "0.4860668", "0.48393282", "0.4837747", "0.48308754", "0.48263177", "0.48052138", "0.47558132", "0.47377256", "0.47338873", "0.47249845", "0.47224092", "0.47209108", "0.47204238", "0.47127116", "0.47010535", "0.46963006", "0.46903425", "0.46896395", "0.46891853", "0.46880296", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598", "0.46868598" ]
0.5404905
4
This endpoint runs the kmeans algorithm a heuristic algorithm that attempts to do kmeans clustering. An ideal kmeans clustering algorithm selects k points such that the sum of the mean squared distances of each member of the set to the nearest of the k points is minimized. The kmeans algorithm however does not necessarily produce such an ideal cluster. It begins with a randomly selected set of k points and then refines the location of the points iteratively and settles to a local minimum. Various parameters and options are provided to control the heuristic search.
public AggregateKMeansResponse aggregateKMeans(AggregateKMeansRequest request) throws GPUdbException { AggregateKMeansResponse actualResponse_ = new AggregateKMeansResponse(); submitRequest("/aggregate/kmeans", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Override\n public String kMeansClusters_json(int k) {\n\n List<Set<String>> kMeansClusters = new ArrayList<Set<String>>();\n\n if (k == 1) {\n // No algorithm needed\n kMeansClusters.add(new HashSet<String>(this.restaurantMap.keySet()));\n return this.clusterToJSON(kMeansClusters);\n }\n\n // restaurant clusters contains random centroids mapped to a set of its closest\n // restaurants (in id form)\n Map<double[], Set<String>> restaurantClusters = this.initiateClusters(k, this.restaurantMap.keySet());\n\n do {\n Set<String> emptyCluster = findEmptyCluster(restaurantClusters);\n Set<String> largestCluster = findLargestCluster(restaurantClusters);\n\n // Code below finds some random centroid within the largest cluster\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n for (String rID : largestCluster) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n double[] centroidInLargestCluster = this.generateRandomCentroid(minLat, maxLat, minLon, maxLon);\n\n // Find the empty cluster and reassign its centroid by placing it somewhere in\n // the largest cluster\n for (double[] centroid : restaurantClusters.keySet()) {\n if (restaurantClusters.get(centroid).equals(emptyCluster)) {\n centroid[0] = centroidInLargestCluster[0]; // New longitude based on largest cluster\n centroid[1] = centroidInLargestCluster[1]; // New latitude based on largest cluster\n break; // Once we find the empty cluster, we are done\n }\n }\n\n // Flag is true if any restaurants are reassigned to a new centroid\n // If no restaurants are reassigned, then we are done one run through\n boolean flag;\n do {\n this.reassignCentroids(restaurantClusters);\n flag = reassignRestaurants(restaurantClusters, this.restaurantMap.keySet());\n } while (flag);\n\n } while (atLeastOneEmptyCluster(restaurantClusters)); // Repeat if any empty clusters are detected\n\n // Add final restaurant clusters to list of clusters\n for (Set<String> cluster : restaurantClusters.values()) {\n kMeansClusters.add(cluster);\n }\n return this.clusterToJSON(kMeansClusters);\n }", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "public static int getOptimalK(Dataset<Row> vectorData) {\n\t\tList<Integer> K = new ArrayList<Integer>();\n\t\tList<Double> computeCost = new ArrayList<Double>();\n\n\t\tfor (int i = 2; i < 10; i++) {\n\n\t\t\tKMeans kMeansForTops = new KMeans().setK(i).setSeed(1L);\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tKMeansModel kMeansModel = kMeansForTops.fit(vectorData);\n\t\t\tSystem.out.println(\"Time to FIT \" + (System.currentTimeMillis() - start) / 1000);\n\t\t\tdouble cost = kMeansModel.computeCost(vectorData); // WCSS\n\t\t\t// KMeansSummary\n\t\t\tK.add(i);\n\t\t\tcomputeCost.add(cost);\n\t\t\t// System.out.println(\"================ Compite cost for K == \" + i + \" is == \"\n\t\t\t// + cost);\n\n\t\t\tDataset<Row> kMeansPredictions = kMeansModel.transform(vectorData);\n\n\t\t\tfor (int j = 0; j < i; j++) {\n\n\t\t\t\t// System.out.println(\"====================== Running it for \" + j + \"th cluster\n\t\t\t\t// when the K is \" + i);\n\t\t\t\t// System.out.println(\"====================== Range for the cluster count \" + i\n\t\t\t\t// + \" ===================\");\n\t\t\t\t// kMeansPredictions.where(kMeansPredictions.col(\"prediction\").equalTo(j)).agg(min(\"features\"),\n\t\t\t\t// max(\"features\")).show();\n\n\t\t\t}\n\n\t\t\t// kMeansPredictions.agg(min(\"features\"), max(\"features\")).show();\n\t\t\t// System.out.println(\"====================== Calculating Silhouette\n\t\t\t// ===================\");\n\n\t\t\t// Evaluate clustering by computing Silhouette score\n\t\t\tClusteringEvaluator topsEvaluator = new ClusteringEvaluator();\n\n\t\t\tdouble TopsSilhouette = topsEvaluator.evaluate(kMeansPredictions);\n\n\t\t\t// System.out.println(\"================ Silhouette score for K == \" + i + \" is\n\t\t\t// == \" + TopsSilhouette);\n\n\t\t}\n\n\t\tPlot plt = Plot.create();\n\t\t// plt.plot().add(K, computeCost).label(\"MyLabel\").linestyle(\"bx-\");\n\t\t// plt.plot().\n\n\t\tSystem.out.println(\"K List \" + K);\n\t\tSystem.out.println(\"Cost List \" + computeCost);\n\t\tplt.plot().add(K, computeCost).label(\"Elbow\").linestyle(\"--\");\n\t\tplt.xlabel(\"K\");\n\t\tplt.ylabel(\"Cost\");\n\t\tplt.title(\"Compute Cost for K-Means !\");\n\t\tplt.legend();\n\t\ttry {\n\t\t\tplt.show();\n\t\t} catch (IOException | PythonExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn 0;\n\n\t}", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "private static void k_means_offline(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "private Map<double[], Set<String>> initiateClusters(int k, Set<String> restaurantIDs) {\n // centroids[0] is lattitude and centroids[1] is longitude for a centroid\n // Map assigns restaurants to a specific centroid\n Map<double[], Set<String>> restaurantClusters = new HashMap<double[], Set<String>>();\n\n // Find the min and max latitudes and longitudes\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n\n for (String rID : restaurantIDs) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n\n // Create a number of centroids equal to k\n for (int i = 0; i < k; i++) {\n // generate random centroid based on min and max latitudes\n // and longitudes, with (currently) no assigned restaurants\n HashSet<String> emptySet = new HashSet<String>();\n restaurantClusters.put(this.generateRandomCentroid(minLat, maxLat, minLon, maxLon), emptySet);\n }\n\n // Assign each restaurant to its closest centroid\n\n for (String rID : restaurantIDs) {\n\n double[] newCentroid = null;\n double minDist = Double.MAX_VALUE;\n\n for (double[] centroid : restaurantClusters.keySet()) {\n double distance = this.computeDistance(centroid, this.restaurantMap.get(rID));\n if (distance < minDist) {\n newCentroid = centroid;\n minDist = distance;\n }\n }\n restaurantClusters.get(newCentroid).add(rID);\n }\n return restaurantClusters;\n }", "static void start() throws IOException\n {\n Double[][] center;\n JavaPairRDD<Integer, Tuple2<Double[], Double>> sol;\n\n center = create_center( num_k );\n\n // 5.do until terminate\n for( int iter=0; iter<num_iter; iter++ )\n\t\t{\n start_t = System.currentTimeMillis();\n\n center = spark_kmeans( center );\n\n end_t = System.currentTimeMillis();\n print_best( iter + 1 );\n\t\t}\n }", "private static void clustering(String inputFile, String outputDir, double opticsXi, int opticsMinPoints) {\n \tLOG.info(\"Begin clustering of stay points.\");\n \t\n \tELKIClusterer.cluster(inputFile, outputDir,\topticsXi, opticsMinPoints);\n \t\n \tLOG.info(\"Finished clustering of stay points.\");\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public void randSelectCenters(int k) {\r\n\t\tif (pointList == null || pointList.isEmpty())\r\n\t\t\treturn;\r\n\r\n\t\tList<Integer> range = IntStream.range(0, pointList.size()).boxed().collect(Collectors.toList());\r\n\t\tCollections.shuffle(range);\r\n\t\tfor (int cid : range.stream().limit(k).collect(Collectors.toList()))\r\n\t\t\tcenterList.add(pointList.get(cid));\r\n\t}", "private static void kmeans(int[] rgb, int k) {\n\t\tColor[] rgbColor = new Color[rgb.length];\r\n\t\tColor[] ColorCluster = new Color[rgb.length];\r\n\t\tint[] ColorClusterID = new int[rgb.length];\r\n\t\t\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgbColor[i] = new Color(rgb[i]);\r\n\t\t\tColorClusterID[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tColor[] currentCluster = new Color[k];\t\t\r\n\t\tint randomNumber[]= ThreadLocalRandom.current().ints(0, rgb.length).distinct().limit(k).toArray();\r\n\t\tColor[] modifiedColorCluster = new Color[k];\t\r\n\t\t\r\n\t\tfor(int j=0;j<k;j++) {\r\n\t\t\tcurrentCluster[j]=rgbColor[randomNumber[j]];\r\n\t\t}\r\n\t\tint flag = 1;\r\n\t\tint maxIterations = 1000;\r\n\t\tint numIteration=0;\r\n\t\tdouble[] distance = new double[maxIterations+1];\t\t\r\n\t\tdistance[0]=Double.MAX_VALUE;\r\n\t\twhile(flag == 1) {\r\n\t\t\tflag = 0;\r\n\t\t\tnumIteration++;\r\n\t\t\tdistance[numIteration]=assignCLustersToPixels(rgbColor,currentCluster,ColorCluster,ColorClusterID,k,rgb.length);\r\n\t\t\tmodifiedColorCluster= findMeans(rgbColor,ColorClusterID,modifiedColorCluster,k,rgb.length);\r\n\t\t\tif(!clusterCenterCheck(currentCluster, modifiedColorCluster,k)){\r\n\t\t\t\tflag = 1;\r\n\t\t\t\tfor(int j=0;j<k;j++) {\r\n\t\t\t\t\tcurrentCluster[j]=modifiedColorCluster[j];}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgb[i]= getValue(ColorCluster[i].getRed(),ColorCluster[i].getGreen(),ColorCluster[i].getBlue());\r\n\t\t}\r\n\t\treturn;\r\n\t }", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "public Map<double[], Integer> kmeans(int distance, Map<Integer, double[]> centroids, int k) {\n Map<double[], Integer> clusters = new HashMap<>();\n int k1 = 0;\n double dist = 0.0;\n for (double[] x : features) {\n double minimum = 999999.0;\n for (int j = 0; j < k; j++) {\n if (distance == 1) {\n dist = Distance.eucledianDistance(centroids.get(j), x);\n } else if (distance == 2) {\n dist = Distance.manhattanDistance(centroids.get(j), x);\n }\n if (dist < minimum) {\n minimum = dist;\n k1 = j;\n }\n\n }\n clusters.put(x, k1);\n }\n\n return clusters;\n }", "@Override\n \tpublic Collection<Collection<Integer>> call() throws Exception {\n \t\tEdgeWeighter<HomologyEdge> weighter = new EdgeWeighter<HomologyEdge>() {\n \t\t\t@Override\n \t\t\tpublic double getWeight(HomologyEdge e) {\n \t\t\t\treturn e.getWeight();\n \t\t\t}\n \t\t};\n \t\tProbabilisticDistanceClusterer<Integer, HomologyEdge> alg = new ProbabilisticDistanceClusterer<Integer, HomologyEdge>(\n \t\t\t\tweighter, xi);\n \t\tSet<Set<Integer>> ccs = alg.transform(graph.getHomology());\n \n \t\t// now map each cluster to a root for that cluster\n \t\t// the choice of root is arbitrary and just for hashing\n \t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n \t\tfor (Set<Integer> cc : ccs) {\n \t\t\tint v0 = -1;\n \t\t\tint i = 0;\n \t\t\tfor (int v : cc) {\n \t\t\t\tif (i == 0) v0 = v;\n \t\t\t\tmap.put(v, v0);\n \t\t\t\ti++;\n \t\t\t}\n \t\t}\n \n \t\t// find the cliques\n \t\tBronKerboschCliqueFinder<Integer, HomologyEdge> finder = new BronKerboschCliqueFinder<>();\n \t\tCollection<Set<Integer>> cliques = finder.transform(graph.getHomology());\n \n \t\t// group the cliques by sets of interactions\n \t\tNavigableMap<String, Collection<Integer>> cliqueGroups = new TreeMap<>();\n \t\tfor (Set<Integer> clique : cliques) {\n \t\t\tfor (int v : clique) {\n \t\t\t\tCollection<Integer> neighbors = graph.getInteractionNeighbors(v);\n \t\t\t\tString hash = hashVertexInteractions(neighbors, map);\n \t\t\t\tCollection<Integer> group = cliqueGroups.get(hash);\n \t\t\t\tif (group == null) group = new TreeSet<>();\n \t\t\t\tgroup.add(v);\n \t\t\t}\n \t\t}\n \n \t\t// now we just want a set to return\n \t\tSet<Collection<Integer>> set = new TreeSet<>();\n \t\tset.addAll(cliqueGroups.values());\n \n \t\treturn set;\n \t}", "protected static <T> Set<List<T>> cluster(ISearchIndex<T> index, double epsilon, int minimum) {\n Set<List<T>> clusters = new HashSet<List<T>>();\n Set<T> visited = new HashSet<T>();\n Set<T> noise = new HashSet<T>();\n\n for (T element : index) {\n if (visited.contains(element)) {\n continue;\n }\n visited.add(element);\n\n List<T> neighbors = index.radius(element, epsilon);\n\n if (neighbors.size() < minimum) {\n noise.add(element);\n } else {\n List<T> cluster = new LinkedList<T>();\n\n LinkedList<T> seeds = new LinkedList<T>();\n for (T neighbor : neighbors) {\n seeds.push(neighbor);\n visited.add(neighbor);\n cluster.add(neighbor);\n noise.remove(neighbor);\n }\n\n while (!seeds.isEmpty()) {\n T seed = seeds.pollLast();\n List<T> exteriors = index.radius(seed, epsilon);\n\n if (exteriors.size() >= minimum) {\n Set<T> subvisited = new HashSet<T>();\n for (T exterior : exteriors) {\n if (!visited.contains(exterior)) {\n seeds.push(exterior);\n subvisited.add(exterior);\n cluster.add(exterior);\n }\n if (noise.contains(exterior)) {\n noise.remove(exterior);\n cluster.add(exterior);\n }\n }\n visited.addAll(subvisited);\n }\n }\n\n clusters.add(cluster);\n }\n }\n\n return clusters;\n }", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public static int optimalK(Dataset<Row> vectorData) {\n\n\t\tHashMap<Double, Integer> scoreKMap = new HashMap<Double, Integer>();\n\t\tdouble maxSilhouetteScore = -1;\n\t\tint optimalK = 0;\n\n\t\tfor (int i = 2; i < 10; i++) {\n\n\t\t\tKMeans kMeans = new KMeans().setK(i).setSeed(1L).setPredictionCol(\"prediction\");\n\t\t\tKMeansModel kMeansModel = kMeans.fit(vectorData);\n\t\t\tDataset<Row> kMeansPredictions = kMeansModel.transform(vectorData);\n\t\t\tint maxAssignedClusterNumber = kMeansPredictions.agg(min(\"prediction\"), max(\"prediction\")).head().getInt(1);\n\t\t\tint minAssignedClusterNumber = kMeansPredictions.agg(min(\"prediction\"), max(\"prediction\")).head().getInt(0);\n\t\t\tif (maxAssignedClusterNumber == minAssignedClusterNumber) {\n\t\t\t\toptimalK = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tClusteringEvaluator topsEvaluator = new ClusteringEvaluator();\n\t\t\tdouble silhouetteScore = topsEvaluator.evaluate(kMeansPredictions);\n\t\t\tscoreKMap.put(silhouetteScore, i);\n\t\t\tif (silhouetteScore > maxSilhouetteScore) {\n\t\t\t\tmaxSilhouetteScore = silhouetteScore;\n\t\t\t\toptimalK = i;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Silhouette score when K = \" + i + \" is \" + silhouetteScore);\n\t\t}\n\n\t\tSystem.out.println(\"Optimal K turned out to be \" + optimalK);\n\t\treturn optimalK;\n\n\t}", "public static void main(String[] args) {\n Random r = new Random();\n// r.setSeed(1982);\n int R = 500;\n int L = 100000;\n\n int start = -500;\n int end = 500;\n HashSet<Point> hi3 = new HashSet<>();\n List<Point> hi5 = new ArrayList<>();\n Stopwatch sw = new Stopwatch();\n for (int i = 0; i < L; i += 1) {\n double ran = r.nextDouble();\n double x = start + (ran * (end - start));\n ran = r.nextDouble();\n double y = start + (ran * (end - start));\n Point temp = new Point(x, y);\n hi5.add(temp);\n\n }\n KDTree speedTest = new KDTree(hi5);\n NaivePointSet speedTest2 = new NaivePointSet(hi5);\n\n// for (int i = 0; i < 1000; i++) {\n// double ran = r.nextDouble();\n// double x2 = start + (ran *(end - start));\n// ran = r.nextDouble();\n// double y2 = start + (ran *(end - start));\n// assertEquals(speedTest2.nearest(x2, y2), speedTest.nearest(x2, y2 ));\n// }\n// assertEquals(speedTest2.nearest(r.nextInt(R + 1 - 500) + 500,\n// r.nextInt(R + 1 - 500) + 100), speedTest.nearest(427.535670, -735.656403));\n\n System.out.println(\"elapsed time1: \" + sw.elapsedTime());\n\n int R2 = 100;\n int L2 = 10000;\n Stopwatch sw2 = new Stopwatch();\n for (int i = 0; i < L2; i += 1) {\n\n speedTest2.nearest(r.nextDouble(), r.nextDouble());\n }\n\n System.out.println(\"elapsed time: \" + sw2.elapsedTime());\n }", "public static Tour NNHeuristic (double distancematrix [][], Cluster cluster) {\n Stack<Integer> stack= new Stack<Integer>();\n Tour tour = new Tour(0);\n double length =0;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n Point out = cluster.getOutPoint ();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n\n tour.addPoint(out);\n tour.addPoint(in);\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n\n int element, dst = 0, i, pos = 0;\n stack.push(in.getPointNumber());\n element = stack.peek() - 1;\n boolean minFlag = false;\n while (!stack.isEmpty()) {\n double min = Integer.MAX_VALUE;\n for (i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (distancematrix[element][cityIndex] > 0 && visited[i] == 0) {\n if (min > distancematrix[element][cityIndex]) {\n min = distancematrix[element][cityIndex];\n dst = cityIndex + 1;\n pos = i;\n minFlag = true;\n }\n }\n }\n if (minFlag) {\n length = length + min;\n visited[pos] = 1;\n stack.push(dst);\n element = stack.peek() - 1;\n tour.addPoint(cluster.getPoints().get(pos));\n minFlag = false;\n continue;\n }\n stack.pop();\n }\n tour.removePoint(out);\n tour.removePoint(in);\n tour.addPoint(out);\n tour.addPoint(in);\n }\n return tour;\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "public void pruneWithApriori(double startEpsilon, double epsilonMultiplier, double shrinkFactor, double maxApproximationSize, int numBuckets, int topK, long startMS){\n CB = new CorrelationBounding(HB.data, useEmpiricalBounds, parallel);\r\n HierarchicalBounding.CB = CB; // pass the corrbounding object to the hierarchbounding object to prevent double work\r\n\r\n // get clusters:\r\n long startClustering = System.currentTimeMillis();\r\n System.out.print(\"constructing hierarchical clustering...\");\r\n RecursiveClustering RC = new RecursiveClustering(HB.data, CB, HB.maxLevels, HB.defaultDesiredClusters, HB.useKMeans, HB.breakFirstKLevelsToMoreClusters, HB.clusteringRetries);\r\n RC.fitRecursiveClusters(startEpsilon, epsilonMultiplier);\r\n long stopClustering = System.currentTimeMillis();\r\n System.out.println(\" --> clustering finished, took \" + ((stopClustering-startClustering)/1000) + \" seconds\");\r\n this.allclusters = RC.allClusters;\r\n this.clustersPerLevel = RC.clustersPerLevel;\r\n this.globalClustID = RC.globalClustID;\r\n\r\n CB.initializeBoundsCache(globalClustID, useEmpiricalBounds);\r\n\r\n ArrayList<Cluster> topLevelClusters = this.clustersPerLevel.get(0);\r\n Cluster rootCluster = topLevelClusters.get(0);\r\n this.rootCluster = rootCluster;\r\n\r\n\r\n\r\n // progressive approximation class in order to get results quickly:\r\n ProgressiveApproximation PA = new ProgressiveApproximation(corrThreshold, useEmpiricalBounds, minJump, maxApproximationSize, header, CB);\r\n\r\n\r\n\r\n //multipoles root candidate:\r\n ArrayList<Cluster> firstClusterComb = new ArrayList<>(2);\r\n firstClusterComb.add(rootCluster);// firstClusterComb.add(rootCluster);\r\n// List<ClusterCombination> candidates = new ArrayList<>(1);\r\n// ClusterCombination rootcandidate = new MultipoleClusterCombination(firstClusterComb);\r\n// candidates.add(rootcandidate);\r\n\r\n\r\n\r\n //multipearson root candidate:\r\n// ArrayList<Cluster> rootLHS = new ArrayList<>(1); rootLHS.add(rootCluster);\r\n// ArrayList<Cluster> rootRHS = new ArrayList<>(1); rootRHS.add(rootCluster); //rootRHS.add(rootCluster); rootRHS.add(rootCluster);\r\n// ClusterCombination rootcandidate = new MultiPearsonClusterCombination(rootLHS, rootRHS);\r\n\r\n\r\n\r\n\r\n //progress overview:\r\n System.out.print(\"|\");\r\n for(int i = 0; i<100; i++){\r\n System.out.print(\".\");\r\n }\r\n System.out.print(\"|\");\r\n System.out.println();\r\n\r\n\r\n // level-wise evaluation of the candidates\r\n for(int p=2; p<=maxP; p++){\r\n firstClusterComb.add(rootCluster);\r\n ClusterCombination rootcandidate = new MultipoleClusterCombination(firstClusterComb);\r\n\r\n List<ClusterCombination> candidates = new ArrayList<>(1);\r\n candidates.add(rootcandidate);\r\n\r\n System.out.println(\"---------------start evaluating level: \"+ p + \" at time \" + LocalTime.now() +\". Number of positives so far: \" + this.positiveResultSet.size() +\". Runtime so far: \" + (System.currentTimeMillis() - startMS)/1000);\r\n\r\n Map<Boolean, List<ClusterCombination>> groupedDCCs = evaluateCandidates(candidates, shrinkFactor, maxApproximationSize, parallel);\r\n\r\n if(positiveDCCs.size() > topK){\r\n positiveDCCs = getStream(positiveDCCs, parallel)\r\n .sorted((cc1, cc2) -> Double.compare(cc2.getLB(), cc1.getLB()))\r\n .limit(topK)\r\n .collect(Collectors.toList());\r\n PA.corrThreshold = positiveDCCs.get(positiveDCCs.size()-1).getLB();\r\n corrThreshold = PA.corrThreshold;\r\n }\r\n\r\n\r\n //progressive approximation within this level p:\r\n List<ClusterCombination> approximatedCCs = getStream(groupedDCCs.get(false), parallel).filter(dcc -> dcc.getCriticalShrinkFactor() <= 1).collect(Collectors.toList());\r\n// PA.testApproximationQuality(approximatedCCs, numBuckets, p, parallel);\r\n this.positiveDCCs = PA.ApproximateProgressively(approximatedCCs, numBuckets, positiveDCCs, parallel, topK, startMS);\r\n corrThreshold = PA.corrThreshold; // for topK -> carry over the updated tau to next p\r\n this.positiveResultSet = PostProcessResults.removeDuplicatesAndToString(this.positiveDCCs, header, CB, parallel);\r\n\r\n // get the approximated candidates to generate the next-level candidates from. the advantage is that we get a head-start down the clustering tree and do not have to start from the top\r\n ArrayList<ClusterCombination> DCCs = new ArrayList<>(groupedDCCs.get(false).size() + groupedDCCs.get(true).size());\r\n DCCs.addAll(groupedDCCs.get(false)); DCCs.addAll(groupedDCCs.get(true));\r\n System.out.println(\"tau updated to \" + corrThreshold);\r\n\r\n\r\n\r\n// if(p<maxP){\r\n// System.out.println(\"level \" + p + \" finished at time \"+ LocalTime.now() + \". generating candidates for level \" + (p+1) +\". #DCCs: \" + DCCs.size() +\". positives so far: \" + this.positiveResultSet.size() + \". Runtime so far (s): \" + (System.currentTimeMillis()-startMS)/1000);\r\n//\r\n//\r\n//\r\n// if(DCCs.get(0).isMultipoleCandidate()){ // multipole pattern\r\n//\r\n// candidates = generateCandidates(DCCs, parallel);\r\n//\r\n// }else{ // multiPearson pattern -> make distinction on adding vectors to LHS or RHS. better performance: use HIerarchicalbounding without level generation.\r\n//\r\n//\r\n// candidates = new ArrayList<>();\r\n//\r\n//\r\n//\r\n// // first generate candidates by adding to RHS\r\n// if(parallel){\r\n// DCCs = (ArrayList<ClusterCombination>) DCCs.parallelStream()\r\n// .sorted(this::lexicographicalOrdering)\r\n// .collect(Collectors.toList());\r\n// }else{\r\n// DCCs.sort(this::lexicographicalOrdering);\r\n// }\r\n// List<ClusterCombination> partial = generateCandidates(DCCs, parallel);\r\n// if(partial!= null){\r\n// candidates.addAll(partial);\r\n// }\r\n//\r\n// //now by adding to LHS: (hack by swapping the LHS and RHS and calling the same methods\r\n// //note that we do not need to swap those in which the size of the LHS and RHS is the same\r\n// ArrayList<ClusterCombination> swappedDCCs;\r\n// if(parallel){\r\n// swappedDCCs = (ArrayList<ClusterCombination>) DCCs.parallelStream()\r\n// .filter(cc -> cc.getLHS().size() != cc.getRHS().size()) // ignore those where lhs and rhs are of the same size\r\n// .collect(Collectors.toList());\r\n// swappedDCCs.parallelStream()\r\n// .forEach(cc -> ((MultiPearsonClusterCombination) cc).swapLeftRightSide());\r\n//\r\n// swappedDCCs = (ArrayList<ClusterCombination>) swappedDCCs.parallelStream()\r\n// .sorted(this::lexicographicalOrdering)\r\n// .collect(Collectors.toList());\r\n// }else{\r\n// swappedDCCs = (ArrayList<ClusterCombination>) DCCs.stream()\r\n// .filter(cc -> cc.getLHS().size() != cc.getRHS().size()) // ignore those where lhs and rhs are of the same size\r\n// .collect(Collectors.toList());\r\n//\r\n// swappedDCCs.forEach(cc -> ((MultiPearsonClusterCombination) cc).swapLeftRightSide());\r\n// swappedDCCs.sort(this::lexicographicalOrdering);\r\n// }\r\n//\r\n// partial = generateCandidates(swappedDCCs, parallel);\r\n// if(partial!= null){\r\n// candidates.addAll(partial);\r\n// }\r\n//\r\n//\r\n// }\r\n//\r\n//\r\n// }\r\n }\r\n\r\n }", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k,\n\t\t\tBiFunction<Position, Position, Double> metric);", "void unionTreeCoreset(int k,int n_1,int n_2,int d, Point[] setA,Point[] setB, Point[] centres, MTRandom clustererRandom) {\n\t\t//printf(\"Computing coreset...\\n\");\n\t\t//total number of points\n\t\tint n = n_1+n_2;\n\n\t\t//choose the first centre (each point has the same probability of being choosen)\n\t\t\n\t\t//stores, how many centres have been choosen yet\n\t\tint choosenPoints = 0; \n\t\t\n\t\t//only choose from the n-i points not already choosen\n\t\tint j = clustererRandom.nextInt(n-choosenPoints); \n\n\t\t//copy the choosen point\n\t\tif(j < n_1){\n\t\t\t//copyPointWithoutInit(&setA[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setA[j].clone();\n\t\t} else {\n\t\t\tj = j - n_1;\n\t\t\t//copyPointWithoutInit(&setB[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setB[j].clone();\n\t\t}\n\t\ttreeNode root = new treeNode(setA,setB,n_1,n_2, centres[choosenPoints],choosenPoints); //??\n\t\tchoosenPoints = 1;\n\t\t\n\t\t//choose the remaining points\n\t\twhile(choosenPoints < k){\n\t\t\tif(root.cost > 0.0){\n\t\t\t\ttreeNode leaf = selectNode(root, clustererRandom);\n\t\t\t\tPoint centre = chooseCentre(leaf, clustererRandom);\n\t\t\t\tsplit(leaf,centre,choosenPoints);\n\t\t\t\t//copyPointWithoutInit(centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = centre;\n\t\t\t} else {\n\t\t\t\t//create a dummy point\n\t\t\t\t//copyPointWithoutInit(root.centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = root.centre;\n\t\t\t\tint l;\n\t\t\t\tfor(l=0;l<root.centre.dimension;l++){\n\t\t\t\t\tcentres[choosenPoints].coordinates[l] = -1 * 1000000;\n\t\t\t\t}\n\t\t\t\tcentres[choosenPoints].id = -1;\n\t\t\t\tcentres[choosenPoints].weight = 0.0;\n\t\t\t\tcentres[choosenPoints].squareSum = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\tchoosenPoints++;\n\t\t}\n\n\t\t//free the tree\n\t\tfreeTree(root);\n\n\t\t//recalculate clustering features\n\t\tint i;\n\t\tfor(i=0;i<n;i++){\n\t\t\t\t\n\t\t\tif(i < n_1) {\n\t\t\t\t\n\t\t\t\tint index = setA[i].centreIndex;\n\t\t\t\tif(centres[index].id != setA[i].id){\n\t\t\t\t\tcentres[index].weight += setA[i].weight;\n\t\t\t\t\tcentres[index].squareSum += setA[i].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setA[i].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setA[i].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tint index = setB[i-n_1].centreIndex;\n\t\t\t\tif(centres[index].id != setB[i-n_1].id){\n\t\t\t\t\tcentres[index].weight += setB[i-n_1].weight;\n\t\t\t\t\tcentres[index].squareSum += setB[i-n_1].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setB[i-n_1].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setB[i-n_1].coordinates[l];\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 BrutePointST<Integer> st = new BrutePointST<Integer>();\n double qx = Double.parseDouble(args[0]);\n double qy = Double.parseDouble(args[1]);\n double rx1 = Double.parseDouble(args[2]);\n double rx2 = Double.parseDouble(args[3]);\n double ry1 = Double.parseDouble(args[4]);\n double ry2 = Double.parseDouble(args[5]);\n int k = Integer.parseInt(args[6]);\n Point2D query = new Point2D(qx, qy);\n RectHV rect = new RectHV(rx1, ry1, rx2, ry2);\n int i = 0;\n while (!StdIn.isEmpty()) {\n double x = StdIn.readDouble();\n double y = StdIn.readDouble();\n Point2D p = new Point2D(x, y);\n st.put(p, i++);\n }\n StdOut.println(\"st.empty()? \" + st.isEmpty());\n StdOut.println(\"st.size() = \" + st.size());\n StdOut.println(\"First \" + k + \" values:\");\n i = 0;\n for (Point2D p : st.points()) {\n StdOut.println(\" \" + st.get(p));\n if (i++ == k) {\n break;\n }\n }\n StdOut.println(\"st.contains(\" + query + \")? \" + st.contains(query));\n StdOut.println(\"st.range(\" + rect + \"):\");\n for (Point2D p : st.range(rect)) {\n StdOut.println(\" \" + p);\n }\n StdOut.println(\"st.nearest(\" + query + \") = \" + st.nearest(query));\n StdOut.println(\"st.nearest(\" + query + \", \" + k + \"):\");\n for (Point2D p : st.nearest(query, k)) {\n StdOut.println(\" \" + p);\n }\n }", "public ArrayList<ArrayList<Example>> kmeanlearn(int k, int n, boolean dist) {\n kmean = new KMean(new ArrayList<Example>(learningData.getExamples().subList(n+1, learningData.getExamples().size())), k);\n kmean.kmeanAlgorithm(dist);\n return kmean.getCluster();\n }", "public static HashMap<LonLat,ArrayList<STPoint>> clustering2dKNSG(IKernel kernel,ArrayList<STPoint> data,double h,double e) {\n\t\tHashMap<LonLat,ArrayList<STPoint>> result = new HashMap<LonLat,ArrayList<STPoint>>();\n\t\tint N = data.size();\n\t\t//\t\tSystem.out.println(\"#number of points : \"+N);\n\n\t\tfor(STPoint point:data) {\n\t\t\t// seek mean value //////////////////\n\t\t\tLonLat mean = new LonLat(point.getLon(),point.getLat());\n\n\t\t\t//loop from here for meanshift\n\t\t\twhile(true) {\n\t\t\t\tdouble numx = 0d;\n\t\t\t\tdouble numy = 0d;\n\t\t\t\tdouble din = 0d;\n\t\t\t\tfor(int j=0;j<N;j++) {\n\t\t\t\t\tLonLat p = new LonLat(data.get(j).getLon(),data.get(j).getLat());\n\t\t\t\t\tdouble k = kernel.getDensity(mean,p,h);\n\t\t\t\t\tnumx += k * p.getLon();\n\t\t\t\t\tnumy += k * p.getLat();\n\t\t\t\t\tdin += k;\n\t\t\t\t}\n\t\t\t\tLonLat m = new LonLat(numx/din,numy/din);\n\t\t\t\tif( mean.distance(m) < e ) { mean = m; break; }\n\t\t\t\tmean = m;\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(\"#mean is : \" + mean);\n\t\t\t// make cluster /////////////////////\n\t\t\tArrayList<STPoint> cluster = null;\n\t\t\tfor(LonLat p:result.keySet()) {\n\t\t\t\tif( mean.distance(p) < e ) { cluster = result.get(p); break; }\n\t\t\t}\n\t\t\tif( cluster == null ) {\n\t\t\t\tcluster = new ArrayList<STPoint>();\n\t\t\t\tresult.put(mean,cluster);\n\t\t\t}\n\t\t\tcluster.add(point);\n\t\t}\n\t\treturn result;\n\t}", "public org.apache.spark.mllib.clustering.KMeansModel train (org.apache.spark.rdd.RDD<org.apache.spark.mllib.linalg.Vector> data, int k, int maxIterations) { throw new RuntimeException(); }", "@Test\n public void test27() throws Throwable {\n SimpleKMeans simpleKMeans0 = new SimpleKMeans();\n String[] stringArray0 = simpleKMeans0.getOptions();\n Vote.main(stringArray0);\n }", "private static void automate() {\n \tLOG.info(\"Begin automation task.\");\n \t\n \tcurrentOpticsXi = clArgs.clusteringOpticsXi;\n \tdouble opticsXiMax = (clArgs.clusteringOpticsXiMaxValue > ELKIClusterer.MAX_OPTICS_XI ? ELKIClusterer.MAX_OPTICS_XI : clArgs.clusteringOpticsXiMaxValue);\n \tcurrentOpticsMinPoints = clArgs.clusteringOpticsMinPts;\n \tint opticsMinPointsMax = clArgs.clusteringOpticsMinPtsMaxValue;\n \t\n \tLOG.info(\"optics-xi-start: {}, optics-xi-min-points-start: {}, optics-xi-step-size: {}, optics-min-points-step-size: {}\",\n \t\t\tnew Object[] { \n \t\t\t\tdf.format(currentOpticsXi), df.format(currentOpticsMinPoints), \n \t\t\t\tdf.format(clArgs.clusteringOpticsXiStepSize), df.format(clArgs.clusteringOpticsMinPtsStepSize)\n \t\t\t});\n \t\n \twhile (currentOpticsXi <= opticsXiMax) {\n \t\twhile (currentOpticsMinPoints <= opticsMinPointsMax) {\n \t\t\t// Run automation for each combination of opticsXi and opticsMinPoints\n \t\t\tLOG.info(\"Run automation with optics-xi: {}, optics-xi-min-points: {}\", \n \t\t\t\t\tdf.format(currentOpticsXi), df.format(currentOpticsMinPoints));\n \t\t\t\n \t\t\ttry {\n\t \t\t\t// Step 1: Clustering\n\t \t\t\tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir, currentOpticsXi, currentOpticsMinPoints);\n\t \t\t\t\n\t \t\t\t// Step 2: Build shared framework\n\t \t\t\tbuildFramework();\n\t \t\t\t\n\t \t\t\t// Step 3: Build user hierarchical graphs\n\t \t\t\tbuildHierarchicalGraphs();\n\t \t\t\t\n\t \t\t\t// Step 4: Calculate similarity between all users and create evaluation results afterwards\n\t \t\t\tcalculateSimilarity();\n \t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"An error occurred during the automation task. Jumping to the next pass.\", e);\n\t\t\t\t} finally {\n\t \t\t\t// Step 5: Clean up for the next run\n\t \t\t\tcleanAutomationResults();\n\t \t\t\t\n\t \t\t\t// Increase the currentOpticsMinPoints for the next run if desired\n\t \t\t\tif (clArgs.clusteringOpticsMinPtsStepSize > 0)\n\t \t\t\t\tcurrentOpticsMinPoints += clArgs.clusteringOpticsMinPtsStepSize;\n\t \t\t\telse\n\t \t\t\t\tbreak;\n\t\t\t\t}\n \t\t}\n \t\t// Reset current values\n \t\tcurrentOpticsMinPoints = clArgs.clusteringOpticsMinPts;\n \t\t\n \t\t// Increase currentOpticsXi for the next run if desired\n \t\tif (clArgs.clusteringOpticsXiStepSize > 0)\n\t\t\t\tcurrentOpticsXi += clArgs.clusteringOpticsXiStepSize;\n\t\t\telse\n\t\t\t\tbreak;\n \t}\n \t\n \tLOG.info(\"End automation task.\");\n }", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "public scala.Tuple2<java.lang.Object, java.lang.Object> findClosest (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "public Vector run(){\n// System.out.println(\"Minimum radius is: \" + minRadius);\n// System.out.println(\"Maximum radius is: \" + maxRadius);\n Vector clusters = new Vector();\n double fitnessSum = 0;\n for (int q = 0; q < numTests; q++){\n Gene hypothesis = initializer.createRandomGene(fitnessFunction, minRadius, maxRadius);\n //This turns it into a circle.\n if (Math.random() > 0.5){ \n hypothesis.setMajorAxisRadius(hypothesis.getMinorAxisRadius());\n } else { \n hypothesis.setMinorAxisRadius(hypothesis.getMajorAxisRadius());\n }\n// System.out.println(hypothesis);\n double fitness = hypothesis.getFitness();\n fitnessSum = fitnessSum + fitness;\n if ((hypothesis.getCount() >= minPoints) && (fitness >= minAccepted)){\n clusters.add(hypothesis);\n }\n }\n averageFitness = fitnessSum/numTests;\n return clusters;\n }", "public Set<? extends Position> findNearest(Position position, int k);", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k, double distance);", "private static double dynamically_select_epsilon(ArrayList<Point> pointset){\n\t\tPair closestPair = closest_pair(pointset);\n\t\t\n\t\t// Calculate Chebyshev distance between nearest pair\n\t\tdouble distance = chebyshev_distance(closestPair.getFirst(), closestPair.getSecond());\n\t\t\n\t\t// Divide by 8 to fit 8e box constraint set in Gabe's paper\n\t\treturn distance / 8.0;\n\t}", "private double dynamically_select_epsilon(ArrayList<Point> pointset) {\n\t\tPair closestPair = closest_pair(pointset);\n\n\t\t// Calculate Chebyshev distance between nearest pair\n\t\tdouble distance = chebyshev_distance(closestPair);\n\n\t\t// Divide by 16 to fit 8e box constraint set in Gabe's paper\n\t\treturn distance / 16.0;\n\t}", "public double pointCost (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "Point chooseCentre(treeNode node, MTRandom clustererRandom){\n\n\t\t//How many times should we try to choose a centre ??\n\t\tint times = 3;\n\t\t\t\n\t\t//stores the nodecost if node is split with the best centre\n\t\tdouble minCost = node.cost;\n\t\tPoint bestCentre = null;\n\t\t\n\t\t//loop counter variable\n\t\tint i;\n\t\tint j;\n\t\t\n\t\tfor(j=0;j<times;j++){\n\t\t\t//sum of the relativ cost of the points\n\t\t\tdouble sum = 0.0;\n\t\t\t//random number between 0 and 1\n\t\t\tdouble random = clustererRandom.nextDouble();\n\t\t\t\n\t\t\tfor(i=0;i<node.n;i++){\n\t\t\t\n\t\t\t\tsum += treeNodeCostOfPoint(node,node.points[i]) / node.cost;\n\t\t\t\tif(sum >= random){\n\t\t\t\t\tif(node.points[i].weight == 0.0){\n\t\t\t\t\t\t//printf(\"ERROR: CHOOSEN DUMMY NODE THOUGH OTHER AVAILABLE \\n\");\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tdouble curCost = treeNodeSplitCost(node,node.centre,node.points[i]);\n\t\t\t\t\tif(curCost < minCost){\n\t\t\t\t\t\tbestCentre = node.points[i];\n\t\t\t\t\t\tminCost = curCost;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(bestCentre == null){\n\t\t\treturn node.points[0];\n\t\t} else {\n\t\t\treturn bestCentre;\n\t\t}\n\t}", "public SolutionSet execute() throws JMetalException, ClassNotFoundException, IOException {\n initialization();\n createInitialSwarm() ;\n evaluateSwarm();\n initializeLeaders() ;\n initializeParticlesMemory() ;\n updateLeadersDensityEstimator() ;\n\n while (!stoppingCondition()) {\n computeSpeed(iterations_, maxIterations_);\n computeNewPositions();\n perturbation();\n evaluateSwarm();\n updateLeaders() ;\n updateParticleMemory() ;\n updateLeadersDensityEstimator() ;\n iterations_++ ;\n }\n\n tearDown() ;\n return paretoFrontApproximation() ;\n }", "@Override\n protected int selectNextClusterIndex(\n final double[] minDistances,\n final boolean[] selected)\n {\n double maxMinDistance = Double.MAX_VALUE;\n int maxIndex = 0;\n\n final int elementCount = minDistances.length;\n for (int i = 0; i < elementCount; i++)\n {\n if (selected[i])\n {\n // Skip clusters we've already selected.\n continue;\n }\n\n // Get the current minimum distance for the element.\n double minDistance = minDistances[i];\n\n if (maxIndex == 0 || minDistance > maxMinDistance)\n {\n // This is the minium seen so far, so keep track of\n // it.\n maxIndex = i;\n maxMinDistance = minDistance;\n }\n }\n\n if (maxMinDistance <= 0.0)\n {\n // There are not enough points to prevent selecting two\n // that are on top of each other.\n return -1;\n }\n else\n {\n return maxIndex;\n }\n }", "public org.apache.spark.mllib.clustering.KMeansModel train (org.apache.spark.rdd.RDD<org.apache.spark.mllib.linalg.Vector> data, int k, int maxIterations, int runs, java.lang.String initializationMode) { throw new RuntimeException(); }", "private void cluster() {\n\t\tint index = 0;\n\t\tfor (DataObject obj : objects) {\n\t\t\tindex = getNearestCenterIndex(obj, centers);\n\t\t\tclusters.get(index).add(obj);\n\t\t}\n\t}", "public Iterable<Point2D> nearest(Point2D p, int k) {\n if (k == 0) {\n throw new NullPointerException();\n }\n \n if (p == null) {\n throw new NullPointerException();\n }\n MinPQ<Point2D> pq = new<Point2D> MinPQ(p.distanceToOrder());\n \n for (Point2D s: bst.keys()) {\n if (!s.equals(p)) {\n //Point2D near = nearest(p);\n pq.insert(s);\n }\n \n }\n \n Queue kpq = new Queue(); \n \n for (int j = 0; j < k; j++) {\n kpq.enqueue(pq.delMin());\n }\n return kpq;\n }", "private List<BlockPoint> chooseFurthestPoints(List<BlockPoint> originalPoints){\n if(plattformsPerChunk <= 0 || plattformsPerChunk > originalPoints.size()){\n throw new IllegalArgumentException(\"plattformsPerChunk can not be negative or larger than originalPoints\");\n\t}\n\tList<BlockPoint> startingPoints = new ArrayList<>(originalPoints);\n List<BlockPoint> chosenPoints = new ArrayList<>();\n\tint randomIndex = random.nextInt(startingPoints.size()-1);\n\t// Add the random starting position\n chosenPoints.add(startingPoints.get(randomIndex));\n // Remove it from the list since we can't add the same point many times\n\tstartingPoints.remove(randomIndex);\n\n\t// Choose \"plattformsPerChunk - 1\" amount of plattforms other than the starting point\n\tfor(int i = 0; i < plattformsPerChunk-1; i++){\n\t\tif(startingPoints.isEmpty()){\n\t\t break;\n\t\t}\n\n\t // Set every consideredPositions weight to its lowest distance\n\t // to any considered node\n\t for(BlockPoint consideredPos : startingPoints){\n\t\tdouble globalMinDist = INFINITY;\n\t\tfor(BlockPoint chosenPos : chosenPoints){\n\t\t double currentMinDist = consideredPos.distanceTo(chosenPos);\n\t\t if(currentMinDist < globalMinDist){\n\t\t\tglobalMinDist = currentMinDist;\n\t\t }\n\t\t}\n\t\tconsideredPos.weight = globalMinDist;\n\t }\n\n\t // Choose the position with the highest weight and add/remove it.\n\t // This means choose the point with largest min distance\n\t double highestMinDist = -1;\n\t BlockPoint chosenPoint = null;\n\t for(BlockPoint consideredPos : startingPoints){\n\t\tif(highestMinDist < consideredPos.weight){\n\t\t highestMinDist = consideredPos.weight;\n\t\t chosenPoint = consideredPos;\n\t\t}\n\t }\n\t assert chosenPoint != null;\n\t chosenPoints.add(chosenPoint.copy());\n\t startingPoints.remove(chosenPoint);\n\t}\n\treturn chosenPoints;\n }", "public void doInitialClustering(AddressIF me, Matrix_4_HSH tmp) {\n\t\t\n\t}", "@Test\n public void basicTest() {\n Point myPoint;\n\n// myPoint = pointSet.nearest(2, 2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n//\n// myPoint = kdPointSet.nearest(2, 2); //THIS ONE DOES NOT MATCH NAIVE!\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n\n\n\n\n\n\n }", "public double[][] generateRandomClusterCentroids(double[][] data, int k) {\n\t\tif (data == null) return null;\n\t\tint n = data.length;\n\t\tif (n == 0) return null;\n\t\tint m = data[0].length;\n\t\t\n\t\t// get number of points\n\t\tdouble[][] centroids = new double[k][m];\n\t\tint[] points = utils.getRandomPermutation(n, k);\n\t\tfor (int i = 0; i<k; i++) {\n\t\t\tcentroids[i] = data[points[i]];\n\t\t}\n\t\t\n\t\treturn centroids;\n\t}", "public List<K> findNearestK(LatitudeLongitude current, int k) {\n\n // Find the euclidean distance between this point and others\n List<Tuple2<Double, K>> closest = new ArrayList<>(locations.size());\n for (K l : locations) {\n LatitudeLongitude latlon = l.getLocation();\n if (latlon != null) {\n Double result = euclidean(latlon, current);\n closest.add(new Tuple2<>(result, l));\n }\n }\n\n // Sort the list\n closest.sort((element1, element2) -> {\n return element1._1().compareTo(element2._1());\n });\n\n closest.removeIf(i -> (i._1().equals(0.0)));\n\n // Return the first k records\n if (k > closest.size()) {\n k = closest.size();\n }\n if (k < 0) {\n k = 0;\n }\n List<K> toReturn = new ArrayList<>(k);\n for (int i = 0; i < k; i++) {\n toReturn.add(closest.get(i)._2());\n }\n\n return toReturn;\n }", "public void KNN() {\n\n\t\t\n\t\t// for each point in test data\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble xy = 0;\n\t\tdouble sum = 0;\n\t\tdouble m = this.Extracted_TestDataset.length;\n\t\tArrayList<ArrayList<Double>> EucledianDistanceUnsorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\tArrayList<ArrayList<Double>> EucledianDistanceSorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\t//EucledianDistance\n\t\t\n\t\t// Initialize EucledianDistance List\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceUnsorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceSorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\t// Testing sorting \n\t\t/*\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tfor(int k=0; k < this.Extracted_TestDataset[i].length; k++) {\n\t\t\t\tdouble min = 0.0; // Set To Your Desired Min Value\n\t\t double max = 10.0; // Set To Your Desired Max Value\n\t\t double ran = (Math.random() * ((max - min) + 1)) + min; // This Will Create \n\t\t \n\t\t double xrounded = Math.round(ran * 100.0) / 100.0; \n\t\t System.out.print(xrounded); \n\t\t //System.out.print(\" , \"); \n\t\t EucledianDistanceUnsorted.get(i).add(xrounded);\n\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\"); \n\t\t\t\n\t\t}\n\t\t*/\n\n\t\t\n\t\t\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int p = 1; p < (this.Extracted_TestDataset.length-1) ; p++) {\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int i = 1; i < this.Extracted_TrainingDataset.length; i++) {\n\t\t\tsum = 0;\n\t\t\tint k = 0;\n\t\t\t//System.out.println(\"first loop\");\n\t\t\tfor ( ; k < (this.Extracted_TestDataset[0].length-1) ; k++) {\t\t\t\n\t\t\t\t//System.out.println(\"second loop\");\n\t\t\t\t\n\t\t\t\tx = (Double.parseDouble(this.Extracted_TestDataset[p][k]));\n\t\t\t\t\t//System.out.print(\" x value : \");\n\t\t\t\t\t//System.out.print(x);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\ty = (Double.parseDouble(this.Extracted_TrainingDataset[i][k]));\n\t\t\t//\tSystem.out.print(\" y value : \");\n\t\t\t//\tSystem.out.println(y);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\txy = x - y;\n\t\t\t\n\t\t\t\txy = (Math.pow(xy, 2));\n\t\t\t\tsum += xy;\n\t\t\t\t\t\t\n\t\t\t\t//System.out.print(\" sum : \");\n\t\t\t\t//System.out.println(sum);\n\t\t\t\t}\n\n\t\t\tEucledianDistanceUnsorted.get(p).add((Math.sqrt(sum/k)));\n\t\t\t\t//System.out.printf(\" distance value of row %i in col %i : %s %n\", i, k ,EucledianDistanceUnsorted.get(i).get(k));\t\t\n\t\t\t}\n\t\t\n\t\t\t//start at index 1 discard the attribute name row\n\t\t\t/*for ( int i = 0; i < (this.Extracted_TrainingDataset.length-1) ; i++) {\t\t\n\t\t\t\tSystem.out.print(\" distance value of row \");\n\t\t\t\tSystem.out.print(p);\n\t\t\t\tSystem.out.print(\" in col \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" = \");\n\t\t\t\tSystem.out.print(EucledianDistanceUnsorted.get(p).get(i));\n\t\t\t\tSystem.out.println(\"\");\t\n\t\t\t}*/\n\t\t\t\n\t\t System.out.print(\"Count : \");\n\t\t System.out.println(p);\n\t\t}\n\t\n\t\tSystem.out.println(\"About to sort distance\");\n\t\t\n\t\tfor( int i = 1; i < (EucledianDistanceUnsorted.size()-1); i++){\n\t\t\tArrayList<Double> temp = EucledianDistanceUnsorted.get(i);\n\t\t\tCollections.sort(temp);\n\t\t\tfor(int k=0; k < (this.Extracted_TrainingDataset.length- 1); k++) {\n\t\t\t\tEucledianDistanceSorted.get(i).add(temp.get(k));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\" Sorted eucledian distance of first k values \");\n\t\tfor(int i=1; i < EucledianDistanceSorted.size()-1; i++) {\n\t\t\tfor(int k=0; k < (this.ValueofK); k++) {\n\t\t\t\tSystem.out.print(EucledianDistanceSorted.get(i).get(k));\n\t\t\t\tSystem.out.print(\" , \");\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\" finding class of first k points \");\n\t\t// find majority distance and find index of distance in unsorted distance \n\t\tdouble majority = 0.0;\n\t\tint IndexofDistance = 0;\n\t\tfor(int i=1; i < (EucledianDistanceSorted.size()-1); i++) {\n\t\t\t\n\t\t\t\tmajority = findMajority(EucledianDistanceSorted.get(i), this.ValueofK);\n\t\t\t\tSystem.out.print(\" index : \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" majority : \");\n\t\t\t\tSystem.out.println(majority);\n\t\t\t\tIndexofDistance = findIndexofMajority(majority,EucledianDistanceUnsorted.get(i));\n\n\t\t\t\t//System.out.print(\" test row original class :\");\n\t\t\t\t//System.out.println(this.Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\tconfusionmatrix.addTrueValue(Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\t//System.out.print(\" predectived training row classifier : \");\n\t\t\t\t//System.out.println(this.Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\t\n\t\t\t\tconfusionmatrix.addPrediction(Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Total number of predictions: \" + confusionmatrix.TotalNumberOfPredictions());\n\t\t\tSystem.out.println(\"Number of correct predictions: \"+confusionmatrix.Correct());\n\t\t\tSystem.out.println(\"Number of incorrect predictions: \"+confusionmatrix.Incorrect());\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"True positive (TP): correct positive prediction: \" + confusionmatrix.TruePositive());\n\t\t\tSystem.out.println(\"False positive (FP): incorrect positive prediction: \" + confusionmatrix.FalsePositive());\n\t\t\tSystem.out.println(\"True negative (TN): correct negative prediction: \" + confusionmatrix.TrueNegative());\n\t\t\tSystem.out.println(\"False negative (FN): incorrect negative prediction: \" +confusionmatrix.FalseNegative()); \n\t\t\tSystem.out.println(\"Error Rate: \"+confusionmatrix.ErrorRate());\n\t\t\tSystem.out.println(\"Accuracy Rate: \"+confusionmatrix.AccuracyRate());\n\t}", "public static void main(String[] args){\n\t\tString dataset = null; boolean headless = false; boolean colour = false;boolean emd = false; int k = 0;\r\n\t\tint width = 0, height = 0;\r\n\t\t// load the properties, a bit messy because it's the 7th and I should not be writing code this late into the project\r\n\t\ttry {\r\n\t\t\t// file reader variables\r\n\t\t\tFile file = new File(\"data/KMEANS.properties\");\r\n\t\t\tFileReader fileReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t\t\t\r\n\t\t\tString line;\t\r\n\t\t\tint lineCounter = 0;\r\n\t\t\t\r\n\t\t\t// the loop for reading in the lines\r\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\tif(lineCounter == 0){\r\n\t\t\t\t\tdataset = line;\r\n\t\t\t\t}else if(lineCounter == 1){\r\n\t\t\t\t\theadless = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 2){\r\n\t\t\t\t\tcolour = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 3){\r\n\t\t\t\t\temd = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 4){\r\n\t\t\t\t\tk = Integer.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 5){\r\n\t\t\t\t\t// width\r\n\t\t\t\t\twidth = Integer.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 6){\r\n\t\t\t\t\t// height\r\n\t\t\t\t\theight = Integer.valueOf(line);\r\n\t\t\t\t}\r\n\t\t\t\tlineCounter++;\r\n\t\t\t}\r\n\t\t\tfileReader.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tif(!headless){\r\n\t\t\ttry {\r\n\t\t\t\t// load k-means before starting\r\n\t\t\t\tkmeans = new KMeans(dataset,false,colour,emd,k,width,height);\r\n\t\t\t\tif(!kmeans.MNIST){\r\n\t\t\t\t\tKMeans.INPUT_WIDTH = width;\r\n\t\t\t\t\tKMeans.INPUT_HEIGHT = height;\r\n\t\t\t\t\tKMeans.TOTAL_WEIGHTS = (KMeans.INPUT_WIDTH*KMeans.INPUT_HEIGHT)*KMeans.TOTAL_COLOURS;\r\n\t\t\t\t}\r\n\t\t\t\tAppGameContainer app;\r\n\t\t\t\tapp = new AppGameContainer(new Visualiser(\"Crowd-sourced drawing clustering with neural computing.\"));\r\n\t\t\t\tapp.setDisplayMode(1024, 720, false);\r\n\t\t\t\tapp.setShowFPS(false);\r\n\t\t\t\tapp.setAlwaysRender(true);\r\n\t\t\t\tapp.start();\r\n\t\t\t}catch (SlickException ex){\r\n\t\t\t\tLogger.getLogger(Visualiser.class.getName()).log(Level.SEVERE, null, ex);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t// start k-means in headless mode\r\n\t\t\tkmeans = new KMeans(dataset,true,colour,emd,k,width,height);\r\n\t\t\tif(!kmeans.MNIST){\r\n\t\t\t\tKMeans.INPUT_WIDTH = width;\r\n\t\t\t\tKMeans.INPUT_HEIGHT = height;\r\n\t\t\t\tKMeans.TOTAL_WEIGHTS = (KMeans.INPUT_WIDTH*KMeans.INPUT_HEIGHT)*KMeans.TOTAL_COLOURS;\r\n\t\t\t}\r\n\t\t\twhile(true){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tkmeans.update();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void baseAlgorithm() {\n\t\tlong start = System.nanoTime();\n\t\tinitCentroids();\n\t\tint counter = 0;\n\t\twhile (counter < 1000\n\t\t\t\t&& (lastCentroids == null || !SeriesComparator.equalClustering(lastCentroids, centroids))) {\n\t\t\tresetClusters();\n\t\t\tassignPoints();\n\t\t\tlastCentroids = new ArrayList<Point2D>(centroids);\n\t\t\tcalculateNewMean();\n\t\t\tbasicIterations++;\n\t\t\tcounter++;\n\t\t}\n\t\tconvertToClustering();\n\t\tbasicRuntime = System.nanoTime() - start;\n\t}", "public Clustering cluster(int kNumber, Clustering inputClustering, List<Point2D> centroids) {\n\t\tthis.inputClustering = inputClustering;\n\t\tthis.kNumber = kNumber;\n\t\tthis.centroids = centroids;\n\t\tbasicIterations = 0;\n\t\tbaseAlgorithm();\n\t\ttotalIterations = basicIterations;\n\t\treturn clustering;\n\t}", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\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 }", "private ArrayList<ArrayList<Vector2i>> identifyClustersByGreedy(LinkedList<ArrayList<PositionAndColor>> cluster, int numOfColors, int ignoreSize) {\n\t\tArrayList<ArrayList<Vector2i>> bestMapping = new ArrayList<ArrayList<Vector2i>>();\n\t\tint activeClu = 0;\n\t\tfor (ArrayList<PositionAndColor> c : cluster) {\n\t\t\tboolean[] added = new boolean[cluster.size() + 1];\n\t\t\tArrayList<Vector2i> tempMapped = new ArrayList<Vector2i>();\n\t\t\tfor (int idx = 0; idx < numOfColors; idx++) {\n\t\t\t\tint posBest = -1;\n\t\t\t\tint diffBest = Integer.MAX_VALUE;\n\t\t\t\tint sizeBest = 0;\n\t\t\t\tint position = 0;\n\t\t\t\tfor (int innerIdx = 0; innerIdx < cluster.size(); innerIdx++) {\n\t\t\t\t\tif (innerIdx != activeClu && cluster.get(innerIdx).size() > ignoreSize)\n\t\t\t\t\t\tif (Math.abs(cluster.get(innerIdx).size() - c.size()) < diffBest && added[position] == false) {\n\t\t\t\t\t\t\tposBest = position;\n\t\t\t\t\t\t\tdiffBest = Math.abs(cluster.get(innerIdx).size() - c.size());\n\t\t\t\t\t\t\tsizeBest = cluster.get(innerIdx).size();\n\t\t\t\t\t\t}\n\t\t\t\t\tposition++;\n\t\t\t\t}\n\t\t\t\tif (posBest != -1) {\n\t\t\t\t\ttempMapped.add(new Vector2i(posBest, sizeBest));\n\t\t\t\t\tadded[posBest] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbestMapping.add(tempMapped);\n\t\t\tactiveClu++;\n\t\t}\n\t\treturn bestMapping;\n\t}", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\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\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\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\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "private void calculateDistances(int pDistancia,int pMetrica,int k)\n\t{\n\t\tDistance dist = null;\n\t\t\n\t\tfor (int i = 0; i < clusterList.size(); i++)\n\t\t{\n\t\t\tfor (int j = i+1; j < clusterList.size(); j++)\n\t\t\t{\n\t\t\t\tdist = new Distance(clusterList.get(i), clusterList.get(j));\n\t\t\t\tdist.calculateDistance(pDistancia, pMetrica, k);\n\t\t\t\tdistanceList.addLast(dist);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(distanceList);\n\t}", "public void connectClusters() {\n\t\tif (clusters.size() == 2) { // once have only two clusters\n\t\t\tSystem.out.println(\"DONE!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tcluster close1 = clusters.get(0),\n\t\t\t\tclose2 = clusters.get(1);\n\t\tdouble closestCluster = computeDistance(close1, close2);\n\t\t\n\t\tfor (int i=0; i<clusters.size(); i++) {\n\t\t\tcluster c1 = clusters.get(i);\n\t\t\t\n\t\t\tfor (int j=0; j<clusters.size(); j++) { // go through all the clusters and find closest\n\t\t\t\tif (i!=j) {\n\t\t\t\t\tcluster c2 = clusters.get(j);\n\t\t\t\t\tdouble dist = computeDistance(c1,c2);\n\t\t\t\t\tif (dist < closestCluster) {\n\t\t\t\t\t\tclose1 = c1;\n\t\t\t\t\t\tclose2 = c2;\n\t\t\t\t\t\tclosestCluster = dist;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmakeCluster(close1, close2);\n\t\t\n\t}", "public double[] dist2All(int s, int k){\n\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n\n double[] resultPath = new double[intersection];\n for (int i = 0; i <intersection ; i++) {\n resultPath[i] = INFINITY;\n }\n resultPath[s] = 0;\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,resultPath[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(resultPath[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey = resultPath[extractedVertex] + edge.weight ;\n double currentKey = resultPath[destination];\n if(currentKey>newKey){\n minHeap.updateKey(newKey, destination,resultPath[destination]);\n resultPath[destination] = newKey;\n }\n }\n }\n }\n for(int i =0; i<resultPath.length;i++){\n if(SPT[i]==false)\n resultPath[i]=-1;\n }\n return resultPath;\n }", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "LinkedListSortedNeighborSet obtainKNeighbors(int paraObjectIndex) {\n LinkedListSortedNeighborSet tempNeighborSet = new LinkedListSortedNeighborSet();\n tempNeighborSet.setNeighborThreshold(k);\n\n for (int i = 0; i < formalContext.trainingFormalContext.length; i++) {\n//\t\t\tSystem.out.println(\"u: \" + paraObjectIndex);\n if (i != paraObjectIndex) {\n//\t\t\t\tSystem.out.println(\"v: \" + i);\n Measures tempSimilarityMetric = new Measures(formalContext.trainingFormalContext[paraObjectIndex],\n formalContext.trainingFormalContext[i]);\n double tempSimilarity = tempSimilarityMetric.jaccardSimilarity();\n//\t\t\t\tSystem.out.println(\"Similarity: \" + tempSimilarity);\n tempNeighborSet.topKSortedInsert(i, tempSimilarity);\n//\t\t\t\tSystem.out.println(\"\" + tempNeighborSet.toString());\n } // End if\n } // End for\n return tempNeighborSet;\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "public org.apache.spark.mllib.clustering.KMeansModel train (org.apache.spark.rdd.RDD<org.apache.spark.mllib.linalg.Vector> data, int k, int maxIterations, int runs) { throw new RuntimeException(); }", "public static int[] run(double[][] data, int numCluster) {\n int N = data.length;\n int M = data[0].length;\n\n // clustering result\n int[] cluster = new int[N];\n\n // randomize cluster center\n double[][] centers = new double[numCluster][M];\n for (int c = 0; c < numCluster; c++) {\n int idx = randomIntRange(0, N - 1);\n centers[c] = Arrays.copyOf(data[idx], M);\n }\n\n // assign every user to a cohort, use Euclidean distance\n assignCluster(cluster, centers, data);\n\n // iteration\n // (1) re-locate cohort center to average location of users in the cohort\n // (2) re-assign every user to the closest cohort center\n // (3) repeat\n // stop criterion: no change in cluster assignment, or reach max iteration\n int iterMax = 100;\n for (int iter = 0; iter < iterMax; iter++) {\n int[] oldCluster = Arrays.copyOf(cluster, N);\n locateCenters(cluster, centers, data);\n assignCluster(cluster, centers, data);\n\n // stop\n if (Arrays.equals(oldCluster, cluster)) {\n System.out.println(\"k-means : clustering converged\");\n break;\n }\n\n if (iter == iterMax) {\n System.out.println(\"k-means : reach max iteration\");\n }\n }\n\n return cluster;\n }", "static Cluster clusterProvider(String neptune, int BATCH_SIZE) {\n java.security.Security.setProperty(\"networkaddress.cache.ttl\", \"0\");\n java.security.Security.setProperty(\"networkaddress.cache.negative.ttl\", \"0\");\n\n Cluster.Builder clusterBuilder = Cluster.build()\n .addContactPoint(neptune) // add more ro contact points for load balancing\n .port(8182)\n .enableSsl(true)\n// .keyStore(keyStore) // optional as amazon cert will be used and should be in truststore of server\n// .keyStorePassword(keyStorePassword)\n .channelizer(SigV4WebSocketChannelizer.class)\n .serializer(Serializers.GRAPHBINARY_V1D0)\n .maxInProcessPerConnection(1) // ensure no contention for connections per batch\n .minInProcessPerConnection(1)\n .maxSimultaneousUsagePerConnection(1)\n .minSimultaneousUsagePerConnection(1)\n .maxWaitForConnection(15000)\n .minConnectionPoolSize(BATCH_SIZE)\n .maxConnectionPoolSize(BATCH_SIZE);\n\n return clusterBuilder.create();\n }", "public WatsetClustering<V> compute() {\n logger.log(Level.INFO, \"Watset started.\");\n\n buildInventory();\n\n final var count = senses.values().stream().mapToInt(List::size).sum();\n logger.log(Level.INFO, \"Watset: sense inventory constructed including {0} senses.\", count);\n\n final var senseGraph = buildSenseGraph();\n\n if (graph.edgeSet().size() != senseGraph.edgeSet().size()) {\n throw new IllegalStateException(\"Mismatch in number of edges: expected \" +\n graph.edgeSet().size() +\n \", but got \" +\n senseGraph.edgeSet().size());\n }\n\n logger.log(Level.INFO, \"Watset: sense graph constructed.\");\n\n final var globalAlgorithm = global.apply(senseGraph);\n final var senseClusters = globalAlgorithm.getClustering();\n\n logger.log(Level.INFO, \"Watset finished.\");\n\n final var clusters = senseClusters.getClusters().stream().\n map(cluster -> cluster.stream().map(Sense::get).collect(Collectors.toSet())).\n collect(Collectors.toList());\n\n return new WatsetClustering.WatsetClusteringImpl<>(clusters,\n Collections.unmodifiableMap(inventory),\n new AsUnmodifiableGraph<>(senseGraph));\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "public void steepestDescent() {\r\n ArrayList<Atom> atoms = cluster.getAtoms();\r\n Atom a;\r\n int numAtoms = atoms.size();\r\n double potentialEnergy;\r\n double trialPotential;\r\n int i;\r\n\r\n //Increment time\r\n totalTime += currentStep;\r\n\r\n //Calculate force on each atom\r\n cluster.calculateForces();\r\n\r\n //Get energy of current configuration\r\n HashMap<String, Double> energies = cluster.getEnergies();\r\n potentialEnergy = 0.0;\r\n for(String eName : energies.keySet())\r\n potentialEnergy += energies.get(eName).doubleValue();\r\n\r\n //Save current atom positions and advance atoms to trial positions\r\n for(i = 0; i < numAtoms; i++) {\r\n a = atoms.get(i);\r\n\r\n savedLocations[i].x = a.location.x;\r\n savedLocations[i].y = a.location.y;\r\n savedLocations[i].z = a.location.z;\r\n\r\n //Compute trial locations\r\n a.location.x += a.force.x * currentStep;\r\n a.location.y += a.force.y * currentStep;\r\n a.location.z += a.force.z * currentStep;\r\n }\r\n\r\n //Get energy of the trial configuration\r\n energies = cluster.getEnergies();\r\n trialPotential = 0.0;\r\n for(String eName : energies.keySet())\r\n trialPotential += energies.get(eName).doubleValue();\r\n\r\n //Decide whether to keep trial configuration based on convergence\r\n if(trialPotential < potentialEnergy) {\r\n //Keep positions and check for convergence\r\n if(Math.abs((potentialEnergy - trialPotential) / potentialEnergy) < convergenceCriterion)\r\n isConverged = true;\r\n\r\n currentStep *= 1.2;\r\n } else {\r\n //Restore old positions\r\n for(i = 0; i < numAtoms; i++) {\r\n a = atoms.get(i);\r\n\r\n a.location.x = savedLocations[i].x;\r\n a.location.y = savedLocations[i].y;\r\n a.location.z = savedLocations[i].z;\r\n }\r\n\r\n currentStep *= 0.5;\r\n }\r\n }", "public NearestNeighbourhood(final int k) {\n\t\tsuper();\n\t\tthis.k = k;\n\t}", "protected void startClusterer() {\r\n\t\tif (m_RunThread == null) {\r\n\t\t\tm_StartBut.setEnabled(false);\r\n\t\t\tm_timer.setEnabled(false);\r\n\t\t\tm_StopBut.setEnabled(true);\r\n\t\t\tm_ignoreBut.setEnabled(false);\r\n\t\t\tm_RunThread = new Thread() {\r\n\t\t\t\tInstances trainInst = null;\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tboolean errors = false;\r\n\t\t\t\t\tlong start,end;\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\t// Copy the current state of things\r\n\t\t\t\t\t\tm_Log.statusMessage(\"Setting up...\");\r\n\t\t\t\t\t\tInstances inst = new Instances(m_Instances);\r\n\t\t\t\t\t\tinst.setClassIndex(-1);\r\n\t\r\n\t\t\t\t\t\tint[] ignoredAtts = null;\r\n\t\t\t\t\t\ttrainInst = new Instances(inst);\r\n\t\r\n\t\t\t\t\t\tif (m_EnableClassesToClusters.isSelected()) {\r\n\t\t\t\t\t\t\ttrainInst.setClassIndex(m_ClassCombo.getSelectedIndex());\r\n\t\t\t\t\t\t\tinst.setClassIndex(m_ClassCombo.getSelectedIndex());\r\n\t\t\t\t\t\t\tif (inst.classAttribute().isNumeric()) {\r\n\t\t\t\t\t\t\t\tthrow new Exception(\"Class must be nominal for class based evaluation!\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!m_ignoreKeyList.isSelectionEmpty()) {\r\n\t\t\t\t\t\t\ttrainInst = removeIgnoreCols(trainInst);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!m_ignoreKeyList.isSelectionEmpty()) {\r\n\t\t\t\t\t\t\tignoredAtts = m_ignoreKeyList.getSelectedIndices();\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\tif (m_EnableClassesToClusters.isSelected()) {\r\n\t\t\t\t\t\t\t// add class to ignored list\r\n\t\t\t\t\t\t\tif (ignoredAtts == null) {\r\n\t\t\t\t\t\t\t\tignoredAtts = new int[1];\r\n\t\t\t\t\t\t\t\tignoredAtts[0] = m_ClassCombo.getSelectedIndex();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tint[] newIgnoredAtts = new int[ignoredAtts.length + 1];\r\n\t\t\t\t\t\t\t\tSystem.arraycopy(ignoredAtts, 0,\r\n\t\t\t\t\t\t\t\t\t\tnewIgnoredAtts, 0, ignoredAtts.length);\r\n\t\t\t\t\t\t\t\tnewIgnoredAtts[ignoredAtts.length] = m_ClassCombo\r\n\t\t\t\t\t\t\t\t\t\t.getSelectedIndex();\r\n\t\t\t\t\t\t\t\tignoredAtts = newIgnoredAtts;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tint clustering_amount = 1;\r\n\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\tclustering_amount = m_bracketingPanel.getNumberClusterings();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add tasks\r\n\t\t\t\t\t\tfor (int i = 0; i < clustering_amount; i++) {\r\n\t\t\t\t\t\t\tif (m_Log instanceof TaskLogger) {\r\n\t\t\t\t\t\t\t\t((TaskLogger) m_Log).taskStarted();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int i = 0; i < clustering_amount ; i++) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tSerializedObject so = new SerializedObject((SubspaceClusterer) m_ClustererEditor.getValue());\r\n\t\t\t\t\t\t\tSubspaceClusterer clusterer = (SubspaceClusterer) so.getObject();\r\n\t\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\t\tm_bracketingPanel.setBracketingParameter(clusterer, i);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tString name = (new SimpleDateFormat(\"HH:mm:ss - \")).format(new Date());\r\n\t\t\t\t\t\t\tString cname = clusterer.getClass().getName();\r\n\t\t\t\t\t\t\tif (cname.startsWith(\"weka.subspaceClusterer.\")) {\r\n\t\t\t\t\t\t\t\tname += cname.substring(\"weka.subspaceClusterer.\".length());\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tname += cname;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tString parameter_name = \"\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\t\tparameter_name+= m_bracketingPanel.getParameterString(clusterer,i);\r\n\t\t\t\t\t\t\t\tname+=parameter_name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tString cmd = clusterer.getClass().getName();\r\n\t\t\t\t\t\t\tif (m_ClustererEditor.getValue() instanceof OptionHandler)\r\n\t\t\t\t\t\t\t\tcmd += \" \" + Utils.joinOptions(((OptionHandler)clusterer).getOptions());\r\n\r\n\t\t\t\t\t\t\t//add measure options to command line\r\n\t\t\t\t\t\t\tif(m_EnableEvaluation.isSelected()){\r\n\t\t\t\t\t\t\t\tArrayList<ClusterQualityMeasure> cmdMeasureList = m_evaluationPanel.getSelectedMeasures();\r\n\t\t\t\t\t\t\t\tif(cmdMeasureList.size() > 0) cmd+= \" -M \";\r\n\t\t\t\t\t\t\t\tfor (int c = 0; c < cmdMeasureList.size(); c++) {\r\n\t\t\t\t\t\t\t\t\tString c_name = cmdMeasureList.get(c).getClass().getName();\r\n\t\t\t\t\t\t\t\t\tif (c_name.startsWith(\"weka.clusterquality.\")) {\r\n\t\t\t\t\t\t\t\t\t\tcmd+= c_name.substring(\"weka.clusterquality.\".length());\r\n\t\t\t\t\t\t\t\t\t\tif(c < cmdMeasureList.size()-1) cmd+= \":\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\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\tm_Log.logMessage(\"Started \" + cname);\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Command: \" + cmd);\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Clustering: Started\");\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Build the model and output it.\r\n\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Clusterer running...\");\r\n\t\r\n\t\t\t\t\t\t\t\tStringBuffer outBuffer = new StringBuffer();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// remove the class attribute (if set) and build the clusterer\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tBuildSubspaceClustererThread clusterthread = new BuildSubspaceClustererThread(clusterer,removeClass(trainInst));\r\n\t\t\t\t\t\t\t\tstart = System.currentTimeMillis();\r\n\r\n\t\t\t\t\t\t\t\tclusterthread.start();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tint timer = Integer.parseInt(m_timer.getText());\r\n\t\t\t\t\t\t\t\tif(!m_EnableTimer.isSelected() || timer <= 0 || timer > 1000000000){\r\n\t\t\t\t\t\t\t\t\ttimer = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tclusterthread.join(timer*60*1000);\r\n\t\t\t\t\t\t\t\tend = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\tif(clusterthread.isAlive()) {\r\n\t\t\t\t\t\t\t\t\tclusterthread.interrupt();\r\n\t\t\t\t\t\t\t\t\tclusterthread.stop();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(\"Timeout after \"+timer+\" minutes\");\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tclusterthread.join();\r\n\t\t\t\t\t\t\t\tif(clusterthread.getException()!=null) {\r\n\t\t\t\t\t\t\t\t\tthrow clusterthread.getException();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\toutBuffer.append(getClusterInformation(clusterer,inst,end-start));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Clustering: done\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Evaluation stuff, catch Exceptions, most likely out of memory\r\n\t\t\t\t\t\t\t\tif(m_EnableEvaluation.isSelected()){\r\n\t\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\t\tif(inst.classIndex() >= 0){\r\n\t\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Evaluation running...\");\r\n\t\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Evaluation: Start\");\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tArrayList<ClusterQualityMeasure> measures = m_evaluationPanel.getSelectedMeasures();\r\n\t\t\t\t\t\t\t\t\t\t\tArrayList<Cluster> m_TrueClusters = m_evaluationPanel.getTrueClusters();\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//Run evaluation\r\n\t\t\t\t\t\t\t\t\t\t\tstart = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\t\tStringBuffer qualBuffer = SubspaceClusterEvaluation.evaluateClustersQuality(clusterer, inst, measures, m_TrueClusters, m_evaluationPanel.getTrueClusterFile());\r\n\t\t\t\t\t\t\t\t\t\t\tend = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\t\toutBuffer.append(qualBuffer);\r\n\t\t\t\t\t\t\t\t\t\t\toutBuffer.append(\"\\n\\nCalculating Evaluation took: \"+formatTimeString(end-start)+\"\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Evaluation: Finished\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Problem evaluating clustering (number of clusters: \"+clusterer.getSubspaceClustering().size()+\")\");\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t}catch (OutOfMemoryError e) {\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t//Visual stuff, catch Exceptions, most likely out of memory\r\n\t\t\t\t\t\t\t\tm_CurrentVis = new SubspaceVisualData();\r\n\t\t\t\t\t\t\t\tif (!isInterrupted() && m_EnableStoreVisual.isSelected()) {\r\n\t\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Calculating visualization...\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Calculate visualization: Start\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t//calculate visual stuff\r\n\t\t\t\t\t\t\t\t\t\tstart = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\tm_CurrentVis.calculateVisual((ArrayList<Cluster>)clusterer.getSubspaceClustering(), removeClass(trainInst));\r\n\t\t\t\t\t\t\t\t\t\tend = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\t//where is the name being used???\r\n\t\t\t\t\t\t\t\t\t\tm_CurrentVis.setName(name + \" (\" + inst.relationName()+ \")\");\r\n\t\t\t\t\t\t\t\t\t\tm_CurrentVis.setHistoryName(parameter_name);\r\n\t\t\t\t\t\t\t\t\t\toutBuffer.append(\"Calculating visualization took: \"+formatTimeString(end-start)+\"\\n\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Calculate visualization: Finished\");\r\n\t\t\t\t\t\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Problem calculating visualization (number of clusters: \"+clusterer.getSubspaceClustering().size()+\")\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tcatch(OutOfMemoryError e){\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//put buffer into cluster so it can be safed with the cluster\r\n\t\t\t\t\t\t\t\tclusterer.setConsole(outBuffer);\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Finished \" + cmd);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tm_History.addResult(name, outBuffer);\r\n\t\t\t\t\t\t\t\tm_History.setSingle(name);\r\n\t\t\t\t\t\t\t\tm_History.updateResult(name);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(ex.getMessage());\r\n\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Problem evaluating clusterer\");\r\n\t\t\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch(OutOfMemoryError e){\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\tFastVector vv = new FastVector();\r\n\t\t\t\t\t\t\t\tvv.addElement(clusterer);\r\n\t\t\t\t\t\t\t\tInstances trainHeader = new Instances(m_Instances, 0);\r\n\t\t\t\t\t\t\t\tvv.addElement(trainHeader);\r\n\t\t\t\t\t\t\t\tif (ignoredAtts != null)\r\n\t\t\t\t\t\t\t\t\tvv.addElement(ignoredAtts);\r\n\t\t\t\t\t\t\t\tvv.addElement(m_CurrentVis);\r\n\t\r\n\t\t\t\t\t\t\t\tm_History.addObject(name, vv);\r\n\t\t\t\t\t\t\t\tif (isInterrupted()) {\r\n\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Bracketing interrupted:\" + cname);\r\n\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (m_Log instanceof TaskLogger) {\r\n\t\t\t\t\t\t\t\t\t((TaskLogger) m_Log).taskFinished();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t\tm_Log.logMessage(ex.getMessage());\r\n\t\t\t\t\t\tm_Log.statusMessage(\"Problem setting up clusterer\");\r\n\t\t\t\t\t} catch (OutOfMemoryError ex) {\r\n\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\tm_Log.logMessage(ex.getMessage());\r\n\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t} \r\n\t\t\t\t\tfinally {\r\n\r\n\t\t\t\t\t\tm_RunThread = null;\r\n\t\t\t\t\t\tm_StartBut.setEnabled(true);\r\n\t\t\t\t\t\tm_StopBut.setEnabled(false);\r\n\t\t\t\t\t\tm_ignoreBut.setEnabled(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//kill all other tasks in the logger so the poor bird can stop running\r\n\t\t\t\t\t\t//belongs somewhere else, but doesnt work in finally after for-bracketing anymore \r\n\t\t\t\t\t\tint clustering_amount = 1;\r\n\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\tclustering_amount = m_bracketingPanel.getNumberClusterings();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (int j = 0; j < clustering_amount; j++) {\r\n\t\t\t\t\t\t\tif (m_Log instanceof TaskLogger) {\r\n\t\t\t\t\t\t\t\t((TaskLogger) m_Log).taskFinished();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(errors){ \r\n\t\t\t\t\t\t\tm_Log.statusMessage(\"Errors accured, see error logs\");\r\n\t\t\t\t\t\t\tJOptionPane\r\n\t\t\t\t\t\t\t\t.showMessageDialog(SubspaceClustererPanel.this,\r\n\t\t\t\t\t\t\t\t\"Problems occured during clusterig, check error log for more details\",\r\n\t\t\t\t\t\t\t\t\"Evaluate clusterer\",\r\n\t\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{ \r\n\t\t\t\t\t\t\tm_Log.statusMessage(\"OK\");\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\tm_RunThread.setPriority(Thread.MIN_PRIORITY);\r\n\t\t\tm_RunThread.start();\r\n\t\t}\r\n\t}", "public List<List<AlgorithmPoint>> getNeighbours(AlgorithmPoint point, double epsilon, int k)\n {\n List<AlgorithmPoint> neighbours = getNeighbours(point, epsilon);\n\n // first we create a max priority queue\n\n PriorityQueue<PrioPair<AlgorithmPoint,Double>> pq = new PriorityQueue<PrioPair<AlgorithmPoint,Double>>();\n\n for (AlgorithmPoint q : neighbours) {\n double dist = Calculations.distance(point.getPoint(), q.getPoint(), Algorithm.DISTANCE_METRIC);\n\n PrioPair<AlgorithmPoint,Double> pair = new PrioPair<AlgorithmPoint,Double>(q, dist);\n\n if (pq.size() <= k) {\n pq.add(pair);\n } else {\n if (dist < ((Double) pq.peek().getV())) {\n // remove the highest element\n pq.poll();\n pq.add(pair);\n }\n }\n }\n\n // now we make the list\n\n List<AlgorithmPoint> knn = new ArrayList<AlgorithmPoint>();\n PrioPair<AlgorithmPoint,Double> pair;\n\n while ((pair = pq.poll()) != null) {\n knn.add(pair.getT());\n }\n\n List<List<AlgorithmPoint>> result = new ArrayList<List<AlgorithmPoint>>(2);\n\n result.add(knn);\n result.add(neighbours);\n\n return result;\n }", "public AggregateKMeansResponse aggregateKMeans(String tableName, List<String> columnNames, int k, double tolerance, Map<String, String> options) throws GPUdbException {\n AggregateKMeansRequest actualRequest_ = new AggregateKMeansRequest(tableName, columnNames, k, tolerance, options);\n AggregateKMeansResponse actualResponse_ = new AggregateKMeansResponse();\n submitRequest(\"/aggregate/kmeans\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void setCentroidsAsMeans();", "public Ms2Cluster cluster(Map<Ms2Pointer, MsnSpectrum> spectra, Float lowmass, OffsetPpmTolerance tol, double min_dp, int miss_index)\n {\n // quit if the master or input are not present!\n if (mHead==null || !Tools.isSet(spectra)) return null;\n\n mHead.cluster=this;\n\n // setting the seed spectrum\n if (getMaster()==null && spectra.get(getHead())!=null)\n setMaster(spectra.get(getHead()).copy(new PurgingPeakProcessor()));\n\n// MsnSpectrum HEAD = (mMaster!=null?mMaster:spectra.get(mHead));\n // setup the master first\n List<Peak> head = Spectra.toListOfPeaks(getMaster(), lowmass);\n // get the index of the HEAD spectrum\n List<Peak> index = Similarity.index(head, 7, 0, 1, 5, 0);\n\n // the collections\n if (mMembers!=null) mMembers.clear(); else mMembers = new ArrayList<>();\n // new members from this round\n Collection<MsnSpectrum> members = new ArrayList<>();\n // the error tolerance\n double delta = tol.calcError(500);\n for (Ms2Pointer member : mCandidates)\n {\n MsnSpectrum scan = spectra.get(member);\n // need to exclude the head itself\n if (member.hcode==getHead().hcode)\n {\n member.dp=1; // being the self\n member.cluster=this;\n mMembers.add(member);\n continue;\n }\n if (scan!=null)\n {\n // calc the forward and backward DPs and choose the smallest\n List<Peak> pks = Spectra.toListOfPeaks(scan,lowmass);\n // make sure a min number of the index peaks are found\n if (miss_index>=0 && index.size()-Peaks.overlap_counts(pks, index, delta, true)>miss_index) continue;\n\n member.dp=(float )Similarity.bidirectional_dp(head, pks, tol, true, true, true);\n // now the matching probability\n member.prob = (float )Similarity.similarity_hg(head, pks, delta);\n\n if (member.dp>=min_dp)\n {\n member.cluster=this;\n mMembers.add(member);\n members.add(spectra.get(member));\n }\n }\n }\n mMaster = Spectra.accumulate(getMaster(), tol, 0.5f, members);\n mMz = (float )mMaster.getPrecursor().getMz();\n mRT = (float )getMaster().getRetentionTimes().getFirst().getTime()/60f;\n mCharge = getMaster().getPrecursor().getCharge();\n// mID = Tools.d2s(getMz(),3)+\"|\"+getCharge()+\"|\"+Tools.d2s(getRT(),1);\n mID = toString();\n\n // remove the local objects\n head = (List )Tools.dispose(head);\n index = (List )Tools.dispose(index);\n members = Tools.dispose(members);\n\n return this;\n }", "Execution getClosestDistance();", "protected final void go(CommandLine options)\r\n {\r\n final File outputDir = (File) getOption(options, \"output\", null);\r\n final File descriptors = (File) getOption(options, \"algorithms\", new File(\"algorithms\"));\r\n \r\n super.config.setDefaultValue(ConfigConstants.ATTR_CLUSTERS_ONLY, new Boolean(options.hasOption(\"co\")));\r\n super.config.setDefaultValue(ConfigConstants.ATTR_DEFAULT_PROCESSID, options.getOptionValue(\"algorithm\"));\r\n super.config.setDefaultValue(ConfigConstants.ATTR_OUTPUT_FORMAT, \r\n options.hasOption(\"json\") ? ControllerContext.RESULTS_TO_JSON :\r\n options.hasOption(\"xml\") ? ControllerContext.RESULTS_TO_XML : null);\r\n \r\n final boolean verbose = options.hasOption(\"verbose\");\r\n if (verbose)\r\n {\r\n logger.setLevel(Level.DEBUG);\r\n }\r\n \r\n if (outputDir != null && !outputDir.exists())\r\n {\r\n logger.info(\"Creating output folder: \" + outputDir.getAbsolutePath());\r\n if (!outputDir.mkdirs())\r\n {\r\n logger.error(\"Could not create output folder: \" + outputDir.getAbsolutePath());\r\n return;\r\n }\r\n }\r\n \r\n if (outputDir == null)\r\n {\r\n logger.warn(\"Output directory not specified, clustering without saving the result.\");\r\n }\r\n \r\n // Initialize processes.\r\n final ControllerContext context;\r\n try\r\n {\r\n context = initializeContext(descriptors);\r\n }\r\n catch (Exception e)\r\n {\r\n getLogger().fatal(\"Could not initialize clustering algorithms. Inspect log files.\", e);\r\n return;\r\n }\r\n \r\n final String processId = config.getString(ConfigConstants.ATTR_DEFAULT_PROCESSID);\r\n if (processId == null || !context.getController().getProcessIds().contains(processId))\r\n {\r\n if (processId == null)\r\n {\r\n getLogger().fatal(\"Provide the identifier of a clustering algorithm to use.\");\r\n }\r\n else\r\n {\r\n getLogger().fatal(\"This clustering algorithm is not available: \" + processId);\r\n }\r\n return;\r\n }\r\n \r\n // Collect files to process.\r\n final String [] unprocessed = options.getArgs();\r\n final ArrayList files = new ArrayList();\r\n \r\n for (int i = 0; i < unprocessed.length; i++)\r\n {\r\n final File file = new File(unprocessed[i]);\r\n if (!file.exists())\r\n {\r\n logger.warn(\"File does not exist, skipping: \" + file);\r\n continue;\r\n }\r\n \r\n if (file.isDirectory())\r\n {\r\n final File [] subfiles = file.listFiles(new FileFilter()\r\n {\r\n public boolean accept(File subfile)\r\n {\r\n return (subfile.isFile() && subfile.canRead());\r\n }\r\n });\r\n files.addAll(Arrays.asList(subfiles));\r\n }\r\n else\r\n {\r\n files.add(file);\r\n }\r\n }\r\n \r\n // Run batch clustering.\r\n try\r\n {\r\n if (files.isEmpty())\r\n {\r\n getLogger().warn(\"Empty list of input files. Provide files and/or directories as program arguments.\");\r\n }\r\n \r\n for (Iterator i = files.iterator(); i.hasNext();)\r\n {\r\n final File f = (File) i.next();\r\n logger.info(\"Processing file: \" + f.getName());\r\n \r\n OutputStream outputStream = null;\r\n InputStream inputStream = null;\r\n try\r\n {\r\n inputStream = new FileInputStream(f);\r\n if (outputDir != null)\r\n {\r\n outputStream = new FileOutputStream(new File(outputDir, f.getName()));\r\n }\r\n else\r\n {\r\n outputStream = new ByteArrayOutputStream();\r\n }\r\n \r\n final String processName = config.getRequiredString(ConfigConstants.ATTR_DEFAULT_PROCESSID);\r\n final String outputProcessName = null;\r\n final boolean clustersOnly = config.getRequiredBoolean(ConfigConstants.ATTR_CLUSTERS_ONLY);\r\n ProcessingUtils.cluster(context.getController(), getLogger(), inputStream, outputStream, processName, outputProcessName, clustersOnly);\r\n }\r\n catch (IOException e)\r\n {\r\n if (outputStream != null) outputStream.close();\r\n if (inputStream != null) inputStream.close();\r\n }\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n getLogger().fatal(\"Unhandled program error occurred.\", e);\r\n }\r\n \r\n getLogger().info(\"Finished.\");\r\n }", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "public void runAlgorithm(PointList customers, int highwayLength, int velocity) {\n\t\t\n\t\tif (!customers.isEmpty()){\n\t\t\tthis._highwayLength = highwayLength;\n\t\t\tthis._velocity = velocity;\n\t\t\t_maxDist = customers.maxDist();\n\t\t\t\n\t\t\t// for drawing purposes only\n\t\t\tfacilityPoints = new ArrayList<Point>();\n\t\t\tturnpikePoints = new ArrayList<Point>();\n\t\t\tpartitionRadius = new ArrayList<Double>();\n\t\t\t\n\t\t\tset_withTurnpike = new ArrayList<PointList>();\n\t\t\tset_withoutTurnpike = new ArrayList<PointList>();\n\t\t\textremePoints1 = new ArrayList<Point[]>();\n\t\t\textremePoints2 = new ArrayList<Point[]>();\n\t\t\tlist_centersWithoutTurnpike = new ArrayList<PointList>();\n\t\t\tlist_centersWithTurnpike = new ArrayList<PointList>();\n\t\t\t\n\t\t\tgetPartition(customers);\n\t\t\t\n\t\t\tmaxDist1 = new ArrayList<Point>();\n\t\t\tmaxDist2 = new ArrayList<Point>();\n\t\t\tminDist1 = new ArrayList<Point>();\n\t\t\tminDist2 = new ArrayList<Point>();\n\t\t\t\n\t\t\t// compute extreme points\n\t\t\tfor (PointList p : set_withTurnpike){\n\t\t\t\textremePoints1.add(p.getExtremePoints());\n\t\t\t}\n\t\t\tfor (PointList p : set_withoutTurnpike){\n\t\t\t\textremePoints2.add(p.getExtremePoints());\n\t\t\t}\n\t\t\t\n\t\t\t// solve basic problem for all partitions {W,H}\n\t\t\tfor (int i = 0; i < set_withTurnpike.size(); i++){\n\n\t\t\t\t_eps1 = Math.max(0, set_withTurnpike.get(i).delta() + highwayLength/velocity - set_withoutTurnpike.get(i).delta());\n\t\t\t\t_eps2 = Math.max(0, set_withoutTurnpike.get(i).delta() - set_withTurnpike.get(i).delta() - highwayLength/velocity);\n\n\t\t\t\tsolveBP(set_withTurnpike.get(i), set_withoutTurnpike.get(i)); \n\t\t\t\tfacilityPoints.add(_currentFacility);\n\t\t\t\tturnpikePoints.add(_currentTurnpikeStart);\n\t\t\t\tpartitionRadius.add(_currentRadius);\n\t\t\t\t\n\t\t\t\t// for drawing purposes\n\t\t\t\t// fixed length\n\t\t\t\tlist_centersWithoutTurnpike.add(center(set_withTurnpike.get(i), set_withTurnpike.get(i).delta() + _eps2 + _x));\n\t\t\t\tlist_centersWithTurnpike.add(center(set_withoutTurnpike.get(i), set_withoutTurnpike.get(i).delta() + _eps1 + _x));\n\t\t\t\t\n\t\t\t\tif (list_centersWithoutTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0])\n\t\t\t\t\t\t|| list_centersWithTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1])){\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t\t} else {\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]);\n\t\t\t\t}\n\t\t\t\tmaxDist1.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\tmaxDist2.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t}\t\n\t\t\t\n\t\t\tif(customers.getSize() > 1){\n\t\t\t\t// find optimal solution\n\t\t\t\tsolutionIndex = getMinRadiusIndex(); \n\t\t\t\tsolution_facility = facilityPoints.get(solutionIndex);\n\t\t\t\tsolution_turnpikeStart = turnpikePoints.get(solutionIndex);\n//\t\t\t\tsolution_radius = partitionRadius.get(solutionIndex);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void kruskalMST()\n\t\t{\n\t\t\tPriorityQueue<Edge> pq = new PriorityQueue<>(allEdges.size(), Comparator.comparingInt(o -> o.roadCost));\n\n\t\t\tfor(int i = 0; i < allEdges.size(); i++)\n\t\t\t{\t\n\t\t\t\tpq.add(allEdges.get(i));\n\t\t\t}\t\t\t\n\n\t\t\tint [] parent = new int[edges];\n\t\t\tmakeSet(parent);\n\t\t\tArrayList<Edge> mst = new ArrayList<>();\n\t\t\tint index = 0, tempCost = 0;\n\n\t\t\t// Step 2: Pick the lowest cost edges to add to our result\n\t\t\twhile(index < edges - 1)\n\t\t\t{\n\t\t\t\tEdge edge = pq.remove();\n\t\t\t\tint x_set = find(parent, edge.source);\n\t\t\t\tint y_set = find(parent, edge.destination);\n\n\t\t\t\t// If creates a cycle, or a road with n wagons can't support the total weight ignore it\n\t\t\t\tif(x_set == y_set /* ||edge.weightCap * wagons < shipWeight */ ){\n\t\t\n\t\t\t\t}else{\n\t\t\t\t\t// These are valid edges for our MST\n\t\t\t\t\tmst.add(edge);\n\t\t\t\t\ttempCost += edge.roadCost;\n\t\t\t\t\tindex++;\n\t\t\t\t\tunion(parent, x_set, y_set);\n\t\t\t\t}\n\t\t\t\t// If there are no edges left, break out of the while loop\n\t\t\t\tif(pq.size() < 1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// ----------- Output working MSTs ----------- \n\t\t\t// printGraph(allEdges);\n\t\t\t// printCities(allCities);\n\n\t\t}", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "public void processFoundCluster(NodeSet cluster) {\n\t}", "public static ArrayList<Point> getInitialCenters(FileSystem fs, Path input, int k) throws IOException {\n\t\treturn getInitialCenters(fs, input, k, false);\n\t}", "protected void setup(Context context) throws IOException, InterruptedException {\n\t\t\tConfiguration config = context.getConfiguration();\n\t\t\t// get the parameter of name \"k\"\n\t\t\t// 2 is the default value (getInt returns the default value if the param of \"k\" is not set)\n\t\t\tK = config.getInt (\"K\", 2);\n\t\t\tdimension = config.getInt (\"dimension\", 2);\n\t\t\t// we have k number of cluster centers\n\t\t\tcenters = new double[K][dimension];\n\t\t\t// get the vectors of the k cluster centers \n // TODO\n // ------------------------------------------------------\n //\n // ------------------------------------------------------\n\n\t\t}", "public static int[] getMinKthNearestN(double[][] pts, int k){\n if(k>= pts.length){\n int[] indexs = new int[k];\n for(int i = 0;i<indexs.length;i++){\n indexs[i] = i;\n }\n return indexs;\n }\n\n double[][] distanceTo = new double[pts.length][pts.length];\n int[][] indexs = new int[pts.length][pts.length];\n for(int i = 0; i<pts.length;i++){\n for(int j = 0; j<pts.length;j++){\n indexs[i][j] = j;\n distanceTo[i][j] = Math.pow(pts[i][0] - pts[j][0],2)+Math.pow(pts[i][1] - pts[j][1],2);\n }\n }\n\n\n for(int i = 0; i<pts.length;i++){\n iSort(indexs[i],distanceTo[i]);\n }\n\n double minKthNearestN = Double.POSITIVE_INFINITY;\n int pos = -1;\n for(int i = 0; i<pts.length;i++){\n if(distanceTo[i][k] < minKthNearestN){\n minKthNearestN = distanceTo[i][k];\n pos = i;\n }\n }\n int[] space = new int[k+1];\n for(int i = 0; i<=k; i++){\n space[i] = indexs[pos][i];\n }\n\n return space;\n }", "public static Tour FarthestInsertion (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n double max;\n double min;\n int chosenPoint = 0;\n int pos = -1;\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(in);\n tour.addPoint(out);\n while (tour.getSize() != numbernodes) {\n int point = 1;\n int insertPoint = 1;\n max =0;\n for (int i = 0; i < numbernodes; i++) {\n double minimum = Double.MAX_VALUE;\n\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (visited[i] == 1) {\n } else {\n double distance;\n\n for (int j = 1; j <= tour.getSize() - 1; j++) {\n int vor = tour.getPoint((j - 1)).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex];\n if (distance < minimum) {\n minimum = distance;\n point = j;\n pos = i;\n }\n }\n if (minimum > max){\n max = minimum;\n chosenPoint = pos;\n insertPoint = point;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(chosenPoint));\n visited[chosenPoint] = 1;\n }\n }\n tour.removePoint(in);\n tour.addPoint(in);\n return tour;\n }", "public Point[] kClosest(Point[] points, Point origin, int k) {\n globalOrigin = origin;\n Queue<Point> pq = new PriorityQueue<>(k, new Comparator<Point>() {\n @Override\n public int compare(Point p1, Point p2) {\n int diff = getDistance(globalOrigin, p2) - getDistance(globalOrigin, p1);\n if (diff == 0) {\n diff = p2.x - p1.x;\n }\n if (diff == 0) {\n diff = p2.y - p1.y;\n }\n return diff;\n }\n });\n\n for (int i = 0; i < points.length; i++) {\n pq.offer(points[i]);\n if (pq.size() > k) {\n pq.poll();\n }\n }\n int size = pq.size();\n Point[] results = new Point[size];\n for (int j = size - 1; j >= 0; j--) {\n results[j] = pq.poll();\n }\n return results;\n }", "public void search() {\r\n\t\tfloat dist = getDistance(permutationPrev);\r\n\t\tfloat delta = 0;\r\n\t\tfloat prob = 0;\r\n\r\n\t\tboolean accept = false;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\twhile ((temperature > minTemperature) || (nIter > 0)) {\r\n\t\t\tdisturbPermut(permutationPrev);\r\n\t\t\tdelta = getDistance(permutation) - dist;\r\n\r\n\t\t\tprob = (float) Math.exp(-delta / temperature);\r\n\t\t\taccept = ((delta < 0) || (delta * (prob - rand.nextFloat()) >= 0));\r\n\r\n\t\t\tif (accept) {\r\n\t\t\t\tacceptPermution(permutation);\r\n\t\t\t\tdist = delta + dist;\r\n\t\t\t}\r\n\r\n\t\t\ttemperature *= cBoltzman;\r\n\t\t\tnIter--;\r\n\r\n\t\t\ttrace.add(dist);\r\n\t\t}\r\n\t\tshortestDist = dist;\r\n\t}", "@Override\n\tpublic void run() {\n\t\tMap<Integer, Integer> roots = new TreeMap<Integer, Integer>();\n\t\t\n\t\tEdge[] edges = new Edge[this.edges.length];\n\t\tint n, weight, relevantEdges, root, lowerBound = 0;\n\t\n\t\t// Sort edges by weight.\n\t\tquickSort(0, this.edges.length - 1);\n\t\n\t\t// Compute initial lower bound (best k - 1 edges).\n\t\t// Choosing the cheapest k - 1 edges is not very intelligent. There is no guarantee\n\t\t// that this subset of edges even induces a subgraph over the initial graph.\n\t\t// TODO: Find a better initial lower bound.\n\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\tlowerBound += this.edges[i].weight;\n\t\t}\n\t\n\t\t// Iterate over all nodes in the graph and run Prim's algorithm\n\t\t// until k - 1 edges are fixed.\n\t\t// As all induced subgraphs have k nodes and are connected according to Prim, they\n\t\t// are candidate solutions and thus submitted.\n\t\tfor (root = 0; root < taken.length; root++) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\n\t\t\ttaken[root] = true;\n\t\t\tn = 0;\n\t\t\tweight = 0;\n\t\t\trelevantEdges = this.edges.length;\n\n\t\t\twhile (n < solution.length) { \n\t\t\t\tfor (int i = 0; i < relevantEdges; i++) {\n\t\t\t\t\t// XOR to check if connected and no circle.\n\t\t\t\t\tif (taken[edges[i].node1] ^ taken[edges[i].node2]) {\n\t\t\t\t\t\ttaken[taken[edges[i].node1] ? edges[i].node2 : edges[i].node1] = true;\n\t\t\t\t\t\tsolution[n++] = edges[i];\n\t\t\t\t\t\tweight += edges[i].weight;\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Check for circle.\n\t\t\t\t\telse if (taken[edges[i].node1]) {\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Sum up what we've just collected and submit this\n\t\t\t// solution to the framework.\n\t\t\tHashSet<Edge> set = new HashSet<Edge>(solution.length);\n\t\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\t\tset.add(solution[i]);\n\t\t\t}\n\t\t\tsetSolution(weight, set);\n\t\t\troots.put(weight, root);\n\t\t}\n\n\t\t// Now for the real business, let's do some Branch-and-Bound. Roots of \"k Prim Spanning Trees\"\n\t\t// are enumerated by weight to increase our chances to obtain the kMST earlier.\n\t\tfor (int item : roots.values()) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\t\t\ttaken[item] = true;\n\t\t\tbranchAndBound(edges, solution.length, 0, lowerBound);\n\t\t}\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n MapModel map = new MapModel(googleMap, true, true);\n map.setMapType(1);\n\n new PersonModel().addItems(person_list);\n //Cluster Manage with click actions in cluster and inside cluster markers :)\n\n LatLng center_location = map.getMapCenterPosition(1, person_list);\n\n Location center_point = new Location(\"center_point\");\n center_point.setLatitude(center_location.latitude);\n center_point.setLongitude(center_location.longitude);\n\n float max_distance = 0;\n for (PersonModel person : person_list) {\n\n System.out.println(person.getPosition());\n\n Location location_mountain = new Location(\"select_location\");\n\n location_mountain.setLatitude(person.getPosition().latitude);\n location_mountain.setLongitude(person.getPosition().longitude);\n float distance = center_point.distanceTo(location_mountain);\n System.out.println(distance + \" to check....\");\n if (distance > max_distance) {\n max_distance = distance;\n System.out.println(distance + \" new asign....\");\n }\n }\n\n\n map.moveCamera(center_location, max_distance);\n mClusterManager = new ClusterManager<>(this, map.getGoogleMap());\n mClusterManager.setRenderer(new PersonClusterRenderer(this, map.getGoogleMap() ,mClusterManager, ClusterMapsActivity.this));\n map.getGoogleMap().setOnCameraChangeListener(mClusterManager);\n map.getGoogleMap().setOnMarkerClickListener(mClusterManager);\n map.getGoogleMap().setOnInfoWindowClickListener(mClusterManager);\n mClusterManager.setOnClusterClickListener(this);\n mClusterManager.setOnClusterInfoWindowClickListener(this);\n mClusterManager.setOnClusterItemClickListener(this);\n mClusterManager.setOnClusterItemInfoWindowClickListener(this);\n for(PersonModel person:person_list)\n {\n mClusterManager.addItem(person);\n }\n\n mClusterManager.cluster();\n\n\n map.getGoogleMap().setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n @Override\n public void onInfoWindowClick(Marker arg0) {\n\n for (PersonModel person : person_list) {\n if (person.name.equals(arg0.getTitle())) {\n\n String uri = \"http://maps.google.com/maps?daddr=\"+arg0.getPosition().latitude+\",\"+\n arg0.getPosition().longitude;\n System.out.println(\"Google maps url: \"+uri);\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));\n intent.setClassName(\"com.google.android.apps.maps\", \"com.google.android.maps.MapsActivity\");\n startActivity(intent);\n }\n }\n }\n });\n }", "public ArrayList<Cluster> mergeBestCluster(int pDistancia,int pMetrica,int k, int clustN)\n\t{\n\t\tcalculateDistances(pDistancia, pMetrica, k);\n\t\tDistance dist = distanceList.getFirst();\n\t\tArrayList<Cluster> clustArray;\n\t\tclustArray = (ArrayList<Cluster>) clusterList.clone();\n\t\tclustArray.remove(dist.getCluster1());\n\t\tclustArray.remove(dist.getCluster2());\n\t\t\n\t\tCluster clust = new Cluster(clustN, dist.mergerInstances() , dist.getCluster1(), dist.getCluster2(), iterationName);\n\t\t//Añadimos el nuevo cluster (El unido) a la nuevalista de clusters\n\t\tclustArray.add(clustArray.size(),clust);\n\t\t\n\t\treturn clustArray;\n\t}", "private static void testAlgorithmOptimality() {\n AlgoFunction testAlgo = SG16Algorithm::new;\n\n //printSeed = false; // keep this commented out.\n Random seedRand = new Random(1241);\n int initial = seedRand.nextInt();\n for (int i=0; i<50000000; i++) {\n int sizeX = seedRand.nextInt(150) + 5;\n int sizeY = seedRand.nextInt(150) + 5;\n int seed = i+initial;\n int ratio = seedRand.nextInt(50) + 5;\n \n int max = (sizeX+1)*(sizeY+1);\n int p1 = seedRand.nextInt(max);\n int p2 = seedRand.nextInt(max-1);\n if (p2 == p1) {\n p2 = max-1;\n }\n \n int sx = p1%(sizeX+1);\n int sy = p1/(sizeX+1);\n int ex = p2%(sizeX+1);\n int ey = p2/(sizeX+1);\n\n double restPathLength = 0, normalPathLength = 0;\n try {\n GridGraph gridGraph = DefaultGenerator.generateSeededGraphOnly(seed, sizeX, sizeY, ratio);\n for (int iii=0;iii<300;++iii) Utility.generatePath(testAlgo, gridGraph, seedRand.nextInt(sizeX+1),seedRand.nextInt(sizeY+1),seedRand.nextInt(sizeX+1),seedRand.nextInt(sizeY+1));\n int[][] path = Utility.generatePath(testAlgo, gridGraph, sx, sy, ex, ey);\n path = Utility.removeDuplicatesInPath(path);\n restPathLength = Utility.computePathLength(gridGraph, path);\n \n path = Utility.computeOptimalPathOnline(gridGraph, sx, sy, ex, ey);\n path = Utility.removeDuplicatesInPath(path);\n normalPathLength = Utility.computePathLength(gridGraph, path);\n }catch (Exception e) {\n e.printStackTrace();\n System.out.println(\"EXCEPTION OCCURRED!\");\n System.out.println(\"Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Start = \" + sx + \",\" + sy + \" End = \" + ex + \",\" + ey);\n throw new UnsupportedOperationException(\"DISCREPANCY!!\");\n }\n \n if (Math.abs(restPathLength - normalPathLength) > 0.000001f) {\n //if ((restPathLength == 0.f) != (normalPathLength == 0.f)) {\n System.out.println(\"============\");\n System.out.println(\"Discrepancy Discovered!\");\n System.out.println(\"Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Start = \" + sx + \",\" + sy + \" End = \" + ex + \",\" + ey);\n System.out.println(\"Actual: \" + restPathLength + \" , Expected: \" + normalPathLength);\n System.out.println(restPathLength / normalPathLength);\n System.out.println(\"============\");\n throw new UnsupportedOperationException(\"DISCREPANCY!!\");\n } else {\n if (i%1000 == 999) {\n System.out.println(\"Count: \" + (i+1));\n System.out.println(\"OK: Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Actual: \" + restPathLength + \" , Expected: \" + normalPathLength);\n }\n }\n }\n }", "private static LinkedList<Integer> localSearch2Opt(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( true )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "public Collection<Node> getNearestNodes(Point point,\n\t\t\tCollection<Node> affectedNodes,\n\t\t\tPredicate<OsmPrimitive> isSelectablePredicate) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tKNN knn = new KNN();\n\t\tknn.classifyTestData();\n\t\t/*\n\t\t * List<Data> knearest = knn.kNearestNeighbors(30, knn.testData.get(0));\n\t\t * for (Data data : knearest) {\n\t\t * System.out.println(data.getEuclideanDistance()); }\n\t\t */\n\t\tSystem.out.println(\"OK\");\n\t}", "public static void main(String[] args) {\n \n PointSET pset = new PointSET();\n System.out.println(\"Empty: \" + pset.isEmpty());\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.6));\n pset.insert(new Point2D(0.5, 0.7));\n pset.insert(new Point2D(0.5, 0.8));\n pset.insert(new Point2D(0.1, 0.5));\n pset.insert(new Point2D(0.8, 0.5));\n pset.insert(new Point2D(0.1, 0.1));\n System.out.println(\"Empty: \" + pset.isEmpty());\n System.out.println(\"Size: \" + pset.size());\n System.out.println(\"Nearest to start: \" + pset.nearest(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #1: \" + pset.contains(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #2: \" + pset.contains(new Point2D(0.5, 0.5)));\n System.out.print(\"Range #1: \");\n for (Point2D p : pset.range(new RectHV(0.001, 0.001, 0.002, 0.002)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #2: \");\n for (Point2D p : pset.range(new RectHV(0.05, 0.05, 0.15, 0.15)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #3: \");\n for (Point2D p : pset.range(new RectHV(0.25, 0.35, 0.65, 0.75)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n \n }", "public REXP kmeans(double[] values, String[] rnames, String[] cnames,\n boolean usePam, String minClusCountExpr, String maxClusCountExpr) {\n minClusCountExpr = minClusCountExpr.replaceAll(\"N\",\n String.valueOf(rnames.length));\n maxClusCountExpr = maxClusCountExpr.replaceAll(\"N\",\n String.valueOf(rnames.length));\n\n double minClusCount = Calculator.calculate(minClusCountExpr);\n double maxClusCount = Calculator.calculate(maxClusCountExpr);\n\n logger.info(\"MIN clusters count: \" + minClusCount\n + \" MAX clusters count: \" + maxClusCount);\n\n // calculate\n\n logger.info(\"values:\\n\" + Arrays.toString(values));\n rengine.assign(CELLS_NAME, values);\n rengine.assign(ROWS_NAME, rnames);\n rengine.assign(COLS_NAME, cnames);\n\n String matrixCmd = \"x <- matrix(\" + CELLS_NAME + \", nrow=\"\n + rnames.length + \", ncol=\" + cnames.length\n + \", byrow=TRUE, dimnames=list(\" + ROWS_NAME + \",\" + COLS_NAME\n + \"))\";\n logger.info(\"Creating matrix command: \" + matrixCmd);\n\n rengine.eval(matrixCmd);\n\n String kmeansCmd = \"km <- pamk(x,\" + ((int) minClusCount) + \":\"\n + ((int) maxClusCount) + \",usepam=\"\n + String.valueOf(usePam).toUpperCase() + \")\";\n logger.info(\"Kmeans command: \" + kmeansCmd);\n REXP km = rengine.eval(kmeansCmd);\n\n // rengine.eval(\"print(km$nc)\");\n\n logger.info(\"Optimal number of clusters : \"\n + ((REXP) km.asVector().get(1)).asInt());\n\n return km;\n\n }" ]
[ "0.652909", "0.6428615", "0.6300359", "0.61292124", "0.609026", "0.5995944", "0.5990615", "0.5879953", "0.5868367", "0.58560073", "0.57911193", "0.57191795", "0.5718159", "0.5700042", "0.5633211", "0.55821127", "0.5502318", "0.54986984", "0.5494347", "0.5493067", "0.545212", "0.53550845", "0.5347129", "0.5326706", "0.5322127", "0.5287845", "0.5277078", "0.5250569", "0.5239007", "0.5237969", "0.523045", "0.5208899", "0.51850474", "0.5173786", "0.5166448", "0.51641273", "0.5161003", "0.5159402", "0.51424605", "0.51401323", "0.513294", "0.51264375", "0.5118365", "0.5097637", "0.50752246", "0.50661546", "0.5049428", "0.50412256", "0.50219953", "0.5019194", "0.50168097", "0.49666563", "0.49643958", "0.4958853", "0.4948975", "0.49430853", "0.49276084", "0.49275354", "0.49248135", "0.4917363", "0.4910353", "0.48831886", "0.48634326", "0.4858421", "0.48573327", "0.48541856", "0.48532078", "0.48501796", "0.4849378", "0.4845647", "0.48428875", "0.48335987", "0.48256683", "0.48248824", "0.48206896", "0.48060948", "0.48036316", "0.47938642", "0.4787612", "0.4781548", "0.4779572", "0.47763368", "0.4770815", "0.47695255", "0.4757645", "0.4750837", "0.47458056", "0.47443777", "0.47440994", "0.47252467", "0.4721633", "0.4696401", "0.46943873", "0.46915358", "0.46827775", "0.4680733", "0.46775904", "0.46740884", "0.466864", "0.46678823" ]
0.46640623
100
This endpoint runs the kmeans algorithm a heuristic algorithm that attempts to do kmeans clustering. An ideal kmeans clustering algorithm selects k points such that the sum of the mean squared distances of each member of the set to the nearest of the k points is minimized. The kmeans algorithm however does not necessarily produce such an ideal cluster. It begins with a randomly selected set of k points and then refines the location of the points iteratively and settles to a local minimum. Various parameters and options are provided to control the heuristic search.
public AggregateKMeansResponse aggregateKMeans(String tableName, List<String> columnNames, int k, double tolerance, Map<String, String> options) throws GPUdbException { AggregateKMeansRequest actualRequest_ = new AggregateKMeansRequest(tableName, columnNames, k, tolerance, options); AggregateKMeansResponse actualResponse_ = new AggregateKMeansResponse(); submitRequest("/aggregate/kmeans", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Override\n public String kMeansClusters_json(int k) {\n\n List<Set<String>> kMeansClusters = new ArrayList<Set<String>>();\n\n if (k == 1) {\n // No algorithm needed\n kMeansClusters.add(new HashSet<String>(this.restaurantMap.keySet()));\n return this.clusterToJSON(kMeansClusters);\n }\n\n // restaurant clusters contains random centroids mapped to a set of its closest\n // restaurants (in id form)\n Map<double[], Set<String>> restaurantClusters = this.initiateClusters(k, this.restaurantMap.keySet());\n\n do {\n Set<String> emptyCluster = findEmptyCluster(restaurantClusters);\n Set<String> largestCluster = findLargestCluster(restaurantClusters);\n\n // Code below finds some random centroid within the largest cluster\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n for (String rID : largestCluster) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n double[] centroidInLargestCluster = this.generateRandomCentroid(minLat, maxLat, minLon, maxLon);\n\n // Find the empty cluster and reassign its centroid by placing it somewhere in\n // the largest cluster\n for (double[] centroid : restaurantClusters.keySet()) {\n if (restaurantClusters.get(centroid).equals(emptyCluster)) {\n centroid[0] = centroidInLargestCluster[0]; // New longitude based on largest cluster\n centroid[1] = centroidInLargestCluster[1]; // New latitude based on largest cluster\n break; // Once we find the empty cluster, we are done\n }\n }\n\n // Flag is true if any restaurants are reassigned to a new centroid\n // If no restaurants are reassigned, then we are done one run through\n boolean flag;\n do {\n this.reassignCentroids(restaurantClusters);\n flag = reassignRestaurants(restaurantClusters, this.restaurantMap.keySet());\n } while (flag);\n\n } while (atLeastOneEmptyCluster(restaurantClusters)); // Repeat if any empty clusters are detected\n\n // Add final restaurant clusters to list of clusters\n for (Set<String> cluster : restaurantClusters.values()) {\n kMeansClusters.add(cluster);\n }\n return this.clusterToJSON(kMeansClusters);\n }", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "public static int getOptimalK(Dataset<Row> vectorData) {\n\t\tList<Integer> K = new ArrayList<Integer>();\n\t\tList<Double> computeCost = new ArrayList<Double>();\n\n\t\tfor (int i = 2; i < 10; i++) {\n\n\t\t\tKMeans kMeansForTops = new KMeans().setK(i).setSeed(1L);\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tKMeansModel kMeansModel = kMeansForTops.fit(vectorData);\n\t\t\tSystem.out.println(\"Time to FIT \" + (System.currentTimeMillis() - start) / 1000);\n\t\t\tdouble cost = kMeansModel.computeCost(vectorData); // WCSS\n\t\t\t// KMeansSummary\n\t\t\tK.add(i);\n\t\t\tcomputeCost.add(cost);\n\t\t\t// System.out.println(\"================ Compite cost for K == \" + i + \" is == \"\n\t\t\t// + cost);\n\n\t\t\tDataset<Row> kMeansPredictions = kMeansModel.transform(vectorData);\n\n\t\t\tfor (int j = 0; j < i; j++) {\n\n\t\t\t\t// System.out.println(\"====================== Running it for \" + j + \"th cluster\n\t\t\t\t// when the K is \" + i);\n\t\t\t\t// System.out.println(\"====================== Range for the cluster count \" + i\n\t\t\t\t// + \" ===================\");\n\t\t\t\t// kMeansPredictions.where(kMeansPredictions.col(\"prediction\").equalTo(j)).agg(min(\"features\"),\n\t\t\t\t// max(\"features\")).show();\n\n\t\t\t}\n\n\t\t\t// kMeansPredictions.agg(min(\"features\"), max(\"features\")).show();\n\t\t\t// System.out.println(\"====================== Calculating Silhouette\n\t\t\t// ===================\");\n\n\t\t\t// Evaluate clustering by computing Silhouette score\n\t\t\tClusteringEvaluator topsEvaluator = new ClusteringEvaluator();\n\n\t\t\tdouble TopsSilhouette = topsEvaluator.evaluate(kMeansPredictions);\n\n\t\t\t// System.out.println(\"================ Silhouette score for K == \" + i + \" is\n\t\t\t// == \" + TopsSilhouette);\n\n\t\t}\n\n\t\tPlot plt = Plot.create();\n\t\t// plt.plot().add(K, computeCost).label(\"MyLabel\").linestyle(\"bx-\");\n\t\t// plt.plot().\n\n\t\tSystem.out.println(\"K List \" + K);\n\t\tSystem.out.println(\"Cost List \" + computeCost);\n\t\tplt.plot().add(K, computeCost).label(\"Elbow\").linestyle(\"--\");\n\t\tplt.xlabel(\"K\");\n\t\tplt.ylabel(\"Cost\");\n\t\tplt.title(\"Compute Cost for K-Means !\");\n\t\tplt.legend();\n\t\ttry {\n\t\t\tplt.show();\n\t\t} catch (IOException | PythonExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn 0;\n\n\t}", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "private static void k_means_offline(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "private Map<double[], Set<String>> initiateClusters(int k, Set<String> restaurantIDs) {\n // centroids[0] is lattitude and centroids[1] is longitude for a centroid\n // Map assigns restaurants to a specific centroid\n Map<double[], Set<String>> restaurantClusters = new HashMap<double[], Set<String>>();\n\n // Find the min and max latitudes and longitudes\n double minLat = Double.MAX_VALUE;\n double minLon = Double.MAX_VALUE;\n double maxLat = -Double.MAX_VALUE;\n double maxLon = -Double.MAX_VALUE;\n\n for (String rID : restaurantIDs) {\n double lat = this.restaurantMap.get(rID).getLatitude();\n double lon = this.restaurantMap.get(rID).getLongitude();\n if (lat < minLat) {\n minLat = lat;\n }\n if (lat > maxLat) {\n maxLat = lat;\n }\n if (lon < minLon) {\n minLon = lon;\n }\n if (lon > maxLon) {\n maxLon = lon;\n }\n }\n\n // Create a number of centroids equal to k\n for (int i = 0; i < k; i++) {\n // generate random centroid based on min and max latitudes\n // and longitudes, with (currently) no assigned restaurants\n HashSet<String> emptySet = new HashSet<String>();\n restaurantClusters.put(this.generateRandomCentroid(minLat, maxLat, minLon, maxLon), emptySet);\n }\n\n // Assign each restaurant to its closest centroid\n\n for (String rID : restaurantIDs) {\n\n double[] newCentroid = null;\n double minDist = Double.MAX_VALUE;\n\n for (double[] centroid : restaurantClusters.keySet()) {\n double distance = this.computeDistance(centroid, this.restaurantMap.get(rID));\n if (distance < minDist) {\n newCentroid = centroid;\n minDist = distance;\n }\n }\n restaurantClusters.get(newCentroid).add(rID);\n }\n return restaurantClusters;\n }", "static void start() throws IOException\n {\n Double[][] center;\n JavaPairRDD<Integer, Tuple2<Double[], Double>> sol;\n\n center = create_center( num_k );\n\n // 5.do until terminate\n for( int iter=0; iter<num_iter; iter++ )\n\t\t{\n start_t = System.currentTimeMillis();\n\n center = spark_kmeans( center );\n\n end_t = System.currentTimeMillis();\n print_best( iter + 1 );\n\t\t}\n }", "private static void clustering(String inputFile, String outputDir, double opticsXi, int opticsMinPoints) {\n \tLOG.info(\"Begin clustering of stay points.\");\n \t\n \tELKIClusterer.cluster(inputFile, outputDir,\topticsXi, opticsMinPoints);\n \t\n \tLOG.info(\"Finished clustering of stay points.\");\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public void randSelectCenters(int k) {\r\n\t\tif (pointList == null || pointList.isEmpty())\r\n\t\t\treturn;\r\n\r\n\t\tList<Integer> range = IntStream.range(0, pointList.size()).boxed().collect(Collectors.toList());\r\n\t\tCollections.shuffle(range);\r\n\t\tfor (int cid : range.stream().limit(k).collect(Collectors.toList()))\r\n\t\t\tcenterList.add(pointList.get(cid));\r\n\t}", "private static void kmeans(int[] rgb, int k) {\n\t\tColor[] rgbColor = new Color[rgb.length];\r\n\t\tColor[] ColorCluster = new Color[rgb.length];\r\n\t\tint[] ColorClusterID = new int[rgb.length];\r\n\t\t\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgbColor[i] = new Color(rgb[i]);\r\n\t\t\tColorClusterID[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tColor[] currentCluster = new Color[k];\t\t\r\n\t\tint randomNumber[]= ThreadLocalRandom.current().ints(0, rgb.length).distinct().limit(k).toArray();\r\n\t\tColor[] modifiedColorCluster = new Color[k];\t\r\n\t\t\r\n\t\tfor(int j=0;j<k;j++) {\r\n\t\t\tcurrentCluster[j]=rgbColor[randomNumber[j]];\r\n\t\t}\r\n\t\tint flag = 1;\r\n\t\tint maxIterations = 1000;\r\n\t\tint numIteration=0;\r\n\t\tdouble[] distance = new double[maxIterations+1];\t\t\r\n\t\tdistance[0]=Double.MAX_VALUE;\r\n\t\twhile(flag == 1) {\r\n\t\t\tflag = 0;\r\n\t\t\tnumIteration++;\r\n\t\t\tdistance[numIteration]=assignCLustersToPixels(rgbColor,currentCluster,ColorCluster,ColorClusterID,k,rgb.length);\r\n\t\t\tmodifiedColorCluster= findMeans(rgbColor,ColorClusterID,modifiedColorCluster,k,rgb.length);\r\n\t\t\tif(!clusterCenterCheck(currentCluster, modifiedColorCluster,k)){\r\n\t\t\t\tflag = 1;\r\n\t\t\t\tfor(int j=0;j<k;j++) {\r\n\t\t\t\t\tcurrentCluster[j]=modifiedColorCluster[j];}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgb[i]= getValue(ColorCluster[i].getRed(),ColorCluster[i].getGreen(),ColorCluster[i].getBlue());\r\n\t\t}\r\n\t\treturn;\r\n\t }", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "public Map<double[], Integer> kmeans(int distance, Map<Integer, double[]> centroids, int k) {\n Map<double[], Integer> clusters = new HashMap<>();\n int k1 = 0;\n double dist = 0.0;\n for (double[] x : features) {\n double minimum = 999999.0;\n for (int j = 0; j < k; j++) {\n if (distance == 1) {\n dist = Distance.eucledianDistance(centroids.get(j), x);\n } else if (distance == 2) {\n dist = Distance.manhattanDistance(centroids.get(j), x);\n }\n if (dist < minimum) {\n minimum = dist;\n k1 = j;\n }\n\n }\n clusters.put(x, k1);\n }\n\n return clusters;\n }", "@Override\n \tpublic Collection<Collection<Integer>> call() throws Exception {\n \t\tEdgeWeighter<HomologyEdge> weighter = new EdgeWeighter<HomologyEdge>() {\n \t\t\t@Override\n \t\t\tpublic double getWeight(HomologyEdge e) {\n \t\t\t\treturn e.getWeight();\n \t\t\t}\n \t\t};\n \t\tProbabilisticDistanceClusterer<Integer, HomologyEdge> alg = new ProbabilisticDistanceClusterer<Integer, HomologyEdge>(\n \t\t\t\tweighter, xi);\n \t\tSet<Set<Integer>> ccs = alg.transform(graph.getHomology());\n \n \t\t// now map each cluster to a root for that cluster\n \t\t// the choice of root is arbitrary and just for hashing\n \t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n \t\tfor (Set<Integer> cc : ccs) {\n \t\t\tint v0 = -1;\n \t\t\tint i = 0;\n \t\t\tfor (int v : cc) {\n \t\t\t\tif (i == 0) v0 = v;\n \t\t\t\tmap.put(v, v0);\n \t\t\t\ti++;\n \t\t\t}\n \t\t}\n \n \t\t// find the cliques\n \t\tBronKerboschCliqueFinder<Integer, HomologyEdge> finder = new BronKerboschCliqueFinder<>();\n \t\tCollection<Set<Integer>> cliques = finder.transform(graph.getHomology());\n \n \t\t// group the cliques by sets of interactions\n \t\tNavigableMap<String, Collection<Integer>> cliqueGroups = new TreeMap<>();\n \t\tfor (Set<Integer> clique : cliques) {\n \t\t\tfor (int v : clique) {\n \t\t\t\tCollection<Integer> neighbors = graph.getInteractionNeighbors(v);\n \t\t\t\tString hash = hashVertexInteractions(neighbors, map);\n \t\t\t\tCollection<Integer> group = cliqueGroups.get(hash);\n \t\t\t\tif (group == null) group = new TreeSet<>();\n \t\t\t\tgroup.add(v);\n \t\t\t}\n \t\t}\n \n \t\t// now we just want a set to return\n \t\tSet<Collection<Integer>> set = new TreeSet<>();\n \t\tset.addAll(cliqueGroups.values());\n \n \t\treturn set;\n \t}", "protected static <T> Set<List<T>> cluster(ISearchIndex<T> index, double epsilon, int minimum) {\n Set<List<T>> clusters = new HashSet<List<T>>();\n Set<T> visited = new HashSet<T>();\n Set<T> noise = new HashSet<T>();\n\n for (T element : index) {\n if (visited.contains(element)) {\n continue;\n }\n visited.add(element);\n\n List<T> neighbors = index.radius(element, epsilon);\n\n if (neighbors.size() < minimum) {\n noise.add(element);\n } else {\n List<T> cluster = new LinkedList<T>();\n\n LinkedList<T> seeds = new LinkedList<T>();\n for (T neighbor : neighbors) {\n seeds.push(neighbor);\n visited.add(neighbor);\n cluster.add(neighbor);\n noise.remove(neighbor);\n }\n\n while (!seeds.isEmpty()) {\n T seed = seeds.pollLast();\n List<T> exteriors = index.radius(seed, epsilon);\n\n if (exteriors.size() >= minimum) {\n Set<T> subvisited = new HashSet<T>();\n for (T exterior : exteriors) {\n if (!visited.contains(exterior)) {\n seeds.push(exterior);\n subvisited.add(exterior);\n cluster.add(exterior);\n }\n if (noise.contains(exterior)) {\n noise.remove(exterior);\n cluster.add(exterior);\n }\n }\n visited.addAll(subvisited);\n }\n }\n\n clusters.add(cluster);\n }\n }\n\n return clusters;\n }", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public static void main(String[] args) {\n Random r = new Random();\n// r.setSeed(1982);\n int R = 500;\n int L = 100000;\n\n int start = -500;\n int end = 500;\n HashSet<Point> hi3 = new HashSet<>();\n List<Point> hi5 = new ArrayList<>();\n Stopwatch sw = new Stopwatch();\n for (int i = 0; i < L; i += 1) {\n double ran = r.nextDouble();\n double x = start + (ran * (end - start));\n ran = r.nextDouble();\n double y = start + (ran * (end - start));\n Point temp = new Point(x, y);\n hi5.add(temp);\n\n }\n KDTree speedTest = new KDTree(hi5);\n NaivePointSet speedTest2 = new NaivePointSet(hi5);\n\n// for (int i = 0; i < 1000; i++) {\n// double ran = r.nextDouble();\n// double x2 = start + (ran *(end - start));\n// ran = r.nextDouble();\n// double y2 = start + (ran *(end - start));\n// assertEquals(speedTest2.nearest(x2, y2), speedTest.nearest(x2, y2 ));\n// }\n// assertEquals(speedTest2.nearest(r.nextInt(R + 1 - 500) + 500,\n// r.nextInt(R + 1 - 500) + 100), speedTest.nearest(427.535670, -735.656403));\n\n System.out.println(\"elapsed time1: \" + sw.elapsedTime());\n\n int R2 = 100;\n int L2 = 10000;\n Stopwatch sw2 = new Stopwatch();\n for (int i = 0; i < L2; i += 1) {\n\n speedTest2.nearest(r.nextDouble(), r.nextDouble());\n }\n\n System.out.println(\"elapsed time: \" + sw2.elapsedTime());\n }", "public static int optimalK(Dataset<Row> vectorData) {\n\n\t\tHashMap<Double, Integer> scoreKMap = new HashMap<Double, Integer>();\n\t\tdouble maxSilhouetteScore = -1;\n\t\tint optimalK = 0;\n\n\t\tfor (int i = 2; i < 10; i++) {\n\n\t\t\tKMeans kMeans = new KMeans().setK(i).setSeed(1L).setPredictionCol(\"prediction\");\n\t\t\tKMeansModel kMeansModel = kMeans.fit(vectorData);\n\t\t\tDataset<Row> kMeansPredictions = kMeansModel.transform(vectorData);\n\t\t\tint maxAssignedClusterNumber = kMeansPredictions.agg(min(\"prediction\"), max(\"prediction\")).head().getInt(1);\n\t\t\tint minAssignedClusterNumber = kMeansPredictions.agg(min(\"prediction\"), max(\"prediction\")).head().getInt(0);\n\t\t\tif (maxAssignedClusterNumber == minAssignedClusterNumber) {\n\t\t\t\toptimalK = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tClusteringEvaluator topsEvaluator = new ClusteringEvaluator();\n\t\t\tdouble silhouetteScore = topsEvaluator.evaluate(kMeansPredictions);\n\t\t\tscoreKMap.put(silhouetteScore, i);\n\t\t\tif (silhouetteScore > maxSilhouetteScore) {\n\t\t\t\tmaxSilhouetteScore = silhouetteScore;\n\t\t\t\toptimalK = i;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Silhouette score when K = \" + i + \" is \" + silhouetteScore);\n\t\t}\n\n\t\tSystem.out.println(\"Optimal K turned out to be \" + optimalK);\n\t\treturn optimalK;\n\n\t}", "public static Tour NNHeuristic (double distancematrix [][], Cluster cluster) {\n Stack<Integer> stack= new Stack<Integer>();\n Tour tour = new Tour(0);\n double length =0;\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n Point out = cluster.getOutPoint ();\n Point in = cluster.getInPoint();\n\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n\n tour.addPoint(out);\n tour.addPoint(in);\n\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n\n int element, dst = 0, i, pos = 0;\n stack.push(in.getPointNumber());\n element = stack.peek() - 1;\n boolean minFlag = false;\n while (!stack.isEmpty()) {\n double min = Integer.MAX_VALUE;\n for (i = 0; i < numbernodes; i++) {\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (distancematrix[element][cityIndex] > 0 && visited[i] == 0) {\n if (min > distancematrix[element][cityIndex]) {\n min = distancematrix[element][cityIndex];\n dst = cityIndex + 1;\n pos = i;\n minFlag = true;\n }\n }\n }\n if (minFlag) {\n length = length + min;\n visited[pos] = 1;\n stack.push(dst);\n element = stack.peek() - 1;\n tour.addPoint(cluster.getPoints().get(pos));\n minFlag = false;\n continue;\n }\n stack.pop();\n }\n tour.removePoint(out);\n tour.removePoint(in);\n tour.addPoint(out);\n tour.addPoint(in);\n }\n return tour;\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "public void pruneWithApriori(double startEpsilon, double epsilonMultiplier, double shrinkFactor, double maxApproximationSize, int numBuckets, int topK, long startMS){\n CB = new CorrelationBounding(HB.data, useEmpiricalBounds, parallel);\r\n HierarchicalBounding.CB = CB; // pass the corrbounding object to the hierarchbounding object to prevent double work\r\n\r\n // get clusters:\r\n long startClustering = System.currentTimeMillis();\r\n System.out.print(\"constructing hierarchical clustering...\");\r\n RecursiveClustering RC = new RecursiveClustering(HB.data, CB, HB.maxLevels, HB.defaultDesiredClusters, HB.useKMeans, HB.breakFirstKLevelsToMoreClusters, HB.clusteringRetries);\r\n RC.fitRecursiveClusters(startEpsilon, epsilonMultiplier);\r\n long stopClustering = System.currentTimeMillis();\r\n System.out.println(\" --> clustering finished, took \" + ((stopClustering-startClustering)/1000) + \" seconds\");\r\n this.allclusters = RC.allClusters;\r\n this.clustersPerLevel = RC.clustersPerLevel;\r\n this.globalClustID = RC.globalClustID;\r\n\r\n CB.initializeBoundsCache(globalClustID, useEmpiricalBounds);\r\n\r\n ArrayList<Cluster> topLevelClusters = this.clustersPerLevel.get(0);\r\n Cluster rootCluster = topLevelClusters.get(0);\r\n this.rootCluster = rootCluster;\r\n\r\n\r\n\r\n // progressive approximation class in order to get results quickly:\r\n ProgressiveApproximation PA = new ProgressiveApproximation(corrThreshold, useEmpiricalBounds, minJump, maxApproximationSize, header, CB);\r\n\r\n\r\n\r\n //multipoles root candidate:\r\n ArrayList<Cluster> firstClusterComb = new ArrayList<>(2);\r\n firstClusterComb.add(rootCluster);// firstClusterComb.add(rootCluster);\r\n// List<ClusterCombination> candidates = new ArrayList<>(1);\r\n// ClusterCombination rootcandidate = new MultipoleClusterCombination(firstClusterComb);\r\n// candidates.add(rootcandidate);\r\n\r\n\r\n\r\n //multipearson root candidate:\r\n// ArrayList<Cluster> rootLHS = new ArrayList<>(1); rootLHS.add(rootCluster);\r\n// ArrayList<Cluster> rootRHS = new ArrayList<>(1); rootRHS.add(rootCluster); //rootRHS.add(rootCluster); rootRHS.add(rootCluster);\r\n// ClusterCombination rootcandidate = new MultiPearsonClusterCombination(rootLHS, rootRHS);\r\n\r\n\r\n\r\n\r\n //progress overview:\r\n System.out.print(\"|\");\r\n for(int i = 0; i<100; i++){\r\n System.out.print(\".\");\r\n }\r\n System.out.print(\"|\");\r\n System.out.println();\r\n\r\n\r\n // level-wise evaluation of the candidates\r\n for(int p=2; p<=maxP; p++){\r\n firstClusterComb.add(rootCluster);\r\n ClusterCombination rootcandidate = new MultipoleClusterCombination(firstClusterComb);\r\n\r\n List<ClusterCombination> candidates = new ArrayList<>(1);\r\n candidates.add(rootcandidate);\r\n\r\n System.out.println(\"---------------start evaluating level: \"+ p + \" at time \" + LocalTime.now() +\". Number of positives so far: \" + this.positiveResultSet.size() +\". Runtime so far: \" + (System.currentTimeMillis() - startMS)/1000);\r\n\r\n Map<Boolean, List<ClusterCombination>> groupedDCCs = evaluateCandidates(candidates, shrinkFactor, maxApproximationSize, parallel);\r\n\r\n if(positiveDCCs.size() > topK){\r\n positiveDCCs = getStream(positiveDCCs, parallel)\r\n .sorted((cc1, cc2) -> Double.compare(cc2.getLB(), cc1.getLB()))\r\n .limit(topK)\r\n .collect(Collectors.toList());\r\n PA.corrThreshold = positiveDCCs.get(positiveDCCs.size()-1).getLB();\r\n corrThreshold = PA.corrThreshold;\r\n }\r\n\r\n\r\n //progressive approximation within this level p:\r\n List<ClusterCombination> approximatedCCs = getStream(groupedDCCs.get(false), parallel).filter(dcc -> dcc.getCriticalShrinkFactor() <= 1).collect(Collectors.toList());\r\n// PA.testApproximationQuality(approximatedCCs, numBuckets, p, parallel);\r\n this.positiveDCCs = PA.ApproximateProgressively(approximatedCCs, numBuckets, positiveDCCs, parallel, topK, startMS);\r\n corrThreshold = PA.corrThreshold; // for topK -> carry over the updated tau to next p\r\n this.positiveResultSet = PostProcessResults.removeDuplicatesAndToString(this.positiveDCCs, header, CB, parallel);\r\n\r\n // get the approximated candidates to generate the next-level candidates from. the advantage is that we get a head-start down the clustering tree and do not have to start from the top\r\n ArrayList<ClusterCombination> DCCs = new ArrayList<>(groupedDCCs.get(false).size() + groupedDCCs.get(true).size());\r\n DCCs.addAll(groupedDCCs.get(false)); DCCs.addAll(groupedDCCs.get(true));\r\n System.out.println(\"tau updated to \" + corrThreshold);\r\n\r\n\r\n\r\n// if(p<maxP){\r\n// System.out.println(\"level \" + p + \" finished at time \"+ LocalTime.now() + \". generating candidates for level \" + (p+1) +\". #DCCs: \" + DCCs.size() +\". positives so far: \" + this.positiveResultSet.size() + \". Runtime so far (s): \" + (System.currentTimeMillis()-startMS)/1000);\r\n//\r\n//\r\n//\r\n// if(DCCs.get(0).isMultipoleCandidate()){ // multipole pattern\r\n//\r\n// candidates = generateCandidates(DCCs, parallel);\r\n//\r\n// }else{ // multiPearson pattern -> make distinction on adding vectors to LHS or RHS. better performance: use HIerarchicalbounding without level generation.\r\n//\r\n//\r\n// candidates = new ArrayList<>();\r\n//\r\n//\r\n//\r\n// // first generate candidates by adding to RHS\r\n// if(parallel){\r\n// DCCs = (ArrayList<ClusterCombination>) DCCs.parallelStream()\r\n// .sorted(this::lexicographicalOrdering)\r\n// .collect(Collectors.toList());\r\n// }else{\r\n// DCCs.sort(this::lexicographicalOrdering);\r\n// }\r\n// List<ClusterCombination> partial = generateCandidates(DCCs, parallel);\r\n// if(partial!= null){\r\n// candidates.addAll(partial);\r\n// }\r\n//\r\n// //now by adding to LHS: (hack by swapping the LHS and RHS and calling the same methods\r\n// //note that we do not need to swap those in which the size of the LHS and RHS is the same\r\n// ArrayList<ClusterCombination> swappedDCCs;\r\n// if(parallel){\r\n// swappedDCCs = (ArrayList<ClusterCombination>) DCCs.parallelStream()\r\n// .filter(cc -> cc.getLHS().size() != cc.getRHS().size()) // ignore those where lhs and rhs are of the same size\r\n// .collect(Collectors.toList());\r\n// swappedDCCs.parallelStream()\r\n// .forEach(cc -> ((MultiPearsonClusterCombination) cc).swapLeftRightSide());\r\n//\r\n// swappedDCCs = (ArrayList<ClusterCombination>) swappedDCCs.parallelStream()\r\n// .sorted(this::lexicographicalOrdering)\r\n// .collect(Collectors.toList());\r\n// }else{\r\n// swappedDCCs = (ArrayList<ClusterCombination>) DCCs.stream()\r\n// .filter(cc -> cc.getLHS().size() != cc.getRHS().size()) // ignore those where lhs and rhs are of the same size\r\n// .collect(Collectors.toList());\r\n//\r\n// swappedDCCs.forEach(cc -> ((MultiPearsonClusterCombination) cc).swapLeftRightSide());\r\n// swappedDCCs.sort(this::lexicographicalOrdering);\r\n// }\r\n//\r\n// partial = generateCandidates(swappedDCCs, parallel);\r\n// if(partial!= null){\r\n// candidates.addAll(partial);\r\n// }\r\n//\r\n//\r\n// }\r\n//\r\n//\r\n// }\r\n }\r\n\r\n }", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k,\n\t\t\tBiFunction<Position, Position, Double> metric);", "void unionTreeCoreset(int k,int n_1,int n_2,int d, Point[] setA,Point[] setB, Point[] centres, MTRandom clustererRandom) {\n\t\t//printf(\"Computing coreset...\\n\");\n\t\t//total number of points\n\t\tint n = n_1+n_2;\n\n\t\t//choose the first centre (each point has the same probability of being choosen)\n\t\t\n\t\t//stores, how many centres have been choosen yet\n\t\tint choosenPoints = 0; \n\t\t\n\t\t//only choose from the n-i points not already choosen\n\t\tint j = clustererRandom.nextInt(n-choosenPoints); \n\n\t\t//copy the choosen point\n\t\tif(j < n_1){\n\t\t\t//copyPointWithoutInit(&setA[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setA[j].clone();\n\t\t} else {\n\t\t\tj = j - n_1;\n\t\t\t//copyPointWithoutInit(&setB[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setB[j].clone();\n\t\t}\n\t\ttreeNode root = new treeNode(setA,setB,n_1,n_2, centres[choosenPoints],choosenPoints); //??\n\t\tchoosenPoints = 1;\n\t\t\n\t\t//choose the remaining points\n\t\twhile(choosenPoints < k){\n\t\t\tif(root.cost > 0.0){\n\t\t\t\ttreeNode leaf = selectNode(root, clustererRandom);\n\t\t\t\tPoint centre = chooseCentre(leaf, clustererRandom);\n\t\t\t\tsplit(leaf,centre,choosenPoints);\n\t\t\t\t//copyPointWithoutInit(centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = centre;\n\t\t\t} else {\n\t\t\t\t//create a dummy point\n\t\t\t\t//copyPointWithoutInit(root.centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = root.centre;\n\t\t\t\tint l;\n\t\t\t\tfor(l=0;l<root.centre.dimension;l++){\n\t\t\t\t\tcentres[choosenPoints].coordinates[l] = -1 * 1000000;\n\t\t\t\t}\n\t\t\t\tcentres[choosenPoints].id = -1;\n\t\t\t\tcentres[choosenPoints].weight = 0.0;\n\t\t\t\tcentres[choosenPoints].squareSum = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\tchoosenPoints++;\n\t\t}\n\n\t\t//free the tree\n\t\tfreeTree(root);\n\n\t\t//recalculate clustering features\n\t\tint i;\n\t\tfor(i=0;i<n;i++){\n\t\t\t\t\n\t\t\tif(i < n_1) {\n\t\t\t\t\n\t\t\t\tint index = setA[i].centreIndex;\n\t\t\t\tif(centres[index].id != setA[i].id){\n\t\t\t\t\tcentres[index].weight += setA[i].weight;\n\t\t\t\t\tcentres[index].squareSum += setA[i].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setA[i].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setA[i].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tint index = setB[i-n_1].centreIndex;\n\t\t\t\tif(centres[index].id != setB[i-n_1].id){\n\t\t\t\t\tcentres[index].weight += setB[i-n_1].weight;\n\t\t\t\t\tcentres[index].squareSum += setB[i-n_1].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setB[i-n_1].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setB[i-n_1].coordinates[l];\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 BrutePointST<Integer> st = new BrutePointST<Integer>();\n double qx = Double.parseDouble(args[0]);\n double qy = Double.parseDouble(args[1]);\n double rx1 = Double.parseDouble(args[2]);\n double rx2 = Double.parseDouble(args[3]);\n double ry1 = Double.parseDouble(args[4]);\n double ry2 = Double.parseDouble(args[5]);\n int k = Integer.parseInt(args[6]);\n Point2D query = new Point2D(qx, qy);\n RectHV rect = new RectHV(rx1, ry1, rx2, ry2);\n int i = 0;\n while (!StdIn.isEmpty()) {\n double x = StdIn.readDouble();\n double y = StdIn.readDouble();\n Point2D p = new Point2D(x, y);\n st.put(p, i++);\n }\n StdOut.println(\"st.empty()? \" + st.isEmpty());\n StdOut.println(\"st.size() = \" + st.size());\n StdOut.println(\"First \" + k + \" values:\");\n i = 0;\n for (Point2D p : st.points()) {\n StdOut.println(\" \" + st.get(p));\n if (i++ == k) {\n break;\n }\n }\n StdOut.println(\"st.contains(\" + query + \")? \" + st.contains(query));\n StdOut.println(\"st.range(\" + rect + \"):\");\n for (Point2D p : st.range(rect)) {\n StdOut.println(\" \" + p);\n }\n StdOut.println(\"st.nearest(\" + query + \") = \" + st.nearest(query));\n StdOut.println(\"st.nearest(\" + query + \", \" + k + \"):\");\n for (Point2D p : st.nearest(query, k)) {\n StdOut.println(\" \" + p);\n }\n }", "public ArrayList<ArrayList<Example>> kmeanlearn(int k, int n, boolean dist) {\n kmean = new KMean(new ArrayList<Example>(learningData.getExamples().subList(n+1, learningData.getExamples().size())), k);\n kmean.kmeanAlgorithm(dist);\n return kmean.getCluster();\n }", "public static HashMap<LonLat,ArrayList<STPoint>> clustering2dKNSG(IKernel kernel,ArrayList<STPoint> data,double h,double e) {\n\t\tHashMap<LonLat,ArrayList<STPoint>> result = new HashMap<LonLat,ArrayList<STPoint>>();\n\t\tint N = data.size();\n\t\t//\t\tSystem.out.println(\"#number of points : \"+N);\n\n\t\tfor(STPoint point:data) {\n\t\t\t// seek mean value //////////////////\n\t\t\tLonLat mean = new LonLat(point.getLon(),point.getLat());\n\n\t\t\t//loop from here for meanshift\n\t\t\twhile(true) {\n\t\t\t\tdouble numx = 0d;\n\t\t\t\tdouble numy = 0d;\n\t\t\t\tdouble din = 0d;\n\t\t\t\tfor(int j=0;j<N;j++) {\n\t\t\t\t\tLonLat p = new LonLat(data.get(j).getLon(),data.get(j).getLat());\n\t\t\t\t\tdouble k = kernel.getDensity(mean,p,h);\n\t\t\t\t\tnumx += k * p.getLon();\n\t\t\t\t\tnumy += k * p.getLat();\n\t\t\t\t\tdin += k;\n\t\t\t\t}\n\t\t\t\tLonLat m = new LonLat(numx/din,numy/din);\n\t\t\t\tif( mean.distance(m) < e ) { mean = m; break; }\n\t\t\t\tmean = m;\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(\"#mean is : \" + mean);\n\t\t\t// make cluster /////////////////////\n\t\t\tArrayList<STPoint> cluster = null;\n\t\t\tfor(LonLat p:result.keySet()) {\n\t\t\t\tif( mean.distance(p) < e ) { cluster = result.get(p); break; }\n\t\t\t}\n\t\t\tif( cluster == null ) {\n\t\t\t\tcluster = new ArrayList<STPoint>();\n\t\t\t\tresult.put(mean,cluster);\n\t\t\t}\n\t\t\tcluster.add(point);\n\t\t}\n\t\treturn result;\n\t}", "public org.apache.spark.mllib.clustering.KMeansModel train (org.apache.spark.rdd.RDD<org.apache.spark.mllib.linalg.Vector> data, int k, int maxIterations) { throw new RuntimeException(); }", "@Test\n public void test27() throws Throwable {\n SimpleKMeans simpleKMeans0 = new SimpleKMeans();\n String[] stringArray0 = simpleKMeans0.getOptions();\n Vote.main(stringArray0);\n }", "private static void automate() {\n \tLOG.info(\"Begin automation task.\");\n \t\n \tcurrentOpticsXi = clArgs.clusteringOpticsXi;\n \tdouble opticsXiMax = (clArgs.clusteringOpticsXiMaxValue > ELKIClusterer.MAX_OPTICS_XI ? ELKIClusterer.MAX_OPTICS_XI : clArgs.clusteringOpticsXiMaxValue);\n \tcurrentOpticsMinPoints = clArgs.clusteringOpticsMinPts;\n \tint opticsMinPointsMax = clArgs.clusteringOpticsMinPtsMaxValue;\n \t\n \tLOG.info(\"optics-xi-start: {}, optics-xi-min-points-start: {}, optics-xi-step-size: {}, optics-min-points-step-size: {}\",\n \t\t\tnew Object[] { \n \t\t\t\tdf.format(currentOpticsXi), df.format(currentOpticsMinPoints), \n \t\t\t\tdf.format(clArgs.clusteringOpticsXiStepSize), df.format(clArgs.clusteringOpticsMinPtsStepSize)\n \t\t\t});\n \t\n \twhile (currentOpticsXi <= opticsXiMax) {\n \t\twhile (currentOpticsMinPoints <= opticsMinPointsMax) {\n \t\t\t// Run automation for each combination of opticsXi and opticsMinPoints\n \t\t\tLOG.info(\"Run automation with optics-xi: {}, optics-xi-min-points: {}\", \n \t\t\t\t\tdf.format(currentOpticsXi), df.format(currentOpticsMinPoints));\n \t\t\t\n \t\t\ttry {\n\t \t\t\t// Step 1: Clustering\n\t \t\t\tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir, currentOpticsXi, currentOpticsMinPoints);\n\t \t\t\t\n\t \t\t\t// Step 2: Build shared framework\n\t \t\t\tbuildFramework();\n\t \t\t\t\n\t \t\t\t// Step 3: Build user hierarchical graphs\n\t \t\t\tbuildHierarchicalGraphs();\n\t \t\t\t\n\t \t\t\t// Step 4: Calculate similarity between all users and create evaluation results afterwards\n\t \t\t\tcalculateSimilarity();\n \t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"An error occurred during the automation task. Jumping to the next pass.\", e);\n\t\t\t\t} finally {\n\t \t\t\t// Step 5: Clean up for the next run\n\t \t\t\tcleanAutomationResults();\n\t \t\t\t\n\t \t\t\t// Increase the currentOpticsMinPoints for the next run if desired\n\t \t\t\tif (clArgs.clusteringOpticsMinPtsStepSize > 0)\n\t \t\t\t\tcurrentOpticsMinPoints += clArgs.clusteringOpticsMinPtsStepSize;\n\t \t\t\telse\n\t \t\t\t\tbreak;\n\t\t\t\t}\n \t\t}\n \t\t// Reset current values\n \t\tcurrentOpticsMinPoints = clArgs.clusteringOpticsMinPts;\n \t\t\n \t\t// Increase currentOpticsXi for the next run if desired\n \t\tif (clArgs.clusteringOpticsXiStepSize > 0)\n\t\t\t\tcurrentOpticsXi += clArgs.clusteringOpticsXiStepSize;\n\t\t\telse\n\t\t\t\tbreak;\n \t}\n \t\n \tLOG.info(\"End automation task.\");\n }", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "public scala.Tuple2<java.lang.Object, java.lang.Object> findClosest (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "public Vector run(){\n// System.out.println(\"Minimum radius is: \" + minRadius);\n// System.out.println(\"Maximum radius is: \" + maxRadius);\n Vector clusters = new Vector();\n double fitnessSum = 0;\n for (int q = 0; q < numTests; q++){\n Gene hypothesis = initializer.createRandomGene(fitnessFunction, minRadius, maxRadius);\n //This turns it into a circle.\n if (Math.random() > 0.5){ \n hypothesis.setMajorAxisRadius(hypothesis.getMinorAxisRadius());\n } else { \n hypothesis.setMinorAxisRadius(hypothesis.getMajorAxisRadius());\n }\n// System.out.println(hypothesis);\n double fitness = hypothesis.getFitness();\n fitnessSum = fitnessSum + fitness;\n if ((hypothesis.getCount() >= minPoints) && (fitness >= minAccepted)){\n clusters.add(hypothesis);\n }\n }\n averageFitness = fitnessSum/numTests;\n return clusters;\n }", "public Set<? extends Position> findNearest(Position position, int k);", "public Set<? extends Position> findNearest(\n\t\t\tPosition position, int k, double distance);", "private static double dynamically_select_epsilon(ArrayList<Point> pointset){\n\t\tPair closestPair = closest_pair(pointset);\n\t\t\n\t\t// Calculate Chebyshev distance between nearest pair\n\t\tdouble distance = chebyshev_distance(closestPair.getFirst(), closestPair.getSecond());\n\t\t\n\t\t// Divide by 8 to fit 8e box constraint set in Gabe's paper\n\t\treturn distance / 8.0;\n\t}", "private double dynamically_select_epsilon(ArrayList<Point> pointset) {\n\t\tPair closestPair = closest_pair(pointset);\n\n\t\t// Calculate Chebyshev distance between nearest pair\n\t\tdouble distance = chebyshev_distance(closestPair);\n\n\t\t// Divide by 16 to fit 8e box constraint set in Gabe's paper\n\t\treturn distance / 16.0;\n\t}", "public double pointCost (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "Point chooseCentre(treeNode node, MTRandom clustererRandom){\n\n\t\t//How many times should we try to choose a centre ??\n\t\tint times = 3;\n\t\t\t\n\t\t//stores the nodecost if node is split with the best centre\n\t\tdouble minCost = node.cost;\n\t\tPoint bestCentre = null;\n\t\t\n\t\t//loop counter variable\n\t\tint i;\n\t\tint j;\n\t\t\n\t\tfor(j=0;j<times;j++){\n\t\t\t//sum of the relativ cost of the points\n\t\t\tdouble sum = 0.0;\n\t\t\t//random number between 0 and 1\n\t\t\tdouble random = clustererRandom.nextDouble();\n\t\t\t\n\t\t\tfor(i=0;i<node.n;i++){\n\t\t\t\n\t\t\t\tsum += treeNodeCostOfPoint(node,node.points[i]) / node.cost;\n\t\t\t\tif(sum >= random){\n\t\t\t\t\tif(node.points[i].weight == 0.0){\n\t\t\t\t\t\t//printf(\"ERROR: CHOOSEN DUMMY NODE THOUGH OTHER AVAILABLE \\n\");\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tdouble curCost = treeNodeSplitCost(node,node.centre,node.points[i]);\n\t\t\t\t\tif(curCost < minCost){\n\t\t\t\t\t\tbestCentre = node.points[i];\n\t\t\t\t\t\tminCost = curCost;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(bestCentre == null){\n\t\t\treturn node.points[0];\n\t\t} else {\n\t\t\treturn bestCentre;\n\t\t}\n\t}", "public SolutionSet execute() throws JMetalException, ClassNotFoundException, IOException {\n initialization();\n createInitialSwarm() ;\n evaluateSwarm();\n initializeLeaders() ;\n initializeParticlesMemory() ;\n updateLeadersDensityEstimator() ;\n\n while (!stoppingCondition()) {\n computeSpeed(iterations_, maxIterations_);\n computeNewPositions();\n perturbation();\n evaluateSwarm();\n updateLeaders() ;\n updateParticleMemory() ;\n updateLeadersDensityEstimator() ;\n iterations_++ ;\n }\n\n tearDown() ;\n return paretoFrontApproximation() ;\n }", "@Override\n protected int selectNextClusterIndex(\n final double[] minDistances,\n final boolean[] selected)\n {\n double maxMinDistance = Double.MAX_VALUE;\n int maxIndex = 0;\n\n final int elementCount = minDistances.length;\n for (int i = 0; i < elementCount; i++)\n {\n if (selected[i])\n {\n // Skip clusters we've already selected.\n continue;\n }\n\n // Get the current minimum distance for the element.\n double minDistance = minDistances[i];\n\n if (maxIndex == 0 || minDistance > maxMinDistance)\n {\n // This is the minium seen so far, so keep track of\n // it.\n maxIndex = i;\n maxMinDistance = minDistance;\n }\n }\n\n if (maxMinDistance <= 0.0)\n {\n // There are not enough points to prevent selecting two\n // that are on top of each other.\n return -1;\n }\n else\n {\n return maxIndex;\n }\n }", "public org.apache.spark.mllib.clustering.KMeansModel train (org.apache.spark.rdd.RDD<org.apache.spark.mllib.linalg.Vector> data, int k, int maxIterations, int runs, java.lang.String initializationMode) { throw new RuntimeException(); }", "private void cluster() {\n\t\tint index = 0;\n\t\tfor (DataObject obj : objects) {\n\t\t\tindex = getNearestCenterIndex(obj, centers);\n\t\t\tclusters.get(index).add(obj);\n\t\t}\n\t}", "public Iterable<Point2D> nearest(Point2D p, int k) {\n if (k == 0) {\n throw new NullPointerException();\n }\n \n if (p == null) {\n throw new NullPointerException();\n }\n MinPQ<Point2D> pq = new<Point2D> MinPQ(p.distanceToOrder());\n \n for (Point2D s: bst.keys()) {\n if (!s.equals(p)) {\n //Point2D near = nearest(p);\n pq.insert(s);\n }\n \n }\n \n Queue kpq = new Queue(); \n \n for (int j = 0; j < k; j++) {\n kpq.enqueue(pq.delMin());\n }\n return kpq;\n }", "private List<BlockPoint> chooseFurthestPoints(List<BlockPoint> originalPoints){\n if(plattformsPerChunk <= 0 || plattformsPerChunk > originalPoints.size()){\n throw new IllegalArgumentException(\"plattformsPerChunk can not be negative or larger than originalPoints\");\n\t}\n\tList<BlockPoint> startingPoints = new ArrayList<>(originalPoints);\n List<BlockPoint> chosenPoints = new ArrayList<>();\n\tint randomIndex = random.nextInt(startingPoints.size()-1);\n\t// Add the random starting position\n chosenPoints.add(startingPoints.get(randomIndex));\n // Remove it from the list since we can't add the same point many times\n\tstartingPoints.remove(randomIndex);\n\n\t// Choose \"plattformsPerChunk - 1\" amount of plattforms other than the starting point\n\tfor(int i = 0; i < plattformsPerChunk-1; i++){\n\t\tif(startingPoints.isEmpty()){\n\t\t break;\n\t\t}\n\n\t // Set every consideredPositions weight to its lowest distance\n\t // to any considered node\n\t for(BlockPoint consideredPos : startingPoints){\n\t\tdouble globalMinDist = INFINITY;\n\t\tfor(BlockPoint chosenPos : chosenPoints){\n\t\t double currentMinDist = consideredPos.distanceTo(chosenPos);\n\t\t if(currentMinDist < globalMinDist){\n\t\t\tglobalMinDist = currentMinDist;\n\t\t }\n\t\t}\n\t\tconsideredPos.weight = globalMinDist;\n\t }\n\n\t // Choose the position with the highest weight and add/remove it.\n\t // This means choose the point with largest min distance\n\t double highestMinDist = -1;\n\t BlockPoint chosenPoint = null;\n\t for(BlockPoint consideredPos : startingPoints){\n\t\tif(highestMinDist < consideredPos.weight){\n\t\t highestMinDist = consideredPos.weight;\n\t\t chosenPoint = consideredPos;\n\t\t}\n\t }\n\t assert chosenPoint != null;\n\t chosenPoints.add(chosenPoint.copy());\n\t startingPoints.remove(chosenPoint);\n\t}\n\treturn chosenPoints;\n }", "public void doInitialClustering(AddressIF me, Matrix_4_HSH tmp) {\n\t\t\n\t}", "@Test\n public void basicTest() {\n Point myPoint;\n\n// myPoint = pointSet.nearest(2, 2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n//\n// myPoint = kdPointSet.nearest(2, 2); //THIS ONE DOES NOT MATCH NAIVE!\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n\n\n\n\n\n\n }", "public double[][] generateRandomClusterCentroids(double[][] data, int k) {\n\t\tif (data == null) return null;\n\t\tint n = data.length;\n\t\tif (n == 0) return null;\n\t\tint m = data[0].length;\n\t\t\n\t\t// get number of points\n\t\tdouble[][] centroids = new double[k][m];\n\t\tint[] points = utils.getRandomPermutation(n, k);\n\t\tfor (int i = 0; i<k; i++) {\n\t\t\tcentroids[i] = data[points[i]];\n\t\t}\n\t\t\n\t\treturn centroids;\n\t}", "public List<K> findNearestK(LatitudeLongitude current, int k) {\n\n // Find the euclidean distance between this point and others\n List<Tuple2<Double, K>> closest = new ArrayList<>(locations.size());\n for (K l : locations) {\n LatitudeLongitude latlon = l.getLocation();\n if (latlon != null) {\n Double result = euclidean(latlon, current);\n closest.add(new Tuple2<>(result, l));\n }\n }\n\n // Sort the list\n closest.sort((element1, element2) -> {\n return element1._1().compareTo(element2._1());\n });\n\n closest.removeIf(i -> (i._1().equals(0.0)));\n\n // Return the first k records\n if (k > closest.size()) {\n k = closest.size();\n }\n if (k < 0) {\n k = 0;\n }\n List<K> toReturn = new ArrayList<>(k);\n for (int i = 0; i < k; i++) {\n toReturn.add(closest.get(i)._2());\n }\n\n return toReturn;\n }", "public void KNN() {\n\n\t\t\n\t\t// for each point in test data\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble xy = 0;\n\t\tdouble sum = 0;\n\t\tdouble m = this.Extracted_TestDataset.length;\n\t\tArrayList<ArrayList<Double>> EucledianDistanceUnsorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\tArrayList<ArrayList<Double>> EucledianDistanceSorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\t//EucledianDistance\n\t\t\n\t\t// Initialize EucledianDistance List\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceUnsorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceSorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\t// Testing sorting \n\t\t/*\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tfor(int k=0; k < this.Extracted_TestDataset[i].length; k++) {\n\t\t\t\tdouble min = 0.0; // Set To Your Desired Min Value\n\t\t double max = 10.0; // Set To Your Desired Max Value\n\t\t double ran = (Math.random() * ((max - min) + 1)) + min; // This Will Create \n\t\t \n\t\t double xrounded = Math.round(ran * 100.0) / 100.0; \n\t\t System.out.print(xrounded); \n\t\t //System.out.print(\" , \"); \n\t\t EucledianDistanceUnsorted.get(i).add(xrounded);\n\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\"); \n\t\t\t\n\t\t}\n\t\t*/\n\n\t\t\n\t\t\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int p = 1; p < (this.Extracted_TestDataset.length-1) ; p++) {\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int i = 1; i < this.Extracted_TrainingDataset.length; i++) {\n\t\t\tsum = 0;\n\t\t\tint k = 0;\n\t\t\t//System.out.println(\"first loop\");\n\t\t\tfor ( ; k < (this.Extracted_TestDataset[0].length-1) ; k++) {\t\t\t\n\t\t\t\t//System.out.println(\"second loop\");\n\t\t\t\t\n\t\t\t\tx = (Double.parseDouble(this.Extracted_TestDataset[p][k]));\n\t\t\t\t\t//System.out.print(\" x value : \");\n\t\t\t\t\t//System.out.print(x);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\ty = (Double.parseDouble(this.Extracted_TrainingDataset[i][k]));\n\t\t\t//\tSystem.out.print(\" y value : \");\n\t\t\t//\tSystem.out.println(y);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\txy = x - y;\n\t\t\t\n\t\t\t\txy = (Math.pow(xy, 2));\n\t\t\t\tsum += xy;\n\t\t\t\t\t\t\n\t\t\t\t//System.out.print(\" sum : \");\n\t\t\t\t//System.out.println(sum);\n\t\t\t\t}\n\n\t\t\tEucledianDistanceUnsorted.get(p).add((Math.sqrt(sum/k)));\n\t\t\t\t//System.out.printf(\" distance value of row %i in col %i : %s %n\", i, k ,EucledianDistanceUnsorted.get(i).get(k));\t\t\n\t\t\t}\n\t\t\n\t\t\t//start at index 1 discard the attribute name row\n\t\t\t/*for ( int i = 0; i < (this.Extracted_TrainingDataset.length-1) ; i++) {\t\t\n\t\t\t\tSystem.out.print(\" distance value of row \");\n\t\t\t\tSystem.out.print(p);\n\t\t\t\tSystem.out.print(\" in col \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" = \");\n\t\t\t\tSystem.out.print(EucledianDistanceUnsorted.get(p).get(i));\n\t\t\t\tSystem.out.println(\"\");\t\n\t\t\t}*/\n\t\t\t\n\t\t System.out.print(\"Count : \");\n\t\t System.out.println(p);\n\t\t}\n\t\n\t\tSystem.out.println(\"About to sort distance\");\n\t\t\n\t\tfor( int i = 1; i < (EucledianDistanceUnsorted.size()-1); i++){\n\t\t\tArrayList<Double> temp = EucledianDistanceUnsorted.get(i);\n\t\t\tCollections.sort(temp);\n\t\t\tfor(int k=0; k < (this.Extracted_TrainingDataset.length- 1); k++) {\n\t\t\t\tEucledianDistanceSorted.get(i).add(temp.get(k));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\" Sorted eucledian distance of first k values \");\n\t\tfor(int i=1; i < EucledianDistanceSorted.size()-1; i++) {\n\t\t\tfor(int k=0; k < (this.ValueofK); k++) {\n\t\t\t\tSystem.out.print(EucledianDistanceSorted.get(i).get(k));\n\t\t\t\tSystem.out.print(\" , \");\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\" finding class of first k points \");\n\t\t// find majority distance and find index of distance in unsorted distance \n\t\tdouble majority = 0.0;\n\t\tint IndexofDistance = 0;\n\t\tfor(int i=1; i < (EucledianDistanceSorted.size()-1); i++) {\n\t\t\t\n\t\t\t\tmajority = findMajority(EucledianDistanceSorted.get(i), this.ValueofK);\n\t\t\t\tSystem.out.print(\" index : \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" majority : \");\n\t\t\t\tSystem.out.println(majority);\n\t\t\t\tIndexofDistance = findIndexofMajority(majority,EucledianDistanceUnsorted.get(i));\n\n\t\t\t\t//System.out.print(\" test row original class :\");\n\t\t\t\t//System.out.println(this.Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\tconfusionmatrix.addTrueValue(Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\t//System.out.print(\" predectived training row classifier : \");\n\t\t\t\t//System.out.println(this.Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\t\n\t\t\t\tconfusionmatrix.addPrediction(Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Total number of predictions: \" + confusionmatrix.TotalNumberOfPredictions());\n\t\t\tSystem.out.println(\"Number of correct predictions: \"+confusionmatrix.Correct());\n\t\t\tSystem.out.println(\"Number of incorrect predictions: \"+confusionmatrix.Incorrect());\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"True positive (TP): correct positive prediction: \" + confusionmatrix.TruePositive());\n\t\t\tSystem.out.println(\"False positive (FP): incorrect positive prediction: \" + confusionmatrix.FalsePositive());\n\t\t\tSystem.out.println(\"True negative (TN): correct negative prediction: \" + confusionmatrix.TrueNegative());\n\t\t\tSystem.out.println(\"False negative (FN): incorrect negative prediction: \" +confusionmatrix.FalseNegative()); \n\t\t\tSystem.out.println(\"Error Rate: \"+confusionmatrix.ErrorRate());\n\t\t\tSystem.out.println(\"Accuracy Rate: \"+confusionmatrix.AccuracyRate());\n\t}", "public static void main(String[] args){\n\t\tString dataset = null; boolean headless = false; boolean colour = false;boolean emd = false; int k = 0;\r\n\t\tint width = 0, height = 0;\r\n\t\t// load the properties, a bit messy because it's the 7th and I should not be writing code this late into the project\r\n\t\ttry {\r\n\t\t\t// file reader variables\r\n\t\t\tFile file = new File(\"data/KMEANS.properties\");\r\n\t\t\tFileReader fileReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t\t\t\r\n\t\t\tString line;\t\r\n\t\t\tint lineCounter = 0;\r\n\t\t\t\r\n\t\t\t// the loop for reading in the lines\r\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\tif(lineCounter == 0){\r\n\t\t\t\t\tdataset = line;\r\n\t\t\t\t}else if(lineCounter == 1){\r\n\t\t\t\t\theadless = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 2){\r\n\t\t\t\t\tcolour = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 3){\r\n\t\t\t\t\temd = Boolean.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 4){\r\n\t\t\t\t\tk = Integer.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 5){\r\n\t\t\t\t\t// width\r\n\t\t\t\t\twidth = Integer.valueOf(line);\r\n\t\t\t\t}else if(lineCounter == 6){\r\n\t\t\t\t\t// height\r\n\t\t\t\t\theight = Integer.valueOf(line);\r\n\t\t\t\t}\r\n\t\t\t\tlineCounter++;\r\n\t\t\t}\r\n\t\t\tfileReader.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tif(!headless){\r\n\t\t\ttry {\r\n\t\t\t\t// load k-means before starting\r\n\t\t\t\tkmeans = new KMeans(dataset,false,colour,emd,k,width,height);\r\n\t\t\t\tif(!kmeans.MNIST){\r\n\t\t\t\t\tKMeans.INPUT_WIDTH = width;\r\n\t\t\t\t\tKMeans.INPUT_HEIGHT = height;\r\n\t\t\t\t\tKMeans.TOTAL_WEIGHTS = (KMeans.INPUT_WIDTH*KMeans.INPUT_HEIGHT)*KMeans.TOTAL_COLOURS;\r\n\t\t\t\t}\r\n\t\t\t\tAppGameContainer app;\r\n\t\t\t\tapp = new AppGameContainer(new Visualiser(\"Crowd-sourced drawing clustering with neural computing.\"));\r\n\t\t\t\tapp.setDisplayMode(1024, 720, false);\r\n\t\t\t\tapp.setShowFPS(false);\r\n\t\t\t\tapp.setAlwaysRender(true);\r\n\t\t\t\tapp.start();\r\n\t\t\t}catch (SlickException ex){\r\n\t\t\t\tLogger.getLogger(Visualiser.class.getName()).log(Level.SEVERE, null, ex);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t// start k-means in headless mode\r\n\t\t\tkmeans = new KMeans(dataset,true,colour,emd,k,width,height);\r\n\t\t\tif(!kmeans.MNIST){\r\n\t\t\t\tKMeans.INPUT_WIDTH = width;\r\n\t\t\t\tKMeans.INPUT_HEIGHT = height;\r\n\t\t\t\tKMeans.TOTAL_WEIGHTS = (KMeans.INPUT_WIDTH*KMeans.INPUT_HEIGHT)*KMeans.TOTAL_COLOURS;\r\n\t\t\t}\r\n\t\t\twhile(true){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tkmeans.update();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void baseAlgorithm() {\n\t\tlong start = System.nanoTime();\n\t\tinitCentroids();\n\t\tint counter = 0;\n\t\twhile (counter < 1000\n\t\t\t\t&& (lastCentroids == null || !SeriesComparator.equalClustering(lastCentroids, centroids))) {\n\t\t\tresetClusters();\n\t\t\tassignPoints();\n\t\t\tlastCentroids = new ArrayList<Point2D>(centroids);\n\t\t\tcalculateNewMean();\n\t\t\tbasicIterations++;\n\t\t\tcounter++;\n\t\t}\n\t\tconvertToClustering();\n\t\tbasicRuntime = System.nanoTime() - start;\n\t}", "public Clustering cluster(int kNumber, Clustering inputClustering, List<Point2D> centroids) {\n\t\tthis.inputClustering = inputClustering;\n\t\tthis.kNumber = kNumber;\n\t\tthis.centroids = centroids;\n\t\tbasicIterations = 0;\n\t\tbaseAlgorithm();\n\t\ttotalIterations = basicIterations;\n\t\treturn clustering;\n\t}", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\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 }", "private ArrayList<ArrayList<Vector2i>> identifyClustersByGreedy(LinkedList<ArrayList<PositionAndColor>> cluster, int numOfColors, int ignoreSize) {\n\t\tArrayList<ArrayList<Vector2i>> bestMapping = new ArrayList<ArrayList<Vector2i>>();\n\t\tint activeClu = 0;\n\t\tfor (ArrayList<PositionAndColor> c : cluster) {\n\t\t\tboolean[] added = new boolean[cluster.size() + 1];\n\t\t\tArrayList<Vector2i> tempMapped = new ArrayList<Vector2i>();\n\t\t\tfor (int idx = 0; idx < numOfColors; idx++) {\n\t\t\t\tint posBest = -1;\n\t\t\t\tint diffBest = Integer.MAX_VALUE;\n\t\t\t\tint sizeBest = 0;\n\t\t\t\tint position = 0;\n\t\t\t\tfor (int innerIdx = 0; innerIdx < cluster.size(); innerIdx++) {\n\t\t\t\t\tif (innerIdx != activeClu && cluster.get(innerIdx).size() > ignoreSize)\n\t\t\t\t\t\tif (Math.abs(cluster.get(innerIdx).size() - c.size()) < diffBest && added[position] == false) {\n\t\t\t\t\t\t\tposBest = position;\n\t\t\t\t\t\t\tdiffBest = Math.abs(cluster.get(innerIdx).size() - c.size());\n\t\t\t\t\t\t\tsizeBest = cluster.get(innerIdx).size();\n\t\t\t\t\t\t}\n\t\t\t\t\tposition++;\n\t\t\t\t}\n\t\t\t\tif (posBest != -1) {\n\t\t\t\t\ttempMapped.add(new Vector2i(posBest, sizeBest));\n\t\t\t\t\tadded[posBest] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbestMapping.add(tempMapped);\n\t\t\tactiveClu++;\n\t\t}\n\t\treturn bestMapping;\n\t}", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\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\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\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\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "private void calculateDistances(int pDistancia,int pMetrica,int k)\n\t{\n\t\tDistance dist = null;\n\t\t\n\t\tfor (int i = 0; i < clusterList.size(); i++)\n\t\t{\n\t\t\tfor (int j = i+1; j < clusterList.size(); j++)\n\t\t\t{\n\t\t\t\tdist = new Distance(clusterList.get(i), clusterList.get(j));\n\t\t\t\tdist.calculateDistance(pDistancia, pMetrica, k);\n\t\t\t\tdistanceList.addLast(dist);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(distanceList);\n\t}", "public void connectClusters() {\n\t\tif (clusters.size() == 2) { // once have only two clusters\n\t\t\tSystem.out.println(\"DONE!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tcluster close1 = clusters.get(0),\n\t\t\t\tclose2 = clusters.get(1);\n\t\tdouble closestCluster = computeDistance(close1, close2);\n\t\t\n\t\tfor (int i=0; i<clusters.size(); i++) {\n\t\t\tcluster c1 = clusters.get(i);\n\t\t\t\n\t\t\tfor (int j=0; j<clusters.size(); j++) { // go through all the clusters and find closest\n\t\t\t\tif (i!=j) {\n\t\t\t\t\tcluster c2 = clusters.get(j);\n\t\t\t\t\tdouble dist = computeDistance(c1,c2);\n\t\t\t\t\tif (dist < closestCluster) {\n\t\t\t\t\t\tclose1 = c1;\n\t\t\t\t\t\tclose2 = c2;\n\t\t\t\t\t\tclosestCluster = dist;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmakeCluster(close1, close2);\n\t\t\n\t}", "public double[] dist2All(int s, int k){\n\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n\n double[] resultPath = new double[intersection];\n for (int i = 0; i <intersection ; i++) {\n resultPath[i] = INFINITY;\n }\n resultPath[s] = 0;\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,resultPath[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(resultPath[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey = resultPath[extractedVertex] + edge.weight ;\n double currentKey = resultPath[destination];\n if(currentKey>newKey){\n minHeap.updateKey(newKey, destination,resultPath[destination]);\n resultPath[destination] = newKey;\n }\n }\n }\n }\n for(int i =0; i<resultPath.length;i++){\n if(SPT[i]==false)\n resultPath[i]=-1;\n }\n return resultPath;\n }", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "LinkedListSortedNeighborSet obtainKNeighbors(int paraObjectIndex) {\n LinkedListSortedNeighborSet tempNeighborSet = new LinkedListSortedNeighborSet();\n tempNeighborSet.setNeighborThreshold(k);\n\n for (int i = 0; i < formalContext.trainingFormalContext.length; i++) {\n//\t\t\tSystem.out.println(\"u: \" + paraObjectIndex);\n if (i != paraObjectIndex) {\n//\t\t\t\tSystem.out.println(\"v: \" + i);\n Measures tempSimilarityMetric = new Measures(formalContext.trainingFormalContext[paraObjectIndex],\n formalContext.trainingFormalContext[i]);\n double tempSimilarity = tempSimilarityMetric.jaccardSimilarity();\n//\t\t\t\tSystem.out.println(\"Similarity: \" + tempSimilarity);\n tempNeighborSet.topKSortedInsert(i, tempSimilarity);\n//\t\t\t\tSystem.out.println(\"\" + tempNeighborSet.toString());\n } // End if\n } // End for\n return tempNeighborSet;\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "public org.apache.spark.mllib.clustering.KMeansModel train (org.apache.spark.rdd.RDD<org.apache.spark.mllib.linalg.Vector> data, int k, int maxIterations, int runs) { throw new RuntimeException(); }", "public static int[] run(double[][] data, int numCluster) {\n int N = data.length;\n int M = data[0].length;\n\n // clustering result\n int[] cluster = new int[N];\n\n // randomize cluster center\n double[][] centers = new double[numCluster][M];\n for (int c = 0; c < numCluster; c++) {\n int idx = randomIntRange(0, N - 1);\n centers[c] = Arrays.copyOf(data[idx], M);\n }\n\n // assign every user to a cohort, use Euclidean distance\n assignCluster(cluster, centers, data);\n\n // iteration\n // (1) re-locate cohort center to average location of users in the cohort\n // (2) re-assign every user to the closest cohort center\n // (3) repeat\n // stop criterion: no change in cluster assignment, or reach max iteration\n int iterMax = 100;\n for (int iter = 0; iter < iterMax; iter++) {\n int[] oldCluster = Arrays.copyOf(cluster, N);\n locateCenters(cluster, centers, data);\n assignCluster(cluster, centers, data);\n\n // stop\n if (Arrays.equals(oldCluster, cluster)) {\n System.out.println(\"k-means : clustering converged\");\n break;\n }\n\n if (iter == iterMax) {\n System.out.println(\"k-means : reach max iteration\");\n }\n }\n\n return cluster;\n }", "static Cluster clusterProvider(String neptune, int BATCH_SIZE) {\n java.security.Security.setProperty(\"networkaddress.cache.ttl\", \"0\");\n java.security.Security.setProperty(\"networkaddress.cache.negative.ttl\", \"0\");\n\n Cluster.Builder clusterBuilder = Cluster.build()\n .addContactPoint(neptune) // add more ro contact points for load balancing\n .port(8182)\n .enableSsl(true)\n// .keyStore(keyStore) // optional as amazon cert will be used and should be in truststore of server\n// .keyStorePassword(keyStorePassword)\n .channelizer(SigV4WebSocketChannelizer.class)\n .serializer(Serializers.GRAPHBINARY_V1D0)\n .maxInProcessPerConnection(1) // ensure no contention for connections per batch\n .minInProcessPerConnection(1)\n .maxSimultaneousUsagePerConnection(1)\n .minSimultaneousUsagePerConnection(1)\n .maxWaitForConnection(15000)\n .minConnectionPoolSize(BATCH_SIZE)\n .maxConnectionPoolSize(BATCH_SIZE);\n\n return clusterBuilder.create();\n }", "public WatsetClustering<V> compute() {\n logger.log(Level.INFO, \"Watset started.\");\n\n buildInventory();\n\n final var count = senses.values().stream().mapToInt(List::size).sum();\n logger.log(Level.INFO, \"Watset: sense inventory constructed including {0} senses.\", count);\n\n final var senseGraph = buildSenseGraph();\n\n if (graph.edgeSet().size() != senseGraph.edgeSet().size()) {\n throw new IllegalStateException(\"Mismatch in number of edges: expected \" +\n graph.edgeSet().size() +\n \", but got \" +\n senseGraph.edgeSet().size());\n }\n\n logger.log(Level.INFO, \"Watset: sense graph constructed.\");\n\n final var globalAlgorithm = global.apply(senseGraph);\n final var senseClusters = globalAlgorithm.getClustering();\n\n logger.log(Level.INFO, \"Watset finished.\");\n\n final var clusters = senseClusters.getClusters().stream().\n map(cluster -> cluster.stream().map(Sense::get).collect(Collectors.toSet())).\n collect(Collectors.toList());\n\n return new WatsetClustering.WatsetClusteringImpl<>(clusters,\n Collections.unmodifiableMap(inventory),\n new AsUnmodifiableGraph<>(senseGraph));\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "public void steepestDescent() {\r\n ArrayList<Atom> atoms = cluster.getAtoms();\r\n Atom a;\r\n int numAtoms = atoms.size();\r\n double potentialEnergy;\r\n double trialPotential;\r\n int i;\r\n\r\n //Increment time\r\n totalTime += currentStep;\r\n\r\n //Calculate force on each atom\r\n cluster.calculateForces();\r\n\r\n //Get energy of current configuration\r\n HashMap<String, Double> energies = cluster.getEnergies();\r\n potentialEnergy = 0.0;\r\n for(String eName : energies.keySet())\r\n potentialEnergy += energies.get(eName).doubleValue();\r\n\r\n //Save current atom positions and advance atoms to trial positions\r\n for(i = 0; i < numAtoms; i++) {\r\n a = atoms.get(i);\r\n\r\n savedLocations[i].x = a.location.x;\r\n savedLocations[i].y = a.location.y;\r\n savedLocations[i].z = a.location.z;\r\n\r\n //Compute trial locations\r\n a.location.x += a.force.x * currentStep;\r\n a.location.y += a.force.y * currentStep;\r\n a.location.z += a.force.z * currentStep;\r\n }\r\n\r\n //Get energy of the trial configuration\r\n energies = cluster.getEnergies();\r\n trialPotential = 0.0;\r\n for(String eName : energies.keySet())\r\n trialPotential += energies.get(eName).doubleValue();\r\n\r\n //Decide whether to keep trial configuration based on convergence\r\n if(trialPotential < potentialEnergy) {\r\n //Keep positions and check for convergence\r\n if(Math.abs((potentialEnergy - trialPotential) / potentialEnergy) < convergenceCriterion)\r\n isConverged = true;\r\n\r\n currentStep *= 1.2;\r\n } else {\r\n //Restore old positions\r\n for(i = 0; i < numAtoms; i++) {\r\n a = atoms.get(i);\r\n\r\n a.location.x = savedLocations[i].x;\r\n a.location.y = savedLocations[i].y;\r\n a.location.z = savedLocations[i].z;\r\n }\r\n\r\n currentStep *= 0.5;\r\n }\r\n }", "public NearestNeighbourhood(final int k) {\n\t\tsuper();\n\t\tthis.k = k;\n\t}", "protected void startClusterer() {\r\n\t\tif (m_RunThread == null) {\r\n\t\t\tm_StartBut.setEnabled(false);\r\n\t\t\tm_timer.setEnabled(false);\r\n\t\t\tm_StopBut.setEnabled(true);\r\n\t\t\tm_ignoreBut.setEnabled(false);\r\n\t\t\tm_RunThread = new Thread() {\r\n\t\t\t\tInstances trainInst = null;\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tboolean errors = false;\r\n\t\t\t\t\tlong start,end;\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\t// Copy the current state of things\r\n\t\t\t\t\t\tm_Log.statusMessage(\"Setting up...\");\r\n\t\t\t\t\t\tInstances inst = new Instances(m_Instances);\r\n\t\t\t\t\t\tinst.setClassIndex(-1);\r\n\t\r\n\t\t\t\t\t\tint[] ignoredAtts = null;\r\n\t\t\t\t\t\ttrainInst = new Instances(inst);\r\n\t\r\n\t\t\t\t\t\tif (m_EnableClassesToClusters.isSelected()) {\r\n\t\t\t\t\t\t\ttrainInst.setClassIndex(m_ClassCombo.getSelectedIndex());\r\n\t\t\t\t\t\t\tinst.setClassIndex(m_ClassCombo.getSelectedIndex());\r\n\t\t\t\t\t\t\tif (inst.classAttribute().isNumeric()) {\r\n\t\t\t\t\t\t\t\tthrow new Exception(\"Class must be nominal for class based evaluation!\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!m_ignoreKeyList.isSelectionEmpty()) {\r\n\t\t\t\t\t\t\ttrainInst = removeIgnoreCols(trainInst);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!m_ignoreKeyList.isSelectionEmpty()) {\r\n\t\t\t\t\t\t\tignoredAtts = m_ignoreKeyList.getSelectedIndices();\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\tif (m_EnableClassesToClusters.isSelected()) {\r\n\t\t\t\t\t\t\t// add class to ignored list\r\n\t\t\t\t\t\t\tif (ignoredAtts == null) {\r\n\t\t\t\t\t\t\t\tignoredAtts = new int[1];\r\n\t\t\t\t\t\t\t\tignoredAtts[0] = m_ClassCombo.getSelectedIndex();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tint[] newIgnoredAtts = new int[ignoredAtts.length + 1];\r\n\t\t\t\t\t\t\t\tSystem.arraycopy(ignoredAtts, 0,\r\n\t\t\t\t\t\t\t\t\t\tnewIgnoredAtts, 0, ignoredAtts.length);\r\n\t\t\t\t\t\t\t\tnewIgnoredAtts[ignoredAtts.length] = m_ClassCombo\r\n\t\t\t\t\t\t\t\t\t\t.getSelectedIndex();\r\n\t\t\t\t\t\t\t\tignoredAtts = newIgnoredAtts;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tint clustering_amount = 1;\r\n\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\tclustering_amount = m_bracketingPanel.getNumberClusterings();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add tasks\r\n\t\t\t\t\t\tfor (int i = 0; i < clustering_amount; i++) {\r\n\t\t\t\t\t\t\tif (m_Log instanceof TaskLogger) {\r\n\t\t\t\t\t\t\t\t((TaskLogger) m_Log).taskStarted();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int i = 0; i < clustering_amount ; i++) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tSerializedObject so = new SerializedObject((SubspaceClusterer) m_ClustererEditor.getValue());\r\n\t\t\t\t\t\t\tSubspaceClusterer clusterer = (SubspaceClusterer) so.getObject();\r\n\t\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\t\tm_bracketingPanel.setBracketingParameter(clusterer, i);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tString name = (new SimpleDateFormat(\"HH:mm:ss - \")).format(new Date());\r\n\t\t\t\t\t\t\tString cname = clusterer.getClass().getName();\r\n\t\t\t\t\t\t\tif (cname.startsWith(\"weka.subspaceClusterer.\")) {\r\n\t\t\t\t\t\t\t\tname += cname.substring(\"weka.subspaceClusterer.\".length());\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tname += cname;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tString parameter_name = \"\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\t\tparameter_name+= m_bracketingPanel.getParameterString(clusterer,i);\r\n\t\t\t\t\t\t\t\tname+=parameter_name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tString cmd = clusterer.getClass().getName();\r\n\t\t\t\t\t\t\tif (m_ClustererEditor.getValue() instanceof OptionHandler)\r\n\t\t\t\t\t\t\t\tcmd += \" \" + Utils.joinOptions(((OptionHandler)clusterer).getOptions());\r\n\r\n\t\t\t\t\t\t\t//add measure options to command line\r\n\t\t\t\t\t\t\tif(m_EnableEvaluation.isSelected()){\r\n\t\t\t\t\t\t\t\tArrayList<ClusterQualityMeasure> cmdMeasureList = m_evaluationPanel.getSelectedMeasures();\r\n\t\t\t\t\t\t\t\tif(cmdMeasureList.size() > 0) cmd+= \" -M \";\r\n\t\t\t\t\t\t\t\tfor (int c = 0; c < cmdMeasureList.size(); c++) {\r\n\t\t\t\t\t\t\t\t\tString c_name = cmdMeasureList.get(c).getClass().getName();\r\n\t\t\t\t\t\t\t\t\tif (c_name.startsWith(\"weka.clusterquality.\")) {\r\n\t\t\t\t\t\t\t\t\t\tcmd+= c_name.substring(\"weka.clusterquality.\".length());\r\n\t\t\t\t\t\t\t\t\t\tif(c < cmdMeasureList.size()-1) cmd+= \":\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\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\tm_Log.logMessage(\"Started \" + cname);\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Command: \" + cmd);\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Clustering: Started\");\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Build the model and output it.\r\n\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Clusterer running...\");\r\n\t\r\n\t\t\t\t\t\t\t\tStringBuffer outBuffer = new StringBuffer();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// remove the class attribute (if set) and build the clusterer\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tBuildSubspaceClustererThread clusterthread = new BuildSubspaceClustererThread(clusterer,removeClass(trainInst));\r\n\t\t\t\t\t\t\t\tstart = System.currentTimeMillis();\r\n\r\n\t\t\t\t\t\t\t\tclusterthread.start();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tint timer = Integer.parseInt(m_timer.getText());\r\n\t\t\t\t\t\t\t\tif(!m_EnableTimer.isSelected() || timer <= 0 || timer > 1000000000){\r\n\t\t\t\t\t\t\t\t\ttimer = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tclusterthread.join(timer*60*1000);\r\n\t\t\t\t\t\t\t\tend = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\tif(clusterthread.isAlive()) {\r\n\t\t\t\t\t\t\t\t\tclusterthread.interrupt();\r\n\t\t\t\t\t\t\t\t\tclusterthread.stop();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(\"Timeout after \"+timer+\" minutes\");\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tclusterthread.join();\r\n\t\t\t\t\t\t\t\tif(clusterthread.getException()!=null) {\r\n\t\t\t\t\t\t\t\t\tthrow clusterthread.getException();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\toutBuffer.append(getClusterInformation(clusterer,inst,end-start));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Clustering: done\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Evaluation stuff, catch Exceptions, most likely out of memory\r\n\t\t\t\t\t\t\t\tif(m_EnableEvaluation.isSelected()){\r\n\t\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\t\tif(inst.classIndex() >= 0){\r\n\t\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Evaluation running...\");\r\n\t\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Evaluation: Start\");\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tArrayList<ClusterQualityMeasure> measures = m_evaluationPanel.getSelectedMeasures();\r\n\t\t\t\t\t\t\t\t\t\t\tArrayList<Cluster> m_TrueClusters = m_evaluationPanel.getTrueClusters();\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//Run evaluation\r\n\t\t\t\t\t\t\t\t\t\t\tstart = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\t\tStringBuffer qualBuffer = SubspaceClusterEvaluation.evaluateClustersQuality(clusterer, inst, measures, m_TrueClusters, m_evaluationPanel.getTrueClusterFile());\r\n\t\t\t\t\t\t\t\t\t\t\tend = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\t\toutBuffer.append(qualBuffer);\r\n\t\t\t\t\t\t\t\t\t\t\toutBuffer.append(\"\\n\\nCalculating Evaluation took: \"+formatTimeString(end-start)+\"\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Evaluation: Finished\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Problem evaluating clustering (number of clusters: \"+clusterer.getSubspaceClustering().size()+\")\");\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t}catch (OutOfMemoryError e) {\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t//Visual stuff, catch Exceptions, most likely out of memory\r\n\t\t\t\t\t\t\t\tm_CurrentVis = new SubspaceVisualData();\r\n\t\t\t\t\t\t\t\tif (!isInterrupted() && m_EnableStoreVisual.isSelected()) {\r\n\t\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Calculating visualization...\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Calculate visualization: Start\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t//calculate visual stuff\r\n\t\t\t\t\t\t\t\t\t\tstart = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\tm_CurrentVis.calculateVisual((ArrayList<Cluster>)clusterer.getSubspaceClustering(), removeClass(trainInst));\r\n\t\t\t\t\t\t\t\t\t\tend = System.currentTimeMillis();\r\n\t\t\t\t\t\t\t\t\t\t//where is the name being used???\r\n\t\t\t\t\t\t\t\t\t\tm_CurrentVis.setName(name + \" (\" + inst.relationName()+ \")\");\r\n\t\t\t\t\t\t\t\t\t\tm_CurrentVis.setHistoryName(parameter_name);\r\n\t\t\t\t\t\t\t\t\t\toutBuffer.append(\"Calculating visualization took: \"+formatTimeString(end-start)+\"\\n\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Calculate visualization: Finished\");\r\n\t\t\t\t\t\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Problem calculating visualization (number of clusters: \"+clusterer.getSubspaceClustering().size()+\")\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tcatch(OutOfMemoryError e){\r\n\t\t\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//put buffer into cluster so it can be safed with the cluster\r\n\t\t\t\t\t\t\t\tclusterer.setConsole(outBuffer);\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(\"Finished \" + cmd);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tm_History.addResult(name, outBuffer);\r\n\t\t\t\t\t\t\t\tm_History.setSingle(name);\r\n\t\t\t\t\t\t\t\tm_History.updateResult(name);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(ex.getMessage());\r\n\t\t\t\t\t\t\t\tm_Log.statusMessage(\"Problem evaluating clusterer\");\r\n\t\t\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch(OutOfMemoryError e){\r\n\t\t\t\t\t\t\t\tm_Log.logMessage(e.getMessage());\r\n\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\tFastVector vv = new FastVector();\r\n\t\t\t\t\t\t\t\tvv.addElement(clusterer);\r\n\t\t\t\t\t\t\t\tInstances trainHeader = new Instances(m_Instances, 0);\r\n\t\t\t\t\t\t\t\tvv.addElement(trainHeader);\r\n\t\t\t\t\t\t\t\tif (ignoredAtts != null)\r\n\t\t\t\t\t\t\t\t\tvv.addElement(ignoredAtts);\r\n\t\t\t\t\t\t\t\tvv.addElement(m_CurrentVis);\r\n\t\r\n\t\t\t\t\t\t\t\tm_History.addObject(name, vv);\r\n\t\t\t\t\t\t\t\tif (isInterrupted()) {\r\n\t\t\t\t\t\t\t\t\tm_Log.logMessage(\"Bracketing interrupted:\" + cname);\r\n\t\t\t\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (m_Log instanceof TaskLogger) {\r\n\t\t\t\t\t\t\t\t\t((TaskLogger) m_Log).taskFinished();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t\tm_Log.logMessage(ex.getMessage());\r\n\t\t\t\t\t\tm_Log.statusMessage(\"Problem setting up clusterer\");\r\n\t\t\t\t\t} catch (OutOfMemoryError ex) {\r\n\t\t\t\t\t\terrors = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Out of memory\");\r\n\t\t\t\t\t\tm_Log.logMessage(ex.getMessage());\r\n\t\t\t\t\t\tm_Log.statusMessage(\"See error log\");\r\n\t\t\t\t\t} \r\n\t\t\t\t\tfinally {\r\n\r\n\t\t\t\t\t\tm_RunThread = null;\r\n\t\t\t\t\t\tm_StartBut.setEnabled(true);\r\n\t\t\t\t\t\tm_StopBut.setEnabled(false);\r\n\t\t\t\t\t\tm_ignoreBut.setEnabled(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//kill all other tasks in the logger so the poor bird can stop running\r\n\t\t\t\t\t\t//belongs somewhere else, but doesnt work in finally after for-bracketing anymore \r\n\t\t\t\t\t\tint clustering_amount = 1;\r\n\t\t\t\t\t\tif(m_BracketingBut.isEnabled()){\r\n\t\t\t\t\t\t\tclustering_amount = m_bracketingPanel.getNumberClusterings();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (int j = 0; j < clustering_amount; j++) {\r\n\t\t\t\t\t\t\tif (m_Log instanceof TaskLogger) {\r\n\t\t\t\t\t\t\t\t((TaskLogger) m_Log).taskFinished();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(errors){ \r\n\t\t\t\t\t\t\tm_Log.statusMessage(\"Errors accured, see error logs\");\r\n\t\t\t\t\t\t\tJOptionPane\r\n\t\t\t\t\t\t\t\t.showMessageDialog(SubspaceClustererPanel.this,\r\n\t\t\t\t\t\t\t\t\"Problems occured during clusterig, check error log for more details\",\r\n\t\t\t\t\t\t\t\t\"Evaluate clusterer\",\r\n\t\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{ \r\n\t\t\t\t\t\t\tm_Log.statusMessage(\"OK\");\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\tm_RunThread.setPriority(Thread.MIN_PRIORITY);\r\n\t\t\tm_RunThread.start();\r\n\t\t}\r\n\t}", "public List<List<AlgorithmPoint>> getNeighbours(AlgorithmPoint point, double epsilon, int k)\n {\n List<AlgorithmPoint> neighbours = getNeighbours(point, epsilon);\n\n // first we create a max priority queue\n\n PriorityQueue<PrioPair<AlgorithmPoint,Double>> pq = new PriorityQueue<PrioPair<AlgorithmPoint,Double>>();\n\n for (AlgorithmPoint q : neighbours) {\n double dist = Calculations.distance(point.getPoint(), q.getPoint(), Algorithm.DISTANCE_METRIC);\n\n PrioPair<AlgorithmPoint,Double> pair = new PrioPair<AlgorithmPoint,Double>(q, dist);\n\n if (pq.size() <= k) {\n pq.add(pair);\n } else {\n if (dist < ((Double) pq.peek().getV())) {\n // remove the highest element\n pq.poll();\n pq.add(pair);\n }\n }\n }\n\n // now we make the list\n\n List<AlgorithmPoint> knn = new ArrayList<AlgorithmPoint>();\n PrioPair<AlgorithmPoint,Double> pair;\n\n while ((pair = pq.poll()) != null) {\n knn.add(pair.getT());\n }\n\n List<List<AlgorithmPoint>> result = new ArrayList<List<AlgorithmPoint>>(2);\n\n result.add(knn);\n result.add(neighbours);\n\n return result;\n }", "public void setCentroidsAsMeans();", "public Ms2Cluster cluster(Map<Ms2Pointer, MsnSpectrum> spectra, Float lowmass, OffsetPpmTolerance tol, double min_dp, int miss_index)\n {\n // quit if the master or input are not present!\n if (mHead==null || !Tools.isSet(spectra)) return null;\n\n mHead.cluster=this;\n\n // setting the seed spectrum\n if (getMaster()==null && spectra.get(getHead())!=null)\n setMaster(spectra.get(getHead()).copy(new PurgingPeakProcessor()));\n\n// MsnSpectrum HEAD = (mMaster!=null?mMaster:spectra.get(mHead));\n // setup the master first\n List<Peak> head = Spectra.toListOfPeaks(getMaster(), lowmass);\n // get the index of the HEAD spectrum\n List<Peak> index = Similarity.index(head, 7, 0, 1, 5, 0);\n\n // the collections\n if (mMembers!=null) mMembers.clear(); else mMembers = new ArrayList<>();\n // new members from this round\n Collection<MsnSpectrum> members = new ArrayList<>();\n // the error tolerance\n double delta = tol.calcError(500);\n for (Ms2Pointer member : mCandidates)\n {\n MsnSpectrum scan = spectra.get(member);\n // need to exclude the head itself\n if (member.hcode==getHead().hcode)\n {\n member.dp=1; // being the self\n member.cluster=this;\n mMembers.add(member);\n continue;\n }\n if (scan!=null)\n {\n // calc the forward and backward DPs and choose the smallest\n List<Peak> pks = Spectra.toListOfPeaks(scan,lowmass);\n // make sure a min number of the index peaks are found\n if (miss_index>=0 && index.size()-Peaks.overlap_counts(pks, index, delta, true)>miss_index) continue;\n\n member.dp=(float )Similarity.bidirectional_dp(head, pks, tol, true, true, true);\n // now the matching probability\n member.prob = (float )Similarity.similarity_hg(head, pks, delta);\n\n if (member.dp>=min_dp)\n {\n member.cluster=this;\n mMembers.add(member);\n members.add(spectra.get(member));\n }\n }\n }\n mMaster = Spectra.accumulate(getMaster(), tol, 0.5f, members);\n mMz = (float )mMaster.getPrecursor().getMz();\n mRT = (float )getMaster().getRetentionTimes().getFirst().getTime()/60f;\n mCharge = getMaster().getPrecursor().getCharge();\n// mID = Tools.d2s(getMz(),3)+\"|\"+getCharge()+\"|\"+Tools.d2s(getRT(),1);\n mID = toString();\n\n // remove the local objects\n head = (List )Tools.dispose(head);\n index = (List )Tools.dispose(index);\n members = Tools.dispose(members);\n\n return this;\n }", "Execution getClosestDistance();", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "protected final void go(CommandLine options)\r\n {\r\n final File outputDir = (File) getOption(options, \"output\", null);\r\n final File descriptors = (File) getOption(options, \"algorithms\", new File(\"algorithms\"));\r\n \r\n super.config.setDefaultValue(ConfigConstants.ATTR_CLUSTERS_ONLY, new Boolean(options.hasOption(\"co\")));\r\n super.config.setDefaultValue(ConfigConstants.ATTR_DEFAULT_PROCESSID, options.getOptionValue(\"algorithm\"));\r\n super.config.setDefaultValue(ConfigConstants.ATTR_OUTPUT_FORMAT, \r\n options.hasOption(\"json\") ? ControllerContext.RESULTS_TO_JSON :\r\n options.hasOption(\"xml\") ? ControllerContext.RESULTS_TO_XML : null);\r\n \r\n final boolean verbose = options.hasOption(\"verbose\");\r\n if (verbose)\r\n {\r\n logger.setLevel(Level.DEBUG);\r\n }\r\n \r\n if (outputDir != null && !outputDir.exists())\r\n {\r\n logger.info(\"Creating output folder: \" + outputDir.getAbsolutePath());\r\n if (!outputDir.mkdirs())\r\n {\r\n logger.error(\"Could not create output folder: \" + outputDir.getAbsolutePath());\r\n return;\r\n }\r\n }\r\n \r\n if (outputDir == null)\r\n {\r\n logger.warn(\"Output directory not specified, clustering without saving the result.\");\r\n }\r\n \r\n // Initialize processes.\r\n final ControllerContext context;\r\n try\r\n {\r\n context = initializeContext(descriptors);\r\n }\r\n catch (Exception e)\r\n {\r\n getLogger().fatal(\"Could not initialize clustering algorithms. Inspect log files.\", e);\r\n return;\r\n }\r\n \r\n final String processId = config.getString(ConfigConstants.ATTR_DEFAULT_PROCESSID);\r\n if (processId == null || !context.getController().getProcessIds().contains(processId))\r\n {\r\n if (processId == null)\r\n {\r\n getLogger().fatal(\"Provide the identifier of a clustering algorithm to use.\");\r\n }\r\n else\r\n {\r\n getLogger().fatal(\"This clustering algorithm is not available: \" + processId);\r\n }\r\n return;\r\n }\r\n \r\n // Collect files to process.\r\n final String [] unprocessed = options.getArgs();\r\n final ArrayList files = new ArrayList();\r\n \r\n for (int i = 0; i < unprocessed.length; i++)\r\n {\r\n final File file = new File(unprocessed[i]);\r\n if (!file.exists())\r\n {\r\n logger.warn(\"File does not exist, skipping: \" + file);\r\n continue;\r\n }\r\n \r\n if (file.isDirectory())\r\n {\r\n final File [] subfiles = file.listFiles(new FileFilter()\r\n {\r\n public boolean accept(File subfile)\r\n {\r\n return (subfile.isFile() && subfile.canRead());\r\n }\r\n });\r\n files.addAll(Arrays.asList(subfiles));\r\n }\r\n else\r\n {\r\n files.add(file);\r\n }\r\n }\r\n \r\n // Run batch clustering.\r\n try\r\n {\r\n if (files.isEmpty())\r\n {\r\n getLogger().warn(\"Empty list of input files. Provide files and/or directories as program arguments.\");\r\n }\r\n \r\n for (Iterator i = files.iterator(); i.hasNext();)\r\n {\r\n final File f = (File) i.next();\r\n logger.info(\"Processing file: \" + f.getName());\r\n \r\n OutputStream outputStream = null;\r\n InputStream inputStream = null;\r\n try\r\n {\r\n inputStream = new FileInputStream(f);\r\n if (outputDir != null)\r\n {\r\n outputStream = new FileOutputStream(new File(outputDir, f.getName()));\r\n }\r\n else\r\n {\r\n outputStream = new ByteArrayOutputStream();\r\n }\r\n \r\n final String processName = config.getRequiredString(ConfigConstants.ATTR_DEFAULT_PROCESSID);\r\n final String outputProcessName = null;\r\n final boolean clustersOnly = config.getRequiredBoolean(ConfigConstants.ATTR_CLUSTERS_ONLY);\r\n ProcessingUtils.cluster(context.getController(), getLogger(), inputStream, outputStream, processName, outputProcessName, clustersOnly);\r\n }\r\n catch (IOException e)\r\n {\r\n if (outputStream != null) outputStream.close();\r\n if (inputStream != null) inputStream.close();\r\n }\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n getLogger().fatal(\"Unhandled program error occurred.\", e);\r\n }\r\n \r\n getLogger().info(\"Finished.\");\r\n }", "public void runAlgorithm(PointList customers, int highwayLength, int velocity) {\n\t\t\n\t\tif (!customers.isEmpty()){\n\t\t\tthis._highwayLength = highwayLength;\n\t\t\tthis._velocity = velocity;\n\t\t\t_maxDist = customers.maxDist();\n\t\t\t\n\t\t\t// for drawing purposes only\n\t\t\tfacilityPoints = new ArrayList<Point>();\n\t\t\tturnpikePoints = new ArrayList<Point>();\n\t\t\tpartitionRadius = new ArrayList<Double>();\n\t\t\t\n\t\t\tset_withTurnpike = new ArrayList<PointList>();\n\t\t\tset_withoutTurnpike = new ArrayList<PointList>();\n\t\t\textremePoints1 = new ArrayList<Point[]>();\n\t\t\textremePoints2 = new ArrayList<Point[]>();\n\t\t\tlist_centersWithoutTurnpike = new ArrayList<PointList>();\n\t\t\tlist_centersWithTurnpike = new ArrayList<PointList>();\n\t\t\t\n\t\t\tgetPartition(customers);\n\t\t\t\n\t\t\tmaxDist1 = new ArrayList<Point>();\n\t\t\tmaxDist2 = new ArrayList<Point>();\n\t\t\tminDist1 = new ArrayList<Point>();\n\t\t\tminDist2 = new ArrayList<Point>();\n\t\t\t\n\t\t\t// compute extreme points\n\t\t\tfor (PointList p : set_withTurnpike){\n\t\t\t\textremePoints1.add(p.getExtremePoints());\n\t\t\t}\n\t\t\tfor (PointList p : set_withoutTurnpike){\n\t\t\t\textremePoints2.add(p.getExtremePoints());\n\t\t\t}\n\t\t\t\n\t\t\t// solve basic problem for all partitions {W,H}\n\t\t\tfor (int i = 0; i < set_withTurnpike.size(); i++){\n\n\t\t\t\t_eps1 = Math.max(0, set_withTurnpike.get(i).delta() + highwayLength/velocity - set_withoutTurnpike.get(i).delta());\n\t\t\t\t_eps2 = Math.max(0, set_withoutTurnpike.get(i).delta() - set_withTurnpike.get(i).delta() - highwayLength/velocity);\n\n\t\t\t\tsolveBP(set_withTurnpike.get(i), set_withoutTurnpike.get(i)); \n\t\t\t\tfacilityPoints.add(_currentFacility);\n\t\t\t\tturnpikePoints.add(_currentTurnpikeStart);\n\t\t\t\tpartitionRadius.add(_currentRadius);\n\t\t\t\t\n\t\t\t\t// for drawing purposes\n\t\t\t\t// fixed length\n\t\t\t\tlist_centersWithoutTurnpike.add(center(set_withTurnpike.get(i), set_withTurnpike.get(i).delta() + _eps2 + _x));\n\t\t\t\tlist_centersWithTurnpike.add(center(set_withoutTurnpike.get(i), set_withoutTurnpike.get(i).delta() + _eps1 + _x));\n\t\t\t\t\n\t\t\t\tif (list_centersWithoutTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0])\n\t\t\t\t\t\t|| list_centersWithTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1])){\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t\t} else {\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]);\n\t\t\t\t}\n\t\t\t\tmaxDist1.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\tmaxDist2.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t}\t\n\t\t\t\n\t\t\tif(customers.getSize() > 1){\n\t\t\t\t// find optimal solution\n\t\t\t\tsolutionIndex = getMinRadiusIndex(); \n\t\t\t\tsolution_facility = facilityPoints.get(solutionIndex);\n\t\t\t\tsolution_turnpikeStart = turnpikePoints.get(solutionIndex);\n//\t\t\t\tsolution_radius = partitionRadius.get(solutionIndex);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void kruskalMST()\n\t\t{\n\t\t\tPriorityQueue<Edge> pq = new PriorityQueue<>(allEdges.size(), Comparator.comparingInt(o -> o.roadCost));\n\n\t\t\tfor(int i = 0; i < allEdges.size(); i++)\n\t\t\t{\t\n\t\t\t\tpq.add(allEdges.get(i));\n\t\t\t}\t\t\t\n\n\t\t\tint [] parent = new int[edges];\n\t\t\tmakeSet(parent);\n\t\t\tArrayList<Edge> mst = new ArrayList<>();\n\t\t\tint index = 0, tempCost = 0;\n\n\t\t\t// Step 2: Pick the lowest cost edges to add to our result\n\t\t\twhile(index < edges - 1)\n\t\t\t{\n\t\t\t\tEdge edge = pq.remove();\n\t\t\t\tint x_set = find(parent, edge.source);\n\t\t\t\tint y_set = find(parent, edge.destination);\n\n\t\t\t\t// If creates a cycle, or a road with n wagons can't support the total weight ignore it\n\t\t\t\tif(x_set == y_set /* ||edge.weightCap * wagons < shipWeight */ ){\n\t\t\n\t\t\t\t}else{\n\t\t\t\t\t// These are valid edges for our MST\n\t\t\t\t\tmst.add(edge);\n\t\t\t\t\ttempCost += edge.roadCost;\n\t\t\t\t\tindex++;\n\t\t\t\t\tunion(parent, x_set, y_set);\n\t\t\t\t}\n\t\t\t\t// If there are no edges left, break out of the while loop\n\t\t\t\tif(pq.size() < 1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// ----------- Output working MSTs ----------- \n\t\t\t// printGraph(allEdges);\n\t\t\t// printCities(allCities);\n\n\t\t}", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "public void processFoundCluster(NodeSet cluster) {\n\t}", "public static ArrayList<Point> getInitialCenters(FileSystem fs, Path input, int k) throws IOException {\n\t\treturn getInitialCenters(fs, input, k, false);\n\t}", "public static int[] getMinKthNearestN(double[][] pts, int k){\n if(k>= pts.length){\n int[] indexs = new int[k];\n for(int i = 0;i<indexs.length;i++){\n indexs[i] = i;\n }\n return indexs;\n }\n\n double[][] distanceTo = new double[pts.length][pts.length];\n int[][] indexs = new int[pts.length][pts.length];\n for(int i = 0; i<pts.length;i++){\n for(int j = 0; j<pts.length;j++){\n indexs[i][j] = j;\n distanceTo[i][j] = Math.pow(pts[i][0] - pts[j][0],2)+Math.pow(pts[i][1] - pts[j][1],2);\n }\n }\n\n\n for(int i = 0; i<pts.length;i++){\n iSort(indexs[i],distanceTo[i]);\n }\n\n double minKthNearestN = Double.POSITIVE_INFINITY;\n int pos = -1;\n for(int i = 0; i<pts.length;i++){\n if(distanceTo[i][k] < minKthNearestN){\n minKthNearestN = distanceTo[i][k];\n pos = i;\n }\n }\n int[] space = new int[k+1];\n for(int i = 0; i<=k; i++){\n space[i] = indexs[pos][i];\n }\n\n return space;\n }", "protected void setup(Context context) throws IOException, InterruptedException {\n\t\t\tConfiguration config = context.getConfiguration();\n\t\t\t// get the parameter of name \"k\"\n\t\t\t// 2 is the default value (getInt returns the default value if the param of \"k\" is not set)\n\t\t\tK = config.getInt (\"K\", 2);\n\t\t\tdimension = config.getInt (\"dimension\", 2);\n\t\t\t// we have k number of cluster centers\n\t\t\tcenters = new double[K][dimension];\n\t\t\t// get the vectors of the k cluster centers \n // TODO\n // ------------------------------------------------------\n //\n // ------------------------------------------------------\n\n\t\t}", "public static Tour FarthestInsertion (double distancematrix [][], Cluster cluster) {\n Tour tour = new Tour(0);\n int numbernodes;\n numbernodes = cluster.getPoints().size();\n int visited[] = new int[numbernodes];\n double max;\n double min;\n int chosenPoint = 0;\n int pos = -1;\n\n Point out = cluster.getOutPoint();\n Point in = cluster.getInPoint();\n\n if (cluster.getPoints().size() == 1){\n tour.addPoint(cluster.getPoints().get(0));\n } else {\n visited[cluster.getPointIndex(out)] = 1;\n visited[cluster.getPointIndex(in)] = 1;\n tour.addPoint(in);\n tour.addPoint(out);\n while (tour.getSize() != numbernodes) {\n int point = 1;\n int insertPoint = 1;\n max =0;\n for (int i = 0; i < numbernodes; i++) {\n double minimum = Double.MAX_VALUE;\n\n int cityIndex = cluster.getPoints().get(i).getPointNumber() - 1;\n if (visited[i] == 1) {\n } else {\n double distance;\n\n for (int j = 1; j <= tour.getSize() - 1; j++) {\n int vor = tour.getPoint((j - 1)).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex];\n if (distance < minimum) {\n minimum = distance;\n point = j;\n pos = i;\n }\n }\n if (minimum > max){\n max = minimum;\n chosenPoint = pos;\n insertPoint = point;\n }\n }\n }\n tour.insertPoint(insertPoint, cluster.getPoints().get(chosenPoint));\n visited[chosenPoint] = 1;\n }\n }\n tour.removePoint(in);\n tour.addPoint(in);\n return tour;\n }", "public Point[] kClosest(Point[] points, Point origin, int k) {\n globalOrigin = origin;\n Queue<Point> pq = new PriorityQueue<>(k, new Comparator<Point>() {\n @Override\n public int compare(Point p1, Point p2) {\n int diff = getDistance(globalOrigin, p2) - getDistance(globalOrigin, p1);\n if (diff == 0) {\n diff = p2.x - p1.x;\n }\n if (diff == 0) {\n diff = p2.y - p1.y;\n }\n return diff;\n }\n });\n\n for (int i = 0; i < points.length; i++) {\n pq.offer(points[i]);\n if (pq.size() > k) {\n pq.poll();\n }\n }\n int size = pq.size();\n Point[] results = new Point[size];\n for (int j = size - 1; j >= 0; j--) {\n results[j] = pq.poll();\n }\n return results;\n }", "public void search() {\r\n\t\tfloat dist = getDistance(permutationPrev);\r\n\t\tfloat delta = 0;\r\n\t\tfloat prob = 0;\r\n\r\n\t\tboolean accept = false;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\twhile ((temperature > minTemperature) || (nIter > 0)) {\r\n\t\t\tdisturbPermut(permutationPrev);\r\n\t\t\tdelta = getDistance(permutation) - dist;\r\n\r\n\t\t\tprob = (float) Math.exp(-delta / temperature);\r\n\t\t\taccept = ((delta < 0) || (delta * (prob - rand.nextFloat()) >= 0));\r\n\r\n\t\t\tif (accept) {\r\n\t\t\t\tacceptPermution(permutation);\r\n\t\t\t\tdist = delta + dist;\r\n\t\t\t}\r\n\r\n\t\t\ttemperature *= cBoltzman;\r\n\t\t\tnIter--;\r\n\r\n\t\t\ttrace.add(dist);\r\n\t\t}\r\n\t\tshortestDist = dist;\r\n\t}", "@Override\n\tpublic void run() {\n\t\tMap<Integer, Integer> roots = new TreeMap<Integer, Integer>();\n\t\t\n\t\tEdge[] edges = new Edge[this.edges.length];\n\t\tint n, weight, relevantEdges, root, lowerBound = 0;\n\t\n\t\t// Sort edges by weight.\n\t\tquickSort(0, this.edges.length - 1);\n\t\n\t\t// Compute initial lower bound (best k - 1 edges).\n\t\t// Choosing the cheapest k - 1 edges is not very intelligent. There is no guarantee\n\t\t// that this subset of edges even induces a subgraph over the initial graph.\n\t\t// TODO: Find a better initial lower bound.\n\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\tlowerBound += this.edges[i].weight;\n\t\t}\n\t\n\t\t// Iterate over all nodes in the graph and run Prim's algorithm\n\t\t// until k - 1 edges are fixed.\n\t\t// As all induced subgraphs have k nodes and are connected according to Prim, they\n\t\t// are candidate solutions and thus submitted.\n\t\tfor (root = 0; root < taken.length; root++) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\n\t\t\ttaken[root] = true;\n\t\t\tn = 0;\n\t\t\tweight = 0;\n\t\t\trelevantEdges = this.edges.length;\n\n\t\t\twhile (n < solution.length) { \n\t\t\t\tfor (int i = 0; i < relevantEdges; i++) {\n\t\t\t\t\t// XOR to check if connected and no circle.\n\t\t\t\t\tif (taken[edges[i].node1] ^ taken[edges[i].node2]) {\n\t\t\t\t\t\ttaken[taken[edges[i].node1] ? edges[i].node2 : edges[i].node1] = true;\n\t\t\t\t\t\tsolution[n++] = edges[i];\n\t\t\t\t\t\tweight += edges[i].weight;\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Check for circle.\n\t\t\t\t\telse if (taken[edges[i].node1]) {\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Sum up what we've just collected and submit this\n\t\t\t// solution to the framework.\n\t\t\tHashSet<Edge> set = new HashSet<Edge>(solution.length);\n\t\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\t\tset.add(solution[i]);\n\t\t\t}\n\t\t\tsetSolution(weight, set);\n\t\t\troots.put(weight, root);\n\t\t}\n\n\t\t// Now for the real business, let's do some Branch-and-Bound. Roots of \"k Prim Spanning Trees\"\n\t\t// are enumerated by weight to increase our chances to obtain the kMST earlier.\n\t\tfor (int item : roots.values()) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\t\t\ttaken[item] = true;\n\t\t\tbranchAndBound(edges, solution.length, 0, lowerBound);\n\t\t}\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n MapModel map = new MapModel(googleMap, true, true);\n map.setMapType(1);\n\n new PersonModel().addItems(person_list);\n //Cluster Manage with click actions in cluster and inside cluster markers :)\n\n LatLng center_location = map.getMapCenterPosition(1, person_list);\n\n Location center_point = new Location(\"center_point\");\n center_point.setLatitude(center_location.latitude);\n center_point.setLongitude(center_location.longitude);\n\n float max_distance = 0;\n for (PersonModel person : person_list) {\n\n System.out.println(person.getPosition());\n\n Location location_mountain = new Location(\"select_location\");\n\n location_mountain.setLatitude(person.getPosition().latitude);\n location_mountain.setLongitude(person.getPosition().longitude);\n float distance = center_point.distanceTo(location_mountain);\n System.out.println(distance + \" to check....\");\n if (distance > max_distance) {\n max_distance = distance;\n System.out.println(distance + \" new asign....\");\n }\n }\n\n\n map.moveCamera(center_location, max_distance);\n mClusterManager = new ClusterManager<>(this, map.getGoogleMap());\n mClusterManager.setRenderer(new PersonClusterRenderer(this, map.getGoogleMap() ,mClusterManager, ClusterMapsActivity.this));\n map.getGoogleMap().setOnCameraChangeListener(mClusterManager);\n map.getGoogleMap().setOnMarkerClickListener(mClusterManager);\n map.getGoogleMap().setOnInfoWindowClickListener(mClusterManager);\n mClusterManager.setOnClusterClickListener(this);\n mClusterManager.setOnClusterInfoWindowClickListener(this);\n mClusterManager.setOnClusterItemClickListener(this);\n mClusterManager.setOnClusterItemInfoWindowClickListener(this);\n for(PersonModel person:person_list)\n {\n mClusterManager.addItem(person);\n }\n\n mClusterManager.cluster();\n\n\n map.getGoogleMap().setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n @Override\n public void onInfoWindowClick(Marker arg0) {\n\n for (PersonModel person : person_list) {\n if (person.name.equals(arg0.getTitle())) {\n\n String uri = \"http://maps.google.com/maps?daddr=\"+arg0.getPosition().latitude+\",\"+\n arg0.getPosition().longitude;\n System.out.println(\"Google maps url: \"+uri);\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));\n intent.setClassName(\"com.google.android.apps.maps\", \"com.google.android.maps.MapsActivity\");\n startActivity(intent);\n }\n }\n }\n });\n }", "public ArrayList<Cluster> mergeBestCluster(int pDistancia,int pMetrica,int k, int clustN)\n\t{\n\t\tcalculateDistances(pDistancia, pMetrica, k);\n\t\tDistance dist = distanceList.getFirst();\n\t\tArrayList<Cluster> clustArray;\n\t\tclustArray = (ArrayList<Cluster>) clusterList.clone();\n\t\tclustArray.remove(dist.getCluster1());\n\t\tclustArray.remove(dist.getCluster2());\n\t\t\n\t\tCluster clust = new Cluster(clustN, dist.mergerInstances() , dist.getCluster1(), dist.getCluster2(), iterationName);\n\t\t//Añadimos el nuevo cluster (El unido) a la nuevalista de clusters\n\t\tclustArray.add(clustArray.size(),clust);\n\t\t\n\t\treturn clustArray;\n\t}", "private static void testAlgorithmOptimality() {\n AlgoFunction testAlgo = SG16Algorithm::new;\n\n //printSeed = false; // keep this commented out.\n Random seedRand = new Random(1241);\n int initial = seedRand.nextInt();\n for (int i=0; i<50000000; i++) {\n int sizeX = seedRand.nextInt(150) + 5;\n int sizeY = seedRand.nextInt(150) + 5;\n int seed = i+initial;\n int ratio = seedRand.nextInt(50) + 5;\n \n int max = (sizeX+1)*(sizeY+1);\n int p1 = seedRand.nextInt(max);\n int p2 = seedRand.nextInt(max-1);\n if (p2 == p1) {\n p2 = max-1;\n }\n \n int sx = p1%(sizeX+1);\n int sy = p1/(sizeX+1);\n int ex = p2%(sizeX+1);\n int ey = p2/(sizeX+1);\n\n double restPathLength = 0, normalPathLength = 0;\n try {\n GridGraph gridGraph = DefaultGenerator.generateSeededGraphOnly(seed, sizeX, sizeY, ratio);\n for (int iii=0;iii<300;++iii) Utility.generatePath(testAlgo, gridGraph, seedRand.nextInt(sizeX+1),seedRand.nextInt(sizeY+1),seedRand.nextInt(sizeX+1),seedRand.nextInt(sizeY+1));\n int[][] path = Utility.generatePath(testAlgo, gridGraph, sx, sy, ex, ey);\n path = Utility.removeDuplicatesInPath(path);\n restPathLength = Utility.computePathLength(gridGraph, path);\n \n path = Utility.computeOptimalPathOnline(gridGraph, sx, sy, ex, ey);\n path = Utility.removeDuplicatesInPath(path);\n normalPathLength = Utility.computePathLength(gridGraph, path);\n }catch (Exception e) {\n e.printStackTrace();\n System.out.println(\"EXCEPTION OCCURRED!\");\n System.out.println(\"Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Start = \" + sx + \",\" + sy + \" End = \" + ex + \",\" + ey);\n throw new UnsupportedOperationException(\"DISCREPANCY!!\");\n }\n \n if (Math.abs(restPathLength - normalPathLength) > 0.000001f) {\n //if ((restPathLength == 0.f) != (normalPathLength == 0.f)) {\n System.out.println(\"============\");\n System.out.println(\"Discrepancy Discovered!\");\n System.out.println(\"Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Start = \" + sx + \",\" + sy + \" End = \" + ex + \",\" + ey);\n System.out.println(\"Actual: \" + restPathLength + \" , Expected: \" + normalPathLength);\n System.out.println(restPathLength / normalPathLength);\n System.out.println(\"============\");\n throw new UnsupportedOperationException(\"DISCREPANCY!!\");\n } else {\n if (i%1000 == 999) {\n System.out.println(\"Count: \" + (i+1));\n System.out.println(\"OK: Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Actual: \" + restPathLength + \" , Expected: \" + normalPathLength);\n }\n }\n }\n }", "private static LinkedList<Integer> localSearch2Opt(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( true )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "public Collection<Node> getNearestNodes(Point point,\n\t\t\tCollection<Node> affectedNodes,\n\t\t\tPredicate<OsmPrimitive> isSelectablePredicate) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tKNN knn = new KNN();\n\t\tknn.classifyTestData();\n\t\t/*\n\t\t * List<Data> knearest = knn.kNearestNeighbors(30, knn.testData.get(0));\n\t\t * for (Data data : knearest) {\n\t\t * System.out.println(data.getEuclideanDistance()); }\n\t\t */\n\t\tSystem.out.println(\"OK\");\n\t}", "public static void main(String[] args) {\n \n PointSET pset = new PointSET();\n System.out.println(\"Empty: \" + pset.isEmpty());\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.6));\n pset.insert(new Point2D(0.5, 0.7));\n pset.insert(new Point2D(0.5, 0.8));\n pset.insert(new Point2D(0.1, 0.5));\n pset.insert(new Point2D(0.8, 0.5));\n pset.insert(new Point2D(0.1, 0.1));\n System.out.println(\"Empty: \" + pset.isEmpty());\n System.out.println(\"Size: \" + pset.size());\n System.out.println(\"Nearest to start: \" + pset.nearest(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #1: \" + pset.contains(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #2: \" + pset.contains(new Point2D(0.5, 0.5)));\n System.out.print(\"Range #1: \");\n for (Point2D p : pset.range(new RectHV(0.001, 0.001, 0.002, 0.002)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #2: \");\n for (Point2D p : pset.range(new RectHV(0.05, 0.05, 0.15, 0.15)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #3: \");\n for (Point2D p : pset.range(new RectHV(0.25, 0.35, 0.65, 0.75)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n \n }", "public REXP kmeans(double[] values, String[] rnames, String[] cnames,\n boolean usePam, String minClusCountExpr, String maxClusCountExpr) {\n minClusCountExpr = minClusCountExpr.replaceAll(\"N\",\n String.valueOf(rnames.length));\n maxClusCountExpr = maxClusCountExpr.replaceAll(\"N\",\n String.valueOf(rnames.length));\n\n double minClusCount = Calculator.calculate(minClusCountExpr);\n double maxClusCount = Calculator.calculate(maxClusCountExpr);\n\n logger.info(\"MIN clusters count: \" + minClusCount\n + \" MAX clusters count: \" + maxClusCount);\n\n // calculate\n\n logger.info(\"values:\\n\" + Arrays.toString(values));\n rengine.assign(CELLS_NAME, values);\n rengine.assign(ROWS_NAME, rnames);\n rengine.assign(COLS_NAME, cnames);\n\n String matrixCmd = \"x <- matrix(\" + CELLS_NAME + \", nrow=\"\n + rnames.length + \", ncol=\" + cnames.length\n + \", byrow=TRUE, dimnames=list(\" + ROWS_NAME + \",\" + COLS_NAME\n + \"))\";\n logger.info(\"Creating matrix command: \" + matrixCmd);\n\n rengine.eval(matrixCmd);\n\n String kmeansCmd = \"km <- pamk(x,\" + ((int) minClusCount) + \":\"\n + ((int) maxClusCount) + \",usepam=\"\n + String.valueOf(usePam).toUpperCase() + \")\";\n logger.info(\"Kmeans command: \" + kmeansCmd);\n REXP km = rengine.eval(kmeansCmd);\n\n // rengine.eval(\"print(km$nc)\");\n\n logger.info(\"Optimal number of clusters : \"\n + ((REXP) km.asVector().get(1)).asInt());\n\n return km;\n\n }", "public AggregateKMeansResponse aggregateKMeans(AggregateKMeansRequest request) throws GPUdbException {\n AggregateKMeansResponse actualResponse_ = new AggregateKMeansResponse();\n submitRequest(\"/aggregate/kmeans\", request, actualResponse_, false);\n return actualResponse_;\n }" ]
[ "0.65283954", "0.6430013", "0.6301807", "0.61290735", "0.6091073", "0.5997253", "0.5992205", "0.58791226", "0.58671266", "0.5855851", "0.57894343", "0.5722388", "0.57202065", "0.56983817", "0.5634972", "0.5580879", "0.55028224", "0.5499135", "0.5494617", "0.54938525", "0.5452247", "0.5355162", "0.53455967", "0.5328952", "0.5323065", "0.5288579", "0.52788705", "0.5250843", "0.52394986", "0.5236933", "0.52293086", "0.52078235", "0.5186349", "0.51738477", "0.5168294", "0.5166093", "0.5161308", "0.5159922", "0.51435375", "0.5139056", "0.5133332", "0.5126136", "0.51186645", "0.50977945", "0.5076234", "0.5069169", "0.50517744", "0.504082", "0.502357", "0.5022386", "0.50197893", "0.49678767", "0.49635732", "0.49593568", "0.4949971", "0.49448675", "0.49289384", "0.4927514", "0.49256024", "0.49185055", "0.4911046", "0.4883514", "0.48654944", "0.48580888", "0.48577806", "0.48550147", "0.48537523", "0.48508352", "0.48492932", "0.4846691", "0.48447332", "0.48326904", "0.48287737", "0.48239252", "0.48220828", "0.48055926", "0.47939438", "0.47873998", "0.4780166", "0.47775942", "0.47759926", "0.47711322", "0.47706172", "0.47576663", "0.47528222", "0.47473717", "0.4744949", "0.47447824", "0.47275978", "0.47231567", "0.46965465", "0.4694577", "0.46923783", "0.4681691", "0.46807456", "0.46789578", "0.46735176", "0.46702352", "0.46684158", "0.46654344" ]
0.4807601
75
Calculates and returns the minimum and maximum values of a particular column in a table.
public AggregateMinMaxResponse aggregateMinMax(AggregateMinMaxRequest request) throws GPUdbException { AggregateMinMaxResponse actualResponse_ = new AggregateMinMaxResponse(); submitRequest("/aggregate/minmax", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getMinColumn();", "public Double getMaxValueInColumn(String columnName){\r\n\t\t\r\n\t\treturn daoEjercicio.getMaxValueInColumn(columnName);\r\n\t\t\r\n\t}", "public int getMaxColumn();", "public AggregateMinMaxResponse aggregateMinMax(String tableName, String columnName, Map<String, String> options) throws GPUdbException {\n AggregateMinMaxRequest actualRequest_ = new AggregateMinMaxRequest(tableName, columnName, options);\n AggregateMinMaxResponse actualResponse_ = new AggregateMinMaxResponse();\n submitRequest(\"/aggregate/minmax\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "private void populateMinMaxTime()\n {\n final ColumnHolder columnHolder = index.getColumnHolder(ColumnHolder.TIME_COLUMN_NAME);\n try (final NumericColumn column = (NumericColumn) columnHolder.getColumn()) {\n this.minTime = DateTimes.utc(column.getLongSingleValueRow(0));\n this.maxTime = DateTimes.utc(column.getLongSingleValueRow(column.length() - 1));\n }\n }", "public int getMinCol() {\n return minCol;\n }", "protected void calcMinMax() {\n }", "double getMin();", "double getMin();", "public int GetMinVal();", "public void normalizeColumn(final int columnIndex) {\r\n double max = Double.NEGATIVE_INFINITY;\r\n double min = Double.POSITIVE_INFINITY;\r\n for (int i = 0; i < this.getRowCount(); i++) {\r\n double val = getLogicalValueAt(i, columnIndex);\r\n if (val > max) {\r\n max = val;\r\n }\r\n if (val < min) {\r\n min = val;\r\n }\r\n }\r\n for (int i = 0; i < this.getRowCount(); i++) {\r\n setLogicalValue(i, columnIndex, (getLogicalValueAt(i, columnIndex) - min)\r\n / (max - min), false);\r\n }\r\n this.fireTableDataChanged();\r\n }", "private int indiceColMin(String tabla[][]){\n int indice=1;\n float aux=-10000;\n for (int j = 1; j <= nVariables; j++) {\n if(Float.parseFloat(tabla[0][j])<0 && Float.parseFloat(tabla[0][j])>aux ){\n aux=Float.parseFloat(tabla[0][j]);\n indice=j;\n }\n }\n return indice;\n }", "public int getMinRow();", "Double getMinimumValue();", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "E minVal();", "double getMax();", "double getMax();", "@Override\n public double[] getMinMax() {\n if ( minMax == null ) {\n calculateMinMaxPositions();\n }\n return minMax;\n }", "public int getMaxRow();", "public double getMinValue() {\n double min = Double.POSITIVE_INFINITY;\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (data[i][j] < min)\n min = data[i][j];\n }\n }\n return min;\n }", "Column getCol();", "Integer calculate(String columnValue);", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "public double getMinDoubleValue();", "public double min() {\n double resultat = Double.MAX_VALUE;\n double tmp = 0;\n for (int i = 0; i < tab.size(); i++) {\n tmp = CalculatorArray.min(tab.get(i));\n if (tmp < resultat) {\n resultat = tmp;\n }\n }\n\n System.out.println(\"Min colonne:\" + resultat);\n return resultat;\n }", "public MaxAndMin(){\n this.list=new ListOfData().getData();\n }", "public double fetchMaxQValue(int row, int col)\n\t\t{\n\t\t\tdouble maxQVal = Integer.MIN_VALUE;\n\t\t\tfor(int i=0; i < ACTION_COUNT; i++)\n\t\t\t{\n\t\t\t\tmaxQVal = Math.max(maxQVal, utilities[i][row][col]);\n\t\t\t}\n\t\t\treturn maxQVal;\n\n\t\t}", "private int indiceColMax(String tabla[][]){\n int indice=1;\n float aux=Float.parseFloat(tabla[0][1]);\n for (int j = 1; j <= nVariables; j++) {\n if(Float.parseFloat(tabla[0][j])<0 && Float.parseFloat(tabla[0][j])<aux){\n aux=Float.parseFloat(tabla[0][j]);\n indice=j;\n }\n }\n return indice;\n }", "public double min(){\r\n\t\t//variable for min val\r\n\t\tdouble min = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the minimum is more than the current index, change min to that value\r\n\t\t\tif (min > this.data[i]){\r\n\t\t\t\tmin = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the minimum val\r\n\t\treturn min;\r\n\t}", "private void findMinandMaxValues(SparklineValues values) {\n minY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).min().orElse(0.0);\n maxY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).max().orElse(0.0);\n\n if (Math.abs(minY) > 1E30 || Math.abs(maxY) > 1E30) {\n // something is probably wrong\n System.out.println(\"Unexpectedly small/large min or max: \");\n values.getValues().forEach(value -> {\n System.out.print(value.getValue() + \" \");\n });\n System.out.println();\n minY = -1.0;\n maxY = 1.0;\n }\n\n if (minY.equals(maxY)) {\n if (minY.equals(0.0)) {\n minY = -1.0;\n maxY = 1.0;\n } else {\n minY = minY - 0.1 * Math.abs(minY);\n maxY = maxY + 0.1 * Math.abs(maxY);\n }\n }\n }", "Double getMaximumValue();", "public void updateMinMax( ) {\r\n if( (data == null) || (data.size() < 1) ) {\r\n min = 0.0;\r\n max = 0.0;\r\n return;\r\n }\r\n\r\n min = data.get( 0 );\r\n max = data.get( 0 );\r\n\r\n for( int i = 1; i < data.size(); i++ ) {\r\n if( min > data.get( i ) )\r\n min = data.get( i );\r\n if( max < data.get( i ) )\r\n max = data.get( i );\r\n }\r\n\r\n }", "int getXMin();", "public int getMinInSingleRow() {\n return minInSingleRow;\n }", "public DynamicPart minMax(float min, float max) {\n return this.min(min).max(max);\n }", "public double getMinimumValue()\n {\n this.minimumValue = getMinNumber(allValues);\n this.maximumValue = getMaxNumber(allValues);\n return minimumValue;\n }", "private int[] getMergedMinMax(SSheet worksheet, int row, int col) {\n\t\tCellRegion merged = worksheet.getMergedRegion(row, col);\n\t\tif (merged == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tint l = merged.getColumn();\n\t\t\tint t = merged.getRow();\n\t\t\tfinal SCell c0 = worksheet.getCell(t, l);\n\t\t\tif (!c0.isNull() && c0.getType() != CellType.BLANK) { // non empty merged cell\n\t\t\t\treturn new int[] {l, t, merged.getLastColumn(), merged.getLastRow()};\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}", "public double get(int min, int max) {\r\n\t\treturn chart[min][max];\r\n\t}", "Object getMinimumValue(Object elementID) throws Exception;", "public Object getValueAt(int row, int col)\n {\n\tif (col==0) {\n\t return smartPrescaleTable.prescaleCondition(row);\n\t} else if (col==1) {\n\t if (smartPrescaleTable.simple(row)) {\n\t\treturn smartPrescaleTable.prescale(row);\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t} else {\n\t if (smartPrescaleTable.simple(row)) {\n\t\tString pathName=smartPrescaleTable.pathName(row);\n\t\tif (smartPrescaleTable.checkHLTPathExists(pathName)) {\n\t\t return smartPrescaleTable.prescale(row)\n\t\t\t*prescaleTable.prescales(pathName).get(col-2);\n\t\t} else {\n\t\t return new Long(-1);\n\t\t}\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t}\n }", "public int getScale(int column) throws SQLException {\n\t\t\treturn 0;\n\t\t}", "public T getMin ();", "private int[] findMinMax(ArrayList<ArrayList<Integer>> objects, int featureNo) {\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\t\n\t\t\tfor(int b = 0; b < objects.size(); b++){\n\t\t\t\t\n\t\t\t\tmax = Math.max(objects.get(b).get(featureNo) , max);\n\t\t\t\tmin = Math.min(objects.get(b).get(featureNo) , min);\n\t\t\t}\n\t\t\t\n\t\t\treturn new int[]{max,min};\n\t\t}", "public void updateFeaturesMinMax() throws DatabaseAccessException {\n\t\tStatement stmt;\n\t\tResultSet rs;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\t\t\trs = stmt.executeQuery(\"SELECT Id FROM Features;\");\n\t\t\tArrayList<Integer> featureIds = new ArrayList<Integer>();\n\t\t\twhile (rs.next()) {\n\t\t\t\tfeatureIds.add(rs.getInt(\"Id\"));\n\t\t\t}\n\t\t\tstmt.close();\n\n\t\t\tfor (Integer id : featureIds) {\n\t\t\t\tstmt = this.connection.createStatement();\n\t\t\t\trs = stmt.executeQuery(\"SELECT MIN(\\\"\" + id + \"\\\"), MAX(\\\"\" + id + \"\\\") FROM Objects;\");\n\t\t\t\tfloat min = rs.getFloat(1);\n\t\t\t\tfloat max = rs.getFloat(2);\n\t\t\t\trs.close();\n\t\t\t\tstmt.close();\n\n\t\t\t\tPreparedStatement prepStmt = this.connection\n\t\t\t\t\t\t.prepareStatement(\"UPDATE Features SET Min=?, Max=? WHERE Id=?\");\n\t\t\t\tprepStmt.setFloat(1, min);\n\t\t\t\tprepStmt.setFloat(2, max);\n\t\t\t\tprepStmt.setInt(3, id);\n\t\t\t\tprepStmt.execute();\n\t\t\t\tprepStmt.close();\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new DatabaseAccessException(Failure.WRITE);\n\t\t}\n\t}", "public int getMaxInSingleRow() {\n return maxInSingleRow;\n }", "protected double getMinDouble() {\r\n boolean handleOutOfMemoryError = false;\r\n double min = Double.POSITIVE_INFINITY;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n double value;\r\n int row;\r\n int col;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n value = getCell(\r\n row,\r\n col);\r\n if (value != noDataValue) {\r\n min = Math.min(\r\n min,\r\n value);\r\n }\r\n }\r\n }\r\n return min;\r\n }", "public static int[] minmax(int[] a)\n {\n \tint[] b= {0,0};\n \tint min=(int)1e9;\n \tint max=(int)-1e9;\n \tfor(int i=0;i<a.length;i++)\n \t{\n \t\tmin=Math.min(min, a[i]);\n \t\tmax=Math.max(max, a[i]);\n \t}\n \tb[0]=min;\n \tb[1]=max;\n \treturn b;\n }", "public abstract int getMinimumValue();", "Expression getMax();", "E maxVal();", "@JSProperty(\"minRange\")\n double getMinRange();", "public int getValue(int row, int column);", "public void visitColumn(double val);", "public int GetMaxVal();", "protected IExpressionValue min()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t// Debug.println(\"ANALISING MIN FUNCTION\");\r\n\t\t\r\n\t\tIExpressionValue ret1 = null;\r\n\t\tIExpressionValue ret2 = null;\r\n\t\tmatch('(');\r\n\t\tret1 = this.expression();\r\n//\t\tmatch(';');\r\n\t\tif (look != ';' && look != ',') {\r\n\t\t\texpected(\";\");\r\n\t\t}\r\n\t\tnextChar();\r\n\t\tskipWhite();\r\n\t\tret2 = this.expression();\r\n\t\tmatch(')');\r\n\t\t/*\r\n\t\t// old code: tests which ret1/ret2 to return and test consistency. ComparisionProbabilityValue replaces it.\r\n\t\tif (!Float.isNaN(ret1)) {\r\n\t\t\tif (!Float.isNaN(ret2)) {\r\n\t\t\t\tret1 = ((ret2<ret1)?ret2:ret1);\r\n\t\t\t}\r\n\t\t} else if (!Float.isNaN(ret2)) {\r\n\t\t\treturn ret2;\r\n\t\t}\r\n\t\t*/\r\n\t\treturn new ComparisionProbabilityValue(ret1,ret2,false);\r\n\t\t\r\n\t}", "private static void findLocalMaxOrMin() {\n // Find the integer with no duplicates\n // Priority Queues / Double ended priority queues are efficient O(1) with remove the min / max\n\n Integer[] a = new Integer[]{0,1,2,3,4,5,6,7,8,7,6};\n// int[] a2 = new int[]{5,4,3,2,1,2,3,4};\n\n MinPQ<Integer> minPQ = new MinPQ<Integer>(a);\n\n System.out.print(minPQ.min());\n }", "@Override\n\t\tpublic int getValueColumn() {\n\t\t\treturn valueColumn;\n\t\t}", "float xMin();", "int getMin( int min );", "public static MinMaxContainer getMinMax(int[] mas){\n // functional programming part\n int min = Arrays.stream(mas).min().getAsInt();\n int max = Arrays.stream(mas).max().getAsInt();\n\n MinMaxContainer minMaxContainer = new MinMaxContainer();\n minMaxContainer.max = max;\n minMaxContainer.min = min;\n\n return minMaxContainer;\n }", "Coordinate getMinX();", "Object getMaximumValue(Object elementID) throws Exception;", "@Override public byte[][] getColumnsMinValue() {\n // operation of getting the min value is not supported as its a non leaf\n // node\n // and in case of B+Tree data will be stored only in leaf node and\n // intermediate\n // node will be used only for searching the leaf node\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }", "public void allMinMax() {\n\t\tthis.theMaxX();\n\t\tthis.theMinX();\n\t\tthis.theMaxY();\n\t\tthis.theMinY();\n\t}", "int atColumn();", "public void getSmallInt(String columnName, NullableSmallIntHolder holder) {\n SmallIntVector vector = (SmallIntVector) table.getVector(columnName);\n vector.get(rowNumber, holder);\n }", "@Override\n public Long getMin() {\n return min;\n }", "public double getMinimumValue() { return this.minimumValue; }", "private static int calculations(int[] tab) {\r\n int result; //result of calculations\r\n \r\n //converts array to List interface element\r\n List list = Arrays.asList(ArrayUtils.toObject(tab));\r\n\r\n //calculates min and max value for array\r\n int val1 = (int) Collections.min(list); //min value in array\r\n int val2 = (int) Collections.max(list); //max value in array\r\n \r\n int min_pow2 = (int) Math.pow(val1, 2); //squared power of minimum\r\n int max_pow2 = (int) Math.pow(val2, 2); //squared power of maximum\r\n \r\n result = Math.max(min_pow2, max_pow2); //max of squared values\r\n \r\n return result;\r\n }", "public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }", "private void objectWidth(TableColumn col,int min,int max){\r\n col.setMinWidth(min); //Establece el valor minimo\r\n col.setMaxWidth(max); //Establece el valor maximo\r\n }", "private static double maxOfColumn(double[][] matrix, int col) {\n\t\t// TODO Auto-generated method stub\n\t\tdouble max = 0; \n\t\tfor(int i=0; i<matrix.length; i++){\n\t\t\t\n\t\t\tif(matrix[i][col] > max)\n\t\t\t\tmax = matrix[i][col]; \n\t\t}\n\t\t\n\t\treturn max;\n\t}", "public static double normalizeMapminmax(double num) {\r\n \t\tint MAXsetvaluefaktor = 1;\r\n \t\tint MINsetvaluefaktor = 1;\r\n \r\n \t\tswitch (GAMETYPE) {\r\n \t\tcase SAYISALLOTO: {\r\n \t\t\tif (INPUTVALUETYPE == DIGITAL) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t\tMINsetvaluefaktor = 0;\r\n \t\t\t} else if (INPUTVALUETYPE == RAWVALUE) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMAXSETVALUE49;\r\n \t\t\t\tMINsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tdefault: {\r\n \r\n \t\t}\r\n \t\t}\r\n \r\n \t\tdouble result = ((MAPMAX - MAPMIN) * (num - MINsetvaluefaktor));\r\n \t\tresult = result / (MAXsetvaluefaktor - MINsetvaluefaktor);\r\n \t\tresult = result + MAPMIN;\r\n \t\treturn result;\r\n \t}", "public int getMaxCol() {\n return maxCol;\n }", "public Coord minCell()\n {\n\t int minX = getGrid().keySet().stream().mapToInt(Coord::getX).min().orElse(0);\n\n\t int minY = getGrid().keySet().stream().mapToInt(Coord::getY).min().orElse(0);\n\n\t return new Coord(minX, minY);\n }", "public Point getMin () {\r\n\r\n\treturn getA();\r\n }", "String getValue(String column, int row);", "int getMax();", "int getColumn();", "private double getMin() {\n return min;\n }", "public double getMinValue() {\n\t\tdouble min = Double.POSITIVE_INFINITY;\n\t\tfor (int i = 0; i < dataSheet.getDesignCount(); i++) {\n\t\t\tdouble value = dataSheet.getDesign(i).getDoubleValue(this);\n\t\t\tif (value < min)\n\t\t\t\tmin = value;\n\t\t}\n\t\treturn min;\n\t}", "private double getMin() {\n return Collections.min(values.values());\n }", "@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }", "double getLeft(double min);", "org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();", "public PrimEdge calculateMinimum() {\n int minWage = Integer.MAX_VALUE;\n PrimEdge result = null;\n for (Map.Entry<Integer, PrimEdge> entry : dtable.entrySet()) {\n if (entry.getValue().getWage() < minWage) {\n result = entry.getValue();\n minWage = entry.getValue().getWage();\n }\n }\n return result;\n }", "int minColSizeAboveZero() {\n int min = Integer.MAX_VALUE;\n for (IntSet col : this.cols) {\n if (col.size() > 0 && col.size() < min) {\n min = col.size();\n }\n }\n return min;\n }", "public Integer getMin() {\n\t\tif (this.Minimum==null)\n\t\t{\n\t\t\tcalcMinMax();\n\t\t}\n\t\treturn this.Minimum;\n\t}", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "public IAverage column(String column);", "public static void setColumnWidth(TableColumn column, int min, int max) {\n column.setMinWidth(min);\n column.setMaxWidth(max);\n }", "double getMin() {\n\t\t\treturn value_min;\n\t\t}", "public double get(int row, int column) {\n\t\tif (row >= this.rows || row < 0 || column >= this.columns || column < 0) {\n\t\t\tthrow new IllegalArgumentException(\"Values out of range, requested \" + row + \",\" + column\n\t\t\t\t\t+ \", but matrix is only \" + this.rows + \"x\" + this.columns);\n\t\t}\n\t\treturn matrix[row][column];\n\t}", "private int columnCalculator() {\n\n DisplayMetrics metrics = new DisplayMetrics();\n Objects.requireNonNull(getActivity())\n .getWindowManager()\n .getDefaultDisplay()\n .getMetrics(metrics);\n\n // Width of smallest tablet\n int divider = 600;\n int width = metrics.widthPixels;\n int columns = width / divider;\n if (columns < 2) return 2;\n\n return columns;\n }", "Get<K, C> withColumnRange(C startColumn, C endColumn, int limit);", "protected IExpressionValue max()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t// Debug.println(\"ANALISING MAX FUNCTION\");\r\n\t\t\r\n\t\tIExpressionValue ret1 = null;\r\n\t\tIExpressionValue ret2 = null;\r\n\t\tmatch('(');\r\n\t\tret1 = this.expression();\r\n//\t\tmatch(';');\r\n\t\tif (look != ';' && look != ',') {\r\n\t\t\texpected(\";\");\r\n\t\t}\r\n\t\tnextChar();\r\n\t\tskipWhite();\r\n\t\tret2 = this.expression();\r\n\t\tmatch(')');\r\n\t\t/*\r\n\t\t// old code: tests which ret1/ret2 to return and test consistency. ComparisionProbabilityValue replaces it.\r\n\t\tif (!Float.isNaN(ret1)) {\r\n\t\t\tif (!Float.isNaN(ret2)) {\r\n\t\t\t\tret1 = ((ret2>ret1)?ret2:ret1);\r\n\t\t\t}\r\n\t\t} else if (!Float.isNaN(ret2)) {\r\n\t\t\treturn ret2;\r\n\t\t}\r\n\t\t*/\r\n\t\treturn new ComparisionProbabilityValue(ret1,ret2,true);\r\n\t\t\r\n\t}", "Get<K, C> withColumnRange(C startColumn, C endColumn);", "public void getRequiredColumn() {\n\t\trequiredColumn = sheet.getRow(0).getCell(sheet.getRow(0).getLastCellNum()-1).getColumnIndex();\n\t}", "public double getMinimumDouble() {\n/* 201 */ return this.min;\n/* */ }" ]
[ "0.67389446", "0.61195487", "0.6114629", "0.57450664", "0.5676068", "0.5545834", "0.55404663", "0.55027753", "0.55027753", "0.5472442", "0.54267514", "0.54115736", "0.5409375", "0.53636813", "0.53597057", "0.5352337", "0.52909696", "0.52909696", "0.5234828", "0.52317166", "0.5180102", "0.51683843", "0.5168376", "0.5157515", "0.5128006", "0.5107457", "0.51065445", "0.5106511", "0.509984", "0.5098775", "0.50955755", "0.5092656", "0.50910854", "0.507462", "0.50574505", "0.50415534", "0.50297487", "0.5016059", "0.5009742", "0.50085175", "0.49997583", "0.49879766", "0.49847424", "0.4972716", "0.4965007", "0.49412298", "0.49353328", "0.49203962", "0.49202585", "0.49185723", "0.487859", "0.48464966", "0.4843287", "0.48372674", "0.48290494", "0.48236927", "0.48215374", "0.48006743", "0.4798721", "0.4798275", "0.4789483", "0.47799587", "0.47798878", "0.47796813", "0.47761163", "0.476649", "0.47619027", "0.47592038", "0.47527322", "0.475236", "0.47511303", "0.47509786", "0.4749268", "0.47413588", "0.4735187", "0.4734977", "0.4732916", "0.47321448", "0.47249296", "0.4713044", "0.4707422", "0.47034228", "0.47020635", "0.46997622", "0.4699549", "0.46974733", "0.46902075", "0.46891028", "0.46844223", "0.4684213", "0.46800393", "0.46747273", "0.46726787", "0.4670657", "0.46701083", "0.46616304", "0.46579787", "0.46575144", "0.4656988", "0.46568152" ]
0.4897065
50
Calculates and returns the minimum and maximum values of a particular column in a table.
public AggregateMinMaxResponse aggregateMinMax(String tableName, String columnName, Map<String, String> options) throws GPUdbException { AggregateMinMaxRequest actualRequest_ = new AggregateMinMaxRequest(tableName, columnName, options); AggregateMinMaxResponse actualResponse_ = new AggregateMinMaxResponse(); submitRequest("/aggregate/minmax", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getMinColumn();", "public Double getMaxValueInColumn(String columnName){\r\n\t\t\r\n\t\treturn daoEjercicio.getMaxValueInColumn(columnName);\r\n\t\t\r\n\t}", "public int getMaxColumn();", "private void populateMinMaxTime()\n {\n final ColumnHolder columnHolder = index.getColumnHolder(ColumnHolder.TIME_COLUMN_NAME);\n try (final NumericColumn column = (NumericColumn) columnHolder.getColumn()) {\n this.minTime = DateTimes.utc(column.getLongSingleValueRow(0));\n this.maxTime = DateTimes.utc(column.getLongSingleValueRow(column.length() - 1));\n }\n }", "public int getMinCol() {\n return minCol;\n }", "protected void calcMinMax() {\n }", "double getMin();", "double getMin();", "public int GetMinVal();", "public void normalizeColumn(final int columnIndex) {\r\n double max = Double.NEGATIVE_INFINITY;\r\n double min = Double.POSITIVE_INFINITY;\r\n for (int i = 0; i < this.getRowCount(); i++) {\r\n double val = getLogicalValueAt(i, columnIndex);\r\n if (val > max) {\r\n max = val;\r\n }\r\n if (val < min) {\r\n min = val;\r\n }\r\n }\r\n for (int i = 0; i < this.getRowCount(); i++) {\r\n setLogicalValue(i, columnIndex, (getLogicalValueAt(i, columnIndex) - min)\r\n / (max - min), false);\r\n }\r\n this.fireTableDataChanged();\r\n }", "private int indiceColMin(String tabla[][]){\n int indice=1;\n float aux=-10000;\n for (int j = 1; j <= nVariables; j++) {\n if(Float.parseFloat(tabla[0][j])<0 && Float.parseFloat(tabla[0][j])>aux ){\n aux=Float.parseFloat(tabla[0][j]);\n indice=j;\n }\n }\n return indice;\n }", "public int getMinRow();", "Double getMinimumValue();", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "E minVal();", "double getMax();", "double getMax();", "@Override\n public double[] getMinMax() {\n if ( minMax == null ) {\n calculateMinMaxPositions();\n }\n return minMax;\n }", "public int getMaxRow();", "public double getMinValue() {\n double min = Double.POSITIVE_INFINITY;\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (data[i][j] < min)\n min = data[i][j];\n }\n }\n return min;\n }", "Column getCol();", "Integer calculate(String columnValue);", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "public double getMinDoubleValue();", "public double min() {\n double resultat = Double.MAX_VALUE;\n double tmp = 0;\n for (int i = 0; i < tab.size(); i++) {\n tmp = CalculatorArray.min(tab.get(i));\n if (tmp < resultat) {\n resultat = tmp;\n }\n }\n\n System.out.println(\"Min colonne:\" + resultat);\n return resultat;\n }", "public MaxAndMin(){\n this.list=new ListOfData().getData();\n }", "public double fetchMaxQValue(int row, int col)\n\t\t{\n\t\t\tdouble maxQVal = Integer.MIN_VALUE;\n\t\t\tfor(int i=0; i < ACTION_COUNT; i++)\n\t\t\t{\n\t\t\t\tmaxQVal = Math.max(maxQVal, utilities[i][row][col]);\n\t\t\t}\n\t\t\treturn maxQVal;\n\n\t\t}", "private int indiceColMax(String tabla[][]){\n int indice=1;\n float aux=Float.parseFloat(tabla[0][1]);\n for (int j = 1; j <= nVariables; j++) {\n if(Float.parseFloat(tabla[0][j])<0 && Float.parseFloat(tabla[0][j])<aux){\n aux=Float.parseFloat(tabla[0][j]);\n indice=j;\n }\n }\n return indice;\n }", "public double min(){\r\n\t\t//variable for min val\r\n\t\tdouble min = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the minimum is more than the current index, change min to that value\r\n\t\t\tif (min > this.data[i]){\r\n\t\t\t\tmin = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the minimum val\r\n\t\treturn min;\r\n\t}", "private void findMinandMaxValues(SparklineValues values) {\n minY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).min().orElse(0.0);\n maxY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).max().orElse(0.0);\n\n if (Math.abs(minY) > 1E30 || Math.abs(maxY) > 1E30) {\n // something is probably wrong\n System.out.println(\"Unexpectedly small/large min or max: \");\n values.getValues().forEach(value -> {\n System.out.print(value.getValue() + \" \");\n });\n System.out.println();\n minY = -1.0;\n maxY = 1.0;\n }\n\n if (minY.equals(maxY)) {\n if (minY.equals(0.0)) {\n minY = -1.0;\n maxY = 1.0;\n } else {\n minY = minY - 0.1 * Math.abs(minY);\n maxY = maxY + 0.1 * Math.abs(maxY);\n }\n }\n }", "Double getMaximumValue();", "public void updateMinMax( ) {\r\n if( (data == null) || (data.size() < 1) ) {\r\n min = 0.0;\r\n max = 0.0;\r\n return;\r\n }\r\n\r\n min = data.get( 0 );\r\n max = data.get( 0 );\r\n\r\n for( int i = 1; i < data.size(); i++ ) {\r\n if( min > data.get( i ) )\r\n min = data.get( i );\r\n if( max < data.get( i ) )\r\n max = data.get( i );\r\n }\r\n\r\n }", "int getXMin();", "public int getMinInSingleRow() {\n return minInSingleRow;\n }", "public DynamicPart minMax(float min, float max) {\n return this.min(min).max(max);\n }", "public double getMinimumValue()\n {\n this.minimumValue = getMinNumber(allValues);\n this.maximumValue = getMaxNumber(allValues);\n return minimumValue;\n }", "private int[] getMergedMinMax(SSheet worksheet, int row, int col) {\n\t\tCellRegion merged = worksheet.getMergedRegion(row, col);\n\t\tif (merged == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tint l = merged.getColumn();\n\t\t\tint t = merged.getRow();\n\t\t\tfinal SCell c0 = worksheet.getCell(t, l);\n\t\t\tif (!c0.isNull() && c0.getType() != CellType.BLANK) { // non empty merged cell\n\t\t\t\treturn new int[] {l, t, merged.getLastColumn(), merged.getLastRow()};\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}", "public double get(int min, int max) {\r\n\t\treturn chart[min][max];\r\n\t}", "Object getMinimumValue(Object elementID) throws Exception;", "public Object getValueAt(int row, int col)\n {\n\tif (col==0) {\n\t return smartPrescaleTable.prescaleCondition(row);\n\t} else if (col==1) {\n\t if (smartPrescaleTable.simple(row)) {\n\t\treturn smartPrescaleTable.prescale(row);\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t} else {\n\t if (smartPrescaleTable.simple(row)) {\n\t\tString pathName=smartPrescaleTable.pathName(row);\n\t\tif (smartPrescaleTable.checkHLTPathExists(pathName)) {\n\t\t return smartPrescaleTable.prescale(row)\n\t\t\t*prescaleTable.prescales(pathName).get(col-2);\n\t\t} else {\n\t\t return new Long(-1);\n\t\t}\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t}\n }", "public int getScale(int column) throws SQLException {\n\t\t\treturn 0;\n\t\t}", "public T getMin ();", "private int[] findMinMax(ArrayList<ArrayList<Integer>> objects, int featureNo) {\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\t\n\t\t\tfor(int b = 0; b < objects.size(); b++){\n\t\t\t\t\n\t\t\t\tmax = Math.max(objects.get(b).get(featureNo) , max);\n\t\t\t\tmin = Math.min(objects.get(b).get(featureNo) , min);\n\t\t\t}\n\t\t\t\n\t\t\treturn new int[]{max,min};\n\t\t}", "public void updateFeaturesMinMax() throws DatabaseAccessException {\n\t\tStatement stmt;\n\t\tResultSet rs;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\t\t\trs = stmt.executeQuery(\"SELECT Id FROM Features;\");\n\t\t\tArrayList<Integer> featureIds = new ArrayList<Integer>();\n\t\t\twhile (rs.next()) {\n\t\t\t\tfeatureIds.add(rs.getInt(\"Id\"));\n\t\t\t}\n\t\t\tstmt.close();\n\n\t\t\tfor (Integer id : featureIds) {\n\t\t\t\tstmt = this.connection.createStatement();\n\t\t\t\trs = stmt.executeQuery(\"SELECT MIN(\\\"\" + id + \"\\\"), MAX(\\\"\" + id + \"\\\") FROM Objects;\");\n\t\t\t\tfloat min = rs.getFloat(1);\n\t\t\t\tfloat max = rs.getFloat(2);\n\t\t\t\trs.close();\n\t\t\t\tstmt.close();\n\n\t\t\t\tPreparedStatement prepStmt = this.connection\n\t\t\t\t\t\t.prepareStatement(\"UPDATE Features SET Min=?, Max=? WHERE Id=?\");\n\t\t\t\tprepStmt.setFloat(1, min);\n\t\t\t\tprepStmt.setFloat(2, max);\n\t\t\t\tprepStmt.setInt(3, id);\n\t\t\t\tprepStmt.execute();\n\t\t\t\tprepStmt.close();\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new DatabaseAccessException(Failure.WRITE);\n\t\t}\n\t}", "public int getMaxInSingleRow() {\n return maxInSingleRow;\n }", "protected double getMinDouble() {\r\n boolean handleOutOfMemoryError = false;\r\n double min = Double.POSITIVE_INFINITY;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n double value;\r\n int row;\r\n int col;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n value = getCell(\r\n row,\r\n col);\r\n if (value != noDataValue) {\r\n min = Math.min(\r\n min,\r\n value);\r\n }\r\n }\r\n }\r\n return min;\r\n }", "public static int[] minmax(int[] a)\n {\n \tint[] b= {0,0};\n \tint min=(int)1e9;\n \tint max=(int)-1e9;\n \tfor(int i=0;i<a.length;i++)\n \t{\n \t\tmin=Math.min(min, a[i]);\n \t\tmax=Math.max(max, a[i]);\n \t}\n \tb[0]=min;\n \tb[1]=max;\n \treturn b;\n }", "public abstract int getMinimumValue();", "Expression getMax();", "public AggregateMinMaxResponse aggregateMinMax(AggregateMinMaxRequest request) throws GPUdbException {\n AggregateMinMaxResponse actualResponse_ = new AggregateMinMaxResponse();\n submitRequest(\"/aggregate/minmax\", request, actualResponse_, false);\n return actualResponse_;\n }", "E maxVal();", "@JSProperty(\"minRange\")\n double getMinRange();", "public int getValue(int row, int column);", "public void visitColumn(double val);", "public int GetMaxVal();", "protected IExpressionValue min()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t// Debug.println(\"ANALISING MIN FUNCTION\");\r\n\t\t\r\n\t\tIExpressionValue ret1 = null;\r\n\t\tIExpressionValue ret2 = null;\r\n\t\tmatch('(');\r\n\t\tret1 = this.expression();\r\n//\t\tmatch(';');\r\n\t\tif (look != ';' && look != ',') {\r\n\t\t\texpected(\";\");\r\n\t\t}\r\n\t\tnextChar();\r\n\t\tskipWhite();\r\n\t\tret2 = this.expression();\r\n\t\tmatch(')');\r\n\t\t/*\r\n\t\t// old code: tests which ret1/ret2 to return and test consistency. ComparisionProbabilityValue replaces it.\r\n\t\tif (!Float.isNaN(ret1)) {\r\n\t\t\tif (!Float.isNaN(ret2)) {\r\n\t\t\t\tret1 = ((ret2<ret1)?ret2:ret1);\r\n\t\t\t}\r\n\t\t} else if (!Float.isNaN(ret2)) {\r\n\t\t\treturn ret2;\r\n\t\t}\r\n\t\t*/\r\n\t\treturn new ComparisionProbabilityValue(ret1,ret2,false);\r\n\t\t\r\n\t}", "private static void findLocalMaxOrMin() {\n // Find the integer with no duplicates\n // Priority Queues / Double ended priority queues are efficient O(1) with remove the min / max\n\n Integer[] a = new Integer[]{0,1,2,3,4,5,6,7,8,7,6};\n// int[] a2 = new int[]{5,4,3,2,1,2,3,4};\n\n MinPQ<Integer> minPQ = new MinPQ<Integer>(a);\n\n System.out.print(minPQ.min());\n }", "@Override\n\t\tpublic int getValueColumn() {\n\t\t\treturn valueColumn;\n\t\t}", "float xMin();", "int getMin( int min );", "public static MinMaxContainer getMinMax(int[] mas){\n // functional programming part\n int min = Arrays.stream(mas).min().getAsInt();\n int max = Arrays.stream(mas).max().getAsInt();\n\n MinMaxContainer minMaxContainer = new MinMaxContainer();\n minMaxContainer.max = max;\n minMaxContainer.min = min;\n\n return minMaxContainer;\n }", "Coordinate getMinX();", "Object getMaximumValue(Object elementID) throws Exception;", "@Override public byte[][] getColumnsMinValue() {\n // operation of getting the min value is not supported as its a non leaf\n // node\n // and in case of B+Tree data will be stored only in leaf node and\n // intermediate\n // node will be used only for searching the leaf node\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }", "public void allMinMax() {\n\t\tthis.theMaxX();\n\t\tthis.theMinX();\n\t\tthis.theMaxY();\n\t\tthis.theMinY();\n\t}", "int atColumn();", "public void getSmallInt(String columnName, NullableSmallIntHolder holder) {\n SmallIntVector vector = (SmallIntVector) table.getVector(columnName);\n vector.get(rowNumber, holder);\n }", "@Override\n public Long getMin() {\n return min;\n }", "public double getMinimumValue() { return this.minimumValue; }", "private static int calculations(int[] tab) {\r\n int result; //result of calculations\r\n \r\n //converts array to List interface element\r\n List list = Arrays.asList(ArrayUtils.toObject(tab));\r\n\r\n //calculates min and max value for array\r\n int val1 = (int) Collections.min(list); //min value in array\r\n int val2 = (int) Collections.max(list); //max value in array\r\n \r\n int min_pow2 = (int) Math.pow(val1, 2); //squared power of minimum\r\n int max_pow2 = (int) Math.pow(val2, 2); //squared power of maximum\r\n \r\n result = Math.max(min_pow2, max_pow2); //max of squared values\r\n \r\n return result;\r\n }", "public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }", "private void objectWidth(TableColumn col,int min,int max){\r\n col.setMinWidth(min); //Establece el valor minimo\r\n col.setMaxWidth(max); //Establece el valor maximo\r\n }", "private static double maxOfColumn(double[][] matrix, int col) {\n\t\t// TODO Auto-generated method stub\n\t\tdouble max = 0; \n\t\tfor(int i=0; i<matrix.length; i++){\n\t\t\t\n\t\t\tif(matrix[i][col] > max)\n\t\t\t\tmax = matrix[i][col]; \n\t\t}\n\t\t\n\t\treturn max;\n\t}", "public static double normalizeMapminmax(double num) {\r\n \t\tint MAXsetvaluefaktor = 1;\r\n \t\tint MINsetvaluefaktor = 1;\r\n \r\n \t\tswitch (GAMETYPE) {\r\n \t\tcase SAYISALLOTO: {\r\n \t\t\tif (INPUTVALUETYPE == DIGITAL) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t\tMINsetvaluefaktor = 0;\r\n \t\t\t} else if (INPUTVALUETYPE == RAWVALUE) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMAXSETVALUE49;\r\n \t\t\t\tMINsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tdefault: {\r\n \r\n \t\t}\r\n \t\t}\r\n \r\n \t\tdouble result = ((MAPMAX - MAPMIN) * (num - MINsetvaluefaktor));\r\n \t\tresult = result / (MAXsetvaluefaktor - MINsetvaluefaktor);\r\n \t\tresult = result + MAPMIN;\r\n \t\treturn result;\r\n \t}", "public int getMaxCol() {\n return maxCol;\n }", "public Coord minCell()\n {\n\t int minX = getGrid().keySet().stream().mapToInt(Coord::getX).min().orElse(0);\n\n\t int minY = getGrid().keySet().stream().mapToInt(Coord::getY).min().orElse(0);\n\n\t return new Coord(minX, minY);\n }", "public Point getMin () {\r\n\r\n\treturn getA();\r\n }", "String getValue(String column, int row);", "int getMax();", "int getColumn();", "private double getMin() {\n return min;\n }", "public double getMinValue() {\n\t\tdouble min = Double.POSITIVE_INFINITY;\n\t\tfor (int i = 0; i < dataSheet.getDesignCount(); i++) {\n\t\t\tdouble value = dataSheet.getDesign(i).getDoubleValue(this);\n\t\t\tif (value < min)\n\t\t\t\tmin = value;\n\t\t}\n\t\treturn min;\n\t}", "private double getMin() {\n return Collections.min(values.values());\n }", "@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }", "double getLeft(double min);", "org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();", "public PrimEdge calculateMinimum() {\n int minWage = Integer.MAX_VALUE;\n PrimEdge result = null;\n for (Map.Entry<Integer, PrimEdge> entry : dtable.entrySet()) {\n if (entry.getValue().getWage() < minWage) {\n result = entry.getValue();\n minWage = entry.getValue().getWage();\n }\n }\n return result;\n }", "int minColSizeAboveZero() {\n int min = Integer.MAX_VALUE;\n for (IntSet col : this.cols) {\n if (col.size() > 0 && col.size() < min) {\n min = col.size();\n }\n }\n return min;\n }", "public Integer getMin() {\n\t\tif (this.Minimum==null)\n\t\t{\n\t\t\tcalcMinMax();\n\t\t}\n\t\treturn this.Minimum;\n\t}", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "public IAverage column(String column);", "public static void setColumnWidth(TableColumn column, int min, int max) {\n column.setMinWidth(min);\n column.setMaxWidth(max);\n }", "double getMin() {\n\t\t\treturn value_min;\n\t\t}", "public double get(int row, int column) {\n\t\tif (row >= this.rows || row < 0 || column >= this.columns || column < 0) {\n\t\t\tthrow new IllegalArgumentException(\"Values out of range, requested \" + row + \",\" + column\n\t\t\t\t\t+ \", but matrix is only \" + this.rows + \"x\" + this.columns);\n\t\t}\n\t\treturn matrix[row][column];\n\t}", "private int columnCalculator() {\n\n DisplayMetrics metrics = new DisplayMetrics();\n Objects.requireNonNull(getActivity())\n .getWindowManager()\n .getDefaultDisplay()\n .getMetrics(metrics);\n\n // Width of smallest tablet\n int divider = 600;\n int width = metrics.widthPixels;\n int columns = width / divider;\n if (columns < 2) return 2;\n\n return columns;\n }", "Get<K, C> withColumnRange(C startColumn, C endColumn, int limit);", "protected IExpressionValue max()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t// Debug.println(\"ANALISING MAX FUNCTION\");\r\n\t\t\r\n\t\tIExpressionValue ret1 = null;\r\n\t\tIExpressionValue ret2 = null;\r\n\t\tmatch('(');\r\n\t\tret1 = this.expression();\r\n//\t\tmatch(';');\r\n\t\tif (look != ';' && look != ',') {\r\n\t\t\texpected(\";\");\r\n\t\t}\r\n\t\tnextChar();\r\n\t\tskipWhite();\r\n\t\tret2 = this.expression();\r\n\t\tmatch(')');\r\n\t\t/*\r\n\t\t// old code: tests which ret1/ret2 to return and test consistency. ComparisionProbabilityValue replaces it.\r\n\t\tif (!Float.isNaN(ret1)) {\r\n\t\t\tif (!Float.isNaN(ret2)) {\r\n\t\t\t\tret1 = ((ret2>ret1)?ret2:ret1);\r\n\t\t\t}\r\n\t\t} else if (!Float.isNaN(ret2)) {\r\n\t\t\treturn ret2;\r\n\t\t}\r\n\t\t*/\r\n\t\treturn new ComparisionProbabilityValue(ret1,ret2,true);\r\n\t\t\r\n\t}", "Get<K, C> withColumnRange(C startColumn, C endColumn);", "public void getRequiredColumn() {\n\t\trequiredColumn = sheet.getRow(0).getCell(sheet.getRow(0).getLastCellNum()-1).getColumnIndex();\n\t}", "public double getMinimumDouble() {\n/* 201 */ return this.min;\n/* */ }" ]
[ "0.67389446", "0.61195487", "0.6114629", "0.5676068", "0.5545834", "0.55404663", "0.55027753", "0.55027753", "0.5472442", "0.54267514", "0.54115736", "0.5409375", "0.53636813", "0.53597057", "0.5352337", "0.52909696", "0.52909696", "0.5234828", "0.52317166", "0.5180102", "0.51683843", "0.5168376", "0.5157515", "0.5128006", "0.5107457", "0.51065445", "0.5106511", "0.509984", "0.5098775", "0.50955755", "0.5092656", "0.50910854", "0.507462", "0.50574505", "0.50415534", "0.50297487", "0.5016059", "0.5009742", "0.50085175", "0.49997583", "0.49879766", "0.49847424", "0.4972716", "0.4965007", "0.49412298", "0.49353328", "0.49203962", "0.49202585", "0.49185723", "0.4897065", "0.487859", "0.48464966", "0.4843287", "0.48372674", "0.48290494", "0.48236927", "0.48215374", "0.48006743", "0.4798721", "0.4798275", "0.4789483", "0.47799587", "0.47798878", "0.47796813", "0.47761163", "0.476649", "0.47619027", "0.47592038", "0.47527322", "0.475236", "0.47511303", "0.47509786", "0.4749268", "0.47413588", "0.4735187", "0.4734977", "0.4732916", "0.47321448", "0.47249296", "0.4713044", "0.4707422", "0.47034228", "0.47020635", "0.46997622", "0.4699549", "0.46974733", "0.46902075", "0.46891028", "0.46844223", "0.4684213", "0.46800393", "0.46747273", "0.46726787", "0.4670657", "0.46701083", "0.46616304", "0.46579787", "0.46575144", "0.4656988", "0.46568152" ]
0.57450664
3
Updates (adds or changes) metadata for tables. The metadata key and values must both be strings. This is an easy way to annotate whole tables rather than single records within tables. Some examples of metadata are owner of the table, table creation timestamp etc.
public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException { AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse(); submitRequest("/alter/table/metadata", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "<K, C> void declareTable(TableMetadata<K, C> metadata);", "public AlterTableMetadataResponse alterTableMetadata(List<String> tableNames, Map<String, String> metadataMap, Map<String, String> options) throws GPUdbException {\n AlterTableMetadataRequest actualRequest_ = new AlterTableMetadataRequest(tableNames, metadataMap, options);\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "void setMetaLocal(Map<Integer, String> newMetaTable);", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {\n/* 787 */ this.server.getEntityMetadata().setMetadata(this, metadataKey, newMetadataValue);\n/* */ }", "<K, C> TableMetadata<K, C> getTableMetadata(TableName tableName);", "<E extends CtElement> E putMetadata(String key, Object val);", "public void setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void setMetadata ( String metadataKey , MetadataValue newMetadataValue ) {\n\t\texecute ( handle -> handle.setMetadata ( metadataKey , newMetadataValue ) );\n\t}", "<E extends CtElement> E setAllMetadata(Map<String, Object> metadata);", "public void setMetaData(MetaData newMetaData);", "@Override\n public void createMetaTable(Connection conn) throws PersistenceException {\n String sql = String.format(\"CREATE TABLE %1$s (%2$s %3$s NOT NULL)\", metaTableName, META_TABLE_DATA_COLUMN, config.dataColumnType());\n executeUpdateSql(conn, sql);\n updateMetaTable(conn);\n }", "@PublicAtsApi\n public void setBlobMetadata( String containerName, String blobName, Map<String, String> newMetadata,\n boolean overwriteExistingKeys, boolean includeOldMetadata, String valueDelimiter ) {\n\n try {\n log.info(\"Setting metadata for blob '\" + blobName + \"' from container '\" + containerName + \"' ...\");\n\n Map<String, String> metadataToBeSent = new HashMap<String, String>();\n if (includeOldMetadata) {\n // keep the old metadata\n metadataToBeSent.putAll(this.getBlobInfo(containerName, blobName).getMetadata());\n }\n\n if (overwriteExistingKeys) {\n // overwrite the old metadata where appropriate\n metadataToBeSent.putAll(newMetadata);\n } else {\n // we should append the new values where appropriate\n // traverse only the keys, where overwrite is possible \n for (String key : metadataToBeSent.keySet()) {\n if (newMetadata.containsKey(key)) {\n String oldValue = metadataToBeSent.get(key);\n String newValue = newMetadata.get(key);\n metadataToBeSent.put(key, oldValue + valueDelimiter + newValue);\n }\n }\n\n for (String key : newMetadata.keySet()) {\n if (!metadataToBeSent.containsKey(key)) {\n // set only keys that will not overwrite anything in the old metadata\n metadataToBeSent.put(key, newMetadata.get(key));\n }\n\n }\n }\n\n serviceClient.getBlobContainerClient(containerName).getBlobClient(blobName).setMetadata(metadataToBeSent);\n\n log.info(\"Successfully set metadata for blob '\" + blobName + \"' from container '\" + containerName\n + \"' ...\");\n } catch (Exception e) {\n throw new AtsBlobStorageException(\"Could not set metadata for blob '\" + blobName + \"' in container '\"\n + containerName + \"'\", e);\n }\n\n }", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "public void acceptMetadata( StarTable meta ) {\n int ncol = meta.getColumnCount();\n for ( int i = 0; i < ncol; i++ ) {\n colMap_.put( meta.getColumnInfo( i ).getName().toLowerCase(),\n i );\n }\n }", "public void registerTableMeta(String paramString, SnmpMibTable paramSnmpMibTable) {\n/* 656 */ if (this.metadatas == null)\n/* 657 */ return; if (paramString == null)\n/* 658 */ return; this.metadatas.put(paramString, paramSnmpMibTable);\n/* */ }", "protected abstract IItemMetadata newItemMetadata(Map<String, String> metadata);", "@PUT\n @Path(\"{metadataId}\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @Permissions({ @Permission(value = RolePermission.APPLICATION_METADATA, acls = RolePermissionAction.UPDATE) })\n public Response updateApplicationMetadataByApplicationIdAndMetadataId(\n @PathParam(\"applicationId\") String applicationId,\n @PathParam(\"metadataId\") String metadataId,\n @Valid @NotNull final ReferenceMetadataInput metadata\n ) {\n UpdateApplicationMetadataEntity updateApplicationMetadataEntity =\n this.referenceMetadataMapper.convert(metadata, applicationId, metadataId);\n\n return Response\n .ok(\n this.referenceMetadataMapper.convert(\n metadataService.update(GraviteeContext.getExecutionContext(), updateApplicationMetadataEntity)\n )\n )\n .build();\n }", "public interface Metadata<I extends MetadataInfo> {\n\n /** Metadata types */\n public enum MetadataType {\n /* New types must be added to the end of this list */\n TOPOLOGY() {\n @Override\n public String getKey() { return \"Topology\";}\n },\n TABLE() {\n @Override\n public String getKey() { return \"Table\";}\n },\n SECURITY() {\n @Override\n public String getKey() { return \"Security\";}\n };\n\n /**\n * Gets a unique string for this type. This string may be used as a\n * key into a metadata store.\n *\n * @return a unique string\n */\n abstract public String getKey();\n }\n\n /* The sequence number of an newly created metadata, empty object */\n public static final int EMPTY_SEQUENCE_NUMBER = 0;\n\n /**\n * Gets the type of this metadata object.\n *\n * @return the type of this metadata object\n */\n public MetadataType getType();\n\n /**\n * Gets the highest sequence number of this metadata object.\n * Returns -1 if the metadata has not been initialized.\n *\n * @return the highest sequence number of this metadata object\n */\n public int getSequenceNumber();\n\n /**\n * Gets an information object for this metadata. The returned object will\n * include the changes between this object and the metadata at the\n * specified sequence number. If the metadata object can not supply\n * information based on the sequence number an empty metadata information\n * object is returned.\n *\n * @param startSeqNum the inclusive start of the sequence of\n * changes to be included\n * @return a metadata info object\n */\n public I getChangeInfo(int startSeqNum);\n}", "void modifyMetadata(MetadataID mid, CellID cid, Metadata metadata){\n db.removeMetadata(mid);\n db.addMetadata(cid, metadata);\n metadataModification(cid, metadata);\n }", "public Builder putAllMetadata(\n java.util.Map<java.lang.String, java.lang.String> values) {\n internalGetMutableMetadata().getMutableMap()\n .putAll(values);\n return this;\n }", "public Builder putAllMetadata(\n java.util.Map<java.lang.String, java.lang.String> values) {\n internalGetMutableMetadata().getMutableMap()\n .putAll(values);\n return this;\n }", "void addNodeMetadata(int node, String key, String value);", "void setMetadataValue(String name, String value) throws IOException;", "public void addEntityMetadata() throws Exception {\n\n\t\tEntityMetadata entity = new EntityMetadata(entityType, false);\n\t\tentity.setRepositoryInstance(\"OperationalDB\");\n\t\tentity.setProviderType(\"RDBMSDataProvider\");\n\n\t\tMap<String, List<String>> providerParams = new HashMap<String, List<String>>();\n\t\tproviderParams.put(\"table\",\n\t\t\t\tArrays.asList(new String[] { \"APPLICATION_OBJECT\" }));\n\t\tproviderParams.put(\"id_column\", Arrays.asList(new String[] { \"ID\" }));\n\t\tproviderParams.put(\"id_type\", Arrays.asList(new String[] { \"guid\" }));\n\t\tproviderParams.put(\"optimistic_locking\",\n\t\t\t\tArrays.asList(new String[] { \"false\" }));\n\t\tproviderParams.put(\"flex_searchable_string_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_VC\" }));\n\t\tproviderParams.put(\"flex_non_searchable_string_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_VC\" }));\n\t\tproviderParams.put(\"flex_searchable_date_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_DT\" }));\n\t\tproviderParams.put(\"flex_non_searchable_date_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_DT\" }));\n\t\tproviderParams.put(\"flex_searchable_number_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_NUM\" }));\n\t\tproviderParams.put(\"flex_non_searchable_number_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_NUM\" }));\n\t\tproviderParams.put(\"flex_blob_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_BLOB\" }));\n\n\t\tentity.setProviderParameters(providerParams);\n\t\tentity.setContainer(false);\n\n\t\tHashMap<String, Map<String, String>> metadataAttachments = new HashMap<String, Map<String, String>>();\n\t\tMap<String, String> prop = new HashMap<String, String>();\n\t\tprop.put(\"isEncrypted\", \"false\");\n\t\tmetadataAttachments.put(\"properties\", prop);\n\t\tAttributeDefinition attrDef = null;\n\t\tFieldDefinition fieldDef = null;\n\n\t\t// parameters: name, type, description, isRequired, isSearchable, isMLS,\n\t\t// defaultValue, groupName, metadataAttachments\n\n\t\tattrDef = new AttributeDefinition(\"givenName\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"lastName\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"email\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"startDate\", \"date\", null, false,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"endDate\", \"date\", null, false,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"employeeNo\", \"number\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\n\n\t\tattrDef = new AttributeDefinition(\"__UID__\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\tfieldDef = new FieldDefinition(\"AO_UID\", \"string\",true);\n\t\tentity.addField(fieldDef);\n\t\tentity.addAttributeMapping(\"__UID__\", \"AO_UID\");\n\t\t\n\t\tattrDef = new AttributeDefinition(\"__NAME__\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\tfieldDef = new FieldDefinition(\"AO_NAME\", \"string\",true);\n\t\tentity.addField(fieldDef);\n\t\tentity.addAttributeMapping(\"__NAME__\", \"AO_NAME\");\n\n\t\t/*\n\t\t * attrDef = new AttributeDefinition(childEntityType, childEntityType,\n\t\t * null, false, true, false, null, \"Basic\", metadataAttachments);\n\t\t * entity.addChildEntityAttribute(attrDef);\n\t\t */\n\n\t\tString xmlString = getStringfromDoc(entity);\n\n\t\ttry {\n\t\t\tmgrConfig.createEntityMetadata(entity);\n\t\t\tSystem.out.println(\"Created entity type: \" + entityType);\n\n\t\t} catch (Exception e) {\n\t\t\t//fail(\"Unexpected exception: \" + getStackTrace(e));\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void setMetaData(AdvResultSetMetaData metadata, String newAlias) {\n\t\t\t\tif (containedColumns != null) {\n\t\t\t\t\tfor (Column col : containedColumns) {\n\t\t\t\t\t\tcol.setMetaData(metadata, newAlias);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// set metadata for IF-predicate\n\t\t\t\tIF.setMetaData(metadata, newAlias);\n\t\t\t\t\n\t\t\t\tClass<?> thenType; \n\t\t\t\tClass<?> elseType;\n\t\t\t\ttry {\n\t\t\t\t\tthenType = Class.forName(THEN.columnMetaData.getColumnClassName());\n\t\t\t\t\telseType = Class.forName(ELSE.columnMetaData.getColumnClassName());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tif(noName)\n\t\t\t\t\t\tthrow new RuntimeException(\"Error while setting metadata for IfThenElse: \"\n\t\t\t\t\t\t\t\t+e.getMessage(), e);\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(\"Error while setting metadata for IfThenElse \\\"\"\n\t\t\t\t\t\t\t\t+columnName+\"\\\": \"+e.getMessage(), e);\n\t\t\t\t} \n\t\t\t\tClass<?> cl = getCommonType(thenType, elseType);\n\t\t\t\tcolumnMetaData = AdvResultSetMetaData.createColumnMetaData(cl, columnName, newAlias);\n\t\t\t}", "protected void addMetadataFieldsFromParameters() {\n for (Map.Entry<String, String> e: parameters.entrySet()) {\n if (e.getKey().startsWith(\"meta-\")) {\n String fieldName = e.getKey().substring(5);\n String fieldValue = e.getValue();\n currentDoc.addTextualMetadataField(fieldName, fieldValue, getDocWriter().metadataFieldType(false));\n }\n }\n }", "public ShowTableMetadataResponse showTableMetadata(List<String> tableNames, Map<String, String> options) throws GPUdbException {\n ShowTableMetadataRequest actualRequest_ = new ShowTableMetadataRequest(tableNames, options);\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void setMetaData(HashMap pMetaData) ;", "Map<String, Object> getAllMetadata();", "public void setMetadata(PDMetadata meta) {\n/* 557 */ this.stream.setItem(COSName.METADATA, meta);\n/* */ }", "@JsonSetter(\"metadata\")\n public void setMetadata (Object value) {\n this.metadata = value;\n }", "void addMetadata(CellID cid, Metadata metadata){\n db.addMetadata(cid, metadata);\n metadataModification(cid, metadata);\n }", "private void addMetadataByString(Metadata metadata, String name, String value) {\n if (value != null) {\n metadata.add(name, value);\n }\n }", "@Override\n public void addMetadata(final OAtomicOperationMetadata<?> metadata) {\n this.metadata.put(metadata.getKey(), metadata);\n }", "public void setMetadata(RavenJObject metadata) {\n this.metadata = metadata;\n }", "@Test\n public void testChangeMetadata() {\n metaDataProcessor.editMetaData(1, \"color\", \"red\");\n assertTrue(CommandController.getInstance().getCommandQ().poll() instanceof EditUserMetaCommand);\n }", "<KEY extends MetadataKey<VALUE>, VALUE> void setMetadata(Class<KEY> keyClass,\n VALUE metadata) throws IllegalArgumentException;", "public abstract Object getMetadata(String key);", "public void setMetaData(MetaData metaData) {\n this.metaData = metaData;\n }", "@Test\n public void testChangeMetadataMap() {\n HashMap<String, String> map = new HashMap<>();\n map.put(\"color\", \"red\");\n map.put(\"r\", \"2\");\n metaDataProcessor.editMetaData(1, map);\n assertTrue(CommandController.getInstance().getCommandQ().poll() instanceof CommandComposite);\n }", "public interface ImageMetadata extends Named, HasMetaTable {\n\n\t/** Sets width (in pixels) of thumbnail planes in this image. */\n\tvoid setThumbSizeX(long thumbSizeX);\n\n\t/** Sets height (in pixels) of thumbnail planes in this image. */\n\tvoid setThumbSizeY(long thumbSizeY);\n\n\t/**\n\t * Sets the data type associated with a pixel. Valid pixel type constants\n\t * (e.g., {@link FormatTools#INT8}) are enumerated in {@link FormatTools}.\n\t */\n\tvoid setPixelType(int pixelType);\n\n\t/** Sets the number of valid bits per pixel. */\n\tvoid setBitsPerPixel(int bitsPerPixel);\n\n\t/**\n\t * Sets whether or not we are confident that the dimension order is correct.\n\t */\n\tvoid setOrderCertain(boolean orderCertain);\n\n\t/** Sets whether or not each pixel's bytes are in little endian order. */\n\tvoid setLittleEndian(boolean littleEndian);\n\n\t/**\n\t * Sets whether or not the planes are stored as indexed color. An indexed\n\t * color image treats each pixel value as an index into a color table\n\t * containing one or more (typically 3) actual values for the pixel.\n\t */\n\tvoid setIndexed(boolean indexed);\n\n\t/**\n\t * Sets the number of planar axes in this image. This value represents the\n\t * number of dimensional axes constituting each {@link Plane} (as returned by\n\t * the {@link Reader#openPlane} methods). This value is necessary to determine\n\t * the total plane count for an N-dimensional image, as well as how many\n\t * pixels there are per plane.\n\t * <p>\n\t * For example, suppose we have a 4-dimensional image with axes (X, Y, Z, T)\n\t * and extents (768, 512, 7, 13). If there are two planar axes, then each\n\t * plane is 768 x 512 and there are 7 x 13 = 91 total planes. But if we have\n\t * three planar axes, then each plane is 768 x 512 x 7 and there are 13 total\n\t * planes.\n\t * </p>\n\t *\n\t * @see Reader#openPlane(int, long)\n\t */\n\tvoid setPlanarAxisCount(final int count);\n\n\t/**\n\t * Sets the number of interleaved axes in this image. This must be a value\n\t * between [0, planarAxisCount). Interleaved axes are planar axes that do not\n\t * constitute the \"canonical\" axes - e.g., in a CXY image with an interleaved\n\t * axis count of 1, the C axis is interleaved, and each plane is an XY plane\n\t * with C different representations.\n\t */\n\tvoid setInterleavedAxisCount(final int count);\n\n\t/** Sets whether or not we can ignore the color map (if present). */\n\tvoid setFalseColor(boolean falseColor);\n\n\t/**\n\t * Sets whether or not we are confident that all of the metadata stored within\n\t * the image has been parsed.\n\t */\n\tvoid setMetadataComplete(boolean metadataComplete);\n\n\t/**\n\t * Sets whether or not this image is a lower-resolution copy of another image.\n\t */\n\tvoid setThumbnail(boolean thumbnail);\n\n\t/**\n\t * Convenience method to set both the axis types and lengths for this\n\t * ImageMetadata.\n\t */\n\tvoid setAxes(CalibratedAxis[] axes, long[] axisLengths);\n\n\t/**\n\t * Sets the Axes types for this image. Order is implied by ordering within\n\t * this array\n\t */\n\tvoid setAxisTypes(AxisType... axisTypes);\n\n\t/**\n\t * Sets the Axes types for this image. Order is implied by ordering within\n\t * this array\n\t */\n\tvoid setAxes(CalibratedAxis... axes);\n\n\t/**\n\t * Sets the lengths of each axis. Order is parallel of {@code axes}.\n\t * <p>\n\t * NB: axes must already exist for this method to be called. Use\n\t * {@link #setAxes(CalibratedAxis[])} or {@link #setAxes}\n\t */\n\tvoid setAxisLengths(long[] axisLengths);\n\n\t/**\n\t * Sets the length for the specified axis. Adds the axis if if its type is not\n\t * already present in the image.\n\t */\n\tvoid setAxisLength(CalibratedAxis axis, long length);\n\n\t/**\n\t * As {@link #setAxisLength(CalibratedAxis, long)} but requires only the\n\t * AxisType.\n\t */\n\tvoid setAxisLength(AxisType axis, long length);\n\n\t/**\n\t * Sets the axis at the specified index, if an axis with a matching type is\n\t * not already defined. Otherwise the axes are re-ordered, per\n\t * {@link java.util.List#add(int, Object)}.\n\t */\n\tvoid setAxis(int index, CalibratedAxis axis);\n\n\t/**\n\t * As {@link #setAxis(int, CalibratedAxis)} but using the default calibration\n\t * values, per {@link FormatTools#createAxis(AxisType)}.\n\t */\n\tvoid setAxisType(int index, AxisType axis);\n\n\t// TODO: Consider typing rois and tables on more specific data structures.\n\n\t/** Sets the ROIs associated with this image. */\n\tvoid setROIs(Object rois);\n\n\t/** Sets the tables associated with this image. */\n\tvoid setTables(Object tables);\n\n\t/** Returns the size, in bytes, of all planes in this image. */\n\tlong getSize();\n\n\t/** Returns the size, in bytes, of one plane in this image. */\n\tlong getPlaneSize();\n\n\t/** Returns the width (in pixels) of the thumbnail planes in this image. */\n\tlong getThumbSizeX();\n\n\t/** Returns the height (in pixels) of the thumbnail planes in this image. */\n\tlong getThumbSizeY();\n\n\t/**\n\t * Returns the CalibratedAxis associated with the given type. Useful to\n\t * retrieve calibration information.\n\t */\n\tCalibratedAxis getAxis(AxisType axisType);\n\n\t/**\n\t * Returns the data type associated with a pixel. Valid pixel type constants\n\t * (e.g., {@link FormatTools#INT8}) are enumerated in {@link FormatTools}.\n\t */\n\tint getPixelType();\n\n\t/** Returns the number of valid bits per pixel. */\n\tint getBitsPerPixel();\n\n\t/**\n\t * Returns true if we are confident that the dimension order is correct.\n\t */\n\tboolean isOrderCertain();\n\n\t/** Returns true if each pixel's bytes are in little endian order. */\n\tboolean isLittleEndian();\n\n\t/** Returns true if the planes are stored as indexed color. */\n\tboolean isIndexed();\n\n\t/** Returns the number of planar axes in this image. */\n\tint getPlanarAxisCount();\n\n\t/**\n\t * Returns the number of interleaved axes in this image.\n\t */\n\tint getInterleavedAxisCount();\n\n\t/** Returns true if the {@link Axes#CHANNEL} axis is a planar axis. */\n\tboolean isMultichannel();\n\n\t/** Returns true if we can ignore the color map (if present). */\n\tboolean isFalseColor();\n\n\t/**\n\t * Returns true if we are confident that all of the metadata stored within the\n\t * image has been parsed.\n\t */\n\tboolean isMetadataComplete();\n\n\t/**\n\t * Determines whether or not this image is a lower-resolution copy of another\n\t * image.\n\t *\n\t * @return true if this image is a thumbnail\n\t */\n\tboolean isThumbnail();\n\n\t/**\n\t * Gets the axis of the (zero-indexed) specified plane.\n\t *\n\t * @param axisIndex - index of the desired axis within this image\n\t * @return Type of the desired plane.\n\t */\n\tCalibratedAxis getAxis(final int axisIndex);\n\n\t/**\n\t * Gets the length of the (zero-indexed) specified plane.\n\t *\n\t * @param axisIndex - index of the desired axis within this image\n\t * @return Length of the desired axis, or 1 if the axis is not found.\n\t */\n\tlong getAxisLength(final int axisIndex);\n\n\t/**\n\t * A convenience method for looking up the length of an axis based on its\n\t * type. No knowledge of plane ordering is necessary.\n\t *\n\t * @param t - CalibratedAxis to look up\n\t * @return Length of axis t, or 1 if the axis is not found.\n\t */\n\tlong getAxisLength(final CalibratedAxis t);\n\n\t/**\n\t * As {@link #getAxisLength(CalibratedAxis)} but only requires the\n\t * {@link AxisType} of the desired axis.\n\t *\n\t * @param t - CalibratedAxis to look up\n\t * @return Length of axis t, or 1 if the axis is not found.\n\t */\n\tlong getAxisLength(final AxisType t);\n\n\t/**\n\t * Returns the array index for the specified CalibratedAxis. This index can be\n\t * used in other Axes methods for looking up lengths, etc...\n\t * <p>\n\t * This method can also be used as an existence check for the target\n\t * CalibratedAxis.\n\t * </p>\n\t *\n\t * @param axis - axis to look up\n\t * @return The index of the desired axis or -1 if not found.\n\t */\n\tint getAxisIndex(final CalibratedAxis axis);\n\n\t/**\n\t * As {@link #getAxisIndex(CalibratedAxis)} but only requires the\n\t * {@link AxisType} of the desired axis.\n\t *\n\t * @param axisType - axis type to look up\n\t * @return The index of the desired axis or -1 if not found.\n\t */\n\tint getAxisIndex(final AxisType axisType);\n\n\t/**\n\t * Returns an array of the types for axes associated with the specified image\n\t * index. Order is consistent with the axis length (int) array returned by\n\t * {@link #getAxesLengths()}.\n\t * <p>\n\t * CalibratedAxis order is sorted and represents order within the image.\n\t * </p>\n\t *\n\t * @return List of CalibratedAxes. Ordering in the list indicates the axis\n\t * order in the image.\n\t */\n\tList<CalibratedAxis> getAxes();\n\n\t/**\n\t * Returns an array of the CalibratedAxis that, together, define the bounds of a\n\t * single plane in the dataset.\n\t *\n\t * @return List of CalibratedAxes. Ordering in the list indicates the axis\n\t * order in the image.\n\t */\n\tList<CalibratedAxis> getAxesPlanar();\n\n\t/**\n\t * Returns an array of the CalibratedAxis that define the number of planes in the\n\t * dataset.\n\t *\n\t * @return List of CalibratedAxes. Ordering in the list indicates the axis\n\t * order in the image.\n\t */\n\tList<CalibratedAxis> getAxesNonPlanar();\n\n\t/**\n\t * @return the number of planes in this image\n\t */\n\tlong getPlaneCount();\n\n\t/**\n\t * Returns an array of the lengths for axes associated with the specified\n\t * image index.\n\t * <p>\n\t * Ordering is consistent with the CalibratedAxis array returned by\n\t * {@link #getAxes()}.\n\t * </p>\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengths();\n\n\t/**\n\t * Returns an array of the lengths for axes in the provided CalibratedAxis list.\n\t * <p>\n\t * Ordering of the lengths is consistent with the provided ordering.\n\t * </p>\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengths(final List<CalibratedAxis> axes);\n\n\t/**\n\t * Returns an array of the lengths for the planar axes in this image.\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengthsPlanar();\n\n\t/**\n\t * Returns an array of the lengths for the non-planar axes in this image.\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengthsNonPlanar();\n\n\t// TODO: Consider typing rois and tables on more specific data structures.\n\n\t/** Retrieves the ROIs associated with this image. */\n\tObject getROIs();\n\n\t/** Retrieves the tables associated with this image. */\n\tObject getTables();\n\n\t/**\n\t * Appends the provided {@link CalibratedAxis} to the metadata's list of axes,\n\t * with a length of 1.\n\t *\n\t * @param axis - The new axis\n\t */\n\tvoid addAxis(final CalibratedAxis axis);\n\n\t/**\n\t * Appends the provided CalibratedAxis to the current CalibratedAxis array and\n\t * creates a corresponding entry with the specified value in axis lengths.\n\t *\n\t * @param axis - The new axis\n\t * @param value - length of the new axis\n\t */\n\tvoid addAxis(final CalibratedAxis axis, final long value);\n\n\t/**\n\t * As {@link #addAxis(CalibratedAxis, long)} using the default calibration\n\t * value, per {@link FormatTools#createAxis(AxisType)}.\n\t */\n\tvoid addAxis(final AxisType axisType, final long value);\n\n\t/**\n\t * @return A new copy of this ImageMetadata.\n\t */\n\tImageMetadata copy();\n\n\t/**\n\t * Populates this ImageMetadata using the provided instance.\n\t *\n\t * @param toCopy - ImageMetadata to copy\n\t */\n\tvoid copy(ImageMetadata toCopy);\n\n\t/**\n\t * As\n\t * {@link #populate(String, List, long[], int, boolean, boolean, boolean, boolean, boolean)}\n\t * but automatically determines bits per pixel.\n\t */\n\tvoid populate(String name, List<CalibratedAxis> axes, long[] lengths,\n\t\tint pixelType, boolean orderCertain, boolean littleEndian, boolean indexed,\n\t\tboolean falseColor, boolean metadataComplete);\n\n\t/**\n\t * Convenience method for manually populating an ImageMetadata.\n\t */\n\tvoid populate(String name, List<CalibratedAxis> axes, long[] lengths,\n\t\tint pixelType, int bitsPerPixel, boolean orderCertain, boolean littleEndian,\n\t\tboolean indexed, boolean falseColor, boolean metadataComplete);\n}", "void addMetaData(MetaDataDescriptor mdd);", "Metadata getMetaData();", "protected void setMetadata(AbstractMetadata metadata) {\n\t\tthis.metadata = metadata;\n\t}", "public abstract List<ColumnSpecification> metadata();", "Object getMetadata(String key);", "public void updateColumnsFromTap(String fullTableName, Map<String, ColumnConfig> configs);", "public void setMeta(Object aKey, Object aValue) {\n if (iIdentificationsMetaData == null) {\n iIdentificationsMetaData = new HashMap();\n }\n iIdentificationsMetaData.put(aKey, aValue);\n }", "private void addMetadataByProperty(Metadata metadata, Property property, String value) {\n if (value != null) {\n metadata.set(property, value);\n }\n }", "public Builder putMetadata(\n java.lang.String key,\n java.lang.String value) {\n if (key == null) { throw new java.lang.NullPointerException(); }\n if (value == null) { throw new java.lang.NullPointerException(); }\n internalGetMutableMetadata().getMutableMap()\n .put(key, value);\n return this;\n }", "public Builder putMetadata(\n java.lang.String key,\n java.lang.String value) {\n if (key == null) { throw new java.lang.NullPointerException(); }\n if (value == null) { throw new java.lang.NullPointerException(); }\n internalGetMutableMetadata().getMutableMap()\n .put(key, value);\n return this;\n }", "public AbstractJob addMetaData(String key, String value) {\n this.mMetaDataAttributes.add(new MetaData(key, value));\n return this;\n }", "public void defineMetadataTypes(Properties properties) throws ThinklabException {\r\n\t\t\r\n\t\tfor (Object p : properties.keySet()) {\r\n\t\t\t\r\n\t\t\tif (p.toString().startsWith(KBOX_METADATA_PREFIX)) {\r\n\t\t\t\tString cid = properties.getProperty(p.toString());\r\n\t\t\t\t\r\n\t\t\t\tString[] ss = p.toString().split(\"\\\\.\");\r\n\t\t\t\tString metadataName = ss[ss.length - 1];\r\n\t\t\t\t\r\n\t\t\t\tIConcept cc = KnowledgeManager.get().requireConcept(cid);\r\n\t\t\t\tmetadataTypes.put(metadataName, cc);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected Boolean updateSystemMetadata(SystemMetadata sysMeta, Map<String, String> tableMap)\n throws DataAccessException {\n\n Boolean updated = new Boolean(false);\n\n // Is the pid valid? (required)\n final Identifier pid = sysMeta.getIdentifier();\n if (pid.getValue() == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\",\n \"Identifier cannot be null\"));\n\n }\n\n // Is the size set? (required)\n final BigInteger size = sysMeta.getSize();\n if (size == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\", \"Size cannot be null\"));\n\n }\n\n // Is the checksum set? (required)\n final Checksum checksum = sysMeta.getChecksum();\n if (checksum == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\",\n \"Checksum cannot be null\"));\n\n }\n\n final SystemMetadata finalSysMeta = sysMeta;\n final String sysMetaTable = tableMap.get(SYSMETA_TABLE);\n final String smReplPolicyTable = tableMap.get(SM_POLICY_TABLE);\n final String smReplStatusTable = tableMap.get(SM_STATUS_TABLE);\n final String xmlAccessTable = tableMap.get(ACCESS_TABLE);\n\n updated = txTemplate.execute(new TransactionCallback<Boolean>() {\n\n @Override\n public Boolean doInTransaction(TransactionStatus status) {\n\n boolean success = false;\n // update the system metadata table\n String sqlStatement = getSysMetaUpdateStatement(sysMetaTable);\n Map<String, Object> sysMetaMap = extractSystemMetadataAttrs(finalSysMeta,\n sysMetaTable);\n Object[] values = getSysMetaAttrValues(sysMetaMap);\n int[] types = getSysMetaAttrTypes();\n int sysMetaRows = jdbcTemplate.update(sqlStatement, values, types);\n if (sysMetaRows == 1) {\n success = true;\n }\n\n // Update the smreplicationpolicy table\n ReplicationPolicy replPolicy = finalSysMeta.getReplicationPolicy();\n int totalReplPolicies = 0;\n int updatedReplPolicies = 0;\n\n if (replPolicy != null) {\n List<NodeReference> preferredNodes = replPolicy.getPreferredMemberNodeList();\n List<NodeReference> blockedNodes = replPolicy.getBlockedMemberNodeList();\n\n // first remove listed policy entries\n if (preferredNodes != null || blockedNodes != null) {\n jdbcTemplate.update(\"DELETE FROM \" + smReplPolicyTable + \" WHERE guid = ?\",\n new Object[] { pid.getValue() });\n }\n\n // count the number of total policies needed to be updated\n if (preferredNodes != null) {\n totalReplPolicies = totalReplPolicies + preferredNodes.size();\n\n // then update the preferred entries\n for (NodeReference preferredNode : preferredNodes) {\n String preferredNodeStr = preferredNode.getValue();\n int preferredRows = jdbcTemplate.update(\"INSERT INTO \"\n + smReplPolicyTable\n + \" (guid, member_node, policy) VALUES (?, ?, ?);\",\n new Object[] { pid.getValue(), preferredNodeStr, \"preferred\" },\n new int[] { java.sql.Types.LONGVARCHAR, java.sql.Types.VARCHAR,\n java.sql.Types.VARCHAR });\n updatedReplPolicies += preferredRows;\n }\n\n }\n\n if (blockedNodes != null) {\n totalReplPolicies = totalReplPolicies + blockedNodes.size();\n\n // then update the blocked entries\n for (NodeReference blockedNode : blockedNodes) {\n int blockedRows = jdbcTemplate.update(\"INSERT INTO \"\n + smReplPolicyTable\n + \" (guid, member_node, policy) VALUES (?, ?, ?);\",\n new Object[] { pid.getValue(), blockedNode.getValue(),\n \"blocked\" }, new int[] { java.sql.Types.LONGVARCHAR,\n java.sql.Types.VARCHAR, java.sql.Types.VARCHAR });\n updatedReplPolicies += blockedRows;\n\n }\n\n }\n\n // did we update what we were supposed to?\n if (updatedReplPolicies == totalReplPolicies) {\n success = true;\n\n } else {\n success = false;\n log.error(\"For identifier \" + pid.getValue() + \", only \"\n + updatedReplPolicies + \"replication policies of \"\n + totalReplPolicies + \"were inserted.\");\n\n }\n }\n\n // Update the smreplicationstatus table\n List<Replica> replicas = finalSysMeta.getReplicaList();\n int totalReplicas = 0;\n int updatedReplicas = 0;\n\n if (replicas != null) {\n totalReplicas = totalReplicas + replicas.size();\n\n // first remove listed replicas\n jdbcTemplate.update(\"DELETE FROM \" + smReplStatusTable + \" WHERE guid = ?\",\n new Object[] { pid.getValue() });\n\n for (Replica replica : replicas) {\n int replicaRows = jdbcTemplate\n .update(\"INSERT INTO \"\n + smReplStatusTable\n + \" (guid, member_node, status, date_verified) VALUES (?, ?, ?, ?)\",\n new Object[] {\n pid.getValue(),\n (replica.getReplicaMemberNode().getValue()),\n replica.getReplicationStatus().toString(),\n new Timestamp(replica.getReplicaVerified()\n .getTime()) }, new int[] {\n java.sql.Types.LONGVARCHAR, java.sql.Types.VARCHAR,\n java.sql.Types.VARCHAR, java.sql.Types.TIMESTAMP });\n updatedReplicas += replicaRows;\n }\n\n }\n\n if (updatedReplicas == totalReplicas) {\n success = true;\n\n } else {\n success = false;\n log.error(\"For identifier \" + pid.getValue() + \", only \" + updatedReplicas\n + \"replicas of \" + totalReplicas + \"were inserted.\");\n\n }\n\n // Update the xml_access table\n AccessPolicy accessPolicy = finalSysMeta.getAccessPolicy();\n int updatedAccessRows = 0;\n int numberOfSubjects = 0;\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n\n if (accessPolicy != null) {\n accessRules = accessPolicy.getAllowList();\n\n // first delete existing rules for this pid\n jdbcTemplate.update(\"DELETE FROM \" + xmlAccessTable + \" WHERE guid = ?\",\n new Object[] { pid.getValue() });\n\n // add the new rules back in\n for (AccessRule accessRule : accessRules) {\n List<Subject> subjects = accessRule.getSubjectList();\n numberOfSubjects += subjects.size();\n List<Permission> permissions = accessRule.getPermissionList();\n // convert permissions from text to int\n Integer perm = null;\n for (Permission permission : permissions) {\n if (perm != null) {\n perm |= convertPermission(permission);\n\n } else {\n perm = convertPermission(permission);\n }\n\n }\n\n for (Subject subject : subjects) {\n int accessRows = jdbcTemplate.update(\"INSERT INTO \" + xmlAccessTable\n + \" (guid, principal_name, permission, perm_type, perm_order) \"\n + \" VALUES (?, ?, ?, ?, ?)\", new Object[] { pid.getValue(),\n subject.getValue(), perm, \"allow\", \"allowFirst\" }, new int[] {\n java.sql.Types.LONGVARCHAR, java.sql.Types.VARCHAR,\n java.sql.Types.INTEGER, java.sql.Types.VARCHAR,\n java.sql.Types.VARCHAR });\n updatedAccessRows += accessRows;\n }\n }\n\n // Determine success for access policy updates\n if (updatedAccessRows == numberOfSubjects) {\n success = true;\n\n } else {\n success = false;\n log.error(\"For identifier \" + pid.getValue() + \", only \"\n + updatedAccessRows + \"replicas of \" + numberOfSubjects\n + \"were inserted.\");\n\n }\n\n }\n\n // rollback if we don't succeed on all calls\n // status.setRollbackOnly(); // seems to only trigger rollback, no commit\n return new Boolean(success);\n }\n\n });\n\n return updated;\n\n }", "protected void updateMetaData() {\r\n System.out.println(\"RefactoringAction.updateMetaData()\");\r\n System.out.flush();\r\n CurrentSummary.get().updateMetaData();\r\n }", "KeyMetadata metadata();", "public void setMetadata(PDMetadata meta)\n {\n stream.setItem(COSName.METADATA, meta);\n }", "private IndexMetadata createUpdatedIndexMetadata(IndexMetadata indexMetadata) {\n return IndexMetadata.builder(indexMetadata)\n .putMapping(\n createUpdatedIndexMetadata(\n indexMetadata.mapping(),\n indexMetadata.getIndex().getName()\n ))\n .build();\n }", "public void setTableSchema(List<String> tableNames, List<String> oringinalTableNames){\n tableSchemaMap = new HashMap<>();\n tableSchemaDir = databaseDir + File.separator + \"schema.txt\";\n HashMap<String,String> tableNamesOringinalTableNamesMap = new HashMap<>();\n for(int i = 0; i < tableNames.size(); i++) {\n tableNamesOringinalTableNamesMap.put(tableNames.get(i),oringinalTableNames.get(i));\n }\n //System.out.println(\"tableNamesOringinalTableNamesMap:\"+tableNamesOringinalTableNamesMap);\n try\n {\n FileReader fr = new FileReader(tableSchemaDir);\n BufferedReader br = new BufferedReader(fr);\n String nextline;\n String[] oneSchema;\n while((nextline = br.readLine()) != null)\n {\n oneSchema = nextline.split(\" \");\n String SchemaName = oneSchema[0];\n for(String tableNamesOringinalTableNamesMapKey:tableNamesOringinalTableNamesMap.keySet())\n {\n if(tableNamesOringinalTableNamesMap.get(tableNamesOringinalTableNamesMapKey).equals(SchemaName)){\n String[] newSchema = oneSchema.clone();\n newSchema[0] = tableNamesOringinalTableNamesMapKey;\n for(int i = 1; i < oneSchema.length; i++)\n newSchema[i] = tableNamesOringinalTableNamesMapKey + \".\" + newSchema[i];\n //String newSchemaName = tableNamesOringinalTableNamesMap.get(tableNamesOringinalTableNamesMapKey);\n tableSchemaMap.put(newSchema[0],newSchema);\n //System.out.println(\"tableSchemaMap:\"+ tableSchemaMap);\n }\n }\n }\n }\n catch (Exception e)\n {\n System.err.println(\"Failed to open file\");\n e.printStackTrace();\n }\n }", "protected String getSysMetaUpdateStatement(String sysMetaTable) {\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"UPDATE \" + sysMetaTable + \" SET \");\n // sql.append(\"guid = ?, \");\n sql.append(\"series_id\t\t = ?, \");\n sql.append(\"serial_version = ?, \");\n sql.append(\"date_uploaded = ?, \");\n sql.append(\"rights_holder = ?, \");\n sql.append(\"checksum = ?, \");\n sql.append(\"checksum_algorithm = ?, \");\n sql.append(\"origin_member_node = ?, \");\n sql.append(\"authoritive_member_node = ?, \");\n sql.append(\"date_modified = ?, \");\n sql.append(\"submitter = ?, \");\n sql.append(\"object_format = ?, \");\n sql.append(\"size = ?, \");\n sql.append(\"archived = ?, \");\n sql.append(\"replication_allowed = ?, \");\n sql.append(\"number_replicas = ?, \");\n sql.append(\"obsoletes = ?, \");\n sql.append(\"obsoleted_by = ?\");\n sql.append(\" WHERE guid = ? ;\");\n\n return sql.toString();\n }", "public ResultSetMetaData(TableMeta[] tMeta_, String[] columns_){\n\t\ttMeta = tMeta_;\n\t\tcolumns = columns_;\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public JSONObject updateMetadata(String projectID, String fileID, String newFilename, JSONObject metadataFields) throws Exception{\n\t\tif (projectID == null || fileID == null || (metadataFields == null && (newFilename == null || newFilename == \"\"))){\n\t\t\tthrow new Exception(\"Project ID and file ID must both be non null and must supply at least one metadata field to update.\");\n\t\t}\n\t\tJSONObject updateMetadataBodyParams = new JSONObject();\n\t\t// user wants to update file name\n\t\tif (newFilename != null && newFilename != \"\"){\n\t\t\tupdateMetadataBodyParams.put(\"name\", newFilename);\n\t\t}\n\t\tif (metadataFields != null ){\n\t\t\tupdateMetadataBodyParams.put(\"metadata\", metadataFields);\n\t\t}\n\t\tSBG updateMetadataRequest = new SBG(authToken, \"project/\" + projectID + \"/file/\" + fileID, \"PUT\", null, updateMetadataBodyParams);\n\t\treturn updateMetadataRequest.checkAndRetrieveResponse(updateMetadataRequest.generateRequest());\n\t}", "public void setMetadata(gov.niem.niem.structures._2_0.MetadataType metadata)\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.niem.niem.structures._2_0.MetadataType target = null;\n target = (gov.niem.niem.structures._2_0.MetadataType)get_store().find_element_user(METADATA$0, 0);\n if (target == null)\n {\n target = (gov.niem.niem.structures._2_0.MetadataType)get_store().add_element_user(METADATA$0);\n }\n target.set(metadata);\n }\n }", "public DaprSubscriptionBuilder setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n return this;\n }", "public Identifier saveSystemMetadata(SystemMetadata systemMetadata, Map<String, String> tableMap)\n throws DataAccessException {\n\n Boolean updated = new Boolean(false); // the result of all table updates transaction\n\n // Is the pid valid? (required)\n final Identifier pid = systemMetadata.getIdentifier();\n if (pid.getValue() == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\",\n \"Identifier cannot be null\"));\n\n }\n\n // prep the transaction\n txTemplate.setName(pid.getValue());\n txTemplate.setReadOnly(false);\n\n SystemMetadata currentSysMeta = getSystemMetadata(pid, tableMap);\n // Is it in the table already?\n if (currentSysMeta == null) {\n Boolean inserted = new Boolean(false);\n final String finalSysMetaTable = tableMap.get(SYSMETA_TABLE);\n // insert just the pid\n inserted = txTemplate.execute(new TransactionCallback<Boolean>() {\n\n @Override\n public Boolean doInTransaction(TransactionStatus arg0) {\n Boolean success = new Boolean(false);\n\n int rows = jdbcTemplate.update(\"INSERT INTO \" + finalSysMetaTable\n + \" (guid) VALUES (?);\", new Object[] { pid.getValue() },\n new int[] { java.sql.Types.LONGVARCHAR });\n\n if (rows == 1) {\n success = new Boolean(true);\n }\n return success;\n }\n });\n }\n\n // then update the system metadata\n updated = updateSystemMetadata(systemMetadata, tableMap);\n\n // We failed and rolled back\n if (!updated.equals(true)) {\n throw new DataAccessException(new Exception(\"Failed to update identifier \"\n + pid.getValue()));\n }\n\n return pid;\n\n }", "void lockMetadata(String key);", "void updateLockedMetadata(String key, long value);", "public Builder addAllMetadata(Iterable<? extends MetadataEntry> values) {\n if (metadataBuilder_ == null) {\n ensureMetadataIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metadata_);\n onChanged();\n } else {\n metadataBuilder_.addAllMessages(values);\n }\n return this;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "public void saveMetaData(Transaction tr) {\r\n\t\tDebug.indexLogger.debug(\"save BPlus index meta data on page {}\",\r\n\t\t\t\tmetaPageID);\r\n\t\tPage page = BufferManager.getPage(tr, metaPageID);\r\n\r\n\t\tpage.setType(tr, Page.TYPE_BTREE_HEADER);\r\n\t\t// always remember: first seek, then write\r\n\t\tpage.seek(Page.HEADER_LENGTH);\r\n\t\tpage.writeString(tr, name);\r\n\t\tpage.writeString(tr, table.getName());\r\n\t\tpage.writeInt(tr, columnID);\r\n\t\tpage.writeInt(tr, metaPageID);\r\n\t\tpage.writeInt(tr, isPrimary ? 1 : 0);\r\n\t\tpage.writeInt(tr, treeRoot);\r\n\r\n\t\tpage.release(tr);\r\n\r\n\t}", "public void registerMetadataType(Metadata m) throws Exception{\n db.registerMetadataType(m);\n }", "protected abstract void updateTableDescriptor(HTableDescriptor desc)\n throws IOException;", "public abstract String metadata(String property);", "boolean containsMetadata(\n java.lang.String key);", "boolean containsMetadata(\n java.lang.String key);", "public void setMetadata(MediaMetadataCompat param1) {\n }", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "public void setMetadata(gov.ucore.ucore._2_0.ContentMetadataType metadata)\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.ucore.ucore._2_0.ContentMetadataType target = null;\n target = (gov.ucore.ucore._2_0.ContentMetadataType)get_store().find_element_user(METADATA$0, 0);\n if (target == null)\n {\n target = (gov.ucore.ucore._2_0.ContentMetadataType)get_store().add_element_user(METADATA$0);\n }\n target.set(metadata);\n }\n }", "public void updateMetadata(String Artiste, String Titre, String Show) {\r\n\t if (remoteControlClient != null) {\r\n\t android.media.RemoteControlClient.MetadataEditor editor = remoteControlClient.editMetadata(false);\r\n\t \r\n\t editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, Artiste);\r\n\t editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, Titre);\r\n\t editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, Show);\r\n\t editor.apply();\r\n\t } \r\n\t }", "protected void populateObjectMetadata(CosHttpResponse response, ObjectMetadata metadata) {\n for (Entry<String, String> header : response.getHeaders().entrySet()) {\n String key = header.getKey();\n if (StringUtils.beginsWithIgnoreCase(key, Headers.COS_USER_METADATA_PREFIX)) {\n key = key.substring(Headers.COS_USER_METADATA_PREFIX.length());\n metadata.addUserMetadata(key, header.getValue());\n } else if (ignoredHeaders.contains(key)) {\n // ignore...\n } else if (key.equalsIgnoreCase(Headers.LAST_MODIFIED)) {\n try {\n metadata.setHeader(key, DateUtils.parseRFC822Date(header.getValue()));\n } catch (Exception pe) {\n log.warn(\"Unable to parse last modified date: \" + header.getValue(), pe);\n }\n } else if (key.equalsIgnoreCase(Headers.CONTENT_LENGTH)) {\n try {\n metadata.setHeader(key, Long.parseLong(header.getValue()));\n } catch (NumberFormatException nfe) {\n log.warn(\"Unable to parse content length: \" + header.getValue(), nfe);\n }\n } else if (key.equalsIgnoreCase(Headers.DELETE_MARKER)) {\n metadata.setDeleteMarker(Boolean.parseBoolean(header.getValue()));\n } else if (key.equalsIgnoreCase(Headers.ETAG)) {\n metadata.setETag(StringUtils.removeQuotes(header.getValue()));\n } else if (key.equalsIgnoreCase(Headers.EXPIRES)) {\n try {\n metadata.setHttpExpiresDate(DateUtils.parseRFC822Date(header.getValue()));\n } catch (Exception pe) {\n log.warn(\"Unable to parse http expiration date: \" + header.getValue(), pe);\n }\n } else if (key.equalsIgnoreCase(Headers.EXPIRATION)) {\n new ObjectExpirationHeaderHandler<ObjectMetadata>().handle(metadata, response);\n } else if (key.equalsIgnoreCase(Headers.RESTORE)) {\n new ObjectRestoreHeaderHandler<ObjectRestoreResult>().handle(metadata, response);\n } else if (key.equalsIgnoreCase(Headers.FILE_MODE_DIR)) { // used for merge bucket\n metadata.setFileModeDir(true);\n } else {\n metadata.setHeader(key, header.getValue());\n }\n }\n }", "public Builder setMetadata(io.grafeas.v1.Metadata value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n metadata_ = value;\n } else {\n metadataBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "public void setMetadataText(String metadataText)\n {\n myMetadataText = metadataText;\n reset();\n }", "public Builder setMetadata(int index, MetadataEntry value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMetadataIsMutable();\n metadata_.set(index, value);\n onChanged();\n } else {\n metadataBuilder_.setMessage(index, value);\n }\n return this;\n }", "CustomUpdateQuery update(String table);", "protected void createMetaData(final TidaModel model) {\n\n\t\t// add some descriptors\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Dog\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Cat\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Mouse\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"ÜÄÖß\");\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tmodel.getMetaDataModel().createDescriptor(\"INT\", i);\n\t\t}\n\t\tfor (long i = Long.MAX_VALUE; i > Long.MAX_VALUE - 1000; i--) {\n\t\t\tmodel.getMetaDataModel().createDescriptor(\"LONG\", i);\n\t\t}\n\t}", "public interface MetadataDynamicable {\r\n\r\n default String getDynamicMetadata(String name){\r\n return getDynamicMetadatas().get(name);\r\n }\r\n\r\n default void setDynamicMetadata(String name, String value){\r\n getDynamicMetadatas().put(name, value);\r\n }\r\n\r\n default void clearDynamicMetadata(String name){\r\n getDynamicMetadatas().remove(name);\r\n }\r\n\r\n Map<String,String> getDynamicMetadatas();\r\n\r\n void setDynamicMetadatas(Map<String,String> metadatas);\r\n}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public MetaData getMetaData();", "private void setMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n metadata_ = value;\n bitField0_ |= 0x00000002;\n }", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "public void setMetadata(@Nullable MediaMetadata2 metadata) {\n if (metadata != null && !TextUtils.equals(mId, metadata.getMediaId())) {\n throw new IllegalArgumentException(\"metadata's id should be matched with the mediaId\");\n }\n mMetadata = metadata;\n }", "@Nullable\n @Generated\n @Selector(\"metadata\")\n public native NSDictionary<?, ?> metadata();", "public static void UpdateTable(String s) throws IOException {\n String result=\"\";\n String s_analysis=\"(?<=set ).+(?=;)\";\n String s_property=\"(.+)( where )(.+)\";\n String s_update_values=\"(.+)=(.+),(.+)=(.+)\";\n String table_name=\"\";//表名\n String find = \"\" ;\n String values=\"\";//where前面的属性\n String values1=\"\";//where后面的属性\n String []x=s.split(\" \");\n table_name=x[1];//表名\n// System.out.println(table_name); //student\n\n //此版块实现判断是否有此表\n File file = new File(\"E:\\\\\"+table_name+\".txt\");\n if(file.exists()){\n //此版块实现将set后语句识别出来\n Pattern p = Pattern.compile(s_analysis);\n Matcher m = p.matcher(s);\n m.find();\n find= m.group().toString();\n// System.out.println(find); //set id=6666,grade=3 where name=houwei\n //实现将where语句前后属性分解出来\n Pattern p1 = Pattern.compile(s_property);\n Matcher m1 = p1.matcher(find);\n while(m1.find()){\n\n values=m1.group(1); //存要设置的新值\n values1=m1.group(3); //存定位到修改行的依据值\n }\n// System.out.println(values); //id=6666,grade=3 (下标为1的那部分)\n// System.out.println(values1); //where name=houwei (下标为3的那部分)\n //此版块实现将需要修改的属性及其值得到\n int weizhi=-1;//\n String line=\"\",attr = \"\";\n\n String[] y=values1.split(\"=\");\n String y_alter_property=y[0];//需要修改的属性\n String y_alter_values=y[1];//需要修改的属性的值\n// System.out.println(y_alter_values+\"需要修改\"); // houwei\n //此版块实现获取更改的属性和值\n BufferedReader br = new BufferedReader(new FileReader(file));\n line=br.readLine();//读取第一行\n result+=line+\"\\r\\n\";\n // list.add(line+\"\\r\\n\");//添加第一行\n attr = line = br.readLine();//读取第二行 属性\n\n //===================================================\n String[] sAttr=attr.split(\" \"); //保存每个属性的值\n String tmp [];\n for(int i = 0;i<sAttr.length;i++){\n\n tmp = sAttr[i].split(\"\\\\(\");\n sAttr[i] = tmp[0];\n\n// System.out.println(\"sAttr[i]\"+sAttr[i]);\n\n }\n\n //用来保存每一行的值\n ArrayList<String> list=new ArrayList<String>();\n\n\n result+=line+\"\";\n // list.add(line+\"\\r\\n\");//添加第二行\n //将第二行数据用空格分开\n String[] h=line.split(\" \");\n\n\n for(int j=0;j<h.length;j++){\n //得到定位属性的位置\n if(y_alter_property.equals(h[j].replaceAll(\"\\\\(.*?\\\\)\",\"\"))){\n weizhi=j;\n// System.out.println(y_alter_property); //name\n }\n }\n// System.out.println(\"要修改的位置是:\"+weizhi); //0 根据哪个属性要修改值得下标\n\n //筛选出修改的值的内容\n String z =\"\";\n Pattern p2 = Pattern.compile(s_update_values);\n Matcher m2 = p2.matcher(values);\n m2.find();\n// System.out.println(m2.group().toString()+\"==================\");\n\n\n //===========================================================\n\n// for(int b=2;b<5;){\n// System.out.println(m2.group(b));\n// z+=m2.group(b)+\" \";\n// b+=2;\n// }\n// z+=y_alter_values;\n// System.out.println(z+\"lalal\");\n\n //存第一个要修改属性的值 houwei\n String a = m2.group(2);\n //存第二个要修改属性的值 6666\n String b = m2.group(4);\n\n //存第一个要修改的属性(含类型)\n String c = m2.group(1);\n //存第二个要修改的属性(含类型)\n String d = m2.group(3);\n\n// System.out.println(\"111111111111111111111\");\n// System.out.println(\"a \"+a);\n// System.out.println(\"b \"+b);\n// System.out.println(\"c \"+c);\n// System.out.println(\"d \"+d);\n\n //从第三行开始读\n while((line=br.readLine())!=null){\n\n// System.out.println(\"读取的行是:\"+line);\n String[] k=line.split(\" \");\n\n if(k==null){\n\n// System.out.println(\"此表中没有值\");\n\n }\n\n //读到的那一行的属性值为 where的属性\n else if(k[weizhi].equals( y_alter_values )){\n\n result+=\"\\r\\n\";\n\n //建立一个动态数组\n // 1. 将修改的值变成新的值 填入动态数组对应的位置\n // 2. 将未修改的值也存入对应位置\n // 3. 将该动态数组拼接成一个字符串(最后加\\r\\n)\n // 4. 接着读取下面的行,重复以上操作\n\n //先将原一行原数据放入数组中\n for(int i = 0;i<k.length;i++) {\n list.add(k[i]);\n }\n\n for(int i = 0;i<k.length;i++){\n\n // if(c == sAttr[i]){\n if(sAttr[i].equals(c)){\n list.set(i,a);\n }\n\n\n //if(d == sAttr[i]){\n if(d.equals(sAttr[i])){\n list.set(i,b);\n\n }\n\n }\n\n // result+=\"\\r\\n\";\n\n for(int i = 0;i<k.length;i++){\n\n result+=list.get(i)+\" \";\n\n }\n\n\n }else{\n //没有则按照原来情况正常写入\n// System.out.println(\"正常\");\n result+=\"\\r\\n\"+line;\n\n }\n }\n //将字符串写入文件中\n System.out.println(result);\n FileWriter fileWriter=new FileWriter(\"E:\\\\\"+table_name+\".txt\", false);\n fileWriter.write(result+\"\");\n fileWriter.close();\n System.out.println(\"成功执行\");\n\n }else{\n System.out.println(\"此表不存在\");\n }\n\n\n\n\n }", "@POST( CONTROLLER + METADATA_PATH )\n VersionedObjectKey createMetadataObject( @Body CreateMetadataObjectRequest request );", "public void setMetadata(@Nullable final Metadata metadata) {\n mMetadata = metadata;\n }", "public interface MetaData extends MetaSearch {\n\t/** place holder for mandatory meta data */\n\tpublic static String sPLACE_HOLDER = \"(...)\";\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get archive with which this MetaData instance is associated (null for\n\t * template meta data).\n\t * \n\t * @return open archive associated with these meta data.\n\t */\n\tpublic Archive getArchive();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set template meta data from which descriptions for matching database objects\n\t * are copied\n\t * \n\t * @param mdTemplate template meta data.\n\t * @throws IOException if an I/O error occurred.\n\t */\n\tpublic void setTemplate(MetaData mdTemplate) throws IOException;\n\n\t/*\n\t * ==================================================================== global\n\t * properties\n\t * ====================================================================\n\t */\n\t/**\n\t * get current version of SIARD format of XML. If an file of an older SIARD\n\t * format is opened, the older version is returned until a change in the meta\n\t * data is saved, at which point the meta data are saved in the current format.\n\t * \n\t * @return version of SIARD format of XML.\n\t */\n\tpublic String getVersion();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of the archived database (must not be null or empty!).\n\t * \n\t * @param sDbName name of the archived database.\n\t */\n\tpublic void setDbName(String sDbName);\n\n\t/**\n\t * get name of the archived database.\n\t * \n\t * @return name of the archived database.\n\t */\n\tpublic String getDbName();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set short free form description of the database content.\n\t * \n\t * @param sDescription short free form description of the database content.\n\t */\n\tpublic void setDescription(String sDescription);\n\n\t/**\n\t * get short free form description of the database content.\n\t * \n\t * @return short free form description of the database content.\n\t */\n\tpublic String getDescription();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of person responsible for archiving the database.\n\t * \n\t * @param sArchiver name of person responsible for archiving the database.\n\t */\n\tpublic void setArchiver(String sArchiver);\n\n\t/**\n\t * get name of person responsible for archiving the database.\n\t * \n\t * @return name of person responsible for archiving the database.\n\t */\n\tpublic String getArchiver();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set contact data (telephone number or email address) of archiver.\n\t * \n\t * @param sArchiverContact contact data (telephone number or email address) of\n\t * archiver.\n\t */\n\tpublic void setArchiverContact(String sArchiverContact);\n\n\t/**\n\t * get contact data (telephone number or email address) of archiver.\n\t * \n\t * @return contact data (telephone number or email address) of archiver.\n\t */\n\tpublic String getArchiverContact();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of data owner (section and institution responsible for data) of\n\t * database when it was archived.\n\t * \n\t * @param sDataOwner name of data owner.\n\t */\n\tpublic void setDataOwner(String sDataOwner);\n\n\t/**\n\t * get name of data owner (section and institution responsible for data) of\n\t * database when it was archived.\n\t * \n\t * @return name of data owner.\n\t */\n\tpublic String getDataOwner();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set time span during which data where entered into the database.\n\t * \n\t * @param sDataOriginTimespan time span during which data where entered into the\n\t * database.\n\t */\n\tpublic void setDataOriginTimespan(String sDataOriginTimespan);\n\n\t/**\n\t * get time span during which data where entered into the database.\n\t * \n\t * @return time span during which data where entered into the database.\n\t */\n\tpublic String getDataOriginTimespan();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set global folder for external LOB files. Can only be set if the field is not\n\t * null or the SIARD archive is open for modification of primary data and still\n\t * empty. It must not be set to null. It must start with \"..\", \"/\" or \"file:/\".\n\t * It must be terminated with \"/\" (because it denotes a folder). If the given\n\t * URI starts with \"file:/\", it refers to a remote absolute folder. If it starts\n\t * with \"/\" it refers to an absolute local folder. Otherwise it is a relative\n\t * URI. If the global lobFolder is set, it is to be resolved relative to it.\n\t * Otherwise it must start with \"..\" which refers to the folder containing the\n\t * SIARD file.\n\t * \n\t * @param uriLobFolder URI for global folder for external files.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setLobFolder(URI uriLobFolder) throws IOException;\n\n\t/**\n\t * get global folder for external LOB files.\n\t * \n\t * @return root folder for external LOB files.\n\t */\n\tpublic URI getLobFolder();\n\n\t/**\n\t * absolute global folder for external LOB files or null, if no global LOB\n\t * folder is set.\n\t * \n\t * @return absolute global folder for external LOB files or null, if no global\n\t * LOB folder is set.\n\t */\n\tpublic URI getAbsoluteLobFolder();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name and version of program that generated the metadata file. Can only be\n\t * set if the SIARD archive is open for modification of primary data.\n\t * \n\t * @param sProducerApplication name and version of program that generated the\n\t * metadata file.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setProducerApplication(String sProducerApplication) throws IOException;\n\n\t/**\n\t * get name and version of program that generated the metadata file.\n\t * \n\t * @return name and version of program that generated the metadata file.\n\t */\n\tpublic String getProducerApplication();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get date of creation of archive (automatically generated by SIARD).\n\t * \n\t * @return date of creation of archive (automatically generated by SIARD).\n\t */\n\tpublic Calendar getArchivalDate();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get message digest codes over all primary data in folder \"content\".\n\t * \n\t * @return message digest codes over all primary data in folder \"content\".\n\t */\n\tpublic List<MessageDigestType> getMessageDigest();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set DNS name of client machine from which connection to the database was\n\t * established for archiving. Can only be set if the SIARD archive is open for\n\t * modification of primary data.\n\t * \n\t * @param sClientMachine DNS name of client machine from which connection to the\n\t * database was established for archiving.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setClientMachine(String sClientMachine) throws IOException;\n\n\t/**\n\t * get DNS name of client machine from which connection to the database was\n\t * established for archiving.\n\t * \n\t * @return DNS name of client machine from which connection to the database was\n\t * established for archiving.\n\t */\n\tpublic String getClientMachine();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of database product and version from which database originates. Can\n\t * only be set if the SIARD archive is open for modification of primary data.\n\t * \n\t * @param sDatabaseProduct name of database product and version from which\n\t * database originates.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setDatabaseProduct(String sDatabaseProduct) throws IOException;\n\n\t/**\n\t * get name of database product and version from which database originates.\n\t * \n\t * @return name of database product and version from which database originates.\n\t */\n\tpublic String getDatabaseProduct();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set connection string (JDBC URL) used for archiving. Can only be set if the\n\t * SIARD archive is open for modification of primary data.\n\t * \n\t * @param sConnection connection string (JDBC URL) used for archiving.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setConnection(String sConnection) throws IOException;\n\n\t/**\n\t * get connection string (JDBC URL) used for archiving.\n\t * \n\t * @return connection string (JDBC URL) used for archiving.\n\t */\n\tpublic String getConnection();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set database user used for archiving Can only be set if the SIARD archive is\n\t * open for modification of primary data.\n\t * \n\t * @param sDatabaseUser database user used for archiving.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setDatabaseUser(String sDatabaseUser) throws IOException;\n\n\t/**\n\t * get database user used for archiving.\n\t * \n\t * @return database user used for archiving.\n\t */\n\tpublic String getDatabaseUser();\n\n\t/*\n\t * ==================================================================== list\n\t * properties\n\t * ====================================================================\n\t */\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of schema meta data entries.\n\t * \n\t * @return number of schema meta data entries.\n\t */\n\tpublic int getMetaSchemas();\n\n\t/**\n\t * get the schema meta data with the given index.\n\t * \n\t * @param iSchema index of schema meta data.\n\t * @return schema meta data.\n\t */\n\tpublic MetaSchema getMetaSchema(int iSchema);\n\n\t/**\n\t * get the schema meta data with the given name.\n\t * \n\t * @param sName name of schema meta data.\n\t * @return schema meta data.\n\t */\n\tpublic MetaSchema getMetaSchema(String sName);\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of user meta data entries.\n\t * \n\t * @return number of user meta data entries.\n\t */\n\tpublic int getMetaUsers();\n\n\t/**\n\t * get the user meta data with the given index.\n\t * \n\t * @param iUser index of user meta data.\n\t * @return user meta data.\n\t */\n\tpublic MetaUser getMetaUser(int iUser);\n\n\t/**\n\t * get the user meta data with the given user name.\n\t * \n\t * @param sName user name.\n\t * @return user meta data.\n\t */\n\tpublic MetaUser getMetaUser(String sName);\n\n\t/**\n\t * add new user to meta data. A new user can only be created if the SIARD\n\t * archive is open for modification of primary data.\n\t * \n\t * @param sName user name of the new user meta data.\n\t * @return user meta data.\n\t * @throws IOException if new user could be created.\n\t */\n\tpublic MetaUser createMetaUser(String sName) throws IOException;\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of role meta data entries.\n\t * \n\t * @return number of role meta data entries.\n\t */\n\tpublic int getMetaRoles();\n\n\t/**\n\t * get the role meta data with the given index.\n\t * \n\t * @param iRole index of role meta data.\n\t * @return role meta data.\n\t */\n\tpublic MetaRole getMetaRole(int iRole);\n\n\t/**\n\t * get the role meta data with the given role name.\n\t * \n\t * @param sName role name.\n\t * @return role meta data.\n\t */\n\tpublic MetaRole getMetaRole(String sName);\n\n\t/**\n\t * add new role meta data. A new role can only be created if the SIARD archive\n\t * is open for modification of primary data.\n\t * \n\t * @param sName role name of the new role meta data.\n\t * @param sAdmin name of administrator (user or role) of the new role.\n\t * @return role meta data.\n\t * @throws IOException if new user could be created.\n\t */\n\tpublic MetaRole createMetaRole(String sName, String sAdmin) throws IOException;\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of privilege meta data entries.\n\t * \n\t * @return number of privilege meta data entries.\n\t */\n\tpublic int getMetaPrivileges();\n\n\t/**\n\t * get the privilege meta data with the given index.\n\t * \n\t * @param iPrivilege index of privilege meta data.\n\t * @return privilege meta data.\n\t */\n\tpublic MetaPrivilege getMetaPrivilege(int iPrivilege);\n\n\t/**\n\t * get the privilege meta data with the given content.\n\t * \n\t * @param sType type of privilege including ROLE privilege or ALL PRIVILEGES.\n\t * @param sObject object of privilege (or null for ROLE privilege).\n\t * @param sGrantor name of grantor of privilege (user or role).\n\t * @param sGrantee name od grantee of privilege (user or role).\n\t * @return privilege meta data.\n\t */\n\tpublic MetaPrivilege getMetaPrivilege(String sType, String sObject, String sGrantor, String sGrantee);\n\n\t/**\n\t * add new privilege meta data. A new privilege can only be created if the SIARD\n\t * archive is open for modification of primary data.\n\t * \n\t * @param sType type of privilege including ROLE privilege or ALL PRIVILEGES.\n\t * @param sObject privilege object (may be null for ROLE privilege)\n\t * @param sGrantor name of grantor (user or role).\n\t * @param sGrantee name of grantee (user or role).\n\t * @return privilge meta data.\n\t * @throws IOException if new user could be created.\n\t */\n\tpublic MetaPrivilege createMetaPrivilege(String sType, String sObject, String sGrantor, String sGrantee)\n\t\t\tthrows IOException;\n\n\t/*\n\t * ==================================================================== methods\n\t * ====================================================================\n\t */\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * checks whether this is the meta data instance of a valid archive, i.e.\n\t * whether it contains at least one table containing at least one record of\n\t * primary data.\n\t * \n\t * @return true, if instance is valid.\n\t */\n\tpublic boolean isValid();\n\n}" ]
[ "0.6587066", "0.6423105", "0.64067113", "0.62549543", "0.62132674", "0.616098", "0.6016946", "0.5972006", "0.59698135", "0.59527594", "0.5888887", "0.5887246", "0.58243877", "0.5797794", "0.5720576", "0.5683197", "0.56644243", "0.5654581", "0.561668", "0.56013596", "0.559392", "0.5568946", "0.5568946", "0.55529165", "0.5543147", "0.5532366", "0.5478683", "0.5464538", "0.54580414", "0.54309344", "0.5368768", "0.53647006", "0.53554475", "0.53465205", "0.5320434", "0.5320027", "0.5297265", "0.5290452", "0.5289712", "0.52516466", "0.524683", "0.52375066", "0.5236762", "0.52165693", "0.52133983", "0.52107704", "0.5208512", "0.5176938", "0.51528066", "0.5151853", "0.5127157", "0.51169246", "0.51169246", "0.51159793", "0.51157147", "0.51107645", "0.50975496", "0.50883424", "0.507093", "0.5058238", "0.50516236", "0.50171876", "0.49909592", "0.49899223", "0.4983746", "0.4979809", "0.49769118", "0.4974592", "0.4972534", "0.49703875", "0.4964973", "0.49577606", "0.49539542", "0.49536845", "0.4946509", "0.4944708", "0.49438432", "0.49438432", "0.49401706", "0.49378458", "0.49368805", "0.4936084", "0.4934743", "0.4926861", "0.4920333", "0.49095485", "0.49081135", "0.49075288", "0.4901152", "0.48940504", "0.48842797", "0.48719412", "0.48695716", "0.48674437", "0.48622444", "0.48622152", "0.48590392", "0.48527196", "0.4849836", "0.48466617" ]
0.70918536
0
Updates (adds or changes) metadata for tables. The metadata key and values must both be strings. This is an easy way to annotate whole tables rather than single records within tables. Some examples of metadata are owner of the table, table creation timestamp etc.
public AlterTableMetadataResponse alterTableMetadata(List<String> tableNames, Map<String, String> metadataMap, Map<String, String> options) throws GPUdbException { AlterTableMetadataRequest actualRequest_ = new AlterTableMetadataRequest(tableNames, metadataMap, options); AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse(); submitRequest("/alter/table/metadata", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "<K, C> void declareTable(TableMetadata<K, C> metadata);", "void setMetaLocal(Map<Integer, String> newMetaTable);", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {\n/* 787 */ this.server.getEntityMetadata().setMetadata(this, metadataKey, newMetadataValue);\n/* */ }", "<K, C> TableMetadata<K, C> getTableMetadata(TableName tableName);", "<E extends CtElement> E putMetadata(String key, Object val);", "public void setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void setMetadata ( String metadataKey , MetadataValue newMetadataValue ) {\n\t\texecute ( handle -> handle.setMetadata ( metadataKey , newMetadataValue ) );\n\t}", "<E extends CtElement> E setAllMetadata(Map<String, Object> metadata);", "public void setMetaData(MetaData newMetaData);", "@Override\n public void createMetaTable(Connection conn) throws PersistenceException {\n String sql = String.format(\"CREATE TABLE %1$s (%2$s %3$s NOT NULL)\", metaTableName, META_TABLE_DATA_COLUMN, config.dataColumnType());\n executeUpdateSql(conn, sql);\n updateMetaTable(conn);\n }", "@PublicAtsApi\n public void setBlobMetadata( String containerName, String blobName, Map<String, String> newMetadata,\n boolean overwriteExistingKeys, boolean includeOldMetadata, String valueDelimiter ) {\n\n try {\n log.info(\"Setting metadata for blob '\" + blobName + \"' from container '\" + containerName + \"' ...\");\n\n Map<String, String> metadataToBeSent = new HashMap<String, String>();\n if (includeOldMetadata) {\n // keep the old metadata\n metadataToBeSent.putAll(this.getBlobInfo(containerName, blobName).getMetadata());\n }\n\n if (overwriteExistingKeys) {\n // overwrite the old metadata where appropriate\n metadataToBeSent.putAll(newMetadata);\n } else {\n // we should append the new values where appropriate\n // traverse only the keys, where overwrite is possible \n for (String key : metadataToBeSent.keySet()) {\n if (newMetadata.containsKey(key)) {\n String oldValue = metadataToBeSent.get(key);\n String newValue = newMetadata.get(key);\n metadataToBeSent.put(key, oldValue + valueDelimiter + newValue);\n }\n }\n\n for (String key : newMetadata.keySet()) {\n if (!metadataToBeSent.containsKey(key)) {\n // set only keys that will not overwrite anything in the old metadata\n metadataToBeSent.put(key, newMetadata.get(key));\n }\n\n }\n }\n\n serviceClient.getBlobContainerClient(containerName).getBlobClient(blobName).setMetadata(metadataToBeSent);\n\n log.info(\"Successfully set metadata for blob '\" + blobName + \"' from container '\" + containerName\n + \"' ...\");\n } catch (Exception e) {\n throw new AtsBlobStorageException(\"Could not set metadata for blob '\" + blobName + \"' in container '\"\n + containerName + \"'\", e);\n }\n\n }", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "public void acceptMetadata( StarTable meta ) {\n int ncol = meta.getColumnCount();\n for ( int i = 0; i < ncol; i++ ) {\n colMap_.put( meta.getColumnInfo( i ).getName().toLowerCase(),\n i );\n }\n }", "public void registerTableMeta(String paramString, SnmpMibTable paramSnmpMibTable) {\n/* 656 */ if (this.metadatas == null)\n/* 657 */ return; if (paramString == null)\n/* 658 */ return; this.metadatas.put(paramString, paramSnmpMibTable);\n/* */ }", "protected abstract IItemMetadata newItemMetadata(Map<String, String> metadata);", "@PUT\n @Path(\"{metadataId}\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @Permissions({ @Permission(value = RolePermission.APPLICATION_METADATA, acls = RolePermissionAction.UPDATE) })\n public Response updateApplicationMetadataByApplicationIdAndMetadataId(\n @PathParam(\"applicationId\") String applicationId,\n @PathParam(\"metadataId\") String metadataId,\n @Valid @NotNull final ReferenceMetadataInput metadata\n ) {\n UpdateApplicationMetadataEntity updateApplicationMetadataEntity =\n this.referenceMetadataMapper.convert(metadata, applicationId, metadataId);\n\n return Response\n .ok(\n this.referenceMetadataMapper.convert(\n metadataService.update(GraviteeContext.getExecutionContext(), updateApplicationMetadataEntity)\n )\n )\n .build();\n }", "public interface Metadata<I extends MetadataInfo> {\n\n /** Metadata types */\n public enum MetadataType {\n /* New types must be added to the end of this list */\n TOPOLOGY() {\n @Override\n public String getKey() { return \"Topology\";}\n },\n TABLE() {\n @Override\n public String getKey() { return \"Table\";}\n },\n SECURITY() {\n @Override\n public String getKey() { return \"Security\";}\n };\n\n /**\n * Gets a unique string for this type. This string may be used as a\n * key into a metadata store.\n *\n * @return a unique string\n */\n abstract public String getKey();\n }\n\n /* The sequence number of an newly created metadata, empty object */\n public static final int EMPTY_SEQUENCE_NUMBER = 0;\n\n /**\n * Gets the type of this metadata object.\n *\n * @return the type of this metadata object\n */\n public MetadataType getType();\n\n /**\n * Gets the highest sequence number of this metadata object.\n * Returns -1 if the metadata has not been initialized.\n *\n * @return the highest sequence number of this metadata object\n */\n public int getSequenceNumber();\n\n /**\n * Gets an information object for this metadata. The returned object will\n * include the changes between this object and the metadata at the\n * specified sequence number. If the metadata object can not supply\n * information based on the sequence number an empty metadata information\n * object is returned.\n *\n * @param startSeqNum the inclusive start of the sequence of\n * changes to be included\n * @return a metadata info object\n */\n public I getChangeInfo(int startSeqNum);\n}", "void modifyMetadata(MetadataID mid, CellID cid, Metadata metadata){\n db.removeMetadata(mid);\n db.addMetadata(cid, metadata);\n metadataModification(cid, metadata);\n }", "public Builder putAllMetadata(\n java.util.Map<java.lang.String, java.lang.String> values) {\n internalGetMutableMetadata().getMutableMap()\n .putAll(values);\n return this;\n }", "public Builder putAllMetadata(\n java.util.Map<java.lang.String, java.lang.String> values) {\n internalGetMutableMetadata().getMutableMap()\n .putAll(values);\n return this;\n }", "void addNodeMetadata(int node, String key, String value);", "void setMetadataValue(String name, String value) throws IOException;", "public void addEntityMetadata() throws Exception {\n\n\t\tEntityMetadata entity = new EntityMetadata(entityType, false);\n\t\tentity.setRepositoryInstance(\"OperationalDB\");\n\t\tentity.setProviderType(\"RDBMSDataProvider\");\n\n\t\tMap<String, List<String>> providerParams = new HashMap<String, List<String>>();\n\t\tproviderParams.put(\"table\",\n\t\t\t\tArrays.asList(new String[] { \"APPLICATION_OBJECT\" }));\n\t\tproviderParams.put(\"id_column\", Arrays.asList(new String[] { \"ID\" }));\n\t\tproviderParams.put(\"id_type\", Arrays.asList(new String[] { \"guid\" }));\n\t\tproviderParams.put(\"optimistic_locking\",\n\t\t\t\tArrays.asList(new String[] { \"false\" }));\n\t\tproviderParams.put(\"flex_searchable_string_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_VC\" }));\n\t\tproviderParams.put(\"flex_non_searchable_string_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_VC\" }));\n\t\tproviderParams.put(\"flex_searchable_date_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_DT\" }));\n\t\tproviderParams.put(\"flex_non_searchable_date_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_DT\" }));\n\t\tproviderParams.put(\"flex_searchable_number_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_NUM\" }));\n\t\tproviderParams.put(\"flex_non_searchable_number_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_NUM\" }));\n\t\tproviderParams.put(\"flex_blob_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_BLOB\" }));\n\n\t\tentity.setProviderParameters(providerParams);\n\t\tentity.setContainer(false);\n\n\t\tHashMap<String, Map<String, String>> metadataAttachments = new HashMap<String, Map<String, String>>();\n\t\tMap<String, String> prop = new HashMap<String, String>();\n\t\tprop.put(\"isEncrypted\", \"false\");\n\t\tmetadataAttachments.put(\"properties\", prop);\n\t\tAttributeDefinition attrDef = null;\n\t\tFieldDefinition fieldDef = null;\n\n\t\t// parameters: name, type, description, isRequired, isSearchable, isMLS,\n\t\t// defaultValue, groupName, metadataAttachments\n\n\t\tattrDef = new AttributeDefinition(\"givenName\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"lastName\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"email\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"startDate\", \"date\", null, false,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"endDate\", \"date\", null, false,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"employeeNo\", \"number\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\n\n\t\tattrDef = new AttributeDefinition(\"__UID__\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\tfieldDef = new FieldDefinition(\"AO_UID\", \"string\",true);\n\t\tentity.addField(fieldDef);\n\t\tentity.addAttributeMapping(\"__UID__\", \"AO_UID\");\n\t\t\n\t\tattrDef = new AttributeDefinition(\"__NAME__\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\tfieldDef = new FieldDefinition(\"AO_NAME\", \"string\",true);\n\t\tentity.addField(fieldDef);\n\t\tentity.addAttributeMapping(\"__NAME__\", \"AO_NAME\");\n\n\t\t/*\n\t\t * attrDef = new AttributeDefinition(childEntityType, childEntityType,\n\t\t * null, false, true, false, null, \"Basic\", metadataAttachments);\n\t\t * entity.addChildEntityAttribute(attrDef);\n\t\t */\n\n\t\tString xmlString = getStringfromDoc(entity);\n\n\t\ttry {\n\t\t\tmgrConfig.createEntityMetadata(entity);\n\t\t\tSystem.out.println(\"Created entity type: \" + entityType);\n\n\t\t} catch (Exception e) {\n\t\t\t//fail(\"Unexpected exception: \" + getStackTrace(e));\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void setMetaData(AdvResultSetMetaData metadata, String newAlias) {\n\t\t\t\tif (containedColumns != null) {\n\t\t\t\t\tfor (Column col : containedColumns) {\n\t\t\t\t\t\tcol.setMetaData(metadata, newAlias);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// set metadata for IF-predicate\n\t\t\t\tIF.setMetaData(metadata, newAlias);\n\t\t\t\t\n\t\t\t\tClass<?> thenType; \n\t\t\t\tClass<?> elseType;\n\t\t\t\ttry {\n\t\t\t\t\tthenType = Class.forName(THEN.columnMetaData.getColumnClassName());\n\t\t\t\t\telseType = Class.forName(ELSE.columnMetaData.getColumnClassName());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tif(noName)\n\t\t\t\t\t\tthrow new RuntimeException(\"Error while setting metadata for IfThenElse: \"\n\t\t\t\t\t\t\t\t+e.getMessage(), e);\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(\"Error while setting metadata for IfThenElse \\\"\"\n\t\t\t\t\t\t\t\t+columnName+\"\\\": \"+e.getMessage(), e);\n\t\t\t\t} \n\t\t\t\tClass<?> cl = getCommonType(thenType, elseType);\n\t\t\t\tcolumnMetaData = AdvResultSetMetaData.createColumnMetaData(cl, columnName, newAlias);\n\t\t\t}", "protected void addMetadataFieldsFromParameters() {\n for (Map.Entry<String, String> e: parameters.entrySet()) {\n if (e.getKey().startsWith(\"meta-\")) {\n String fieldName = e.getKey().substring(5);\n String fieldValue = e.getValue();\n currentDoc.addTextualMetadataField(fieldName, fieldValue, getDocWriter().metadataFieldType(false));\n }\n }\n }", "public ShowTableMetadataResponse showTableMetadata(List<String> tableNames, Map<String, String> options) throws GPUdbException {\n ShowTableMetadataRequest actualRequest_ = new ShowTableMetadataRequest(tableNames, options);\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void setMetaData(HashMap pMetaData) ;", "Map<String, Object> getAllMetadata();", "public void setMetadata(PDMetadata meta) {\n/* 557 */ this.stream.setItem(COSName.METADATA, meta);\n/* */ }", "@JsonSetter(\"metadata\")\n public void setMetadata (Object value) {\n this.metadata = value;\n }", "void addMetadata(CellID cid, Metadata metadata){\n db.addMetadata(cid, metadata);\n metadataModification(cid, metadata);\n }", "private void addMetadataByString(Metadata metadata, String name, String value) {\n if (value != null) {\n metadata.add(name, value);\n }\n }", "@Override\n public void addMetadata(final OAtomicOperationMetadata<?> metadata) {\n this.metadata.put(metadata.getKey(), metadata);\n }", "public void setMetadata(RavenJObject metadata) {\n this.metadata = metadata;\n }", "@Test\n public void testChangeMetadata() {\n metaDataProcessor.editMetaData(1, \"color\", \"red\");\n assertTrue(CommandController.getInstance().getCommandQ().poll() instanceof EditUserMetaCommand);\n }", "<KEY extends MetadataKey<VALUE>, VALUE> void setMetadata(Class<KEY> keyClass,\n VALUE metadata) throws IllegalArgumentException;", "public abstract Object getMetadata(String key);", "public void setMetaData(MetaData metaData) {\n this.metaData = metaData;\n }", "@Test\n public void testChangeMetadataMap() {\n HashMap<String, String> map = new HashMap<>();\n map.put(\"color\", \"red\");\n map.put(\"r\", \"2\");\n metaDataProcessor.editMetaData(1, map);\n assertTrue(CommandController.getInstance().getCommandQ().poll() instanceof CommandComposite);\n }", "public interface ImageMetadata extends Named, HasMetaTable {\n\n\t/** Sets width (in pixels) of thumbnail planes in this image. */\n\tvoid setThumbSizeX(long thumbSizeX);\n\n\t/** Sets height (in pixels) of thumbnail planes in this image. */\n\tvoid setThumbSizeY(long thumbSizeY);\n\n\t/**\n\t * Sets the data type associated with a pixel. Valid pixel type constants\n\t * (e.g., {@link FormatTools#INT8}) are enumerated in {@link FormatTools}.\n\t */\n\tvoid setPixelType(int pixelType);\n\n\t/** Sets the number of valid bits per pixel. */\n\tvoid setBitsPerPixel(int bitsPerPixel);\n\n\t/**\n\t * Sets whether or not we are confident that the dimension order is correct.\n\t */\n\tvoid setOrderCertain(boolean orderCertain);\n\n\t/** Sets whether or not each pixel's bytes are in little endian order. */\n\tvoid setLittleEndian(boolean littleEndian);\n\n\t/**\n\t * Sets whether or not the planes are stored as indexed color. An indexed\n\t * color image treats each pixel value as an index into a color table\n\t * containing one or more (typically 3) actual values for the pixel.\n\t */\n\tvoid setIndexed(boolean indexed);\n\n\t/**\n\t * Sets the number of planar axes in this image. This value represents the\n\t * number of dimensional axes constituting each {@link Plane} (as returned by\n\t * the {@link Reader#openPlane} methods). This value is necessary to determine\n\t * the total plane count for an N-dimensional image, as well as how many\n\t * pixels there are per plane.\n\t * <p>\n\t * For example, suppose we have a 4-dimensional image with axes (X, Y, Z, T)\n\t * and extents (768, 512, 7, 13). If there are two planar axes, then each\n\t * plane is 768 x 512 and there are 7 x 13 = 91 total planes. But if we have\n\t * three planar axes, then each plane is 768 x 512 x 7 and there are 13 total\n\t * planes.\n\t * </p>\n\t *\n\t * @see Reader#openPlane(int, long)\n\t */\n\tvoid setPlanarAxisCount(final int count);\n\n\t/**\n\t * Sets the number of interleaved axes in this image. This must be a value\n\t * between [0, planarAxisCount). Interleaved axes are planar axes that do not\n\t * constitute the \"canonical\" axes - e.g., in a CXY image with an interleaved\n\t * axis count of 1, the C axis is interleaved, and each plane is an XY plane\n\t * with C different representations.\n\t */\n\tvoid setInterleavedAxisCount(final int count);\n\n\t/** Sets whether or not we can ignore the color map (if present). */\n\tvoid setFalseColor(boolean falseColor);\n\n\t/**\n\t * Sets whether or not we are confident that all of the metadata stored within\n\t * the image has been parsed.\n\t */\n\tvoid setMetadataComplete(boolean metadataComplete);\n\n\t/**\n\t * Sets whether or not this image is a lower-resolution copy of another image.\n\t */\n\tvoid setThumbnail(boolean thumbnail);\n\n\t/**\n\t * Convenience method to set both the axis types and lengths for this\n\t * ImageMetadata.\n\t */\n\tvoid setAxes(CalibratedAxis[] axes, long[] axisLengths);\n\n\t/**\n\t * Sets the Axes types for this image. Order is implied by ordering within\n\t * this array\n\t */\n\tvoid setAxisTypes(AxisType... axisTypes);\n\n\t/**\n\t * Sets the Axes types for this image. Order is implied by ordering within\n\t * this array\n\t */\n\tvoid setAxes(CalibratedAxis... axes);\n\n\t/**\n\t * Sets the lengths of each axis. Order is parallel of {@code axes}.\n\t * <p>\n\t * NB: axes must already exist for this method to be called. Use\n\t * {@link #setAxes(CalibratedAxis[])} or {@link #setAxes}\n\t */\n\tvoid setAxisLengths(long[] axisLengths);\n\n\t/**\n\t * Sets the length for the specified axis. Adds the axis if if its type is not\n\t * already present in the image.\n\t */\n\tvoid setAxisLength(CalibratedAxis axis, long length);\n\n\t/**\n\t * As {@link #setAxisLength(CalibratedAxis, long)} but requires only the\n\t * AxisType.\n\t */\n\tvoid setAxisLength(AxisType axis, long length);\n\n\t/**\n\t * Sets the axis at the specified index, if an axis with a matching type is\n\t * not already defined. Otherwise the axes are re-ordered, per\n\t * {@link java.util.List#add(int, Object)}.\n\t */\n\tvoid setAxis(int index, CalibratedAxis axis);\n\n\t/**\n\t * As {@link #setAxis(int, CalibratedAxis)} but using the default calibration\n\t * values, per {@link FormatTools#createAxis(AxisType)}.\n\t */\n\tvoid setAxisType(int index, AxisType axis);\n\n\t// TODO: Consider typing rois and tables on more specific data structures.\n\n\t/** Sets the ROIs associated with this image. */\n\tvoid setROIs(Object rois);\n\n\t/** Sets the tables associated with this image. */\n\tvoid setTables(Object tables);\n\n\t/** Returns the size, in bytes, of all planes in this image. */\n\tlong getSize();\n\n\t/** Returns the size, in bytes, of one plane in this image. */\n\tlong getPlaneSize();\n\n\t/** Returns the width (in pixels) of the thumbnail planes in this image. */\n\tlong getThumbSizeX();\n\n\t/** Returns the height (in pixels) of the thumbnail planes in this image. */\n\tlong getThumbSizeY();\n\n\t/**\n\t * Returns the CalibratedAxis associated with the given type. Useful to\n\t * retrieve calibration information.\n\t */\n\tCalibratedAxis getAxis(AxisType axisType);\n\n\t/**\n\t * Returns the data type associated with a pixel. Valid pixel type constants\n\t * (e.g., {@link FormatTools#INT8}) are enumerated in {@link FormatTools}.\n\t */\n\tint getPixelType();\n\n\t/** Returns the number of valid bits per pixel. */\n\tint getBitsPerPixel();\n\n\t/**\n\t * Returns true if we are confident that the dimension order is correct.\n\t */\n\tboolean isOrderCertain();\n\n\t/** Returns true if each pixel's bytes are in little endian order. */\n\tboolean isLittleEndian();\n\n\t/** Returns true if the planes are stored as indexed color. */\n\tboolean isIndexed();\n\n\t/** Returns the number of planar axes in this image. */\n\tint getPlanarAxisCount();\n\n\t/**\n\t * Returns the number of interleaved axes in this image.\n\t */\n\tint getInterleavedAxisCount();\n\n\t/** Returns true if the {@link Axes#CHANNEL} axis is a planar axis. */\n\tboolean isMultichannel();\n\n\t/** Returns true if we can ignore the color map (if present). */\n\tboolean isFalseColor();\n\n\t/**\n\t * Returns true if we are confident that all of the metadata stored within the\n\t * image has been parsed.\n\t */\n\tboolean isMetadataComplete();\n\n\t/**\n\t * Determines whether or not this image is a lower-resolution copy of another\n\t * image.\n\t *\n\t * @return true if this image is a thumbnail\n\t */\n\tboolean isThumbnail();\n\n\t/**\n\t * Gets the axis of the (zero-indexed) specified plane.\n\t *\n\t * @param axisIndex - index of the desired axis within this image\n\t * @return Type of the desired plane.\n\t */\n\tCalibratedAxis getAxis(final int axisIndex);\n\n\t/**\n\t * Gets the length of the (zero-indexed) specified plane.\n\t *\n\t * @param axisIndex - index of the desired axis within this image\n\t * @return Length of the desired axis, or 1 if the axis is not found.\n\t */\n\tlong getAxisLength(final int axisIndex);\n\n\t/**\n\t * A convenience method for looking up the length of an axis based on its\n\t * type. No knowledge of plane ordering is necessary.\n\t *\n\t * @param t - CalibratedAxis to look up\n\t * @return Length of axis t, or 1 if the axis is not found.\n\t */\n\tlong getAxisLength(final CalibratedAxis t);\n\n\t/**\n\t * As {@link #getAxisLength(CalibratedAxis)} but only requires the\n\t * {@link AxisType} of the desired axis.\n\t *\n\t * @param t - CalibratedAxis to look up\n\t * @return Length of axis t, or 1 if the axis is not found.\n\t */\n\tlong getAxisLength(final AxisType t);\n\n\t/**\n\t * Returns the array index for the specified CalibratedAxis. This index can be\n\t * used in other Axes methods for looking up lengths, etc...\n\t * <p>\n\t * This method can also be used as an existence check for the target\n\t * CalibratedAxis.\n\t * </p>\n\t *\n\t * @param axis - axis to look up\n\t * @return The index of the desired axis or -1 if not found.\n\t */\n\tint getAxisIndex(final CalibratedAxis axis);\n\n\t/**\n\t * As {@link #getAxisIndex(CalibratedAxis)} but only requires the\n\t * {@link AxisType} of the desired axis.\n\t *\n\t * @param axisType - axis type to look up\n\t * @return The index of the desired axis or -1 if not found.\n\t */\n\tint getAxisIndex(final AxisType axisType);\n\n\t/**\n\t * Returns an array of the types for axes associated with the specified image\n\t * index. Order is consistent with the axis length (int) array returned by\n\t * {@link #getAxesLengths()}.\n\t * <p>\n\t * CalibratedAxis order is sorted and represents order within the image.\n\t * </p>\n\t *\n\t * @return List of CalibratedAxes. Ordering in the list indicates the axis\n\t * order in the image.\n\t */\n\tList<CalibratedAxis> getAxes();\n\n\t/**\n\t * Returns an array of the CalibratedAxis that, together, define the bounds of a\n\t * single plane in the dataset.\n\t *\n\t * @return List of CalibratedAxes. Ordering in the list indicates the axis\n\t * order in the image.\n\t */\n\tList<CalibratedAxis> getAxesPlanar();\n\n\t/**\n\t * Returns an array of the CalibratedAxis that define the number of planes in the\n\t * dataset.\n\t *\n\t * @return List of CalibratedAxes. Ordering in the list indicates the axis\n\t * order in the image.\n\t */\n\tList<CalibratedAxis> getAxesNonPlanar();\n\n\t/**\n\t * @return the number of planes in this image\n\t */\n\tlong getPlaneCount();\n\n\t/**\n\t * Returns an array of the lengths for axes associated with the specified\n\t * image index.\n\t * <p>\n\t * Ordering is consistent with the CalibratedAxis array returned by\n\t * {@link #getAxes()}.\n\t * </p>\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengths();\n\n\t/**\n\t * Returns an array of the lengths for axes in the provided CalibratedAxis list.\n\t * <p>\n\t * Ordering of the lengths is consistent with the provided ordering.\n\t * </p>\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengths(final List<CalibratedAxis> axes);\n\n\t/**\n\t * Returns an array of the lengths for the planar axes in this image.\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengthsPlanar();\n\n\t/**\n\t * Returns an array of the lengths for the non-planar axes in this image.\n\t *\n\t * @return Sorted axis length array\n\t */\n\tlong[] getAxesLengthsNonPlanar();\n\n\t// TODO: Consider typing rois and tables on more specific data structures.\n\n\t/** Retrieves the ROIs associated with this image. */\n\tObject getROIs();\n\n\t/** Retrieves the tables associated with this image. */\n\tObject getTables();\n\n\t/**\n\t * Appends the provided {@link CalibratedAxis} to the metadata's list of axes,\n\t * with a length of 1.\n\t *\n\t * @param axis - The new axis\n\t */\n\tvoid addAxis(final CalibratedAxis axis);\n\n\t/**\n\t * Appends the provided CalibratedAxis to the current CalibratedAxis array and\n\t * creates a corresponding entry with the specified value in axis lengths.\n\t *\n\t * @param axis - The new axis\n\t * @param value - length of the new axis\n\t */\n\tvoid addAxis(final CalibratedAxis axis, final long value);\n\n\t/**\n\t * As {@link #addAxis(CalibratedAxis, long)} using the default calibration\n\t * value, per {@link FormatTools#createAxis(AxisType)}.\n\t */\n\tvoid addAxis(final AxisType axisType, final long value);\n\n\t/**\n\t * @return A new copy of this ImageMetadata.\n\t */\n\tImageMetadata copy();\n\n\t/**\n\t * Populates this ImageMetadata using the provided instance.\n\t *\n\t * @param toCopy - ImageMetadata to copy\n\t */\n\tvoid copy(ImageMetadata toCopy);\n\n\t/**\n\t * As\n\t * {@link #populate(String, List, long[], int, boolean, boolean, boolean, boolean, boolean)}\n\t * but automatically determines bits per pixel.\n\t */\n\tvoid populate(String name, List<CalibratedAxis> axes, long[] lengths,\n\t\tint pixelType, boolean orderCertain, boolean littleEndian, boolean indexed,\n\t\tboolean falseColor, boolean metadataComplete);\n\n\t/**\n\t * Convenience method for manually populating an ImageMetadata.\n\t */\n\tvoid populate(String name, List<CalibratedAxis> axes, long[] lengths,\n\t\tint pixelType, int bitsPerPixel, boolean orderCertain, boolean littleEndian,\n\t\tboolean indexed, boolean falseColor, boolean metadataComplete);\n}", "void addMetaData(MetaDataDescriptor mdd);", "Metadata getMetaData();", "protected void setMetadata(AbstractMetadata metadata) {\n\t\tthis.metadata = metadata;\n\t}", "public abstract List<ColumnSpecification> metadata();", "Object getMetadata(String key);", "public void setMeta(Object aKey, Object aValue) {\n if (iIdentificationsMetaData == null) {\n iIdentificationsMetaData = new HashMap();\n }\n iIdentificationsMetaData.put(aKey, aValue);\n }", "public void updateColumnsFromTap(String fullTableName, Map<String, ColumnConfig> configs);", "private void addMetadataByProperty(Metadata metadata, Property property, String value) {\n if (value != null) {\n metadata.set(property, value);\n }\n }", "public Builder putMetadata(\n java.lang.String key,\n java.lang.String value) {\n if (key == null) { throw new java.lang.NullPointerException(); }\n if (value == null) { throw new java.lang.NullPointerException(); }\n internalGetMutableMetadata().getMutableMap()\n .put(key, value);\n return this;\n }", "public Builder putMetadata(\n java.lang.String key,\n java.lang.String value) {\n if (key == null) { throw new java.lang.NullPointerException(); }\n if (value == null) { throw new java.lang.NullPointerException(); }\n internalGetMutableMetadata().getMutableMap()\n .put(key, value);\n return this;\n }", "public AbstractJob addMetaData(String key, String value) {\n this.mMetaDataAttributes.add(new MetaData(key, value));\n return this;\n }", "public void defineMetadataTypes(Properties properties) throws ThinklabException {\r\n\t\t\r\n\t\tfor (Object p : properties.keySet()) {\r\n\t\t\t\r\n\t\t\tif (p.toString().startsWith(KBOX_METADATA_PREFIX)) {\r\n\t\t\t\tString cid = properties.getProperty(p.toString());\r\n\t\t\t\t\r\n\t\t\t\tString[] ss = p.toString().split(\"\\\\.\");\r\n\t\t\t\tString metadataName = ss[ss.length - 1];\r\n\t\t\t\t\r\n\t\t\t\tIConcept cc = KnowledgeManager.get().requireConcept(cid);\r\n\t\t\t\tmetadataTypes.put(metadataName, cc);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected Boolean updateSystemMetadata(SystemMetadata sysMeta, Map<String, String> tableMap)\n throws DataAccessException {\n\n Boolean updated = new Boolean(false);\n\n // Is the pid valid? (required)\n final Identifier pid = sysMeta.getIdentifier();\n if (pid.getValue() == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\",\n \"Identifier cannot be null\"));\n\n }\n\n // Is the size set? (required)\n final BigInteger size = sysMeta.getSize();\n if (size == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\", \"Size cannot be null\"));\n\n }\n\n // Is the checksum set? (required)\n final Checksum checksum = sysMeta.getChecksum();\n if (checksum == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\",\n \"Checksum cannot be null\"));\n\n }\n\n final SystemMetadata finalSysMeta = sysMeta;\n final String sysMetaTable = tableMap.get(SYSMETA_TABLE);\n final String smReplPolicyTable = tableMap.get(SM_POLICY_TABLE);\n final String smReplStatusTable = tableMap.get(SM_STATUS_TABLE);\n final String xmlAccessTable = tableMap.get(ACCESS_TABLE);\n\n updated = txTemplate.execute(new TransactionCallback<Boolean>() {\n\n @Override\n public Boolean doInTransaction(TransactionStatus status) {\n\n boolean success = false;\n // update the system metadata table\n String sqlStatement = getSysMetaUpdateStatement(sysMetaTable);\n Map<String, Object> sysMetaMap = extractSystemMetadataAttrs(finalSysMeta,\n sysMetaTable);\n Object[] values = getSysMetaAttrValues(sysMetaMap);\n int[] types = getSysMetaAttrTypes();\n int sysMetaRows = jdbcTemplate.update(sqlStatement, values, types);\n if (sysMetaRows == 1) {\n success = true;\n }\n\n // Update the smreplicationpolicy table\n ReplicationPolicy replPolicy = finalSysMeta.getReplicationPolicy();\n int totalReplPolicies = 0;\n int updatedReplPolicies = 0;\n\n if (replPolicy != null) {\n List<NodeReference> preferredNodes = replPolicy.getPreferredMemberNodeList();\n List<NodeReference> blockedNodes = replPolicy.getBlockedMemberNodeList();\n\n // first remove listed policy entries\n if (preferredNodes != null || blockedNodes != null) {\n jdbcTemplate.update(\"DELETE FROM \" + smReplPolicyTable + \" WHERE guid = ?\",\n new Object[] { pid.getValue() });\n }\n\n // count the number of total policies needed to be updated\n if (preferredNodes != null) {\n totalReplPolicies = totalReplPolicies + preferredNodes.size();\n\n // then update the preferred entries\n for (NodeReference preferredNode : preferredNodes) {\n String preferredNodeStr = preferredNode.getValue();\n int preferredRows = jdbcTemplate.update(\"INSERT INTO \"\n + smReplPolicyTable\n + \" (guid, member_node, policy) VALUES (?, ?, ?);\",\n new Object[] { pid.getValue(), preferredNodeStr, \"preferred\" },\n new int[] { java.sql.Types.LONGVARCHAR, java.sql.Types.VARCHAR,\n java.sql.Types.VARCHAR });\n updatedReplPolicies += preferredRows;\n }\n\n }\n\n if (blockedNodes != null) {\n totalReplPolicies = totalReplPolicies + blockedNodes.size();\n\n // then update the blocked entries\n for (NodeReference blockedNode : blockedNodes) {\n int blockedRows = jdbcTemplate.update(\"INSERT INTO \"\n + smReplPolicyTable\n + \" (guid, member_node, policy) VALUES (?, ?, ?);\",\n new Object[] { pid.getValue(), blockedNode.getValue(),\n \"blocked\" }, new int[] { java.sql.Types.LONGVARCHAR,\n java.sql.Types.VARCHAR, java.sql.Types.VARCHAR });\n updatedReplPolicies += blockedRows;\n\n }\n\n }\n\n // did we update what we were supposed to?\n if (updatedReplPolicies == totalReplPolicies) {\n success = true;\n\n } else {\n success = false;\n log.error(\"For identifier \" + pid.getValue() + \", only \"\n + updatedReplPolicies + \"replication policies of \"\n + totalReplPolicies + \"were inserted.\");\n\n }\n }\n\n // Update the smreplicationstatus table\n List<Replica> replicas = finalSysMeta.getReplicaList();\n int totalReplicas = 0;\n int updatedReplicas = 0;\n\n if (replicas != null) {\n totalReplicas = totalReplicas + replicas.size();\n\n // first remove listed replicas\n jdbcTemplate.update(\"DELETE FROM \" + smReplStatusTable + \" WHERE guid = ?\",\n new Object[] { pid.getValue() });\n\n for (Replica replica : replicas) {\n int replicaRows = jdbcTemplate\n .update(\"INSERT INTO \"\n + smReplStatusTable\n + \" (guid, member_node, status, date_verified) VALUES (?, ?, ?, ?)\",\n new Object[] {\n pid.getValue(),\n (replica.getReplicaMemberNode().getValue()),\n replica.getReplicationStatus().toString(),\n new Timestamp(replica.getReplicaVerified()\n .getTime()) }, new int[] {\n java.sql.Types.LONGVARCHAR, java.sql.Types.VARCHAR,\n java.sql.Types.VARCHAR, java.sql.Types.TIMESTAMP });\n updatedReplicas += replicaRows;\n }\n\n }\n\n if (updatedReplicas == totalReplicas) {\n success = true;\n\n } else {\n success = false;\n log.error(\"For identifier \" + pid.getValue() + \", only \" + updatedReplicas\n + \"replicas of \" + totalReplicas + \"were inserted.\");\n\n }\n\n // Update the xml_access table\n AccessPolicy accessPolicy = finalSysMeta.getAccessPolicy();\n int updatedAccessRows = 0;\n int numberOfSubjects = 0;\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n\n if (accessPolicy != null) {\n accessRules = accessPolicy.getAllowList();\n\n // first delete existing rules for this pid\n jdbcTemplate.update(\"DELETE FROM \" + xmlAccessTable + \" WHERE guid = ?\",\n new Object[] { pid.getValue() });\n\n // add the new rules back in\n for (AccessRule accessRule : accessRules) {\n List<Subject> subjects = accessRule.getSubjectList();\n numberOfSubjects += subjects.size();\n List<Permission> permissions = accessRule.getPermissionList();\n // convert permissions from text to int\n Integer perm = null;\n for (Permission permission : permissions) {\n if (perm != null) {\n perm |= convertPermission(permission);\n\n } else {\n perm = convertPermission(permission);\n }\n\n }\n\n for (Subject subject : subjects) {\n int accessRows = jdbcTemplate.update(\"INSERT INTO \" + xmlAccessTable\n + \" (guid, principal_name, permission, perm_type, perm_order) \"\n + \" VALUES (?, ?, ?, ?, ?)\", new Object[] { pid.getValue(),\n subject.getValue(), perm, \"allow\", \"allowFirst\" }, new int[] {\n java.sql.Types.LONGVARCHAR, java.sql.Types.VARCHAR,\n java.sql.Types.INTEGER, java.sql.Types.VARCHAR,\n java.sql.Types.VARCHAR });\n updatedAccessRows += accessRows;\n }\n }\n\n // Determine success for access policy updates\n if (updatedAccessRows == numberOfSubjects) {\n success = true;\n\n } else {\n success = false;\n log.error(\"For identifier \" + pid.getValue() + \", only \"\n + updatedAccessRows + \"replicas of \" + numberOfSubjects\n + \"were inserted.\");\n\n }\n\n }\n\n // rollback if we don't succeed on all calls\n // status.setRollbackOnly(); // seems to only trigger rollback, no commit\n return new Boolean(success);\n }\n\n });\n\n return updated;\n\n }", "protected void updateMetaData() {\r\n System.out.println(\"RefactoringAction.updateMetaData()\");\r\n System.out.flush();\r\n CurrentSummary.get().updateMetaData();\r\n }", "KeyMetadata metadata();", "public void setMetadata(PDMetadata meta)\n {\n stream.setItem(COSName.METADATA, meta);\n }", "private IndexMetadata createUpdatedIndexMetadata(IndexMetadata indexMetadata) {\n return IndexMetadata.builder(indexMetadata)\n .putMapping(\n createUpdatedIndexMetadata(\n indexMetadata.mapping(),\n indexMetadata.getIndex().getName()\n ))\n .build();\n }", "public void setTableSchema(List<String> tableNames, List<String> oringinalTableNames){\n tableSchemaMap = new HashMap<>();\n tableSchemaDir = databaseDir + File.separator + \"schema.txt\";\n HashMap<String,String> tableNamesOringinalTableNamesMap = new HashMap<>();\n for(int i = 0; i < tableNames.size(); i++) {\n tableNamesOringinalTableNamesMap.put(tableNames.get(i),oringinalTableNames.get(i));\n }\n //System.out.println(\"tableNamesOringinalTableNamesMap:\"+tableNamesOringinalTableNamesMap);\n try\n {\n FileReader fr = new FileReader(tableSchemaDir);\n BufferedReader br = new BufferedReader(fr);\n String nextline;\n String[] oneSchema;\n while((nextline = br.readLine()) != null)\n {\n oneSchema = nextline.split(\" \");\n String SchemaName = oneSchema[0];\n for(String tableNamesOringinalTableNamesMapKey:tableNamesOringinalTableNamesMap.keySet())\n {\n if(tableNamesOringinalTableNamesMap.get(tableNamesOringinalTableNamesMapKey).equals(SchemaName)){\n String[] newSchema = oneSchema.clone();\n newSchema[0] = tableNamesOringinalTableNamesMapKey;\n for(int i = 1; i < oneSchema.length; i++)\n newSchema[i] = tableNamesOringinalTableNamesMapKey + \".\" + newSchema[i];\n //String newSchemaName = tableNamesOringinalTableNamesMap.get(tableNamesOringinalTableNamesMapKey);\n tableSchemaMap.put(newSchema[0],newSchema);\n //System.out.println(\"tableSchemaMap:\"+ tableSchemaMap);\n }\n }\n }\n }\n catch (Exception e)\n {\n System.err.println(\"Failed to open file\");\n e.printStackTrace();\n }\n }", "protected String getSysMetaUpdateStatement(String sysMetaTable) {\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"UPDATE \" + sysMetaTable + \" SET \");\n // sql.append(\"guid = ?, \");\n sql.append(\"series_id\t\t = ?, \");\n sql.append(\"serial_version = ?, \");\n sql.append(\"date_uploaded = ?, \");\n sql.append(\"rights_holder = ?, \");\n sql.append(\"checksum = ?, \");\n sql.append(\"checksum_algorithm = ?, \");\n sql.append(\"origin_member_node = ?, \");\n sql.append(\"authoritive_member_node = ?, \");\n sql.append(\"date_modified = ?, \");\n sql.append(\"submitter = ?, \");\n sql.append(\"object_format = ?, \");\n sql.append(\"size = ?, \");\n sql.append(\"archived = ?, \");\n sql.append(\"replication_allowed = ?, \");\n sql.append(\"number_replicas = ?, \");\n sql.append(\"obsoletes = ?, \");\n sql.append(\"obsoleted_by = ?\");\n sql.append(\" WHERE guid = ? ;\");\n\n return sql.toString();\n }", "public ResultSetMetaData(TableMeta[] tMeta_, String[] columns_){\n\t\ttMeta = tMeta_;\n\t\tcolumns = columns_;\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public JSONObject updateMetadata(String projectID, String fileID, String newFilename, JSONObject metadataFields) throws Exception{\n\t\tif (projectID == null || fileID == null || (metadataFields == null && (newFilename == null || newFilename == \"\"))){\n\t\t\tthrow new Exception(\"Project ID and file ID must both be non null and must supply at least one metadata field to update.\");\n\t\t}\n\t\tJSONObject updateMetadataBodyParams = new JSONObject();\n\t\t// user wants to update file name\n\t\tif (newFilename != null && newFilename != \"\"){\n\t\t\tupdateMetadataBodyParams.put(\"name\", newFilename);\n\t\t}\n\t\tif (metadataFields != null ){\n\t\t\tupdateMetadataBodyParams.put(\"metadata\", metadataFields);\n\t\t}\n\t\tSBG updateMetadataRequest = new SBG(authToken, \"project/\" + projectID + \"/file/\" + fileID, \"PUT\", null, updateMetadataBodyParams);\n\t\treturn updateMetadataRequest.checkAndRetrieveResponse(updateMetadataRequest.generateRequest());\n\t}", "public void setMetadata(gov.niem.niem.structures._2_0.MetadataType metadata)\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.niem.niem.structures._2_0.MetadataType target = null;\n target = (gov.niem.niem.structures._2_0.MetadataType)get_store().find_element_user(METADATA$0, 0);\n if (target == null)\n {\n target = (gov.niem.niem.structures._2_0.MetadataType)get_store().add_element_user(METADATA$0);\n }\n target.set(metadata);\n }\n }", "public DaprSubscriptionBuilder setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n return this;\n }", "public Identifier saveSystemMetadata(SystemMetadata systemMetadata, Map<String, String> tableMap)\n throws DataAccessException {\n\n Boolean updated = new Boolean(false); // the result of all table updates transaction\n\n // Is the pid valid? (required)\n final Identifier pid = systemMetadata.getIdentifier();\n if (pid.getValue() == null) {\n throw new DataAccessException(new InvalidSystemMetadata(\"0000\",\n \"Identifier cannot be null\"));\n\n }\n\n // prep the transaction\n txTemplate.setName(pid.getValue());\n txTemplate.setReadOnly(false);\n\n SystemMetadata currentSysMeta = getSystemMetadata(pid, tableMap);\n // Is it in the table already?\n if (currentSysMeta == null) {\n Boolean inserted = new Boolean(false);\n final String finalSysMetaTable = tableMap.get(SYSMETA_TABLE);\n // insert just the pid\n inserted = txTemplate.execute(new TransactionCallback<Boolean>() {\n\n @Override\n public Boolean doInTransaction(TransactionStatus arg0) {\n Boolean success = new Boolean(false);\n\n int rows = jdbcTemplate.update(\"INSERT INTO \" + finalSysMetaTable\n + \" (guid) VALUES (?);\", new Object[] { pid.getValue() },\n new int[] { java.sql.Types.LONGVARCHAR });\n\n if (rows == 1) {\n success = new Boolean(true);\n }\n return success;\n }\n });\n }\n\n // then update the system metadata\n updated = updateSystemMetadata(systemMetadata, tableMap);\n\n // We failed and rolled back\n if (!updated.equals(true)) {\n throw new DataAccessException(new Exception(\"Failed to update identifier \"\n + pid.getValue()));\n }\n\n return pid;\n\n }", "void lockMetadata(String key);", "void updateLockedMetadata(String key, long value);", "public Builder addAllMetadata(Iterable<? extends MetadataEntry> values) {\n if (metadataBuilder_ == null) {\n ensureMetadataIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metadata_);\n onChanged();\n } else {\n metadataBuilder_.addAllMessages(values);\n }\n return this;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "public void registerMetadataType(Metadata m) throws Exception{\n db.registerMetadataType(m);\n }", "public void saveMetaData(Transaction tr) {\r\n\t\tDebug.indexLogger.debug(\"save BPlus index meta data on page {}\",\r\n\t\t\t\tmetaPageID);\r\n\t\tPage page = BufferManager.getPage(tr, metaPageID);\r\n\r\n\t\tpage.setType(tr, Page.TYPE_BTREE_HEADER);\r\n\t\t// always remember: first seek, then write\r\n\t\tpage.seek(Page.HEADER_LENGTH);\r\n\t\tpage.writeString(tr, name);\r\n\t\tpage.writeString(tr, table.getName());\r\n\t\tpage.writeInt(tr, columnID);\r\n\t\tpage.writeInt(tr, metaPageID);\r\n\t\tpage.writeInt(tr, isPrimary ? 1 : 0);\r\n\t\tpage.writeInt(tr, treeRoot);\r\n\r\n\t\tpage.release(tr);\r\n\r\n\t}", "protected abstract void updateTableDescriptor(HTableDescriptor desc)\n throws IOException;", "public abstract String metadata(String property);", "boolean containsMetadata(\n java.lang.String key);", "boolean containsMetadata(\n java.lang.String key);", "public void setMetadata(MediaMetadataCompat param1) {\n }", "public void setMetadata(gov.ucore.ucore._2_0.ContentMetadataType metadata)\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.ucore.ucore._2_0.ContentMetadataType target = null;\n target = (gov.ucore.ucore._2_0.ContentMetadataType)get_store().find_element_user(METADATA$0, 0);\n if (target == null)\n {\n target = (gov.ucore.ucore._2_0.ContentMetadataType)get_store().add_element_user(METADATA$0);\n }\n target.set(metadata);\n }\n }", "public void updateMetadata(String Artiste, String Titre, String Show) {\r\n\t if (remoteControlClient != null) {\r\n\t android.media.RemoteControlClient.MetadataEditor editor = remoteControlClient.editMetadata(false);\r\n\t \r\n\t editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, Artiste);\r\n\t editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, Titre);\r\n\t editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, Show);\r\n\t editor.apply();\r\n\t } \r\n\t }", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "protected void populateObjectMetadata(CosHttpResponse response, ObjectMetadata metadata) {\n for (Entry<String, String> header : response.getHeaders().entrySet()) {\n String key = header.getKey();\n if (StringUtils.beginsWithIgnoreCase(key, Headers.COS_USER_METADATA_PREFIX)) {\n key = key.substring(Headers.COS_USER_METADATA_PREFIX.length());\n metadata.addUserMetadata(key, header.getValue());\n } else if (ignoredHeaders.contains(key)) {\n // ignore...\n } else if (key.equalsIgnoreCase(Headers.LAST_MODIFIED)) {\n try {\n metadata.setHeader(key, DateUtils.parseRFC822Date(header.getValue()));\n } catch (Exception pe) {\n log.warn(\"Unable to parse last modified date: \" + header.getValue(), pe);\n }\n } else if (key.equalsIgnoreCase(Headers.CONTENT_LENGTH)) {\n try {\n metadata.setHeader(key, Long.parseLong(header.getValue()));\n } catch (NumberFormatException nfe) {\n log.warn(\"Unable to parse content length: \" + header.getValue(), nfe);\n }\n } else if (key.equalsIgnoreCase(Headers.DELETE_MARKER)) {\n metadata.setDeleteMarker(Boolean.parseBoolean(header.getValue()));\n } else if (key.equalsIgnoreCase(Headers.ETAG)) {\n metadata.setETag(StringUtils.removeQuotes(header.getValue()));\n } else if (key.equalsIgnoreCase(Headers.EXPIRES)) {\n try {\n metadata.setHttpExpiresDate(DateUtils.parseRFC822Date(header.getValue()));\n } catch (Exception pe) {\n log.warn(\"Unable to parse http expiration date: \" + header.getValue(), pe);\n }\n } else if (key.equalsIgnoreCase(Headers.EXPIRATION)) {\n new ObjectExpirationHeaderHandler<ObjectMetadata>().handle(metadata, response);\n } else if (key.equalsIgnoreCase(Headers.RESTORE)) {\n new ObjectRestoreHeaderHandler<ObjectRestoreResult>().handle(metadata, response);\n } else if (key.equalsIgnoreCase(Headers.FILE_MODE_DIR)) { // used for merge bucket\n metadata.setFileModeDir(true);\n } else {\n metadata.setHeader(key, header.getValue());\n }\n }\n }", "public Builder setMetadata(io.grafeas.v1.Metadata value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n metadata_ = value;\n } else {\n metadataBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "public void setMetadataText(String metadataText)\n {\n myMetadataText = metadataText;\n reset();\n }", "public Builder setMetadata(int index, MetadataEntry value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMetadataIsMutable();\n metadata_.set(index, value);\n onChanged();\n } else {\n metadataBuilder_.setMessage(index, value);\n }\n return this;\n }", "CustomUpdateQuery update(String table);", "protected void createMetaData(final TidaModel model) {\n\n\t\t// add some descriptors\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Dog\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Cat\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Mouse\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"ÜÄÖß\");\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tmodel.getMetaDataModel().createDescriptor(\"INT\", i);\n\t\t}\n\t\tfor (long i = Long.MAX_VALUE; i > Long.MAX_VALUE - 1000; i--) {\n\t\t\tmodel.getMetaDataModel().createDescriptor(\"LONG\", i);\n\t\t}\n\t}", "public interface MetadataDynamicable {\r\n\r\n default String getDynamicMetadata(String name){\r\n return getDynamicMetadatas().get(name);\r\n }\r\n\r\n default void setDynamicMetadata(String name, String value){\r\n getDynamicMetadatas().put(name, value);\r\n }\r\n\r\n default void clearDynamicMetadata(String name){\r\n getDynamicMetadatas().remove(name);\r\n }\r\n\r\n Map<String,String> getDynamicMetadatas();\r\n\r\n void setDynamicMetadatas(Map<String,String> metadatas);\r\n}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public MetaData getMetaData();", "private void setMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n metadata_ = value;\n bitField0_ |= 0x00000002;\n }", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "public void setMetadata(@Nullable MediaMetadata2 metadata) {\n if (metadata != null && !TextUtils.equals(mId, metadata.getMediaId())) {\n throw new IllegalArgumentException(\"metadata's id should be matched with the mediaId\");\n }\n mMetadata = metadata;\n }", "@Nullable\n @Generated\n @Selector(\"metadata\")\n public native NSDictionary<?, ?> metadata();", "public static void UpdateTable(String s) throws IOException {\n String result=\"\";\n String s_analysis=\"(?<=set ).+(?=;)\";\n String s_property=\"(.+)( where )(.+)\";\n String s_update_values=\"(.+)=(.+),(.+)=(.+)\";\n String table_name=\"\";//表名\n String find = \"\" ;\n String values=\"\";//where前面的属性\n String values1=\"\";//where后面的属性\n String []x=s.split(\" \");\n table_name=x[1];//表名\n// System.out.println(table_name); //student\n\n //此版块实现判断是否有此表\n File file = new File(\"E:\\\\\"+table_name+\".txt\");\n if(file.exists()){\n //此版块实现将set后语句识别出来\n Pattern p = Pattern.compile(s_analysis);\n Matcher m = p.matcher(s);\n m.find();\n find= m.group().toString();\n// System.out.println(find); //set id=6666,grade=3 where name=houwei\n //实现将where语句前后属性分解出来\n Pattern p1 = Pattern.compile(s_property);\n Matcher m1 = p1.matcher(find);\n while(m1.find()){\n\n values=m1.group(1); //存要设置的新值\n values1=m1.group(3); //存定位到修改行的依据值\n }\n// System.out.println(values); //id=6666,grade=3 (下标为1的那部分)\n// System.out.println(values1); //where name=houwei (下标为3的那部分)\n //此版块实现将需要修改的属性及其值得到\n int weizhi=-1;//\n String line=\"\",attr = \"\";\n\n String[] y=values1.split(\"=\");\n String y_alter_property=y[0];//需要修改的属性\n String y_alter_values=y[1];//需要修改的属性的值\n// System.out.println(y_alter_values+\"需要修改\"); // houwei\n //此版块实现获取更改的属性和值\n BufferedReader br = new BufferedReader(new FileReader(file));\n line=br.readLine();//读取第一行\n result+=line+\"\\r\\n\";\n // list.add(line+\"\\r\\n\");//添加第一行\n attr = line = br.readLine();//读取第二行 属性\n\n //===================================================\n String[] sAttr=attr.split(\" \"); //保存每个属性的值\n String tmp [];\n for(int i = 0;i<sAttr.length;i++){\n\n tmp = sAttr[i].split(\"\\\\(\");\n sAttr[i] = tmp[0];\n\n// System.out.println(\"sAttr[i]\"+sAttr[i]);\n\n }\n\n //用来保存每一行的值\n ArrayList<String> list=new ArrayList<String>();\n\n\n result+=line+\"\";\n // list.add(line+\"\\r\\n\");//添加第二行\n //将第二行数据用空格分开\n String[] h=line.split(\" \");\n\n\n for(int j=0;j<h.length;j++){\n //得到定位属性的位置\n if(y_alter_property.equals(h[j].replaceAll(\"\\\\(.*?\\\\)\",\"\"))){\n weizhi=j;\n// System.out.println(y_alter_property); //name\n }\n }\n// System.out.println(\"要修改的位置是:\"+weizhi); //0 根据哪个属性要修改值得下标\n\n //筛选出修改的值的内容\n String z =\"\";\n Pattern p2 = Pattern.compile(s_update_values);\n Matcher m2 = p2.matcher(values);\n m2.find();\n// System.out.println(m2.group().toString()+\"==================\");\n\n\n //===========================================================\n\n// for(int b=2;b<5;){\n// System.out.println(m2.group(b));\n// z+=m2.group(b)+\" \";\n// b+=2;\n// }\n// z+=y_alter_values;\n// System.out.println(z+\"lalal\");\n\n //存第一个要修改属性的值 houwei\n String a = m2.group(2);\n //存第二个要修改属性的值 6666\n String b = m2.group(4);\n\n //存第一个要修改的属性(含类型)\n String c = m2.group(1);\n //存第二个要修改的属性(含类型)\n String d = m2.group(3);\n\n// System.out.println(\"111111111111111111111\");\n// System.out.println(\"a \"+a);\n// System.out.println(\"b \"+b);\n// System.out.println(\"c \"+c);\n// System.out.println(\"d \"+d);\n\n //从第三行开始读\n while((line=br.readLine())!=null){\n\n// System.out.println(\"读取的行是:\"+line);\n String[] k=line.split(\" \");\n\n if(k==null){\n\n// System.out.println(\"此表中没有值\");\n\n }\n\n //读到的那一行的属性值为 where的属性\n else if(k[weizhi].equals( y_alter_values )){\n\n result+=\"\\r\\n\";\n\n //建立一个动态数组\n // 1. 将修改的值变成新的值 填入动态数组对应的位置\n // 2. 将未修改的值也存入对应位置\n // 3. 将该动态数组拼接成一个字符串(最后加\\r\\n)\n // 4. 接着读取下面的行,重复以上操作\n\n //先将原一行原数据放入数组中\n for(int i = 0;i<k.length;i++) {\n list.add(k[i]);\n }\n\n for(int i = 0;i<k.length;i++){\n\n // if(c == sAttr[i]){\n if(sAttr[i].equals(c)){\n list.set(i,a);\n }\n\n\n //if(d == sAttr[i]){\n if(d.equals(sAttr[i])){\n list.set(i,b);\n\n }\n\n }\n\n // result+=\"\\r\\n\";\n\n for(int i = 0;i<k.length;i++){\n\n result+=list.get(i)+\" \";\n\n }\n\n\n }else{\n //没有则按照原来情况正常写入\n// System.out.println(\"正常\");\n result+=\"\\r\\n\"+line;\n\n }\n }\n //将字符串写入文件中\n System.out.println(result);\n FileWriter fileWriter=new FileWriter(\"E:\\\\\"+table_name+\".txt\", false);\n fileWriter.write(result+\"\");\n fileWriter.close();\n System.out.println(\"成功执行\");\n\n }else{\n System.out.println(\"此表不存在\");\n }\n\n\n\n\n }", "@POST( CONTROLLER + METADATA_PATH )\n VersionedObjectKey createMetadataObject( @Body CreateMetadataObjectRequest request );", "public void setMetadata(@Nullable final Metadata metadata) {\n mMetadata = metadata;\n }", "public interface MetaData extends MetaSearch {\n\t/** place holder for mandatory meta data */\n\tpublic static String sPLACE_HOLDER = \"(...)\";\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get archive with which this MetaData instance is associated (null for\n\t * template meta data).\n\t * \n\t * @return open archive associated with these meta data.\n\t */\n\tpublic Archive getArchive();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set template meta data from which descriptions for matching database objects\n\t * are copied\n\t * \n\t * @param mdTemplate template meta data.\n\t * @throws IOException if an I/O error occurred.\n\t */\n\tpublic void setTemplate(MetaData mdTemplate) throws IOException;\n\n\t/*\n\t * ==================================================================== global\n\t * properties\n\t * ====================================================================\n\t */\n\t/**\n\t * get current version of SIARD format of XML. If an file of an older SIARD\n\t * format is opened, the older version is returned until a change in the meta\n\t * data is saved, at which point the meta data are saved in the current format.\n\t * \n\t * @return version of SIARD format of XML.\n\t */\n\tpublic String getVersion();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of the archived database (must not be null or empty!).\n\t * \n\t * @param sDbName name of the archived database.\n\t */\n\tpublic void setDbName(String sDbName);\n\n\t/**\n\t * get name of the archived database.\n\t * \n\t * @return name of the archived database.\n\t */\n\tpublic String getDbName();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set short free form description of the database content.\n\t * \n\t * @param sDescription short free form description of the database content.\n\t */\n\tpublic void setDescription(String sDescription);\n\n\t/**\n\t * get short free form description of the database content.\n\t * \n\t * @return short free form description of the database content.\n\t */\n\tpublic String getDescription();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of person responsible for archiving the database.\n\t * \n\t * @param sArchiver name of person responsible for archiving the database.\n\t */\n\tpublic void setArchiver(String sArchiver);\n\n\t/**\n\t * get name of person responsible for archiving the database.\n\t * \n\t * @return name of person responsible for archiving the database.\n\t */\n\tpublic String getArchiver();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set contact data (telephone number or email address) of archiver.\n\t * \n\t * @param sArchiverContact contact data (telephone number or email address) of\n\t * archiver.\n\t */\n\tpublic void setArchiverContact(String sArchiverContact);\n\n\t/**\n\t * get contact data (telephone number or email address) of archiver.\n\t * \n\t * @return contact data (telephone number or email address) of archiver.\n\t */\n\tpublic String getArchiverContact();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of data owner (section and institution responsible for data) of\n\t * database when it was archived.\n\t * \n\t * @param sDataOwner name of data owner.\n\t */\n\tpublic void setDataOwner(String sDataOwner);\n\n\t/**\n\t * get name of data owner (section and institution responsible for data) of\n\t * database when it was archived.\n\t * \n\t * @return name of data owner.\n\t */\n\tpublic String getDataOwner();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set time span during which data where entered into the database.\n\t * \n\t * @param sDataOriginTimespan time span during which data where entered into the\n\t * database.\n\t */\n\tpublic void setDataOriginTimespan(String sDataOriginTimespan);\n\n\t/**\n\t * get time span during which data where entered into the database.\n\t * \n\t * @return time span during which data where entered into the database.\n\t */\n\tpublic String getDataOriginTimespan();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set global folder for external LOB files. Can only be set if the field is not\n\t * null or the SIARD archive is open for modification of primary data and still\n\t * empty. It must not be set to null. It must start with \"..\", \"/\" or \"file:/\".\n\t * It must be terminated with \"/\" (because it denotes a folder). If the given\n\t * URI starts with \"file:/\", it refers to a remote absolute folder. If it starts\n\t * with \"/\" it refers to an absolute local folder. Otherwise it is a relative\n\t * URI. If the global lobFolder is set, it is to be resolved relative to it.\n\t * Otherwise it must start with \"..\" which refers to the folder containing the\n\t * SIARD file.\n\t * \n\t * @param uriLobFolder URI for global folder for external files.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setLobFolder(URI uriLobFolder) throws IOException;\n\n\t/**\n\t * get global folder for external LOB files.\n\t * \n\t * @return root folder for external LOB files.\n\t */\n\tpublic URI getLobFolder();\n\n\t/**\n\t * absolute global folder for external LOB files or null, if no global LOB\n\t * folder is set.\n\t * \n\t * @return absolute global folder for external LOB files or null, if no global\n\t * LOB folder is set.\n\t */\n\tpublic URI getAbsoluteLobFolder();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name and version of program that generated the metadata file. Can only be\n\t * set if the SIARD archive is open for modification of primary data.\n\t * \n\t * @param sProducerApplication name and version of program that generated the\n\t * metadata file.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setProducerApplication(String sProducerApplication) throws IOException;\n\n\t/**\n\t * get name and version of program that generated the metadata file.\n\t * \n\t * @return name and version of program that generated the metadata file.\n\t */\n\tpublic String getProducerApplication();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get date of creation of archive (automatically generated by SIARD).\n\t * \n\t * @return date of creation of archive (automatically generated by SIARD).\n\t */\n\tpublic Calendar getArchivalDate();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get message digest codes over all primary data in folder \"content\".\n\t * \n\t * @return message digest codes over all primary data in folder \"content\".\n\t */\n\tpublic List<MessageDigestType> getMessageDigest();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set DNS name of client machine from which connection to the database was\n\t * established for archiving. Can only be set if the SIARD archive is open for\n\t * modification of primary data.\n\t * \n\t * @param sClientMachine DNS name of client machine from which connection to the\n\t * database was established for archiving.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setClientMachine(String sClientMachine) throws IOException;\n\n\t/**\n\t * get DNS name of client machine from which connection to the database was\n\t * established for archiving.\n\t * \n\t * @return DNS name of client machine from which connection to the database was\n\t * established for archiving.\n\t */\n\tpublic String getClientMachine();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set name of database product and version from which database originates. Can\n\t * only be set if the SIARD archive is open for modification of primary data.\n\t * \n\t * @param sDatabaseProduct name of database product and version from which\n\t * database originates.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setDatabaseProduct(String sDatabaseProduct) throws IOException;\n\n\t/**\n\t * get name of database product and version from which database originates.\n\t * \n\t * @return name of database product and version from which database originates.\n\t */\n\tpublic String getDatabaseProduct();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set connection string (JDBC URL) used for archiving. Can only be set if the\n\t * SIARD archive is open for modification of primary data.\n\t * \n\t * @param sConnection connection string (JDBC URL) used for archiving.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setConnection(String sConnection) throws IOException;\n\n\t/**\n\t * get connection string (JDBC URL) used for archiving.\n\t * \n\t * @return connection string (JDBC URL) used for archiving.\n\t */\n\tpublic String getConnection();\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * set database user used for archiving Can only be set if the SIARD archive is\n\t * open for modification of primary data.\n\t * \n\t * @param sDatabaseUser database user used for archiving.\n\t * @throws IOException if the value could not be set.\n\t */\n\tpublic void setDatabaseUser(String sDatabaseUser) throws IOException;\n\n\t/**\n\t * get database user used for archiving.\n\t * \n\t * @return database user used for archiving.\n\t */\n\tpublic String getDatabaseUser();\n\n\t/*\n\t * ==================================================================== list\n\t * properties\n\t * ====================================================================\n\t */\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of schema meta data entries.\n\t * \n\t * @return number of schema meta data entries.\n\t */\n\tpublic int getMetaSchemas();\n\n\t/**\n\t * get the schema meta data with the given index.\n\t * \n\t * @param iSchema index of schema meta data.\n\t * @return schema meta data.\n\t */\n\tpublic MetaSchema getMetaSchema(int iSchema);\n\n\t/**\n\t * get the schema meta data with the given name.\n\t * \n\t * @param sName name of schema meta data.\n\t * @return schema meta data.\n\t */\n\tpublic MetaSchema getMetaSchema(String sName);\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of user meta data entries.\n\t * \n\t * @return number of user meta data entries.\n\t */\n\tpublic int getMetaUsers();\n\n\t/**\n\t * get the user meta data with the given index.\n\t * \n\t * @param iUser index of user meta data.\n\t * @return user meta data.\n\t */\n\tpublic MetaUser getMetaUser(int iUser);\n\n\t/**\n\t * get the user meta data with the given user name.\n\t * \n\t * @param sName user name.\n\t * @return user meta data.\n\t */\n\tpublic MetaUser getMetaUser(String sName);\n\n\t/**\n\t * add new user to meta data. A new user can only be created if the SIARD\n\t * archive is open for modification of primary data.\n\t * \n\t * @param sName user name of the new user meta data.\n\t * @return user meta data.\n\t * @throws IOException if new user could be created.\n\t */\n\tpublic MetaUser createMetaUser(String sName) throws IOException;\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of role meta data entries.\n\t * \n\t * @return number of role meta data entries.\n\t */\n\tpublic int getMetaRoles();\n\n\t/**\n\t * get the role meta data with the given index.\n\t * \n\t * @param iRole index of role meta data.\n\t * @return role meta data.\n\t */\n\tpublic MetaRole getMetaRole(int iRole);\n\n\t/**\n\t * get the role meta data with the given role name.\n\t * \n\t * @param sName role name.\n\t * @return role meta data.\n\t */\n\tpublic MetaRole getMetaRole(String sName);\n\n\t/**\n\t * add new role meta data. A new role can only be created if the SIARD archive\n\t * is open for modification of primary data.\n\t * \n\t * @param sName role name of the new role meta data.\n\t * @param sAdmin name of administrator (user or role) of the new role.\n\t * @return role meta data.\n\t * @throws IOException if new user could be created.\n\t */\n\tpublic MetaRole createMetaRole(String sName, String sAdmin) throws IOException;\n\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * get number of privilege meta data entries.\n\t * \n\t * @return number of privilege meta data entries.\n\t */\n\tpublic int getMetaPrivileges();\n\n\t/**\n\t * get the privilege meta data with the given index.\n\t * \n\t * @param iPrivilege index of privilege meta data.\n\t * @return privilege meta data.\n\t */\n\tpublic MetaPrivilege getMetaPrivilege(int iPrivilege);\n\n\t/**\n\t * get the privilege meta data with the given content.\n\t * \n\t * @param sType type of privilege including ROLE privilege or ALL PRIVILEGES.\n\t * @param sObject object of privilege (or null for ROLE privilege).\n\t * @param sGrantor name of grantor of privilege (user or role).\n\t * @param sGrantee name od grantee of privilege (user or role).\n\t * @return privilege meta data.\n\t */\n\tpublic MetaPrivilege getMetaPrivilege(String sType, String sObject, String sGrantor, String sGrantee);\n\n\t/**\n\t * add new privilege meta data. A new privilege can only be created if the SIARD\n\t * archive is open for modification of primary data.\n\t * \n\t * @param sType type of privilege including ROLE privilege or ALL PRIVILEGES.\n\t * @param sObject privilege object (may be null for ROLE privilege)\n\t * @param sGrantor name of grantor (user or role).\n\t * @param sGrantee name of grantee (user or role).\n\t * @return privilge meta data.\n\t * @throws IOException if new user could be created.\n\t */\n\tpublic MetaPrivilege createMetaPrivilege(String sType, String sObject, String sGrantor, String sGrantee)\n\t\t\tthrows IOException;\n\n\t/*\n\t * ==================================================================== methods\n\t * ====================================================================\n\t */\n\t/*------------------------------------------------------------------*/\n\t/**\n\t * checks whether this is the meta data instance of a valid archive, i.e.\n\t * whether it contains at least one table containing at least one record of\n\t * primary data.\n\t * \n\t * @return true, if instance is valid.\n\t */\n\tpublic boolean isValid();\n\n}" ]
[ "0.7090766", "0.6584375", "0.6407535", "0.6253085", "0.6215429", "0.6157469", "0.6018742", "0.59720045", "0.5966004", "0.5954509", "0.5890431", "0.5888926", "0.5821971", "0.58004886", "0.57220876", "0.56823874", "0.5663753", "0.56547165", "0.56187725", "0.5601447", "0.55955946", "0.5569895", "0.5569895", "0.55539924", "0.5545391", "0.5532796", "0.5478811", "0.5465175", "0.5454359", "0.5431501", "0.53671354", "0.5364683", "0.535699", "0.53473675", "0.5322399", "0.5321241", "0.52987164", "0.5291358", "0.52910864", "0.52506757", "0.52472055", "0.5238533", "0.52367693", "0.5216892", "0.5212158", "0.5211497", "0.52074087", "0.5176061", "0.5152195", "0.5151825", "0.51291984", "0.5118442", "0.5118442", "0.5116607", "0.51152664", "0.51116085", "0.5098302", "0.5087915", "0.50705576", "0.5058135", "0.5050952", "0.5017107", "0.49886915", "0.4988643", "0.4985124", "0.49806982", "0.4977365", "0.49742523", "0.49742183", "0.49736494", "0.49654782", "0.4955289", "0.49539238", "0.4953556", "0.49465394", "0.4944273", "0.494342", "0.494342", "0.49411932", "0.49380672", "0.49368826", "0.49364334", "0.4933804", "0.49274626", "0.4921535", "0.4910529", "0.4908962", "0.49059013", "0.49012208", "0.48918498", "0.48830557", "0.48731792", "0.4869462", "0.48642725", "0.48628664", "0.4860541", "0.48595163", "0.48529613", "0.48506188", "0.48465353" ]
0.64221835
2
Clears (drops) one or all tables in the database cluster. The operation is synchronous meaning that the table will be cleared before the function returns. The response payload returns the status of the operation along with the name of the table that was cleared.
public ClearTableResponse clearTable(ClearTableRequest request) throws GPUdbException { ClearTableResponse actualResponse_ = new ClearTableResponse(); submitRequest("/clear/table", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClearTableResponse clearTable(String tableName, String authorization, Map<String, String> options) throws GPUdbException {\n ClearTableRequest actualRequest_ = new ClearTableRequest(tableName, authorization, options);\n ClearTableResponse actualResponse_ = new ClearTableResponse();\n submitRequest(\"/clear/table\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void clearTables()\n\t{\n\t\ttry {\n\t\t\tclearStatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tif (DEBUG) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public MessageResponse clear() {\n Database db = new Database();\n try {\n db.clear();\n } catch (DatabaseException dbe) {\n return new MessageResponse(dbe.toString());\n }\n return new MessageResponse(\"Clear succeeded\");\n }", "@DELETE\n @Consumes(MediaType.APPLICATION_JSON)\n public String clearOrderTable() {\n service.deleteOrders();\n return \"deleted orders\";\n }", "public void clearTable(String tableName) throws Exception {\n DefaultDataSet dataset = new DefaultDataSet();\n dataset.addTable(new DefaultTable(tableName));\n DatabaseOperation.DELETE_ALL.execute(conn, dataset);\n }", "@Override\n public void clearTable() {\n final var query = \"TRUNCATE TABLE piano_project.pianos\";\n try(final var statement = connection.createStatement()) {\n statement.executeUpdate(query);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }", "@Override\n public void clearDB() throws Exception {\n hBaseOperation.deleteTable(this.dataTableNameString);\n hBaseOperation.createTable(this.dataTableNameString, this.columnFamily, numRegion);\n }", "public void clear() {\n tableCache.invalidateAll();\n }", "private void clearTable(String tableName) throws SQLException {\n Connection conn = getConnection();\n String setStatement = \"DELETE FROM \" + tableName;\n Statement stm = conn.createStatement();\n stm.execute(setStatement);\n }", "void dropAllTables();", "public void wipeTable() {\n SqlStorage.wipeTable(db, TABLE_NAME);\n }", "void dropAllTablesForAllConnections();", "public void clear() throws DBException\n {\n String sqlString = \"DELETE FROM user\";\n try(Statement statement = conn.createStatement())\n {\n statement.executeUpdate(sqlString);\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Error while clearing user table\");\n }\n\n\n }", "void cleanupTable(TableName tablename) throws Exception {\n if (tbl != null) {\n tbl.close();\n tbl = null;\n }\n\n ((ClusterConnection) connection).clearRegionCache();\n deleteTable(TEST_UTIL, tablename);\n }", "@Modifying\n @Transactional\n @Query(\"DELETE FROM \" + dbName)\n void deleteAllFromTable();", "public void clearDatabase();", "public void clearTables() {\r\n // your code here\r\n\t\ttry {\r\n\t\t\tdeleteReservationStatement.executeUpdate();\r\n\t\t\tdeleteBookingStatement.executeUpdate();\r\n\t\t\tdeleteUserStatement.executeUpdate();\r\n\t\t} catch (SQLException e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "public void clearTable(){\n\t\tloaderImage.loadingStart();\n\t\tfullBackup.clear();\n\t\tlist.clear();\n\t\toracle.clear();\n\t\tselectionModel.clear();\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t}", "@Override\n\tpublic int deleteAll() {\n\t\treturn SApplicationcategorydao.executeHql(\"delete from \"+tablename);\n\t}", "@Override\n\tpublic void emptyTable() {\n\t\tresTable.deleteAll();\n\t}", "public void clear() throws RemoteException, Error;", "public void Clear() throws DataAccessException {\n try (Statement stmt = conn.createStatement()){\n String sql = \"DELETE FROM Event\";\n stmt.executeUpdate(sql);\n } catch (SQLException e) {\n throw new DataAccessException(\"SQL Error encountered while clearing tables\");\n }\n }", "public void clearAllTable() {\n\t\tint rowCount = dmodel.getRowCount();\n\t\tfor (int i = rowCount - 1; i >= 0; i--) {\n\t\t\tdmodel.removeRow(i);\n\t\t}\n\t}", "public abstract void destroyTables() throws DataServiceException;", "public void clear() throws DBException\n {\n String sqlString = \"DELETE FROM authToken\";\n try(Statement statement = conn.createStatement())\n {\n statement.executeUpdate(sqlString);\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Error while clearing authToken table\");\n }\n }", "public void dropTable();", "void clearAllItemsTable();", "public void flushAllTables() {\n\t}", "public int dropTable() \n throws InterruptedException, IOException \n {\n return dropTable(false);\n }", "public void clear() {\n\t\tfor (int i = 0; i < table.size(); i++) {\n\t\t\ttable.get(i).clear();\n\t\t}\n\t}", "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 }", "public void clearUserTable() {\n\t\tSQLDelete deleteStatament = new SQLDelete();\n\t\tdeleteStatament.clearUserTable();\n\t}", "@Synchronized\r\n public int deleteAllTransfersData() {\r\n return databaseHandler.deleteData(TableTransferModel.TABLE_NAME, \"\", null);\r\n }", "public void cleanTable() throws ClassicDatabaseException;", "public void clearCollection() {\n\t\tMongoDatabase db = mongoClient.getDatabase(MongoActions.props.getDBName());\n\t\tMongoCollection<Document> table = db.getCollection(MongoActions.props.getCollectionName());\n\t\ttable.drop();\n\t}", "public void clearTables() {\n\t _database.delete(XREF_TABLE, null, null);\n\t _database.delete(ORDER_RECORDS_TABLE, null, null); \n\t}", "public void deleteTableRecords()\n {\n coronaRepository.deleteAll();\n }", "@Override\r\n\tpublic void clearDatabase() {\n\t\t\r\n\t}", "@AfterEach\n\tvoid clearDatabase() {\n\t\t//Clear the table\n\t\taccountRepository.deleteAll();\n\t}", "public void dropTable() {\n }", "@Test\n public void testDropTable() throws Exception {\n String tableName = createTable(true, true, false);\n\n assertTableIsRegistered(DEFAULT_DB, tableName);\n assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), \"id\"));\n assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), NAME));\n\n String query = String.format(\"drop table %s \", tableName);\n\n runCommandWithDelay(query, 3000);\n\n assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), \"id\"));\n assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), NAME));\n assertTableIsNotRegistered(DEFAULT_DB, tableName);\n }", "@Override\n public void deleteAll() {\n String deleteAllQuery = \"DELETE FROM \" + getTableName();\n getJdbcTemplate().execute(deleteAllQuery);\n }", "public void clearTable() {\n reportTable.getColumns().clear();\n }", "public void clearDatabase() {\n\n\t\tObjectSet<Article> articles = db.query(Article.class);\n\t\tarticles.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<CreditCard> creditCards = db.query(CreditCard.class);\n\t\tcreditCards.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Customer> customers = db.query(Customer.class);\n\t\tcustomers.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Order> orders = db.query(Order.class);\n\t\torders.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<OrderDetail> orderDetails = db.query(OrderDetail.class);\n\t\torderDetails.stream()\n\t\t\t.forEach(db::delete);\n\t\t\n\t\tSystem.out.println(\"\\nBase de dades esborrada per complet\");\n\t}", "static void emptyTable () {\n Session session = null;\n Transaction transaction = null;\n try {\n session = sessionFactory.openSession();\n transaction = session.beginTransaction();\n Query query = session.createQuery(\"DELETE from ReservationsEntity \");\n query.executeUpdate();\n Query query2 = session.createQuery(\"DELETE from OrdersEntity \");\n query2.executeUpdate();\n\n Query query3 = session.createQuery(\"DELETE from TablesEntity \");\n query3.executeUpdate();\n transaction.commit();\n }\n catch (Exception e)\n {\n if (transaction != null) {\n transaction.rollback();\n }\n throw e;\n } finally {\n if (session != null) {\n session.close();\n }\n }\n }", "public void clearDatabase(){\n\t\tem.createNativeQuery(\"DELETE FROM CAMINHO\").executeUpdate();\r\n\t\tem.createNativeQuery(\"DELETE FROM MAPA\").executeUpdate();\r\n\t\t\r\n\t\tlog.info(\"Limpou a base de dados\");\r\n\t\r\n\t}", "public Builder clearTables() {\n if (tablesBuilder_ == null) {\n tables_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n } else {\n tablesBuilder_.clear();\n }\n return this;\n }", "void clearDeletedItemsTable();", "public void deleteAllTransactions();", "public void clearDatabase() {\n new ExecutionEngine(this.database).execute(\"MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r, n\");\n }", "private static void clearDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n clearTable(\"myRooms\");\n clearTable(\"myReservations\");\n }", "public synchronized void clear() {\n ServerDescEntry tab[] = table;\n for (int index = tab.length; --index >= 0; )\n tab[index] = null;\n count = 0;\n }", "public void clear() {\r\n\t\tfor (int i = 0; i < table.length; i++) {\r\n\t\t\ttable[i] = null;\r\n\t\t}\r\n\r\n\t\tmodificationCount++;\r\n\t\tsize = 0;\r\n\t}", "@Override\r\n public boolean deleteAll(String strTable)\r\n { try\r\n { String strSQL = \"DELETE * FROM \" + strTable;\r\n status(strSQL);\r\n dbCmdText.executeUpdate(strSQL);\r\n\r\n // dbRecordset.close();\r\n } catch (SQLException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n return false;\r\n }", "boolean dropTable();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void clear( )\r\n\t{\r\n\t\tfor (int i =0; i< this.tableSize; i++)\r\n\t\t\t{ ((LinkedArrays<T>) table[i]).clear(); }\r\n\t\tthis.size = 0; \r\n\t\t\r\n\t}", "public void clearData(){\n\t\t\n\t\tclearTable(conditionTableModel);\n\t\tclearTable(faultTableModel);\n\t}", "@Test\n public void removeAll_204() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n addMOToDb(3);\n\n // PREPARE THE TEST\n // Nothing to do\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(204, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "public void clearBatch() throws SQLException {\n\r\n }", "@Test\n public void removeAll_204_empty() throws Exception {\n\n // PREPARE THE DATABASE\n // Database is empty\n\n // PREPARE THE TEST\n // Nothing to do\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(204, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "public void clear() {\n table = new Handle[defaultSize];\n logicalSize = 0;\n }", "public void doDropTable();", "public int dropTable(boolean quiet) \n throws InterruptedException, IOException \n {\n // if (! tablecreated) \n // System.err.println(\"Warning: table not created yet?\");\n\n Process client = startDbClient();\n PrintWriter w = \n new PrintWriter(new OutputStreamWriter(client.getOutputStream()));\n w.print(\"DROP TABLE \");\n w.print(tbl);\n w.println(\";\");\n w.close();\n\n client.waitFor();\n if (! quiet) {\n if (client.exitValue() > 0) {\n for (String line : emsgs) \n System.err.println(line);\n }\n else {\n tablecreated = false;\n System.err.println(\"Existing table \"+tbl+\" dropped\");\n }\n }\n\n return client.exitValue();\n }", "@Override\n public void deleteAll(final Connection _con) throws SQLException {\n\n final Statement stmtSel = _con.createStatement();\n final Statement stmtExec = _con.createStatement();\n\n try {\n // remove all foreign keys\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Foreign Keys\");\n }\n ResultSet rs = stmtSel.executeQuery(SELECT_ALL_KEYS);\n while (rs.next()) {\n final String tableName = rs.getString(1);\n final String constrName = rs.getString(2);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - Table '\" + tableName + \"' Constraint '\" + constrName + \"'\");\n }\n stmtExec.execute(\"alter table \" + tableName + \" drop constraint \" + constrName);\n }\n rs.close();\n\n // remove all views\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Views\");\n }\n rs = stmtSel.executeQuery(SELECT_ALL_VIEWS);\n while (rs.next()) {\n final String viewName = rs.getString(1);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - View '\" + viewName + \"'\");\n }\n stmtExec.execute(\"drop view \" + viewName);\n }\n rs.close();\n\n // remove all tables\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Tables\");\n }\n rs = stmtSel.executeQuery(SELECT_ALL_TABLES);\n while (rs.next()) {\n final String tableName = rs.getString(1);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - Table '\" + tableName + \"'\");\n }\n stmtExec.execute(\"drop table \" + tableName);\n }\n rs.close();\n } finally {\n stmtSel.close();\n stmtExec.close();\n }\n }", "public void deleteAllRequests() {\n try {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, null, null);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n db.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void doEmptyTableList() {\n tableList.deleteList();\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/infrastructures\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionInfrastructure();", "public void clearDatabase() {\n\t\tstudentRepository.deleteAll();\n\t}", "@Override\n public void clear() {\n reference.dropColumnFamily(mapName);\n columnFamilyHandle = reference.getOrCreateColumnFamily(mapName);\n size.set(0L);\n updateLastModifiedTime();\n }", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"Mysql DB 서버에 접속해서 삭제를 하다.\");\n\t}", "void clear( final ResultProcs procs )\n {\n enqueue( new Runnable() {\n @Override\n public void run() {\n int result = getWritableDatabase()\n .delete( LOGS_TABLE_NAME, \"1\", null );\n procs.onCleared( result );\n }\n } );\n }", "private void clearAllDatabases()\n\t{\n\t\tdb.clear();\n\t\tstudent_db.clear();\n\t}", "public void clearAll();", "public void clearAll();", "public static void resetTable() {\n tableModel.resetDefault();\n updateSummaryTable();\n }", "public void resetTable() {\n\t\tif (table != null) {\n\t\t\ttable.removeAll();\n\t\t}\n\t}", "public void dropAll () {\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tif (dbCol.getIndexInfo().size()>0)\n\t\t\tdbCol.dropIndexes();\n\t\tdbCol.drop();\n\t\t\t \n\t\t\n\t}", "private static void clearRedis() {\n StringRedisTemplate redisTemplate = getRedisTemplate();\n Set<String> keys = redisTemplate.keys(\"*\");\n for (String key : keys) {\n redisTemplate.delete(key);\n Assert.assertFalse(redisTemplate.hasKey(key));\n }\n }", "void clearAllIndexes();", "public void deleteAll() {\n repository.deleteAll();\n }", "public void deleteAll();", "@Override\n public void cleanUsersTable() {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n session.createQuery(\"delete from User\").executeUpdate();\n tx.commit();\n System.out.println(\"HibCleaning users table\");\n session.close();\n\n }", "public void deleteAll() {\n\t\t mongoTemplate.remove(new Query(), COLLECTION);\n\t}", "public void deleteAll();", "public void deleteAll();", "public void deleteAll();", "public int clear() {\n int result = 0;\n for( Iterator it = this.rcIterator(); it.hasNext() ; ){\n ReplicaCatalog catalog = (ReplicaCatalog) it.next();\n result += catalog.clear();\n }\n return 0;\n }", "public static boolean testTableClear() {\r\n table.clear();\r\n if (table.size() != 0)\r\n return false;\r\n return true;\r\n }", "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}", "void clear() throws PapooseException;", "public String execute() throws SQLException {\n\t\t/*conn = DataBase.getConnection();\n\t\tst = conn.createStatement();\n\t\tString sql=\"drop table user\";\n\t\tst.execute(sql);*/\n\t\treturn \"SUCCESS\";\n\n\t}", "private void clearData() {\r\n em.createQuery(\"delete from MonitoriaEntity\").executeUpdate();\r\n }", "@Test\n public void dropTable() {\n try {\n String sql = \"drop table if exists \" + \"\";\n boolean resultSet = statement.execute(sql);\n System.out.println(resultSet);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void deleteTable(String tableName) {\n try {\n connectToDB(\"jdbc:mysql://localhost/EmployeesProject\");\n } catch (Exception e) {\n System.out.println(\"The EmployeesProject db does not exist!\\n\"\n + e.getMessage());\n }\n String sqlQuery = \"drop table \" + tableName;\n try {\n stmt.executeUpdate(sqlQuery);\n } catch (SQLException ex) {\n System.err.println(\"Failed to delete '\" + tableName + \n \"' table.\\n\" + ex.getMessage());\n }\n }", "public void deleteAll() throws SQLException {\n\t\tfinal String sql = \"DELETE FROM \" + table_name;\n\t\tPreparedStatement statement = null;\n\n\t\ttry {\n\t\t\tfinal Connection connection = _database.getConnection();\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tfinal int rowcount = update(statement);\n\t\t} finally {\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\t\t}\n\t}", "@RequestMapping(\"reset\")\n\tpublic @ResponseBody\n\tString resetDB() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tList<SwapItem> items = dao.findAll();\n\t\tfor (SwapItem item : items) {\n\t\t\tint result = dao.delete(item);\n\t\t\tbuffer.append(result).append(\" / \");\n\t\t}\n\t\treturn buffer.toString();\n\t}", "@Override\n public void clearBatch() throws SQLException {\n throw new SQLException(\"tinySQL does not support clearBatch.\");\n }", "public void clearTable() {\n\t\tfor (int i = modelCondTable.getRowCount() - 1; i >= 0; i--) {\n\t\t\tmodelCondTable.removeRow(i);\n\t\t}\n\t}", "public Builder clearThrift() {\n if (thriftBuilder_ == null) {\n if (schemaCase_ == 2) {\n schemaCase_ = 0;\n schema_ = null;\n onChanged();\n }\n } else {\n if (schemaCase_ == 2) {\n schemaCase_ = 0;\n schema_ = null;\n }\n thriftBuilder_.clear();\n }\n return this;\n }", "public void clearHashTable()\n {\n int index;\n\n for(index = 0; index < tableSize; index++)\n {\n tableArray[index] = null;\n }\n }" ]
[ "0.67739147", "0.64785016", "0.6467571", "0.63862234", "0.6376031", "0.6352168", "0.6349244", "0.62469596", "0.6232843", "0.61872035", "0.60977507", "0.6072299", "0.60633814", "0.60338825", "0.60078096", "0.5984888", "0.591742", "0.59104383", "0.5905824", "0.59008485", "0.5884675", "0.58811474", "0.5875269", "0.58738136", "0.5855594", "0.5855463", "0.5845102", "0.584211", "0.5835391", "0.5831232", "0.58247626", "0.5760188", "0.57318515", "0.5722295", "0.5718053", "0.5695468", "0.5686783", "0.5672825", "0.56377697", "0.5633577", "0.56237644", "0.56130576", "0.5612261", "0.56076443", "0.56006724", "0.5581559", "0.5577231", "0.5557377", "0.554612", "0.55242544", "0.55242354", "0.54788554", "0.547416", "0.54380494", "0.5435899", "0.5423596", "0.54211384", "0.5418216", "0.5412654", "0.5409716", "0.5409539", "0.5409345", "0.539153", "0.539062", "0.5381503", "0.53752697", "0.5371159", "0.53605", "0.53580225", "0.53560734", "0.5347114", "0.53381807", "0.53339165", "0.53339165", "0.53305554", "0.532283", "0.5319079", "0.53189474", "0.5317083", "0.528481", "0.5282587", "0.5281633", "0.52742183", "0.52729744", "0.52729744", "0.52729744", "0.52687037", "0.52658236", "0.52532166", "0.52529985", "0.5251082", "0.52446854", "0.52407277", "0.5235819", "0.52332664", "0.5221204", "0.5220311", "0.52162975", "0.52158976", "0.5215032" ]
0.73870057
0
Clears (drops) one or all tables in the database cluster. The operation is synchronous meaning that the table will be cleared before the function returns. The response payload returns the status of the operation along with the name of the table that was cleared.
public ClearTableResponse clearTable(String tableName, String authorization, Map<String, String> options) throws GPUdbException { ClearTableRequest actualRequest_ = new ClearTableRequest(tableName, authorization, options); ClearTableResponse actualResponse_ = new ClearTableResponse(); submitRequest("/clear/table", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClearTableResponse clearTable(ClearTableRequest request) throws GPUdbException {\n ClearTableResponse actualResponse_ = new ClearTableResponse();\n submitRequest(\"/clear/table\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void clearTables()\n\t{\n\t\ttry {\n\t\t\tclearStatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tif (DEBUG) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public MessageResponse clear() {\n Database db = new Database();\n try {\n db.clear();\n } catch (DatabaseException dbe) {\n return new MessageResponse(dbe.toString());\n }\n return new MessageResponse(\"Clear succeeded\");\n }", "@DELETE\n @Consumes(MediaType.APPLICATION_JSON)\n public String clearOrderTable() {\n service.deleteOrders();\n return \"deleted orders\";\n }", "public void clearTable(String tableName) throws Exception {\n DefaultDataSet dataset = new DefaultDataSet();\n dataset.addTable(new DefaultTable(tableName));\n DatabaseOperation.DELETE_ALL.execute(conn, dataset);\n }", "@Override\n public void clearTable() {\n final var query = \"TRUNCATE TABLE piano_project.pianos\";\n try(final var statement = connection.createStatement()) {\n statement.executeUpdate(query);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }", "@Override\n public void clearDB() throws Exception {\n hBaseOperation.deleteTable(this.dataTableNameString);\n hBaseOperation.createTable(this.dataTableNameString, this.columnFamily, numRegion);\n }", "public void clear() {\n tableCache.invalidateAll();\n }", "private void clearTable(String tableName) throws SQLException {\n Connection conn = getConnection();\n String setStatement = \"DELETE FROM \" + tableName;\n Statement stm = conn.createStatement();\n stm.execute(setStatement);\n }", "void dropAllTables();", "public void wipeTable() {\n SqlStorage.wipeTable(db, TABLE_NAME);\n }", "void dropAllTablesForAllConnections();", "public void clear() throws DBException\n {\n String sqlString = \"DELETE FROM user\";\n try(Statement statement = conn.createStatement())\n {\n statement.executeUpdate(sqlString);\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Error while clearing user table\");\n }\n\n\n }", "void cleanupTable(TableName tablename) throws Exception {\n if (tbl != null) {\n tbl.close();\n tbl = null;\n }\n\n ((ClusterConnection) connection).clearRegionCache();\n deleteTable(TEST_UTIL, tablename);\n }", "@Modifying\n @Transactional\n @Query(\"DELETE FROM \" + dbName)\n void deleteAllFromTable();", "public void clearDatabase();", "public void clearTables() {\r\n // your code here\r\n\t\ttry {\r\n\t\t\tdeleteReservationStatement.executeUpdate();\r\n\t\t\tdeleteBookingStatement.executeUpdate();\r\n\t\t\tdeleteUserStatement.executeUpdate();\r\n\t\t} catch (SQLException e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "public void clearTable(){\n\t\tloaderImage.loadingStart();\n\t\tfullBackup.clear();\n\t\tlist.clear();\n\t\toracle.clear();\n\t\tselectionModel.clear();\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t}", "@Override\n\tpublic int deleteAll() {\n\t\treturn SApplicationcategorydao.executeHql(\"delete from \"+tablename);\n\t}", "@Override\n\tpublic void emptyTable() {\n\t\tresTable.deleteAll();\n\t}", "public void clear() throws RemoteException, Error;", "public void Clear() throws DataAccessException {\n try (Statement stmt = conn.createStatement()){\n String sql = \"DELETE FROM Event\";\n stmt.executeUpdate(sql);\n } catch (SQLException e) {\n throw new DataAccessException(\"SQL Error encountered while clearing tables\");\n }\n }", "public void clearAllTable() {\n\t\tint rowCount = dmodel.getRowCount();\n\t\tfor (int i = rowCount - 1; i >= 0; i--) {\n\t\t\tdmodel.removeRow(i);\n\t\t}\n\t}", "public abstract void destroyTables() throws DataServiceException;", "public void clear() throws DBException\n {\n String sqlString = \"DELETE FROM authToken\";\n try(Statement statement = conn.createStatement())\n {\n statement.executeUpdate(sqlString);\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Error while clearing authToken table\");\n }\n }", "public void dropTable();", "void clearAllItemsTable();", "public void flushAllTables() {\n\t}", "public int dropTable() \n throws InterruptedException, IOException \n {\n return dropTable(false);\n }", "public void clear() {\n\t\tfor (int i = 0; i < table.size(); i++) {\n\t\t\ttable.get(i).clear();\n\t\t}\n\t}", "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 }", "public void clearUserTable() {\n\t\tSQLDelete deleteStatament = new SQLDelete();\n\t\tdeleteStatament.clearUserTable();\n\t}", "@Synchronized\r\n public int deleteAllTransfersData() {\r\n return databaseHandler.deleteData(TableTransferModel.TABLE_NAME, \"\", null);\r\n }", "public void cleanTable() throws ClassicDatabaseException;", "public void clearCollection() {\n\t\tMongoDatabase db = mongoClient.getDatabase(MongoActions.props.getDBName());\n\t\tMongoCollection<Document> table = db.getCollection(MongoActions.props.getCollectionName());\n\t\ttable.drop();\n\t}", "public void clearTables() {\n\t _database.delete(XREF_TABLE, null, null);\n\t _database.delete(ORDER_RECORDS_TABLE, null, null); \n\t}", "public void deleteTableRecords()\n {\n coronaRepository.deleteAll();\n }", "@Override\r\n\tpublic void clearDatabase() {\n\t\t\r\n\t}", "@AfterEach\n\tvoid clearDatabase() {\n\t\t//Clear the table\n\t\taccountRepository.deleteAll();\n\t}", "public void dropTable() {\n }", "@Test\n public void testDropTable() throws Exception {\n String tableName = createTable(true, true, false);\n\n assertTableIsRegistered(DEFAULT_DB, tableName);\n assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), \"id\"));\n assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), NAME));\n\n String query = String.format(\"drop table %s \", tableName);\n\n runCommandWithDelay(query, 3000);\n\n assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), \"id\"));\n assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), NAME));\n assertTableIsNotRegistered(DEFAULT_DB, tableName);\n }", "@Override\n public void deleteAll() {\n String deleteAllQuery = \"DELETE FROM \" + getTableName();\n getJdbcTemplate().execute(deleteAllQuery);\n }", "public void clearTable() {\n reportTable.getColumns().clear();\n }", "public void clearDatabase() {\n\n\t\tObjectSet<Article> articles = db.query(Article.class);\n\t\tarticles.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<CreditCard> creditCards = db.query(CreditCard.class);\n\t\tcreditCards.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Customer> customers = db.query(Customer.class);\n\t\tcustomers.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Order> orders = db.query(Order.class);\n\t\torders.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<OrderDetail> orderDetails = db.query(OrderDetail.class);\n\t\torderDetails.stream()\n\t\t\t.forEach(db::delete);\n\t\t\n\t\tSystem.out.println(\"\\nBase de dades esborrada per complet\");\n\t}", "static void emptyTable () {\n Session session = null;\n Transaction transaction = null;\n try {\n session = sessionFactory.openSession();\n transaction = session.beginTransaction();\n Query query = session.createQuery(\"DELETE from ReservationsEntity \");\n query.executeUpdate();\n Query query2 = session.createQuery(\"DELETE from OrdersEntity \");\n query2.executeUpdate();\n\n Query query3 = session.createQuery(\"DELETE from TablesEntity \");\n query3.executeUpdate();\n transaction.commit();\n }\n catch (Exception e)\n {\n if (transaction != null) {\n transaction.rollback();\n }\n throw e;\n } finally {\n if (session != null) {\n session.close();\n }\n }\n }", "public void clearDatabase(){\n\t\tem.createNativeQuery(\"DELETE FROM CAMINHO\").executeUpdate();\r\n\t\tem.createNativeQuery(\"DELETE FROM MAPA\").executeUpdate();\r\n\t\t\r\n\t\tlog.info(\"Limpou a base de dados\");\r\n\t\r\n\t}", "public Builder clearTables() {\n if (tablesBuilder_ == null) {\n tables_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n } else {\n tablesBuilder_.clear();\n }\n return this;\n }", "void clearDeletedItemsTable();", "public void deleteAllTransactions();", "public void clearDatabase() {\n new ExecutionEngine(this.database).execute(\"MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r, n\");\n }", "private static void clearDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n clearTable(\"myRooms\");\n clearTable(\"myReservations\");\n }", "public synchronized void clear() {\n ServerDescEntry tab[] = table;\n for (int index = tab.length; --index >= 0; )\n tab[index] = null;\n count = 0;\n }", "public void clear() {\r\n\t\tfor (int i = 0; i < table.length; i++) {\r\n\t\t\ttable[i] = null;\r\n\t\t}\r\n\r\n\t\tmodificationCount++;\r\n\t\tsize = 0;\r\n\t}", "@Override\r\n public boolean deleteAll(String strTable)\r\n { try\r\n { String strSQL = \"DELETE * FROM \" + strTable;\r\n status(strSQL);\r\n dbCmdText.executeUpdate(strSQL);\r\n\r\n // dbRecordset.close();\r\n } catch (SQLException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n return false;\r\n }", "boolean dropTable();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void clear( )\r\n\t{\r\n\t\tfor (int i =0; i< this.tableSize; i++)\r\n\t\t\t{ ((LinkedArrays<T>) table[i]).clear(); }\r\n\t\tthis.size = 0; \r\n\t\t\r\n\t}", "public void clearData(){\n\t\t\n\t\tclearTable(conditionTableModel);\n\t\tclearTable(faultTableModel);\n\t}", "@Test\n public void removeAll_204() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n addMOToDb(3);\n\n // PREPARE THE TEST\n // Nothing to do\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(204, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "public void clearBatch() throws SQLException {\n\r\n }", "@Test\n public void removeAll_204_empty() throws Exception {\n\n // PREPARE THE DATABASE\n // Database is empty\n\n // PREPARE THE TEST\n // Nothing to do\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(204, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "public void clear() {\n table = new Handle[defaultSize];\n logicalSize = 0;\n }", "public void doDropTable();", "public int dropTable(boolean quiet) \n throws InterruptedException, IOException \n {\n // if (! tablecreated) \n // System.err.println(\"Warning: table not created yet?\");\n\n Process client = startDbClient();\n PrintWriter w = \n new PrintWriter(new OutputStreamWriter(client.getOutputStream()));\n w.print(\"DROP TABLE \");\n w.print(tbl);\n w.println(\";\");\n w.close();\n\n client.waitFor();\n if (! quiet) {\n if (client.exitValue() > 0) {\n for (String line : emsgs) \n System.err.println(line);\n }\n else {\n tablecreated = false;\n System.err.println(\"Existing table \"+tbl+\" dropped\");\n }\n }\n\n return client.exitValue();\n }", "@Override\n public void deleteAll(final Connection _con) throws SQLException {\n\n final Statement stmtSel = _con.createStatement();\n final Statement stmtExec = _con.createStatement();\n\n try {\n // remove all foreign keys\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Foreign Keys\");\n }\n ResultSet rs = stmtSel.executeQuery(SELECT_ALL_KEYS);\n while (rs.next()) {\n final String tableName = rs.getString(1);\n final String constrName = rs.getString(2);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - Table '\" + tableName + \"' Constraint '\" + constrName + \"'\");\n }\n stmtExec.execute(\"alter table \" + tableName + \" drop constraint \" + constrName);\n }\n rs.close();\n\n // remove all views\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Views\");\n }\n rs = stmtSel.executeQuery(SELECT_ALL_VIEWS);\n while (rs.next()) {\n final String viewName = rs.getString(1);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - View '\" + viewName + \"'\");\n }\n stmtExec.execute(\"drop view \" + viewName);\n }\n rs.close();\n\n // remove all tables\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Tables\");\n }\n rs = stmtSel.executeQuery(SELECT_ALL_TABLES);\n while (rs.next()) {\n final String tableName = rs.getString(1);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - Table '\" + tableName + \"'\");\n }\n stmtExec.execute(\"drop table \" + tableName);\n }\n rs.close();\n } finally {\n stmtSel.close();\n stmtExec.close();\n }\n }", "public void deleteAllRequests() {\n try {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, null, null);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n db.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void doEmptyTableList() {\n tableList.deleteList();\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/infrastructures\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionInfrastructure();", "public void clearDatabase() {\n\t\tstudentRepository.deleteAll();\n\t}", "@Override\n public void clear() {\n reference.dropColumnFamily(mapName);\n columnFamilyHandle = reference.getOrCreateColumnFamily(mapName);\n size.set(0L);\n updateLastModifiedTime();\n }", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"Mysql DB 서버에 접속해서 삭제를 하다.\");\n\t}", "void clear( final ResultProcs procs )\n {\n enqueue( new Runnable() {\n @Override\n public void run() {\n int result = getWritableDatabase()\n .delete( LOGS_TABLE_NAME, \"1\", null );\n procs.onCleared( result );\n }\n } );\n }", "private void clearAllDatabases()\n\t{\n\t\tdb.clear();\n\t\tstudent_db.clear();\n\t}", "public void clearAll();", "public void clearAll();", "public static void resetTable() {\n tableModel.resetDefault();\n updateSummaryTable();\n }", "public void resetTable() {\n\t\tif (table != null) {\n\t\t\ttable.removeAll();\n\t\t}\n\t}", "public void dropAll () {\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tif (dbCol.getIndexInfo().size()>0)\n\t\t\tdbCol.dropIndexes();\n\t\tdbCol.drop();\n\t\t\t \n\t\t\n\t}", "private static void clearRedis() {\n StringRedisTemplate redisTemplate = getRedisTemplate();\n Set<String> keys = redisTemplate.keys(\"*\");\n for (String key : keys) {\n redisTemplate.delete(key);\n Assert.assertFalse(redisTemplate.hasKey(key));\n }\n }", "void clearAllIndexes();", "public void deleteAll() {\n repository.deleteAll();\n }", "public void deleteAll();", "@Override\n public void cleanUsersTable() {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n session.createQuery(\"delete from User\").executeUpdate();\n tx.commit();\n System.out.println(\"HibCleaning users table\");\n session.close();\n\n }", "public void deleteAll() {\n\t\t mongoTemplate.remove(new Query(), COLLECTION);\n\t}", "public void deleteAll();", "public void deleteAll();", "public void deleteAll();", "public int clear() {\n int result = 0;\n for( Iterator it = this.rcIterator(); it.hasNext() ; ){\n ReplicaCatalog catalog = (ReplicaCatalog) it.next();\n result += catalog.clear();\n }\n return 0;\n }", "public static boolean testTableClear() {\r\n table.clear();\r\n if (table.size() != 0)\r\n return false;\r\n return true;\r\n }", "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}", "void clear() throws PapooseException;", "public String execute() throws SQLException {\n\t\t/*conn = DataBase.getConnection();\n\t\tst = conn.createStatement();\n\t\tString sql=\"drop table user\";\n\t\tst.execute(sql);*/\n\t\treturn \"SUCCESS\";\n\n\t}", "private void clearData() {\r\n em.createQuery(\"delete from MonitoriaEntity\").executeUpdate();\r\n }", "@Test\n public void dropTable() {\n try {\n String sql = \"drop table if exists \" + \"\";\n boolean resultSet = statement.execute(sql);\n System.out.println(resultSet);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void deleteTable(String tableName) {\n try {\n connectToDB(\"jdbc:mysql://localhost/EmployeesProject\");\n } catch (Exception e) {\n System.out.println(\"The EmployeesProject db does not exist!\\n\"\n + e.getMessage());\n }\n String sqlQuery = \"drop table \" + tableName;\n try {\n stmt.executeUpdate(sqlQuery);\n } catch (SQLException ex) {\n System.err.println(\"Failed to delete '\" + tableName + \n \"' table.\\n\" + ex.getMessage());\n }\n }", "public void deleteAll() throws SQLException {\n\t\tfinal String sql = \"DELETE FROM \" + table_name;\n\t\tPreparedStatement statement = null;\n\n\t\ttry {\n\t\t\tfinal Connection connection = _database.getConnection();\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tfinal int rowcount = update(statement);\n\t\t} finally {\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\t\t}\n\t}", "@RequestMapping(\"reset\")\n\tpublic @ResponseBody\n\tString resetDB() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tList<SwapItem> items = dao.findAll();\n\t\tfor (SwapItem item : items) {\n\t\t\tint result = dao.delete(item);\n\t\t\tbuffer.append(result).append(\" / \");\n\t\t}\n\t\treturn buffer.toString();\n\t}", "@Override\n public void clearBatch() throws SQLException {\n throw new SQLException(\"tinySQL does not support clearBatch.\");\n }", "public void clearTable() {\n\t\tfor (int i = modelCondTable.getRowCount() - 1; i >= 0; i--) {\n\t\t\tmodelCondTable.removeRow(i);\n\t\t}\n\t}", "public Builder clearThrift() {\n if (thriftBuilder_ == null) {\n if (schemaCase_ == 2) {\n schemaCase_ = 0;\n schema_ = null;\n onChanged();\n }\n } else {\n if (schemaCase_ == 2) {\n schemaCase_ = 0;\n schema_ = null;\n }\n thriftBuilder_.clear();\n }\n return this;\n }", "public void clearHashTable()\n {\n int index;\n\n for(index = 0; index < tableSize; index++)\n {\n tableArray[index] = null;\n }\n }" ]
[ "0.73870057", "0.64785016", "0.6467571", "0.63862234", "0.6376031", "0.6352168", "0.6349244", "0.62469596", "0.6232843", "0.61872035", "0.60977507", "0.6072299", "0.60633814", "0.60338825", "0.60078096", "0.5984888", "0.591742", "0.59104383", "0.5905824", "0.59008485", "0.5884675", "0.58811474", "0.5875269", "0.58738136", "0.5855594", "0.5855463", "0.5845102", "0.584211", "0.5835391", "0.5831232", "0.58247626", "0.5760188", "0.57318515", "0.5722295", "0.5718053", "0.5695468", "0.5686783", "0.5672825", "0.56377697", "0.5633577", "0.56237644", "0.56130576", "0.5612261", "0.56076443", "0.56006724", "0.5581559", "0.5577231", "0.5557377", "0.554612", "0.55242544", "0.55242354", "0.54788554", "0.547416", "0.54380494", "0.5435899", "0.5423596", "0.54211384", "0.5418216", "0.5412654", "0.5409716", "0.5409539", "0.5409345", "0.539153", "0.539062", "0.5381503", "0.53752697", "0.5371159", "0.53605", "0.53580225", "0.53560734", "0.5347114", "0.53381807", "0.53339165", "0.53339165", "0.53305554", "0.532283", "0.5319079", "0.53189474", "0.5317083", "0.528481", "0.5282587", "0.5281633", "0.52742183", "0.52729744", "0.52729744", "0.52729744", "0.52687037", "0.52658236", "0.52532166", "0.52529985", "0.5251082", "0.52446854", "0.52407277", "0.5235819", "0.52332664", "0.5221204", "0.5220311", "0.52162975", "0.52158976", "0.5215032" ]
0.67739147
1
Clears or cancels the trigger identified by the specified handle. The output returns the handle of the trigger cleared as well as indicating success or failure of the trigger deactivation.
public ClearTriggerResponse clearTrigger(ClearTriggerRequest request) throws GPUdbException { ClearTriggerResponse actualResponse_ = new ClearTriggerResponse(); submitRequest("/clear/trigger", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000002);\n handle_ = 0;\n onChanged();\n return this;\n }", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000001);\n handle_ = 0;\n onChanged();\n return this;\n }", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000001);\n handle_ = 0;\n onChanged();\n return this;\n }", "public ClearTriggerResponse clearTrigger(String triggerId, Map<String, String> options) throws GPUdbException {\n ClearTriggerRequest actualRequest_ = new ClearTriggerRequest(triggerId, options);\n ClearTriggerResponse actualResponse_ = new ClearTriggerResponse();\n submitRequest(\"/clear/trigger\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public static void bgfx_destroy_occlusion_query(@NativeType(\"bgfx_occlusion_query_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_occlusion_query;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_frame_buffer(@NativeType(\"bgfx_frame_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_frame_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_indirect_buffer(@NativeType(\"bgfx_indirect_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_indirect_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_uniform(@NativeType(\"bgfx_uniform_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_uniform;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_texture(@NativeType(\"bgfx_texture_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_texture;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_program(@NativeType(\"bgfx_program_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_program;\n invokeCV(_handle, __functionAddress);\n }", "protected abstract void off(ACATimer handle_);", "protected synchronized void removeHandle(Object handle) {\n\t\tNgGrpcHandle targetHandle = (NgGrpcHandle) handle;\n\t\tint targetHandleID = targetHandle.getExecutableID();\n\t\tint elemHandleID = -1;\n\t\t\n\t\tfor (int i = 0; i < handleList.size(); i++) {\n\t\t\tObject elemHandle = handleList.get(i);\n\t\t\tif (elemHandle instanceof NgGrpcFunctionHandle) {\n\t\t\t\t/* function handle */\n\t\t\t\tNgGrpcFunctionHandle funcHandle = (NgGrpcFunctionHandle) elemHandle;\n\t\t\t\telemHandleID = funcHandle.getExecutableID();\n\t\t\t} else if (elemHandle instanceof NgGrpcObjectHandle) {\n\t\t\t\t/* object handle */\n\t\t\t\tNgGrpcObjectHandle objHandle = (NgGrpcObjectHandle) elemHandle;\n\t\t\t\telemHandleID = objHandle.getExecutableID();\n\t\t\t} else {\n\t\t\t\t/* error */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* check if it's the target */\n\t\t\tif (elemHandleID == targetHandleID) {\n\t\t\t\t/* target was found! remove it */\n\t\t\t\thandleList.remove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void unsetAutoReplyTriggeredSend()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(AUTOREPLYTRIGGEREDSEND$20, 0);\n }\n }", "public static void bgfx_destroy_index_buffer(@NativeType(\"bgfx_index_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_index_buffer;\n invokeCV(_handle, __functionAddress);\n }", "@Override\n\tpublic void disposeHandle(SVGHandle handle) {\n\t\tFile projectFile = handle.getScrollPane().getSVGCanvas()\n\t\t\t\t.getProjectFile();\n\n\t\tif (projectFile != null && shouldDisposeProjectFiles(projectFile)) {\n\n\t\t\t// removing the loaded action classes\n\t\t\tActionsLoader.removeClasses(ActionsLoader\n\t\t\t\t\t.getProjectName(projectFile));\n\n\t\t\t// removing the entry of this project file\n\t\t\t((RtdaColorChooserModule) Editor.getColorChooser())\n\t\t\t\t\t.getColorsAndBlinkingsToolkit().removeColorsAndBlinkings(\n\t\t\t\t\t\t\tColorsAndBlinkingsToolkit\n\t\t\t\t\t\t\t\t\t.getProjectName(projectFile));\n\n\t\t\t// TODO\n\t\t}\n\n\t\tsuper.disposeHandle(handle);\n\t}", "public static native void cleanNotifier(int notifierHandle);", "public void unsetAutoForwardTriggeredSend()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(AUTOFORWARDTRIGGEREDSEND$16, 0);\n }\n }", "HRESULT VariantClear(VARIANT pvarg);", "public void clear() throws ChangeVetoException;", "public static native void destroyHandle();", "@Override\n public void handle(ActionEvent t) {\n c1.setText(\"\");\n c2.setText(\"\");\n }", "@Action\n public void acCancel() {\n setChangeObj(false);\n }", "@Action\n public void acCancel() {\n setChangeObj(false);\n }", "public static void bgfx_destroy_vertex_buffer(@NativeType(\"bgfx_vertex_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_vertex_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public T caseReactionTrigger(ReactionTrigger object) {\r\n\t\treturn null;\r\n\t}", "void unsetRef();", "private static native void stopAnalogActionMomentum(long pointer,\n long controllerHandle,\n long analogActionHandle);", "public void clear(int flag) {\n setWaitFlags( waitFlags & ~flag );\n }", "public void retract(FactHandle handle) {\n mKsession.retract(handle);\n }", "void clearAndNotify();", "public void revoke();", "public T caseTrigger(Trigger object) {\r\n\t\treturn null;\r\n\t}", "@FXML\n\tprivate void handleCancel() {\n\t\tdialogStage.close();\n\t\t\n\t\tif (acknowledgment.getANumber() == null) {\n\t\t\tmain.getDbHelper().deleteAcknowledgment(acknowledgment);\n\t\t}\n\t\t\n\t\tmain.getAcknowledgmentData().clear();\n\t\tmain.getAcknowledgmentData().addAll(main.getDbHelper().retrieveAcknowledgmentList());\n\t}", "public static native void stopNotifierAlarm(int notifierHandle);", "protected void ACTION_ON_CLEAR(ActionEvent arg0) {\n\t\ttextArea_1.setText(\"\");\r\n\t}", "void delete(String receiptHandle);", "public int maDBCursorDestroy(int cursorHandle)\n \t{\n \t\tif (!hasCursor(cursorHandle))\n \t\t{\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \n \t\tremoveCursor(cursorHandle);\n \t\treturn MA_DB_OK;\n \t}", "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") // I know what I'm doing - famous last words.\n private static void awaitCompletion(final HashMultimap<UUID, Future<Void>> handles, final UUID handle) {\n final Set<Future<Void>> futures;\n synchronized (handles) {\n futures = handles.removeAll(handle);\n }\n\n for (final Future<Void> future : futures) {\n await(future);\n }\n }", "protected void reset()\n {\n if (_resetTimedEvent != null && !_resetTimedEvent.hasAborted()\n && !_resetTimedEvent.hasFired()) _resetTimedEvent.abort();\n\n clearFlag();\n }", "private void triggerReset() {\n DefenceField.fieldActivated = false;\n OnFieldReset event = new OnFieldReset(this::doActivation);\n event.beginTask();\n DefenceField.getShrineEntity().send(event);\n event.finishTask();\n }", "@Override\n\tpublic AssetManageReqHandle remove(long handleId)\n\t\tthrows NoSuchAssetManageReqHandleException, SystemException {\n\t\treturn remove((Serializable)handleId);\n\t}", "@Override\n public void handle(ActionEvent t) {\n e1.setText(\"\");\n e2.setText(\"\");\n }", "public void dropHandle(RepositoryServerHandleImpl handle) {\n\t\tsynchronized (handleList) {\n\t\t\thandleList.remove(handle);\n\t\t}\n\t}", "void clearSoftLock(SoftLock softLock);", "public void clearInterrupt() {\n Object object = this.msgSync;\n synchronized (object) {\n this.msg = 0;\n }\n }", "public void cancelAudioCapture(){\n\t\tLogger.log(\"cancelAudioCapture()::BEGIN\");\n\t\tif (mRecordControl != null){\n\t\t\ttry {\n\t\t\t\tmRecordControl.reset();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tRecorderEvent re = new RecorderEvent();\n\t\tre.setType(RecorderEvent.RECORD_CANCEL);\n\t\tnotifyListener(re);\n\t\tLogger.log(\"cancelAudioCapture()::END\");\n\t}", "private void handleActionBaz() {\n Notifier.cancelTimer(this);\n }", "void DevClear (int boardID, short addr);", "abstract protected boolean clearSurroundHandle(Location m);", "public void ClearActionPerformed(java.awt.event.ActionEvent evt) {\n drawingPanel.setPath(\"null\"); \r\n }", "public static void bgfx_destroy_dynamic_index_buffer(@NativeType(\"bgfx_dynamic_index_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_dynamic_index_buffer;\n invokeCV(_handle, __functionAddress);\n }", "@Editor.Ignore\n T clear(boolean silent);", "public void setTrigger(Trigger trigger) {\n \t\tthis.trigger = trigger;\n \t\tif (this.trigger == null)\n \t\t\tthis.trigger = Trigger.NONE;\n \t}", "@Override\n\tpublic void clearRecording(int srcPin) throws emException, TException {\n\n\t}", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n if (mCaptureSession != null) {\n mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mState = STATE_PREVIEW;\n mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler);\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public abstract Promise<JsonValue, ResourceException> clear(Context context, String resourceId);", "public void clearFocusWithoutChangingState() {\n this.mFocusManager.removeMessages();\n this.mUI.clearFocus();\n this.mCameraDevice.cancelAutoFocus();\n this.mUI.clearEvoPendingUI();\n if (this.mEvoFlashLock != null) {\n this.mAppController.getButtonManager().enableButtonWithToken(0, this.mEvoFlashLock.intValue());\n this.mEvoFlashLock = null;\n }\n this.mFocusManager.setAeAwbLock(false);\n setCameraParameters(4);\n }", "public static void clearIntake(LogitechFlightStick joy) {\n\n\t\tif (joy.getButton(11)) {\n\t\t\tintake.set(-1.0);\n\t\t}\n\n\t\tintake.set(0.0);\n\t}", "protected abstract void handleCancel();", "public void deselect(){\n\t\tPIN.reset();\n\t}", "void clearAssetConnection(String userId,\n String assetManagerGUID,\n String assetManagerName,\n String assetGUID,\n String connectionGUID,\n Date effectiveTime,\n boolean forLineage,\n boolean forDuplicateProcessing) throws InvalidParameterException,\n UserNotAuthorizedException,\n PropertyServerException;", "public static void remove(VkObject ...handles){\n if(handles == null) return;\n for (VkObject vkHandle : handles) {\n if(vkHandle != null)\n vkHandle.free();\n }\n }", "public abstract void onReset();", "public native static int cancel();", "public static native void OpenMM_HippoNonbondedForce_destroy(PointerByReference target);", "@Override\n\tpublic String unbind(String arg0) {\n\t\treturn null;\n\t}", "private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed\n textArea.setText(null);\n }", "public DraggableBehavior setHandle(String handle)\n\t{\n\t\tthis.options.putLiteral(\"handle\", handle);\n\t\treturn this;\n\t}", "void unsetAuto();", "@Override\n\tpublic void removeTrigger() {\n\t\tplayer.removeListener(this.listener, EventNameType.SOUL_FIGHT);\n\t}", "public void cloudClear (int stateKey, GPGAppStateConflictHandler conflictHandler, GPGAppStateWriteResultHandler resultHandler) {\n\n\t\t// get the model\n\t\tfinal GPGAppStateModel model = GPGManager.sharedInstance().getApplicationModel().getAppState();\n\n\t\t// clear the state\n\t\tmodel.clear(NSNumber.valueOf(stateKey), resultHandler, conflictHandler);\n\t}", "public T caseTriggerDesc(TriggerDesc object) {\n\t\treturn null;\n\t}", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n mCaptureRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,\n CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n mPreviewCaptureSession.capture(mCaptureRequestBuilder.build(), mPreviewCaptureCallback,\n mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mCaptureState = STATE_PREVIEW;\n mPreviewCaptureSession.setRepeatingRequest(mPreviewRequest, mPreviewCaptureCallback,\n mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public boolean cancel();", "public void setHandle(String handle) {\r\n this.handle = handle;\r\n }", "public void clear() throws RemoteException, Error;", "public T caseDefaultTrigger(DefaultTrigger object) {\r\n\t\treturn null;\r\n\t}", "public void clear() {\r\n if (ObjectiveFunctionWrapper.this.m_use)\r\n this.m_state.clear();\r\n }", "public void onUnblock();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancelLogCapture() {\n if (logFileHandle_ == null) {\n return;\n }\n\n core_.logMessage(\"Problem Report: Canceling log capture\");\n try {\n core_.stopSecondaryLogFile(logFileHandle_);\n } catch (Exception ignore) {\n // Errors will be logged by the Core; there is not much else we can\n // do.\n }\n logFileHandle_ = null;\n\n new File(logFileName_).delete();\n logFileName_ = null;\n }", "public static void bgfx_destroy_dynamic_vertex_buffer(@NativeType(\"bgfx_dynamic_vertex_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_dynamic_vertex_buffer;\n invokeCV(_handle, __functionAddress);\n }", "void unsetExchange();", "@Override\n public void handle(WindowEvent t) {\n System.exit(0);\n }", "void unsetEvent();", "void clearHandlers();", "protected abstract void ceaseHelper();", "@Override\n public void cancelAutoFocus() {\n mCameraDevice.cancelAutoFocus();\n if (mCameraState != SELFTIMER_COUNTING\n && mCameraState != SNAPSHOT_IN_PROGRESS) {\n setCameraState(IDLE);\n }\n setCameraParameters(UPDATE_PARAM_PREFERENCE);\n isTouchCalled = false;\n }", "private void clearChangeHeadpicRelay() {\n if (rspCase_ == 21) {\n rspCase_ = 0;\n rsp_ = null;\n }\n }", "private void clearButtonActionPerformed(ActionEvent evt) {\r\n\t\tlogger.info(\"Clear button Clicked.\");\r\n\t\tinputTextField.setText(\"\");\r\n\t\toutputScoreTextArea.setText(\"\");\r\n\t}", "void unsetState();", "void unsetValueAttachment();", "private void clearUpdateTriggerTime() {\n bitField0_ = (bitField0_ & ~0x00000002);\n updateTriggerTime_ = 0;\n }", "int clear();" ]
[ "0.606916", "0.6046965", "0.6046965", "0.5616502", "0.52028453", "0.5108615", "0.5058137", "0.5043886", "0.50264996", "0.48716763", "0.48517293", "0.48189193", "0.47356766", "0.47343338", "0.47339675", "0.4722419", "0.46195033", "0.46106607", "0.4593605", "0.45836893", "0.456919", "0.45579955", "0.45579955", "0.45533362", "0.45464808", "0.4542882", "0.45227188", "0.4513967", "0.4508851", "0.44733885", "0.44705486", "0.44355378", "0.44327444", "0.44281346", "0.44279602", "0.44088525", "0.43902034", "0.43885055", "0.43870008", "0.43840435", "0.43828323", "0.43477404", "0.43172905", "0.43144408", "0.43049935", "0.4299141", "0.4296667", "0.42881802", "0.42667258", "0.42609733", "0.42598566", "0.42536765", "0.42371753", "0.4228419", "0.4226087", "0.4220198", "0.42125607", "0.42056262", "0.4201433", "0.41934642", "0.41918683", "0.4190288", "0.41693062", "0.41575828", "0.41535738", "0.4149721", "0.41449186", "0.41297865", "0.41269964", "0.41264305", "0.4126406", "0.41234142", "0.41234133", "0.4115456", "0.41142172", "0.41076478", "0.41070378", "0.4106319", "0.41000518", "0.40974945", "0.40974945", "0.40974945", "0.40974945", "0.40974945", "0.40974945", "0.40967909", "0.40958673", "0.40903255", "0.40876752", "0.4078199", "0.40768564", "0.40745953", "0.40723175", "0.40722775", "0.40716976", "0.40716502", "0.406524", "0.40622354", "0.4056702", "0.4055472" ]
0.60610884
1
Clears or cancels the trigger identified by the specified handle. The output returns the handle of the trigger cleared as well as indicating success or failure of the trigger deactivation.
public ClearTriggerResponse clearTrigger(String triggerId, Map<String, String> options) throws GPUdbException { ClearTriggerRequest actualRequest_ = new ClearTriggerRequest(triggerId, options); ClearTriggerResponse actualResponse_ = new ClearTriggerResponse(); submitRequest("/clear/trigger", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000002);\n handle_ = 0;\n onChanged();\n return this;\n }", "public ClearTriggerResponse clearTrigger(ClearTriggerRequest request) throws GPUdbException {\n ClearTriggerResponse actualResponse_ = new ClearTriggerResponse();\n submitRequest(\"/clear/trigger\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000001);\n handle_ = 0;\n onChanged();\n return this;\n }", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000001);\n handle_ = 0;\n onChanged();\n return this;\n }", "public static void bgfx_destroy_occlusion_query(@NativeType(\"bgfx_occlusion_query_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_occlusion_query;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_frame_buffer(@NativeType(\"bgfx_frame_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_frame_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_indirect_buffer(@NativeType(\"bgfx_indirect_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_indirect_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_uniform(@NativeType(\"bgfx_uniform_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_uniform;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_texture(@NativeType(\"bgfx_texture_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_texture;\n invokeCV(_handle, __functionAddress);\n }", "public static void bgfx_destroy_program(@NativeType(\"bgfx_program_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_program;\n invokeCV(_handle, __functionAddress);\n }", "protected abstract void off(ACATimer handle_);", "protected synchronized void removeHandle(Object handle) {\n\t\tNgGrpcHandle targetHandle = (NgGrpcHandle) handle;\n\t\tint targetHandleID = targetHandle.getExecutableID();\n\t\tint elemHandleID = -1;\n\t\t\n\t\tfor (int i = 0; i < handleList.size(); i++) {\n\t\t\tObject elemHandle = handleList.get(i);\n\t\t\tif (elemHandle instanceof NgGrpcFunctionHandle) {\n\t\t\t\t/* function handle */\n\t\t\t\tNgGrpcFunctionHandle funcHandle = (NgGrpcFunctionHandle) elemHandle;\n\t\t\t\telemHandleID = funcHandle.getExecutableID();\n\t\t\t} else if (elemHandle instanceof NgGrpcObjectHandle) {\n\t\t\t\t/* object handle */\n\t\t\t\tNgGrpcObjectHandle objHandle = (NgGrpcObjectHandle) elemHandle;\n\t\t\t\telemHandleID = objHandle.getExecutableID();\n\t\t\t} else {\n\t\t\t\t/* error */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* check if it's the target */\n\t\t\tif (elemHandleID == targetHandleID) {\n\t\t\t\t/* target was found! remove it */\n\t\t\t\thandleList.remove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static void bgfx_destroy_index_buffer(@NativeType(\"bgfx_index_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_index_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public void unsetAutoReplyTriggeredSend()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(AUTOREPLYTRIGGEREDSEND$20, 0);\n }\n }", "@Override\n\tpublic void disposeHandle(SVGHandle handle) {\n\t\tFile projectFile = handle.getScrollPane().getSVGCanvas()\n\t\t\t\t.getProjectFile();\n\n\t\tif (projectFile != null && shouldDisposeProjectFiles(projectFile)) {\n\n\t\t\t// removing the loaded action classes\n\t\t\tActionsLoader.removeClasses(ActionsLoader\n\t\t\t\t\t.getProjectName(projectFile));\n\n\t\t\t// removing the entry of this project file\n\t\t\t((RtdaColorChooserModule) Editor.getColorChooser())\n\t\t\t\t\t.getColorsAndBlinkingsToolkit().removeColorsAndBlinkings(\n\t\t\t\t\t\t\tColorsAndBlinkingsToolkit\n\t\t\t\t\t\t\t\t\t.getProjectName(projectFile));\n\n\t\t\t// TODO\n\t\t}\n\n\t\tsuper.disposeHandle(handle);\n\t}", "public static native void cleanNotifier(int notifierHandle);", "public void unsetAutoForwardTriggeredSend()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(AUTOFORWARDTRIGGEREDSEND$16, 0);\n }\n }", "HRESULT VariantClear(VARIANT pvarg);", "public void clear() throws ChangeVetoException;", "public static native void destroyHandle();", "@Override\n public void handle(ActionEvent t) {\n c1.setText(\"\");\n c2.setText(\"\");\n }", "@Action\n public void acCancel() {\n setChangeObj(false);\n }", "@Action\n public void acCancel() {\n setChangeObj(false);\n }", "public static void bgfx_destroy_vertex_buffer(@NativeType(\"bgfx_vertex_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_vertex_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public T caseReactionTrigger(ReactionTrigger object) {\r\n\t\treturn null;\r\n\t}", "void unsetRef();", "private static native void stopAnalogActionMomentum(long pointer,\n long controllerHandle,\n long analogActionHandle);", "public void clear(int flag) {\n setWaitFlags( waitFlags & ~flag );\n }", "public void retract(FactHandle handle) {\n mKsession.retract(handle);\n }", "void clearAndNotify();", "public void revoke();", "public T caseTrigger(Trigger object) {\r\n\t\treturn null;\r\n\t}", "@FXML\n\tprivate void handleCancel() {\n\t\tdialogStage.close();\n\t\t\n\t\tif (acknowledgment.getANumber() == null) {\n\t\t\tmain.getDbHelper().deleteAcknowledgment(acknowledgment);\n\t\t}\n\t\t\n\t\tmain.getAcknowledgmentData().clear();\n\t\tmain.getAcknowledgmentData().addAll(main.getDbHelper().retrieveAcknowledgmentList());\n\t}", "public static native void stopNotifierAlarm(int notifierHandle);", "protected void ACTION_ON_CLEAR(ActionEvent arg0) {\n\t\ttextArea_1.setText(\"\");\r\n\t}", "void delete(String receiptHandle);", "public int maDBCursorDestroy(int cursorHandle)\n \t{\n \t\tif (!hasCursor(cursorHandle))\n \t\t{\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \n \t\tremoveCursor(cursorHandle);\n \t\treturn MA_DB_OK;\n \t}", "protected void reset()\n {\n if (_resetTimedEvent != null && !_resetTimedEvent.hasAborted()\n && !_resetTimedEvent.hasFired()) _resetTimedEvent.abort();\n\n clearFlag();\n }", "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") // I know what I'm doing - famous last words.\n private static void awaitCompletion(final HashMultimap<UUID, Future<Void>> handles, final UUID handle) {\n final Set<Future<Void>> futures;\n synchronized (handles) {\n futures = handles.removeAll(handle);\n }\n\n for (final Future<Void> future : futures) {\n await(future);\n }\n }", "@Override\n\tpublic AssetManageReqHandle remove(long handleId)\n\t\tthrows NoSuchAssetManageReqHandleException, SystemException {\n\t\treturn remove((Serializable)handleId);\n\t}", "private void triggerReset() {\n DefenceField.fieldActivated = false;\n OnFieldReset event = new OnFieldReset(this::doActivation);\n event.beginTask();\n DefenceField.getShrineEntity().send(event);\n event.finishTask();\n }", "@Override\n public void handle(ActionEvent t) {\n e1.setText(\"\");\n e2.setText(\"\");\n }", "public void dropHandle(RepositoryServerHandleImpl handle) {\n\t\tsynchronized (handleList) {\n\t\t\thandleList.remove(handle);\n\t\t}\n\t}", "void clearSoftLock(SoftLock softLock);", "public void clearInterrupt() {\n Object object = this.msgSync;\n synchronized (object) {\n this.msg = 0;\n }\n }", "public void cancelAudioCapture(){\n\t\tLogger.log(\"cancelAudioCapture()::BEGIN\");\n\t\tif (mRecordControl != null){\n\t\t\ttry {\n\t\t\t\tmRecordControl.reset();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tRecorderEvent re = new RecorderEvent();\n\t\tre.setType(RecorderEvent.RECORD_CANCEL);\n\t\tnotifyListener(re);\n\t\tLogger.log(\"cancelAudioCapture()::END\");\n\t}", "private void handleActionBaz() {\n Notifier.cancelTimer(this);\n }", "void DevClear (int boardID, short addr);", "abstract protected boolean clearSurroundHandle(Location m);", "public void ClearActionPerformed(java.awt.event.ActionEvent evt) {\n drawingPanel.setPath(\"null\"); \r\n }", "public static void bgfx_destroy_dynamic_index_buffer(@NativeType(\"bgfx_dynamic_index_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_dynamic_index_buffer;\n invokeCV(_handle, __functionAddress);\n }", "@Editor.Ignore\n T clear(boolean silent);", "public void setTrigger(Trigger trigger) {\n \t\tthis.trigger = trigger;\n \t\tif (this.trigger == null)\n \t\t\tthis.trigger = Trigger.NONE;\n \t}", "@Override\n\tpublic void clearRecording(int srcPin) throws emException, TException {\n\n\t}", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n if (mCaptureSession != null) {\n mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mState = STATE_PREVIEW;\n mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler);\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public abstract Promise<JsonValue, ResourceException> clear(Context context, String resourceId);", "public void clearFocusWithoutChangingState() {\n this.mFocusManager.removeMessages();\n this.mUI.clearFocus();\n this.mCameraDevice.cancelAutoFocus();\n this.mUI.clearEvoPendingUI();\n if (this.mEvoFlashLock != null) {\n this.mAppController.getButtonManager().enableButtonWithToken(0, this.mEvoFlashLock.intValue());\n this.mEvoFlashLock = null;\n }\n this.mFocusManager.setAeAwbLock(false);\n setCameraParameters(4);\n }", "public static void clearIntake(LogitechFlightStick joy) {\n\n\t\tif (joy.getButton(11)) {\n\t\t\tintake.set(-1.0);\n\t\t}\n\n\t\tintake.set(0.0);\n\t}", "protected abstract void handleCancel();", "public void deselect(){\n\t\tPIN.reset();\n\t}", "void clearAssetConnection(String userId,\n String assetManagerGUID,\n String assetManagerName,\n String assetGUID,\n String connectionGUID,\n Date effectiveTime,\n boolean forLineage,\n boolean forDuplicateProcessing) throws InvalidParameterException,\n UserNotAuthorizedException,\n PropertyServerException;", "public static void remove(VkObject ...handles){\n if(handles == null) return;\n for (VkObject vkHandle : handles) {\n if(vkHandle != null)\n vkHandle.free();\n }\n }", "public abstract void onReset();", "public native static int cancel();", "public static native void OpenMM_HippoNonbondedForce_destroy(PointerByReference target);", "@Override\n\tpublic String unbind(String arg0) {\n\t\treturn null;\n\t}", "private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed\n textArea.setText(null);\n }", "public DraggableBehavior setHandle(String handle)\n\t{\n\t\tthis.options.putLiteral(\"handle\", handle);\n\t\treturn this;\n\t}", "void unsetAuto();", "public void cloudClear (int stateKey, GPGAppStateConflictHandler conflictHandler, GPGAppStateWriteResultHandler resultHandler) {\n\n\t\t// get the model\n\t\tfinal GPGAppStateModel model = GPGManager.sharedInstance().getApplicationModel().getAppState();\n\n\t\t// clear the state\n\t\tmodel.clear(NSNumber.valueOf(stateKey), resultHandler, conflictHandler);\n\t}", "@Override\n\tpublic void removeTrigger() {\n\t\tplayer.removeListener(this.listener, EventNameType.SOUL_FIGHT);\n\t}", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n mCaptureRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,\n CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n mPreviewCaptureSession.capture(mCaptureRequestBuilder.build(), mPreviewCaptureCallback,\n mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mCaptureState = STATE_PREVIEW;\n mPreviewCaptureSession.setRepeatingRequest(mPreviewRequest, mPreviewCaptureCallback,\n mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public T caseTriggerDesc(TriggerDesc object) {\n\t\treturn null;\n\t}", "public void setHandle(String handle) {\r\n this.handle = handle;\r\n }", "public boolean cancel();", "public void clear() throws RemoteException, Error;", "public void clear() {\r\n if (ObjectiveFunctionWrapper.this.m_use)\r\n this.m_state.clear();\r\n }", "public T caseDefaultTrigger(DefaultTrigger object) {\r\n\t\treturn null;\r\n\t}", "public void onUnblock();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancelLogCapture() {\n if (logFileHandle_ == null) {\n return;\n }\n\n core_.logMessage(\"Problem Report: Canceling log capture\");\n try {\n core_.stopSecondaryLogFile(logFileHandle_);\n } catch (Exception ignore) {\n // Errors will be logged by the Core; there is not much else we can\n // do.\n }\n logFileHandle_ = null;\n\n new File(logFileName_).delete();\n logFileName_ = null;\n }", "public static void bgfx_destroy_dynamic_vertex_buffer(@NativeType(\"bgfx_dynamic_vertex_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_dynamic_vertex_buffer;\n invokeCV(_handle, __functionAddress);\n }", "void unsetExchange();", "@Override\n public void handle(WindowEvent t) {\n System.exit(0);\n }", "void unsetEvent();", "void clearHandlers();", "private void clearChangeHeadpicRelay() {\n if (rspCase_ == 21) {\n rspCase_ = 0;\n rsp_ = null;\n }\n }", "protected abstract void ceaseHelper();", "private void clearButtonActionPerformed(ActionEvent evt) {\r\n\t\tlogger.info(\"Clear button Clicked.\");\r\n\t\tinputTextField.setText(\"\");\r\n\t\toutputScoreTextArea.setText(\"\");\r\n\t}", "@Override\n public void cancelAutoFocus() {\n mCameraDevice.cancelAutoFocus();\n if (mCameraState != SELFTIMER_COUNTING\n && mCameraState != SNAPSHOT_IN_PROGRESS) {\n setCameraState(IDLE);\n }\n setCameraParameters(UPDATE_PARAM_PREFERENCE);\n isTouchCalled = false;\n }", "void unsetState();", "void unsetValueAttachment();", "int clear();", "private void clearUpdateTriggerTime() {\n bitField0_ = (bitField0_ & ~0x00000002);\n updateTriggerTime_ = 0;\n }" ]
[ "0.60719675", "0.6059072", "0.6049814", "0.6049814", "0.52038515", "0.5110589", "0.50607884", "0.50453347", "0.5027549", "0.48740032", "0.48539802", "0.48206112", "0.47372603", "0.47357133", "0.47354662", "0.47249547", "0.4619289", "0.46126193", "0.4595313", "0.45872098", "0.45708364", "0.45582294", "0.45582294", "0.45553237", "0.4543684", "0.45433947", "0.4524617", "0.45152405", "0.45102936", "0.44744807", "0.44720444", "0.4432737", "0.44315138", "0.44301695", "0.44293502", "0.44102216", "0.43921793", "0.43887645", "0.4387875", "0.43868336", "0.4382872", "0.4348906", "0.43197793", "0.4315714", "0.43076473", "0.43004474", "0.4296515", "0.42908955", "0.42678207", "0.4262369", "0.42623633", "0.425453", "0.42342868", "0.42308497", "0.42265204", "0.4221871", "0.4214494", "0.42067963", "0.42012972", "0.41948158", "0.41940212", "0.41931644", "0.41715634", "0.4159146", "0.41535804", "0.41501656", "0.41469073", "0.41318867", "0.412712", "0.41263238", "0.4124566", "0.4123991", "0.412142", "0.41175288", "0.41156837", "0.41110772", "0.41075763", "0.4104515", "0.40999177", "0.4098517", "0.4098517", "0.4098517", "0.4098517", "0.4098517", "0.4098517", "0.40976512", "0.40970838", "0.40920523", "0.40875807", "0.40802085", "0.40781057", "0.4076204", "0.40743375", "0.40734556", "0.40733084", "0.40730244", "0.4066889", "0.40619907", "0.40574178", "0.40549558" ]
0.56145585
4
Creates a table that is the result of a SQL JOIN. For details see: join concept documentation.
public CreateJoinTableResponse createJoinTable(CreateJoinTableRequest request) throws GPUdbException { CreateJoinTableResponse actualResponse_ = new CreateJoinTableResponse(); submitRequest("/create/jointable", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FromTableJoin createFromTableJoin();", "Join createJoin();", "protected void createSubQueryJoinTable() throws ODataApplicationException {\r\n try {\r\n final List<JPAOnConditionItem> left = association\r\n .getJoinTable()\r\n .getJoinColumns(); // Team -->\r\n final List<JPAOnConditionItem> right = association\r\n .getJoinTable()\r\n .getInverseJoinColumns(); // Person -->\r\n createSelectClauseJoin(subQuery, queryRoot, right);\r\n Expression<Boolean> whereCondition = createWhereByAssociation(from, queryJoinTable, left);\r\n whereCondition = cb.and(whereCondition, createWhereByAssociation(queryJoinTable, queryRoot, right));\r\n subQuery.where(applyAdditionalFilter(whereCondition));\r\n } catch (final ODataJPAModelException e) {\r\n throw new ODataJPAQueryException(e, HttpStatusCode.INTERNAL_SERVER_ERROR);\r\n }\r\n\r\n }", "Table noCommonJoin(String name, Table t1, Table t2) {\n {\n String[] names = new String[t1.colSize() + t2.colSize()];\n String[] types = new String[t1.colSize() + t2.colSize()];\n\n System.arraycopy(t1.getColNames(), 0, names, 0, t1.colSize());\n System.arraycopy(t2.getColNames(), 0, names, t1.colSize(), t2.colSize());\n System.arraycopy(t1.getColTypes(), 0, types, 0, t1.colSize());\n System.arraycopy(t2.getColTypes(), 0, types, t1.colSize(), t2.colSize());\n\n Table t = new Table(name, names, types);\n\n for (int i = 0; i < t1.rowSize(); i += 1) {\n for (int j = 0; j < t2.rowSize(); j += 1) {\n t.insertLastRow(t1.combineRows(t2, i, j));\n }\n }\n return t;\n }\n }", "TableOrAlias createTableOrAlias();", "Table createTable();", "TABLE createTABLE();", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "<V1, R> KTable<K, R> join(KTable<K, V1> other, ValueJoiner<V, V1, R> joiner);", "@Test(timeout = 4000)\n public void test043() throws Throwable {\n String[] stringArray0 = new String[6];\n String string0 = SQLUtil.innerJoin(\"create table \", stringArray0, (String) null, \"FMK$x:Q_QfZ|{K*oyK \", stringArray0);\n assertEquals(\"null as FMK$x:Q_QfZ|{K*oyK on create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null\", string0);\n }", "private void appendTempTableRightSideJoin(\r\n Object source,\r\n Attribute[] prototypeAttributes,\r\n MithraFastList<Attribute> nullAttributes,\r\n int pkAttributeCount,\r\n TupleTempContext tempContext,\r\n StringBuilder builder)\r\n {\r\n builder.append(tempContext.getFullyQualifiedTableName(source, this.getMithraObjectPortal().getPersisterId()));\r\n builder.append(\" t1 where \");\r\n this.constructJoin(prototypeAttributes, nullAttributes, pkAttributeCount, builder);\r\n }", "FromTable createFromTable();", "public String createTable() {\n\n String statement = \"CREATE TABLE \" + tableName + \"( \";\n\n //go through INTEGER, FLOAT, TEXT columns\n Iterator iterator = Iterables.filter(columns.entrySet(), entry -> entry.getValue().getType() instanceof String).iterator();\n\n while (iterator.hasNext()) {\n Map.Entry<Element, FieldData> fieldDataEntry = (Map.Entry<Element, FieldData>) iterator.next();\n statement += fieldDataEntry.getValue().createColumn() + \",\";\n }\n\n return (new StringBuilder(statement).replace(statement.length() - 1, statement.length(), \"\").toString() + \")\").toUpperCase();\n }", "tbls createtbls();", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "<V1, R> KTable<K, R> leftJoin(KTable<K, V1> other, ValueJoiner<V, V1, R> joiner);", "public void testMember(){\n\r\n parser.sqltext = \"select f from t1\";\r\n assertTrue(parser.parse() == 0);\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getKind() == TBaseType.join_source_fake );\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getTable().toString().compareToIgnoreCase(\"t1\") == 0);\r\n\r\n parser.sqltext = \"select f from t as t1 join t2 on t1.f1 = t2.f1\";\r\n assertTrue(parser.parse() == 0);\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getKind() == TBaseType.join_source_table );\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getTable().toString().compareToIgnoreCase(\"t\") == 0);\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getTable().getAliasClause().toString().compareToIgnoreCase(\"t1\") == 0);\r\n\r\n\r\n parser.sqltext = \"select a_join.f1 from (a as a_alias left join a1 on a1.f1 = a_alias.f1 ) as a_join join b on a_join.f1 = b.f1;\";\r\n assertTrue(parser.parse() == 0);\r\n TJoin lcJoin = parser.sqlstatements.get(0).joins.getJoin(0);\r\n //System.out.println(lcJoin.getKind());\r\n assertTrue(lcJoin.getKind() == TBaseType.join_source_join );\r\n\r\n assertTrue(lcJoin.getJoin().toString().compareToIgnoreCase(\"(a as a_alias left join a1 on a1.f1 = a_alias.f1 )\") == 0);\r\n assertTrue(lcJoin.getJoin().getAliasClause().toString().compareToIgnoreCase(\"a_join\") == 0);\r\n assertTrue(lcJoin.getJoin().getJoinItems().getJoinItem(0).getJoinType() == EJoinType.left);\r\n\r\n assertTrue(lcJoin.getJoinItems().getJoinItem(0).getJoinType() == EJoinType.join);\r\n\r\n parser.sqltext = \"select a_join.f1 from (a as a_alias left join a1 on a1.f1 = a_alias.f1 ) as a_join\";\r\n assertTrue(parser.parse() == 0);\r\n TJoin lcJoin1 = parser.sqlstatements.get(0).joins.getJoin(0);\r\n assertTrue(lcJoin1.getKind() == TBaseType.join_source_join );\r\n assertTrue(lcJoin1.getJoin().toString().compareToIgnoreCase(\"(a as a_alias left join a1 on a1.f1 = a_alias.f1 )\") == 0);\r\n assertTrue(lcJoin1.getJoin().getAliasClause().toString().compareToIgnoreCase(\"a_join\") == 0);\r\n\r\n }", "public static void create_join_CP(String databaseCT,String rchain,Connection con2) throws SQLException{\n\t\t\n\t\tString table_name = databaseCT+\"_CT.\"+rchain.substring(0,rchain.length()-1) + \"_CT`\";\n\t\t//System.out.println(databaseCT+\"_CT\");\n\t\tString newTable_name = rchain.substring(0,rchain.length()-1) + \"_CT_KLD`\";\n\t\t//System.out.println(table_name);\n\t\t// table_name is input contingency table, newTable_name will be output KLD table\n\t\tStatement st=con2.createStatement();\n ResultSet rst=st.executeQuery(\"show columns from \"+table_name+\" ;\");\n // System.out.println(\"show columns from \"+table_name+\" ;\");\n while(rst.next()){\n \tcolumn_names.add(\"`\"+rst.getString(1)+\"`\");\n \tcolumn_names_CP.add(\"`\"+rst.getString(1)+\"_CP`\");\n \t// add conditional probability column for each attribute column\n }\n \n \n st.execute(\"drop table if exists \" + newTable_name);\n String query1=\"create table \" + newTable_name + \" ( id int(11) NOT NULL AUTO_INCREMENT, MULT BIGINT(21), \" ;\n // make query string for creating KLD table\n // auto index each row in table\n for(int i=1; i<column_names.size(); i++){\n \tquery1 = query1 + column_names.get(i) + \" VARCHAR(45),\" + column_names_CP.get(i) + \" float(7,6) ,\";\n // add column headers\t\t\n }\n query1 = query1 + \" JP float, JP_DB float, KLD float default 0, PRIMARY KEY (id) ) engine=INNODB;\";\n //System.out.println(query1);\n st.execute(query1);\n \n // copy the values from the mult table. CP values are null at this point.\n String query2 = \"insert into \" + newTable_name + \" ( MULT\";\n for(int i=1; i<column_names.size(); i++){\n \tquery2 = query2 + \", \" + column_names.get(i);\n }\n query2 = query2 + \" ) select * from \"+table_name+\"; \"; // Nov 28 @ zqian, do not use \"*\" in terms of query optimization\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t// Nov 28 @ zqian, adding covering index to CT table for query string \n System.out.println(query2);\n st.execute(query2);\n \n System.out.println(\"\\n insert into KLD table conditional probability for each node\"); // zqian\n //insert CP value to attributes\n insert_CP_Values(rchain, newTable_name,con2);\n System.out.println(\"\\n compute Bayes net joint probabilities \"); //zqian\n //compute Bayes net joint probabilities \n cal_KLD(newTable_name,con2);\n \n \n st.close();\n\t}", "public String toString() {\n\t\treturn \"JoinTableSpec(\"+leftTable.toString()+\" INNER JOIN \"+rightTable.toString()\n\t\t\t\t+\" ON \"+leftCell.toString()+\" = \"+rightCell.toString()+\")\";\n\t}", "public interface ISQLiteJoinTableCreator {\n\n}", "public Table asTable() {\n Table table = Table.create(this.name());\n for (Column<?> column : this.columns()) {\n table.addColumns(column);\n }\n return table;\n }", "public void doCreateTable();", "public static String createSimpleCreateTableQuery(String tableName, String storageEngine, String selectQuery) {\n builder.setLength(0);\n builder.append(\"CREATE TABLE `\").append(tableName).append(\"` ENGINE = \").append(storageEngine).append(\" AS \");\n builder.append(selectQuery);\n return builder.toString();\n }", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "<V1, R> KTable<K, R> outerJoin(KTable<K, V1> other, ValueJoiner<V, V1, R> joiner);", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "public void testJoin() {\n\n\t\t\tSystem.out.println(\"\\nSELECT first,last,street,city,state,zip\" + \" FROM people, address\"\n\t\t\t\t\t+ \" WHERE people.addrId = address.addrId\");\n\n\t\t\t// Collection version chains to String[] version,\n\t\t\t// so this code tests both:\n\t\t\tList columns = new ArrayList();\n\t\t\tcolumns.add(\"first\");\n\t\t\tcolumns.add(\"last\");\n\t\t\tcolumns.add(\"street\");\n\t\t\tcolumns.add(\"city\");\n\t\t\tcolumns.add(\"state\");\n\t\t\tcolumns.add(\"zip\");\n\n\t\t\tList tables = new ArrayList();\n\t\t\ttables.add(address);\n\n\t\t\tTable result = // WHERE people.addrID = address.addrID\n\t\t\t\t\tpeople.select(new Selector.Adapter() {\n\t\t\t\t\t\tpublic boolean approve(Cursor[] tables) {\n\t\t\t\t\t\t\treturn tables[0].column(\"addrId\").equals(tables[1].column(\"addrId\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}, columns, tables);\n\n\t\t\tprint(result);\n\t\t\tSystem.out.println(\"\");\n\n\t\t\t// Now test a three-way join\n\t\t\t//\n\t\t\tSystem.out.println(\"\\nSELECT first,last,street,city,state,zip,text\" + \" FROM people, address, third\"\n\t\t\t\t\t+ \" WHERE (people.addrId = address.addrId)\" + \" AND (people.addrId = third.addrId)\");\n\n\t\t\tTable third = TableFactory.create(\"third\", new String[] { \"addrId\", \"text\" });\n\t\t\tthird.insert(new Object[] { \"1\", \"addrId=1\" });\n\t\t\tthird.insert(new Object[] { \"2\", \"addrId=2\" });\n\n\t\t\tresult = people.select(new Selector.Adapter() {\n\t\t\t\tpublic boolean approve(Cursor[] tables) {\n\t\t\t\t\treturn (tables[0].column(\"addrId\").equals(tables[1].column(\"addrId\"))\n\t\t\t\t\t\t\t&& tables[0].column(\"addrId\").equals(tables[2].column(\"addrId\")));\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t\t\tnew String[] { \"last\", \"first\", \"state\", \"text\" }, new Table[] { address, third });\n\n\t\t\tSystem.out.println(result.toString() + \"\\n\");\n\t\t}", "public OwJoinedTable(OwTableReference tableReference1_p, OwTableReference tableReference2_p, OwJoinSpecification joinSpecification_p)\r\n {\r\n this(tableReference1_p, DEFAULT_JOIN_TYPE, tableReference2_p, joinSpecification_p);\r\n }", "@Test(timeout = 4000)\n public void test054() throws Throwable {\n String[] stringArray0 = new String[8];\n String string0 = SQLUtil.join(\"inner\", \"create tablept5qf^h^w72cnj\", stringArray0, \"Y[W,@7e}2gcxB\", \"alter tableo\", stringArray0);\n assertEquals(\"Y[W,@7e}2gcxB as alter tableo on create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null and create tablept5qf^h^w72cnj.null = alter tableo.null\", string0);\n }", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "Table joinTwoTables(String name, Table t1, Table t2) {\n if (t1.equals(t2)) {\n return t1;\n }\n int sim = 0;\n LinkedList<String> simNames = new LinkedList<>();\n for (String c1 : t1.getColNames()) {\n for (String c2 : t2.getColNames()) {\n if (c1.equals(c2)) {\n sim += 1;\n simNames.addLast(c1);\n }\n }\n }\n if (sim == 0) {\n return noCommonJoin(name, t1, t2);\n }\n //Check matches between similar columns and log the row number per table\n LinkedList<Integer> simRowsT1 = new LinkedList<>();\n HashMap<Integer, LinkedList> t1ToT2 = new HashMap<>();\n LinkedList<LinkedList> totalSimRows = new LinkedList<>();\n\n checkSimColumns(t1, t2, simNames, t1ToT2, simRowsT1, totalSimRows);\n boolean flag = false;\n\n /**Here we check if there is a repetition\n * of the same row equal to the number of similar columns*/\n simRowsT1 = totalSimRows.get(0);\n LinkedHashSet<Integer> similarRow = new LinkedHashSet<>();\n LinkedList<Integer> simRowsTemp;\n LinkedList<Integer> simRowsFinal = new LinkedList<>();\n if (totalSimRows.size() > 1) {\n for (int i = 1; i < totalSimRows.size(); i++) {\n simRowsTemp = totalSimRows.get(i);\n int count = 0;\n for (int j = 0; j < simRowsT1.size(); j++) {\n Integer intTemp = simRowsT1.get(j);\n for (int k = 0; k < simRowsTemp.size(); k++) {\n if (intTemp == simRowsTemp.get(k)) {\n count += 1;\n }\n if (count == sim) {\n similarRow.add(intTemp);\n break;\n }\n }\n }\n }\n } else {\n simRowsFinal = simRowsT1;\n }\n simRowsFinal.addAll(0, similarRow);\n /**Call createSubTable with similar column & rows to generate similarity subTable*/\n Table simTable = t1.similarSubTable(simNames, simRowsFinal);\n /**Call createSubTable with unsimilar column & rows to generate unsimilar subTable from t1*/\n Table unsimT1 = t1.unsimSubTable(simNames, simRowsFinal);\n /**Call createSubTable with unsimilar column & rows to generate unsimilar subTable from t2*/\n if (!flag) {\n for (int i = 0; i < simRowsFinal.size(); i++) {\n simRowsFinal.addLast(\n (Integer) (t1ToT2.get(simRowsFinal.removeFirst())).removeFirst());\n }\n } else {\n int row;\n int size1 = simRowsFinal.size();\n int size2;\n for (int i = 0; i < size1; i++) {\n row = simRowsFinal.removeFirst();\n size2 = (t1ToT2.get(row).size());\n for (int j = 0; j < size2; j++) {\n simRowsFinal.addLast((Integer) (t1ToT2.get(row).removeFirst()));\n }\n }\n }\n Table unsimT2 = t2.unsimSubTable(simNames, simRowsFinal);\n simTable = simTable.naiveJoinTables(unsimT1);\n return simTable.naiveJoinTables(unsimT2);\n }", "public static LearningTable createLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createExamples(table.getAttributes()));\n\t\t\n\t\treturn table;\n\t}", "TableInstance createTableInstance();", "private void createTables() {\n\t\tStatement s = null;\n\t\ttry {\n\t\t\ts = conn.createStatement();\n\t\t} catch (SQLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\tString createString = \"CREATE TABLE targeteprs (\" +\n\t\t\t\t\t \"targetepr varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"processID varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"operation varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"status varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"uniqueID varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"correlationKey varchar(255) NOT NULL, \"+\n\t\t\t\t\t \"correlationValue varchar(255) NOT NULL)\";\n\t\t//System.out.println(\"CREATE: \" + createString);\n\t\tSystem.out.println(\"--> Created targetepr table.\");\n\t\ttry {\n\t\t\tthis.insertQuery(createString);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tcreateString = \"CREATE TABLE workflow (\" +\n\t\t\t\t\t \"uniqueID varchar(100) NOT NULL, \" +\n\t\t\t\t\t \"processID varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"operation varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"status varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"correlationKey varchar(255) NOT NULL, \"+\n\t\t\t\t\t \"correlationValue varchar(255) NOT NULL)\";\n\t\t//System.out.println(\"CREATE: \" + createString);\n\t\tSystem.out.println(\"--> Created workflow table.\");\n\t\ttry {\n\t\t\tthis.insertQuery(createString);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }", "private void appendJoinStatement(JoinStage left,\n JoinStage right) {\n String joinType;\n\n if (left.isRequired() && right.isRequired()) {\n joinType = \"INNER\";\n } else if (left.isRequired() && !right.isRequired()) {\n joinType = \"LEFT OUTER\";\n } else if (!left.isRequired() && right.isRequired()) {\n joinType = \"RIGHT OUTER\";\n } else {\n joinType = \"FULL OUTER\";\n }\n\n // ... <join_type> JOIN <right_table> ON ...\n builder.append(joinType);\n builder.append(JOIN);\n appendFullTableNameAndAlias(right.getStageName());\n builder.append(ON);\n }", "TableFull createTableFull();", "@Override\n\tpublic String getJoinTable() {\n\t\treturn null;\n\t}", "private RelationalTable convertTable(org.hibernate.mapping.Table mappedTable) {\n RelationalTable table = new RelationalTable(m_catalogSchema, getTableName(mappedTable));\n\n List<Column> columns = new ArrayList<>();\n List<RelationalIndex> indices = new ArrayList<>();\n\n @SuppressWarnings(\"unchecked\")\n Iterator<org.hibernate.mapping.Column> mappedColumns = mappedTable.getColumnIterator();\n int idx = 1;\n while (mappedColumns.hasNext()) {\n org.hibernate.mapping.Column mappedColumn = mappedColumns.next();\n Column column = convertColumn(mappedColumn, mappedTable, idx++);\n columns.add(column);\n if (mappedColumn.isUnique()) {\n indices.add(getUniqueIndex(table, column));\n }\n }\n\n table.setColumns(columns);\n\n Set<ForeignKey> fkeys = new HashSet<>();\n @SuppressWarnings(\"unchecked\")\n Iterator<org.hibernate.mapping.ForeignKey> mappedKeys = mappedTable.getForeignKeyIterator();\n while (mappedKeys.hasNext()) {\n convertForeignKey(mappedKeys.next(), fkeys);\n }\n\n table.setFks(fkeys);\n\n @SuppressWarnings(\"unchecked\")\n Iterator<Index> mappedIndices = mappedTable.getIndexIterator();\n\n while (mappedIndices.hasNext()) {\n indices.add(convertIndex(mappedIndices.next(), table));\n }\n\n @SuppressWarnings(\"unchecked\")\n Iterator<UniqueKey> mappedUniqueKeys = mappedTable.getUniqueKeyIterator();\n while (mappedUniqueKeys.hasNext()) {\n indices.add(convertIndex(mappedUniqueKeys.next(), table));\n }\n\n if (mappedTable.getPrimaryKey() != null) {\n indices.add(convertIndex(mappedTable.getPrimaryKey(), table));\n List<String> pkColumnNames = new ArrayList<>();\n @SuppressWarnings(\"unchecked\")\n Iterator<org.hibernate.mapping.Column> pkColumns = mappedTable.getPrimaryKey().getColumnIterator();\n while (pkColumns.hasNext()) {\n pkColumnNames.add(getColumnName(pkColumns.next()));\n }\n table.setPkColumns(pkColumnNames);\n }\n\n table.setIndices(indices);\n\n return table;\n }", "public static void createRedshiftTable(String redshiftURL,\n Properties loginProperties,\n String tableName,\n List<String> fields) throws SQLException {\n Connection conn = DriverManager.getConnection(redshiftURL, loginProperties);\n Statement stmt = conn.createStatement();\n stmt.execute(\"CREATE TABLE \" + tableName + \" \" + toSQLFields(fields) + \";\");\n stmt.close();\n conn.close();\n }", "public HtmlTable createTable() {\n\t\tHtmlTable table = null;\n\t\tif (recordList != null) {\n\t\t\ttable = new HtmlTable();\n\t\t\tint irow = 0;\n\t\t\tfor (CSVRecord record : recordList) {\n\t\t\t\tHtmlTr tr = createTr(record, irow);\n\t\t\t\ttable.appendChild(tr);\n\t\t\t\tirow++;\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}", "public final void mT__90() throws RecognitionException {\n try {\n int _type = T__90;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:60:7: ( 'join-tables' )\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:60:9: 'join-tables'\n {\n match(\"join-tables\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Override\n\tpublic void createTable(Object connectionHandle, DataTable table) throws DataSourceException\n\t{\n\t\tList<DataField> fields = new LinkedList<DataField>();\n\t\tList<String> indexes = new LinkedList<String>();\n\t\t\n\t\tList<String> keys = table.getFields();\n\t\tIterator<String> it = keys.iterator();\n\t\twhile(it.hasNext()){\n\t\t\tString fld = it.next();\n\t\t\tDataField df = table.getDataField(fld);\n\t\t\t\n\t\t\tfields.add(df);\n\t\t\t\n\t\t//\tif(df.isPrimary()){\n\t\t//\t\tindexes.add(fld);\n\t\t//\t}\n\t\t}\n\t\t\n\t\tIterator<DataField> primaryIt = table.getPrimaryKeys().iterator();\n\t\twhile(primaryIt.hasNext()){\n\t\t\tDataField pf = primaryIt.next();\n\t\t\t\n\t\t\tindexes.add(pf.getName());\n\t\t}\n\t\t\n\t\t\n\t\t// Make SQL String\n\t\tStringBuffer sqlString = new StringBuffer();\n\t\tsqlString.append(\"CREATE TABLE \");\n\t\tsqlString.append(table.getName());\n\t\tsqlString.append(\" ( \\n\");\n\t\t\n\t\tboolean first = true;\n\t\tIterator<DataField> itDf = fields.iterator();\n\t\twhile(itDf.hasNext()){\n\t\t\tDataField fld = itDf.next();\n\t\t\t\n\t\t\tif(first){\n\t\t\t\tfirst = false;\n\t\t\t}else{\n\t\t\t\tsqlString.append(\",\\n\");\n\t\t\t}\n\t\t\t\n\t\t\tsqlString.append(fld.getName());\n\t\t\tsqlString.append(\" \");\n\t\t\tsqlString.append(getSQLType(fld.getType()));\n\t\t\t\n\t\t\t// not null\n\t\t\tif(fld.isNotnull()){\n\t\t\t\tsqlString.append(\" NOT NULL\");\n\t\t\t}\n\t\t\t\n\t\t\t// unique\n\t\t\tif(fld.isUnique()){\n\t\t\t\tsqlString.append(\" UNIQUE\");\n\t\t\t}\n\t\t\t\n\t\t\t// default\n\t\t\tif(fld.getDefaultValue() != null){\n\t\t\t\tsqlString.append(\" \");\n\t\t\t\tsqlString.append(fld.getDefaultString());\n\t\t\t}\n\t\t\t\n\t\t\t// check\n\t\t\tif(fld.getCheck() != null){\n\t\t\t\tsqlString.append(\" \");\n\t\t\t\ttry {\n\t\t\t\t\tsqlString.append(fld.getCheck().extract(null, null, null, null, null));\n\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow new DataSourceException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check\n\t\tIterator<CheckDefinition> checkIt = table.getCheck().iterator();\n\t\twhile(checkIt.hasNext()){\n\t\t\tCheckDefinition def = checkIt.next();\n\t\t\t\n\t\t\tsqlString.append(\",\\n\");\n\t\t\ttry {\n\t\t\t\tsqlString.append(def.extract(null, null, null, null, null));\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new DataSourceException(e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// foreign key\n\t\tIterator<ForeignKey> foreignIt = table.getForeignKey().iterator();\n\t\twhile(foreignIt.hasNext()){\n\t\t\tForeignKey fkey = foreignIt.next();\n\t\t\t\n\t\t\tsqlString.append(\",\\n\");\n\t\t\ttry {\n\t\t\t\tsqlString.append(fkey.extract(null, null, null, null, null));\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new DataSourceException(e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// primary key\n\t\tif(indexes.size() > 0){\n\t\t\tsqlString.append(\",\\n\");\n\t\t\tsqlString.append(\"PRIMARY KEY(\");\n\t\t\t\n\t\t\tfirst = true;\n\t\t\tit = indexes.iterator();\n\t\t\twhile(it.hasNext()){\n\t\t\t\tString idxFld = it.next();\n\t\t\t\t\n\t\t\t\tif(first){\n\t\t\t\t\tfirst = false;\n\t\t\t\t}else{\n\t\t\t\t\tsqlString.append(\", \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsqlString.append(idxFld);\n\t\t\t}\n\n\t\t\tsqlString.append(\")\");\n\t\t}\n\t\t\n\t\t// unique\n\t\tIterator<Unique> itU = table.getUnique().iterator();\n\t\twhile(itU.hasNext()){\n\t\t\tUnique unique = itU.next();\n\t\t\t\n\t\t\tsqlString.append(\",\\n\");\n\t\t\tsqlString.append(\"UNIQUE(\");\n\t\t\t\n\t\t\tfirst = true;\n\t\t\tIterator<String> itUnique = unique.getKey().iterator();\n\t\t\twhile(itUnique.hasNext()){\n\t\t\t\tString col = itUnique.next();\n\t\t\t\t\n\t\t\t\tif(first){\n\t\t\t\t\tfirst = false;\n\t\t\t\t}else{\n\t\t\t\t\tsqlString.append(\",\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsqlString.append(col);\n\t\t\t}\n\t\t\t\n\t\t\tsqlString.append(\")\");\n\t\t}\n\t\t\n\t\tsqlString.append(\"\\n)\\n\");\n\t\t\n\t\tif(this.logger != null && this.outSql){\n\t\t\tthis.logger.reportInfo(sqlString.toString());\n\t\t}\n\t\t\n\t\t// \n\t\tAlinousDebug.debugOut(core, sqlString.toString());\n\t\t\n\t\texecuteUpdateSQL(connectionHandle, sqlString.toString(), false);\n\n\t}", "public void testJoinInner() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName, c.AD_Column_ID, c.ColumnName \" + \"FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table=t,AD_Column=c|0]\", fixture.toString());\n }", "public Joins()\n {\n joins = new ArrayList<Join>();\n }", "UnpivotTable createUnpivotTable();", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "public JoinedTable[] getJoinedTables();", "JoinCondition createJoinCondition();", "@Test\r\n\tvoid join() {\r\n\t\tQuery query = entityManager.createQuery(\"Select c,s from Course c JOIN c.students s\");\r\n\t\tList<Object[]> resultList = query.getResultList();\r\n\t\tlog.info(\"Result Size -> {}\", resultList.size());\r\n\t\tfor (Object[] result : resultList) {\r\n\t\t\tlog.info(\"Course -> {}\", result[0]);\r\n\t\t\tlog.info(\"Student -> {}\", result[1]);\r\n\t\t}\r\n\t}", "public TableCreation(Table table) {\n this.table = table;\n }", "public static void createTables() throws SQLException {\n\t\tString table = \"CREATE table users(\" + \"customer_ID INT NOT NULL,\" + \"uNAME VARCHAR(15) NOT NULL,\"\n\t\t\t\t+ \"BANNED boolean default 0,\" + \"PRIMARY KEY(customer_ID)\" + \");\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\n\t\t// Creating table items, Items(Item_ID, Item_name, Cost, department);\n\t\ttable = \"CREATE table items(\" + \"item_ID INT NOT NULL,\" + \"item_name VARCHAR(25) NOT NULL,\"\n\t\t\t\t+ \"cost double not null,\" + \"department VARCHAR(20) DEFAULT NULL,\" + \"PRIMARY KEY(item_id, department)\"\n\t\t\t\t+ \");\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\n\t\t// Needed for foreign key on department.\n\t\ttable = \"CREATE index department on items(department);\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\n\t\t// Creating table sales, Sales(Sales_ID, customer_id, Item_ID,\n\t\t// SaleDate);\n\t\ttable = \"CREATE table sales(\" + \"sales_ID INT NOT NULL,\" + \"customer_ID INT,\" + \"item_ID INT,\"\n\t\t\t\t+ \"sale_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\" + \"department VARCHAR(20) DEFAULT 'None',\"\n\t\t\t\t+ \"PRIMARY KEY(sales_ID),\";\n\t\ttable += \"FOREIGN KEY(customer_ID) references users(customer_ID) ON DELETE SET NULL,\";\n\t\ttable += \"FOREIGN KEY(item_ID) references items(item_ID) ON DELETE SET NULL,\";\n\t\ttable += \"FOREIGN KEY(department) references items(department) ON DELETE SET NULL\";\n\t\ttable += \");\";\n\t\tSystem.out.println(table);\n\t\tstatement = connection.prepareStatement(table);\n\t\tstatement.executeUpdate();\n\t}", "@Override\r\n public Db_db createTable (Db_table table)\r\n {\r\n Db_db db = null;\r\n String query = \"CREATE TABLE IF NOT EXISTS \"+ table.getName() + \" (\"; \r\n String primaryKeyName = null;\r\n Set<Map.Entry<String, Db_tableColumn>> tableEntries;\r\n List<String> listOfUniqueKey = Lists.newArrayList();\r\n \r\n if(curConnection_ != null)\r\n {\r\n try\r\n {\r\n tableEntries = table.getEntrySet();\r\n for(Map.Entry<String, Db_tableColumn> entry: tableEntries)\r\n {\r\n Db_tableColumn entryContent = entry.getValue();\r\n \r\n if(entryContent.isPrimary() && primaryKeyName == null)\r\n {\r\n primaryKeyName = entryContent.getName();\r\n }\r\n else if(entryContent.isPrimary() && primaryKeyName != null)\r\n {\r\n throw new NumberFormatException();\r\n }\r\n \r\n if(itsAttributeMapper_ == null)\r\n {\r\n throw new NumberFormatException();\r\n }\r\n \r\n if(entryContent.isUnique())\r\n {\r\n listOfUniqueKey.add(entryContent.getName());\r\n }\r\n \r\n String mappedAttribute = this.itsAttributeMapper_.MapAttribute(entryContent.getAttributeName());\r\n if(entryContent.getAttribute().isEnum())\r\n {\r\n mappedAttribute += entryContent.getAttribute().buildEnumValueListString();\r\n }\r\n query += entryContent.getName() + \" \" + mappedAttribute \r\n + (entryContent.isAutoIncreasmnet()?\" AUTO_INCREMENT \":\" \")\r\n + (entryContent.isUnique()?\" UNIQUE, \": \", \");\r\n }\r\n \r\n query += \"PRIMARY KEY (\" + primaryKeyName + \"));\";\r\n try (Statement sm = curConnection_.createStatement()) {\r\n sm.executeUpdate(query);\r\n db = this.curDb_;\r\n }\r\n \r\n }catch(NumberFormatException e){System.out.print(e);}\r\n catch(SQLException e){System.out.print(query);this.CurConnectionFailed();}\r\n }\r\n return db;\r\n }", "public PdfPTable createTable() {\n\t\tPdfPTable t = new PdfPTable(2);\n\t\tt.setWidthPercentage(100);\n\t\tt.setHorizontalAlignment(Element.ALIGN_LEFT);\n\t\tt.getDefaultCell().setBorder(Rectangle.NO_BORDER);\n\t\t// set up the table headers for albums\n\t\tif (state.equals(\"a\")) {\n\t\t\tFont bold = new Font(Font.FontFamily.HELVETICA, 13, Font.BOLD);\n\t\t\t\n\t\t\tPdfPCell nameCell = new PdfPCell();\n\t\t\tnameCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase name = new Phrase(\"Name\", bold);\n\t\t\tnameCell.addElement(name);\n\t\t\t\n\t\t\tPdfPCell artistCell = new PdfPCell();\n\t\t\tartistCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase artist = new Phrase(\"Artist\", bold);\n\t\t\tartistCell.addElement(artist);\n\t\t\t\n\t\t\tt.addCell(nameCell);\n\t\t\tt.addCell(artistCell);\n\t\t}\n\t\t// set up the table headers for publications\n\t\telse if (state.equals(\"p\")) {\n\t\t\tFont bold = new Font(Font.FontFamily.HELVETICA, 13, Font.BOLD);\n\t\t\t\n\t\t\tPdfPCell nameCell = new PdfPCell();\n\t\t\tnameCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase name = new Phrase(\"Name\", bold);\n\t\t\tnameCell.addElement(name);\n\t\t\t\n\t\t\tPdfPCell devisorCell = new PdfPCell();\n\t\t\tdevisorCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase devisor = new Phrase(\"Devisor\", bold);\n\t\t\tdevisorCell.addElement(devisor);\n\t\t\t\n\t\t\tt.addCell(nameCell);\n\t\t\tt.addCell(devisorCell);\n\t\t}\n\t\ttry {\n\t\t\tResultSet results = db.searchTableByName(table, \"\", true);\n\t\t\twhile(results.next()) {\n\t\t\t\t// add album info to table\n\t\t\t\tif (state.equals(\"a\")) {\n\t\t\t\t\tt.addCell(results.getString(\"name\"));\n\t\t\t\t\tt.addCell(results.getString(\"artist\"));\n\t\t\t\t}\n\t\t\t\t// add publication info to table\n\t\t\t\telse if (state.equals(\"p\")) {\n\t\t\t\t\tt.addCell(results.getString(\"name\"));\n\t\t\t\t\tt.addCell(results.getString(\"devisor\"));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn t;\n\t}", "public JoinTableSpec(TableSpec leftTable, SimpleTableSpec rightTable, \n\t\t\t\t\t\t CellIDExpression leftCell, CellIDExpression rightCell) {\n\t\tthis.leftTable = leftTable;\n\t\tthis.rightTable = rightTable;\n\t\tthis.leftCell = leftCell;\n\t\tthis.rightCell = rightCell;\n\n\t}", "private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}", "public String toSql() {\t\n int n;\t\n void a;\t\n StringBuilder a2 = new StringBuilder();\t\n Table table = MapperHelper.getTable(this.entity);\t\n a2.append(MapperHelper.getTableName((Table)a, this.entity) + \" \" + a.alias());\t\n JoinTable[] arrjoinTable = a.joinTable();\t\n int n2 = arrjoinTable.length;\t\n int n3 = n = 0;\t\n while (n3 < n2) {\t\n JoinTable a3 = arrjoinTable[n];\t\n Table a4 = MapperHelper.getTable(a3.entity());\t\n a2.append(new StringBuilder().insert(0, \" \").append(a3.type().value()).append(\" \").toString());\t\n a2.append(new StringBuilder().insert(0, MapperHelper.getTableName(a4, this.entity)).append(\" \").append(a3.alias()).toString());\t\n a2.append(new StringBuilder().insert(0, \" ON \").append(a3.on()).toString());\t\n n3 = ++n;\t\n }\t\n StringBuilder stringBuilder = a2;\t\n stringBuilder.append(MapperHelper.getSqlMapValue(this.entity, a.extFromKeys()));\t\n return stringBuilder.toString();\t\n }", "public void createTable(String tableName) {\n //SQL Statement\n String query = \"call aTable\";\n\n try {\n //connection\n stmt = con.createStatement();\n //execute query\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Table \" + tableName + \" created--\");\n } catch (SQLException ex) {\n System.out.println(\"\\n--Query did not execute--\");\n ex.printStackTrace();\n }\n }", "private void handleJoinTable(JFieldVar field, JDefinedClass clazz, String propertyName, JsonNode propertyNode) {\n if (propertyNode.has(JpaConstants.JOIN_TABLE)) {\n JAnnotationUse jAnnotationUse = field.annotate(JoinTable.class);\n JsonNode node = propertyNode.get(JpaConstants.JOIN_TABLE);\n\n if (node.has(JpaConstants.NAME)) {\n String tableName = node.get(JpaConstants.NAME).asText();\n jAnnotationUse.param(JpaConstants.NAME, tableName);\n }\n\n if (node.has(JpaConstants.JOIN_COLUMNS)) {\n handleJoinColumns(node, jAnnotationUse, JpaConstants.JOIN_COLUMNS);\n handleJoinColumns(node, jAnnotationUse, JpaConstants.INVERSE_JOIN_COLUMNS);\n }\n }\n }", "private void createLoginTable() {\r\n jdbcExecutor.executeQuery(new Work() {\r\n @Override\r\n public void execute(Connection connection) throws SQLException {\r\n connection.createStatement().executeUpdate(\"CREATE TABLE login ( id numeric(19,0), user_id numeric(19,0), timestamp TIMESTAMP )\");\r\n }\r\n });\r\n }", "private void createDataTable() {\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoEditors.TABLE + \" (ID INT IDENTITY PRIMARY KEY, NAME VARCHAR(150) NOT NULL UNIQUE)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.TABLE + \" (ID INT IDENTITY PRIMARY KEY, TITLE VARCHAR(150) NOT NULL UNIQUE, YEAR INT, ISBN10 VARCHAR(20), ISBN13 VARCHAR(13), NOTE INT, PAGES_NUMBER INT, RESUME VARCHAR(2000), THE_EDITOR_FK INT, THE_KIND_FK INT, THE_LANGUAGE_FK INT, THE_LENDING_FK INT, THE_SAGA_FK INT, THE_TYPE_FK INT)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" (THE_BOOK_FK INT NOT NULL, THE_AUTHOR_FK INT NOT NULL)\");\n\n jdbcTemplate.update(\"CREATE INDEX BOOK_EDITOR_IDX ON \" + IDaoEditors.TABLE + \"(ID)\");\n jdbcTemplate.update(\"CREATE INDEX BOOKS_IDX ON \" + IDaoBooks.TABLE + \"(ID)\");\n }", "private void appendTempTableUpdateDeleteJoin(Object source, Attribute[] prototypeAttributes, MithraFastList<Attribute> nullAttributes, int pkAttributeCount, TupleTempContext tempContext, StringBuilder builder)\r\n {\r\n builder.append(\" from \").append(this.getFullyQualifiedTableNameGenericSource(source));\r\n builder.append(\" t0, \");\r\n this.appendTempTableRightSideJoin(source, prototypeAttributes, nullAttributes, pkAttributeCount, tempContext, builder);\r\n }", "public String toSQL(String tableName, Vector pk, Map additionalColumn)\n {\n /*\n CREATE TABLE distributors (\n did integer,\n name varchar(40) );\n */\n StringBuffer buf = new StringBuffer();\n buf.append(\"CREATE TABLE \" + tableName + \"( \\n\");\n for (Iterator it = attDBTypeList.keySet().iterator(); it.hasNext(); )\n {\n String attribute = (String) it.next();\n String dbtype = (String) attDBTypeList.get(attribute);\n buf.append(\" \" + attribute + \" \" + dbtype + \",\\n\");\n }\n\n if (additionalColumn != null) // 2005-03-28\n {\n for (Iterator it = additionalColumn.keySet().iterator(); it.hasNext(); )\n {\n String attribute = (String) it.next();\n String dbtype = (String) additionalColumn.get(attribute);\n buf.append(\" \" + attribute + \" \" + dbtype + \",\\n\");\n }\n }\n\n /*\n CREATE TABLE distributors (\n did integer CHECK (did > 100),\n name varchar(40),\n CONSTRAINT distributors_pkey PRIMARY KEY (did,name)\n );\n */\n\n if (pk != null)\n {\n buf.append(\"CONSTRAINT \" + tableName + \"_pkey PRIMARY KEY (\");\n for (int i = 0; i < pk.size() - 1; i++)\n {\n buf.append(pk.elementAt(i) + \",\");\n }\n buf.append(pk.elementAt(pk.size() - 1));\n\n buf.append(\"),\\n\");\n }\n\n String sql = buf.toString();\n sql = sql.substring(0, sql.length() - 2); // filter out the last \",\\n\"\n sql = sql + \");\";\n return sql;\n }", "BTable createBTable();", "private String createTableSQL()\n\t{\n\t\tStringBuffer str = new StringBuffer();\n\n\t\t// Keep track of the list of fields\n\t\tList<String> listFields = new ArrayList<String>();\n\n\t\t// Table command\n\t\tstr.append(\"CREATE TABLE \" + getFullPath() + \"( \");\n\t\tstr.append(createStandardGZFields());\n\n\t\t// Loop through all InputFields\n\t\tfor (InputFieldSet fieldSet : function.getInputFieldSets())\n\t\t{\n\t\t\tfor (InputField inputField : fieldSet.getInputFields())\n\t\t\t{\n\t\t\t\t// Phase 2 does not support repeating fields being journalled\n\t\t\t\tif (!Field.isRepeating(inputField))\n\t\t\t\t{\n\t\t\t\t\t// Field\n\t\t\t\t\tString fieldName = SQLToolbox.cvtToSQLFieldName(inputField.getId());\n\n\t\t\t\t\t// add if not yet existing\n\t\t\t\t\tif (listFields.indexOf(fieldName) == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr.append(\", \");\n\t\t\t\t\t\tString fieldDataType = inputField.getDataType();\n\t\t\t\t\t\tString fieldType = SQLToolbox.cvtToSQLFieldType(fieldDataType, inputField.getSize(), inputField\n\t\t\t\t\t\t\t\t\t\t.getDecimals());\n\t\t\t\t\t\tString fieldDefault = SQLToolbox.cvtToSQLDefault(fieldDataType);\n\t\t\t\t\t\tstr.append(fieldName + \" \" + fieldType + \" \" + \" not null default \" + fieldDefault);\n\t\t\t\t\t\tlistFields.add(fieldName);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// End\n\t\tstr.append(\" ) \");\n\t\t// RCDFMT \" + getJournalRcdName());\n\n\t\treturn str.toString();\n\t}", "protected void createSubQueryJoinTableAggregation() throws ODataApplicationException {\r\n try {\r\n final List<JPAOnConditionItem> left = association\r\n .getJoinTable()\r\n .getJoinColumns(); // Person -->\r\n final List<JPAOnConditionItem> right = association\r\n .getJoinTable()\r\n .getInverseJoinColumns(); // Team -->\r\n createSelectClauseAggregation(subQuery, queryJoinTable, left);\r\n final Expression<Boolean> whereCondition = createWhereByAssociation(from, queryJoinTable, parentQuery.jpaEntity);\r\n subQuery.where(applyAdditionalFilter(whereCondition));\r\n handleAggregation(subQuery, queryJoinTable, right);\r\n } catch (final ODataJPAModelException e) {\r\n throw new ODataJPAQueryException(e, HttpStatusCode.INTERNAL_SERVER_ERROR);\r\n }\r\n }", "protected String getJoin( LogicalModel businessModel, LogicalRelationship relation,\n Map<LogicalTable, String> tableAliases, Map<String, Object> parameters, boolean genAsPreparedStatement,\n DatabaseMeta databaseMeta, String locale ) throws PentahoMetadataException {\n String join = \"\"; //$NON-NLS-1$\n if ( relation.isComplex() ) {\n try {\n // parse join as MQL\n SqlOpenFormula formula =\n new SqlOpenFormula( businessModel, databaseMeta, relation.getComplexJoin(), tableAliases, parameters,\n genAsPreparedStatement );\n formula.parseAndValidate();\n join = formula.generateSQL( locale );\n } catch ( PentahoMetadataException e ) {\n // backward compatibility, deprecate\n // FIXME: we need to get rid of this and just throw an exception\n logger.warn( Messages.getErrorString(\n \"SqlGenerator.ERROR_0017_FAILED_TO_PARSE_COMPLEX_JOIN\", relation.getComplexJoin() ), e ); //$NON-NLS-1$\n join = relation.getComplexJoin();\n }\n } else if ( relation.getFromTable() != null && relation.getToTable() != null && relation.getFromColumn() != null\n && relation.getToColumn() != null ) {\n // Left side\n String leftTableAlias = null;\n if ( tableAliases != null ) {\n leftTableAlias = tableAliases.get( relation.getFromColumn().getLogicalTable() );\n } else {\n leftTableAlias = relation.getFromColumn().getLogicalTable().getId();\n }\n\n join = databaseMeta.quoteField( leftTableAlias );\n join += \".\"; //$NON-NLS-1$\n join +=\n databaseMeta.quoteField( (String) relation.getFromColumn().getProperty( SqlPhysicalColumn.TARGET_COLUMN ) );\n\n // Equals\n join += \" = \"; //$NON-NLS-1$\n\n // Right side\n String rightTableAlias = null;\n if ( tableAliases != null ) {\n rightTableAlias = tableAliases.get( relation.getToColumn().getLogicalTable() );\n } else {\n rightTableAlias = relation.getToColumn().getLogicalTable().getId();\n }\n\n join += databaseMeta.quoteField( rightTableAlias );\n join += \".\"; //$NON-NLS-1$\n join += databaseMeta.quoteField( (String) relation.getToColumn().getProperty( SqlPhysicalColumn.TARGET_COLUMN ) );\n } else {\n throw new PentahoMetadataException( Messages.getErrorString(\n \"SqlGenerator.ERROR_0003_INVALID_RELATION\", relation.toString() ) ); //$NON-NLS-1$\n }\n\n return join;\n }", "@Override\n\tpublic String createTable() {\n\t\t\t\treturn \"CREATE TABLE history_table_view(id number(8) primary key not null ,sqltext text, pointid varchar2(1024), type varchar2(100))\";\n\t}", "Table getTable();", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "private void calcTableList() throws SQLException {\n tableList = new TableList(session);\n SQLTokenizer[] tzs = tableListTokens.parse(SQLTokenizer.COMMA);\n for(int i = 0; tzs != null && i < tzs.length; i++) {\n if(tzs[i].countTokens() == 0) throw new SQLException(\"Syntax error\");\n String correlation = null;\n String table = tzs[i].getToken(0);\n int n = 1;\n if(tzs[i].getType(1) == Keyword.AS) {\n n++;\n }\n correlation = tzs[i].getToken(n);\n tableList.addTable(table, correlation);\n }\n }", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "private static void DoJoin()\n\t{\n\n\t\tArrayList<Attribute> inAttsRight = new ArrayList<Attribute>();\n\t\tinAttsRight.add(new Attribute(\"Int\", \"o_orderkey\"));\n\t\tinAttsRight.add(new Attribute(\"Int\", \"o_custkey\"));\n\t\tinAttsRight.add(new Attribute(\"Str\", \"o_orderstatus\"));\n\t\tinAttsRight.add(new Attribute(\"Float\", \"o_totalprice\"));\n\t\tinAttsRight.add(new Attribute(\"Str\", \"o_orderdate\"));\n\t\tinAttsRight.add(new Attribute(\"Str\", \"o_orderpriority\"));\n\t\tinAttsRight.add(new Attribute(\"Str\", \"o_clerk\"));\n\t\tinAttsRight.add(new Attribute(\"Int\", \"o_shippriority\"));\n\t\tinAttsRight.add(new Attribute(\"Str\", \"o_comment\"));\n\n\t\tArrayList<Attribute> inAttsLeft = new ArrayList<Attribute>();\n\t\tinAttsLeft.add(new Attribute(\"Int\", \"c_custkey\"));\n\t\tinAttsLeft.add(new Attribute(\"Str\", \"c_name\"));\n\t\tinAttsLeft.add(new Attribute(\"Str\", \"c_address\"));\n\t\tinAttsLeft.add(new Attribute(\"Int\", \"c_nationkey\"));\n\t\tinAttsLeft.add(new Attribute(\"Str\", \"c_phone\"));\n\t\tinAttsLeft.add(new Attribute(\"Float\", \"c_acctbal\"));\n\t\tinAttsLeft.add(new Attribute(\"Str\", \"c_mktsegment\"));\n\t\tinAttsLeft.add(new Attribute(\"Str\", \"c_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Str\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att4\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att5\"));\n\n\t\tArrayList<String> leftHash = new ArrayList<String>();\n\t\tleftHash.add(\"c_custkey\");\n\n\t\tArrayList<String> rightHash = new ArrayList<String>();\n\t\trightHash.add(\"o_custkey\");\n\n\t\tString selection = \"right.o_custkey == left.c_custkey && right.o_custkey > Int (1000)\";\n\n\t\tHashMap<String, String> exprs = new HashMap<String, String>();\n\t\texprs.put(\"att1\", \"right.o_comment + Str(\\\" \\\") + left.c_comment\");\n\t\texprs.put(\"att2\", \"right.o_custkey\");\n\t\texprs.put(\"att3\", \"left.c_custkey\");\n\t\texprs.put(\"att4\", \"left.c_name\");\n\t\texprs.put(\"att5\", \"right.o_orderkey\");\n\n\t\t// run the join\n\t\ttry\n\t\t{\n\t\t\tnew Join(inAttsLeft, inAttsRight, outAtts, leftHash, rightHash, selection, exprs, \"customer.tbl\", \"orders.tbl\",\n\t\t\t\t\t\"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\n\t}", "public void create_table(String table_name, List<String> attributes) {\n //throw error if table already exists\n if (get_table_names().contains(table_name) && !table_name.equals(\"relationship\")) {\n throw new RuntimeException(\"Table with this name already exists.\");\n }\n //throw error if no name is given\n if (table_name.isEmpty()) {\n throw new RuntimeException(\"Table name can not be empty.\");\n }\n //throw error if no attributes are given\n if (attributes.isEmpty()) {\n throw new RuntimeException(\"Table needs at least one attribute.\");\n }\n\n StringBuilder stringBuilder = new StringBuilder(\"create table if not exists \");\n stringBuilder.append(table_name);\n //autoincrement handles the correct incrementation of the primary key\n stringBuilder.append(\" (id integer primary key autoincrement, \");\n for (String attribute : attributes) {\n stringBuilder.append(attribute);\n stringBuilder.append(\" varchar, \"); //values are varchar since the user inputs text\n }\n stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.length());\n stringBuilder.append(\")\");\n\n String sql = stringBuilder.toString();\n\n execute_statement(sql, false);\n }", "public String prepareTable(ColumnInfo[] layout,\n String from,\n String where,\n boolean multiSelection,\n String tableName,boolean addAccessSQL)\n {\n int columnIndex = 0;\n StringBuffer sql = new StringBuffer (\"SELECT \");\n setLayout(layout);\n\n clearColumns();\n\n setMultiSelection(multiSelection);\n\n // add columns & sql\n for (columnIndex = 0; columnIndex < layout.length; columnIndex++)\n {\n // create sql\n if (columnIndex > 0)\n {\n sql.append(\", \");\n }\n sql.append(layout[columnIndex].getColSQL());\n\n // adding ID column\n if (layout[columnIndex].isKeyPairCol())\n {\n sql.append(\",\").append(layout[columnIndex].getKeyPairColSQL());\n }\n\n // add to model\n addColumn(layout[columnIndex].getColHeader());\n\n // set the colour column\n if (layout[columnIndex].isColorColumn())\n {\n setColorColumn(columnIndex);\n }\n if (layout[columnIndex].getColClass() == IDColumn.class)\n {\n m_keyColumnIndex = columnIndex;\n }\n }\n\n // set editors (two steps)\n for (columnIndex = 0; columnIndex < layout.length; columnIndex++)\n {\n setColumnClass(columnIndex,\n layout[columnIndex].getColClass(),\n layout[columnIndex].isReadOnly(),\n layout[columnIndex].getColHeader());\n }\n\n sql.append( \" FROM \").append(from);\n sql.append(\" WHERE \").append(where);\n\n if (from.length() == 0)\n {\n return sql.toString();\n }\n //\n if (addAccessSQL)\n {\n String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(),\n tableName,\n MRole.SQL_FULLYQUALIFIED,\n MRole.SQL_RO);\n\n logger.finest(finalSQL);\n\n return finalSQL;\n }\n else\n {\n return sql.toString();\n }\n }", "private void createLinkedInTable(){\n cellTableOfLinkedIn.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);\n\n // Add a text columns to show the details.\n TextColumn<LinkedInProfile> firstName = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getFirstName();\n }\n };\n cellTableOfLinkedIn.addColumn(firstName, \"First Name\");\n\n TextColumn<LinkedInProfile> lastName = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getLastName();\n }\n };\n cellTableOfLinkedIn.addColumn(lastName, \"Last Name\");\n\n TextColumn<LinkedInProfile> emailAddress = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getEmailAddress();\n }\n };\n cellTableOfLinkedIn.addColumn(emailAddress, \"Email Address\");\n\n TextColumn<LinkedInProfile> industry = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getIndustry();\n }\n };\n cellTableOfLinkedIn.addColumn(industry, \"Industry\");\n\n TextColumn<LinkedInProfile> currentPositionCompany = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getCurrentPositionCompany();\n }\n };\n cellTableOfLinkedIn.addColumn(currentPositionCompany, \"Current Company\");\n\n TextColumn<LinkedInProfile> pictureUrl = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getPictureUrl();\n }\n };\n cellTableOfLinkedIn.addColumn(pictureUrl, \"Picture URL\");\n\n final SingleSelectionModel<LinkedInProfile> selectionModel = new SingleSelectionModel<>();\n cellTableOfLinkedIn.setSelectionModel(selectionModel);\n }", "public static String getSQLForUserTableCreation() {\n return \"CREATE TABLE \" + USER_TABLE + \"(\" +\n USER_ID + \" varchar(8) PRIMARY KEY, \" +\n USER_LAST_NAME + \" varchar(32), \" +\n USER_FIRST_NAME + \" varchar(32), \" +\n USER_EMAIL + \" varchar(256), \" +\n USER_PASSWORD + \" varchar(64), \" +\n USER_IS_TEACHER + \" bool, \" +\n USER_GROUP + \" varchar(32))\";\n\n }", "@Test\n public void testCrossJoin() throws Exception {\n String sql = \"SELECT * FROM g1 cross join g2\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN g2\", fileNode);\n }", "public CreateTableStatementTranslator(TSQL2Adapter con) {\n this._con = con.getUnderlyingConnection();\n }", "private String getCloneSetTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET(\");\n \t\tbuilder.append(\"CLONE_SET_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"OWNER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"ELEMENTS TEXT NOT NULL,\");\n \t\tbuilder.append(\"NUMBER_OF_ELEMENTS INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "@Test(timeout = 4000)\n public void test043() throws Throwable {\n String[] stringArray0 = new String[8];\n String[] stringArray1 = new String[1];\n // Undeclared exception!\n try { \n SQLUtil.innerJoin(\"XSRS9.S, XSRS9.S, XSRS9.S, XSRS9.S, XSRS9.S, XSRS9.S\", stringArray0, \"create table\", (String) null, stringArray1);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 1\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void createTemporaryTable(Session session, final Dialect dialect, final String tempTable) {\n\t\tsession.doWork(connection -> {\n\t\t\t// check if table exists\n if (!getConfiguration().isUsingPostgreSQL()) {\n try {\n Statement s = connection.createStatement();\n s.execute(\"select id from \" + tempTable + \" where id = 1\");\n\n s.close();\n // table already exists\n return;\n } catch (Exception ex) {\n // we expect this on the first time\n }\n }\n\n TemporaryTableDialect ttDialect = TemporaryTableDialect.getTempTableDialect(dialect);\n\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tsb.append(ttDialect.getCreateTemporaryTableString());\n\t\t\tsb.append(' ').append(tempTable).append(\" (id \");\n\t\t\tsb.append(dialect.getTypeName(Types.BIGINT));\n\t\t\tsb.append(\" not null)\");\n\t\t\tsb.append(ttDialect.getCreateTemporaryTablePostfix());\n\n Statement s = connection.createStatement();\n s.execute(sb.toString());\n s.close();\n\t\t});\n\t}", "private String createLabelTableSQL()\n\t{\n\t\treturn \"LABEL ON TABLE \" + getFullPath() + \" IS '\" + SQLToolbox.cvtToSQLFieldColHdg(function.getLabel()) + \"'\";\n\t}", "@Test\n public void testJoinOn_withTwoValidTables() {\n String table1column0 = \"user_id\";\n String table1column1 = \"age\";\n int idValue0 = 0;\n int ageValue0 = 23;\n int idValue1 = 1;\n int ageValue1 = 22;\n int idValue2 = 2;\n int ageValue2 = 18;\n String table2column0 = \"pet_id\";\n String table2column1 = \"owner_id\";\n int pet1_id = 0;\n int pet2_id = 1;\n\n try {\n // Set up ModelExtension Table\n String sql = \"CREATE TABLE ModelExtension (\" +\n table1column0 + \" int, \" +\n table1column1 + \" int)\";\n PreparedStatement pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.execute();\n sql = \"INSERT INTO ModelExtension (\" +\n table1column0 + \", \" +\n table1column1 + \") VALUES (\" +\n idValue0 + \", \" +\n ageValue0 + \"), (\" +\n idValue1 + \", \" +\n ageValue1 + \"), (\" +\n idValue2 + \", \" +\n ageValue2 + \")\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.executeUpdate();\n // Set up Test Table\n sql = \"CREATE TABLE Test (\" +\n table2column0 + \" int, \" +\n table2column1 + \" int)\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.execute();\n sql = \"INSERT INTO Test (\" +\n table2column0 + \", \" +\n table2column1 + \") VALUES (\" +\n pet1_id + \", \" +\n idValue0 + \"), (\" +\n pet2_id + \", \" +\n idValue1 + \")\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n\n List<ModelExtension> models = child.findAll()\n .joinOn(\n new ModelExtensionWithAnnotation(), \n table1column0, \n table2column1)\n .execute(ModelExtension.class);\n\n assertEquals(2, models.size());\n assertEquals(idValue0, models.get(0).get(table1column0));\n assertEquals(ageValue0, models.get(0).get(table1column1));\n assertEquals(pet1_id, models.get(0).get(table2column0));\n assertEquals(idValue0, models.get(0).get(table2column1));\n\n assertEquals(idValue1, models.get(1).get(table1column0));\n assertEquals(ageValue1, models.get(1).get(table1column1));\n assertEquals(pet2_id, models.get(1).get(table2column0));\n assertEquals(idValue1, models.get(1).get(table2column1));\n }", "public void createTable() throws LRException\n\t{\n\t\tgetBackground();\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\t// Create a new (empty) record\n\t\tcreate(new Hashtable(),myData);\n\t\tif (myData.record==null) throw new LRException(DataRMessages.nullRecord(getName()));\n\t\ttry\n\t\t{\n\t\t\tbackground.newTransaction();\n\t\t\tmyData.record.createNewTable(background.getClient(),true);\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}", "PivotTable createPivotTable();", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public void create(Connection db) throws SQLException {\n if (tableName == null) {\n throw new SQLException(\"Table Name not specified\");\n }\n\n Statement st = db.createStatement();\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence()) {\n st.executeUpdate(\"CREATE SEQUENCE \" + sequenceName);\n }\n }\n\n StringBuffer sql = new StringBuffer();\n sql.append(\"CREATE TABLE \" + tableName + \" (\");\n\n String primaryKey = \"\";\n Iterator fields = columns.iterator();\n while (fields.hasNext()) {\n DatabaseColumn thisColumn = (DatabaseColumn) fields.next();\n if (thisColumn.isPrimaryKey()) {\n primaryKey = thisColumn.getName();\n sql.append(thisColumn.getCreateSQL(dbType, sequenceName));\n } else {\n sql.append(thisColumn.getCreateSQL(dbType));\n }\n if (fields.hasNext()) {\n sql.append(\",\");\n }\n }\n if (dbType == DatabaseUtils.ORACLE) {\n sql.append(\", PRIMARY KEY (\" + primaryKey + \")\");\n }\n sql.append(\");\");\n st.executeUpdate(sql.toString());\n st.close();\n }", "public static QueryDelegate generateTableQuery(String tableName) {\n String FROM_QUERY = \" FROM \" + tableName;\n String SELECT_QUERY=\" SELECT * \" +\n FROM_QUERY;\n String COUNT_QUERY = \"SELECT count(*) \" + FROM_QUERY;\n String CONTAINS_QUERY = \"SELECT * FROM \" + tableName + \" WHERE id = ?\";\n\n return generateQueryDelegate(SELECT_QUERY, COUNT_QUERY, CONTAINS_QUERY);\n }", "public void createVirtualTable(){\n\n\t\t\n\t\tif(DBHandler.getConnection()==null){\n\t\t\treturn;\n\t\t}\n\n\t\tif(DBHandler.tableExists(name())){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tStatement s = DBHandler.getConnection().createStatement();\n\t\t\ts.execute(\"create virtual table \"+name()+\" using fts4(\"+struct()+\")\");\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tMainFrame.print(e.getMessage());\n\t\t}\n\t}", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "Table8 create(Table8 table8);", "private void createTable() {\n try (Statement st = this.conn.createStatement()) {\n st.execute(\"CREATE TABLE IF NOT EXISTS users (user_id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, \"\n + \"login VARCHAR(100) UNIQUE NOT NULL, email VARCHAR(100) NOT NULL, createDate TIMESTAMP NOT NULL);\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n public SqlDatabaseTable createTable(String tableName, int columnCount, boolean dropExist) {\n StringBuilder sql = new StringBuilder();\n if (dropExist) {\n sql.append(\"DROP TABLE IF EXISTS `\").append(tableName).append(\"`;\");\n executeSql(sql.toString());\n sql.setLength(0);\n }\n\n // Ignored check because only one statement is executed\n // if (!dropExist && SqlStorageEngine.getInstance().checkTableExist(tableName))\n\n sql.append(\"CREATE TEMPORARY TABLE\");\n if (!dropExist) {\n sql.append(\" IF NOT EXISTS\");\n }\n sql.append(\" `\").append(tableName).append(\"`\");\n sql.append(\" ( `id` INT NOT NULL AUTO_INCREMENT, `uniq` CHAR(32) NOT NULL UNIQUE,\");\n for (int i = 0; i < columnCount; i++) {\n sql.append(\" `_\").append(i).append(\"` VARCHAR(32) NULL,\");\n sql.append(\"INDEX (`_\").append(i).append(\"`),\");\n }\n sql.append(\" PRIMARY KEY (`id`)) ENGINE = MEMORY;\");\n executeSql(sql.toString());\n\n // Ignore this, we use create clause to create index\n // createIndexes(tableName, columnCount);\n\n return new SqlDatabaseRefTable(tableName, columnCount);\n }", "public String getJunctionTableName(String table1)\n\t{\n\t\treturn \"Junct_\"\n\t\t\t\t+ table1 \n\t\t\t\t+ \"_\"\n\t\t\t\t+ this.getDBTableName(); \n\t}", "public String getCreationSQL(final boolean quoteNames) {\n final StringBuilder sbSQL = new StringBuilder();\n sbSQL.append(\"CREATE TABLE \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" (\\n\");\n \n for (PgColumn column : columns) {\n sbSQL.append(\"\\t\");\n sbSQL.append(column.getFullDefinition(quoteNames, false));\n sbSQL.append(\",\\n\");\n }\n \n sbSQL.setLength(sbSQL.length() - 2);\n sbSQL.append(\"\\n)\");\n \n if ((inherits != null) && (inherits.length() > 0)) {\n sbSQL.append(\"\\nINHERITS \");\n sbSQL.append(inherits);\n }\n \n sbSQL.append(';');\n \n for (PgColumn column : getColumnsWithStatistics()) {\n sbSQL.append(\"\\nALTER TABLE ONLY \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" ALTER COLUMN \");\n sbSQL.append(\n PgDiffUtils.getQuotedName(column.getName(), quoteNames));\n sbSQL.append(\" SET STATISTICS \");\n sbSQL.append(column.getStatistics());\n sbSQL.append(';');\n }\n \n return sbSQL.toString();\n }", "public void joinRelative(String tableName, JoinType joinType) {\n JoinType queryJoin = joinType;\n if (queryJoin == null) {\n queryJoin = JoinType.INNER;\n }\n joinTables.add(new BaseJoin(tableName, queryJoin));\n }", "public void CreateTable(String nameTable) throws SQLException {\n\n String FEATURE_DB_SQL = \"CREATE TABLE IF NOT EXISTS \" + nameTable + \"(id INT NOT NULL AUTO_INCREMENT, \"\n + FEATURE_DB_TEXTFEATURE + \" VARCHAR(255), \" + FEATURE_DB_ELO + \" INT, \" + FEATURE_DB_MMR + \" INT,\"\n + FEATURE_DB_AUTHOR + \" VARCHAR(255),\"\n +\" PRIMARY KEY ( id ))\";\n\n statement = conn.createStatement();\n statement.executeUpdate(FEATURE_DB_SQL);\n }", "protected void appendBaseTable(final SQLSelect _sqlSelect, final SQLTable _sqlTable)\n {\n if (_sqlSelect.getFromTables().isEmpty()) {\n final TableIdx tableidx = _sqlSelect.getIndexer().getTableIdx(_sqlTable.getSqlTable());\n if (tableidx.isCreated()) {\n _sqlSelect.from(tableidx.getTable(), tableidx.getIdx());\n }\n }\n }", "private String getCodeFragmentLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CODE_FRAGMENT_LINK(\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}" ]
[ "0.7885453", "0.6794531", "0.6426907", "0.6410609", "0.6054355", "0.59897876", "0.59736866", "0.59617424", "0.5936326", "0.59053403", "0.5898009", "0.58924735", "0.5853223", "0.57170475", "0.57010126", "0.5675409", "0.5656619", "0.5650129", "0.5650107", "0.5641839", "0.5641669", "0.5625632", "0.56217486", "0.56055534", "0.5599178", "0.55341023", "0.5528099", "0.55267644", "0.5524294", "0.55154914", "0.5514853", "0.5478592", "0.5419601", "0.5409086", "0.5396237", "0.537954", "0.5365552", "0.5344551", "0.53436786", "0.534082", "0.53218055", "0.53185964", "0.5313703", "0.5298624", "0.5289857", "0.5284492", "0.5283131", "0.5273091", "0.5259058", "0.52520066", "0.5231529", "0.52244806", "0.5216484", "0.5212355", "0.52113193", "0.5201609", "0.5193938", "0.51856875", "0.517822", "0.5177334", "0.51658154", "0.5162829", "0.5157789", "0.5153517", "0.51493174", "0.5147339", "0.51430404", "0.51382846", "0.51281464", "0.51277274", "0.512481", "0.5115775", "0.510599", "0.5091001", "0.5084461", "0.507609", "0.5068234", "0.5066707", "0.506358", "0.5057378", "0.5054227", "0.5051926", "0.50509113", "0.5049445", "0.50419295", "0.5040956", "0.50384355", "0.5028384", "0.5027664", "0.5024573", "0.50140256", "0.5010827", "0.5007743", "0.5006478", "0.50056726", "0.50055057", "0.5002248", "0.50002474", "0.4995501", "0.49788907" ]
0.6830948
1
Creates an instance (proc) of the userdefined function (UDF) specified by the given command, options, and files, and makes it available for execution. For details on UDFs, see: UserDefined Functions
public CreateProcResponse createProc(CreateProcRequest request) throws GPUdbException { CreateProcResponse actualResponse_ = new CreateProcResponse(); submitRequest("/create/proc", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object executeRVMFunction(String uid_func, IValue[] posArgs, Map<String,IValue> kwArgs){\n\t\t// Assumption here is that the function called is not a nested one and does not use global variables\n\t\tFunction func = functionStore[functionMap.get(uid_func)];\n\t\treturn executeRVMFunction(func, posArgs, kwArgs);\n\t}", "Function createFunction();", "abstract /*package*/ Object executeRVMFunction(Function func, IValue[] posArgs, Map<String,IValue> kwArgs);", "public static void main(String[] args) {\n FunctionFactory<Integer, Integer> functionFactory = new FunctionFactory<>();\n // 1. add simple functions \"square\", \"increment\", \"decrement\", \"negative\"\n // 2. get each function by name, and apply to argument 5, print a result (should be 25, 6, 4,-5 accordingly)\n // 3. add simple function \"abs\" using method reference (use class Math)\n // 4. add try/catch block, catch InvalidFunctionNameException and print some error message to the console\n // 5. try to get function with invalid name\n\n functionFactory.addFunction(\"square\", n -> n * n);\n functionFactory.addFunction(\"abs\", Math::abs);\n\n functionFactory.getFunction(\"square\").apply(5);\n try{\n functionFactory.getFunction(\"abs\").apply(5);\n }catch (InvalidFunctionNameException e){\n System.out.println(e.getMessage());\n }\n\n\n\n\n }", "OpFunction createOpFunction();", "private static Object command(String userCommandLine[]) {\n\t\tint size = userCommandLine.length;\n\n\t\tswitch(userCommandLine[0].trim().toUpperCase()) {\n\n\t\t/*\n\t\t * INFORMATION\n\t\t *\n\t\t * Add executecommand on each case\n\t\t * but if it dosn't yet implemented\n\t\t * comment the command allow to user\n\t\t * on the variable string[] commands\n\t\t *\n\t\t */\n\t\t\n\t\t/* ************************************\n\t\t * standard commands\n\t\t *************************************/\n\t\tcase \"QUIT\": return ExecuteCommand.exit();\n\t\tcase \"EXIT\": return ExecuteCommand.exit();\n\t\tcase \"HELP\": help( (size > 1) ? userCommandLine[1].trim() : \"\"); break;\n\t\tcase \"VAR\": ExecuteCommand.showVar(); break;\n\t\tcase \"DEL\" : ExecuteCommand.delVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"RENAME\": ExecuteCommand.renameVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"STARTSPARK\": ExecuteCommand.startSpark(); break;\n\t\tcase \"STOPSPARK\": ExecuteCommand.stopSpark(); break;\n\t\t\n\t\t/* ************************************\n\t\t * database\n\t\t *************************************/ \n\t\t\n\t\t/* open database(name: String, filesystem: FileSystem, conf: Config) */\n\t\tcase \"OPEN\" : ExecuteCommand.openDB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* close database */\n\t\tcase \"CLOSE\" : ExecuteCommand.closeDB(); break;\n\t\t/* restart database */\n\t\tcase \"RESTART\" : ExecuteCommand.restartDB(); break;\n\t\t/* show list of TimeSeries */\n\t\tcase \"SHOW\" : ExecuteCommand.showTS(); break;\n\t\t/* drop a timeSeries */\n\t\tcase \"DROP\" : ExecuteCommand.dropTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* exist a timeSeries with name ... */\n\t\tcase \"EXIST\" : ExecuteCommand.existTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get a timeSeries */\n\t\tcase \"GET\" : ExecuteCommand.getTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* create a timeSeries */\n\t\tcase \"CREATE\" : ExecuteCommand.createTS2DB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Time Series\n\t\t *************************************/\n\t\t\n\t\t/* create the timeSerie schema */\n\t\tcase \"CREATE_SCHEMA\" : ExecuteCommand.createSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* show the schema of the timeSerie */\n\t\tcase \"SHOW_SCHEMA\" : ExecuteCommand.showSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get the schema of the timeSerie*/\n\t\tcase \"GET_SCHEMA\" : ExecuteCommand.getSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* insert data at a certain file */\n\t\tcase \"INSERT\" : ExecuteCommand.insertDataFromFile(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* select timeSerie Range from timeStart to timeEnd */\n\t\tcase \"SELECT_RANGE\": break;\n\t\t/* select a column of a timeserie */\n\t\tcase \"SELECT\": ExecuteCommand.selectColumn(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find max value of timeSerie */\n\t\tcase \"MAX_VALUE\" : ExecuteCommand.maxValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find min value of timeSerie */\n\t\tcase \"MIN_VALUE\" : ExecuteCommand.minValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* print first five values */\n\t\tcase \"PRINT\" : ExecuteCommand.printHead(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Transformations\n\t\t *************************************/\n\t\t\n\t\t/* power transformation of timeSerie: square root */\n\t\tcase \"SQRT_TRANSFORM\" : break;\n\t\t/* power transformation of timeSerie: logarithm */\n\t\tcase \"LOG_TRANSFORM\" : break;\n\t\t/* average of timeSerie */\n\t\tcase \"MEAN\" : break;\n\t\t/* shifting timeSerie with coefficient */\n\t\tcase \"SHIFT\" : break;\n\t\t/* scaling timeSerie with coefficient */\n\t\tcase \"SCALE\" : break;\n\t\t/* standard deviation of timeSeries */\n\t\tcase \"STD_DEVIATION\" : break;\n\t\t/* normalize the TimeSerie */\n\t\tcase \"NORMALIZE\" : break;\n\t\t/* search the first time occurs */\n\t\tcase \"SEARCH\" : break;\n\t\t/* moving average */\n\t\tcase \"MOVING_AVERAGE\" : break;\n\t\t/* DFT of timeSerie */\n\t\tcase \"DFT\" : break;\n\t\t/* DTW of 2 timeSerie (similarity between two timeseries) */\n\t\tcase \"DTW\" : break;\n\t\t\n\t\t/* ************************************\n\t\t * Compression \n\t\t *************************************/\n\n\t\t/* compress a timeserie */\n\t\tcase \"COMPRESSION\" : ExecuteCommand.compression(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* decompress a timeserie */\n\t\tcase \"DECOMPRESSION\" : break;\n\n\t\t/* ************************************\n\t\t * indexing \n\t\t *************************************/\n\t\t\n\t\t/* create index for many ts */\n\t\tcase \"CREATE_INDEX\" : ExecuteCommand.createIndex(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* return neighbors of a ts from the create index */\n\t\tcase \"NEIGHBORS\" : break;\n\t\t/* ************************************\n\t\t * clustering \n\t\t *************************************/\n\t\t\n\t\t/* ************************************\n\t\t * Application \n\t\t *************************************/\n\t\tcase \"CREATE_DNA\" : break;\n\t\tcase \"DNA_SIMILARITY\" : ExecuteCommand.dnApplication(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\t\t\n\t\tdefault: System.out.println(\"oups it may have a code error\");\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public FlinkFnApi.UserDefinedFunctions createUserDefinedFunctionsProto() {\n return ProtoUtils.createUserDefinedFunctionsProto(\n getRuntimeContext(),\n scalarFunctions,\n config.get(PYTHON_METRIC_ENABLED),\n config.get(PYTHON_PROFILE_ENABLED));\n }", "FunCall createFunCall();", "FunctionCall getFc();", "static public interface FunctionHandler\r\n {\r\n public double evaluateFunction(String nam, ArgParser args) throws ArithmeticException;\r\n }", "@Override\r\n public String getCommand() {\n return \"function\";\r\n }", "public void exec();", "private static Function instantiateHiveFunction(\n ObjectPath functionPath, CatalogFunction function) {\n String functionClassName;\n if (function.getFunctionLanguage() == FunctionLanguage.JAVA) {\n functionClassName = function.getClassName();\n } else if (function.getFunctionLanguage() == FunctionLanguage.SCALA) {\n functionClassName = FLINK_SCALA_FUNCTION_PREFIX + function.getClassName();\n } else if (function.getFunctionLanguage() == FunctionLanguage.PYTHON) {\n functionClassName = FLINK_PYTHON_FUNCTION_PREFIX + function.getClassName();\n } else {\n throw new UnsupportedOperationException(\n \"HiveCatalog supports only creating\"\n + \" JAVA/SCALA or PYTHON based function for now\");\n }\n\n List<org.apache.hadoop.hive.metastore.api.ResourceUri> resources = new ArrayList<>();\n for (ResourceUri resourceUri : function.getFunctionResources()) {\n switch (resourceUri.getResourceType()) {\n case JAR:\n resources.add(\n new org.apache.hadoop.hive.metastore.api.ResourceUri(\n ResourceType.JAR, resourceUri.getUri()));\n break;\n case FILE:\n resources.add(\n new org.apache.hadoop.hive.metastore.api.ResourceUri(\n ResourceType.FILE, resourceUri.getUri()));\n break;\n case ARCHIVE:\n resources.add(\n new org.apache.hadoop.hive.metastore.api.ResourceUri(\n ResourceType.ARCHIVE, resourceUri.getUri()));\n break;\n default:\n throw new CatalogException(\n String.format(\n \"Unknown resource type %s for function %s.\",\n resourceUri.getResourceType(), functionPath.getFullName()));\n }\n }\n\n return new Function(\n // due to https://issues.apache.org/jira/browse/HIVE-22053, we have to normalize\n // function name ourselves\n functionPath.getObjectName().trim().toLowerCase(),\n functionPath.getDatabaseName(),\n functionClassName,\n null, // Owner name\n PrincipalType\n .GROUP, // Temporarily set to GROUP type because it's required by Hive. May\n // change later\n (int) (System.currentTimeMillis() / 1000),\n FunctionType.JAVA, // FunctionType only has JAVA now\n resources // Resource URIs\n );\n }", "FunctionExtract createFunctionExtract();", "FunctionAnalytical createFunctionAnalytical();", "public interface Operation {\n /**\n * Executes given operation\n *\n * @param file file for executing operation\n * @param printerOK method for printing OK things\n * @param printerError method for printing error things\n */\n void execute(FitsFile file, PrintOutputMethod printerOK, PrintOutputMethod printerError);\n}", "private static Object invoke(CompileResult compileResult, BIRNode.BIRFunction function, String functionName,\n Object[] args, Class<?>[] paramTypes) {\n assert args.length == paramTypes.length;\n\n Object[] jvmArgs = populateJvmArgumentArrays(args);\n\n Object jvmResult;\n PackageManifest packageManifest = compileResult.packageManifest();\n String funcClassName = JarResolver.getQualifiedClassName(packageManifest.org().toString(),\n packageManifest.name().toString(),\n packageManifest.version().toString(),\n getClassName(function.pos.lineRange().fileName()));\n\n try {\n Class<?> funcClass = compileResult.getClassLoader().loadClass(funcClassName);\n Method method = getMethod(functionName, funcClass);\n Function<Object[], Object> func = a -> {\n try {\n return method.invoke(null, a);\n } catch (IllegalAccessException e) {\n throw new RuntimeException(\"Error while invoking function '\" + functionName + \"'\", e);\n } catch (InvocationTargetException e) {\n Throwable t = e.getTargetException();\n if (t instanceof BLangTestException) {\n throw ErrorCreator.createError(StringUtils.fromString(t.getMessage()));\n }\n if (t instanceof io.ballerina.runtime.api.values.BError) {\n throw ErrorCreator.createError(StringUtils.fromString(\n \"error: \" + ((io.ballerina.runtime.api.values.BError) t).getPrintableStackTrace()));\n }\n if (t instanceof StackOverflowError) {\n throw ErrorCreator.createError(StringUtils.fromString(\"error: \" +\n \"{ballerina}StackOverflow {\\\"message\\\":\\\"stack overflow\\\"}\"));\n }\n throw ErrorCreator.createError(StringUtils.fromString(\"Error while invoking function '\" +\n functionName + \"'\"), e);\n }\n };\n\n Scheduler scheduler = new Scheduler(false);\n FutureValue futureValue = scheduler.schedule(jvmArgs, func, null, null, new HashMap<>(),\n PredefinedTypes.TYPE_ANY, \"test\",\n new StrandMetadata(ANON_ORG, DOT, DEFAULT_MAJOR_VERSION.value, functionName));\n scheduler.start();\n if (futureValue.panic instanceof RuntimeException) {\n throw new BLangTestException(futureValue.panic.getMessage(),\n futureValue.panic);\n }\n jvmResult = futureValue.result;\n } catch (ClassNotFoundException | NoSuchMethodException e) {\n throw new RuntimeException(\"Error while invoking function '\" + functionName + \"'\", e);\n }\n\n return jvmResult;\n }", "public void execfile(String filename) {\n }", "private Visitor createCommand(String[][] cmdTokens)\n {\n Visitor cmd = null;\n\n try {\n String cmdName = Character.toUpperCase(cmdTokens[0][Helpers.CMD].charAt(0)) + cmdTokens[Helpers.CMD][0].substring(1);\n Class<?> aClass = Class.forName(Visitor.class.getPackage().getName() + '.' + cmdName);\n Constructor<?> ctor = aClass.getConstructor(String[].class, User.class, String[].class);\n cmd = (Visitor) ctor.newInstance(cmdTokens[ARGS], currentUser, cmdTokens[FS_ELEMENTS]);\n } catch (Exception ignored) {\n System.out.println(cmdTokens[0][Helpers.CMD] + \": command not found\");\n } finally {\n System.out.println(); // print out a new line after the command runs (or errors)\n }\n\n return cmd;\n }", "public boolean addFunction(Accessibility pPAccess, SubRoutine pExec, MoreData pMoreData);", "public Function getFunction();", "protected Blob buildCommandLineAndRun(String inCommandLine, CmdParameters inParams, String inFileName,\n boolean inUseAllParams) throws IOException, CommandNotAvailable, NuxeoException {\n Blob resultPdf = Blobs.createBlobWithExtension(\".pdf\");\n\n // Build the full, resolved command line\n String resolvedParameterString = CommandLineParameters.buildParameterString(inCommandLine,\n inParams.getParameter(CommandLineParameters.COOKIE_JAR),\n inParams.getParameter(CommandLineParameters.URL), resultPdf.getFile().getAbsolutePath());\n\n // Mainly during test, we may have uncjecked parameters (safe because everything is hard-coded server side)\n if (inUseAllParams) {\n if (!Framework.isTestModeSet()) {\n throw new NuxeoException(\"A call to buildCommandLineAndRun(..., true) is for test only.\");\n }\n Map<String, ParameterValue> allParams = inParams.getParameters();\n String key, value;\n for (Entry<String, ParameterValue> entry : allParams.entrySet()) {\n key = entry.getKey();\n value = entry.getValue().getValue();\n if (!CommandLineParameters.isHandledParameter(key)) {\n resolvedParameterString = StringUtils.replace(resolvedParameterString, \"#{\" + key + \"}\", value);\n }\n }\n }\n\n // Get the exact command line and build the line\n CommandLineDescriptor desc = CommandLineExecutorComponent.getCommandDescriptor(inCommandLine);\n String line = desc.getCommand() + \" \" + resolvedParameterString;\n\n // Run the thing\n Exception exception = null;\n\n CommandLine cmdLine = CommandLine.parse(line);\n DefaultExecutor executor = new DefaultExecutor();\n ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);\n // We don't want a check on exit values, because a PDF can still be created with errors\n // (can't get a font, ...)\n executor.setExitValues(null);\n executor.setWatchdog(watchdog);\n int exitValue = 0;\n try {\n exitValue = executor.execute(cmdLine);\n } catch (IOException e) {\n exception = e;\n }\n\n // Even if we had no error catched, we must check if the pdf is valid.\n // Exit value may be 1, or non zero while the pdf was created. But maybe\n // a font could not be correctly rendered, etc. Let's check if we have\n // something in the pdf and it looks valid\n if (!pdfLooksValid(resultPdf.getFile())) {\n resultPdf = null;\n String msg = \"Failed to execute the command line [\" + cmdLine.toString()\n + \" ]. No valid PDF generated. exitValue: \" + exitValue;\n\n if (exitValue == 143) { // On Linux: Timeout, wkhtmltopdf was SIGTERM\n msg += \" (time out reached. The timeout was \" + timeout + \"ms)\";\n }\n if (exception == null) {\n throw new NuxeoException(msg);\n } else {\n throw new NuxeoException(msg, exception);\n }\n }\n\n resultPdf.setMimeType(\"application/pdf\");\n String url = inParams.getParameter(CommandLineParameters.URL);\n // Url parameter can be blank (hard coded url in the command line XML for example)\n if (StringUtils.isBlank(inFileName) && StringUtils.isNotBlank(url)) {\n try {\n URL urlObj = new URL(url);\n inFileName = StringUtils.replace(urlObj.getHost(), \".\", \"-\") + \".pdf\";\n } finally {\n // Nothing. Default name has been set by nuxeo\n }\n }\n if (StringUtils.isNotBlank(inFileName)) {\n resultPdf.setFilename(inFileName);\n }\n\n return resultPdf;\n }", "@MBeanInfo(\"Execute commands from a file\")\n String execfile(@MBeanInfo(\"Path to file\") String path);", "public static void main(String[] args) throws Exception {\n \t\n \tbyte[] fileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/main/re/bytecode/obfuscat/pass/vm/VMRefImpl.class\").toURI()));\n \tDSLParser p = new DSLParser();\n \tMap<String, Function> functions = p.processFile(fileData);\n \tFunction refF = MergedFunction.mergeFunctions(functions, \"process\"); // functions.get(\"process\");\n \t\n \t\n \t\n \tfileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/test/re/bytecode/obfuscat/samples/Sample8.class\").toURI()));\n \tp = new DSLParser();\n functions = p.processFile(fileData);\n \n \tFunction f = MergedFunction.mergeFunctions(functions, \"entry\");\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//Function f = Obfuscat.buildFunction(\"Test\", map);\n \t\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//map.put(\"data\", new byte[] { 1, 2, 3, 4 });\n\t\t//Function f = Obfuscat.buildFunction(\"KeyBuilder\", map );\n\t\n \tf = Obfuscat.applyPass(f, \"Flatten\");\n\t\tf = Obfuscat.applyPass(f, \"OperationEncode\");\n\t\t\n\t\tint[] gen = new VMCodeGenerator(new Context(System.currentTimeMillis()), f).generate();\n\n\t\tbyte[] vmcode = new byte[gen.length];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < gen.length; i++) {\n\t\t\tsb.append(String.format(\"%02X\", gen[i] & 0xFF));\n\t\t\tvmcode[i] = (byte) gen[i];\n\t\t}\n\n\t\tSystem.out.println(sb.toString());\n\n\t\tSystem.out.println(\"=========================================\");\n\n\t\t\n\t\tSystem.out.println(f.getBlocks().get(0));\n\t\t\n\t\tEmulateFunction eFB = new EmulateFunction(f);\n\t\tbyte[] arr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Original => \"+eFB.run(-1, arr));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Java Reference => \"+VMRefImpl.process(vmcode, f.getData() ,new Object[]{0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\n\t\t\n\t\tEmulateFunction eFRef = new EmulateFunction(refF);\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulated Reference => \"+eFRef.run(-1, gen, f.getData(), new Object[] {0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tEmulateFunction eFPass = new EmulateFunction(Obfuscat.applyPass(f, \"Virtualize\"));\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Pass VM => \"+eFPass.run(-1, arr ));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\n }", "public static void main(String[] args) {\n \t\t\n \t\t// parse the command line options\n \t\tCommandLineParser parser = new PosixParser();\n \t\tCommandLine cmd = null;\n \t\ttry {\n \t\t\tcmd = parser.parse(createOptions(), args);\n \t\t}catch(org.apache.commons.cli.ParseException e) {\n \t\t\t// something bad happened so output help message\n \t\t\tprintCliHelp(\"Error in parsing arguments:\\n\" + e.getMessage());\n \t\t}\n \t\t\n \t\t/*\n \t\t * get and test the command line arguments\n \t\t */\n \n \t\t// input path\n \t\tString inputPath = cmd.getOptionValue(\"input\");\n \n \t\tif(StringUtils.isEmpty(inputPath)) {\n \t\t\tprintCliHelp(\"Error: the path to the input file / directory is required\");\n \t\t}\n \n \t\tif(FileUtils.isFileAccessible(inputPath) == false && FileUtils.isDirectoryAccessible(inputPath) == false) {\n \t\t\tprintCliHelp(\"Error: the input file / directory is not accessible\");\n \t\t}\n \n \t\tFile inputFile = new File(inputPath);\n \t\t\n \t\t// minimum file size\n \t\tString inputSize = cmd.getOptionValue(\"minsize\");\n \t\tint minFileSize = MIN_FILE_SIZE;\n \t\t\n \t\tif(StringUtils.isEmpty(inputSize) == false) {\n \t\t\ttry {\n \t\t\t\tminFileSize = Integer.parseInt(inputSize);\n \t\t\t} catch(NumberFormatException e) {\n \t\t\t\tprintCliHelp(\"Error: the minimum file size must be a valid integer\");\n \t\t\t}\n \t\t}\n \t\t\n \t\t// arbitrary file size in attempt to stop invalid data and \n \t\t// unnecessarily processing small files\n \t\tif(minFileSize < 10) {\n \t\t\tprintCliHelp(\"Error: the minimum file size must be greater than 10\");\n \t\t}\n \t\t\n \t\t// output path && template file\n \t\t\n \t\tFile outputDir = null;\n \t\tString scriptContents = null;\n \t\t\n \t\tString outputPath = cmd.getOptionValue(\"output\");\n \t\tString templatePath = cmd.getOptionValue(\"template\");\n \t\t\n \t\tif(StringUtils.isEmpty(outputPath) == false) {\n \t\t\tif(FileUtils.isDirectoryAccessible(outputPath) == false) {\n \t\t\t\tprintCliHelp(\"Error: the output directory is not accessible\");\n \t\t\t}\n \t\t\t\n \t\t\tif(StringUtils.isEmpty(templatePath)) {\n \t\t\t\tprintCliHelp(\"Error: the template must be specified when the output pararameter used\");\n \t\t\t}\n \t\t\t\n \t\t\tif(FileUtils.isFileAccessible(templatePath) == false) {\n \t\t\t\tprintCliHelp(\"Error: the osmosis script template file is not accesible\");\n \t\t\t}\n \t\t\t\n \t\t\toutputDir = new File(outputPath);\n \t\t\t\n \t\t\t// read the contents of the template file\n \t\t\ttry {\n \t\t\t\tscriptContents = org.apache.commons.io.FileUtils.readFileToString(new File(templatePath));\n \t\t\t} catch (IOException e1) {\n \t\t\t\tSystem.err.println(\"ERROR: unable to read the template file\");\n \t\t\t\tSystem.exit(-1);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// ignore list path\n \t\tignoreList = new ArrayList<String>();\n \t\t\n \t\tString ignorePath = cmd.getOptionValue(\"ignore\");\n \t\t\n \t\tif(StringUtils.isEmpty(ignorePath) == false) {\n \t\t\t\n \t\t\tif(FileUtils.isFileAccessible(ignorePath) == false) {\n \t\t\t\tprintCliHelp(\"Error: the ignore list file is not accessible\");\n \t\t\t}\n \t\t\t\n \t\t\t// read the contents of the ignore list file\n \t\t\ttry {\n \t\t\t\tignoreList = (ArrayList<String>) org.apache.commons.io.FileUtils.readLines(new File(ignorePath));\n \t\t\t\t\n \t\t\t\t// strip out any comment lines\n \t\t\t\tfor (int i = 0; i < ignoreList.size(); i++) {\n \t\t\t\t\tif(ignoreList.get(i).startsWith(\"#\")) {\n \t\t\t\t\t\tignoreList.remove(i);\n \t\t\t\t\t\ti--;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} catch (IOException e) {\n \t\t\t\tSystem.err.println(\"ERROR: unable to read the ignore list file\");\n \t\t\t\tSystem.exit(-1);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\t/*\n \t\t * output some text\n \t\t */\n \t\tSystem.out.println(APP_NAME);\n \t\tSystem.out.println(\"Version: \" + APP_VERSION);\n \t\tSystem.out.println(\"More info: \" + MORE_INFO);\n \t\tSystem.out.println(\"License info: \" + LICENSE_INFO + \"\\n\");\n \t\t\n \t\t// inform user of resources we'll be working on\n \t\ttry {\n \t\t\tif(inputFile.isDirectory()) {\n \t\t\t\tSystem.out.println(\"Processing OSM PBF files in directory: \" + inputFile.getCanonicalPath());\n \t\t\t\t\n \t\t\t\t// test the files in the directory\n \t\t\t\tBBoxSplit.readFilesInDir(inputFile, outputDir, scriptContents, minFileSize);\n \t\t\t\t\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t// test the file\n \t\t\t\tBBoxSplit.readFile(inputFile, outputDir, scriptContents, minFileSize);\n \t\t\t}\n \t\t} catch (IOException e) {\n \t\t\tSystem.err.println(\"Unable to access file system resources.\\n\" + e.toString());\n \t\t\tSystem.exit(-1);\n \t\t}\n \t}", "org.globus.swift.language.Function addNewFunction();", "public void addZetaSQLFunctionsAndTypes(ZetaSQLBuiltinFunctionOptions options) {\n Preconditions.checkNotNull(options);\n Preconditions.checkState(builtinFunctionOptions == null);\n builtinFunctionOptions = options.serialize();\n\n try {\n GetBuiltinFunctionsResponse response =\n Client.getStub().getBuiltinFunctions(builtinFunctionOptions);\n\n processGetBuiltinFunctionsResponse(response);\n } catch (StatusRuntimeException e) {\n throw new SqlException(e);\n }\n }", "public Function() {\r\n\r\n\t}", "ProcedureCall createProcedureCall();", "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 void\ncmdProc(\n Interp interp, \t\t\t// Current interp to eval the file cmd.\n TclObject argv[])\t\t\t// Args passed to the file command.\nthrows\n TclException\n{\n// String dirName;\n//\n\tif(argv.length == 1)\n\t{\n\t\tString result = Commands.getAllCommands();\n\t\tSystem.out.println(result);\n\t\treturn;\n\t}\n if (argv.length > 2) {\n \tthrow new TclNumArgsException(interp, 1, argv, \"?dirName?\");\n }\n//\n// if (argv.length == 1) {\n//\tdirName = \"~\";\n// } else {\n//\tdirName = argv[1].toString();\n// }\n// if ((JACL.PLATFORM == JACL.PLATFORM_WINDOWS) \n//\t && (dirName.length() == 2) && (dirName.charAt(1) == ':')) {\n//\tdirName = dirName + \"/\";\n// }\n//\n// // Set the interp's working dir.\n//\n// interp.setWorkingDir(dirName);\n\t\n\tCommands.man(argv[1].toString());\n}", "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}", "public interface Function {\n /**\n * Get the name of this function.\n *\n * @return The name of the function.\n */\n String getName();\n\n /**\n * Execute this function.\n */\n void execute();\n}", "protected void addCommand(SpaceSystemType spaceSystem,\n String commandName,\n String cmdFuncCode,\n String cmdArgument,\n String applicationID,\n boolean isCmdHeader,\n String cmdHdrSysPath,\n String[] argumentNames,\n String[] argDataTypes,\n String[] argArraySizes,\n String description) throws CCDDException\n {\n // Set the flag assuming the internal method is used\n boolean useInternal = true;\n\n // Check if an external method is to be used\n if (invocable != null)\n {\n try\n {\n // Execute the external method\n invocable.invokeFunction(\"addCommand\",\n project,\n factory,\n cmdHeaderTable,\n spaceSystem,\n commandName,\n cmdFuncCodeName,\n cmdFuncCode,\n DefaultInputType.COMMAND_ARGUMENT.getInputName(),\n cmdArgument,\n applicationIDName,\n applicationID,\n isCmdHeader,\n cmdHdrSysPath,\n argumentNames,\n argDataTypes,\n argArraySizes,\n description);\n\n // Set the flag to indicate the internal method is not used\n useInternal = false;\n }\n catch (NoSuchMethodException nsme)\n {\n // The script method couldn't be located in the script; use the internal method\n // instead\n }\n catch (Exception e)\n {\n throw new CCDDException(\"Error in script function '</b>addCommand<b>'; cause '</b>\"\n + e.getMessage()\n + \"<b>'\");\n }\n }\n\n // Check if the internal method is used\n if (useInternal)\n {\n MetaCommandSet commandSet = spaceSystem.getCommandMetaData().getMetaCommandSet();\n MetaCommandType command = factory.createMetaCommandType();\n\n // Check is a command name exists\n if (commandName != null && !commandName.isEmpty())\n {\n // Set the command name attribute\n command.setName(commandName);\n }\n\n // Check is a command description exists\n if (description != null && !description.isEmpty())\n {\n // Set the command description attribute\n command.setLongDescription(description);\n }\n\n // Check if the command has any arguments\n if (argumentNames.length != 0)\n {\n int index = 0;\n ArgumentList argList = null;\n CommandContainerType cmdContainer = factory.createCommandContainerType();\n cmdContainer.setName(commandName);\n CommandContainerEntryListType entryList = factory.createCommandContainerEntryListType();\n\n // Step through each argument\n for (String argumentName : argumentNames)\n {\n String argDataType = argDataTypes[index];\n String argArraySize = argArraySizes[index];\n\n // Set the flag to indicate that the argument is an array\n boolean isArray = argArraySize != null && !argArraySize.isEmpty();\n\n // Check if the argument data type is a primitive\n if (dataTypeHandler.isPrimitive(argDataType))\n {\n // Check if this is the first argument\n if (argList == null)\n {\n argList = factory.createMetaCommandTypeArgumentList();\n }\n\n // Add the argument to the the command's argument list\n Argument arg = factory.createMetaCommandTypeArgumentListArgument();\n arg.setName(argumentName);\n arg.setArgumentTypeRef(argumentName + (isArray ? ARRAY : TYPE));\n argList.getArgument().add(arg);\n\n // Check if the command argument is an array\n if (isArray)\n {\n DimensionList dimList = factory.createArrayParameterRefEntryTypeDimensionList();\n\n // Set the array dimension start index (always 0)\n IntegerValueType startVal = factory.createIntegerValueType();\n startVal.setFixedValue(\"0\");\n\n // Step through each array dimension\n for (int arrayDim : ArrayVariable.getArrayIndexFromSize(argArraySize))\n {\n // Create the dimension and set the start and end indices (the end\n // index is the number of elements in this array dimension minus 1)\n Dimension dim = factory.createArrayParameterRefEntryTypeDimensionListDimension();\n IntegerValueType endVal = factory.createIntegerValueType();\n endVal.setFixedValue(String.valueOf(arrayDim - 1));\n dim.setStartingIndex(startVal);\n dim.setEndingIndex(endVal);\n dimList.getDimension().add(dim);\n }\n\n // Store the array parameter array reference in the list\n ArrayParameterRefEntryType arrayRef = factory.createArrayParameterRefEntryType();\n arrayRef.setParameterRef(argumentName);\n arrayRef.setDimensionList(dimList);\n JAXBElement<ArrayParameterRefEntryType> arrayRefElem = factory.createCommandContainerEntryListTypeArrayArgumentRefEntry(arrayRef);\n entryList.getParameterRefEntryOrParameterSegmentRefEntryOrContainerRefEntry().add(arrayRefElem);\n }\n // Not an array\n else\n {\n // Store the argument reference in the list\n ArgumentRefEntry argumentRef = factory.createCommandContainerEntryListTypeArgumentRefEntry();\n argumentRef.setArgumentRef(argumentName);\n JAXBElement<ArgumentRefEntry> argumentRefElem = factory.createCommandContainerEntryListTypeArgumentRefEntry(argumentRef);\n entryList.getParameterRefEntryOrParameterSegmentRefEntryOrContainerRefEntry().add(argumentRefElem);\n }\n }\n // The argument data type is a structure reference. This occurs if this is the\n // command header table or a descendant table of the command header table\n else\n {\n // Add a container reference (or references if the argument is an array) to\n // the space system in the command container entry list that defines the\n // argument\n addContainerReference(argumentName, argDataType, argArraySize, entryList);\n }\n\n index++;\n }\n\n // Check if this table represents the command header\n if (isCmdHeader)\n {\n // Set the abstract flag to indicate the command metadata represents a command\n // header\n command.setAbstract(true);\n }\n // Not the command header. Check if the command application ID and command header\n // table name are provided\n else if (applicationID != null && !applicationID.isEmpty() && cmdHeaderTable != null\n && !cmdHeaderTable.isEmpty())\n {\n // Create the reference to the base meta-command and set it to the empty base,\n // in case no command header is defined\n BaseMetaCommand baseCmd = factory.createMetaCommandTypeBaseMetaCommand();\n baseCmd.setMetaCommandRef(cleanSystemPath(\"/\"\n + project.getValue().getName()\n + (cmdHdrSysPath == null || cmdHdrSysPath.isEmpty() ? \"\"\n : \"/\"\n + cmdHdrSysPath)\n + \"/\"\n + cmdHeaderTable\n + \"/\"\n + cmdHeaderTable));\n\n // Create the argument assignment list and store the application ID\n ArgumentAssignmentList argAssnList = factory.createMetaCommandTypeBaseMetaCommandArgumentAssignmentList();\n ArgumentAssignment argAssn = factory.createMetaCommandTypeBaseMetaCommandArgumentAssignmentListArgumentAssignment();\n argAssn.setArgumentName(applicationIDName);\n argAssn.setArgumentValue(applicationID);\n argAssnList.getArgumentAssignment().add(argAssn);\n\n // Check if a command code is provided\n if (cmdFuncCode != null && !cmdFuncCode.isEmpty())\n {\n // Store the command code\n argAssn = factory.createMetaCommandTypeBaseMetaCommandArgumentAssignmentListArgumentAssignment();\n argAssn.setArgumentName(cmdFuncCodeName);\n argAssn.setArgumentValue(cmdFuncCode);\n argAssnList.getArgumentAssignment().add(argAssn);\n }\n\n // Check if a command argument is provided\n if (cmdArgument != null && !cmdArgument.isEmpty())\n {\n // Store the command argument\n argAssn = factory.createMetaCommandTypeBaseMetaCommandArgumentAssignmentListArgumentAssignment();\n argAssn.setArgumentName(DefaultInputType.COMMAND_ARGUMENT.getInputName());\n argAssn.setArgumentValue(cmdArgument);\n argAssnList.getArgumentAssignment().add(argAssn);\n }\n\n baseCmd.setArgumentAssignmentList(argAssnList);\n command.setBaseMetaCommand(baseCmd);\n }\n\n // Check if the command references any primitive data types\n if (argList != null)\n {\n command.setArgumentList(argList);\n }\n\n cmdContainer.setEntryList(entryList);\n command.setCommandContainer(cmdContainer);\n }\n\n commandSet.getMetaCommandOrMetaCommandRefOrBlockMetaCommand().add(command);\n }\n }", "public void execute(String cmd, String[] args) {\n\n switch (cmd)\n {\n case \"CreateFile\" -> {\n String newFilePath = args[0];\n StringBuilder filePath = extractPrePath(newFilePath);\n\n Directory dir = GetDirectory(filePath.toString(), getRoot());\n\n if (validateDirectory(newFilePath, dir)) {\n _File file = new _File(newFilePath, Integer.parseInt(args[1]));\n\n if (allocator.allocateFile(file) != -1)\n {\n dir.addFile(file);\n System.out.println(\"FIle Added Successfully\");\n }\n else\n {\n System.out.println(\"Failed to add file\");\n }\n }\n else\n System.out.println(\"Invalid path\");\n }\n case \"CreateFolder\" -> {\n String newFolderPath = args[0];\n StringBuilder folderPath = extractPrePath(newFolderPath);\n\n Directory directory = GetDirectory(folderPath.toString(), getRoot());\n\n if (validateDirectoryPath(newFolderPath, directory)) {\n Directory dir = new Directory();\n\n dir.setDirectoryPath(newFolderPath);\n directory.addDirectory(dir);\n\n System.out.println(\"Directory added successfully\");\n }\n else\n System.out.println(\"Directory already exists\");\n }\n case \"DeleteFile\" -> {\n StringBuilder filePath = extractPrePath(args[0]);\n Directory dir = GetDirectory(filePath.toString(), getRoot());\n\n deleteFile(args[0], dir);\n }\n case \"DeleteFolder\" -> {\n StringBuilder folderPath = extractPrePath(args[0]);\n Directory dir = GetDirectory(folderPath.toString(), getRoot());\n System.out.println(args[0]);\n deleteDirectory(args[0], dir);\n }\n case \"DisplayDiskStatus\" -> {\n allocator.displayDiskStatus();\n }\n case \"DisplayDiskStructure\" -> {\n getRoot().printDirectoryStructure(0);\n }\n }\n }", "public static void main(String[] args)\n {\n OneVarParameterizedFunction polynomial; \n\n double coef[] = { 1, 2, 3, 4 };\n polynomial = new Polynomial( coef );\n\n String par_name[] = polynomial.getParameterNames();\n\n System.out.println( \"Polynomial: \" );\n for ( int i = 0; i < par_name.length; i++ )\n System.out.println(par_name[i] + \" = \" + coef[i] );\n\n double x;\n for ( int i = 0; i <= 10; i++ )\n {\n x = i;\n System.out.println( \"x = \" + x + \n \", p(x) = \" + polynomial.getValue(x) +\n \", p'(x) = \" + polynomial.get_dFdx(x) +\n \", fp'(x) = \" + polynomial.get_dFdx((float)x) );\n }\n\n x = 3;\n double derivs[] = polynomial.get_dFda( x );\n System.out.println( \"At \" + x + \n \", the derivatives relative to the coeffs are:\");\n for ( int i = 0; i < par_name.length; i++ )\n System.out.println(\"deriv WRT \" + par_name[i] + \" = \" + derivs[i]);\n\n/*\n \n DataSet ds = new DataSet( \"Sample Polynomials\", \"Initial Version\" );\n\n XScale x_scale = new UniformXScale( -5, 5, 500 );\n Data polynomial_data; \n for ( int i = 0; i < 100; i++ )\n {\n double a = -5+i/10.0f;\n double coefficients[] = { a*a, -2*a, 1 };\n polynomial = new Polynomial( coefficients );\n polynomial_data = new FunctionModel( x_scale, polynomial, i );\n ds.addData_entry( polynomial_data );\n }\n ViewManager vm = new ViewManager( ds, IViewManager.IMAGE );\n*/\n }", "Subprocess createSubprocess();", "public void parseFunctions(){\n\t\t\n\t}", "abstract public void execute(FunctionContext context) throws Exception;", "public static Object compileCustomFunction(Class iface, String expression, String... params) {\n\n\t\t// check for obviously invalid expressions\n\t\tif (expression == null || expression.length() == 0)\n\t\t\treturn null;\n\n\t\t// class must be an interface\n\t\tif (!iface.isInterface())\n\t\t\treturn null;\n\n\t\tString signature;\n\n\t\ttry {\n\t\t\tMethod[] methods = iface.getMethods();\n\n\t\t\t// must be a functional interface\n\t\t\tif (methods.length != 1)\n\t\t\t\treturn null;\n\n\t\t\tMethod method = methods[0];\n\t\t\tClass<?> returnType = method.getReturnType();\n\t\t\tClass<?>[] paramTypes = method.getParameterTypes();\n\n\t\t\t// method must return a value\n\t\t\tif (returnType == Void.class)\n\t\t\t\treturn null;\n\n\t\t\tString paramString = \"\";\n\n\t\t\t// add parameter types and names to the parameter list\n\t\t\tfor (int i=0; i < params.length; i++) {\n\t\t\t\tif (i > 0)\n\t\t\t\t\tparamString += \", \";\n\t\t\t\tparamString += paramTypes[i].getCanonicalName() + \" \" + params[i];\n\t\t\t}\n\n\t\t\t// build the method signature\n\t\t\tsignature = returnType.getCanonicalName() + \" \" +\n\t\t\t\t\t\tmethod.getName() + \"(\" +\n\t\t\t\t\t\tparamString + \")\";\n\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\n\t\treturn createNewInstance(iface.getCanonicalName(),\n\t\t\t\t\t\t\t\t signature,\n\t\t\t\t\t\t\t\t expression);\n\t}", "public static void openFileForInput(String ID, String file, Function function,\n DawnParser parser) throws DawnRuntimeException\n {\n if (!isFileAvailable(ID, parser))\n {\n try\n {\n parser.setProperty(\"DAWN.IO#FILE.\" + ID, new BufferedReader(new FileReader(\n DawnUtilities.constructPath(file))));\n } catch (IOException ioe) {\n throw new DawnRuntimeException(function, parser, \"file \" + file + \" not found\");\n }\n } else\n throw new DawnRuntimeException(function, parser, \"file ID \" + ID + \" already exists\");\n }", "Command createCommand();", "public static void main(String[] args) {\n\n Function<String, String> function1 = (string) -> string +string;\n System.out.println(function1.apply(\"aaa\"));\n\n Function<String,String> function2 =s -> new String(s);\n System.out.println(function2.apply(function2.apply(\"sss\")));\n\n// Function<String, Emp> function = s -> new Emp(s);\n// System.out.println(function.apply(\"yy\"));\n\n Function<String, Emp> function3 = Emp::new;\n System.out.println(function3.apply(\"yy\"));\n }", "public static void main (String[] argv)\n {\n Function F = new Function (\"Silly function\");\n\n for (double x=0; x<=5; x=x+0.05) {\n //double f = 3*x + 5;\n //double f = x*x - 2;\n //double f = 5/(x*x);\n double f = Math.pow(Math.E,-2*x); \n // Feed the x,f(x) combinations into the object.\n F.add (x, f);\n }\n\n // Write to screen.\n System.out.println (F);\n\n // Display.\n F.show ();\n }", "public interface IFunctions {\n\t/**\n\t * Interprets the function.\n\t * @param commandDict: command dictionary for current workspace.\n\t * @param varDict: variable dictionary for current workspace.\n\t * @return value that the function evaluates to.\n\t * @throws ClassNotFoundException\n\t */\n\tdouble interpret(CommandDictionary commandDict, VariableDictionary varDict) throws ClassNotFoundException;\n\n\t/**\n\t * Gets the children of the function.\n\t * @return list of children.\n\t */\n\tList<IFunctions> getChildren();\n\n\t/**\n\t * Returns a string representation of the function.\n\t * @return string representation of the function.\n\t */\n\tString toString();\n}", "@Override // kotlin.jvm.functions.Function0\n public File invoke() {\n return new File(this.a.b, this.a.c);\n }", "T getFunction(String functionName) throws IllegalArgumentException;", "private static void startWork()\n {{\n String ftnTxt= null;\n FileToFtnParser parser= new FileToFtnParser( arg_ir_filename );\n String hashes39= \"#######################################\";\n\n while( true ) {\n\t ftnTxt= parser.parseFtn();\n\t if ( ftnTxt == null ) { break; }\n\t if ( arg_verbosity > 1 ) {\n\t System.out.println ( hashes39+ hashes39 );\n\t System.out.println ( \"found function: <<EOF \" );\n\t System.out.println ( ftnTxt );\n\t System.out.println ( \"EOF\" );\n\t }\n\n\t FtnParts ftnParts= new FtnParts( ftnTxt );\n\n\t if ( arg_verbosity > 0 ) {\n System.out.println( \"---\" );\n\t System.out.println( \"function: \" );\n\t System.out.println( ftnParts.toString() );\n\t }\n\n\t TestGenerator generator= new TestGenerator( ftnParts, arg_numCalls );\n\t String outFilename= arg_outDirname+ File.separator+ \n\t ftnParts.getNameWithoutSigil()+ \".ll\";\n\t generator.generate( outFilename );\n }\n\n }}", "@AutoGUIAnnotation(\r\n DescriptionForUser = \"<html>A reference implementation of<br>a Instrument Command.</html>\",\r\n ParameterNames = {\"Value 1\", \"Value 2\", \"Value 3\"},\r\n DefaultValues = {\"1.1\", \"true\", \"\\\"Command-Line in double quotes\\\"\"},\r\n ToolTips = {\"TT1\", \"TT2\", \"The command to execute\"})\r\n @iC_Annotation( MethodChecksSyntax = true )\r\n public void ReferenceImplementation(float Param1,\r\n boolean Param2,\r\n String CommandLine)\r\n throws ScriptException, IOException, DataFormatException {\r\n\r\n // local variables\r\n float dummy = 0;\r\n\r\n\r\n // remove double-quotes from the beginning and end of the CommandLine\r\n CommandLine = CommandLine.replaceFirst(\"^\\\"\", \"\").replaceFirst(\"\\\"$\", \"\");\r\n\r\n\r\n //////////////////////////////////////\r\n // Syntax-Check + Execute Command Line\r\n\r\n // Execute the Command Line:\r\n // in Syntax-Check mode the returned object is null\r\n // when not in Syntax-Check mode, the object should be valid\r\n if ( !CommandLine.isEmpty() ) {\r\n\r\n // make a new Device object to call it's DispatchCommand method\r\n // see Remark in javadoc (How to write new Instrument-Classes)\r\n Device dev = new Device();\r\n\r\n // perform the Syntax check\r\n Object obj = dev.DispatchCommand(CommandLine);\r\n\r\n // convert to float if returned object is valid\r\n if (obj != null) {\r\n\r\n try {\r\n // convert the Instrument's answer to a float\r\n dummy = getFloat(obj.toString());\r\n \r\n } catch (ScriptException ex) {\r\n // returned object is no convertible into a float, so throw an Exception\r\n String str = \"Executing the Command Line\\n\" + CommandLine + \"\\n\"\r\n + \"did not return an object that can be converted into a float value.\\n\"\r\n + \"Please check the Command Line.\\n\";\r\n throw new ScriptException(str);\r\n }\r\n }\r\n // the returned object is not valid, so throw an Exception when\r\n // not in Syntax-Check mode\r\n else if ( !inSyntaxCheckMode() ) {\r\n\r\n // returned object is null, so throw an Exception\r\n String str = \"Executing the Command Line\\n\" + CommandLine + \"\\n\";\r\n str += \"did not return a valid object. Please check the Command Line.\\n\";\r\n\r\n throw new ScriptException(str);\r\n }\r\n }\r\n\r\n\r\n // perform Syntax-Checks here\r\n if (inSyntaxCheckMode()) {\r\n \r\n // these commands are only executed during Syntax-Check mode\r\n \r\n /* if (...) {\r\n String str = \"Descriptive Text.\\n\";\r\n\r\n throw new DataFormatException(str);\r\n }*/\r\n \r\n // Syntax check for a String value defined in a List\r\n // consider if it makes sense to define the list in iC.properties\r\n // see LakeshoreTC.checkInputChannel for an example\r\n /*final List<String> NEW_LIST =\r\n Arrays.asList(\"A\", \"B\", \"C\"); // the entries need to be in uppercase letters!\r\n if ( !NEW_LIST.contains(YourVariableToCheck.toUpperCase()) ) {\r\n String str = \"YourVariableToCheck '\" + YourVariableToCheck + \"' is not valid.\";\r\n str += \"Please select a value from:\\n \" + NEW_LIST.toString() + \".\\n\";\r\n throw new DataFormatException(str);\r\n }*/\r\n\r\n // Range check for a Float value defined in a List\r\n // consider if it makes sense to define the list in iC.properties\r\n /* final List<Float> YOUR_RANGE = Arrays.asList(-100f, 100f);\r\n\r\n if (YourVariableToCheck < YOUR_RANGE.get(0) || YourVariableToCheck > YOUR_RANGE.get(1)) {\r\n String str = \"The zyx value is out of range.\\n\"\r\n + \"Please select a value between \" + YOUR_RANGE.toString() + \".\\n\";\r\n throw new DataFormatException(str);\r\n }*/\r\n \r\n // return if in Syntax-Check mode\r\n return;\r\n }\r\n \r\n\r\n \r\n // exit if in No-Communication-Mode\r\n if (inNoCommunicationMode())\r\n return;\r\n\r\n\r\n\r\n // insert code to perform the desired task\r\n // for instance open files, calculate intermediate values, etc.\r\n\r\n\r\n\r\n //////////////////\r\n // query a command\r\n\r\n // build the GPIB command\r\n String cmd = String.format(Locale.US, \"COMMAND 1, %.3f\", Param1);\r\n\r\n // add the boolean value\r\n cmd += (Param2 ? \"ON\" : \"OFF\");\r\n\r\n\r\n\r\n // if new code requires to wait until a certain criteria is met, the\r\n // following while-loop can be used\r\n boolean Done = false;\r\n while ( !Done && !m_StopScripting) {\r\n\r\n // check for pause button\r\n isPaused(true);\r\n\r\n\r\n // query the command\r\n String ans = QueryInstrument(cmd);\r\n\r\n\r\n /* Convert to float\r\n * Using the predefined conversion routine is useful, because\r\n * it throws a ScriptException when the conversion fails.\r\n */\r\n dummy = getFloat(ans);\r\n\r\n\r\n // do something useful with dummy\r\n\r\n\r\n // check if the Instrument's answer is what we want it to be\r\n // to exit the method\r\n if (dummy == Param1) {\r\n Done = true;\r\n }\r\n }\r\n\r\n\r\n // if new code requires to start a new task, the following anonymous\r\n // inner class can be used. Ensure that the task terminates itself\r\n // upon the Stop signal.\r\n // See iC_Instrument.MonitorChart() for a working example displaying\r\n // data in a chart.\r\n\r\n /**\r\n * Implement a new class from an anonymous inner class that extends\r\n * Thread and implements run(), in which the actual job is done.<p>\r\n *\r\n * The thread pauses, respectively, stops when <code>m_Paused</code>, respectively,\r\n * <code>m_StopScripting</code> is true.\r\n */\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"myThread as anonymous inner class\">\r\n class myThread extends Thread {\r\n\r\n // member variables\r\n public String m_dummy;\r\n\r\n /** Constructor */\r\n public myThread(String dummy) {\r\n // assign the passed values\r\n m_dummy = dummy;\r\n }\r\n\r\n\r\n @Override\r\n public void run() {\r\n // local variables\r\n float dummy = 0.0f;\r\n\r\n // Display a status message\r\n m_GUI.DisplayStatusMessage(\"Starting the thread.\\n\");\r\n\r\n // do until the thread should be stopped\r\n while ( m_StopScripting == false) {\r\n\r\n // check for pause button\r\n isPaused(true);\r\n\r\n // do something useful here\r\n\r\n\r\n // wait the desired time\r\n try { Thread.sleep( 500 ); } catch (InterruptedException ignore) {}\r\n }\r\n\r\n // clean up the thread\r\n\r\n\r\n // Display a status message\r\n m_GUI.DisplayStatusMessage(\"Thread stopped.\\n\");\r\n }\r\n }//</editor-fold>\r\n\r\n\r\n // make a new thread object\r\n myThread myT = new myThread(\"Love All, Serve All\");\r\n\r\n // start the thread and return\r\n myT.start();\r\n }", "public interface ExecFunctionFakeThisSupported extends ExecCallable {\n\t//\n}", "private static void loadFunctions(List<String> cleanFunctionNames, String functionsPackageName) {\n for (String functionName : cleanFunctionNames) {\n String classPath = functionsPackageName + \".\" + functionName;\n\n try {\n Class[] params = {};\n\n Callable callable = (Callable) Class.forName(classPath).getDeclaredConstructor(params).newInstance();\n\n FunctionLoader.callable.put(functionName.toLowerCase(), callable);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "ProcessTaskFactory<T> runAsCommand();", "abstract void exec();", "Script createScript();", "public abstract @Nullable Function getFunction(@NotNull String functionName);", "public void runFile(String filename) {\n }", "public static void main(String[] args) {\n\n List<String> functionArgumentOfA = new ArrayList<>();\n functionArgumentOfA.add(\"Boolean\");\n functionArgumentOfA.add(\"Integer\");\n functionArgumentOfA.add(\"Integer\");\n\n Function functionA = new Function(\"A\", false, functionArgumentOfA);\n\n\n List<String> functionArgumentOfB = new ArrayList<>();\n functionArgumentOfB.add(\"Integer\");\n functionArgumentOfB.add(\"Integer\");\n functionArgumentOfB.add(\"Integer\");\n\n Function functionB = new Function(\"B\", false, functionArgumentOfB);\n\n List<String> functionArgumentOfC = new ArrayList<>();\n functionArgumentOfC.add(\"Integer\");\n\n Function functionC = new Function(\"C\", true, functionArgumentOfC);\n\n FunctionSearchPlugin searchPlugin = new FunctionSearchPlugin();\n\n List<Function> functions = new ArrayList<>();\n\n functions.add(functionA);\n functions.add(functionB);\n functions.add(functionC);\n\n searchPlugin.register(functions);\n //Search for functions now\n //Integer, Integer, Integer should return B and C\n\n List<String> firstSearch = new ArrayList<>();\n firstSearch.add(\"Integer\");\n firstSearch.add(\"Integer\");\n firstSearch.add(\"Integer\");\n\n List<Function> searchResponse = searchPlugin.searchFunctions(firstSearch);\n System.out.format(\"Query: %s\", String.join(\", \", firstSearch) + \"\\n\");\n System.out.println(\"Response: \");\n printFunctionSignature(searchResponse);\n\n\n List<String> secondSearch = new ArrayList<>();\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n\n searchResponse = searchPlugin.searchFunctions(secondSearch);\n System.out.format(\"Query: %s\", String.join(\", \", secondSearch) + \"\\n\");\n System.out.println(\"Response: \");\n printFunctionSignature(searchResponse);\n\n }", "void execute(Executable executable);", "PivotFunctions createPivotFunctions();", "OpFunctionArg createOpFunctionArg();", "private void jetFunctions(){\n\t\tInvokeExpr invokeExpr = (InvokeExpr) rExpr;\n\t\tSootMethodRef methodRef = invokeExpr.getMethodRef();\n\t\t\n\t\t//if this is a java.lang.String.func, we don't need to declare it\n\t\tif(StringModeling.stringMethods.contains(methodRef.getSignature())){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString funStr = constructFunStr(invokeExpr);\n\t\tType thisType = null;\n\t\tif(!fileGenerator.getDeclaredFunctions().contains(funStr)){\n\t\t\tif(invokeExpr instanceof StaticInvokeExpr){\n\t\t\t\twriter.println(Z3MiscFunctions.v().getFuncDeclareStmt(funStr, thisType,\n\t\t\t\t\t\tmethodRef.parameterTypes(), methodRef.returnType()));\n\t\t\t}else{\n\t\t\t\tif(invokeExpr instanceof InterfaceInvokeExpr){\n\t\t\t\t\tthisType = ((InterfaceInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}else if(invokeExpr instanceof SpecialInvokeExpr){\n\t\t\t\t\tthisType = ((SpecialInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}else if(invokeExpr instanceof VirtualInvokeExpr){\n\t\t\t\t\tthisType = ((VirtualInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}\n\t\t\t\twriter.println(Z3MiscFunctions.v().getFuncDeclareStmt(funStr, thisType,\n\t\t\t\t\t\tmethodRef.parameterTypes(), methodRef.returnType()));\n\t\t\t}\n\t\t\tfileGenerator.getDeclaredFunctions().add(funStr);\n\t\t}\n\t}", "@Override\n public void execute(AbstractVFSApplication application)\n throws CommandException\n {\n switch (args.length)\n {\n case 1:\n {\n application.setCurrent((VDirectory) resolve(application, VDisk.PATH_SEPARATOR));\n break;\n }\n case 2:\n {\n int expr = args.length - 1;\n\n for (int i = 1; i < args.length; i++)\n {\n if (args[i].equals(AbstractVFSCommand.OPTION_H) || args[i].equals(AbstractVFSCommand.OPTION_HELP))\n {\n help();\n break;\n } else\n {\n expr = Math.min(i, expr);\n }\n }\n\n VObject destination = resolve(application, args[expr]);\n if (destination != null && destination instanceof VDirectory)\n {\n application.setCurrent((VDirectory) destination);\n break;\n }\n }\n default:\n {\n usage();\n break;\n }\n }\n }", "public void myProgram();", "IFunctionLibrary getFunctionLibrary();", "protected Program(String fileName, \n Map<FunctionSignature,FunctionLike> fileFunctions,\n Map<Type, DataDeclaration> structDecs,\n List<Expr> exprList) {\n \n this.fileName = fileName;\n this.fileFunctions = fileFunctions;\n this.structDecs = structDecs;\n this.exprList = exprList;\n }", "public abstract AbstractFunction getFunction(String name) throws BadAlloc;", "public UpdateUDFRequest() {\n this( null, null);\n }", "public static void main(String[] args) {\n\t\tmyFunction();\r\n\t\t\r\n\r\n\t}", "@Override\n public AlgorithmProcess createProcess() {\n return new FileLoaderProcess(file);\n }", "public void defineFunction(String prefix, String function, String className, String methodName)\n/* */ throws ClassNotFoundException, NoSuchMethodException\n/* */ {\n/* 87 */ if ((prefix == null) || (function == null) || (className == null) || (methodName == null))\n/* */ {\n/* 89 */ throw new NullPointerException(Util.message(this.context, \"elProcessor.defineFunctionNullParams\", new Object[0]));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 94 */ Class<?> clazz = this.context.getImportHandler().resolveClass(className);\n/* */ \n/* 96 */ if (clazz == null) {\n/* 97 */ clazz = Class.forName(className, true, \n/* 98 */ Thread.currentThread().getContextClassLoader());\n/* */ }\n/* */ \n/* 101 */ if (!Modifier.isPublic(clazz.getModifiers())) {\n/* 102 */ throw new ClassNotFoundException(Util.message(this.context, \"elProcessor.defineFunctionInvalidClass\", new Object[] { className }));\n/* */ }\n/* */ \n/* */ \n/* 106 */ MethodSignature sig = new MethodSignature(this.context, methodName, className);\n/* */ \n/* */ \n/* 109 */ if (function.length() == 0) {\n/* 110 */ function = sig.getName();\n/* */ }\n/* */ \n/* 113 */ Method[] methods = clazz.getMethods();\n/* 114 */ for (Method method : methods) {\n/* 115 */ if (Modifier.isStatic(method.getModifiers()))\n/* */ {\n/* */ \n/* 118 */ if (method.getName().equals(sig.getName())) {\n/* 119 */ if (sig.getParamTypeNames() == null)\n/* */ {\n/* */ \n/* 122 */ this.manager.mapFunction(prefix, function, method);\n/* 123 */ return;\n/* */ }\n/* 125 */ if (sig.getParamTypeNames().length == method.getParameterTypes().length)\n/* */ {\n/* */ \n/* 128 */ if (sig.getParamTypeNames().length == 0) {\n/* 129 */ this.manager.mapFunction(prefix, function, method);\n/* 130 */ return;\n/* */ }\n/* 132 */ Class<?>[] types = method.getParameterTypes();\n/* 133 */ String[] typeNames = sig.getParamTypeNames();\n/* 134 */ if (types.length == typeNames.length) {\n/* 135 */ boolean match = true;\n/* 136 */ for (int i = 0; i < types.length; i++) {\n/* 137 */ if ((i == types.length - 1) && (method.isVarArgs())) {\n/* 138 */ String typeName = typeNames[i];\n/* 139 */ if (typeName.endsWith(\"...\")) {\n/* 140 */ typeName = typeName.substring(0, typeName.length() - 3);\n/* 141 */ if (!typeName.equals(types[i].getName())) {\n/* 142 */ match = false;\n/* */ }\n/* */ } else {\n/* 145 */ match = false;\n/* */ }\n/* 147 */ } else if (!types[i].getName().equals(typeNames[i])) {\n/* 148 */ match = false;\n/* 149 */ break;\n/* */ }\n/* */ }\n/* 152 */ if (match) {\n/* 153 */ this.manager.mapFunction(prefix, function, method);\n/* 154 */ return;\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* 161 */ throw new NoSuchMethodException(Util.message(this.context, \"elProcessor.defineFunctionNoMethod\", new Object[] { methodName, className }));\n/* */ }", "public static void main(String[] args){\t \n\t FunctionTest ft = ()-> System.out.println(\"Hola Mundo\");\n ft.saludar();\n\t}", "static public ColumnDataCalculator createDataCalc(String cmd)\n {\n Class cls = (Class) calcsClasses.get(cmd);\n if(cls == null)\n {\n try\n {\n cls = Class.forName(cmd);\n addColumnDataCalc(cmd, cls);\n }\n catch(ClassNotFoundException e)\n {\n return null;\n }\n }\n\n try\n {\n return (ColumnDataCalculator) cls.newInstance();\n }\n catch(Exception e)\n {\n throw new RuntimeException(e.toString());\n }\n }", "UOp createUOp();", "@FunctionalInterface\r\npublic interface Command {\r\n\tpublic void execute();\r\n}", "R execute();", "public static String parseCommand(final String[] commandLineArguments) throws ClassNotFoundException, SQLException{ \n \t\t\n \t\tString result = \"\";\n \t\t\t\n \t\tString commandName = \"upload divergence\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = uploadCommand(commandLineArguments, \"updiv\");\n \t\t}\n \t\t\t\n \t\tcommandName = \"updiv\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = uploadCommand(commandLineArguments, \"updiv\");\n \t\t}\n \t\t\n \t\tcommandName = \"upload annotation\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = uploadCommand(commandLineArguments, \"upano\");\n \t\t}\n \t\t\n \t\tcommandName = \"upano\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = uploadCommand(commandLineArguments, \"upano\");\n \t\t}\n \t\t\n \t\tcommandName = \"afs\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = vcfCommand(commandLineArguments);\n \t\t}\n \t\t\n \t\tcommandName = \"allele frequency spectra\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = vcfCommand(commandLineArguments);\n \t\t}\n \t\t\n \t\tcommandName = \"delete\";\n \t\tif (isTheCommandName(commandLineArguments, commandName)){\t\t\t\t\t\t\n \t\t\treturn deleteCommand(commandLineArguments);\n \t\t}\n \t\t\n \t\tcommandName = \"view\";\n \t\tif(isTheCommandName(commandLineArguments, commandName)){\n \t\t\treturn viewCommand(commandLineArguments);\n \t\t}\n \t\t\n \t\tcommandName = \"create filter\";\n \t\tif(isTheCommandName(commandLineArguments, commandName)){\n \t\t\tcreateFilterLoop(commandLineArguments);\n \t\t}\n \t\t\n \t\tcommandName = \"crefil\";\n \t\tif(isTheCommandName(commandLineArguments, commandName)){\n \t\t\tcreateFilterLoop(commandLineArguments);\n \t\t}\n \t\t\n \t\tcommandName = \"filter\";\n \t\tif(isTheCommandName(commandLineArguments, commandName)){\n \t\t\tresult = filterCommand(commandLineArguments);\n \t\t}\n \t\t\n \t\treturn result;\n \t}", "public String getMode() { return \"FUNC\"; }", "private CodeFragment callFunc(List<AlangParser.ExpressionContext> expressions, Function f) {\n CodeFragment result = new CodeFragment();\n\n ST template;\n if (f.returntype.equals(Types.LLVMVOID)) {\n template = this.group.getInstanceOf(\"voidfunccall\");\n } else {\n template = this.group.getInstanceOf(\"funccall\");\n result.setRegister(this.generateNewRegister(false));\n template.add(\"reg\", result.getRegister());\n template.add(\"type\", f.returntype);\n if (f.returntype.equals(Types.LLVMZNAK)){\n result.setCharRegister();\n }\n }\n\n template.add(\"name\", f.name);\n\n for (int i = 0; i < expressions.size(); i++) {\n CodeFragment expr = visit(expressions.get(i));\n result.addCode(expr);\n if (i == 0)\n template.add(\"args\", f.args.get(i) + \" \" + expr.getRegister());\n else\n template.add(\"args\", \", \" + f.args.get(i) + \" \" + expr.getRegister());\n\n String exprtext = expressions.get(i).getText();\n if (this.globals.containsKey(exprtext)) {\n this.addError(expressions.get(i), exprtext, \"Cannot pass global array to function\");\n return new CodeFragment(\"\");\n }\n\n /* if we are passing whole array to function, pass also its dimensions */\n if (this.vars.get(this.scope).containsKey(exprtext)) {\n Variable v = this.vars.get(this.scope).get(exprtext);\n for (int j = 0; j < v.levelregs.size(); j++) {\n String finalreg = v.levelregs.get(j);\n if (!v.isLocalArray) {\n finalreg = this.generateNewRegister(false);\n result.addCode(String.format(\"%s = load i32, i32* %s\\n\", finalreg, v.levelregs.get(j)));\n }\n template.add(\"args\", \", i32 \" + finalreg);\n }\n }\n }\n\n result.addCode(template.render() + \"\\n\");\n return result;\n }", "public NativeExecutable(String command, GenerationScript generated) {\n this.command = command;\n this.generated = generated;\n }", "public synchronized static void executeCommand(String command) {\n\n command = command.toLowerCase();\n //System.out.println(command);\n\n if(command.startsWith(\"open\") || command.startsWith(\"read\")) {\n String filename = command.substring(command.indexOf(' ')).trim();\n // check if the file name is valid, if not, try prepend working directory to it\n if(!new File(filename).exists()) {\n filename = SystemSettings.getWorkingDir() + File.separator + filename;\n }\n\n if(!new File(filename).exists()) {\n UIMain.getUIMessage().setMessage(filename + \" not found\");\n }\n else {\n createPatternImage(filename);\n }\n }\n else if(command.startsWith(\"ac\")) { // to display actual image size\n try {\n UIMain.resizeToHeight(currentPattern.getHeight());\n UIMain.setMessage(\"data w, h: \" + currentPattern.getWidth() + \", \" + currentPattern.getHeight());\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n }\n else if(command.startsWith(\"f\")) { // to display image to fit to current window\n try {\n UIMain.resizeToFit();\n UIMain.setMessage(\"display w, h: \" + UIMain.getUIPattern().getWidth() + \", \" + UIMain.getUIPattern().getHeight());\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n }\n else if(command.startsWith(\"h\") || command.startsWith(\"w\")) { // display to height, width\n try {\n int size = Integer.parseInt(command.substring(command.indexOf(' ')).trim());\n if(command.charAt(0) == 'w') {\n size /= currentPattern.getAspectRatio();\n }\n UIMain.resizeToHeight(size);\n UIMain.setMessage(\"display w, h: \" + UIMain.getUIPattern().getWidth() + \", \" + UIMain.getUIPattern().getHeight());\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n }\n else if(command.startsWith(\"o\")) { // scale data to original image size\n try {\n currentPattern.scaleToOriginal();\n UIMain.setMessage(\"data w, h: \" + currentPattern.getWidth() + \", \" + currentPattern.getHeight());\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n } \n else if(command.startsWith(\"au\")) { // scale data to current window size\n try {\n currentPattern.scaleFit();\n UIMain.setMessage(\"data w, h: \" + currentPattern.getWidth() + \", \" + currentPattern.getHeight());\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n } \n else if(command.startsWith(\"r\")) { // rotate\n try {\n double degree = Double.parseDouble(command.substring(command.indexOf(' ')).trim());\n currentPattern.rotateData(degree);\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n }\n else if(command.startsWith(\"sc\")) { // scroll\n try {\n UIMain.scrollPattern();\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n }\n else if(command.startsWith(\"pwd\")) {\n try {\n UIMain.getUIMessage().setMessage(SystemSettings.getWorkingDir());\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n }\n }", "private void createFPdataProc(Code32 code, int opCode, int cond, int Vd, int Vn, int Vm, boolean single) {\r\n\t\tif (opCode == armVmov && (Vd == Vm)) return;\t// mov Vx, Vx makes no sense\t\r\n\t\tcode.instructions[code.iCount] = (cond << 28) | opCode;\r\n\t\tif (single) code.instructions[code.iCount] |= (((Vd>>1)&0xf) << 12) | ((Vd&1) << 22) | (((Vn>>1)&0xf) << 16) | ((Vn&1) << 7) | ((Vm>>1)&0xf) | ((Vm&1) << 5);\r\n\t\telse code.instructions[code.iCount] |= (1 << 8) | ((Vd&0xf) << 12) | ((Vd>>4) << 22) | ((Vn&0xf) << 16) | ((Vn>>4) << 7) | (Vm&0xf) | ((Vm>>4) << 5);\r\n\t\tcode.incInstructionNum();\r\n\t}", "final public void function() throws ParseException {\n String name = \"\";\n LinkedList<String> params = new LinkedList<String>();\n jj_consume_token(TO);\n jj_consume_token(VARIABLE);\n name = token.image;\n label_8:\n while (true) {\n if (jj_2_44(4)) {\n ;\n } else {\n break label_8;\n }\n jj_consume_token(PARAM);\n params.add(token.image);\n }\n //retorna el viejo valor (si ya habia uno con esa misma key) y null si es la primera vez que se inserta.\n if(functions.put(name,params)!=null) {\n {if (true) throw new ParseException(\"La funcion: \"+ name +\" ya fue previamente definida.\");}\n }\n funparams = params;\n label_9:\n while (true) {\n if (jj_2_45(4)) {\n ;\n } else {\n break label_9;\n }\n jj_consume_token(34);\n }\n jj_consume_token(OUTPUT);\n label_10:\n while (true) {\n if (jj_2_46(4)) {\n ;\n } else {\n break label_10;\n }\n jj_consume_token(34);\n }\n command(salidaS);\n label_11:\n while (true) {\n if (jj_2_47(4)) {\n ;\n } else {\n break label_11;\n }\n jj_consume_token(34);\n }\n jj_consume_token(END);\n funparams = null;\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 }", "protected FunctionPriority createFunctionPrioritizer() {\n final String functionPriorities = getCommandLine().getOptionValue(FUNCTION_PRIORITY_OPTION);\n if (functionPriorities != null) {\n try {\n final Class<?> functionPrioritiesClass = ClassUtils.loadClass(functionPriorities);\n Object prioritiesObject = functionPrioritiesClass.newInstance();\n if (prioritiesObject instanceof InitializingBean) {\n ((InitializingBean) prioritiesObject).afterPropertiesSet();\n }\n if (prioritiesObject instanceof FactoryBean) {\n prioritiesObject = ((FactoryBean<?>) prioritiesObject).getObject();\n }\n if (prioritiesObject instanceof FunctionPriority) {\n return (FunctionPriority) prioritiesObject;\n }\n } catch (final Exception e) {\n throw new OpenGammaRuntimeException(\"Error loading function priorities\", e);\n }\n }\n return new FunctionPriority() {\n @Override\n public int getPriority(final CompiledFunctionDefinition function) {\n return 0;\n }\n };\n }", "void main(CommandLine cmd);", "public static void openFileForOutput(String ID, String file, Function function,\n DawnParser parser) throws DawnRuntimeException\n {\n if (!isFileAvailable(ID, parser))\n {\n try\n {\n parser.setProperty(\"DAWN.IO#FILE.\" + ID, new BufferedWriter(new FileWriter(\n DawnUtilities.constructPath(file))));\n } catch (IOException ioe) {\n throw new DawnRuntimeException(function, parser, \"file \" + file + \" not found\");\n }\n } else\n throw new DawnRuntimeException(function, parser, \"file ID \" + ID + \" already exists\");\n }", "private void exec(String inputFile, String outputPath) {\n\t\tRuntime runtime = Runtime.getRuntime();\n\t\tString[] args = {\"java\", \"-jar\",freelingpath,freelingconf, outputPath, inputFile};\n\t\ttry {\n\t\t\tProcess p = runtime.exec(args);\n\t\t\tp.waitFor();\n\t\t\t//System.out.println(p.exitValue());\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}", "FileReference createFile(String fileName, String toolId);", "public Object executeScript(String command);", "public interface UtilityFunction {\n\t\n\t/**\n\t * Get the perceived utility, given a consumption plan\n\t * \n\t * @param consumption the allocation given to the user\n\t * @return perceivedUtility quantitative measure of the utility\n\t */\n\tpublic double getUtility(double consumption);\n\t\n\t/**\n\t * Get the marginal utility evaluated in the point given in input\n\t * <br>\n\t * Starting from the function U(c) this\n\t * returns:\n\t * <br>\n\t * du(c)/dc\n\t * \n\t * @param consumptionAllocation the allocation given to the user\n\t * @return derivative representing marginal utility\n\t */\n\tpublic double getPartialDerviative(double consumptionAllocation);\n\t\n\t/**\n\t * Returns dimension of utility function domain\n\t * \n\t * @return n the domain dimension\n\t */\n\tpublic default int getDimension() {\n\t\treturn 1;\n\t};\n\n}", "public static void main(String[] args) {\n\t\tFunctionInterface<?,Integer> imp = (a,b) -> a+b;\n\t\tSystem.out.println(imp.add(3, 5));\n\t\t//使用系统提供的functional interface\n\t\t//BiFunction<Integer,String,Long> sub = (a,b) -> System.out.println(b + a);\n\t}", "public RunProcDefJob() {\n\t}", "CatalogFunction getFunction(ObjectPath functionPath)\n throws FunctionNotExistException, CatalogException;", "@Override\n\tpublic CommandFunction getNewFunction() {\n\t\treturn new txnscript();\n\t}", "UserFunction getUserFunctions(int index);", "public void run(Object options);", "private String exec(String cmd, File ws, String errorMessage) throws IOException, ProcessingException {\n listener.info(\"Executing: \"+cmd);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n int r = new Proc(cmd, null, baos, ws).join();\n if(r!=0) {\n listener.info(baos.toString());\n throw new ProcessingException(errorMessage);\n }\n return baos.toString();\n }", "FunDef resolve(\n Exp[] args,\n Validator validator,\n List<Conversion> conversions);", "static <T> Function<T,SibillaValue> apply(UnaryOperator<SibillaValue> op, Function<T,SibillaValue> f1) {\n return arg -> op.apply(f1.apply(arg));\n }", "Commands createCommands();", "public void initFunction(IConnectionServer con, IAclManager aclm, UserInformation user, String[] functionInit) throws MorseException {\n\t\t\r\n\t}" ]
[ "0.55520785", "0.54573", "0.5243005", "0.5220597", "0.4991785", "0.49780193", "0.4960765", "0.49580792", "0.4929435", "0.48982698", "0.4796806", "0.47497916", "0.47070163", "0.4703113", "0.4671856", "0.46669257", "0.464111", "0.46379992", "0.46150652", "0.46124333", "0.45631412", "0.45553276", "0.44997883", "0.44995683", "0.4495866", "0.44880337", "0.448778", "0.44569546", "0.44477457", "0.44433564", "0.4435868", "0.4434821", "0.44321942", "0.44202957", "0.43956006", "0.43778026", "0.4365549", "0.43605915", "0.43605146", "0.4350212", "0.4347487", "0.43297085", "0.43274423", "0.43231663", "0.43207023", "0.43196994", "0.43159512", "0.43124208", "0.4303575", "0.42994887", "0.42960694", "0.42947558", "0.42914683", "0.4282781", "0.4281607", "0.42701676", "0.42690143", "0.426537", "0.4261725", "0.4260275", "0.42546535", "0.42521352", "0.42509183", "0.4246698", "0.42438483", "0.42404154", "0.4240187", "0.42321816", "0.4224507", "0.42169136", "0.4211775", "0.41956058", "0.41949624", "0.41939762", "0.41915536", "0.4185385", "0.41846308", "0.4179293", "0.41754374", "0.41719723", "0.416293", "0.41628036", "0.4161879", "0.41560158", "0.4146835", "0.41401583", "0.41342488", "0.41310424", "0.41297054", "0.41271904", "0.4126607", "0.41255724", "0.41241062", "0.41228333", "0.41208023", "0.41178152", "0.41164607", "0.4112544", "0.41095367", "0.41040328", "0.41036713" ]
0.0
-1
Creates a new projection of an existing table. A projection represents a subset of the columns (potentially including derived columns) of a table.
public CreateProjectionResponse createProjection(CreateProjectionRequest request) throws GPUdbException { CreateProjectionResponse actualResponse_ = new CreateProjectionResponse(); submitRequest("/create/projection", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "QueryProjection<R> getProjection();", "public static TempTable projection(Table table, ArrayList<FieldDefinition> fieldList) throws ProcessorException {\n\t\ttry {\n\t\t\t\n\t\t\t// Remove unwanted fields\n\t\t\tint numFields = fieldList.size();\n\t\t\tTempTable result = new TempTable(table.getDatabase());\n\t\t\tfor (FieldDefinition fd : table.getFields()) {\n\t\t\t\tif (numFields > 0) {\n\t\t\t\t\tfor (FieldDefinition f : fieldList) {\n\t\t\t\t\t\tif (f.getFullStringCode().equals(fd.getFullStringCode())) {\n\t\t\t\t\t\t\tresult.addField(fd);\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\t\n\t\t\t// Create and load definition into memory\n\t\t\tresult.create();\n\t\t\t\n\t\t\t// Copy rows\n\t\t\tArrayList<Tuple> rows = table.getTuples2();\n\t\t\tif (rows.size() > 0) {\n\t\t\t\t\n\t\t\t\tClass<?> tupleDef = rows.get(0).getData().getClass();\n\t\t\t\tField[] fieldDefs = tupleDef.getFields();\n\t\t\t\t\n\t\t\t\tClass<?> newDef = result.getDefinition();\n\t\t\t\t\n\t\t\t\tfor (Tuple row : rows) {\n\t\t\t\t\tTableDefinition origData = row.getData();\n\t\t\t\t\tTableDefinition newData = (TableDefinition) newDef.newInstance();\n\t\t\t\t\t\n\t\t\t\t\tfor (Field fd : fieldDefs) {\n\t\t\t\t\t\tString fieldName = fd.getName();\n\t\t\t\t\t\tObject fieldValue = fd.get(origData);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (numFields > 0) {\n\t\t\t\t\t\t\tfor (FieldDefinition f : fieldList) {\n\t\t\t\t\t\t\t\tif (f.getFullStringCode().equals(fieldName)) {\n\t\t\t\t\t\t\t\t\tnewDef.getField(fieldName).set(newData, fieldValue);\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}\n\t\t\t\t\t\n\t\t\t\t\tTuple newTuple = new Tuple(result);\n\t\t\t\t\tnewTuple.setData(newData);\n\t\t\t\t\tresult.insertTuple(newTuple);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn result;\n\t\t\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | IllegalArgumentException | NoSuchFieldException | SecurityException e) {\n\t\t\tthrow new ProcessorException(\"Failed to perform projection: \" + e);\n\t\t\t\n\t\t}\n\t}", "public final ProjectionParser.projection_return projection() throws RecognitionException {\n ProjectionParser.projection_return retval = new ProjectionParser.projection_return();\n retval.start = input.LT(1);\n\n\n Object root_0 = null;\n\n Token string_literal1=null;\n Token string_literal2=null;\n Token IDENT3=null;\n Token char_literal4=null;\n Token char_literal5=null;\n Token string_literal6=null;\n Token char_literal7=null;\n Token string_literal8=null;\n Token string_literal9=null;\n Token char_literal10=null;\n ProjectionParser.column_return c =null;\n\n\n Object string_literal1_tree=null;\n Object string_literal2_tree=null;\n Object IDENT3_tree=null;\n Object char_literal4_tree=null;\n Object char_literal5_tree=null;\n Object string_literal6_tree=null;\n Object char_literal7_tree=null;\n Object string_literal8_tree=null;\n Object string_literal9_tree=null;\n Object char_literal10_tree=null;\n\n try {\n // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:30:3: ( 'PROJECTION' | 'TABLE' IDENT '(' c= column ( ',' c= column )* ( 'hitType' '=' ( 'DAILY' | 'HOURLY' ) )* ')' )\n int alt4=2;\n int LA4_0 = input.LA(1);\n\n if ( (LA4_0==20) ) {\n alt4=1;\n }\n else if ( (LA4_0==23) ) {\n alt4=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 4, 0, input);\n\n throw nvae;\n\n }\n switch (alt4) {\n case 1 :\n // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:30:3: 'PROJECTION'\n {\n root_0 = (Object)adaptor.nil();\n\n\n string_literal1=(Token)match(input,20,FOLLOW_20_in_projection75); \n string_literal1_tree = \n (Object)adaptor.create(string_literal1)\n ;\n adaptor.addChild(root_0, string_literal1_tree);\n\n\n }\n break;\n case 2 :\n // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:30:16: 'TABLE' IDENT '(' c= column ( ',' c= column )* ( 'hitType' '=' ( 'DAILY' | 'HOURLY' ) )* ')'\n {\n root_0 = (Object)adaptor.nil();\n\n\n string_literal2=(Token)match(input,23,FOLLOW_23_in_projection77); \n string_literal2_tree = \n (Object)adaptor.create(string_literal2)\n ;\n adaptor.addChild(root_0, string_literal2_tree);\n\n\n IDENT3=(Token)match(input,IDENT,FOLLOW_IDENT_in_projection79); \n IDENT3_tree = \n (Object)adaptor.create(IDENT3)\n ;\n adaptor.addChild(root_0, IDENT3_tree);\n\n\n retval.builder.setName((IDENT3!=null?IDENT3.getText():null));\n\n char_literal4=(Token)match(input,9,FOLLOW_9_in_projection94); \n char_literal4_tree = \n (Object)adaptor.create(char_literal4)\n ;\n adaptor.addChild(root_0, char_literal4_tree);\n\n\n pushFollow(FOLLOW_column_in_projection98);\n c=column();\n\n state._fsp--;\n\n adaptor.addChild(root_0, c.getTree());\n\n retval.builder.addColumn(c.col.build());\n\n // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:32:16: ( ',' c= column )*\n loop1:\n do {\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( (LA1_0==11) ) {\n alt1=1;\n }\n\n\n switch (alt1) {\n \tcase 1 :\n \t // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:32:17: ',' c= column\n \t {\n \t char_literal5=(Token)match(input,11,FOLLOW_11_in_projection118); \n \t char_literal5_tree = \n \t (Object)adaptor.create(char_literal5)\n \t ;\n \t adaptor.addChild(root_0, char_literal5_tree);\n\n\n \t pushFollow(FOLLOW_column_in_projection122);\n \t c=column();\n\n \t state._fsp--;\n\n \t adaptor.addChild(root_0, c.getTree());\n\n \t retval.builder.addColumn(c.col.build());\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop1;\n }\n } while (true);\n\n\n // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:33:12: ( 'hitType' '=' ( 'DAILY' | 'HOURLY' ) )*\n loop3:\n do {\n int alt3=2;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0==24) ) {\n alt3=1;\n }\n\n\n switch (alt3) {\n \tcase 1 :\n \t // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:34:13: 'hitType' '=' ( 'DAILY' | 'HOURLY' )\n \t {\n \t string_literal6=(Token)match(input,24,FOLLOW_24_in_projection153); \n \t string_literal6_tree = \n \t (Object)adaptor.create(string_literal6)\n \t ;\n \t adaptor.addChild(root_0, string_literal6_tree);\n\n\n \t char_literal7=(Token)match(input,12,FOLLOW_12_in_projection155); \n \t char_literal7_tree = \n \t (Object)adaptor.create(char_literal7)\n \t ;\n \t adaptor.addChild(root_0, char_literal7_tree);\n\n\n \t // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:34:27: ( 'DAILY' | 'HOURLY' )\n \t int alt2=2;\n \t int LA2_0 = input.LA(1);\n\n \t if ( (LA2_0==14) ) {\n \t alt2=1;\n \t }\n \t else if ( (LA2_0==17) ) {\n \t alt2=2;\n \t }\n \t else {\n \t NoViableAltException nvae =\n \t new NoViableAltException(\"\", 2, 0, input);\n\n \t throw nvae;\n\n \t }\n \t switch (alt2) {\n \t case 1 :\n \t // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:34:28: 'DAILY'\n \t {\n \t string_literal8=(Token)match(input,14,FOLLOW_14_in_projection158); \n \t string_literal8_tree = \n \t (Object)adaptor.create(string_literal8)\n \t ;\n \t adaptor.addChild(root_0, string_literal8_tree);\n\n\n \t retval.builder.setHitType(org.simplesql.om.ClientInfoTemplate.Projection.HIT_TYPE.DAILY);\n\n \t }\n \t break;\n \t case 2 :\n \t // /home/gvanvuuren/checkouts/SimpleSQL/om/src/main/antlr3/org.simplesql.om.projection/Projection.g:35:28: 'HOURLY'\n \t {\n \t string_literal9=(Token)match(input,17,FOLLOW_17_in_projection190); \n \t string_literal9_tree = \n \t (Object)adaptor.create(string_literal9)\n \t ;\n \t adaptor.addChild(root_0, string_literal9_tree);\n\n\n \t retval.builder.setHitType(org.simplesql.om.ClientInfoTemplate.Projection.HIT_TYPE.HOURLY);\n\n \t }\n \t break;\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop3;\n }\n } while (true);\n\n\n char_literal10=(Token)match(input,10,FOLLOW_10_in_projection209); \n char_literal10_tree = \n (Object)adaptor.create(char_literal10)\n ;\n adaptor.addChild(root_0, char_literal10_tree);\n\n\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public View projection(String projection) {\n setProjection(projection);\n return this;\n }", "@Projection(name = \"studentProjection\", types = Student.class)\npublic interface StudentProjection {\n String getName();\n\n Long getId();\n}", "@Test\n public void projection_and_twoColumns() {\n for (Tuple row : query().from(Constants.survey).select(new QIdName(Constants.survey.id, Constants.survey.name), Constants.survey.id, Constants.survey.name).fetch()) {\n Assert.assertEquals(3, row.size());\n Assert.assertEquals(IdName.class, row.get(0, Object.class).getClass());\n Assert.assertEquals(Integer.class, row.get(1, Object.class).getClass());\n Assert.assertEquals(String.class, row.get(2, Object.class).getClass());\n }\n }", "public Table copy(int[] subset) {\n\t\tTableImpl vt;\n\t\tint[] newsubset = this.resubset(subset);\n\n\t\t// Copy failed, maybe objects in a column that are not serializable.\n\t\tColumn[] cols = new Column[this.getNumColumns()];\n\t\tColumn[] oldcols = this.getColumns();\n\t\tfor (int i = 0; i < cols.length; i++) {\n\t\t\tcols[i] = oldcols[i].getSubset(newsubset);\n\t\t}\n\n\t\tvt = new MutableTableImpl(cols);\n\t\tvt.setLabel(this.getLabel());\n\t\tvt.setComment(this.getComment());\n\t\treturn vt;\n\t}", "PivotForClause createPivotForClause();", "Col createCol();", "public Table copy() {\n\t\tTableImpl vt;\n\n\t\t// Copy failed, maybe objects in a column that are not serializable.\n\t\tColumn[] cols = new Column[this.getNumColumns()];\n\t\tColumn[] oldcols = this.getColumns();\n\t\tfor (int i = 0; i < cols.length; i++) {\n\t\t\tcols[i] = oldcols[i].copy();\n\t\t}\n\t\tint[] newsubset = new int[subset.length];\n\t\tSystem.arraycopy(subset, 0, newsubset, 0, subset.length);\n\t\tvt = new SubsetTableImpl(cols, newsubset);\n\t\tvt.setLabel(this.getLabel());\n\t\tvt.setComment(this.getComment());\n\t\treturn vt;\n\t}", "@Override\n\t@Transactional\n\n\tpublic void initProjection() {\n\t\tdouble[] prices=new double[] {30,50,60,70,90,100};//\n\t\tvilleRepository.findAll().forEach(ville->{\n\t\tville.getCinemas().forEach(cinema->{\n\t\tcinema.getSalles().forEach(salle->{\n\t\tfilmRepository.findAll().forEach(film->{\n\t\tseanceRepository.findAll().forEach(seance->{\n\t\tProjection projection=new Projection();\n\t\tprojection.setDateProjection(new Date());\n\t\tprojection.setFilm(film);\n\t\tprojection.setPrix(prices[new Random().nextInt(prices.length)]);\n\t\tprojection.setSalle(salle);\n\t\tprojection.setSeance(seance);\n\t\tprojectionRepository.save(projection);\n\t\t});\n\t\t});\n\t\t});\n\t\t});\n\t\t});\n\t\t\n\t}", "public void setProjection(String projection) {\n this.projection = projection;\n }", "public static String[] columnProjection() {\n\n\t\treturn new String[]{KEY_ID, KEY_ADDRESS, KEY_NAME, KEY_VOLUME, KEY_POOL_LOCALE, KEY_FINISH, KEY_SANITIZER, KEY_PUMP_BRAND, KEY_PUMP_MODEL, KEY_FILTER, KEY_CLEANER_BRAND, KEY_CLEANER_MODEL, KEY_TRAFFIC, KEY_MIN_DEPTH, KEY_MAX_DEPTH, KEY_TILING, KEY_COVER, KEY_ATTACHED_SPA, KEY_HEATER, KEY_DIVING_BOARD, KEY_SLIDE, KEY_LADDER, KEY_FOUNTAINS, KEY_ROCK_WATERFALL, KEY_LIGHTS, KEY_INFINITY, KEY_SPORTING_EQUIPMENT, KEY_BEACH_ENTRY, KEY_SAND, KEY_IMAGE, KEY_WEATHER_NOTIFICATIONS, KEY_WATER_TEST_REMINDERS, KEY_FILTER_REMINDERS, KEY_SAFETY_NOTIFICATIONS, KEY_MAINTENANCE_REMINDERS, KEY_CUSTOM_NOTIFICATIONS, KEY_COUPON_NOTIFICATIONS};\n\t}", "public static String[] concreteColumnProjection() {\n\n\t\treturn new String[]{CONCRETE_ID, CONCRETE_ADDRESS, CONCRETE_NAME, CONCRETE_VOLUME, CONCRETE_POOL_LOCALE, CONCRETE_FINISH, CONCRETE_SANITIZER, CONCRETE_PUMP_BRAND, CONCRETE_PUMP_MODEL, CONCRETE_FILTER, CONCRETE_CLEANER_BRAND, CONCRETE_CLEANER_MODEL, CONCRETE_TRAFFIC, CONCRETE_MIN_DEPTH, CONCRETE_MAX_DEPTH, CONCRETE_TILING, CONCRETE_COVER, CONCRETE_ATTACHED_SPA, CONCRETE_HEATER, CONCRETE_DIVING_BOARD, CONCRETE_SLIDE, CONCRETE_LADDER, CONCRETE_FOUNTAINS, CONCRETE_ROCK_WATERFALL, CONCRETE_LIGHTS, CONCRETE_INFINITY, CONCRETE_SPORTING_EQUIPMENT, CONCRETE_BEACH_ENTRY, CONCRETE_SAND, CONCRETE_IMAGE, CONCRETE_WEATHER_NOTIFICATIONS, CONCRETE_WATER_TEST_REMINDERS, CONCRETE_FILTER_REMINDERS, CONCRETE_SAFETY_NOTIFICATIONS, CONCRETE_MAINTENANCE_REMINDERS, CONCRETE_CUSTOM_NOTIFICATIONS, CONCRETE_COUPON_NOTIFICATIONS};\n\t}", "UsingCols createUsingCols();", "@Test\n public void twoColumns_and_projection() {\n for (Tuple row : query().from(Constants.survey).select(Constants.survey.id, Constants.survey.name, new QIdName(Constants.survey.id, Constants.survey.name)).fetch()) {\n Assert.assertEquals(3, row.size());\n Assert.assertEquals(Integer.class, row.get(0, Object.class).getClass());\n Assert.assertEquals(String.class, row.get(1, Object.class).getClass());\n Assert.assertEquals(IdName.class, row.get(2, Object.class).getClass());\n }\n }", "public TableSlice(Table table, Selection rowSelection) {\n this.name = table.name();\n this.selection = rowSelection;\n this.table = table;\n }", "@Override\n protected ExactRelation rewriteWithPartition() {\n ExactRelation newSource = source.rewriteWithPartition();\n List<SelectElem> newElems = new ArrayList<SelectElem>();\n \n // Check if the newElems include star expressions. If so, we don't have to explicitly include\n // prob column and partition column.\n// boolean includeStar = false;\n \n for (SelectElem e : elems) {\n if (e.getExpr() instanceof StarExpr) {\n// includeStar = true;\n TableNameExpr tabExpr = ((StarExpr) e.getExpr()).getTab();\n List<ColNameExpr> col_names = source.getAssociatedColumnNames(tabExpr);\n for (ColNameExpr ce : col_names) {\n newElems.add(new SelectElem(vc, ce));\n }\n } else {\n newElems.add(e);\n }\n }\n \n // prob column (for point estimate and also for subsampling)\n newElems.add(new SelectElem(vc, source.tupleProbabilityColumn(), samplingProbabilityColumnName()));\n\n // partition column (for subsampling)\n newElems.add(new SelectElem(vc, newSource.partitionColumn(), partitionColumnName()));\n \n// // we manually insert the probability and partition (for subsampling) columns if the star expression\n// // is not placed on the table from which partition\n// if (includeStar == false) {\n// }\n\n ExactRelation r = new ProjectedRelation(vc, newSource, newElems);\n r.setAlias(getAlias());\n return r;\n\n // return rewriteWithPartition(false);\n }", "public TableSlice(Table table) {\n this.name = table.name();\n this.selection = null;\n this.table = table;\n }", "FromTable createFromTable();", "ColumnFull createColumnFull();", "FromTableJoin createFromTableJoin();", "@Override\n public DatabaseQueryColumn clone() {\n return new DatabaseQueryColumn(this.formula, this.name);\n }", "@Projection(name = \"experiencetaskinfo\", types = {ExperienceTask.class})\npublic interface ExperienceTaskProjection {\n\n int getId();\n\n String getName();\n\n int getExperience();\n\n String getDescription();\n\n int getLimitPeriod();\n\n int getLimitTimes();\n}", "public Table shallowCopy() {\n\t\tSubsetTableImpl vt =\n\t\t\tnew SubsetTableImpl(this.getColumns(), this.subset);\n\t\tvt.setLabel(getLabel());\n\t\tvt.setComment(getComment());\n\t\treturn vt;\n\t}", "private ProjectionOperation getVehicleProjection() {\n return project()\n .andInclude(bind(\"_id\", \"cars.vehicles.id\"))\n .andInclude(bind(\"make\", \"cars.vehicles.make\"))\n .andInclude(bind(\"model\", \"cars.vehicles.model\"))\n .andInclude(bind(\"year_model\", \"cars.vehicles.year\"))\n .andInclude(bind(\"price\", \"cars.vehicles.price\"))\n .andInclude(bind(\"licensed\", \"cars.vehicles.licensed\"))\n .andInclude(bind(\"date_added\", \"cars.vehicles.dateAdded\"))\n .andInclude(bind(\"warehouse\", \"name\"))\n .andInclude(bind(\"location\", \"cars.location\"))\n .andInclude(bind(\"latitude\", \"location.latitude\"))\n .andInclude(bind(\"longitude\", \"location.longitude\"));\n }", "public Cursor query(String[] Projection, String Selection, String[] SelectionArgs, String SortOrder){\n\n SQLiteQueryBuilder qb= new SQLiteQueryBuilder();\n qb.setTables(TableName);\n\n Cursor cursor=qb.query(sqlDB,Projection,Selection,SelectionArgs,null,null,SortOrder);\n return cursor;\n }", "pcols createpcols();", "ProjectionMode getProjectionMode();", "private RelationalTable convertTable(org.hibernate.mapping.Table mappedTable) {\n RelationalTable table = new RelationalTable(m_catalogSchema, getTableName(mappedTable));\n\n List<Column> columns = new ArrayList<>();\n List<RelationalIndex> indices = new ArrayList<>();\n\n @SuppressWarnings(\"unchecked\")\n Iterator<org.hibernate.mapping.Column> mappedColumns = mappedTable.getColumnIterator();\n int idx = 1;\n while (mappedColumns.hasNext()) {\n org.hibernate.mapping.Column mappedColumn = mappedColumns.next();\n Column column = convertColumn(mappedColumn, mappedTable, idx++);\n columns.add(column);\n if (mappedColumn.isUnique()) {\n indices.add(getUniqueIndex(table, column));\n }\n }\n\n table.setColumns(columns);\n\n Set<ForeignKey> fkeys = new HashSet<>();\n @SuppressWarnings(\"unchecked\")\n Iterator<org.hibernate.mapping.ForeignKey> mappedKeys = mappedTable.getForeignKeyIterator();\n while (mappedKeys.hasNext()) {\n convertForeignKey(mappedKeys.next(), fkeys);\n }\n\n table.setFks(fkeys);\n\n @SuppressWarnings(\"unchecked\")\n Iterator<Index> mappedIndices = mappedTable.getIndexIterator();\n\n while (mappedIndices.hasNext()) {\n indices.add(convertIndex(mappedIndices.next(), table));\n }\n\n @SuppressWarnings(\"unchecked\")\n Iterator<UniqueKey> mappedUniqueKeys = mappedTable.getUniqueKeyIterator();\n while (mappedUniqueKeys.hasNext()) {\n indices.add(convertIndex(mappedUniqueKeys.next(), table));\n }\n\n if (mappedTable.getPrimaryKey() != null) {\n indices.add(convertIndex(mappedTable.getPrimaryKey(), table));\n List<String> pkColumnNames = new ArrayList<>();\n @SuppressWarnings(\"unchecked\")\n Iterator<org.hibernate.mapping.Column> pkColumns = mappedTable.getPrimaryKey().getColumnIterator();\n while (pkColumns.hasNext()) {\n pkColumnNames.add(getColumnName(pkColumns.next()));\n }\n table.setPkColumns(pkColumnNames);\n }\n\n table.setIndices(indices);\n\n return table;\n }", "@Projection(name = \"reportProjection\", types = ItemEntity.class)\npublic interface ReportProjection {\n Integer getRecordNumber();\n\n String getFileName();\n\n String getType();\n\n Date getCreatedDate();\n\n String getInstitutionName();\n\n List<ReportDataEntity> getReportDataEntities();\n}", "ColumnOrAlias createColumnOrAlias();", "public FieldProjection(Class<F> returnType, Field f) {\r\n\t\t\tsuper();\r\n\t\t\tthis.returnType = returnType;\r\n\t\t\tthis.f = f;\r\n\t\t}", "@Override\n public SqlDatabaseTable select(SqlDatabaseTable table, List<SelectionRule> selectionRules) {\n StringBuilder sql = new StringBuilder();\n if (selectionRules.isEmpty()) {\n sql.append(\"SELECT 0 AS `id`\");\n } else {\n sql.append(\"SELECT 0 AS `id`\");\n for (int i = 0; i < selectionRules.size(); i++) {\n sql.append(\", \");\n SelectionRule rule = selectionRules.get(i);\n if (rule instanceof NullSelectionRule) {\n sql.append(\"NULL\");\n } else if (rule instanceof ConstantSelectionRule) {\n sql.append(\"'\").append(((ConstantSelectionRule) rule).getValue()).append(\"'\");\n } else if (rule instanceof VariableSelectionRule) {\n sql.append(\"`_\").append(((VariableSelectionRule) rule).getVariableIndex()).append(\"`\");\n }\n sql.append(\" AS `_\").append(i).append(\"`\");\n }\n sql.append(\" FROM \").append(table.getFullRef());\n }\n return new SqlDatabaseQueryTable(sql.toString(), selectionRules.size());\n }", "public Coordinates projection() {\n return projection;\n }", "public String getProjection() {\n return projection;\n }", "Column createColumn();", "public Project(final Operator op, final String column, final String table)\n\t{\n\t\tthis(op, new String[] { column }, new String[] { table });\n\t}", "public abstract DataTableDefinition clone();", "SelectQuery createSelectQuery();", "public static Table selectionOnTable(Expression expression, Table tableToApplySelectionOn) throws IOException, ParseException {\n\n\t\t//System.out.println(tableToApplySelectionOn.columnIndexMap);\n\t\t\n\t\t// if the where expression is null then we don't apply any operations on the table and just return the table as is\n\t\tif(expression == null)\n\t\t\treturn tableToApplySelectionOn;\n\t\t\n\t\t// this Table contains the resultant table, obtained after applying selection operation\n\t\tFile resultantTableFile = new File(tableToApplySelectionOn.tableDataDirectoryPath+System.getProperty(\"file.separator\") + tableToApplySelectionOn.tableName + \"|.tbl\");\n\t\tif(!resultantTableFile.exists())\n\t\t\tresultantTableFile.createNewFile();\n\t\t\n\t\tTable resultantTable = new Table(tableToApplySelectionOn.tableName + \"|\", \n\t\t\t\t\t\t\t\t\t\t tableToApplySelectionOn.noOfColumns,\n\t\t\t\t\t\t\t\t\t\t resultantTableFile,\n\t\t\t\t\t\t\t\t\t\t tableToApplySelectionOn.tableDataDirectoryPath);\n\n\t\t// initialize the column description list of the resultant table, which would be the same as the table given as input\n\t\tresultantTable.columnDescriptionList = tableToApplySelectionOn.columnDescriptionList;\n\t\t// initialize the column index map of the resultant table, which would be the same as the table given as input\n\t\tresultantTable.columnIndexMap = tableToApplySelectionOn.columnIndexMap;\n\n\t\t// we use the following conditions to evaluate the expressions\n\t\tif (expression instanceof EqualsTo || expression instanceof GreaterThanEquals\n\t\t\t|| expression instanceof GreaterThan || expression instanceof MinorThanEquals || expression instanceof MinorThan || expression instanceof NotEqualsTo) {\n\t\t\t\n\t\t\t// indices of the tuples that match the where clause or satisfy the where clause\n\t\t\tArrayList<Integer> listOfIndices = expressionEvaluator(expression, tableToApplySelectionOn);\n\t\t\tpopulateTable(resultantTable, tableToApplySelectionOn, listOfIndices);\n\n\t\t}\n\n\t\t else if (expression instanceof InExpression) {\n\t\t} else if (expression instanceof LikeExpression) {\n\t\t} else if (expression instanceof AndExpression) {\n\t\t\t\n\t\t\t// this is the AND expression extracted from the WHERE clause\n\t\t\tAndExpression andExpression = (AndExpression) expression;\n\t\t\t// this is the left expression of the AND expression\n\t\t\tExpression leftExpression = ((Expression) andExpression.getLeftExpression());\n\t\t\t// this is the right expression of the AND expression\n\t\t\tExpression rightExpression = ((Expression) andExpression.getRightExpression());\n\t\t\t// this stores the list of indices that satisfy the leftExpression\n\t\t\tArrayList<Integer> leftArr = expressionEvaluator(leftExpression, tableToApplySelectionOn);\n\t\t\t// this stores the list of indices that satisfy the rightExpression\n\t\t\tArrayList<Integer> rightArr = expressionEvaluator(rightExpression, tableToApplySelectionOn);\n\t\t\t// indices of the tuples that match the where clause or satisfy the where clause \n\t\t\tArrayList<Integer> listOfIndices = new ArrayList<Integer>();\n\t\t\t//System.out.println(leftExpression);\n\t\t\t//System.out.println(leftArr);\n\t\t\t//System.out.println(rightExpression);\n\t\t\t//System.out.println(rightArr);\n\t\t\t\n\t\t\t// the following nested loop is used to find the intersection of the two list indices\n\t\t\tfor (int i : leftArr) {\n\t\t\t\t\tif (rightArr.contains(i)) {\n\t\t\t\t\t\tlistOfIndices.add(i);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// this is used to populate the resultant table with the indices in the listOfIndices\n\t\t\tpopulateTable(resultantTable, tableToApplySelectionOn, listOfIndices);\n\n\t\t} else if (expression instanceof OrExpression) {\n\t\t\tOrExpression orExpression = (OrExpression) expression;\n\t\t\tExpression leftExpression = ((Expression) orExpression.getLeftExpression());\n\t\t\tExpression rightExpression = ((Expression) orExpression.getRightExpression());\n\t\t\t\n\t\t\t// this stores the list of indices that satisfy the leftExpression\n\t\t\tArrayList<Integer> leftArr = expressionEvaluator(leftExpression, tableToApplySelectionOn);\n\t\t\t// this stores the list of indices that satisfy the rightExpression\n\t\t\tArrayList<Integer> rightArr = expressionEvaluator(rightExpression, tableToApplySelectionOn);\n\t\t\t// this set is used to store the list of indices of tuples that satisfy both left and right expression\n\t\t\tTreeSet<Integer> set = new TreeSet<Integer>();\n\t\t\t\n\t\t\tfor (int i : leftArr) {\n\t\t\t\tset.add(i);\n\t\t\t}\n\t\t\tfor (int i : rightArr) {\n\t\t\t\tset.add(i);\n\t\t\t}\n\n\t\t\tArrayList<Integer> listOfIndices = new ArrayList<Integer>();\n\n\t\t\tfor (int i : set) {\n\t\t\t\tlistOfIndices.add(i);\n\t\t\t}\n\n\t\t\tpopulateTable(resultantTable, tableToApplySelectionOn, listOfIndices);\n\n\t\t} else if (expression instanceof Between) {\n\n\t\t} else if (expression instanceof NullValue) {\n\n\t\t} else if (expression instanceof IsNullExpression) {\n\n\t\t}\n\t\t// change the name of the resultant table to be the name of the table on which you applied selection conditions, this is done to extract the join conditions\n\t\tresultantTable.tableName = tableToApplySelectionOn.tableName;\n\t\treturn resultantTable;\n\t}", "SELECT createSELECT();", "<T> Setter<R> set(Projection<T> projection, T value);", "<T> Setter<R> set(Projection<T> projection, T value);", "public Table copy(int start, int length) {\n\t\tTableImpl vt;\n\t\tint[] newsubset = this.resubset(start, length);\n\n\t\t// Copy failed, maybe objects in a column that are not serializable.\n\t\tColumn[] cols = new Column[this.getNumColumns()];\n\t\tColumn[] oldcols = this.getColumns();\n\t\tfor (int i = 0; i < cols.length; i++) {\n\t\t\tcols[i] = oldcols[i].getSubset(newsubset);\n\t\t}\n\n\t\tvt = new MutableTableImpl(cols);\n\t\tvt.setLabel(this.getLabel());\n\t\tvt.setComment(this.getComment());\n\t\treturn vt;\n\t}", "public static void projections(){\r\n\t\tSession session = factory.openSession();\r\n\t\tTransaction tx = null; \r\n\t\ttry{ \r\n\t\t\ttx = session.beginTransaction();\r\n\t\t\tCriteria cr = session.createCriteria(Employees.class);\r\n\t\t\t// To get total row count. \r\n//\t\t\tcr.setProjection(Projections.rowCount()); \r\n\t\t\t// To get average of a property. \r\n//\t\t\tcr.setProjection(Projections.avg(\"salary\")); \r\n//\t\t\t// To get distinct count of a property. \r\n//\t\t\tcr.setProjection(Projections.countDistinct(\"firstName\")); \r\n//\t\t\t// To get maximum of a property. \r\n//\t\t\tcr.setProjection(Projections.max(\"salary\")); \r\n//\t\t\t// To get minimum of a property. \r\n//\t\t\tcr.setProjection(Projections.min(\"salary\")); \r\n//\t\t\t// To get sum of a property. \r\n//\t\t\tcr.setProjection(Projections.sum(\"salary\"));\r\n\t\t\t\r\n//\t\t\tselect department_id, count(*),max(salary) as salary from employees group by DEPARTMENT_ID order by salary desc\r\n\t\t\tList rows = cr.setProjection(Projections.projectionList()\r\n\t\t\t\t\t//.add(Projections.property(\"departmentId\"))\r\n\t\t\t\t\t.add(Projections.rowCount(),\"count\")\r\n\t\t\t\t\t.add(Projections.max(\"salary\"),\"salary\")\r\n\t\t\t\t\t.add(Projections.groupProperty(\"departmentId\"),\"departmentId\"))\r\n\t\t\t\t.addOrder(Order.desc(\"salary\")).list();\r\n\t\t\t\r\n\t\t\tfor (Iterator iterator = rows.iterator(); iterator.hasNext();){ \r\n\t\t\t\tObject[] employee = (Object[]) iterator.next(); \r\n\t\t\t\tSystem.out.println(employee[0] +\" \" + employee[1] + \" \"+ employee[2]); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\trows = cr.list();\r\n\t\t\tSystem.out.println(\"Total Count: \" + rows.get(0));\r\n\t\t\tSystem.out.println(\"Rows : \" + rows);\r\n\t\t\t\r\n\t\t\ttx.commit();\r\n\t\t}catch(HibernateException exp){\r\n\t\t\texp.printStackTrace();\r\n\t\t}\r\n\t}", "public SelectStatement() {\n\t\tthis.columnSpecs = new ArrayList<>();\n\t}", "@Projection(name=\"summary\", types = TvSeriesSummary.class)\npublic interface TvSeriesSummaryProjection {\n Date getLastUpdateDate();\n}", "LProjectionDecl LProjectionDecl(Token t, ProtoModList mods,\n\t\t\tLProtoHeader header, LProtoDef def, GProtoNameNode fullname,\n\t\t\tRoleNode self);", "GroupByColumnFull createGroupByColumnFull();", "public String prepareTable(ColumnInfo[] layout,\n String from,\n String where,\n boolean multiSelection,\n String tableName,boolean addAccessSQL)\n {\n int columnIndex = 0;\n StringBuffer sql = new StringBuffer (\"SELECT \");\n setLayout(layout);\n\n clearColumns();\n\n setMultiSelection(multiSelection);\n\n // add columns & sql\n for (columnIndex = 0; columnIndex < layout.length; columnIndex++)\n {\n // create sql\n if (columnIndex > 0)\n {\n sql.append(\", \");\n }\n sql.append(layout[columnIndex].getColSQL());\n\n // adding ID column\n if (layout[columnIndex].isKeyPairCol())\n {\n sql.append(\",\").append(layout[columnIndex].getKeyPairColSQL());\n }\n\n // add to model\n addColumn(layout[columnIndex].getColHeader());\n\n // set the colour column\n if (layout[columnIndex].isColorColumn())\n {\n setColorColumn(columnIndex);\n }\n if (layout[columnIndex].getColClass() == IDColumn.class)\n {\n m_keyColumnIndex = columnIndex;\n }\n }\n\n // set editors (two steps)\n for (columnIndex = 0; columnIndex < layout.length; columnIndex++)\n {\n setColumnClass(columnIndex,\n layout[columnIndex].getColClass(),\n layout[columnIndex].isReadOnly(),\n layout[columnIndex].getColHeader());\n }\n\n sql.append( \" FROM \").append(from);\n sql.append(\" WHERE \").append(where);\n\n if (from.length() == 0)\n {\n return sql.toString();\n }\n //\n if (addAccessSQL)\n {\n String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(),\n tableName,\n MRole.SQL_FULLYQUALIFIED,\n MRole.SQL_RO);\n\n logger.finest(finalSQL);\n\n return finalSQL;\n }\n else\n {\n return sql.toString();\n }\n }", "public InsertStatement from(TableReference sourceTable) {\r\n return copyOnWriteOrMutate(\r\n b -> b.from(sourceTable),\r\n () -> {\r\n if (selectStatement != null) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a source table and a source SelectStatement\");\r\n }\r\n if (!fields.isEmpty()) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a source table and a list of fields\");\r\n }\r\n if (!values.isEmpty()) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a source table and a set of literal field values.\");\r\n }\r\n this.fromTable = sourceTable;\r\n }\r\n );\r\n }", "@Projection(name = \"IdTeacher\", types = TblTeacher.class)\npublic interface Teacher {\n\n int getId();\n\n String getUserCode();\n\n String getLoginCode();\n\n String getName();\n\n String getSex();\n\n String getDep();\n\n String getBirthday();\n String getEdu();\n\n String getEntryTime();\n\n String getPhone();\n\n String getAddress();\n\n String getPassword();\n\n Integer getIsAdmin();\n}", "public Map<String, DynamicContext.VariableDependency> getProjection(Map<String, DynamicContext.VariableDependency> parentProjection)\n {\n Map<String, DynamicContext.VariableDependency> projection = new TreeMap<String, DynamicContext.VariableDependency>();\n projection.putAll(parentProjection);\n\n // add the variable dependencies needed by this for clause's expression.\n for(OrderByClauseSparkIteratorExpression iterator : _expressions)\n {\n Map<String, DynamicContext.VariableDependency> exprDependency = iterator.getExpression().getVariableDependencies();\n for(String variable : exprDependency.keySet())\n {\n if(projection.containsKey(variable)) {\n if(projection.get(variable) != exprDependency.get(variable))\n {\n projection.put(variable, DynamicContext.VariableDependency.FULL);\n }\n } else {\n projection.put(variable, exprDependency.get(variable));\n }\n }\n }\n return projection;\n }", "public ATExpression base_tableExpression();", "OrColumn createOrColumn();", "List<MorePracticeClass> selectClass(Integer pracId, RowBounds rowBounds);", "public Criteria setColumns(String[] columns) {\r\n this.projections.clear();\r\n for (int i = 0; i < columns.length; i++) {\r\n this.projections.add(columns[i]);\r\n }\r\n return this;\r\n }", "@Projection(name = \"std\", types = { Branch.class })\n@JsonPropertyOrder({\"id\",\"name\"})\npublic interface BranchStandardProjection {\n UUID getId();\n String getName();\n}", "Column createColumn(JavaTypeMapping mapping, String javaType, int datastoreFieldIndex);", "SubsetTableImpl(int numColumns) {\n\t\tsuper(numColumns);\n\t\tsubset = new int[0];\n\t}", "Select createSelect();", "Project selectByPrimaryKey(Long id);", "PivotTable createPivotTable();", "UnpivotTable createUnpivotTable();", "public Projection(final String code) {\n this(code, DEFAULT_UNITS, DEFAULT_AXIS_ORIENTATION);\n }", "public Object getProjection() {\n return getValue(PROP_PROJECTION);\n }", "public SubsetTableImpl(TableImpl table, int[] subset) {\n\t\tthis.columns = table.getColumns();\n\t\tthis.label = table.label;\n\t\tthis.comment = table.comment;\n\t\tthis.subset = subset;\n\t}", "PivotCol createPivotCol();", "public Object clone() {\n SetQuery copy = new SetQuery(this.operation);\n\n this.copyMetadataState(copy);\n\n copy.leftQuery = (QueryCommand)this.leftQuery.clone();\n copy.rightQuery = (QueryCommand)this.rightQuery.clone();\n\n copy.setAll(this.all);\n\n if(this.getOrderBy() != null) {\n copy.setOrderBy(this.getOrderBy().clone());\n }\n\n if(this.getLimit() != null) {\n copy.setLimit( this.getLimit().clone() );\n }\n\n copy.setWith(LanguageObject.Util.deepClone(this.getWith(), WithQueryCommand.class));\n\n if (this.projectedTypes != null) {\n copy.setProjectedTypes(new ArrayList<Class<?>>(projectedTypes), this.metadata);\n }\n\n return copy;\n }", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public SubsetTableImpl(Column[] col, int[] subset) {\n\t\tsuper(col);\n\t\tthis.subset = subset;\n\t}", "@Override\r\n public PlanNode makePlan(SelectClause selClause,\r\n List<SelectClause> enclosingSelects) {\r\n\r\n // For HW1, we have a very simple implementation that defers to\r\n // makeSimpleSelect() to handle simple SELECT queries with one table,\r\n // and an optional WHERE clause.\r\n\r\n PlanNode plan = null;\r\n\r\n if (enclosingSelects != null && !enclosingSelects.isEmpty()) {\r\n throw new UnsupportedOperationException(\r\n \"Not implemented: enclosing queries\");\r\n }\r\n\r\n FromClause fromClause = selClause.getFromClause();\r\n // case for when no From clause is present. Creates a ProjectNode.\r\n if (fromClause == null) {\r\n plan = new ProjectNode(selClause.getSelectValues());\r\n plan.prepare();\r\n return plan;\r\n }\r\n // implementation of our ExpressionProcessor\r\n AggregateFinder processor = new AggregateFinder();\r\n\r\n List<SelectValue> selectValues = selClause.getSelectValues();\r\n // call helper function to recursively handle From Clause\r\n plan = processFromClause(fromClause, selClause, processor);\r\n Expression whereExpr = selClause.getWhereExpr();\r\n if (whereExpr != null){\r\n whereExpr.traverse(processor);\r\n if (!processor.aggregates.isEmpty()) {\r\n throw new InvalidSQLException(\"Can't have aggregates in WHERE\\n\");\r\n }\r\n plan = PlanUtils.addPredicateToPlan(plan, whereExpr);\r\n }\r\n\r\n\r\n for (SelectValue sv : selectValues) {\r\n // Skip select-values that aren't expressions\r\n if (!sv.isExpression())\r\n continue;\r\n\r\n Expression e = sv.getExpression().traverse(processor);\r\n sv.setExpression(e);\r\n }\r\n\r\n Map<String, FunctionCall> colMap = processor.initMap();\r\n\r\n List<Expression> groupByExprs = selClause.getGroupByExprs();\r\n\r\n\r\n if (!groupByExprs.isEmpty() || !colMap.isEmpty()){\r\n plan = new HashedGroupAggregateNode(plan, groupByExprs, colMap);\r\n }\r\n\r\n Expression havingExpr = selClause.getHavingExpr();\r\n if (havingExpr != null){\r\n havingExpr.traverse(processor);\r\n selClause.setHavingExpr(havingExpr);\r\n plan = PlanUtils.addPredicateToPlan(plan, havingExpr);\r\n }\r\n\r\n\r\n\r\n List<OrderByExpression> orderByExprs = selClause.getOrderByExprs();\r\n if (orderByExprs.size() > 0){\r\n // need to do something about order by clause.\r\n plan = new SortNode(plan, orderByExprs);\r\n }\r\n\r\n if (!selClause.isTrivialProject())\r\n plan = new ProjectNode(plan, selectValues);\r\n\r\n plan.prepare();\r\n return plan;\r\n }", "private static HashMap<String,String> buildColumnMapCar() {\r\n HashMap<String,String> map = new HashMap<String,String>();\r\n map.put(KEY_POINTS, KEY_POINTS);\r\n\r\n map.put(BaseColumns._ID, \"rowid AS \" +\r\n BaseColumns._ID);\r\n\r\n return map;\r\n }", "TABLE41 selectByPrimaryKey(Long id);", "TABLE createTABLE();", "public abstract void newColumn();", "public interface TableQueryResult extends Catalog, TableModel {\n\n /**\n * Returns the Vector of Vectors that contains the table's data values.\n * The vectors contained in the outer vector are each a single row of values.\n */\n Vector<Vector<Object>> getDataVector();\n\n /** Return a description of the ith table column field */\n FieldDesc getColumnDesc(int i);\n\n /** Return the table column index for the given column name */\n int getColumnIndex(String name);\n\n /** Return a vector of column headings for this table. */\n List<String> getColumnIdentifiers();\n\n /** Return true if the table has coordinate columns, such as (ra, dec) */\n boolean hasCoordinates();\n\n /**\n * Return a Coordinates object based on the appropriate columns in the given row,\n * or null if there are no coordinates available for the row.\n */\n Coordinates getCoordinates(int rowIndex);\n\n /**\n * Return an object describing the columns that can be used to search\n * this catalog.\n */\n RowCoordinates getRowCoordinates();\n\n /**\n * Return the center coordinates for this table from the query arguments,\n * if known, otherwise return the coordinates of the first row, or null\n * if there are no world coordinates available.\n */\n WorldCoordinates getWCSCenter();\n\n /**\n * Return the object representing the arguments to the query that resulted in this table,\n * if known, otherwise null.\n */\n QueryArgs getQueryArgs();\n\n /**\n * Set the object representing the arguments to the query that resulted in this table.\n */\n void setQueryArgs(QueryArgs queryArgs);\n\n /** Return true if the result was truncated and more data would have been available */\n boolean isMore();\n\n /**\n * Return the catalog used to create this table,\n * or a dummy, generated catalog object, if not known.\n */\n Catalog getCatalog();\n\n /**\n * Return a possible SiderealTarget for the row i\n */\n Option<SiderealTarget> getSiderealTarget(int i);\n\n}", "final public static String createPstmtSelectById(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tString idField = null;\n\t\tField[] fields = null;\n\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tfields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.IDENTIFICATOR_ANNOTATION);\n\t\tfor (Field f : fields) {\n\t\t\tidField = AnnotationUtil.getAnnotationValue(f, DbAnnotations.PROPERTY_ANNOTATION);\n\t\t}\n\n\t\tsb.append(\"SELECT * FROM \");\n\t\tsb.append(table);\n\t\tsb.append(\" WHERE \");\n\t\tsb.append(idField);\n\t\tsb.append(\"=?\");\n\n\t\treturn sb.toString();\n\t}", "public Relation project(Tuple t) throws RelationException;", "public TableImpl() { columns = new Column[0]; }", "public static TupleExpr selectQuery(StatementPattern stmt, BindingSet bindings, FilterValueExpr filterExpr,\n\t\t\tAtomicBoolean evaluated) throws IllegalQueryException {\n\n\t\tSet<String> varNames = new HashSet<>();\n\t\tTupleExpr expr = constructStatement(stmt, varNames, bindings);\n\n\t\tif (varNames.isEmpty()) {\n\t\t\tthrow new IllegalQueryException(\"SELECT query needs at least one projection!\");\n\t\t}\n\n\t\tif (filterExpr != null) {\n\t\t\ttry {\n\t\t\t\texpr = new Filter(expr, FilterUtils.toFilter(filterExpr));\n\t\t\t\tevaluated.set(true);\n\t\t\t} catch (Exception e) {\n\t\t\t\tlog.debug(\"Filter could not be evaluated remotely: \" + e.getMessage());\n\t\t\t\tlog.trace(\"Details: \", e);\n\t\t\t}\n\t\t}\n\n\t\tProjectionElemList projList = new ProjectionElemList();\n\t\tfor (String var : varNames) {\n\t\t\tprojList.addElement(new ProjectionElem(var));\n\t\t}\n\n\t\tProjection proj = new Projection(expr, projList);\n\n\t\treturn proj;\n\t}", "public Cursor getCursorWithRows() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length())\n .addLengths(\"val123\".length()).setValues(ByteString\n .copyFromUtf8(\"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS TEAMHELLO\"\n +\n \" TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123val123\"))).build());\n return cursor;\n }", "List<MorePracticeClass> selectQueryNotProMng(HashMap map, RowBounds rowBounds);", "public ProjectTableModel(ArrayList<Project> prjs) {\n\t\t\tint rows = prjs.size();\n\t\t\t\n\t\t\tObject[][] data = null;\n\t\t\tString[] colNames = null;\n\t\t\tObject[] delOpt = new Object[rows];\n\t\t\t\n\t\t\tif(rows > 0) {\n\t\t\t\tif(prjs.get(0) instanceof OngoingProject) {\n\t\t\t\t\tdata = new Object[rows][ONGOING_COL_NAMES.length];\n\t\t\t\t\tcolNames = ONGOING_COL_NAMES;\n\t\t\t\t} else if(prjs.get(0) instanceof FinishedProject) {\n\t\t\t\t\tdata = new Object[rows][FINISHED_COL_NAMES.length];\n\t\t\t\t\tcolNames = FINISHED_COL_NAMES;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=0;i<rows;i++) {\n\t\t\t\tdata[i] = prjs.get(i).toTable();\n\t\t\t\tdelOpt[i] = new Boolean(true);\n\t\t\t}\n\t\t\t\n\t\t\tsuper.setDataVector(data, (Object[]) colNames);\n\t\t\tthis.addColumn(\"\", delOpt);\n\t\t\t\t\t\n\t\t}", "public interface IProjectionModel extends IModel {\r\n\r\n /**\r\n * Gets the number of projected years.\r\n * \r\n * @return the number of years\r\n */\r\n int getYears();\r\n\r\n /**\r\n * Gets the number of projected generations.\r\n * \r\n * @return the number of generations\r\n */\r\n int getGenerations();\r\n\r\n /**\r\n * Gets the map parameter instance => Settype.\r\n * \r\n * @return the map from parameter instance to Settypes\r\n */\r\n Map<ParameterInstance, SetType> getInstanceSetTypes();\r\n\r\n /**\r\n * Gets the maximum age.\r\n * \r\n * @return the maximum age\r\n */\r\n int getMaximumAge();\r\n\r\n /**\r\n * Returns list of all {@link SetType} objects, the custom ones and the\r\n * default one.\r\n * \r\n * @return list of all {@link SetType} objects defined in this scenario (at\r\n * least the default {@link SetType} is defined)\r\n */\r\n List<SetType> getAllSetTypes();\r\n\r\n /**\r\n * Returns the {@link SubPopulationModel} this projection assumes.\r\n * \r\n * @return the {@link SubPopulationModel} of the projection\r\n */\r\n SubPopulationModel getSubPopulationModel();\r\n\r\n}", "public TableImpl(Column[] c) { columns = c; }", "@Select({\n \"select\",\n \"ID, SDATE, STYPE, SMONEY, TOUCHING, ACCOUNT, CHECKSTATUS, DEMO1, DEMO2, DEMO3\",\n \"from PURCHASE\",\n \"where ID = #{id,jdbcType=DECIMAL}\"\n })\n @ConstructorArgs({\n @Arg(column=\"ID\", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL, id=true),\n @Arg(column=\"SDATE\", javaType=Date.class, jdbcType=JdbcType.TIMESTAMP),\n @Arg(column=\"STYPE\", javaType=String.class, jdbcType=JdbcType.VARCHAR),\n @Arg(column=\"SMONEY\", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL),\n @Arg(column=\"TOUCHING\", javaType=String.class, jdbcType=JdbcType.VARCHAR),\n @Arg(column=\"ACCOUNT\", javaType=String.class, jdbcType=JdbcType.VARCHAR),\n @Arg(column=\"CHECKSTATUS\", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL),\n @Arg(column=\"DEMO1\", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL),\n @Arg(column=\"DEMO2\", javaType=String.class, jdbcType=JdbcType.VARCHAR),\n @Arg(column=\"DEMO3\", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL)\n })\n Purchase selectByPrimaryKey(BigDecimal id);", "DataFrame<R,C> select(Iterable<R> rowKeys, Iterable<C> colKeys);", "DataFrame<R,C> copy();", "@Test\n public void countMoreThanOneProjectedColumn() throws Exception {\n final SqlBuilder3 sb = new SqlBuilder3();\n Table table = sb.table(\"tbl\");\n sb.addProjection(sb.column(table, \"col1\"));\n sb.addProjection(sb.column(table, \"col2\"));\n // Old bogus SQL\n String selectCount = sb.getSelectCount();\n assertFalse(\"select count(tbl.col1, tbl.col2) from tbl\".equals(selectCount));\n assertEquals(\"select count(*) from tbl\", selectCount);\n }", "public Object shallowCopy()\n\t{\n\t\tIfcTable ifcTable = new IfcTable();\n\t\tif(this.Name != null)\n\t\t\tifcTable.setName(this.Name);\n\t\tif(this.Rows != null)\n\t\t\tifcTable.setRows(this.Rows);\n\t\tif(this.Columns != null)\n\t\t\tifcTable.setColumns(this.Columns);\n\t\treturn ifcTable;\n\t}", "public abstract Polygon4D project();", "public Vector projection(Vector b){\n Vector result = new Vector();\n result.norm= (this.x*b.x+this.y*b.y) / b.getNorm();\n result.x = b.x/b.getNorm();\n result.y = b.y/b.getNorm();\n return result;\n }", "Table regularSelect(String name, String[] columns, String[] tablesList) {\n Table t1;\n Table t2;\n tablesList = new LinkedHashSet<String>(Arrays.asList(tablesList)).toArray(new String[0]);\n\n //Parse Arithmetic Op\n LinkedList<LinkedList> arithOp = p.arithOp(columns);\n\n // creates a new table from all columns - before running operators\n if (arithOp != null) {\n //get real column names, operated columns, and operation\n LinkedList<String> columnsToKeep = p.realCols(columns);\n LinkedList<String> colNames = arithOp.get(0);\n LinkedList<String> lhs = arithOp.get(1);\n LinkedList<String> rhs = arithOp.get(2);\n LinkedList<String> operators = arithOp.get(3);\n\n t1 = tables.get(tablesList[0]);\n t1 = selectColumns(name, tablesList[0], t1.getColNames());\n\n for (int i = 1; i < tablesList.length; i++) {\n t2 = tables.get(tablesList[i]);\n t2 = selectColumns(name, tablesList[i], t2.getColNames());\n t1 = joinTwoTables(name, t1, t2);\n tables.put(t1.getName(), t1);\n\n }\n\n /**run over the arithOp Columns that needs to be handeled\n * - t1 is the new combined table! And inserts the new column.*/\n for (int i = 0; i < operators.size(); i += 1) {\n t1.insertNewColumn(t1.arithmaticOperator(colNames.get(i),\n lhs.get(i), rhs.get(i), operators.get(i)));\n }\n t1.removeColumn(columnsToKeep);\n return t1;\n }\n\n if (columns[0].equals(\"*\")) {\n t1 = tables.get(tablesList[0]);\n t1 = selectColumns(name, tablesList[0], t1.getColNames());\n\n for (int i = 1; i < tablesList.length; i++) {\n t2 = tables.get(tablesList[i]);\n t2 = selectColumns(name, tablesList[i], t2.getColNames());\n t1 = joinTwoTables(name, t1, t2);\n tables.put(t1.getName(), t1);\n }\n\n return t1;\n // Check similar and distinct column names of tables\n } else {\n t1 = tables.get(tablesList[0]);\n t1 = selectColumns(name, tablesList[0], columns);\n for (int i = 1; i < tablesList.length; i++) {\n t2 = tables.get(tablesList[i]);\n t2 = selectColumns(name, tablesList[i], columns);\n t1 = joinTwoTables(name, t1, t2);\n tables.put(t1.getName(), t1);\n }\n\n return t1;\n }\n\n }", "public Query query(Table table) {\r\n return new Query(this, table);\r\n }", "AnalyticClause createAnalyticClause();", "protected String buildDataQuery() {\n StringBuilder sql = new StringBuilder(\"select\");\n String delim = \" \";\n for (String vname : getColumnNames()) {\n sql.append(delim).append(vname);\n delim = \", \";\n }\n \n Element ncElement = getNetcdfElement();\n \n String table = ncElement.getAttributeValue(\"dbTable\");\n if (table == null) {\n String msg = \"No database table defined. Must set 'dbTable' attribute.\";\n _logger.error(msg);\n throw new TSSException(msg);\n }\n sql.append(\" from \" + table);\n \n String predicate = ncElement.getAttributeValue(\"predicate\");\n if (predicate != null) sql.append(\" where \" + predicate);\n \n //Order by time.\n String tname = getTimeVarName();\n sql.append(\" order by \"+tname+\" ASC\");\n \n return sql.toString();\n }", "public boolean isProjectionOnly(Predicate p_pred){\n\t\tint num_ms = this.numStatements();\n\t\tfor (int j = 0; j < num_ms; j++)\n\t\t{\n\t\t\tStatement state = (Statement)this.statementI(j);\n\t\t\tif (state.containsPredicateName(p_pred.getFunctionHead()) &&\n\t\t\t\t\tstate.isProjectionOnly()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "Factory selectByPrimaryKey(Long id);" ]
[ "0.6241701", "0.60020244", "0.5824031", "0.55710495", "0.5532449", "0.54755294", "0.54572666", "0.54325116", "0.539704", "0.5360099", "0.5347454", "0.53459966", "0.53425723", "0.528978", "0.5224821", "0.5217111", "0.51991343", "0.51962584", "0.517516", "0.517224", "0.5138724", "0.51106644", "0.51025224", "0.5096161", "0.50374854", "0.5034755", "0.5011891", "0.4991818", "0.49782965", "0.49568573", "0.4950905", "0.49286565", "0.49192807", "0.49185127", "0.48991522", "0.4891525", "0.48782358", "0.48410395", "0.48064044", "0.4803004", "0.4776708", "0.47742638", "0.47709793", "0.47709793", "0.4761998", "0.47533044", "0.47488695", "0.473288", "0.47021353", "0.46983007", "0.46488497", "0.4622817", "0.4610054", "0.4603076", "0.46017233", "0.4595941", "0.45924175", "0.45912692", "0.4580554", "0.45689076", "0.45620555", "0.45324302", "0.45283097", "0.45254323", "0.45247126", "0.45233494", "0.45231718", "0.4520275", "0.45106715", "0.45013642", "0.44978178", "0.4485974", "0.4481518", "0.4475694", "0.44755507", "0.4463591", "0.4463286", "0.44592595", "0.44590187", "0.4449982", "0.44457838", "0.44349757", "0.44329178", "0.44182214", "0.44114506", "0.4409379", "0.43925887", "0.43918872", "0.4387608", "0.43848452", "0.43815604", "0.43775284", "0.43773982", "0.4371656", "0.43661878", "0.43622223", "0.4359009", "0.43432248", "0.43421006", "0.43419033" ]
0.5378794
9
Creates a new role.
public CreateRoleResponse createRole(CreateRoleRequest request) throws GPUdbException { CreateRoleResponse actualResponse_ = new CreateRoleResponse(); submitRequest("/create/role", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ResourceRole createResourceRole();", "@Override\n\tpublic UserRole createNew()\n\t{\n\t\treturn new UserRole();\n\t}", "TDLRoleEntity create(TDLRoleEntity tldrole);", "public void addRole(String username, String role) throws UserNotExistsException ;", "@Override\n public void createNewRole(final String roleName, final String roleDescription,\n final String unAssignedPermission, final int partnerType) {\n\n DriverConfig.setLogString(\"Processing a new role creation with required fields.\", true);\n\n WaitUtil.waitUntil(200);\n\n final WebElement roleManagement = retrieveElementByAttributeValue(DriverConfig.getDriver(),\n TAG_ANCHOR, ATTR_TITLE, roleConfig.get(ROLE_MANAGEMENT_VAL));\n roleManagement.click();\n logger.info(\"check if create new role is displayed.\");\n isDisplayedByLinkText(DriverConfig.getDriver(), roleConfig.get(CREATE_NEW_ROLE_VAL),\n MEDIUM_TIMEOUT);\n DriverConfig.setLogString(\"select create new role link.\", true);\n final WebElement createNewRole = retrieveElementByLinkText(DriverConfig.getDriver(),\n roleConfig.get(CREATE_NEW_ROLE_VAL), MEDIUM_TIMEOUT);\n createNewRole.click();\n DriverConfig.setLogString(\"enter details in create role form.\", true);\n final String dynamicRoleName = enterRoleName(roleName);\n selectPartnerType(partnerType);\n enterRoleDescription(roleDescription);\n DriverConfig.setLogString(\"select permissions for the role.\", true);\n sendPermissions(DriverConfig.getDriver(), unAssignedPermission);\n DriverConfig.setLogString(\"save & verify the role access.\", true);\n saveAndVerifyRole(DriverConfig.getDriver(), dynamicRoleName);\n }", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "@Override\n public void populateAndCreateNewRole(final String roleName, final String roleDescription,\n final String unAssignedPermission) {\n\n DriverConfig.setLogString(\"Processing a new role creation with required fields.\", true);\n\n WaitUtil.waitUntil(200);\n\n final WebElement roleManagement = retrieveElementByAttributeValue(DriverConfig.getDriver(),\n TAG_ANCHOR, ATTR_TITLE, roleConfig.get(ROLE_MANAGEMENT_VAL));\n roleManagement.click();\n logger.info(\"check if create new role is displayed.\");\n isDisplayedByLinkText(DriverConfig.getDriver(), roleConfig.get(CREATE_NEW_ROLE_VAL),\n MEDIUM_TIMEOUT);\n DriverConfig.setLogString(\"select create new role link.\", true);\n final WebElement createNewRole = retrieveElementByLinkText(DriverConfig.getDriver(),\n roleConfig.get(CREATE_NEW_ROLE_VAL), MEDIUM_TIMEOUT);\n createNewRole.click();\n DriverConfig.setLogString(\"enter details in create role form.\", true);\n sendRoleDetails(DriverConfig.getDriver(), roleDescription);\n DriverConfig.setLogString(\"select permissions for the role.\", true);\n sendPermissions(DriverConfig.getDriver(), unAssignedPermission);\n DriverConfig.setLogString(\"save & verify the role access.\", true);\n saveAndVerifyRole(DriverConfig.getDriver(), roleName);\n }", "public CreateRoleResponse createRole(String name, Map<String, String> options) throws GPUdbException {\n CreateRoleRequest actualRequest_ = new CreateRoleRequest(name, options);\n CreateRoleResponse actualResponse_ = new CreateRoleResponse();\n submitRequest(\"/create/role\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "@Override\n\tpublic void addRole(Role r) {\n\t\t\n\t}", "QuoteRole createQuoteRole();", "private Role createIamRole()\n {\n return iamRoleBuilder().build();\n }", "public void addRole(String roleName) throws UnsupportedOperationException;", "@PostMapping(\"/role/new\")\r\n\tpublic ModelAndView addNewRole (@ModelAttribute(\"role\") Role role)\r\n\t{\n\t\tRole newRole = roleService.createRole(role);\r\n\t\t\r\n\t\tif (newRole != null)\r\n\t\t\treturn ModelAndViewCreator.createModelAndView(\"role\", roleService.getRole(newRole.getId()), VIEW_SHOW_ROLE);\r\n\t\telse\r\n\t\t\treturn ModelAndViewCreator.createModelAndView(\"role\", new Role(), VIEW_CREATE_ROLE)\r\n\t\t\t\t\t.addObject(\"errorRoleExists\", true);\r\n\t}", "public Role() {\n }", "public Role() {\n }", "private Role createRole( String className, Agent agent ) {\n// System.out.println(\"Attempting to create class \" + className);\n Class cl = null;\n try {\n cl = Class.forName( \"tns.roles.\" + className );\n } catch ( ClassNotFoundException e ) {\n System.err.println( \"Can't find your darned class.\" );\n System.exit( 0 );\n } // end try-catch\n\n Constructor c = null;\n Object o = null;\n try {\n c = cl.getConstructor(new Class[] {Agent.class});\n o = c.newInstance(new Object[] {agent});\n } catch (NoSuchMethodException e) {\n System.err.println(\"Can't find you class' constructor.\");\n System.exit(0);\n } catch (SecurityException e) {\n System.err.println(\"Security Exception. Can't access your class.\");\n System.exit(0);\n } catch ( InstantiationException e ) {\n System.err.println( \"Can't make your darned class.\" );\n System.exit( 0 );\n } catch ( IllegalAccessException e ) {\n System.err.println( \"Can't access your darned class.\" );\n System.exit( 0 );\n } catch (IllegalArgumentException e) {\n System.err.println(\"Can't create your class. Illegal arguments.\");\n System.exit(0);\n } catch (InvocationTargetException e) {\n System.err.println(\"Can't create your class. Contructor threw an exception.\");\n System.exit(0);\n } // end try-catch\n\n return (Role)o;\n\n }", "public MetaRole createMetaRole(String sName, String sAdmin) throws IOException;", "@Override\r\n\tpublic void addRole(Role role) {\n\t\tgetHibernateTemplate().save(role);\r\n\t}", "public GraphNode addRole(String role){\n\t\tInteger intValue = addElement(role, 2);\n\t\t//System.out.println(role + \" Added with : \" + intValue);\n\t\tGraphNode roleVar = new GraphNode(intValue, 2);\n\t\tauthGraph.addVertex(roleVar);\n\t\treturn roleVar;\n\t}", "public Role(String name) {\r\n\t\tthis();\r\n\t\tthis.name = name;\r\n\t}", "public Role() {\n\t}", "@Override\n\tpublic void addRole(Role role) {\n\t\tSnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);\n\t\tlong id = idWorker.nextId();\n\t\trole.setRoleid(Long.toString(id));\n\t\troleMapper.addRole(role);\n\t}", "@Override\r\n\tpublic int addRole(Role role) {\n\t\treturn 0;\r\n\t}", "@Test\n\tpublic void testCreate() {\n\t\tApp app = new App();\n\t\tapp.setId(1L);\n\t\tRole role = new Role();\n\t\trole.setApp(app);\n\t\trole.setName(\"admin中国\");\n\t\troleService.create(role);\n\t}", "public Role() {\n\t super();\n }", "ISModifyProvidedRole createISModifyProvidedRole();", "long addUserRole(UserRole userRole);", "void addRoleToUser(int userID,int roleID);", "@Override\r\n\tpublic void addRole(Role role) {\n\t\troleDao.addRole(role);\r\n\t}", "public void setRole(java.lang.String value) {\n this.role = value;\n }", "void insertRole(Role role) throws DataException;", "public void addRole(Role role) {\n this.roles.add(role);\n }", "public RoleImpl() {}", "ISModifyRequiredRole createISModifyRequiredRole();", "public void createUser(String username, String password, String role) {\r\n Optional<User> user = userRepo.findByName(username);\r\n if (!user.isPresent()) {\r\n User newUser = new User();\r\n newUser.setName(username);\r\n newUser.setPassword(password);\r\n newUser.setRole(role);\r\n userRepo.save(newUser);\r\n }\r\n }", "public void addRole(AppRole role) {\n this.roles.add(role);\n }", "@Override\n\tpublic Role createNewSelfSourcedRole(String title, String location,\n\t\t\tDate start, Date end, String description, Double salary) {\n\t\tofferman.createNewSelfSourcedRole(title, location, start, end, description, salary);\n\t\treturn null;\n\t}", "public void addRole(Role role) {\n getRoles().add(role);\n }", "@RequestMapping(value = \"/new\", method = RequestMethod.GET)\n public String newRole(Model model) {\n model.addAttribute(\"roleCreate\", new CreateRoleDTO());\n return (WebUrls.URL_ROLE+\"/new\");\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public void setRole(String role)\n {\n _role=role;\n }", "public void setRole(String role) {\n this.role = role;\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public RoleEntity(){}", "<T extends Role> ISModifyRole<T> createISModifyRole();", "public Role saveRole(Role role) {\n return roleRepository.save(role);\n }", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "void addNewUser(User user, int roleId) throws DAOException;", "public void createSupplier(User user){\n BCryptPasswordEncoder encoder= new BCryptPasswordEncoder();\n user.setPassword(encoder.encode(user.getPassword()));\n //creating roles\n Role userRole = new Role(\"SUPPLIER\");//we create a role type client\n //a user can then take a list of roles\n List<Role> roles = new ArrayList<>();//list of roles\n roles.add(userRole);//add client role type to the list\n user.setRoles(roles);//set a user to a role type\n userRepository.save(user);//save( save is a crudrepository method) the user to the database.\n }", "Builder roleArn(String roleArn);", "@Override\n\tpublic void saveRole(Role role) {\n\t\tthis.roleMapper.insert(role);\n\t}", "@Override\r\n\tpublic int insertRole(AdminRole role) {\n\t\treturn adminRoleDao.insert(role);\r\n\t}", "public void ajouterRole(RoleUtilisateur ru);", "@GetMapping( value = {\"/add\"} )\n public String roleAddFrom(Model model) {\n model.addAttribute(\"addStatus\", true);\n model.addAttribute(\"role\", new Role());\n return \"role/addRole\";\n }", "public void add(Role role) throws QuestionBankSystemException,\n\t\t\tQuestionBankException;", "public SecRole getNewSecRole();", "public SecRole getNewSecRole();", "public void testCreateRoles1() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role1\", \"user1\", \"Login to admin console\");\r\n }", "public void addRole(String role) {\n StringBuffer rolesStringBuffer = new StringBuffer(this.roles);\n rolesStringBuffer.append(\",\").append(role);\n this.roles = rolesStringBuffer.toString();\n }", "@Test(groups = \"role\", priority = 1)\n public void testRoleAdd() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient.roleAdd(rootRole).get();\n this.authDisabledAuthClient.roleAdd(userRole).get();\n }", "@Override\n\tpublic Integer add(Role role) {\n\t\treturn roleDao.add(role);\n\t}", "void setRole(final SecurityRole role);", "public void createRoleData() throws DataLayerException\r\n\t{\r\n\t\t// ---------------------------------------------------------------\r\n\t\t// Task States\r\n\t\t// ---------------------------------------------------------------\r\n\t\tfor (Role.RoleType roleType : Role.RoleType.values())\r\n\t\t{\r\n\t\t\tRole role = createHelper.createRole(0);\r\n\t\t\trole.setRoleType(roleType);\r\n\t\t\troleDao.save(role);\r\n\t\t}\r\n\t}", "@Override\n @Transactional\n public AjaxResult createRole(RoleCreatePojo roleCreatePojo) {\n\n User loginUser = SpringUtils.getBean(LoginTokenService.class).getLoginUser(ServletUtils.getRequest());\n roleCreatePojo.getSysRole().setCreateBy(loginUser.getNickname());\n // 处理各类不能为空的字段\n if(null == roleCreatePojo.getSysRole().getRoleSort())\n roleCreatePojo.getSysRole().setRoleSort(\"1\");\n if(null == roleCreatePojo.getSysRole().getStatus())\n roleCreatePojo.getSysRole().setStatus(\"0\");\n if(null == roleCreatePojo.getSysRole().getCreateTime())\n roleCreatePojo.getSysRole().setCreateTime(Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()));\n if(null == roleCreatePojo.getSysRole().getRemark())\n roleCreatePojo.getSysRole().setRemark(roleCreatePojo.getSysRole().getRoleName());\n\n // 新增角色\n SysRole sysRole = roleCreatePojo.getSysRole();\n sysRoleMapper.insert(sysRole);\n Long roleId = sysRole.getRoleId();\n\n // 新增角色对应的menu\n if(null != roleCreatePojo.getMenuList() && 0 != roleCreatePojo.getMenuList().size()) {\n List<SysRoleMenu> sysRoleMenus = new ArrayList<>();\n roleCreatePojo.getMenuList().forEach(item -> {\n SysRoleMenu sysRoleMenu = new SysRoleMenu();\n sysRoleMenu.setRoleId(roleId);\n sysRoleMenu.setMenuId(item);\n\n sysRoleMenus.add(sysRoleMenu);\n });\n sysRoleMenuMapper.batchRoleMenu(sysRoleMenus);\n }\n\n return AjaxResult.success();\n }", "private void onAddRole() {\n\t\troleProxy.addRoleToUser(user, selectedRole);\n\t}", "public CreateRoleConstantOperation(String roleName) {\n \tSpliceLogUtils.trace(LOG, \"CreateRoleConstantOperation with role name {%s}\",roleName);\n this.roleName = roleName;\n }", "public CreateServiceRequest withRole(String role) {\n setRole(role);\n return this;\n }", "@PostMapping( value = {\"/add\", \"/update\"} )\n public String addRole(@Valid @ModelAttribute Role role, BindingResult result, Model model\n , RedirectAttributes redirectAttributes) {\n\n if ( result.hasErrors() && role.getId() == null ) {\n model.addAttribute(\"addStatus\", true);\n model.addAttribute(\"role\", role);\n return \"role/addRole\";\n }\n\n try {\n roleService.persist(role);\n return \"redirect:/role\";\n } catch ( Exception e ) {\n ObjectError error = new ObjectError(\"role\",\n \"This role is already in the System <br/>System message -->\" + e.toString());\n result.addError(error);\n model.addAttribute(\"addStatus\", false);\n model.addAttribute(\"role\", role);\n return \"role/addRole\";\n }\n\n }", "public SecUserrole getNewSecUserrole();", "public void setRole(String role) {\r\n\t\tthis.role = role;\r\n\t}", "@Test\n\tpublic void testAddRole_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "public void testCreateRoles3() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role3\", \"user3\", \"manage-security\");\r\n\r\n }", "public void addRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"No roles can be attached to user [ Anonymous ]\");\r\n }", "public User create(String username, String password, String role) throws AdException{\n\t\ttry{\n\t\t\tUser user = new User(username, password, role);\n\t\t\t\n\t\t\tbegin();\n\t\t\tgetSession().save(user);\n\t\t\tcommit();\n\t\t\t\n\t\t\treturn user;\n\t\t}catch(HibernateException e){\n\t\t\trollback();\n\t\t\te.printStackTrace();\n\t\t\tthrow new AdException(\"Could not create user with \" + username, e);\n\t\t}\n\t}", "@Override\n\tpublic void save(Role role) {\n\t\tjdbcTemplate.update(\"insert into role(name, description) values(?,?)\",\n\t\t\t\trole.getName(),role.getDescription());\n\t\n\t}", "public void setRole(String role) {\n\t\tthis.role = role;\n\t}", "public Role(String name, long museum_id, \r\n long id, Timestamp deleted, Timestamp insert, Timestamp update)\r\n {\r\n super(id, deleted, insert, update);\r\n this.name = name;\r\n this.museum_id = museum_id;\r\n }", "private UserRole(String name) {\n\t\tthis.name = name;\n\t}", "public void createTableRoles() {\n try (Statement statement = connection.createStatement()) {\n statement.executeUpdate(\"CREATE TABLE roles ( \" +\n \"id INT NOT NULL PRIMARY KEY,\"\n + \"roleName VARCHAR(256) NOT NULL)\");\n statement.executeUpdate(\"DROP TABLE IF EXISTS role \");\n } catch (SQLException sqlException) {\n sqlException.printStackTrace();\n }\n }", "@Override\n\tpublic int create(Rol r) {\n\t\treturn rolDao.create(r);\n\t}", "public Integer addUserRole(UserRole userRole) throws ClassNotFoundException, SQLException {\n\t\treturn saveWithPK(\"insert into user_role (id, name) VALUES(?, ?)\",\n\t\t\t\tnew Object[] { userRole.getId(), userRole.getName() });\n\t}", "@Test\n\tpublic void testAddRole_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "public int addRole(Role role){\n\t\tString sql = \"INSERT INTO `outpatient`.`role` \"\n\t\t\t\t+ \"(`role_power`, `role_describe`) \"\n\t\t\t\t+ \"VALUES (?, ?);\";\n\t\tConnection conn = new DBUtilFactory().getConn();\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\tps.setInt(1, role.getRole_power());\n\t\t\tps.setString(2, role.getRole_describe());\n\t\t\tps.execute();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn -1;\n\t\t} finally {\n\t\t\tclearUp(conn);\n\t\t}\n\t\tint role_id = -1;\n\t\tsql = \"select max(role_id) as id from role;\";\n\t\tconn = new DBUtilFactory().getConn();\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\trs = ps.executeQuery();\n\t\t\tif(rs.next()){\n\t\t\t\trole_id = rs.getInt(\"id\");\n\t\t\t}else{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn -1;\n\t\t} finally {\n\t\t\tclearUp(conn);\n\t\t}\n\t\treturn role_id;\n\t}", "@Override\n\tpublic void insertRole(Role role) {\n\t\tlogger.debug(\"RoleServiceImpl::insertRole Role = {}\", role.toString());\n\t\troleMapper.insertRole(role);\n\t\tlogger.debug(\"RoleServiceImpl::insertRole id = {}\", role.getId());\n\t}", "public void addRole(Role theRole) {\r\n\t\tthis.roles.add(theRole);\r\n\t\ttheRole.getUsers().add(this);\r\n\t}", "public void create() {\n String salt = PasswordUtils.getSalt(30);\n\n // Protect user's password. The generated value can be stored in DB.\n String mySecurePassword = PasswordUtils.generateSecurePassword(password, salt);\n\n // Print out protected password\n System.out.println(\"My secure password = \" + mySecurePassword);\n System.out.println(\"Salt value = \" + salt);\n Operator op = new Operator();\n op.setUsername(username);\n op.setDescription(description);\n op.setSalt(salt);\n op.setPassword(mySecurePassword);\n op.setRol(rol);\n operatorService.create(op);\n message = \"Se creo al usuario \" + username;\n username = \"\";\n description = \"\";\n password = \"\";\n rol = null;\n }", "boolean addUser(int employeeId, String name, String password, String role);", "public synchronized void createDefaultRoles() {\n if (roleDAO.findByName(getUserRole()) == null) {\n createRole(getUserRole());\n }\n if (roleDAO.findByName(getAdminRole()) == null) {\n createRole(getAdminRole());\n }\n }", "public PsecRole createOrUpdateRole(String name, boolean defaultRole, String... permissions) {\r\n PsecRole result = server.find(PsecRole.class).\r\n where().eq(\"name\", name).findUnique();\r\n if (result == null) {\r\n result = new PsecRole();\r\n result.setName(name);\r\n }\r\n if (!result.getAutoUpdatesForbidden()) {\r\n final List<PsecPermission> permissionObjects = server.find(PsecPermission.class).\r\n where().in(\"name\", (Object[])permissions).findList();\r\n result.setPsecPermissions(permissionObjects);\r\n result.setDefaultRole(defaultRole);\r\n } else {\r\n System.out.println(\"Can't update Role \" + name);\r\n }\r\n server.save(result);\r\n server.saveManyToManyAssociations(result, \"psecPermissions\");\r\n return result;\r\n }", "public Role() {\r\n\t\tpermissions = new ArrayList<Permission>();\r\n\t}", "public void setRole(String role) {\n\t\t\tthis.role = role;\n\t\t}", "public Builder setRole(com.message.MessageInfo.RoleVO value) {\n if (roleBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n role_ = value;\n onChanged();\n } else {\n roleBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }", "public Account createAccount() {\n\t\t\n\t\tAccountBuilder builder = new AccountBuilder();\n\t\tUserRole role = new UserRole();\n\t\trole.setUsername(getUsername());\n\t\trole.setRole(\"ROLE_USER\");\n\t\t\n\t\t//builds the account entity using the front end POJO\n\t\tbuilder\n\t\t\t.withUsername(getUsername())\n\t\t\t.withPassword(getPassword())\n\t\t\t.withLastName(getLastName())\n\t\t\t.withFirstName(getFirstName())\n\t\t\t.withRole(role)\n\t\t\t.withStatus(AccountStatus.ACTIVE)\n\t\t\t.withEmail(getEmail())\n\t\t\t.withStoreCd(getStoreCd());\n\t\t\n return builder.build();\n\t}", "public synchronized void setRole(final Role newValue) {\n checkWritePermission();\n role = newValue;\n }", "public IBusinessObject addToRole(IIID useriid, IIID roleiid, int ordernum)\n throws OculusException;", "public static GenericRoleVoter createInstance(ApplicationRole namedRole) {\n if (namedRole == null) {\n throw new AtbashIllegalActionException(\"(OCT-DEV-008) namedRole can't be null\");\n }\n\n GenericRoleVoter result = new GenericRoleVoter();\n result.subject = CDIUtils.retrieveInstance(Subject.class);\n result.permission = new RolePermission(namedRole.name());\n return result;\n }", "@Override\r\n\tpublic void addCredential(String role) {\n\r\n\t}", "@Override\n public ResponseEntity<ResponseMessage> addRole(String roleName, String email) {\n logger.info(STARTING_METHOD_EXECUTION);\n ResponseMessage responseMessage = new ResponseMessage();\n RoleModel roleModel=roleRepo.findByRole(roleName);\n if (roleModel == null) {\n RoleModel obj = new RoleModel();\n obj.setRole(roleName);\n obj.setCreatedOn(System.currentTimeMillis());\n obj.setCreatedBy(userRepo.getUserIdByUserEmail(email));\n roleRepo.save(obj);\n logger.debug(\"Role saved : {}\",roleName);\n responseMessage.setMessage(ROLE_ADDED);\n responseMessage.setStatusCode(HttpStatus.CREATED.value());\n logger.info(EXITING_METHOD_EXECUTION);\n return new ResponseEntity<>(responseMessage, HttpStatus.CREATED);\n }\n responseMessage.setMessage(ROLE_ALREADY_EXIST);\n responseMessage.setStatusCode(HttpStatus.CONFLICT.value());\n logger.debug(\"Role {} already exits\",roleName);\n logger.info(EXITING_METHOD_EXECUTION);\n return new ResponseEntity<>(responseMessage, HttpStatus.CONFLICT);\n }", "public void testCreateRoles4() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role4\", \"user4\", \"upload-services\");\r\n\r\n }" ]
[ "0.7133639", "0.710821", "0.7100776", "0.70197153", "0.69617224", "0.6724931", "0.66875476", "0.6666349", "0.66526765", "0.6651947", "0.660904", "0.65620345", "0.65369505", "0.65327567", "0.64948577", "0.64948577", "0.6468678", "0.63804907", "0.63703465", "0.63692474", "0.6346241", "0.634032", "0.6324896", "0.6322145", "0.6321111", "0.63057476", "0.62569153", "0.6251983", "0.62472695", "0.622324", "0.6213458", "0.61758894", "0.6157801", "0.61425954", "0.6124635", "0.6123765", "0.6108758", "0.60762405", "0.60374564", "0.6018895", "0.6005362", "0.60034645", "0.5975418", "0.5966503", "0.5955604", "0.59406465", "0.5935445", "0.59205353", "0.5918024", "0.59162414", "0.5912936", "0.58865166", "0.58827424", "0.5879221", "0.5843328", "0.5837347", "0.5835267", "0.5835267", "0.58238834", "0.58106947", "0.5800412", "0.5796448", "0.57891536", "0.5780735", "0.5777967", "0.57778764", "0.5771315", "0.57665473", "0.5762903", "0.5728166", "0.5727502", "0.57170093", "0.5716449", "0.5699508", "0.569205", "0.5681848", "0.5680109", "0.56758815", "0.5655524", "0.5644803", "0.5642068", "0.5635775", "0.5590062", "0.55888575", "0.55653167", "0.5565097", "0.55467564", "0.55420953", "0.5532984", "0.5521617", "0.55188626", "0.55112565", "0.55028486", "0.54978704", "0.54916334", "0.54903686", "0.54868656", "0.54792535", "0.54740095", "0.54739404" ]
0.7477064
0
Creates a new role.
public CreateRoleResponse createRole(String name, Map<String, String> options) throws GPUdbException { CreateRoleRequest actualRequest_ = new CreateRoleRequest(name, options); CreateRoleResponse actualResponse_ = new CreateRoleResponse(); submitRequest("/create/role", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateRoleResponse createRole(CreateRoleRequest request) throws GPUdbException {\n CreateRoleResponse actualResponse_ = new CreateRoleResponse();\n submitRequest(\"/create/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "ResourceRole createResourceRole();", "@Override\n\tpublic UserRole createNew()\n\t{\n\t\treturn new UserRole();\n\t}", "TDLRoleEntity create(TDLRoleEntity tldrole);", "public void addRole(String username, String role) throws UserNotExistsException ;", "@Override\n public void createNewRole(final String roleName, final String roleDescription,\n final String unAssignedPermission, final int partnerType) {\n\n DriverConfig.setLogString(\"Processing a new role creation with required fields.\", true);\n\n WaitUtil.waitUntil(200);\n\n final WebElement roleManagement = retrieveElementByAttributeValue(DriverConfig.getDriver(),\n TAG_ANCHOR, ATTR_TITLE, roleConfig.get(ROLE_MANAGEMENT_VAL));\n roleManagement.click();\n logger.info(\"check if create new role is displayed.\");\n isDisplayedByLinkText(DriverConfig.getDriver(), roleConfig.get(CREATE_NEW_ROLE_VAL),\n MEDIUM_TIMEOUT);\n DriverConfig.setLogString(\"select create new role link.\", true);\n final WebElement createNewRole = retrieveElementByLinkText(DriverConfig.getDriver(),\n roleConfig.get(CREATE_NEW_ROLE_VAL), MEDIUM_TIMEOUT);\n createNewRole.click();\n DriverConfig.setLogString(\"enter details in create role form.\", true);\n final String dynamicRoleName = enterRoleName(roleName);\n selectPartnerType(partnerType);\n enterRoleDescription(roleDescription);\n DriverConfig.setLogString(\"select permissions for the role.\", true);\n sendPermissions(DriverConfig.getDriver(), unAssignedPermission);\n DriverConfig.setLogString(\"save & verify the role access.\", true);\n saveAndVerifyRole(DriverConfig.getDriver(), dynamicRoleName);\n }", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "@Override\n public void populateAndCreateNewRole(final String roleName, final String roleDescription,\n final String unAssignedPermission) {\n\n DriverConfig.setLogString(\"Processing a new role creation with required fields.\", true);\n\n WaitUtil.waitUntil(200);\n\n final WebElement roleManagement = retrieveElementByAttributeValue(DriverConfig.getDriver(),\n TAG_ANCHOR, ATTR_TITLE, roleConfig.get(ROLE_MANAGEMENT_VAL));\n roleManagement.click();\n logger.info(\"check if create new role is displayed.\");\n isDisplayedByLinkText(DriverConfig.getDriver(), roleConfig.get(CREATE_NEW_ROLE_VAL),\n MEDIUM_TIMEOUT);\n DriverConfig.setLogString(\"select create new role link.\", true);\n final WebElement createNewRole = retrieveElementByLinkText(DriverConfig.getDriver(),\n roleConfig.get(CREATE_NEW_ROLE_VAL), MEDIUM_TIMEOUT);\n createNewRole.click();\n DriverConfig.setLogString(\"enter details in create role form.\", true);\n sendRoleDetails(DriverConfig.getDriver(), roleDescription);\n DriverConfig.setLogString(\"select permissions for the role.\", true);\n sendPermissions(DriverConfig.getDriver(), unAssignedPermission);\n DriverConfig.setLogString(\"save & verify the role access.\", true);\n saveAndVerifyRole(DriverConfig.getDriver(), roleName);\n }", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "@Override\n\tpublic void addRole(Role r) {\n\t\t\n\t}", "QuoteRole createQuoteRole();", "private Role createIamRole()\n {\n return iamRoleBuilder().build();\n }", "public void addRole(String roleName) throws UnsupportedOperationException;", "@PostMapping(\"/role/new\")\r\n\tpublic ModelAndView addNewRole (@ModelAttribute(\"role\") Role role)\r\n\t{\n\t\tRole newRole = roleService.createRole(role);\r\n\t\t\r\n\t\tif (newRole != null)\r\n\t\t\treturn ModelAndViewCreator.createModelAndView(\"role\", roleService.getRole(newRole.getId()), VIEW_SHOW_ROLE);\r\n\t\telse\r\n\t\t\treturn ModelAndViewCreator.createModelAndView(\"role\", new Role(), VIEW_CREATE_ROLE)\r\n\t\t\t\t\t.addObject(\"errorRoleExists\", true);\r\n\t}", "public Role() {\n }", "public Role() {\n }", "private Role createRole( String className, Agent agent ) {\n// System.out.println(\"Attempting to create class \" + className);\n Class cl = null;\n try {\n cl = Class.forName( \"tns.roles.\" + className );\n } catch ( ClassNotFoundException e ) {\n System.err.println( \"Can't find your darned class.\" );\n System.exit( 0 );\n } // end try-catch\n\n Constructor c = null;\n Object o = null;\n try {\n c = cl.getConstructor(new Class[] {Agent.class});\n o = c.newInstance(new Object[] {agent});\n } catch (NoSuchMethodException e) {\n System.err.println(\"Can't find you class' constructor.\");\n System.exit(0);\n } catch (SecurityException e) {\n System.err.println(\"Security Exception. Can't access your class.\");\n System.exit(0);\n } catch ( InstantiationException e ) {\n System.err.println( \"Can't make your darned class.\" );\n System.exit( 0 );\n } catch ( IllegalAccessException e ) {\n System.err.println( \"Can't access your darned class.\" );\n System.exit( 0 );\n } catch (IllegalArgumentException e) {\n System.err.println(\"Can't create your class. Illegal arguments.\");\n System.exit(0);\n } catch (InvocationTargetException e) {\n System.err.println(\"Can't create your class. Contructor threw an exception.\");\n System.exit(0);\n } // end try-catch\n\n return (Role)o;\n\n }", "public MetaRole createMetaRole(String sName, String sAdmin) throws IOException;", "@Override\r\n\tpublic void addRole(Role role) {\n\t\tgetHibernateTemplate().save(role);\r\n\t}", "public GraphNode addRole(String role){\n\t\tInteger intValue = addElement(role, 2);\n\t\t//System.out.println(role + \" Added with : \" + intValue);\n\t\tGraphNode roleVar = new GraphNode(intValue, 2);\n\t\tauthGraph.addVertex(roleVar);\n\t\treturn roleVar;\n\t}", "public Role(String name) {\r\n\t\tthis();\r\n\t\tthis.name = name;\r\n\t}", "public Role() {\n\t}", "@Override\n\tpublic void addRole(Role role) {\n\t\tSnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);\n\t\tlong id = idWorker.nextId();\n\t\trole.setRoleid(Long.toString(id));\n\t\troleMapper.addRole(role);\n\t}", "@Override\r\n\tpublic int addRole(Role role) {\n\t\treturn 0;\r\n\t}", "@Test\n\tpublic void testCreate() {\n\t\tApp app = new App();\n\t\tapp.setId(1L);\n\t\tRole role = new Role();\n\t\trole.setApp(app);\n\t\trole.setName(\"admin中国\");\n\t\troleService.create(role);\n\t}", "public Role() {\n\t super();\n }", "ISModifyProvidedRole createISModifyProvidedRole();", "long addUserRole(UserRole userRole);", "void addRoleToUser(int userID,int roleID);", "@Override\r\n\tpublic void addRole(Role role) {\n\t\troleDao.addRole(role);\r\n\t}", "public void setRole(java.lang.String value) {\n this.role = value;\n }", "void insertRole(Role role) throws DataException;", "public void addRole(Role role) {\n this.roles.add(role);\n }", "public RoleImpl() {}", "ISModifyRequiredRole createISModifyRequiredRole();", "public void createUser(String username, String password, String role) {\r\n Optional<User> user = userRepo.findByName(username);\r\n if (!user.isPresent()) {\r\n User newUser = new User();\r\n newUser.setName(username);\r\n newUser.setPassword(password);\r\n newUser.setRole(role);\r\n userRepo.save(newUser);\r\n }\r\n }", "public void addRole(AppRole role) {\n this.roles.add(role);\n }", "@Override\n\tpublic Role createNewSelfSourcedRole(String title, String location,\n\t\t\tDate start, Date end, String description, Double salary) {\n\t\tofferman.createNewSelfSourcedRole(title, location, start, end, description, salary);\n\t\treturn null;\n\t}", "public void addRole(Role role) {\n getRoles().add(role);\n }", "@RequestMapping(value = \"/new\", method = RequestMethod.GET)\n public String newRole(Model model) {\n model.addAttribute(\"roleCreate\", new CreateRoleDTO());\n return (WebUrls.URL_ROLE+\"/new\");\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public void setRole(String role)\n {\n _role=role;\n }", "public void setRole(String role) {\n this.role = role;\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public RoleEntity(){}", "<T extends Role> ISModifyRole<T> createISModifyRole();", "public Role saveRole(Role role) {\n return roleRepository.save(role);\n }", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "void addNewUser(User user, int roleId) throws DAOException;", "public void createSupplier(User user){\n BCryptPasswordEncoder encoder= new BCryptPasswordEncoder();\n user.setPassword(encoder.encode(user.getPassword()));\n //creating roles\n Role userRole = new Role(\"SUPPLIER\");//we create a role type client\n //a user can then take a list of roles\n List<Role> roles = new ArrayList<>();//list of roles\n roles.add(userRole);//add client role type to the list\n user.setRoles(roles);//set a user to a role type\n userRepository.save(user);//save( save is a crudrepository method) the user to the database.\n }", "Builder roleArn(String roleArn);", "@Override\n\tpublic void saveRole(Role role) {\n\t\tthis.roleMapper.insert(role);\n\t}", "@Override\r\n\tpublic int insertRole(AdminRole role) {\n\t\treturn adminRoleDao.insert(role);\r\n\t}", "public void ajouterRole(RoleUtilisateur ru);", "@GetMapping( value = {\"/add\"} )\n public String roleAddFrom(Model model) {\n model.addAttribute(\"addStatus\", true);\n model.addAttribute(\"role\", new Role());\n return \"role/addRole\";\n }", "public void add(Role role) throws QuestionBankSystemException,\n\t\t\tQuestionBankException;", "public SecRole getNewSecRole();", "public SecRole getNewSecRole();", "public void testCreateRoles1() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role1\", \"user1\", \"Login to admin console\");\r\n }", "public void addRole(String role) {\n StringBuffer rolesStringBuffer = new StringBuffer(this.roles);\n rolesStringBuffer.append(\",\").append(role);\n this.roles = rolesStringBuffer.toString();\n }", "@Test(groups = \"role\", priority = 1)\n public void testRoleAdd() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient.roleAdd(rootRole).get();\n this.authDisabledAuthClient.roleAdd(userRole).get();\n }", "@Override\n\tpublic Integer add(Role role) {\n\t\treturn roleDao.add(role);\n\t}", "void setRole(final SecurityRole role);", "public void createRoleData() throws DataLayerException\r\n\t{\r\n\t\t// ---------------------------------------------------------------\r\n\t\t// Task States\r\n\t\t// ---------------------------------------------------------------\r\n\t\tfor (Role.RoleType roleType : Role.RoleType.values())\r\n\t\t{\r\n\t\t\tRole role = createHelper.createRole(0);\r\n\t\t\trole.setRoleType(roleType);\r\n\t\t\troleDao.save(role);\r\n\t\t}\r\n\t}", "@Override\n @Transactional\n public AjaxResult createRole(RoleCreatePojo roleCreatePojo) {\n\n User loginUser = SpringUtils.getBean(LoginTokenService.class).getLoginUser(ServletUtils.getRequest());\n roleCreatePojo.getSysRole().setCreateBy(loginUser.getNickname());\n // 处理各类不能为空的字段\n if(null == roleCreatePojo.getSysRole().getRoleSort())\n roleCreatePojo.getSysRole().setRoleSort(\"1\");\n if(null == roleCreatePojo.getSysRole().getStatus())\n roleCreatePojo.getSysRole().setStatus(\"0\");\n if(null == roleCreatePojo.getSysRole().getCreateTime())\n roleCreatePojo.getSysRole().setCreateTime(Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()));\n if(null == roleCreatePojo.getSysRole().getRemark())\n roleCreatePojo.getSysRole().setRemark(roleCreatePojo.getSysRole().getRoleName());\n\n // 新增角色\n SysRole sysRole = roleCreatePojo.getSysRole();\n sysRoleMapper.insert(sysRole);\n Long roleId = sysRole.getRoleId();\n\n // 新增角色对应的menu\n if(null != roleCreatePojo.getMenuList() && 0 != roleCreatePojo.getMenuList().size()) {\n List<SysRoleMenu> sysRoleMenus = new ArrayList<>();\n roleCreatePojo.getMenuList().forEach(item -> {\n SysRoleMenu sysRoleMenu = new SysRoleMenu();\n sysRoleMenu.setRoleId(roleId);\n sysRoleMenu.setMenuId(item);\n\n sysRoleMenus.add(sysRoleMenu);\n });\n sysRoleMenuMapper.batchRoleMenu(sysRoleMenus);\n }\n\n return AjaxResult.success();\n }", "private void onAddRole() {\n\t\troleProxy.addRoleToUser(user, selectedRole);\n\t}", "public CreateRoleConstantOperation(String roleName) {\n \tSpliceLogUtils.trace(LOG, \"CreateRoleConstantOperation with role name {%s}\",roleName);\n this.roleName = roleName;\n }", "public CreateServiceRequest withRole(String role) {\n setRole(role);\n return this;\n }", "@PostMapping( value = {\"/add\", \"/update\"} )\n public String addRole(@Valid @ModelAttribute Role role, BindingResult result, Model model\n , RedirectAttributes redirectAttributes) {\n\n if ( result.hasErrors() && role.getId() == null ) {\n model.addAttribute(\"addStatus\", true);\n model.addAttribute(\"role\", role);\n return \"role/addRole\";\n }\n\n try {\n roleService.persist(role);\n return \"redirect:/role\";\n } catch ( Exception e ) {\n ObjectError error = new ObjectError(\"role\",\n \"This role is already in the System <br/>System message -->\" + e.toString());\n result.addError(error);\n model.addAttribute(\"addStatus\", false);\n model.addAttribute(\"role\", role);\n return \"role/addRole\";\n }\n\n }", "public SecUserrole getNewSecUserrole();", "public void setRole(String role) {\r\n\t\tthis.role = role;\r\n\t}", "@Test\n\tpublic void testAddRole_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "public void testCreateRoles3() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role3\", \"user3\", \"manage-security\");\r\n\r\n }", "public void addRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"No roles can be attached to user [ Anonymous ]\");\r\n }", "public User create(String username, String password, String role) throws AdException{\n\t\ttry{\n\t\t\tUser user = new User(username, password, role);\n\t\t\t\n\t\t\tbegin();\n\t\t\tgetSession().save(user);\n\t\t\tcommit();\n\t\t\t\n\t\t\treturn user;\n\t\t}catch(HibernateException e){\n\t\t\trollback();\n\t\t\te.printStackTrace();\n\t\t\tthrow new AdException(\"Could not create user with \" + username, e);\n\t\t}\n\t}", "@Override\n\tpublic void save(Role role) {\n\t\tjdbcTemplate.update(\"insert into role(name, description) values(?,?)\",\n\t\t\t\trole.getName(),role.getDescription());\n\t\n\t}", "public void setRole(String role) {\n\t\tthis.role = role;\n\t}", "public Role(String name, long museum_id, \r\n long id, Timestamp deleted, Timestamp insert, Timestamp update)\r\n {\r\n super(id, deleted, insert, update);\r\n this.name = name;\r\n this.museum_id = museum_id;\r\n }", "private UserRole(String name) {\n\t\tthis.name = name;\n\t}", "public void createTableRoles() {\n try (Statement statement = connection.createStatement()) {\n statement.executeUpdate(\"CREATE TABLE roles ( \" +\n \"id INT NOT NULL PRIMARY KEY,\"\n + \"roleName VARCHAR(256) NOT NULL)\");\n statement.executeUpdate(\"DROP TABLE IF EXISTS role \");\n } catch (SQLException sqlException) {\n sqlException.printStackTrace();\n }\n }", "@Override\n\tpublic int create(Rol r) {\n\t\treturn rolDao.create(r);\n\t}", "public Integer addUserRole(UserRole userRole) throws ClassNotFoundException, SQLException {\n\t\treturn saveWithPK(\"insert into user_role (id, name) VALUES(?, ?)\",\n\t\t\t\tnew Object[] { userRole.getId(), userRole.getName() });\n\t}", "@Test\n\tpublic void testAddRole_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "public int addRole(Role role){\n\t\tString sql = \"INSERT INTO `outpatient`.`role` \"\n\t\t\t\t+ \"(`role_power`, `role_describe`) \"\n\t\t\t\t+ \"VALUES (?, ?);\";\n\t\tConnection conn = new DBUtilFactory().getConn();\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\tps.setInt(1, role.getRole_power());\n\t\t\tps.setString(2, role.getRole_describe());\n\t\t\tps.execute();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn -1;\n\t\t} finally {\n\t\t\tclearUp(conn);\n\t\t}\n\t\tint role_id = -1;\n\t\tsql = \"select max(role_id) as id from role;\";\n\t\tconn = new DBUtilFactory().getConn();\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\trs = ps.executeQuery();\n\t\t\tif(rs.next()){\n\t\t\t\trole_id = rs.getInt(\"id\");\n\t\t\t}else{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn -1;\n\t\t} finally {\n\t\t\tclearUp(conn);\n\t\t}\n\t\treturn role_id;\n\t}", "@Override\n\tpublic void insertRole(Role role) {\n\t\tlogger.debug(\"RoleServiceImpl::insertRole Role = {}\", role.toString());\n\t\troleMapper.insertRole(role);\n\t\tlogger.debug(\"RoleServiceImpl::insertRole id = {}\", role.getId());\n\t}", "public void addRole(Role theRole) {\r\n\t\tthis.roles.add(theRole);\r\n\t\ttheRole.getUsers().add(this);\r\n\t}", "public void create() {\n String salt = PasswordUtils.getSalt(30);\n\n // Protect user's password. The generated value can be stored in DB.\n String mySecurePassword = PasswordUtils.generateSecurePassword(password, salt);\n\n // Print out protected password\n System.out.println(\"My secure password = \" + mySecurePassword);\n System.out.println(\"Salt value = \" + salt);\n Operator op = new Operator();\n op.setUsername(username);\n op.setDescription(description);\n op.setSalt(salt);\n op.setPassword(mySecurePassword);\n op.setRol(rol);\n operatorService.create(op);\n message = \"Se creo al usuario \" + username;\n username = \"\";\n description = \"\";\n password = \"\";\n rol = null;\n }", "boolean addUser(int employeeId, String name, String password, String role);", "public synchronized void createDefaultRoles() {\n if (roleDAO.findByName(getUserRole()) == null) {\n createRole(getUserRole());\n }\n if (roleDAO.findByName(getAdminRole()) == null) {\n createRole(getAdminRole());\n }\n }", "public PsecRole createOrUpdateRole(String name, boolean defaultRole, String... permissions) {\r\n PsecRole result = server.find(PsecRole.class).\r\n where().eq(\"name\", name).findUnique();\r\n if (result == null) {\r\n result = new PsecRole();\r\n result.setName(name);\r\n }\r\n if (!result.getAutoUpdatesForbidden()) {\r\n final List<PsecPermission> permissionObjects = server.find(PsecPermission.class).\r\n where().in(\"name\", (Object[])permissions).findList();\r\n result.setPsecPermissions(permissionObjects);\r\n result.setDefaultRole(defaultRole);\r\n } else {\r\n System.out.println(\"Can't update Role \" + name);\r\n }\r\n server.save(result);\r\n server.saveManyToManyAssociations(result, \"psecPermissions\");\r\n return result;\r\n }", "public Role() {\r\n\t\tpermissions = new ArrayList<Permission>();\r\n\t}", "public void setRole(String role) {\n\t\t\tthis.role = role;\n\t\t}", "public Builder setRole(com.message.MessageInfo.RoleVO value) {\n if (roleBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n role_ = value;\n onChanged();\n } else {\n roleBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }", "public Account createAccount() {\n\t\t\n\t\tAccountBuilder builder = new AccountBuilder();\n\t\tUserRole role = new UserRole();\n\t\trole.setUsername(getUsername());\n\t\trole.setRole(\"ROLE_USER\");\n\t\t\n\t\t//builds the account entity using the front end POJO\n\t\tbuilder\n\t\t\t.withUsername(getUsername())\n\t\t\t.withPassword(getPassword())\n\t\t\t.withLastName(getLastName())\n\t\t\t.withFirstName(getFirstName())\n\t\t\t.withRole(role)\n\t\t\t.withStatus(AccountStatus.ACTIVE)\n\t\t\t.withEmail(getEmail())\n\t\t\t.withStoreCd(getStoreCd());\n\t\t\n return builder.build();\n\t}", "public synchronized void setRole(final Role newValue) {\n checkWritePermission();\n role = newValue;\n }", "public IBusinessObject addToRole(IIID useriid, IIID roleiid, int ordernum)\n throws OculusException;", "public static GenericRoleVoter createInstance(ApplicationRole namedRole) {\n if (namedRole == null) {\n throw new AtbashIllegalActionException(\"(OCT-DEV-008) namedRole can't be null\");\n }\n\n GenericRoleVoter result = new GenericRoleVoter();\n result.subject = CDIUtils.retrieveInstance(Subject.class);\n result.permission = new RolePermission(namedRole.name());\n return result;\n }", "@Override\r\n\tpublic void addCredential(String role) {\n\r\n\t}", "@Override\n public ResponseEntity<ResponseMessage> addRole(String roleName, String email) {\n logger.info(STARTING_METHOD_EXECUTION);\n ResponseMessage responseMessage = new ResponseMessage();\n RoleModel roleModel=roleRepo.findByRole(roleName);\n if (roleModel == null) {\n RoleModel obj = new RoleModel();\n obj.setRole(roleName);\n obj.setCreatedOn(System.currentTimeMillis());\n obj.setCreatedBy(userRepo.getUserIdByUserEmail(email));\n roleRepo.save(obj);\n logger.debug(\"Role saved : {}\",roleName);\n responseMessage.setMessage(ROLE_ADDED);\n responseMessage.setStatusCode(HttpStatus.CREATED.value());\n logger.info(EXITING_METHOD_EXECUTION);\n return new ResponseEntity<>(responseMessage, HttpStatus.CREATED);\n }\n responseMessage.setMessage(ROLE_ALREADY_EXIST);\n responseMessage.setStatusCode(HttpStatus.CONFLICT.value());\n logger.debug(\"Role {} already exits\",roleName);\n logger.info(EXITING_METHOD_EXECUTION);\n return new ResponseEntity<>(responseMessage, HttpStatus.CONFLICT);\n }", "public void testCreateRoles4() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role4\", \"user4\", \"upload-services\");\r\n\r\n }" ]
[ "0.7477064", "0.7133639", "0.710821", "0.7100776", "0.70197153", "0.69617224", "0.6724931", "0.66875476", "0.66526765", "0.6651947", "0.660904", "0.65620345", "0.65369505", "0.65327567", "0.64948577", "0.64948577", "0.6468678", "0.63804907", "0.63703465", "0.63692474", "0.6346241", "0.634032", "0.6324896", "0.6322145", "0.6321111", "0.63057476", "0.62569153", "0.6251983", "0.62472695", "0.622324", "0.6213458", "0.61758894", "0.6157801", "0.61425954", "0.6124635", "0.6123765", "0.6108758", "0.60762405", "0.60374564", "0.6018895", "0.6005362", "0.60034645", "0.5975418", "0.5966503", "0.5955604", "0.59406465", "0.5935445", "0.59205353", "0.5918024", "0.59162414", "0.5912936", "0.58865166", "0.58827424", "0.5879221", "0.5843328", "0.5837347", "0.5835267", "0.5835267", "0.58238834", "0.58106947", "0.5800412", "0.5796448", "0.57891536", "0.5780735", "0.5777967", "0.57778764", "0.5771315", "0.57665473", "0.5762903", "0.5728166", "0.5727502", "0.57170093", "0.5716449", "0.5699508", "0.569205", "0.5681848", "0.5680109", "0.56758815", "0.5655524", "0.5644803", "0.5642068", "0.5635775", "0.5590062", "0.55888575", "0.55653167", "0.5565097", "0.55467564", "0.55420953", "0.5532984", "0.5521617", "0.55188626", "0.55112565", "0.55028486", "0.54978704", "0.54916334", "0.54903686", "0.54868656", "0.54792535", "0.54740095", "0.54739404" ]
0.6666349
8
Creates a table that is the concatenation of one or more existing tables. It is equivalent to the SQL UNION ALL operator. NoncharN 'string' and 'bytes' column types cannot be included in a union, neither can columns with the property 'store_only'.
public CreateUnionResponse createUnion(CreateUnionRequest request) throws GPUdbException { CreateUnionResponse actualResponse_ = new CreateUnionResponse(); submitRequest("/create/union", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Table noCommonJoin(String name, Table t1, Table t2) {\n {\n String[] names = new String[t1.colSize() + t2.colSize()];\n String[] types = new String[t1.colSize() + t2.colSize()];\n\n System.arraycopy(t1.getColNames(), 0, names, 0, t1.colSize());\n System.arraycopy(t2.getColNames(), 0, names, t1.colSize(), t2.colSize());\n System.arraycopy(t1.getColTypes(), 0, types, 0, t1.colSize());\n System.arraycopy(t2.getColTypes(), 0, types, t1.colSize(), t2.colSize());\n\n Table t = new Table(name, names, types);\n\n for (int i = 0; i < t1.rowSize(); i += 1) {\n for (int j = 0; j < t2.rowSize(); j += 1) {\n t.insertLastRow(t1.combineRows(t2, i, j));\n }\n }\n return t;\n }\n }", "TableFull createTableFull();", "@Test void testInterpretUnionAll() {\n rootSchema.add(\"simple\", new ScannableTableTest.SimpleTable());\n final String sql = \"select * from \\\"simple\\\"\\n\"\n + \"union all\\n\"\n + \"select * from \\\"simple\\\"\";\n sql(sql).returnsRowsUnordered(\"[0]\", \"[10]\", \"[20]\", \"[30]\", \"[0]\", \"[10]\",\n \"[20]\", \"[30]\");\n }", "TABLE createTABLE();", "public static ArrayList<ArrayList<String>> unionD(String table1Name, String table2Name){\n\t\tArrayList<ArrayList<String>> union = new ArrayList<ArrayList<String>>();\r\n\t\t//these will hold the data from the input tables\r\n\t\tArrayList<ArrayList<String>> columns1 = new ArrayList<ArrayList<String>>();\r\n\t\tArrayList<ArrayList<String>> columns2 = new ArrayList<ArrayList<String>>();\r\n\t\t//find the input tables in the database list\r\n\t\tfor (int i = 0; i < tables.size(); i++) {\r\n\t\t\tif (tables.get(i).getName().equals(table1Name)) {\r\n\t\t\t\tcolumns1 = new ArrayList<ArrayList<String>>(tables.get(i).datas);\r\n\t\t\t}\r\n\t\t\tif (tables.get(i).getName().equals(table2Name)) {\r\n\t\t\t\tcolumns2 = new ArrayList<ArrayList<String>>(tables.get(i).datas);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check if the tables are union compatable\r\n\t\tif (columns1.size() != columns2.size()) {\r\n\t\t\tSystem.out.println(\"Unable to perform union - unnequal number of columns.\");\r\n\t\t}\r\n\t\telse {\t//only continue if they are union compatable\r\n\t\t\t//true if all columns have the same type\r\n\t\t\tint sameTypes = 1;\r\n\t\t\tint type1 = 0;\r\n\t\t\tint type2 = 0;\r\n\t\t\t//a max char value of -1 indicates the type is integer\r\n\t\t\tfor (int j = 0; j < columns1.size(); j++) {\r\n\t\t\t\ttype1 = Integer.valueOf(new String(columns1.get(j).get(1)));\r\n\t\t\t\ttype2 = Integer.valueOf(columns2.get(j).get(1));\r\n\t\t\t\tif (type1 > 0) { type1 = 1; }\r\n\t\t\t\telse if (type1 < 0) { type1 = -1; }\r\n\t\t\t\tif (type2 > 0) { type2 = 1; }\r\n\t\t\t\telse if (type2 < 0) { type2 = -1; }\r\n\t\t\t\t//if the types were not equal, don't continue\r\n\t\t\t\tif (type1 != type2) {\r\n\t\t\t\t\tSystem.out.println(\"Unable to perform union - incompatible types.\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\t//continue if the types are equal\r\n\t\t\t\t\t\t//create new columns holding the name from the first table and the greatest char max\r\n\t\t\t\t\tArrayList<String> newColumn = new ArrayList<String>();\r\n\t\t\t\t\tint largestChar = 0;\r\n\t\t\t\t\tif (type1 != -1) {\t//if they aren't integers\r\n\t\t\t\t\t\t//find the largest max char value\r\n\t\t\t\t\t\tif (Integer.parseInt(columns1.get(j).get(1)) >= Integer.parseInt(columns2.get(j).get(1))) {\r\n\t\t\t\t\t\t\tlargestChar = Integer.parseInt(new String(columns1.get(j).get(1)));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse { \r\n\t\t\t\t\t\t\tlargestChar = Integer.parseInt(columns2.get(j).get(1)); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//keep the type as integer\r\n\t\t\t\t\telse { \r\n\t\t\t\t\t\tlargestChar = -1; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t//use the name from the first table and largest char max\r\n\t\t\t\t\tnewColumn.add(new String(columns1.get(j).get(0)));\r\n\t\t\t\t\tnewColumn.add(String.valueOf(largestChar));\r\n\t\t\t\t\tunion.add(newColumn);\r\n\t\t\t\t\t//check if there are equal rows to avoid duplicates\r\n\t\t\t\t\tint colCount = 0;\r\n\t\t\t\t\tfor (int n = 2; n < columns1.get(colCount).size(); n++) {\t//for each row in table1\r\n\t\t\t\t\t\tunion.get(j).add(new String(columns1.get(j).get(n)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tfor(int t = 2; t<columns2.get(0).size(); t++){\t//column2 row\r\n\t\t\t\tboolean completeUniqe = true;\r\n\t\t\t\tfor(int p = 2; p < union.get(0).size(); p++){// rows of union\r\n\t\t\t\t\tint sameCount = 0;\r\n\t\t\t\t\tfor(int u = 0; u<union.size(); u++){//columns of union\r\n\t\t\t\t\t\tif(columns2.get(u).get(t).equals(union.get(u).get(p))){\r\n\t\t\t\t\t\t\tsameCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(sameCount);\r\n\t\t\t\t\tif(sameCount == union.size()){\r\n\t\t\t\t\t\tcompleteUniqe = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(completeUniqe){\r\n\t\t\t\t\tfor(int u = 0; u<union.size(); u++){//columns of union\r\n\t\t\t\t\t\tunion.get(u).add(new String(columns2.get(u).get(t)));\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\treturn union;\r\n\t}", "public String createTable() {\n\n String statement = \"CREATE TABLE \" + tableName + \"( \";\n\n //go through INTEGER, FLOAT, TEXT columns\n Iterator iterator = Iterables.filter(columns.entrySet(), entry -> entry.getValue().getType() instanceof String).iterator();\n\n while (iterator.hasNext()) {\n Map.Entry<Element, FieldData> fieldDataEntry = (Map.Entry<Element, FieldData>) iterator.next();\n statement += fieldDataEntry.getValue().createColumn() + \",\";\n }\n\n return (new StringBuilder(statement).replace(statement.length() - 1, statement.length(), \"\").toString() + \")\").toUpperCase();\n }", "public abstract String[] createTablesStatementStrings();", "private String createTableSQL()\n\t{\n\t\tStringBuffer str = new StringBuffer();\n\n\t\t// Keep track of the list of fields\n\t\tList<String> listFields = new ArrayList<String>();\n\n\t\t// Table command\n\t\tstr.append(\"CREATE TABLE \" + getFullPath() + \"( \");\n\t\tstr.append(createStandardGZFields());\n\n\t\t// Loop through all InputFields\n\t\tfor (InputFieldSet fieldSet : function.getInputFieldSets())\n\t\t{\n\t\t\tfor (InputField inputField : fieldSet.getInputFields())\n\t\t\t{\n\t\t\t\t// Phase 2 does not support repeating fields being journalled\n\t\t\t\tif (!Field.isRepeating(inputField))\n\t\t\t\t{\n\t\t\t\t\t// Field\n\t\t\t\t\tString fieldName = SQLToolbox.cvtToSQLFieldName(inputField.getId());\n\n\t\t\t\t\t// add if not yet existing\n\t\t\t\t\tif (listFields.indexOf(fieldName) == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr.append(\", \");\n\t\t\t\t\t\tString fieldDataType = inputField.getDataType();\n\t\t\t\t\t\tString fieldType = SQLToolbox.cvtToSQLFieldType(fieldDataType, inputField.getSize(), inputField\n\t\t\t\t\t\t\t\t\t\t.getDecimals());\n\t\t\t\t\t\tString fieldDefault = SQLToolbox.cvtToSQLDefault(fieldDataType);\n\t\t\t\t\t\tstr.append(fieldName + \" \" + fieldType + \" \" + \" not null default \" + fieldDefault);\n\t\t\t\t\t\tlistFields.add(fieldName);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// End\n\t\tstr.append(\" ) \");\n\t\t// RCDFMT \" + getJournalRcdName());\n\n\t\treturn str.toString();\n\t}", "protected abstract void addTables();", "TableOrAlias createTableOrAlias();", "UnpivotTable createUnpivotTable();", "public Table asTable() {\n Table table = Table.create(this.name());\n for (Column<?> column : this.columns()) {\n table.addColumns(column);\n }\n return table;\n }", "tbls createtbls();", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }", "Table createTable();", "public String getCreationSQL(final boolean quoteNames) {\n final StringBuilder sbSQL = new StringBuilder();\n sbSQL.append(\"CREATE TABLE \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" (\\n\");\n \n for (PgColumn column : columns) {\n sbSQL.append(\"\\t\");\n sbSQL.append(column.getFullDefinition(quoteNames, false));\n sbSQL.append(\",\\n\");\n }\n \n sbSQL.setLength(sbSQL.length() - 2);\n sbSQL.append(\"\\n)\");\n \n if ((inherits != null) && (inherits.length() > 0)) {\n sbSQL.append(\"\\nINHERITS \");\n sbSQL.append(inherits);\n }\n \n sbSQL.append(';');\n \n for (PgColumn column : getColumnsWithStatistics()) {\n sbSQL.append(\"\\nALTER TABLE ONLY \");\n sbSQL.append(PgDiffUtils.getQuotedName(name, quoteNames));\n sbSQL.append(\" ALTER COLUMN \");\n sbSQL.append(\n PgDiffUtils.getQuotedName(column.getName(), quoteNames));\n sbSQL.append(\" SET STATISTICS \");\n sbSQL.append(column.getStatistics());\n sbSQL.append(';');\n }\n \n return sbSQL.toString();\n }", "@Test void testInterpretUnion() {\n rootSchema.add(\"simple\", new ScannableTableTest.SimpleTable());\n final String sql = \"select * from \\\"simple\\\"\\n\"\n + \"union\\n\"\n + \"select * from \\\"simple\\\"\";\n sql(sql).returnsRowsUnordered(\"[0]\", \"[10]\", \"[20]\", \"[30]\");\n }", "public void doCreateTable();", "OrTable createOrTable();", "Table regularSelect(String name, String[] columns, String[] tablesList) {\n Table t1;\n Table t2;\n tablesList = new LinkedHashSet<String>(Arrays.asList(tablesList)).toArray(new String[0]);\n\n //Parse Arithmetic Op\n LinkedList<LinkedList> arithOp = p.arithOp(columns);\n\n // creates a new table from all columns - before running operators\n if (arithOp != null) {\n //get real column names, operated columns, and operation\n LinkedList<String> columnsToKeep = p.realCols(columns);\n LinkedList<String> colNames = arithOp.get(0);\n LinkedList<String> lhs = arithOp.get(1);\n LinkedList<String> rhs = arithOp.get(2);\n LinkedList<String> operators = arithOp.get(3);\n\n t1 = tables.get(tablesList[0]);\n t1 = selectColumns(name, tablesList[0], t1.getColNames());\n\n for (int i = 1; i < tablesList.length; i++) {\n t2 = tables.get(tablesList[i]);\n t2 = selectColumns(name, tablesList[i], t2.getColNames());\n t1 = joinTwoTables(name, t1, t2);\n tables.put(t1.getName(), t1);\n\n }\n\n /**run over the arithOp Columns that needs to be handeled\n * - t1 is the new combined table! And inserts the new column.*/\n for (int i = 0; i < operators.size(); i += 1) {\n t1.insertNewColumn(t1.arithmaticOperator(colNames.get(i),\n lhs.get(i), rhs.get(i), operators.get(i)));\n }\n t1.removeColumn(columnsToKeep);\n return t1;\n }\n\n if (columns[0].equals(\"*\")) {\n t1 = tables.get(tablesList[0]);\n t1 = selectColumns(name, tablesList[0], t1.getColNames());\n\n for (int i = 1; i < tablesList.length; i++) {\n t2 = tables.get(tablesList[i]);\n t2 = selectColumns(name, tablesList[i], t2.getColNames());\n t1 = joinTwoTables(name, t1, t2);\n tables.put(t1.getName(), t1);\n }\n\n return t1;\n // Check similar and distinct column names of tables\n } else {\n t1 = tables.get(tablesList[0]);\n t1 = selectColumns(name, tablesList[0], columns);\n for (int i = 1; i < tablesList.length; i++) {\n t2 = tables.get(tablesList[i]);\n t2 = selectColumns(name, tablesList[i], columns);\n t1 = joinTwoTables(name, t1, t2);\n tables.put(t1.getName(), t1);\n }\n\n return t1;\n }\n\n }", "FromTable createFromTable();", "Table8 create(Table8 table8);", "private String getCloneSetTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET(\");\n \t\tbuilder.append(\"CLONE_SET_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"OWNER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"ELEMENTS TEXT NOT NULL,\");\n \t\tbuilder.append(\"NUMBER_OF_ELEMENTS INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "@Override\n public List<String> buildCreateTableStatements(TableId table,\n Collection<SinkRecordField> fields) {\n List<String> sqlQueries = new ArrayList<>();\n if (table.schemaName() != null) {\n sqlQueries.add(buildCreateSchemaStatement(table));\n }\n sqlQueries.add(super.buildCreateTableStatement(table, fields));\n\n Optional<SinkRecordField> timeField = getTimeField(fields);\n if (!timeField.isPresent()) {\n log.warn(\"Time column is not present. Skipping hypertable creation..\");\n } else {\n sqlQueries.add(buildCreateHyperTableStatement(table, timeField.get().name()));\n }\n\n return sqlQueries;\n }", "public Builder addAllTables(\n Iterable<? extends Table> values) {\n if (tablesBuilder_ == null) {\n ensureTablesIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, tables_);\n onChanged();\n } else {\n tablesBuilder_.addAllMessages(values);\n }\n return this;\n }", "Table getBaseTable();", "public static String createSimpleCreateTableQuery(String tableName, String storageEngine, String selectQuery) {\n builder.setLength(0);\n builder.append(\"CREATE TABLE `\").append(tableName).append(\"` ENGINE = \").append(storageEngine).append(\" AS \");\n builder.append(selectQuery);\n return builder.toString();\n }", "protected void createInitialTables() throws SQLException {\n\t\n\t\t// create one table per type with the corresponding attributes\n\t\tfor (String type: entityType2attributes.keySet()) {\n\t\t\tcreateTableForEntityType(type);\n\t\t}\n\t\t\n\t\t// TODO indexes !\n\t\t\n\t}", "private void addTables() {\r\n for (SQLTable table : getType().getTables()) {\r\n if (getExpr4Tables().get(table) == null) {\r\n getExpr4Tables().put(table, new HashMap<String,AttributeTypeInterface>());\r\n }\r\n }\r\n\r\n }", "public boolean createAllTables (){\n try {\n this.execute(CREATE_PEOPLE);\n this.execute(CREATE_AUTHOR);\n this.execute(CREATE_EMPLOYEE);\n this.execute(CREATE_MEETING);\n this.execute(CREATE_COVERPRICE);\n this.execute(CREATE_PRICEPARAMETERS);\n this.execute(CREATE_ORDER);\n this.execute(CREATE_CORRECTIONS);\n this.execute(CREATE_BOOK);\n this.execute(CREATE_COVERLINK);\n return true;\n } catch (SQLException | IOException | ClassNotFoundException e) {\n log.error(e);\n return false;\n }\n }", "@Override\n public SqlDatabaseTable createTable(String tableName, int columnCount, boolean dropExist) {\n StringBuilder sql = new StringBuilder();\n if (dropExist) {\n sql.append(\"DROP TABLE IF EXISTS `\").append(tableName).append(\"`;\");\n executeSql(sql.toString());\n sql.setLength(0);\n }\n\n // Ignored check because only one statement is executed\n // if (!dropExist && SqlStorageEngine.getInstance().checkTableExist(tableName))\n\n sql.append(\"CREATE TEMPORARY TABLE\");\n if (!dropExist) {\n sql.append(\" IF NOT EXISTS\");\n }\n sql.append(\" `\").append(tableName).append(\"`\");\n sql.append(\" ( `id` INT NOT NULL AUTO_INCREMENT, `uniq` CHAR(32) NOT NULL UNIQUE,\");\n for (int i = 0; i < columnCount; i++) {\n sql.append(\" `_\").append(i).append(\"` VARCHAR(32) NULL,\");\n sql.append(\"INDEX (`_\").append(i).append(\"`),\");\n }\n sql.append(\" PRIMARY KEY (`id`)) ENGINE = MEMORY;\");\n executeSql(sql.toString());\n\n // Ignore this, we use create clause to create index\n // createIndexes(tableName, columnCount);\n\n return new SqlDatabaseRefTable(tableName, columnCount);\n }", "public void createTables()\n {\n String[] sqlStrings = createTablesStatementStrings();\n String sqlString;\n Statement statement;\n\n System.out.println(\"Creating table(s):\" +\n Arrays.toString(tableNames));\n for (int i=0; i<sqlStrings.length; i++)\n try\n {\n statement = connect.createStatement();\n\n sqlString = sqlStrings[i];\n\n System.out.println(\"SQL: \" + sqlString);\n\n statement.executeUpdate(sqlString);\n }\n catch (SQLException ex)\n {\n System.out.println(\"Error creating table: \" + ex);\n Logger.getLogger(DatabaseManagementDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private StringBuilder startBuild() {\n StringBuilder strBuilder = new StringBuilder()\n .append(\"CREATE EXTERNAL TABLE IF NOT EXISTS \");\n if (databaseName != null) {\n strBuilder.append(databaseName).append('.');\n }\n strBuilder.append(tableName);\n\n // yeah... schema is not always required.\n if (hiveSchema != null) {\n strBuilder.append(\" \").append(hiveSchema);\n }\n\n if (tableComment != null && !tableComment.isEmpty()) {\n strBuilder.append(\" COMMENT '\")\n .append(tableComment)\n .append(\"'\");\n }\n\n if (partitioning != null && !partitioning.getFields().isEmpty()) {\n strBuilder.append(\" PARTITIONED BY (\");\n for (Map.Entry<String, Partitioning.FieldType> entry : partitioning.getFields().entrySet()) {\n strBuilder = shouldEscapeColumns ?\n strBuilder.append('`').append(entry.getKey()).append('`') : strBuilder.append(entry.getKey());\n strBuilder.append(\" \")\n .append(FieldTypes.toHiveType(entry.getValue()))\n .append(\", \");\n }\n // remove trailing \", \"\n strBuilder.deleteCharAt(strBuilder.length() - 1)\n .deleteCharAt(strBuilder.length() - 1)\n .append(\")\");\n }\n\n if (rowFormat != null) {\n strBuilder.append(\" ROW FORMAT \").append(rowFormat);\n }\n return strBuilder;\n }", "public Tables getTables(){\n\t\tTables result=null;\n\t\tTable t1=(column1==null || column1.getTableName()==null)?(null):new Table(column1.getTableName());\t\t\n\t\tTable t2=(column2==null || column2.getTableName()==null)?(null):new Table(column2.getTableName());\n\t\tif (t1!=null) { \n\t\t\tresult=new Tables(t1);\n\t\t\tresult.add(t2);\n\t\t} else if(t2!=null){\n\t\t\tresult=new Tables(t2);\n\t\t}\n\t\treturn result;\n\t}", "BTable createBTable();", "private void calcTableList() throws SQLException {\n tableList = new TableList(session);\n SQLTokenizer[] tzs = tableListTokens.parse(SQLTokenizer.COMMA);\n for(int i = 0; tzs != null && i < tzs.length; i++) {\n if(tzs[i].countTokens() == 0) throw new SQLException(\"Syntax error\");\n String correlation = null;\n String table = tzs[i].getToken(0);\n int n = 1;\n if(tzs[i].getType(1) == Keyword.AS) {\n n++;\n }\n correlation = tzs[i].getToken(n);\n tableList.addTable(table, correlation);\n }\n }", "public Table mixNestedTables(){\n\t\tTable nTable = new Table(table.getName());\n\t\ttable.getColumns().forEach(c->{\n\t\t\tnTable.addColumn(c.clone());\n\t\t});\n\t\ttable.getSubtables().forEach(t->{\n\t\t\tTableDivision td = new TableDivision(t);\n\t\t\tList<Column> lc = td.getNestedColumns();\n\t\t\tlc.forEach(sc->{\n\t\t\t\tnTable.addColumn(sc.clone());\n\t\t\t});\n\t\t});\n\t\treturn nTable;\n\t}", "private List<Table> getTables() {\n List<Table> tables = new ArrayList<>();\n\n DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n Query query = new Query(\"Table\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n String firstName = (String) entity.getProperty(\"firstName\");\n String lastName = (String) entity.getProperty(\"lastName\");\n String email = (String) entity.getProperty(\"email\");\n String phoneNumber = (String) entity.getProperty(\"phoneNumber\");\n String restName = (String) entity.getProperty(\"restName\");\n String restAdd = (String) entity.getProperty(\"restAdd\");\n String restDescrip = (String) entity.getProperty(\"restDescrip\");\n String dateTime = (String) entity.getProperty(\"dateTime\");\n String maxSize = (String) entity.getProperty(\"maxSize\");\n String otherNotes = (String) entity.getProperty(\"otherNotes\");\n List members = (List) entity.getProperty(\"members\");\n double lat = (double) entity.getProperty(\"lat\");\n double lng = (double) entity.getProperty(\"lng\");\n\n\n \n\n Table table = new Table(firstName, lastName, email, phoneNumber, restName, restAdd, restDescrip, dateTime, maxSize, otherNotes, members, lat, lng);\n tables.add(table);\n }\n return tables;\n }", "@Test(timeout = 4000)\n public void test043() throws Throwable {\n String[] stringArray0 = new String[6];\n String string0 = SQLUtil.innerJoin(\"create table \", stringArray0, (String) null, \"FMK$x:Q_QfZ|{K*oyK \", stringArray0);\n assertEquals(\"null as FMK$x:Q_QfZ|{K*oyK on create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null and create table .null = FMK$x:Q_QfZ|{K*oyK .null\", string0);\n }", "private void createTables() {\n\t\tStatement s = null;\n\t\ttry {\n\t\t\ts = conn.createStatement();\n\t\t} catch (SQLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\tString createString = \"CREATE TABLE targeteprs (\" +\n\t\t\t\t\t \"targetepr varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"processID varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"operation varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"status varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"uniqueID varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"correlationKey varchar(255) NOT NULL, \"+\n\t\t\t\t\t \"correlationValue varchar(255) NOT NULL)\";\n\t\t//System.out.println(\"CREATE: \" + createString);\n\t\tSystem.out.println(\"--> Created targetepr table.\");\n\t\ttry {\n\t\t\tthis.insertQuery(createString);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tcreateString = \"CREATE TABLE workflow (\" +\n\t\t\t\t\t \"uniqueID varchar(100) NOT NULL, \" +\n\t\t\t\t\t \"processID varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"operation varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"status varchar(255) NOT NULL, \" +\n\t\t\t\t\t \"correlationKey varchar(255) NOT NULL, \"+\n\t\t\t\t\t \"correlationValue varchar(255) NOT NULL)\";\n\t\t//System.out.println(\"CREATE: \" + createString);\n\t\tSystem.out.println(\"--> Created workflow table.\");\n\t\ttry {\n\t\t\tthis.insertQuery(createString);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void createTables() throws DatabaseAccessException {\n\t\tStatement stmt = null;\n\t\tPreparedStatement prepStmt = null;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\n\t\t\t// be sure to drop all tables in case someone manipulated the database manually\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS DynamicConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Features;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Groups;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Metadata;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Objects;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS StaticConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Subspaces;\");\n\n\t\t\t// populate database with tables.. by using ugly sql\n\t\t\tstmt.executeUpdate(\"CREATE TABLE DynamicConstraints(Id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t+ \" Operator INTEGER, FeatureReference INTEGER,\"\n\t\t\t\t\t+ \" GroupReference INTEGER, Value FLOAT, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Features(Id INTEGER PRIMARY KEY AUTOINCREMENT,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"), OutlierFlag BOOLEAN, Min FLOAT, Max FLOAT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Groups(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"),\"\n\t\t\t\t\t+ \" Visibility BOOLEAN, Color INTEGER, ColorCalculatedByFeature INTEGER, Description TEXT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Metadata(Version INTEGER);\");\n\n\t\t\t// Object table is created in initFeatures, to boost performance\n\n\t\t\tstmt.executeUpdate(\"CREATE TABLE StaticConstraints(Id INTEGER, GroupReference INTEGER,\"\n\t\t\t\t\t+ \" ObjectReference INTEGER, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Subspaces(Id INTEGER, FeatureReference INTEGER,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"));\");\n\n\t\t\tstmt.close();\n\n\t\t\t// after creating the tables, write the layout version\n\t\t\tprepStmt = this.connection.prepareStatement(\"INSERT INTO Metadata VALUES(?);\");\n\t\t\tprepStmt.setInt(1, DatabaseConfiguration.LAYOUTVERSION);\n\t\t\tprepStmt.execute();\n\n\t\t\tprepStmt.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DatabaseAccessException(Failure.LAYOUT);\n\t\t}\n\t}", "String createNewTable(String name,\n String[] colNames, String[] colTypes) {\n\n try {\n if (tables.get(name) != null) {\n return \"ERROR: Table already exists\";\n\n }\n Table t = new Table(name, colNames, colTypes);\n tables.put(name, t);\n\n return \"\";\n } catch (NullPointerException e) {\n return \"ERROR: Malformed Table\";\n } catch (IllegalArgumentException e) {\n return \"ERROR: Malformed Table\";\n }\n\n\n }", "public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void createTransactionsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE transactions \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \"\n\t\t\t\t\t+ \"owner INT, amount DOUBLE, source BIGINT, sourceType VARCHAR(20), target BIGINT, targetType VARCHAR(20), comment VARCHAR(255), time BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table transactions\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of transactions table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "public static void addDbCols(List<Individual> rows, Connection c, String[] tables, List<Column> allColumns) throws IOException {\n\t\tMenu menu = new AutoMenu();\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tfor (int i = 0; i < tables.length; i++) {\n\t\t\t\tString table = tables[i];\n\t\t\t\tboolean choice = menu.getChoice(table); //insurance\n\t\t\t\tif (choice) {\n\t\t\t\t\t//medical records\n\t\t\t\t\tString[] addTables = menu.getMvTables(table);\n\t\t\t\t\tfor (int j = 0; j < addTables.length; j++) {\t\n\t\t\t\t\t\tString newTable = addTables[j];\n\n\t\t\t\t\t\tList<Column> newTableCols = menu.getTableCols(newTable, allColumns); //disease, prescription\n\t\t\t\t\t\tColumn mv = null;\t\n\t\t\t\t\t\tColumn mv2 = null;\n\t\t\t\t\t\tfor (Column col : newTableCols) {\n\t\t\t\t\t\t\tSource s = menu.getSource(col);\n\t\t\t\t\t\t\tif (s.equals(Source.MULTI_VALUE)) {\n\t\t\t\t\t\t\t\tmv = col;\n\t\t\t\t\t\t\t} else if (s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\t\t\tmv2 = col;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tString mvType = \"\";\n\t\t\t\t\t\tString mv2Type = \"\";\n\t\t\t\t\t\tString addCreate = \"CREATE TABLE \" + newTable + \"( \";\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Column col : newTableCols) {\n\t\t\t\t\t\t\tSource s = menu.getSource(col);\n\t\t\t\t\t\t\tString val = rows.get(0).getValues().get(col);\n\t\t\t\t\t\t\tString type = \"\";\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tInteger.parseInt(val);\n\t\t\t\t\t\t\t\ttype = \"BIGINT\";\n\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\ttype = \"VARCHAR\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\t\t\taddCreate = addCreate + col.datatype + \" \" + type + \" NOT NULL, \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (s.equals(Source.MULTI_VALUE)) {\n\t\t\t\t\t\t\t\tmvType = type;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmv2Type = type;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\taddCreate = addCreate + mv.datatype + \" \" + mvType + \n\t\t\t\t\t\t\t\t\", \" + mv2.datatype + \" \" + mv2Type + \");\"; //so matches\n\t\t\t\t\t\t//order below\n\n\t\t\t\tstmt = c.prepareStatement(addCreate);\n\t\t\t\tstmt.executeUpdate();\t\t\t\n\t\t\t\tString all = \"\";\n\t\t\t\tString some = \"\";\n\t\t\t\tString none = \"\";\n\t\t\t\tfor (Column colTwo : newTableCols) {\n\t\t\t\t\tSource s = menu.getSource(colTwo);\n\t\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\tnone = none + colTwo.datatype + \",\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnone = none.substring(0, none.length() - 1);\n\t\t\t\tsome = none + \",\" + mv.datatype;\n\t\t\t\tall = some + \",\" + mv2.datatype;\n\n\t\t\t\tfor (Individual person : rows) {\n\t\t\t\t\tMap<String, String> mvMap = person.mvTwo;\n\t\t\t\t\tMap<Column, String> vals = person.getValues();\t\t\t\n\t\t\t\t\tif (mvMap.size() > 0) {\n\t\t\t\t\tfor (String mvS : mvMap.keySet()) {\n\t\t\t\t\t\tString mv2S = mvMap.get(mvS);\n\t\t\t\t\t\tif (mv2S.length() > 0) {\n\t\t\t\t\t\tString[] parts = mv2S.split(\",\");\n\t\t\t\t\t\tfor (int l = 0; l < parts.length; l++) {\n\t\t\t\t\t\t\tString addInsert = \"INSERT INTO \" + newTable + \" (\" + all + \") \" + \" VALUES (\";\t \n\t\t\t\t\t\t\tfor (Column colTwo : newTableCols) {\n\t\t\t\t\t\t\t\tSource s = menu.getSource(colTwo);\n\t\t\t\t\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\t\t\t\tString check = vals.get(colTwo);\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tInteger.parseInt(check);\n\t\t\t\t\t\t\t\t\t\taddInsert = addInsert + check + \", \";\n\t\t\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\t\taddInsert = addInsert + \"'\" + check + \"', \";\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\ttry {\n\t\t\t\t\t\t\t\tInteger.parseInt(mvS);\n\t\t\t\t\t\t\t\taddInsert = addInsert + mvS + \", \";\n\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\taddInsert = addInsert + \"'\" + mvS + \"', \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tInteger.parseInt(parts[l]);\n\t\t\t\t\t\t\t\taddInsert = addInsert + parts[l] + \");\";\n\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\taddInsert = addInsert + \"'\" + parts[l] + \"');\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstmt = c.prepareStatement(addInsert);\n\t\t\t\t\t\t\tstmt.executeUpdate();\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tString addInsert = \"INSERT INTO \" + newTable + \" (\" + some + \") \" + \" VALUES (\";\n\t\t\t\t\t\t\tfor (Column colTwo : newTableCols) {\n\t\t\t\t\t\t\t\tSource s = menu.getSource(colTwo);\n\t\t\t\t\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\t\t\t\tString check = vals.get(colTwo);\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tInteger.parseInt(check);\n\t\t\t\t\t\t\t\t\t\taddInsert = addInsert + check + \", \";\n\t\t\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\t\t\taddInsert = addInsert + \"'\" + check + \"', \";\n\t\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\tSystem.out.println(\"what is disease: \" + mvS);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tInteger.parseInt(mvS);\n\t\t\t\t\t\t\t\taddInsert = addInsert + mvS + \");\";\n\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\taddInsert = addInsert + \"'\" + mvS + \"');\";\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\tstmt = c.prepareStatement(addInsert);\n\t\t\t\t\t\t\tstmt.executeUpdate();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tString addInsert = \"INSERT INTO \" + newTable + \" (\" + none + \") \" + \" VALUES (\";\n\t\t\t\t\t\tfor (Column colTwo : newTableCols) {\n\t\t\t\t\t\t\tSource s = menu.getSource(colTwo);\n\t\t\t\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\t\t\tString check = vals.get(colTwo);\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tInteger.parseInt(check);\n\t\t\t\t\t\t\t\t\taddInsert = addInsert + check + \", \";\n\t\t\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\t\t\t\taddInsert = addInsert + \"'\" + check + \"', \";\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}\n\t\t\t\t\t\taddInsert = addInsert.substring(0, addInsert.length() - 2) + \");\";\n\t\t\t\t\t\tstmt = c.prepareStatement(addInsert);\n\t\t\t\t\t\tstmt.executeUpdate();\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t \t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tstmt.close();\n\t\t\tc.commit();\n\t\t\tc.close();\n\t\t\t\t\t\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n\t System.exit(0);\n\t\t}\t\t\n\t}", "private static void createTables(String tableNames, Statement stat) {\n\t\t\n\t\t//creates a table with the name of the file\n\t\ttry {\n\t\t\tstat.executeQuery(comd.createTable(\"stevenwbroussard.\" + tableNames));\n\t\t}\n\t\tcatch(SQLException s) {\n\t\t\tSystem.out.println(\"CREATE Statement Failed.\");\n\t\t\ts.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "DataFrame<R,C> addAll(DataFrame<R,C> other);", "String getBaseTable();", "@Test\n public void testUnionOnSchemaIncompatibleTypes() throws Exception {\n String query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : float);\"\n + \"u = union onschema l1, l2;\";\n\n checkSchemaEx(query, \"Cannot cast from chararray to bytearray\");\n\n //without \"onschema\"\n query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : float);\"\n + \"u = union l1, l2;\";\n\n checkSchemaEx(query, \"Cannot cast from chararray to bytearray\");\n\n\n \n query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : map[ ], y : chararray);\"\n + \"u = union onschema l1, l2;\"\n ; \n checkSchemaEx(query, \"Cannot cast from long to bytearray\");\n \n query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : map[ ], y : chararray);\"\n + \"u = union l1, l2;\"\n ;\n checkSchemaEx(query, \"Cannot cast from long to bytearray\");\n\n // bag column with different internal column types\n query =\n \" l1 = load '\" + INP_FILE_2NUMS \n + \"' as (x : long, b : bag { t : tuple (c1 : int, c2 : chararray)} );\"\n \n + \"l2 = load '\" + INP_FILE_2NUMS \n + \"' as (x : long, b : bag { t : tuple (c1 : long, c2 : chararray)} );\"\n + \"u = union onschema l1, l2;\"\n ; \n Schema sch = new Schema();\n sch.add(new FieldSchema(\"x\", DataType.LONG));\n Schema bagInnerSchema = new Schema();\n bagInnerSchema.add(new FieldSchema(null, new Schema(), DataType.TUPLE));\n sch.add(new FieldSchema(\"b\", bagInnerSchema, DataType.BAG));\n checkSchemaEquals(query, sch);\n \n // tuple column with different internal column types\n query =\n \" l1 = load '\" + INP_FILE_2NUMS \n + \"' as (t : tuple (c1 : int, c2 : chararray) );\"\n \n + \"l2 = load '\" + INP_FILE_2NUMS \n + \"' as (t : tuple (c1 : long, c2 : chararray) );\"\n + \"u = union onschema l1, l2;\"\n ; \n sch = new Schema();\n sch.add(new FieldSchema(\"t\", new Schema(), DataType.TUPLE));\n checkSchemaEquals(query, sch);\n }", "private String getCreateTableSql() {\n StringBuffer stringBuffer = new StringBuffer();\r\n stringBuffer.append(\"create table if not exists \");\r\n stringBuffer.append(tableName + \"(\");\r\n //反射得到所有的成员变量\r\n Field[] fields = entityClass.getDeclaredFields();\r\n for (Field field : fields) {\r\n Class type = field.getType();\r\n if (field.getAnnotation(DbField.class) != null) {\r\n if (type == String.class) {\r\n stringBuffer.append(field.getAnnotation(DbField.class).value() + \" TEXT,\");\r\n } else if (type == Integer.class) {\r\n stringBuffer.append(field.getAnnotation(DbField.class).value() + \" INTEGER,\");\r\n } else if (type == Long.class) {\r\n stringBuffer.append(field.getAnnotation(DbField.class).value() + \" BIGINT,\");\r\n } else if (type == Double.class) {\r\n stringBuffer.append(field.getAnnotation(DbField.class).value() + \" DOUBLE,\");\r\n } else if (type == byte[].class) {\r\n stringBuffer.append(field.getAnnotation(DbField.class).value() + \" BLOB,\");\r\n } else {\r\n //不支持的类型\r\n continue;\r\n }\r\n } else {\r\n if (type == String.class) {\r\n stringBuffer.append(field.getName() + \" TEXT,\");\r\n } else if (type == Integer.class) {\r\n stringBuffer.append(field.getName() + \" INTEGER,\");\r\n } else if (type == Long.class) {\r\n stringBuffer.append(field.getName() + \" BIGINT,\");\r\n } else if (type == Double.class) {\r\n stringBuffer.append(field.getName() + \" DOUBLE,\");\r\n } else if (type == byte[].class) {\r\n stringBuffer.append(field.getName() + \" BLOB,\");\r\n } else {\r\n //不支持的类型\r\n continue;\r\n }\r\n }\r\n }\r\n if (stringBuffer.charAt(stringBuffer.length() - 1) == ',') {\r\n stringBuffer.deleteCharAt(stringBuffer.length() - 1);\r\n }\r\n stringBuffer.append(\")\");\r\n return stringBuffer.toString();\r\n\r\n }", "public static String getSQLForUserTableCreation() {\n return \"CREATE TABLE \" + USER_TABLE + \"(\" +\n USER_ID + \" varchar(8) PRIMARY KEY, \" +\n USER_LAST_NAME + \" varchar(32), \" +\n USER_FIRST_NAME + \" varchar(32), \" +\n USER_EMAIL + \" varchar(256), \" +\n USER_PASSWORD + \" varchar(64), \" +\n USER_IS_TEACHER + \" bool, \" +\n USER_GROUP + \" varchar(32))\";\n\n }", "@Override\n public boolean supportsUnionAll() {\n return true;\n }", "private void addTableProperty(ElementType elementType, boolean multiValued)\n throws Exception\n {\n if (!multiValued)\n {\n // out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n out.write(\" VARCHAR(50)\");\n createAllTablesQuery+=NEWLINE+INDENT+\"m_\"+elementType.name.getLocalName()+\" VARCHAR(50)\";\n\n }else\n {\n // out.write(\",\");\n /* out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n */\n }\n \n }", "public static void createRedshiftTable(String redshiftURL,\n Properties loginProperties,\n String tableName,\n List<String> fields) throws SQLException {\n Connection conn = DriverManager.getConnection(redshiftURL, loginProperties);\n Statement stmt = conn.createStatement();\n stmt.execute(\"CREATE TABLE \" + tableName + \" \" + toSQLFields(fields) + \";\");\n stmt.close();\n conn.close();\n }", "public ATExpression base_tableExpression();", "public static LearningTable createLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createExamples(table.getAttributes()));\n\t\t\n\t\treturn table;\n\t}", "BUnion createBUnion();", "static LearningTable createFilledLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createFilledExamples());\n\t\t\n\t\treturn table;\n\t}", "private void createDataTable() {\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoEditors.TABLE + \" (ID INT IDENTITY PRIMARY KEY, NAME VARCHAR(150) NOT NULL UNIQUE)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.TABLE + \" (ID INT IDENTITY PRIMARY KEY, TITLE VARCHAR(150) NOT NULL UNIQUE, YEAR INT, ISBN10 VARCHAR(20), ISBN13 VARCHAR(13), NOTE INT, PAGES_NUMBER INT, RESUME VARCHAR(2000), THE_EDITOR_FK INT, THE_KIND_FK INT, THE_LANGUAGE_FK INT, THE_LENDING_FK INT, THE_SAGA_FK INT, THE_TYPE_FK INT)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" (THE_BOOK_FK INT NOT NULL, THE_AUTHOR_FK INT NOT NULL)\");\n\n jdbcTemplate.update(\"CREATE INDEX BOOK_EDITOR_IDX ON \" + IDaoEditors.TABLE + \"(ID)\");\n jdbcTemplate.update(\"CREATE INDEX BOOKS_IDX ON \" + IDaoBooks.TABLE + \"(ID)\");\n }", "Concat createConcat();", "String getCreateTableSql(String name, DataSet dataSet, boolean isTemporary,\r\n String key, FieldsRepository fieldsRepository);", "public ArrayList getAllTables(TableSelectExpression selExp) {\r\n\t\tArrayList sourceTableList = new ArrayList();\r\n\r\n\t\t// from clause in select statement\r\n\t\tFromClause fromclause = selExp.from_clause;\r\n\t\tArrayList def_list = fromclause.def_list;\r\n\t\tfor (int i = 0; i < def_list.size(); i++) {\r\n\t\t\tFromTableDef table_def = (FromTableDef) def_list.get(i);\r\n\t\t\tString tableName = table_def.getName();\r\n\t\t\t// if the table is a subquery table\r\n\t\t\tif (table_def.isSubQueryTable()) {\r\n\t\t\t\tTableSelectExpression sub_query = table_def.getTableSelectExpression();\r\n\t\t\t\tArrayList tablesInSubQuery = getAllTables(sub_query);\r\n\t\t\t\tfor (int j = 0; j < tablesInSubQuery.size(); j++) {\r\n\t\t\t\t\tsourceTableList.add(tablesInSubQuery.get(j));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsourceTableList.add(tableName);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// where clause in select statement\r\n\t\tSearchExpression where = (SearchExpression) selExp.where_clause;\r\n\t\tExpression whereExp = where.getFromExpression();\r\n\t\tif (whereExp != null) {\r\n\t\t\tfor (int i = 0; i < whereExp.allElements().size(); i++) {\r\n\t\t\t\tObject element = whereExp.allElements().get(i);\r\n\t\t\t\t// if existing sub query in where clause\r\n\t\t\t\tif (element.getClass().getName().equals(\"com.teradata.sqlparser.interpret.TableSelectExpression\")) {\r\n\t\t\t\t\tTableSelectExpression tablesel = (TableSelectExpression) element;\r\n\t\t\t\t\tArrayList tablesInWhere = getAllTables(tablesel);\r\n\t\t\t\t\tfor (int j = 0; j < tablesInWhere.size(); j++) {\r\n\t\t\t\t\t\tsourceTableList.add(tablesInWhere.get(j));\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\t// 处理union语句\r\n\t\twhile (selExp.composite_function != -1) {\r\n\t\t\tselExp = selExp.next_composite;\r\n\t\t\tArrayList tablesInUnion = getAllTables(selExp);\r\n\t\t\tfor (int j = 0; j < tablesInUnion.size(); j++) {\r\n\t\t\t\tsourceTableList.add(tablesInUnion.get(j));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sourceTableList;\r\n\t}", "public Table.Builder addTablesBuilder() {\n return getTablesFieldBuilder().addBuilder(\n Table.getDefaultInstance());\n }", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private void createStressTestControlTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(true);\n Column clientCommitSleepMs = new Column(\"CLIENT_COMMIT_SLEEP_MS\");\n clientCommitSleepMs.setMappedType(\"BIGINT\");\n Column clientCommitRows = new Column(\"CLIENT_COMMIT_ROWS\");\n clientCommitRows.setMappedType(\"BIGINT\");\n Column serverCommitSleepMs = new Column(\"SERVER_COMMIT_SLEEP_MS\");\n serverCommitSleepMs.setMappedType(\"BIGINT\");\n Column serverCommitRows = new Column(\"SERVER_COMMIT_ROWS\");\n serverCommitRows.setMappedType(\"BIGINT\");\n Column payloadColumns = new Column(\"PAYLOAD_COLUMNS\");\n payloadColumns.setMappedType(\"INTEGER\");\n Column initialSeedSize = new Column(\"INITIAL_SEED_SIZE\");\n initialSeedSize.setMappedType(\"BIGINT\");\n Column duration = new Column(\"DURATION_MINUTES\");\n duration.setMappedType(\"BIGINT\");\n\n Table table = new Table(STRESS_TEST_CONTROL, runId, clientCommitSleepMs, clientCommitRows, serverCommitSleepMs, serverCommitRows,\n payloadColumns, initialSeedSize, duration);\n engine.getDatabasePlatform().createTables(true, true, table);\n }", "@Override\r\n public Db_db createTable (Db_table table)\r\n {\r\n Db_db db = null;\r\n String query = \"CREATE TABLE IF NOT EXISTS \"+ table.getName() + \" (\"; \r\n String primaryKeyName = null;\r\n Set<Map.Entry<String, Db_tableColumn>> tableEntries;\r\n List<String> listOfUniqueKey = Lists.newArrayList();\r\n \r\n if(curConnection_ != null)\r\n {\r\n try\r\n {\r\n tableEntries = table.getEntrySet();\r\n for(Map.Entry<String, Db_tableColumn> entry: tableEntries)\r\n {\r\n Db_tableColumn entryContent = entry.getValue();\r\n \r\n if(entryContent.isPrimary() && primaryKeyName == null)\r\n {\r\n primaryKeyName = entryContent.getName();\r\n }\r\n else if(entryContent.isPrimary() && primaryKeyName != null)\r\n {\r\n throw new NumberFormatException();\r\n }\r\n \r\n if(itsAttributeMapper_ == null)\r\n {\r\n throw new NumberFormatException();\r\n }\r\n \r\n if(entryContent.isUnique())\r\n {\r\n listOfUniqueKey.add(entryContent.getName());\r\n }\r\n \r\n String mappedAttribute = this.itsAttributeMapper_.MapAttribute(entryContent.getAttributeName());\r\n if(entryContent.getAttribute().isEnum())\r\n {\r\n mappedAttribute += entryContent.getAttribute().buildEnumValueListString();\r\n }\r\n query += entryContent.getName() + \" \" + mappedAttribute \r\n + (entryContent.isAutoIncreasmnet()?\" AUTO_INCREMENT \":\" \")\r\n + (entryContent.isUnique()?\" UNIQUE, \": \", \");\r\n }\r\n \r\n query += \"PRIMARY KEY (\" + primaryKeyName + \"));\";\r\n try (Statement sm = curConnection_.createStatement()) {\r\n sm.executeUpdate(query);\r\n db = this.curDb_;\r\n }\r\n \r\n }catch(NumberFormatException e){System.out.print(e);}\r\n catch(SQLException e){System.out.print(query);this.CurConnectionFailed();}\r\n }\r\n return db;\r\n }", "public static SqlOperatorTable chain(Iterable<SqlOperatorTable> tables) {\n final ImmutableList<SqlOperatorTable> list =\n ImmutableList.copyOf(tables);\n if (list.size() == 1) {\n return list.get(0);\n }\n return new ChainedSqlOperatorTable(list);\n }", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "public String getCreateTableString() {\n \t\treturn \"create table\";\n \t}", "public static void buildOfficeTable() {\n\t\tif (TableExists(\"office\"))\n\t\t\treturn;// if office table has been built, no need to build again\n\t\tConnect connectLocal = new Connect(\"local\", localDatabase);\n\t\tConnection localConnection = connectLocal.getConnection();\n\t\tConnect connectServer = new Connect(\"server\", serverDatabase);\n\t\tConnection serverConnection = connectServer.getConnection();\n\t\tResultSet rs;\n\t\tList<String> emails = new ArrayList<>();\n\t\ttry {\n\t\t\tStatement stmtserver = serverConnection.createStatement();\n\t\t\trs = stmtserver.executeQuery(\n\t\t\t\t\tString.format(\"select email from USER where office is not null and email is not null\"));\n\t\t\twhile (rs.next()) {\n\t\t\t\temails.add(rs.getString(1));\n\t\t\t}\n\t\t\tStatement stmtlocal = localConnection.createStatement();\n\t\t\t//System.out.println(emails.size());\n\t\t\tfor (int i = 0; i < emails.size(); i++) {\n\t\t\t\trs = stmtserver.executeQuery(String.format(\n\t\t\t\t\t\t\"select INFRASTRUCTURE.name from USER, INFRASTRUCTURE\"\n\t\t\t\t\t\t\t\t+ \" where USER.office=INFRASTRUCTURE.SEMANTIC_ENTITY_ID and USER.email='%s'\",\n\t\t\t\t\t\temails.get(i)));\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tstmtlocal.executeUpdate(String.format(\"insert into office(email,office) value('%s','%s')\",\n\t\t\t\t\t\t\temails.get(i), rs.getString(1)));\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tconnectLocal.close();\n\t\tconnectServer.close();\n\t}", "@Override\n protected DBConcatFunctionSymbol createRegularDBConcat(int arity) {\n return new NullToleratingDBConcatFunctionSymbol(CONCAT_STR, arity, dbStringType, abstractRootDBType, false);\n }", "UsingCols createUsingCols();", "@Test\n public void testUnionOnSchemaNoCommonCols() throws Exception {\n PigServer pig = new PigServer(Util.getLocalTestMode());\n String query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (i : int, j : int);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : float);\"\n + \"u = union onschema l1, l2;\"\n ; \n Util.registerMultiLineQuery(pig, query);\n Iterator<Tuple> it = pig.openIterator(\"u\");\n \n List<Tuple> expectedRes = \n Util.getTuplesFromConstantTupleStrings(\n new String[] {\n \"(1,2,null,null)\",\n \"(5,3,null,null)\",\n \"(null,null,1L,2.0F)\",\n \"(null,null,5L,3.0F)\"\n });\n Util.checkQueryOutputsAfterSort(it, expectedRes);\n\n }", "public void createTmpTable(GenericService genericService, String nonce) {\n // Get the current method name\n String methodName = new Throwable().getStackTrace()[0].getMethodName();\n\n // To time how long function takes to run\n Stopwatch stopwatch = Stopwatch.createStarted();\n\n // Use non-external table so that temporary file can be removed with table drop\n String sql =\n \"CREATE TABLE %s (%s)\"\n + \" STORED AS ORC LOCATION '%s' TBLPROPERTIES ('ORC.COMPRESS' = 'ZLIB')\";\n String query = String.format(\n sql,\n genericService.getTmpTableName() + \"_\" + nonce,\n genericService.getSchemaStr(),\n genericService.getOutputPath(nonce)\n );\n jdbcTemplate.execute(query);\n\n stopwatch.stop(); // Optional\n log.info(\"[{} - {}] -> Time elapsed: [{}] ms\",\n genericService.getTableName(),\n methodName,\n stopwatch.elapsed(TimeUnit.MILLISECONDS)\n );\n }", "private void generateTemporaryTable(String tableName, Collection<?> items, SQLProcessor sqlP)\n throws GenericEntityException {\n //Ensure connection is created\n sqlP.getConnection();\n\n //Determine the data type to create based on the item element type\n //Right now this only works for SQL server so we hardcode the SQL server data types\n //And we only support numbers and strings at this point\n Object firstItem = items.iterator().next();\n String dataType;\n if (firstItem instanceof Number) {\n dataType = \"bigint\";\n } else {\n dataType = \"varchar(8000)\"; //8000 is max size of varchar for SQL server\n }\n\n sqlP.executeUpdate(\"create table #\" + tableName + \" (item \" + dataType + \" primary key)\");\n\n //Insert data into this temporary table\n sqlP.prepareStatement(\"insert into #\" + tableName + \" (item) values (?)\");\n PreparedStatement stat = sqlP.getPreparedStatement();\n try {\n for (Object item : items) {\n if (item instanceof Number) {\n stat.setLong(1, ((Number) item).longValue());\n } else if (item instanceof String) {\n stat.setString(1, (String) item);\n } else {\n stat.setObject(1, item);\n }\n\n stat.addBatch();\n }\n stat.executeBatch();\n } catch (SQLException e) {\n throw new GenericEntityException(e.getMessage(), e);\n } finally {\n try {\n stat.close();\n } catch (SQLException ignore) {\n }\n }\n }", "private void extend() {\n for (Object o : table) {\n if (o == null)\n return;\n }\n\n TABLE_SIZE *= 2;\n Object[] entries = entrySet();\n this.table = new Object[TABLE_SIZE];\n\n rebuild(entries);\n }", "@Override\n\tpublic void createTable() {\n\t\tSystem.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\ttry {\n\t\t\tTableUtils.createTable(connectionSource, UserEntity.class);\n\t\t\tTableUtils.createTable(connectionSource, Downloads.class);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\");\n\t\t}\n\t}", "@Override\n\tpublic String createTable() {\n\t\t\t\treturn \"CREATE TABLE history_table_view(id number(8) primary key not null ,sqltext text, pointid varchar2(1024), type varchar2(100))\";\n\t}", "private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}", "public static SqlOperatorTable chain(SqlOperatorTable... tables) {\n return chain(ImmutableList.copyOf(tables));\n }", "public void makeSql() {\n\t\tfor(int i=0; i<arr_sql.length; i++) {\n\t\t\tarr_sql[i] = new StringBuffer();\n\t\t}\n\t\t\n\t\t/*\n\t\t * 공통코드 쿼리\n\t\t * 대리점구분 : CU006\n\t\t * 직판구분 : CU012\n\t\t * 지역 : SY006\n\t\t * 계약상태 : CU013\n\t\t * 사용유무 : SY011\n\t\t * 보증보험회사 : CU010\n\t\t * 하위대리점여부 : CU011\n\t\t */\n\t\tarr_sql[0].append (\"SELECT\t\t\t\t\t\t\t\t\t\t\\n\")\n\t\t\t\t .append (\"\t' ' head, ' ' detail, '전체' detail_nm \\n\")\n\t\t\t\t .append (\"FROM DUAL \\n\")\n\t\t\t\t .append (\"UNION ALL \\n\")\n\t\t\t\t .append (\"SELECT \\n\")\n\t\t\t\t .append (\"\tB.head, B.detail, B.detail_nm \\n\")\n\t\t\t\t .append (\"FROM \\n\")\n\t\t\t\t .append (\"\tSALES.TSY011 A, \\n\")\n\t\t\t\t .append (\"\tSALES.TSY010 B \\n\")\n\t\t\t\t .append (\"WHERE 1=1 \\n\")\n\t\t\t\t .append (\" AND A.head = B.head \\n\")\n\t\t\t\t .append (\" AND B.head = ? \\n\")\n\t\t\t\t .append (\" AND LENGTH (rtrim(B.detail)) > 0 \\n\");\n\t\t\n\t\t/*\n\t\t * 대리점 조회\n\t\t */\n\t\tarr_sql[1].append(\"SELECT T1.client_sid\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 매출처SID \t*/\n\t \t\t .append(\"\t\t ,T1.vend_cd \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* [회계]거래처 코드 \t*/\n\t \t\t .append(\"\t\t ,T1.client_cd \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 매출처 코드 \t*/\n\t \t\t .append(\"\t\t ,T1.client_nm \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 매출처 명 \t*/\n\t \t\t .append(\"\t\t ,T1.client_gu \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 매출처구분 :CU005 \t*/\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.agen_gu \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 대리점구분 :CU006 \t*/\n\t \t\t .append(\"\t\t ,T1.dir_yn \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 직판여부 :CU012 \t*/\n\t \t\t .append(\"\t\t ,T1.area_cd \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 지역코드 :SY006 \t*/\n\t \t\t .append(\"\t\t ,T1.sal_dam_sid \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 영업담당자코드[TSY410] */\n\t \t\t .append(\"\t\t ,T1.client_dam_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 매출처담당자 \t*/\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.tel_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 전화번호 \t*/\n\t \t\t .append(\"\t\t ,T1.mobile_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 휴대전화 \t*/\n\t \t\t .append(\"\t\t ,T1.fax_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* FAX번호 \t*/\n\t \t\t .append(\"\t\t ,T1.e_mail \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 이메일 \t*/\n\t \t\t .append(\"\t\t ,T1.zip_cd \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 우편번호[TSY110] */\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.address1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 주소1 \t*/\n\t \t\t .append(\"\t\t ,T1.address2 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 주소2 \t*/\n\t \t\t .append(\"\t\t ,T1.commi_rate \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 수수료율 \t*/\n\t \t\t .append(\"\t\t ,T1.cunt_status \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 계약상태 :CU013 \t*/\n\t \t\t .append(\"\t\t ,T1.bancod \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 은행코드 [BANKCODE] */\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.bank_acc_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 은행계좌번호 \t*/\n\t \t\t .append(\"\t\t ,T1.bank_acct_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 예금주 \t*/\n\t \t\t .append(\"\t\t ,T1.use_yn \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 사용여부 :SY011 \t*/ \n\t \t\t .append(\"\t\t ,T1.client_url\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 홈페이지 URL\t\t\t\t*/\n\t \t\t .append(\"\t\t ,T2.sal_dam_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 영업담당자명 \t*/\n\t \t\t .append(\"\t\t ,T3.vend_nm \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 거래처명 \t*/\n\t \t\t \n\t \t\t .append(\"\t\t ,T4.bannam \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 은행명 \t*/\n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU006',T1.agen_gu) AS agen_gu_name \t\t\t\t\t\\n\")\t/* 대리점구분명 \t\t\t\t*/ \n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU012',T1.dir_yn) AS dir_yn_name \t\t\t\t\t\\n\")\t/* 직판여부명 \t\t\t\t*/ \n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'SY006',T1.area_cd) AS area_nm\t\t\t\t\t\t\t\\n\")\t/* 지역명 \t\t\t\t*/\n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU013',T1.cunt_status) AS cunt_status_name \t\t\t\\n\")\t/* 계약상태명 \t\t\t\t*/\n\n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'SY011',T1.use_yn) AS use_yn_name \t\t\t\\n\")\t/* 사용여부명 \t\t\t \t*/\n\n\t \t\t .append(\"FROM SALES.TCU030 T1 LEFT OUTER JOIN SALES.TSY410 T2 ON T1.SAL_DAM_SID = T2.SAL_DAM_SID \\n\")\n\t \t\t .append(\"\t\t LEFT OUTER JOIN ACCOUNT.GCZM_VENDER T3 ON T1.VEND_CD = T3.VEND_CD \t\t\t\t\t\\n\")\n\t \t\t .append(\"\t\t LEFT OUTER JOIN ACCOUNT.BANKCODE T4 ON T1.BANCOD = T4.BANCOD \t\t\t\t\t\\n\")\n\t \t\t .append(\"WHERE 1 = 1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\n\t \t\t .append(\"\t\t AND T1.client_GU = '1' \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\");\n\t\t/*\n\t\t * 계약정보 조회\n\t\t */\n\t\tarr_sql[2].append(\"SELECT T1.client_sid\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 매출처SID \t*/\n\t\t\t\t .append(\"\t\t ,T1.cont_date\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 계약일자 \t*/\n\t\t\t\t .append(\"\t\t ,T1.expire_date\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 만기일자 \t*/\n\t\t\t\t .append(\"\t\t ,TO_NUMBER(T1.insur_amt) AS insur_amt\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 보험료 \t*/\n\t\t\t\t .append(\"\t\t ,T1.insur_comp_cd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 보증보험회사:CU010 \t*/\n\t\t\t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ('CU010',T1.insur_comp_cd) AS insur_comp_cd_name\t\t\\n\") \t/* 보증보험회사명 \t\t*/ \n\t\t\t\t .append(\"FROM SALES.TCU031 T1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"WHERE 1=1\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\");\n\t\t \n\t\n\t\t/*\n\t\t * 지점정보 조회\n\t\t */\n\t\tarr_sql[3].append(\"SELECT T1.client_sid\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 매출처SID \t\t*/\n\t\t\t\t .append(\"\t\t ,T1.branch_cd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 지점코드 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.branch_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 지점명 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.area_cd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 지역코드:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,T1.client_down_yn \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 하위대리점여부:CU011 \t*/\n\t\t\t\t .append(\"\t\t ,T1.empno \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 담당자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.tel_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 전화번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.mobile_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 휴대폰 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.fax_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 팩스번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.branch_url \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 지점홈페이지 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'SY006', T1.area_cd) AS area_nm\t\t\t\t\t\t\t\\n\") \t/* 지역명:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU011',T1.client_down_yn) AS client_down_yn_name \t\\n\")\t/* 하위대리점여부명 \t\t*/\n\t\t\t\t .append(\"FROM SALES.TCU032 T1\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\");\n\t\t\n\t\t\n\t\t/*\n\t\t * 대리점 등록\n\t\t */\n\n\t\tarr_sql[4].append(\"INSERT INTO SALES.TCU030 (\")\n\t\t\t\t .append(\"\t\t\t\t client_sid \\n\")\t\n\t\t\t\t .append(\"\t\t\t\t,vend_cd \\n\")\t/* [회계]거래처 코드 \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_cd \\n\")\t/* 매출처 코드 \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_nm \\n\")\t/* 매출처 명 \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_gu \\n\")\t/* 매출처구분 :CU005 \t*/\n\t\t\t\t .append(\"\t\t\t\t,agen_gu \\n\")\t/* 대리점구분 :CU006 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,dir_yn \\n\")\t/* 직판여부 :CU012 \t*/\n\t\t\t\t .append(\"\t\t\t\t,area_cd \\n\")\t/* 지역코드 :SY006 \t*/\n\t\t\t\t .append(\"\t\t\t\t,sal_dam_sid \\n\")\t/* 영업담당자코드[TSY410] \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_dam_nm \\n\")\t/* 매출처담당자 \t*/\n\t\t\t\t .append(\"\t\t\t\t,tel_no \\n\")\t/* 전화번호 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,mobile_no \\n\")\t/* 핸드폰 \t*/\n\t\t\t\t .append(\"\t\t\t\t,fax_no \\n\")\t/* FAX번호 \t*/\n\t\t\t\t .append(\"\t\t\t\t,e_mail \\n\")\t/* 이메일 \t*/\n\t\t\t\t .append(\"\t\t\t\t,zip_cd \\n\")\t/* 소재지우편번호[TSY110] */\n\t\t\t\t .append(\"\t\t\t\t,address1 \\n\")\t/* 소재지주소1 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,address2 \\n\")\t/* 소재지주소2 \t*/\n\t\t\t\t .append(\"\t\t\t\t,commi_rate \t\\n\") \t/* 수수료율 \t*/\n\t\t\t\t .append(\"\t\t\t\t,cunt_status \\n\")\t/* 계약상태 :CU013 \t*/\n\t\t\t\t .append(\"\t\t\t\t,bancod\t\t\t\\n\") \t/* 은행코드 \t\t\t\t\t*/\n\t\t\t\t .append(\"\t\t\t\t,bank_acc_no \\n\")\t/* 은행계좌번호[BANKCODE] \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,bank_acct_nm\t\\n\")\t/* 예금주 \t\t\t\t\t*/\n\t\t\t\t .append(\"\t\t\t\t,use_yn\t\t\t\\n\")\t/* 사용여부 \t\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t .append(\"\t\t \t\t,u_date \t\\n\") \t/* 최종수정일자 \t*/\n\t \t\t .append(\"\t\t \t\t,u_empno \t\\n\")\t/* 최종수정자사번 \t*/\n\t \t\t .append(\"\t\t \t\t,u_ip \\n\")\t/* 최종수정IP */\t\t\t\n\t \t\t .append(\"\t\t\t\t,client_url\t\t\\n\")\t/* 홈페이지 */\n\t\t\t\t .append(\"\t\t\t)\t\t\t\t\t\\n\")\n\t\t\t\t \n\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\tSALES.SWS_TCU030_ID.NEXTVAL,?,?,?,?,?,\t\t\\n\")\t\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,SYSTIMESTAMP,?,?,?\t\\n\")\n\t\t\t\t .append(\"\t\t\t)\");\n\t\t\n\t\n\t\t\n\t\t/*\n\t\t * 계약정보 등록\n\t\t */\n\t\tarr_sql[5].append(\"INSERT INTO SALES.TCU031 ( \t\\n\")\n\t\t\t\t .append(\" \t client_SID\t\t\t\\n\")\t/* 매출처SID \t*/\n\t\t\t\t .append(\"\t\t ,cont_date\t\t\t\t\\n\") \t/* 계약일자 \t*/\n\t\t\t\t .append(\"\t\t ,expire_date\t\t\t\\n\")\t/* 만기일자 \t*/\n\t\t\t\t .append(\"\t\t ,insur_amt\t\t\t\t\\n\")\t/* 보험료 \t*/\n\t\t\t\t .append(\"\t\t ,insur_comp_cd\t\t\t\\n\")\t/* 보증보험회사:CU010 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date\t\t\t\t\\n\")\t/* 최종수정일자 \t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\n\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\n\t\t\t\t .append(\"\t\t)\t\t\t\t\t\t\\n\")\n\t\t\t\t \n\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\t\n\t\t\t\t .append(\"\t\t\t\tSYSTIMESTAMP,?,?\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t)\");\n\t\t\t\t\t\n\t\t/*\n\t\t * 지점정보 등록\n\t\t */\n\t\t\n\t\tarr_sql[6].append(\"INSERT INTO SALES.TCU032 ( \t\\n\")\n\t\t\t\t .append(\"\t\t client_SID\t\t\t\\n\") \t/* 매출처SID \t\t*/\n\t\t\t\t .append(\"\t\t ,branch_cd\t\t\t\t\\n\")\t/* 지점코드 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,branch_nm \t\t\t\\n\") \t/* 지점명 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,area_cd\t\t\t\t\\n\") \t/* 지역코드:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,client_down_yn \t\t\\n\")\t/* 하위대리점여부:CU011 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,empno \t\t\t\t\\n\")\t/* 담당자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,tel_no \t\t\t\t\\n\")\t/* 전화번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,mobile_no \t\t\t\\n\")\t/* 휴대폰 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,fax_no \t\t\t\t\\n\")\t/* 팩스번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,branch_url \t\t\t\\n\")\t/* 지점홈페이지 \t\t\t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date \t\t\t\t\\n\")\t/* 최종수정일자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t\t\\n\")\t/* 최종수정자사번 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_ip \t\t\t\t\\n\")\t/* 최종수정IP \t\t*/\n\t\t\t\t .append(\"\t)\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\t\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\tSYSTIMESTAMP,?,?\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t)\");\n\t\t\n\t\t/*\n\t\t * 대리점 수정\n\t\t */\n\n\t\tarr_sql[7].append(\"UPDATE SALES.TCU030 SET \t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t vend_cd\t\t= ? \t\t\t\t\\n\")\t/* [회계]거래처 코드 \t*/\n\t\t\t\t .append(\"\t\t,client_nm\t\t= ? \t\t\t\t\\n\")\t/* 매출처 명 \t*/\n\t\t\t\t .append(\"\t\t,agen_gu\t\t= ? \t\t\t\t \t\\n\")\t/* 대리점구분 :CU006 \t*/\n\t\t\t\t .append(\"\t\t,dir_yn\t\t\t= ? \t\t\t\t\\n\")\t/* 직판여부 :CU012 \t*/\n\t\t\t\t .append(\"\t\t,area_cd \t= ? \t\t\t\t\t\\n\")\t/* 지역코드 :SY006 \t*/\n\n\t\t\t\t .append(\"\t\t,sal_dam_sid\t= ? \t\t\t\t\t\\n\")\t/* 영업담당자코드[TSY410] */\n\t\t\t\t .append(\"\t\t,client_dam_nm\t= ? \t\t\t\t\t\\n\")\t/* 매출처담당자 \t*/\n\t\t\t\t .append(\"\t\t,tel_no = ?\t\t\t\t\t\t\\n\")\t/* 전화번호 \t*/\n\t\t\t\t .append(\"\t\t,mobile_no = ?\t\t\t\t\t\t\\n\")\t/* 핸드폰 \t*/\n\t\t\t\t .append(\"\t\t,fax_no = ?\t\t\t\t\t\t\\n\")\t/* FAX번호 \t*/\n\n\t\t\t\t .append(\"\t\t,e_mail = ?\t\t\t\t\t\t\\n\")\t/* 이메일 \t*/\n\t\t\t\t .append(\"\t\t,zip_cd = ?\t\t\t\t\t\t\\n\")\t/* 소재지우편번호[TSY110] \t*/\n\t\t\t\t .append(\"\t\t,address1 = ?\t\t\t\t\t\t\\n\")\t/* 소재지주소1 \t*/\n\t\t\t\t .append(\"\t\t,address2 = ?\t\t\t\t\t\t\\n\")\t/* 소재지주소2 \t*/\n\t\t\t\t .append(\"\t\t,commi_rate \t= ?\t\t\t\t\t\t\\n\") \t/* 수수료율 \t*/\n\n\t\t\t\t .append(\"\t\t,cunt_status = ?\t\t\t\t\t\t\\n\")\t/* 계약상태 :CU013 \t*/\n\t\t\t\t .append(\"\t\t,bancod\t\t\t= ?\t\t\t\t\t\t\\n\") \t/* 은행코드\t \t\t\t\t*/\n\t\t\t\t .append(\"\t\t,bank_acc_no = ?\t\t\t\t\t\t\\n\")\t/* 은행계좌번호[BANKCODE]\t\t*/\n\t\t\t\t .append(\"\t\t,bank_acct_nm\t= ?\t\t\t\t\t\t\\n\")\t/* 예금주 \t\t\t\t\t*/\n\t\t\t\t .append(\"\t\t,use_yn\t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 사용여부 \t\t\t\t\t*/\n\n\t\t\t\t .append(\"\t\t,u_date \t= SYSTIMESTAMP\t\t\\n\") \t/* 최종수정일자 \t*/\n\t \t\t .append(\"\t\t,u_empno \t= ?\t\t\t\t\t\t\\n\")\t/* 최종수정자사번 \t*/\n\t \t\t .append(\"\t\t,u_ip = ?\t\t\t\t\t\t\\n\")\t/* 최종수정IP */\n\t \t\t .append(\"\t,client_url = ?\t\t\t\t\t\t\\n\")\t/* 홈페이지 */\n\t\t\t\t .append (\"WHERE client_sid \t= ? \t\t\t\t\\n\");\n\t\t\t\t \n\t\t/*\n\t\t * 계약정보 수정\n\t\t */\n\t\tarr_sql[8].append(\"UPDATE SALES.TCU031 SET\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t cont_date\t\t\t= ?\t\t\t\t\t\\n\") \t/* 계약일자 \t*/\n\t\t\t\t .append(\"\t\t ,expire_date\t\t= ?\t\t\t\t\t\\n\")\t/* 만기일자 \t*/\n\t\t\t\t .append(\"\t\t ,insur_amt\t\t\t= ?\t\t\t\t\t\\n\")\t/* 보험료 \t*/\n\t\t\t\t .append(\"\t\t ,insur_comp_cd\t\t= ?\t\t\t\t\t\\n\")\t/* 보증보험회사:CU010 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date\t\t\t= SYSTIMESTAMP\t\\n\")\t/* 최종수정일자 \t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t= ?\t\t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\n\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t= ?\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\n\t\t\t\t .append (\"WHERE client_sid \t\t= ? AND cont_date = ? \\n\");\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t\n\t\t/*\n\t\t * 지점정보 수정\n\t\t */\n\t\t\n\t\tarr_sql[9].append(\"UPDATE SALES.TCU032 SET \t\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t branch_nm \t\t= ?\t\t\t\t\t\t\\n\") \t/* 지점명 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,area_cd\t\t\t= ?\t\t\t\t\t\t\\n\") \t/* 지역코드:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,client_down_yn \t= ?\t\t\t\t\t\t\\n\")\t/* 하위대리점여부:CU011 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,empno \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 담당자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,tel_no \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 전화번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,mobile_no \t\t= ?\t\t\t\t\t\t\\n\")\t/* 휴대폰 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,fax_no \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 팩스번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,branch_url \t\t= ?\t\t\t\t\t\t\\n\")\t/* 지점홈페이지 \t\t\t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date \t\t\t= SYSTIMESTAMP\t\t\t\t\t\t\\n\")\t/* 최종수정일자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t= ?\t\t\\n\")\t/* 최종수정자사번 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_ip \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 최종수정IP \t\t*/\n\t\t\t\t .append (\"WHERE client_sid = ? AND branch_cd \t= ?\t\t\\n\");\n\t\t\n\t\t arr_sql[10].append(\"DELETE FROM SALES.TCU030 WHERE client_sid = ?\");\t\n\t\t arr_sql[11].append(\"DELETE FROM SALES.TCU031 WHERE client_sid = ? AND cont_date = ?\");\n\t\t arr_sql[12].append(\"DELETE FROM SALES.TCU032 WHERE client_sid = ? AND branch_cd = ?\");\n\t\t \n\t\t \n\t\t /*\n\t\t * Client SID 얻어오기\n\t\t */\n\t\t\t\n\t\t\tarr_sql[13].append(\"SELECT client_sid FROM SALES.TCU030 WHERE client_cd = ?\\n\");\n\t\t\t\n\t\t/*\n\t\t * 수수료율 조회\n\t\t */\n\t\t\tarr_sql[14].append(\"SELECT\t\t\t\t\t\t\t\t\\n\")\n\t\t\t\t\t\t.append(\" T1.CLIENT_SID AS CLIENT_SID\t\\n\") /* 매출처SID */\n\t\t\t\t\t\t.append(\" ,T1.FR_DATE AS FR_DATE \t\\n\") /* 시작일자 */\n\t\t\t\t\t\t.append(\" ,T1.TO_DATE AS TO_DATE \t\\n\") /* 종료일자 */\n\t\t\t\t\t\t.append(\" ,T1.WEEKEND_YN AS WEEKEND_YN \t\\n\") /* 주말여부 */\n\t\t\t\t\t\t.append(\" ,T1.COMMI_RATE AS COMMI_RATE\t\\n\") /* 수수료율 */\n\t\t\t\t\t\t.append(\"FROM SALES.TCU033 T1 \t\\n\")\n\t\t\t\t\t\t.append(\"WHERE 1=1 \t\t\t\t\t\t\t\\n\");\n\t\t\t\t\t\t\n\t\t/*\n\t\t * 수수료율 등록\n\t\t */\n\t\t\t\n\t\t\tarr_sql[15].append(\"INSERT INTO SALES.TCU033 ( \t\\n\")\n\t\t\t\t\t\t .append(\" \t CLIENT_SID\t\t\t\\n\")\t/* 매출처SID \t*/\n\t\t\t\t\t\t .append(\"\t\t ,FR_DATE\t\t\t\t\\n\") \t/* 시작일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,TO_DATE\t\t\t\\n\")\t/* 종료일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,COMMI_RATE\t\t\t\t\\n\")\t/* 수수료율 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,WEEKEND_YN\t\t\t\\n\")\t/* 주말여부 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,I_DATE\t\t\t\t\\n\")\t/* 최종입력일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,I_EMPNO \t\t\t\t\\n\") \t/* 최종입력자사번 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,I_IP\t\t\t\t\t\\n\")\t/* 최종입력IP \t*/\t\t\t\t\t\t \n\t\t\t\t\t\t .append(\"\t\t ,u_date\t\t\t\t\\n\")\t/* 최종수정일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,u_empno \t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\n\t\t\t\t\t\t .append(\"\t\t)\t\t\t\t\t\t\\n\")\n\t\t\t\t\t\t \n\t\t\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t\t\t .append(\"\t\t\t\t?,?,?,?, ?,\t\t\\n\")\t\n\t\t\t\t\t\t .append(\"\t\t\t\tSYSTIMESTAMP,?,?, SYSTIMESTAMP,?,?\t\\n\")\n\t\t\t\t\t\t .append(\"\t\t\t)\");\n\t\t/*\n\t\t * 수수료율 수정\n\t\t */\n\t\t\tarr_sql[16].append(\"UPDATE SALES.TCU033 SET\t\t\t\t\t\t\\n\") \n\t\t\t\t\t .append(\"\t\t TO_DATE\t\t\t= ?\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\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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append(\"\t\t ,COMMI_RATE\t\t= ?\t\t\t\t\t\\n\")\t/* 수수료율 \t*/\n\t\t\t\t\t .append(\"\t\t ,WEEKEND_YN\t\t= ?\t\t\t\t\t\\n\")\t/* 주말여부 \t*/\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\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\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 .append(\"\t\t ,u_date\t\t\t= SYSTIMESTAMP\t\\n\")\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\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\t\t\n\t\t\t\t\t .append(\"\t\t ,u_empno \t\t\t= ?\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\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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t= ?\t\t\t\t\t\\n\")\t/* 최종수정IP \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\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\t\n\t\t\t\t\t .append (\"WHERE client_sid \t\t= ? AND FR_DATE = ? AND WEEKEND_YN=? \\n\"); \n\t\t/*\n\t\t * 수수료율 삭제\n\t\t */\n\t\tarr_sql[17].append(\"DELETE FROM SALES.TCU033 WHERE client_sid = ? AND fr_date = ? AND WEEKEND_YN=? \");\t \n\t\t\t \n\n\t}", "private Tables() {\n\t\tsuper(\"TABLES\", org.jooq.util.mysql.information_schema.InformationSchema.INFORMATION_SCHEMA);\n\t}", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "final public SqlStatement CreateTableStatement() throws ParseException {Token tk = null, tk2 = null;\n String tableName;\n CreateTableDefinition definition = null;\n List<CreateTableOption> options = null;\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case TEMPORARY:{\n tk = jj_consume_token(TEMPORARY);\n break;\n }\n default:\n jj_la1[16] = jj_gen;\n ;\n }\n jj_consume_token(TABLE);\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case IF:{\n tk2 = jj_consume_token(IF);\n jj_consume_token(NOT);\n jj_consume_token(EXISTS);\n break;\n }\n default:\n jj_la1[17] = jj_gen;\n ;\n }\n tableName = DbObjectName();\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case 118:{\n definition = CreateTableDefinition();\n break;\n }\n default:\n jj_la1[18] = jj_gen;\n ;\n }\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case K_DEFAULT:\n case AUTO_INCREMENT:\n case COMMENT:\n case S_IDENTIFIER:{\n options = CreateTableOptions();\n break;\n }\n default:\n jj_la1[19] = jj_gen;\n ;\n }\nreturn new CreateTableStatement(tk != null, tk2 != null, tableName, definition, options);\n}", "@SuppressWarnings(\"unchecked\")\n private void createTable() {\n table = (LinkedList<Item<V>>[])new LinkedList[capacity];\n for(int i = 0; i < table.length; i++) {\n table[i] = new LinkedList<>();\n }\n }", "public String getCreateTemporaryTableString() {\n \t\treturn \"create table\";\n \t}", "ColumnFull createColumnFull();", "public static Connection createTables() {\n\t \n\t Statement stmt = null;\n\t int result = 0;\n\t \n\t try {\n\t \t Connection connection = getConnection();\n\t \t \n\t \t try {\n\t \t stmt = connection.createStatement();\n\t \t \n\t \t result = stmt.executeUpdate(\"\"\n\t \t \t\t\n\t \t \t\t// Creating form table\n\t \t \t\t+ \"CREATE TABLE IF NOT EXISTS form (\"\n\t \t \t\t+ \"form_version VARCHAR(50),\"\n\t \t \t\t+ \"form_name VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"field_id INT NOT NULL,\"\n\t \t \t\t+ \"field_value VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"CONSTRAINT PK_form PRIMARY KEY (form_version, field_id)); \"\n\t \t \t\t\n\t \t \t\t// Creating template_fields table\n\t \t \t\t+ \"CREATE TABLE IF NOT EXISTS template_fields (\"\n\t \t \t\t+ \"field_id INT NOT NULL,\"\n\t \t \t\t+ \"form_name VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"field_name VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"field_value VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"field_type VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"field_mandatory VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"CONSTRAINT PK_field PRIMARY KEY (field_id,form_name)); \"\n\t \t \t\t\n\t \t \t\t// Creating radio_fields table\n\t \t \t\t+ \"CREATE TABLE IF NOT EXISTS radio_fields (\"\n\t \t \t\t+ \"radio_id INTEGER IDENTITY PRIMARY KEY,\"\n\t \t \t\t+ \"field_id INTEGER NOT NULL,\"\n\t \t \t\t+ \"form_name VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"radio_value VARCHAR(50) NOT NULL,\"\n\t \t \t\t+ \"UNIQUE(field_id, radio_value, form_name)); \"\n\t \t \t\t\n\t \t \t\t//Creating template_fields_options table\n\t \t \t\t+ \"CREATE TABLE IF NOT EXISTS template_fields_options (\"\n\t \t \t\t+ \"option_id INTEGER IDENTITY PRIMARY KEY,\"\n\t \t \t\t+ \"option_value VARCHAR(50) NOT NULL); \"\n\t \t \t\t+ \"\");\n\t \t \n\t \t connection.close();\n\t \t stmt.close();\n\t \t } catch (SQLException e) {\n\t e.printStackTrace();\n\t \t }\n\t \t System.out.println(\"Tables created successfully\");\n\t \t return connection;\n\t \t \n\t }\n\t catch (Exception e) {\n\t e.printStackTrace();\n\t return null;\n\t \n\t }\n\t}", "public static Table registerTable(Configuration conf, Properties props, String metadataLocation) {\n Schema schema = schema(props);\n PartitionSpec spec = spec(props, schema);\n Map<String, String> map = filterIcebergTableProperties(props);\n String location = props.getProperty(LOCATION);\n String catalogName = props.getProperty(InputFormatConfig.CATALOG_NAME);\n\n Optional<Catalog> catalog = loadCatalog(conf, catalogName);\n if (catalog.isPresent()) {\n String name = props.getProperty(NAME);\n Preconditions.checkNotNull(name, \"Table identifier not set\");\n return catalog.get().registerTable(TableIdentifier.parse(name), metadataLocation);\n }\n\n Preconditions.checkNotNull(location, \"Table location not set\");\n return new HadoopTables(conf).create(schema, spec, map, location);\n }", "@Test\n public void testMixedPutTables() throws Exception {\n List<WALEntry> entries = new ArrayList<>(((TestReplicationSink.BATCH_SIZE) / 2));\n List<Cell> cells = new ArrayList<>();\n for (int i = 0; i < (TestReplicationSink.BATCH_SIZE); i++) {\n entries.add(createEntry(((i % 2) == 0 ? TestReplicationSink.TABLE_NAME2 : TestReplicationSink.TABLE_NAME1), i, Put, cells));\n }\n TestReplicationSink.SINK.replicateEntries(entries, CellUtil.createCellScanner(cells.iterator()), TestReplicationSink.replicationClusterId, TestReplicationSink.baseNamespaceDir, TestReplicationSink.hfileArchiveDir);\n Scan scan = new Scan();\n ResultScanner scanRes = TestReplicationSink.table2.getScanner(scan);\n for (Result res : scanRes) {\n Assert.assertTrue((((Bytes.toInt(res.getRow())) % 2) == 0));\n }\n }", "private String createSEQTable() {\n\t\tStringBuffer buildSQL = new StringBuffer();\n\t\tbuildSQL.append(\" CREATE TABLE \" + DEFAULT_SEQUENCE_NAME + \" ( \");\n\t\tbuildSQL.append(\"id bigint(20) NOT NULL AUTO_INCREMENT, \");\n\t\tbuildSQL.append(\"prefix_value varchar(12) NOT NULL, \");\n\t\tbuildSQL.append(\"next_val int(11) NOT NULL, \");\n\t\tbuildSQL.append(\"increment int(11) NOT NULL, \");\n\t\tbuildSQL.append(\"PRIMARY KEY (id) \");\n\t\tbuildSQL.append(\") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\");\n\t\t// --log.debug(buildSQL.toString());\n\t\treturn buildSQL.toString();\n\t}", "void addTable(String tableName, LinkedHashMap<String, String> columns)\n\t\t\tthrows SQLException {\n\t\tif (!columns.isEmpty() && !tableName.isEmpty()) {\n\t\t\tIterator<String> it = columns.keySet().iterator();\n\t\t\tstmt = con.createStatement();\n\t\t\tString sql = (new StringBuilder(\"create table \")).append(tableName)\n\t\t\t\t\t.append(\" (\").toString();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tString columnName = it.next();\n\t\t\t\tif (it.hasNext())\n\t\t\t\t\tsql = (new StringBuilder(String.valueOf(sql)))\n\t\t\t\t\t\t\t.append(columnName).append(\" \")\n\t\t\t\t\t\t\t.append(columns.get(columnName)).append(\", \")\n\t\t\t\t\t\t\t.toString();\n\t\t\t\telse\n\t\t\t\t\tsql = (new StringBuilder(String.valueOf(sql)))\n\t\t\t\t\t\t\t.append(columnName).append(\" \")\n\t\t\t\t\t\t\t.append(columns.get(columnName)).toString();\n\t\t\t}\n\t\t\tsql = (new StringBuilder(String.valueOf(sql))).append(\")\")\n\t\t\t\t\t.toString();\n\t\t\tstmt.executeUpdate(sql);\n\t\t\tstmt.close();\n\t\t}\n\t}", "public HtmlTable createTable() {\n\t\tHtmlTable table = null;\n\t\tif (recordList != null) {\n\t\t\ttable = new HtmlTable();\n\t\t\tint irow = 0;\n\t\t\tfor (CSVRecord record : recordList) {\n\t\t\t\tHtmlTr tr = createTr(record, irow);\n\t\t\t\ttable.appendChild(tr);\n\t\t\t\tirow++;\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}", "com.google.protobuf.ByteString\n getBaseTableBytes();", "private String buildUnionOut(Stream strm){\n\t\tInteger i = 0;\n\t\tString str = genTableStr + strm.getName() + \"_starqlout\"+\" AS WCACHE\\r\\n\";\n\t\tstr += \"select * from (mergeunion '\";\n\t\twhile (i < outNum){\n\t\t\ti++;\n\t\t\tstr += strm.getName() + \"_starqlout_\"+i;\t\t\t\n\t\t\tif(i < outNum)\n\t\t\t\tstr += \",\";\n\t\t}\n\t\tstr += \t\"' cols:timestamp);\\r\\n\";\n\t\treturn str;\n\t}", "@Test\n public void testUnionOnSchemaSameSchema() throws Exception {\n PigServer pig = new PigServer(Util.getLocalTestMode());\n String query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (i : int, j : int);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (i : int, j : int);\"\n + \"u = union onschema l1, l2;\"\n ; \n Util.registerMultiLineQuery(pig, query);\n Schema expectedSch = Utils.getSchemaFromString(\"i: int, j: int\");\n Schema sch = pig.dumpSchema(\"u\");\n assertEquals(\"Checking expected schema\",sch, expectedSch);\n Iterator<Tuple> it = pig.openIterator(\"u\");\n \n List<Tuple> expectedRes = \n Util.getTuplesFromConstantTupleStrings(\n new String[] {\n \"(1,2)\",\n \"(5,3)\",\n \"(1,2)\",\n \"(5,3)\"\n });\n Util.checkQueryOutputsAfterSort(it, expectedRes);\n\n }", "@Test\n public void testUnionOnSchemaCastOnByteArray() throws Exception {\n PigServer pig = new PigServer(Util.getLocalTestMode());\n String query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (i, j);\"\n + \" f1 = foreach l1 generate (int)i, (int)j;\"\n + \"u = union onschema f1, l1;\"\n ; \n Util.registerMultiLineQuery(pig, query);\n Iterator<Tuple> it = pig.openIterator(\"u\");\n \n List<Tuple> expectedRes = \n Util.getTuplesFromConstantTupleStrings(\n new String[] {\n \"(1,2)\",\n \"(5,3)\",\n \"(1,2)\",\n \"(5,3)\"\n });\n Util.checkQueryOutputsAfterSort(it, expectedRes);\n\n }", "@Test void testInterpretTableFunctionWithDynamicType() {\n SchemaPlus schema = rootSchema.add(\"s\", new AbstractSchema());\n final TableFunction table1 =\n TableFunctionImpl.create(Smalls.DYNAMIC_ROW_TYPE_TABLE_METHOD);\n schema.add(\"dynamicRowTypeTable\", table1);\n final String sql = \"select *\\n\"\n + \"from table(\\\"s\\\".\\\"dynamicRowTypeTable\\\"('\"\n + \"{\\\"nullable\\\":false,\\\"fields\\\":[\"\n + \" {\\\"name\\\":\\\"i\\\",\\\"type\\\":\\\"INTEGER\\\",\\\"nullable\\\":false},\"\n + \" {\\\"name\\\":\\\"d\\\",\\\"type\\\":\\\"DATE\\\",\\\"nullable\\\":true}\"\n + \"]}', 0))\\n\"\n + \"where \\\"i\\\" < 0 and \\\"d\\\" is not null\";\n sql(sql).returnsRows();\n }", "public String composeTableNamesQuery() {\n\t\treturn String.format(\"show tables;\");\n\t}" ]
[ "0.57422537", "0.5681221", "0.5644066", "0.55456984", "0.55338997", "0.55131006", "0.54889405", "0.5417562", "0.5360047", "0.53556263", "0.5326744", "0.53148377", "0.5313099", "0.5296369", "0.5276249", "0.5239298", "0.52322483", "0.52268773", "0.5223403", "0.52059186", "0.51881635", "0.51767373", "0.5167681", "0.51296073", "0.5055725", "0.504977", "0.5042653", "0.5009346", "0.4999622", "0.49614006", "0.49576145", "0.49452597", "0.49216393", "0.4897239", "0.48883832", "0.48857287", "0.48850608", "0.48775887", "0.48511356", "0.4843609", "0.4840842", "0.4838406", "0.4835799", "0.4822891", "0.4820887", "0.48039624", "0.48032528", "0.4802704", "0.47986475", "0.47870773", "0.47791764", "0.47621468", "0.47532147", "0.473613", "0.47331476", "0.471784", "0.47118357", "0.46996215", "0.46899715", "0.4679896", "0.46716014", "0.46643394", "0.4664209", "0.4643219", "0.463677", "0.46334153", "0.46325666", "0.4629723", "0.4618731", "0.4615956", "0.46112934", "0.4597215", "0.45959178", "0.45945373", "0.45886102", "0.45859346", "0.4576752", "0.45718613", "0.45673934", "0.45667833", "0.45629922", "0.45617545", "0.45596483", "0.45596448", "0.45538977", "0.4553565", "0.4544817", "0.4541728", "0.4535865", "0.45296", "0.45277146", "0.45140985", "0.45137164", "0.4513193", "0.4509188", "0.4503481", "0.44995016", "0.44994837", "0.4496444", "0.44951284", "0.44905463" ]
0.0
-1
Creates a new external user (a user whose credentials are managed by an external LDAP).
public CreateUserExternalResponse createUserExternal(CreateUserExternalRequest request) throws GPUdbException { CreateUserExternalResponse actualResponse_ = new CreateUserExternalResponse(); submitRequest("/create/user/external", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createNewUser(final User unmanagedUser) {\n Realm realm = (mRealm == null) ? Realm.getDefaultInstance() : mRealm;\n //create by administrator\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n User u2 = realm.createObject(User.class, PrimaryKeyFactory.getInstance().nextKey(User.class));\n u2.setLoggedIn(false);\n u2.setUserId(unmanagedUser.getUserId());\n\n String password = unmanagedUser.getPassword();\n if (password == null) {\n password = \"\";\n }\n u2.setPassword(password);\n\n u2.setUserName(unmanagedUser.getUserName());\n u2.setStartDate(unmanagedUser.getStartDate());\n u2.setEndDate(unmanagedUser.getEndDate());\n u2.setCreated(new Date());\n u2.setActive(unmanagedUser.getActive());\n u2.setSpecial(false);\n u2.setPermission(unmanagedUser.getPermission());\n u2.setEnabled(unmanagedUser.getEnabled());\n }\n });\n\n if (mRealm == null)\n realm.close();\n }", "private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }", "void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "int newUser(String username, String password, Time creationTime);", "public CreateUserExternalResponse createUserExternal(String name, Map<String, String> options) throws GPUdbException {\n CreateUserExternalRequest actualRequest_ = new CreateUserExternalRequest(name, options);\n CreateUserExternalResponse actualResponse_ = new CreateUserExternalResponse();\n submitRequest(\"/create/user/external\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void createUser(User user) {\n\n\t}", "@POST\n @AuthProviderRESTExposure\n public String createUser(@QueryParam(\"token\") String authToken, APIUser user) \n throws GuacamoleException {\n UserContext userContext = authenticationService.getUserContextFromAuthToken(authToken);\n \n // Get the directory\n Directory<String, User> userDirectory = userContext.getUserDirectory();\n\n // Create the user\n userDirectory.add(new APIUserWrapper(user));\n\n return user.getUsername();\n }", "public void creatUser(String name, String phone, String email, String password);", "public synchronized User createAccount(String username, String password, String type, String actualName, String email) {\r\n\t\tUser user = new User();\r\n\t\tuser.setActualName(actualName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setPassword(password);\r\n\t\tuser.setType(type);\r\n\t\tuser.setUsername(username);\r\n\t\tboolean added = addUser(user);\r\n\t\tif (added) {\r\n\t\t\treturn user;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "boolean createUser(String username, String password);", "public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}", "public void createUser(User user);", "private void createUser(final String email, final String password) {\n\n }", "public CreateUserInternalResponse createUserInternal(CreateUserInternalRequest request) throws GPUdbException {\n CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse();\n submitRequest(\"/create/user/internal\", request, actualResponse_, false);\n return actualResponse_;\n }", "public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;", "public void createUserAccount(UserAccount account);", "HttpStatus createUserAccount(final String realm, final String username, final String firstName,\n\t\t\tfinal String lastName, final String email, final String password);", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "Human_User createHuman_User();", "public void createUser(String userName, String password,\n boolean createDB) throws Exception;", "UserCreateResponse createUser(UserCreateRequest request);", "@PostMapping(path = \"/online-sales-service/registerUser\")\n\tpublic ResponseEntity<?> createUser(@RequestBody final ActiveDirectory user, final HttpServletRequest request,\n\t\t\tfinal HttpServletResponse response) {\n\t\tResponseEntity<?> responseEntity;\n\t\tActiveDirectory thisUser = null;\n\t\ttry {\n\t\t\tthisUser = activeDirectoryService.createNewUser(user);\n\t\t} catch (Exception e) {\n\t\t\tresponseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.NOT_FOUND);\n\t\t}\n\t\tresponseEntity = new ResponseEntity<ActiveDirectory>(thisUser, HttpStatus.OK);\n\t\treturn responseEntity;\n\t}", "BaseUser createAdminUser(Application application);", "public boolean createUser(String username, String password) {\r\n \t\tboolean result = this.dataLayer.addUser(username, password);\r\n \r\n \t\treturn result;\r\n \t}", "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "AionAddress createAccount(String password);", "@Test\n public void testGetNewUser() throws Exception {\n UserMultiID umk = createRU(\"remote-user-\" + getRandomString());\n String idp = \"test-idp-\" + getRandomString();\n // create a new user.\n XMLMap map = getDBSClient().getUser(umk, idp);\n assert getDBSClient().hasUser(umk, idp);\n Identifier uid = BasicIdentifier.newID(map.get(userKeys.identifier()).toString());\n User user2 = getUserStore().get(uid);\n checkUserAgainstMap(map, user2);\n }", "User createUser();", "public String createUserAction()throws Exception{\n\t\tString response=\"\";\n\t\tresponse=getService().getUserMgmtService().createNewUser(\n\t\t\t\tgetAuthBean().getUserName(),\n\t\t\t\tgetAuthBean().getFirstName(),\n\t\t\t\tgetAuthBean().getLastName(),\n\t\t\t\tgetAuthBean().getEmailId(),\n\t\t\t\tgetAuthBean().getRole()\n\t\t);\n\t\tgetAuthBean().setResponse(response);\n\t\tinputStream = new StringBufferInputStream(response);\n\t\tinputStream.close();\n\t\treturn SUCCESS;\n\t}", "public User loginUserExternal(Map params) throws MultipleLoginException {\r\n\t\tString username = (String) params.get(\"username\");\r\n\t\tparams.put(\"externalLogin\", true);\r\n\t\tint userCount = userHelper.getUserCount();\r\n\t\tif ( userCount == 0 ) {\r\n\t\t\tparams.put(\"role\", 2); // set as Admin\r\n\t\t}\r\n\t\tUser u = userHelper.createNewUser(null, params);\r\n\r\n\t\tdhh.logLogin(username, \"AUTO_USER_CREATE\", params);\r\n\t\tu.getUserAccount().setUser( u );\r\n\t\treturn loginUserExternal(u.getUserAccount(), params);\r\n\t}", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "int createUser(User data) throws Exception;", "@Override\n\tpublic IUser creatUser() {\n\t\treturn new SqlServerUser();\n\t}", "public eu.aladdin_project.xsd.User addNewUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.xsd.User target = null;\n target = (eu.aladdin_project.xsd.User)get_store().add_element_user(USER$0);\n return target;\n }\n }", "public eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser addNewCreateUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser target = null;\n target = (eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser)get_store().add_element_user(CREATEUSER$0);\n return target;\n }\n }", "public static void createMysqlUser(Eleve e) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"CREATE USER '\" + e.getAbreviation() + \"'@'%' IDENTIFIED BY '\" + e.getPwd() + \"'; \";\r\n System.out.println(SQLRequest);\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }", "User createUser(User user);", "public CreateUserInternalResponse createUserInternal(String name, String password, Map<String, String> options) throws GPUdbException {\n CreateUserInternalRequest actualRequest_ = new CreateUserInternalRequest(name, password, options);\n CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse();\n submitRequest(\"/create/user/internal\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public static void createUser(String name, Record record) {\n\t\tEntity user = getUser(name);\n\t\tif(user == null) {\n\t\t\tuser = new Entity(\"User\", name);\n\t\t\tuser.setProperty(\"record\", record);\n\t\t}\n\t\tUtil.persistEntity(user);\n\t}", "private void createAccount(String username, String passphrase, String email) {\n\tif (!AccountManager.getUniqueInstance().candidateUsernameExists(username)) {\n\t try {\n\t\tAccountManager.getUniqueInstance().createCandidateAccount(username, \n\t\t\t\t\t\t\t\t\t passphrase, \n\t\t\t\t\t\t\t\t\t email);\n\t } catch (Exception e) {\n\t\tthrow new RuntimeException(\"creation failed\");\n\t }\n\t} else {\n\t throw new RuntimeException(\"username already exists\");\n\t}\n }", "public void createUser(SignUpDto signupdto) {\n\t\tUser user = new User();\r\n\t\t\r\n\t\tuser.setId(signupdto.getId());\r\n\t\tuser.setPw(signupdto.getPw());\r\n\t\tuser.setNickname(signupdto.getNickname());\r\n\t\t\r\n\t\tuserRepository.save(user);\t\r\n\t}", "public void makeNewUser(String name, int age, String address, String password)\n throws SQLException, ConnectionFailedException, DatabaseInsertException {\n if (this.currentUserAuthenticated) {\n // find the role ID that corresponds to customer\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n int roleId = map.roleIds.get(Roles.CUSTOMER);\n int userId = DatabaseInsertHelper.insertNewUser(name, age, address, roleId, password);\n System.out.println(\"User ID - \" + userId);\n System.out.println(\"succesfully made user\");\n } else {\n System.out.println(\"failed making user\");\n throw new ConnectionFailedException();\n }\n }", "public UserProfile createUserProfile(String username, UserProfile newProfile);", "private void createUser(Request request, Response response) {\r\n\t\tUserBean userBean = new UserBean();\r\n\t\tRESTfulSession session = null;\r\n\r\n\t\ttry {\r\n\t\t\tBeanHelper.populateUserBeanFromRequest(request, userBean);\r\n\t\t\tString username = userBean.getUsername();\r\n\t\t\tString password = userBean.getPassword();\r\n\t\t\tString email = userBean.getEmail();\r\n\r\n\t\t\tif (StringHelper.isNullOrNullString(username)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(password)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(email)) {\r\n\t\t\t\tthrow new InvalidInputException();\r\n\t\t\t}\r\n\r\n\t\t\tsession = userService.createUser(userBean);\r\n\t\t} catch (InvalidInputException e) {\r\n\t\t\tresponse.setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage());\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\t// generate response XML\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tsession);\r\n\t\t}\r\n\t}", "public void createUser(int usertype) {\n\t\tthePerson = PersonFactory.getPerson(usertype);\n\t}", "public void newUser(User user);", "public static ExUser createEntity(EntityManager em) {\n ExUser exUser = new ExUser()\n .userKey(DEFAULT_USER_KEY);\n return exUser;\n }", "User create(final User user) throws DatabaseException;", "boolean create(User user) throws Exception;", "public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "public void create(UserValidator account) {\n Account validated = new Account();\n validated.setUsername(account.getUsername());\n validated.setPassword(passwordEncoder.encode(account.getPassword()));\n validated.setFirstName(account.getFirstName());\n validated.setLastName(account.getLastName());\n validated.getAuthorities().add(\"USER\");\n\n this.accountRepository.save(validated);\n }", "@POST\n\t@Path(\"/newUser\")\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\t@Transactional\n\tpublic Response createUser(User user) {\n\t\tuserDao.createUser(user);\n\n\t\treturn Response.status(201)\n\t\t\t\t.entity(\"A new user has been created\").build();\n\t}", "public EOSUser createUser(EOSUser user, Map<String, String> userData) throws EOSDuplicatedEntryException,\n\t\t\tEOSForbiddenException, EOSUnauthorizedException, EOSValidationException;", "public UserAuthToken createUser(CreateUserRequest request);", "public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}", "Boolean registerNewUser(User user);", "public Person createAdminUser(Register entity) {\t\t\n\t\tPerson person = new Person();\n\t\tif(!searchPersonNew(entity)) {\t\t\t\n\t\t\tperson = factory.createPerson(entity);\t\t\t\t\t\t\n\t\t\tcreate(person);\t\t\t\n\t\t}\t\t\n\t\treturn person;\n\t}", "public User createUser(User newUser) {\n if(userRepository.findByUsername(newUser.getUsername()) != null){\n throw new UsernameException(\"The username is already taken please choose another one\");\n }\n newUser.setToken(\"dummy_token\"); //not really needed after registration;\n\n newUser.setStatus(UserStatus.ONLINE);\n userRepository.save(newUser); //userRepository creates User entity for the first time\n\n newUser.setToken(generateToken(newUser));\n userRepository.save(newUser); //userRepository saves the new entity items to existing user\n\n log.debug(\"Created Information for User: {}\", newUser);\n return newUser;\n }", "private User createUser(int index, boolean deleted) {\n User entity = new User();\n\n entity.setDeleted(deleted);\n entity.setUsername(\"username\" + index);\n entity.setDefaultTab(ActionTab.ADMIN);\n entity.setNetworkId(\"networkId\" + index);\n\n Role role = new Role();\n role.setName(\"role\" + index);\n entity.setRole(role);\n create(entity.getRole());\n\n entity.setFirstName(\"firstName\" + index);\n entity.setLastName(\"lastName\" + index);\n entity.setEmail(\"email\" + index);\n entity.setTelephone(\"telephone\" + index);\n\n UserStatus userStatus = new UserStatus();\n userStatus.setName(\"userStatus\" + index);\n entity.setStatus(userStatus);\n create(entity.getStatus());\n\n create(entity);\n\n return entity;\n }", "@Override\n\tpublic ApplicationResponse createUser(UserRequest request) {\n\t\tUserEntity entity = repository.save(modeltoentity.apply(request));\n\t\tif (entity != null) {\n\t\t\treturn new ApplicationResponse(true, \"Success\", enitytomodel.apply(entity));\n\t\t}\n\t\treturn new ApplicationResponse(false, \"Failure\", enitytomodel.apply(entity));\n\t}", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "@BeforeClass(alwaysRun = true)\r\n\tpublic void createUser() throws ParseException, SQLException, JoseException {\r\n\t\tSystem.out.println(\"******STARTING***********\");\r\n\t\tUser userInfo = User.builder().build();\r\n\t\tuserInfo.setUsername(userName);\r\n\t\tuserInfo.setPassword(\"Test@123\");\r\n\t\tsessionObj = EnvSession.builder().cobSession(config.getCobrandSessionObj().getCobSession())\r\n\t\t\t\t.path(config.getCobrandSessionObj().getPath()).build();\r\n\t\t//userHelper.getUserSession(\"InsightsEngineusers26 \", \"TEST@123\", sessionObj); \r\n\t\tuserHelper.getUserSession(userInfo, sessionObj);\r\n\t\tlong providerId = 16441;\r\n\t\tproviderAccountId = providerId;\r\n\t\tResponse response = providerAccountUtils.addProviderAccountStrict(providerId, \"fieldarray\",\r\n\t\t\t\t\"budget1_v1.site16441.1\", \"site16441.1\", sessionObj);\r\n\t\tproviderAccountId = response.jsonPath().getLong(JSONPaths.PROVIDER_ACC_ID);\r\n\t\tAssert.assertTrue(providerAccountId!=null);\r\n\t\t\r\n\t\t}", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "public void createUser(VUser vUser) {\n\t\tUser user = new User();\n\n\t\tboolean match = Pattern.matches(Constants.REGEX_EMAIL, vUser.getEmail());\n\t\tif (!match) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"El email tiene formato incorrecto.\");\n\t\t}\n\n\t\tif (repo.getUserByEmail(vUser.getEmail()) != null) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Ya hay un usuario con ese email.\");\n\t\t}\n\n\t\tuser.setEmail(vUser.getEmail());\n\t\tuser.setFullName(vUser.getFullName());\n\t\t\n\t\tif(vUser.getFullName() == null || vUser.getFullName().isEmpty()) {\n\t\t\tuser.setFullName(vUser.getEmail());\n\t\t}\n\n\t\t// TODO: hashear password\n\t\tuser.setPasswordHash(vUser.getPassword());\n\n\t\tuser.setRoles(vUser.getRoles());\n\t\tuser.setUserType(vUser.getUserType());\n\n\t\trepo.createUser(user);\n\t}", "Long create(EmployeeDTO u, String unencryptedPassword);", "@Test\n public void testCreateValidUser() {\n LocalUserManager ua = new LocalUserManager();\n\n try {\n ua.createUser(\"gburdell1\", \"buzz\", \"[email protected]\", \"George\", \"Burdell\", \"MANAGER\");\n } catch (Exception e) {\n Assert.fail();\n }\n Assert.assertEquals(1, ua.getUsers().size());\n Assert.assertEquals(\"gburdell1\", ua.getUsers().get(0).getUsername());\n Assert.assertEquals(\"[email protected]\", ua.getUsers().get(0).getEmail());\n Assert.assertEquals(UserClass.MANAGER, ua.getUsers().get(0).getUserClass());\n }", "public AuthInfo createAuthInfo(String username, String userid, String passwd, String ha1, String realm, String domain);", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "private User createUser(String username, String name, String email, String password) {\n UserDTO userDTO = new UserDTO();\n userDTO.setEmail(email);\n userDTO.setName(name);\n userDTO.setPassword(password);\n userDTO.setUsername(username);\n\n userService.registerUser(userDTO);\n\n User user = userService.getUserByEmail(email);\n return user;\n }", "@PreAuthorize(\"@userAuthorize.canCreate(#user)\")\n\t@RequestMapping(value = \"/createWithLogin\", method = RequestMethod.POST)\n\tpublic ResponseEntity<?> createWithLogin(@RequestBody User user, @RequestParam Map<String, Object> params) throws NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException, KeyStoreException, KeyManagementException, UnrecoverableKeyException {\n\t\t// Call serverauth to create user.\n\t String serverauthUrl = evn.getProperty(\"serverauth.url\");\n\t String token = params.get(\"token\").toString();\n\t Map<String, Object> data = new HashMap<String, Object>();\n\t data.put(\"username\", user.getUsername());\n\t data.put(\"password\", user.getPassword());\n\t data.put(\"displayname\", user.getDisplayname());\n\t data.put(\"thumbnail\", user.getThumbnail());\n\t data.put(\"enabled\", true);\n\t ResponseEntity<Object> response = RestAPIHelper.exchangeSSLService(serverauthUrl + \"/users/createWithEvent\", HttpMethod.POST, token, null, data, null);\n\t Map<String, Object> resultRemote = (Map<String, Object>) response.getBody();\n\t if(resultRemote.get(\"error\") != null) {\n\t \t// throw server exception.\n\t\t \tthrow new ServerException(Constant.SERVERCODE_ERROR);\n\t }\n\t \n\t try {\n\t \tUser result = userService.create(user);\n\t\t\t// Call serverauth to confirm create user as SUCCESS.\n\t\t\tresponse = RestAPIHelper.exchangeSSLService(serverauthUrl + \"/users/confirmStatus/\" + resultRemote.get(\"id\") + \"/\" + Constant.SERVICETRANSACTION_SUCCESS, HttpMethod.GET, token, null, null, null);\n\t\t\t// return.\n\t\t\treturn new ResponseEntity<Integer>(result.getId(), HttpStatus.OK);\n\t } catch(Exception ex) {\n\t\t\t// Call serverauth to confirm create user as ABORT.\n\t\t\tresponse = RestAPIHelper.exchangeSSLService(serverauthUrl + \"/users/confirmStatus/\" + resultRemote.get(\"id\") + \"/\" + Constant.SERVICETRANSACTION_ABORT, HttpMethod.GET, token, null, null, null);\n\t\t\t// throw server exception.\n\t\t \tthrow new ServerException(Constant.SERVERCODE_ERROR);\n\t }\n\t \n\t}", "public Login createUser(final String username, final String password, final String eMailAddress) {\r\n\t\tLogin login = this.getLogin(username);\r\n\t\tif (login == null) {\r\n\t\t\tthis.em.getTransaction().begin();\r\n\r\n\t\t\tEmailAddress email = this.getEmail(eMailAddress);\r\n\t\t\tif (email == null) {\r\n\t\t\t\temail = new EmailAddress();\r\n\t\t\t\temail.setEMailAddress(eMailAddress);\r\n\t\t\t\tthis.em.persist(email);\r\n\t\t\t}\r\n\r\n\t\t\tlogin = new Login();\r\n\t\t\tlogin.setPassword(password);\r\n\t\t\tlogin.setUser(username);\r\n\t\t\tlogin.setEmail(email);\r\n\t\t\tthis.em.persist(login);\r\n\t\t\tthis.em.getTransaction().commit();\r\n\t\t} \r\n\t\treturn login;\r\n\t}", "public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}", "public User createUser(UserDTO userDto) {\n User user = new User();\n user.setLogin(userDto.getLogin());\n user.setFirstName(userDto.getFirstName());\n user.setLastName(userDto.getLastName());\n user.setEmail(userDto.getEmail());\n if (userDto.getLangKey() == null) {\n user.setLangKey(\"en\"); // default language\n } else {\n user.setLangKey(userDto.getLangKey());\n }\n String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());\n user.setPassword(encryptedPassword);\n user.setResetKey(RandomUtil.generateResetKey());\n user.setResetDate(ZonedDateTime.now());\n user.setActivated(false);\n\n user.setRoles(getUserRoles(userDto));\n userRepository.save(user);\n log.debug(\"Created Information for User: {}\", user);\n return user;\n }", "public void addAccount(String user, String password);", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "UserAccount createUserAccount(User user, double amount);", "private void CreateUserAccount(final String lname, String lemail, String lpassword, final String lphone, final String laddress, final String groupid, final String grouppass ){\n mAuth.createUserWithEmailAndPassword(lemail,lpassword).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //account creation successful\n showMessage(\"Account Created\");\n //after user account created we need to update profile other information\n updateUserInfo(lname, pickedImgUri,lphone, laddress, groupid, grouppass, mAuth.getCurrentUser());\n }\n else{\n //account creation failed\n showMessage(\"Account creation failed\" + task.getException().getMessage());\n regBtn.setVisibility(View.VISIBLE);\n loadingProgress.setVisibility(View.INVISIBLE);\n\n }\n }\n });\n }", "public UserEntity createUser(String userName, String localUserName, String displayName) throws AmbariException {\n return createUser(userName, localUserName, displayName, true);\n }", "public UserTO createUser(String name, String email, String password) {\n\t\tUserTO res = new UserTO();\n\n\t\tres.setName(name);\n res.setEmail(email);\n res.setPassword(password);\n\t\tres.setCreationDate(new Date());\n\t\tres.setModifyDate(new Date());\n\t\tres.setActive(true);\n\n\t\treturn res;\n\t}", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "@Transactional\n public synchronized UserEntity createUser(String userName, String localUserName, String displayName, Boolean active) throws AmbariException {\n\n String validatedUserName = UserName.fromString(userName).toString();\n String validatedDisplayName = (StringUtils.isEmpty(displayName))\n ? validatedUserName\n : UserName.fromString(displayName).toString();\n String validatedLocalUserName = (StringUtils.isEmpty(localUserName))\n ? validatedUserName\n : UserName.fromString(localUserName).toString();\n\n // Ensure that the user does not already exist\n if (userDAO.findUserByName(validatedUserName) != null) {\n throw new AmbariException(\"User already exists\");\n }\n\n // Create the PrincipalEntity - needed for assigning privileges/roles\n PrincipalTypeEntity principalTypeEntity = principalTypeDAO.findById(PrincipalTypeEntity.USER_PRINCIPAL_TYPE);\n if (principalTypeEntity == null) {\n principalTypeEntity = new PrincipalTypeEntity();\n principalTypeEntity.setId(PrincipalTypeEntity.USER_PRINCIPAL_TYPE);\n principalTypeEntity.setName(PrincipalTypeEntity.USER_PRINCIPAL_TYPE_NAME);\n principalTypeDAO.create(principalTypeEntity);\n }\n PrincipalEntity principalEntity = new PrincipalEntity();\n principalEntity.setPrincipalType(principalTypeEntity);\n principalDAO.create(principalEntity);\n\n // Create the new UserEntity Record\n UserEntity userEntity = new UserEntity();\n userEntity.setUserName(validatedUserName);\n userEntity.setDisplayName(validatedDisplayName);\n userEntity.setLocalUsername(validatedLocalUserName);\n\n userEntity.setPrincipal(principalEntity);\n if (active != null) {\n userEntity.setActive(active);\n }\n\n userDAO.create(userEntity);\n\n // execute user initialization hook if required ()\n executeUserHook(validatedUserName);\n\n return userEntity;\n }", "public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void createAdministrator(OpBroker broker) {\n OpQuery query = broker.newQuery(OpUser.ADMINISTRATOR_ID_QUERY);\r\n Iterator result = broker.iterate(query);\r\n if (!result.hasNext()) {\r\n OpTransaction t = broker.newTransaction();\r\n OpUser administrator = new OpUser();\r\n administrator.setName(OpUser.ADMINISTRATOR_NAME);\r\n administrator.setDisplayName(OpUser.ADMINISTRATOR_DISPLAY_NAME);\r\n administrator.setDescription(OpUser.ADMINISTRATOR_DESCRIPTION);\r\n administrator.setPassword(OpUser.BLANK_PASSWORD);\r\n administrator.doSetLevel(new Byte(OpUser.MANAGER_USER_LEVEL));\r\n broker.makePersistent(administrator);\r\n OpContact contact = new OpContact();\r\n contact.setUser(administrator);\r\n broker.makePersistent(contact);\r\n t.commit();\r\n }\r\n }", "public String createUser(String userJson) throws IOException {\r\n ObjectMapper mapper = new ObjectMapper();\r\n\r\n User user = mapper.readValue(userJson, User.class);\r\n UserValidator userValidator = new UserValidator();\r\n boolean valid = userValidator.validateUser(user);\r\n\r\n if(!valid) {\r\n return \"ERROR\";\r\n }\r\n\r\n persistenceService.saveUser(user);\r\n\r\n return \"SUCCESS\";\r\n }", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "boolean addUser(int employeeId, String name, String password, String role);", "public int createUser(Users user) {\n\t\t int result = getTemplate().update(INSERT_users_RECORD,user.getUsername(),user.getPassword(),user.getFirstname(),user.getLastname(),user.getMobilenumber());\n\t\t\treturn result;\n\t\t\n\t\n\t}", "void registerNewUser(String login, String name, String password, String matchingPassword,\n String email);", "public void registerUser(User user) throws UserManagementException;", "public RecordObject createUser(String token, Object record) throws RestResponseException;", "@ApiMethod(name = \"insertNewUser\")\n\tpublic AuthResponse insertNewUser(@Named(\"email\") String email,\n\t\t\t@Named(\"password\") String password,\n\t\t\t@Named(\"firstName\") String firstName,\n\t\t\t@Named(\"lastName\") String lastName,\n\t\t\t@Named(\"displayName\") String displayName) {\n\t\tEntityManager mgr = getEntityManager();\n\n\t\tAuthResponse response = new AuthResponse();\n\n\t\tUser user = new User();\n\n\t\tDate insertedDate = new Date();\n\n\t\tuser.setEmail(email);\n\t\tuser.setPassword(HashUtil.getEncryptedPassword(password, insertedDate));\n\t\tuser.setInsertedDate(insertedDate);\n\t\tuser.setUpdatedDate(insertedDate);\n\t\tuser.setFirstName(firstName);\n\t\tuser.setLastName(lastName);\n\t\tuser.setDisplayName(displayName);\n\n\t\ttry {\n\t\t\t// if (containsUser(user)) {\n\t\t\t// throw new EntityExistsException(\"Object already exists\");\n\t\t\t// }\n\t\t\tmgr.persist(user);\n\t\t} finally {\n\t\t\tmgr.close();\n\t\t}\n\n\t\tresponse.setUser(user);\n\t\tresponse.setApiKey(generateAPIKey(user.getKey().getId(),\n\t\t\t\tuser.getPassword(), insertedDate.getTime()));\n\n\t\treturn response;\n\t}", "@Test\n\tpublic void testCreateAdminAccountWithTakenUsername() {\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(USERNAME1, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"This username is not available.\", error);\n\t}", "public void CreateUser(Connection conn, String user_name,\r\n String user_uid, String user_pwd, String status) \r\n throws DbException\r\n {\r\n Statement stmt = null;\r\n String sql = \"\";\r\n int id = 0;\r\n try \r\n {\r\n id = getNextID(conn, \"Users_seq\");\r\n \r\n sql = \"insert into Users values(\"+id+\", \"+sqlString(user_uid)+\", \"+sqlString(user_pwd)+\", \"+sqlString(user_name)+\", \"+sqlString(status)+\");\";\r\n stmt = conn.createStatement();\r\n stmt.execute(sql);\r\n } \r\n catch (SQLException sqle) \r\n { \r\n sqle.printStackTrace(System.err);\r\n \r\n throw new DbException(\"Internal error. Failed to call PL/SQL procedure\\n(\" +\r\n sqle.getMessage() + \")\");\r\n } \r\n finally \r\n {\r\n try \r\n {\r\n if (stmt != null) stmt.close();\r\n } \r\n catch (SQLException ignored) \r\n {}\r\n }\r\n }", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "public void create() throws DuplicateException, InvalidUserDataException, \n NoSuchAlgorithmException, SQLException {\n\tUserDA.create(this);\n }", "public User createUser(User user) {\n String loginId = user.getLoginId();\n if (dao.find(loginId) != null)\n throw new ExistingLoginException();\n\n // verify password requirements\n String password = user.getPassword();\n if (password.length() < PASSWORD_MIN_LENGTH)\n throw new InadequatePasswordException();\n\n // securely generate password hash\n String hash = BCrypt.hashpw(password, BCrypt.gensalt());\n\n return dao.create(user, hash);\n }" ]
[ "0.6881282", "0.67393064", "0.6689995", "0.6650946", "0.6647062", "0.65558773", "0.65051675", "0.64601153", "0.6421201", "0.64191335", "0.64035743", "0.64023733", "0.6392211", "0.63713026", "0.63414055", "0.63374245", "0.6280078", "0.62758356", "0.6257256", "0.6235377", "0.62159115", "0.62080103", "0.61877733", "0.6184741", "0.615586", "0.61526203", "0.61438155", "0.613216", "0.6121501", "0.610965", "0.6061516", "0.603423", "0.6033643", "0.6022442", "0.6019784", "0.6013053", "0.6004408", "0.60037315", "0.59973717", "0.599088", "0.5984076", "0.5982165", "0.59734106", "0.59726876", "0.5967929", "0.5966665", "0.59645826", "0.59589696", "0.59429437", "0.5933111", "0.59272695", "0.5925251", "0.5920389", "0.5908459", "0.5907431", "0.5871294", "0.58705825", "0.5868028", "0.58673334", "0.5860145", "0.5858063", "0.5856603", "0.5852248", "0.5842122", "0.5830328", "0.582711", "0.5807975", "0.57893187", "0.5786036", "0.5782787", "0.5780312", "0.5770647", "0.57697153", "0.5768895", "0.5768233", "0.5767878", "0.573796", "0.5734531", "0.5728082", "0.5725", "0.57244444", "0.5718759", "0.57167166", "0.57124686", "0.57117295", "0.57089514", "0.570848", "0.57032156", "0.5700938", "0.5696939", "0.56956595", "0.56944", "0.5687915", "0.568066", "0.56748486", "0.56743306", "0.5670177", "0.56648105", "0.56647336", "0.5664635" ]
0.7509696
0
Creates a new external user (a user whose credentials are managed by an external LDAP).
public CreateUserExternalResponse createUserExternal(String name, Map<String, String> options) throws GPUdbException { CreateUserExternalRequest actualRequest_ = new CreateUserExternalRequest(name, options); CreateUserExternalResponse actualResponse_ = new CreateUserExternalResponse(); submitRequest("/create/user/external", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateUserExternalResponse createUserExternal(CreateUserExternalRequest request) throws GPUdbException {\n CreateUserExternalResponse actualResponse_ = new CreateUserExternalResponse();\n submitRequest(\"/create/user/external\", request, actualResponse_, false);\n return actualResponse_;\n }", "private void createNewUser(final User unmanagedUser) {\n Realm realm = (mRealm == null) ? Realm.getDefaultInstance() : mRealm;\n //create by administrator\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n User u2 = realm.createObject(User.class, PrimaryKeyFactory.getInstance().nextKey(User.class));\n u2.setLoggedIn(false);\n u2.setUserId(unmanagedUser.getUserId());\n\n String password = unmanagedUser.getPassword();\n if (password == null) {\n password = \"\";\n }\n u2.setPassword(password);\n\n u2.setUserName(unmanagedUser.getUserName());\n u2.setStartDate(unmanagedUser.getStartDate());\n u2.setEndDate(unmanagedUser.getEndDate());\n u2.setCreated(new Date());\n u2.setActive(unmanagedUser.getActive());\n u2.setSpecial(false);\n u2.setPermission(unmanagedUser.getPermission());\n u2.setEnabled(unmanagedUser.getEnabled());\n }\n });\n\n if (mRealm == null)\n realm.close();\n }", "private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }", "void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "int newUser(String username, String password, Time creationTime);", "public void createUser(User user) {\n\n\t}", "@POST\n @AuthProviderRESTExposure\n public String createUser(@QueryParam(\"token\") String authToken, APIUser user) \n throws GuacamoleException {\n UserContext userContext = authenticationService.getUserContextFromAuthToken(authToken);\n \n // Get the directory\n Directory<String, User> userDirectory = userContext.getUserDirectory();\n\n // Create the user\n userDirectory.add(new APIUserWrapper(user));\n\n return user.getUsername();\n }", "public void creatUser(String name, String phone, String email, String password);", "public synchronized User createAccount(String username, String password, String type, String actualName, String email) {\r\n\t\tUser user = new User();\r\n\t\tuser.setActualName(actualName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setPassword(password);\r\n\t\tuser.setType(type);\r\n\t\tuser.setUsername(username);\r\n\t\tboolean added = addUser(user);\r\n\t\tif (added) {\r\n\t\t\treturn user;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "boolean createUser(String username, String password);", "public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}", "public void createUser(User user);", "private void createUser(final String email, final String password) {\n\n }", "public CreateUserInternalResponse createUserInternal(CreateUserInternalRequest request) throws GPUdbException {\n CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse();\n submitRequest(\"/create/user/internal\", request, actualResponse_, false);\n return actualResponse_;\n }", "public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;", "public void createUserAccount(UserAccount account);", "HttpStatus createUserAccount(final String realm, final String username, final String firstName,\n\t\t\tfinal String lastName, final String email, final String password);", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "Human_User createHuman_User();", "public void createUser(String userName, String password,\n boolean createDB) throws Exception;", "UserCreateResponse createUser(UserCreateRequest request);", "@PostMapping(path = \"/online-sales-service/registerUser\")\n\tpublic ResponseEntity<?> createUser(@RequestBody final ActiveDirectory user, final HttpServletRequest request,\n\t\t\tfinal HttpServletResponse response) {\n\t\tResponseEntity<?> responseEntity;\n\t\tActiveDirectory thisUser = null;\n\t\ttry {\n\t\t\tthisUser = activeDirectoryService.createNewUser(user);\n\t\t} catch (Exception e) {\n\t\t\tresponseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.NOT_FOUND);\n\t\t}\n\t\tresponseEntity = new ResponseEntity<ActiveDirectory>(thisUser, HttpStatus.OK);\n\t\treturn responseEntity;\n\t}", "BaseUser createAdminUser(Application application);", "public boolean createUser(String username, String password) {\r\n \t\tboolean result = this.dataLayer.addUser(username, password);\r\n \r\n \t\treturn result;\r\n \t}", "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "AionAddress createAccount(String password);", "@Test\n public void testGetNewUser() throws Exception {\n UserMultiID umk = createRU(\"remote-user-\" + getRandomString());\n String idp = \"test-idp-\" + getRandomString();\n // create a new user.\n XMLMap map = getDBSClient().getUser(umk, idp);\n assert getDBSClient().hasUser(umk, idp);\n Identifier uid = BasicIdentifier.newID(map.get(userKeys.identifier()).toString());\n User user2 = getUserStore().get(uid);\n checkUserAgainstMap(map, user2);\n }", "User createUser();", "public String createUserAction()throws Exception{\n\t\tString response=\"\";\n\t\tresponse=getService().getUserMgmtService().createNewUser(\n\t\t\t\tgetAuthBean().getUserName(),\n\t\t\t\tgetAuthBean().getFirstName(),\n\t\t\t\tgetAuthBean().getLastName(),\n\t\t\t\tgetAuthBean().getEmailId(),\n\t\t\t\tgetAuthBean().getRole()\n\t\t);\n\t\tgetAuthBean().setResponse(response);\n\t\tinputStream = new StringBufferInputStream(response);\n\t\tinputStream.close();\n\t\treturn SUCCESS;\n\t}", "public User loginUserExternal(Map params) throws MultipleLoginException {\r\n\t\tString username = (String) params.get(\"username\");\r\n\t\tparams.put(\"externalLogin\", true);\r\n\t\tint userCount = userHelper.getUserCount();\r\n\t\tif ( userCount == 0 ) {\r\n\t\t\tparams.put(\"role\", 2); // set as Admin\r\n\t\t}\r\n\t\tUser u = userHelper.createNewUser(null, params);\r\n\r\n\t\tdhh.logLogin(username, \"AUTO_USER_CREATE\", params);\r\n\t\tu.getUserAccount().setUser( u );\r\n\t\treturn loginUserExternal(u.getUserAccount(), params);\r\n\t}", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "int createUser(User data) throws Exception;", "@Override\n\tpublic IUser creatUser() {\n\t\treturn new SqlServerUser();\n\t}", "public eu.aladdin_project.xsd.User addNewUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.xsd.User target = null;\n target = (eu.aladdin_project.xsd.User)get_store().add_element_user(USER$0);\n return target;\n }\n }", "public eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser addNewCreateUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser target = null;\n target = (eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser)get_store().add_element_user(CREATEUSER$0);\n return target;\n }\n }", "public static void createMysqlUser(Eleve e) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"CREATE USER '\" + e.getAbreviation() + \"'@'%' IDENTIFIED BY '\" + e.getPwd() + \"'; \";\r\n System.out.println(SQLRequest);\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }", "User createUser(User user);", "public CreateUserInternalResponse createUserInternal(String name, String password, Map<String, String> options) throws GPUdbException {\n CreateUserInternalRequest actualRequest_ = new CreateUserInternalRequest(name, password, options);\n CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse();\n submitRequest(\"/create/user/internal\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public static void createUser(String name, Record record) {\n\t\tEntity user = getUser(name);\n\t\tif(user == null) {\n\t\t\tuser = new Entity(\"User\", name);\n\t\t\tuser.setProperty(\"record\", record);\n\t\t}\n\t\tUtil.persistEntity(user);\n\t}", "private void createAccount(String username, String passphrase, String email) {\n\tif (!AccountManager.getUniqueInstance().candidateUsernameExists(username)) {\n\t try {\n\t\tAccountManager.getUniqueInstance().createCandidateAccount(username, \n\t\t\t\t\t\t\t\t\t passphrase, \n\t\t\t\t\t\t\t\t\t email);\n\t } catch (Exception e) {\n\t\tthrow new RuntimeException(\"creation failed\");\n\t }\n\t} else {\n\t throw new RuntimeException(\"username already exists\");\n\t}\n }", "public void createUser(SignUpDto signupdto) {\n\t\tUser user = new User();\r\n\t\t\r\n\t\tuser.setId(signupdto.getId());\r\n\t\tuser.setPw(signupdto.getPw());\r\n\t\tuser.setNickname(signupdto.getNickname());\r\n\t\t\r\n\t\tuserRepository.save(user);\t\r\n\t}", "public void makeNewUser(String name, int age, String address, String password)\n throws SQLException, ConnectionFailedException, DatabaseInsertException {\n if (this.currentUserAuthenticated) {\n // find the role ID that corresponds to customer\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n int roleId = map.roleIds.get(Roles.CUSTOMER);\n int userId = DatabaseInsertHelper.insertNewUser(name, age, address, roleId, password);\n System.out.println(\"User ID - \" + userId);\n System.out.println(\"succesfully made user\");\n } else {\n System.out.println(\"failed making user\");\n throw new ConnectionFailedException();\n }\n }", "public UserProfile createUserProfile(String username, UserProfile newProfile);", "private void createUser(Request request, Response response) {\r\n\t\tUserBean userBean = new UserBean();\r\n\t\tRESTfulSession session = null;\r\n\r\n\t\ttry {\r\n\t\t\tBeanHelper.populateUserBeanFromRequest(request, userBean);\r\n\t\t\tString username = userBean.getUsername();\r\n\t\t\tString password = userBean.getPassword();\r\n\t\t\tString email = userBean.getEmail();\r\n\r\n\t\t\tif (StringHelper.isNullOrNullString(username)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(password)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(email)) {\r\n\t\t\t\tthrow new InvalidInputException();\r\n\t\t\t}\r\n\r\n\t\t\tsession = userService.createUser(userBean);\r\n\t\t} catch (InvalidInputException e) {\r\n\t\t\tresponse.setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage());\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\t// generate response XML\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tsession);\r\n\t\t}\r\n\t}", "public void createUser(int usertype) {\n\t\tthePerson = PersonFactory.getPerson(usertype);\n\t}", "public void newUser(User user);", "public static ExUser createEntity(EntityManager em) {\n ExUser exUser = new ExUser()\n .userKey(DEFAULT_USER_KEY);\n return exUser;\n }", "User create(final User user) throws DatabaseException;", "boolean create(User user) throws Exception;", "public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "public void create(UserValidator account) {\n Account validated = new Account();\n validated.setUsername(account.getUsername());\n validated.setPassword(passwordEncoder.encode(account.getPassword()));\n validated.setFirstName(account.getFirstName());\n validated.setLastName(account.getLastName());\n validated.getAuthorities().add(\"USER\");\n\n this.accountRepository.save(validated);\n }", "@POST\n\t@Path(\"/newUser\")\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\t@Transactional\n\tpublic Response createUser(User user) {\n\t\tuserDao.createUser(user);\n\n\t\treturn Response.status(201)\n\t\t\t\t.entity(\"A new user has been created\").build();\n\t}", "public EOSUser createUser(EOSUser user, Map<String, String> userData) throws EOSDuplicatedEntryException,\n\t\t\tEOSForbiddenException, EOSUnauthorizedException, EOSValidationException;", "public UserAuthToken createUser(CreateUserRequest request);", "public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}", "Boolean registerNewUser(User user);", "public Person createAdminUser(Register entity) {\t\t\n\t\tPerson person = new Person();\n\t\tif(!searchPersonNew(entity)) {\t\t\t\n\t\t\tperson = factory.createPerson(entity);\t\t\t\t\t\t\n\t\t\tcreate(person);\t\t\t\n\t\t}\t\t\n\t\treturn person;\n\t}", "public User createUser(User newUser) {\n if(userRepository.findByUsername(newUser.getUsername()) != null){\n throw new UsernameException(\"The username is already taken please choose another one\");\n }\n newUser.setToken(\"dummy_token\"); //not really needed after registration;\n\n newUser.setStatus(UserStatus.ONLINE);\n userRepository.save(newUser); //userRepository creates User entity for the first time\n\n newUser.setToken(generateToken(newUser));\n userRepository.save(newUser); //userRepository saves the new entity items to existing user\n\n log.debug(\"Created Information for User: {}\", newUser);\n return newUser;\n }", "private User createUser(int index, boolean deleted) {\n User entity = new User();\n\n entity.setDeleted(deleted);\n entity.setUsername(\"username\" + index);\n entity.setDefaultTab(ActionTab.ADMIN);\n entity.setNetworkId(\"networkId\" + index);\n\n Role role = new Role();\n role.setName(\"role\" + index);\n entity.setRole(role);\n create(entity.getRole());\n\n entity.setFirstName(\"firstName\" + index);\n entity.setLastName(\"lastName\" + index);\n entity.setEmail(\"email\" + index);\n entity.setTelephone(\"telephone\" + index);\n\n UserStatus userStatus = new UserStatus();\n userStatus.setName(\"userStatus\" + index);\n entity.setStatus(userStatus);\n create(entity.getStatus());\n\n create(entity);\n\n return entity;\n }", "@Override\n\tpublic ApplicationResponse createUser(UserRequest request) {\n\t\tUserEntity entity = repository.save(modeltoentity.apply(request));\n\t\tif (entity != null) {\n\t\t\treturn new ApplicationResponse(true, \"Success\", enitytomodel.apply(entity));\n\t\t}\n\t\treturn new ApplicationResponse(false, \"Failure\", enitytomodel.apply(entity));\n\t}", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "@BeforeClass(alwaysRun = true)\r\n\tpublic void createUser() throws ParseException, SQLException, JoseException {\r\n\t\tSystem.out.println(\"******STARTING***********\");\r\n\t\tUser userInfo = User.builder().build();\r\n\t\tuserInfo.setUsername(userName);\r\n\t\tuserInfo.setPassword(\"Test@123\");\r\n\t\tsessionObj = EnvSession.builder().cobSession(config.getCobrandSessionObj().getCobSession())\r\n\t\t\t\t.path(config.getCobrandSessionObj().getPath()).build();\r\n\t\t//userHelper.getUserSession(\"InsightsEngineusers26 \", \"TEST@123\", sessionObj); \r\n\t\tuserHelper.getUserSession(userInfo, sessionObj);\r\n\t\tlong providerId = 16441;\r\n\t\tproviderAccountId = providerId;\r\n\t\tResponse response = providerAccountUtils.addProviderAccountStrict(providerId, \"fieldarray\",\r\n\t\t\t\t\"budget1_v1.site16441.1\", \"site16441.1\", sessionObj);\r\n\t\tproviderAccountId = response.jsonPath().getLong(JSONPaths.PROVIDER_ACC_ID);\r\n\t\tAssert.assertTrue(providerAccountId!=null);\r\n\t\t\r\n\t\t}", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "public void createUser(VUser vUser) {\n\t\tUser user = new User();\n\n\t\tboolean match = Pattern.matches(Constants.REGEX_EMAIL, vUser.getEmail());\n\t\tif (!match) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"El email tiene formato incorrecto.\");\n\t\t}\n\n\t\tif (repo.getUserByEmail(vUser.getEmail()) != null) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Ya hay un usuario con ese email.\");\n\t\t}\n\n\t\tuser.setEmail(vUser.getEmail());\n\t\tuser.setFullName(vUser.getFullName());\n\t\t\n\t\tif(vUser.getFullName() == null || vUser.getFullName().isEmpty()) {\n\t\t\tuser.setFullName(vUser.getEmail());\n\t\t}\n\n\t\t// TODO: hashear password\n\t\tuser.setPasswordHash(vUser.getPassword());\n\n\t\tuser.setRoles(vUser.getRoles());\n\t\tuser.setUserType(vUser.getUserType());\n\n\t\trepo.createUser(user);\n\t}", "Long create(EmployeeDTO u, String unencryptedPassword);", "@Test\n public void testCreateValidUser() {\n LocalUserManager ua = new LocalUserManager();\n\n try {\n ua.createUser(\"gburdell1\", \"buzz\", \"[email protected]\", \"George\", \"Burdell\", \"MANAGER\");\n } catch (Exception e) {\n Assert.fail();\n }\n Assert.assertEquals(1, ua.getUsers().size());\n Assert.assertEquals(\"gburdell1\", ua.getUsers().get(0).getUsername());\n Assert.assertEquals(\"[email protected]\", ua.getUsers().get(0).getEmail());\n Assert.assertEquals(UserClass.MANAGER, ua.getUsers().get(0).getUserClass());\n }", "public AuthInfo createAuthInfo(String username, String userid, String passwd, String ha1, String realm, String domain);", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "private User createUser(String username, String name, String email, String password) {\n UserDTO userDTO = new UserDTO();\n userDTO.setEmail(email);\n userDTO.setName(name);\n userDTO.setPassword(password);\n userDTO.setUsername(username);\n\n userService.registerUser(userDTO);\n\n User user = userService.getUserByEmail(email);\n return user;\n }", "@PreAuthorize(\"@userAuthorize.canCreate(#user)\")\n\t@RequestMapping(value = \"/createWithLogin\", method = RequestMethod.POST)\n\tpublic ResponseEntity<?> createWithLogin(@RequestBody User user, @RequestParam Map<String, Object> params) throws NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException, KeyStoreException, KeyManagementException, UnrecoverableKeyException {\n\t\t// Call serverauth to create user.\n\t String serverauthUrl = evn.getProperty(\"serverauth.url\");\n\t String token = params.get(\"token\").toString();\n\t Map<String, Object> data = new HashMap<String, Object>();\n\t data.put(\"username\", user.getUsername());\n\t data.put(\"password\", user.getPassword());\n\t data.put(\"displayname\", user.getDisplayname());\n\t data.put(\"thumbnail\", user.getThumbnail());\n\t data.put(\"enabled\", true);\n\t ResponseEntity<Object> response = RestAPIHelper.exchangeSSLService(serverauthUrl + \"/users/createWithEvent\", HttpMethod.POST, token, null, data, null);\n\t Map<String, Object> resultRemote = (Map<String, Object>) response.getBody();\n\t if(resultRemote.get(\"error\") != null) {\n\t \t// throw server exception.\n\t\t \tthrow new ServerException(Constant.SERVERCODE_ERROR);\n\t }\n\t \n\t try {\n\t \tUser result = userService.create(user);\n\t\t\t// Call serverauth to confirm create user as SUCCESS.\n\t\t\tresponse = RestAPIHelper.exchangeSSLService(serverauthUrl + \"/users/confirmStatus/\" + resultRemote.get(\"id\") + \"/\" + Constant.SERVICETRANSACTION_SUCCESS, HttpMethod.GET, token, null, null, null);\n\t\t\t// return.\n\t\t\treturn new ResponseEntity<Integer>(result.getId(), HttpStatus.OK);\n\t } catch(Exception ex) {\n\t\t\t// Call serverauth to confirm create user as ABORT.\n\t\t\tresponse = RestAPIHelper.exchangeSSLService(serverauthUrl + \"/users/confirmStatus/\" + resultRemote.get(\"id\") + \"/\" + Constant.SERVICETRANSACTION_ABORT, HttpMethod.GET, token, null, null, null);\n\t\t\t// throw server exception.\n\t\t \tthrow new ServerException(Constant.SERVERCODE_ERROR);\n\t }\n\t \n\t}", "public Login createUser(final String username, final String password, final String eMailAddress) {\r\n\t\tLogin login = this.getLogin(username);\r\n\t\tif (login == null) {\r\n\t\t\tthis.em.getTransaction().begin();\r\n\r\n\t\t\tEmailAddress email = this.getEmail(eMailAddress);\r\n\t\t\tif (email == null) {\r\n\t\t\t\temail = new EmailAddress();\r\n\t\t\t\temail.setEMailAddress(eMailAddress);\r\n\t\t\t\tthis.em.persist(email);\r\n\t\t\t}\r\n\r\n\t\t\tlogin = new Login();\r\n\t\t\tlogin.setPassword(password);\r\n\t\t\tlogin.setUser(username);\r\n\t\t\tlogin.setEmail(email);\r\n\t\t\tthis.em.persist(login);\r\n\t\t\tthis.em.getTransaction().commit();\r\n\t\t} \r\n\t\treturn login;\r\n\t}", "public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}", "public User createUser(UserDTO userDto) {\n User user = new User();\n user.setLogin(userDto.getLogin());\n user.setFirstName(userDto.getFirstName());\n user.setLastName(userDto.getLastName());\n user.setEmail(userDto.getEmail());\n if (userDto.getLangKey() == null) {\n user.setLangKey(\"en\"); // default language\n } else {\n user.setLangKey(userDto.getLangKey());\n }\n String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());\n user.setPassword(encryptedPassword);\n user.setResetKey(RandomUtil.generateResetKey());\n user.setResetDate(ZonedDateTime.now());\n user.setActivated(false);\n\n user.setRoles(getUserRoles(userDto));\n userRepository.save(user);\n log.debug(\"Created Information for User: {}\", user);\n return user;\n }", "public void addAccount(String user, String password);", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "UserAccount createUserAccount(User user, double amount);", "private void CreateUserAccount(final String lname, String lemail, String lpassword, final String lphone, final String laddress, final String groupid, final String grouppass ){\n mAuth.createUserWithEmailAndPassword(lemail,lpassword).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //account creation successful\n showMessage(\"Account Created\");\n //after user account created we need to update profile other information\n updateUserInfo(lname, pickedImgUri,lphone, laddress, groupid, grouppass, mAuth.getCurrentUser());\n }\n else{\n //account creation failed\n showMessage(\"Account creation failed\" + task.getException().getMessage());\n regBtn.setVisibility(View.VISIBLE);\n loadingProgress.setVisibility(View.INVISIBLE);\n\n }\n }\n });\n }", "public UserEntity createUser(String userName, String localUserName, String displayName) throws AmbariException {\n return createUser(userName, localUserName, displayName, true);\n }", "public UserTO createUser(String name, String email, String password) {\n\t\tUserTO res = new UserTO();\n\n\t\tres.setName(name);\n res.setEmail(email);\n res.setPassword(password);\n\t\tres.setCreationDate(new Date());\n\t\tres.setModifyDate(new Date());\n\t\tres.setActive(true);\n\n\t\treturn res;\n\t}", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "@Transactional\n public synchronized UserEntity createUser(String userName, String localUserName, String displayName, Boolean active) throws AmbariException {\n\n String validatedUserName = UserName.fromString(userName).toString();\n String validatedDisplayName = (StringUtils.isEmpty(displayName))\n ? validatedUserName\n : UserName.fromString(displayName).toString();\n String validatedLocalUserName = (StringUtils.isEmpty(localUserName))\n ? validatedUserName\n : UserName.fromString(localUserName).toString();\n\n // Ensure that the user does not already exist\n if (userDAO.findUserByName(validatedUserName) != null) {\n throw new AmbariException(\"User already exists\");\n }\n\n // Create the PrincipalEntity - needed for assigning privileges/roles\n PrincipalTypeEntity principalTypeEntity = principalTypeDAO.findById(PrincipalTypeEntity.USER_PRINCIPAL_TYPE);\n if (principalTypeEntity == null) {\n principalTypeEntity = new PrincipalTypeEntity();\n principalTypeEntity.setId(PrincipalTypeEntity.USER_PRINCIPAL_TYPE);\n principalTypeEntity.setName(PrincipalTypeEntity.USER_PRINCIPAL_TYPE_NAME);\n principalTypeDAO.create(principalTypeEntity);\n }\n PrincipalEntity principalEntity = new PrincipalEntity();\n principalEntity.setPrincipalType(principalTypeEntity);\n principalDAO.create(principalEntity);\n\n // Create the new UserEntity Record\n UserEntity userEntity = new UserEntity();\n userEntity.setUserName(validatedUserName);\n userEntity.setDisplayName(validatedDisplayName);\n userEntity.setLocalUsername(validatedLocalUserName);\n\n userEntity.setPrincipal(principalEntity);\n if (active != null) {\n userEntity.setActive(active);\n }\n\n userDAO.create(userEntity);\n\n // execute user initialization hook if required ()\n executeUserHook(validatedUserName);\n\n return userEntity;\n }", "public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void createAdministrator(OpBroker broker) {\n OpQuery query = broker.newQuery(OpUser.ADMINISTRATOR_ID_QUERY);\r\n Iterator result = broker.iterate(query);\r\n if (!result.hasNext()) {\r\n OpTransaction t = broker.newTransaction();\r\n OpUser administrator = new OpUser();\r\n administrator.setName(OpUser.ADMINISTRATOR_NAME);\r\n administrator.setDisplayName(OpUser.ADMINISTRATOR_DISPLAY_NAME);\r\n administrator.setDescription(OpUser.ADMINISTRATOR_DESCRIPTION);\r\n administrator.setPassword(OpUser.BLANK_PASSWORD);\r\n administrator.doSetLevel(new Byte(OpUser.MANAGER_USER_LEVEL));\r\n broker.makePersistent(administrator);\r\n OpContact contact = new OpContact();\r\n contact.setUser(administrator);\r\n broker.makePersistent(contact);\r\n t.commit();\r\n }\r\n }", "public String createUser(String userJson) throws IOException {\r\n ObjectMapper mapper = new ObjectMapper();\r\n\r\n User user = mapper.readValue(userJson, User.class);\r\n UserValidator userValidator = new UserValidator();\r\n boolean valid = userValidator.validateUser(user);\r\n\r\n if(!valid) {\r\n return \"ERROR\";\r\n }\r\n\r\n persistenceService.saveUser(user);\r\n\r\n return \"SUCCESS\";\r\n }", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "boolean addUser(int employeeId, String name, String password, String role);", "public int createUser(Users user) {\n\t\t int result = getTemplate().update(INSERT_users_RECORD,user.getUsername(),user.getPassword(),user.getFirstname(),user.getLastname(),user.getMobilenumber());\n\t\t\treturn result;\n\t\t\n\t\n\t}", "void registerNewUser(String login, String name, String password, String matchingPassword,\n String email);", "public void registerUser(User user) throws UserManagementException;", "public RecordObject createUser(String token, Object record) throws RestResponseException;", "@ApiMethod(name = \"insertNewUser\")\n\tpublic AuthResponse insertNewUser(@Named(\"email\") String email,\n\t\t\t@Named(\"password\") String password,\n\t\t\t@Named(\"firstName\") String firstName,\n\t\t\t@Named(\"lastName\") String lastName,\n\t\t\t@Named(\"displayName\") String displayName) {\n\t\tEntityManager mgr = getEntityManager();\n\n\t\tAuthResponse response = new AuthResponse();\n\n\t\tUser user = new User();\n\n\t\tDate insertedDate = new Date();\n\n\t\tuser.setEmail(email);\n\t\tuser.setPassword(HashUtil.getEncryptedPassword(password, insertedDate));\n\t\tuser.setInsertedDate(insertedDate);\n\t\tuser.setUpdatedDate(insertedDate);\n\t\tuser.setFirstName(firstName);\n\t\tuser.setLastName(lastName);\n\t\tuser.setDisplayName(displayName);\n\n\t\ttry {\n\t\t\t// if (containsUser(user)) {\n\t\t\t// throw new EntityExistsException(\"Object already exists\");\n\t\t\t// }\n\t\t\tmgr.persist(user);\n\t\t} finally {\n\t\t\tmgr.close();\n\t\t}\n\n\t\tresponse.setUser(user);\n\t\tresponse.setApiKey(generateAPIKey(user.getKey().getId(),\n\t\t\t\tuser.getPassword(), insertedDate.getTime()));\n\n\t\treturn response;\n\t}", "@Test\n\tpublic void testCreateAdminAccountWithTakenUsername() {\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(USERNAME1, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"This username is not available.\", error);\n\t}", "public void CreateUser(Connection conn, String user_name,\r\n String user_uid, String user_pwd, String status) \r\n throws DbException\r\n {\r\n Statement stmt = null;\r\n String sql = \"\";\r\n int id = 0;\r\n try \r\n {\r\n id = getNextID(conn, \"Users_seq\");\r\n \r\n sql = \"insert into Users values(\"+id+\", \"+sqlString(user_uid)+\", \"+sqlString(user_pwd)+\", \"+sqlString(user_name)+\", \"+sqlString(status)+\");\";\r\n stmt = conn.createStatement();\r\n stmt.execute(sql);\r\n } \r\n catch (SQLException sqle) \r\n { \r\n sqle.printStackTrace(System.err);\r\n \r\n throw new DbException(\"Internal error. Failed to call PL/SQL procedure\\n(\" +\r\n sqle.getMessage() + \")\");\r\n } \r\n finally \r\n {\r\n try \r\n {\r\n if (stmt != null) stmt.close();\r\n } \r\n catch (SQLException ignored) \r\n {}\r\n }\r\n }", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "public void create() throws DuplicateException, InvalidUserDataException, \n NoSuchAlgorithmException, SQLException {\n\tUserDA.create(this);\n }", "public User createUser(User user) {\n String loginId = user.getLoginId();\n if (dao.find(loginId) != null)\n throw new ExistingLoginException();\n\n // verify password requirements\n String password = user.getPassword();\n if (password.length() < PASSWORD_MIN_LENGTH)\n throw new InadequatePasswordException();\n\n // securely generate password hash\n String hash = BCrypt.hashpw(password, BCrypt.gensalt());\n\n return dao.create(user, hash);\n }" ]
[ "0.7509696", "0.6881282", "0.67393064", "0.6689995", "0.6650946", "0.6647062", "0.65051675", "0.64601153", "0.6421201", "0.64191335", "0.64035743", "0.64023733", "0.6392211", "0.63713026", "0.63414055", "0.63374245", "0.6280078", "0.62758356", "0.6257256", "0.6235377", "0.62159115", "0.62080103", "0.61877733", "0.6184741", "0.615586", "0.61526203", "0.61438155", "0.613216", "0.6121501", "0.610965", "0.6061516", "0.603423", "0.6033643", "0.6022442", "0.6019784", "0.6013053", "0.6004408", "0.60037315", "0.59973717", "0.599088", "0.5984076", "0.5982165", "0.59734106", "0.59726876", "0.5967929", "0.5966665", "0.59645826", "0.59589696", "0.59429437", "0.5933111", "0.59272695", "0.5925251", "0.5920389", "0.5908459", "0.5907431", "0.5871294", "0.58705825", "0.5868028", "0.58673334", "0.5860145", "0.5858063", "0.5856603", "0.5852248", "0.5842122", "0.5830328", "0.582711", "0.5807975", "0.57893187", "0.5786036", "0.5782787", "0.5780312", "0.5770647", "0.57697153", "0.5768895", "0.5768233", "0.5767878", "0.573796", "0.5734531", "0.5728082", "0.5725", "0.57244444", "0.5718759", "0.57167166", "0.57124686", "0.57117295", "0.57089514", "0.570848", "0.57032156", "0.5700938", "0.5696939", "0.56956595", "0.56944", "0.5687915", "0.568066", "0.56748486", "0.56743306", "0.5670177", "0.56648105", "0.56647336", "0.5664635" ]
0.65558773
6
Creates a new internal user (a user whose credentials are managed by the database system).
public CreateUserInternalResponse createUserInternal(CreateUserInternalRequest request) throws GPUdbException { CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse(); submitRequest("/create/user/internal", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int newUser(String username, String password, Time creationTime);", "@Override\n\tpublic IUser creatUser() {\n\t\treturn new SqlServerUser();\n\t}", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "private void createNewUser(final User unmanagedUser) {\n Realm realm = (mRealm == null) ? Realm.getDefaultInstance() : mRealm;\n //create by administrator\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n User u2 = realm.createObject(User.class, PrimaryKeyFactory.getInstance().nextKey(User.class));\n u2.setLoggedIn(false);\n u2.setUserId(unmanagedUser.getUserId());\n\n String password = unmanagedUser.getPassword();\n if (password == null) {\n password = \"\";\n }\n u2.setPassword(password);\n\n u2.setUserName(unmanagedUser.getUserName());\n u2.setStartDate(unmanagedUser.getStartDate());\n u2.setEndDate(unmanagedUser.getEndDate());\n u2.setCreated(new Date());\n u2.setActive(unmanagedUser.getActive());\n u2.setSpecial(false);\n u2.setPermission(unmanagedUser.getPermission());\n u2.setEnabled(unmanagedUser.getEnabled());\n }\n });\n\n if (mRealm == null)\n realm.close();\n }", "void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;", "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "public void createUser(User user) {\n\n\t}", "private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }", "public void createUser(String userName, String password,\n boolean createDB) throws Exception;", "public CreateUserInternalResponse createUserInternal(String name, String password, Map<String, String> options) throws GPUdbException {\n CreateUserInternalRequest actualRequest_ = new CreateUserInternalRequest(name, password, options);\n CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse();\n submitRequest(\"/create/user/internal\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "private void createUser(final String email, final String password) {\n\n }", "public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}", "public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "boolean createUser(String username, String password);", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "User createUser();", "User create(final User user) throws DatabaseException;", "public void createUser(User user);", "BaseUser createAdminUser(Application application);", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "public static User createBasicUser () {\n User user = new User();\n user.setUsername(\"basicUser\");\n user.setPassword(\"secret\");\n user.setEmail(\"[email protected]\");\n user.setFirstName(\"firstName\");\n user.setLastName(\"lastName\");\n user.setPhoneNumber(\"123456789123\");\n user.setCountry(\"GB\");\n user.setEnabled(true);\n user.setDescription(\"A basic user\");\n user.setProfileImageUrl(\"https://blabla.images.com/basicuser\");\n\n return user;\n }", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "public User createUser(User newUser) {\n if(userRepository.findByUsername(newUser.getUsername()) != null){\n throw new UsernameException(\"The username is already taken please choose another one\");\n }\n newUser.setToken(\"dummy_token\"); //not really needed after registration;\n\n newUser.setStatus(UserStatus.ONLINE);\n userRepository.save(newUser); //userRepository creates User entity for the first time\n\n newUser.setToken(generateToken(newUser));\n userRepository.save(newUser); //userRepository saves the new entity items to existing user\n\n log.debug(\"Created Information for User: {}\", newUser);\n return newUser;\n }", "Human_User createHuman_User();", "public static void createMysqlUser(Eleve e) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"CREATE USER '\" + e.getAbreviation() + \"'@'%' IDENTIFIED BY '\" + e.getPwd() + \"'; \";\r\n System.out.println(SQLRequest);\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "public void creatUser(String name, String phone, String email, String password);", "public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;", "public EOSUser createUser(EOSUser user, Map<String, String> userData) throws EOSDuplicatedEntryException,\n\t\t\tEOSForbiddenException, EOSUnauthorizedException, EOSValidationException;", "public User createUser(UserDTO userDto) {\n User user = new User();\n user.setLogin(userDto.getLogin());\n user.setFirstName(userDto.getFirstName());\n user.setLastName(userDto.getLastName());\n user.setEmail(userDto.getEmail());\n if (userDto.getLangKey() == null) {\n user.setLangKey(\"en\"); // default language\n } else {\n user.setLangKey(userDto.getLangKey());\n }\n String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());\n user.setPassword(encryptedPassword);\n user.setResetKey(RandomUtil.generateResetKey());\n user.setResetDate(ZonedDateTime.now());\n user.setActivated(false);\n\n user.setRoles(getUserRoles(userDto));\n userRepository.save(user);\n log.debug(\"Created Information for User: {}\", user);\n return user;\n }", "private User createUser(String username, String name, String email, String password) {\n UserDTO userDTO = new UserDTO();\n userDTO.setEmail(email);\n userDTO.setName(name);\n userDTO.setPassword(password);\n userDTO.setUsername(username);\n\n userService.registerUser(userDTO);\n\n User user = userService.getUserByEmail(email);\n return user;\n }", "@Override\r\n\tpublic Object createUser() throws DataAccessException, SQLException {\n\t\treturn null;\r\n\t}", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "protected User createUser(final Request req) {\n final User user = new ServletUser(req);\n return user;\n }", "public eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser addNewCreateUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser target = null;\n target = (eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser)get_store().add_element_user(CREATEUSER$0);\n return target;\n }\n }", "public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public iUser createUser(int id) {\n iUser user = null;\n String username = getUsername();\n String password = getPassword();\n\n boolean confirmed = confirmed(id, username);\n if (confirmed) {\n user = registerOptions(username, password, id);\n }\n return user;\n }", "public synchronized User createAccount(String username, String password, String type, String actualName, String email) {\r\n\t\tUser user = new User();\r\n\t\tuser.setActualName(actualName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setPassword(password);\r\n\t\tuser.setType(type);\r\n\t\tuser.setUsername(username);\r\n\t\tboolean added = addUser(user);\r\n\t\tif (added) {\r\n\t\t\treturn user;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void newUser(User user);", "public void createUser(SignUpDto signupdto) {\n\t\tUser user = new User();\r\n\t\t\r\n\t\tuser.setId(signupdto.getId());\r\n\t\tuser.setPw(signupdto.getPw());\r\n\t\tuser.setNickname(signupdto.getNickname());\r\n\t\t\r\n\t\tuserRepository.save(user);\t\r\n\t}", "public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "@POST\n @AuthProviderRESTExposure\n public String createUser(@QueryParam(\"token\") String authToken, APIUser user) \n throws GuacamoleException {\n UserContext userContext = authenticationService.getUserContextFromAuthToken(authToken);\n \n // Get the directory\n Directory<String, User> userDirectory = userContext.getUserDirectory();\n\n // Create the user\n userDirectory.add(new APIUserWrapper(user));\n\n return user.getUsername();\n }", "private User createUser(int index, boolean deleted) {\n User entity = new User();\n\n entity.setDeleted(deleted);\n entity.setUsername(\"username\" + index);\n entity.setDefaultTab(ActionTab.ADMIN);\n entity.setNetworkId(\"networkId\" + index);\n\n Role role = new Role();\n role.setName(\"role\" + index);\n entity.setRole(role);\n create(entity.getRole());\n\n entity.setFirstName(\"firstName\" + index);\n entity.setLastName(\"lastName\" + index);\n entity.setEmail(\"email\" + index);\n entity.setTelephone(\"telephone\" + index);\n\n UserStatus userStatus = new UserStatus();\n userStatus.setName(\"userStatus\" + index);\n entity.setStatus(userStatus);\n create(entity.getStatus());\n\n create(entity);\n\n return entity;\n }", "UserCreateResponse createUser(UserCreateRequest request);", "@Override\n\tpublic void create(User user) {\n\t\t\n\t}", "@Override\n public User create(User user) {\n user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));\n if (user.getCreateDate() == null) {\n DateTime dt = new DateTime();\n user.setCreateDate(dt.toDate());\n }\n user.setEnabled(true);\n user.setRoleList(Collections.singletonList(roleDao.findByName(\"ROLE_USER\")));\n\n return dao.create(user);\n }", "public boolean createUser(String username, String password) {\r\n \t\tboolean result = this.dataLayer.addUser(username, password);\r\n \r\n \t\treturn result;\r\n \t}", "User createUser(User user);", "public User createUser(User user) {\n String loginId = user.getLoginId();\n if (dao.find(loginId) != null)\n throw new ExistingLoginException();\n\n // verify password requirements\n String password = user.getPassword();\n if (password.length() < PASSWORD_MIN_LENGTH)\n throw new InadequatePasswordException();\n\n // securely generate password hash\n String hash = BCrypt.hashpw(password, BCrypt.gensalt());\n\n return dao.create(user, hash);\n }", "@Test\n\tpublic void newUser() {\n\n\t\tUser user = new User(\"moviewatcher\", \"$2a$10$37jGlxDwJK4mRpYqYvPmyu8mqQJfeQJVSdsyFY5UNAm9ckThf2Zqa\", \"USER\");\n\t\tuserRepository.save(user);\n\n\t\tassertThat(user).isNotNull();\n\t\tassertThat(user).hasFieldOrPropertyWithValue(\"username\", \"moviewatcher\");\n\t}", "public static User createUser(Integer userId, String firstName, String lastName,\r\n\t\t\tString email, String userName, String companyName) {\r\n\t\tUser user = new User();\r\n\t\tif (userId != null) {\r\n\t\t\tuser.setUserId(userId);\r\n\t\t}\r\n\t\tuser.setFirstName(firstName);\r\n\t\tuser.setLastName(lastName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setUserName(userName);\r\n\t\tuser.setCompanyName(companyName); \r\n\t\treturn user;\r\n\t}", "public UserEntity createUser(String userName, String localUserName, String displayName) throws AmbariException {\n return createUser(userName, localUserName, displayName, true);\n }", "public void createUser(VUser vUser) {\n\t\tUser user = new User();\n\n\t\tboolean match = Pattern.matches(Constants.REGEX_EMAIL, vUser.getEmail());\n\t\tif (!match) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"El email tiene formato incorrecto.\");\n\t\t}\n\n\t\tif (repo.getUserByEmail(vUser.getEmail()) != null) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Ya hay un usuario con ese email.\");\n\t\t}\n\n\t\tuser.setEmail(vUser.getEmail());\n\t\tuser.setFullName(vUser.getFullName());\n\t\t\n\t\tif(vUser.getFullName() == null || vUser.getFullName().isEmpty()) {\n\t\t\tuser.setFullName(vUser.getEmail());\n\t\t}\n\n\t\t// TODO: hashear password\n\t\tuser.setPasswordHash(vUser.getPassword());\n\n\t\tuser.setRoles(vUser.getRoles());\n\t\tuser.setUserType(vUser.getUserType());\n\n\t\trepo.createUser(user);\n\t}", "public UserTO createUser(String name, String email, String password) {\n\t\tUserTO res = new UserTO();\n\n\t\tres.setName(name);\n res.setEmail(email);\n res.setPassword(password);\n\t\tres.setCreationDate(new Date());\n\t\tres.setModifyDate(new Date());\n\t\tres.setActive(true);\n\n\t\treturn res;\n\t}", "public void makeNewUser(String name, int age, String address, String password)\n throws SQLException, ConnectionFailedException, DatabaseInsertException {\n if (this.currentUserAuthenticated) {\n // find the role ID that corresponds to customer\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n int roleId = map.roleIds.get(Roles.CUSTOMER);\n int userId = DatabaseInsertHelper.insertNewUser(name, age, address, roleId, password);\n System.out.println(\"User ID - \" + userId);\n System.out.println(\"succesfully made user\");\n } else {\n System.out.println(\"failed making user\");\n throw new ConnectionFailedException();\n }\n }", "int createUser(User data) throws Exception;", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "public String createUserAction()throws Exception{\n\t\tString response=\"\";\n\t\tresponse=getService().getUserMgmtService().createNewUser(\n\t\t\t\tgetAuthBean().getUserName(),\n\t\t\t\tgetAuthBean().getFirstName(),\n\t\t\t\tgetAuthBean().getLastName(),\n\t\t\t\tgetAuthBean().getEmailId(),\n\t\t\t\tgetAuthBean().getRole()\n\t\t);\n\t\tgetAuthBean().setResponse(response);\n\t\tinputStream = new StringBufferInputStream(response);\n\t\tinputStream.close();\n\t\treturn SUCCESS;\n\t}", "@Test\n public void testGetNewUser() throws Exception {\n UserMultiID umk = createRU(\"remote-user-\" + getRandomString());\n String idp = \"test-idp-\" + getRandomString();\n // create a new user.\n XMLMap map = getDBSClient().getUser(umk, idp);\n assert getDBSClient().hasUser(umk, idp);\n Identifier uid = BasicIdentifier.newID(map.get(userKeys.identifier()).toString());\n User user2 = getUserStore().get(uid);\n checkUserAgainstMap(map, user2);\n }", "@Override\n\tpublic User createUserService(User user) {\n\t\treturn new User();\n\t}", "private String createUser(String name) {\n\t\treturn null;\n\t}", "public void create() throws DuplicateException, InvalidUserDataException, \n NoSuchAlgorithmException, SQLException {\n\tUserDA.create(this);\n }", "private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic User createUser(User user) {\n\t\tem.persist(user);\n\t\tem.flush();\n\t\treturn user;\n\t}", "public static void createUser(String name, Record record) {\n\t\tEntity user = getUser(name);\n\t\tif(user == null) {\n\t\t\tuser = new Entity(\"User\", name);\n\t\t\tuser.setProperty(\"record\", record);\n\t\t}\n\t\tUtil.persistEntity(user);\n\t}", "public void createUserAccount(UserAccount account);", "public static ExUser createEntity(EntityManager em) {\n ExUser exUser = new ExUser()\n .userKey(DEFAULT_USER_KEY);\n return exUser;\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public eu.aladdin_project.xsd.User addNewUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.xsd.User target = null;\n target = (eu.aladdin_project.xsd.User)get_store().add_element_user(USER$0);\n return target;\n }\n }", "private void createUser(Request request, Response response) {\r\n\t\tUserBean userBean = new UserBean();\r\n\t\tRESTfulSession session = null;\r\n\r\n\t\ttry {\r\n\t\t\tBeanHelper.populateUserBeanFromRequest(request, userBean);\r\n\t\t\tString username = userBean.getUsername();\r\n\t\t\tString password = userBean.getPassword();\r\n\t\t\tString email = userBean.getEmail();\r\n\r\n\t\t\tif (StringHelper.isNullOrNullString(username)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(password)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(email)) {\r\n\t\t\t\tthrow new InvalidInputException();\r\n\t\t\t}\r\n\r\n\t\t\tsession = userService.createUser(userBean);\r\n\t\t} catch (InvalidInputException e) {\r\n\t\t\tresponse.setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage());\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\t// generate response XML\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tsession);\r\n\t\t}\r\n\t}", "public User(String uId, String email, String password) \n\t{\n\t\tthis.userId = uId;\n\t\tthis.accDetails = AccountDetails.create(uId,email,password);\n this.credit = Credit.create(uId);\n }", "public User createUser(User user) {\n\t\treturn userRepository.save(user);\n\t}", "public User createUser(User user) {\n\t\treturn userRepository.save(user);\n\t}", "public MetaUser createMetaUser(String sName) throws IOException;", "public void create() {\n String salt = PasswordUtils.getSalt(30);\n\n // Protect user's password. The generated value can be stored in DB.\n String mySecurePassword = PasswordUtils.generateSecurePassword(password, salt);\n\n // Print out protected password\n System.out.println(\"My secure password = \" + mySecurePassword);\n System.out.println(\"Salt value = \" + salt);\n Operator op = new Operator();\n op.setUsername(username);\n op.setDescription(description);\n op.setSalt(salt);\n op.setPassword(mySecurePassword);\n op.setRol(rol);\n operatorService.create(op);\n message = \"Se creo al usuario \" + username;\n username = \"\";\n description = \"\";\n password = \"\";\n rol = null;\n }", "public User(String firstName, String lastName, Long userid, String email, String password, String userName) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userid = userid;\n this.email = email;\n this.password = password;\n this.userName = userName;\n\n createContributorPrivilege();\n }", "@POST\n\t@Path(\"/newUser\")\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\t@Transactional\n\tpublic Response createUser(User user) {\n\t\tuserDao.createUser(user);\n\n\t\treturn Response.status(201)\n\t\t\t\t.entity(\"A new user has been created\").build();\n\t}", "public void setNewUser(String username, String password)\r\n {\r\n configureClient(username, password);\r\n }", "public static void createAdministrator(OpBroker broker) {\n OpQuery query = broker.newQuery(OpUser.ADMINISTRATOR_ID_QUERY);\r\n Iterator result = broker.iterate(query);\r\n if (!result.hasNext()) {\r\n OpTransaction t = broker.newTransaction();\r\n OpUser administrator = new OpUser();\r\n administrator.setName(OpUser.ADMINISTRATOR_NAME);\r\n administrator.setDisplayName(OpUser.ADMINISTRATOR_DISPLAY_NAME);\r\n administrator.setDescription(OpUser.ADMINISTRATOR_DESCRIPTION);\r\n administrator.setPassword(OpUser.BLANK_PASSWORD);\r\n administrator.doSetLevel(new Byte(OpUser.MANAGER_USER_LEVEL));\r\n broker.makePersistent(administrator);\r\n OpContact contact = new OpContact();\r\n contact.setUser(administrator);\r\n broker.makePersistent(contact);\r\n t.commit();\r\n }\r\n }", "public CreateUserExternalResponse createUserExternal(CreateUserExternalRequest request) throws GPUdbException {\n CreateUserExternalResponse actualResponse_ = new CreateUserExternalResponse();\n submitRequest(\"/create/user/external\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n\tpublic int create(Users user) {\n\t\tSystem.out.println(\"service:creating new user...\");\n\t\treturn userDAO.create(user);\n\t}", "public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}", "void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }", "public static User registerNewUser(String username, String password) {\n if (db.userExists(username))\n throw new IllegalArgumentException(\"user already exists\");\n \n User user = new User(username, password);\n DatabaseWrapper.getInstance().addUser(user);\n return user;\n }", "static void CreateNewUserToDB(String[] userData, boolean[] userPermissions) throws IOException, InvalidKeySpecException, NoSuchAlgorithmException, ClassNotFoundException {\n if (CreateNewUser(userData, GetListOfUsers())) {\n Socket client = ConnectionToServer();\n\n // connects to the server with information and attempts to get the auth token\n // for the user after successful Login\n if (client.isConnected()) {\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"createNewUser\");\n send.writeUTF(userData[0]);\n send.writeUTF(userData[1]);\n send.writeUTF(userData[2]);\n send.writeUTF(userData[3]);\n send.writeBoolean(userPermissions[0]);\n send.writeBoolean(userPermissions[1]);\n send.writeBoolean(userPermissions[2]);\n send.writeBoolean(userPermissions[3]);\n send.writeUTF(loggedInUser);\n send.writeUTF(token);\n send.flush();\n\n WasRequestSuccessful(receiver.readBoolean(), receiver.readUTF());\n\n // End connections\n send.close();\n receiver.close();\n client.close();\n }\n }\n }", "public static User createUser(String id) {\n\n User user = new User();\n user.setId(id);\n\n return user;\n }", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "boolean create(User user) throws Exception;", "public Login createLogin(String userName, String password, String userId) {\n return saveLogin(userName, password, userId, \"USER\");\n }", "private User createWithParameters(Map<String, String> userParameters) {\n User user = new User();\n String passHashed = BCrypt.hashpw(userParameters.get(PASSWORD_PARAMETER_NAME), BCrypt.gensalt());\n user.setUsername(userParameters.get(USERNAME_PARAMETER_NAME));\n user.setPassword(passHashed);\n user.setFirstName(userParameters.get(FIRST_NAME_PARAMETER_NAME));\n user.setLastName(userParameters.get(LAST_NAME_PARAMETER_NAME));\n user.setEmail(userParameters.get(EMAIL_PARAMETER_NAME));\n user.setPhone(userParameters.get(PHONE_PARAMETER_NAME));\n user.setAddress(userParameters.get(ADDRESS_PARAMETER_NAME));\n user.setAccount(BigDecimal.ZERO);\n user.setInitDate(LocalDate.now());\n user.setBlockedUntil(LocalDate.now());\n user.setRole(User.Role.USER);\n return user;\n }", "public static void createUser(User user) throws LegoHouseException {\n try {\n Connection con = Connector.connection();\n String SQL = \"INSERT INTO users (email, password, role) VALUES (?, ?, ?)\";\n PreparedStatement ps = con.prepareStatement(SQL, Statement.RETURN_GENERATED_KEYS);\n ps.setString(1, user.getEmail());\n ps.setString(2, user.getPassword());\n ps.setString(3, user.getRole());\n ps.executeUpdate();\n ResultSet ids = ps.getGeneratedKeys();\n ids.next();\n int id = ids.getInt(1);\n user.setId(id);\n }\n catch (SQLException | IllegalAccessException | InstantiationException | ClassNotFoundException ex) {\n throw new LegoHouseException(ex.getMessage(), \"index\");\n }\n }", "@RequestMapping(value=\"\", method=RequestMethod.POST, consumes=MediaType.MULTIPART_FORM_DATA_VALUE, produces = \"application/json\")\n\tpublic @ResponseBody Object createUser(@RequestParam String userName, @RequestParam String userPassword, @RequestParam String userFirstName, \n\t\t\t@RequestParam String userLastName, @RequestParam String userPicURL,@RequestParam String userEmail, @RequestParam String userEmployer,\n\t\t\t@RequestParam String userDesignation, @RequestParam String userCity, @RequestParam String userState, @RequestParam(required=false) String programId, \n\t\t\t@RequestParam long updatedBy, @RequestParam String userExpertise, @RequestParam String userRoleDescription,\n\t\t\t@RequestParam String userPermissionCode, @RequestParam String userPermissionDescription, HttpServletRequest request, HttpServletResponse response) {\n\t\treturn userService.createUser(userName, userPassword, userFirstName, userLastName, userPicURL, userEmail, userEmployer, userDesignation, userCity, userState, programId, updatedBy, userExpertise, userRoleDescription, userPermissionCode, userPermissionDescription, request, response);\n\t}", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "User createUser(UserCreationModel user);", "public CreateUser(UserRepository userRepo, String username,\n\t\t\tString password, String email, String fullname) {\n\t\tthis.userRepository = userRepo;\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.email = email;\n\t\tthis.fullname = fullname;\n\t}", "public void CreateUser(Connection conn, String user_name,\r\n String user_uid, String user_pwd, String status) \r\n throws DbException\r\n {\r\n Statement stmt = null;\r\n String sql = \"\";\r\n int id = 0;\r\n try \r\n {\r\n id = getNextID(conn, \"Users_seq\");\r\n \r\n sql = \"insert into Users values(\"+id+\", \"+sqlString(user_uid)+\", \"+sqlString(user_pwd)+\", \"+sqlString(user_name)+\", \"+sqlString(status)+\");\";\r\n stmt = conn.createStatement();\r\n stmt.execute(sql);\r\n } \r\n catch (SQLException sqle) \r\n { \r\n sqle.printStackTrace(System.err);\r\n \r\n throw new DbException(\"Internal error. Failed to call PL/SQL procedure\\n(\" +\r\n sqle.getMessage() + \")\");\r\n } \r\n finally \r\n {\r\n try \r\n {\r\n if (stmt != null) stmt.close();\r\n } \r\n catch (SQLException ignored) \r\n {}\r\n }\r\n }", "public static com.inkwell.internet.productregistration.model.PRUser create(\n\t\tlong prUserId) {\n\t\treturn getPersistence().create(prUserId);\n\t}", "@PostMapping(\"/createUser\")\n\t@ApiOperation(value = \"Create a new user\", notes = \"Creates user by providing valid login credentials\")\n\tpublic ResponseEntity<?> createUser(\n\t\t\t@ApiParam(value = \"User credentials\", required = true) @RequestBody AppUser appUserCredentials) {\n\t\tAppUser createduser = null;\n\t\ttry {\n\t\t\tcreateduser = userRepository.save(appUserCredentials);\n\t\t} catch (Exception e) {\n\t\t\treturn new ResponseEntity<String>(\"Not created\", HttpStatus.NOT_ACCEPTABLE);\n\t\t}\n\t\tlog.info(\"user creation---->{}\", createduser);\n\t\treturn new ResponseEntity<>(createduser, HttpStatus.CREATED);\n\n\t}" ]
[ "0.7457961", "0.7388198", "0.73874605", "0.7241501", "0.71765935", "0.716606", "0.7149426", "0.713553", "0.7121723", "0.7112458", "0.70734346", "0.7049827", "0.69297886", "0.69297725", "0.6898288", "0.6871441", "0.68485254", "0.68422073", "0.6823701", "0.6775364", "0.67374134", "0.6730386", "0.67197764", "0.6713636", "0.66988105", "0.6644021", "0.65982735", "0.65831494", "0.6557784", "0.6550082", "0.65479183", "0.65461725", "0.6544445", "0.6528988", "0.65279317", "0.6524015", "0.6519815", "0.6512347", "0.64783204", "0.6477066", "0.6463039", "0.6457343", "0.64518183", "0.6448372", "0.6441856", "0.6426198", "0.6425378", "0.64214796", "0.6396977", "0.6396223", "0.63928324", "0.6391422", "0.63890547", "0.63802433", "0.63792515", "0.6377008", "0.63749623", "0.6367741", "0.6362574", "0.6361526", "0.63277996", "0.632676", "0.6326079", "0.63195044", "0.6310117", "0.6306619", "0.63060045", "0.6303438", "0.6298919", "0.6281488", "0.6273335", "0.627179", "0.6271461", "0.62620264", "0.62620264", "0.6254963", "0.6252218", "0.62502754", "0.6238061", "0.6234753", "0.62294745", "0.6227622", "0.6224691", "0.62171143", "0.62151146", "0.6215111", "0.6212842", "0.6211311", "0.620478", "0.6197204", "0.6193623", "0.6192702", "0.6181733", "0.61816466", "0.61793476", "0.61775804", "0.6174329", "0.6168802", "0.61683685", "0.6163824" ]
0.73046327
3
Creates a new internal user (a user whose credentials are managed by the database system).
public CreateUserInternalResponse createUserInternal(String name, String password, Map<String, String> options) throws GPUdbException { CreateUserInternalRequest actualRequest_ = new CreateUserInternalRequest(name, password, options); CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse(); submitRequest("/create/user/internal", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int newUser(String username, String password, Time creationTime);", "@Override\n\tpublic IUser creatUser() {\n\t\treturn new SqlServerUser();\n\t}", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "public CreateUserInternalResponse createUserInternal(CreateUserInternalRequest request) throws GPUdbException {\n CreateUserInternalResponse actualResponse_ = new CreateUserInternalResponse();\n submitRequest(\"/create/user/internal\", request, actualResponse_, false);\n return actualResponse_;\n }", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "private void createNewUser(final User unmanagedUser) {\n Realm realm = (mRealm == null) ? Realm.getDefaultInstance() : mRealm;\n //create by administrator\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n User u2 = realm.createObject(User.class, PrimaryKeyFactory.getInstance().nextKey(User.class));\n u2.setLoggedIn(false);\n u2.setUserId(unmanagedUser.getUserId());\n\n String password = unmanagedUser.getPassword();\n if (password == null) {\n password = \"\";\n }\n u2.setPassword(password);\n\n u2.setUserName(unmanagedUser.getUserName());\n u2.setStartDate(unmanagedUser.getStartDate());\n u2.setEndDate(unmanagedUser.getEndDate());\n u2.setCreated(new Date());\n u2.setActive(unmanagedUser.getActive());\n u2.setSpecial(false);\n u2.setPermission(unmanagedUser.getPermission());\n u2.setEnabled(unmanagedUser.getEnabled());\n }\n });\n\n if (mRealm == null)\n realm.close();\n }", "void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;", "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "public void createUser(User user) {\n\n\t}", "private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }", "public void createUser(String userName, String password,\n boolean createDB) throws Exception;", "private void createUser(final String email, final String password) {\n\n }", "public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}", "public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "boolean createUser(String username, String password);", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "User createUser();", "User create(final User user) throws DatabaseException;", "public void createUser(User user);", "BaseUser createAdminUser(Application application);", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "public static User createBasicUser () {\n User user = new User();\n user.setUsername(\"basicUser\");\n user.setPassword(\"secret\");\n user.setEmail(\"[email protected]\");\n user.setFirstName(\"firstName\");\n user.setLastName(\"lastName\");\n user.setPhoneNumber(\"123456789123\");\n user.setCountry(\"GB\");\n user.setEnabled(true);\n user.setDescription(\"A basic user\");\n user.setProfileImageUrl(\"https://blabla.images.com/basicuser\");\n\n return user;\n }", "public void create(String username, String password, DatabaseRolesEnum role){\r\n ORole dbRole = db.getMetadata().getSecurity().getRole(role.getRoleName());\r\n db.getMetadata().getSecurity().createUser(username, password, dbRole);\r\n }", "public User createUser(User newUser) {\n if(userRepository.findByUsername(newUser.getUsername()) != null){\n throw new UsernameException(\"The username is already taken please choose another one\");\n }\n newUser.setToken(\"dummy_token\"); //not really needed after registration;\n\n newUser.setStatus(UserStatus.ONLINE);\n userRepository.save(newUser); //userRepository creates User entity for the first time\n\n newUser.setToken(generateToken(newUser));\n userRepository.save(newUser); //userRepository saves the new entity items to existing user\n\n log.debug(\"Created Information for User: {}\", newUser);\n return newUser;\n }", "Human_User createHuman_User();", "public static void createMysqlUser(Eleve e) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"CREATE USER '\" + e.getAbreviation() + \"'@'%' IDENTIFIED BY '\" + e.getPwd() + \"'; \";\r\n System.out.println(SQLRequest);\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "public void creatUser(String name, String phone, String email, String password);", "public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;", "public EOSUser createUser(EOSUser user, Map<String, String> userData) throws EOSDuplicatedEntryException,\n\t\t\tEOSForbiddenException, EOSUnauthorizedException, EOSValidationException;", "public User createUser(UserDTO userDto) {\n User user = new User();\n user.setLogin(userDto.getLogin());\n user.setFirstName(userDto.getFirstName());\n user.setLastName(userDto.getLastName());\n user.setEmail(userDto.getEmail());\n if (userDto.getLangKey() == null) {\n user.setLangKey(\"en\"); // default language\n } else {\n user.setLangKey(userDto.getLangKey());\n }\n String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());\n user.setPassword(encryptedPassword);\n user.setResetKey(RandomUtil.generateResetKey());\n user.setResetDate(ZonedDateTime.now());\n user.setActivated(false);\n\n user.setRoles(getUserRoles(userDto));\n userRepository.save(user);\n log.debug(\"Created Information for User: {}\", user);\n return user;\n }", "private User createUser(String username, String name, String email, String password) {\n UserDTO userDTO = new UserDTO();\n userDTO.setEmail(email);\n userDTO.setName(name);\n userDTO.setPassword(password);\n userDTO.setUsername(username);\n\n userService.registerUser(userDTO);\n\n User user = userService.getUserByEmail(email);\n return user;\n }", "@Override\r\n\tpublic Object createUser() throws DataAccessException, SQLException {\n\t\treturn null;\r\n\t}", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "protected User createUser(final Request req) {\n final User user = new ServletUser(req);\n return user;\n }", "public eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser addNewCreateUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser target = null;\n target = (eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser)get_store().add_element_user(CREATEUSER$0);\n return target;\n }\n }", "public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public iUser createUser(int id) {\n iUser user = null;\n String username = getUsername();\n String password = getPassword();\n\n boolean confirmed = confirmed(id, username);\n if (confirmed) {\n user = registerOptions(username, password, id);\n }\n return user;\n }", "public synchronized User createAccount(String username, String password, String type, String actualName, String email) {\r\n\t\tUser user = new User();\r\n\t\tuser.setActualName(actualName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setPassword(password);\r\n\t\tuser.setType(type);\r\n\t\tuser.setUsername(username);\r\n\t\tboolean added = addUser(user);\r\n\t\tif (added) {\r\n\t\t\treturn user;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void newUser(User user);", "public void createUser(SignUpDto signupdto) {\n\t\tUser user = new User();\r\n\t\t\r\n\t\tuser.setId(signupdto.getId());\r\n\t\tuser.setPw(signupdto.getPw());\r\n\t\tuser.setNickname(signupdto.getNickname());\r\n\t\t\r\n\t\tuserRepository.save(user);\t\r\n\t}", "public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}", "@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}", "@POST\n @AuthProviderRESTExposure\n public String createUser(@QueryParam(\"token\") String authToken, APIUser user) \n throws GuacamoleException {\n UserContext userContext = authenticationService.getUserContextFromAuthToken(authToken);\n \n // Get the directory\n Directory<String, User> userDirectory = userContext.getUserDirectory();\n\n // Create the user\n userDirectory.add(new APIUserWrapper(user));\n\n return user.getUsername();\n }", "private User createUser(int index, boolean deleted) {\n User entity = new User();\n\n entity.setDeleted(deleted);\n entity.setUsername(\"username\" + index);\n entity.setDefaultTab(ActionTab.ADMIN);\n entity.setNetworkId(\"networkId\" + index);\n\n Role role = new Role();\n role.setName(\"role\" + index);\n entity.setRole(role);\n create(entity.getRole());\n\n entity.setFirstName(\"firstName\" + index);\n entity.setLastName(\"lastName\" + index);\n entity.setEmail(\"email\" + index);\n entity.setTelephone(\"telephone\" + index);\n\n UserStatus userStatus = new UserStatus();\n userStatus.setName(\"userStatus\" + index);\n entity.setStatus(userStatus);\n create(entity.getStatus());\n\n create(entity);\n\n return entity;\n }", "UserCreateResponse createUser(UserCreateRequest request);", "@Override\n\tpublic void create(User user) {\n\t\t\n\t}", "@Override\n public User create(User user) {\n user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));\n if (user.getCreateDate() == null) {\n DateTime dt = new DateTime();\n user.setCreateDate(dt.toDate());\n }\n user.setEnabled(true);\n user.setRoleList(Collections.singletonList(roleDao.findByName(\"ROLE_USER\")));\n\n return dao.create(user);\n }", "public boolean createUser(String username, String password) {\r\n \t\tboolean result = this.dataLayer.addUser(username, password);\r\n \r\n \t\treturn result;\r\n \t}", "User createUser(User user);", "public User createUser(User user) {\n String loginId = user.getLoginId();\n if (dao.find(loginId) != null)\n throw new ExistingLoginException();\n\n // verify password requirements\n String password = user.getPassword();\n if (password.length() < PASSWORD_MIN_LENGTH)\n throw new InadequatePasswordException();\n\n // securely generate password hash\n String hash = BCrypt.hashpw(password, BCrypt.gensalt());\n\n return dao.create(user, hash);\n }", "@Test\n\tpublic void newUser() {\n\n\t\tUser user = new User(\"moviewatcher\", \"$2a$10$37jGlxDwJK4mRpYqYvPmyu8mqQJfeQJVSdsyFY5UNAm9ckThf2Zqa\", \"USER\");\n\t\tuserRepository.save(user);\n\n\t\tassertThat(user).isNotNull();\n\t\tassertThat(user).hasFieldOrPropertyWithValue(\"username\", \"moviewatcher\");\n\t}", "public static User createUser(Integer userId, String firstName, String lastName,\r\n\t\t\tString email, String userName, String companyName) {\r\n\t\tUser user = new User();\r\n\t\tif (userId != null) {\r\n\t\t\tuser.setUserId(userId);\r\n\t\t}\r\n\t\tuser.setFirstName(firstName);\r\n\t\tuser.setLastName(lastName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setUserName(userName);\r\n\t\tuser.setCompanyName(companyName); \r\n\t\treturn user;\r\n\t}", "public UserEntity createUser(String userName, String localUserName, String displayName) throws AmbariException {\n return createUser(userName, localUserName, displayName, true);\n }", "public void createUser(VUser vUser) {\n\t\tUser user = new User();\n\n\t\tboolean match = Pattern.matches(Constants.REGEX_EMAIL, vUser.getEmail());\n\t\tif (!match) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"El email tiene formato incorrecto.\");\n\t\t}\n\n\t\tif (repo.getUserByEmail(vUser.getEmail()) != null) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Ya hay un usuario con ese email.\");\n\t\t}\n\n\t\tuser.setEmail(vUser.getEmail());\n\t\tuser.setFullName(vUser.getFullName());\n\t\t\n\t\tif(vUser.getFullName() == null || vUser.getFullName().isEmpty()) {\n\t\t\tuser.setFullName(vUser.getEmail());\n\t\t}\n\n\t\t// TODO: hashear password\n\t\tuser.setPasswordHash(vUser.getPassword());\n\n\t\tuser.setRoles(vUser.getRoles());\n\t\tuser.setUserType(vUser.getUserType());\n\n\t\trepo.createUser(user);\n\t}", "public UserTO createUser(String name, String email, String password) {\n\t\tUserTO res = new UserTO();\n\n\t\tres.setName(name);\n res.setEmail(email);\n res.setPassword(password);\n\t\tres.setCreationDate(new Date());\n\t\tres.setModifyDate(new Date());\n\t\tres.setActive(true);\n\n\t\treturn res;\n\t}", "public void makeNewUser(String name, int age, String address, String password)\n throws SQLException, ConnectionFailedException, DatabaseInsertException {\n if (this.currentUserAuthenticated) {\n // find the role ID that corresponds to customer\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n int roleId = map.roleIds.get(Roles.CUSTOMER);\n int userId = DatabaseInsertHelper.insertNewUser(name, age, address, roleId, password);\n System.out.println(\"User ID - \" + userId);\n System.out.println(\"succesfully made user\");\n } else {\n System.out.println(\"failed making user\");\n throw new ConnectionFailedException();\n }\n }", "int createUser(User data) throws Exception;", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "public String createUserAction()throws Exception{\n\t\tString response=\"\";\n\t\tresponse=getService().getUserMgmtService().createNewUser(\n\t\t\t\tgetAuthBean().getUserName(),\n\t\t\t\tgetAuthBean().getFirstName(),\n\t\t\t\tgetAuthBean().getLastName(),\n\t\t\t\tgetAuthBean().getEmailId(),\n\t\t\t\tgetAuthBean().getRole()\n\t\t);\n\t\tgetAuthBean().setResponse(response);\n\t\tinputStream = new StringBufferInputStream(response);\n\t\tinputStream.close();\n\t\treturn SUCCESS;\n\t}", "@Test\n public void testGetNewUser() throws Exception {\n UserMultiID umk = createRU(\"remote-user-\" + getRandomString());\n String idp = \"test-idp-\" + getRandomString();\n // create a new user.\n XMLMap map = getDBSClient().getUser(umk, idp);\n assert getDBSClient().hasUser(umk, idp);\n Identifier uid = BasicIdentifier.newID(map.get(userKeys.identifier()).toString());\n User user2 = getUserStore().get(uid);\n checkUserAgainstMap(map, user2);\n }", "@Override\n\tpublic User createUserService(User user) {\n\t\treturn new User();\n\t}", "private String createUser(String name) {\n\t\treturn null;\n\t}", "public void create() throws DuplicateException, InvalidUserDataException, \n NoSuchAlgorithmException, SQLException {\n\tUserDA.create(this);\n }", "private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic User createUser(User user) {\n\t\tem.persist(user);\n\t\tem.flush();\n\t\treturn user;\n\t}", "public static void createUser(String name, Record record) {\n\t\tEntity user = getUser(name);\n\t\tif(user == null) {\n\t\t\tuser = new Entity(\"User\", name);\n\t\t\tuser.setProperty(\"record\", record);\n\t\t}\n\t\tUtil.persistEntity(user);\n\t}", "public void createUserAccount(UserAccount account);", "public static ExUser createEntity(EntityManager em) {\n ExUser exUser = new ExUser()\n .userKey(DEFAULT_USER_KEY);\n return exUser;\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public eu.aladdin_project.xsd.User addNewUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.xsd.User target = null;\n target = (eu.aladdin_project.xsd.User)get_store().add_element_user(USER$0);\n return target;\n }\n }", "private void createUser(Request request, Response response) {\r\n\t\tUserBean userBean = new UserBean();\r\n\t\tRESTfulSession session = null;\r\n\r\n\t\ttry {\r\n\t\t\tBeanHelper.populateUserBeanFromRequest(request, userBean);\r\n\t\t\tString username = userBean.getUsername();\r\n\t\t\tString password = userBean.getPassword();\r\n\t\t\tString email = userBean.getEmail();\r\n\r\n\t\t\tif (StringHelper.isNullOrNullString(username)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(password)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(email)) {\r\n\t\t\t\tthrow new InvalidInputException();\r\n\t\t\t}\r\n\r\n\t\t\tsession = userService.createUser(userBean);\r\n\t\t} catch (InvalidInputException e) {\r\n\t\t\tresponse.setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage());\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\t// generate response XML\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tsession);\r\n\t\t}\r\n\t}", "public User(String uId, String email, String password) \n\t{\n\t\tthis.userId = uId;\n\t\tthis.accDetails = AccountDetails.create(uId,email,password);\n this.credit = Credit.create(uId);\n }", "public User createUser(User user) {\n\t\treturn userRepository.save(user);\n\t}", "public User createUser(User user) {\n\t\treturn userRepository.save(user);\n\t}", "public MetaUser createMetaUser(String sName) throws IOException;", "public void create() {\n String salt = PasswordUtils.getSalt(30);\n\n // Protect user's password. The generated value can be stored in DB.\n String mySecurePassword = PasswordUtils.generateSecurePassword(password, salt);\n\n // Print out protected password\n System.out.println(\"My secure password = \" + mySecurePassword);\n System.out.println(\"Salt value = \" + salt);\n Operator op = new Operator();\n op.setUsername(username);\n op.setDescription(description);\n op.setSalt(salt);\n op.setPassword(mySecurePassword);\n op.setRol(rol);\n operatorService.create(op);\n message = \"Se creo al usuario \" + username;\n username = \"\";\n description = \"\";\n password = \"\";\n rol = null;\n }", "public User(String firstName, String lastName, Long userid, String email, String password, String userName) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userid = userid;\n this.email = email;\n this.password = password;\n this.userName = userName;\n\n createContributorPrivilege();\n }", "@POST\n\t@Path(\"/newUser\")\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\t@Transactional\n\tpublic Response createUser(User user) {\n\t\tuserDao.createUser(user);\n\n\t\treturn Response.status(201)\n\t\t\t\t.entity(\"A new user has been created\").build();\n\t}", "public void setNewUser(String username, String password)\r\n {\r\n configureClient(username, password);\r\n }", "public static void createAdministrator(OpBroker broker) {\n OpQuery query = broker.newQuery(OpUser.ADMINISTRATOR_ID_QUERY);\r\n Iterator result = broker.iterate(query);\r\n if (!result.hasNext()) {\r\n OpTransaction t = broker.newTransaction();\r\n OpUser administrator = new OpUser();\r\n administrator.setName(OpUser.ADMINISTRATOR_NAME);\r\n administrator.setDisplayName(OpUser.ADMINISTRATOR_DISPLAY_NAME);\r\n administrator.setDescription(OpUser.ADMINISTRATOR_DESCRIPTION);\r\n administrator.setPassword(OpUser.BLANK_PASSWORD);\r\n administrator.doSetLevel(new Byte(OpUser.MANAGER_USER_LEVEL));\r\n broker.makePersistent(administrator);\r\n OpContact contact = new OpContact();\r\n contact.setUser(administrator);\r\n broker.makePersistent(contact);\r\n t.commit();\r\n }\r\n }", "public CreateUserExternalResponse createUserExternal(CreateUserExternalRequest request) throws GPUdbException {\n CreateUserExternalResponse actualResponse_ = new CreateUserExternalResponse();\n submitRequest(\"/create/user/external\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n\tpublic int create(Users user) {\n\t\tSystem.out.println(\"service:creating new user...\");\n\t\treturn userDAO.create(user);\n\t}", "public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}", "void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }", "public static User registerNewUser(String username, String password) {\n if (db.userExists(username))\n throw new IllegalArgumentException(\"user already exists\");\n \n User user = new User(username, password);\n DatabaseWrapper.getInstance().addUser(user);\n return user;\n }", "static void CreateNewUserToDB(String[] userData, boolean[] userPermissions) throws IOException, InvalidKeySpecException, NoSuchAlgorithmException, ClassNotFoundException {\n if (CreateNewUser(userData, GetListOfUsers())) {\n Socket client = ConnectionToServer();\n\n // connects to the server with information and attempts to get the auth token\n // for the user after successful Login\n if (client.isConnected()) {\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"createNewUser\");\n send.writeUTF(userData[0]);\n send.writeUTF(userData[1]);\n send.writeUTF(userData[2]);\n send.writeUTF(userData[3]);\n send.writeBoolean(userPermissions[0]);\n send.writeBoolean(userPermissions[1]);\n send.writeBoolean(userPermissions[2]);\n send.writeBoolean(userPermissions[3]);\n send.writeUTF(loggedInUser);\n send.writeUTF(token);\n send.flush();\n\n WasRequestSuccessful(receiver.readBoolean(), receiver.readUTF());\n\n // End connections\n send.close();\n receiver.close();\n client.close();\n }\n }\n }", "public static User createUser(String id) {\n\n User user = new User();\n user.setId(id);\n\n return user;\n }", "public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);", "boolean create(User user) throws Exception;", "public Login createLogin(String userName, String password, String userId) {\n return saveLogin(userName, password, userId, \"USER\");\n }", "private User createWithParameters(Map<String, String> userParameters) {\n User user = new User();\n String passHashed = BCrypt.hashpw(userParameters.get(PASSWORD_PARAMETER_NAME), BCrypt.gensalt());\n user.setUsername(userParameters.get(USERNAME_PARAMETER_NAME));\n user.setPassword(passHashed);\n user.setFirstName(userParameters.get(FIRST_NAME_PARAMETER_NAME));\n user.setLastName(userParameters.get(LAST_NAME_PARAMETER_NAME));\n user.setEmail(userParameters.get(EMAIL_PARAMETER_NAME));\n user.setPhone(userParameters.get(PHONE_PARAMETER_NAME));\n user.setAddress(userParameters.get(ADDRESS_PARAMETER_NAME));\n user.setAccount(BigDecimal.ZERO);\n user.setInitDate(LocalDate.now());\n user.setBlockedUntil(LocalDate.now());\n user.setRole(User.Role.USER);\n return user;\n }", "public static void createUser(User user) throws LegoHouseException {\n try {\n Connection con = Connector.connection();\n String SQL = \"INSERT INTO users (email, password, role) VALUES (?, ?, ?)\";\n PreparedStatement ps = con.prepareStatement(SQL, Statement.RETURN_GENERATED_KEYS);\n ps.setString(1, user.getEmail());\n ps.setString(2, user.getPassword());\n ps.setString(3, user.getRole());\n ps.executeUpdate();\n ResultSet ids = ps.getGeneratedKeys();\n ids.next();\n int id = ids.getInt(1);\n user.setId(id);\n }\n catch (SQLException | IllegalAccessException | InstantiationException | ClassNotFoundException ex) {\n throw new LegoHouseException(ex.getMessage(), \"index\");\n }\n }", "@RequestMapping(value=\"\", method=RequestMethod.POST, consumes=MediaType.MULTIPART_FORM_DATA_VALUE, produces = \"application/json\")\n\tpublic @ResponseBody Object createUser(@RequestParam String userName, @RequestParam String userPassword, @RequestParam String userFirstName, \n\t\t\t@RequestParam String userLastName, @RequestParam String userPicURL,@RequestParam String userEmail, @RequestParam String userEmployer,\n\t\t\t@RequestParam String userDesignation, @RequestParam String userCity, @RequestParam String userState, @RequestParam(required=false) String programId, \n\t\t\t@RequestParam long updatedBy, @RequestParam String userExpertise, @RequestParam String userRoleDescription,\n\t\t\t@RequestParam String userPermissionCode, @RequestParam String userPermissionDescription, HttpServletRequest request, HttpServletResponse response) {\n\t\treturn userService.createUser(userName, userPassword, userFirstName, userLastName, userPicURL, userEmail, userEmployer, userDesignation, userCity, userState, programId, updatedBy, userExpertise, userRoleDescription, userPermissionCode, userPermissionDescription, request, response);\n\t}", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "User createUser(UserCreationModel user);", "public CreateUser(UserRepository userRepo, String username,\n\t\t\tString password, String email, String fullname) {\n\t\tthis.userRepository = userRepo;\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t\tthis.email = email;\n\t\tthis.fullname = fullname;\n\t}", "public void CreateUser(Connection conn, String user_name,\r\n String user_uid, String user_pwd, String status) \r\n throws DbException\r\n {\r\n Statement stmt = null;\r\n String sql = \"\";\r\n int id = 0;\r\n try \r\n {\r\n id = getNextID(conn, \"Users_seq\");\r\n \r\n sql = \"insert into Users values(\"+id+\", \"+sqlString(user_uid)+\", \"+sqlString(user_pwd)+\", \"+sqlString(user_name)+\", \"+sqlString(status)+\");\";\r\n stmt = conn.createStatement();\r\n stmt.execute(sql);\r\n } \r\n catch (SQLException sqle) \r\n { \r\n sqle.printStackTrace(System.err);\r\n \r\n throw new DbException(\"Internal error. Failed to call PL/SQL procedure\\n(\" +\r\n sqle.getMessage() + \")\");\r\n } \r\n finally \r\n {\r\n try \r\n {\r\n if (stmt != null) stmt.close();\r\n } \r\n catch (SQLException ignored) \r\n {}\r\n }\r\n }", "public static com.inkwell.internet.productregistration.model.PRUser create(\n\t\tlong prUserId) {\n\t\treturn getPersistence().create(prUserId);\n\t}", "@PostMapping(\"/createUser\")\n\t@ApiOperation(value = \"Create a new user\", notes = \"Creates user by providing valid login credentials\")\n\tpublic ResponseEntity<?> createUser(\n\t\t\t@ApiParam(value = \"User credentials\", required = true) @RequestBody AppUser appUserCredentials) {\n\t\tAppUser createduser = null;\n\t\ttry {\n\t\t\tcreateduser = userRepository.save(appUserCredentials);\n\t\t} catch (Exception e) {\n\t\t\treturn new ResponseEntity<String>(\"Not created\", HttpStatus.NOT_ACCEPTABLE);\n\t\t}\n\t\tlog.info(\"user creation---->{}\", createduser);\n\t\treturn new ResponseEntity<>(createduser, HttpStatus.CREATED);\n\n\t}" ]
[ "0.7457961", "0.7388198", "0.73874605", "0.73046327", "0.7241501", "0.71765935", "0.716606", "0.7149426", "0.713553", "0.7121723", "0.7112458", "0.7049827", "0.69297886", "0.69297725", "0.6898288", "0.6871441", "0.68485254", "0.68422073", "0.6823701", "0.6775364", "0.67374134", "0.6730386", "0.67197764", "0.6713636", "0.66988105", "0.6644021", "0.65982735", "0.65831494", "0.6557784", "0.6550082", "0.65479183", "0.65461725", "0.6544445", "0.6528988", "0.65279317", "0.6524015", "0.6519815", "0.6512347", "0.64783204", "0.6477066", "0.6463039", "0.6457343", "0.64518183", "0.6448372", "0.6441856", "0.6426198", "0.6425378", "0.64214796", "0.6396977", "0.6396223", "0.63928324", "0.6391422", "0.63890547", "0.63802433", "0.63792515", "0.6377008", "0.63749623", "0.6367741", "0.6362574", "0.6361526", "0.63277996", "0.632676", "0.6326079", "0.63195044", "0.6310117", "0.6306619", "0.63060045", "0.6303438", "0.6298919", "0.6281488", "0.6273335", "0.627179", "0.6271461", "0.62620264", "0.62620264", "0.6254963", "0.6252218", "0.62502754", "0.6238061", "0.6234753", "0.62294745", "0.6227622", "0.6224691", "0.62171143", "0.62151146", "0.6215111", "0.6212842", "0.6211311", "0.620478", "0.6197204", "0.6193623", "0.6192702", "0.6181733", "0.61816466", "0.61793476", "0.61775804", "0.6174329", "0.6168802", "0.61683685", "0.6163824" ]
0.70734346
11
Deletes a proc. Any currently running instances of the proc will be killed.
public DeleteProcResponse deleteProc(DeleteProcRequest request) throws GPUdbException { DeleteProcResponse actualResponse_ = new DeleteProcResponse(); submitRequest("/delete/proc", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DeleteProcResponse deleteProc(String procName, Map<String, String> options) throws GPUdbException {\n DeleteProcRequest actualRequest_ = new DeleteProcRequest(procName, options);\n DeleteProcResponse actualResponse_ = new DeleteProcResponse();\n submitRequest(\"/delete/proc\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "void kill(long procid);", "public KillProcResponse killProc(KillProcRequest request) throws GPUdbException {\n KillProcResponse actualResponse_ = new KillProcResponse();\n submitRequest(\"/kill/proc\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Process delete(int p){\n\t\tif (search(p) == -1){\n\t\tSystem.out.println(p);\n\t\t\tSystem.out.println(\"error: tried to delete nonexistent process\");\n\t\t\treturn new Process(0, 0, \"errorprocess\");\n\t\t}\n\t\tProcess output = this.table[search(p)].getValue();\n\t\tthis.table[search(p)] = null;\n\t\treturn output;\n\t\t\n\t}", "@DELETE\n @ApiOperation(\"Forcefully stops a process\")\n @javax.ws.rs.Path(\"/{id}\")\n @WithTimer\n public void kill(@ApiParam @PathParam(\"id\") UUID instanceId) {\n ProcessKey processKey = assertProcessKey(instanceId);\n processManager.kill(processKey);\n }", "int deleteByExample(ProcdefExample example);", "@Override\n\tpublic void destroyProcess() {\n\t\tsuper.destroyProcess();\n\t\tDataDirRemoverHandler ddhHandler = \n\t\t\tnew DataDirRemoverHandler(getLogHandler());\n\t\tddhHandler.setRetryLimitInMillis(2000);\n\t\tddhHandler.execute();\n\t\tportsInUse.remove(port);\n\t}", "int deleteByPrimaryKey(Integer buildProcedureId);", "public void delete() {\n\t\tcp.delete();\n\t}", "@Override\n\tpublic void removeProcedure(String instanceId)\n\t{\n\t\tm_models.removeLocalProcedureModel(instanceId);\n\t}", "SpCharInSeq delete(Integer spcharinseqId);", "int deleteByExample(CodeBuildProcedureExample example);", "public void Kill();", "public KillProcResponse killProc(String runId, Map<String, String> options) throws GPUdbException {\n KillProcRequest actualRequest_ = new KillProcRequest(runId, options);\n KillProcResponse actualResponse_ = new KillProcResponse();\n submitRequest(\"/kill/proc\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n\tpublic void deleteProcessInstance(String processInstanceId, String deleteReason) {\n\t\truntimeService.deleteProcessInstance(processInstanceId, deleteReason);\n\n\t}", "private void nativeKill()\n {\n if (process == null)\n {\n return;\n }\n for (Field f : process.getClass().getDeclaredFields())\n {\n if (\"pid\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n int pid = f.getInt(process);\n Runtime.getRuntime().exec(\n new String[] {\"kill\", \"-9\", Integer.toString(pid)});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n else if (\"handle\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n long handleId = f.getLong(process);\n\n Kernel32 kernel = Kernel32.INSTANCE;\n HANDLE handle = new HANDLE();\n handle.setPointer(Pointer.createConstant(handleId));\n int pid = kernel.GetProcessId(handle);\n Runtime.getRuntime().exec(\n new String[] {\"taskkill\", \"/PID\", Integer.toString(pid), \"/F\"});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n }\n }", "public static synchronized void stop() {\n\n if (proc != null) {\n proc.destroy();\n try {\n // wait for the process to really stop\n proc.waitFor();\n } catch (InterruptedException e) {\n // ignore\n }\n try {\n // leeway since sometimes the unbind happens after\n Thread.sleep(500);\n } catch (InterruptedException e) {\n // ignore\n }\n proc = null;\n }\n }", "void destroy() {\n \t\ttry {\r\n \t\t\tupKeep.stopRunning();\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \r\n \t\t// Kill all running processes.\r\n \t\tfor (MaximaProcess mp : pool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tpool.clear();\r\n \r\n \t\t// Kill all used processes.\r\n \t\tfor (MaximaProcess mp : usedPool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tusedPool.clear();\r\n \t}", "void instanceKilled(String pid, IKilledResult result);", "public static void cancelProcess() {\r\n\r\n if (m_Proc != null) {\r\n if (m_bProcInterruptible) {\r\n m_Proc.destroy();\r\n m_Proc = null;\r\n m_bProcCanceled = true;\r\n }\r\n }\r\n\r\n }", "public void killIt() {\n isRunning = false;\n killed = true;\n hardKill = true;\n\n dumpState();\n if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_killing_cpm__INFO\",\n new Object[] { Thread.currentThread().getName() });\n }\n if (workQueue != null) {\n while (workQueue.getCurrentSize() > 0) {\n workQueue.dequeue();\n }\n }\n if (outputQueue != null) {\n while (outputQueue.getCurrentSize() > 0) {\n outputQueue.dequeue();\n }\n }\n if (casPool != null) {\n synchronized (casPool) {\n casPool.notifyAll();\n }\n }\n if (workQueue != null) {\n Object[] eofToken = new Object[1];\n // only need one member in the array\n eofToken[0] = new EOFToken();\n workQueue.enqueue(eofToken);\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_terminate_pipelines__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(killed) });\n // synchronized (workQueue) { // redundant - enqueue call above does this\n // workQueue.notifyAll();\n // }\n }\n\n }", "public void kill()\n\t{\n\t\tisKilled = true;\n\t}", "public void unsetProcStat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PROCSTAT$16, 0);\n }\n }", "public void abort()\n\t{\n\t\tif(process != null)\n\t\t\tprocess.destroy();\n\t}", "public static void delInstance() {\n \tINSTANCE = null;\n \tcloseConnection();\n }", "public void deleteInst() {\n\t\tlogger.debug(\"DeviceNameTableTester has been stopped\");\n\t}", "public final void kill() {\n doKill();\n }", "@DELETE\n @ApiOperation(\"Forcefully stops a process and its all children\")\n @javax.ws.rs.Path(\"/{id}/cascade\")\n @WithTimer\n public void killCascade(@ApiParam @PathParam(\"id\") UUID instanceId) {\n PartialProcessKey processKey = PartialProcessKey.from(instanceId);\n processManager.killCascade(processKey);\n }", "public void kill();", "public void kill();", "public void removeProcedure(Procedure procedure) {\n removeProcedure(procedure.getName());\n }", "@Override\n\tpublic void delete(DatabaseHandler db) {\n\t\tdb.deleteWork(this);\n\t\t\n\t}", "@Override\n\tpublic void killProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.info(\"Killing procedure \" + instanceId, Level.PROC, this);\n\t\tif (isLocallyLoaded(instanceId))\n\t\t{\n\t\t\tkillLocalProcedure(instanceId, monitor);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunloadRemoteProcedure(instanceId, true, monitor);\n\t\t}\n\t}", "private void killLocalProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.debug(\"killLocalProcedure()\", Level.PROC, this);\n\t\t\n\t\tmonitor.beginTask(\"Kill procedure\", 3);\n\t\tIProcedure model = getProcedure(instanceId);\n\n\t\tmonitor.subTask(\"Removing local model\");\n\t\tmonitor.worked(1);\n\n\t\t// Remove the model directly\n\t\tm_models.deleteLocalProcedureModel(instanceId);\n\n\t\tif (!s_ctx.isConnected())\n\t\t{\n\t\t\tmonitor.worked(3);\n\t\t\tmonitor.done();\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check condition: the client mode shall be controlling\n\t\t\t\tmonitor.subTask(\"Checking client mode\");\n\t\t\t\tClientMode mode = model.getRuntimeInformation().getClientMode();\n\t\t\t\tif (mode != ClientMode.CONTROL)\n\t\t\t\t{\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Cannot kill this procedure while in monitoring mode\");\n\t\t\t\t}\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\n\t\t\t\tmonitor.subTask(\"Killing process\");\n\t\t\t\t// Request context to close the procedure\n\t\t\t\tLogger.debug(\"Requesting context to kill procedure : \" + instanceId, Level.PROC, this);\n\t\t\t\tif (!s_ctx.killExecutor(instanceId))\n\t\t\t\t{\n\t\t\t\t\t// The context command was sent but it raised an error\n\t\t\t\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \" on the server\");\n\t\t\t\t}\n\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\t\t\t}\n\t\t\tcatch (ContextError err)\n\t\t\t{\n\t\t\t\tLogger.error(err.getLocalizedMessage(), Level.PROC, this);\n\t\t\t\t// The procedure could not be unloaded due to an error in the\n\t\t\t\t// context\n\t\t\t\t// processing\n\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\tmonitor.done();\n\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \": \" + err.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\t\t// Reached to this point we have the model of the procedure created.\n\t\t// Now notify any plugin extensions implementing the ProcedureView\n\t\t// support.\n\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t}", "@Override\n\tpublic void deleteRoutine(int id) {\n\n\t}", "public void removeRafProcess(RafProcess rafProcess);", "void abortProcess(Long processInstanceId);", "@Override\r\n\tpublic GlobalResult deleteEquipt(String machineno,String fstarttime) {\n\t\t\r\n\t\tint deleteByPrimaryKey = faultymachine.deleteByPrimaryKey(machineno,fstarttime);\r\n\t\tif(deleteByPrimaryKey==0) {\r\n\t\t\treturn new GlobalResult(200, \"删除失败\", null);\r\n\t\t}else {\r\n\t\t\treturn new GlobalResult(200, \"删除成功\", null);\r\n\t\t}\r\n\t}", "public synchronized void deQueue(Process p){\n if(p.getId() == queue[0].getId()){\n for(int i =0; i<(queue.length-1);i++){\n queue[i] = queue[i+1];\n }\n queue[queue.length-1] = p;\n }else if(p.getId() == queue[1].getId()){\n for(int i = 1; i<(queue.length-1);i++){\n queue[i] = queue[i+1];\n }\n queue[queue.length-1] = p;\n }else return;\n }", "public void Kill() {\n\tif (process != null) {\n\t process.destroy();\n\t childStdin.Kill();\n\t childStdout.Kill();\n\t childStderr.Kill();\n\t}\n\tprocess = null;\n }", "@DeleteMapping(value = \"/{processId}\")\n\tpublic ResponseEntity<HttpStatus> deleteProcess(@PathVariable long processId) {\n\t\tservice.deleteProcess(processId);\n\t\treturn new ResponseEntity<>(HttpStatus.OK);\n\t}", "public void markProcessPidDelete() throws JNCException {\n markLeafDelete(\"processPid\");\n }", "public void destroyPartition(int nPid);", "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 }", "@Override\n\tpublic void del() {\n\t\ttarget.del();\n\t}", "@Override\n public void delete(Promocion prm) {\n promocionRepository.delete(prm);\n }", "@Override\r\n\tpublic void deleteByMember(int memberId) {\n\t\tString sql = \"DELETE FROM executetask WHERE et_member_id = ?\";\r\n\t\tupdate(sql,memberId);\r\n\t}", "public void remove(Env env) {\n\t\tT obj = objs.remove(Thread.currentThread());\n\t\tif(obj!=null)\n\t\t\tobj.destroy(env);\n\t}", "void delete(SpCharInSeq spCharInSeq);", "@Override\n public void deleted(String pid) {\n ServiceRegistration oldRegistration = registrations.remove(pid);\n if (bundleContext != null) {\n Connect connect = (Connect) bundleContext.getService(oldRegistration.getReference());\n try {\n connect.close();\n } catch (LibvirtException e) {\n LOG.error(\"Error closing libvirt connection\", e);\n }\n }\n if (oldRegistration != null) {\n oldRegistration.unregister();\n }\n }", "int deleteByExample(ProcurementSourceExample example);", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete CustomProcess : {}\", id);\n customProcessRepository.deleteById(id);\n }", "public void deletePubkey(PubkeyBean pubkey) {\n\t\tHostDatabase hostdb = new HostDatabase(context);\n\t\thostdb.stopUsingPubkey(pubkey.getId());\n\t\thostdb.close();\n\n\t\tSQLiteDatabase db = getWritableDatabase();\n\t\tdb.delete(TABLE_PUBKEYS, \"_id = ?\", new String[] { Long.toString(pubkey.getId()) });\n\t\tdb.close();\n\t}", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void destroy() {\n this.octaveExec.destroy();\n }", "public void Kill(){\n this.dead.getAndSet(true);\n if(this.registry != null){\n try {\n UnicastRemoteObject.unexportObject(this.registry, true);\n } catch(Exception e){\n System.out.println(\"None reference\");\n }\n }\n }", "public void deleteCurrWorker() {\n this.currWorker = null;\n }", "@Override\n public void kill()\n {\n }", "public void close() {\n myProcess.destroy();\n }", "private void delete() {\n\n\t}", "void removePC(UUID uID);", "public static int delete(String fileName) {\n return Kernel.interrupt(Kernel.INTERRUPT_SOFTWARE, Kernel.DELETE, 0, fileName);\n }", "protected void processDestroy()\n {\n }", "public synchronized void delete() {\n if (this.agpCptr != 0) {\n if (this.isAgpCmemOwn) {\n this.isAgpCmemOwn = false;\n CoreJni.deleteCoreResourceArray(this.agpCptr);\n }\n this.agpCptr = 0;\n }\n }", "public int delete() {\r\n int ret = heap.get(0);\r\n heap.set(0, heap.get(heap.size() - 1));\r\n heap.remove(heap.size() - 1);\r\n\r\n siftDown(0);\r\n\r\n return ret;\r\n }", "@Override\n\tpublic void deletePro(Integer id) {\n\t\tproblemMapper.deleteByPrimaryKey(id);\n\t}", "public void eliminar(Procedimiento procedimiento) {\n IProcedimientoDao dao = new ProcedimientoDaoImpl();\n dao.eliminarProcedimiento(procedimiento);\n }", "private synchronized void freeProcess(long uid) {\n\t\trunningCount--;\n\t\tlogger.debug(\"End process {}, have {} processes still running.\", uid, runningCount);\n\t\tcheckRunningProcesses();\n\t}", "public static void deleteInstance()\r\n\t{\r\n\t\tlightManager = null;\r\n\t}", "public void destroy() {\n this.bfc.cleanUp();\n }", "public void delete()\n {\n call(\"Delete\");\n }", "private void deletion(String pids) {\n\t\tDeletions(pids);\n\t\t\n\t}", "@Override\n\tpublic void kill() {\n\n\t}", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public static synchronized void deleteInstance() {\n if (eventManager != null) { eventManager = null; }\n }", "@Override\n\tpublic void delete(Integer deptno) {\n\t\t\n\t}", "public void removeProcedure(String name) {\n String nameInLowerCase = Ascii.toLowerCase(name);\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(procedures.containsKey(nameInLowerCase));\n procedures.remove(nameInLowerCase);\n }", "public boolean deleteOnExit();", "public DestroyPostpaidInstanceResponse DestroyPostpaidInstance(DestroyPostpaidInstanceRequest req) throws TencentCloudSDKException{\n JsonResponseModel<DestroyPostpaidInstanceResponse> rsp = null;\n try {\n Type type = new TypeToken<JsonResponseModel<DestroyPostpaidInstanceResponse>>() {\n }.getType();\n rsp = gson.fromJson(this.internalRequest(req, \"DestroyPostpaidInstance\"), type);\n } catch (JsonSyntaxException e) {\n throw new TencentCloudSDKException(e.getMessage());\n }\n return rsp.response;\n }", "public String deleteProductionBlock(ProductionBlock pb);", "public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}", "public void delete() {\n Utils.inWriteLock(leaderIsrUpdateLock, () -> {\n assignedReplicaMap.clear();\n Set<Replica> inSyncReplicas = Sets.newHashSet();\n leaderReplicaIdOpt = Optional.empty();\n logManager.deleteLog(new TopicAndPartition(topic, partitionId));\n// error(String.format(\"Error deleting the log for partition <%s,%d>\", topic, partitionId), e);\n// Runtime.getRuntime().halt(1);\n return null;\n });\n }", "void deleteCenterProgram(String centerProgramId);", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "@Override\r\n\tpublic boolean pdsdelete(int seq) {\n\t\treturn pdsdao.pdsdelete(seq);\r\n\t}", "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 delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }", "public void proposalDeleted(long pid) throws RemoteException {\n\n\t\tlogger.create().block(\"proposalDeleted\").info().level(1).msg(\n\t\t\t\t\"Adding deleteProposal request to update queue for pid: \" + pid).send();\n\t}", "int deleteByExample(BasicInfoPrecursorProcessTypeExample example);", "public void destroy(){\n runner.destroy();\n }", "@Override\r\n public int deptDelete(int dept_seq) {\n return sqlSession.delete(\"deptDAO.deptDelete\", dept_seq);\r\n }", "public void destroy() {\n AwPacProcessorJni.get().destroyNative(mNativePacProcessor, this);\n }", "@Override\n\tpublic boolean removeProcess(String procLabel) {\n\t\tif(findProcess(procLabel)) {\n\t\t\tProc procTBD = getProcViaLabel(procLabel);\n\n\t\t\tif(procTBD.getLeftProc() == null && procTBD.getRightProc() == null) {\n\t\t\t\tif(procTBD.getParentProc() != null \n\t\t\t\t\t\t&& procTBD.getParentProc().getLeftProc().getProcLabel().equals(procLabel)){\n\t\t\t\t\tprocTBD.getParentProc().setLeftProc(null);\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}else {\n\t\t\t\t\tprocTBD.getParentProc().setRightProc(null);\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}else if(procTBD.getLeftProc() != null && procTBD.getRightProc() == null) {\n\t\t\t\tif(procTBD.getParentProc() != null) {\n\t\t\t\t\tprocTBD.getParentProc().setLeftProc(procTBD.getLeftProc());\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}else if(procTBD.getParentProc() == null) {\n\t\t\t\t\troot = procTBD.getLeftProc();\n\t\t\t\t\troot.setParentProc(null);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else if(procTBD.getLeftProc() == null && procTBD.getRightProc() != null) {\n\t\t\t\tprocTBD = procTBD.getRightProc();\n\t\t\t}else if(procTBD.getLeftProc() != null && procTBD.getRightProc() != null) {\n\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false; // placeholder, modify this\n\t}", "public void delete() {\n\n\t}", "public void killExecution() {\n \n \t\tcancelOrKillExecution(false);\n \t}" ]
[ "0.66092783", "0.6371656", "0.60826206", "0.6006031", "0.5565628", "0.5462919", "0.54472697", "0.5430233", "0.54119265", "0.53923786", "0.5339357", "0.5327687", "0.5313981", "0.53115726", "0.53079236", "0.52863073", "0.52774644", "0.5276856", "0.5269182", "0.5231733", "0.52306205", "0.52305925", "0.5198753", "0.5188428", "0.51800954", "0.5179233", "0.51596117", "0.51437664", "0.51412094", "0.51412094", "0.5121449", "0.5105831", "0.51002836", "0.50710446", "0.5067809", "0.5065525", "0.5050418", "0.50487405", "0.50422317", "0.50245535", "0.5011258", "0.5003747", "0.49560547", "0.49525148", "0.4945345", "0.49445271", "0.49096036", "0.4901256", "0.48982129", "0.4890317", "0.48870468", "0.48768124", "0.48724037", "0.4867908", "0.4867908", "0.4867908", "0.4867908", "0.4867908", "0.4867908", "0.48407337", "0.4834011", "0.4817848", "0.48125738", "0.48046088", "0.4792432", "0.47905186", "0.47863838", "0.47858727", "0.47813782", "0.47780234", "0.47740933", "0.47665313", "0.47576177", "0.47556236", "0.4741507", "0.4740519", "0.47263783", "0.47242263", "0.47184473", "0.47183415", "0.4716642", "0.4715089", "0.47082177", "0.47001407", "0.4698948", "0.46935135", "0.4691475", "0.4687259", "0.46861273", "0.4678736", "0.4678246", "0.4675737", "0.46739903", "0.46718022", "0.46687698", "0.4668107", "0.4665871", "0.46644095", "0.4657438", "0.4652876" ]
0.70254207
0
Deletes a proc. Any currently running instances of the proc will be killed.
public DeleteProcResponse deleteProc(String procName, Map<String, String> options) throws GPUdbException { DeleteProcRequest actualRequest_ = new DeleteProcRequest(procName, options); DeleteProcResponse actualResponse_ = new DeleteProcResponse(); submitRequest("/delete/proc", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DeleteProcResponse deleteProc(DeleteProcRequest request) throws GPUdbException {\n DeleteProcResponse actualResponse_ = new DeleteProcResponse();\n submitRequest(\"/delete/proc\", request, actualResponse_, false);\n return actualResponse_;\n }", "void kill(long procid);", "public KillProcResponse killProc(KillProcRequest request) throws GPUdbException {\n KillProcResponse actualResponse_ = new KillProcResponse();\n submitRequest(\"/kill/proc\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Process delete(int p){\n\t\tif (search(p) == -1){\n\t\tSystem.out.println(p);\n\t\t\tSystem.out.println(\"error: tried to delete nonexistent process\");\n\t\t\treturn new Process(0, 0, \"errorprocess\");\n\t\t}\n\t\tProcess output = this.table[search(p)].getValue();\n\t\tthis.table[search(p)] = null;\n\t\treturn output;\n\t\t\n\t}", "@DELETE\n @ApiOperation(\"Forcefully stops a process\")\n @javax.ws.rs.Path(\"/{id}\")\n @WithTimer\n public void kill(@ApiParam @PathParam(\"id\") UUID instanceId) {\n ProcessKey processKey = assertProcessKey(instanceId);\n processManager.kill(processKey);\n }", "int deleteByExample(ProcdefExample example);", "@Override\n\tpublic void destroyProcess() {\n\t\tsuper.destroyProcess();\n\t\tDataDirRemoverHandler ddhHandler = \n\t\t\tnew DataDirRemoverHandler(getLogHandler());\n\t\tddhHandler.setRetryLimitInMillis(2000);\n\t\tddhHandler.execute();\n\t\tportsInUse.remove(port);\n\t}", "int deleteByPrimaryKey(Integer buildProcedureId);", "public void delete() {\n\t\tcp.delete();\n\t}", "@Override\n\tpublic void removeProcedure(String instanceId)\n\t{\n\t\tm_models.removeLocalProcedureModel(instanceId);\n\t}", "SpCharInSeq delete(Integer spcharinseqId);", "int deleteByExample(CodeBuildProcedureExample example);", "public void Kill();", "public KillProcResponse killProc(String runId, Map<String, String> options) throws GPUdbException {\n KillProcRequest actualRequest_ = new KillProcRequest(runId, options);\n KillProcResponse actualResponse_ = new KillProcResponse();\n submitRequest(\"/kill/proc\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n\tpublic void deleteProcessInstance(String processInstanceId, String deleteReason) {\n\t\truntimeService.deleteProcessInstance(processInstanceId, deleteReason);\n\n\t}", "private void nativeKill()\n {\n if (process == null)\n {\n return;\n }\n for (Field f : process.getClass().getDeclaredFields())\n {\n if (\"pid\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n int pid = f.getInt(process);\n Runtime.getRuntime().exec(\n new String[] {\"kill\", \"-9\", Integer.toString(pid)});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n else if (\"handle\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n long handleId = f.getLong(process);\n\n Kernel32 kernel = Kernel32.INSTANCE;\n HANDLE handle = new HANDLE();\n handle.setPointer(Pointer.createConstant(handleId));\n int pid = kernel.GetProcessId(handle);\n Runtime.getRuntime().exec(\n new String[] {\"taskkill\", \"/PID\", Integer.toString(pid), \"/F\"});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n }\n }", "public static synchronized void stop() {\n\n if (proc != null) {\n proc.destroy();\n try {\n // wait for the process to really stop\n proc.waitFor();\n } catch (InterruptedException e) {\n // ignore\n }\n try {\n // leeway since sometimes the unbind happens after\n Thread.sleep(500);\n } catch (InterruptedException e) {\n // ignore\n }\n proc = null;\n }\n }", "void destroy() {\n \t\ttry {\r\n \t\t\tupKeep.stopRunning();\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \r\n \t\t// Kill all running processes.\r\n \t\tfor (MaximaProcess mp : pool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tpool.clear();\r\n \r\n \t\t// Kill all used processes.\r\n \t\tfor (MaximaProcess mp : usedPool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tusedPool.clear();\r\n \t}", "void instanceKilled(String pid, IKilledResult result);", "public static void cancelProcess() {\r\n\r\n if (m_Proc != null) {\r\n if (m_bProcInterruptible) {\r\n m_Proc.destroy();\r\n m_Proc = null;\r\n m_bProcCanceled = true;\r\n }\r\n }\r\n\r\n }", "public void killIt() {\n isRunning = false;\n killed = true;\n hardKill = true;\n\n dumpState();\n if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_killing_cpm__INFO\",\n new Object[] { Thread.currentThread().getName() });\n }\n if (workQueue != null) {\n while (workQueue.getCurrentSize() > 0) {\n workQueue.dequeue();\n }\n }\n if (outputQueue != null) {\n while (outputQueue.getCurrentSize() > 0) {\n outputQueue.dequeue();\n }\n }\n if (casPool != null) {\n synchronized (casPool) {\n casPool.notifyAll();\n }\n }\n if (workQueue != null) {\n Object[] eofToken = new Object[1];\n // only need one member in the array\n eofToken[0] = new EOFToken();\n workQueue.enqueue(eofToken);\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_terminate_pipelines__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(killed) });\n // synchronized (workQueue) { // redundant - enqueue call above does this\n // workQueue.notifyAll();\n // }\n }\n\n }", "public void kill()\n\t{\n\t\tisKilled = true;\n\t}", "public void unsetProcStat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PROCSTAT$16, 0);\n }\n }", "public void abort()\n\t{\n\t\tif(process != null)\n\t\t\tprocess.destroy();\n\t}", "public static void delInstance() {\n \tINSTANCE = null;\n \tcloseConnection();\n }", "public void deleteInst() {\n\t\tlogger.debug(\"DeviceNameTableTester has been stopped\");\n\t}", "public final void kill() {\n doKill();\n }", "@DELETE\n @ApiOperation(\"Forcefully stops a process and its all children\")\n @javax.ws.rs.Path(\"/{id}/cascade\")\n @WithTimer\n public void killCascade(@ApiParam @PathParam(\"id\") UUID instanceId) {\n PartialProcessKey processKey = PartialProcessKey.from(instanceId);\n processManager.killCascade(processKey);\n }", "public void kill();", "public void kill();", "public void removeProcedure(Procedure procedure) {\n removeProcedure(procedure.getName());\n }", "@Override\n\tpublic void delete(DatabaseHandler db) {\n\t\tdb.deleteWork(this);\n\t\t\n\t}", "@Override\n\tpublic void killProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.info(\"Killing procedure \" + instanceId, Level.PROC, this);\n\t\tif (isLocallyLoaded(instanceId))\n\t\t{\n\t\t\tkillLocalProcedure(instanceId, monitor);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunloadRemoteProcedure(instanceId, true, monitor);\n\t\t}\n\t}", "private void killLocalProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.debug(\"killLocalProcedure()\", Level.PROC, this);\n\t\t\n\t\tmonitor.beginTask(\"Kill procedure\", 3);\n\t\tIProcedure model = getProcedure(instanceId);\n\n\t\tmonitor.subTask(\"Removing local model\");\n\t\tmonitor.worked(1);\n\n\t\t// Remove the model directly\n\t\tm_models.deleteLocalProcedureModel(instanceId);\n\n\t\tif (!s_ctx.isConnected())\n\t\t{\n\t\t\tmonitor.worked(3);\n\t\t\tmonitor.done();\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check condition: the client mode shall be controlling\n\t\t\t\tmonitor.subTask(\"Checking client mode\");\n\t\t\t\tClientMode mode = model.getRuntimeInformation().getClientMode();\n\t\t\t\tif (mode != ClientMode.CONTROL)\n\t\t\t\t{\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Cannot kill this procedure while in monitoring mode\");\n\t\t\t\t}\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\n\t\t\t\tmonitor.subTask(\"Killing process\");\n\t\t\t\t// Request context to close the procedure\n\t\t\t\tLogger.debug(\"Requesting context to kill procedure : \" + instanceId, Level.PROC, this);\n\t\t\t\tif (!s_ctx.killExecutor(instanceId))\n\t\t\t\t{\n\t\t\t\t\t// The context command was sent but it raised an error\n\t\t\t\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \" on the server\");\n\t\t\t\t}\n\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\t\t\t}\n\t\t\tcatch (ContextError err)\n\t\t\t{\n\t\t\t\tLogger.error(err.getLocalizedMessage(), Level.PROC, this);\n\t\t\t\t// The procedure could not be unloaded due to an error in the\n\t\t\t\t// context\n\t\t\t\t// processing\n\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\tmonitor.done();\n\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \": \" + err.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\t\t// Reached to this point we have the model of the procedure created.\n\t\t// Now notify any plugin extensions implementing the ProcedureView\n\t\t// support.\n\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t}", "@Override\n\tpublic void deleteRoutine(int id) {\n\n\t}", "public void removeRafProcess(RafProcess rafProcess);", "void abortProcess(Long processInstanceId);", "@Override\r\n\tpublic GlobalResult deleteEquipt(String machineno,String fstarttime) {\n\t\t\r\n\t\tint deleteByPrimaryKey = faultymachine.deleteByPrimaryKey(machineno,fstarttime);\r\n\t\tif(deleteByPrimaryKey==0) {\r\n\t\t\treturn new GlobalResult(200, \"删除失败\", null);\r\n\t\t}else {\r\n\t\t\treturn new GlobalResult(200, \"删除成功\", null);\r\n\t\t}\r\n\t}", "public synchronized void deQueue(Process p){\n if(p.getId() == queue[0].getId()){\n for(int i =0; i<(queue.length-1);i++){\n queue[i] = queue[i+1];\n }\n queue[queue.length-1] = p;\n }else if(p.getId() == queue[1].getId()){\n for(int i = 1; i<(queue.length-1);i++){\n queue[i] = queue[i+1];\n }\n queue[queue.length-1] = p;\n }else return;\n }", "public void Kill() {\n\tif (process != null) {\n\t process.destroy();\n\t childStdin.Kill();\n\t childStdout.Kill();\n\t childStderr.Kill();\n\t}\n\tprocess = null;\n }", "@DeleteMapping(value = \"/{processId}\")\n\tpublic ResponseEntity<HttpStatus> deleteProcess(@PathVariable long processId) {\n\t\tservice.deleteProcess(processId);\n\t\treturn new ResponseEntity<>(HttpStatus.OK);\n\t}", "public void markProcessPidDelete() throws JNCException {\n markLeafDelete(\"processPid\");\n }", "public void destroyPartition(int nPid);", "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 }", "@Override\n\tpublic void del() {\n\t\ttarget.del();\n\t}", "@Override\n public void delete(Promocion prm) {\n promocionRepository.delete(prm);\n }", "@Override\r\n\tpublic void deleteByMember(int memberId) {\n\t\tString sql = \"DELETE FROM executetask WHERE et_member_id = ?\";\r\n\t\tupdate(sql,memberId);\r\n\t}", "public void remove(Env env) {\n\t\tT obj = objs.remove(Thread.currentThread());\n\t\tif(obj!=null)\n\t\t\tobj.destroy(env);\n\t}", "void delete(SpCharInSeq spCharInSeq);", "@Override\n public void deleted(String pid) {\n ServiceRegistration oldRegistration = registrations.remove(pid);\n if (bundleContext != null) {\n Connect connect = (Connect) bundleContext.getService(oldRegistration.getReference());\n try {\n connect.close();\n } catch (LibvirtException e) {\n LOG.error(\"Error closing libvirt connection\", e);\n }\n }\n if (oldRegistration != null) {\n oldRegistration.unregister();\n }\n }", "int deleteByExample(ProcurementSourceExample example);", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete CustomProcess : {}\", id);\n customProcessRepository.deleteById(id);\n }", "public void deletePubkey(PubkeyBean pubkey) {\n\t\tHostDatabase hostdb = new HostDatabase(context);\n\t\thostdb.stopUsingPubkey(pubkey.getId());\n\t\thostdb.close();\n\n\t\tSQLiteDatabase db = getWritableDatabase();\n\t\tdb.delete(TABLE_PUBKEYS, \"_id = ?\", new String[] { Long.toString(pubkey.getId()) });\n\t\tdb.close();\n\t}", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void destroy() {\n this.octaveExec.destroy();\n }", "public void Kill(){\n this.dead.getAndSet(true);\n if(this.registry != null){\n try {\n UnicastRemoteObject.unexportObject(this.registry, true);\n } catch(Exception e){\n System.out.println(\"None reference\");\n }\n }\n }", "public void deleteCurrWorker() {\n this.currWorker = null;\n }", "@Override\n public void kill()\n {\n }", "public void close() {\n myProcess.destroy();\n }", "private void delete() {\n\n\t}", "void removePC(UUID uID);", "public static int delete(String fileName) {\n return Kernel.interrupt(Kernel.INTERRUPT_SOFTWARE, Kernel.DELETE, 0, fileName);\n }", "protected void processDestroy()\n {\n }", "public synchronized void delete() {\n if (this.agpCptr != 0) {\n if (this.isAgpCmemOwn) {\n this.isAgpCmemOwn = false;\n CoreJni.deleteCoreResourceArray(this.agpCptr);\n }\n this.agpCptr = 0;\n }\n }", "public int delete() {\r\n int ret = heap.get(0);\r\n heap.set(0, heap.get(heap.size() - 1));\r\n heap.remove(heap.size() - 1);\r\n\r\n siftDown(0);\r\n\r\n return ret;\r\n }", "@Override\n\tpublic void deletePro(Integer id) {\n\t\tproblemMapper.deleteByPrimaryKey(id);\n\t}", "public void eliminar(Procedimiento procedimiento) {\n IProcedimientoDao dao = new ProcedimientoDaoImpl();\n dao.eliminarProcedimiento(procedimiento);\n }", "private synchronized void freeProcess(long uid) {\n\t\trunningCount--;\n\t\tlogger.debug(\"End process {}, have {} processes still running.\", uid, runningCount);\n\t\tcheckRunningProcesses();\n\t}", "public static void deleteInstance()\r\n\t{\r\n\t\tlightManager = null;\r\n\t}", "public void destroy() {\n this.bfc.cleanUp();\n }", "public void delete()\n {\n call(\"Delete\");\n }", "private void deletion(String pids) {\n\t\tDeletions(pids);\n\t\t\n\t}", "@Override\n\tpublic void kill() {\n\n\t}", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public static synchronized void deleteInstance() {\n if (eventManager != null) { eventManager = null; }\n }", "@Override\n\tpublic void delete(Integer deptno) {\n\t\t\n\t}", "public void removeProcedure(String name) {\n String nameInLowerCase = Ascii.toLowerCase(name);\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(procedures.containsKey(nameInLowerCase));\n procedures.remove(nameInLowerCase);\n }", "public boolean deleteOnExit();", "public DestroyPostpaidInstanceResponse DestroyPostpaidInstance(DestroyPostpaidInstanceRequest req) throws TencentCloudSDKException{\n JsonResponseModel<DestroyPostpaidInstanceResponse> rsp = null;\n try {\n Type type = new TypeToken<JsonResponseModel<DestroyPostpaidInstanceResponse>>() {\n }.getType();\n rsp = gson.fromJson(this.internalRequest(req, \"DestroyPostpaidInstance\"), type);\n } catch (JsonSyntaxException e) {\n throw new TencentCloudSDKException(e.getMessage());\n }\n return rsp.response;\n }", "public String deleteProductionBlock(ProductionBlock pb);", "public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}", "public void delete() {\n Utils.inWriteLock(leaderIsrUpdateLock, () -> {\n assignedReplicaMap.clear();\n Set<Replica> inSyncReplicas = Sets.newHashSet();\n leaderReplicaIdOpt = Optional.empty();\n logManager.deleteLog(new TopicAndPartition(topic, partitionId));\n// error(String.format(\"Error deleting the log for partition <%s,%d>\", topic, partitionId), e);\n// Runtime.getRuntime().halt(1);\n return null;\n });\n }", "void deleteCenterProgram(String centerProgramId);", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "@Override\r\n\tpublic boolean pdsdelete(int seq) {\n\t\treturn pdsdao.pdsdelete(seq);\r\n\t}", "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 delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }", "public void proposalDeleted(long pid) throws RemoteException {\n\n\t\tlogger.create().block(\"proposalDeleted\").info().level(1).msg(\n\t\t\t\t\"Adding deleteProposal request to update queue for pid: \" + pid).send();\n\t}", "int deleteByExample(BasicInfoPrecursorProcessTypeExample example);", "public void destroy(){\n runner.destroy();\n }", "@Override\r\n public int deptDelete(int dept_seq) {\n return sqlSession.delete(\"deptDAO.deptDelete\", dept_seq);\r\n }", "public void destroy() {\n AwPacProcessorJni.get().destroyNative(mNativePacProcessor, this);\n }", "@Override\n\tpublic boolean removeProcess(String procLabel) {\n\t\tif(findProcess(procLabel)) {\n\t\t\tProc procTBD = getProcViaLabel(procLabel);\n\n\t\t\tif(procTBD.getLeftProc() == null && procTBD.getRightProc() == null) {\n\t\t\t\tif(procTBD.getParentProc() != null \n\t\t\t\t\t\t&& procTBD.getParentProc().getLeftProc().getProcLabel().equals(procLabel)){\n\t\t\t\t\tprocTBD.getParentProc().setLeftProc(null);\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}else {\n\t\t\t\t\tprocTBD.getParentProc().setRightProc(null);\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}else if(procTBD.getLeftProc() != null && procTBD.getRightProc() == null) {\n\t\t\t\tif(procTBD.getParentProc() != null) {\n\t\t\t\t\tprocTBD.getParentProc().setLeftProc(procTBD.getLeftProc());\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}else if(procTBD.getParentProc() == null) {\n\t\t\t\t\troot = procTBD.getLeftProc();\n\t\t\t\t\troot.setParentProc(null);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else if(procTBD.getLeftProc() == null && procTBD.getRightProc() != null) {\n\t\t\t\tprocTBD = procTBD.getRightProc();\n\t\t\t}else if(procTBD.getLeftProc() != null && procTBD.getRightProc() != null) {\n\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false; // placeholder, modify this\n\t}", "public void delete() {\n\n\t}", "public void killExecution() {\n \n \t\tcancelOrKillExecution(false);\n \t}" ]
[ "0.70254207", "0.6371656", "0.60826206", "0.6006031", "0.5565628", "0.5462919", "0.54472697", "0.5430233", "0.54119265", "0.53923786", "0.5339357", "0.5327687", "0.5313981", "0.53115726", "0.53079236", "0.52863073", "0.52774644", "0.5276856", "0.5269182", "0.5231733", "0.52306205", "0.52305925", "0.5198753", "0.5188428", "0.51800954", "0.5179233", "0.51596117", "0.51437664", "0.51412094", "0.51412094", "0.5121449", "0.5105831", "0.51002836", "0.50710446", "0.5067809", "0.5065525", "0.5050418", "0.50487405", "0.50422317", "0.50245535", "0.5011258", "0.5003747", "0.49560547", "0.49525148", "0.4945345", "0.49445271", "0.49096036", "0.4901256", "0.48982129", "0.4890317", "0.48870468", "0.48768124", "0.48724037", "0.4867908", "0.4867908", "0.4867908", "0.4867908", "0.4867908", "0.4867908", "0.48407337", "0.4834011", "0.4817848", "0.48125738", "0.48046088", "0.4792432", "0.47905186", "0.47863838", "0.47858727", "0.47813782", "0.47780234", "0.47740933", "0.47665313", "0.47576177", "0.47556236", "0.4741507", "0.4740519", "0.47263783", "0.47242263", "0.47184473", "0.47183415", "0.4716642", "0.4715089", "0.47082177", "0.47001407", "0.4698948", "0.46935135", "0.4691475", "0.4687259", "0.46861273", "0.4678736", "0.4678246", "0.4675737", "0.46739903", "0.46718022", "0.46687698", "0.4668107", "0.4665871", "0.46644095", "0.4657438", "0.4652876" ]
0.66092783
1
Deletes an existing role.
public DeleteRoleResponse deleteRole(DeleteRoleRequest request) throws GPUdbException { DeleteRoleResponse actualResponse_ = new DeleteRoleResponse(); submitRequest("/delete/role", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void deleteRole(Role role) {\n\t\tgetHibernateTemplate().delete(role);\r\n\t}", "void deleteRole(UserRole role) {\n\t\tuserRoleRepository.delete(role.getId());\n\t}", "public void delRole( String role )\n {\n if ( this.roles != null )\n {\n this.roles.remove( role );\n }\n }", "@RequestMapping(value = \"/roles/{roleId}/delete\", method = RequestMethod.POST)\n public String deleteRole(@PathVariable Long roleId) {\n // TODO: Delete role whose id is roleId\n\n // TODO: Redirect browser to /roles\n return null;\n }", "@Override\n\tpublic void deleteRole(int id) {\n\t\tthis.roleMapper.deleteByPrimaryKey(id);\n\t}", "@Override\r\n\tpublic boolean deleteRole(Long id) {\n\t\tdeleteById(id);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void deleteRole(long id) {\n\t\t\n\t}", "@Override\r\n\tpublic int deleteRole(int roleid) {\n\t\treturn adminRoleDao.deleteByPrimaryKey(roleid);\r\n\t}", "public Boolean deleteRole(Role role) {\n if (log.isDebugEnabled()) {\n log.debug(\"RoleService deleteRole method calling.\");\n }\n Boolean saveStatus = false;\n if (log.isDebugEnabled()) {\n log.debug(\"RoleService deleteRole method delete role to the database.\");\n }\n roleRepository.delete(role);\n saveStatus = true;\n return saveStatus;\n }", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "int deleteByPrimaryKey(Integer roleId);", "int deleteByPrimaryKey(Integer roleId);", "@Override\n\tpublic void deleteRole(MaintenanceDTO dto) {\n\t\tmd.deleteRole(dto);\n\t}", "void removeRole(String id) throws DataException;", "public void delete(SecRole entity);", "public void deleteRoleData() throws DataLayerException\r\n\t{\r\n\t\troleDao.deleteAll();\r\n\t}", "@Override\n\tpublic void delete(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from role where id=?\",roleid);\n\t}", "@Override\n\tpublic void deleteRole(Integer id) {\n\t\tlogger.debug(\"RoleServiceImpl::deleteRole id = {}\", id);\n\t\troleMapper.deleteRole(id);\n\t}", "@Override\n\t@Transactional\n\tpublic void delete(Role role) {\n\t\t\n\t}", "public void delete(int roleId) throws QuestionBankSystemException,\n\t\t\tQuestionBankException;", "@Override\n\tpublic void delRole(String roleid) {\n\t\troleMapper.delRole(roleid);\n\t}", "public DeleteRoleResponse deleteRole(String name, Map<String, String> options) throws GPUdbException {\n DeleteRoleRequest actualRequest_ = new DeleteRoleRequest(name, options);\n DeleteRoleResponse actualResponse_ = new DeleteRoleResponse();\n submitRequest(\"/delete/role\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n\tpublic Integer delete(Integer id) {\n\t\treturn roleDao.delete(id);\n\t}", "@Override\n\tpublic boolean deleteByPrimaryKey(Role Role) {\n\t\tif(this.RoleDao.deleteByPrimaryKey(Role))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean deleteRole(String role_id){\n\t\tString sql = \"delete from role where role_id = ?;\";\n\t\t\n\t\tConnection conn = new DBUtilFactory().getConn();\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\tps.setString(1, role_id);\n\t\t\tps.execute();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t} finally {\n\t\t\tclearUp(conn);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public void deleteUserRole(UserRole userRole) throws ClassNotFoundException, SQLException {\n\t\tsave(\"delete from user_role where id = ?\", new Object[] { userRole.getId() });\n\t}", "public void removeRole(String roleName) throws UnsupportedOperationException;", "public void deletRole(int id) {\n\trolesDao.deleteById(id);\n\t}", "int deleteByPrimaryKey(Integer roleResId);", "@Override\n\tpublic void deleteUserRole(UserDto userDto, RoleDto role) {\n\t\t\n\t}", "public void removeRole(Role role) {\n if (this.roles.contains(role)) {\n this.roles.remove(role);\n }\n }", "@GetMapping( value = \"/remove/{id}\")\n public String removeRole(@PathVariable( \"id\" ) Long id) {\n roleService.delete(id);\n return \"redirect:/role\";\n }", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Test\n public void removeRole() throws Exception {\n\n doReturn(role).when(roleRepository).findOne(anyLong());\n doAnswer(invocationOnMock -> users).when(userRepository).findUsersByRolesContains(any(Role.class));\n doAnswer(invocationOnMock -> users).when(userRepository).save(any(List.class));\n doNothing().when(roleRepository).delete(any(Role.class));\n\n boolean result = roleService.removeRole(anyLong());\n\n Assert.assertTrue(\"Remove role failed\", result);\n }", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "int deleteByExample(JindouyunRoleExample example);", "int deleteByPrimaryKey(@Param(\"roleId\") String roleId, @Param(\"adminId\") String adminId);", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "public boolean deleteUserRole(String userName, String roleName) {\n boolean deleteResult = false;\n String sql;\n if(roleName == null)\n sql = \"DELETE FROM users_roles WHERE user_name = ?\";\n else\n sql = \"DELETE FROM users_roles WHERE user_name = ? and role_name = ?\";\n \ttry {\t\t\t\n this.statement = connection.prepareStatement(sql);\n this.statement.setString(1, userName); \n if(roleName != null)\n this.statement.setString(2, roleName);\n this.statement.executeUpdate();\n deleteResult = true;\n this.statement.close();\n\t}\n catch(SQLException ex) {\n Logger.getLogger(UserDBManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n return deleteResult; \n }", "@Override\n\tpublic void deleteRolemenuByRoleId(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from menurole where roleid=?\",roleid);\n\t}", "public static int removeRoleFromDb(String roleName)\n\t{\t\t\n\t\t//Remove user data from table BSM_USER\n\t\tString sql = String.format(\"DELETE FROM BSM_ROLE WHERE ROLE_NAME='%s'\", roleName);\n\t\tint ret = DBUtil.executeSQL(sql);\n\t\treturn ret;\n\t}", "public void supprimerRole(Long idRoUt);", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "@Test\n public void deleteId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Attempt to remove from the database with delete request\n try {\n mvc.perform(MockMvcRequestBuilders.delete(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n )\n .andExpect(status().isOk());\n } catch (Exception e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Check if successfully removed from database\n try {\n //Remove from database (above get function should have thrown an error if the object was no longer in the database)\n remove(role.getUuid());\n fail(\"DELETE request did not succesfully delete the object from the database\");\n } catch (ObjectNotFoundException e) {\n //Nothing because the object is no longer present in the database which is expected\n }\n }", "public void removeSysRole(final Long roleId);", "Integer deleteByRoleAndPermission(@Param(\"roleId\") Integer roleId,\n @Param(\"permissionId\") Integer permissionId);", "@Override\n\tpublic void delete(UserRole vo) {\n\n\t}", "@Override\n\t@TriggersRemove(cacheName=\"baseCache\",when=When.AFTER_METHOD_INVOCATION,removeAll=true)\n\tpublic int deleteByRole(Integer roleid) {\n\t\treturn permissionRoleMapper.deleteByRole(roleid);\n\t}", "public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException {\n RevokeRoleResponse actualResponse_ = new RevokeRoleResponse();\n submitRequest(\"/revoke/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "private void onRemoveRole() {\n\t\troleProxy.removeRoleFromUser(user, selectedRole);\n\t}", "int deleteByExample(SysRoleDOExample example);", "int deleteByExample(RoleSystemauthorityExample example);", "@Override\r\n\tpublic int deleteRoleandPermission(int roleid, int permissionid) {\n\t\treturn adminRoleandpermissionDao.deleteByPrimaryKey(roleid, permissionid);\r\n\t}", "public void removeRole(Role role) {\n\t\tif (role.parentRole != null) {\n\t\t\trole.parentRole.subRoles.remove(role);\n\t\t\trole.parentRole = null;\n\t\t}\n\t}", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "int deleteByExample(UsercontrollerRoleExample example);", "@RequestMapping(value=\"/delete/{id}\", method=RequestMethod.DELETE)\n\tpublic ResponseEntity<?> deleteUserRole(@PathVariable Integer id) throws UserRoleServiceException {\n\t\tlogger.info(\"UserRoleRestService :: Entered into deleteUserRole()\");\n\t\tServiceStatusDto serviceStatusDto=new ServiceStatusDto();\n\t\ttry {\n\t\t\t\tuserRoleService.deleteUserRole(id);\n\t\t\t\tserviceStatusDto.setStatus(true);;\n\t\t\t\tserviceStatusDto.setMessage(Constants.USER_ROLE_DELETED);\n\t\t}catch(Exception e) {\t\n\t\t\tlogger.error(\"UserRoleRestService :: User Role with Given \"+id+\" Doesn't Exists\");\n\t\t\t\n\t\t\tErrors error = new Errors();\n\t\t\terror.setErrorCode(\"Errors-UserRole\");\n\t\t\terror.setErrorMessage(Constants.USER_ROLE_NOT_EXISTS);\n\t\t\tResponseEntity<Errors> rsEntity=new ResponseEntity<Errors>(error, HttpStatus.NOT_ACCEPTABLE);\n\t\t\treturn rsEntity;\n\t\t}\t\n\t\tlogger.info(\"UserRoleRestService :: Existing User Role Deleted Successfully\");\t\t\n\t\treturn new ResponseEntity<Object>(serviceStatusDto, HttpStatus.OK);\n\t}", "@Override\n\tpublic int deleteRoleInfo(int roleid) throws Exception {\n\t\tDBContextHolder.setDBType(\"0\");\n\t\treturn froleMapper.deleteRoleInfo(roleid);\n\t}", "int deleteByExample(T00RolePostExample example);", "@Delete({\n \"delete from A_USER_ROLE\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);", "@Override\n\tpublic void deleteRoleUtilisateur(Integer idR) {\n\t\troleUtilisateurDAO.deleteRoleUtilsiateur(idR);\n\t}", "public static void removeRoleDocuments(Role role) {\n getService().removeRoleDocuments(role);\n }", "@DeleteMapping(\"/{id}\")\n\t@ResponseStatus(HttpStatus.NO_CONTENT)\n\tpublic void delete(@PathVariable Long id) {\n\t\tplanRoleRepository.deleteById(id);\n\t}", "public int deleteByPrimaryKey(Integer rolemenuId) throws SQLException {\r\n SysRoleMenu key = new SysRoleMenu();\r\n key.setRolemenuId(rolemenuId);\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByPrimaryKey\", key);\r\n return rows;\r\n }", "public void revokeRole(String roleName, User user) throws UserManagementException;", "@POST\n @Path(\"DeleteAllRolePermissions/{roleName}/{gameModelId}\")\n public boolean deleteAllRolePermissions(@PathParam(\"roleName\") String roleName,\n @PathParam(\"gameModelId\") String id) {\n try {\n return this.deleteAllRolePermissions(roleFacade.findByName(roleName).getId(), id);\n } catch (WegasNoResultException ex) {\n throw WegasErrorMessage.error(\"Role \\\"\" + roleName + \"\\\" does not exists\");\n }\n }", "@Override\n\tpublic void deleteRole_Activity(Integer id) {\n\t\tlogger.debug(\"RoleServiceImpl::deleteRole_Activity id = {}\", id);\n\t\troleMapper.deleteRole_Activity(id);\n\t}", "public int deleteRoleItem(Map<String, Object> param) {\n\t\tint dataCode = 0;\n\t\ttry {\n\t\t\tsqlMapperFlight.startTransaction();\n\t\t\tdataCode = sqlMapperFlight.delete(\"deleteRoleItem\", param);\n\t\t\tsqlMapperFlight.commitTransaction();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tsqlMapperFlight.endTransaction();\n\t\t\t} catch (SQLException 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\treturn dataCode;\n\t}", "int logicalDeleteByExample(@Param(\"example\") JindouyunRoleExample example);", "int deleteByExample(UserRoleExample example);", "int deleteByExample(UserRoleExample example);", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "int deleteByExample(BsUserRoleExample example);", "public void setRole(String role) {\n this.role = role;\n }", "@Override\n\tpublic int delRFunc(int roleid) throws Exception {\n\t\treturn froleMapper.delRFunc(roleid);\n\t}", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public IBusinessObject removeFromRole(IIID useriid, IIID roleiid)\n throws OculusException;", "int deleteByPrimaryKey(T00RolePostKey key);", "public static void removeRoleInListOf(Keycloak keycloak, KeycloakAdminClientConfig keycloakAdminClientConfig, String role, String compositeRole) {\n\n final String clientUuid = keycloak.realm(keycloakAdminClientConfig.getRealm()).clients().findByClientId(keycloakAdminClientConfig.getClientId()).get(0).getId();\n\n final RolesResource rolesResource = keycloak.realm(keycloakAdminClientConfig.getRealm()).clients().get(clientUuid).roles();\n\n final RoleResource compositeRoleResource = rolesResource.get(compositeRole);\n\n try {\n final RoleRepresentation roleToDelete = rolesResource.get(role).toRepresentation();\n compositeRoleResource.getRoleComposites().remove(roleToDelete);\n\n } catch (NotFoundException e) {\n log.warn(\"Role {} does not exists!\", role);\n }\n }", "int deleteByRoleIdList(@Param(\"roleIdList\") List<Long> roleIdList);", "int deleteByExample(TawRoleDomainExample example);", "int deleteByExample(UUserRoleExample example);", "public void removeRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"User [ Anonymous ] has no roles\");\r\n }", "public void delete(Integer idRol);", "public Builder clearRole() {\n if (roleBuilder_ == null) {\n role_ = null;\n onChanged();\n } else {\n roleBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x00000002);\n return this;\n }", "@Override\n\tpublic void updateRole(Role role) {\n\t\tthis.roleMapper.updateByPrimaryKey(role);\n\t}", "public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearRole() {\n role = null;\n fieldSetFlags()[6] = false;\n return this;\n }", "@Override\r\n\tpublic void updateRole(Role role) {\n\t\troleDao.updateRole(role);\r\n\t}", "int deleteByPrimaryKey(TawRoleDomainKey key);", "@Override\n\tpublic Rol delete(Rol p) {\n\t\tdao.delete(p);\n\t\treturn null;\n\t}", "public void setRole(String role) {\r\n\t\tthis.role = role;\r\n\t}", "int deleteByExample(SystemRoleUserMapperExample example);", "public void setRole(String role) {\n\t\tthis.role = role;\n\t}", "@Override\n\tpublic void editRole(Role role) {\n\t\trd.editRole(role);\n\t}", "@Override\r\n\tpublic int updRole(Role role) {\n\t\treturn 0;\r\n\t}", "@POST\n @Path(\"DeleteAllRolePermissions/{roleId : [1-9][0-9]*}/{gameModelId}\")\n public boolean deleteAllRolePermissions(@PathParam(\"roleId\") Long roleId,\n @PathParam(\"gameModelId\") String id) {\n\n checkGmOrGPermission(id, \"GameModel:Edit:\", \"Game:Edit:\");\n\n return this.userFacade.deleteRolePermissionsByIdAndInstance(roleId, id);\n }", "public void setRole(java.lang.String value) {\n this.role = value;\n }", "public int deleteByExample(SysRoleMenuExample example) throws SQLException {\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByExample\", example);\r\n return rows;\r\n }" ]
[ "0.78018844", "0.7699577", "0.75962865", "0.7516469", "0.7501005", "0.74694824", "0.7453181", "0.73355937", "0.72136754", "0.71697265", "0.71616286", "0.71616286", "0.70951456", "0.70038015", "0.7003146", "0.6996362", "0.6941467", "0.69273806", "0.6910364", "0.69088805", "0.6896354", "0.68639314", "0.68327284", "0.6821222", "0.6792963", "0.6731789", "0.6728843", "0.6694741", "0.6674621", "0.6604339", "0.6541473", "0.65255225", "0.6427031", "0.6386697", "0.6382604", "0.6366045", "0.63231725", "0.6261498", "0.62481993", "0.62379783", "0.6201657", "0.61902916", "0.61827296", "0.6155398", "0.6142827", "0.61360824", "0.6109968", "0.60860205", "0.6080172", "0.6068313", "0.60625035", "0.6040167", "0.59781957", "0.5963186", "0.59479076", "0.5944583", "0.58788246", "0.58778334", "0.5851199", "0.5847129", "0.58002", "0.5795663", "0.5785485", "0.5783461", "0.5765143", "0.5756419", "0.5741851", "0.5734619", "0.57271415", "0.5689844", "0.56571853", "0.56571853", "0.56470376", "0.56406575", "0.5634359", "0.55956674", "0.5594974", "0.5587979", "0.557893", "0.55763674", "0.55734926", "0.55458724", "0.5542065", "0.5537863", "0.552313", "0.552291", "0.55210185", "0.55172765", "0.5516792", "0.550473", "0.54935426", "0.54888093", "0.5487614", "0.54872763", "0.5483299", "0.5472031", "0.54684407", "0.5466951", "0.5449626", "0.5440443" ]
0.7925964
0
Deletes an existing role.
public DeleteRoleResponse deleteRole(String name, Map<String, String> options) throws GPUdbException { DeleteRoleRequest actualRequest_ = new DeleteRoleRequest(name, options); DeleteRoleResponse actualResponse_ = new DeleteRoleResponse(); submitRequest("/delete/role", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DeleteRoleResponse deleteRole(DeleteRoleRequest request) throws GPUdbException {\n DeleteRoleResponse actualResponse_ = new DeleteRoleResponse();\n submitRequest(\"/delete/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic void deleteRole(Role role) {\n\t\tgetHibernateTemplate().delete(role);\r\n\t}", "void deleteRole(UserRole role) {\n\t\tuserRoleRepository.delete(role.getId());\n\t}", "public void delRole( String role )\n {\n if ( this.roles != null )\n {\n this.roles.remove( role );\n }\n }", "@RequestMapping(value = \"/roles/{roleId}/delete\", method = RequestMethod.POST)\n public String deleteRole(@PathVariable Long roleId) {\n // TODO: Delete role whose id is roleId\n\n // TODO: Redirect browser to /roles\n return null;\n }", "@Override\n\tpublic void deleteRole(int id) {\n\t\tthis.roleMapper.deleteByPrimaryKey(id);\n\t}", "@Override\r\n\tpublic boolean deleteRole(Long id) {\n\t\tdeleteById(id);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void deleteRole(long id) {\n\t\t\n\t}", "@Override\r\n\tpublic int deleteRole(int roleid) {\n\t\treturn adminRoleDao.deleteByPrimaryKey(roleid);\r\n\t}", "public Boolean deleteRole(Role role) {\n if (log.isDebugEnabled()) {\n log.debug(\"RoleService deleteRole method calling.\");\n }\n Boolean saveStatus = false;\n if (log.isDebugEnabled()) {\n log.debug(\"RoleService deleteRole method delete role to the database.\");\n }\n roleRepository.delete(role);\n saveStatus = true;\n return saveStatus;\n }", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "int deleteByPrimaryKey(Integer roleId);", "int deleteByPrimaryKey(Integer roleId);", "@Override\n\tpublic void deleteRole(MaintenanceDTO dto) {\n\t\tmd.deleteRole(dto);\n\t}", "void removeRole(String id) throws DataException;", "public void delete(SecRole entity);", "public void deleteRoleData() throws DataLayerException\r\n\t{\r\n\t\troleDao.deleteAll();\r\n\t}", "@Override\n\tpublic void delete(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from role where id=?\",roleid);\n\t}", "@Override\n\tpublic void deleteRole(Integer id) {\n\t\tlogger.debug(\"RoleServiceImpl::deleteRole id = {}\", id);\n\t\troleMapper.deleteRole(id);\n\t}", "@Override\n\t@Transactional\n\tpublic void delete(Role role) {\n\t\t\n\t}", "public void delete(int roleId) throws QuestionBankSystemException,\n\t\t\tQuestionBankException;", "@Override\n\tpublic void delRole(String roleid) {\n\t\troleMapper.delRole(roleid);\n\t}", "@Override\n\tpublic Integer delete(Integer id) {\n\t\treturn roleDao.delete(id);\n\t}", "@Override\n\tpublic boolean deleteByPrimaryKey(Role Role) {\n\t\tif(this.RoleDao.deleteByPrimaryKey(Role))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean deleteRole(String role_id){\n\t\tString sql = \"delete from role where role_id = ?;\";\n\t\t\n\t\tConnection conn = new DBUtilFactory().getConn();\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\tps.setString(1, role_id);\n\t\t\tps.execute();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t} finally {\n\t\t\tclearUp(conn);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public void deleteUserRole(UserRole userRole) throws ClassNotFoundException, SQLException {\n\t\tsave(\"delete from user_role where id = ?\", new Object[] { userRole.getId() });\n\t}", "public void removeRole(String roleName) throws UnsupportedOperationException;", "public void deletRole(int id) {\n\trolesDao.deleteById(id);\n\t}", "int deleteByPrimaryKey(Integer roleResId);", "@Override\n\tpublic void deleteUserRole(UserDto userDto, RoleDto role) {\n\t\t\n\t}", "public void removeRole(Role role) {\n if (this.roles.contains(role)) {\n this.roles.remove(role);\n }\n }", "@GetMapping( value = \"/remove/{id}\")\n public String removeRole(@PathVariable( \"id\" ) Long id) {\n roleService.delete(id);\n return \"redirect:/role\";\n }", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Test\n public void removeRole() throws Exception {\n\n doReturn(role).when(roleRepository).findOne(anyLong());\n doAnswer(invocationOnMock -> users).when(userRepository).findUsersByRolesContains(any(Role.class));\n doAnswer(invocationOnMock -> users).when(userRepository).save(any(List.class));\n doNothing().when(roleRepository).delete(any(Role.class));\n\n boolean result = roleService.removeRole(anyLong());\n\n Assert.assertTrue(\"Remove role failed\", result);\n }", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "int deleteByExample(JindouyunRoleExample example);", "int deleteByPrimaryKey(@Param(\"roleId\") String roleId, @Param(\"adminId\") String adminId);", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "public boolean deleteUserRole(String userName, String roleName) {\n boolean deleteResult = false;\n String sql;\n if(roleName == null)\n sql = \"DELETE FROM users_roles WHERE user_name = ?\";\n else\n sql = \"DELETE FROM users_roles WHERE user_name = ? and role_name = ?\";\n \ttry {\t\t\t\n this.statement = connection.prepareStatement(sql);\n this.statement.setString(1, userName); \n if(roleName != null)\n this.statement.setString(2, roleName);\n this.statement.executeUpdate();\n deleteResult = true;\n this.statement.close();\n\t}\n catch(SQLException ex) {\n Logger.getLogger(UserDBManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n return deleteResult; \n }", "@Override\n\tpublic void deleteRolemenuByRoleId(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from menurole where roleid=?\",roleid);\n\t}", "public static int removeRoleFromDb(String roleName)\n\t{\t\t\n\t\t//Remove user data from table BSM_USER\n\t\tString sql = String.format(\"DELETE FROM BSM_ROLE WHERE ROLE_NAME='%s'\", roleName);\n\t\tint ret = DBUtil.executeSQL(sql);\n\t\treturn ret;\n\t}", "public void supprimerRole(Long idRoUt);", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "@Test\n public void deleteId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Attempt to remove from the database with delete request\n try {\n mvc.perform(MockMvcRequestBuilders.delete(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n )\n .andExpect(status().isOk());\n } catch (Exception e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Check if successfully removed from database\n try {\n //Remove from database (above get function should have thrown an error if the object was no longer in the database)\n remove(role.getUuid());\n fail(\"DELETE request did not succesfully delete the object from the database\");\n } catch (ObjectNotFoundException e) {\n //Nothing because the object is no longer present in the database which is expected\n }\n }", "public void removeSysRole(final Long roleId);", "Integer deleteByRoleAndPermission(@Param(\"roleId\") Integer roleId,\n @Param(\"permissionId\") Integer permissionId);", "@Override\n\tpublic void delete(UserRole vo) {\n\n\t}", "@Override\n\t@TriggersRemove(cacheName=\"baseCache\",when=When.AFTER_METHOD_INVOCATION,removeAll=true)\n\tpublic int deleteByRole(Integer roleid) {\n\t\treturn permissionRoleMapper.deleteByRole(roleid);\n\t}", "public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException {\n RevokeRoleResponse actualResponse_ = new RevokeRoleResponse();\n submitRequest(\"/revoke/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "private void onRemoveRole() {\n\t\troleProxy.removeRoleFromUser(user, selectedRole);\n\t}", "int deleteByExample(SysRoleDOExample example);", "int deleteByExample(RoleSystemauthorityExample example);", "@Override\r\n\tpublic int deleteRoleandPermission(int roleid, int permissionid) {\n\t\treturn adminRoleandpermissionDao.deleteByPrimaryKey(roleid, permissionid);\r\n\t}", "public void removeRole(Role role) {\n\t\tif (role.parentRole != null) {\n\t\t\trole.parentRole.subRoles.remove(role);\n\t\t\trole.parentRole = null;\n\t\t}\n\t}", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "int deleteByExample(UsercontrollerRoleExample example);", "@RequestMapping(value=\"/delete/{id}\", method=RequestMethod.DELETE)\n\tpublic ResponseEntity<?> deleteUserRole(@PathVariable Integer id) throws UserRoleServiceException {\n\t\tlogger.info(\"UserRoleRestService :: Entered into deleteUserRole()\");\n\t\tServiceStatusDto serviceStatusDto=new ServiceStatusDto();\n\t\ttry {\n\t\t\t\tuserRoleService.deleteUserRole(id);\n\t\t\t\tserviceStatusDto.setStatus(true);;\n\t\t\t\tserviceStatusDto.setMessage(Constants.USER_ROLE_DELETED);\n\t\t}catch(Exception e) {\t\n\t\t\tlogger.error(\"UserRoleRestService :: User Role with Given \"+id+\" Doesn't Exists\");\n\t\t\t\n\t\t\tErrors error = new Errors();\n\t\t\terror.setErrorCode(\"Errors-UserRole\");\n\t\t\terror.setErrorMessage(Constants.USER_ROLE_NOT_EXISTS);\n\t\t\tResponseEntity<Errors> rsEntity=new ResponseEntity<Errors>(error, HttpStatus.NOT_ACCEPTABLE);\n\t\t\treturn rsEntity;\n\t\t}\t\n\t\tlogger.info(\"UserRoleRestService :: Existing User Role Deleted Successfully\");\t\t\n\t\treturn new ResponseEntity<Object>(serviceStatusDto, HttpStatus.OK);\n\t}", "@Override\n\tpublic int deleteRoleInfo(int roleid) throws Exception {\n\t\tDBContextHolder.setDBType(\"0\");\n\t\treturn froleMapper.deleteRoleInfo(roleid);\n\t}", "int deleteByExample(T00RolePostExample example);", "@Delete({\n \"delete from A_USER_ROLE\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);", "@Override\n\tpublic void deleteRoleUtilisateur(Integer idR) {\n\t\troleUtilisateurDAO.deleteRoleUtilsiateur(idR);\n\t}", "public static void removeRoleDocuments(Role role) {\n getService().removeRoleDocuments(role);\n }", "@DeleteMapping(\"/{id}\")\n\t@ResponseStatus(HttpStatus.NO_CONTENT)\n\tpublic void delete(@PathVariable Long id) {\n\t\tplanRoleRepository.deleteById(id);\n\t}", "public int deleteByPrimaryKey(Integer rolemenuId) throws SQLException {\r\n SysRoleMenu key = new SysRoleMenu();\r\n key.setRolemenuId(rolemenuId);\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByPrimaryKey\", key);\r\n return rows;\r\n }", "public void revokeRole(String roleName, User user) throws UserManagementException;", "@POST\n @Path(\"DeleteAllRolePermissions/{roleName}/{gameModelId}\")\n public boolean deleteAllRolePermissions(@PathParam(\"roleName\") String roleName,\n @PathParam(\"gameModelId\") String id) {\n try {\n return this.deleteAllRolePermissions(roleFacade.findByName(roleName).getId(), id);\n } catch (WegasNoResultException ex) {\n throw WegasErrorMessage.error(\"Role \\\"\" + roleName + \"\\\" does not exists\");\n }\n }", "@Override\n\tpublic void deleteRole_Activity(Integer id) {\n\t\tlogger.debug(\"RoleServiceImpl::deleteRole_Activity id = {}\", id);\n\t\troleMapper.deleteRole_Activity(id);\n\t}", "public int deleteRoleItem(Map<String, Object> param) {\n\t\tint dataCode = 0;\n\t\ttry {\n\t\t\tsqlMapperFlight.startTransaction();\n\t\t\tdataCode = sqlMapperFlight.delete(\"deleteRoleItem\", param);\n\t\t\tsqlMapperFlight.commitTransaction();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tsqlMapperFlight.endTransaction();\n\t\t\t} catch (SQLException 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\treturn dataCode;\n\t}", "int logicalDeleteByExample(@Param(\"example\") JindouyunRoleExample example);", "int deleteByExample(UserRoleExample example);", "int deleteByExample(UserRoleExample example);", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "int deleteByExample(BsUserRoleExample example);", "public void setRole(String role) {\n this.role = role;\n }", "@Override\n\tpublic int delRFunc(int roleid) throws Exception {\n\t\treturn froleMapper.delRFunc(roleid);\n\t}", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public IBusinessObject removeFromRole(IIID useriid, IIID roleiid)\n throws OculusException;", "int deleteByPrimaryKey(T00RolePostKey key);", "public static void removeRoleInListOf(Keycloak keycloak, KeycloakAdminClientConfig keycloakAdminClientConfig, String role, String compositeRole) {\n\n final String clientUuid = keycloak.realm(keycloakAdminClientConfig.getRealm()).clients().findByClientId(keycloakAdminClientConfig.getClientId()).get(0).getId();\n\n final RolesResource rolesResource = keycloak.realm(keycloakAdminClientConfig.getRealm()).clients().get(clientUuid).roles();\n\n final RoleResource compositeRoleResource = rolesResource.get(compositeRole);\n\n try {\n final RoleRepresentation roleToDelete = rolesResource.get(role).toRepresentation();\n compositeRoleResource.getRoleComposites().remove(roleToDelete);\n\n } catch (NotFoundException e) {\n log.warn(\"Role {} does not exists!\", role);\n }\n }", "int deleteByRoleIdList(@Param(\"roleIdList\") List<Long> roleIdList);", "int deleteByExample(TawRoleDomainExample example);", "int deleteByExample(UUserRoleExample example);", "public void removeRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"User [ Anonymous ] has no roles\");\r\n }", "public void delete(Integer idRol);", "public Builder clearRole() {\n if (roleBuilder_ == null) {\n role_ = null;\n onChanged();\n } else {\n roleBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x00000002);\n return this;\n }", "@Override\n\tpublic void updateRole(Role role) {\n\t\tthis.roleMapper.updateByPrimaryKey(role);\n\t}", "public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearRole() {\n role = null;\n fieldSetFlags()[6] = false;\n return this;\n }", "@Override\r\n\tpublic void updateRole(Role role) {\n\t\troleDao.updateRole(role);\r\n\t}", "int deleteByPrimaryKey(TawRoleDomainKey key);", "@Override\n\tpublic Rol delete(Rol p) {\n\t\tdao.delete(p);\n\t\treturn null;\n\t}", "public void setRole(String role) {\r\n\t\tthis.role = role;\r\n\t}", "int deleteByExample(SystemRoleUserMapperExample example);", "public void setRole(String role) {\n\t\tthis.role = role;\n\t}", "@Override\n\tpublic void editRole(Role role) {\n\t\trd.editRole(role);\n\t}", "@Override\r\n\tpublic int updRole(Role role) {\n\t\treturn 0;\r\n\t}", "@POST\n @Path(\"DeleteAllRolePermissions/{roleId : [1-9][0-9]*}/{gameModelId}\")\n public boolean deleteAllRolePermissions(@PathParam(\"roleId\") Long roleId,\n @PathParam(\"gameModelId\") String id) {\n\n checkGmOrGPermission(id, \"GameModel:Edit:\", \"Game:Edit:\");\n\n return this.userFacade.deleteRolePermissionsByIdAndInstance(roleId, id);\n }", "public void setRole(java.lang.String value) {\n this.role = value;\n }", "public int deleteByExample(SysRoleMenuExample example) throws SQLException {\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByExample\", example);\r\n return rows;\r\n }" ]
[ "0.7925964", "0.78018844", "0.7699577", "0.75962865", "0.7516469", "0.7501005", "0.74694824", "0.7453181", "0.73355937", "0.72136754", "0.71697265", "0.71616286", "0.71616286", "0.70951456", "0.70038015", "0.7003146", "0.6996362", "0.6941467", "0.69273806", "0.6910364", "0.69088805", "0.6896354", "0.68327284", "0.6821222", "0.6792963", "0.6731789", "0.6728843", "0.6694741", "0.6674621", "0.6604339", "0.6541473", "0.65255225", "0.6427031", "0.6386697", "0.6382604", "0.6366045", "0.63231725", "0.6261498", "0.62481993", "0.62379783", "0.6201657", "0.61902916", "0.61827296", "0.6155398", "0.6142827", "0.61360824", "0.6109968", "0.60860205", "0.6080172", "0.6068313", "0.60625035", "0.6040167", "0.59781957", "0.5963186", "0.59479076", "0.5944583", "0.58788246", "0.58778334", "0.5851199", "0.5847129", "0.58002", "0.5795663", "0.5785485", "0.5783461", "0.5765143", "0.5756419", "0.5741851", "0.5734619", "0.57271415", "0.5689844", "0.56571853", "0.56571853", "0.56470376", "0.56406575", "0.5634359", "0.55956674", "0.5594974", "0.5587979", "0.557893", "0.55763674", "0.55734926", "0.55458724", "0.5542065", "0.5537863", "0.552313", "0.552291", "0.55210185", "0.55172765", "0.5516792", "0.550473", "0.54935426", "0.54888093", "0.5487614", "0.54872763", "0.5483299", "0.5472031", "0.54684407", "0.5466951", "0.5449626", "0.5440443" ]
0.68639314
22
Deletes an existing user.
public DeleteUserResponse deleteUser(DeleteUserRequest request) throws GPUdbException { DeleteUserResponse actualResponse_ = new DeleteUserResponse(); submitRequest("/delete/user", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteUser(User userToDelete) throws Exception;", "public void deleteUser(User user) {\n\t\tdelete(user);\r\n\t}", "void deleteUserById(Long id);", "public void deleteUser(User user) {\n update(\"DELETE FROM user WHERE id = ?\",\n new Object[] {user.getId()});\n }", "public void delete(User user){\n userRepository.delete(user);\n }", "public void deleteUser(int id) {\n\t\tuserRepository.delete(id);\r\n\t}", "public void deleteUser(final Long id) {\n userRepository.deleteById(id);\n }", "@Override\n public boolean deleteUser(User user) {\n return controller.deleteUser(user);\n }", "void deleteUserById(Integer id);", "public void deleteUser(int id) {\r\n userRepo.deleteById(id);\r\n }", "public void delete(User user) {\n repository.delete(user);\n }", "@PostMapping(\"/authenticate/delete/user\")\n\tpublic ResponseEntity<?> deleteUser(@RequestBody DeleteUserRequest deleteUserRequest) throws Exception {\n\n\t\tRegisterUserResponse response = new RegisterUserResponse();\n\n\t\tuserRepository.deleteById(deleteUserRequest.getUserId());\n\n\t\treturn ResponseEntity.ok(response);\n\t}", "@Override\r\n\tpublic void delete(User user) {\n\t\tuserDao.delete(user);\r\n\t}", "public void delete(User user) {\n\t\tuserDao.delete(user);\n\t}", "public void deleteUser(User user) {\r\n\t\tusersPersistence.deleteUser(user);\r\n\t}", "public void deleteUser(String name);", "public void deleteUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USER, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }", "@Override\n\tpublic void deleteUser(User user) {\n\t\tiUserDao.deleteUser(user);\n\t}", "public void deleteUser(User user) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().delete(user);\t\r\n\t\t\r\n\t}", "DeleteUserResult deleteUser(DeleteUserRequest deleteUserRequest);", "public void deleteUser(long id){\n userRepository.deleteById(id);\n }", "public boolean delete(User user);", "public void deleteUser(Integer id) throws BadRequestException;", "public String deleteUser(){\n\t\tusersservice.delete(usersId);\n\t\treturn \"Success\";\n\t}", "@Override\n\tpublic int deleteUser(Integer id) {\n\t\treturn userDao.deleteUser(id);\n\t}", "public void deleteUserById(Long userId);", "@Override\n\tpublic int delete(Users user) {\n\t\t\n\t\treturn userDAO.delete(user);\n\t}", "@Override\n\tpublic void delete(User user)\n\t{\n\t\tuserDAO.delete(user);\n\t}", "void deleteUser(String userId);", "@Override\n\tpublic void deleteUser(int id) {\n\t\tuserMapper.deleteUser(id);\n\t}", "@Override\r\n\tpublic int deleteUser(Users user) {\n\t\treturn 0;\r\n\t}", "public void deleteUser(User u) {\n\t\tuserRepository.delete(u);\n\t}", "public void deleteUser(Integer uid);", "public void deleteUser(String username);", "public void deleteUser(long userId);", "@Override\n\tpublic void deleteUser(int userId) {\n\t\tuserDao.deleteUser(userId);\n\t}", "@Override\n\tpublic void deleteUser(User user)\n\t{\n\n\t}", "public void deleteUser(int id) {\n\t\tet.begin();\n\t\tem.remove(em.find(User.class, id));\n\t\tet.commit();\n\t}", "void deleteUser(User user, String token) throws AuthenticationException;", "@Override\r\n\tpublic int delete(int id) {\n\t\treturn userDAO.DeleteUser(id);\r\n\t}", "public User delete(String user);", "public void deleteUser(int id){\r\n\t\tconfigDao.deleteUserById(id);\r\n\t}", "@Override\n\tpublic void deleteUser(User user) {\n\t\topenSession().createQuery(\"DELETE FROM User where userId =\" + user.getUserId()).executeUpdate();\n\t\t\n\t}", "public void deleteUser(user user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_NAME, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }", "@Override\n\tpublic void deleteUser(Long userId) {\n\t\tusersRepo.deleteById(userId);\n\n\t}", "@DeleteMapping(\"/user/{id}\")\n\tpublic ResponseEntity<User> deleteUser(@PathVariable(\"id\") int id) {\n\t\tUser currentUser = userDao.getUserById(id);\n\t\tif (currentUser == null) {\n\t\t\treturn new ResponseEntity<User>(HttpStatus.NOT_FOUND);\n\t\t} else {\n\n\t\t\tuserDao.delete(currentUser);\n\t\t\treturn new ResponseEntity<User>(HttpStatus.NO_CONTENT);\n\t\t}\n\n\t}", "@Override\n public void delete(User user) {\n dao.delete(user);\n }", "void deleteUser(int id);", "boolean delete(User user);", "public void deleteUser(String username) {\n profile.deleteUser(username);\n }", "@Override\n\tpublic void delete_User(String user_id) {\n\t\tuserInfoDao.delete_User(user_id);\n\t}", "public void deleteUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk deleteUser\");\r\n\t}", "@Override\r\n\tpublic int deleteUser(String userId) {\n\t\treturn userMapper.deleteUser(userId);\r\n\t}", "public void deleteUserById(int id){\n userListCtrl.deleteUser(id);\n }", "void delete(User user);", "void delete(User user);", "@Override\n\tpublic void deleteUser(String id) throws Exception {\n\t\t\n\t}", "public void deleteUser(Integer id) {\n UserModel userModel;\n try {\n userModel = userRepository.findById(id).orElseThrow(IOException::new);\n }\n catch (IOException e) {\n System.out.println(\"User not found\");\n userModel = null;\n }\n userRepository.delete(userModel);\n }", "void deleteUser(String deleteUserId);", "public int deleteUser(int id) {\n\t\treturn userMapper.deleteUser(id);\r\n\t}", "@Override\n\tpublic void deleteOne(User u) {\n\t\tdao.deleteOne(u);\n\t}", "void deleteUser(String username) throws UserDaoException;", "void deleteUser( String username );", "@Override\n public boolean deleteUser(User user) {\n return false;\n }", "@Override\r\n\tpublic void deleteByUser(User user) {\n\t\tuserReposotory.delete(user);\r\n\t}", "public User delete(User user);", "@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n\t@RequestMapping(value = \"/users/{id}\", method = RequestMethod.DELETE)\n\tpublic ResponseEntity<AppUser> deleteUser(@PathVariable Long id) {\n\t\tAppUser appUser = appUserRepository.findOne(id);\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tString loggedUsername = auth.getName();\n\t\tif (appUser == null) {\n\t\t\treturn new ResponseEntity<AppUser>(HttpStatus.NO_CONTENT);\n\t\t} else if (appUser.getUsername().equalsIgnoreCase(loggedUsername)) {\n\t\t\tthrow new RuntimeException(\"You cannot delete your account\");\n\t\t} else {\n\t\t\tappUserRepository.delete(appUser);\n\t\t\treturn new ResponseEntity<AppUser>(appUser, HttpStatus.OK);\n\t\t}\n\n\t}", "public Boolean DeleteUser(User user){\n\t\t\treturn null;\n\t\t}", "public void removeUser(){\n googleId_ = User.getDeletedUserGoogleID();\n this.addToDB(DBUtility.get().getDb_());\n }", "public void delete(User u) {\n\t\tUserDao ua=new UserDao();\n\t\tua.delete(u);\n\t\t\n\t}", "@DeleteMapping(\"/users/{id}\")\n\tpublic void deleteUser(@PathVariable int id) {\n\t\tuserService.deleteById(id);\n\t\t\n\t\t\n\t}", "@Override\n\tpublic Boolean deleteUser(User user) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void deleteUser(user theUser) {\n\t\t\n\t}", "@Override\r\n\tpublic int deleteByPrimaryKey(Integer id) {\n\t\treturn userDao.deleteByPrimaryKey(id);\r\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic User deleteUser(Long userId) throws MyUserException {\n\t\treturn userDao.deleteUser(userId);\r\n\t}", "@Override\n\tpublic int deleteByPrimaryKey(Integer id) {\n\t\treturn userMapper.deleteByPrimaryKey(id);\n\t}", "public void deleteUser(Long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\trepository.deleteById(id);\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\t}", "public void deleteUser(String userId) {\n deleteUser(getUser(userId));\n }", "public void deleteUserRecord() {\n\t\tSystem.out.println(\"Calling deleteUserRecord() Method To Delete User Record\");\n\t\tuserDAO.deleteUser(user);\n\t}", "@Override\n\tpublic void deleteUserById(Integer id) {\n\n\t}", "public void delete() throws NotFoundException {\n\tUserDA.delete(this);\n }", "@Override\n\tpublic int delete(int uid) {\n\t\treturn new userDaoImpl().delete(uid);\n\t}", "@Override\r\n\tpublic void delete(int userId) {\n\t\ttheUserRepository.deleteById(userId);\r\n\t}", "public void deleteUser(String id) {\n\t\tSystem.out.println(\"deleteUser\");\n\t\t personDAO.deleteUser(id);\n\t}", "@Override\n\tpublic ApplicationResponse deleteUser(String id) {\n\t\tOptional<UserEntity> userEntity = repository.findById(id);\n\t\tif (userEntity.isPresent()) {\n\t\t\trepository.deleteById(id);\n\t\t\treturn new ApplicationResponse(true, \"Success\", null);\n\t\t} else {\n\t\t\tthrow new UserNotFoundException(\"User not found\");\n\t\t}\n\t}", "@Override\r\n\tpublic boolean delUser(user user) {\n\t\tif(userdao.deleteByPrimaryKey(user.gettUserid())==1){\r\n\t\t\treturn true;}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}", "@Override\r\n\tpublic void delete(User user) {\n\t\tint iRet = dao.delete(user);\r\n\t\tif(iRet != 1){\r\n\t\t\tlogger.error(\"删除失败\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"删除成功\");\r\n\t}", "public void deleteUser(Userlist user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USERLIST, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getID())});\n db.close();\n }", "public void deleteUser(View v){\n Boolean deleteSucceeded = null;\n\n int userId = users.get(userSpinner.getSelectedItemPosition() - 1).getId();\n\n // Delete user from database\n deleteSucceeded = udbHelper.deleteUser(userId);\n\n String message = \"\";\n if(deleteSucceeded){\n message = \"Successfully removed user with id {\" + userId + \"} from database!\";\n }\n else {\n message = \"Failed to save user!\";\n }\n Toast.makeText(ManageAccountsActivity.this, message, Toast.LENGTH_LONG).show();\n\n reloadUserLists();\n }", "@Override\r\n\tpublic int delete(User user) {\n\t\treturn 0;\r\n\t}", "@RolesAllowed(\"admin\")\n @DELETE\n public Response delete() {\n synchronized (Database.users) {\n User user = Database.users.remove(username);\n if (user == null) {\n return Response.status(404).\n type(\"text/plain\").\n entity(\"User '\" + username + \"' not found\\r\\n\").\n build();\n } else {\n Database.usersUpdated = new Date();\n synchronized (Database.contacts) {\n Database.contacts.remove(username);\n }\n }\n }\n return Response.ok().build();\n }", "public void delete(User usuario);", "public int delete(Long userId) {\n LOGGER.debug(\"delete a User\");\n Session s = getSession();\n Query query = s.createQuery(\"delete User where id = :ID\");\n query.setParameter(\"ID\", userId);\n int result = query.executeUpdate();\n return result;\n }", "@Override\n\tpublic void deleteUser() {\n\t\tLog.d(\"HFModuleManager\", \"deleteUser\");\n\t}", "@Override\r\n\tpublic void deleteByIdUser(int id) {\n\t\tuserReposotory.deleteById(id);\r\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\tuserDao.delete(id);\n\t}", "public void delete(User user)throws Exception;", "@Override\n\tpublic void delete(String id) {\n\t\tuserDao.delete(id);\n\t\t\n\t}", "@Override\r\n\tpublic void delete(UserMain user) {\n\t\tusermaindao.delete(user);\r\n\t}", "@Override\r\n\tpublic boolean delete(int id) {\r\n\t\treturn executeAndIsModified(DELETE_USER, id);\r\n\t}" ]
[ "0.77059376", "0.7684148", "0.7668088", "0.7587115", "0.7565009", "0.7561611", "0.755137", "0.7548753", "0.75481045", "0.75429046", "0.7542709", "0.7540529", "0.753833", "0.75360316", "0.75054574", "0.74972236", "0.74677455", "0.7458433", "0.7447916", "0.7446287", "0.7436894", "0.74259067", "0.7424685", "0.7422991", "0.7402939", "0.7368606", "0.7361231", "0.7360172", "0.7355476", "0.73520225", "0.73508245", "0.732975", "0.73168325", "0.73128057", "0.7308611", "0.7290849", "0.7286858", "0.7282921", "0.7278799", "0.7275905", "0.7273478", "0.72509134", "0.7248206", "0.7247182", "0.7229862", "0.72251564", "0.72140795", "0.7206464", "0.72053", "0.7204291", "0.7189891", "0.71861494", "0.7185302", "0.71783394", "0.71719706", "0.71719706", "0.71658325", "0.7152846", "0.7151088", "0.7124915", "0.7118255", "0.7101122", "0.70997524", "0.7087505", "0.7077352", "0.7071711", "0.70597064", "0.7049968", "0.7043098", "0.70352554", "0.70333475", "0.7028196", "0.7024486", "0.70185494", "0.701499", "0.70067716", "0.7005605", "0.6998656", "0.69676846", "0.6962874", "0.6961791", "0.69586617", "0.6958309", "0.6955557", "0.6946705", "0.69443923", "0.6937648", "0.69344014", "0.69204116", "0.6916867", "0.6915129", "0.69061494", "0.690475", "0.6893128", "0.6888905", "0.6878923", "0.68686306", "0.6859258", "0.68556994", "0.6850296" ]
0.7416985
24
Deletes an existing user.
public DeleteUserResponse deleteUser(String name, Map<String, String> options) throws GPUdbException { DeleteUserRequest actualRequest_ = new DeleteUserRequest(name, options); DeleteUserResponse actualResponse_ = new DeleteUserResponse(); submitRequest("/delete/user", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteUser(User userToDelete) throws Exception;", "public void deleteUser(User user) {\n\t\tdelete(user);\r\n\t}", "void deleteUserById(Long id);", "public void deleteUser(User user) {\n update(\"DELETE FROM user WHERE id = ?\",\n new Object[] {user.getId()});\n }", "public void delete(User user){\n userRepository.delete(user);\n }", "public void deleteUser(int id) {\n\t\tuserRepository.delete(id);\r\n\t}", "public void deleteUser(final Long id) {\n userRepository.deleteById(id);\n }", "@Override\n public boolean deleteUser(User user) {\n return controller.deleteUser(user);\n }", "void deleteUserById(Integer id);", "public void deleteUser(int id) {\r\n userRepo.deleteById(id);\r\n }", "public void delete(User user) {\n repository.delete(user);\n }", "@PostMapping(\"/authenticate/delete/user\")\n\tpublic ResponseEntity<?> deleteUser(@RequestBody DeleteUserRequest deleteUserRequest) throws Exception {\n\n\t\tRegisterUserResponse response = new RegisterUserResponse();\n\n\t\tuserRepository.deleteById(deleteUserRequest.getUserId());\n\n\t\treturn ResponseEntity.ok(response);\n\t}", "@Override\r\n\tpublic void delete(User user) {\n\t\tuserDao.delete(user);\r\n\t}", "public void delete(User user) {\n\t\tuserDao.delete(user);\n\t}", "public void deleteUser(User user) {\r\n\t\tusersPersistence.deleteUser(user);\r\n\t}", "public void deleteUser(String name);", "public void deleteUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USER, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }", "@Override\n\tpublic void deleteUser(User user) {\n\t\tiUserDao.deleteUser(user);\n\t}", "public void deleteUser(User user) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().delete(user);\t\r\n\t\t\r\n\t}", "DeleteUserResult deleteUser(DeleteUserRequest deleteUserRequest);", "public void deleteUser(long id){\n userRepository.deleteById(id);\n }", "public boolean delete(User user);", "public void deleteUser(Integer id) throws BadRequestException;", "public String deleteUser(){\n\t\tusersservice.delete(usersId);\n\t\treturn \"Success\";\n\t}", "public DeleteUserResponse deleteUser(DeleteUserRequest request) throws GPUdbException {\n DeleteUserResponse actualResponse_ = new DeleteUserResponse();\n submitRequest(\"/delete/user\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n\tpublic int deleteUser(Integer id) {\n\t\treturn userDao.deleteUser(id);\n\t}", "public void deleteUserById(Long userId);", "@Override\n\tpublic int delete(Users user) {\n\t\t\n\t\treturn userDAO.delete(user);\n\t}", "@Override\n\tpublic void delete(User user)\n\t{\n\t\tuserDAO.delete(user);\n\t}", "void deleteUser(String userId);", "@Override\n\tpublic void deleteUser(int id) {\n\t\tuserMapper.deleteUser(id);\n\t}", "@Override\r\n\tpublic int deleteUser(Users user) {\n\t\treturn 0;\r\n\t}", "public void deleteUser(User u) {\n\t\tuserRepository.delete(u);\n\t}", "public void deleteUser(Integer uid);", "public void deleteUser(String username);", "public void deleteUser(long userId);", "@Override\n\tpublic void deleteUser(int userId) {\n\t\tuserDao.deleteUser(userId);\n\t}", "@Override\n\tpublic void deleteUser(User user)\n\t{\n\n\t}", "public void deleteUser(int id) {\n\t\tet.begin();\n\t\tem.remove(em.find(User.class, id));\n\t\tet.commit();\n\t}", "void deleteUser(User user, String token) throws AuthenticationException;", "@Override\r\n\tpublic int delete(int id) {\n\t\treturn userDAO.DeleteUser(id);\r\n\t}", "public User delete(String user);", "public void deleteUser(int id){\r\n\t\tconfigDao.deleteUserById(id);\r\n\t}", "@Override\n\tpublic void deleteUser(User user) {\n\t\topenSession().createQuery(\"DELETE FROM User where userId =\" + user.getUserId()).executeUpdate();\n\t\t\n\t}", "public void deleteUser(user user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_NAME, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }", "@Override\n\tpublic void deleteUser(Long userId) {\n\t\tusersRepo.deleteById(userId);\n\n\t}", "@DeleteMapping(\"/user/{id}\")\n\tpublic ResponseEntity<User> deleteUser(@PathVariable(\"id\") int id) {\n\t\tUser currentUser = userDao.getUserById(id);\n\t\tif (currentUser == null) {\n\t\t\treturn new ResponseEntity<User>(HttpStatus.NOT_FOUND);\n\t\t} else {\n\n\t\t\tuserDao.delete(currentUser);\n\t\t\treturn new ResponseEntity<User>(HttpStatus.NO_CONTENT);\n\t\t}\n\n\t}", "@Override\n public void delete(User user) {\n dao.delete(user);\n }", "void deleteUser(int id);", "boolean delete(User user);", "public void deleteUser(String username) {\n profile.deleteUser(username);\n }", "@Override\n\tpublic void delete_User(String user_id) {\n\t\tuserInfoDao.delete_User(user_id);\n\t}", "public void deleteUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk deleteUser\");\r\n\t}", "@Override\r\n\tpublic int deleteUser(String userId) {\n\t\treturn userMapper.deleteUser(userId);\r\n\t}", "public void deleteUserById(int id){\n userListCtrl.deleteUser(id);\n }", "void delete(User user);", "void delete(User user);", "@Override\n\tpublic void deleteUser(String id) throws Exception {\n\t\t\n\t}", "public void deleteUser(Integer id) {\n UserModel userModel;\n try {\n userModel = userRepository.findById(id).orElseThrow(IOException::new);\n }\n catch (IOException e) {\n System.out.println(\"User not found\");\n userModel = null;\n }\n userRepository.delete(userModel);\n }", "void deleteUser(String deleteUserId);", "public int deleteUser(int id) {\n\t\treturn userMapper.deleteUser(id);\r\n\t}", "@Override\n\tpublic void deleteOne(User u) {\n\t\tdao.deleteOne(u);\n\t}", "void deleteUser(String username) throws UserDaoException;", "void deleteUser( String username );", "@Override\n public boolean deleteUser(User user) {\n return false;\n }", "@Override\r\n\tpublic void deleteByUser(User user) {\n\t\tuserReposotory.delete(user);\r\n\t}", "public User delete(User user);", "@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n\t@RequestMapping(value = \"/users/{id}\", method = RequestMethod.DELETE)\n\tpublic ResponseEntity<AppUser> deleteUser(@PathVariable Long id) {\n\t\tAppUser appUser = appUserRepository.findOne(id);\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tString loggedUsername = auth.getName();\n\t\tif (appUser == null) {\n\t\t\treturn new ResponseEntity<AppUser>(HttpStatus.NO_CONTENT);\n\t\t} else if (appUser.getUsername().equalsIgnoreCase(loggedUsername)) {\n\t\t\tthrow new RuntimeException(\"You cannot delete your account\");\n\t\t} else {\n\t\t\tappUserRepository.delete(appUser);\n\t\t\treturn new ResponseEntity<AppUser>(appUser, HttpStatus.OK);\n\t\t}\n\n\t}", "public Boolean DeleteUser(User user){\n\t\t\treturn null;\n\t\t}", "public void removeUser(){\n googleId_ = User.getDeletedUserGoogleID();\n this.addToDB(DBUtility.get().getDb_());\n }", "public void delete(User u) {\n\t\tUserDao ua=new UserDao();\n\t\tua.delete(u);\n\t\t\n\t}", "@DeleteMapping(\"/users/{id}\")\n\tpublic void deleteUser(@PathVariable int id) {\n\t\tuserService.deleteById(id);\n\t\t\n\t\t\n\t}", "@Override\n\tpublic Boolean deleteUser(User user) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void deleteUser(user theUser) {\n\t\t\n\t}", "@Override\r\n\tpublic int deleteByPrimaryKey(Integer id) {\n\t\treturn userDao.deleteByPrimaryKey(id);\r\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic User deleteUser(Long userId) throws MyUserException {\n\t\treturn userDao.deleteUser(userId);\r\n\t}", "@Override\n\tpublic int deleteByPrimaryKey(Integer id) {\n\t\treturn userMapper.deleteByPrimaryKey(id);\n\t}", "public void deleteUser(Long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\trepository.deleteById(id);\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\t}", "public void deleteUser(String userId) {\n deleteUser(getUser(userId));\n }", "public void deleteUserRecord() {\n\t\tSystem.out.println(\"Calling deleteUserRecord() Method To Delete User Record\");\n\t\tuserDAO.deleteUser(user);\n\t}", "@Override\n\tpublic void deleteUserById(Integer id) {\n\n\t}", "public void delete() throws NotFoundException {\n\tUserDA.delete(this);\n }", "@Override\n\tpublic int delete(int uid) {\n\t\treturn new userDaoImpl().delete(uid);\n\t}", "@Override\r\n\tpublic void delete(int userId) {\n\t\ttheUserRepository.deleteById(userId);\r\n\t}", "public void deleteUser(String id) {\n\t\tSystem.out.println(\"deleteUser\");\n\t\t personDAO.deleteUser(id);\n\t}", "@Override\n\tpublic ApplicationResponse deleteUser(String id) {\n\t\tOptional<UserEntity> userEntity = repository.findById(id);\n\t\tif (userEntity.isPresent()) {\n\t\t\trepository.deleteById(id);\n\t\t\treturn new ApplicationResponse(true, \"Success\", null);\n\t\t} else {\n\t\t\tthrow new UserNotFoundException(\"User not found\");\n\t\t}\n\t}", "@Override\r\n\tpublic boolean delUser(user user) {\n\t\tif(userdao.deleteByPrimaryKey(user.gettUserid())==1){\r\n\t\t\treturn true;}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}", "@Override\r\n\tpublic void delete(User user) {\n\t\tint iRet = dao.delete(user);\r\n\t\tif(iRet != 1){\r\n\t\t\tlogger.error(\"删除失败\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"删除成功\");\r\n\t}", "public void deleteUser(Userlist user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USERLIST, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getID())});\n db.close();\n }", "public void deleteUser(View v){\n Boolean deleteSucceeded = null;\n\n int userId = users.get(userSpinner.getSelectedItemPosition() - 1).getId();\n\n // Delete user from database\n deleteSucceeded = udbHelper.deleteUser(userId);\n\n String message = \"\";\n if(deleteSucceeded){\n message = \"Successfully removed user with id {\" + userId + \"} from database!\";\n }\n else {\n message = \"Failed to save user!\";\n }\n Toast.makeText(ManageAccountsActivity.this, message, Toast.LENGTH_LONG).show();\n\n reloadUserLists();\n }", "@Override\r\n\tpublic int delete(User user) {\n\t\treturn 0;\r\n\t}", "@RolesAllowed(\"admin\")\n @DELETE\n public Response delete() {\n synchronized (Database.users) {\n User user = Database.users.remove(username);\n if (user == null) {\n return Response.status(404).\n type(\"text/plain\").\n entity(\"User '\" + username + \"' not found\\r\\n\").\n build();\n } else {\n Database.usersUpdated = new Date();\n synchronized (Database.contacts) {\n Database.contacts.remove(username);\n }\n }\n }\n return Response.ok().build();\n }", "public void delete(User usuario);", "public int delete(Long userId) {\n LOGGER.debug(\"delete a User\");\n Session s = getSession();\n Query query = s.createQuery(\"delete User where id = :ID\");\n query.setParameter(\"ID\", userId);\n int result = query.executeUpdate();\n return result;\n }", "@Override\n\tpublic void deleteUser() {\n\t\tLog.d(\"HFModuleManager\", \"deleteUser\");\n\t}", "@Override\r\n\tpublic void deleteByIdUser(int id) {\n\t\tuserReposotory.deleteById(id);\r\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\tuserDao.delete(id);\n\t}", "public void delete(User user)throws Exception;", "@Override\n\tpublic void delete(String id) {\n\t\tuserDao.delete(id);\n\t\t\n\t}", "@Override\r\n\tpublic void delete(UserMain user) {\n\t\tusermaindao.delete(user);\r\n\t}", "@Override\r\n\tpublic boolean delete(int id) {\r\n\t\treturn executeAndIsModified(DELETE_USER, id);\r\n\t}" ]
[ "0.77059376", "0.7684148", "0.7668088", "0.7587115", "0.7565009", "0.7561611", "0.755137", "0.7548753", "0.75481045", "0.75429046", "0.7542709", "0.7540529", "0.753833", "0.75360316", "0.75054574", "0.74972236", "0.74677455", "0.7458433", "0.7447916", "0.7446287", "0.7436894", "0.74259067", "0.7424685", "0.7422991", "0.7416985", "0.7402939", "0.7368606", "0.7361231", "0.7360172", "0.7355476", "0.73520225", "0.73508245", "0.732975", "0.73168325", "0.73128057", "0.7308611", "0.7290849", "0.7286858", "0.7282921", "0.7278799", "0.7275905", "0.7273478", "0.72509134", "0.7248206", "0.7247182", "0.7229862", "0.72251564", "0.72140795", "0.7206464", "0.72053", "0.7204291", "0.7189891", "0.71861494", "0.7185302", "0.71783394", "0.71719706", "0.71719706", "0.71658325", "0.7152846", "0.7151088", "0.7124915", "0.7118255", "0.7101122", "0.70997524", "0.7087505", "0.7077352", "0.7071711", "0.70597064", "0.7049968", "0.7043098", "0.70352554", "0.70333475", "0.7028196", "0.7024486", "0.70185494", "0.701499", "0.70067716", "0.7005605", "0.6998656", "0.69676846", "0.6962874", "0.6961791", "0.69586617", "0.6958309", "0.6955557", "0.6946705", "0.69443923", "0.6937648", "0.69344014", "0.69204116", "0.6916867", "0.6915129", "0.69061494", "0.690475", "0.6893128", "0.6888905", "0.6878923", "0.68686306", "0.6859258", "0.68556994", "0.6850296" ]
0.0
-1
Executes a proc. This endpoint is asynchronous and does not wait for the proc to complete before returning.
public ExecuteProcResponse executeProc(ExecuteProcRequest request) throws GPUdbException { ExecuteProcResponse actualResponse_ = new ExecuteProcResponse(); submitRequest("/execute/proc", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "<T> AsyncResult<T> startProcess(Callable<T> task, AsyncCallback<T> callback);", "<T> AsyncResult<T> startProcess(Callable<T> task);", "@Override\n\t@Transactional\n\tpublic void callProc(String proc, List<String> paras) {\n\t\tSession session = getHibernateTemplate().getSessionFactory().openSession();\n\t\t// Transaction tx = session.beginTransaction();\n\t\tSQLQuery q = session.createSQLQuery(\"{call \" + proc + \" }\");\n\t\tif (paras != null) {\n\t\t\tint i = 0;\n\t\t\tfor (String para : paras) {\n\t\t\t\tq.setString(i++, para);\n\t\t\t}\n\t\t}\n\t\tq.executeUpdate();\n\n\t}", "@SuppressWarnings(\"rawtypes\")\n private void synchronousInvokeCallback(Callable call) {\n\n Future future = streamingSlopResults.submit(call);\n\n try {\n future.get();\n\n } catch(InterruptedException e1) {\n\n logger.error(\"Callback failed\", e1);\n throw new VoldemortException(\"Callback failed\");\n\n } catch(ExecutionException e1) {\n\n logger.error(\"Callback failed during execution\", e1);\n throw new VoldemortException(\"Callback failed during execution\");\n }\n\n }", "@Override\n\t@Transactional\n\tpublic List callProcR(String proc, List<String> paras) {\n\t\tSession session = getHibernateTemplate().getSessionFactory().openSession();\n\t\t// Transaction tx = session.beginTransaction();\n\t\tSQLQuery q = session.createSQLQuery(\"{call \" + proc + \"(?) }\");\n\t\tif (paras != null) {\n\t\t\tint i = 0;\n\t\t\tfor (String para : paras) {\n\t\t\t\tq.setString(i++, para);\n\t\t\t}\n\t\t}\n\t\treturn q.list();\n\n\t}", "ExecutionResult<Void> execute();", "public void execute() {\n\t\t/* Create a new thread and kick it off */\n\t\tThread tempThread = new Thread(exec, \"ROSpec Executer\");\n\t\ttempThread.start();\n\t}", "public void execute() {\n\t\tlaunch();\n\t}", "R execute();", "public final void asyncExec( int outputs, Frame fr, boolean run_local){\n // Use first readable vector to gate home/not-home\n fr.checkCompatible(); // Check for compatible vectors\n if((_noutputs = outputs) > 0) _vid = fr.anyVec().group().reserveKeys(outputs);\n _fr = fr; // Record vectors to work on\n _nxx = (short)H2O.SELF.index(); _nhi = (short)H2O.CLOUD.size(); // Do Whole Cloud\n _run_local = run_local; // Run locally by copying data, or run globally?\n setupLocal0(); // Local setup\n H2O.submitTask(this); // Begin normal execution on a FJ thread\n }", "public TaskReturnType Run();", "public abstract List<C_result> processJob(C_request processing_cmd);", "protected final Object execute(String procedure) throws ExecutionException {\n if (parser == null) throw new ExecutionException(\"Parser not found!\");\n parser.parseExpression(procedure);\n return parser.getValueAsObject();\n }", "Future_<V> submit(Callable_<V> task);", "ProcedureCall createProcedureCall();", "public RunProcDefJob() {\n\t}", "public void executeASync (ProcessInfo pi)\r\n\t {\r\n\t }", "Future<Object> execCmd(byte[] cmd, byte[]... params);", "@SuppressWarnings(\"unchecked\")\n public <T> T execute() {\n return (T) fetchResponse(getCallToExecute());\n }", "public Promise<Void> execute() {\n\t\tcheckInReactorThread(this);\n\t\tMap<Partition, List<Node>> nodesByPartition = getNodesByPartition();\n\t\tlong taskId = ThreadLocalRandom.current().nextInt() & (Integer.MAX_VALUE >>> 1);\n\t\treturn connect(nodesByPartition.keySet())\n\t\t\t.then(sessions ->\n\t\t\t\tPromises.all(\n\t\t\t\t\t\tsessions.stream()\n\t\t\t\t\t\t\t.map(session -> session.execute(taskId, nodesByPartition.get(session.partition))))\n\t\t\t\t\t.whenException(() -> sessions.forEach(PartitionSession::close)));\n\t}", "public String execute(){\r\n\t\t\r\n\t\tString resultHtml = null;\r\n\t\tdebug(1,\"jsrpc start...\"+screenName+\" \"+rpcid); \r\n\t\tHashMap hm = jsrpcProcessBL(screenName);\r\n\t\tJSONObject jobj = new JSONObject(hm);\r\n\t\tresultHtml = jobj.toString();\r\n\t\tdebug(1,\"json result:\"+resultHtml);\r\n\t\tinputStream = new StringBufferInputStream(resultHtml);\r\n\t\treturn SUCCESS;\r\n\t}", "public void exec();", "public void run() {\n try {\n System.out.println(\"Calling Process\");\n processRequest();\n\n } catch (Exception e) {\n System.out.println(\"Run Exception\" + e);\n }\n\n }", "private String exec(String cmd, File ws, String errorMessage) throws IOException, ProcessingException {\n listener.info(\"Executing: \"+cmd);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n int r = new Proc(cmd, null, baos, ws).join();\n if(r!=0) {\n listener.info(baos.toString());\n throw new ProcessingException(errorMessage);\n }\n return baos.toString();\n }", "protected void execute() {\n\t\t//execution handled by pid thread\n\t}", "public int execute();", "protected final boolean exec() {\n/* 94 */ this.result = compute();\n/* 95 */ return true;\n/* */ }", "<T> CompletableFuture<T> submit(Callable<T> request);", "public CompletableFuture<ClientResponse> run(String procedureNames) {\n\n CatalogContext context = VoltDB.instance().getCatalogContext();\n\n /*\n * TODO: We don't actually support multiple proc names in an ExplainProc call,\n * so I THINK that the string is always a single procname symbol and all this\n * splitting and iterating is a no-op.\n */\n List<String> procNames = SQLLexer.splitStatements(procedureNames).getCompletelyParsedStmts();\n int size = procNames.size();\n VoltTable[] vt = new VoltTable[size];\n\n for (int i = 0; i < size; i++) {\n String procName = procNames.get(i);\n\n // look in the catalog\n Procedure proc = context.procedures.get(procName);\n if (proc == null) {\n // check default procs and send them off to be explained using the regular\n // adhoc explain process\n proc = context.m_defaultProcs.checkForDefaultProcedure(procName);\n if (proc != null) {\n String sql = DefaultProcedureManager.sqlForDefaultProc(proc);\n List<String> sqlStatements = new ArrayList<>(1);\n sqlStatements.add(sql);\n return runNonDDLAdHoc(context,\n sqlStatements,\n true, // infer partitioning\n null, // no partition key\n ExplainMode.EXPLAIN_DEFAULT_PROC,\n false, // not a large query\n false, // not swap tables\n new Object[0]);\n }\n\n return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE,\n \"Procedure \" + procName + \" not in catalog\");\n }\n\n vt[i] = new VoltTable(new VoltTable.ColumnInfo(\"SQL_STATEMENT\", VoltType.STRING),\n new VoltTable.ColumnInfo(\"EXECUTION_PLAN\", VoltType.STRING));\n\n for(Statement stmt : proc.getStatements()) {\n vt[i].addRow(stmt.getSqltext(), Encoder.hexDecodeToString(stmt.getExplainplan()));\n }\n }\n\n ClientResponseImpl response = new ClientResponseImpl(ClientResponseImpl.SUCCESS,\n ClientResponse.UNINITIALIZED_APP_STATUS_CODE,\n null,\n vt,\n null);\n\n CompletableFuture<ClientResponse> fut = new CompletableFuture<>();\n fut.complete(response);\n return fut;\n }", "CompletableFuture<Exchange> asyncSend(Endpoint endpoint, Processor processor);", "public void execute() {\n\n\t}", "public abstract void doExecute(A a, TaskCompletionSource<ResultT> taskCompletionSource) throws RemoteException;", "public void execute() {\n }", "public abstract void submit(Callable callable);", "public void execute();", "public void execute();", "public void execute();", "public void execute();", "public static void main(String[] args) {\n System.out.println(\"Begin\");\n //create().thenAccept(data-> print(data));\n //CompletableFuture<Integer> cFuture=create();\n CompletableFuture<Integer> cFuture=new CompletableFuture<>();\n process(cFuture);\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n cFuture.complete(3);\n System.out.println(\"END\");\n }", "public void Execute() {\n\n }", "public void execute() {\n\t\t\n\t}", "CompletableFuture<Exchange> asyncSend(String endpointUri, Processor processor);", "public void process();", "public void receiveResultexecute(\n loadbalance.LoadBalanceStub.ExecuteResponse result\n ) {\n }", "void execute(final Callback callback);", "public void execute() {\r\n\t\r\n\t}", "@Override\n public byte[] execute() {\n return buildResponse();\n }", "public void execute() {\n if (hasError())\n return;\n\n runLocally();\n runRemotely();\n }", "@JavascriptInterface\n public String invoke(String feature, String action, String rawParams, String callback) {\n String response = mManager.invoke(feature, action, rawParams, callback);\n if (Log.isLoggable(HybridManager.TAG, Log.DEBUG)) {\n Log.d(HybridManager.TAG, \"blocking response is \" + response);\n }\n return response;\n }", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "<T> T endProcess(AsyncResult<T> asyncResult) throws ExecutionException, InterruptedException;", "void execute(Handler handler, Callback callback);", "public void executer(Callback callback){\n exec();\n if(callback != null){\n System.out.println(\" \" +\n \"[ Callback : callback() : 调用回调函数 ]\");\n callback.call();\n }\n }", "public final void run() {\n final long contextID = Nodex.instance.getContextID();\n Runnable runner = new Runnable() {\n public void run() {\n try {\n final T result = execute();\n NodexInternal.instance.executeOnContext(contextID, new Runnable() {\n public void run() {\n completionHandler.onEvent(new Completion(result));\n }\n });\n } catch (final Exception e) {\n NodexInternal.instance.executeOnContext(contextID, new Runnable() {\n public void run() {\n completionHandler.onEvent(new Completion(e));\n }\n });\n } catch (Throwable t) {\n //Not much we can do, just log it\n t.printStackTrace(System.err);\n }\n }\n };\n\n NodexInternal.instance.executeInBackground(runner);\n }", "@Override\n\tpublic Object execute() {\n\n\t\treturn null;\n\t}", "public void process() {\n\n }", "Supplier<TransactionPackage.TxValidationCode> submitAsync();", "public native int execute(String name);", "public interface IBugReportRpcAsync {\r\n\r\n /**\r\n * Submit a bug report.\r\n * @param bugReport Bug report to submit\r\n * @param callback Callback to be invoked after method call completes\r\n */\r\n void submitBugReport(BugReport bugReport, AsyncCallback<Void> callback);\r\n\r\n}", "public void run()\n {\n Process exportProc = null;\n\n try\n {\n exportProc = Runtime.getRuntime().exec( execParams );\n exportProc.waitFor();\n }\n catch( IOException ex )\n {\n statusCode = ExportStatusCode.SCCERR_JAVA_IO_ERROR;\n return;\n }\n catch( InterruptedException ex )\n {\n // We've been interrupted (probably a timeout). Kill the process.\n exportProc.destroy();\n statusCode = ExportStatusCode.SCCERR_JAVA_INTERRUPTED;\n return;\n }\n\n statusCode = new ExportStatusCode( exportProc.exitValue() );\n }", "public void execute(){\n\n }", "CompletionStage<ResponseMessage> invoke(RequestMessage requestMessage);", "public abstract int execute();", "CompletableFuture<CalculationResult> goAsync(GoCommand goCommand);", "public Object doProcess() {\n List<Result> retv = new ArrayList<Result>();\n try {\n current_time = NTPDate.currentTimeMillis();\n current_time_nano = Utils.nanoNow();\n\n try {\n currentProcs = ProcFSUtil.getCurrentProcsHash();\n } catch (Throwable t) {\n if (logger.isLoggable(Level.FINER)) {\n logger.log(Level.FINER, \" [ myMon ] ProcFSUtil.getCurrentProcsHash exc\", t);\n }\n }\n final Result result = getResult();\n if(result != null) {\n result.addSet(\"Max Memory\", Runtime.getRuntime().maxMemory() / MEGABYTE_FACTOR);\n result.addSet(\"Memory\", Runtime.getRuntime().totalMemory() / MEGABYTE_FACTOR);\n result.addSet(\"Free Memory\", Runtime.getRuntime().freeMemory() / MEGABYTE_FACTOR);\n retv.add(result);\n }\n\n Result r = fillMLCPUTimeStats();\n if (r != null)\n retv.add(r);\n\n r = fillParamStats();\n if (r != null)\n retv.add(r);\n\n r = fillProcsStats();\n if (r != null)\n retv.add(r);\n\n if (currentProcs != null && currentProcs.size() > 0) {\n prevProcs = currentProcs;\n }\n\n r = fillPMSStats();\n if (r != null)\n retv.add(r);\n\n r = fillMLLUSHelperStats();\n if (r != null)\n retv.add(r);\n\n r = fillPWStats();\n if (r != null)\n retv.add(r);\n\n r = fillTCWStats();\n if (r != null)\n retv.add(r);\n\n if (IS_MAC) {\n r = fillFromMAC();\n if (r != null)\n retv.add(r);\n }\n } catch (Throwable t) {\n if (logger.isLoggable(Level.FINER)) {\n logger.log(Level.FINER, \"[ myMon ] [ HANDLED ] got ex main loop ... \", t);\n }\n return null;\n } finally {\n last_time_nano = current_time_nano;\n }\n\n currentProcs = null;\n if (logger.isLoggable(Level.FINEST)) {\n logger.log(Level.FINEST, \" [ myMon ] Returning ... \\n\" + retv);\n }\n return retv;\n }", "@Override\n public void execute() {\n Task<Void> task = new Task<Void>() {\n @Override\n protected Void call() throws Exception {\n exportData();\n return null;\n }\n\n @Override\n protected void succeeded(){\n callback.onSuccess();\n super.succeeded();\n }\n\n @Override\n protected void failed(){\n callback.onFail(this.getException());\n super.failed();\n }\n };\n new Thread(task).start();\n }", "public abstract void runProcess();", "CompletableFuture<WriteResponse> submit();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "public void execute(){\n\t\t\n\t}", "<T> T execute(ProducerCallback<K, V, T> callback);", "public void execute() {\n execute0();\n }", "private int runGroovyImpl(Context context, URL groovyNodeUrl, boolean block)\n {\n final String name = URLFileSystem.getName(groovyNodeUrl);\n final GroovyRunProcess process;\n try\n {\n process = new GroovyRunProcess(context, NodeFactory.findOrCreate(GroovyNode.class, groovyNodeUrl), name);\n final Map<Node, Long> timestampMap = new HashMap<Node, Long>();\n NodeUtil.storeAllTimestamps(timestampMap);\n process.setRunProcessListener(new RunProcessListener()\n {\n public void processFinished(int exitCode)\n {\n NodeUtil.reloadBuffers(timestampMap);\n process.setRunProcessListener(null);\n }\n });\n //if (listener != null)\n //{\n // process.setMavenListener(listener);\n //}\n process.start();\n if (block)\n {\n try\n {\n return process.waitUntilFinished();\n }\n catch (InterruptedException ie)\n {\n }\n }\n\n }\n catch (IllegalAccessException e)\n {\n e.printStackTrace();\n }\n catch (InstantiationException e)\n {\n e.printStackTrace();\n }\n\n return -1;\n }", "@Override\n\tpublic void execute() {\n\t\tcmdReceiver.send();\n\t}", "@Api(1.1)\n public Response execute() throws HaloNetException {\n return mBuilder.mClient.request(mRequest);\n }", "java.util.concurrent.Future<StartJobRunResult> startJobRunAsync(StartJobRunRequest startJobRunRequest);", "public interface RunnableTask {\n ProcessResult run();\n}", "T execute(String jobName) throws Exception;", "CommandResult execute();", "void process();", "void process();", "public void demo5() {\n\n\t\t\t\t\tConnection con = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcon = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:orcl\",\"scott\",\"tiger\");\n\n\t\t\t\t\t\tCallableStatement cs = con.prepareCall(\"CALL squareNum(?,?)\");\n\n\t\t\t\t\t\tcs.setInt(1, 5);\n\t\t\t\t\t\tcs.registerOutParameter(2, Types.INTEGER);\n\t\t\t\t\t\t\n\t\t\t\t\t\tcs.execute();\n\t\t\t\t\t\tint res = cs.getInt(2);\n\t\t\t\t\t\tSystem.out.println(\"Result: \" + res);\n\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t//DbUtils.closeConnection();\n\t\t\t\t\t}\n\n\t\t\t\t}", "Object run(Callback<String> callback, String input);", "public interface AsyncResponce {\n\n /// Cette classe permet de realiser une callback dans une Async Task en overidant cette classe\n void ComputeResult(Object result);\n}", "public boolean execute();", "public interface Executable {\n\tvoid execute();\n}", "public interface LongProcessOperations \n{\n ServoConRemote.LongProcessPackage.Status Completed ();\n\n //message is empty on success\n String Message ();\n double Progress ();\n void Detach ();\n}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\npublic Object Call_pr(final String[] parm) {\n String procedureSql = \"{?=call pr()}\"; \n return (Object) getJdbcTemplate().execute(procedureSql, new CallableStatementCallback() {\n\n\t\t\t@Override\n\t\t\tpublic Object doInCallableStatement(CallableStatement cs) throws SQLException, DataAccessException {\n\t\t\t\tcs.registerOutParameter(1, Types.INTEGER);\n\t\t\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn \"111111\";\n\t\t\t}\n\t\t});\n\n }", "public interface Process<R> {\n R run();\n}", "@Override\n\tpublic Result doProcessing() {\n\t\treturn doProcessing1();\n\t}", "public T execute() {\n return GraalCompiler.compile(this);\n }", "public void execute() {\n // empty\n }" ]
[ "0.6175894", "0.6039223", "0.5608472", "0.5517181", "0.5487477", "0.5478426", "0.54202473", "0.54113925", "0.5366388", "0.53575194", "0.5333738", "0.5326532", "0.5290004", "0.5287963", "0.5287702", "0.5274965", "0.5263065", "0.52357006", "0.51887196", "0.5183471", "0.51789635", "0.5162441", "0.51580083", "0.51160806", "0.5088734", "0.50663173", "0.50482243", "0.50478995", "0.50453585", "0.50439507", "0.5040201", "0.5022148", "0.5014031", "0.5012766", "0.50126374", "0.50126374", "0.50126374", "0.50126374", "0.49978828", "0.4997416", "0.49851832", "0.49825868", "0.496828", "0.4967304", "0.4946184", "0.49321765", "0.4910575", "0.49078855", "0.4878396", "0.48777857", "0.48777857", "0.48777857", "0.48681784", "0.4866601", "0.48596108", "0.48573846", "0.4855443", "0.48311496", "0.4822415", "0.48194715", "0.48175794", "0.48134506", "0.48122573", "0.4807135", "0.48037875", "0.47996235", "0.47990674", "0.47981954", "0.47981802", "0.47966862", "0.4794467", "0.4794467", "0.4794467", "0.4794467", "0.4794467", "0.4794467", "0.4794467", "0.47863862", "0.47818565", "0.4780878", "0.4777291", "0.47772092", "0.47671184", "0.47612557", "0.4759276", "0.47525325", "0.4743472", "0.47382942", "0.47382942", "0.47337407", "0.47323805", "0.47301295", "0.4727832", "0.471163", "0.47115314", "0.47072256", "0.4706521", "0.4704227", "0.4702238", "0.47019684" ]
0.64318407
0
Filters objects matching all points of the given track (works only on track type data). It allows users to specify a particular track to find all other points in the table that fall within specified rangesspatial and temporalof all points of the given track. Additionally, the user can specify another track to see if the two intersect (or go close to each other within the specified ranges). The user also has the flexibility of using different metrics for the spatial distance calculation: Euclidean (flat geometry) or Great Circle (spherical geometry to approximate the Earth's surface distances). The filtered points are stored in a newly created result set. The return value of the function is the number of points in the resultant set (view). This operation is synchronous, meaning that a response will not be returned until all the objects are fully available.
public FilterBySeriesResponse filterBySeries(FilterBySeriesRequest request) throws GPUdbException { FilterBySeriesResponse actualResponse_ = new FilterBySeriesResponse(); submitRequest("/filter/byseries", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Measurement> findMeasurementsByTimeRange(Date fromDate, Date toDate) {\n return entityManager.createQuery(\"SELECT m from \" +\n \"Measurement m where m.date >= :fromDate and m.date <= :toDate\", Measurement.class)\n .setParameter(\"fromDate\", fromDate)\n .setParameter(\"toDate\", toDate)\n .getResultList();\n\n }", "boolean hasPagingValues(TrackList<? extends Track> trackList);", "public List<QueryStats> getQueryStats(boolean inTest,\n LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(QueryStats.class));\n return handle.createQuery(inTest ? QueryStats.getExtractQueryinTest(rangeStart, rangeEnd)\n : QueryStats.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(QueryStats.class)\n .list();\n });\n }", "@Override\n public void filter(BoundingBox3d bounds) {\n filter = new boolean[points.size()];\n for (int i = 0; i < filter.length; i++)\n filter[i] = bounds.contains(points.get(i).xyz);\n }", "public FilterBySeriesResponse filterBySeries(String tableName, String viewName, String trackId, List<String> targetTrackIds, Map<String, String> options) throws GPUdbException {\n FilterBySeriesRequest actualRequest_ = new FilterBySeriesRequest(tableName, viewName, trackId, targetTrackIds, options);\n FilterBySeriesResponse actualResponse_ = new FilterBySeriesResponse();\n submitRequest(\"/filter/byseries\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic int[] countRecords(Record record, Timestamp startTime, Timestamp endTime){\n\t\t//System.out.println(\"hello:\"+record);\n\t\tint[] result = {0,0};//0 is passed records, 1 is total executed records\n\t\tCriteria c = dao.getSession().createCriteria(Record.class, \"r\");\n\t\tc.createAlias(\"r.test\", \"t\").createAlias(\"r.test.project\", \"p\");\n\t\tc.add(Restrictions.ge(\"r.startTime\",startTime));\n\t\tc.add(Restrictions.le(\"r.startTime\",endTime));\n\t\tParamChecker pc = new ParamChecker();\n\t\tif (record!=null && record.getTest()!=null && record.getTest().getProject()!=null){\n\t\t\tProject project = record.getTest().getProject();\n\t\t\tif (pc.isFollowPattern(pc.UUID, project.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"p.id\", project.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCategory())){\n\t\t\t\tc.add(Restrictions.eq(\"p.category\", project.getCategory()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCountry())){\n\t\t\t\tc.add(Restrictions.eq(\"p.country\", project.getCountry()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getLeader())){\n\t\t\t\tc.add(Restrictions.eq(\"p.leader\", project.getLeader()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductCode())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productCode\", project.getProductCode()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductName())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productName\", project.getProductName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getRegion())){\n\t\t\t\tc.add(Restrictions.eq(\"p.region\", project.getRegion()));\n\t\t\t}\n\t\t\tif (project.getStatus()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.status\", project.getStatus()));\n\t\t\t}\n\t\t\tif (project.getTargetTestcaseNumber()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.targetTestcaseNumber\", project.getTargetTestcaseNumber()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getPod())){\n\t\t\t\tc.add(Restrictions.eq(\"p.pod\", project.getPod()));\n\t\t\t}\n\t\t}\n\t\tif (record!=null && record.getTest()!=null){\n\t\t\tTest t = record.getTest();\n\t\t\tif (pc.isFollowPattern(pc.UUID, t.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"t.id\", t.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getName())){\n\t\t\t\tc.add(Restrictions.eq(\"t.name\", t.getName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getDescription())){\n\t\t\t\tc.add(Restrictions.eq(\"t.description\", t.getDescription()));\n\t\t\t}\n\t\t\tif (t.getManualExecutionTime()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"t.manualExecutionTime\", t.getManualExecutionTime()));\n\t\t\t}\n\t\t}\n\t\tc.setProjection(Projections.rowCount());\n\t\tresult[1]= ((Long) c.uniqueResult()).intValue();\n\n\t\tc = dao.getSession().createCriteria(Record.class, \"r\");\n\t\tc.createAlias(\"r.test\", \"t\").createAlias(\"r.test.project\", \"p\");\n\t\tif (record!=null && record.getTest()!=null && record.getTest().getProject()!=null){\n\t\t\tProject project = record.getTest().getProject();\n\t\t\tif (pc.isFollowPattern(pc.UUID, project.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"p.id\", project.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCategory())){\n\t\t\t\tc.add(Restrictions.eq(\"p.category\", project.getCategory()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCountry())){\n\t\t\t\tc.add(Restrictions.eq(\"p.country\", project.getCountry()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getLeader())){\n\t\t\t\tc.add(Restrictions.eq(\"p.leader\", project.getLeader()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductCode())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productCode\", project.getProductCode()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductName())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productName\", project.getProductName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getRegion())){\n\t\t\t\tc.add(Restrictions.eq(\"p.region\", project.getRegion()));\n\t\t\t}\n\t\t\tif (project.getStatus()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.status\", project.getStatus()));\n\t\t\t}\n\t\t\tif (project.getTargetTestcaseNumber()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.targetTestcaseNumber\", project.getTargetTestcaseNumber()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getPod())){\n\t\t\t\tc.add(Restrictions.eq(\"p.pod\", project.getPod()));\n\t\t\t}\n\t\t}\n\t\tif (record!=null && record.getTest()!=null){\n\t\t\tTest t = record.getTest();\n\t\t\tif (pc.isFollowPattern(pc.UUID, t.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"t.id\", t.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getName())){\n\t\t\t\tc.add(Restrictions.eq(\"t.name\", t.getName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getDescription())){\n\t\t\t\tc.add(Restrictions.eq(\"t.description\", t.getDescription()));\n\t\t\t}\n\t\t\tif (t.getManualExecutionTime()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"t.manualExecutionTime\", t.getManualExecutionTime()));\n\t\t\t}\n\t\t}\n\t\tc.add(Restrictions.ge(\"r.startTime\",startTime));\n\t\tc.add(Restrictions.le(\"r.startTime\",endTime));\n\t\tc.add(Restrictions.isNotNull(\"r.result\"));\n\t\tc.setProjection(Projections.rowCount());\n\t\tresult[0]= ((Long) c.uniqueResult()).intValue();\n\n\t\treturn result;\n\t}", "@Override\n\tpublic List<DisplayResult> getResults(ReferencedEnvelope bounds) {\n\t\t\n\t\tString whereClause = bounds != null ? \"WHERE ST_Transform(geom, 4326) && ST_MakeEnvelope(\"+bounds.getMinX()+\",\"+bounds.getMinY()+\",\"+bounds.getMaxX()+\",\"+bounds.getMaxY()+\") \" : \"\";\n\t\t\n\t\t//Only latest results\n\t\tString query = \"SELECT DISTINCT ON (meshblock_id) id, meshblock_id, operat_score, date_entered, ST_AsText(ST_Transform(centroid,4326)), ST_AsText(ST_Transform(geom,4326)), \"\n\t\t\t\t+ \"natural_elements_score, incivilities_and_nuisance_score, navigation_and_mobility_score, territorial_score \"\n\t\t\t\t+ \"FROM result \"\n\t\t\t\t+ whereClause\n\t\t\t\t+ \"ORDER BY meshblock_id, date_entered DESC;\";\n\n\t\tSystem.out.println(query);\n\t GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();\n\n\t WKTReader reader = new WKTReader(geometryFactory);\n\t \n\t\tRowMapper<DisplayResult> rowMapper = (rs, rowNum) -> {\n\t\t\t\n\t\t\tDisplayResult result = new DisplayResult();\n\t\t\tresult.setResultId(rs.getInt(1));\n\t\t\tresult.setMeshblockId(rs.getInt(2));\n\t\t\tresult.setOperatScore(rs.getDouble(3));\n\t\t\t\t\n\t\t\tresult.setNaturalElementsScore(rs.getDouble(7));\n\t\t\tresult.setIncivilitiesScore(rs.getDouble(8));\n\t\t\tresult.setNavigationScore(rs.getDouble(9));\n\t\t\tresult.setTerritorialScore(rs.getDouble(10));\n\t\t\tPoint point;\n\t\t\ttry {\n\t\t\t\tpoint = (Point) reader.read(rs.getString(5));\n\t\t\t\tresult.setCentroid(point.toString());\n\t\t\t\tresult.setLat(point.getCoordinate().y);\n\t\t\t\tresult.setLng(point.getCoordinate().x);\n\t\t\t\t\t\n\t\t\t\tresult.setGeom(rs.getString(6));\n\t\t\t\t\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\t\n\t\treturn jdbcTemplate.query(query, rowMapper);\n\t\t\n\t}", "@GET\n\t@Produces(\"application/json\")\n\t@Path(\"within\")\n\tpublic List<Pizzerias> findPizzeriasWithin(@QueryParam(\"lat1\") float lat1,\n @QueryParam(\"lon1\") float lon1, @QueryParam(\"lat2\") float lat2,\n @QueryParam(\"lon2\") float lon2) {\n dbConnection.checkDatabase();\n\t\tArrayList<Pizzerias> allPizzeriasList = new ArrayList<Pizzerias>();\n\t\tMongoCollection pizzerias = dbConnection.getCollection();\n\n\t\t// make the query object\n\t\tBasicDBObject spatialQuery = new BasicDBObject();\n\n\t\tArrayList<double[]> boxList = new ArrayList<double[]>();\n\t\tboxList.add(new double[] { new Float(lat2), new Float(lon2) });\n\t\tboxList.add(new double[] { new Float(lat1), new Float(lon1) });\n\n\t\tBasicDBObject boxQuery = new BasicDBObject();\n\t\tboxQuery.put(\"$box\", boxList);\n\n\t\tspatialQuery.put(\"pos\", new BasicDBObject(\"$within\", boxQuery));\n\t\tSystem.out.println(\"Using spatial query: \" + spatialQuery.toString());\n\n\t\tMongoCursor<Document> cursor = pizzerias.find(spatialQuery).iterator();\n\t\ttry {\n\t\t\twhile (cursor.hasNext()) {\n\t\t\t\tallPizzeriasList.add(this.populatePizzeriasInformation(cursor.next()));\n\t\t\t}\n\t\t} finally {\n\t\t\tcursor.close();\n\t\t}\n\t\tSystem.out.println(\"Return \" + allPizzeriasList.size() + \" pizzerias\");\n\n\t\treturn allPizzeriasList;\n\t}", "private static void getObjects(List<TrackingObject> objects,\n\t\t\tTrackingObject objectToTrack, Mat hsvImage) {\n\t\tMat hsvImageThresholded = new Mat();\n\n\t\t// Threshold the hsv image to filter for Pucks\n\t\tCore.inRange(hsvImage, objectToTrack.HSVmin, objectToTrack.HSVmax,\n\t\t\t\thsvImageThresholded);\n\n\t\t// reduce the noise in the image\n\t\treduceNoise(hsvImageThresholded);\n\n\t\t// Find list of Pucks\n\t\tfindObjects(hsvImageThresholded, objectToTrack, objects);\n\n\t}", "List<Media> search(double latitude, double longitude, long maxTimeStamp, long minTimeStamp, int distance);", "public List<Point> query(Rectangle rectangle) {\n if (!boundary.intersects(rectangle)) {\n return Collections.emptyList();\n }\n\n List<Point> found = new ArrayList<>();\n points.stream()\n .filter(rectangle::contains)\n .forEach(found::add);\n\n if (isSubdivided) {\n found.addAll(nw.query(rectangle));\n found.addAll(ne.query(rectangle));\n found.addAll(se.query(rectangle));\n found.addAll(sw.query(rectangle));\n }\n\n return found;\n }", "public interface TrackSearchClient<T extends Track> {\n\n /**\n * Search for tracks using a string containing keywords.\n * @param search keywords to search for.\n * @return a tracklist containing all found tracks.\n * @throws TrackSearchException when the client encountered a problem on searching.\n */\n TrackList<T> getTracksForSearch(String search) throws TrackSearchException;\n\n /**\n * Search for the next tracks for last result.\n * @param trackList a previous search result for that client.\n * @return a tracklist containing the next tracks available.\n * @throws TrackSearchException when the client encounters a problem on getting the next tracks.\n */\n TrackList<T> getNext(TrackList<? extends Track> trackList) throws TrackSearchException;\n\n /**\n * Get the audio stream URL in the highest possible audio resolution.\n * @param track from this client.\n * @return the audio stream URL.\n * @throws TrackSearchException when the URL could not be exposed.\n */\n String getStreamUrl(T track) throws TrackSearchException;\n\n /**\n * Check the tracklist for this client if the paging values to get next are present.\n * @param trackList a previous search result for this client.\n * @return either the paging values are present or not.\n */\n boolean hasPagingValues(TrackList<? extends Track> trackList);\n\n}", "@Override\n public List<AudioTrackContext> getTracksInRange(int indexA, int indexB) {\n\n //make sure startIndex <= endIndex\n int startIndex = indexA < indexB ? indexA : indexB;\n int endIndex = indexA < indexB ? indexB : indexA;\n\n //Collect tracks between the two indices\n int i = 0;\n List<AudioTrackContext> result = new ArrayList<>();\n for (AudioTrackContext atc : getAsListOrdered()) {\n if (i >= startIndex && i < endIndex)\n result.add(atc);\n i++;\n if (i >= endIndex) break;//abort early if we're done\n }\n\n //trigger shuffle queue update if we found tracks to remove\n if (result.isEmpty()) shouldUpdateShuffledQueue = true;\n return result;\n }", "private void buildQueryFilterTemporal(String dateField,\n String startDate,\n String endDate,\n boolean isDatesContainedChecked,\n String namedTimescale, \n String namedTimescaleQueryType,\n TermsList termsList\n ) \n \t\tthrows UnsupportedEncodingException {\n\t boolean endDateSpecified = false;\n\t boolean startDateSpecified = false;\n\t \n /* If the user specified a named time-scale query, search for it\n * in the \"timescale\" field.\n */\n if ((namedTimescale != null) && (!(namedTimescale.equals(\"\")))) {\n termsList.addTerm(namedTimescale);\n String parenthesizedValue = parenthesizeQueryValue(namedTimescale);\n String escapedValue = Search.escapeQueryChars(parenthesizedValue);\n String encodedValue = URLEncoder.encode(escapedValue, \"UTF-8\");\n String timescaleQuery = String.format(\"timescale:%s\", encodedValue);\n updateQString(timescaleQuery);\n }\n \n if ((startDate == null) || (startDate.equals(\"\"))) {\n \tstartDate = \"*\";\n }\n else {\n startDate = ISO8601Utility.formatTimestamp(startDate, \"DAY\");\n if (startDate != null) startDateSpecified = true;\n }\n\n if ((endDate == null) || (endDate.equals(\"\"))) {\n \tendDate = \"NOW\";\n }\n else {\n \tendDate = ISO8601Utility.formatTimestamp(endDate, \"DAY\");\n \tif (endDate != null) endDateSpecified = true;\n }\n\n validateDateRange(startDate, endDate);\n \n // If a start date or an end date was specified, search temporal coverage\n //\n if (startDateSpecified || endDateSpecified) {\n \tString temporalFilter = null;\n \tString collectionFilter = null;\n \tString pubDateFilter = null;\n \tString LEFT_BRACKET = \"%5B\";\n \tString RIGHT_BRACKET = \"%5D\";\n\n if (dateField.equals(\"ALL\") || dateField.equals(\"COLLECTION\")) {\n \t String singleDateQuery = String.format(\"singledate:%s%s+TO+%s%s\", LEFT_BRACKET, startDate, endDate, RIGHT_BRACKET);\n \t String startDateQuery = String.format(\"begindate:%s*+TO+%s%s\", LEFT_BRACKET, endDate, RIGHT_BRACKET);\n \t String endDateQuery = String.format(\"enddate:%s%s+TO+NOW%s\", LEFT_BRACKET, startDate, RIGHT_BRACKET);\n \t collectionFilter = String.format(\"(%s+OR+(%s+AND+%s))\", singleDateQuery, startDateQuery, endDateQuery);\n }\n \n if (dateField.equals(\"ALL\") || dateField.equals(\"PUBLICATION\")) {\n \t pubDateFilter = String.format(\"pubdate:%s%s+TO+%s%s\", LEFT_BRACKET, startDate, endDate, RIGHT_BRACKET);\n }\n \n if (dateField.equals(\"ALL\")) {\n \t temporalFilter = String.format(\"(%s+OR+%s)\", pubDateFilter, collectionFilter);\n }\n else if (dateField.equals(\"COLLECTION\")) {\n \t temporalFilter = collectionFilter;\n }\n else if (dateField.equals(\"PUBLICATION\")) {\n \t temporalFilter = pubDateFilter;\n }\n \n updateFQString(temporalFilter); \n }\n\n }", "private void queryListings(double left, double right, double top, double bottom) {\n ParseQuery<Listing> query = ParseQuery.getQuery(Listing.class);\n query.include(Listing.KEY_AUTHOR);\n query.whereGreaterThanOrEqualTo(Listing.KEY_LONGITUDE, left);\n query.whereLessThanOrEqualTo(Listing.KEY_LONGITUDE, right);\n query.whereGreaterThanOrEqualTo(Listing.KEY_LATITUDE, bottom);\n query.whereLessThanOrEqualTo(Listing.KEY_LATITUDE, top);\n query.findInBackground(new FindCallback<Listing>() {\n @Override\n public void done(List<Listing> listings, ParseException e) {\n // Check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting listings\", e);\n return;\n }\n // Add a marker for each listing on screen\n for (Listing listing : listings) {\n LatLng coordinates = new LatLng(listing.getLatitude(), listing.getLongitude());\n Marker marker = thisMap.addMarker(new MarkerOptions().position(coordinates).title(listing.getCategory()));\n marker.setTag(listing);\n }\n }\n });\n }", "public Iterable<Point2D> range(RectHV rect) {\n\n if (rect == null)\n throw new IllegalArgumentException(\"Got null object in range()\");\n \n Queue<Point2D> pointsInside = new Queue<>();\n \n for (Point2D p : point2DSET) {\n \n double x = p.x();\n double y = p.y();\n if (x >= rect.xmin() && x <= rect.xmax() &&\n y >= rect.ymin() && y <= rect.ymax())\n pointsInside.enqueue(p);\n \n }\n \n return pointsInside;\n }", "public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) throw new IllegalArgumentException(\n \"Null pointer provided instead of a query rectangle\");\n ptsInside = new SET<Point2D>();\n searchForPoints(root, rect);\n return ptsInside;\n }", "@Override\n public List<UserQuery> getQueries(LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(UserQuery.class));\n return handle.createQuery(UserQuery.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(UserQuery.class)\n .list();\n });\n }", "public JSONObject matchPoints(String coordinates) {\n String url = String.format(OSRM_SERVER + \"/match/v1/car/%s?geometries=geojson&overview=full\", coordinates);\n System.out.println(url);\n return fetchResult(url);\n }", "long countByFilter(String keySearch, String brands, Double priceFrom, Double priceTo);", "Set<Ride> queryRidesFromSupplier(Trip trip, Supplier supplier){\n Map<String, String> parameters = journeyRequestLocationsToParameters(trip);\n String parsedParameters = new HttpUrlParameterParser().parseParameters(parameters);\n String urlAddress = REQUEST_ROOT_URL + supplier.toString() + \"?\" + parsedParameters;\n IConnection<HttpURLConnection, String> httpConnectionHandler = new HttpConnectionHandler();\n HttpURLConnection connection = httpConnectionHandler.connect(urlAddress);\n\n if(connection == null){\n return new HashSet<>();\n }\n\n String response = httpConnectionHandler.getResponse(connection);\n return extractRidesFromResponse(response, trip.getNumPassengers(), supplier);\n }", "@Override\n\tpublic PaginationResultsTo<Track> getTracks(Integer pageNum, Integer pageSize) {\n\t\tLOGGER.info(\"Fetching all Tracks from DB for page number : \" + pageNum);\n\t\tPaginationResultsTo<Track> paginationResults = null;\n\t\tif(Util.isNull(pageNum) || Util.isNull(pageSize)) {\n\t\t\tthrow new IllegalArgumentException(\"Missing pageNum/pageSize method arguments\");\n\t\t}\n\t\ttry {\n\t\t\t\n\t\t\tOrder o1 = new Order(Direction.DESC,\"type\").ignoreCase();\n\t\t\tOrder o2 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\tOrder o3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\n\t\t\tSort sort = new Sort(new Order[]{o1,o2,o3}) ;\n\t\t\t\n\t\t\tPageRequest request = new PageRequest(pageNum - 1, pageSize, sort);\n\t\t\t\n\t\t\tPage<Track> tracks = tracksRepository.findAll(request);\n\t\t\tif(!Util.isNull(tracks)) {\n\t\t\t\tpaginationResults = new PaginationResultsTo<Track>();\n\t\t\t\tpaginationResults.setPageNumber(pageNum);\n\t\t\t\tpaginationResults.setPageSize(pageSize);\n\t\t\t\tpaginationResults.setTotalNumberOfPages(tracks.getTotalPages());\n\t\t\t\tpaginationResults.setTotalNumberOfResults(tracks.getTotalElements());\n\t\t\t\tpaginationResults.setResults(tracks.getContent());\n\t\t\t\ttracks.getTotalPages();\n\t\t\t}\n\t\t} catch(Exception e){\n\t\t\tLOGGER.error(\"Error while retreiving all Tracks for Pagination --> page Number : \" + pageNum + \" , Page Size : \" + pageSize, e);\n\t\t}\n\n\t\treturn paginationResults;\n\t}", "public void filterLocations(double rad, double centerlat, double centerlng) {\n Location center = new Location(\"Center\");\n center.setLatitude(centerlat);\n center.setLongitude(centerlng);\n Location point = new Location(\"Point\");\n\n // New arraylist of filter things.\n filtered = new ArrayList<DiscoverTile>();\n\n // For loop calculate straight line distance between each tile object in database and center.\n for (int i = 0; i < Test.size(); i++) {\n //Log.d(TAG, \"onMapDialogFragmentInteraction: Rad is \" + rad);\n point.setLatitude(Test.get(i).getLat());\n point.setLongitude(Test.get(i).getLng());\n float distance = center.distanceTo(point);\n //Log.d(TAG, \"onMapDialogFragmentInteraction: distance is \" + distance);\n if (distance <= rad) {\n // Test.get(i) is in the radius. Show selection.\n filtered.add(Test.get(i));\n }\n }\n\n // Create a new tile fragment (separate from disoverTileFragment) called filteredTileFragment,\n // which contains the filtered tiles.\n filteredTileFragment = new DiscoverTileFragment();\n TFmode = useFTF;\n\n Bundle bundle = new Bundle();\n bundle.putParcelableArrayList(\"KEY\", filtered);\n\n filteredTileFragment.setArguments(bundle);\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n fragmentTransaction.replace(R.id.discover_tilefragment, filteredTileFragment);\n //fragmentTransaction.addToBackStack(null);\n fragmentTransaction.commit();\n\n\n }", "public List<PointDetails> getIntersectingPoints(Rectangle2D rect) {\n\t\tboolean useParallelStreaming = numPoints() > 10000;\n\t\treturn Utils.parallelize(getPointDetails().stream(), useParallelStreaming)\n\t\t\t\t.filter(p->rect.contains(p.location))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public static void main(String[] args) {\n \n PointSET pset = new PointSET();\n System.out.println(\"Empty: \" + pset.isEmpty());\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.6));\n pset.insert(new Point2D(0.5, 0.7));\n pset.insert(new Point2D(0.5, 0.8));\n pset.insert(new Point2D(0.1, 0.5));\n pset.insert(new Point2D(0.8, 0.5));\n pset.insert(new Point2D(0.1, 0.1));\n System.out.println(\"Empty: \" + pset.isEmpty());\n System.out.println(\"Size: \" + pset.size());\n System.out.println(\"Nearest to start: \" + pset.nearest(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #1: \" + pset.contains(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #2: \" + pset.contains(new Point2D(0.5, 0.5)));\n System.out.print(\"Range #1: \");\n for (Point2D p : pset.range(new RectHV(0.001, 0.001, 0.002, 0.002)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #2: \");\n for (Point2D p : pset.range(new RectHV(0.05, 0.05, 0.15, 0.15)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #3: \");\n for (Point2D p : pset.range(new RectHV(0.25, 0.35, 0.65, 0.75)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n \n }", "TrackList<T> getTracksForSearch(String search) throws TrackSearchException;", "public Asphalt getAsphalt(int x,int y,List<Asphalt> track) {\n\t\treturn track.stream()\n\t\t\t\t .filter(coords -> new Point(x,y).equals(coords))\n\t\t\t\t .findAny()\n\t\t\t\t .orElse(null);\n\t}", "@Override\n public RealmResults<MainModelImp> getRealmResults(String lat, String lon) {\n return realm.where(MainModelImp.class)\n .equalTo(LATITUDE, lat)\n .equalTo(LONGITUDE, lon)\n .findAll();\n }", "void queryTimeSeries(final Message<JsonObject> msg) {\n\n final JsonObject query = msg.body();\n LOG.debug(\"{}\\n{}\", address, query.encodePrettily());\n\n // get the paramsters from the query\n final Range range = rangeParser.parse(query.getJsonObject(\"range\").getString(\"from\"),\n query.getJsonObject(\"range\").getString(\"to\"));\n final long interval = intervalParser.parseToLong(query.getString(\"interval\"));\n final JsonArray targets = query.getJsonArray(\"targets\")\n .stream()\n .map(o -> ((JsonObject) o).getString(\"target\"))\n .collect(toJsonArray());\n\n //build the query and options\n final JsonObject tsQuery = $and(obj(\"n.begin\", $gte(range.getStart())),\n obj(\"n.begin\", $lte(range.getEnd())),\n obj(\"t.name\", $in(targets)));\n\n final FindOptions findOptions = new FindOptions().setFields(obj().put(\"t.name\", 1)\n .put(\"n.begin\", 1)\n .put(\"n.value\", 1)\n .put(\"_id\", 0)).setSort(obj(\"n.begin\", 1));\n\n long start = System.currentTimeMillis();\n //execute search and process response\n client.findWithOptions(collectionName, tsQuery, findOptions, result -> {\n\n if (result.succeeded()) {\n JsonArray resp = processResponse(range, r -> range.splitEvery(interval), targets, result);\n long end = System.currentTimeMillis();\n LOG.debug(\n \"Sending response with {} timeseries and {} datapoints (after {} ms)\",\n resp.size(),\n resp.stream()\n .map(o -> ((JsonObject) o).getJsonArray(\"datapoints\"))\n .collect(Collectors.summingInt(JsonArray::size)),\n (end - start));\n msg.reply(resp);\n\n } else {\n LOG.error(\"Annotation query failed\", result.cause());\n msg.reply(arr());\n }\n\n });\n }", "private void collectForRange(Date startDate, Date endDate) {\n Flux<SolarFlare> flux = solarFlareMapper.transferCollectionToEntityFlux(\n donkiClient.getBetweenRange(startDate, endDate)\n );\n solarFlareRepository.saveAll(flux)\n .count()\n .subscribe(total -> log.info(\"Collected {} data sets solar flares\", total));\n }", "public Track[] searchTracks_Sync(String q) {\n SearchTracksRequest searchTracksRequest = spotifyApi.searchTracks(q)\n .limit(10)\n .offset(0)\n .build();\n Track[] tracks = null;\n try {\n final Paging<Track> trackPaging = searchTracksRequest.execute();\n\n System.out.println(\"Total: \" + trackPaging.getTotal());\n tracks = trackPaging.getItems();\n /*\n for (int i=0; i<tracks.length; i++){\n System.out.println(\"track = \" + tracks[i].getName());\n System.out.println(\"artist = \" + tracks[i].getArtists()[0].getName());\n System.out.println(\"album = \"+ tracks[i].getAlbum().getName());\n //System.out.println(\"\")\n }\n */\n } catch (IOException | SpotifyWebApiException e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n\n return tracks;\n }", "@Override\n public List<Revenue> revenuesForTime(long startTime, long endTime) {\n List<Revenue> revenues = revenueRepository.findAll();\n List<Revenue> foundRevenues = new ArrayList<>();\n for(Revenue revenue : revenues){\n if(revenue.getTimestamp() == startTime || revenue.getTimestamp() == endTime){\n foundRevenues.add(revenue);\n continue;\n }\n if(revenue.getTimestamp() > startTime && revenue.getTimestamp() < endTime ){\n foundRevenues.add(revenue);\n }\n }\n return foundRevenues;\n }", "@Override\n public List<Object[]> getStatistics(String owner, StatisticsGroup group, String from, String to) {\n String date = parseDateLimit(from, to);\n String groupHQL = this.groupToHQL(group);\n List<Object[]> list = (List<Object[]>) getHibernateTemplate().findByNamedParam(\"select count(*), \"\n + \"count(distinct ipAddress), \" + groupHQL + \" \"\n + \"from SearchEvent \"\n + \"where owner like :owner \"\n + date + \" \"\n + \"group by col_2_0_\", \"owner\", owner);\n return list;\n }", "@Override\n public Long countByCriteria(String x,String y,int xType,int yType){\n //Build the query string base on parameters\n StringBuilder query = new StringBuilder();\n query.append(\"Select count(distinct scientific_name_id) from ait.taxon_info_index where \");\n \n switch(xType){\n case 1: //Taxonomical criteria\n query.append(getTaxoCriteria(x));\n break;\n case 2: //Geographical criteria\n query.append(getGeoCriteria(x));\n break;\n case 3: //Indicators criteria\n query.append(getIndiCriteria(x));\n break;\n }\n \n switch(yType){\n case 1: //Taxonomical criteria\n query.append(\" and \"+getTaxoCriteria(y));\n break;\n case 2: //Geographical criteria\n query.append(\" and \"+getGeoCriteria(y));\n break;\n case 3: //Indicators criteria\n query.append(\" and \"+getIndiCriteria(y));\n break;\n }\n \n //Execute query\n return taxonInfoIndexDAO.countTaxonsByQuery(query.toString());\n }", "private DescriptiveStatistics calculateStatsForRange(List<JsonObject> datapoints, String targetName, Range range) {\n\n return datapoints.stream()\n .filter(js -> targetName.equals(js.getJsonObject(\"t\").getString(\"name\"))\n && range.contains(js.getJsonObject(\"n\").getLong(\"begin\")))\n .map(js -> js.getJsonObject(\"n\").getLong(\"value\"))\n .map(Long::doubleValue)\n .collect(descStatsCollector());\n }", "public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) {\n throw new IllegalArgumentException();\n }\n SET<Point2D> result = new SET<Point2D>();\n for (Point2D point : points) {\n if (rect.contains(point))\n result.add(point);\n }\n return result;\n }", "public <T extends GameObject> T[] senseNearbyGameObjects(Class<T> type);", "public List<Hotel> findByPriceBetween(double low, double high);", "@Override\n public List<Object[]> getStatistics(String owner, StatisticsGroup group, SearchEventType type, String from, String to) {\n String date = parseDateLimit(from, to);\n String groupHQL = this.groupToHQL(group);\n List<Object[]> list = (List<Object[]>) getHibernateTemplate().findByNamedParam(\"select count(*), \"\n + \"count(distinct ipAddress), \" + groupHQL + \" \"\n + \"from SearchEvent \"\n + \"where owner like :owner \"\n + \"and eventType = :type \"\n + date + \" \"\n + \"group by col_2_0_\", new String[]{\"owner\", \"type\"}, new Object[]{owner, type});\n return list;\n }", "public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) throw new NullPointerException();\n TreeSet<Point2D> inRangeSet = new TreeSet<>();\n for (Point2D point : pointSet) {\n if (rect.contains(point)) {\n inRangeSet.add(point);\n }\n }\n return inRangeSet;\n }", "ArrayList<Transaction> getFilteredTransactions(long startTimestamp,\n long endTimestamp, long accountNumber, boolean showExpense, boolean showIncome) {\n ArrayList<Transaction> filteredTransactionList = new ArrayList<>();\n int low = 0;\n int high = transactionList.size() - 1;\n if (startTimestamp != -1 && endTimestamp != -1) {\n /*\n If start and end time are set, then get the range of\n transaction corresponding to the time range.\n */\n Points p = getTransactions(startTimestamp, endTimestamp);\n if (p.x == -1 && p.y == -1)\n return filteredTransactionList;\n low = p.x;\n high = p.y;\n }\n for (int i = low; i <= high; i++) {\n if (accountNumber != -1 && transactionList.get(i).transactionAccountNumber != accountNumber)\n continue;\n if (!showExpense && (transactionList.get(i).transactionType == 0 || transactionList.get(i).transactionType == 2))\n continue;\n if (!showIncome && (transactionList.get(i).transactionType == 1 || transactionList.get(i).transactionType == 3))\n continue;\n filteredTransactionList.add(transactionList.get(i));\n }\n return filteredTransactionList;\n }", "@Override\n\tpublic void queryPoints() {\n\n\t}", "@Override\n\tpublic PaginationResultsTo<Track> getTracks(Integer pageNum, Integer pageSize, String field, String sortOrder) {\n\t\tif (Util.isEmptyString(field)\n\t\t\t\t|| Util.isEmptyString(sortOrder)\n\t\t\t\t|| !(\"ASC\".equalsIgnoreCase(sortOrder) || \"DESC\"\n\t\t\t\t\t\t.equalsIgnoreCase(sortOrder))) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Invalid Arguments to sort Tracks in pagination\");\n\t\t}\n\t\tPaginationResultsTo<Track> paginationResults = null;\n\t\ttry {\n\t\t\t\n\t\t\tOrder o1 = new Order(Direction.fromString(sortOrder), field).ignoreCase();\n\t\t\tOrder o2 = null;\n\t\t\tOrder o3 = null;\n\t\t\tif(\"type\".equalsIgnoreCase(field)) {\n\t\t\t\to2 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\t\to3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\t\t\t} else if(\"country\".equalsIgnoreCase(field)) {\n\t\t\t\to2 = new Order(Direction.DESC,\"type\").ignoreCase();\n\t\t\t\to3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\t\t\t} else {\n\t\t\t\to2 = new Order(Direction.ASC,\"id\").ignoreCase();\n\t\t\t\to3 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\t}\n\t\t\t\n\n\t\t\tSort sort = new Sort(new Order[]{o1,o2,o3}) ;\n\t\t\t\n\t\t\tPageRequest request = new PageRequest(pageNum - 1, pageSize, sort);\n\n\t\t\tPage<Track> tracks = tracksRepository.findAll(request);\n\t\t\tif (!Util.isNull(tracks)) {\n\t\t\t\tpaginationResults = new PaginationResultsTo<Track>();\n\t\t\t\tpaginationResults.setPageNumber(pageNum);\n\t\t\t\tpaginationResults.setPageSize(pageSize);\n\t\t\t\tpaginationResults.setTotalNumberOfPages(tracks.getTotalPages());\n\t\t\t\tpaginationResults.setTotalNumberOfResults(tracks\n\t\t\t\t\t\t.getTotalElements());\n\t\t\t\tpaginationResults.setResults(tracks.getContent());\n\t\t\t\ttracks.getTotalPages();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\n\t\t\t\t\t\"Error while retreiving all Tracks with Sorting for Pagination --> page Number : \"\n\t\t\t\t\t\t\t+ pageNum\n\t\t\t\t\t\t\t+ \" , Page Size : \"\n\t\t\t\t\t\t\t+ pageSize\n\t\t\t\t\t\t\t+ \" , Sort field : \"\n\t\t\t\t\t\t\t+ field\n\t\t\t\t\t\t\t+ \" , Sort order : \"\n\t\t\t\t\t\t\t+ sortOrder, e);\n\t\t}\n\n\t\treturn paginationResults;\n\t}", "@SuppressWarnings(\"unchecked\") \n public List<Item> getItemsByCategoryByRadiusVLH(String catID, int start,\n int chunkSize,double fromLat,double toLat,double fromLong,\n double toLong){\n EntityManager em = emf.createEntityManager();\n Query query = em.createQuery(\"SELECT i FROM Item i, Product p WHERE \" +\n \"i.productID=p.productID AND p.categoryID = :categoryID \" +\n \"AND((i.address.latitude BETWEEN :fromLatitude AND :toLatitude) AND \" +\n \"(i.address.longitude BETWEEN :fromLongitude AND :toLongitude )) AND i.disabled = 0\" +\n \" ORDER BY i.name\");\n query.setParameter(\"categoryID\",catID);\n query.setParameter(\"fromLatitude\",fromLat);\n query.setParameter(\"toLatitude\",toLat);\n query.setParameter(\"fromLongitude\",fromLong);\n query.setParameter(\"toLongitude\",toLong);\n List<Item> items = query.setFirstResult(start).setMaxResults(chunkSize).getResultList();\n em.close();\n return items;\n }", "public Iterable<Point2D> range(RectHV rect) {\n ArrayList<Point2D> returnArray = new ArrayList<Point2D>();\n if (rect == null) {\n throw new IllegalArgumentException(\"rect input is null\");\n }\n for (Point2D i : pointsSet) {\n if (rect.contains(i))\n returnArray.add(i);\n }\n return returnArray;\n }", "private Points getTransactions(long startTimestamp, long endTimestamp) {\n if (startTimestamp > endTimestamp) {\n long tmp = startTimestamp;\n startTimestamp = endTimestamp;\n endTimestamp = tmp;\n }\n int low = 0;\n int high = transactionList.size() - 1;\n int x = -1;\n int y = -1;\n while (low <= high) {\n int mid = (high + low) >> 1;\n if (transactionList.get(mid).transactionTimestamp >= startTimestamp) {\n x = mid;\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n if (x == -1) {\n return new Points(-1, -1);\n }\n\n low = 0;\n high = transactionList.size() - 1;\n while (low <= high) {\n int mid = (high + low) >> 1;\n if (transactionList.get(mid).transactionTimestamp <= endTimestamp) {\n y = mid;\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n if (y == -1) {\n return new Points(-1, -1);\n }\n return new Points(x, y);\n }", "Stream<DataPoint> getHistoryData(Symbol symbol, LocalDateTime startTime, LocalDateTime endTime, int numberOfPoints);", "@RequestMapping(value = \"/co\", method = RequestMethod.GET)\n\tpublic ResponseEntity<List<CarbonMonoxideMeasurement>> getCarbonMonoxideMeasurementsBetweenTimestamps(\n\t\t\t@PathVariable String username, @RequestParam(\"from\") long from,\n\t\t\t@RequestParam(\"to\") long to, @RequestParam(value = \"room\", required = false) String room_name) {\n\n\t\tLOG.debug(\"getCarbonMonoxideMeasurementsBetweenTimestamps: \" + from + \" and \"\n\t\t\t\t+ to);\n\n\t\tList<CarbonMonoxideMeasurement> carbonMonoxideMeasurementList;\n\n\t\ttry {\n\t\t\tcarbonMonoxideMeasurementList = gasesMeasurementService\n\t\t\t\t\t.getCarbonMonoxideMeasurementBetweenTimestamps(username, from,\n\t\t\t\t\t\t\tto, room_name);\n\n\t\t\tif (carbonMonoxideMeasurementList != null) {\n\t\t\t\treturn new ResponseEntity<List<CarbonMonoxideMeasurement>>(\n\t\t\t\t\t\tcarbonMonoxideMeasurementList, HttpStatus.OK);\n\t\t\t} else {\n\t\t\t\treturn new ResponseEntity<List<CarbonMonoxideMeasurement>>(\n\t\t\t\t\t\tHttpStatus.NOT_FOUND);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(e.getMessage());\n\t\t\treturn new ResponseEntity<List<CarbonMonoxideMeasurement>>(\n\t\t\t\t\tHttpStatus.BAD_REQUEST);\n\t\t}\n\n\t}", "List<ResultsView2> findByCnoBetween(int min,int max);", "public CorrResultModel searchForEvents(String searchString, int page, String lowerBound, String upperBound, List filterNames);", "private List<WavefrontEvent> filterEvents(List<WavefrontEvent> wavefrontEvents, Long startTime, Long endTime) {\n List<WavefrontEvent> filterEvents = wavefrontEvents.stream()\n .filter(event -> event.getEnd() >= startTime && event.getEnd() <= endTime).collect(Collectors.toList());\n log.debug(\"{} events were found out of time bound, startTime: {} and endTime: {}\",\n wavefrontEvents.size() - filterEvents.size(), startTime, endTime);\n return filterEvents;\n }", "public Set<Integer> checkAndFilter(Map<Integer, QuantDataset> quantDatasetToFilter) {\n this.updateQuantDatasetMap(quantDatasetToFilter);\n filtersSet.values().stream().forEach((filter) -> {\n filter.reset();\n });\n return filterSelectionUnit();\n\n }", "private void getMatches(){\r\n\t\tString cLong = commandList.get(2);//holds client's longitude in string form\r\n\t\tString cLat = commandList.get(3);//holds the client's latitude in String form\r\n\r\n\t\tArrayList<String> matchList = new ArrayList<>();//holds user names of found matches\r\n\t\t\r\n\t\tString[] clientPSliders = getPSliders(commandList.get(1));\r\n\r\n\t\t//load in SQL command to find matches using given client's min and max values\r\n\t\tcommand =\"SELECT location.userName FROM (location INNER JOIN users \"\r\n\t\t\t\t+ \"ON location.userName = users.userName) INNER JOIN personalSlider \"\r\n\t\t\t\t+ \"ON users.userName = personalSlider.userName WHERE (((location.longitude) <= \";\r\n\t\tcommand += roundLongUp(cLong) + \" And (location.longitude) >= \";\r\n\t\tcommand += roundLongDown(cLong) + \") AND ((location.latitude) <= \";\r\n\t\tcommand += roundLatUp(cLat) + \" And (location.latitude) >= \";\r\n\t\tcommand += roundLatDown(cLat) + \") AND ((personalSlider.pGender) >= \";\r\n\t\tcommand += commandList.get(4) + \" And (personalSlider.pGender) <= \" + commandList.get(5);\r\n\t\tcommand += \" AND ((personalSlider.pExpression) >= \" + commandList.get(6) +\r\n\t\t\t\t\" And (personalSlider.pExpression) <= \" + commandList.get(7) + \")\";\r\n\t\tcommand += \" AND ((personalSlider.pOrientation) >= \" + commandList.get(8) +\r\n\t\t\t\t\" And (personalSlider.pOrientation) <= \" + commandList.get(9) + \")));\";\r\n\r\n\t\t\r\n\t\ttry {//try block for sending SQL command\r\n\t\t\trs = stmt.executeQuery(command);//send command\r\n\r\n\t\t\twhile(rs.next()){//while there are matches\r\n\t\t\t\tmatchList.add(rs.getString(\"userName\"));//load userName\r\n\t\t\t}\r\n\r\n\t\t\t//each String[] is a match, 0 = userName, 1 = pGenderMin, .....6=pOrientationMax, 7=distance (used later)\r\n\t\t\tArrayList<String[]> fullMatches = getSeekingSlider(matchList);\r\n\r\n\t\t\t//remove the non-overlapping matches, pass clients ratings and the list of matches\r\n\t\t\tcrossMatch(strArrToIntArr(clientPSliders), fullMatches);\r\n\t\t\t\r\n\t\t\t//remove matches over 25 miles away\r\n\t\t\tlimitDistance(Double.valueOf(cLat), Double.valueOf(cLong), fullMatches);\r\n\t\t\t\r\n\t\t\trs = null;//null the result set\r\n\t\t\t\r\n\t\t\tString[] tempStrArr;//holds the personal slider for the current match\r\n\t\t\tfor(String[] currArr: fullMatches){//for all the remaining matches\r\n\t\t\t\ttempStrArr = getPSliders(currArr[0]);//get personal slider for current matches\r\n\t\t\t\tout.println(tempStrArr[0] + \", \" + tempStrArr[1] + \", \"//loads userName, pGen, pExpr, pOrient\r\n\t\t\t\t\t\t\t+ tempStrArr[2] + \", \" + tempStrArr[3] + \", \" + currArr[7]);//line 2\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t}\r\n\t}", "public List<Timetable> getListSearch(String from, String to) throws Exception;", "DbQuery setRangeFilter(long startValue, long endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "@Override\n\tpublic List<Track> getAllTracks() {\n\t\tLOGGER.info(\"Getting All Tracks From DB...\");\n\t\tList<Track> tracks = null;\n\t\ttry {\n\t\t\t\n\t\t\tOrder o1 = new Order(Direction.DESC,\"type\").ignoreCase();\n\t\t\tOrder o2 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\tOrder o3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\n\t\t\tSort sort = new Sort(new Order[]{o1,o2,o3}) ;\n\t\t\t\n\t\t\t\n\t\t\ttracks = tracksRepository.findAll(sort);\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"Error while fetching all Tracks \", e);\n\t\t}\n\t\treturn tracks;\n\t}", "public List<ExperimentSummaryResource> searchExperiments(Timestamp fromTime, Timestamp toTime, Map<String, String> filters, int limit,\n int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {\n List<ExperimentSummaryResource> result = new ArrayList();\n EntityManager em = null;\n try {\n String query = \"SELECT e FROM ExperimentSummary e \" +\n \"WHERE \";\n\n if (filters.get(ExperimentStatusConstants.STATE) != null) {\n String experimentState = ExperimentState.valueOf(filters.get(ExperimentStatusConstants.STATE)).toString();\n query += \"e.state='\" + experimentState + \"' AND \";\n }\n\n if (toTime != null && fromTime != null && toTime.after(fromTime)) {\n query += \"e.creationTime > '\" + fromTime + \"' \" + \"AND e.creationTime <'\" + toTime + \"' AND \";\n }\n\n filters.remove(ExperimentStatusConstants.STATE);\n if (filters != null && filters.size() != 0) {\n for (String field : filters.keySet()) {\n String filterVal = filters.get(field);\n if (field.equals(ExperimentConstants.USER_NAME)) {\n query += \"e.\" + field + \"= '\" + filterVal + \"' AND \";\n } else if (field.equals(ExperimentConstants.GATEWAY_ID)) {\n query += \"e.\" + field + \"= '\" + filterVal + \"' AND \";\n } else if (field.equals(ExperimentConstants.PROJECT_ID)) {\n query += \"e.\" + field + \"= '\" + filterVal + \"' AND \";\n } else {\n if (filterVal.contains(\"*\")) {\n filterVal = filterVal.replaceAll(\"\\\\*\", \"\");\n }\n query += \"e.\" + field + \" LIKE '%\" + filterVal + \"%' AND \";\n }\n }\n }\n query = query.substring(0, query.length() - 5);\n\n //ordering\n if (orderByIdentifier != null && resultOrderType != null\n && orderByIdentifier.equals(Constants.FieldConstants.ExperimentConstants.CREATION_TIME)) {\n String order = (resultOrderType == ResultOrderType.ASC) ? \"ASC\" : \"DESC\";\n query += \" ORDER BY e.\" + ExperimentConstants.CREATION_TIME + \" \" + order;\n }\n\n em = ExpCatResourceUtils.getEntityManager();\n em.getTransaction().begin();\n Query q;\n\n //pagination\n if (offset >= 0 && limit >= 0) {\n q = em.createQuery(query).setFirstResult(offset).setMaxResults(limit);\n } else {\n q = em.createQuery(query);\n }\n\n List resultList = q.getResultList();\n for (Object o : resultList) {\n ExperimentSummary experimentSummary = (ExperimentSummary) o;\n ExperimentSummaryResource experimentSummaryResource =\n (ExperimentSummaryResource) Utils.getResource(ResourceType.EXPERIMENT_SUMMARY,\n experimentSummary);\n result.add(experimentSummaryResource);\n }\n em.getTransaction().commit();\n em.close();\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n throw new RegistryException(e);\n } finally {\n if (em != null && em.isOpen()) {\n if (em.getTransaction().isActive()) {\n em.getTransaction().rollback();\n }\n em.close();\n }\n }\n return result;\n }", "@Override\n public Long countByCriteria(String[] layerList, String[] taxonList, String[] indicList,String colum) {\n //Build the query string base on parameters\n StringBuilder query = new StringBuilder();\n query.append(\"Select count(distinct \"+colum+\") from ait.taxon_info_index where \");\n \n //If there is geografical criteria\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\"(\");\n for(int i = 0;i<layerList.length;i++){\n String[] aux = layerList[i].split(\"~\");\n String layer = aux[0];\n String polygon = aux[1];\n if(i==layerList.length-1){ //last element\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\")\");\n }\n else{\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //If there is taxonomy criteria\n if(taxonList.length>0 && !taxonList[0].equals(\"\")){\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<taxonList.length;i++){\n //Get the name and taxonomical level of the specified taxon\n TaxonIndex ti = taxonIndexDAO.getTaxonIndexByName(taxonList[i]);\n if(ti.getTaxon_id()!=null){\n //To search in the specified taxonomyField\n String levelColum;\n switch (ti.getTaxon_range().intValue()) {\n case 1:\n levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n break;\n case 2:\n levelColum = TaxonomicalRange.PHYLUM.getFieldName();\n break;\n case 3:\n levelColum = TaxonomicalRange.CLASS.getFieldName();\n break;\n case 4:\n levelColum = TaxonomicalRange.ORDER.getFieldName();\n break;\n case 5:\n levelColum = TaxonomicalRange.FAMILY.getFieldName();\n break;\n case 6:\n levelColum = TaxonomicalRange.GENUS.getFieldName();\n break;\n case 7:\n levelColum = TaxonomicalRange.SPECIFICEPITHET.getFieldName();\n break;\n default:\n levelColum = TaxonomicalRange.SCIENTIFICNAME.getFieldName();\n break;\n }\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\") or \");\n }\n }\n else{ //If the taxon doesn't exist on data base\n String levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+-1+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+-1+\") or \");\n }\n }\n }\n query.append(\")\");\n }\n \n //If there is indicators criteria\n if(indicList.length>0 && !indicList[0].equals(\"\")){\n if((taxonList.length>0 && !taxonList[0].equals(\"\"))||(layerList.length>0 && !layerList[0].equals(\"\"))){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<indicList.length;i++){\n if(i==indicList.length-1){ //last element\n query.append(\"(indicator_id = \"+indicList[i]+\")\");\n }\n else{\n query.append(\"(indicator_id = \"+indicList[i]+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //Execute query\n return taxonInfoIndexDAO.countTaxonsByQuery(query.toString());\n }", "public Map<Map<String, Object>, Map<String, Object>> queryFromAndTo(String siteId, int lastHours, String from, String to, String timeType) {\n String[] fromToIndices = filterRangeDateIndices(from, to, lastHours, timeType);\n boolean isLoggedTime = false;\n if (lastHours > 0 || timeType.equals(\"h\") || timeType.equals(\"m\")) {\n isLoggedTime = true;\n }\n return doMultiRequestForDays(siteId, fromToIndices, isLoggedTime, lastHours, timeType);\n }", "public ArrayList getEqkRupturesNearSite() {\n\n //initializing the list for containing the EqkRuptures\n ArrayList probEqkList = new ArrayList();\n int numSources = eqkRupForecast.getNumSources();\n\n //Going over each and every source in the forecast\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex) {\n // get the ith source\n ProbEqkSource source = eqkRupForecast.getSource(sourceIndex);\n int numRuptures = source.getNumRuptures();\n\n //going over all the ruptures in the source\n for (int rupIndex = 0; rupIndex < numRuptures; ++rupIndex) {\n ProbEqkRupture rupture = source.getRupture(rupIndex);\n\n AbstractEvenlyGriddedSurface rupSurface = new EvenlyGridCenteredSurface((EvenlyGriddedSurface)rupture.getRuptureSurface());\n\n\n //getting the iterator for all points on the rupture\n ListIterator it = rupSurface.getAllByRowsIterator();\n //looping over all the rupture pt locations and if any of those lies\n //within the provided distance range then include the rupture in the list.\n while (it.hasNext()) {\n Location ptLoc = (Location) it.next();\n if (region.contains(ptLoc)) {\n probEqkList.add(rupture.clone());\n break;\n }\n }\n }\n }\n return probEqkList;\n }", "public SolrQueryResult query(Map<String, String> params) {\n SolrQuery query = new SolrQuery();\n\n /* enable facetting */\n query.setFacet(true);\n\n /* list of all filters; key: name to display, value: entity parameter */\n List<SolrQueryParameter> filter = new ArrayList<SolrQueryParameter>();\n\n /* list of partition filter */\n List<SolrQueryParameter> partitionFilter = new ArrayList<SolrQueryParameter>();\n\n /*\n * list of filter which have been set by the user (key = filtername, value =\n * list of selections)\n */\n Map<String, List<String>> activeFilterValues = new HashMap<String, List<String>>();\n\n /*\n * determine on which type is searched for (either 'Table' or 'Partition')\n */\n String typeFilterValue = params.get(TYPE);\n filter.add(new SolrQueryParameter(FILTER_TYPE, TYPE, FilterType.EXCLUSIVE, FacetSort.COUNT));\n if (typeFilterValue != null && typeFilterValue.equalsIgnoreCase(TYPE_PARTITION)) {\n typeFilterValue = TYPE_PARTITION;\n for (String parameter : metascopeParameterService.findDistinctParameters()) {\n partitionFilter.add(new SolrQueryParameter(\"Parameter: \" + parameter, parameter + \"_s\", FilterType.AND,\n FacetSort.INDEX));\n }\n for (SolrQueryParameter pFilter : partitionFilter) {\n query.addFacetField(pFilter.getName());\n query.add(\"f.\" + pFilter.getName() + \".facet.sort\", \"index\");\n String filterValue = params.get(pFilter.getName());\n if (filterValue != null && !filterValue.isEmpty()) {\n query.addFilterQuery(pFilter.getName() + \":\" + \"(\" + filterValue.replace(\",\", \" AND \") + \")\");\n }\n\n }\n } else {\n typeFilterValue = TYPE_TABLE;\n }\n query.addFilterQuery(\"{!tag=\" + TYPE + \"}\" + TYPE + \":\" + typeFilterValue);\n query.addFacetField(\"{!ex=\" + TYPE + \"}\" + TYPE);\n\n /* set solr search query parameter 'q' */\n String searchQueryValue = params.get(URLUtil.SEARCH_QUERY_PARAM);\n if (searchQueryValue == null || searchQueryValue.isEmpty()) {\n searchQueryValue = \"*\";\n query.setQuery(searchQueryValue);\n } else {\n String[] queryTerms = searchQueryValue.trim().split(\" \");\n String queryTerm = \"\";\n for (String term : queryTerms) {\n if (term.isEmpty()) {\n continue;\n }\n\n if (!queryTerm.isEmpty()) {\n queryTerm += \" AND \";\n }\n queryTerm += \"*\" + term + \"*\";\n }\n query.setQuery(queryTerm);\n query.setHighlight(true);\n query.setHighlightSimplePre(\"<b>\");\n query.setHighlightSimplePost(\"</b>\");\n query.setHighlightSnippets(100);\n query.set(\"hl.fl\", \"*\");\n }\n\n /* set the remaining filters */\n for (SolrQueryParameter queryFilter : facetFields) {\n filter.add(queryFilter);\n String value = params.get(queryFilter.getName());\n\n String filterQuery = \"\";\n String facetField = \"\";\n if (queryFilter.isExcludeFromFacet()) {\n if (value != null) {\n String[] multipleFilter = value.split(\",\");\n value = \"(\";\n for (int i = 0; i < multipleFilter.length; i++) {\n String filterValue = cleanseValue(multipleFilter[i]).replace(\" \", \"*\");\n value += \"(\" + filterValue + \")\";\n if (i < multipleFilter.length - 1) {\n value += \" \" + getOperator(queryFilter.getFilterType()) + \" \";\n }\n }\n value += \")\";\n }\n filterQuery = \"{!tag=\" + queryFilter.getName() + \"}\" + queryFilter.getName() + \":\" + value;\n facetField = \"{!ex=\" + queryFilter.getName() + \"}\" + queryFilter.getName();\n } else {\n if (value != null) {\n String[] multipleFilter = value.split(\",\");\n value = \"(\";\n for (int i = 0; i < multipleFilter.length; i++) {\n String filterValue = cleanseValue(multipleFilter[i]).replace(\" \", \"*\");\n value += \"(\" + filterValue + \")\";\n if (i < multipleFilter.length - 1) {\n value += \" \" + getOperator(queryFilter.getFilterType()) + \" \";\n }\n }\n value += \")\";\n }\n filterQuery = queryFilter.getName() + \":\" + value;\n facetField = queryFilter.getName();\n }\n\n if (value != null && !value.isEmpty()) {\n query.addFilterQuery(filterQuery);\n }\n query.addFacetField(facetField);\n\n if (queryFilter.getFacetSort().equals(FacetSort.INDEX)) {\n query.add(\"f.\" + queryFilter.getName() + \".facet.sort\", \"index\");\n }\n query.add(\"f.\" + queryFilter.getName() + \".facet.limit\", \"-1\");\n }\n\n /* set facet queries */\n Map<String, String> facetQueryMap = new HashMap<String, String>();\n long now = System.currentTimeMillis() / 1000;\n for (SolrFacetQuery solrFacetQuery : facetQueries) {\n for (SolrHourRange range : solrFacetQuery.getRanges()) {\n long from = range.getFrom() == Long.MAX_VALUE ? 0 : now - (range.getFrom() * 3600);\n String facetQueryString = solrFacetQuery.getName() + \":[\" + from + \" TO \" + now + \"]\";\n query.addFacetQuery(\"{!ex=\" + solrFacetQuery.getName() + \"}\" + facetQueryString);\n facetQueryMap.put(solrFacetQuery.getName() + range.getName(), facetQueryString);\n }\n String value = params.get(solrFacetQuery.getName());\n if (value != null) {\n String fq = \"{!tag=\" + solrFacetQuery.getName() + \"}\" + facetQueryMap.get(solrFacetQuery.getName() + value);\n query.addFilterQuery(fq);\n }\n }\n\n /* always sort the entities (for a deterministic view) */\n query.setSort(ID, ORDER.asc);\n\n /* set pagination information */\n int page = getPageParameter(params);\n int elements = getElementsParameter(params);\n query.setRows(elements);\n query.setStart((page - 1) * elements);\n\n /* execute the query */\n QueryResponse queryResponse = null;\n try {\n queryResponse = solrClient.query(query);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n SolrDocumentList list = queryResponse.getResults();\n\n /* get table / view entities from local repository */\n List<SolrQueryResultEntity> resultEntities = new LinkedList<SolrQueryResultEntity>();\n String resultType = \"\";\n for (SolrDocument solrDocument : list) {\n String id = (String) solrDocument.get(ID);\n\n if (typeFilterValue.equalsIgnoreCase(TYPE_PARTITION)) {\n if (!searchQueryValue.equals(\"*\")) {\n resultEntities.add(new SolrQueryResultEntity(metascopeViewService.findByViewId(id), queryResponse\n .getHighlighting().get(id)));\n } else {\n resultEntities.add(new SolrQueryResultEntity(metascopeViewService.findByViewId(id)));\n }\n resultType = TYPE_PARTITION;\n } else if (typeFilterValue.equalsIgnoreCase(TYPE_TABLE)) {\n if (!searchQueryValue.equals(\"*\")) {\n resultEntities.add(new SolrQueryResultEntity(metascopeTableService.findByFqdn(id), queryResponse\n .getHighlighting().get(id)));\n } else {\n resultEntities.add(new SolrQueryResultEntity(metascopeTableService.findByFqdn(id)));\n }\n }\n }\n if (resultType.isEmpty()) {\n resultType = TYPE_TABLE;\n }\n\n filter.addAll(partitionFilter);\n\n /* get the facet values and counts */\n Map<String, List<SolrFacet>> facetValues = new HashMap<String, List<SolrFacet>>();\n for (SolrQueryParameter f : filter) {\n if (!f.getName().equals(URLUtil.SEARCH_QUERY_PARAM)) {\n List<SolrFacet> values = new ArrayList<SolrFacet>();\n FacetField facet = queryResponse.getFacetField(f.getName());\n for (Count count : facet.getValues()) {\n values.add(new SolrFacet(count.getName(), count.getCount()));\n }\n facetValues.put(f.getName(), values);\n }\n }\n\n /* remove the type filter */\n filter.remove(0);\n\n for (SolrFacetQuery solrFacetQuery : facetQueries) {\n filter\n .add(new SolrQueryParameter(solrFacetQuery.getDisplayName(), solrFacetQuery.getName(), FilterType.EXCLUSIVE));\n List<SolrFacet> values = new ArrayList<SolrFacet>();\n for (SolrHourRange range : solrFacetQuery.getRanges()) {\n long facetQueryCount = getFacetQueryCount(queryResponse, \"{!ex=\" + solrFacetQuery.getName() + \"}\"\n + facetQueryMap.get(solrFacetQuery.getName() + range.getName()));\n values.add(new SolrFacet(range.getName(), facetQueryCount));\n }\n facetValues.put(solrFacetQuery.getName(), values);\n }\n\n /* get the active filter values which have been selected by the user */\n addToActiveFilterValues(activeFilterValues, params, filter);\n\n /* is a search query */\n boolean isSearchQuery = (searchQueryValue != null && !searchQueryValue.isEmpty() && !searchQueryValue.equals(\"*\"))\n || hasActiveFilters(activeFilterValues);\n\n\n /* build and return the result */\n SolrQueryResult result = new SolrQueryResult().withResultEntities(resultEntities).withResultType(resultType)\n .withFilters(filter).withFacetValues(facetValues).withActiveFilterValues(activeFilterValues)\n .withSearchQuery(searchQueryValue).withPage(page).withElements(elements)\n .withTotalPages((int) Math.ceil(((double) list.getNumFound()) / elements)).withTotalResults(list.getNumFound())\n .withIsSearchRequest(isSearchQuery);\n return result;\n }", "public List<News> query(List<float[]> waypoints);", "public CorrResultModel searchForEvents(String searchString, int page, HashMap foundEventtypes, String lowerBound, String upperBound, List filterNames);", "private List<DataSource> getProcessedResults (List<DataSource> listOfDataSource, Page pageDetail) {\n List<DataSource> dataSourceList = listOfDataSource;\n List<PageSearch> searchList = pageDetail.getSearchList();\n if (ExecueCoreUtil.isCollectionNotEmpty(searchList)) {\n // TODO: -JM- Currently there will be only one search object, change later if there are multiple searches\n PageSearch search = searchList.get(0);\n // check for the search info\n if (PageSearchType.STARTS_WITH == search.getType()) {\n dataSourceList = new ArrayList<DataSource>();\n for (DataSource dataSource : dataSourceList) {\n // TODO: -JM- use the field from the search object\n String cDispName = dataSource.getName();\n if (cDispName.toLowerCase().startsWith(search.getString().toLowerCase())) {\n dataSourceList.add(dataSource);\n }\n }\n } else if (PageSearchType.CONTAINS == search.getType()) {\n dataSourceList = new ArrayList<DataSource>();\n for (DataSource dataSource : dataSourceList) {\n String cDispName = dataSource.getName();\n if (cDispName.toLowerCase().startsWith(search.getString().toLowerCase())) {\n dataSourceList.add(dataSource);\n }\n }\n }\n }\n // modify the page object with the new record count which will modify the page count as well\n pageDetail.setRecordCount(Long.valueOf(dataSourceList.size()));\n List<DataSource> pageDataSources = new ArrayList<DataSource>();\n // manipulate the list to return the set of concepts belonging to the page requested\n int start = (pageDetail.getRequestedPage().intValue() - 1) * pageDetail.getPageSize().intValue();\n int end = start + pageDetail.getPageSize().intValue();\n if (end > pageDetail.getRecordCount().intValue()) {\n end = (pageDetail.getRecordCount().intValue());\n }\n for (int i = start; i < end; i++) {\n pageDataSources.add(dataSourceList.get(i));\n }\n return pageDataSources;\n }", "@GetMapping(\"/filter/{source}/{destination}/{timeSlot}/{skip}/{limit}\")\r\n\tpublic ResponseEntity<List<TripDetails>> getByFilterRequest(@PathVariable(\"source\") String source,\r\n\t\t\t@PathVariable(\"destination\") String destination, @PathVariable(\"timeSlot\") String timeSlot,\r\n\t\t\t@PathVariable(\"skip\") long skip, @PathVariable(\"limit\") int limit) {\r\n\t\r\n List<TripDetails> details= this.bl.getByFilter(source,destination,timeSlot,skip,limit);\r\n return ResponseEntity.status(HttpStatus.OK).body(details); \r\n\t}", "public List<PartitionedThermostatEvent> listAlgoProcessedEventsByThermostatAndTimeRange(Integer thermostatId, Calendar startTime, Calendar endTime) {\n\n String ql = \"SELECT te FROM PartitionedThermostatEvent te WHERE te.type=1 AND te.thermostatId = :thermostatId AND te.status = :status AND te.id.eventSysTime BETWEEN :startTime AND :endTime\";\n Map<String, Object> paramVals = new HashMap<String, Object>();\n paramVals.put(\"status\", ThermostatEventAttributeDef.Status.PROCESSED.status());\n paramVals.put(\"thermostatId\", thermostatId);\n paramVals.put(\"startTime\", startTime);\n paramVals.put(\"endTime\", endTime);\n\n List<PartitionedThermostatEvent> thermostatEvents = listByQuery(ql, paramVals);\n return thermostatEvents;\n }", "@Override\r\n\tpublic int collect(Map<String, String> arguments) {\r\n\t\tinitialize(arguments);\r\n\t\tint count = 0;\r\n\r\n\t\t// Setup the authorization\r\n\t\tinitializeAuthorizationData();\r\n\r\n\t\tReportingServiceManager reportingManager = new ReportingServiceManager(authorizationData);\r\n\t\treportingManager.setStatusPollIntervalInMilliseconds(5000);\r\n\r\n\t\t// Setup the observable window range\r\n\t\tCalendar minRange = Calendar.getInstance();\r\n\t\tminRange.add(Calendar.HOUR, 0-lag-obsWindow);\r\n\t\tCalendar maxRange = Calendar.getInstance();\r\n\t\tmaxRange.add(Calendar.HOUR, 0-lag);\r\n\t\tLOG(\"Query range from: (\"+minRange.getTime()+\" - \"+maxRange.getTime()+\")\");\r\n\r\n\t\t// collect the data\r\n\t\t// do we load from offline or online source ?\r\n\t\tboolean bLoadFromFile = false;\r\n\t\tFile fromFile = null;\r\n\t\tif (loadFromFile != null) {\r\n\t\t\ttry {\r\n\t\t\t\tString[] files = loadFromFile.split(\";\");\r\n\t\t\t\tfromFile = new File(files[files.length-1]);\r\n\t\t\t\tbLoadFromFile = fromFile.exists() && fromFile.isFile();\r\n\t\t\t\tif (files.length > 1) {\r\n\t\t\t\t\tfor (int f = 0; f < files.length - 1; f++) {\r\n\t\t\t\t\t\tprocessFile(new File(files[f]), minRange, maxRange, false, false, null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (Exception ea) {\r\n\t\t\t\tbLoadFromFile = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!bLoadFromFile) {\r\n\t\t\t// Load From API (online)\r\n\t\t\t\r\n\t\t\t// 1. Prepare report request for AdPerformance\r\n\t\t\tReportRequest reportRequest = getAdReport(minRange, maxRange);\r\n\t\t\t// 2. Set Download options\r\n\t\t\tReportingDownloadParameters reportingDownloadParameters = new ReportingDownloadParameters();\r\n\t\t\treportingDownloadParameters.setReportRequest(reportRequest);\r\n\t\t\treportingDownloadParameters.setResultFileDirectory(new File(reportDirectory));\r\n\t\t\treportingDownloadParameters.setResultFileName(System.currentTimeMillis()+\"_AdReport.csv\");\r\n\t\t\treportingDownloadParameters.setOverwriteResultFile(true);\r\n\t\t\t// 3. Download report file from BingAds API (unfortunately Microsoft insists on using the file, there is no stream option)\r\n\t\t\t// We may optionally cancel the downloadFileAsync operation after a specified time interval.\r\n\t\t\tFile resultAdReportFile = null;;\r\n\t\t\ttry {\r\n\t\t\t\tresultAdReportFile = reportingManager.downloadFileAsync(\r\n\t\t\t\t\t\treportingDownloadParameters, \r\n\t\t\t\t\t\tnull).get(3600000, TimeUnit.MILLISECONDS);\r\n\r\n\t\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// 4. Prepare the AdGroupPerformance request\r\n\t\t\treportRequest = getAdGroupReport(minRange, maxRange);\r\n\t\t\tFile resultAdGroupReportFile = null;\r\n\r\n\t\t\t// 5. Set Download options\r\n\t\t\treportingDownloadParameters.setReportRequest(reportRequest);\r\n\t\t\treportingDownloadParameters.setResultFileName(System.currentTimeMillis()+\"_AdGroupReport.csv\");\r\n\t\t\t\r\n\t\t\t// 6. Download the report file\r\n\t\t\ttry {\r\n\t\t\t\tresultAdGroupReportFile = reportingManager.downloadFileAsync(\r\n\t\t\t\t\t\treportingDownloadParameters, \r\n\t\t\t\t\t\tnull).get(3600000, TimeUnit.MILLISECONDS);\r\n\r\n\t\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\t// 7. prepare the DB\r\n\t\t\tinitializeMongoDb();\r\n\r\n\t\t\t// 8. process downloaded files\r\n\t\t\tList<Document> adList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(resultAdReportFile, minRange, maxRange, true, true, adList);\r\n\t\t\tList<Document> adGroupList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(resultAdGroupReportFile, minRange, maxRange, false, true, adGroupList);\r\n\t\t\t\r\n\t\t\tList<Document> allDocs = extrapolateHourlyPerformance(adList, adGroupList);\r\n\t\t\tinsertDocuments(allDocs);\r\n\t\t\t// 9. cleanup\r\n\t\t\tmongoClient.close();\r\n\t\t\tif (removeDownloadedReportFile) {\r\n\t\t\t\tif (resultAdReportFile != null) {\r\n\t\t\t\t\tresultAdReportFile.deleteOnExit();\r\n\t\t\t\t}\r\n\t\t\t\tif (resultAdGroupReportFile != null) {\r\n\t\t\t\t\tresultAdGroupReportFile.deleteOnExit();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t// 1. Prepare DB\r\n\t\t\tinitializeMongoDb();\r\n\t\t\t\r\n\t\t\t// 2. load from provided offline file\r\n\t\t\tList<Document> adGroupList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(fromFile, minRange, maxRange, false, true, null);\r\n\t\t\t\r\n\t\t\t// 3. cleanup\r\n\t\t\tmongoClient.close();\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public Long countByModelAndDate(Integer ue_type, Date startDate, Date endDate){\n\t\tQuery query = em.createQuery(\"select count (c) from BaseData c where c.ue_type = :ue_type AND c.date_time >= :sDate AND c.date_time <= :eDate\");\n\t\tquery.setParameter(\"ue_type\", ue_type);\n\t\tquery.setParameter(\"sDate\",startDate);\n\t\tquery.setParameter(\"eDate\", endDate);\n\t\treturn (Long)query.getSingleResult();\n\t}", "boolean allHits();", "List<Media> search(double latitude, double longitude);", "public Iterable<Point2D> range(RectHV rect) {\n SET<Point2D> point_list = new SET<Point2D>();\n rangesearch(root, rect, point_list);\n return point_list;\n }", "public List<Equipment> findByPriceRange(int from, int to){\n List<Equipment> foundEquipment = new ArrayList<>();\n for(Equipment e: equipment){\n if (e.getPrice() <= to && e.getPrice() >= from){\n foundEquipment.add(e);\n }\n }\n return foundEquipment;\n }", "List<SpotPrice> getByCommodityAndFromDateAndToDateAndLocation(\n Commodity commodity,\n Date fromDate,\n Date toDate,\n Location location\n );", "@Test\r\n public void testAllPoints() {\r\n Path all = backend.getPoints();\r\n int numPointsInterest = 0; // Store number of points of interest\r\n // Verify all intersections\r\n if(all.getPath().size() != intersections.size())\r\n fail(\"Failed to get all intersections\");\r\n // Get number of points of interest\r\n for(int i = 0; i < intersections.size(); i++) {\r\n numPointsInterest += intersections.get(i).getPointOfInterests().size();\r\n }\r\n if(all.getPOI().size() != numPointsInterest)\r\n fail(\"Failed to get all points of interest\");\r\n }", "public void execFuzzySearchRangeFunc(){\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true){\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if(this.searchParam.indexOf(\":\") > -1 ){\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0,idex );\n System.out.println(\"chrom=\"+chrom);\n map.put(\"chrom\",chrom);\n if(this.searchParam.indexOf(\"-\") > -1 ){\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, idex1));\n pend = Integer.parseInt(this.searchParam.substring(idex1+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n map.put(\"endpos\",pend);\n }else {\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n }\n\n }else if(this.searchParam.startsWith(\"chr\") == true){\n map.put(\"chrom\",this.searchParam);\n\n\n }\n }\n }\n\n int idenfilter = 0;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\")==false && this.pvalue.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n List<SearchItemBean> searchlist = (List<SearchItemBean>) baseService.findResultList(\"cn.big.gvk.dm.Search.selectRangeBySearch\",map);\n if( searchlist != null ){\n genotypeBeanList = new ArrayList<GenotypeBean>();\n mapGeneBeanList = new ArrayList<MapGeneBean>();\n for(SearchItemBean tmpbean : searchlist){\n if(tmpbean.getItemType() == 1){ //variant\n Map cmp = new HashMap();\n cmp.put(\"genotypeid\",tmpbean.getItemId());\n GenotypeBean tbean = (GenotypeBean) baseService.findObjectByObject(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",cmp);\n if(tbean != null ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n genotypeBeanList.add(tbean) ;\n }\n\n\n\n\n }else if(tmpbean.getItemType() == 2){//gene\n\n Map cmp = new HashMap();\n cmp.put(\"gid\",tmpbean.getItemId()) ;\n MapGeneBean mgb = (MapGeneBean) baseService.findObjectByObject(\"cn.big.gvk.dm.MapGene.selectMapGeneCount\",cmp);\n if(mgb != null ){\n Map t = new HashMap();\n t.put(\"gId\",mgb.getGid()) ;\n t.put(\"count\",\"count\");\n\n //trait count\n GwasAssociationView gwas = (GwasAssociationView) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectGwasViewByGeneInfo\",t);\n if(gwas != null){\n mgb.setTraitCount(gwas.getTraitCount());\n }\n\n //study count\n StudyBean study = (StudyBean) baseService.findObjectByObject(\"cn.big.gvk.dm.study.selectStudyByMapGeneId\",t);\n if(study != null ){\n mgb.setStudyCount(study.getStudyCount());\n }\n\n //publication count\n PublicationBean publication = (PublicationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.publication.selectPubByGeneId\",t);\n if (publication != null ){\n mgb.setPublicationCount(publication.getPublicationCount());\n }\n mapGeneBeanList.add(mgb) ;\n\n }\n\n\n }\n }\n }\n StringBuffer sb = new StringBuffer();\n //generate hidden html table and then use tableExport.js export\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(mapGeneBeanList != null && mapGeneBeanList.size()>0){\n for(MapGeneBean mapgene: mapGeneBeanList){\n sb.append(mapgene.getMapGeneId()).append(\"\\t\").append(mapgene.getMapGeneChrom()).append(\":\")\n .append(mapgene.getMapGeneStart()).append(\"-\").append(mapgene.getMapGeneEnd()).append(\"\\t\").append(mapgene.getTraitCount()).append(\"\\t\")\n .append(mapgene.getStudyCount()).append(\"\\n\");\n }\n }\n\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "public Trackmatches getTrackmatches() {\n return trackmatches;\n }", "@RequestMapping(value = \"/ng\", method = RequestMethod.GET)\n\tpublic ResponseEntity<List<NaturalGasMeasurement>> getNaturalGasMeasurementBetweenTimestamps(\n\t\t\t@PathVariable String username, @RequestParam(\"from\") long from,\n\t\t\t@RequestParam(\"to\") long to, @RequestParam(value = \"room\", required = false) String room_name) {\n\n\t\tLOG.debug(\"getNaturalGasMeasurementBetweenTimestamps: \" + from + \" and \"\n\t\t\t\t+ to);\n\n\t\tList<NaturalGasMeasurement> naturalGasMeasurement;\n\n\t\ttry {\n\t\t\tnaturalGasMeasurement = gasesMeasurementService\n\t\t\t\t\t.getNaturalGasMeasurementBetweenTimestamps(username, from,\n\t\t\t\t\t\t\tto, room_name);\n\n\t\t\tif (naturalGasMeasurement != null) {\n\t\t\t\treturn new ResponseEntity<List<NaturalGasMeasurement>>(\n\t\t\t\t\t\tnaturalGasMeasurement, HttpStatus.OK);\n\t\t\t} else {\n\t\t\t\treturn new ResponseEntity<List<NaturalGasMeasurement>>(\n\t\t\t\t\t\tHttpStatus.NOT_FOUND);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(e.getMessage());\n\t\t\treturn new ResponseEntity<List<NaturalGasMeasurement>>(\n\t\t\t\t\tHttpStatus.BAD_REQUEST);\n\t\t}\n\n\t}", "@Test\n public void testQueryOnHeterogenousObjects() throws Exception {\n DefaultQueryService.TEST_QUERY_HETEROGENEOUS_OBJECTS = true;\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n for (int i = 0; i < 5; ++i) {\n Portfolio p = new Portfolio(i + 1);\n region.put(i + 1, p);\n }\n\n for (int i = 5; i < 10; ++i) {\n region.put(i + 1, i + 1);\n }\n String queryStr =\n \"Select distinct * from \" + SEPARATOR + \"portfolio1 pf1 where pf1.getID() > 3\";\n Query q = qs.newQuery(queryStr);\n SelectResults rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n Iterator itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID()\", SEPARATOR + \"portfolio1 pf\");\n QueryObserver old = QueryObserverHolder.setInstance(new QueryObserverAdapter() {\n private boolean indexUsed = false;\n\n @Override\n public void beforeIndexLookup(Index index, int oper, Object key) {\n indexUsed = true;\n }\n\n @Override\n public void endQuery() {\n assertTrue(indexUsed);\n }\n });\n\n rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n qs.removeIndex(i1);\n\n queryStr = \"Select distinct * from \" + SEPARATOR + \"portfolio1 pf1 where pf1.pkid > '3'\";\n q = qs.newQuery(queryStr);\n rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n\n i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.pkid\", SEPARATOR + \"portfolio1 pf\");\n QueryObserverHolder.setInstance(new QueryObserverAdapter() {\n private boolean indexUsed = false;\n\n @Override\n public void beforeIndexLookup(Index index, int oper, Object key) {\n indexUsed = true;\n }\n\n @Override\n public void endQuery() {\n assertTrue(indexUsed);\n }\n });\n\n rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n }", "public List<MeteringDataSec> findWithinTimeRange(final Instant startTime, final Instant untilTime) {\n\t\tInstant until = untilTime == null ? startTime.plus(5, ChronoUnit.MINUTES) : untilTime;\n\n\t\tList<MeteringDataSec> matches = meteringDataRepository.findWithinTimeRange(Timestamp.from(startTime), Timestamp.from(until));\n\t\tif (!matches.isEmpty()) {\n\t\t\tLOG.info(\"findWithinTimeRange found {} entries starting with: {}\", matches.size(), matches.get(0).getCreationTime());\n\t\t}\n\n\t\treturn matches;\n\t}", "@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic ServiceResult listTeamConfidence(final TeamConfidence obj, Timestamp startDate, Timestamp endDate){\n\t\tServiceResult result = new ServiceResult();\n\t\tObject temp;\n\t\tPage page = new Page();\n\t\tpage.setRecordsPerPage(10000l);\n\t\tParamChecker pc = new ParamChecker();\n\t\ttry{\n\t\t\tCriteria c = dao.getSession().createCriteria(TeamConfidence.class,\"t\");\n\t\t\tc.createAlias(\"t.project\", \"p\");\n\t\t\tc.add(Restrictions.ge(\"t.createdTime\", startDate));\n\t\t\tc.add(Restrictions.le(\"t.createdTime\", endDate));\n\t\t\tif (pc.isNotEmpty(obj.getCreatedBy())){\n\t\t\t\tc.add(Restrictions.eq(\"t.createdBy\", obj.getCreatedBy()));\n\t\t\t}\n\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getId())){\n\t\t\t\tc.add(Restrictions.eq(\"p.id\", obj.getProject().getId()));\n\t\t\t}\n\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getProductCode())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productCode\", obj.getProject().getProductCode()));\n\t\t\t}\n\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getProductName())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productName\", obj.getProject().getProductName()));\n\t\t\t}\n\t\t\t//search by POD\n\t\t\tif (obj.getProject()!=null){\n\t\t\t Project ref = new Project();\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getRegion())) {\n\t\t\t\t\tref.setRegion(obj.getProject().getRegion());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getPod())) {\n\t\t\t\t\tref.setPod(obj.getProject().getPod());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getCountry())) {\n\t\t\t\t\tref.setCountry(obj.getProject().getCountry());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getLeader())) {\n\t\t\t\t\tref.setLeader(obj.getProject().getLeader());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getManager())) {\n\t\t\t\t\tref.setManager(obj.getProject().getManager());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && obj.getProject().getStatus()!=null && obj.getProject().getStatus().toString().length()>0) {\n\t\t\t\t\tref.setStatus(obj.getProject().getStatus());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getCategory())) {\n\t\t\t\t\tref.setCategory(obj.getProject().getCategory());\n\t\t\t\t}\n\t\t\t\tServiceResult tempResult = searchByInstance(ref, CommonDAO.OP_MODE.CASE_SENSITIVE_LIKE);\n\t\t\t\tif (tempResult.getResult()){\n\t\t\t\t\t//found project\n\t\t\t\t\tList<Project> projectList = (List<Project>) tempResult.getReturnObject();\n\t\t\t\t\tList<String> sb = new ArrayList<>();\n\t\t\t\t\tfor (Project prj:projectList){\n\t\t\t\t\t\t sb.add(prj.getId());\n\t\t\t\t\t}\n\t\t\t\t\tif (sb.size()>0){\n\t\t\t\t\t\tc.add(Restrictions.in(\"p.id\", sb));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tc.addOrder(Order.desc(\"p.pod\")).addOrder(Order.desc(\"t.createdTime\"));\n\t\t\tList<TeamConfidence> resultList = c.list();\n\n\t\t\tif (resultList != null){\n\t\t\t\tresult.setResult(true);\n\t\t\t\tresult.setReturnObject(resultList);\n\t\t\t} else {\n\t\t\t\tresult.setResult(false);\n\t\t\t}\n\t\t} catch (Exception e){\n\t\t\tresult.setResult(false);\n\t\t\tresult.setMessage(\"Error:\"+e);\n\t\t\tlog.error(\"Error getting team confidence: \", e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "List<Media> search(double latitude, double longitude, int distance);", "DbQuery setRangeFilter(int startValue, int endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "private TreeSet<SpatialTemporal> gatherData() {\r\n TreeSet<SpatialTemporal> dataPoints = new TreeSet<>(new Comparator<SpatialTemporal>() {\r\n @Override\r\n public int compare(SpatialTemporal o1, SpatialTemporal o2) {\r\n return (new Double(o1.position)).compareTo(new Double(o2.position));\r\n }\r\n });\r\n\r\n double positionOnRoute = 0;\r\n for (final RoadSegment roadSegment : route) {\r\n for (Vehicle veh : roadSegment) {\r\n if (veh.type() == AgentType.OBSTACLE) {\r\n continue;\r\n }\r\n double position = positionOnRoute + veh.getFrontPosition();\r\n dataPoints.add(new SpatialTemporal(position, veh.getSpeed(), veh.getLength(), veh.getAcc()));\r\n }\r\n positionOnRoute += roadSegment.roadLength();\r\n }\r\n return dataPoints;\r\n }", "@Override\n public List<PrescriptionRecord> findListByParams(Map map) {\n Map<String, Object> param = new HashMap<String, Object>(map);\n \n String sort = (String) map.get(\"sortType\");\n if(sort!=null) {\n param.put(\"sortType\", sort);\n }else {\n param.put(\"sortType\", \"DESC\");\n }\n \n List<ShardMeta> shardMetas = generateShardMetas();\n Integer pageSize = (Integer) param.get(\"pageSize\");\n boolean findRange = StringUtils.isBlank((String) param.get(\"orderNo\")) && pageSize != null;\n Integer startNum = findRange ? (Integer) param.get(\"startNum\") : 0;\n Integer subStartNum = startNum / shardMetas.size();\n \n List<PrescriptionRecord> allOrders = new ArrayList<PrescriptionRecord>();\n try {\n // 指定订单号则跳过\n if (findRange) {\n param.put(\"subStartNum\", subStartNum);\n // 提交第一次查询,查询每个分片的订单范围\n List<Future<List<Long>>> rangeTasks = submitRangeQuery(param, shardMetas, queryPool);\n long minTime = Long.MAX_VALUE;\n long maxTime = Long.MIN_VALUE;\n Iterator<ShardMeta> iterator = shardMetas.iterator();\n // 根据每个分片的订单范围计算出全局的订单范围\n for (int i = 0; i < rangeTasks.size(); i++) {\n ShardMeta shardMeta = iterator.next();\n List<Long> timestamps = rangeTasks.get(i).get();\n if (timestamps.isEmpty()) {\n continue;\n }\n \n shardMeta.setMaxTime(timestamps.get(0));\n shardMeta.setMinTime(timestamps.get(timestamps.size() - 1));\n if (maxTime < shardMeta.getMaxTime()) {\n maxTime = shardMeta.getMaxTime();\n }\n if (minTime > shardMeta.getMinTime()) {\n minTime = shardMeta.getMinTime();\n }\n }\n param.put(\"startTime\", minTime);\n param.put(\"endTime\", maxTime);\n }\n \n // 提交第二次查询,查询每个分片符合范围的订单\n List<Future<List<PrescriptionRecord>>> orderTasks = submitOrderQuery(param, shardMetas, queryPool);\n int offset = 0;\n Iterator<ShardMeta> iterator = shardMetas.iterator();\n List<ShardMeta> offsetShards = new ArrayList<ShardMeta>();\n // 合并所有分片的结果\n for (Future<List<PrescriptionRecord>> orderTask : orderTasks) {\n ShardMeta shardMeta = iterator.next();\n List<PrescriptionRecord> orderViews = orderTask.get();\n if (findRange) {\n if (shardMeta.getMaxTime() == Long.MIN_VALUE) {\n offsetShards.add(shardMeta);\n } else {\n int shardAheadCount = getAheadCount(orderViews, shardMeta.getMaxTime());\n // 累加全局偏移量\n offset += subStartNum - shardAheadCount;\n // 删除不需要后补齐查询的分片信息\n if (orderViews.size() - shardAheadCount < pageSize)\n iterator.remove();\n }\n }\n allOrders.addAll(orderViews);\n }\n \n if (!findRange || allOrders.isEmpty())\n return allOrders;\n /*\n // 进行分片偏移量查询\n if (!offsetShards.isEmpty()) {\n Object startTime = param.get(\"startTime\");\n param.put(\"startTime\", param.get(\"endTime\"));\n param.put(\"endTime\", map.get(\"endTime\"));\n \n List<Future<Long>> offsetTasks = submitOffsetQuery(param, offsetShards, queryPool);\n for (Future<Long> offsetTask : offsetTasks)\n offset += offsetTask.get();\n \n param.put(\"startTime\", startTime);\n }\n \n // 进行第三次查询\n int targetOffset = startNum - offset;\n int endIndex = targetOffset + pageSize;\n if (endIndex > allOrders.size() && !shardMetas.isEmpty()) {\n int backfill = endIndex - allOrders.size();\n param.put(\"backfill\", backfill);\n param.put(\"endTime\", param.get(\"startTime\"));\n param.put(\"startTime\", map.get(\"startTime\"));\n orderTasks = submitOrderQuery(param, shardMetas, queryPool);\n for (Future<List<PrescriptionRecord>> orderTask : orderTasks)\n allOrders.addAll(orderTask.get());\n }\n \n */\n int targetOffset = startNum;\n int endIndex = startNum + pageSize;\n \n if (allOrders.size() <= targetOffset)\n return Collections.EMPTY_LIST;\n \n \n // 对合并后的结果统一排序,并根据全局偏移量定位分页的第一条订单的偏移量,提取分页结果\n \n sortByCreateTime(allOrders);\n return allOrders.subList(targetOffset, Math.min(endIndex, allOrders.size()));\n } catch (Exception e) {\n e.printStackTrace();\n throw new SystemException(e);\n }\n }", "@Override\n\tpublic ResultTO getFileInfoFromInterval(LocalDateTime startDateTime, LocalDateTime endDateTime) {\n\t\tResultTO result = this.getAllFiles();\n\t\tif (result.isError()) {\n\t\t\treturn result;\n\t\t}\n\t\tList<InfoFileTO> infoFileList = result.getFiles();\n\t\tList<InfoFileTO> filterFileList = new ArrayList<>();\n\t\t// If it is void (when some error occurred) it is not executed\n\t\tfor (InfoFileTO infoFileTO : infoFileList) {\n\t\t\tLocalDateTime lastModify = infoFileTO.getLastModify();\n\t\t\tif (lastModify.isAfter(startDateTime) && lastModify.isBefore(endDateTime)) {\n\t\t\t\tfilterFileList.add(infoFileTO);\n\t\t\t}\n\t\t}\n\t\tresult.setFiles(filterFileList);\n\t\treturn result;\n\t}", "Map<String, Long> hits();", "@Query(\"SELECT id, measured_at FROM measurements WHERE measured_at >= :startDate AND measured_at < :endDate\")\n @TypeConverters({DateConverter.class})\n List<MeasurementEvent> findForPeriodTest(Date startDate, Date endDate);", "@ApiOperation(value = \"Get all music track\")\n @GetMapping(\"tracks\")\n public ResponseEntity<?> getAllTrack(){\n ResponseEntity responseEntity;\n try {\n responseEntity = new ResponseEntity<List<Track>>(trackService.getAllTrack(), HttpStatus.CREATED);\n }catch (TrackNotFoundException ex){\n responseEntity = new ResponseEntity(ex.getMessage(), HttpStatus.CONFLICT);\n }\n return responseEntity;\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<GuideStatisticDTO> getGuidesStatisticByPeriod(LocalDateTime start, LocalDateTime end) {\n\t\tStringBuilder query = new StringBuilder(\n\t\t\t\t\"SELECT XS.guide.firstName AS firstName, XS.guide.lastName AS lastName, COUNT(id) AS totalExcursions, \"\n\t\t\t\t\t\t+ \"SUM(XS.details.durationSec) AS excursionsTotalDuration \" + \"FROM Excursion AS XS \"\n\t\t\t\t\t\t+ \"WHERE (XS.start >= :startDate AND XS.end <= :endDate) GROUP BY XS.guide\");\n\t\tSystem.out.println(query.toString());\n\t\tQuery result = sessionFactory.getCurrentSession().createQuery(query.toString());\n\t\tresult.setTimestamp(\"startDate\", Timestamp.valueOf(start));\n\t\tresult.setTimestamp(\"endDate\", Timestamp.valueOf(end));\n\t\tList<GuideStatisticDTO> returnResult = new ArrayList<GuideStatisticDTO>();\n\t\tfor (Object[] obj : (List<Object[]>) result.list()) {\n\t\t\tGuideStatisticDTO listElement = new GuideStatisticDTO();\n\t\t\tlistElement.setFirstName(String.valueOf(obj[0]));\n\t\t\tlistElement.setLastName(String.valueOf(obj[1]));\n\t\t\tlistElement.setTotalExcursions((long) obj[2]);\n\t\t\tlistElement.setExcursionsTotalDuration(LocalTime.MIN.plusSeconds((long) obj[3]));\n\t\t\treturnResult.add(listElement);\n\n\t\t}\n\n\t\treturn returnResult;\n\t\t// return result.list();\n\t}", "void getAdvertsAvailableWithFilter(AdvertFilter filter, Coordinates currentLocation, final AdvertListResult result);", "protected static<T extends FitbitInterval> List<T> filterResults( List<T> results, FitbitQuery query ) {\n\t\tif ( query.atResolution( ) == FitbitResolution.DAILY )\n\t\t\treturn results;\n\t\t\n\t\tList<T> filteredResults = new ArrayList<T>( );\n\t\tfor ( T r : results )\n\t\t\tif ( r.getInterval( ).getStart( ).isAfter( query.from( ) ) && r.getInterval( ).getStart( ).isBefore( query.to( ) ) )\n\t\t\t\tfilteredResults.add( r );\n\t\t\t\t\n\t\treturn filteredResults;\n\t}", "public void testRange() throws IOException, InvalidGeoException\r\n {\n LgteIndexSearcherWrapper searcher = new LgteIndexSearcherWrapper(path);\r\n\r\n //try find Jorge and Bruno documents last year\r\n // In this case the closest one will be in 2007\r\n String query = \"contents:(Jorge Bruno)\";\r\n\r\n LgteQuery lgteQueryResult1;\r\n LgteQuery lgteQueryResult1and2;\r\n try\r\n {\r\n lgteQueryResult1 = LgteQueryParser.parseQuery(query);\r\n lgteQueryResult1and2 = LgteQueryParser.parseQuery(query);\r\n\r\n MyCalendar c1Aux = new MyCalendar(2005,11,20,9,0,10);\r\n MyCalendar c2Aux = new MyCalendar(2007,1,12,20,45,15);\r\n long dif = c2Aux.getTimeInMillis() - c1Aux.getTimeInMillis();\r\n\r\n lgteQueryResult1.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1.getQueryParams().setRadiumMiliseconds(dif -1);\r\n lgteQueryResult1and2.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1and2.getQueryParams().setRadiumMiliseconds(dif+1);\r\n }\r\n catch (ParseException e)\r\n {\r\n fail(e.toString());\r\n return;\r\n }\r\n\r\n //Lets use aos Time Sorter to dont worry about distances and stuff like that, he will do the job\r\n TimeDistanceSortSource dsort1 = new TimeDistanceSortSource();\r\n LgteSort sort1 = new LgteSort(new SortField(\"foo\", dsort1));\r\n\r\n //LgteHits give you Documents and time with unecessary lines of boring code\r\n LgteHits lgteHits1;\r\n LgteHits lgteHits1and2;\r\n lgteHits1 = searcher.search(lgteQueryResult1, sort1);\r\n assertTrue(lgteHits1.length() == 1);\r\n\r\n lgteHits1and2 = searcher.search(lgteQueryResult1and2, sort1);\r\n assertTrue(lgteHits1and2.length() == 2);\r\n\r\n\r\n long time1_0 = lgteHits1.doc(0).getTime().getTime();\r\n long time1and2_0 = lgteHits1and2.doc(0).getTime().getTime();\r\n long time1and2_1 = lgteHits1and2.doc(1).getTime().getTime();\r\n assertTrue(time1_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_1 == new MyCalendar(2007,1,12,20,45,15).getTimeInMillis());\r\n\r\n\r\n searcher.close();\r\n }", "@Override\n public List<ScheduledInterview> getScheduledInterviewsInRangeForUser(\n String userId, Instant minTime, Instant maxTime) {\n TimeRange range = new TimeRange(minTime, maxTime);\n List<ScheduledInterview> scheduledInterviews = getForPerson(userId);\n List<ScheduledInterview> scheduledInterviewsInRange = new ArrayList<ScheduledInterview>();\n for (ScheduledInterview scheduledInterview : scheduledInterviews) {\n if (range.contains(scheduledInterview.when())) {\n scheduledInterviewsInRange.add(scheduledInterview);\n }\n }\n return scheduledInterviewsInRange;\n }", "@Test void process_allPointsInside() {\n\t\tvar alg = (PointTrackerKltPyramid<GrayF32, GrayF32>)createTracker();\n\n\t\talg.process(image);\n\t\talg.spawnTracks();\n\n\t\t// swap in a new tracker which won't change the track states\n\t\talg.tracker = new DummyTracker(null);\n\t\tint N = alg.active.size();\n\t\tassertTrue(N > 10);\n\t\t// put two tracks outside of the image, but still close enough to be tracked by KLT\n\t\talg.active.get(0).setPosition(-1, -2);\n\t\talg.active.get(2).setPosition(image.width + 1, image.height);\n\n\t\t// process it again, location's wont change so two tracks should be dropped since they are outside\n\t\talg.process(image);\n\t\tassertEquals(2, alg.getDroppedTracks(null).size());\n\t\tassertEquals(N - 2, alg.getActiveTracks(null).size());\n\t}", "public ArrayList<Stock> filter(Stock low, Stock high){\n ArrayList<Stock> result = new ArrayList<Stock>();\n ArrayList<Stock> all = this.ShowAll();\n\n//\t\tSystem.out.println(\"in filter\");\n\n for (Stock current : all) {\n StockFilter filter = new StockFilter(low, high, current);\n//\t\t\tSystem.out.println(low.getHigh()+\" \"+high.getHigh());\n//\t\t\tSystem.out.println(current.getHigh());\n\n if (filter.filt())\n result.add(current);\n }\n return result;\n }", "@GetMapping(\"Track\")\n public ResponseEntity<?> getAllTrack() {\n return new ResponseEntity<>(trackService.getAllTracks(), HttpStatus.OK);\n }", "public static TwitterStream filter(TwitterStreamConfiguration tws, TwitterStreamHandler handler,\n Collection<Long> follows, Collection<String> tracks, Collection<String> locations) throws IOException, OAuthException {\n\n String postBody = buildFilterContents(follows, tracks, locations);\n //build get params\n HttpParams getParams = new BasicHttpParams();\n if (tws.getCount() != null) getParams.setIntParameter(\"count\", tws.getCount());\n if (tws.isDelimited()) getParams.setParameter(\"delimited\", tws.getDelimited());\n //send request\n HttpRequestBase conn = buildConnection(FILTER_URL, getParams, tws, postBody);\n return new TwitterStream(conn, handler);\n }", "@GET(\"/tracks?client_id=\"+ Contants.CLIENT_ID)\n /**\n * this @Query might give us something like this:\n * https://api.soundcloud.com/tracks?client_id=1233be8128198789963a226f93916311&created_at[from]=\"10/11/2014\"\n * the string \"10/11/2014\" will be @param date\n */\n public void getTrack(@Query(\"created_at[from]\") String date, Callback<List<SoundCloudModel>> response);", "@Test\r\n public void testSinglePoints() {\r\n String searchIntersection = \"Randall & Dayton\";\r\n Path path = backend.getPoints(searchIntersection);\r\n ArrayList<String> points = path.getPOI();\r\n // Search for 'Randall & Dayton' point of interest\r\n if(!points.contains(\"Vantage Point\"))\r\n fail(\"Failed to find points of interest\");\r\n }", "public static int count_overlap_regions(ArrayList<RegionVO> user_set, ArrayList<RegionVO> test_set){\n\t\tint i = 0, j = 0, count = 0;\n\t\t\n\t\twhile(i < user_set.size() && j < test_set.size()){\n\t\t\t\n\t\t\tif (user_set.get(i).getChr_id() == test_set.get(j).getChr_id() \n\t\t\t\t\t&& Math.max(user_set.get(i).getStart(), test_set.get(j).getStart()) \n\t\t\t\t\t\t<= Math.min(user_set.get(i).getEnd(), test_set.get(j).getEnd())){\n\t\t\t\t\n\t\t\t\tint overlap = Math.min(user_set.get(i).getEnd(), test_set.get(j).getEnd()) - Math.max(user_set.get(i).getStart(), test_set.get(j).getStart());\n\t\t\t\t\n\t\t\t\t//if (overlap > (user_set.get(i).end - user_set.get(i).start) / 2) {\n\t\t\t\tif (overlap > 0) {\t\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\ti++;\n\t\t\t\tj++;\n\t\t\t}else if (user_set.get(i).compareTo(test_set.get(j)) > 0) j++;\n\t\t\telse{ \n\t\t\t\ti++;\n\t\t\t\tSystem.out.println(\"Length: \" + (user_set.get(i).getEnd() - user_set.get(i).getStart())/10000);\n\t\t\t\tSystem.out.printf(\"chrom: %s, start: %d, end: %d\\n\", user_set.get(i).getChrom(), user_set.get(i).getStart(), user_set.get(i).getEnd());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn count;\n\t}" ]
[ "0.52351207", "0.49520648", "0.49225038", "0.48878023", "0.4788133", "0.47840288", "0.4671202", "0.4623134", "0.46226248", "0.459414", "0.45899218", "0.45800206", "0.4572939", "0.45459163", "0.4544028", "0.4531046", "0.45224684", "0.4515771", "0.4509309", "0.44902077", "0.44848973", "0.4462317", "0.44551912", "0.44450575", "0.4443633", "0.44413096", "0.4440705", "0.4431773", "0.44231853", "0.4410521", "0.44043392", "0.4398607", "0.43985462", "0.4397064", "0.4378884", "0.4374379", "0.43709487", "0.43649387", "0.43610027", "0.4354046", "0.43527436", "0.43326283", "0.43146035", "0.43083256", "0.43038732", "0.4298688", "0.4292779", "0.4277256", "0.42760134", "0.42679134", "0.4266572", "0.42624384", "0.4257945", "0.42246217", "0.42193103", "0.4218869", "0.42176554", "0.42166314", "0.42161733", "0.4215223", "0.42076978", "0.42057908", "0.42035997", "0.41959003", "0.41924316", "0.41822043", "0.41785806", "0.41760004", "0.41750544", "0.41708386", "0.41704965", "0.4158112", "0.41562232", "0.41507417", "0.4148252", "0.41452715", "0.41430286", "0.41392973", "0.41274127", "0.4124435", "0.41213444", "0.41137293", "0.41119474", "0.41092324", "0.41081962", "0.41036114", "0.41000015", "0.40997568", "0.40953106", "0.40945706", "0.40898633", "0.40834868", "0.4082579", "0.40820011", "0.40817", "0.40788275", "0.40776807", "0.40752262", "0.40706155", "0.40611735", "0.40582493" ]
0.0
-1
Filters objects matching all points of the given track (works only on track type data). It allows users to specify a particular track to find all other points in the table that fall within specified rangesspatial and temporalof all points of the given track. Additionally, the user can specify another track to see if the two intersect (or go close to each other within the specified ranges). The user also has the flexibility of using different metrics for the spatial distance calculation: Euclidean (flat geometry) or Great Circle (spherical geometry to approximate the Earth's surface distances). The filtered points are stored in a newly created result set. The return value of the function is the number of points in the resultant set (view). This operation is synchronous, meaning that a response will not be returned until all the objects are fully available.
public FilterBySeriesResponse filterBySeries(String tableName, String viewName, String trackId, List<String> targetTrackIds, Map<String, String> options) throws GPUdbException { FilterBySeriesRequest actualRequest_ = new FilterBySeriesRequest(tableName, viewName, trackId, targetTrackIds, options); FilterBySeriesResponse actualResponse_ = new FilterBySeriesResponse(); submitRequest("/filter/byseries", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Measurement> findMeasurementsByTimeRange(Date fromDate, Date toDate) {\n return entityManager.createQuery(\"SELECT m from \" +\n \"Measurement m where m.date >= :fromDate and m.date <= :toDate\", Measurement.class)\n .setParameter(\"fromDate\", fromDate)\n .setParameter(\"toDate\", toDate)\n .getResultList();\n\n }", "boolean hasPagingValues(TrackList<? extends Track> trackList);", "public List<QueryStats> getQueryStats(boolean inTest,\n LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(QueryStats.class));\n return handle.createQuery(inTest ? QueryStats.getExtractQueryinTest(rangeStart, rangeEnd)\n : QueryStats.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(QueryStats.class)\n .list();\n });\n }", "@Override\n public void filter(BoundingBox3d bounds) {\n filter = new boolean[points.size()];\n for (int i = 0; i < filter.length; i++)\n filter[i] = bounds.contains(points.get(i).xyz);\n }", "@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic int[] countRecords(Record record, Timestamp startTime, Timestamp endTime){\n\t\t//System.out.println(\"hello:\"+record);\n\t\tint[] result = {0,0};//0 is passed records, 1 is total executed records\n\t\tCriteria c = dao.getSession().createCriteria(Record.class, \"r\");\n\t\tc.createAlias(\"r.test\", \"t\").createAlias(\"r.test.project\", \"p\");\n\t\tc.add(Restrictions.ge(\"r.startTime\",startTime));\n\t\tc.add(Restrictions.le(\"r.startTime\",endTime));\n\t\tParamChecker pc = new ParamChecker();\n\t\tif (record!=null && record.getTest()!=null && record.getTest().getProject()!=null){\n\t\t\tProject project = record.getTest().getProject();\n\t\t\tif (pc.isFollowPattern(pc.UUID, project.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"p.id\", project.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCategory())){\n\t\t\t\tc.add(Restrictions.eq(\"p.category\", project.getCategory()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCountry())){\n\t\t\t\tc.add(Restrictions.eq(\"p.country\", project.getCountry()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getLeader())){\n\t\t\t\tc.add(Restrictions.eq(\"p.leader\", project.getLeader()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductCode())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productCode\", project.getProductCode()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductName())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productName\", project.getProductName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getRegion())){\n\t\t\t\tc.add(Restrictions.eq(\"p.region\", project.getRegion()));\n\t\t\t}\n\t\t\tif (project.getStatus()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.status\", project.getStatus()));\n\t\t\t}\n\t\t\tif (project.getTargetTestcaseNumber()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.targetTestcaseNumber\", project.getTargetTestcaseNumber()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getPod())){\n\t\t\t\tc.add(Restrictions.eq(\"p.pod\", project.getPod()));\n\t\t\t}\n\t\t}\n\t\tif (record!=null && record.getTest()!=null){\n\t\t\tTest t = record.getTest();\n\t\t\tif (pc.isFollowPattern(pc.UUID, t.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"t.id\", t.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getName())){\n\t\t\t\tc.add(Restrictions.eq(\"t.name\", t.getName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getDescription())){\n\t\t\t\tc.add(Restrictions.eq(\"t.description\", t.getDescription()));\n\t\t\t}\n\t\t\tif (t.getManualExecutionTime()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"t.manualExecutionTime\", t.getManualExecutionTime()));\n\t\t\t}\n\t\t}\n\t\tc.setProjection(Projections.rowCount());\n\t\tresult[1]= ((Long) c.uniqueResult()).intValue();\n\n\t\tc = dao.getSession().createCriteria(Record.class, \"r\");\n\t\tc.createAlias(\"r.test\", \"t\").createAlias(\"r.test.project\", \"p\");\n\t\tif (record!=null && record.getTest()!=null && record.getTest().getProject()!=null){\n\t\t\tProject project = record.getTest().getProject();\n\t\t\tif (pc.isFollowPattern(pc.UUID, project.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"p.id\", project.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCategory())){\n\t\t\t\tc.add(Restrictions.eq(\"p.category\", project.getCategory()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getCountry())){\n\t\t\t\tc.add(Restrictions.eq(\"p.country\", project.getCountry()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getLeader())){\n\t\t\t\tc.add(Restrictions.eq(\"p.leader\", project.getLeader()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductCode())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productCode\", project.getProductCode()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getProductName())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productName\", project.getProductName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getRegion())){\n\t\t\t\tc.add(Restrictions.eq(\"p.region\", project.getRegion()));\n\t\t\t}\n\t\t\tif (project.getStatus()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.status\", project.getStatus()));\n\t\t\t}\n\t\t\tif (project.getTargetTestcaseNumber()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"p.targetTestcaseNumber\", project.getTargetTestcaseNumber()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(project.getPod())){\n\t\t\t\tc.add(Restrictions.eq(\"p.pod\", project.getPod()));\n\t\t\t}\n\t\t}\n\t\tif (record!=null && record.getTest()!=null){\n\t\t\tTest t = record.getTest();\n\t\t\tif (pc.isFollowPattern(pc.UUID, t.getId())){\n\t\t\t\tc.add(Restrictions.eq(\"t.id\", t.getId()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getName())){\n\t\t\t\tc.add(Restrictions.eq(\"t.name\", t.getName()));\n\t\t\t}\n\t\t\tif (pc.isNotEmpty(t.getDescription())){\n\t\t\t\tc.add(Restrictions.eq(\"t.description\", t.getDescription()));\n\t\t\t}\n\t\t\tif (t.getManualExecutionTime()!=null){\n\t\t\t\tc.add(Restrictions.eq(\"t.manualExecutionTime\", t.getManualExecutionTime()));\n\t\t\t}\n\t\t}\n\t\tc.add(Restrictions.ge(\"r.startTime\",startTime));\n\t\tc.add(Restrictions.le(\"r.startTime\",endTime));\n\t\tc.add(Restrictions.isNotNull(\"r.result\"));\n\t\tc.setProjection(Projections.rowCount());\n\t\tresult[0]= ((Long) c.uniqueResult()).intValue();\n\n\t\treturn result;\n\t}", "@Override\n\tpublic List<DisplayResult> getResults(ReferencedEnvelope bounds) {\n\t\t\n\t\tString whereClause = bounds != null ? \"WHERE ST_Transform(geom, 4326) && ST_MakeEnvelope(\"+bounds.getMinX()+\",\"+bounds.getMinY()+\",\"+bounds.getMaxX()+\",\"+bounds.getMaxY()+\") \" : \"\";\n\t\t\n\t\t//Only latest results\n\t\tString query = \"SELECT DISTINCT ON (meshblock_id) id, meshblock_id, operat_score, date_entered, ST_AsText(ST_Transform(centroid,4326)), ST_AsText(ST_Transform(geom,4326)), \"\n\t\t\t\t+ \"natural_elements_score, incivilities_and_nuisance_score, navigation_and_mobility_score, territorial_score \"\n\t\t\t\t+ \"FROM result \"\n\t\t\t\t+ whereClause\n\t\t\t\t+ \"ORDER BY meshblock_id, date_entered DESC;\";\n\n\t\tSystem.out.println(query);\n\t GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();\n\n\t WKTReader reader = new WKTReader(geometryFactory);\n\t \n\t\tRowMapper<DisplayResult> rowMapper = (rs, rowNum) -> {\n\t\t\t\n\t\t\tDisplayResult result = new DisplayResult();\n\t\t\tresult.setResultId(rs.getInt(1));\n\t\t\tresult.setMeshblockId(rs.getInt(2));\n\t\t\tresult.setOperatScore(rs.getDouble(3));\n\t\t\t\t\n\t\t\tresult.setNaturalElementsScore(rs.getDouble(7));\n\t\t\tresult.setIncivilitiesScore(rs.getDouble(8));\n\t\t\tresult.setNavigationScore(rs.getDouble(9));\n\t\t\tresult.setTerritorialScore(rs.getDouble(10));\n\t\t\tPoint point;\n\t\t\ttry {\n\t\t\t\tpoint = (Point) reader.read(rs.getString(5));\n\t\t\t\tresult.setCentroid(point.toString());\n\t\t\t\tresult.setLat(point.getCoordinate().y);\n\t\t\t\tresult.setLng(point.getCoordinate().x);\n\t\t\t\t\t\n\t\t\t\tresult.setGeom(rs.getString(6));\n\t\t\t\t\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\t\n\t\treturn jdbcTemplate.query(query, rowMapper);\n\t\t\n\t}", "private static void getObjects(List<TrackingObject> objects,\n\t\t\tTrackingObject objectToTrack, Mat hsvImage) {\n\t\tMat hsvImageThresholded = new Mat();\n\n\t\t// Threshold the hsv image to filter for Pucks\n\t\tCore.inRange(hsvImage, objectToTrack.HSVmin, objectToTrack.HSVmax,\n\t\t\t\thsvImageThresholded);\n\n\t\t// reduce the noise in the image\n\t\treduceNoise(hsvImageThresholded);\n\n\t\t// Find list of Pucks\n\t\tfindObjects(hsvImageThresholded, objectToTrack, objects);\n\n\t}", "@GET\n\t@Produces(\"application/json\")\n\t@Path(\"within\")\n\tpublic List<Pizzerias> findPizzeriasWithin(@QueryParam(\"lat1\") float lat1,\n @QueryParam(\"lon1\") float lon1, @QueryParam(\"lat2\") float lat2,\n @QueryParam(\"lon2\") float lon2) {\n dbConnection.checkDatabase();\n\t\tArrayList<Pizzerias> allPizzeriasList = new ArrayList<Pizzerias>();\n\t\tMongoCollection pizzerias = dbConnection.getCollection();\n\n\t\t// make the query object\n\t\tBasicDBObject spatialQuery = new BasicDBObject();\n\n\t\tArrayList<double[]> boxList = new ArrayList<double[]>();\n\t\tboxList.add(new double[] { new Float(lat2), new Float(lon2) });\n\t\tboxList.add(new double[] { new Float(lat1), new Float(lon1) });\n\n\t\tBasicDBObject boxQuery = new BasicDBObject();\n\t\tboxQuery.put(\"$box\", boxList);\n\n\t\tspatialQuery.put(\"pos\", new BasicDBObject(\"$within\", boxQuery));\n\t\tSystem.out.println(\"Using spatial query: \" + spatialQuery.toString());\n\n\t\tMongoCursor<Document> cursor = pizzerias.find(spatialQuery).iterator();\n\t\ttry {\n\t\t\twhile (cursor.hasNext()) {\n\t\t\t\tallPizzeriasList.add(this.populatePizzeriasInformation(cursor.next()));\n\t\t\t}\n\t\t} finally {\n\t\t\tcursor.close();\n\t\t}\n\t\tSystem.out.println(\"Return \" + allPizzeriasList.size() + \" pizzerias\");\n\n\t\treturn allPizzeriasList;\n\t}", "List<Media> search(double latitude, double longitude, long maxTimeStamp, long minTimeStamp, int distance);", "public List<Point> query(Rectangle rectangle) {\n if (!boundary.intersects(rectangle)) {\n return Collections.emptyList();\n }\n\n List<Point> found = new ArrayList<>();\n points.stream()\n .filter(rectangle::contains)\n .forEach(found::add);\n\n if (isSubdivided) {\n found.addAll(nw.query(rectangle));\n found.addAll(ne.query(rectangle));\n found.addAll(se.query(rectangle));\n found.addAll(sw.query(rectangle));\n }\n\n return found;\n }", "public interface TrackSearchClient<T extends Track> {\n\n /**\n * Search for tracks using a string containing keywords.\n * @param search keywords to search for.\n * @return a tracklist containing all found tracks.\n * @throws TrackSearchException when the client encountered a problem on searching.\n */\n TrackList<T> getTracksForSearch(String search) throws TrackSearchException;\n\n /**\n * Search for the next tracks for last result.\n * @param trackList a previous search result for that client.\n * @return a tracklist containing the next tracks available.\n * @throws TrackSearchException when the client encounters a problem on getting the next tracks.\n */\n TrackList<T> getNext(TrackList<? extends Track> trackList) throws TrackSearchException;\n\n /**\n * Get the audio stream URL in the highest possible audio resolution.\n * @param track from this client.\n * @return the audio stream URL.\n * @throws TrackSearchException when the URL could not be exposed.\n */\n String getStreamUrl(T track) throws TrackSearchException;\n\n /**\n * Check the tracklist for this client if the paging values to get next are present.\n * @param trackList a previous search result for this client.\n * @return either the paging values are present or not.\n */\n boolean hasPagingValues(TrackList<? extends Track> trackList);\n\n}", "@Override\n public List<AudioTrackContext> getTracksInRange(int indexA, int indexB) {\n\n //make sure startIndex <= endIndex\n int startIndex = indexA < indexB ? indexA : indexB;\n int endIndex = indexA < indexB ? indexB : indexA;\n\n //Collect tracks between the two indices\n int i = 0;\n List<AudioTrackContext> result = new ArrayList<>();\n for (AudioTrackContext atc : getAsListOrdered()) {\n if (i >= startIndex && i < endIndex)\n result.add(atc);\n i++;\n if (i >= endIndex) break;//abort early if we're done\n }\n\n //trigger shuffle queue update if we found tracks to remove\n if (result.isEmpty()) shouldUpdateShuffledQueue = true;\n return result;\n }", "private void buildQueryFilterTemporal(String dateField,\n String startDate,\n String endDate,\n boolean isDatesContainedChecked,\n String namedTimescale, \n String namedTimescaleQueryType,\n TermsList termsList\n ) \n \t\tthrows UnsupportedEncodingException {\n\t boolean endDateSpecified = false;\n\t boolean startDateSpecified = false;\n\t \n /* If the user specified a named time-scale query, search for it\n * in the \"timescale\" field.\n */\n if ((namedTimescale != null) && (!(namedTimescale.equals(\"\")))) {\n termsList.addTerm(namedTimescale);\n String parenthesizedValue = parenthesizeQueryValue(namedTimescale);\n String escapedValue = Search.escapeQueryChars(parenthesizedValue);\n String encodedValue = URLEncoder.encode(escapedValue, \"UTF-8\");\n String timescaleQuery = String.format(\"timescale:%s\", encodedValue);\n updateQString(timescaleQuery);\n }\n \n if ((startDate == null) || (startDate.equals(\"\"))) {\n \tstartDate = \"*\";\n }\n else {\n startDate = ISO8601Utility.formatTimestamp(startDate, \"DAY\");\n if (startDate != null) startDateSpecified = true;\n }\n\n if ((endDate == null) || (endDate.equals(\"\"))) {\n \tendDate = \"NOW\";\n }\n else {\n \tendDate = ISO8601Utility.formatTimestamp(endDate, \"DAY\");\n \tif (endDate != null) endDateSpecified = true;\n }\n\n validateDateRange(startDate, endDate);\n \n // If a start date or an end date was specified, search temporal coverage\n //\n if (startDateSpecified || endDateSpecified) {\n \tString temporalFilter = null;\n \tString collectionFilter = null;\n \tString pubDateFilter = null;\n \tString LEFT_BRACKET = \"%5B\";\n \tString RIGHT_BRACKET = \"%5D\";\n\n if (dateField.equals(\"ALL\") || dateField.equals(\"COLLECTION\")) {\n \t String singleDateQuery = String.format(\"singledate:%s%s+TO+%s%s\", LEFT_BRACKET, startDate, endDate, RIGHT_BRACKET);\n \t String startDateQuery = String.format(\"begindate:%s*+TO+%s%s\", LEFT_BRACKET, endDate, RIGHT_BRACKET);\n \t String endDateQuery = String.format(\"enddate:%s%s+TO+NOW%s\", LEFT_BRACKET, startDate, RIGHT_BRACKET);\n \t collectionFilter = String.format(\"(%s+OR+(%s+AND+%s))\", singleDateQuery, startDateQuery, endDateQuery);\n }\n \n if (dateField.equals(\"ALL\") || dateField.equals(\"PUBLICATION\")) {\n \t pubDateFilter = String.format(\"pubdate:%s%s+TO+%s%s\", LEFT_BRACKET, startDate, endDate, RIGHT_BRACKET);\n }\n \n if (dateField.equals(\"ALL\")) {\n \t temporalFilter = String.format(\"(%s+OR+%s)\", pubDateFilter, collectionFilter);\n }\n else if (dateField.equals(\"COLLECTION\")) {\n \t temporalFilter = collectionFilter;\n }\n else if (dateField.equals(\"PUBLICATION\")) {\n \t temporalFilter = pubDateFilter;\n }\n \n updateFQString(temporalFilter); \n }\n\n }", "private void queryListings(double left, double right, double top, double bottom) {\n ParseQuery<Listing> query = ParseQuery.getQuery(Listing.class);\n query.include(Listing.KEY_AUTHOR);\n query.whereGreaterThanOrEqualTo(Listing.KEY_LONGITUDE, left);\n query.whereLessThanOrEqualTo(Listing.KEY_LONGITUDE, right);\n query.whereGreaterThanOrEqualTo(Listing.KEY_LATITUDE, bottom);\n query.whereLessThanOrEqualTo(Listing.KEY_LATITUDE, top);\n query.findInBackground(new FindCallback<Listing>() {\n @Override\n public void done(List<Listing> listings, ParseException e) {\n // Check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting listings\", e);\n return;\n }\n // Add a marker for each listing on screen\n for (Listing listing : listings) {\n LatLng coordinates = new LatLng(listing.getLatitude(), listing.getLongitude());\n Marker marker = thisMap.addMarker(new MarkerOptions().position(coordinates).title(listing.getCategory()));\n marker.setTag(listing);\n }\n }\n });\n }", "public Iterable<Point2D> range(RectHV rect) {\n\n if (rect == null)\n throw new IllegalArgumentException(\"Got null object in range()\");\n \n Queue<Point2D> pointsInside = new Queue<>();\n \n for (Point2D p : point2DSET) {\n \n double x = p.x();\n double y = p.y();\n if (x >= rect.xmin() && x <= rect.xmax() &&\n y >= rect.ymin() && y <= rect.ymax())\n pointsInside.enqueue(p);\n \n }\n \n return pointsInside;\n }", "public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) throw new IllegalArgumentException(\n \"Null pointer provided instead of a query rectangle\");\n ptsInside = new SET<Point2D>();\n searchForPoints(root, rect);\n return ptsInside;\n }", "@Override\n public List<UserQuery> getQueries(LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(UserQuery.class));\n return handle.createQuery(UserQuery.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(UserQuery.class)\n .list();\n });\n }", "public JSONObject matchPoints(String coordinates) {\n String url = String.format(OSRM_SERVER + \"/match/v1/car/%s?geometries=geojson&overview=full\", coordinates);\n System.out.println(url);\n return fetchResult(url);\n }", "long countByFilter(String keySearch, String brands, Double priceFrom, Double priceTo);", "Set<Ride> queryRidesFromSupplier(Trip trip, Supplier supplier){\n Map<String, String> parameters = journeyRequestLocationsToParameters(trip);\n String parsedParameters = new HttpUrlParameterParser().parseParameters(parameters);\n String urlAddress = REQUEST_ROOT_URL + supplier.toString() + \"?\" + parsedParameters;\n IConnection<HttpURLConnection, String> httpConnectionHandler = new HttpConnectionHandler();\n HttpURLConnection connection = httpConnectionHandler.connect(urlAddress);\n\n if(connection == null){\n return new HashSet<>();\n }\n\n String response = httpConnectionHandler.getResponse(connection);\n return extractRidesFromResponse(response, trip.getNumPassengers(), supplier);\n }", "@Override\n\tpublic PaginationResultsTo<Track> getTracks(Integer pageNum, Integer pageSize) {\n\t\tLOGGER.info(\"Fetching all Tracks from DB for page number : \" + pageNum);\n\t\tPaginationResultsTo<Track> paginationResults = null;\n\t\tif(Util.isNull(pageNum) || Util.isNull(pageSize)) {\n\t\t\tthrow new IllegalArgumentException(\"Missing pageNum/pageSize method arguments\");\n\t\t}\n\t\ttry {\n\t\t\t\n\t\t\tOrder o1 = new Order(Direction.DESC,\"type\").ignoreCase();\n\t\t\tOrder o2 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\tOrder o3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\n\t\t\tSort sort = new Sort(new Order[]{o1,o2,o3}) ;\n\t\t\t\n\t\t\tPageRequest request = new PageRequest(pageNum - 1, pageSize, sort);\n\t\t\t\n\t\t\tPage<Track> tracks = tracksRepository.findAll(request);\n\t\t\tif(!Util.isNull(tracks)) {\n\t\t\t\tpaginationResults = new PaginationResultsTo<Track>();\n\t\t\t\tpaginationResults.setPageNumber(pageNum);\n\t\t\t\tpaginationResults.setPageSize(pageSize);\n\t\t\t\tpaginationResults.setTotalNumberOfPages(tracks.getTotalPages());\n\t\t\t\tpaginationResults.setTotalNumberOfResults(tracks.getTotalElements());\n\t\t\t\tpaginationResults.setResults(tracks.getContent());\n\t\t\t\ttracks.getTotalPages();\n\t\t\t}\n\t\t} catch(Exception e){\n\t\t\tLOGGER.error(\"Error while retreiving all Tracks for Pagination --> page Number : \" + pageNum + \" , Page Size : \" + pageSize, e);\n\t\t}\n\n\t\treturn paginationResults;\n\t}", "public void filterLocations(double rad, double centerlat, double centerlng) {\n Location center = new Location(\"Center\");\n center.setLatitude(centerlat);\n center.setLongitude(centerlng);\n Location point = new Location(\"Point\");\n\n // New arraylist of filter things.\n filtered = new ArrayList<DiscoverTile>();\n\n // For loop calculate straight line distance between each tile object in database and center.\n for (int i = 0; i < Test.size(); i++) {\n //Log.d(TAG, \"onMapDialogFragmentInteraction: Rad is \" + rad);\n point.setLatitude(Test.get(i).getLat());\n point.setLongitude(Test.get(i).getLng());\n float distance = center.distanceTo(point);\n //Log.d(TAG, \"onMapDialogFragmentInteraction: distance is \" + distance);\n if (distance <= rad) {\n // Test.get(i) is in the radius. Show selection.\n filtered.add(Test.get(i));\n }\n }\n\n // Create a new tile fragment (separate from disoverTileFragment) called filteredTileFragment,\n // which contains the filtered tiles.\n filteredTileFragment = new DiscoverTileFragment();\n TFmode = useFTF;\n\n Bundle bundle = new Bundle();\n bundle.putParcelableArrayList(\"KEY\", filtered);\n\n filteredTileFragment.setArguments(bundle);\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n fragmentTransaction.replace(R.id.discover_tilefragment, filteredTileFragment);\n //fragmentTransaction.addToBackStack(null);\n fragmentTransaction.commit();\n\n\n }", "public List<PointDetails> getIntersectingPoints(Rectangle2D rect) {\n\t\tboolean useParallelStreaming = numPoints() > 10000;\n\t\treturn Utils.parallelize(getPointDetails().stream(), useParallelStreaming)\n\t\t\t\t.filter(p->rect.contains(p.location))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "TrackList<T> getTracksForSearch(String search) throws TrackSearchException;", "public static void main(String[] args) {\n \n PointSET pset = new PointSET();\n System.out.println(\"Empty: \" + pset.isEmpty());\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.6));\n pset.insert(new Point2D(0.5, 0.7));\n pset.insert(new Point2D(0.5, 0.8));\n pset.insert(new Point2D(0.1, 0.5));\n pset.insert(new Point2D(0.8, 0.5));\n pset.insert(new Point2D(0.1, 0.1));\n System.out.println(\"Empty: \" + pset.isEmpty());\n System.out.println(\"Size: \" + pset.size());\n System.out.println(\"Nearest to start: \" + pset.nearest(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #1: \" + pset.contains(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #2: \" + pset.contains(new Point2D(0.5, 0.5)));\n System.out.print(\"Range #1: \");\n for (Point2D p : pset.range(new RectHV(0.001, 0.001, 0.002, 0.002)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #2: \");\n for (Point2D p : pset.range(new RectHV(0.05, 0.05, 0.15, 0.15)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #3: \");\n for (Point2D p : pset.range(new RectHV(0.25, 0.35, 0.65, 0.75)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n \n }", "public Asphalt getAsphalt(int x,int y,List<Asphalt> track) {\n\t\treturn track.stream()\n\t\t\t\t .filter(coords -> new Point(x,y).equals(coords))\n\t\t\t\t .findAny()\n\t\t\t\t .orElse(null);\n\t}", "@Override\n public RealmResults<MainModelImp> getRealmResults(String lat, String lon) {\n return realm.where(MainModelImp.class)\n .equalTo(LATITUDE, lat)\n .equalTo(LONGITUDE, lon)\n .findAll();\n }", "void queryTimeSeries(final Message<JsonObject> msg) {\n\n final JsonObject query = msg.body();\n LOG.debug(\"{}\\n{}\", address, query.encodePrettily());\n\n // get the paramsters from the query\n final Range range = rangeParser.parse(query.getJsonObject(\"range\").getString(\"from\"),\n query.getJsonObject(\"range\").getString(\"to\"));\n final long interval = intervalParser.parseToLong(query.getString(\"interval\"));\n final JsonArray targets = query.getJsonArray(\"targets\")\n .stream()\n .map(o -> ((JsonObject) o).getString(\"target\"))\n .collect(toJsonArray());\n\n //build the query and options\n final JsonObject tsQuery = $and(obj(\"n.begin\", $gte(range.getStart())),\n obj(\"n.begin\", $lte(range.getEnd())),\n obj(\"t.name\", $in(targets)));\n\n final FindOptions findOptions = new FindOptions().setFields(obj().put(\"t.name\", 1)\n .put(\"n.begin\", 1)\n .put(\"n.value\", 1)\n .put(\"_id\", 0)).setSort(obj(\"n.begin\", 1));\n\n long start = System.currentTimeMillis();\n //execute search and process response\n client.findWithOptions(collectionName, tsQuery, findOptions, result -> {\n\n if (result.succeeded()) {\n JsonArray resp = processResponse(range, r -> range.splitEvery(interval), targets, result);\n long end = System.currentTimeMillis();\n LOG.debug(\n \"Sending response with {} timeseries and {} datapoints (after {} ms)\",\n resp.size(),\n resp.stream()\n .map(o -> ((JsonObject) o).getJsonArray(\"datapoints\"))\n .collect(Collectors.summingInt(JsonArray::size)),\n (end - start));\n msg.reply(resp);\n\n } else {\n LOG.error(\"Annotation query failed\", result.cause());\n msg.reply(arr());\n }\n\n });\n }", "private void collectForRange(Date startDate, Date endDate) {\n Flux<SolarFlare> flux = solarFlareMapper.transferCollectionToEntityFlux(\n donkiClient.getBetweenRange(startDate, endDate)\n );\n solarFlareRepository.saveAll(flux)\n .count()\n .subscribe(total -> log.info(\"Collected {} data sets solar flares\", total));\n }", "public Track[] searchTracks_Sync(String q) {\n SearchTracksRequest searchTracksRequest = spotifyApi.searchTracks(q)\n .limit(10)\n .offset(0)\n .build();\n Track[] tracks = null;\n try {\n final Paging<Track> trackPaging = searchTracksRequest.execute();\n\n System.out.println(\"Total: \" + trackPaging.getTotal());\n tracks = trackPaging.getItems();\n /*\n for (int i=0; i<tracks.length; i++){\n System.out.println(\"track = \" + tracks[i].getName());\n System.out.println(\"artist = \" + tracks[i].getArtists()[0].getName());\n System.out.println(\"album = \"+ tracks[i].getAlbum().getName());\n //System.out.println(\"\")\n }\n */\n } catch (IOException | SpotifyWebApiException e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n\n return tracks;\n }", "@Override\n public List<Object[]> getStatistics(String owner, StatisticsGroup group, String from, String to) {\n String date = parseDateLimit(from, to);\n String groupHQL = this.groupToHQL(group);\n List<Object[]> list = (List<Object[]>) getHibernateTemplate().findByNamedParam(\"select count(*), \"\n + \"count(distinct ipAddress), \" + groupHQL + \" \"\n + \"from SearchEvent \"\n + \"where owner like :owner \"\n + date + \" \"\n + \"group by col_2_0_\", \"owner\", owner);\n return list;\n }", "@Override\n public Long countByCriteria(String x,String y,int xType,int yType){\n //Build the query string base on parameters\n StringBuilder query = new StringBuilder();\n query.append(\"Select count(distinct scientific_name_id) from ait.taxon_info_index where \");\n \n switch(xType){\n case 1: //Taxonomical criteria\n query.append(getTaxoCriteria(x));\n break;\n case 2: //Geographical criteria\n query.append(getGeoCriteria(x));\n break;\n case 3: //Indicators criteria\n query.append(getIndiCriteria(x));\n break;\n }\n \n switch(yType){\n case 1: //Taxonomical criteria\n query.append(\" and \"+getTaxoCriteria(y));\n break;\n case 2: //Geographical criteria\n query.append(\" and \"+getGeoCriteria(y));\n break;\n case 3: //Indicators criteria\n query.append(\" and \"+getIndiCriteria(y));\n break;\n }\n \n //Execute query\n return taxonInfoIndexDAO.countTaxonsByQuery(query.toString());\n }", "@Override\n public List<Revenue> revenuesForTime(long startTime, long endTime) {\n List<Revenue> revenues = revenueRepository.findAll();\n List<Revenue> foundRevenues = new ArrayList<>();\n for(Revenue revenue : revenues){\n if(revenue.getTimestamp() == startTime || revenue.getTimestamp() == endTime){\n foundRevenues.add(revenue);\n continue;\n }\n if(revenue.getTimestamp() > startTime && revenue.getTimestamp() < endTime ){\n foundRevenues.add(revenue);\n }\n }\n return foundRevenues;\n }", "private DescriptiveStatistics calculateStatsForRange(List<JsonObject> datapoints, String targetName, Range range) {\n\n return datapoints.stream()\n .filter(js -> targetName.equals(js.getJsonObject(\"t\").getString(\"name\"))\n && range.contains(js.getJsonObject(\"n\").getLong(\"begin\")))\n .map(js -> js.getJsonObject(\"n\").getLong(\"value\"))\n .map(Long::doubleValue)\n .collect(descStatsCollector());\n }", "public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) {\n throw new IllegalArgumentException();\n }\n SET<Point2D> result = new SET<Point2D>();\n for (Point2D point : points) {\n if (rect.contains(point))\n result.add(point);\n }\n return result;\n }", "public <T extends GameObject> T[] senseNearbyGameObjects(Class<T> type);", "public List<Hotel> findByPriceBetween(double low, double high);", "@Override\n public List<Object[]> getStatistics(String owner, StatisticsGroup group, SearchEventType type, String from, String to) {\n String date = parseDateLimit(from, to);\n String groupHQL = this.groupToHQL(group);\n List<Object[]> list = (List<Object[]>) getHibernateTemplate().findByNamedParam(\"select count(*), \"\n + \"count(distinct ipAddress), \" + groupHQL + \" \"\n + \"from SearchEvent \"\n + \"where owner like :owner \"\n + \"and eventType = :type \"\n + date + \" \"\n + \"group by col_2_0_\", new String[]{\"owner\", \"type\"}, new Object[]{owner, type});\n return list;\n }", "public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) throw new NullPointerException();\n TreeSet<Point2D> inRangeSet = new TreeSet<>();\n for (Point2D point : pointSet) {\n if (rect.contains(point)) {\n inRangeSet.add(point);\n }\n }\n return inRangeSet;\n }", "ArrayList<Transaction> getFilteredTransactions(long startTimestamp,\n long endTimestamp, long accountNumber, boolean showExpense, boolean showIncome) {\n ArrayList<Transaction> filteredTransactionList = new ArrayList<>();\n int low = 0;\n int high = transactionList.size() - 1;\n if (startTimestamp != -1 && endTimestamp != -1) {\n /*\n If start and end time are set, then get the range of\n transaction corresponding to the time range.\n */\n Points p = getTransactions(startTimestamp, endTimestamp);\n if (p.x == -1 && p.y == -1)\n return filteredTransactionList;\n low = p.x;\n high = p.y;\n }\n for (int i = low; i <= high; i++) {\n if (accountNumber != -1 && transactionList.get(i).transactionAccountNumber != accountNumber)\n continue;\n if (!showExpense && (transactionList.get(i).transactionType == 0 || transactionList.get(i).transactionType == 2))\n continue;\n if (!showIncome && (transactionList.get(i).transactionType == 1 || transactionList.get(i).transactionType == 3))\n continue;\n filteredTransactionList.add(transactionList.get(i));\n }\n return filteredTransactionList;\n }", "@Override\n\tpublic void queryPoints() {\n\n\t}", "@Override\n\tpublic PaginationResultsTo<Track> getTracks(Integer pageNum, Integer pageSize, String field, String sortOrder) {\n\t\tif (Util.isEmptyString(field)\n\t\t\t\t|| Util.isEmptyString(sortOrder)\n\t\t\t\t|| !(\"ASC\".equalsIgnoreCase(sortOrder) || \"DESC\"\n\t\t\t\t\t\t.equalsIgnoreCase(sortOrder))) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Invalid Arguments to sort Tracks in pagination\");\n\t\t}\n\t\tPaginationResultsTo<Track> paginationResults = null;\n\t\ttry {\n\t\t\t\n\t\t\tOrder o1 = new Order(Direction.fromString(sortOrder), field).ignoreCase();\n\t\t\tOrder o2 = null;\n\t\t\tOrder o3 = null;\n\t\t\tif(\"type\".equalsIgnoreCase(field)) {\n\t\t\t\to2 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\t\to3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\t\t\t} else if(\"country\".equalsIgnoreCase(field)) {\n\t\t\t\to2 = new Order(Direction.DESC,\"type\").ignoreCase();\n\t\t\t\to3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\t\t\t} else {\n\t\t\t\to2 = new Order(Direction.ASC,\"id\").ignoreCase();\n\t\t\t\to3 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\t}\n\t\t\t\n\n\t\t\tSort sort = new Sort(new Order[]{o1,o2,o3}) ;\n\t\t\t\n\t\t\tPageRequest request = new PageRequest(pageNum - 1, pageSize, sort);\n\n\t\t\tPage<Track> tracks = tracksRepository.findAll(request);\n\t\t\tif (!Util.isNull(tracks)) {\n\t\t\t\tpaginationResults = new PaginationResultsTo<Track>();\n\t\t\t\tpaginationResults.setPageNumber(pageNum);\n\t\t\t\tpaginationResults.setPageSize(pageSize);\n\t\t\t\tpaginationResults.setTotalNumberOfPages(tracks.getTotalPages());\n\t\t\t\tpaginationResults.setTotalNumberOfResults(tracks\n\t\t\t\t\t\t.getTotalElements());\n\t\t\t\tpaginationResults.setResults(tracks.getContent());\n\t\t\t\ttracks.getTotalPages();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\n\t\t\t\t\t\"Error while retreiving all Tracks with Sorting for Pagination --> page Number : \"\n\t\t\t\t\t\t\t+ pageNum\n\t\t\t\t\t\t\t+ \" , Page Size : \"\n\t\t\t\t\t\t\t+ pageSize\n\t\t\t\t\t\t\t+ \" , Sort field : \"\n\t\t\t\t\t\t\t+ field\n\t\t\t\t\t\t\t+ \" , Sort order : \"\n\t\t\t\t\t\t\t+ sortOrder, e);\n\t\t}\n\n\t\treturn paginationResults;\n\t}", "@SuppressWarnings(\"unchecked\") \n public List<Item> getItemsByCategoryByRadiusVLH(String catID, int start,\n int chunkSize,double fromLat,double toLat,double fromLong,\n double toLong){\n EntityManager em = emf.createEntityManager();\n Query query = em.createQuery(\"SELECT i FROM Item i, Product p WHERE \" +\n \"i.productID=p.productID AND p.categoryID = :categoryID \" +\n \"AND((i.address.latitude BETWEEN :fromLatitude AND :toLatitude) AND \" +\n \"(i.address.longitude BETWEEN :fromLongitude AND :toLongitude )) AND i.disabled = 0\" +\n \" ORDER BY i.name\");\n query.setParameter(\"categoryID\",catID);\n query.setParameter(\"fromLatitude\",fromLat);\n query.setParameter(\"toLatitude\",toLat);\n query.setParameter(\"fromLongitude\",fromLong);\n query.setParameter(\"toLongitude\",toLong);\n List<Item> items = query.setFirstResult(start).setMaxResults(chunkSize).getResultList();\n em.close();\n return items;\n }", "public Iterable<Point2D> range(RectHV rect) {\n ArrayList<Point2D> returnArray = new ArrayList<Point2D>();\n if (rect == null) {\n throw new IllegalArgumentException(\"rect input is null\");\n }\n for (Point2D i : pointsSet) {\n if (rect.contains(i))\n returnArray.add(i);\n }\n return returnArray;\n }", "private Points getTransactions(long startTimestamp, long endTimestamp) {\n if (startTimestamp > endTimestamp) {\n long tmp = startTimestamp;\n startTimestamp = endTimestamp;\n endTimestamp = tmp;\n }\n int low = 0;\n int high = transactionList.size() - 1;\n int x = -1;\n int y = -1;\n while (low <= high) {\n int mid = (high + low) >> 1;\n if (transactionList.get(mid).transactionTimestamp >= startTimestamp) {\n x = mid;\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n if (x == -1) {\n return new Points(-1, -1);\n }\n\n low = 0;\n high = transactionList.size() - 1;\n while (low <= high) {\n int mid = (high + low) >> 1;\n if (transactionList.get(mid).transactionTimestamp <= endTimestamp) {\n y = mid;\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n if (y == -1) {\n return new Points(-1, -1);\n }\n return new Points(x, y);\n }", "Stream<DataPoint> getHistoryData(Symbol symbol, LocalDateTime startTime, LocalDateTime endTime, int numberOfPoints);", "@RequestMapping(value = \"/co\", method = RequestMethod.GET)\n\tpublic ResponseEntity<List<CarbonMonoxideMeasurement>> getCarbonMonoxideMeasurementsBetweenTimestamps(\n\t\t\t@PathVariable String username, @RequestParam(\"from\") long from,\n\t\t\t@RequestParam(\"to\") long to, @RequestParam(value = \"room\", required = false) String room_name) {\n\n\t\tLOG.debug(\"getCarbonMonoxideMeasurementsBetweenTimestamps: \" + from + \" and \"\n\t\t\t\t+ to);\n\n\t\tList<CarbonMonoxideMeasurement> carbonMonoxideMeasurementList;\n\n\t\ttry {\n\t\t\tcarbonMonoxideMeasurementList = gasesMeasurementService\n\t\t\t\t\t.getCarbonMonoxideMeasurementBetweenTimestamps(username, from,\n\t\t\t\t\t\t\tto, room_name);\n\n\t\t\tif (carbonMonoxideMeasurementList != null) {\n\t\t\t\treturn new ResponseEntity<List<CarbonMonoxideMeasurement>>(\n\t\t\t\t\t\tcarbonMonoxideMeasurementList, HttpStatus.OK);\n\t\t\t} else {\n\t\t\t\treturn new ResponseEntity<List<CarbonMonoxideMeasurement>>(\n\t\t\t\t\t\tHttpStatus.NOT_FOUND);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(e.getMessage());\n\t\t\treturn new ResponseEntity<List<CarbonMonoxideMeasurement>>(\n\t\t\t\t\tHttpStatus.BAD_REQUEST);\n\t\t}\n\n\t}", "List<ResultsView2> findByCnoBetween(int min,int max);", "public CorrResultModel searchForEvents(String searchString, int page, String lowerBound, String upperBound, List filterNames);", "private List<WavefrontEvent> filterEvents(List<WavefrontEvent> wavefrontEvents, Long startTime, Long endTime) {\n List<WavefrontEvent> filterEvents = wavefrontEvents.stream()\n .filter(event -> event.getEnd() >= startTime && event.getEnd() <= endTime).collect(Collectors.toList());\n log.debug(\"{} events were found out of time bound, startTime: {} and endTime: {}\",\n wavefrontEvents.size() - filterEvents.size(), startTime, endTime);\n return filterEvents;\n }", "public Set<Integer> checkAndFilter(Map<Integer, QuantDataset> quantDatasetToFilter) {\n this.updateQuantDatasetMap(quantDatasetToFilter);\n filtersSet.values().stream().forEach((filter) -> {\n filter.reset();\n });\n return filterSelectionUnit();\n\n }", "private void getMatches(){\r\n\t\tString cLong = commandList.get(2);//holds client's longitude in string form\r\n\t\tString cLat = commandList.get(3);//holds the client's latitude in String form\r\n\r\n\t\tArrayList<String> matchList = new ArrayList<>();//holds user names of found matches\r\n\t\t\r\n\t\tString[] clientPSliders = getPSliders(commandList.get(1));\r\n\r\n\t\t//load in SQL command to find matches using given client's min and max values\r\n\t\tcommand =\"SELECT location.userName FROM (location INNER JOIN users \"\r\n\t\t\t\t+ \"ON location.userName = users.userName) INNER JOIN personalSlider \"\r\n\t\t\t\t+ \"ON users.userName = personalSlider.userName WHERE (((location.longitude) <= \";\r\n\t\tcommand += roundLongUp(cLong) + \" And (location.longitude) >= \";\r\n\t\tcommand += roundLongDown(cLong) + \") AND ((location.latitude) <= \";\r\n\t\tcommand += roundLatUp(cLat) + \" And (location.latitude) >= \";\r\n\t\tcommand += roundLatDown(cLat) + \") AND ((personalSlider.pGender) >= \";\r\n\t\tcommand += commandList.get(4) + \" And (personalSlider.pGender) <= \" + commandList.get(5);\r\n\t\tcommand += \" AND ((personalSlider.pExpression) >= \" + commandList.get(6) +\r\n\t\t\t\t\" And (personalSlider.pExpression) <= \" + commandList.get(7) + \")\";\r\n\t\tcommand += \" AND ((personalSlider.pOrientation) >= \" + commandList.get(8) +\r\n\t\t\t\t\" And (personalSlider.pOrientation) <= \" + commandList.get(9) + \")));\";\r\n\r\n\t\t\r\n\t\ttry {//try block for sending SQL command\r\n\t\t\trs = stmt.executeQuery(command);//send command\r\n\r\n\t\t\twhile(rs.next()){//while there are matches\r\n\t\t\t\tmatchList.add(rs.getString(\"userName\"));//load userName\r\n\t\t\t}\r\n\r\n\t\t\t//each String[] is a match, 0 = userName, 1 = pGenderMin, .....6=pOrientationMax, 7=distance (used later)\r\n\t\t\tArrayList<String[]> fullMatches = getSeekingSlider(matchList);\r\n\r\n\t\t\t//remove the non-overlapping matches, pass clients ratings and the list of matches\r\n\t\t\tcrossMatch(strArrToIntArr(clientPSliders), fullMatches);\r\n\t\t\t\r\n\t\t\t//remove matches over 25 miles away\r\n\t\t\tlimitDistance(Double.valueOf(cLat), Double.valueOf(cLong), fullMatches);\r\n\t\t\t\r\n\t\t\trs = null;//null the result set\r\n\t\t\t\r\n\t\t\tString[] tempStrArr;//holds the personal slider for the current match\r\n\t\t\tfor(String[] currArr: fullMatches){//for all the remaining matches\r\n\t\t\t\ttempStrArr = getPSliders(currArr[0]);//get personal slider for current matches\r\n\t\t\t\tout.println(tempStrArr[0] + \", \" + tempStrArr[1] + \", \"//loads userName, pGen, pExpr, pOrient\r\n\t\t\t\t\t\t\t+ tempStrArr[2] + \", \" + tempStrArr[3] + \", \" + currArr[7]);//line 2\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t}\r\n\t}", "public List<Timetable> getListSearch(String from, String to) throws Exception;", "@Override\n\tpublic List<Track> getAllTracks() {\n\t\tLOGGER.info(\"Getting All Tracks From DB...\");\n\t\tList<Track> tracks = null;\n\t\ttry {\n\t\t\t\n\t\t\tOrder o1 = new Order(Direction.DESC,\"type\").ignoreCase();\n\t\t\tOrder o2 = new Order(Direction.DESC,\"country\").ignoreCase();\n\t\t\tOrder o3 = new Order(Direction.ASC,\"id\").ignoreCase();\n\n\t\t\tSort sort = new Sort(new Order[]{o1,o2,o3}) ;\n\t\t\t\n\t\t\t\n\t\t\ttracks = tracksRepository.findAll(sort);\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"Error while fetching all Tracks \", e);\n\t\t}\n\t\treturn tracks;\n\t}", "DbQuery setRangeFilter(long startValue, long endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "@Override\n public Long countByCriteria(String[] layerList, String[] taxonList, String[] indicList,String colum) {\n //Build the query string base on parameters\n StringBuilder query = new StringBuilder();\n query.append(\"Select count(distinct \"+colum+\") from ait.taxon_info_index where \");\n \n //If there is geografical criteria\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\"(\");\n for(int i = 0;i<layerList.length;i++){\n String[] aux = layerList[i].split(\"~\");\n String layer = aux[0];\n String polygon = aux[1];\n if(i==layerList.length-1){ //last element\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\")\");\n }\n else{\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //If there is taxonomy criteria\n if(taxonList.length>0 && !taxonList[0].equals(\"\")){\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<taxonList.length;i++){\n //Get the name and taxonomical level of the specified taxon\n TaxonIndex ti = taxonIndexDAO.getTaxonIndexByName(taxonList[i]);\n if(ti.getTaxon_id()!=null){\n //To search in the specified taxonomyField\n String levelColum;\n switch (ti.getTaxon_range().intValue()) {\n case 1:\n levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n break;\n case 2:\n levelColum = TaxonomicalRange.PHYLUM.getFieldName();\n break;\n case 3:\n levelColum = TaxonomicalRange.CLASS.getFieldName();\n break;\n case 4:\n levelColum = TaxonomicalRange.ORDER.getFieldName();\n break;\n case 5:\n levelColum = TaxonomicalRange.FAMILY.getFieldName();\n break;\n case 6:\n levelColum = TaxonomicalRange.GENUS.getFieldName();\n break;\n case 7:\n levelColum = TaxonomicalRange.SPECIFICEPITHET.getFieldName();\n break;\n default:\n levelColum = TaxonomicalRange.SCIENTIFICNAME.getFieldName();\n break;\n }\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\") or \");\n }\n }\n else{ //If the taxon doesn't exist on data base\n String levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+-1+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+-1+\") or \");\n }\n }\n }\n query.append(\")\");\n }\n \n //If there is indicators criteria\n if(indicList.length>0 && !indicList[0].equals(\"\")){\n if((taxonList.length>0 && !taxonList[0].equals(\"\"))||(layerList.length>0 && !layerList[0].equals(\"\"))){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<indicList.length;i++){\n if(i==indicList.length-1){ //last element\n query.append(\"(indicator_id = \"+indicList[i]+\")\");\n }\n else{\n query.append(\"(indicator_id = \"+indicList[i]+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //Execute query\n return taxonInfoIndexDAO.countTaxonsByQuery(query.toString());\n }", "public List<ExperimentSummaryResource> searchExperiments(Timestamp fromTime, Timestamp toTime, Map<String, String> filters, int limit,\n int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {\n List<ExperimentSummaryResource> result = new ArrayList();\n EntityManager em = null;\n try {\n String query = \"SELECT e FROM ExperimentSummary e \" +\n \"WHERE \";\n\n if (filters.get(ExperimentStatusConstants.STATE) != null) {\n String experimentState = ExperimentState.valueOf(filters.get(ExperimentStatusConstants.STATE)).toString();\n query += \"e.state='\" + experimentState + \"' AND \";\n }\n\n if (toTime != null && fromTime != null && toTime.after(fromTime)) {\n query += \"e.creationTime > '\" + fromTime + \"' \" + \"AND e.creationTime <'\" + toTime + \"' AND \";\n }\n\n filters.remove(ExperimentStatusConstants.STATE);\n if (filters != null && filters.size() != 0) {\n for (String field : filters.keySet()) {\n String filterVal = filters.get(field);\n if (field.equals(ExperimentConstants.USER_NAME)) {\n query += \"e.\" + field + \"= '\" + filterVal + \"' AND \";\n } else if (field.equals(ExperimentConstants.GATEWAY_ID)) {\n query += \"e.\" + field + \"= '\" + filterVal + \"' AND \";\n } else if (field.equals(ExperimentConstants.PROJECT_ID)) {\n query += \"e.\" + field + \"= '\" + filterVal + \"' AND \";\n } else {\n if (filterVal.contains(\"*\")) {\n filterVal = filterVal.replaceAll(\"\\\\*\", \"\");\n }\n query += \"e.\" + field + \" LIKE '%\" + filterVal + \"%' AND \";\n }\n }\n }\n query = query.substring(0, query.length() - 5);\n\n //ordering\n if (orderByIdentifier != null && resultOrderType != null\n && orderByIdentifier.equals(Constants.FieldConstants.ExperimentConstants.CREATION_TIME)) {\n String order = (resultOrderType == ResultOrderType.ASC) ? \"ASC\" : \"DESC\";\n query += \" ORDER BY e.\" + ExperimentConstants.CREATION_TIME + \" \" + order;\n }\n\n em = ExpCatResourceUtils.getEntityManager();\n em.getTransaction().begin();\n Query q;\n\n //pagination\n if (offset >= 0 && limit >= 0) {\n q = em.createQuery(query).setFirstResult(offset).setMaxResults(limit);\n } else {\n q = em.createQuery(query);\n }\n\n List resultList = q.getResultList();\n for (Object o : resultList) {\n ExperimentSummary experimentSummary = (ExperimentSummary) o;\n ExperimentSummaryResource experimentSummaryResource =\n (ExperimentSummaryResource) Utils.getResource(ResourceType.EXPERIMENT_SUMMARY,\n experimentSummary);\n result.add(experimentSummaryResource);\n }\n em.getTransaction().commit();\n em.close();\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n throw new RegistryException(e);\n } finally {\n if (em != null && em.isOpen()) {\n if (em.getTransaction().isActive()) {\n em.getTransaction().rollback();\n }\n em.close();\n }\n }\n return result;\n }", "public Map<Map<String, Object>, Map<String, Object>> queryFromAndTo(String siteId, int lastHours, String from, String to, String timeType) {\n String[] fromToIndices = filterRangeDateIndices(from, to, lastHours, timeType);\n boolean isLoggedTime = false;\n if (lastHours > 0 || timeType.equals(\"h\") || timeType.equals(\"m\")) {\n isLoggedTime = true;\n }\n return doMultiRequestForDays(siteId, fromToIndices, isLoggedTime, lastHours, timeType);\n }", "public ArrayList getEqkRupturesNearSite() {\n\n //initializing the list for containing the EqkRuptures\n ArrayList probEqkList = new ArrayList();\n int numSources = eqkRupForecast.getNumSources();\n\n //Going over each and every source in the forecast\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex) {\n // get the ith source\n ProbEqkSource source = eqkRupForecast.getSource(sourceIndex);\n int numRuptures = source.getNumRuptures();\n\n //going over all the ruptures in the source\n for (int rupIndex = 0; rupIndex < numRuptures; ++rupIndex) {\n ProbEqkRupture rupture = source.getRupture(rupIndex);\n\n AbstractEvenlyGriddedSurface rupSurface = new EvenlyGridCenteredSurface((EvenlyGriddedSurface)rupture.getRuptureSurface());\n\n\n //getting the iterator for all points on the rupture\n ListIterator it = rupSurface.getAllByRowsIterator();\n //looping over all the rupture pt locations and if any of those lies\n //within the provided distance range then include the rupture in the list.\n while (it.hasNext()) {\n Location ptLoc = (Location) it.next();\n if (region.contains(ptLoc)) {\n probEqkList.add(rupture.clone());\n break;\n }\n }\n }\n }\n return probEqkList;\n }", "public List<News> query(List<float[]> waypoints);", "public SolrQueryResult query(Map<String, String> params) {\n SolrQuery query = new SolrQuery();\n\n /* enable facetting */\n query.setFacet(true);\n\n /* list of all filters; key: name to display, value: entity parameter */\n List<SolrQueryParameter> filter = new ArrayList<SolrQueryParameter>();\n\n /* list of partition filter */\n List<SolrQueryParameter> partitionFilter = new ArrayList<SolrQueryParameter>();\n\n /*\n * list of filter which have been set by the user (key = filtername, value =\n * list of selections)\n */\n Map<String, List<String>> activeFilterValues = new HashMap<String, List<String>>();\n\n /*\n * determine on which type is searched for (either 'Table' or 'Partition')\n */\n String typeFilterValue = params.get(TYPE);\n filter.add(new SolrQueryParameter(FILTER_TYPE, TYPE, FilterType.EXCLUSIVE, FacetSort.COUNT));\n if (typeFilterValue != null && typeFilterValue.equalsIgnoreCase(TYPE_PARTITION)) {\n typeFilterValue = TYPE_PARTITION;\n for (String parameter : metascopeParameterService.findDistinctParameters()) {\n partitionFilter.add(new SolrQueryParameter(\"Parameter: \" + parameter, parameter + \"_s\", FilterType.AND,\n FacetSort.INDEX));\n }\n for (SolrQueryParameter pFilter : partitionFilter) {\n query.addFacetField(pFilter.getName());\n query.add(\"f.\" + pFilter.getName() + \".facet.sort\", \"index\");\n String filterValue = params.get(pFilter.getName());\n if (filterValue != null && !filterValue.isEmpty()) {\n query.addFilterQuery(pFilter.getName() + \":\" + \"(\" + filterValue.replace(\",\", \" AND \") + \")\");\n }\n\n }\n } else {\n typeFilterValue = TYPE_TABLE;\n }\n query.addFilterQuery(\"{!tag=\" + TYPE + \"}\" + TYPE + \":\" + typeFilterValue);\n query.addFacetField(\"{!ex=\" + TYPE + \"}\" + TYPE);\n\n /* set solr search query parameter 'q' */\n String searchQueryValue = params.get(URLUtil.SEARCH_QUERY_PARAM);\n if (searchQueryValue == null || searchQueryValue.isEmpty()) {\n searchQueryValue = \"*\";\n query.setQuery(searchQueryValue);\n } else {\n String[] queryTerms = searchQueryValue.trim().split(\" \");\n String queryTerm = \"\";\n for (String term : queryTerms) {\n if (term.isEmpty()) {\n continue;\n }\n\n if (!queryTerm.isEmpty()) {\n queryTerm += \" AND \";\n }\n queryTerm += \"*\" + term + \"*\";\n }\n query.setQuery(queryTerm);\n query.setHighlight(true);\n query.setHighlightSimplePre(\"<b>\");\n query.setHighlightSimplePost(\"</b>\");\n query.setHighlightSnippets(100);\n query.set(\"hl.fl\", \"*\");\n }\n\n /* set the remaining filters */\n for (SolrQueryParameter queryFilter : facetFields) {\n filter.add(queryFilter);\n String value = params.get(queryFilter.getName());\n\n String filterQuery = \"\";\n String facetField = \"\";\n if (queryFilter.isExcludeFromFacet()) {\n if (value != null) {\n String[] multipleFilter = value.split(\",\");\n value = \"(\";\n for (int i = 0; i < multipleFilter.length; i++) {\n String filterValue = cleanseValue(multipleFilter[i]).replace(\" \", \"*\");\n value += \"(\" + filterValue + \")\";\n if (i < multipleFilter.length - 1) {\n value += \" \" + getOperator(queryFilter.getFilterType()) + \" \";\n }\n }\n value += \")\";\n }\n filterQuery = \"{!tag=\" + queryFilter.getName() + \"}\" + queryFilter.getName() + \":\" + value;\n facetField = \"{!ex=\" + queryFilter.getName() + \"}\" + queryFilter.getName();\n } else {\n if (value != null) {\n String[] multipleFilter = value.split(\",\");\n value = \"(\";\n for (int i = 0; i < multipleFilter.length; i++) {\n String filterValue = cleanseValue(multipleFilter[i]).replace(\" \", \"*\");\n value += \"(\" + filterValue + \")\";\n if (i < multipleFilter.length - 1) {\n value += \" \" + getOperator(queryFilter.getFilterType()) + \" \";\n }\n }\n value += \")\";\n }\n filterQuery = queryFilter.getName() + \":\" + value;\n facetField = queryFilter.getName();\n }\n\n if (value != null && !value.isEmpty()) {\n query.addFilterQuery(filterQuery);\n }\n query.addFacetField(facetField);\n\n if (queryFilter.getFacetSort().equals(FacetSort.INDEX)) {\n query.add(\"f.\" + queryFilter.getName() + \".facet.sort\", \"index\");\n }\n query.add(\"f.\" + queryFilter.getName() + \".facet.limit\", \"-1\");\n }\n\n /* set facet queries */\n Map<String, String> facetQueryMap = new HashMap<String, String>();\n long now = System.currentTimeMillis() / 1000;\n for (SolrFacetQuery solrFacetQuery : facetQueries) {\n for (SolrHourRange range : solrFacetQuery.getRanges()) {\n long from = range.getFrom() == Long.MAX_VALUE ? 0 : now - (range.getFrom() * 3600);\n String facetQueryString = solrFacetQuery.getName() + \":[\" + from + \" TO \" + now + \"]\";\n query.addFacetQuery(\"{!ex=\" + solrFacetQuery.getName() + \"}\" + facetQueryString);\n facetQueryMap.put(solrFacetQuery.getName() + range.getName(), facetQueryString);\n }\n String value = params.get(solrFacetQuery.getName());\n if (value != null) {\n String fq = \"{!tag=\" + solrFacetQuery.getName() + \"}\" + facetQueryMap.get(solrFacetQuery.getName() + value);\n query.addFilterQuery(fq);\n }\n }\n\n /* always sort the entities (for a deterministic view) */\n query.setSort(ID, ORDER.asc);\n\n /* set pagination information */\n int page = getPageParameter(params);\n int elements = getElementsParameter(params);\n query.setRows(elements);\n query.setStart((page - 1) * elements);\n\n /* execute the query */\n QueryResponse queryResponse = null;\n try {\n queryResponse = solrClient.query(query);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n SolrDocumentList list = queryResponse.getResults();\n\n /* get table / view entities from local repository */\n List<SolrQueryResultEntity> resultEntities = new LinkedList<SolrQueryResultEntity>();\n String resultType = \"\";\n for (SolrDocument solrDocument : list) {\n String id = (String) solrDocument.get(ID);\n\n if (typeFilterValue.equalsIgnoreCase(TYPE_PARTITION)) {\n if (!searchQueryValue.equals(\"*\")) {\n resultEntities.add(new SolrQueryResultEntity(metascopeViewService.findByViewId(id), queryResponse\n .getHighlighting().get(id)));\n } else {\n resultEntities.add(new SolrQueryResultEntity(metascopeViewService.findByViewId(id)));\n }\n resultType = TYPE_PARTITION;\n } else if (typeFilterValue.equalsIgnoreCase(TYPE_TABLE)) {\n if (!searchQueryValue.equals(\"*\")) {\n resultEntities.add(new SolrQueryResultEntity(metascopeTableService.findByFqdn(id), queryResponse\n .getHighlighting().get(id)));\n } else {\n resultEntities.add(new SolrQueryResultEntity(metascopeTableService.findByFqdn(id)));\n }\n }\n }\n if (resultType.isEmpty()) {\n resultType = TYPE_TABLE;\n }\n\n filter.addAll(partitionFilter);\n\n /* get the facet values and counts */\n Map<String, List<SolrFacet>> facetValues = new HashMap<String, List<SolrFacet>>();\n for (SolrQueryParameter f : filter) {\n if (!f.getName().equals(URLUtil.SEARCH_QUERY_PARAM)) {\n List<SolrFacet> values = new ArrayList<SolrFacet>();\n FacetField facet = queryResponse.getFacetField(f.getName());\n for (Count count : facet.getValues()) {\n values.add(new SolrFacet(count.getName(), count.getCount()));\n }\n facetValues.put(f.getName(), values);\n }\n }\n\n /* remove the type filter */\n filter.remove(0);\n\n for (SolrFacetQuery solrFacetQuery : facetQueries) {\n filter\n .add(new SolrQueryParameter(solrFacetQuery.getDisplayName(), solrFacetQuery.getName(), FilterType.EXCLUSIVE));\n List<SolrFacet> values = new ArrayList<SolrFacet>();\n for (SolrHourRange range : solrFacetQuery.getRanges()) {\n long facetQueryCount = getFacetQueryCount(queryResponse, \"{!ex=\" + solrFacetQuery.getName() + \"}\"\n + facetQueryMap.get(solrFacetQuery.getName() + range.getName()));\n values.add(new SolrFacet(range.getName(), facetQueryCount));\n }\n facetValues.put(solrFacetQuery.getName(), values);\n }\n\n /* get the active filter values which have been selected by the user */\n addToActiveFilterValues(activeFilterValues, params, filter);\n\n /* is a search query */\n boolean isSearchQuery = (searchQueryValue != null && !searchQueryValue.isEmpty() && !searchQueryValue.equals(\"*\"))\n || hasActiveFilters(activeFilterValues);\n\n\n /* build and return the result */\n SolrQueryResult result = new SolrQueryResult().withResultEntities(resultEntities).withResultType(resultType)\n .withFilters(filter).withFacetValues(facetValues).withActiveFilterValues(activeFilterValues)\n .withSearchQuery(searchQueryValue).withPage(page).withElements(elements)\n .withTotalPages((int) Math.ceil(((double) list.getNumFound()) / elements)).withTotalResults(list.getNumFound())\n .withIsSearchRequest(isSearchQuery);\n return result;\n }", "public CorrResultModel searchForEvents(String searchString, int page, HashMap foundEventtypes, String lowerBound, String upperBound, List filterNames);", "private List<DataSource> getProcessedResults (List<DataSource> listOfDataSource, Page pageDetail) {\n List<DataSource> dataSourceList = listOfDataSource;\n List<PageSearch> searchList = pageDetail.getSearchList();\n if (ExecueCoreUtil.isCollectionNotEmpty(searchList)) {\n // TODO: -JM- Currently there will be only one search object, change later if there are multiple searches\n PageSearch search = searchList.get(0);\n // check for the search info\n if (PageSearchType.STARTS_WITH == search.getType()) {\n dataSourceList = new ArrayList<DataSource>();\n for (DataSource dataSource : dataSourceList) {\n // TODO: -JM- use the field from the search object\n String cDispName = dataSource.getName();\n if (cDispName.toLowerCase().startsWith(search.getString().toLowerCase())) {\n dataSourceList.add(dataSource);\n }\n }\n } else if (PageSearchType.CONTAINS == search.getType()) {\n dataSourceList = new ArrayList<DataSource>();\n for (DataSource dataSource : dataSourceList) {\n String cDispName = dataSource.getName();\n if (cDispName.toLowerCase().startsWith(search.getString().toLowerCase())) {\n dataSourceList.add(dataSource);\n }\n }\n }\n }\n // modify the page object with the new record count which will modify the page count as well\n pageDetail.setRecordCount(Long.valueOf(dataSourceList.size()));\n List<DataSource> pageDataSources = new ArrayList<DataSource>();\n // manipulate the list to return the set of concepts belonging to the page requested\n int start = (pageDetail.getRequestedPage().intValue() - 1) * pageDetail.getPageSize().intValue();\n int end = start + pageDetail.getPageSize().intValue();\n if (end > pageDetail.getRecordCount().intValue()) {\n end = (pageDetail.getRecordCount().intValue());\n }\n for (int i = start; i < end; i++) {\n pageDataSources.add(dataSourceList.get(i));\n }\n return pageDataSources;\n }", "@GetMapping(\"/filter/{source}/{destination}/{timeSlot}/{skip}/{limit}\")\r\n\tpublic ResponseEntity<List<TripDetails>> getByFilterRequest(@PathVariable(\"source\") String source,\r\n\t\t\t@PathVariable(\"destination\") String destination, @PathVariable(\"timeSlot\") String timeSlot,\r\n\t\t\t@PathVariable(\"skip\") long skip, @PathVariable(\"limit\") int limit) {\r\n\t\r\n List<TripDetails> details= this.bl.getByFilter(source,destination,timeSlot,skip,limit);\r\n return ResponseEntity.status(HttpStatus.OK).body(details); \r\n\t}", "public List<PartitionedThermostatEvent> listAlgoProcessedEventsByThermostatAndTimeRange(Integer thermostatId, Calendar startTime, Calendar endTime) {\n\n String ql = \"SELECT te FROM PartitionedThermostatEvent te WHERE te.type=1 AND te.thermostatId = :thermostatId AND te.status = :status AND te.id.eventSysTime BETWEEN :startTime AND :endTime\";\n Map<String, Object> paramVals = new HashMap<String, Object>();\n paramVals.put(\"status\", ThermostatEventAttributeDef.Status.PROCESSED.status());\n paramVals.put(\"thermostatId\", thermostatId);\n paramVals.put(\"startTime\", startTime);\n paramVals.put(\"endTime\", endTime);\n\n List<PartitionedThermostatEvent> thermostatEvents = listByQuery(ql, paramVals);\n return thermostatEvents;\n }", "@Override\r\n\tpublic int collect(Map<String, String> arguments) {\r\n\t\tinitialize(arguments);\r\n\t\tint count = 0;\r\n\r\n\t\t// Setup the authorization\r\n\t\tinitializeAuthorizationData();\r\n\r\n\t\tReportingServiceManager reportingManager = new ReportingServiceManager(authorizationData);\r\n\t\treportingManager.setStatusPollIntervalInMilliseconds(5000);\r\n\r\n\t\t// Setup the observable window range\r\n\t\tCalendar minRange = Calendar.getInstance();\r\n\t\tminRange.add(Calendar.HOUR, 0-lag-obsWindow);\r\n\t\tCalendar maxRange = Calendar.getInstance();\r\n\t\tmaxRange.add(Calendar.HOUR, 0-lag);\r\n\t\tLOG(\"Query range from: (\"+minRange.getTime()+\" - \"+maxRange.getTime()+\")\");\r\n\r\n\t\t// collect the data\r\n\t\t// do we load from offline or online source ?\r\n\t\tboolean bLoadFromFile = false;\r\n\t\tFile fromFile = null;\r\n\t\tif (loadFromFile != null) {\r\n\t\t\ttry {\r\n\t\t\t\tString[] files = loadFromFile.split(\";\");\r\n\t\t\t\tfromFile = new File(files[files.length-1]);\r\n\t\t\t\tbLoadFromFile = fromFile.exists() && fromFile.isFile();\r\n\t\t\t\tif (files.length > 1) {\r\n\t\t\t\t\tfor (int f = 0; f < files.length - 1; f++) {\r\n\t\t\t\t\t\tprocessFile(new File(files[f]), minRange, maxRange, false, false, null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (Exception ea) {\r\n\t\t\t\tbLoadFromFile = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!bLoadFromFile) {\r\n\t\t\t// Load From API (online)\r\n\t\t\t\r\n\t\t\t// 1. Prepare report request for AdPerformance\r\n\t\t\tReportRequest reportRequest = getAdReport(minRange, maxRange);\r\n\t\t\t// 2. Set Download options\r\n\t\t\tReportingDownloadParameters reportingDownloadParameters = new ReportingDownloadParameters();\r\n\t\t\treportingDownloadParameters.setReportRequest(reportRequest);\r\n\t\t\treportingDownloadParameters.setResultFileDirectory(new File(reportDirectory));\r\n\t\t\treportingDownloadParameters.setResultFileName(System.currentTimeMillis()+\"_AdReport.csv\");\r\n\t\t\treportingDownloadParameters.setOverwriteResultFile(true);\r\n\t\t\t// 3. Download report file from BingAds API (unfortunately Microsoft insists on using the file, there is no stream option)\r\n\t\t\t// We may optionally cancel the downloadFileAsync operation after a specified time interval.\r\n\t\t\tFile resultAdReportFile = null;;\r\n\t\t\ttry {\r\n\t\t\t\tresultAdReportFile = reportingManager.downloadFileAsync(\r\n\t\t\t\t\t\treportingDownloadParameters, \r\n\t\t\t\t\t\tnull).get(3600000, TimeUnit.MILLISECONDS);\r\n\r\n\t\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// 4. Prepare the AdGroupPerformance request\r\n\t\t\treportRequest = getAdGroupReport(minRange, maxRange);\r\n\t\t\tFile resultAdGroupReportFile = null;\r\n\r\n\t\t\t// 5. Set Download options\r\n\t\t\treportingDownloadParameters.setReportRequest(reportRequest);\r\n\t\t\treportingDownloadParameters.setResultFileName(System.currentTimeMillis()+\"_AdGroupReport.csv\");\r\n\t\t\t\r\n\t\t\t// 6. Download the report file\r\n\t\t\ttry {\r\n\t\t\t\tresultAdGroupReportFile = reportingManager.downloadFileAsync(\r\n\t\t\t\t\t\treportingDownloadParameters, \r\n\t\t\t\t\t\tnull).get(3600000, TimeUnit.MILLISECONDS);\r\n\r\n\t\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\t// 7. prepare the DB\r\n\t\t\tinitializeMongoDb();\r\n\r\n\t\t\t// 8. process downloaded files\r\n\t\t\tList<Document> adList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(resultAdReportFile, minRange, maxRange, true, true, adList);\r\n\t\t\tList<Document> adGroupList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(resultAdGroupReportFile, minRange, maxRange, false, true, adGroupList);\r\n\t\t\t\r\n\t\t\tList<Document> allDocs = extrapolateHourlyPerformance(adList, adGroupList);\r\n\t\t\tinsertDocuments(allDocs);\r\n\t\t\t// 9. cleanup\r\n\t\t\tmongoClient.close();\r\n\t\t\tif (removeDownloadedReportFile) {\r\n\t\t\t\tif (resultAdReportFile != null) {\r\n\t\t\t\t\tresultAdReportFile.deleteOnExit();\r\n\t\t\t\t}\r\n\t\t\t\tif (resultAdGroupReportFile != null) {\r\n\t\t\t\t\tresultAdGroupReportFile.deleteOnExit();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t// 1. Prepare DB\r\n\t\t\tinitializeMongoDb();\r\n\t\t\t\r\n\t\t\t// 2. load from provided offline file\r\n\t\t\tList<Document> adGroupList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(fromFile, minRange, maxRange, false, true, null);\r\n\t\t\t\r\n\t\t\t// 3. cleanup\r\n\t\t\tmongoClient.close();\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public Long countByModelAndDate(Integer ue_type, Date startDate, Date endDate){\n\t\tQuery query = em.createQuery(\"select count (c) from BaseData c where c.ue_type = :ue_type AND c.date_time >= :sDate AND c.date_time <= :eDate\");\n\t\tquery.setParameter(\"ue_type\", ue_type);\n\t\tquery.setParameter(\"sDate\",startDate);\n\t\tquery.setParameter(\"eDate\", endDate);\n\t\treturn (Long)query.getSingleResult();\n\t}", "boolean allHits();", "List<Media> search(double latitude, double longitude);", "public Iterable<Point2D> range(RectHV rect) {\n SET<Point2D> point_list = new SET<Point2D>();\n rangesearch(root, rect, point_list);\n return point_list;\n }", "public List<Equipment> findByPriceRange(int from, int to){\n List<Equipment> foundEquipment = new ArrayList<>();\n for(Equipment e: equipment){\n if (e.getPrice() <= to && e.getPrice() >= from){\n foundEquipment.add(e);\n }\n }\n return foundEquipment;\n }", "List<SpotPrice> getByCommodityAndFromDateAndToDateAndLocation(\n Commodity commodity,\n Date fromDate,\n Date toDate,\n Location location\n );", "@Test\r\n public void testAllPoints() {\r\n Path all = backend.getPoints();\r\n int numPointsInterest = 0; // Store number of points of interest\r\n // Verify all intersections\r\n if(all.getPath().size() != intersections.size())\r\n fail(\"Failed to get all intersections\");\r\n // Get number of points of interest\r\n for(int i = 0; i < intersections.size(); i++) {\r\n numPointsInterest += intersections.get(i).getPointOfInterests().size();\r\n }\r\n if(all.getPOI().size() != numPointsInterest)\r\n fail(\"Failed to get all points of interest\");\r\n }", "public void execFuzzySearchRangeFunc(){\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true){\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if(this.searchParam.indexOf(\":\") > -1 ){\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0,idex );\n System.out.println(\"chrom=\"+chrom);\n map.put(\"chrom\",chrom);\n if(this.searchParam.indexOf(\"-\") > -1 ){\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, idex1));\n pend = Integer.parseInt(this.searchParam.substring(idex1+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n map.put(\"endpos\",pend);\n }else {\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n }\n\n }else if(this.searchParam.startsWith(\"chr\") == true){\n map.put(\"chrom\",this.searchParam);\n\n\n }\n }\n }\n\n int idenfilter = 0;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\")==false && this.pvalue.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n List<SearchItemBean> searchlist = (List<SearchItemBean>) baseService.findResultList(\"cn.big.gvk.dm.Search.selectRangeBySearch\",map);\n if( searchlist != null ){\n genotypeBeanList = new ArrayList<GenotypeBean>();\n mapGeneBeanList = new ArrayList<MapGeneBean>();\n for(SearchItemBean tmpbean : searchlist){\n if(tmpbean.getItemType() == 1){ //variant\n Map cmp = new HashMap();\n cmp.put(\"genotypeid\",tmpbean.getItemId());\n GenotypeBean tbean = (GenotypeBean) baseService.findObjectByObject(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",cmp);\n if(tbean != null ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n genotypeBeanList.add(tbean) ;\n }\n\n\n\n\n }else if(tmpbean.getItemType() == 2){//gene\n\n Map cmp = new HashMap();\n cmp.put(\"gid\",tmpbean.getItemId()) ;\n MapGeneBean mgb = (MapGeneBean) baseService.findObjectByObject(\"cn.big.gvk.dm.MapGene.selectMapGeneCount\",cmp);\n if(mgb != null ){\n Map t = new HashMap();\n t.put(\"gId\",mgb.getGid()) ;\n t.put(\"count\",\"count\");\n\n //trait count\n GwasAssociationView gwas = (GwasAssociationView) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectGwasViewByGeneInfo\",t);\n if(gwas != null){\n mgb.setTraitCount(gwas.getTraitCount());\n }\n\n //study count\n StudyBean study = (StudyBean) baseService.findObjectByObject(\"cn.big.gvk.dm.study.selectStudyByMapGeneId\",t);\n if(study != null ){\n mgb.setStudyCount(study.getStudyCount());\n }\n\n //publication count\n PublicationBean publication = (PublicationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.publication.selectPubByGeneId\",t);\n if (publication != null ){\n mgb.setPublicationCount(publication.getPublicationCount());\n }\n mapGeneBeanList.add(mgb) ;\n\n }\n\n\n }\n }\n }\n StringBuffer sb = new StringBuffer();\n //generate hidden html table and then use tableExport.js export\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(mapGeneBeanList != null && mapGeneBeanList.size()>0){\n for(MapGeneBean mapgene: mapGeneBeanList){\n sb.append(mapgene.getMapGeneId()).append(\"\\t\").append(mapgene.getMapGeneChrom()).append(\":\")\n .append(mapgene.getMapGeneStart()).append(\"-\").append(mapgene.getMapGeneEnd()).append(\"\\t\").append(mapgene.getTraitCount()).append(\"\\t\")\n .append(mapgene.getStudyCount()).append(\"\\n\");\n }\n }\n\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "public Trackmatches getTrackmatches() {\n return trackmatches;\n }", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "@RequestMapping(value = \"/ng\", method = RequestMethod.GET)\n\tpublic ResponseEntity<List<NaturalGasMeasurement>> getNaturalGasMeasurementBetweenTimestamps(\n\t\t\t@PathVariable String username, @RequestParam(\"from\") long from,\n\t\t\t@RequestParam(\"to\") long to, @RequestParam(value = \"room\", required = false) String room_name) {\n\n\t\tLOG.debug(\"getNaturalGasMeasurementBetweenTimestamps: \" + from + \" and \"\n\t\t\t\t+ to);\n\n\t\tList<NaturalGasMeasurement> naturalGasMeasurement;\n\n\t\ttry {\n\t\t\tnaturalGasMeasurement = gasesMeasurementService\n\t\t\t\t\t.getNaturalGasMeasurementBetweenTimestamps(username, from,\n\t\t\t\t\t\t\tto, room_name);\n\n\t\t\tif (naturalGasMeasurement != null) {\n\t\t\t\treturn new ResponseEntity<List<NaturalGasMeasurement>>(\n\t\t\t\t\t\tnaturalGasMeasurement, HttpStatus.OK);\n\t\t\t} else {\n\t\t\t\treturn new ResponseEntity<List<NaturalGasMeasurement>>(\n\t\t\t\t\t\tHttpStatus.NOT_FOUND);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(e.getMessage());\n\t\t\treturn new ResponseEntity<List<NaturalGasMeasurement>>(\n\t\t\t\t\tHttpStatus.BAD_REQUEST);\n\t\t}\n\n\t}", "@Test\n public void testQueryOnHeterogenousObjects() throws Exception {\n DefaultQueryService.TEST_QUERY_HETEROGENEOUS_OBJECTS = true;\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n for (int i = 0; i < 5; ++i) {\n Portfolio p = new Portfolio(i + 1);\n region.put(i + 1, p);\n }\n\n for (int i = 5; i < 10; ++i) {\n region.put(i + 1, i + 1);\n }\n String queryStr =\n \"Select distinct * from \" + SEPARATOR + \"portfolio1 pf1 where pf1.getID() > 3\";\n Query q = qs.newQuery(queryStr);\n SelectResults rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n Iterator itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID()\", SEPARATOR + \"portfolio1 pf\");\n QueryObserver old = QueryObserverHolder.setInstance(new QueryObserverAdapter() {\n private boolean indexUsed = false;\n\n @Override\n public void beforeIndexLookup(Index index, int oper, Object key) {\n indexUsed = true;\n }\n\n @Override\n public void endQuery() {\n assertTrue(indexUsed);\n }\n });\n\n rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n qs.removeIndex(i1);\n\n queryStr = \"Select distinct * from \" + SEPARATOR + \"portfolio1 pf1 where pf1.pkid > '3'\";\n q = qs.newQuery(queryStr);\n rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n\n i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.pkid\", SEPARATOR + \"portfolio1 pf\");\n QueryObserverHolder.setInstance(new QueryObserverAdapter() {\n private boolean indexUsed = false;\n\n @Override\n public void beforeIndexLookup(Index index, int oper, Object key) {\n indexUsed = true;\n }\n\n @Override\n public void endQuery() {\n assertTrue(indexUsed);\n }\n });\n\n rs = (SelectResults) q.execute();\n assertEquals(2, rs.size());\n itr = rs.iterator();\n while (itr.hasNext()) {\n Portfolio p = (Portfolio) itr.next();\n assertTrue(p == region.get(4) || p == region.get(5));\n }\n }", "public List<MeteringDataSec> findWithinTimeRange(final Instant startTime, final Instant untilTime) {\n\t\tInstant until = untilTime == null ? startTime.plus(5, ChronoUnit.MINUTES) : untilTime;\n\n\t\tList<MeteringDataSec> matches = meteringDataRepository.findWithinTimeRange(Timestamp.from(startTime), Timestamp.from(until));\n\t\tif (!matches.isEmpty()) {\n\t\t\tLOG.info(\"findWithinTimeRange found {} entries starting with: {}\", matches.size(), matches.get(0).getCreationTime());\n\t\t}\n\n\t\treturn matches;\n\t}", "@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic ServiceResult listTeamConfidence(final TeamConfidence obj, Timestamp startDate, Timestamp endDate){\n\t\tServiceResult result = new ServiceResult();\n\t\tObject temp;\n\t\tPage page = new Page();\n\t\tpage.setRecordsPerPage(10000l);\n\t\tParamChecker pc = new ParamChecker();\n\t\ttry{\n\t\t\tCriteria c = dao.getSession().createCriteria(TeamConfidence.class,\"t\");\n\t\t\tc.createAlias(\"t.project\", \"p\");\n\t\t\tc.add(Restrictions.ge(\"t.createdTime\", startDate));\n\t\t\tc.add(Restrictions.le(\"t.createdTime\", endDate));\n\t\t\tif (pc.isNotEmpty(obj.getCreatedBy())){\n\t\t\t\tc.add(Restrictions.eq(\"t.createdBy\", obj.getCreatedBy()));\n\t\t\t}\n\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getId())){\n\t\t\t\tc.add(Restrictions.eq(\"p.id\", obj.getProject().getId()));\n\t\t\t}\n\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getProductCode())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productCode\", obj.getProject().getProductCode()));\n\t\t\t}\n\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getProductName())){\n\t\t\t\tc.add(Restrictions.eq(\"p.productName\", obj.getProject().getProductName()));\n\t\t\t}\n\t\t\t//search by POD\n\t\t\tif (obj.getProject()!=null){\n\t\t\t Project ref = new Project();\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getRegion())) {\n\t\t\t\t\tref.setRegion(obj.getProject().getRegion());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getPod())) {\n\t\t\t\t\tref.setPod(obj.getProject().getPod());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getCountry())) {\n\t\t\t\t\tref.setCountry(obj.getProject().getCountry());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getLeader())) {\n\t\t\t\t\tref.setLeader(obj.getProject().getLeader());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getManager())) {\n\t\t\t\t\tref.setManager(obj.getProject().getManager());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && obj.getProject().getStatus()!=null && obj.getProject().getStatus().toString().length()>0) {\n\t\t\t\t\tref.setStatus(obj.getProject().getStatus());\n\t\t\t\t}\n\t\t\t\tif (obj.getProject()!=null && pc.isNotEmpty(obj.getProject().getCategory())) {\n\t\t\t\t\tref.setCategory(obj.getProject().getCategory());\n\t\t\t\t}\n\t\t\t\tServiceResult tempResult = searchByInstance(ref, CommonDAO.OP_MODE.CASE_SENSITIVE_LIKE);\n\t\t\t\tif (tempResult.getResult()){\n\t\t\t\t\t//found project\n\t\t\t\t\tList<Project> projectList = (List<Project>) tempResult.getReturnObject();\n\t\t\t\t\tList<String> sb = new ArrayList<>();\n\t\t\t\t\tfor (Project prj:projectList){\n\t\t\t\t\t\t sb.add(prj.getId());\n\t\t\t\t\t}\n\t\t\t\t\tif (sb.size()>0){\n\t\t\t\t\t\tc.add(Restrictions.in(\"p.id\", sb));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tc.addOrder(Order.desc(\"p.pod\")).addOrder(Order.desc(\"t.createdTime\"));\n\t\t\tList<TeamConfidence> resultList = c.list();\n\n\t\t\tif (resultList != null){\n\t\t\t\tresult.setResult(true);\n\t\t\t\tresult.setReturnObject(resultList);\n\t\t\t} else {\n\t\t\t\tresult.setResult(false);\n\t\t\t}\n\t\t} catch (Exception e){\n\t\t\tresult.setResult(false);\n\t\t\tresult.setMessage(\"Error:\"+e);\n\t\t\tlog.error(\"Error getting team confidence: \", e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "List<Media> search(double latitude, double longitude, int distance);", "DbQuery setRangeFilter(int startValue, int endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "private TreeSet<SpatialTemporal> gatherData() {\r\n TreeSet<SpatialTemporal> dataPoints = new TreeSet<>(new Comparator<SpatialTemporal>() {\r\n @Override\r\n public int compare(SpatialTemporal o1, SpatialTemporal o2) {\r\n return (new Double(o1.position)).compareTo(new Double(o2.position));\r\n }\r\n });\r\n\r\n double positionOnRoute = 0;\r\n for (final RoadSegment roadSegment : route) {\r\n for (Vehicle veh : roadSegment) {\r\n if (veh.type() == AgentType.OBSTACLE) {\r\n continue;\r\n }\r\n double position = positionOnRoute + veh.getFrontPosition();\r\n dataPoints.add(new SpatialTemporal(position, veh.getSpeed(), veh.getLength(), veh.getAcc()));\r\n }\r\n positionOnRoute += roadSegment.roadLength();\r\n }\r\n return dataPoints;\r\n }", "@Override\n public List<PrescriptionRecord> findListByParams(Map map) {\n Map<String, Object> param = new HashMap<String, Object>(map);\n \n String sort = (String) map.get(\"sortType\");\n if(sort!=null) {\n param.put(\"sortType\", sort);\n }else {\n param.put(\"sortType\", \"DESC\");\n }\n \n List<ShardMeta> shardMetas = generateShardMetas();\n Integer pageSize = (Integer) param.get(\"pageSize\");\n boolean findRange = StringUtils.isBlank((String) param.get(\"orderNo\")) && pageSize != null;\n Integer startNum = findRange ? (Integer) param.get(\"startNum\") : 0;\n Integer subStartNum = startNum / shardMetas.size();\n \n List<PrescriptionRecord> allOrders = new ArrayList<PrescriptionRecord>();\n try {\n // 指定订单号则跳过\n if (findRange) {\n param.put(\"subStartNum\", subStartNum);\n // 提交第一次查询,查询每个分片的订单范围\n List<Future<List<Long>>> rangeTasks = submitRangeQuery(param, shardMetas, queryPool);\n long minTime = Long.MAX_VALUE;\n long maxTime = Long.MIN_VALUE;\n Iterator<ShardMeta> iterator = shardMetas.iterator();\n // 根据每个分片的订单范围计算出全局的订单范围\n for (int i = 0; i < rangeTasks.size(); i++) {\n ShardMeta shardMeta = iterator.next();\n List<Long> timestamps = rangeTasks.get(i).get();\n if (timestamps.isEmpty()) {\n continue;\n }\n \n shardMeta.setMaxTime(timestamps.get(0));\n shardMeta.setMinTime(timestamps.get(timestamps.size() - 1));\n if (maxTime < shardMeta.getMaxTime()) {\n maxTime = shardMeta.getMaxTime();\n }\n if (minTime > shardMeta.getMinTime()) {\n minTime = shardMeta.getMinTime();\n }\n }\n param.put(\"startTime\", minTime);\n param.put(\"endTime\", maxTime);\n }\n \n // 提交第二次查询,查询每个分片符合范围的订单\n List<Future<List<PrescriptionRecord>>> orderTasks = submitOrderQuery(param, shardMetas, queryPool);\n int offset = 0;\n Iterator<ShardMeta> iterator = shardMetas.iterator();\n List<ShardMeta> offsetShards = new ArrayList<ShardMeta>();\n // 合并所有分片的结果\n for (Future<List<PrescriptionRecord>> orderTask : orderTasks) {\n ShardMeta shardMeta = iterator.next();\n List<PrescriptionRecord> orderViews = orderTask.get();\n if (findRange) {\n if (shardMeta.getMaxTime() == Long.MIN_VALUE) {\n offsetShards.add(shardMeta);\n } else {\n int shardAheadCount = getAheadCount(orderViews, shardMeta.getMaxTime());\n // 累加全局偏移量\n offset += subStartNum - shardAheadCount;\n // 删除不需要后补齐查询的分片信息\n if (orderViews.size() - shardAheadCount < pageSize)\n iterator.remove();\n }\n }\n allOrders.addAll(orderViews);\n }\n \n if (!findRange || allOrders.isEmpty())\n return allOrders;\n /*\n // 进行分片偏移量查询\n if (!offsetShards.isEmpty()) {\n Object startTime = param.get(\"startTime\");\n param.put(\"startTime\", param.get(\"endTime\"));\n param.put(\"endTime\", map.get(\"endTime\"));\n \n List<Future<Long>> offsetTasks = submitOffsetQuery(param, offsetShards, queryPool);\n for (Future<Long> offsetTask : offsetTasks)\n offset += offsetTask.get();\n \n param.put(\"startTime\", startTime);\n }\n \n // 进行第三次查询\n int targetOffset = startNum - offset;\n int endIndex = targetOffset + pageSize;\n if (endIndex > allOrders.size() && !shardMetas.isEmpty()) {\n int backfill = endIndex - allOrders.size();\n param.put(\"backfill\", backfill);\n param.put(\"endTime\", param.get(\"startTime\"));\n param.put(\"startTime\", map.get(\"startTime\"));\n orderTasks = submitOrderQuery(param, shardMetas, queryPool);\n for (Future<List<PrescriptionRecord>> orderTask : orderTasks)\n allOrders.addAll(orderTask.get());\n }\n \n */\n int targetOffset = startNum;\n int endIndex = startNum + pageSize;\n \n if (allOrders.size() <= targetOffset)\n return Collections.EMPTY_LIST;\n \n \n // 对合并后的结果统一排序,并根据全局偏移量定位分页的第一条订单的偏移量,提取分页结果\n \n sortByCreateTime(allOrders);\n return allOrders.subList(targetOffset, Math.min(endIndex, allOrders.size()));\n } catch (Exception e) {\n e.printStackTrace();\n throw new SystemException(e);\n }\n }", "@Override\n\tpublic ResultTO getFileInfoFromInterval(LocalDateTime startDateTime, LocalDateTime endDateTime) {\n\t\tResultTO result = this.getAllFiles();\n\t\tif (result.isError()) {\n\t\t\treturn result;\n\t\t}\n\t\tList<InfoFileTO> infoFileList = result.getFiles();\n\t\tList<InfoFileTO> filterFileList = new ArrayList<>();\n\t\t// If it is void (when some error occurred) it is not executed\n\t\tfor (InfoFileTO infoFileTO : infoFileList) {\n\t\t\tLocalDateTime lastModify = infoFileTO.getLastModify();\n\t\t\tif (lastModify.isAfter(startDateTime) && lastModify.isBefore(endDateTime)) {\n\t\t\t\tfilterFileList.add(infoFileTO);\n\t\t\t}\n\t\t}\n\t\tresult.setFiles(filterFileList);\n\t\treturn result;\n\t}", "Map<String, Long> hits();", "@Query(\"SELECT id, measured_at FROM measurements WHERE measured_at >= :startDate AND measured_at < :endDate\")\n @TypeConverters({DateConverter.class})\n List<MeasurementEvent> findForPeriodTest(Date startDate, Date endDate);", "@ApiOperation(value = \"Get all music track\")\n @GetMapping(\"tracks\")\n public ResponseEntity<?> getAllTrack(){\n ResponseEntity responseEntity;\n try {\n responseEntity = new ResponseEntity<List<Track>>(trackService.getAllTrack(), HttpStatus.CREATED);\n }catch (TrackNotFoundException ex){\n responseEntity = new ResponseEntity(ex.getMessage(), HttpStatus.CONFLICT);\n }\n return responseEntity;\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<GuideStatisticDTO> getGuidesStatisticByPeriod(LocalDateTime start, LocalDateTime end) {\n\t\tStringBuilder query = new StringBuilder(\n\t\t\t\t\"SELECT XS.guide.firstName AS firstName, XS.guide.lastName AS lastName, COUNT(id) AS totalExcursions, \"\n\t\t\t\t\t\t+ \"SUM(XS.details.durationSec) AS excursionsTotalDuration \" + \"FROM Excursion AS XS \"\n\t\t\t\t\t\t+ \"WHERE (XS.start >= :startDate AND XS.end <= :endDate) GROUP BY XS.guide\");\n\t\tSystem.out.println(query.toString());\n\t\tQuery result = sessionFactory.getCurrentSession().createQuery(query.toString());\n\t\tresult.setTimestamp(\"startDate\", Timestamp.valueOf(start));\n\t\tresult.setTimestamp(\"endDate\", Timestamp.valueOf(end));\n\t\tList<GuideStatisticDTO> returnResult = new ArrayList<GuideStatisticDTO>();\n\t\tfor (Object[] obj : (List<Object[]>) result.list()) {\n\t\t\tGuideStatisticDTO listElement = new GuideStatisticDTO();\n\t\t\tlistElement.setFirstName(String.valueOf(obj[0]));\n\t\t\tlistElement.setLastName(String.valueOf(obj[1]));\n\t\t\tlistElement.setTotalExcursions((long) obj[2]);\n\t\t\tlistElement.setExcursionsTotalDuration(LocalTime.MIN.plusSeconds((long) obj[3]));\n\t\t\treturnResult.add(listElement);\n\n\t\t}\n\n\t\treturn returnResult;\n\t\t// return result.list();\n\t}", "void getAdvertsAvailableWithFilter(AdvertFilter filter, Coordinates currentLocation, final AdvertListResult result);", "public void testRange() throws IOException, InvalidGeoException\r\n {\n LgteIndexSearcherWrapper searcher = new LgteIndexSearcherWrapper(path);\r\n\r\n //try find Jorge and Bruno documents last year\r\n // In this case the closest one will be in 2007\r\n String query = \"contents:(Jorge Bruno)\";\r\n\r\n LgteQuery lgteQueryResult1;\r\n LgteQuery lgteQueryResult1and2;\r\n try\r\n {\r\n lgteQueryResult1 = LgteQueryParser.parseQuery(query);\r\n lgteQueryResult1and2 = LgteQueryParser.parseQuery(query);\r\n\r\n MyCalendar c1Aux = new MyCalendar(2005,11,20,9,0,10);\r\n MyCalendar c2Aux = new MyCalendar(2007,1,12,20,45,15);\r\n long dif = c2Aux.getTimeInMillis() - c1Aux.getTimeInMillis();\r\n\r\n lgteQueryResult1.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1.getQueryParams().setRadiumMiliseconds(dif -1);\r\n lgteQueryResult1and2.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1and2.getQueryParams().setRadiumMiliseconds(dif+1);\r\n }\r\n catch (ParseException e)\r\n {\r\n fail(e.toString());\r\n return;\r\n }\r\n\r\n //Lets use aos Time Sorter to dont worry about distances and stuff like that, he will do the job\r\n TimeDistanceSortSource dsort1 = new TimeDistanceSortSource();\r\n LgteSort sort1 = new LgteSort(new SortField(\"foo\", dsort1));\r\n\r\n //LgteHits give you Documents and time with unecessary lines of boring code\r\n LgteHits lgteHits1;\r\n LgteHits lgteHits1and2;\r\n lgteHits1 = searcher.search(lgteQueryResult1, sort1);\r\n assertTrue(lgteHits1.length() == 1);\r\n\r\n lgteHits1and2 = searcher.search(lgteQueryResult1and2, sort1);\r\n assertTrue(lgteHits1and2.length() == 2);\r\n\r\n\r\n long time1_0 = lgteHits1.doc(0).getTime().getTime();\r\n long time1and2_0 = lgteHits1and2.doc(0).getTime().getTime();\r\n long time1and2_1 = lgteHits1and2.doc(1).getTime().getTime();\r\n assertTrue(time1_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_1 == new MyCalendar(2007,1,12,20,45,15).getTimeInMillis());\r\n\r\n\r\n searcher.close();\r\n }", "@Test void process_allPointsInside() {\n\t\tvar alg = (PointTrackerKltPyramid<GrayF32, GrayF32>)createTracker();\n\n\t\talg.process(image);\n\t\talg.spawnTracks();\n\n\t\t// swap in a new tracker which won't change the track states\n\t\talg.tracker = new DummyTracker(null);\n\t\tint N = alg.active.size();\n\t\tassertTrue(N > 10);\n\t\t// put two tracks outside of the image, but still close enough to be tracked by KLT\n\t\talg.active.get(0).setPosition(-1, -2);\n\t\talg.active.get(2).setPosition(image.width + 1, image.height);\n\n\t\t// process it again, location's wont change so two tracks should be dropped since they are outside\n\t\talg.process(image);\n\t\tassertEquals(2, alg.getDroppedTracks(null).size());\n\t\tassertEquals(N - 2, alg.getActiveTracks(null).size());\n\t}", "protected static<T extends FitbitInterval> List<T> filterResults( List<T> results, FitbitQuery query ) {\n\t\tif ( query.atResolution( ) == FitbitResolution.DAILY )\n\t\t\treturn results;\n\t\t\n\t\tList<T> filteredResults = new ArrayList<T>( );\n\t\tfor ( T r : results )\n\t\t\tif ( r.getInterval( ).getStart( ).isAfter( query.from( ) ) && r.getInterval( ).getStart( ).isBefore( query.to( ) ) )\n\t\t\t\tfilteredResults.add( r );\n\t\t\t\t\n\t\treturn filteredResults;\n\t}", "@Override\n public List<ScheduledInterview> getScheduledInterviewsInRangeForUser(\n String userId, Instant minTime, Instant maxTime) {\n TimeRange range = new TimeRange(minTime, maxTime);\n List<ScheduledInterview> scheduledInterviews = getForPerson(userId);\n List<ScheduledInterview> scheduledInterviewsInRange = new ArrayList<ScheduledInterview>();\n for (ScheduledInterview scheduledInterview : scheduledInterviews) {\n if (range.contains(scheduledInterview.when())) {\n scheduledInterviewsInRange.add(scheduledInterview);\n }\n }\n return scheduledInterviewsInRange;\n }", "public ArrayList<Stock> filter(Stock low, Stock high){\n ArrayList<Stock> result = new ArrayList<Stock>();\n ArrayList<Stock> all = this.ShowAll();\n\n//\t\tSystem.out.println(\"in filter\");\n\n for (Stock current : all) {\n StockFilter filter = new StockFilter(low, high, current);\n//\t\t\tSystem.out.println(low.getHigh()+\" \"+high.getHigh());\n//\t\t\tSystem.out.println(current.getHigh());\n\n if (filter.filt())\n result.add(current);\n }\n return result;\n }", "@GetMapping(\"Track\")\n public ResponseEntity<?> getAllTrack() {\n return new ResponseEntity<>(trackService.getAllTracks(), HttpStatus.OK);\n }", "public static TwitterStream filter(TwitterStreamConfiguration tws, TwitterStreamHandler handler,\n Collection<Long> follows, Collection<String> tracks, Collection<String> locations) throws IOException, OAuthException {\n\n String postBody = buildFilterContents(follows, tracks, locations);\n //build get params\n HttpParams getParams = new BasicHttpParams();\n if (tws.getCount() != null) getParams.setIntParameter(\"count\", tws.getCount());\n if (tws.isDelimited()) getParams.setParameter(\"delimited\", tws.getDelimited());\n //send request\n HttpRequestBase conn = buildConnection(FILTER_URL, getParams, tws, postBody);\n return new TwitterStream(conn, handler);\n }", "@GET(\"/tracks?client_id=\"+ Contants.CLIENT_ID)\n /**\n * this @Query might give us something like this:\n * https://api.soundcloud.com/tracks?client_id=1233be8128198789963a226f93916311&created_at[from]=\"10/11/2014\"\n * the string \"10/11/2014\" will be @param date\n */\n public void getTrack(@Query(\"created_at[from]\") String date, Callback<List<SoundCloudModel>> response);", "public static int count_overlap_regions(ArrayList<RegionVO> user_set, ArrayList<RegionVO> test_set){\n\t\tint i = 0, j = 0, count = 0;\n\t\t\n\t\twhile(i < user_set.size() && j < test_set.size()){\n\t\t\t\n\t\t\tif (user_set.get(i).getChr_id() == test_set.get(j).getChr_id() \n\t\t\t\t\t&& Math.max(user_set.get(i).getStart(), test_set.get(j).getStart()) \n\t\t\t\t\t\t<= Math.min(user_set.get(i).getEnd(), test_set.get(j).getEnd())){\n\t\t\t\t\n\t\t\t\tint overlap = Math.min(user_set.get(i).getEnd(), test_set.get(j).getEnd()) - Math.max(user_set.get(i).getStart(), test_set.get(j).getStart());\n\t\t\t\t\n\t\t\t\t//if (overlap > (user_set.get(i).end - user_set.get(i).start) / 2) {\n\t\t\t\tif (overlap > 0) {\t\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\ti++;\n\t\t\t\tj++;\n\t\t\t}else if (user_set.get(i).compareTo(test_set.get(j)) > 0) j++;\n\t\t\telse{ \n\t\t\t\ti++;\n\t\t\t\tSystem.out.println(\"Length: \" + (user_set.get(i).getEnd() - user_set.get(i).getStart())/10000);\n\t\t\t\tSystem.out.printf(\"chrom: %s, start: %d, end: %d\\n\", user_set.get(i).getChrom(), user_set.get(i).getStart(), user_set.get(i).getEnd());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn count;\n\t}", "@Test\r\n public void testSinglePoints() {\r\n String searchIntersection = \"Randall & Dayton\";\r\n Path path = backend.getPoints(searchIntersection);\r\n ArrayList<String> points = path.getPOI();\r\n // Search for 'Randall & Dayton' point of interest\r\n if(!points.contains(\"Vantage Point\"))\r\n fail(\"Failed to find points of interest\");\r\n }" ]
[ "0.5234684", "0.4952911", "0.4921858", "0.48858348", "0.47853073", "0.4668542", "0.46226975", "0.46222347", "0.45935678", "0.45878696", "0.458056", "0.45740578", "0.45445034", "0.45417476", "0.45290846", "0.45207238", "0.4513934", "0.45084247", "0.44914588", "0.44831437", "0.44629896", "0.4453525", "0.44425654", "0.44422513", "0.44421846", "0.44406545", "0.4429804", "0.4420559", "0.44103935", "0.44050223", "0.43992263", "0.4398045", "0.43969834", "0.43783426", "0.43723157", "0.43712428", "0.4364625", "0.4361606", "0.43521428", "0.43512014", "0.43309897", "0.4315717", "0.43071333", "0.43017954", "0.4297915", "0.42926058", "0.42771614", "0.42757502", "0.42662573", "0.42654538", "0.4261872", "0.42564452", "0.42235202", "0.42188856", "0.42187658", "0.4217248", "0.42159075", "0.42146873", "0.42141682", "0.42056105", "0.42052963", "0.4201694", "0.4195194", "0.4191097", "0.41809264", "0.41787133", "0.41778076", "0.41732457", "0.41698143", "0.4168426", "0.41575083", "0.41547513", "0.41505086", "0.41461983", "0.4144676", "0.4144249", "0.4139859", "0.41265658", "0.4123417", "0.4120842", "0.4113307", "0.41113347", "0.41078717", "0.4106092", "0.41025764", "0.4100791", "0.40987742", "0.40949416", "0.4094873", "0.40884757", "0.40825328", "0.4082208", "0.40816602", "0.408131", "0.4077671", "0.40770042", "0.40748736", "0.40708914", "0.40599775", "0.40597734" ]
0.47881073
4
Calculates which objects from a table has a particular value for a particular column. The input parameters provide a way to specify either a String or a Double valued column and a desired value for the column on which the filter is performed. The operation is synchronous, meaning that a response will not be returned until all the objects are fully available. The response payload provides the count of the resulting set. A new result view which satisfies the input filter restriction specification is also created with a view name passed in as part of the input payload. Although this functionality can also be accomplished with the standard filter function, it is more efficient.
public FilterByValueResponse filterByValue(FilterByValueRequest request) throws GPUdbException { FilterByValueResponse actualResponse_ = new FilterByValueResponse(); submitRequest("/filter/byvalue", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FilterByValueResponse filterByValue(String tableName, String viewName, boolean isString, double value, String valueStr, String columnName, Map<String, String> options) throws GPUdbException {\n FilterByValueRequest actualRequest_ = new FilterByValueRequest(tableName, viewName, isString, value, valueStr, columnName, options);\n FilterByValueResponse actualResponse_ = new FilterByValueResponse();\n submitRequest(\"/filter/byvalue\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\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[] bindingNameRow = new String[7];\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\tbindingNameRow[6] = \"ROW_cc3\";\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\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "Integer calculate(String columnValue);", "long findValues(List<Object> values, List<Column> columns);", "ColumnInfoFilter getColumnInfoFilter();", "public Long getCount(Filter filter);", "KTable<K, V> filter(Predicate<K, V> predicate);", "public Object compile(DLFilterOperator unusedOperator, String key, Object... values) {\n List<DLColumnUnitModel> model = (List<DLColumnUnitModel>) values[2];\n\n // the key used as needle, the value input by the user\n // occurrence of this value is tested in the each column\n final String needle = (String) values[1];\n\n if (model.isEmpty()) {\n // compare by toString()\n String value = values[0] == null ? \"\" : values[0].toString();\n return needle != null && value.toLowerCase().contains(needle.toLowerCase());\n }\n\n // for each column\n for (DLColumnUnitModel unit : model) {\n\n try {\n\n // filter by visible columns only\n // filter by recognized (deifned) columns only\n // filter by columns available in QF only\n if (!unit.isVisible() || !unit.isColumn() || !unit.isQuickFilter()) {\n continue;\n }\n\n // get compiler for the value and operator to be able to evaluate the rule\n final FilterCompiler compiler = unit.getFilterCompiler() == null ? FilterSimpleCompiler.INSTANCE : unit.getFilterCompiler();\n\n // When the user wants to filter by ALL then he wants to use WYSIWYG search\n // Due to his expectations the filter uses CONTAINS operator to make a STRING\n // comparison as the user expect Eg. integer: value \"1223\", needle \"223\". CONTAINS evaluates this\n // as the valid entity but the EQUALS doesn't.\n final DLFilterOperator operator = DLFilterOperator.LIKE;\n\n // get value to be evaluated against given key\n // entity property - the value shown in the listbox\n // try to convert value\n final Object value = FilterUtils.getConvertedValue( FilterUtils.getValue(values[0], unit.getColumn()), unit);\n\n // if the value is missing it cannot match the rules\n // this if also prevents the NPE in the following code\n if (value == null) {\n continue;\n }\n\n // try to evaluate column\n // if matches, entity is valid\n // this is the basic implementation used also in DLFilter\n if ((Boolean) compiler.compile(operator, unit.getColumn(), value, needle)) {\n // matching property is found, the entity is valid\n // otherwise we have to continue searching for matching column\n return true;\n }\n\n } catch (NoSuchMethodException ex) {\n // ignore, field cannot be used in filter\n }\n }\n\n // no column matches the rule, entity is not valid\n return false;\n }", "public IAverageClause having(String column);", "public void addFilterEqual(String column, Object value) {\n controlRelationAndAddToList(criterionList, Restrictions.eq(trimColumn(column), value), column);\n }", "String getTypeFilter(String column, Collection<FxType> types);", "@FXML\n public void getFilteredResults(ActionEvent event) throws IOException {\n int filterValueInt = 0;\n String filterName = filterChoiceBox.getValue(); //Get value from text field\n\n UpdateHandler.setFilter_Changed(true);\n\n if (!filterName.equals(ALL_FILTER)) {\n try {\n filterValueInt = Integer.parseInt(filterValue.getText());\n } catch (NumberFormatException e) {\n JOptionPane.showMessageDialog(null, \"Has to be a number.\");\n }\n UpdateHandler.setFILTER_NAME(filterName);\n UpdateHandler.setFILTER_VALUE(filterValueInt);\n } else {\n UpdateHandler.setFILTER_NAME(\"All\");\n UpdateHandler.setFILTER_VALUE(0);\n }\n }", "@Test void testInterpretProjectFilterValues() {\n final String sql = \"select y, x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"where x > 1\";\n sql(sql).returnsRows(\"[b, 2]\", \"[c, 3]\");\n }", "public void visitColumn(double val);", "public IAverageClause where(String column);", "public Collection<T> filter(Query query) throws DataAccessException;", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;", "protected boolean hasFactsInIt( LogicalModel model, Selection businessColumn, Map<String, Object> parameters,\n boolean genAsPreparedStatement, DatabaseMeta databaseMeta, String locale ) {\n if ( businessColumn.hasAggregate() ) {\n return true;\n }\n\n // Parse the formula in the business column to see which tables and columns are involved...\n //\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, businessColumn, null, parameters, genAsPreparedStatement, databaseMeta, locale );\n for ( Selection column : sqlAndTables.getUsedColumns() ) {\n if ( column.hasAggregate() ) {\n return true;\n }\n }\n\n // Nothing found\n //\n return false;\n\n }", "@Override\n public SqlDatabaseTable filter(SqlDatabaseTable table, List<FilterRule> filterRules) {\n if (filterRules.isEmpty()) return table;\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"SELECT * FROM \").append(table.getFullRef());\n sql.append(\" WHERE\");\n for (int i = 0; i < filterRules.size(); i++) {\n FilterRule filterRule = filterRules.get(i);\n if (filterRule instanceof ColumnFilterRule) {\n int lhs = ((ColumnFilterRule) filterRule).getRowId();\n int rhs = ((ColumnFilterRule) filterRule).getAnotherRowId();\n sql.append(\" `_\").append(lhs).append(\"`=`_\").append(rhs).append(\"`\");\n } else if (filterRule instanceof ConstantFilterRule) {\n int rowId = ((ConstantFilterRule) filterRule).getRowId();\n String value = ((ConstantFilterRule) filterRule).getValue();\n sql.append(\" `_\").append(rowId).append(\"`='\").append(value).append(\"'\");\n } else {\n throw new IllegalArgumentException();\n }\n if (i != filterRules.size() - 1) {\n sql.append(\" AND\");\n }\n }\n\n return new SqlDatabaseQueryTable(sql.toString(), table.getArity());\n }", "public ColumnBasedTableFilter(RowObjectTableModel<R> model) {\n\t\tthis.model = model;\n\t\tthis.name = null;\n\t}", "@Nullable\n @Generated\n @Selector(\"havingPredicate\")\n public native NSPredicate havingPredicate();", "DataFilter getDataFilter(Connection con, SqlSearch search) throws FxSqlSearchException;", "int countByExample(MVoucherDTOCriteria example);", "public long countWithCondition(EvaluetingListDO evaluetingList) throws DataAccessException;", "public int searchRowsCount(SearchCriteria cri);", "public List<Object> queryByWhere(String col_name, String dto, List<List<Triple>> filter, List<String> keys) {\n\t\tList<Object> res = new ArrayList<Object>();\n\t\tDBCollection dbc = db.getCollection(col_name);\n\t\t// filter\n\t\tBasicDBObject all_ref = new BasicDBObject();\n\t\tDBObject _keys = new BasicDBObject();\n\t\t\n\t\tif(keys != null)\n\t\t\tfor(String key : keys) \n\t\t\t\t_keys.put(key, true);\n\t\t\n\t\tBasicDBList list = new BasicDBList();\n\t\tfor(List<Triple> and : filter) {\n\t\t\tBasicDBObject ref = new BasicDBObject();\n\t\t\tfor(Triple tri : and) {\n\t\t\t\tif(!ref.containsField(tri.key_name)) {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) \n\t\t\t\t\t\tref.put(tri.key_name, tri.value);\n\t\t\t\t\t\n\t\t\t\t\telse \n\t\t\t\t\t\tref.put(tri.key_name, new BasicDBObject(tri.condition, tri.value));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) {\n\t\t\t\t\t\t// TODO It is impossible\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tBasicDBObject bo = (BasicDBObject)ref.get(tri.key_name);\n\t\t\t\t\t\tbo.append(tri.condition, tri.value);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end an \"and\" query\n\t\t\tlist.add(ref);\n\t\t}\n\t\t\n\t\tall_ref.put(\"$or\", list);\n\t\t\n\t\ttry {\n\t DBCursor cur = dbc.find(all_ref, _keys);\n\t \twhile (cur.hasNext()) {\n\t \t\tDBObject doc = cur.next();\n\t \t\ttry {\n\t \t\t\tres.add(Util.deserialize(doc, dto));\n\t \t\t} catch(InvocationTargetException ite) {\n\t \t\t\tite.printStackTrace();\n\t \t\t} \t\t\n\t \t\t//System.out.println(doc);\n\t }\n\n\t\t} catch(ClassNotFoundException cnfe) {\n \tcnfe.printStackTrace();\n } catch(InstantiationException ie) {\n \tie.printStackTrace();\n } catch(IllegalAccessException iae) {\n \tiae.printStackTrace();\n }\n\n \treturn res;\n\t}", "String getVersionFilter(String tableAlias);", "protected boolean analyzeTable(final Parameter _parameter,\n final IFilterList _filterlist,\n final QueryBuilder _queryBldr,\n final Type _type)\n throws EFapsException\n {\n boolean exec = true;\n if (CollectionUtils.isNotEmpty(_filterlist)) {\n // filtering\n for (final IFilter filter : _filterlist) {\n final Field field = Field.get(filter.getFieldId());\n if (field.getFilter().getType().equals(FilterType.FREETEXT)\n || field.getFilter().getType().equals(FilterType.FORM)\n && field.getFilter().getAttributes() != null) {\n String attrName = field.getAttribute();\n String[] attrNames = null;\n if (field.getFilter().getAttributes() != null) {\n if (field.getFilter().getAttributes().contains(\",\")) {\n attrNames = field.getFilter().getAttributes().split(\",\");\n } else {\n attrName = field.getFilter().getAttributes();\n }\n }\n if (attrNames != null) {\n exec = addInsideRangeFilter(_parameter, filter, _queryBldr, _type, attrNames);\n } else {\n if (attrName != null && _type.getAttribute(attrName) != null) {\n exec = addFilter(_parameter, filter, _queryBldr, _type, attrName);\n } else {\n exec = addFilter4Select(_parameter, filter, _queryBldr, _type, field.getSelect());\n }\n }\n if (!exec) {\n break;\n }\n } else if (field.getFilter().getType().equals(FilterType.CLASSIFICATION)) {\n exec = addClassFilter(_parameter, filter, _queryBldr, _type);\n } else if (field.getFilter().getType().equals(FilterType.STATUS)) {\n exec = addStatusFilter(_parameter, filter, _queryBldr, _type);\n }\n }\n }\n return exec;\n }", "@SelectProvider(type = ServeInfoSqlProvider.class, method = \"hasSameName\")\n int hasSameName(@Param(\"name\") String name, @Param(\"filterId\") Long filterId);", "public List<ViewXwZqkh> Query(String filters, String orders, Object... values);", "ArrayList<E> getWhere(String parameterName, int parameterValue, E dummyObject) throws DatabaseNotAccessibleException, DatabaseObjectNotFoundException, NoSuchFieldException;", "long countByFilter(String keySearch, String brands, Double priceFrom, Double priceTo);", "protected boolean analyzeTable(final Parameter _parameter,\n final IFilterList _filterlist,\n final QueryBuilder _queryBldr)\n throws EFapsException\n {\n return analyzeTable(_parameter, _filterlist, _queryBldr, Type.get(_queryBldr.getTypeUUID()));\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "public void testGroupFilterOnComputedColumnsWithAggregations( ) throws Exception\n \t{\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\", \"cc4\" };\n \t\tccExpr = new String[] {\n \t\t\t\t\"row.COL0+row.COL1\",\n \t\t\t\t\"Total.sum(row.COL1+row.cc1)\",\n \t\t\t\t\"Total.ave(row.cc1+row.COL2+row.COL3, null, 0)*81\",\n \t\t\t\t\"Total.sum(row.COL1+row.COL2+row.COL3+row.COL0)\" };\n \t\t\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 \t\t\n \t\tString[] bindingNameGroup = new String[1];\n \t\tbindingNameGroup[0] = \"GROUP_GROUP1\";\n \t\tIBaseExpression[] bindingExprGroup = new IBaseExpression[1];\n \t\tbindingExprGroup[0] = new ScriptExpression(\"dataSetRow.cc1\");\n \n \t\tGroupDefinition[] groupDefn = new GroupDefinition[] {\n \t\t\t\tnew GroupDefinition(\"group1\") };\t\n \t\tgroupDefn[0].setKeyExpression(\"row.GROUP_GROUP1\");\n \t\t\n \t\tFilterDefinition filter = new FilterDefinition(new ScriptExpression(\n \t\t\t\t\"Total.sum(dataSetRow.COL0)>400\"));\n \t\tgroupDefn[0].addFilter(filter);\n \n \t\tString[] bindingNameRow = new String[8];\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\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tbindingNameRow[7] = \"ROW_cc4\";\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\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[3], 0) };\n \n \t\ttry {\n \t\t\tthis.executeQuery(this.createQuery(null, null, null, null, null,\n \t\t\t\t\tnull, null, null, null, bindingNameRow, bindingExprRow));\n \t\t\t// fail( \"Should not arrive here\" );\n \t\t} catch (DataException e) {\n \n \t\t}\n \t}", "DbQuery setEqualsFilter(int value) {\n return setEqualsFilter((double) value);\n }", "@Override\n\tpublic long countBy(ITableDBContext context, Table table, IDBFilter filter) throws Throwable {\n\t\tthrow new Warning(\"not impl\");\n\t}", "public interface QueryFilter {\n\t\tpublic void apply(Query<? extends PersistentObject> qbe);\n\t}", "public void interactiveTestColumnControlAndFilters() {\n final JXTable table = new JXTable(new AncientSwingTeam());\n table.setColumnControlVisible(true);\n // table.setFilters(createPipeline());\n Action toggleFilter = new AbstractAction(\"Toggle Filters\") {\n boolean hasFilters;\n public void actionPerformed(ActionEvent e) {\n if (hasFilters) {\n table.setFilters(null);\n } else {\n table.setFilters(createPipeline());\n // FilterPipeline pipeline = new FilterPipeline(new Filter[] {});\n // table.setFilters(pipeline);\n }\n hasFilters = !hasFilters;\n \n }\n \n };\n toggleFilter.putValue(Action.SHORT_DESCRIPTION, \"filtering first column - problem if invisible \");\n JXFrame frame = wrapWithScrollingInFrame(table, \"JXTable ColumnControl and Filters\");\n addAction(frame, toggleFilter);\n frame.setVisible(true);\n }", "ArrayList<E> getWhere(String parameterName, String parameterValue, E dummyObject) throws DatabaseNotAccessibleException, DatabaseObjectNotFoundException, NoSuchFieldException;", "@Test\n public void testWhere_withValidQuery() {\n String column0 = \"user_id\";\n String column1 = \"age\";\n int idValue0 = 0;\n int ageValue0 = 23;\n int idValue1 = 1;\n int ageValue1 = 22;\n int idValue2 = 2;\n int ageValue2 = 18;\n\n try {\n String sql = \"CREATE TABLE ModelExtension (\" +\n column0 + \" int, \" +\n column1 + \" int)\";\n PreparedStatement pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.execute();\n sql = \"INSERT INTO ModelExtension (\" +\n column0 + \", \" +\n column1 + \") VALUES (\" +\n idValue0 + \", \" +\n ageValue0 + \"), (\" +\n idValue1 + \", \" +\n ageValue1 + \"), (\" +\n idValue2 + \", \" +\n ageValue2 + \")\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n\n List<ModelExtension> models = child.findAll().where(column1 + \">20\").execute(ModelExtension.class);\n\n assertEquals(2, models.size());\n assertEquals(idValue0, models.get(0).get(column0));\n assertEquals(ageValue0, models.get(0).get(column1));\n assertEquals(idValue1, models.get(1).get(column0));\n assertEquals(ageValue1, models.get(1).get(column1));\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public void counter(Object filterValue ) throws SQLException, NamingException, IOException {\n\t try {\t\n\t \tContext initContext = new InitialContext(); \n\t \t\tDataSource ds = (DataSource) initContext.lookup(JNDI);\n\t\n\t \t\tcon = ds.getConnection();\n\t \t\t\n\t \t\t//Reconoce la base de datos de conección para ejecutar el query correspondiente a cada uno\n\t \t\tDatabaseMetaData databaseMetaData = con.getMetaData();\n\t \t\tproductName = databaseMetaData.getDatabaseProductName();//Identifica la base de datos de conección\n\t \t\t\n\t \t\tString[] veccodcia = pcodcia.split(\"\\\\ - \", -1);\n\t\n\t \t\tString query = null;\n\t \t\t\n\t \t\tswitch ( productName ) {\n\t case \"Oracle\":\n\t \tquery = \"SELECT count_autos01('\" + ((String) filterValue).toUpperCase() + \"','\" + veccodcia[0] + \"','\" + grupo + \"') from dual\";\n\t break;\n\t case \"PostgreSQL\":\n\t \tquery = \"SELECT count_autos01('\" + ((String) filterValue).toUpperCase() + \"','\" + veccodcia[0] + \"','\" + grupo + \"')\";\n\t break;\n\t \t\t}\n\n\t \t\t \n\t\n\t \n\t pstmt = con.prepareStatement(query);\n\t //System.out.println(query);\n\t\n\t r = pstmt.executeQuery();\n\t \n\t \n\t while (r.next()){\n\t \trows = r.getInt(1);\n\t }\n\t } catch (SQLException e){\n\t e.printStackTrace(); \n\t }\n\t //Cierra las conecciones\n\t pstmt.close();\n\t con.close();\n\t r.close();\n\t\n\t \t}", "@Override\r\n\tpublic boolean evaluate(Object value, int column) throws SQLException {\n\t\treturn false;\r\n\t}", "@Override\n public Long countByCriteria(String[] layerList, String[] taxonList, String[] indicList,String colum) {\n //Build the query string base on parameters\n StringBuilder query = new StringBuilder();\n query.append(\"Select count(distinct \"+colum+\") from ait.taxon_info_index where \");\n \n //If there is geografical criteria\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\"(\");\n for(int i = 0;i<layerList.length;i++){\n String[] aux = layerList[i].split(\"~\");\n String layer = aux[0];\n String polygon = aux[1];\n if(i==layerList.length-1){ //last element\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\")\");\n }\n else{\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //If there is taxonomy criteria\n if(taxonList.length>0 && !taxonList[0].equals(\"\")){\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<taxonList.length;i++){\n //Get the name and taxonomical level of the specified taxon\n TaxonIndex ti = taxonIndexDAO.getTaxonIndexByName(taxonList[i]);\n if(ti.getTaxon_id()!=null){\n //To search in the specified taxonomyField\n String levelColum;\n switch (ti.getTaxon_range().intValue()) {\n case 1:\n levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n break;\n case 2:\n levelColum = TaxonomicalRange.PHYLUM.getFieldName();\n break;\n case 3:\n levelColum = TaxonomicalRange.CLASS.getFieldName();\n break;\n case 4:\n levelColum = TaxonomicalRange.ORDER.getFieldName();\n break;\n case 5:\n levelColum = TaxonomicalRange.FAMILY.getFieldName();\n break;\n case 6:\n levelColum = TaxonomicalRange.GENUS.getFieldName();\n break;\n case 7:\n levelColum = TaxonomicalRange.SPECIFICEPITHET.getFieldName();\n break;\n default:\n levelColum = TaxonomicalRange.SCIENTIFICNAME.getFieldName();\n break;\n }\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\") or \");\n }\n }\n else{ //If the taxon doesn't exist on data base\n String levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+-1+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+-1+\") or \");\n }\n }\n }\n query.append(\")\");\n }\n \n //If there is indicators criteria\n if(indicList.length>0 && !indicList[0].equals(\"\")){\n if((taxonList.length>0 && !taxonList[0].equals(\"\"))||(layerList.length>0 && !layerList[0].equals(\"\"))){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<indicList.length;i++){\n if(i==indicList.length-1){ //last element\n query.append(\"(indicator_id = \"+indicList[i]+\")\");\n }\n else{\n query.append(\"(indicator_id = \"+indicList[i]+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //Execute query\n return taxonInfoIndexDAO.countTaxonsByQuery(query.toString());\n }", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit,\n Filter<K, C>... filters);", "@Deprecated\n ExtraQuery filter(String name, Object value);", "int selectCountByFilter( ResponseFilter filter, Plugin plugin );", "public static void generalFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(general);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n default:\r\n \r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public static void displayFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(displays);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Resolución\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND resolucion LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Tamaño\":\r\n //BUSCA POR TAMAÑO\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND tam LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public int contarPorCriterio(Map<String, String> filters)\r\n/* 44: */ {\r\n/* 45: 93 */ return this.maquinaDao.contarPorCriterio(filters);\r\n/* 46: */ }", "public QueryResultBuilder<T> applyFilter(Option<QueryFilter<T>> filter, Option<Map<String, Object>> params);", "Condition greaterThanOrEqualTo(QueryParameter parameter, Object x);", "@Override\r\n\tpublic List<ViewListeEleve> filter(HttpHeaders headers, List<Predicat> predicats, Map<String, OrderType> orders,\r\n\t\t\tSet<String> properties, Map<String, Object> hints, int firstResult, int maxResult) {\n \tList<ViewListeEleve> list = super.filter(headers, predicats, orders, properties, hints, firstResult, maxResult);\r\n \tSystem.out.println(\"ViewListeEleveRSImpl.filter() size is \"+list.size());\r\n\t\treturn list ;\r\n\t}", "private void filteringAndSortingWithDataView() {\n ComboBox<Person> comboBox = new ComboBox<>(\"Persons\");\n PersonService personService = new PersonService();\n\n // We fetch the items to the memory and bind the obtained collection\n // to the combo box\n Collection<Person> persons = personService.fetchAll();\n\n ComboBoxListDataView<Person> dataView = comboBox.setItems(persons);\n\n /*\n * Providing a predicate item filter allows filtering by any field of\n * the business entity and apply a combo box's text filter independently\n */\n IntegerField personAgeFilter = new IntegerField(\n event -> dataView.setFilter(person -> event.getValue() == null\n || person.getAge() > event.getValue()));\n\n /*\n * Providing a value provider or comparator allows sorting combo box's\n * items by custom field, or combination of fields\n */\n Button sortPersons = new Button(\"Sort Persons by Name\",\n event -> dataView.setSortOrder(Person::toString,\n SortDirection.ASCENDING));\n\n personAgeFilter.setLabel(\"Filter Persons with age more than:\");\n personAgeFilter.setWidth(WIDTH_STRING);\n addCard(\"Filtering\", \"Filtering and Sorting with Data View\", comboBox,\n personAgeFilter, sortPersons);\n }", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseByFilter();\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 (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public static void procFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(proc);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Nucleos\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND nucleos = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Tipo Socket\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND tiposocket LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Velocidad\":\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND velocidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n } \r\n }", "@Override\r\n\t@Transactional\r\n\tpublic int getCount(List<Filter> filters){\r\n\t\ttry{\r\n\t\t\tString sql = \"select count(*) \"\r\n\t\t\t\t\t + \"from FmtEstado \";\r\n\t\t\t\r\n\t\t\tsql = sqlFunctions.completeSQL(null, filters, sql, FmtEstado.getColumnNames());\r\n\t\t\t\r\n\t\t\tQuery query = getSession().createQuery(sql);\r\n\t \r\n\t\t\t query=sqlFunctions.setParameters(filters, query);\r\n\t\t\t \r\n\t\t\tIterator it = query.list().iterator();\r\n\t Long ret = new Long(0);\r\n\t \r\n\t if (it != null)\r\n\t\t if (it.hasNext()){\r\n\t\t \tret = (Long) it.next();\r\n\t\t }\r\n\t \r\n\t\t\treturn ret.intValue();\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "public Object getResult(ResultSet rs, String columnName) throws SQLException;", "@GetMapping(\"/filtering\")\n\tpublic MappingJacksonValue retrieveSomeBean() {\n\n\t\tSomeBean someBean = new SomeBean(\"value1\", \"value2\", \"value3\");\n\n\t\t// dynamic filtering\n\t\tSimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"field1\", \"field2\");\n\n\t\tMappingJacksonValue mapping = filtering(someBean, filter);\n\n\t\treturn mapping;\n\t}", "private Object [] getFilterVals()\n throws java.sql.SQLException\n {\n Object [] ret = new Object[m_cols.length];\n\n for (int i = 0; i < m_cols.length; i++)\n {\n ret[i] = m_rs.getString((String)m_cols[i]);\n }\n return ret;\n }", "public String applyFilter() {\n if (!filterSelectedField.equals(\"-1\")) {\n Class<?> fieldClass = getFieldType(filterSelectedField);\n\n if ((fieldClass.equals(Integer.class) && !NumberUtil.isInteger(filterCriteria))\n || (fieldClass.equals(Long.class) && !NumberUtil.isLong(filterCriteria))\n || (fieldClass.equals(BigInteger.class) && !NumberUtil.isBigInteger(filterCriteria))) {\n setWarnMessage(i18n.iValue(\"web.client.backingBean.abstractCrudBean.message.MustBeInteger\"));\n filterCriteria = \"\";\n } else {\n signalRead();\n }\n paginationHelper = null; // For pagination recreation\n dataModel = null; // For data model recreation\n selectedItems = null; // For clearing selection\n } else {\n setWarnMessage(i18n.iValue(\"web.client.backingBean.abstractCrudBean.message.MustSelectFindOption\"));\n }\n return null;\n }", "KTable<K, V> filterOut(Predicate<K, V> predicate);", "public <T> int select(final String sqlQuery, final Map<String, Object> param) throws Exception;", "@Override\r\n\tpublic boolean evaluate(Object value, String columnName)\r\n\t\t\tthrows SQLException {\n\t\treturn false;\r\n\t}", "public boolean isFiltered()\n\t{\n\t\tfinal TiTableView tableView = getTableView();\n\n\t\tif (tableView != null) {\n\t\t\treturn tableView.isFiltered();\n\t\t}\n\n\t\treturn false;\n\t}", "public void addStats(String column, boolean queryHit, boolean filterHit) {\n if (this.columnStats.containsKey(column)) {\n this.columnStats.get(column).queryHit |= queryHit;\n this.columnStats.get(column).filterHit |= filterHit;\n } else {\n this.columnStats.put(column, new ColumnStatsDelta(queryHit, filterHit));\n }\n }", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getEquipserviceRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new EquipserviceDao(uriInfo,header).getEquipserviceByFilter();\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 (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getEquipserviceRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public <Y extends RPrimitive> RDataframe filter(String name, Predicate<Y> predicate) {\n\t\treturn filter(RFilter.from(name, predicate));\n\t}", "IViewFilter getViewFilter();", "Condition greaterThan(QueryParameter parameter, Object x);", "public boolean fitsCriteria(Map<String, String> filter){\n return mutableSegmentController.fitsFilterCriteria(filter);\n }", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getChannelRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new ChannelDao(uriInfo,header).getChannelByFilter();\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 (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getChannelRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "UserFilterResult find(UserFilterRequest request);", "<K1> KTable<K1, Long> count(KeyValueMapper<K, V, K1> selector,\n Serializer<K1> keySerializer,\n Serializer<V> valueSerializer,\n Serializer<Long> aggValueSerializer,\n Deserializer<K1> keyDeserializer,\n Deserializer<V> valueDeserializer,\n Deserializer<Long> aggValueDeserializer,\n String name);", "handy.storage.api.ColumnCondition<DeleteOperation<T>> where(String column);", "public void testDynamizePredicate() {\n part.insertPredicate(\"<http://dbpedia.org/ontology/deathPlace>\", 100);\n\n part.setInsDyn(0.5);\n part.setDelDyn(0.1);\n \n part.dynamizePredicate(\"<http://dbpedia.org/ontology/deathPlace>\");\n\n WebResource endpoint = part.getService();\n String checkquery= \"SELECT (COUNT(*) as ?no) \"\n + \"{?s <http://dbpedia.org/ontology/deathPlace> ?o }\";\n\n assertEquals(140,\n Integer.parseInt(\n endpoint.path(\"sparql\").queryParam(\"query\", checkquery)\n\t\t\t .accept(\"application/sparql-results+csv\")\n\t\t\t .get(String.class).replace(\"no\\n\", \"\").trim()));\n }", "public static List<Result> getDataByFilter(String tableName, String startRowKey, String endRowKey, String regexKey, int num) {\n FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);\n\n //a row filter using regex\n RegexStringComparator rc = new RegexStringComparator(regexKey);\n RowFilter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, rc);\n\n //filter the the num in a page\n Filter filterNum = new PageFilter(num);\n\n //add them into filter list\n filterList.addFilter(rowFilter);\n filterList.addFilter(filterNum);\n\n //setup a scan and set the range and regex of row\n Scan scan = new Scan();\n scan.setStartRow(startRowKey.getBytes());\n scan.setStopRow(endRowKey.getBytes());\n scan.setFilter(filterList);\n\n //get result\n return getResultsFromScan(tableName, scan);\n }", "public DDataFilter(DDataAttribute column, DDataFilterOperator operator, Object value, Object valueTo) throws DDataException {\n if (column == null || column.getPropertyName() == null)\n throw new DDataException(\"can't create filter for NULL\");\n\n this.attribute = column;\n if (attribute.isMappedBean()) {\n filters = new ArrayList<>();\n this.externalData = attribute.getBeanInterface().isAnnotationPresent(DDataPrototypeRealization.class);\n this.operator = operator;\n this.value = value;\n this.valueTo = valueTo;\n } else {\n filters = null;\n this.externalData = false;\n this.operator = operator;\n this.value = value;\n this.valueTo = valueTo;\n }\n }", "public void filtered(FilteredCall<UserCQ, UserCQ> filteredLambda) {\n filtered(filteredLambda, null);\n }", "private Object[] scanRows(int field, NFilterColumn fc, SRange range, \n\t\t\tSSheet worksheet, STable table, //ZSS-988 \n\t\t\tSFill filterFill, boolean byFontColor, //ZSS-1191 \n\t\t\tSCustomFilters custFilters,\n\t\t\tSDynamicFilter dynaFilter, STop10Filter top10Filter) { //ZSS-1192\n\t\tSortedSet<FilterRowInfo> orderedRowInfos = \n\t\t\t\tnew TreeSet<FilterRowInfo>(new FilterRowInfoComparator());\n\t\t\n\t\t//ZSS-1191\n\t\tLinkedHashSet<SFill> ccitems = new LinkedHashSet<SFill>(); //ZSS-1191: CELL_COLOR\n\t\tLinkedHashSet<SFill> fcitems = new LinkedHashSet<SFill>(); //ZSS-1191: FONT_COLOR\n\t\tint[] types = new int[] {0, 0, 0}; //0: date, 1: number, 2: string\n\t\t\n\t\tblankRowInfo = new FilterRowInfo(BLANK_VALUE, \"(Blanks)\");\n\t\tfinal Set criteria1 = fc == null ? null : fc.getCriteria1();\n\t\tboolean hasBlank = false;\n\t\tboolean hasSelectedBlank = false;\n\t\tfinal int top = range.getRow() + 1;\n\t\tint bottom = range.getLastRow();\n\t\tfinal int columnIndex = range.getColumn() + field - 1;\n\t\tfinal SFont defaultFont = worksheet.getBook().getDefaultFont(); //ZSS-1191\n\t\tFormatEngine fe = EngineFactory.getInstance().createFormatEngine();\n\t\tboolean isItemFilter = filterFill == null //ZSS-1191 \n\t\t\t\t&& custFilters == null //ZSS-1192\n\t\t\t\t&& dynaFilter == null && top10Filter == null; //ZSS-1193\n\t\t//ZSS-1195\n\t\tfinal SCell cell = worksheet.getCell(range.getRow(), columnIndex);\n\t\tString colName = null;\n\t\tif (!cell.isNull() && cell.getType() != CellType.BLANK) {\n\t\t\tFormatResult fr = fe.format(cell, new FormatContext(ZssContext.getCurrent().getLocale()));\n\t\t\tcolName = fr.getText();\n\t\t}\n\t\tif (colName == null || Strings.isBlank(colName)) {\n\t\t\tfinal String ab = CellReference.convertNumToColString(columnIndex);\n\t\t\tcolName = \"(Column \"+ab+\")\";\n\t\t}\n\n\t\tfor (int i = top; i <= bottom; i++) {\n\t\t\t//ZSS-988: filter column with no criteria should not show option of hidden row \n\t\t\tif (isItemFilter && (criteria1 == null || criteria1.isEmpty())) { //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\tif (worksheet.getRow(i).isHidden())\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal SCell c = worksheet.getCell(i, columnIndex);\n\t\t\t\n\t\t\t//ZSS-1191\n\t\t\tfinal SCellStyle style = c.isNull() ? null : c.getCellStyle();\n\t\t\tfinal SFill ccfill = style == null ? BLANK_FILL : style.getFill();\n\t\t\tccitems.add(ccfill);\n\t\t\tfinal SFont font = style == null ? null : style.getFont();\n\t\t\tfinal boolean isDefaultFont = defaultFont.equals(font);\n\t\t\tfinal SFill fcfill = font == null || isDefaultFont ? \n\t\t\t\tBLANK_FILL : new FillImpl(FillPattern.NONE, font.getColor(), ColorImpl.WHITE);\n\t\t\tfcitems.add(fcfill);\t\t\t\n\t\t\tint type0 = 3; //ZSS-1241\n\t\t\t\n\t\t\tif (!c.isNull() && c.getType() != CellType.BLANK) {\n\t\t\t\tFormatResult fr = fe.format(c, new FormatContext(ZssContext.getCurrent().getLocale()));\n\t\t\t\tString displaytxt = fr.getText();\n\t\t\t\tif(!hasBlank && displaytxt.trim().isEmpty()) { //ZSS-707: show as blank; then it is blank\n\t\t\t\t\thasBlank = true;\n\t\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\tObject val = c.getValue(); // ZSS-707\n\t\t\t\t\tif(c.getType()==CellType.NUMBER && fr.isDateFormatted()){\n\t\t\t\t\t\tval = c.getDateValue();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//ZSS-1191: Date 1, Number 2, String 3, Boolean 4 is Number; Error 5 and Blank 6.\n\t\t\t\t\tfinal int type = FilterRowInfo.getType(val);\n\t\t\t\t\ttype0 = (type == 4 ? 2 : type) - 1; //ZSS-1241\n\t\t\t\t\t\n\t\t\t\t\tFilterRowInfo rowInfo = new FilterRowInfo(val, displaytxt);\n\t\t\t\t\t//ZSS-299\n\t\t\t\t\torderedRowInfos.add(rowInfo);\n\t\t\t\t\t//ZSS-1191, ZSS-1192, ZSS-1193: color/custom/dynamic/top10 filter excludes item filter\n\t\t\t\t\tif (isItemFilter) { \n\t\t\t\t\t\tif (criteria1 == null || criteria1.isEmpty() || criteria1.contains(displaytxt)) { //selected\n\t\t\t\t\t\t\trowInfo.setSelected(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (!hasBlank){\n\t\t\t\thasBlank = true;\n\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t}\n\t\t\t\n\t\t\t//ZSS-1241: Date 0, Number 1, String 2\n\t\t\tif (type0 < 3) {\n\t\t\t\ttypes[type0] = types[type0] + 1;\n\t\t\t}\n\t\t}\n\t\t//ZSS-988: Only when it is not a table filter, it is possible to change the last row.\n\t\tif (table == null) {\n\t\t\t//ZSS-988: when hit Table cell; must stop\n\t\t\tint blm = Integer.MAX_VALUE;\n\t\t\tfinal SSheet sheet = range.getSheet();\n\t\t\tfor (STable tb : sheet.getTables()) {\n\t\t\t\tfinal CellRegion rgn = tb.getAllRegion().getRegion();\n\t\t\t\tfinal int l = rgn.getColumn();\n\t\t\t\tfinal int r = rgn.getLastColumn();\n\t\t\t\tfinal int t = rgn.getRow();\n\t\t\t\tif (l <= columnIndex && columnIndex <= r && t > bottom && blm >= t)\n\t\t\t\t\tblm = t - 1;\n\t\t\t}\n\n\t\t\tfinal int maxblm = Math.min(blm, worksheet.getEndRowIndex());\n\t\t\t//ZSS-704: user could have enter non-blank value along the filter, must add that into\n\t\t\tfinal int left = range.getColumn();\n\t\t\tfinal int right = range.getLastColumn();\n\t\t\tboolean leaveLoop = false;\n\t\t\tfor (int i = bottom+1; i <= maxblm ; ++i) {\n\t\t\t\tfinal SCell c = worksheet.getCell(i, columnIndex);\n\t\t\t\t\n\t\t\t\tint type0 = 3; //ZSS-1241\n\n\t\t\t\tif (!c.isNull() && c.getType() != CellType.BLANK) {\n\t\t\t\t\tFormatResult fr = fe.format(c, new FormatContext(ZssContext.getCurrent().getLocale()));\n\t\t\t\t\tString displaytxt = fr.getText();\n\t\t\t\t\tif(!hasBlank && displaytxt.trim().isEmpty()) { //ZSS-707: show as blank; then it is blank\n\t\t\t\t\t\thasBlank = true;\n\t\t\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\t\t} else {\n\t\t\t\t\t\tObject val = c.getValue(); // ZSS-707\n\t\t\t\t\t\tif(c.getType()==CellType.NUMBER && fr.isDateFormatted()){\n\t\t\t\t\t\t\tval = c.getDateValue();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//ZSS-1191: Date 1, Number 2, String 3, Boolean 4 is Number; Error 5 and Blank 6\n\t\t\t\t\t\tfinal int type = FilterRowInfo.getType(val);\n\t\t\t\t\t\ttype0 = (type == 4 ? 2 : type) - 1; // ZSS-1241\n\t\t\t\t\t\t\n\t\t\t\t\t\tFilterRowInfo rowInfo = new FilterRowInfo(val, displaytxt);\n\t\t\t\t\t\t//ZSS-299\n\t\t\t\t\t\torderedRowInfos.add(rowInfo);\n\t\t\t\t\t\t//ZSS-1191, ZSS-1192: color/custom/dynamic/top10 filter excludes item filter\n\t\t\t\t\t\tif (filterFill == null && custFilters == null) { \n\t\t\t\t\t\t\tif (criteria1 == null || criteria1.isEmpty() || criteria1.contains(displaytxt)) { //selected\n\t\t\t\t\t\t\t\trowInfo.setSelected(true);\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} else {\n\t\t\t\t\t//really an empty cell?\n\t\t\t\t\tint[] ltrb = getMergedMinMax(worksheet, i, columnIndex);\n\t\t\t\t\tif (ltrb == null) {\n\t\t\t\t\t\tif (neighborIsBlank(worksheet, left, right, i, columnIndex)) {\n\t\t\t\t\t\t\tbottom = i - 1;\n\t\t\t\t\t\t\tleaveLoop = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti = ltrb[3];\n\t\t\t\t\t}\n\t\t\t\t\tif (!leaveLoop && !hasBlank) { //ZSS-1233\n\t\t\t\t\t\thasBlank = true;\n\t\t\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (leaveLoop) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ZSS-1241: Date 0, Number 1, String 2\n\t\t\t\tif (type0 < 3) {\n\t\t\t\t\ttypes[type0] = types[type0] + 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ZSS-1191\n\t\t\t\tfinal SCellStyle style = c.isNull() ? null : c.getCellStyle();\n\t\t\t\tfinal SFill ccfill = style == null ? BLANK_FILL : style.getFill();\n\t\t\t\tccitems.add(ccfill);\n\t\t\t\tfinal SFont font = style == null ? null : style.getFont();\n\t\t\t\tfinal SFill fcfill = font == null ? BLANK_FILL : new FillImpl(FillPattern.SOLID, font.getColor(), null);\n\t\t\t\tfcitems.add(fcfill);\n\t\t\t}\n\t\t}\n\t\tif (hasBlank) {\n\t\t\torderedRowInfos.add(blankRowInfo);\n\t\t}\n\t\t\n\t\t//ZSS-1241 determine the candidate\n\t\t//which kind of filter (DateFilter/NumberFilter/TextFilter); \n\t\t//0: date, 1: number, 2: string; if same count; Text > Number > Date\n\t\tint candidate = 2; \n\t\tint max = types[2];\n\t\tif (max < types[1]) {\n\t\t\tcandidate = 1;\n\t\t\tmax = types[1];\n\t\t}\n\t\tif (max < types[0]) {\n\t\t\tcandidate = 0;\n\t\t}\n\t\t\n\t\treturn new Object[] {orderedRowInfos, bottom, \n\t\t\t\tccitems.size() > 1 ? ccitems : Collections.EMPTY_SET, //ZSS-1191 \n\t\t\t\tnew Integer(candidate+1), //ZSS-1192\n\t\t\t\tfcitems.size() > 1 ? fcitems : Collections.EMPTY_SET, //ZSS-1191\n\t\t\t\tcolName}; //ZSS-1195\n\t}", "public boolean hasObject(SQLiteDatabase db,String TableName,\n String dbfield, String fieldValue) {\n String selectString = \"SELECT * FROM \" + TableName + \" WHERE \" + dbfield + \" =?\";\n\n // Add the String you are searching by here.\n // Put it in an array to avoid an unrecognized token error\n Cursor cursor = db.rawQuery(selectString, new String[] {fieldValue});\n\n boolean hasObject = false;\n if(cursor.moveToFirst()){\n hasObject = true;\n\n //region if you had multiple records to check for, use this region.\n\n int count = 0;\n while(cursor.moveToNext()){\n count++;\n }\n //here, count is records found\n Log.d(\"uzair\", String.format(\"%d records found\", count));\n\n //endregion\n\n }\n\n cursor.close(); // Dont forget to close your cursor\n db.close(); //AND your Database!\n return hasObject;\n }", "public static void ramFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n singleton.dtm.setColumnIdentifiers(ram);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Tipo\":\r\n //BUSCA POR TIPO\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND tipo LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Capacidad\":\r\n //BUSCA POR CAPACIDAD\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND capacidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Velocidad\":\r\n //BUSCA POR VELOCIDAD \r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND velocidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public LearningResultHasActivity[] findByDynamicWhere(String sql, Object[] sqlParams) throws LearningResultHasActivityDaoException;", "private RowFilter<Object, Object> getFilter(List<String> selectedCheckBoxes, final String regex) {\n FilterMapKey key = new FilterMapKey(selectedCheckBoxes);\n if (tableFilterMap.containsKey(key)) {\n return tableFilterMap.get(key);\n }\n\n RowFilter<Object, Object> filter = new RowFilter<Object, Object>() {\n @Override\n public boolean include(RowFilter.Entry entry) {\n String severity = (String) entry.getValue(1);\n return severity.matches(regex);\n }\n };\n tableFilterMap.put(key, filter);\n return filter;\n }", "@Override\n public List<ScalarFunctionColumn> getScalarFunctionColumns() {\n return subFilter.getScalarFunctionColumns();\n }", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "Condition equal(QueryParameter parameter, Object value);", "@Override\n\tpublic Datatable getdatatable(String sEcho, int iDisplayLength,\n\t\t\tint iDisplayStart, int iSortCol_0, String sSortDir_0, String sSearch, String filter) {\n\t\tDatatableExtractParams parameter = new DatatableExtractParams(sSearch, this.column, this.searchable, iSortCol_0, sSortDir_0);\n\t\tDatatable thnAjaranDatatable= new Datatable();\n\t\tthnAjaranDatatable.setsEcho(sEcho);\n\t\tString dbFilter = \"\";\n\t\tif(filter != null && !filter.equals(\"\")) dbFilter+=\" AND \"+filter; \n\t\tList<StsKehadiran> queryResult = get(\"(\"+parameter.getWhere()+\")\"+dbFilter, parameter.getOrder(), iDisplayLength, iDisplayStart);\n\t\tList<String[]> aData = new ArrayList<String[]>();\n\t\tfor (StsKehadiran stsKehadiran : queryResult) {\n\t\t\tString[] stsKehadiranString = new String[7];\n\t\t\tstsKehadiranString[0] = stsKehadiran.getIdStsKehadiran().toString();\n\t\t\tstsKehadiranString[1] = String.valueOf(stsKehadiran.getKodeStsKehadiran());\n\t\t\tstsKehadiranString[2] = String.valueOf(stsKehadiran.getNmStsKehadiran());\n\t\t\tstsKehadiranString[3] = String.valueOf(stsKehadiran.isaKehadiranAwal());\n\t\t\tstsKehadiranString[4] = String.valueOf(stsKehadiran.getaAbsen());\n\t\t\tstsKehadiranString[5] = String.valueOf(stsKehadiran.isaKehadiranTerhapus());\n\t\t\tstsKehadiranString[6] = String.valueOf(stsKehadiran.isaKehadiranTerhapus());\n\t\t\taData.add(stsKehadiranString);\n\t\t}\n\t\tthnAjaranDatatable.setAaData(aData);\n\t\tthnAjaranDatatable.setiTotalRecords(stsKehadiranRepository.count(filter));\n\t\tthnAjaranDatatable.setiTotalDisplayRecords(stsKehadiranRepository.count(\"(\"+parameter.getWhere()+\")\"+dbFilter));\n\n\t\treturn thnAjaranDatatable;\n\t}", "@FXML\r\n private void search(){\n \r\n String s = tfSearch.getText().trim(); \r\n String type = cmbType.getSelectionModel().getSelectedItem();\r\n String col = cmbFilterBy.getSelectionModel().getSelectedItem();\r\n \r\n /**\r\n * Column Filters\r\n * \r\n */\r\n \r\n \r\n if(!s.isEmpty()){\r\n if(!chbtoggleInActiveTraining.isSelected()){\r\n db.populateTable(trainingFields+ \" WHERE title LIKE '%\"+s+\"%' AND status<>'active'\", tblTrainingList);\r\n }\r\n\r\n if(chbtoggleInActiveTraining.isSelected()){\r\n db.populateTable(trainingFields+ \" WHERE title LIKE '%\"+s+\"%'\", tblTrainingList);\r\n } \r\n } \r\n }", "public RawGetRecordsByColumnResponse getRecordsByColumnRaw(GetRecordsByColumnRequest request) throws GPUdbException {\n RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse();\n submitRequest(\"/get/records/bycolumn\", request, actualResponse_, false);\n return actualResponse_;\n }", "private FechaCierreXModulo queryData() {\n\t\ttry {\n\n\t\t\tSystem.out.println(\"Los filtros son \"\n\t\t\t\t\t+ this.filterBI.getBean().toString());\n\n\t\t\t// Notification.show(\"Los filtros son \"\n\t\t\t// + this.filterBI.getBean().toString());\n\n\t\t\tFechaCierreXModulo item = mockData(this.filterBI.getBean());\n\n\t\t\treturn item;\n\n\t\t} catch (Exception e) {\n\t\t\tLogAndNotification.print(e);\n\t\t}\n\n\t\treturn new FechaCierreXModulo();\n\t}", "public void ProductsSearch(DefaultTableModel tableModel, String parameter){\n connect();\n ResultSet result = null;\n tableModel.setRowCount(0);\n tableModel.setColumnCount(0);\n String sql = \"SELECT id_producto as Id, descripcion, presentacion, cantidad, precio, subtotal, proveedor FROM \"+\n \"productos WHERE descripcion LIKE ? ORDER BY descripcion\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setString(1, \"%\" + parameter + \"%\");\n result = ps.executeQuery();\n if(result != null){\n int columnNumber = result.getMetaData().getColumnCount();\n for(int i = 1; i < columnNumber; i++){\n tableModel.addColumn(result.getMetaData().getColumnName(i));\n }\n while(result.next()){\n Object []obj = new Object[columnNumber];\n for(int i = 1; i < columnNumber; i++){\n obj[i-1] = result.getObject(i);\n }\n tableModel.addRow(obj);\n }\n }\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n } \n }", "DbQuery setEqualsFilter(long value) {\n return setEqualsFilter((double) value);\n }", "long countByExample(Table2Example example);", "boolean isFilterByExpression();", "public FilterCriterion(String columnName, Object value, Object value2, FilterType type)\n {\n this.columnName = columnName;\n this.value = value;\n this.type = type;\n this.value2 = value2;\n }", "public static void hddFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(hdd);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Capacidad\":\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND capacidad LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"RPM\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND rpm LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Tipo\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND tipo LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }" ]
[ "0.54151654", "0.53444487", "0.49339274", "0.482827", "0.48089364", "0.47969416", "0.47643846", "0.4755715", "0.47195786", "0.47162145", "0.47077373", "0.46518746", "0.46167734", "0.46071583", "0.45804745", "0.45793882", "0.4515424", "0.45108905", "0.4504017", "0.45030499", "0.44900206", "0.44607586", "0.44487643", "0.4443003", "0.44303027", "0.44038385", "0.4383608", "0.4377561", "0.43725112", "0.43634668", "0.4360734", "0.43537384", "0.43346825", "0.43309185", "0.432249", "0.43200836", "0.43103936", "0.43050852", "0.42958018", "0.42947638", "0.4286969", "0.42792976", "0.4274986", "0.4253677", "0.42415237", "0.42397493", "0.42381966", "0.42306045", "0.42241842", "0.42210916", "0.42155978", "0.4195909", "0.41864744", "0.41860658", "0.41858017", "0.41844636", "0.41705492", "0.41653267", "0.41562936", "0.41509455", "0.41377717", "0.41321346", "0.4130884", "0.41211295", "0.41204342", "0.411849", "0.411511", "0.4111057", "0.4108849", "0.41068906", "0.41024938", "0.4101796", "0.41008586", "0.41008368", "0.40971804", "0.40883216", "0.40824884", "0.40743774", "0.4073998", "0.40634015", "0.40623903", "0.40595657", "0.40543953", "0.40519604", "0.40509996", "0.40428934", "0.4039932", "0.40315002", "0.40219253", "0.40179208", "0.40165785", "0.4011586", "0.40100387", "0.40066257", "0.4000859", "0.40001732", "0.39942583", "0.39906767", "0.39804018", "0.39787087" ]
0.507589
2
Calculates which objects from a table has a particular value for a particular column. The input parameters provide a way to specify either a String or a Double valued column and a desired value for the column on which the filter is performed. The operation is synchronous, meaning that a response will not be returned until all the objects are fully available. The response payload provides the count of the resulting set. A new result view which satisfies the input filter restriction specification is also created with a view name passed in as part of the input payload. Although this functionality can also be accomplished with the standard filter function, it is more efficient.
public FilterByValueResponse filterByValue(String tableName, String viewName, boolean isString, double value, String valueStr, String columnName, Map<String, String> options) throws GPUdbException { FilterByValueRequest actualRequest_ = new FilterByValueRequest(tableName, viewName, isString, value, valueStr, columnName, options); FilterByValueResponse actualResponse_ = new FilterByValueResponse(); submitRequest("/filter/byvalue", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\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[] bindingNameRow = new String[7];\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\tbindingNameRow[6] = \"ROW_cc3\";\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\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "public FilterByValueResponse filterByValue(FilterByValueRequest request) throws GPUdbException {\n FilterByValueResponse actualResponse_ = new FilterByValueResponse();\n submitRequest(\"/filter/byvalue\", request, actualResponse_, false);\n return actualResponse_;\n }", "Integer calculate(String columnValue);", "long findValues(List<Object> values, List<Column> columns);", "ColumnInfoFilter getColumnInfoFilter();", "public Long getCount(Filter filter);", "KTable<K, V> filter(Predicate<K, V> predicate);", "public Object compile(DLFilterOperator unusedOperator, String key, Object... values) {\n List<DLColumnUnitModel> model = (List<DLColumnUnitModel>) values[2];\n\n // the key used as needle, the value input by the user\n // occurrence of this value is tested in the each column\n final String needle = (String) values[1];\n\n if (model.isEmpty()) {\n // compare by toString()\n String value = values[0] == null ? \"\" : values[0].toString();\n return needle != null && value.toLowerCase().contains(needle.toLowerCase());\n }\n\n // for each column\n for (DLColumnUnitModel unit : model) {\n\n try {\n\n // filter by visible columns only\n // filter by recognized (deifned) columns only\n // filter by columns available in QF only\n if (!unit.isVisible() || !unit.isColumn() || !unit.isQuickFilter()) {\n continue;\n }\n\n // get compiler for the value and operator to be able to evaluate the rule\n final FilterCompiler compiler = unit.getFilterCompiler() == null ? FilterSimpleCompiler.INSTANCE : unit.getFilterCompiler();\n\n // When the user wants to filter by ALL then he wants to use WYSIWYG search\n // Due to his expectations the filter uses CONTAINS operator to make a STRING\n // comparison as the user expect Eg. integer: value \"1223\", needle \"223\". CONTAINS evaluates this\n // as the valid entity but the EQUALS doesn't.\n final DLFilterOperator operator = DLFilterOperator.LIKE;\n\n // get value to be evaluated against given key\n // entity property - the value shown in the listbox\n // try to convert value\n final Object value = FilterUtils.getConvertedValue( FilterUtils.getValue(values[0], unit.getColumn()), unit);\n\n // if the value is missing it cannot match the rules\n // this if also prevents the NPE in the following code\n if (value == null) {\n continue;\n }\n\n // try to evaluate column\n // if matches, entity is valid\n // this is the basic implementation used also in DLFilter\n if ((Boolean) compiler.compile(operator, unit.getColumn(), value, needle)) {\n // matching property is found, the entity is valid\n // otherwise we have to continue searching for matching column\n return true;\n }\n\n } catch (NoSuchMethodException ex) {\n // ignore, field cannot be used in filter\n }\n }\n\n // no column matches the rule, entity is not valid\n return false;\n }", "public IAverageClause having(String column);", "public void addFilterEqual(String column, Object value) {\n controlRelationAndAddToList(criterionList, Restrictions.eq(trimColumn(column), value), column);\n }", "String getTypeFilter(String column, Collection<FxType> types);", "@FXML\n public void getFilteredResults(ActionEvent event) throws IOException {\n int filterValueInt = 0;\n String filterName = filterChoiceBox.getValue(); //Get value from text field\n\n UpdateHandler.setFilter_Changed(true);\n\n if (!filterName.equals(ALL_FILTER)) {\n try {\n filterValueInt = Integer.parseInt(filterValue.getText());\n } catch (NumberFormatException e) {\n JOptionPane.showMessageDialog(null, \"Has to be a number.\");\n }\n UpdateHandler.setFILTER_NAME(filterName);\n UpdateHandler.setFILTER_VALUE(filterValueInt);\n } else {\n UpdateHandler.setFILTER_NAME(\"All\");\n UpdateHandler.setFILTER_VALUE(0);\n }\n }", "@Test void testInterpretProjectFilterValues() {\n final String sql = \"select y, x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"where x > 1\";\n sql(sql).returnsRows(\"[b, 2]\", \"[c, 3]\");\n }", "public void visitColumn(double val);", "public IAverageClause where(String column);", "public Collection<T> filter(Query query) throws DataAccessException;", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;", "protected boolean hasFactsInIt( LogicalModel model, Selection businessColumn, Map<String, Object> parameters,\n boolean genAsPreparedStatement, DatabaseMeta databaseMeta, String locale ) {\n if ( businessColumn.hasAggregate() ) {\n return true;\n }\n\n // Parse the formula in the business column to see which tables and columns are involved...\n //\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, businessColumn, null, parameters, genAsPreparedStatement, databaseMeta, locale );\n for ( Selection column : sqlAndTables.getUsedColumns() ) {\n if ( column.hasAggregate() ) {\n return true;\n }\n }\n\n // Nothing found\n //\n return false;\n\n }", "@Override\n public SqlDatabaseTable filter(SqlDatabaseTable table, List<FilterRule> filterRules) {\n if (filterRules.isEmpty()) return table;\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"SELECT * FROM \").append(table.getFullRef());\n sql.append(\" WHERE\");\n for (int i = 0; i < filterRules.size(); i++) {\n FilterRule filterRule = filterRules.get(i);\n if (filterRule instanceof ColumnFilterRule) {\n int lhs = ((ColumnFilterRule) filterRule).getRowId();\n int rhs = ((ColumnFilterRule) filterRule).getAnotherRowId();\n sql.append(\" `_\").append(lhs).append(\"`=`_\").append(rhs).append(\"`\");\n } else if (filterRule instanceof ConstantFilterRule) {\n int rowId = ((ConstantFilterRule) filterRule).getRowId();\n String value = ((ConstantFilterRule) filterRule).getValue();\n sql.append(\" `_\").append(rowId).append(\"`='\").append(value).append(\"'\");\n } else {\n throw new IllegalArgumentException();\n }\n if (i != filterRules.size() - 1) {\n sql.append(\" AND\");\n }\n }\n\n return new SqlDatabaseQueryTable(sql.toString(), table.getArity());\n }", "public ColumnBasedTableFilter(RowObjectTableModel<R> model) {\n\t\tthis.model = model;\n\t\tthis.name = null;\n\t}", "@Nullable\n @Generated\n @Selector(\"havingPredicate\")\n public native NSPredicate havingPredicate();", "DataFilter getDataFilter(Connection con, SqlSearch search) throws FxSqlSearchException;", "int countByExample(MVoucherDTOCriteria example);", "public long countWithCondition(EvaluetingListDO evaluetingList) throws DataAccessException;", "public int searchRowsCount(SearchCriteria cri);", "public List<Object> queryByWhere(String col_name, String dto, List<List<Triple>> filter, List<String> keys) {\n\t\tList<Object> res = new ArrayList<Object>();\n\t\tDBCollection dbc = db.getCollection(col_name);\n\t\t// filter\n\t\tBasicDBObject all_ref = new BasicDBObject();\n\t\tDBObject _keys = new BasicDBObject();\n\t\t\n\t\tif(keys != null)\n\t\t\tfor(String key : keys) \n\t\t\t\t_keys.put(key, true);\n\t\t\n\t\tBasicDBList list = new BasicDBList();\n\t\tfor(List<Triple> and : filter) {\n\t\t\tBasicDBObject ref = new BasicDBObject();\n\t\t\tfor(Triple tri : and) {\n\t\t\t\tif(!ref.containsField(tri.key_name)) {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) \n\t\t\t\t\t\tref.put(tri.key_name, tri.value);\n\t\t\t\t\t\n\t\t\t\t\telse \n\t\t\t\t\t\tref.put(tri.key_name, new BasicDBObject(tri.condition, tri.value));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) {\n\t\t\t\t\t\t// TODO It is impossible\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tBasicDBObject bo = (BasicDBObject)ref.get(tri.key_name);\n\t\t\t\t\t\tbo.append(tri.condition, tri.value);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end an \"and\" query\n\t\t\tlist.add(ref);\n\t\t}\n\t\t\n\t\tall_ref.put(\"$or\", list);\n\t\t\n\t\ttry {\n\t DBCursor cur = dbc.find(all_ref, _keys);\n\t \twhile (cur.hasNext()) {\n\t \t\tDBObject doc = cur.next();\n\t \t\ttry {\n\t \t\t\tres.add(Util.deserialize(doc, dto));\n\t \t\t} catch(InvocationTargetException ite) {\n\t \t\t\tite.printStackTrace();\n\t \t\t} \t\t\n\t \t\t//System.out.println(doc);\n\t }\n\n\t\t} catch(ClassNotFoundException cnfe) {\n \tcnfe.printStackTrace();\n } catch(InstantiationException ie) {\n \tie.printStackTrace();\n } catch(IllegalAccessException iae) {\n \tiae.printStackTrace();\n }\n\n \treturn res;\n\t}", "String getVersionFilter(String tableAlias);", "protected boolean analyzeTable(final Parameter _parameter,\n final IFilterList _filterlist,\n final QueryBuilder _queryBldr,\n final Type _type)\n throws EFapsException\n {\n boolean exec = true;\n if (CollectionUtils.isNotEmpty(_filterlist)) {\n // filtering\n for (final IFilter filter : _filterlist) {\n final Field field = Field.get(filter.getFieldId());\n if (field.getFilter().getType().equals(FilterType.FREETEXT)\n || field.getFilter().getType().equals(FilterType.FORM)\n && field.getFilter().getAttributes() != null) {\n String attrName = field.getAttribute();\n String[] attrNames = null;\n if (field.getFilter().getAttributes() != null) {\n if (field.getFilter().getAttributes().contains(\",\")) {\n attrNames = field.getFilter().getAttributes().split(\",\");\n } else {\n attrName = field.getFilter().getAttributes();\n }\n }\n if (attrNames != null) {\n exec = addInsideRangeFilter(_parameter, filter, _queryBldr, _type, attrNames);\n } else {\n if (attrName != null && _type.getAttribute(attrName) != null) {\n exec = addFilter(_parameter, filter, _queryBldr, _type, attrName);\n } else {\n exec = addFilter4Select(_parameter, filter, _queryBldr, _type, field.getSelect());\n }\n }\n if (!exec) {\n break;\n }\n } else if (field.getFilter().getType().equals(FilterType.CLASSIFICATION)) {\n exec = addClassFilter(_parameter, filter, _queryBldr, _type);\n } else if (field.getFilter().getType().equals(FilterType.STATUS)) {\n exec = addStatusFilter(_parameter, filter, _queryBldr, _type);\n }\n }\n }\n return exec;\n }", "@SelectProvider(type = ServeInfoSqlProvider.class, method = \"hasSameName\")\n int hasSameName(@Param(\"name\") String name, @Param(\"filterId\") Long filterId);", "public List<ViewXwZqkh> Query(String filters, String orders, Object... values);", "ArrayList<E> getWhere(String parameterName, int parameterValue, E dummyObject) throws DatabaseNotAccessibleException, DatabaseObjectNotFoundException, NoSuchFieldException;", "long countByFilter(String keySearch, String brands, Double priceFrom, Double priceTo);", "protected boolean analyzeTable(final Parameter _parameter,\n final IFilterList _filterlist,\n final QueryBuilder _queryBldr)\n throws EFapsException\n {\n return analyzeTable(_parameter, _filterlist, _queryBldr, Type.get(_queryBldr.getTypeUUID()));\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "public void testGroupFilterOnComputedColumnsWithAggregations( ) throws Exception\n \t{\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\", \"cc4\" };\n \t\tccExpr = new String[] {\n \t\t\t\t\"row.COL0+row.COL1\",\n \t\t\t\t\"Total.sum(row.COL1+row.cc1)\",\n \t\t\t\t\"Total.ave(row.cc1+row.COL2+row.COL3, null, 0)*81\",\n \t\t\t\t\"Total.sum(row.COL1+row.COL2+row.COL3+row.COL0)\" };\n \t\t\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 \t\t\n \t\tString[] bindingNameGroup = new String[1];\n \t\tbindingNameGroup[0] = \"GROUP_GROUP1\";\n \t\tIBaseExpression[] bindingExprGroup = new IBaseExpression[1];\n \t\tbindingExprGroup[0] = new ScriptExpression(\"dataSetRow.cc1\");\n \n \t\tGroupDefinition[] groupDefn = new GroupDefinition[] {\n \t\t\t\tnew GroupDefinition(\"group1\") };\t\n \t\tgroupDefn[0].setKeyExpression(\"row.GROUP_GROUP1\");\n \t\t\n \t\tFilterDefinition filter = new FilterDefinition(new ScriptExpression(\n \t\t\t\t\"Total.sum(dataSetRow.COL0)>400\"));\n \t\tgroupDefn[0].addFilter(filter);\n \n \t\tString[] bindingNameRow = new String[8];\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\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tbindingNameRow[7] = \"ROW_cc4\";\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\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[3], 0) };\n \n \t\ttry {\n \t\t\tthis.executeQuery(this.createQuery(null, null, null, null, null,\n \t\t\t\t\tnull, null, null, null, bindingNameRow, bindingExprRow));\n \t\t\t// fail( \"Should not arrive here\" );\n \t\t} catch (DataException e) {\n \n \t\t}\n \t}", "DbQuery setEqualsFilter(int value) {\n return setEqualsFilter((double) value);\n }", "@Override\n\tpublic long countBy(ITableDBContext context, Table table, IDBFilter filter) throws Throwable {\n\t\tthrow new Warning(\"not impl\");\n\t}", "public interface QueryFilter {\n\t\tpublic void apply(Query<? extends PersistentObject> qbe);\n\t}", "public void interactiveTestColumnControlAndFilters() {\n final JXTable table = new JXTable(new AncientSwingTeam());\n table.setColumnControlVisible(true);\n // table.setFilters(createPipeline());\n Action toggleFilter = new AbstractAction(\"Toggle Filters\") {\n boolean hasFilters;\n public void actionPerformed(ActionEvent e) {\n if (hasFilters) {\n table.setFilters(null);\n } else {\n table.setFilters(createPipeline());\n // FilterPipeline pipeline = new FilterPipeline(new Filter[] {});\n // table.setFilters(pipeline);\n }\n hasFilters = !hasFilters;\n \n }\n \n };\n toggleFilter.putValue(Action.SHORT_DESCRIPTION, \"filtering first column - problem if invisible \");\n JXFrame frame = wrapWithScrollingInFrame(table, \"JXTable ColumnControl and Filters\");\n addAction(frame, toggleFilter);\n frame.setVisible(true);\n }", "ArrayList<E> getWhere(String parameterName, String parameterValue, E dummyObject) throws DatabaseNotAccessibleException, DatabaseObjectNotFoundException, NoSuchFieldException;", "@Test\n public void testWhere_withValidQuery() {\n String column0 = \"user_id\";\n String column1 = \"age\";\n int idValue0 = 0;\n int ageValue0 = 23;\n int idValue1 = 1;\n int ageValue1 = 22;\n int idValue2 = 2;\n int ageValue2 = 18;\n\n try {\n String sql = \"CREATE TABLE ModelExtension (\" +\n column0 + \" int, \" +\n column1 + \" int)\";\n PreparedStatement pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.execute();\n sql = \"INSERT INTO ModelExtension (\" +\n column0 + \", \" +\n column1 + \") VALUES (\" +\n idValue0 + \", \" +\n ageValue0 + \"), (\" +\n idValue1 + \", \" +\n ageValue1 + \"), (\" +\n idValue2 + \", \" +\n ageValue2 + \")\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n\n List<ModelExtension> models = child.findAll().where(column1 + \">20\").execute(ModelExtension.class);\n\n assertEquals(2, models.size());\n assertEquals(idValue0, models.get(0).get(column0));\n assertEquals(ageValue0, models.get(0).get(column1));\n assertEquals(idValue1, models.get(1).get(column0));\n assertEquals(ageValue1, models.get(1).get(column1));\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public void counter(Object filterValue ) throws SQLException, NamingException, IOException {\n\t try {\t\n\t \tContext initContext = new InitialContext(); \n\t \t\tDataSource ds = (DataSource) initContext.lookup(JNDI);\n\t\n\t \t\tcon = ds.getConnection();\n\t \t\t\n\t \t\t//Reconoce la base de datos de conección para ejecutar el query correspondiente a cada uno\n\t \t\tDatabaseMetaData databaseMetaData = con.getMetaData();\n\t \t\tproductName = databaseMetaData.getDatabaseProductName();//Identifica la base de datos de conección\n\t \t\t\n\t \t\tString[] veccodcia = pcodcia.split(\"\\\\ - \", -1);\n\t\n\t \t\tString query = null;\n\t \t\t\n\t \t\tswitch ( productName ) {\n\t case \"Oracle\":\n\t \tquery = \"SELECT count_autos01('\" + ((String) filterValue).toUpperCase() + \"','\" + veccodcia[0] + \"','\" + grupo + \"') from dual\";\n\t break;\n\t case \"PostgreSQL\":\n\t \tquery = \"SELECT count_autos01('\" + ((String) filterValue).toUpperCase() + \"','\" + veccodcia[0] + \"','\" + grupo + \"')\";\n\t break;\n\t \t\t}\n\n\t \t\t \n\t\n\t \n\t pstmt = con.prepareStatement(query);\n\t //System.out.println(query);\n\t\n\t r = pstmt.executeQuery();\n\t \n\t \n\t while (r.next()){\n\t \trows = r.getInt(1);\n\t }\n\t } catch (SQLException e){\n\t e.printStackTrace(); \n\t }\n\t //Cierra las conecciones\n\t pstmt.close();\n\t con.close();\n\t r.close();\n\t\n\t \t}", "@Override\r\n\tpublic boolean evaluate(Object value, int column) throws SQLException {\n\t\treturn false;\r\n\t}", "@Override\n public Long countByCriteria(String[] layerList, String[] taxonList, String[] indicList,String colum) {\n //Build the query string base on parameters\n StringBuilder query = new StringBuilder();\n query.append(\"Select count(distinct \"+colum+\") from ait.taxon_info_index where \");\n \n //If there is geografical criteria\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\"(\");\n for(int i = 0;i<layerList.length;i++){\n String[] aux = layerList[i].split(\"~\");\n String layer = aux[0];\n String polygon = aux[1];\n if(i==layerList.length-1){ //last element\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\")\");\n }\n else{\n query.append(\"(layer_table = '\"+layer+\"' and polygom_id = \"+polygon+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //If there is taxonomy criteria\n if(taxonList.length>0 && !taxonList[0].equals(\"\")){\n if(layerList.length>0 && !layerList[0].equals(\"\")){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<taxonList.length;i++){\n //Get the name and taxonomical level of the specified taxon\n TaxonIndex ti = taxonIndexDAO.getTaxonIndexByName(taxonList[i]);\n if(ti.getTaxon_id()!=null){\n //To search in the specified taxonomyField\n String levelColum;\n switch (ti.getTaxon_range().intValue()) {\n case 1:\n levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n break;\n case 2:\n levelColum = TaxonomicalRange.PHYLUM.getFieldName();\n break;\n case 3:\n levelColum = TaxonomicalRange.CLASS.getFieldName();\n break;\n case 4:\n levelColum = TaxonomicalRange.ORDER.getFieldName();\n break;\n case 5:\n levelColum = TaxonomicalRange.FAMILY.getFieldName();\n break;\n case 6:\n levelColum = TaxonomicalRange.GENUS.getFieldName();\n break;\n case 7:\n levelColum = TaxonomicalRange.SPECIFICEPITHET.getFieldName();\n break;\n default:\n levelColum = TaxonomicalRange.SCIENTIFICNAME.getFieldName();\n break;\n }\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+ti.getTaxon_id()+\") or \");\n }\n }\n else{ //If the taxon doesn't exist on data base\n String levelColum = TaxonomicalRange.KINGDOM.getFieldName();\n if(i==taxonList.length-1){ //last element\n query.append(\"(\"+levelColum+\" = \"+-1+\")\");\n }\n else{\n query.append(\"(\"+levelColum+\" = \"+-1+\") or \");\n }\n }\n }\n query.append(\")\");\n }\n \n //If there is indicators criteria\n if(indicList.length>0 && !indicList[0].equals(\"\")){\n if((taxonList.length>0 && !taxonList[0].equals(\"\"))||(layerList.length>0 && !layerList[0].equals(\"\"))){\n query.append(\" and (\");\n }\n else{\n query.append(\"(\");\n }\n for(int i = 0;i<indicList.length;i++){\n if(i==indicList.length-1){ //last element\n query.append(\"(indicator_id = \"+indicList[i]+\")\");\n }\n else{\n query.append(\"(indicator_id = \"+indicList[i]+\") or \");\n }\n }\n query.append(\")\");\n }\n \n //Execute query\n return taxonInfoIndexDAO.countTaxonsByQuery(query.toString());\n }", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit,\n Filter<K, C>... filters);", "@Deprecated\n ExtraQuery filter(String name, Object value);", "int selectCountByFilter( ResponseFilter filter, Plugin plugin );", "public static void generalFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(general);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n default:\r\n \r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public static void displayFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(displays);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Resolución\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND resolucion LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n case \"Tamaño\":\r\n //BUSCA POR TAMAÑO\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tam,r.resolucion FROM articulos a,mon r WHERE a.codigo = r.producto_id AND tam LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosMon(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"tam\"),rs.getString(\"resolucion\")));\r\n }\r\n }else{\r\n searchDisplays();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public int contarPorCriterio(Map<String, String> filters)\r\n/* 44: */ {\r\n/* 45: 93 */ return this.maquinaDao.contarPorCriterio(filters);\r\n/* 46: */ }", "public QueryResultBuilder<T> applyFilter(Option<QueryFilter<T>> filter, Option<Map<String, Object>> params);", "Condition greaterThanOrEqualTo(QueryParameter parameter, Object x);", "@Override\r\n\tpublic List<ViewListeEleve> filter(HttpHeaders headers, List<Predicat> predicats, Map<String, OrderType> orders,\r\n\t\t\tSet<String> properties, Map<String, Object> hints, int firstResult, int maxResult) {\n \tList<ViewListeEleve> list = super.filter(headers, predicats, orders, properties, hints, firstResult, maxResult);\r\n \tSystem.out.println(\"ViewListeEleveRSImpl.filter() size is \"+list.size());\r\n\t\treturn list ;\r\n\t}", "private void filteringAndSortingWithDataView() {\n ComboBox<Person> comboBox = new ComboBox<>(\"Persons\");\n PersonService personService = new PersonService();\n\n // We fetch the items to the memory and bind the obtained collection\n // to the combo box\n Collection<Person> persons = personService.fetchAll();\n\n ComboBoxListDataView<Person> dataView = comboBox.setItems(persons);\n\n /*\n * Providing a predicate item filter allows filtering by any field of\n * the business entity and apply a combo box's text filter independently\n */\n IntegerField personAgeFilter = new IntegerField(\n event -> dataView.setFilter(person -> event.getValue() == null\n || person.getAge() > event.getValue()));\n\n /*\n * Providing a value provider or comparator allows sorting combo box's\n * items by custom field, or combination of fields\n */\n Button sortPersons = new Button(\"Sort Persons by Name\",\n event -> dataView.setSortOrder(Person::toString,\n SortDirection.ASCENDING));\n\n personAgeFilter.setLabel(\"Filter Persons with age more than:\");\n personAgeFilter.setWidth(WIDTH_STRING);\n addCard(\"Filtering\", \"Filtering and Sorting with Data View\", comboBox,\n personAgeFilter, sortPersons);\n }", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseByFilter();\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 (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public static void procFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(proc);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Nucleos\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND nucleos = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Tipo Socket\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND tiposocket LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n case \"Velocidad\":\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,proc r WHERE a.codigo = r.codart AND velocidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosProc(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"velocidad\"),rs.getString(\"tiposocket\"),rs.getInt(\"nucleos\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchProcessors();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n } \r\n }", "@Override\r\n\t@Transactional\r\n\tpublic int getCount(List<Filter> filters){\r\n\t\ttry{\r\n\t\t\tString sql = \"select count(*) \"\r\n\t\t\t\t\t + \"from FmtEstado \";\r\n\t\t\t\r\n\t\t\tsql = sqlFunctions.completeSQL(null, filters, sql, FmtEstado.getColumnNames());\r\n\t\t\t\r\n\t\t\tQuery query = getSession().createQuery(sql);\r\n\t \r\n\t\t\t query=sqlFunctions.setParameters(filters, query);\r\n\t\t\t \r\n\t\t\tIterator it = query.list().iterator();\r\n\t Long ret = new Long(0);\r\n\t \r\n\t if (it != null)\r\n\t\t if (it.hasNext()){\r\n\t\t \tret = (Long) it.next();\r\n\t\t }\r\n\t \r\n\t\t\treturn ret.intValue();\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "public Object getResult(ResultSet rs, String columnName) throws SQLException;", "@GetMapping(\"/filtering\")\n\tpublic MappingJacksonValue retrieveSomeBean() {\n\n\t\tSomeBean someBean = new SomeBean(\"value1\", \"value2\", \"value3\");\n\n\t\t// dynamic filtering\n\t\tSimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"field1\", \"field2\");\n\n\t\tMappingJacksonValue mapping = filtering(someBean, filter);\n\n\t\treturn mapping;\n\t}", "private Object [] getFilterVals()\n throws java.sql.SQLException\n {\n Object [] ret = new Object[m_cols.length];\n\n for (int i = 0; i < m_cols.length; i++)\n {\n ret[i] = m_rs.getString((String)m_cols[i]);\n }\n return ret;\n }", "public String applyFilter() {\n if (!filterSelectedField.equals(\"-1\")) {\n Class<?> fieldClass = getFieldType(filterSelectedField);\n\n if ((fieldClass.equals(Integer.class) && !NumberUtil.isInteger(filterCriteria))\n || (fieldClass.equals(Long.class) && !NumberUtil.isLong(filterCriteria))\n || (fieldClass.equals(BigInteger.class) && !NumberUtil.isBigInteger(filterCriteria))) {\n setWarnMessage(i18n.iValue(\"web.client.backingBean.abstractCrudBean.message.MustBeInteger\"));\n filterCriteria = \"\";\n } else {\n signalRead();\n }\n paginationHelper = null; // For pagination recreation\n dataModel = null; // For data model recreation\n selectedItems = null; // For clearing selection\n } else {\n setWarnMessage(i18n.iValue(\"web.client.backingBean.abstractCrudBean.message.MustSelectFindOption\"));\n }\n return null;\n }", "KTable<K, V> filterOut(Predicate<K, V> predicate);", "public <T> int select(final String sqlQuery, final Map<String, Object> param) throws Exception;", "@Override\r\n\tpublic boolean evaluate(Object value, String columnName)\r\n\t\t\tthrows SQLException {\n\t\treturn false;\r\n\t}", "public boolean isFiltered()\n\t{\n\t\tfinal TiTableView tableView = getTableView();\n\n\t\tif (tableView != null) {\n\t\t\treturn tableView.isFiltered();\n\t\t}\n\n\t\treturn false;\n\t}", "public void addStats(String column, boolean queryHit, boolean filterHit) {\n if (this.columnStats.containsKey(column)) {\n this.columnStats.get(column).queryHit |= queryHit;\n this.columnStats.get(column).filterHit |= filterHit;\n } else {\n this.columnStats.put(column, new ColumnStatsDelta(queryHit, filterHit));\n }\n }", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getEquipserviceRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new EquipserviceDao(uriInfo,header).getEquipserviceByFilter();\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 (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getEquipserviceRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public <Y extends RPrimitive> RDataframe filter(String name, Predicate<Y> predicate) {\n\t\treturn filter(RFilter.from(name, predicate));\n\t}", "IViewFilter getViewFilter();", "Condition greaterThan(QueryParameter parameter, Object x);", "public boolean fitsCriteria(Map<String, String> filter){\n return mutableSegmentController.fitsFilterCriteria(filter);\n }", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getChannelRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new ChannelDao(uriInfo,header).getChannelByFilter();\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 (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getChannelRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "UserFilterResult find(UserFilterRequest request);", "<K1> KTable<K1, Long> count(KeyValueMapper<K, V, K1> selector,\n Serializer<K1> keySerializer,\n Serializer<V> valueSerializer,\n Serializer<Long> aggValueSerializer,\n Deserializer<K1> keyDeserializer,\n Deserializer<V> valueDeserializer,\n Deserializer<Long> aggValueDeserializer,\n String name);", "handy.storage.api.ColumnCondition<DeleteOperation<T>> where(String column);", "public void testDynamizePredicate() {\n part.insertPredicate(\"<http://dbpedia.org/ontology/deathPlace>\", 100);\n\n part.setInsDyn(0.5);\n part.setDelDyn(0.1);\n \n part.dynamizePredicate(\"<http://dbpedia.org/ontology/deathPlace>\");\n\n WebResource endpoint = part.getService();\n String checkquery= \"SELECT (COUNT(*) as ?no) \"\n + \"{?s <http://dbpedia.org/ontology/deathPlace> ?o }\";\n\n assertEquals(140,\n Integer.parseInt(\n endpoint.path(\"sparql\").queryParam(\"query\", checkquery)\n\t\t\t .accept(\"application/sparql-results+csv\")\n\t\t\t .get(String.class).replace(\"no\\n\", \"\").trim()));\n }", "public static List<Result> getDataByFilter(String tableName, String startRowKey, String endRowKey, String regexKey, int num) {\n FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);\n\n //a row filter using regex\n RegexStringComparator rc = new RegexStringComparator(regexKey);\n RowFilter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, rc);\n\n //filter the the num in a page\n Filter filterNum = new PageFilter(num);\n\n //add them into filter list\n filterList.addFilter(rowFilter);\n filterList.addFilter(filterNum);\n\n //setup a scan and set the range and regex of row\n Scan scan = new Scan();\n scan.setStartRow(startRowKey.getBytes());\n scan.setStopRow(endRowKey.getBytes());\n scan.setFilter(filterList);\n\n //get result\n return getResultsFromScan(tableName, scan);\n }", "public DDataFilter(DDataAttribute column, DDataFilterOperator operator, Object value, Object valueTo) throws DDataException {\n if (column == null || column.getPropertyName() == null)\n throw new DDataException(\"can't create filter for NULL\");\n\n this.attribute = column;\n if (attribute.isMappedBean()) {\n filters = new ArrayList<>();\n this.externalData = attribute.getBeanInterface().isAnnotationPresent(DDataPrototypeRealization.class);\n this.operator = operator;\n this.value = value;\n this.valueTo = valueTo;\n } else {\n filters = null;\n this.externalData = false;\n this.operator = operator;\n this.value = value;\n this.valueTo = valueTo;\n }\n }", "public void filtered(FilteredCall<UserCQ, UserCQ> filteredLambda) {\n filtered(filteredLambda, null);\n }", "private Object[] scanRows(int field, NFilterColumn fc, SRange range, \n\t\t\tSSheet worksheet, STable table, //ZSS-988 \n\t\t\tSFill filterFill, boolean byFontColor, //ZSS-1191 \n\t\t\tSCustomFilters custFilters,\n\t\t\tSDynamicFilter dynaFilter, STop10Filter top10Filter) { //ZSS-1192\n\t\tSortedSet<FilterRowInfo> orderedRowInfos = \n\t\t\t\tnew TreeSet<FilterRowInfo>(new FilterRowInfoComparator());\n\t\t\n\t\t//ZSS-1191\n\t\tLinkedHashSet<SFill> ccitems = new LinkedHashSet<SFill>(); //ZSS-1191: CELL_COLOR\n\t\tLinkedHashSet<SFill> fcitems = new LinkedHashSet<SFill>(); //ZSS-1191: FONT_COLOR\n\t\tint[] types = new int[] {0, 0, 0}; //0: date, 1: number, 2: string\n\t\t\n\t\tblankRowInfo = new FilterRowInfo(BLANK_VALUE, \"(Blanks)\");\n\t\tfinal Set criteria1 = fc == null ? null : fc.getCriteria1();\n\t\tboolean hasBlank = false;\n\t\tboolean hasSelectedBlank = false;\n\t\tfinal int top = range.getRow() + 1;\n\t\tint bottom = range.getLastRow();\n\t\tfinal int columnIndex = range.getColumn() + field - 1;\n\t\tfinal SFont defaultFont = worksheet.getBook().getDefaultFont(); //ZSS-1191\n\t\tFormatEngine fe = EngineFactory.getInstance().createFormatEngine();\n\t\tboolean isItemFilter = filterFill == null //ZSS-1191 \n\t\t\t\t&& custFilters == null //ZSS-1192\n\t\t\t\t&& dynaFilter == null && top10Filter == null; //ZSS-1193\n\t\t//ZSS-1195\n\t\tfinal SCell cell = worksheet.getCell(range.getRow(), columnIndex);\n\t\tString colName = null;\n\t\tif (!cell.isNull() && cell.getType() != CellType.BLANK) {\n\t\t\tFormatResult fr = fe.format(cell, new FormatContext(ZssContext.getCurrent().getLocale()));\n\t\t\tcolName = fr.getText();\n\t\t}\n\t\tif (colName == null || Strings.isBlank(colName)) {\n\t\t\tfinal String ab = CellReference.convertNumToColString(columnIndex);\n\t\t\tcolName = \"(Column \"+ab+\")\";\n\t\t}\n\n\t\tfor (int i = top; i <= bottom; i++) {\n\t\t\t//ZSS-988: filter column with no criteria should not show option of hidden row \n\t\t\tif (isItemFilter && (criteria1 == null || criteria1.isEmpty())) { //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\tif (worksheet.getRow(i).isHidden())\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal SCell c = worksheet.getCell(i, columnIndex);\n\t\t\t\n\t\t\t//ZSS-1191\n\t\t\tfinal SCellStyle style = c.isNull() ? null : c.getCellStyle();\n\t\t\tfinal SFill ccfill = style == null ? BLANK_FILL : style.getFill();\n\t\t\tccitems.add(ccfill);\n\t\t\tfinal SFont font = style == null ? null : style.getFont();\n\t\t\tfinal boolean isDefaultFont = defaultFont.equals(font);\n\t\t\tfinal SFill fcfill = font == null || isDefaultFont ? \n\t\t\t\tBLANK_FILL : new FillImpl(FillPattern.NONE, font.getColor(), ColorImpl.WHITE);\n\t\t\tfcitems.add(fcfill);\t\t\t\n\t\t\tint type0 = 3; //ZSS-1241\n\t\t\t\n\t\t\tif (!c.isNull() && c.getType() != CellType.BLANK) {\n\t\t\t\tFormatResult fr = fe.format(c, new FormatContext(ZssContext.getCurrent().getLocale()));\n\t\t\t\tString displaytxt = fr.getText();\n\t\t\t\tif(!hasBlank && displaytxt.trim().isEmpty()) { //ZSS-707: show as blank; then it is blank\n\t\t\t\t\thasBlank = true;\n\t\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\tObject val = c.getValue(); // ZSS-707\n\t\t\t\t\tif(c.getType()==CellType.NUMBER && fr.isDateFormatted()){\n\t\t\t\t\t\tval = c.getDateValue();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//ZSS-1191: Date 1, Number 2, String 3, Boolean 4 is Number; Error 5 and Blank 6.\n\t\t\t\t\tfinal int type = FilterRowInfo.getType(val);\n\t\t\t\t\ttype0 = (type == 4 ? 2 : type) - 1; //ZSS-1241\n\t\t\t\t\t\n\t\t\t\t\tFilterRowInfo rowInfo = new FilterRowInfo(val, displaytxt);\n\t\t\t\t\t//ZSS-299\n\t\t\t\t\torderedRowInfos.add(rowInfo);\n\t\t\t\t\t//ZSS-1191, ZSS-1192, ZSS-1193: color/custom/dynamic/top10 filter excludes item filter\n\t\t\t\t\tif (isItemFilter) { \n\t\t\t\t\t\tif (criteria1 == null || criteria1.isEmpty() || criteria1.contains(displaytxt)) { //selected\n\t\t\t\t\t\t\trowInfo.setSelected(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (!hasBlank){\n\t\t\t\thasBlank = true;\n\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t}\n\t\t\t\n\t\t\t//ZSS-1241: Date 0, Number 1, String 2\n\t\t\tif (type0 < 3) {\n\t\t\t\ttypes[type0] = types[type0] + 1;\n\t\t\t}\n\t\t}\n\t\t//ZSS-988: Only when it is not a table filter, it is possible to change the last row.\n\t\tif (table == null) {\n\t\t\t//ZSS-988: when hit Table cell; must stop\n\t\t\tint blm = Integer.MAX_VALUE;\n\t\t\tfinal SSheet sheet = range.getSheet();\n\t\t\tfor (STable tb : sheet.getTables()) {\n\t\t\t\tfinal CellRegion rgn = tb.getAllRegion().getRegion();\n\t\t\t\tfinal int l = rgn.getColumn();\n\t\t\t\tfinal int r = rgn.getLastColumn();\n\t\t\t\tfinal int t = rgn.getRow();\n\t\t\t\tif (l <= columnIndex && columnIndex <= r && t > bottom && blm >= t)\n\t\t\t\t\tblm = t - 1;\n\t\t\t}\n\n\t\t\tfinal int maxblm = Math.min(blm, worksheet.getEndRowIndex());\n\t\t\t//ZSS-704: user could have enter non-blank value along the filter, must add that into\n\t\t\tfinal int left = range.getColumn();\n\t\t\tfinal int right = range.getLastColumn();\n\t\t\tboolean leaveLoop = false;\n\t\t\tfor (int i = bottom+1; i <= maxblm ; ++i) {\n\t\t\t\tfinal SCell c = worksheet.getCell(i, columnIndex);\n\t\t\t\t\n\t\t\t\tint type0 = 3; //ZSS-1241\n\n\t\t\t\tif (!c.isNull() && c.getType() != CellType.BLANK) {\n\t\t\t\t\tFormatResult fr = fe.format(c, new FormatContext(ZssContext.getCurrent().getLocale()));\n\t\t\t\t\tString displaytxt = fr.getText();\n\t\t\t\t\tif(!hasBlank && displaytxt.trim().isEmpty()) { //ZSS-707: show as blank; then it is blank\n\t\t\t\t\t\thasBlank = true;\n\t\t\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\t\t} else {\n\t\t\t\t\t\tObject val = c.getValue(); // ZSS-707\n\t\t\t\t\t\tif(c.getType()==CellType.NUMBER && fr.isDateFormatted()){\n\t\t\t\t\t\t\tval = c.getDateValue();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//ZSS-1191: Date 1, Number 2, String 3, Boolean 4 is Number; Error 5 and Blank 6\n\t\t\t\t\t\tfinal int type = FilterRowInfo.getType(val);\n\t\t\t\t\t\ttype0 = (type == 4 ? 2 : type) - 1; // ZSS-1241\n\t\t\t\t\t\t\n\t\t\t\t\t\tFilterRowInfo rowInfo = new FilterRowInfo(val, displaytxt);\n\t\t\t\t\t\t//ZSS-299\n\t\t\t\t\t\torderedRowInfos.add(rowInfo);\n\t\t\t\t\t\t//ZSS-1191, ZSS-1192: color/custom/dynamic/top10 filter excludes item filter\n\t\t\t\t\t\tif (filterFill == null && custFilters == null) { \n\t\t\t\t\t\t\tif (criteria1 == null || criteria1.isEmpty() || criteria1.contains(displaytxt)) { //selected\n\t\t\t\t\t\t\t\trowInfo.setSelected(true);\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} else {\n\t\t\t\t\t//really an empty cell?\n\t\t\t\t\tint[] ltrb = getMergedMinMax(worksheet, i, columnIndex);\n\t\t\t\t\tif (ltrb == null) {\n\t\t\t\t\t\tif (neighborIsBlank(worksheet, left, right, i, columnIndex)) {\n\t\t\t\t\t\t\tbottom = i - 1;\n\t\t\t\t\t\t\tleaveLoop = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti = ltrb[3];\n\t\t\t\t\t}\n\t\t\t\t\tif (!leaveLoop && !hasBlank) { //ZSS-1233\n\t\t\t\t\t\thasBlank = true;\n\t\t\t\t\t\thasSelectedBlank = prepareBlankRow(criteria1, hasSelectedBlank, isItemFilter); //ZSS-1191, ZSS-1192, ZSS-1193\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (leaveLoop) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ZSS-1241: Date 0, Number 1, String 2\n\t\t\t\tif (type0 < 3) {\n\t\t\t\t\ttypes[type0] = types[type0] + 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ZSS-1191\n\t\t\t\tfinal SCellStyle style = c.isNull() ? null : c.getCellStyle();\n\t\t\t\tfinal SFill ccfill = style == null ? BLANK_FILL : style.getFill();\n\t\t\t\tccitems.add(ccfill);\n\t\t\t\tfinal SFont font = style == null ? null : style.getFont();\n\t\t\t\tfinal SFill fcfill = font == null ? BLANK_FILL : new FillImpl(FillPattern.SOLID, font.getColor(), null);\n\t\t\t\tfcitems.add(fcfill);\n\t\t\t}\n\t\t}\n\t\tif (hasBlank) {\n\t\t\torderedRowInfos.add(blankRowInfo);\n\t\t}\n\t\t\n\t\t//ZSS-1241 determine the candidate\n\t\t//which kind of filter (DateFilter/NumberFilter/TextFilter); \n\t\t//0: date, 1: number, 2: string; if same count; Text > Number > Date\n\t\tint candidate = 2; \n\t\tint max = types[2];\n\t\tif (max < types[1]) {\n\t\t\tcandidate = 1;\n\t\t\tmax = types[1];\n\t\t}\n\t\tif (max < types[0]) {\n\t\t\tcandidate = 0;\n\t\t}\n\t\t\n\t\treturn new Object[] {orderedRowInfos, bottom, \n\t\t\t\tccitems.size() > 1 ? ccitems : Collections.EMPTY_SET, //ZSS-1191 \n\t\t\t\tnew Integer(candidate+1), //ZSS-1192\n\t\t\t\tfcitems.size() > 1 ? fcitems : Collections.EMPTY_SET, //ZSS-1191\n\t\t\t\tcolName}; //ZSS-1195\n\t}", "public boolean hasObject(SQLiteDatabase db,String TableName,\n String dbfield, String fieldValue) {\n String selectString = \"SELECT * FROM \" + TableName + \" WHERE \" + dbfield + \" =?\";\n\n // Add the String you are searching by here.\n // Put it in an array to avoid an unrecognized token error\n Cursor cursor = db.rawQuery(selectString, new String[] {fieldValue});\n\n boolean hasObject = false;\n if(cursor.moveToFirst()){\n hasObject = true;\n\n //region if you had multiple records to check for, use this region.\n\n int count = 0;\n while(cursor.moveToNext()){\n count++;\n }\n //here, count is records found\n Log.d(\"uzair\", String.format(\"%d records found\", count));\n\n //endregion\n\n }\n\n cursor.close(); // Dont forget to close your cursor\n db.close(); //AND your Database!\n return hasObject;\n }", "public static void ramFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n singleton.dtm.setColumnIdentifiers(ram);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Tipo\":\r\n //BUSCA POR TIPO\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND tipo LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Capacidad\":\r\n //BUSCA POR CAPACIDAD\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND capacidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Velocidad\":\r\n //BUSCA POR VELOCIDAD \r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND velocidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public LearningResultHasActivity[] findByDynamicWhere(String sql, Object[] sqlParams) throws LearningResultHasActivityDaoException;", "private RowFilter<Object, Object> getFilter(List<String> selectedCheckBoxes, final String regex) {\n FilterMapKey key = new FilterMapKey(selectedCheckBoxes);\n if (tableFilterMap.containsKey(key)) {\n return tableFilterMap.get(key);\n }\n\n RowFilter<Object, Object> filter = new RowFilter<Object, Object>() {\n @Override\n public boolean include(RowFilter.Entry entry) {\n String severity = (String) entry.getValue(1);\n return severity.matches(regex);\n }\n };\n tableFilterMap.put(key, filter);\n return filter;\n }", "@Override\n public List<ScalarFunctionColumn> getScalarFunctionColumns() {\n return subFilter.getScalarFunctionColumns();\n }", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "Condition equal(QueryParameter parameter, Object value);", "@Override\n\tpublic Datatable getdatatable(String sEcho, int iDisplayLength,\n\t\t\tint iDisplayStart, int iSortCol_0, String sSortDir_0, String sSearch, String filter) {\n\t\tDatatableExtractParams parameter = new DatatableExtractParams(sSearch, this.column, this.searchable, iSortCol_0, sSortDir_0);\n\t\tDatatable thnAjaranDatatable= new Datatable();\n\t\tthnAjaranDatatable.setsEcho(sEcho);\n\t\tString dbFilter = \"\";\n\t\tif(filter != null && !filter.equals(\"\")) dbFilter+=\" AND \"+filter; \n\t\tList<StsKehadiran> queryResult = get(\"(\"+parameter.getWhere()+\")\"+dbFilter, parameter.getOrder(), iDisplayLength, iDisplayStart);\n\t\tList<String[]> aData = new ArrayList<String[]>();\n\t\tfor (StsKehadiran stsKehadiran : queryResult) {\n\t\t\tString[] stsKehadiranString = new String[7];\n\t\t\tstsKehadiranString[0] = stsKehadiran.getIdStsKehadiran().toString();\n\t\t\tstsKehadiranString[1] = String.valueOf(stsKehadiran.getKodeStsKehadiran());\n\t\t\tstsKehadiranString[2] = String.valueOf(stsKehadiran.getNmStsKehadiran());\n\t\t\tstsKehadiranString[3] = String.valueOf(stsKehadiran.isaKehadiranAwal());\n\t\t\tstsKehadiranString[4] = String.valueOf(stsKehadiran.getaAbsen());\n\t\t\tstsKehadiranString[5] = String.valueOf(stsKehadiran.isaKehadiranTerhapus());\n\t\t\tstsKehadiranString[6] = String.valueOf(stsKehadiran.isaKehadiranTerhapus());\n\t\t\taData.add(stsKehadiranString);\n\t\t}\n\t\tthnAjaranDatatable.setAaData(aData);\n\t\tthnAjaranDatatable.setiTotalRecords(stsKehadiranRepository.count(filter));\n\t\tthnAjaranDatatable.setiTotalDisplayRecords(stsKehadiranRepository.count(\"(\"+parameter.getWhere()+\")\"+dbFilter));\n\n\t\treturn thnAjaranDatatable;\n\t}", "@FXML\r\n private void search(){\n \r\n String s = tfSearch.getText().trim(); \r\n String type = cmbType.getSelectionModel().getSelectedItem();\r\n String col = cmbFilterBy.getSelectionModel().getSelectedItem();\r\n \r\n /**\r\n * Column Filters\r\n * \r\n */\r\n \r\n \r\n if(!s.isEmpty()){\r\n if(!chbtoggleInActiveTraining.isSelected()){\r\n db.populateTable(trainingFields+ \" WHERE title LIKE '%\"+s+\"%' AND status<>'active'\", tblTrainingList);\r\n }\r\n\r\n if(chbtoggleInActiveTraining.isSelected()){\r\n db.populateTable(trainingFields+ \" WHERE title LIKE '%\"+s+\"%'\", tblTrainingList);\r\n } \r\n } \r\n }", "public RawGetRecordsByColumnResponse getRecordsByColumnRaw(GetRecordsByColumnRequest request) throws GPUdbException {\n RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse();\n submitRequest(\"/get/records/bycolumn\", request, actualResponse_, false);\n return actualResponse_;\n }", "private FechaCierreXModulo queryData() {\n\t\ttry {\n\n\t\t\tSystem.out.println(\"Los filtros son \"\n\t\t\t\t\t+ this.filterBI.getBean().toString());\n\n\t\t\t// Notification.show(\"Los filtros son \"\n\t\t\t// + this.filterBI.getBean().toString());\n\n\t\t\tFechaCierreXModulo item = mockData(this.filterBI.getBean());\n\n\t\t\treturn item;\n\n\t\t} catch (Exception e) {\n\t\t\tLogAndNotification.print(e);\n\t\t}\n\n\t\treturn new FechaCierreXModulo();\n\t}", "public void ProductsSearch(DefaultTableModel tableModel, String parameter){\n connect();\n ResultSet result = null;\n tableModel.setRowCount(0);\n tableModel.setColumnCount(0);\n String sql = \"SELECT id_producto as Id, descripcion, presentacion, cantidad, precio, subtotal, proveedor FROM \"+\n \"productos WHERE descripcion LIKE ? ORDER BY descripcion\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setString(1, \"%\" + parameter + \"%\");\n result = ps.executeQuery();\n if(result != null){\n int columnNumber = result.getMetaData().getColumnCount();\n for(int i = 1; i < columnNumber; i++){\n tableModel.addColumn(result.getMetaData().getColumnName(i));\n }\n while(result.next()){\n Object []obj = new Object[columnNumber];\n for(int i = 1; i < columnNumber; i++){\n obj[i-1] = result.getObject(i);\n }\n tableModel.addRow(obj);\n }\n }\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n } \n }", "DbQuery setEqualsFilter(long value) {\n return setEqualsFilter((double) value);\n }", "long countByExample(Table2Example example);", "boolean isFilterByExpression();", "public FilterCriterion(String columnName, Object value, Object value2, FilterType type)\n {\n this.columnName = columnName;\n this.value = value;\n this.type = type;\n this.value2 = value2;\n }", "public static void hddFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(hdd);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Capacidad\":\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND capacidad LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"RPM\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND rpm LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Tipo\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND tipo LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }" ]
[ "0.53444487", "0.507589", "0.49339274", "0.482827", "0.48089364", "0.47969416", "0.47643846", "0.4755715", "0.47195786", "0.47162145", "0.47077373", "0.46518746", "0.46167734", "0.46071583", "0.45804745", "0.45793882", "0.4515424", "0.45108905", "0.4504017", "0.45030499", "0.44900206", "0.44607586", "0.44487643", "0.4443003", "0.44303027", "0.44038385", "0.4383608", "0.4377561", "0.43725112", "0.43634668", "0.4360734", "0.43537384", "0.43346825", "0.43309185", "0.432249", "0.43200836", "0.43103936", "0.43050852", "0.42958018", "0.42947638", "0.4286969", "0.42792976", "0.4274986", "0.4253677", "0.42415237", "0.42397493", "0.42381966", "0.42306045", "0.42241842", "0.42210916", "0.42155978", "0.4195909", "0.41864744", "0.41860658", "0.41858017", "0.41844636", "0.41705492", "0.41653267", "0.41562936", "0.41509455", "0.41377717", "0.41321346", "0.4130884", "0.41211295", "0.41204342", "0.411849", "0.411511", "0.4111057", "0.4108849", "0.41068906", "0.41024938", "0.4101796", "0.41008586", "0.41008368", "0.40971804", "0.40883216", "0.40824884", "0.40743774", "0.4073998", "0.40634015", "0.40623903", "0.40595657", "0.40543953", "0.40519604", "0.40509996", "0.40428934", "0.4039932", "0.40315002", "0.40219253", "0.40179208", "0.40165785", "0.4011586", "0.40100387", "0.40066257", "0.4000859", "0.40001732", "0.39942583", "0.39906767", "0.39804018", "0.39787087" ]
0.54151654
0
For a given table, retrieves the values of the given columns within a given range. It returns maps of column name to the vector of values for each supported data type (double, float, long, int and string). This operation supports pagination feature, i.e. values that are retrieved are those associated with the indices between the start (offset) and end value (offset + limit) parameters (inclusive). If there are num_points values in the table then each of the indices between 0 and num_points1 retrieves a unique value. Note that when using the pagination feature, if the table (or the underlying table in case of a view) is updated (records are inserted, deleted or modified) the records or values retrieved may differ between calls (discontiguous or overlap) based on the type of the update. The response is returned as a dynamic schema. For details see: dynamic schemas documentation.
public RawGetRecordsByColumnResponse getRecordsByColumnRaw(GetRecordsByColumnRequest request) throws GPUdbException { RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse(); submitRequest("/get/records/bycolumn", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Get<K, C> withColumnRange(C startColumn, C endColumn, int limit);", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit);", "Get<K, C> withColumnRange(C startColumn, C endColumn);", "List<List<Object>> getTableValues(TableParameters tableParameters);", "public abstract Map<String, Integer> getColumnTypes(String tableName);", "private void fetchColumnValues(int[] docIdSet, int startIndex, int length) {\n Set<String> columnsLoaded = new HashSet();\n\n for (AggregationFunctionContext aggrFuncContext : _aggrFuncContextList) {\n String[] aggrColumns = aggrFuncContext.getAggregationColumns();\n\n for (int i = 0; i < aggrColumns.length; i++) {\n String aggrColumn = aggrColumns[i];\n\n if (!columnsLoaded.contains(aggrColumn)) {\n int[] dictIdArray = _columnToDictArrayMap.get(aggrColumn);\n BlockValSet blockValSet = aggrFuncContext.getBlockValSet(i);\n\n blockValSet.readIntValues(docIdSet, startIndex, length, dictIdArray, startIndex);\n columnsLoaded.add(aggrColumn);\n\n Dictionary dictionary = aggrFuncContext.getDictionary(i);\n double[] valueArray = _columnToValueArrayMap.get(aggrColumn);\n dictionary.readDoubleValues(dictIdArray, startIndex, length, valueArray, startIndex);\n }\n }\n }\n }", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit,\n Filter<K, C>... filters);", "public List<?> getMap(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "List<List<Object>> getTableValues();", "List<Map<String, Object>> getTableValuesWithHeaders();", "protected abstract Map<String, String> getColumnValueTypeOverrides();", "Map<String, ByteBuffer> getColumns(String columnFamily, String key, int limit, boolean reversed, String fromColumn, String toColumn);", "List<Column> getQueryColumns();", "List<Map<String, Object>> getTableValuesWithHeaders(TableParameters tableParameters);", "public List<Column> getColumns();", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues, int limit,\n long offset) {\n return queryFeaturesForChunk(columns, boundingBox, fieldValues,\n getPkColumnName(), limit, offset);\n }", "FromValuesColumns createFromValuesColumns();", "@GET\n @Timed\n @ApiStability.Experimental\n // CSOFF: ParameterNumberCheck - There are a bunch of query param options\n public Response getRows(@PathParam(INSTANCE_PARAMETER) String instance,\n @PathParam(TABLE_PARAMETER) String table,\n @QueryParam(\"eid\") String jsonEntityId,\n @QueryParam(\"eids\") String jsonEntityIds,\n @QueryParam(\"start_eid\") String startEidString,\n @QueryParam(\"end_eid\") String endEidString,\n @QueryParam(\"limit\") @DefaultValue(\"100\") int limit,\n @QueryParam(\"cols\") @DefaultValue(ALL_COLS) String columns,\n @QueryParam(\"versions\") @DefaultValue(\"1\") String maxVersionsString,\n @QueryParam(\"timerange\") String timeRange,\n @Context UriInfo uriInfo) {\n // CSON: ParameterNumberCheck - There are a bunch of query param options\n long[] timeRanges = null;\n KijiTable kijiTable = mKijiClient.getKijiTable(instance, table);\n KijiTableLayout layout = kijiTable.getLayout();\n Iterable<KijiRowData> scanner = null;\n int maxVersions;\n KijiDataRequestBuilder dataBuilder = KijiDataRequest.builder();\n if (timeRange != null) {\n timeRanges = getTimestamps(timeRange);\n }\n try {\n if (UNLIMITED_VERSIONS.equalsIgnoreCase(maxVersionsString)) {\n maxVersions = HConstants.ALL_VERSIONS;\n } else {\n maxVersions = Integer.parseInt(maxVersionsString);\n }\n } catch (NumberFormatException nfe) {\n throw new WebApplicationException(nfe, Status.BAD_REQUEST);\n }\n if (timeRange != null) {\n dataBuilder.withTimeRange(timeRanges[0], timeRanges[1]);\n }\n ColumnsDef colsRequested = dataBuilder.newColumnsDef().withMaxVersions(maxVersions);\n List<KijiColumnName> requestedColumns = addColumnDefs(layout, colsRequested,\n columns);\n\n /* Check that the row retrieval method is valid, only one of the following may be true:\n * @eid has a value for single gets,\n * @eids has a value for bulk gets,\n * @start_eid or @end_eid has a value for scanned gets.\n */\n if (countTrue(jsonEntityId != null, (startEidString != null || endEidString != null),\n jsonEntityIds != null) > 1) {\n throw new WebApplicationException(new IllegalArgumentException(\"Ambiguous request. \"\n + \"Specified more than one entity Id search method.\"), Status.BAD_REQUEST);\n }\n\n KijiTableReader reader = null;\n try {\n if (jsonEntityId != null) {\n final KijiRestEntityId kijiRestEntityId =\n KijiRestEntityId.createFromUrl(jsonEntityId, layout);\n if (kijiRestEntityId.isWildcarded()) {\n // Wildcards were found, continue with FormattedEntityIdRowFilter.\n final KijiRowFilter entityIdRowFilter =\n new FormattedEntityIdRowFilter(\n (RowKeyFormat2) layout.getDesc().getKeysFormat(),\n kijiRestEntityId.getComponents());\n reader = kijiTable.openTableReader();\n final KijiScannerOptions scanOptions = new KijiScannerOptions();\n scanOptions.setKijiRowFilter(entityIdRowFilter);\n scanner = reader.getScanner(dataBuilder.build(), scanOptions);\n } else {\n // No wildcards found, but potentially valid entity id.\n // Continue scanning point row.\n final EntityId eid = kijiRestEntityId.resolve(layout);\n final KijiDataRequest request = dataBuilder.build();\n scanner = ImmutableList.of(RowResourceUtil.getKijiRowData(kijiTable, eid, request));\n }\n } else if (jsonEntityIds != null) {\n // If there are wildcards in the json array, creating and entity id list will\n // throw and exception.\n final List<KijiRestEntityId> kijiRestEntityIds =\n KijiRestEntityId.createListFromUrl(jsonEntityIds, layout);\n reader = kijiTable.openTableReader();\n scanner = reader.bulkGet(\n getEntityIdsFromKijiRestEntityIds(kijiRestEntityIds, layout),\n dataBuilder.build());\n } else {\n // Single eid not provided. Continue with a range scan.\n final KijiScannerOptions scanOptions = new KijiScannerOptions();\n if (startEidString != null) {\n final EntityId eid =\n KijiRestEntityId.createFromUrl(startEidString, null).resolve(layout);\n scanOptions.setStartRow(eid);\n }\n if (endEidString != null) {\n final EntityId eid =\n KijiRestEntityId.createFromUrl(endEidString, null).resolve(layout);\n scanOptions.setStopRow(eid);\n }\n reader = kijiTable.openTableReader();\n scanner = reader.getScanner(dataBuilder.build(), scanOptions);\n }\n } catch (KijiIOException kioe) {\n mKijiClient.invalidateTable(instance, table);\n throw new WebApplicationException(kioe, Status.BAD_REQUEST);\n } catch (JsonProcessingException jpe) {\n throw new WebApplicationException(jpe, Status.BAD_REQUEST);\n } catch (Exception e) {\n throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);\n } finally {\n // If reader was used, close it.\n if (null != reader) {\n ResourceUtils.closeOrLog(reader);\n }\n }\n KijiSchemaTable schemaTable = mKijiClient.getKijiSchemaTable(instance);\n return Response.ok(new RowStreamer(scanner, kijiTable, limit, requestedColumns,\n schemaTable)).build();\n }", "public Cursor getCursorWithRows() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length())\n .addLengths(\"val123\".length()).setValues(ByteString\n .copyFromUtf8(\"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS TEAMHELLO\"\n +\n \" TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123val123\"))).build());\n return cursor;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n int limit, long offset) {\n return queryFeaturesForChunk(columns, envelope, fieldValues,\n getPkColumnName(), limit, offset);\n }", "public Map<String, ColumnMetaData> getColumns();", "public static Map<String, Double> calculateFinalValues(JTable table) throws InvalidRangeException {\n\n\t\tint dataSize = table.getRowCount();\n\t\tLinkedHashMap<String, List<Integer>> nmap = new LinkedHashMap<String, List<Integer>>();\n\n\t\tfor (int i = 0; i < dataSize; i++) {\n\n\t\t\tString memName = (String) table.getValueAt(i, 0);\n\t\t\tList<Integer> tlist = new ArrayList<Integer>();\n\t\t\tfor (int j = 1; j <= 3; j++) {\n\n\t\t\t\ttlist.add(Integer.parseInt((String) table.getValueAt(i, j)));\n\t\t\t}\n\t\t\tnmap.put(memName, tlist);\n\n\t\t}\n\n\t\treturn new TScreen().normalize(nmap);\n\n\t}", "public Table<Integer, Integer, String> getData();", "public GetRecordsByColumnResponse getRecordsByColumn(GetRecordsByColumnRequest request) throws GPUdbException {\n if ( !request.getEncoding().equals( \"binary\" ))\n throw new GPUdbException( \"This method only supports binary encoding.\" );\n\n RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse();\n submitRequest(\"/get/records/bycolumn\", request, actualResponse_, false);\n GetRecordsByColumnResponse response_ = new GetRecordsByColumnResponse();\n response_.setTableName(actualResponse_.getTableName());\n response_.setData( DynamicTableRecord.transpose( actualResponse_.getResponseSchemaStr(), actualResponse_.getBinaryEncodedResponse() ) );\n response_.setTotalNumberOfRecords(actualResponse_.getTotalNumberOfRecords());\n response_.setHasMoreRecords(actualResponse_.getHasMoreRecords());\n return response_;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n int limit) {\n return queryFeaturesForChunk(columns, envelope, fieldValues,\n getPkColumnName(), limit);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues,\n int limit) {\n return queryFeaturesForChunk(columns, boundingBox, fieldValues,\n getPkColumnName(), limit);\n }", "long findValues(List<Object> values, List<Column> columns);", "public abstract ResultSet readTable(String tableName, String [] columns)\n throws SQLException;", "public double[] getRange();", "public ArrayList<Column> getColumns(String schema, String table) {\r\n try {\r\n Statement stmt = conexion.createStatement();\r\n String sql;\r\n sql = \"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '\" + schema + \"' AND TABLE_NAME = '\" + table + \"'\";\r\n ResultSet rs = stmt.executeQuery(sql);\r\n ArrayList<Column> columns = new ArrayList();\r\n while (rs.next()) {\r\n Column_Base column = new Column_Base();\r\n column.setTitle(rs.getString(4));\r\n column.setStorageFormat(rs.getString(8));\r\n column.setDecimalPositions(\".\");//default standard mysql\r\n column.setRecordNumber(getRecordNumberColumnBD(schema, table, column.getTitle()));\r\n columns.add(column);\r\n }\r\n return columns;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(DAOBaseDatos.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n\r\n }", "public Object[][] retrieveDataBasedOnViewSeq(ArrayList<String> columns) {\n Object cellData;\r\n Object[][] data = new Object[this.viewSequence.size()][columns.size()];\r\n int j;\r\n int columnType;\r\n\r\n for (int i = 0; i < this.viewSequence.size(); i++) {\r\n j = 0;\r\n for (String column : columns) {\r\n columnType = this.getColumnType(column);\r\n\r\n if (isNumberColumn(columnType)) {\r\n cellData = this.getMeasureColumnData(column, this.viewSequence.get(i));//this.getFieldValueBigDecimal(i,column);\r\n } else {\r\n cellData = this.getDimensionColumnData(column, this.viewSequence.get(i)); //hardcoding not good assuming C is Dimension\r\n }\r\n data[i][j] = cellData;\r\n j++;\r\n }\r\n }\r\n // long endTime = System.currentTimeMillis();\r\n// \r\n return data;\r\n }", "public String[][] fill_table()\n {\n int j=0;\n String[][] data = new String[0][];\n for (Map.Entry<String,Descriptor> entry :parms.getDescriptors().entrySet()) {\n\n data[j][0]=entry.getValue().getId();\n data[j][1]= String.valueOf(entry.getValue().getType());\n data[j][2]= String.valueOf(entry.getValue().getCapacity());\n data[j][3]= String.valueOf(entry.getValue().getState());\n data[j][4]= String.valueOf(entry.getValue().getNbRequest());\n data[j][5]= String.valueOf(entry.getValue().getRequest());\n data[j][6]= String.valueOf(entry.getValue().getRange());\n data[j][7]= String.valueOf(entry.getValue().getService());\n Point p=entry.getValue().getPosition();\n data[j][8]= String.valueOf(p.getX());\n data[j][9]= String.valueOf(p.getY());\n j++;\n }\n return data;\n }", "Vector<String> getColumns(String table) throws SQLException {\n\t\tVector<String> columns = new Vector<String>();\n\t\tDatabaseMetaData md = con.getMetaData();\n\t\tfor (ResultSet rs = md.getColumns(null, null, table, null); rs.next(); columns\n\t\t\t\t.add(rs.getString(4)))\n\t\t\t;\n\t\treturn columns;\n\t}", "@RequestMapping(value = \"columns/{srcEnv}/{srcDB}/{table}\", method = {RequestMethod.GET})\n @ResponseBody\n public RestWrapper getColumsnList(@PathVariable(\"srcEnv\") String srcEnv, @PathVariable(\"srcDB\") String srcDB, @PathVariable(\"table\") String tableName) {\n RestWrapper restWrapper = null;\n LOGGER.info(srcEnv + \"srcEnvi\");\n LOGGER.info(srcDB + \"srcDB\");\n LOGGER.info(tableName + \"tableName\");\n try {\n Class.forName(driverName);\n connection = DriverManager.getConnection(\"jdbc:hive2://\" + srcEnv + \"/\" + srcDB.toLowerCase(), \"\", \"\");\n ResultSet rs = connection.createStatement().executeQuery(\"select * from \" + srcDB + \".\" + tableName +\" limit 1\");\n ResultSetMetaData metaData = rs.getMetaData();\n Map<String, String> databases = new HashMap<String, String>();\n List<Map<String,String>> columnList=new ArrayList<>();\n\n TableColumns[] tableColumns=new TableColumns[1000];\n for(int i=1; i<=metaData.getColumnCount();i++){\n String colName = metaData.getColumnLabel(i).replaceFirst(tableName.toLowerCase()+\".\", \"\");\n String datatype = metaData.getColumnTypeName(i);\n TableColumns t=new TableColumns();\n Map<String,String> m1=new HashMap<>();\n\n t.setColumnName(colName);\n t.setDataType(datatype);\n m1.put(\"columnName\", colName);\n m1.put(\"dataType\", datatype);\n columnList.add(m1);\n\n databases.put(colName,datatype);\n tableColumns[i-1]=t;\n }\n //System.out.println(\"databases = \" + databases);\n restWrapper = new RestWrapper(columnList, RestWrapperOptions.OK);\n } catch (Exception e) {\n LOGGER.error(\"error occured \" + e);\n restWrapper = new RestWrapper(e.getMessage(), RestWrapper.ERROR);\n }\n return restWrapper;\n }", "public List<ColumnValueAnalysisResult> fetchValueAnalysisData() throws IOException, AnalysisException {\n String[] pigScript = generatePigScript();\n if(itsLogger.isDebugEnabled()){itsLogger.debug(\"ValueAnalysis script for first round is:\\n\"+Arrays.toString(pigScript));}\n\n registerPigQueries(getPigServer(),pigScript);\n List<ColumnValueAnalysisResult> results = new ArrayList<ColumnValueAnalysisResult>();\n if(null==columnValuesMap){\n columnValuesMap= new HashMap<String,ColumnValueAnalysisResult>();\n }\n\n\n Tuple itForNumber = acquireIterator(generator.getAggregatorVariableNameForNumber());\n\n for(String column:columnNames){\n ColumnValueAnalysisResult analy = fetcTheAggreagedValuesForTheColumnOf(itForNumber,column);\n columnValuesMap.put(column, analy);\n results.add(analy);\n\n }\n\n return results;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(columns, boundingBox, projection,\n fieldValues, getPkColumnName(), limit, offset);\n }", "public Map<String, Integer> getColumnTypesForQuery(String query) {\n LOG.error(\"This database does not support free-form query column types.\");\n return null;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(columns, fieldValues, getPkColumnName(),\n limit, offset);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues,\n String orderBy, int limit, long offset) {\n return queryFeaturesForChunk(false, columns, boundingBox, fieldValues,\n orderBy, limit, offset);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n String orderBy, int limit, long offset) {\n return queryFeaturesForChunk(false, columns, envelope, fieldValues,\n orderBy, limit, offset);\n }", "private static List<Object> getPartitionValues(\n ResultSet inputSet,\n List<String> columnNames)\n throws SQLException\n {\n List<Object> vals = new ArrayList<Object>();\n for (String name : columnNames) {\n vals.add(inputSet.getObject(name));\n }\n return vals;\n }", "@SneakyThrows\n public List<Map<String, String>> getTable(String tableName, int page, int pageSize) {\n try (CloseableHttpClient client = HttpClientBuilder.create()\n .setDefaultRequestConfig(getRequestConfig())\n .build()) {\n String url = KodexaPlatform.getUrl() + \"/api/stores/\" + ref.replace(\":\", \"/\") + \"/rows\";\n log.info(\"Connecting to [\" + url + \"]\");\n\n URIBuilder builder = new URIBuilder(url);\n builder.setParameter(\"page\", String.valueOf(page)).setParameter(\"pageSize\", String.valueOf(pageSize)).setParameter(\"table\", tableName);\n\n HttpGet httpGet = new HttpGet(builder.build());\n httpGet.addHeader(\"x-access-token\", KodexaPlatform.getAccessToken());\n\n HttpResponse response = client.execute(httpGet);\n\n if (response.getStatusLine().getStatusCode() != 200) {\n throw new KodexaException(\"Unable to create a session, check your access token and URL [\" + response.getStatusLine().getStatusCode() + \"]\");\n }\n\n String responseJson = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);\n Page<StoredRow> rowPage = jsonOm.readValue(responseJson, new TypeReference<Page<StoredRow>>() {\n });\n\n return rowPage.getContent().stream().map(StoredRow::getData).collect(Collectors.toList());\n\n\n } catch (IOException e) {\n throw new KodexaException(\"Unable to create a session on Kodexa\", e);\n }\n }", "public FeatureCursor queryFeatures(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues) {\n return queryFeatures(false, columns, boundingBox, fieldValues);\n }", "Iterator<ColumnPair> columnPairs();", "public ResultSet getColumns(String table)\n\t{\n\t\tDatabaseMetaData metadata = null;\n\t\tResultSet rs = null;\n\t\ttry\n\t\t{\n\t\t\tConnection conn = source.conn;\n\t\t\tmetadata = conn.getMetaData();\n\t\t\trs = metadata.getColumns(null, sourceSchema, table, \"%\");\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\tLog.error(\"Errore SQL generico: \" + e.getMessage());\n\t\t}\n\t\treturn rs;\n\t}", "protected abstract Map<String, Map<String, Object>> getData(String columnFamilyName);", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n String orderBy, int limit) {\n return queryFeaturesForChunk(false, columns, envelope, fieldValues,\n orderBy, limit);\n }", "public AggregateMinMaxResponse aggregateMinMax(String tableName, String columnName, Map<String, String> options) throws GPUdbException {\n AggregateMinMaxRequest actualRequest_ = new AggregateMinMaxRequest(tableName, columnName, options);\n AggregateMinMaxResponse actualResponse_ = new AggregateMinMaxResponse();\n submitRequest(\"/aggregate/minmax\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "java.util.List<Column>\n getColumnsList();", "public FilterByValueResponse filterByValue(String tableName, String viewName, boolean isString, double value, String valueStr, String columnName, Map<String, String> options) throws GPUdbException {\n FilterByValueRequest actualRequest_ = new FilterByValueRequest(tableName, viewName, isString, value, valueStr, columnName, options);\n FilterByValueResponse actualResponse_ = new FilterByValueResponse();\n submitRequest(\"/filter/byvalue\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "List<String> getColumns();", "Iterator<Column> baseColumns();", "IExtensionPoint getTableValue(String rowId, String columnId) {\n lock.readLock().lock();\n try {\n return extensionPointPluginMap.contains(rowId, columnId)\n ? extensionPointPluginMap.get(rowId, columnId).get()\n : null;\n } finally {\n lock.readLock().unlock();\n }\n }", "public List<Long> findByNumberRange(String tableName, Long start, Long end) {\n String numberColName = \"number\";\n if (!tableName.equals(\"blocks\")) {\n numberColName = \"block_number\";\n }\n\n String sql =\n \"SELECT %s FROM %s.%s \"\n + \"WHERE %s BETWEEN %s AND %s\";\n String query = String.format(sql, numberColName, schema, tableName, numberColName, start, end);\n // String used in lambda expressions need to be final or effectively final\n String _numberColName = numberColName;\n return jdbcTemplate.query(query, (resultSet, i) -> resultSet.getLong(_numberColName));\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues,\n String orderBy, int limit) {\n return queryFeaturesForChunk(false, columns, boundingBox, fieldValues,\n orderBy, limit);\n }", "@Override\r\n public List<Map<String, Object>> findAllRecords(String tableName, int upperLimit) throws SQLException {\r\n List<Map<String, Object>> records = new ArrayList();\r\n String sqlQuery = (upperLimit > 0) ? \"SELECT * FROM \" + tableName + \" LIMIT \" + upperLimit : \"SELECT * FROM \" + tableName;\r\n if (connection != null) {\r\n\r\n Statement sqlStatement = connection.createStatement();\r\n ResultSet rs = sqlStatement.executeQuery(sqlQuery);\r\n ResultSetMetaData rsmd = rs.getMetaData();\r\n int columnCount = rsmd.getColumnCount();\r\n while (rs.next()) {\r\n Map<String, Object> record = new HashMap();\r\n for (int i = 1; i <= columnCount; i++) {\r\n record.put(rsmd.getColumnName(i), rs.getObject(i));\r\n }\r\n records.add(record);\r\n }\r\n } else {\r\n System.out.println(\"No connection could be established\");\r\n }\r\n return records;\r\n }", "public ArrayList<int[]> queryData(String tablename, String[] schema){\n ArrayList<int[]> res = new ArrayList<int[]>();\n\n ResultSet resultSet = session.execute(\"SELECT * FROM \" + tablename);\n for (Row row : resultSet) {\n int[] data = new int[schema.length];\n int j = 0;\n for (String s : schema) {\n data[j] = Integer.parseInt(s);\n }\n res.add(data);\n }\n return res;\n }", "public Column[] getColumns() {return columns;}", "public List<IdRange> calculateRangesForType(MigrationType migrationType, long minimumId, long maximumId, long optimalNumberOfRows);", "public FeatureCursor queryFeatures(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues) {\n return featureDao.queryIn(columns, queryIdsSQL(envelope), fieldValues);\n }", "Column[] getColumns() { return columns; }", "List<ObjectTableColumn<E>> getObjectColumnMap();", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n Map<String, Object> fieldValues, int limit) {\n return queryFeaturesForChunk(columns, fieldValues, getPkColumnName(),\n limit);\n }", "private Class[] typifyCells() {\n int ncol = ((List) rows.get( 0 )).size();\n int nrow = rows.size();\n Class[] classes = new Class[ ncol ];\n \n /* For each column in the table, go through each row and see what\n * is the most restrictive datatype that all rows are compatible \n * with. */\n for ( int icol = 0; icol < ncol; icol++ ) {\n boolean maybeBoolean = true;\n boolean maybeInteger = true;\n boolean maybeFloat = false;\n boolean maybeDouble = true;\n boolean maybeLong = true;\n for ( Iterator it = rows.iterator(); it.hasNext(); ) {\n List row = (List) it.next();\n String value = (String) row.get( icol );\n if ( value == null || value.length() == 0 ) {\n continue;\n }\n boolean done = false;\n if ( ! done && maybeBoolean ) {\n if ( value.equalsIgnoreCase( \"false\" ) ||\n value.equalsIgnoreCase( \"true\" ) ||\n value.equalsIgnoreCase( \"f\" ) ||\n value.equalsIgnoreCase( \"t\" ) ) {\n done = true;\n }\n else {\n maybeBoolean = false;\n }\n }\n if ( ! done && maybeInteger ) {\n try {\n Integer.parseInt( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeInteger = false;\n }\n }\n if ( ! done && maybeFloat ) {\n try {\n Float.parseFloat( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeFloat = false;\n }\n }\n if ( ! done && maybeDouble ) {\n try {\n Double.parseDouble( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeDouble = false;\n }\n }\n if ( ! done && maybeLong ) {\n try {\n Long.parseLong( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeLong = false;\n }\n }\n }\n \n /* Set the type we will use, and an object which can convert from\n * a string to the type in question. */\n abstract class Converter {\n abstract Object convert( String value);\n }\n Converter conv;\n Class clazz;\n if ( maybeBoolean ) {\n clazz = Boolean.class;\n conv = new Converter() {\n Object convert( String value ) {\n char v1 = value.charAt( 0 );\n return ( v1 == 't' || v1 == 'T' ) ? Boolean.TRUE \n : Boolean.FALSE;\n }\n };\n }\n else if ( maybeInteger ) {\n clazz = Integer.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Integer( Integer.parseInt( value ) );\n }\n };\n }\n else if ( maybeFloat ) {\n clazz = Float.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Float( Float.parseFloat( value ) );\n }\n };\n }\n else if ( maybeDouble ) {\n clazz = Double.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Double( Double.parseDouble( value ) );\n }\n };\n }\n else if ( maybeLong ) {\n clazz = Long.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Long( Long.parseLong( value ) );\n }\n };\n }\n else {\n clazz = String.class;\n conv = new Converter() {\n Object convert( String value ) {\n return value;\n }\n };\n }\n classes[ icol ] = clazz;\n \n /* Do the conversion for each row. */\n for ( Iterator it = rows.iterator(); it.hasNext(); ) {\n List row = (List) it.next();\n String value = (String) row.get( icol );\n if ( value == null || value.length() == 0 ) {\n row.set( icol, null );\n }\n else {\n row.set( icol, conv.convert( value ) );\n }\n }\n }\n \n /* Return the types. */\n return classes;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues, int limit) {\n return queryFeaturesForChunk(columns, boundingBox, projection,\n fieldValues, getPkColumnName(), limit);\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "public Map<String, ColumnConfig> exportColumns(String fullTableName);", "Get<K, C> withColumnLimit(int limit);", "public List<String> getColumns();", "public Cursor getCursorWithRowsAsNull() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length()).addLengths(-1).setValues(\n ByteString.copyFromUtf8(\n \"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS \"\n +\n \"TEAMHELLO TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123\"))).build());\n return cursor;\n }", "public ResponseEntityJsonArrayStream[] getPointValues (String xid, Date from, Date to, String rollup, String timePeriodType, Integer timePeriods) throws ApiException {\n Object postBody = null;\n byte[] postBinaryBody = null;\n\n // verify the required parameter 'xid' is set\n if (xid == null) {\n throw new ApiException(400, \"Missing the required parameter 'xid' when calling getPointValues\");\n }\n\n // create path and map variables\n String path = API_VERSION + \"/point-values/{xid}\".replaceAll(\"\\\\{\" + \"xid\" + \"\\\\}\", apiClient.escapeString(xid.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n Map<String, String> headerParams = new HashMap<String, String>();\n Map<String, Object> formParams = new HashMap<String, Object>();\n\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"from\", from));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"to\", to));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"rollup\", rollup));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"timePeriodType\", timePeriodType));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"timePeriods\", timePeriods));\n\n final String[] accepts = { \"application/json\" };\n\n final String accept = apiClient.selectHeaderAccept(accepts);\n\n final String[] contentTypes = { };\n\n final String contentType = apiClient.selectHeaderContentType(contentTypes);\n\n String[] authNames = getAuthNames();\n\n TypeRef returnType = new TypeRef<ResponseEntityJsonArrayStream[]>() { };\n\n return apiClient.invokeAPI(path, \"GET\", queryParams, postBody, postBinaryBody, headerParams, formParams, accept, contentType, authNames, returnType);\n }", "public DefaultTableModel obtenerInmuebles(String minPrecio,String maxPrecio,String direccion,String lugarReferencia){\n\t\tDefaultTableModel tableModel=new DefaultTableModel();\n\t\tint registros=0;\n\t\tString[] columNames={\"ID\",\"DIRECCION\",\"PRECIO\",\"USUARIO\"};\n\t\ttry{\n\t\t\tPreparedStatement statement=getConnection().prepareStatement(\"select count(*) as total from inmuebles where precio between \"+minPrecio+\" and \"+maxPrecio+\" and direccion like '%\"+direccion+\"%' and lugarReferencia like '%\"+lugarReferencia+\"%' \");\n\t\t\t\n\t\t\tResultSet respuesta=statement.executeQuery();\n\t\t\trespuesta.next();\n\t\t\tregistros=respuesta.getInt(\"total\");\n\t\t\trespuesta.close();\n\t\t}catch(SQLException exception){\n\t\t\tSystem.err.println(exception.getMessage());\n\t\t}\n\t\tObject [][] data=new String[registros][5];\n\t\ttry{\n\t\t\tPreparedStatement statement=getConnection().prepareStatement(\"select id,direccion,precio,idUsuario from inmuebles where precio between \"+minPrecio+\" and \"+maxPrecio+\" and direccion like ? and lugarReferencia like ? \");\n\t\t\tstatement.setString(1, \"%\"+direccion+\"%\");\n\t\t\tstatement.setString(2, \"%\"+lugarReferencia+\"%\");\n\t\t\tResultSet respuesta=statement.executeQuery();\n\t\t\tint i=0;\n\t\t\twhile(respuesta.next()){\n\t\t\t\tdata[i][0]=respuesta.getString(\"id\");\n\t\t\t\tdata[i][1]=respuesta.getString(\"direccion\");\n\t\t\t\tdata[i][2]=respuesta.getString(\"precio\");\n\t\t\t\tdata[i][3]=respuesta.getString(\"idUsuario\");\n\t\t\t\ti++;\n\t\t\t}\n\t\t\trespuesta.close();\n\t\t\ttableModel.setDataVector(data, columNames);\n\t\t}catch(SQLException exception){\n\t\t\tSystem.err.println(exception.getMessage());\n\t\t}\n\t\treturn tableModel;\n\t}", "public Vector getColunas(String schema, String name);", "<V1> KTable<K, V1> mapValues(ValueMapper<V, V1> mapper);", "com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index);", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues, String orderBy, int limit,\n long offset) {\n return queryFeaturesForChunk(false, columns, boundingBox, projection,\n fieldValues, orderBy, limit, offset);\n }", "@Override\n public final Collection<HasCell<T, ?>> getColumns() {\n return idToCellMap.values();\n }", "Page<List<FieldValue>> list(BigQuery.TableDataListOption... options) throws BigQueryException {\n return bigquery.listTableData(info.tableId(), options);\n }", "Column getColumns(int index);", "public List<?> getList(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public List<QueryStats> getQueryStats(boolean inTest,\n LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(QueryStats.class));\n return handle.createQuery(inTest ? QueryStats.getExtractQueryinTest(rangeStart, rangeEnd)\n : QueryStats.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(QueryStats.class)\n .list();\n });\n }", "public FeatureCursor queryFeaturesForChunk(GeometryEnvelope envelope,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(envelope, fieldValues, getPkColumnName(),\n limit, offset);\n }", "public FeatureCursor queryFeaturesForChunk(boolean distinct,\n String[] columns, BoundingBox boundingBox,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(distinct, columns, boundingBox,\n fieldValues, getPkColumnName(), limit, offset);\n }", "private String createColumns() {\n String columns = LATITUDE;\n if (getLongitude() != FLOATNULL) {\n columns = columns + \",\" + LONGITUDE;\n } // if getLongitude\n if (getDepth() != FLOATNULL) {\n columns = columns + \",\" + DEPTH;\n } // if getDepth\n if (getTemperatureMin() != FLOATNULL) {\n columns = columns + \",\" + TEMPERATURE_MIN;\n } // if getTemperatureMin\n if (getTemperatureMax() != FLOATNULL) {\n columns = columns + \",\" + TEMPERATURE_MAX;\n } // if getTemperatureMax\n if (getSalinityMin() != FLOATNULL) {\n columns = columns + \",\" + SALINITY_MIN;\n } // if getSalinityMin\n if (getSalinityMax() != FLOATNULL) {\n columns = columns + \",\" + SALINITY_MAX;\n } // if getSalinityMax\n if (getOxygenMin() != FLOATNULL) {\n columns = columns + \",\" + OXYGEN_MIN;\n } // if getOxygenMin\n if (getOxygenMax() != FLOATNULL) {\n columns = columns + \",\" + OXYGEN_MAX;\n } // if getOxygenMax\n if (getNitrateMin() != FLOATNULL) {\n columns = columns + \",\" + NITRATE_MIN;\n } // if getNitrateMin\n if (getNitrateMax() != FLOATNULL) {\n columns = columns + \",\" + NITRATE_MAX;\n } // if getNitrateMax\n if (getPhosphateMin() != FLOATNULL) {\n columns = columns + \",\" + PHOSPHATE_MIN;\n } // if getPhosphateMin\n if (getPhosphateMax() != FLOATNULL) {\n columns = columns + \",\" + PHOSPHATE_MAX;\n } // if getPhosphateMax\n if (getSilicateMin() != FLOATNULL) {\n columns = columns + \",\" + SILICATE_MIN;\n } // if getSilicateMin\n if (getSilicateMax() != FLOATNULL) {\n columns = columns + \",\" + SILICATE_MAX;\n } // if getSilicateMax\n if (getChlorophyllMin() != FLOATNULL) {\n columns = columns + \",\" + CHLOROPHYLL_MIN;\n } // if getChlorophyllMin\n if (getChlorophyllMax() != FLOATNULL) {\n columns = columns + \",\" + CHLOROPHYLL_MAX;\n } // if getChlorophyllMax\n if (dbg) System.out.println (\"<br>columns = \" + columns); // debug\n return columns;\n }", "java.util.List<com.google.ads.googleads.v6.common.CpvBidSimulationPoint> \n getPointsList();", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n Map<String, Object> fieldValues, String orderBy, int limit,\n long offset) {\n return featureDao.queryInForChunk(columns, queryIdsSQL(), fieldValues,\n orderBy, limit, offset);\n }", "private static String[] getColumnValue(ServiceFieldTableRestRep table, ServiceFieldRestRep field) {\n List<String> values = Lists.newArrayList();\n Pattern pattern = Pattern.compile(table.getName() + \"\\\\[(\\\\d+)\\\\].\" + field.getName());\n for (String name : params.data.keySet()) {\n Matcher match = pattern.matcher(name);\n if (match.matches()) {\n int index = Integer.valueOf(match.group(1));\n for (int i = values.size(); i <= index; i++) {\n values.add(null);\n }\n values.set(index, params.get(name));\n }\n }\n return values.toArray(new String[values.size()]);\n }", "public static ImmutableList<ColumnMetadata> getColumnMetaFromJson(String schemaName, String tableName, String metaDir) {\n long startTime = System.currentTimeMillis();\n ImmutableList.Builder<ColumnMetadata> columnsMetadata = ImmutableList.builder();\n try {\n String jsonStr = readTableJson(schemaName, tableName, metaDir);\n JSONObject obj = new JSONObject(jsonStr);\n JSONArray cols = obj.getJSONArray(JSON_TABLEMETA_COLUMNES);\n for (int i = 0; i < cols.length(); i++) {\n JSONObject temp = new JSONObject(cols.getString(i));\n String family = temp.getString(JSON_TABLEMETA_FAMILY);\n String columnName = temp.getString(JSON_TABLEMETA_COLUMNNAME);\n String type = temp.getString(JSON_TABLEMETA_TYPE);\n columnsMetadata.add(new HBaseColumnMetadata(family, columnName, matchType(type)));\n }\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n } finally {\n logger.info(String.format(\"Read COLUMN meta info of TABLE %s.%s from json, totally used %d ms.\",\n schemaName, tableName, (System.currentTimeMillis() - startTime)));\n }\n return columnsMetadata.build();\n }", "private static void parseResultSetColumn(Field field, Object obj, ResultSet rs, String tableName, Map<String, Integer> columns) {\n String columnName = tableName + \".\" + (field.isAnnotationPresent(Column.class) ? field.getAnnotation(Column.class).value() : \"id\");\n try {\n Object value;\n if (field.isAnnotationPresent(Enum.class)) {\n value = parseEnum(field, rs, columnName, columns);\n } else if (DaoUtils.isEntity(field)) {\n value = parseResultSetToObject(field.getType(), rs);\n } else {\n Integer columnIndex = columns.get(columnName);\n if (columnIndex == null) {\n return;\n }\n value = rs.getObject(columns.get(columnName));\n }\n\n if (field.getType().equals(Long.class) && value != null) {\n value = new Long((Integer) value);\n }\n if (field.getType().equals(Double.class) && value != null) {\n value = ((int) (((float) value) * 100)) / 100.0;\n }\n if (field.getType().equals(Boolean.class) && value != null) {\n value = (int) value != 0;\n }\n field.set(obj, value);\n\n } catch (IllegalArgumentException | IllegalAccessException | SQLException | SecurityException e) {\n LOGGER.warning(e.getMessage());\n }\n }", "public static void readInRange() throws IOException, GeneralSecurityException {\n\t\tValueRange valuesInSheet = sheetService.spreadsheets().values().get(spreadSheetID, \"A1:E10\").execute();\n\t\tList<List<Object>> values = valuesInSheet.getValues();\n// System.out.println(\"number of rows: \" + values.size() + \" \\n\" + \"number of columns: \" + values.get(0).size());\n\t\tif (values == null || values.isEmpty()) {\n\t\t\tSystem.out.println(\"no data\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < values.size(); i++) {\n\t\t\t\tfor (int j = 0; j < values.get(i).size(); j++) {\n\t\t\t\t\tif (j < values.get(i).size() - 1) {\n\t\t\t\t\t\tSystem.out.printf(\"%s \\t \", values.get(i).get(j));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%s \\t \\n\", values.get(i).get(j));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public HashMap displayRangeValues(Context context, String[] args) throws Exception {\n HashMap rangeMap = new HashMap();\n try {\n String strLanguage = context.getSession().getLanguage();\n HashMap programMap = (HashMap) JPO.unpackArgs(args);\n HashMap columnMap = (HashMap) programMap.get(\"columnMap\");\n HashMap settings = (HashMap) columnMap.get(\"settings\");\n String strAdminType = (String) settings.get(\"Attribute Name\");\n StringList strRangeValues = FrameworkUtil.getRanges(context, strAdminType);\n\n StringList listChoices = new StringList();\n StringList listDispChoices = new StringList();\n\n String attrValue = \"\";\n String dispValue = \"\";\n\n for (int i = 0; i < strRangeValues.size(); i++) {\n attrValue = (String) strRangeValues.get(i);\n if (UIUtil.isNotNullAndNotEmpty(attrValue) && !attrValue.equals(\"None\")) {\n dispValue = i18nNow.getRangeI18NString(strAdminType, attrValue, strLanguage);\n listDispChoices.add(dispValue);\n listChoices.add(attrValue);\n }\n }\n\n rangeMap.put(\"field_choices\", listChoices);\n rangeMap.put(\"field_display_choices\", listDispChoices);\n } catch (Exception e) {\n logger.error(\"Error in pss.slc.ui.SLCUIUtil:displayRangeValues: \", e);\n throw e;\n }\n\n return rangeMap;\n }", "@Override\n public Object getValueAt(int row, int column) {\n if (row >= blockList.size())\n return null;\n Object value;\n Response block = blockList.get(row);\n //\n // Get the value for the requested cell\n //\n switch (column) {\n case 0: // Date\n value = new Date(block.getLong(\"timestamp\") * 1000 + Nxt.getEpoch());\n break;\n case 1: // Height\n value = block.getInt(\"height\");\n break;\n case 2: // Block identifier\n value = block.getString(\"block\");\n break;\n case 3: // Block version\n value = block.getInt(\"version\");\n break;\n case 4: // Block transaction count\n value = block.getInt(\"numberOfTransactions\");\n break;\n case 5: // Block generator\n value = block.getString(\"generatorRS\");\n break;\n default:\n throw new IndexOutOfBoundsException(\"Table column \"+column+\" is not valid\");\n }\n return value;\n }", "public ArrayList<HashMap<String, String>> retrieve(String tableName, String colName, long value) {\n //GET Qualifiing Rows from DB\n select(tableName, colName, String.valueOf(value), false);\n \n return this.processRetrieve();\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, int limit, long offset) {\n return queryFeaturesForChunk(columns, boundingBox, getPkColumnName(),\n limit, offset);\n }", "java.util.List<com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition> \n getColumnsList();", "public Object[] getColumn(int c) {\n// Object[] dta = new Object[data.rows];\n// for (int i = 0; i < data.rows; i++)\n// dta[i] = data.values[c][c];\n return data.values[c];\n }", "@Override\n public List<UserQuery> getQueries(LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(UserQuery.class));\n return handle.createQuery(UserQuery.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(UserQuery.class)\n .list();\n });\n }", "public FeatureCursor queryFeatures(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues) {\n return queryFeatures(false, columns, boundingBox, projection,\n fieldValues);\n }", "public Object getValueAt(int row, int col)\n {\n\tif (col==0) {\n\t return smartPrescaleTable.prescaleCondition(row);\n\t} else if (col==1) {\n\t if (smartPrescaleTable.simple(row)) {\n\t\treturn smartPrescaleTable.prescale(row);\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t} else {\n\t if (smartPrescaleTable.simple(row)) {\n\t\tString pathName=smartPrescaleTable.pathName(row);\n\t\tif (smartPrescaleTable.checkHLTPathExists(pathName)) {\n\t\t return smartPrescaleTable.prescale(row)\n\t\t\t*prescaleTable.prescales(pathName).get(col-2);\n\t\t} else {\n\t\t return new Long(-1);\n\t\t}\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t}\n }", "public void get_TableValues(){\r\n\tFFM=99;\r\n\tADFM=99;\r\n\tDF=0;\r\n\tFLOAD=0;\r\n\t\r\n}" ]
[ "0.5732672", "0.5635571", "0.55681163", "0.51585865", "0.51455265", "0.5038277", "0.50062627", "0.50049394", "0.4960266", "0.49522105", "0.49196285", "0.4917015", "0.48501128", "0.4845661", "0.48440766", "0.48268077", "0.4812383", "0.47903833", "0.4763964", "0.47438934", "0.4728721", "0.4678084", "0.4645481", "0.46444476", "0.4643924", "0.46433932", "0.46400476", "0.46266466", "0.46262413", "0.4622908", "0.46169963", "0.4594333", "0.45799765", "0.45770562", "0.45757067", "0.45736066", "0.45660773", "0.456392", "0.4561555", "0.45463303", "0.45450184", "0.45386654", "0.4525209", "0.45245105", "0.45128685", "0.45058575", "0.4479422", "0.44730425", "0.44677222", "0.44609126", "0.44514123", "0.4430278", "0.4427477", "0.44177142", "0.4416519", "0.44136274", "0.43994614", "0.4382636", "0.43743458", "0.43712315", "0.43661967", "0.43589222", "0.4355075", "0.43549863", "0.4352436", "0.4348563", "0.43485314", "0.4342651", "0.4340913", "0.43370196", "0.43165568", "0.43161547", "0.431563", "0.43067327", "0.43001613", "0.42985505", "0.42929158", "0.42898133", "0.42881724", "0.42870983", "0.42834195", "0.4266602", "0.42610672", "0.42578217", "0.4255234", "0.42405188", "0.42348474", "0.42315996", "0.42222297", "0.42217243", "0.42212245", "0.42206857", "0.42133114", "0.4210971", "0.4196367", "0.41926938", "0.41814494", "0.41813353", "0.4179752", "0.41717982" ]
0.4855984
12
For a given table, retrieves the values of the given columns within a given range. It returns maps of column name to the vector of values for each supported data type (double, float, long, int and string). This operation supports pagination feature, i.e. values that are retrieved are those associated with the indices between the start (offset) and end value (offset + limit) parameters (inclusive). If there are num_points values in the table then each of the indices between 0 and num_points1 retrieves a unique value. Note that when using the pagination feature, if the table (or the underlying table in case of a view) is updated (records are inserted, deleted or modified) the records or values retrieved may differ between calls (discontiguous or overlap) based on the type of the update. The response is returned as a dynamic schema. For details see: dynamic schemas documentation.
public GetRecordsByColumnResponse getRecordsByColumn(GetRecordsByColumnRequest request) throws GPUdbException { if ( !request.getEncoding().equals( "binary" )) throw new GPUdbException( "This method only supports binary encoding." ); RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse(); submitRequest("/get/records/bycolumn", request, actualResponse_, false); GetRecordsByColumnResponse response_ = new GetRecordsByColumnResponse(); response_.setTableName(actualResponse_.getTableName()); response_.setData( DynamicTableRecord.transpose( actualResponse_.getResponseSchemaStr(), actualResponse_.getBinaryEncodedResponse() ) ); response_.setTotalNumberOfRecords(actualResponse_.getTotalNumberOfRecords()); response_.setHasMoreRecords(actualResponse_.getHasMoreRecords()); return response_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Get<K, C> withColumnRange(C startColumn, C endColumn, int limit);", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit);", "Get<K, C> withColumnRange(C startColumn, C endColumn);", "List<List<Object>> getTableValues(TableParameters tableParameters);", "public abstract Map<String, Integer> getColumnTypes(String tableName);", "private void fetchColumnValues(int[] docIdSet, int startIndex, int length) {\n Set<String> columnsLoaded = new HashSet();\n\n for (AggregationFunctionContext aggrFuncContext : _aggrFuncContextList) {\n String[] aggrColumns = aggrFuncContext.getAggregationColumns();\n\n for (int i = 0; i < aggrColumns.length; i++) {\n String aggrColumn = aggrColumns[i];\n\n if (!columnsLoaded.contains(aggrColumn)) {\n int[] dictIdArray = _columnToDictArrayMap.get(aggrColumn);\n BlockValSet blockValSet = aggrFuncContext.getBlockValSet(i);\n\n blockValSet.readIntValues(docIdSet, startIndex, length, dictIdArray, startIndex);\n columnsLoaded.add(aggrColumn);\n\n Dictionary dictionary = aggrFuncContext.getDictionary(i);\n double[] valueArray = _columnToValueArrayMap.get(aggrColumn);\n dictionary.readDoubleValues(dictIdArray, startIndex, length, valueArray, startIndex);\n }\n }\n }\n }", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit,\n Filter<K, C>... filters);", "public List<?> getMap(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "List<List<Object>> getTableValues();", "List<Map<String, Object>> getTableValuesWithHeaders();", "protected abstract Map<String, String> getColumnValueTypeOverrides();", "Map<String, ByteBuffer> getColumns(String columnFamily, String key, int limit, boolean reversed, String fromColumn, String toColumn);", "public RawGetRecordsByColumnResponse getRecordsByColumnRaw(GetRecordsByColumnRequest request) throws GPUdbException {\n RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse();\n submitRequest(\"/get/records/bycolumn\", request, actualResponse_, false);\n return actualResponse_;\n }", "List<Column> getQueryColumns();", "List<Map<String, Object>> getTableValuesWithHeaders(TableParameters tableParameters);", "public List<Column> getColumns();", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues, int limit,\n long offset) {\n return queryFeaturesForChunk(columns, boundingBox, fieldValues,\n getPkColumnName(), limit, offset);\n }", "FromValuesColumns createFromValuesColumns();", "@GET\n @Timed\n @ApiStability.Experimental\n // CSOFF: ParameterNumberCheck - There are a bunch of query param options\n public Response getRows(@PathParam(INSTANCE_PARAMETER) String instance,\n @PathParam(TABLE_PARAMETER) String table,\n @QueryParam(\"eid\") String jsonEntityId,\n @QueryParam(\"eids\") String jsonEntityIds,\n @QueryParam(\"start_eid\") String startEidString,\n @QueryParam(\"end_eid\") String endEidString,\n @QueryParam(\"limit\") @DefaultValue(\"100\") int limit,\n @QueryParam(\"cols\") @DefaultValue(ALL_COLS) String columns,\n @QueryParam(\"versions\") @DefaultValue(\"1\") String maxVersionsString,\n @QueryParam(\"timerange\") String timeRange,\n @Context UriInfo uriInfo) {\n // CSON: ParameterNumberCheck - There are a bunch of query param options\n long[] timeRanges = null;\n KijiTable kijiTable = mKijiClient.getKijiTable(instance, table);\n KijiTableLayout layout = kijiTable.getLayout();\n Iterable<KijiRowData> scanner = null;\n int maxVersions;\n KijiDataRequestBuilder dataBuilder = KijiDataRequest.builder();\n if (timeRange != null) {\n timeRanges = getTimestamps(timeRange);\n }\n try {\n if (UNLIMITED_VERSIONS.equalsIgnoreCase(maxVersionsString)) {\n maxVersions = HConstants.ALL_VERSIONS;\n } else {\n maxVersions = Integer.parseInt(maxVersionsString);\n }\n } catch (NumberFormatException nfe) {\n throw new WebApplicationException(nfe, Status.BAD_REQUEST);\n }\n if (timeRange != null) {\n dataBuilder.withTimeRange(timeRanges[0], timeRanges[1]);\n }\n ColumnsDef colsRequested = dataBuilder.newColumnsDef().withMaxVersions(maxVersions);\n List<KijiColumnName> requestedColumns = addColumnDefs(layout, colsRequested,\n columns);\n\n /* Check that the row retrieval method is valid, only one of the following may be true:\n * @eid has a value for single gets,\n * @eids has a value for bulk gets,\n * @start_eid or @end_eid has a value for scanned gets.\n */\n if (countTrue(jsonEntityId != null, (startEidString != null || endEidString != null),\n jsonEntityIds != null) > 1) {\n throw new WebApplicationException(new IllegalArgumentException(\"Ambiguous request. \"\n + \"Specified more than one entity Id search method.\"), Status.BAD_REQUEST);\n }\n\n KijiTableReader reader = null;\n try {\n if (jsonEntityId != null) {\n final KijiRestEntityId kijiRestEntityId =\n KijiRestEntityId.createFromUrl(jsonEntityId, layout);\n if (kijiRestEntityId.isWildcarded()) {\n // Wildcards were found, continue with FormattedEntityIdRowFilter.\n final KijiRowFilter entityIdRowFilter =\n new FormattedEntityIdRowFilter(\n (RowKeyFormat2) layout.getDesc().getKeysFormat(),\n kijiRestEntityId.getComponents());\n reader = kijiTable.openTableReader();\n final KijiScannerOptions scanOptions = new KijiScannerOptions();\n scanOptions.setKijiRowFilter(entityIdRowFilter);\n scanner = reader.getScanner(dataBuilder.build(), scanOptions);\n } else {\n // No wildcards found, but potentially valid entity id.\n // Continue scanning point row.\n final EntityId eid = kijiRestEntityId.resolve(layout);\n final KijiDataRequest request = dataBuilder.build();\n scanner = ImmutableList.of(RowResourceUtil.getKijiRowData(kijiTable, eid, request));\n }\n } else if (jsonEntityIds != null) {\n // If there are wildcards in the json array, creating and entity id list will\n // throw and exception.\n final List<KijiRestEntityId> kijiRestEntityIds =\n KijiRestEntityId.createListFromUrl(jsonEntityIds, layout);\n reader = kijiTable.openTableReader();\n scanner = reader.bulkGet(\n getEntityIdsFromKijiRestEntityIds(kijiRestEntityIds, layout),\n dataBuilder.build());\n } else {\n // Single eid not provided. Continue with a range scan.\n final KijiScannerOptions scanOptions = new KijiScannerOptions();\n if (startEidString != null) {\n final EntityId eid =\n KijiRestEntityId.createFromUrl(startEidString, null).resolve(layout);\n scanOptions.setStartRow(eid);\n }\n if (endEidString != null) {\n final EntityId eid =\n KijiRestEntityId.createFromUrl(endEidString, null).resolve(layout);\n scanOptions.setStopRow(eid);\n }\n reader = kijiTable.openTableReader();\n scanner = reader.getScanner(dataBuilder.build(), scanOptions);\n }\n } catch (KijiIOException kioe) {\n mKijiClient.invalidateTable(instance, table);\n throw new WebApplicationException(kioe, Status.BAD_REQUEST);\n } catch (JsonProcessingException jpe) {\n throw new WebApplicationException(jpe, Status.BAD_REQUEST);\n } catch (Exception e) {\n throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);\n } finally {\n // If reader was used, close it.\n if (null != reader) {\n ResourceUtils.closeOrLog(reader);\n }\n }\n KijiSchemaTable schemaTable = mKijiClient.getKijiSchemaTable(instance);\n return Response.ok(new RowStreamer(scanner, kijiTable, limit, requestedColumns,\n schemaTable)).build();\n }", "public Cursor getCursorWithRows() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length())\n .addLengths(\"val123\".length()).setValues(ByteString\n .copyFromUtf8(\"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS TEAMHELLO\"\n +\n \" TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123val123\"))).build());\n return cursor;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n int limit, long offset) {\n return queryFeaturesForChunk(columns, envelope, fieldValues,\n getPkColumnName(), limit, offset);\n }", "public Map<String, ColumnMetaData> getColumns();", "public static Map<String, Double> calculateFinalValues(JTable table) throws InvalidRangeException {\n\n\t\tint dataSize = table.getRowCount();\n\t\tLinkedHashMap<String, List<Integer>> nmap = new LinkedHashMap<String, List<Integer>>();\n\n\t\tfor (int i = 0; i < dataSize; i++) {\n\n\t\t\tString memName = (String) table.getValueAt(i, 0);\n\t\t\tList<Integer> tlist = new ArrayList<Integer>();\n\t\t\tfor (int j = 1; j <= 3; j++) {\n\n\t\t\t\ttlist.add(Integer.parseInt((String) table.getValueAt(i, j)));\n\t\t\t}\n\t\t\tnmap.put(memName, tlist);\n\n\t\t}\n\n\t\treturn new TScreen().normalize(nmap);\n\n\t}", "public Table<Integer, Integer, String> getData();", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n int limit) {\n return queryFeaturesForChunk(columns, envelope, fieldValues,\n getPkColumnName(), limit);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues,\n int limit) {\n return queryFeaturesForChunk(columns, boundingBox, fieldValues,\n getPkColumnName(), limit);\n }", "long findValues(List<Object> values, List<Column> columns);", "public double[] getRange();", "public abstract ResultSet readTable(String tableName, String [] columns)\n throws SQLException;", "public ArrayList<Column> getColumns(String schema, String table) {\r\n try {\r\n Statement stmt = conexion.createStatement();\r\n String sql;\r\n sql = \"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '\" + schema + \"' AND TABLE_NAME = '\" + table + \"'\";\r\n ResultSet rs = stmt.executeQuery(sql);\r\n ArrayList<Column> columns = new ArrayList();\r\n while (rs.next()) {\r\n Column_Base column = new Column_Base();\r\n column.setTitle(rs.getString(4));\r\n column.setStorageFormat(rs.getString(8));\r\n column.setDecimalPositions(\".\");//default standard mysql\r\n column.setRecordNumber(getRecordNumberColumnBD(schema, table, column.getTitle()));\r\n columns.add(column);\r\n }\r\n return columns;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(DAOBaseDatos.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n\r\n }", "public Object[][] retrieveDataBasedOnViewSeq(ArrayList<String> columns) {\n Object cellData;\r\n Object[][] data = new Object[this.viewSequence.size()][columns.size()];\r\n int j;\r\n int columnType;\r\n\r\n for (int i = 0; i < this.viewSequence.size(); i++) {\r\n j = 0;\r\n for (String column : columns) {\r\n columnType = this.getColumnType(column);\r\n\r\n if (isNumberColumn(columnType)) {\r\n cellData = this.getMeasureColumnData(column, this.viewSequence.get(i));//this.getFieldValueBigDecimal(i,column);\r\n } else {\r\n cellData = this.getDimensionColumnData(column, this.viewSequence.get(i)); //hardcoding not good assuming C is Dimension\r\n }\r\n data[i][j] = cellData;\r\n j++;\r\n }\r\n }\r\n // long endTime = System.currentTimeMillis();\r\n// \r\n return data;\r\n }", "public String[][] fill_table()\n {\n int j=0;\n String[][] data = new String[0][];\n for (Map.Entry<String,Descriptor> entry :parms.getDescriptors().entrySet()) {\n\n data[j][0]=entry.getValue().getId();\n data[j][1]= String.valueOf(entry.getValue().getType());\n data[j][2]= String.valueOf(entry.getValue().getCapacity());\n data[j][3]= String.valueOf(entry.getValue().getState());\n data[j][4]= String.valueOf(entry.getValue().getNbRequest());\n data[j][5]= String.valueOf(entry.getValue().getRequest());\n data[j][6]= String.valueOf(entry.getValue().getRange());\n data[j][7]= String.valueOf(entry.getValue().getService());\n Point p=entry.getValue().getPosition();\n data[j][8]= String.valueOf(p.getX());\n data[j][9]= String.valueOf(p.getY());\n j++;\n }\n return data;\n }", "Vector<String> getColumns(String table) throws SQLException {\n\t\tVector<String> columns = new Vector<String>();\n\t\tDatabaseMetaData md = con.getMetaData();\n\t\tfor (ResultSet rs = md.getColumns(null, null, table, null); rs.next(); columns\n\t\t\t\t.add(rs.getString(4)))\n\t\t\t;\n\t\treturn columns;\n\t}", "public List<ColumnValueAnalysisResult> fetchValueAnalysisData() throws IOException, AnalysisException {\n String[] pigScript = generatePigScript();\n if(itsLogger.isDebugEnabled()){itsLogger.debug(\"ValueAnalysis script for first round is:\\n\"+Arrays.toString(pigScript));}\n\n registerPigQueries(getPigServer(),pigScript);\n List<ColumnValueAnalysisResult> results = new ArrayList<ColumnValueAnalysisResult>();\n if(null==columnValuesMap){\n columnValuesMap= new HashMap<String,ColumnValueAnalysisResult>();\n }\n\n\n Tuple itForNumber = acquireIterator(generator.getAggregatorVariableNameForNumber());\n\n for(String column:columnNames){\n ColumnValueAnalysisResult analy = fetcTheAggreagedValuesForTheColumnOf(itForNumber,column);\n columnValuesMap.put(column, analy);\n results.add(analy);\n\n }\n\n return results;\n }", "@RequestMapping(value = \"columns/{srcEnv}/{srcDB}/{table}\", method = {RequestMethod.GET})\n @ResponseBody\n public RestWrapper getColumsnList(@PathVariable(\"srcEnv\") String srcEnv, @PathVariable(\"srcDB\") String srcDB, @PathVariable(\"table\") String tableName) {\n RestWrapper restWrapper = null;\n LOGGER.info(srcEnv + \"srcEnvi\");\n LOGGER.info(srcDB + \"srcDB\");\n LOGGER.info(tableName + \"tableName\");\n try {\n Class.forName(driverName);\n connection = DriverManager.getConnection(\"jdbc:hive2://\" + srcEnv + \"/\" + srcDB.toLowerCase(), \"\", \"\");\n ResultSet rs = connection.createStatement().executeQuery(\"select * from \" + srcDB + \".\" + tableName +\" limit 1\");\n ResultSetMetaData metaData = rs.getMetaData();\n Map<String, String> databases = new HashMap<String, String>();\n List<Map<String,String>> columnList=new ArrayList<>();\n\n TableColumns[] tableColumns=new TableColumns[1000];\n for(int i=1; i<=metaData.getColumnCount();i++){\n String colName = metaData.getColumnLabel(i).replaceFirst(tableName.toLowerCase()+\".\", \"\");\n String datatype = metaData.getColumnTypeName(i);\n TableColumns t=new TableColumns();\n Map<String,String> m1=new HashMap<>();\n\n t.setColumnName(colName);\n t.setDataType(datatype);\n m1.put(\"columnName\", colName);\n m1.put(\"dataType\", datatype);\n columnList.add(m1);\n\n databases.put(colName,datatype);\n tableColumns[i-1]=t;\n }\n //System.out.println(\"databases = \" + databases);\n restWrapper = new RestWrapper(columnList, RestWrapperOptions.OK);\n } catch (Exception e) {\n LOGGER.error(\"error occured \" + e);\n restWrapper = new RestWrapper(e.getMessage(), RestWrapper.ERROR);\n }\n return restWrapper;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(columns, boundingBox, projection,\n fieldValues, getPkColumnName(), limit, offset);\n }", "public Map<String, Integer> getColumnTypesForQuery(String query) {\n LOG.error(\"This database does not support free-form query column types.\");\n return null;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(columns, fieldValues, getPkColumnName(),\n limit, offset);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues,\n String orderBy, int limit, long offset) {\n return queryFeaturesForChunk(false, columns, boundingBox, fieldValues,\n orderBy, limit, offset);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n String orderBy, int limit, long offset) {\n return queryFeaturesForChunk(false, columns, envelope, fieldValues,\n orderBy, limit, offset);\n }", "private static List<Object> getPartitionValues(\n ResultSet inputSet,\n List<String> columnNames)\n throws SQLException\n {\n List<Object> vals = new ArrayList<Object>();\n for (String name : columnNames) {\n vals.add(inputSet.getObject(name));\n }\n return vals;\n }", "@SneakyThrows\n public List<Map<String, String>> getTable(String tableName, int page, int pageSize) {\n try (CloseableHttpClient client = HttpClientBuilder.create()\n .setDefaultRequestConfig(getRequestConfig())\n .build()) {\n String url = KodexaPlatform.getUrl() + \"/api/stores/\" + ref.replace(\":\", \"/\") + \"/rows\";\n log.info(\"Connecting to [\" + url + \"]\");\n\n URIBuilder builder = new URIBuilder(url);\n builder.setParameter(\"page\", String.valueOf(page)).setParameter(\"pageSize\", String.valueOf(pageSize)).setParameter(\"table\", tableName);\n\n HttpGet httpGet = new HttpGet(builder.build());\n httpGet.addHeader(\"x-access-token\", KodexaPlatform.getAccessToken());\n\n HttpResponse response = client.execute(httpGet);\n\n if (response.getStatusLine().getStatusCode() != 200) {\n throw new KodexaException(\"Unable to create a session, check your access token and URL [\" + response.getStatusLine().getStatusCode() + \"]\");\n }\n\n String responseJson = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);\n Page<StoredRow> rowPage = jsonOm.readValue(responseJson, new TypeReference<Page<StoredRow>>() {\n });\n\n return rowPage.getContent().stream().map(StoredRow::getData).collect(Collectors.toList());\n\n\n } catch (IOException e) {\n throw new KodexaException(\"Unable to create a session on Kodexa\", e);\n }\n }", "public FeatureCursor queryFeatures(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues) {\n return queryFeatures(false, columns, boundingBox, fieldValues);\n }", "Iterator<ColumnPair> columnPairs();", "public ResultSet getColumns(String table)\n\t{\n\t\tDatabaseMetaData metadata = null;\n\t\tResultSet rs = null;\n\t\ttry\n\t\t{\n\t\t\tConnection conn = source.conn;\n\t\t\tmetadata = conn.getMetaData();\n\t\t\trs = metadata.getColumns(null, sourceSchema, table, \"%\");\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\tLog.error(\"Errore SQL generico: \" + e.getMessage());\n\t\t}\n\t\treturn rs;\n\t}", "protected abstract Map<String, Map<String, Object>> getData(String columnFamilyName);", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues,\n String orderBy, int limit) {\n return queryFeaturesForChunk(false, columns, envelope, fieldValues,\n orderBy, limit);\n }", "public AggregateMinMaxResponse aggregateMinMax(String tableName, String columnName, Map<String, String> options) throws GPUdbException {\n AggregateMinMaxRequest actualRequest_ = new AggregateMinMaxRequest(tableName, columnName, options);\n AggregateMinMaxResponse actualResponse_ = new AggregateMinMaxResponse();\n submitRequest(\"/aggregate/minmax\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "java.util.List<Column>\n getColumnsList();", "public FilterByValueResponse filterByValue(String tableName, String viewName, boolean isString, double value, String valueStr, String columnName, Map<String, String> options) throws GPUdbException {\n FilterByValueRequest actualRequest_ = new FilterByValueRequest(tableName, viewName, isString, value, valueStr, columnName, options);\n FilterByValueResponse actualResponse_ = new FilterByValueResponse();\n submitRequest(\"/filter/byvalue\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "List<String> getColumns();", "Iterator<Column> baseColumns();", "IExtensionPoint getTableValue(String rowId, String columnId) {\n lock.readLock().lock();\n try {\n return extensionPointPluginMap.contains(rowId, columnId)\n ? extensionPointPluginMap.get(rowId, columnId).get()\n : null;\n } finally {\n lock.readLock().unlock();\n }\n }", "public List<Long> findByNumberRange(String tableName, Long start, Long end) {\n String numberColName = \"number\";\n if (!tableName.equals(\"blocks\")) {\n numberColName = \"block_number\";\n }\n\n String sql =\n \"SELECT %s FROM %s.%s \"\n + \"WHERE %s BETWEEN %s AND %s\";\n String query = String.format(sql, numberColName, schema, tableName, numberColName, start, end);\n // String used in lambda expressions need to be final or effectively final\n String _numberColName = numberColName;\n return jdbcTemplate.query(query, (resultSet, i) -> resultSet.getLong(_numberColName));\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Map<String, Object> fieldValues,\n String orderBy, int limit) {\n return queryFeaturesForChunk(false, columns, boundingBox, fieldValues,\n orderBy, limit);\n }", "@Override\r\n public List<Map<String, Object>> findAllRecords(String tableName, int upperLimit) throws SQLException {\r\n List<Map<String, Object>> records = new ArrayList();\r\n String sqlQuery = (upperLimit > 0) ? \"SELECT * FROM \" + tableName + \" LIMIT \" + upperLimit : \"SELECT * FROM \" + tableName;\r\n if (connection != null) {\r\n\r\n Statement sqlStatement = connection.createStatement();\r\n ResultSet rs = sqlStatement.executeQuery(sqlQuery);\r\n ResultSetMetaData rsmd = rs.getMetaData();\r\n int columnCount = rsmd.getColumnCount();\r\n while (rs.next()) {\r\n Map<String, Object> record = new HashMap();\r\n for (int i = 1; i <= columnCount; i++) {\r\n record.put(rsmd.getColumnName(i), rs.getObject(i));\r\n }\r\n records.add(record);\r\n }\r\n } else {\r\n System.out.println(\"No connection could be established\");\r\n }\r\n return records;\r\n }", "public ArrayList<int[]> queryData(String tablename, String[] schema){\n ArrayList<int[]> res = new ArrayList<int[]>();\n\n ResultSet resultSet = session.execute(\"SELECT * FROM \" + tablename);\n for (Row row : resultSet) {\n int[] data = new int[schema.length];\n int j = 0;\n for (String s : schema) {\n data[j] = Integer.parseInt(s);\n }\n res.add(data);\n }\n return res;\n }", "public Column[] getColumns() {return columns;}", "public List<IdRange> calculateRangesForType(MigrationType migrationType, long minimumId, long maximumId, long optimalNumberOfRows);", "public FeatureCursor queryFeatures(String[] columns,\n GeometryEnvelope envelope, Map<String, Object> fieldValues) {\n return featureDao.queryIn(columns, queryIdsSQL(envelope), fieldValues);\n }", "Column[] getColumns() { return columns; }", "List<ObjectTableColumn<E>> getObjectColumnMap();", "private Class[] typifyCells() {\n int ncol = ((List) rows.get( 0 )).size();\n int nrow = rows.size();\n Class[] classes = new Class[ ncol ];\n \n /* For each column in the table, go through each row and see what\n * is the most restrictive datatype that all rows are compatible \n * with. */\n for ( int icol = 0; icol < ncol; icol++ ) {\n boolean maybeBoolean = true;\n boolean maybeInteger = true;\n boolean maybeFloat = false;\n boolean maybeDouble = true;\n boolean maybeLong = true;\n for ( Iterator it = rows.iterator(); it.hasNext(); ) {\n List row = (List) it.next();\n String value = (String) row.get( icol );\n if ( value == null || value.length() == 0 ) {\n continue;\n }\n boolean done = false;\n if ( ! done && maybeBoolean ) {\n if ( value.equalsIgnoreCase( \"false\" ) ||\n value.equalsIgnoreCase( \"true\" ) ||\n value.equalsIgnoreCase( \"f\" ) ||\n value.equalsIgnoreCase( \"t\" ) ) {\n done = true;\n }\n else {\n maybeBoolean = false;\n }\n }\n if ( ! done && maybeInteger ) {\n try {\n Integer.parseInt( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeInteger = false;\n }\n }\n if ( ! done && maybeFloat ) {\n try {\n Float.parseFloat( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeFloat = false;\n }\n }\n if ( ! done && maybeDouble ) {\n try {\n Double.parseDouble( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeDouble = false;\n }\n }\n if ( ! done && maybeLong ) {\n try {\n Long.parseLong( value );\n done = true;\n }\n catch ( NumberFormatException e ) {\n maybeLong = false;\n }\n }\n }\n \n /* Set the type we will use, and an object which can convert from\n * a string to the type in question. */\n abstract class Converter {\n abstract Object convert( String value);\n }\n Converter conv;\n Class clazz;\n if ( maybeBoolean ) {\n clazz = Boolean.class;\n conv = new Converter() {\n Object convert( String value ) {\n char v1 = value.charAt( 0 );\n return ( v1 == 't' || v1 == 'T' ) ? Boolean.TRUE \n : Boolean.FALSE;\n }\n };\n }\n else if ( maybeInteger ) {\n clazz = Integer.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Integer( Integer.parseInt( value ) );\n }\n };\n }\n else if ( maybeFloat ) {\n clazz = Float.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Float( Float.parseFloat( value ) );\n }\n };\n }\n else if ( maybeDouble ) {\n clazz = Double.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Double( Double.parseDouble( value ) );\n }\n };\n }\n else if ( maybeLong ) {\n clazz = Long.class;\n conv = new Converter() {\n Object convert( String value ) {\n return new Long( Long.parseLong( value ) );\n }\n };\n }\n else {\n clazz = String.class;\n conv = new Converter() {\n Object convert( String value ) {\n return value;\n }\n };\n }\n classes[ icol ] = clazz;\n \n /* Do the conversion for each row. */\n for ( Iterator it = rows.iterator(); it.hasNext(); ) {\n List row = (List) it.next();\n String value = (String) row.get( icol );\n if ( value == null || value.length() == 0 ) {\n row.set( icol, null );\n }\n else {\n row.set( icol, conv.convert( value ) );\n }\n }\n }\n \n /* Return the types. */\n return classes;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n Map<String, Object> fieldValues, int limit) {\n return queryFeaturesForChunk(columns, fieldValues, getPkColumnName(),\n limit);\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues, int limit) {\n return queryFeaturesForChunk(columns, boundingBox, projection,\n fieldValues, getPkColumnName(), limit);\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "public Map<String, ColumnConfig> exportColumns(String fullTableName);", "Get<K, C> withColumnLimit(int limit);", "public List<String> getColumns();", "public Cursor getCursorWithRowsAsNull() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length()).addLengths(-1).setValues(\n ByteString.copyFromUtf8(\n \"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS \"\n +\n \"TEAMHELLO TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123\"))).build());\n return cursor;\n }", "public ResponseEntityJsonArrayStream[] getPointValues (String xid, Date from, Date to, String rollup, String timePeriodType, Integer timePeriods) throws ApiException {\n Object postBody = null;\n byte[] postBinaryBody = null;\n\n // verify the required parameter 'xid' is set\n if (xid == null) {\n throw new ApiException(400, \"Missing the required parameter 'xid' when calling getPointValues\");\n }\n\n // create path and map variables\n String path = API_VERSION + \"/point-values/{xid}\".replaceAll(\"\\\\{\" + \"xid\" + \"\\\\}\", apiClient.escapeString(xid.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n Map<String, String> headerParams = new HashMap<String, String>();\n Map<String, Object> formParams = new HashMap<String, Object>();\n\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"from\", from));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"to\", to));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"rollup\", rollup));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"timePeriodType\", timePeriodType));\n queryParams.addAll(apiClient.parameterToPairs(\"\", \"timePeriods\", timePeriods));\n\n final String[] accepts = { \"application/json\" };\n\n final String accept = apiClient.selectHeaderAccept(accepts);\n\n final String[] contentTypes = { };\n\n final String contentType = apiClient.selectHeaderContentType(contentTypes);\n\n String[] authNames = getAuthNames();\n\n TypeRef returnType = new TypeRef<ResponseEntityJsonArrayStream[]>() { };\n\n return apiClient.invokeAPI(path, \"GET\", queryParams, postBody, postBinaryBody, headerParams, formParams, accept, contentType, authNames, returnType);\n }", "public DefaultTableModel obtenerInmuebles(String minPrecio,String maxPrecio,String direccion,String lugarReferencia){\n\t\tDefaultTableModel tableModel=new DefaultTableModel();\n\t\tint registros=0;\n\t\tString[] columNames={\"ID\",\"DIRECCION\",\"PRECIO\",\"USUARIO\"};\n\t\ttry{\n\t\t\tPreparedStatement statement=getConnection().prepareStatement(\"select count(*) as total from inmuebles where precio between \"+minPrecio+\" and \"+maxPrecio+\" and direccion like '%\"+direccion+\"%' and lugarReferencia like '%\"+lugarReferencia+\"%' \");\n\t\t\t\n\t\t\tResultSet respuesta=statement.executeQuery();\n\t\t\trespuesta.next();\n\t\t\tregistros=respuesta.getInt(\"total\");\n\t\t\trespuesta.close();\n\t\t}catch(SQLException exception){\n\t\t\tSystem.err.println(exception.getMessage());\n\t\t}\n\t\tObject [][] data=new String[registros][5];\n\t\ttry{\n\t\t\tPreparedStatement statement=getConnection().prepareStatement(\"select id,direccion,precio,idUsuario from inmuebles where precio between \"+minPrecio+\" and \"+maxPrecio+\" and direccion like ? and lugarReferencia like ? \");\n\t\t\tstatement.setString(1, \"%\"+direccion+\"%\");\n\t\t\tstatement.setString(2, \"%\"+lugarReferencia+\"%\");\n\t\t\tResultSet respuesta=statement.executeQuery();\n\t\t\tint i=0;\n\t\t\twhile(respuesta.next()){\n\t\t\t\tdata[i][0]=respuesta.getString(\"id\");\n\t\t\t\tdata[i][1]=respuesta.getString(\"direccion\");\n\t\t\t\tdata[i][2]=respuesta.getString(\"precio\");\n\t\t\t\tdata[i][3]=respuesta.getString(\"idUsuario\");\n\t\t\t\ti++;\n\t\t\t}\n\t\t\trespuesta.close();\n\t\t\ttableModel.setDataVector(data, columNames);\n\t\t}catch(SQLException exception){\n\t\t\tSystem.err.println(exception.getMessage());\n\t\t}\n\t\treturn tableModel;\n\t}", "public Vector getColunas(String schema, String name);", "<V1> KTable<K, V1> mapValues(ValueMapper<V, V1> mapper);", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues, String orderBy, int limit,\n long offset) {\n return queryFeaturesForChunk(false, columns, boundingBox, projection,\n fieldValues, orderBy, limit, offset);\n }", "com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index);", "@Override\n public final Collection<HasCell<T, ?>> getColumns() {\n return idToCellMap.values();\n }", "Page<List<FieldValue>> list(BigQuery.TableDataListOption... options) throws BigQueryException {\n return bigquery.listTableData(info.tableId(), options);\n }", "public List<?> getList(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "Column getColumns(int index);", "public List<QueryStats> getQueryStats(boolean inTest,\n LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(QueryStats.class));\n return handle.createQuery(inTest ? QueryStats.getExtractQueryinTest(rangeStart, rangeEnd)\n : QueryStats.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(QueryStats.class)\n .list();\n });\n }", "public FeatureCursor queryFeaturesForChunk(GeometryEnvelope envelope,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(envelope, fieldValues, getPkColumnName(),\n limit, offset);\n }", "public FeatureCursor queryFeaturesForChunk(boolean distinct,\n String[] columns, BoundingBox boundingBox,\n Map<String, Object> fieldValues, int limit, long offset) {\n return queryFeaturesForChunk(distinct, columns, boundingBox,\n fieldValues, getPkColumnName(), limit, offset);\n }", "java.util.List<com.google.ads.googleads.v6.common.CpvBidSimulationPoint> \n getPointsList();", "private String createColumns() {\n String columns = LATITUDE;\n if (getLongitude() != FLOATNULL) {\n columns = columns + \",\" + LONGITUDE;\n } // if getLongitude\n if (getDepth() != FLOATNULL) {\n columns = columns + \",\" + DEPTH;\n } // if getDepth\n if (getTemperatureMin() != FLOATNULL) {\n columns = columns + \",\" + TEMPERATURE_MIN;\n } // if getTemperatureMin\n if (getTemperatureMax() != FLOATNULL) {\n columns = columns + \",\" + TEMPERATURE_MAX;\n } // if getTemperatureMax\n if (getSalinityMin() != FLOATNULL) {\n columns = columns + \",\" + SALINITY_MIN;\n } // if getSalinityMin\n if (getSalinityMax() != FLOATNULL) {\n columns = columns + \",\" + SALINITY_MAX;\n } // if getSalinityMax\n if (getOxygenMin() != FLOATNULL) {\n columns = columns + \",\" + OXYGEN_MIN;\n } // if getOxygenMin\n if (getOxygenMax() != FLOATNULL) {\n columns = columns + \",\" + OXYGEN_MAX;\n } // if getOxygenMax\n if (getNitrateMin() != FLOATNULL) {\n columns = columns + \",\" + NITRATE_MIN;\n } // if getNitrateMin\n if (getNitrateMax() != FLOATNULL) {\n columns = columns + \",\" + NITRATE_MAX;\n } // if getNitrateMax\n if (getPhosphateMin() != FLOATNULL) {\n columns = columns + \",\" + PHOSPHATE_MIN;\n } // if getPhosphateMin\n if (getPhosphateMax() != FLOATNULL) {\n columns = columns + \",\" + PHOSPHATE_MAX;\n } // if getPhosphateMax\n if (getSilicateMin() != FLOATNULL) {\n columns = columns + \",\" + SILICATE_MIN;\n } // if getSilicateMin\n if (getSilicateMax() != FLOATNULL) {\n columns = columns + \",\" + SILICATE_MAX;\n } // if getSilicateMax\n if (getChlorophyllMin() != FLOATNULL) {\n columns = columns + \",\" + CHLOROPHYLL_MIN;\n } // if getChlorophyllMin\n if (getChlorophyllMax() != FLOATNULL) {\n columns = columns + \",\" + CHLOROPHYLL_MAX;\n } // if getChlorophyllMax\n if (dbg) System.out.println (\"<br>columns = \" + columns); // debug\n return columns;\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n Map<String, Object> fieldValues, String orderBy, int limit,\n long offset) {\n return featureDao.queryInForChunk(columns, queryIdsSQL(), fieldValues,\n orderBy, limit, offset);\n }", "private static String[] getColumnValue(ServiceFieldTableRestRep table, ServiceFieldRestRep field) {\n List<String> values = Lists.newArrayList();\n Pattern pattern = Pattern.compile(table.getName() + \"\\\\[(\\\\d+)\\\\].\" + field.getName());\n for (String name : params.data.keySet()) {\n Matcher match = pattern.matcher(name);\n if (match.matches()) {\n int index = Integer.valueOf(match.group(1));\n for (int i = values.size(); i <= index; i++) {\n values.add(null);\n }\n values.set(index, params.get(name));\n }\n }\n return values.toArray(new String[values.size()]);\n }", "public static ImmutableList<ColumnMetadata> getColumnMetaFromJson(String schemaName, String tableName, String metaDir) {\n long startTime = System.currentTimeMillis();\n ImmutableList.Builder<ColumnMetadata> columnsMetadata = ImmutableList.builder();\n try {\n String jsonStr = readTableJson(schemaName, tableName, metaDir);\n JSONObject obj = new JSONObject(jsonStr);\n JSONArray cols = obj.getJSONArray(JSON_TABLEMETA_COLUMNES);\n for (int i = 0; i < cols.length(); i++) {\n JSONObject temp = new JSONObject(cols.getString(i));\n String family = temp.getString(JSON_TABLEMETA_FAMILY);\n String columnName = temp.getString(JSON_TABLEMETA_COLUMNNAME);\n String type = temp.getString(JSON_TABLEMETA_TYPE);\n columnsMetadata.add(new HBaseColumnMetadata(family, columnName, matchType(type)));\n }\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n } finally {\n logger.info(String.format(\"Read COLUMN meta info of TABLE %s.%s from json, totally used %d ms.\",\n schemaName, tableName, (System.currentTimeMillis() - startTime)));\n }\n return columnsMetadata.build();\n }", "public static void readInRange() throws IOException, GeneralSecurityException {\n\t\tValueRange valuesInSheet = sheetService.spreadsheets().values().get(spreadSheetID, \"A1:E10\").execute();\n\t\tList<List<Object>> values = valuesInSheet.getValues();\n// System.out.println(\"number of rows: \" + values.size() + \" \\n\" + \"number of columns: \" + values.get(0).size());\n\t\tif (values == null || values.isEmpty()) {\n\t\t\tSystem.out.println(\"no data\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < values.size(); i++) {\n\t\t\t\tfor (int j = 0; j < values.get(i).size(); j++) {\n\t\t\t\t\tif (j < values.get(i).size() - 1) {\n\t\t\t\t\t\tSystem.out.printf(\"%s \\t \", values.get(i).get(j));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%s \\t \\n\", values.get(i).get(j));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public Object getValueAt(int row, int column) {\n if (row >= blockList.size())\n return null;\n Object value;\n Response block = blockList.get(row);\n //\n // Get the value for the requested cell\n //\n switch (column) {\n case 0: // Date\n value = new Date(block.getLong(\"timestamp\") * 1000 + Nxt.getEpoch());\n break;\n case 1: // Height\n value = block.getInt(\"height\");\n break;\n case 2: // Block identifier\n value = block.getString(\"block\");\n break;\n case 3: // Block version\n value = block.getInt(\"version\");\n break;\n case 4: // Block transaction count\n value = block.getInt(\"numberOfTransactions\");\n break;\n case 5: // Block generator\n value = block.getString(\"generatorRS\");\n break;\n default:\n throw new IndexOutOfBoundsException(\"Table column \"+column+\" is not valid\");\n }\n return value;\n }", "private static void parseResultSetColumn(Field field, Object obj, ResultSet rs, String tableName, Map<String, Integer> columns) {\n String columnName = tableName + \".\" + (field.isAnnotationPresent(Column.class) ? field.getAnnotation(Column.class).value() : \"id\");\n try {\n Object value;\n if (field.isAnnotationPresent(Enum.class)) {\n value = parseEnum(field, rs, columnName, columns);\n } else if (DaoUtils.isEntity(field)) {\n value = parseResultSetToObject(field.getType(), rs);\n } else {\n Integer columnIndex = columns.get(columnName);\n if (columnIndex == null) {\n return;\n }\n value = rs.getObject(columns.get(columnName));\n }\n\n if (field.getType().equals(Long.class) && value != null) {\n value = new Long((Integer) value);\n }\n if (field.getType().equals(Double.class) && value != null) {\n value = ((int) (((float) value) * 100)) / 100.0;\n }\n if (field.getType().equals(Boolean.class) && value != null) {\n value = (int) value != 0;\n }\n field.set(obj, value);\n\n } catch (IllegalArgumentException | IllegalAccessException | SQLException | SecurityException e) {\n LOGGER.warning(e.getMessage());\n }\n }", "public HashMap displayRangeValues(Context context, String[] args) throws Exception {\n HashMap rangeMap = new HashMap();\n try {\n String strLanguage = context.getSession().getLanguage();\n HashMap programMap = (HashMap) JPO.unpackArgs(args);\n HashMap columnMap = (HashMap) programMap.get(\"columnMap\");\n HashMap settings = (HashMap) columnMap.get(\"settings\");\n String strAdminType = (String) settings.get(\"Attribute Name\");\n StringList strRangeValues = FrameworkUtil.getRanges(context, strAdminType);\n\n StringList listChoices = new StringList();\n StringList listDispChoices = new StringList();\n\n String attrValue = \"\";\n String dispValue = \"\";\n\n for (int i = 0; i < strRangeValues.size(); i++) {\n attrValue = (String) strRangeValues.get(i);\n if (UIUtil.isNotNullAndNotEmpty(attrValue) && !attrValue.equals(\"None\")) {\n dispValue = i18nNow.getRangeI18NString(strAdminType, attrValue, strLanguage);\n listDispChoices.add(dispValue);\n listChoices.add(attrValue);\n }\n }\n\n rangeMap.put(\"field_choices\", listChoices);\n rangeMap.put(\"field_display_choices\", listDispChoices);\n } catch (Exception e) {\n logger.error(\"Error in pss.slc.ui.SLCUIUtil:displayRangeValues: \", e);\n throw e;\n }\n\n return rangeMap;\n }", "public ArrayList<HashMap<String, String>> retrieve(String tableName, String colName, long value) {\n //GET Qualifiing Rows from DB\n select(tableName, colName, String.valueOf(value), false);\n \n return this.processRetrieve();\n }", "public FeatureCursor queryFeaturesForChunk(String[] columns,\n BoundingBox boundingBox, int limit, long offset) {\n return queryFeaturesForChunk(columns, boundingBox, getPkColumnName(),\n limit, offset);\n }", "java.util.List<com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition> \n getColumnsList();", "public Object[] getColumn(int c) {\n// Object[] dta = new Object[data.rows];\n// for (int i = 0; i < data.rows; i++)\n// dta[i] = data.values[c][c];\n return data.values[c];\n }", "public FeatureCursor queryFeatures(String[] columns,\n BoundingBox boundingBox, Projection projection,\n Map<String, Object> fieldValues) {\n return queryFeatures(false, columns, boundingBox, projection,\n fieldValues);\n }", "@Override\n public List<UserQuery> getQueries(LocalDateTime rangeStart, LocalDateTime rangeEnd) {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(UserQuery.class));\n return handle.createQuery(UserQuery.getExtractQuery(rangeStart, rangeEnd))\n .mapTo(UserQuery.class)\n .list();\n });\n }", "public Object getValueAt(int row, int col)\n {\n\tif (col==0) {\n\t return smartPrescaleTable.prescaleCondition(row);\n\t} else if (col==1) {\n\t if (smartPrescaleTable.simple(row)) {\n\t\treturn smartPrescaleTable.prescale(row);\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t} else {\n\t if (smartPrescaleTable.simple(row)) {\n\t\tString pathName=smartPrescaleTable.pathName(row);\n\t\tif (smartPrescaleTable.checkHLTPathExists(pathName)) {\n\t\t return smartPrescaleTable.prescale(row)\n\t\t\t*prescaleTable.prescales(pathName).get(col-2);\n\t\t} else {\n\t\t return new Long(-1);\n\t\t}\n\t } else {\n\t\treturn new Long(-1);\n\t }\n\t}\n }", "public void get_TableValues(){\r\n\tFFM=99;\r\n\tADFM=99;\r\n\tDF=0;\r\n\tFLOAD=0;\r\n\t\r\n}" ]
[ "0.57324266", "0.5635166", "0.55678904", "0.5158855", "0.51423424", "0.5037109", "0.5005871", "0.50036013", "0.49601254", "0.49507293", "0.49180478", "0.49148366", "0.48560187", "0.4849195", "0.48446706", "0.4843477", "0.48264384", "0.48115784", "0.4790719", "0.4764393", "0.47431266", "0.4726267", "0.46787545", "0.4644748", "0.46433342", "0.46433157", "0.46400282", "0.46285975", "0.4626225", "0.46221486", "0.4617347", "0.4593293", "0.4580835", "0.45750603", "0.45744854", "0.45734712", "0.45641246", "0.4563244", "0.4561763", "0.45460916", "0.4544496", "0.45379785", "0.4525917", "0.45239145", "0.45125213", "0.45036146", "0.44793814", "0.44717723", "0.4467308", "0.44613504", "0.4450636", "0.4429662", "0.44261876", "0.44177154", "0.441696", "0.44122362", "0.4399075", "0.4381976", "0.43734658", "0.43712184", "0.4365414", "0.4356202", "0.43556604", "0.4354679", "0.43525442", "0.43482938", "0.4345676", "0.4341434", "0.43401533", "0.43374503", "0.4317936", "0.43158382", "0.431372", "0.43042114", "0.42990834", "0.42980382", "0.42908758", "0.42907894", "0.42876935", "0.42874992", "0.42828146", "0.42655835", "0.4260743", "0.42567718", "0.42564377", "0.42405427", "0.4235757", "0.4229906", "0.42227566", "0.42218006", "0.42205063", "0.4220435", "0.4213447", "0.4210705", "0.4195182", "0.4192889", "0.41823113", "0.41812587", "0.4179861", "0.41711617" ]
0.46437958
24
Grants a systemlevel permission to a user or role.
public GrantPermissionSystemResponse grantPermissionSystem(GrantPermissionSystemRequest request) throws GPUdbException { GrantPermissionSystemResponse actualResponse_ = new GrantPermissionSystemResponse(); submitRequest("/grant/permission/system", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "@Test(dependsOnMethods = \"testRoleAdd\", groups = \"role\", priority = 1)\n public void testRoleGrantPermission() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient\n .roleGrantPermission(rootRole, rootRolekeyRangeBegin, rootkeyRangeEnd,\n Permission.Type.READWRITE).get();\n this.authDisabledAuthClient\n .roleGrantPermission(userRole, userRolekeyRangeBegin, userRolekeyRangeEnd, Type.READWRITE)\n .get();\n }", "public GrantPermissionSystemResponse grantPermissionSystem(String name, String permission, Map<String, String> options) throws GPUdbException {\n GrantPermissionSystemRequest actualRequest_ = new GrantPermissionSystemRequest(name, permission, options);\n GrantPermissionSystemResponse actualResponse_ = new GrantPermissionSystemResponse();\n submitRequest(\"/grant/permission/system\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "protected void grantPrivileges() {\n if (!PRIVILEGES_FEATURE_ENABLED.contains(dbType)) {\n return;\n }\n\n // The case where all are to be granted on the default schemas.\n if (!(updateFhirSchema || grantFhirSchema || updateOauthSchema\n || grantOauthSchema || updateJavaBatchSchema || grantJavaBatchSchema)) {\n grantOauthSchema = true;\n grantFhirSchema = true;\n grantJavaBatchSchema = true;\n }\n\n // Build/update the tables as well as the stored procedures\n PhysicalDataModel pdm = new PhysicalDataModel();\n buildCommonModel(pdm, updateFhirSchema || grantFhirSchema, updateOauthSchema || grantOauthSchema,\n updateJavaBatchSchema || grantJavaBatchSchema);\n\n final IDatabaseAdapter adapter = getDbAdapter(dbType, connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n try {\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_USER_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_BATCH_GRANT_GROUP, grantTo);\n } catch (DataAccessException x) {\n // Something went wrong, so mark the transaction as failed\n tx.setRollbackOnly();\n throw x;\n }\n }\n }", "protected SystemRole getDefaultSystemRole(){\r\n \tif (true) return AccessDef.SystemRole.SiteAdmin;\r\n return AccessDef.SystemRole.User;\r\n }", "@Override\n\tpublic void grant(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public final void setActivity_GrantSystem(ugs.proxies.GrantSystem activity_grantsystem)\n\t{\n\t\tsetActivity_GrantSystem(getContext(), activity_grantsystem);\n\t}", "public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;", "public void grantAdministrate(User user) throws ServiceException{\n }", "boolean isSystemUser() throws RepositoryException;", "@Override\r\n\tpublic SysPrivilege addSysPrivilege(SysPrivilege sysPrivilege) {\n\t\treturn (SysPrivilege)sysPrivilegeDao.save(sysPrivilege);\r\n\t}", "public boolean systemAdminOnly()\n {\n return false;\n }", "public void grantRole(String roleName, User user) throws UserManagementException;", "public static void requireSuperAdmin() throws InsufficientPrivilegeException {\n Principal principal = PrincipalContext.getPrincipal();\n if (principal == null) {\n throw new InsufficientPrivilegeException();\n }\n List<RoleType> roles = principal.getRoles();\n assertContainRole(roles, RoleType.SUPER_ADMIN);\n }", "public synchronized void grantAdminPrivilege(UserEntity userEntity) {\n final PrivilegeEntity adminPrivilege = new PrivilegeEntity();\n adminPrivilege.setPermission(permissionDAO.findAmbariAdminPermission());\n adminPrivilege.setPrincipal(userEntity.getPrincipal());\n adminPrivilege.setResource(resourceDAO.findAmbariResource());\n if (!userEntity.getPrincipal().getPrivileges().contains(adminPrivilege)) {\n privilegeDAO.create(adminPrivilege);\n userEntity.getPrincipal().getPrivileges().add(adminPrivilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n }\n }", "public void grantPermission(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "protected void grantAdminAuthority( ApplicationContext ctx ) {\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n // Grant all roles to test user.\n TestingAuthenticationToken token = new TestingAuthenticationToken( \"administrator\", \"administrator\",\n new GrantedAuthority[] { new GrantedAuthorityImpl( \"GROUP_ADMIN\" ) } );\n\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "void grant(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n n |= rights;\n\n rightsMap.put(dbobject, n);\n }", "public void saveSysRole(SysRole sysRole);", "public final void setActivity_GrantSystem(com.mendix.systemwideinterfaces.core.IContext context, ugs.proxies.GrantSystem activity_grantsystem)\n\t{\n\t\tif (activity_grantsystem == null)\n\t\t\tgetMendixObject().setValue(context, MemberNames.Activity_GrantSystem.toString(), null);\n\t\telse\n\t\t\tgetMendixObject().setValue(context, MemberNames.Activity_GrantSystem.toString(), activity_grantsystem.getMendixObject().getId());\n\t}", "void setPermission(String perm, boolean add);", "void requestNeededPermissions(int requestCode);", "private void addApplicationsPermissionsToRegistry() throws APIManagementException {\n Registry tenantGovReg = getRegistry();\n String permissionResourcePath = CarbonConstants.UI_PERMISSION_NAME + RegistryConstants.PATH_SEPARATOR + APPLICATION_ROOT_PERMISSION;\n try {\n if (!tenantGovReg.resourceExists(permissionResourcePath)) {\n String loggedInUser = CarbonContext.getThreadLocalCarbonContext().getUsername();\n UserRealm realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm();\n // Logged in user is not authorized to create the permission.\n // Temporarily change the user to the admin for creating the permission\n PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(realm.getRealmConfiguration().getAdminUserName());\n tenantGovReg = CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.USER_GOVERNANCE);\n Collection appRootNode = tenantGovReg.newCollection();\n appRootNode.setProperty(\"name\", \"Applications\");\n tenantGovReg.put(permissionResourcePath, appRootNode);\n PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(loggedInUser);\n }\n } catch (org.wso2.carbon.user.core.UserStoreException e) {\n throw new APIManagementException(\"Error while reading user store information.\", e);\n } catch (org.wso2.carbon.registry.api.RegistryException e) {\n throw new APIManagementException(\"Error while creating new permission in registry\", e);\n }\n }", "int getPermissionWrite();", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "boolean setSiteRights(SiteAdminRights r, boolean b);", "private void requestPermission() {\n boolean shouldProvideRationale = ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (shouldProvideRationale) {\n Log.i(TAG, \"requestPermission: \" + \"Displaying the permission rationale\");\n // provide a way so that user can grant permission\n\n showSnackbar(R.string.warning_txt, android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startLocationPermissionRequest();\n }\n });\n\n } else {\n startLocationPermissionRequest();\n }\n }", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "private void requestPermissions(){\n Intent intent = new Intent(this.getApplication(), MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n startActivity(intent);\r\n }", "@PreAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"((hasRole('EMPLOYEE') OR isAnonymous()) AND \"\r\n \t\t\t+ \"(#userDTO.type.typeLabel == 'CUSTOMERLEGAL' OR #userDTO.type.typeLabel == 'CUSTOMERINDIVIDUAL'))\")\r\n \tpublic SystemUserDTO create(SystemUserDTO userDTO);", "void permissionGranted(int requestCode);", "private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_ACCESS_FINE_LOCATION);\n\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_ACCESS_COARSE_LOCATION);\n } else {\n isPermission = true;\n }\n }", "public void addPermission(T object, Permission permission, User user);", "private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\r\n PERMISSIONS_ACCESS_FINE_LOCATION);\r\n\r\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED){\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\r\n PERMISSIONS_ACCESS_COARSE_LOCATION);\r\n } else {\r\n isPermission = true;\r\n }\r\n }", "public void grantOper2Role(final Role role, final String operId);", "private static void setPermission(Path path) throws JulongChainException {\n if(System.getProperty(SYSTEM_PROP_OS).contains(SYSTEM_PROP_VALUE_WINDOWS)) {\n return;\n }\n\n Set<PosixFilePermission> filePermissions = new HashSet<>();\n filePermissions.add(PosixFilePermission.OWNER_READ);\n filePermissions.add(PosixFilePermission.OWNER_WRITE);\n filePermissions.add(PosixFilePermission.OWNER_EXECUTE);\n filePermissions.add(PosixFilePermission.GROUP_READ);\n filePermissions.add(PosixFilePermission.GROUP_EXECUTE);\n filePermissions.add(PosixFilePermission.OTHERS_READ);\n filePermissions.add(PosixFilePermission.OTHERS_EXECUTE);\n try {\n Files.setPosixFilePermissions(path, filePermissions);\n } catch (IOException e) {\n throw new JulongChainException(\"set directory\" + path + \" permission failed \" + e.getMessage());\n }\n }", "public abstract boolean addRunAs(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "@Override\n\tpublic void grantGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "private void checkRunTimePermission() {\n\n if(checkPermission()){\n\n Toast.makeText(MainActivity.this, \"All Permissions Granted Successfully\", Toast.LENGTH_LONG).show();\n\n }\n else {\n\n requestPermission();\n }\n }", "private void dynamicPermission() {\n if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {\n Log.i(\"MainActivity\", \"android sdk <= 28 Q\");\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n String[] strings =\n {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n ActivityCompat.requestPermissions(this, strings, 1);\n }\n } else {\n // Dynamically apply for required permissions if the API level is greater than 28. The android.permission.ACCESS_BACKGROUND_LOCATION permission is required.\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\") != PackageManager.PERMISSION_GRANTED) {\n String[] strings = {android.Manifest.permission.ACCESS_FINE_LOCATION,\n android.Manifest.permission.ACCESS_COARSE_LOCATION,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\"};\n ActivityCompat.requestPermissions(this, strings, 2);\n }\n }\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n public void requestPermission() {\n //shouldShowRequestPermissionRationale es verdadero solamente si ya se había mostrado\n //anteriormente el dialogo de permisos y el usuario lo negó\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.SEND_SMS)) {\n } else {\n //si es la primera vez se solicita el permiso directamente\n requestPermissions(new String[]{Manifest.permission.SEND_SMS},\n MY_WRITE_EXTERNAL_STORAGE);\n }\n }", "void setPremiumSmsPermission(String packageName, int permission);", "private void requestPermission() {\r\n\r\n if (ActivityCompat.shouldShowRequestPermissionRationale(UniformDrawer.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\r\n Toast.makeText(UniformDrawer.this, \"Write External Storage permission allows us to do store images. Please allow this permission in App Settings.\", Toast.LENGTH_LONG).show();\r\n } else {\r\n ActivityCompat.requestPermissions(UniformDrawer.this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);\r\n }\r\n }", "private void requestPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{\n Manifest.permission.CAMERA}, 1);\n //if not permitted by the user ,send a message to the user to get the right\n } else {\n opencamera();\n //if permitted by the user already ,then start open the camera directly\n }\n }", "@Override\n public void grantPrivileges(String sessID, String name, UserLevel level) throws SQLException, SessionExpiredException {\n PooledConnection conn = ConnectionController.connectPooled(sessID);\n try {\n String dbName = ConnectionController.getDBName(sessID);\n LOG.info(\"Granting \" + level + \" privileges to \" + name + \" on \" + dbName + \"...\");\n switch (level) {\n case ADMIN:\n conn.executePreparedUpdate(\"GRANT ALTER, RELOAD, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, CREATE USER, DELETE, DROP, FILE, GRANT OPTION, INSERT, SELECT, UPDATE ON *.* TO ?\", name);\n conn.executePreparedUpdate(String.format(\"GRANT GRANT OPTION ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT ALTER, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, DELETE, DROP, INSERT, SELECT, UPDATE ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.db TO ?\", name);\n break;\n case USER:\n conn.executePreparedUpdate(String.format(\"GRANT CREATE TEMPORARY TABLES, SELECT ON %s.* TO ?\", dbName), name);\n\n //grant read/write/delete on region sets.\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set_membership TO ?\", dbName), name);\n\n //Grant read/write/delete on cohorts.\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort_membership TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n break;\n case GUEST:\n conn.executePreparedUpdate(String.format(\"GRANT SELECT ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.server_log TO ?\", dbName), name);\n // Grant permissions to write comments\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.variant_starred TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n\n break;\n }\n\n SettingsManager.getInstance().addSetting(sessID, DATABASE_USER_KEY_PREFIX + name, level.name());\n LOG.info(\"... granted.\");\n } catch (Exception ex) {\n LOG.error(\"Problem creating user\", ex);\n throw new SQLException(\"Can't setup privileges for user \" + name, ex);\n } finally {\n conn.executeQuery(\"FLUSH PRIVILEGES\");\n conn.close();\n }\n }", "public void grantPermissionPending(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "@Override\n public boolean hasPermission(Permission permission) {\n // FacesContext context = FacesContext.getCurrentInstance();\n String imp = (String)ADFContext.getCurrent().getSessionScope().get(\"isImpersonationOn\");\n// String imp = (String)context.getExternalContext().getSessionMap().get(\"isImpersonationOn\");\n if(imp == null || !imp.equals(\"Y\")){\n return super.hasPermission(permission);\n }\n else{\n return true;\n \n }\n \n }", "@Override\n public void onClick(View view) {\n String platform = checkPlatform();\n if (platform.equals(\"Marshmallow\")) {\n Log.d(TAG, \"Runtime permission required\");\n //Step 2. check the permission\n boolean permissionStatus = checkPermission();\n if (permissionStatus) {\n //Permission already granted\n Log.d(TAG, \"Permission already granted\");\n } else {\n //Permission not granted\n //Step 3. Explain permission i.e show an explanation\n Log.d(TAG, \"Explain permission\");\n explainPermission();\n //Step 4. Request Permissions\n Log.d(TAG, \"Request Permission\");\n requestPermission();\n }\n\n } else {\n Log.d(TAG, \"onClick: Runtime permission not required\");\n }\n\n\n }", "public synchronized void grantAdminPrivilege(Integer userId) {\n grantAdminPrivilege(userDAO.findByPK(userId));\n }", "private void requestPermission(){\r\n ActivityCompat.requestPermissions(activity,new String[]{Manifest.permission.ACCESS_FINE_LOCATION},1);\r\n }", "private void requirePermission(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;\n if (ActivityCompat.checkSelfPermission(MainActivity2.this, permission)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MainActivity2.this, new String[]{permission},123);\n }\n }\n }", "@Override\r\n\tpublic void updateSysPrivilege(SysPrivilege sysPrivilege) {\n\t\tsysPrivilegeDao.saveOrUpdate(sysPrivilege);\r\n\t}", "private void requestReadAndSendSmsPermission()\n {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.READ_SMS))\n {\n\n }\n ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.READ_SMS,\n android.Manifest.permission.SEND_SMS,\n android.Manifest.permission.RECEIVE_SMS,\n Manifest.permission.READ_PHONE_STATE}, 1);\n }", "public static void addGuestMemberPermission(String permission)\r\n throws CreateException, DatabaseException, ForeignKeyNotFoundException {\r\n \r\n MemberXML.addGuestMemberPermission(permission);\r\n }", "int setCanStatus(int canRegno, int action);", "private void askPermission() {\n if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n Parameters.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_PERMISSION_SETTING) {\n checkPermission();\n }\n }", "void askForPermissions();", "public static void checkAccess() throws SecurityException {\n if(isSystemThread.get()) {\n return;\n }\n //TODO: Add Admin Checking Code\n// if(getCurrentUser() != null && getCurrentUser().isAdmin()) {\n// return;\n// }\n throw new SecurityException(\"Invalid Permissions\");\n }", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "public void permission_check() {\n //Usage Permission\n if (!isAccessGranted()) {\n new LovelyStandardDialog(MainActivity.this)\n .setTopColorRes(R.color.colorPrimaryDark)\n .setIcon(R.drawable.ic_perm_device_information_white_48dp)\n .setTitle(getString(R.string.permission_check_title))\n .setMessage(getString(R.string.permission_check_message))\n .setPositiveButton(android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);\n startActivity(intent);\n }\n })\n .setNegativeButton(android.R.string.no, null)\n .show();\n }\n }", "public void doPermissions(RunData data, Context context)\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\t// should we save here?\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, new TreeSet());\n\n\t\t// get the current home collection id and the related site\n\t\tString collectionId = (String) state.getAttribute (STATE_HOME_COLLECTION_ID);\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\n\t\t// setup for editing the permissions of the site for this tool, using the roles of this site, too\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis1\")\n\t\t\t\t+ SiteService.getSiteDisplay(ref.getContext()));\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}", "public void addPermission(T object, Permission permission);", "public void EnableRuntimePermission(){\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(EditProfileActivity.this,\n Manifest.permission.CAMERA))\n {\n\n Toast.makeText(getApplicationContext(),\"CAMERA permission allows us to Access CAMERA app\", Toast.LENGTH_LONG).show();\n\n } else {\n\n ActivityCompat.requestPermissions(EditProfileActivity.this,new String[]{\n Manifest.permission.CAMERA}, RequestPermissionCode);\n\n }\n }", "boolean isWritePermissionGranted();", "public boolean isPermissionGranted(String permission){\n return true;\n// else\n// return false;\n }", "public void setNegativePermissions();", "public boolean createSystemAdmin(String userName, String password, String fullName) {\n if (!validateParams(userName, password, fullName)) {\n return false;\n }\n\n admin = userController.createUser(userName, password, fullName, UserType.SYSTEM_ADMIN, true, null);\n return true;\n }", "@TargetApi(23)\r\n public void requestPermission() {\r\n ArrayList<String> arrayList;\r\n String[] strArr = this.mPermissions;\r\n for (String str : strArr) {\r\n if (this.mActivity.checkCallingOrSelfPermission(str) != 0) {\r\n if (shouldShowRequestPermissionRationale(str) || !PermissionUtils.isNeverShowEnabled(PermissionUtils.getRequestCode(str))) {\r\n if (this.normalPermissions == null) {\r\n this.normalPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.normalPermissions;\r\n } else {\r\n if (this.settingsPermissions == null) {\r\n this.settingsPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.settingsPermissions;\r\n }\r\n arrayList.add(str);\r\n }\r\n }\r\n Log.d(TAG, \"requestPermission() settingsPermissions:\" + this.settingsPermissions);\r\n Log.d(TAG, \"requestPermission() normalPermissions:\" + this.normalPermissions);\r\n ArrayList<String> arrayList2 = this.normalPermissions;\r\n if (arrayList2 == null || arrayList2.size() <= 0) {\r\n ArrayList<String> arrayList3 = this.settingsPermissions;\r\n if (arrayList3 == null || arrayList3.size() <= 0) {\r\n IGrantedTask iGrantedTask = this.mTask;\r\n if (iGrantedTask != null) {\r\n iGrantedTask.doTask();\r\n }\r\n } else {\r\n Activity activity = this.mActivity;\r\n PermissionUtils.showPermissionSettingsDialog(activity, activity.getResources().getString(R.string.app_name), this.settingsPermissions, true);\r\n this.settingsPermissions = null;\r\n }\r\n finishFragment();\r\n return;\r\n }\r\n requestPermissions((String[]) this.normalPermissions.toArray(new String[this.normalPermissions.size()]), 5003);\r\n this.normalPermissions = null;\r\n }", "public void askForPermissionsGrant(){\n int res =ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION);\n int res2 =ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION);\n if (res!= PackageManager.PERMISSION_GRANTED || res2!= PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"We need to access your location\")\n .setMessage(\"We want to track every breath you take\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.READ_CONTACTS},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n });\n builder.create().show();\n }\n else {\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n } else {\n // Permission has already been granted\n publishLastLocation();\n }\n\n }", "ISModifyRequiredRole createISModifyRequiredRole();", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "public interface SysPermissionService {\n}", "private void requestPermissionAccessLocation() {\n int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n Log.d(TAG, \"permissionCheck: \" + permissionCheck);\n\n if (permissionCheck == PackageManager.PERMISSION_GRANTED) {\n updateFragmentOnLocationSuccess();\n } else {\n ActivityCompat\n .requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_PERMISSION_LOCATION);\n }\n }", "public void addUserToAccessControlList(Site site, String permission) {\n \t\n \tString gcalid = getGoogleCalendarID( site);\n \tif (gcalid == null){\n \t\tM_log.error(\"Google calendar id not found in site properties for site: \" + site.getId());\n \t\treturn;\n \t}\n \t\n \tString currentUserId = getCurrentUserId();\n \t\n \tCalendar client;\n \t\n \tPreferences prefs = (PreferencesEdit)m_preferencesService.getPreferences(currentUserId);\n\t\tResourceProperties props = prefs.getProperties(GOOGLE_CALENDAR_PREFS);\n\t\tString googleCalendarPrefPropValue = props.getProperty(gcalid);\n\t\tboolean isSuper = securityService.isSuperUser(currentUserId);\n \t\n\t\t// if the current user is a valid user in the site or a superuser\n\t\t// and if the current user is not in google calendar acl (access control list)\n\t\t// OR if their permissions have changed\n\t\t// add the current user to the google calendar acl (access control list)\t\t\n\t\tif (site.getMember(currentUserId) != null \n\t\t\t\t&& ( googleCalendarPrefPropValue == null || !googleCalendarPrefPropValue.equals(permission) )\n\t\t\t\t|| isSuper ) {\n\t\t\t\n\t\t\t// Site creator \n\t\t\tString siteCreatorEmailAddress = site.getCreatedBy().getEmail();\n\t\t\t\n\t\t\t// no email associated with the site owner results in the call to Google to fail.\n\t\t\tif ( null == siteCreatorEmailAddress || siteCreatorEmailAddress.isEmpty() ) {\n\t\t\t\t// TODO: error message to the user here?\n\t\t\t\tM_log.error(\"Missing email address for site creator - unable to create google calender. Site \" + site.getId() + \" creator \" + site.getCreatedBy().getSortName() );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Create ACL using site creator email\n\t\t\tGoogleCredential credential = getGoogleCredential(siteCreatorEmailAddress);\n\t\t\t\n\t\t\tif (credential == null) {\n\t\t\t\tM_log.error(\"addUserToAccessControlList: bad credentials for \" + site.getId() + \" creator \" + siteCreatorEmailAddress);\n\t\t\t\treturn; // user not authorized\n\t\t\t}\n\n\t\t\tclient = getGoogleClient( credential );\n\t\t\t\t\n\t\t\tString currentUserEmailAddress = getUserEmailAddress();\n\t\t\tAclRule rule = new AclRule();\n\t\t\tScope scope = new Scope();\n\n\t\t\tscope.setType(SakaiGCalendarServiceStaticVariables.RULE_SCOPE_TYPE_USER);\n\t\t\tscope.setValue(currentUserEmailAddress);\n\t\t\trule.setScope(scope);\n\t\t\t\n\t\t\t// Determine Google calendar permissions based on Sakai permissions\n\t\t\tif ( permission.equals(org.sakaiproject.site.api.SiteService.SECURE_UPDATE_SITE_MEMBERSHIP)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_OWNER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_EDIT)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_WRITER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW_ALL) || isSuper) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_READER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_FREEBUSYREADER);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_FREEBUSYREADER); // should never fall through\n\t\t\t}\n\t\t\t// TODO: although this seems to work, we should update the role if it already exists AND we should test the return\n\t\t\ttry {\n\t\t\t\tAclRule createdRule = client.acl().insert(gcalid, rule).execute();\n\t\t\t} catch (IOException e) {\n\t\t\t\tM_log.error(\"addUserToAccessControlList for site \" + site.getId() + \" \" + e.getMessage());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Save gcalid in user preferences (so we know the user has been added to the google calendar ACL)\t\t\n\t\t\tsaveGCalProperty(currentUserId, gcalid, permission);\n \t}\n }", "void setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission);", "protected void checkSetPolicyPermission() {\n\tSecurityManager sm = System.getSecurityManager();\n\tif (sm != null) {\n\t if (setPolicyPermission == null) {\n\t\tsetPolicyPermission = new java.security.SecurityPermission(\"setPolicy\");\n\t }\n\t sm.checkPermission(setPolicyPermission);\n\t}\n }", "abstract public void getPermission();", "UserPermissionsType createUserPermissionsType();", "void addRoleToUser(int userID,int roleID);", "protected void setPrivileges(PrivilegeSet ps) { this.privileges = ps; }", "public String getFloodPerm() throws PermissionDeniedException;", "@Override\r\n protected void mayProceed() throws InsufficientPermissionException {\n if (ub.isSysAdmin() || ub.isTechAdmin()) {\r\n return;\r\n }\r\n// if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) {// ?\r\n// ?\r\n// return;\r\n// }\r\n\r\n addPageMessage(respage.getString(\"no_have_correct_privilege_current_study\") + respage.getString(\"change_study_contact_sysadmin\"));\r\n throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString(\"not_allowed_access_extract_data_servlet\"), \"1\");// TODO\r\n // above copied from create dataset servlet, needs to be changed to\r\n // allow only admin-level users\r\n\r\n }", "private void changePermissionsInUI(int position) {\n if (permissions.get(position).equals(\"Viewer\")) {\n permissions.set(position, \"Editor\");\n items.set(position, users.get(position) + \": Editor\");\n Toast.makeText(RoomSettingsActivity.this, users.get(position) + \" has been changed to an Editor\", Toast.LENGTH_SHORT).show();\n } else if (permissions.get(position).equals(\"Editor\")) {\n permissions.set(position, \"Viewer\");\n items.set(position, users.get(position) + \": Viewer\");\n Toast.makeText(RoomSettingsActivity.this, users.get(position) + \" has been changed to a Viewer\", Toast.LENGTH_SHORT).show();\n }\n }", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void fineLocationPermissionGranted() {\n UtilityService.addGeofences(this);\n UtilityService.requestLocation(this);\n }", "private void requestLocationPermission() {\n Log.d(MainActivity.TAG,\"Requesting location permission.\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (shouldShowRequestPermissionRationale(\n android.Manifest.permission.ACCESS_FINE_LOCATION)) {\n Toast.makeText(this, R.string.location_permission_request_rationale, Toast.LENGTH_SHORT).show();\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n }\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n MainActivity.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "public boolean addPermission(Permission permission);", "private static void createAdmin(SecurityService service,\n\t\t\tString securityDomainId, Actor requestingActor, Actor adminActor,\n\t\t\tString groupId) {\n\t\tBooleanResultResponse boolResp = service.createAceActionByActorIdByRoleId(securityDomainId, adminActor, \"USRGADM\", groupId, requestingActor);\n\t\tSystem.out.println(\"after inserting admins>>>>\" + boolResp);\n\t}", "private void requestPermission() {\n if (shouldShowRequestPermissionRationale(android.Manifest.permission.ACCESS_FINE_LOCATION)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(this.getResources().getString(R.string.request_location_permission_message))\n .setPositiveButton(this.getResources().getString(R.string.OK), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},\n REQUEST_LOCATION);\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n } else {\n ActivityCompat.requestPermissions((Activity) mContext,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},\n REQUEST_LOCATION);\n }\n }", "private void setPerms() {\n int oPerm = 0; // Owner permissions\n int gPerm = 0; // Group permissions\n int aPerm = 0; // All (other) permissions\n\n // Set owner permissions digit\n if (ownerRead.isSelected()) oPerm += 4; // Read\n if (ownerWrite.isSelected()) oPerm += 2; // Write\n if (ownerExe.isSelected()) oPerm += 1; // Execute\n\n // Set group permissions digit\n if (groupRead.isSelected()) gPerm += 4; // Read\n if (groupWrite.isSelected()) gPerm += 2; // Write\n if (groupExe.isSelected()) gPerm += 1; // Execute\n\n // Set all permissions digit\n if (allRead.isSelected()) aPerm += 4; // Read\n if (allWrite.isSelected()) aPerm += 2; // Write\n if (allExe.isSelected()) aPerm += 1; // Execute\n\n // Concatenate digits into chmod code\n String perms = Integer.toString(oPerm) + Integer.toString(gPerm) + Integer.toString(aPerm);\n //System.out.println(perms); // just for testing\n\n FTPReply chmodReply;\n try {\n // Set file permissions\n chmodReply = client.sendSiteCommand(\"chmod \" + perms + \" \" + theFile);\n System.out.println(chmodReply.toString());\n }\n catch (FTPIllegalReplyException | IOException e) {\n e.printStackTrace();\n }\n }", "private void requestLocationPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n\n new AlertDialog.Builder(this)\n .setTitle(\"Permission needed\")\n .setMessage(\"Location Permission is needed to show your current location on the map\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(ScavengerHunt.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n Toast.makeText(ScavengerHunt.this, \"Location Permission is needed to update the map\", Toast.LENGTH_SHORT).show();\n }\n })\n .create()\n .show();\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n }", "private void requestCameraPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.CAMERA)) {\n // Provide an additional rationale to the user if the permission was not granted\n // and the user would benefit from additional context for the use of the permission.\n // Display a SnackBar with a button to request the missing permission.\n Snackbar.make(mLayoutMap, \"Location access is required to display restaurants near you.\",\n Snackbar.LENGTH_INDEFINITE).setAction(\"OK\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n // Request the permission\n ActivityCompat.requestPermissions(MapsActivity.this,\n new String[]{Manifest.permission.CAMERA},\n PERMISSION_REQUEST_CAMERA);\n }\n }).show();\n\n } else {\n Snackbar.make(mLayoutMap,\n \"Permission is not available. Requesting location permission.\",\n Snackbar.LENGTH_SHORT).show();\n // Request the permission. The result will be received in onRequestPermissionResult().\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},\n PERMISSION_REQUEST_CAMERA);\n }\n }", "public void getLocationPermission() {\n if (!isPermissionGranted())\n // get the location permission from user\n // this will prompt user a dialog to give the location permission\n requestPermissionLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION);\n /*ActivityCompat.requestPermissions(activity,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);*/\n }", "public void requestCameraPermission() {\n int currentapiVersion = Build.VERSION.SDK_INT;\n if (currentapiVersion >= Build.VERSION_CODES.M) {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE},\n 1);\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE},\n 1);\n }\n }\n }\n }", "private void requestPermissions() {\n String[] PERMISSIONS = {android.Manifest.permission.WRITE_EXTERNAL_STORAGE};\r\n ActivityCompat.requestPermissions(this, PERMISSIONS, 112);\r\n\r\n ActivityCompat.requestPermissions(this,\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 1000);\r\n\r\n // Check for GPS usage permission\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED\r\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n ActivityCompat.requestPermissions(this,\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 1000);\r\n\r\n }\r\n }", "private void permissionLocationRequest() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int hasLocationPermission = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);\n if (hasLocationPermission != PackageManager.PERMISSION_GRANTED) {\n if (!shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)) {\n showMessageOKCancel(\"You need to allow access to Location\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n });\n }\n }\n\n }\n }", "@Override\n public void checkPermission(Permission perm, Object context) {\n }", "protected void requestPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n PERMISSION_REQUEST_WRITE_EXTERNAL_STORATE);\n\n } else {\n // Request the permission. The result will be received in onRequestPermissionResult().\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n PERMISSION_REQUEST_WRITE_EXTERNAL_STORATE);\n }\n }", "@Override\n protected String requiredGetPermission() {\n return \"user\";\n }" ]
[ "0.7000365", "0.59101325", "0.586449", "0.5786038", "0.564631", "0.5631921", "0.5619662", "0.5504023", "0.5468869", "0.5385709", "0.5376446", "0.5351213", "0.53469026", "0.53373563", "0.53299046", "0.5325347", "0.5324954", "0.5300362", "0.52917325", "0.52895164", "0.5281453", "0.5267852", "0.52408147", "0.52179", "0.5217333", "0.52160555", "0.51992065", "0.51890796", "0.5150246", "0.5139444", "0.513794", "0.510095", "0.5099558", "0.5075972", "0.50632983", "0.50600713", "0.50521797", "0.50447065", "0.5042792", "0.50343174", "0.50317985", "0.50217694", "0.5020742", "0.5018363", "0.5010249", "0.5009647", "0.50032616", "0.49965322", "0.499145", "0.49889192", "0.4981593", "0.498081", "0.4978031", "0.4964827", "0.4952005", "0.49450865", "0.49340272", "0.4915309", "0.4906749", "0.49016878", "0.48906916", "0.48899707", "0.48832446", "0.48752663", "0.4870207", "0.4859484", "0.48530033", "0.48528937", "0.48523062", "0.48478556", "0.4845782", "0.4843651", "0.48368013", "0.48270047", "0.48242435", "0.4820737", "0.48201805", "0.48201284", "0.48199007", "0.48136765", "0.4812566", "0.48117927", "0.48064512", "0.48032036", "0.48021674", "0.48007175", "0.47926483", "0.478966", "0.4787665", "0.47870368", "0.47794592", "0.4770345", "0.47677317", "0.476299", "0.4761509", "0.4756253", "0.47560036", "0.47522187", "0.4751923", "0.4745837" ]
0.64439744
1
Grants a systemlevel permission to a user or role.
public GrantPermissionSystemResponse grantPermissionSystem(String name, String permission, Map<String, String> options) throws GPUdbException { GrantPermissionSystemRequest actualRequest_ = new GrantPermissionSystemRequest(name, permission, options); GrantPermissionSystemResponse actualResponse_ = new GrantPermissionSystemResponse(); submitRequest("/grant/permission/system", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public GrantPermissionSystemResponse grantPermissionSystem(GrantPermissionSystemRequest request) throws GPUdbException {\n GrantPermissionSystemResponse actualResponse_ = new GrantPermissionSystemResponse();\n submitRequest(\"/grant/permission/system\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Test(dependsOnMethods = \"testRoleAdd\", groups = \"role\", priority = 1)\n public void testRoleGrantPermission() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient\n .roleGrantPermission(rootRole, rootRolekeyRangeBegin, rootkeyRangeEnd,\n Permission.Type.READWRITE).get();\n this.authDisabledAuthClient\n .roleGrantPermission(userRole, userRolekeyRangeBegin, userRolekeyRangeEnd, Type.READWRITE)\n .get();\n }", "protected void grantPrivileges() {\n if (!PRIVILEGES_FEATURE_ENABLED.contains(dbType)) {\n return;\n }\n\n // The case where all are to be granted on the default schemas.\n if (!(updateFhirSchema || grantFhirSchema || updateOauthSchema\n || grantOauthSchema || updateJavaBatchSchema || grantJavaBatchSchema)) {\n grantOauthSchema = true;\n grantFhirSchema = true;\n grantJavaBatchSchema = true;\n }\n\n // Build/update the tables as well as the stored procedures\n PhysicalDataModel pdm = new PhysicalDataModel();\n buildCommonModel(pdm, updateFhirSchema || grantFhirSchema, updateOauthSchema || grantOauthSchema,\n updateJavaBatchSchema || grantJavaBatchSchema);\n\n final IDatabaseAdapter adapter = getDbAdapter(dbType, connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n try {\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_USER_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_BATCH_GRANT_GROUP, grantTo);\n } catch (DataAccessException x) {\n // Something went wrong, so mark the transaction as failed\n tx.setRollbackOnly();\n throw x;\n }\n }\n }", "protected SystemRole getDefaultSystemRole(){\r\n \tif (true) return AccessDef.SystemRole.SiteAdmin;\r\n return AccessDef.SystemRole.User;\r\n }", "@Override\n\tpublic void grant(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public final void setActivity_GrantSystem(ugs.proxies.GrantSystem activity_grantsystem)\n\t{\n\t\tsetActivity_GrantSystem(getContext(), activity_grantsystem);\n\t}", "public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;", "public void grantAdministrate(User user) throws ServiceException{\n }", "boolean isSystemUser() throws RepositoryException;", "@Override\r\n\tpublic SysPrivilege addSysPrivilege(SysPrivilege sysPrivilege) {\n\t\treturn (SysPrivilege)sysPrivilegeDao.save(sysPrivilege);\r\n\t}", "public boolean systemAdminOnly()\n {\n return false;\n }", "public void grantRole(String roleName, User user) throws UserManagementException;", "public static void requireSuperAdmin() throws InsufficientPrivilegeException {\n Principal principal = PrincipalContext.getPrincipal();\n if (principal == null) {\n throw new InsufficientPrivilegeException();\n }\n List<RoleType> roles = principal.getRoles();\n assertContainRole(roles, RoleType.SUPER_ADMIN);\n }", "public synchronized void grantAdminPrivilege(UserEntity userEntity) {\n final PrivilegeEntity adminPrivilege = new PrivilegeEntity();\n adminPrivilege.setPermission(permissionDAO.findAmbariAdminPermission());\n adminPrivilege.setPrincipal(userEntity.getPrincipal());\n adminPrivilege.setResource(resourceDAO.findAmbariResource());\n if (!userEntity.getPrincipal().getPrivileges().contains(adminPrivilege)) {\n privilegeDAO.create(adminPrivilege);\n userEntity.getPrincipal().getPrivileges().add(adminPrivilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n }\n }", "public void grantPermission(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "protected void grantAdminAuthority( ApplicationContext ctx ) {\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n // Grant all roles to test user.\n TestingAuthenticationToken token = new TestingAuthenticationToken( \"administrator\", \"administrator\",\n new GrantedAuthority[] { new GrantedAuthorityImpl( \"GROUP_ADMIN\" ) } );\n\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "void grant(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n n |= rights;\n\n rightsMap.put(dbobject, n);\n }", "public void saveSysRole(SysRole sysRole);", "public final void setActivity_GrantSystem(com.mendix.systemwideinterfaces.core.IContext context, ugs.proxies.GrantSystem activity_grantsystem)\n\t{\n\t\tif (activity_grantsystem == null)\n\t\t\tgetMendixObject().setValue(context, MemberNames.Activity_GrantSystem.toString(), null);\n\t\telse\n\t\t\tgetMendixObject().setValue(context, MemberNames.Activity_GrantSystem.toString(), activity_grantsystem.getMendixObject().getId());\n\t}", "void setPermission(String perm, boolean add);", "void requestNeededPermissions(int requestCode);", "private void addApplicationsPermissionsToRegistry() throws APIManagementException {\n Registry tenantGovReg = getRegistry();\n String permissionResourcePath = CarbonConstants.UI_PERMISSION_NAME + RegistryConstants.PATH_SEPARATOR + APPLICATION_ROOT_PERMISSION;\n try {\n if (!tenantGovReg.resourceExists(permissionResourcePath)) {\n String loggedInUser = CarbonContext.getThreadLocalCarbonContext().getUsername();\n UserRealm realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm();\n // Logged in user is not authorized to create the permission.\n // Temporarily change the user to the admin for creating the permission\n PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(realm.getRealmConfiguration().getAdminUserName());\n tenantGovReg = CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.USER_GOVERNANCE);\n Collection appRootNode = tenantGovReg.newCollection();\n appRootNode.setProperty(\"name\", \"Applications\");\n tenantGovReg.put(permissionResourcePath, appRootNode);\n PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(loggedInUser);\n }\n } catch (org.wso2.carbon.user.core.UserStoreException e) {\n throw new APIManagementException(\"Error while reading user store information.\", e);\n } catch (org.wso2.carbon.registry.api.RegistryException e) {\n throw new APIManagementException(\"Error while creating new permission in registry\", e);\n }\n }", "int getPermissionWrite();", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "boolean setSiteRights(SiteAdminRights r, boolean b);", "private void requestPermission() {\n boolean shouldProvideRationale = ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (shouldProvideRationale) {\n Log.i(TAG, \"requestPermission: \" + \"Displaying the permission rationale\");\n // provide a way so that user can grant permission\n\n showSnackbar(R.string.warning_txt, android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startLocationPermissionRequest();\n }\n });\n\n } else {\n startLocationPermissionRequest();\n }\n }", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "private void requestPermissions(){\n Intent intent = new Intent(this.getApplication(), MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n startActivity(intent);\r\n }", "@PreAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"((hasRole('EMPLOYEE') OR isAnonymous()) AND \"\r\n \t\t\t+ \"(#userDTO.type.typeLabel == 'CUSTOMERLEGAL' OR #userDTO.type.typeLabel == 'CUSTOMERINDIVIDUAL'))\")\r\n \tpublic SystemUserDTO create(SystemUserDTO userDTO);", "void permissionGranted(int requestCode);", "private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_ACCESS_FINE_LOCATION);\n\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_ACCESS_COARSE_LOCATION);\n } else {\n isPermission = true;\n }\n }", "public void addPermission(T object, Permission permission, User user);", "private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\r\n PERMISSIONS_ACCESS_FINE_LOCATION);\r\n\r\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED){\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\r\n PERMISSIONS_ACCESS_COARSE_LOCATION);\r\n } else {\r\n isPermission = true;\r\n }\r\n }", "public void grantOper2Role(final Role role, final String operId);", "private static void setPermission(Path path) throws JulongChainException {\n if(System.getProperty(SYSTEM_PROP_OS).contains(SYSTEM_PROP_VALUE_WINDOWS)) {\n return;\n }\n\n Set<PosixFilePermission> filePermissions = new HashSet<>();\n filePermissions.add(PosixFilePermission.OWNER_READ);\n filePermissions.add(PosixFilePermission.OWNER_WRITE);\n filePermissions.add(PosixFilePermission.OWNER_EXECUTE);\n filePermissions.add(PosixFilePermission.GROUP_READ);\n filePermissions.add(PosixFilePermission.GROUP_EXECUTE);\n filePermissions.add(PosixFilePermission.OTHERS_READ);\n filePermissions.add(PosixFilePermission.OTHERS_EXECUTE);\n try {\n Files.setPosixFilePermissions(path, filePermissions);\n } catch (IOException e) {\n throw new JulongChainException(\"set directory\" + path + \" permission failed \" + e.getMessage());\n }\n }", "public abstract boolean addRunAs(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "@Override\n\tpublic void grantGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "private void checkRunTimePermission() {\n\n if(checkPermission()){\n\n Toast.makeText(MainActivity.this, \"All Permissions Granted Successfully\", Toast.LENGTH_LONG).show();\n\n }\n else {\n\n requestPermission();\n }\n }", "private void dynamicPermission() {\n if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {\n Log.i(\"MainActivity\", \"android sdk <= 28 Q\");\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n String[] strings =\n {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n ActivityCompat.requestPermissions(this, strings, 1);\n }\n } else {\n // Dynamically apply for required permissions if the API level is greater than 28. The android.permission.ACCESS_BACKGROUND_LOCATION permission is required.\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\") != PackageManager.PERMISSION_GRANTED) {\n String[] strings = {android.Manifest.permission.ACCESS_FINE_LOCATION,\n android.Manifest.permission.ACCESS_COARSE_LOCATION,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\"};\n ActivityCompat.requestPermissions(this, strings, 2);\n }\n }\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n public void requestPermission() {\n //shouldShowRequestPermissionRationale es verdadero solamente si ya se había mostrado\n //anteriormente el dialogo de permisos y el usuario lo negó\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.SEND_SMS)) {\n } else {\n //si es la primera vez se solicita el permiso directamente\n requestPermissions(new String[]{Manifest.permission.SEND_SMS},\n MY_WRITE_EXTERNAL_STORAGE);\n }\n }", "void setPremiumSmsPermission(String packageName, int permission);", "private void requestPermission() {\r\n\r\n if (ActivityCompat.shouldShowRequestPermissionRationale(UniformDrawer.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\r\n Toast.makeText(UniformDrawer.this, \"Write External Storage permission allows us to do store images. Please allow this permission in App Settings.\", Toast.LENGTH_LONG).show();\r\n } else {\r\n ActivityCompat.requestPermissions(UniformDrawer.this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);\r\n }\r\n }", "private void requestPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{\n Manifest.permission.CAMERA}, 1);\n //if not permitted by the user ,send a message to the user to get the right\n } else {\n opencamera();\n //if permitted by the user already ,then start open the camera directly\n }\n }", "@Override\n public void grantPrivileges(String sessID, String name, UserLevel level) throws SQLException, SessionExpiredException {\n PooledConnection conn = ConnectionController.connectPooled(sessID);\n try {\n String dbName = ConnectionController.getDBName(sessID);\n LOG.info(\"Granting \" + level + \" privileges to \" + name + \" on \" + dbName + \"...\");\n switch (level) {\n case ADMIN:\n conn.executePreparedUpdate(\"GRANT ALTER, RELOAD, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, CREATE USER, DELETE, DROP, FILE, GRANT OPTION, INSERT, SELECT, UPDATE ON *.* TO ?\", name);\n conn.executePreparedUpdate(String.format(\"GRANT GRANT OPTION ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT ALTER, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, DELETE, DROP, INSERT, SELECT, UPDATE ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.db TO ?\", name);\n break;\n case USER:\n conn.executePreparedUpdate(String.format(\"GRANT CREATE TEMPORARY TABLES, SELECT ON %s.* TO ?\", dbName), name);\n\n //grant read/write/delete on region sets.\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set_membership TO ?\", dbName), name);\n\n //Grant read/write/delete on cohorts.\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort_membership TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n break;\n case GUEST:\n conn.executePreparedUpdate(String.format(\"GRANT SELECT ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.server_log TO ?\", dbName), name);\n // Grant permissions to write comments\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.variant_starred TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n\n break;\n }\n\n SettingsManager.getInstance().addSetting(sessID, DATABASE_USER_KEY_PREFIX + name, level.name());\n LOG.info(\"... granted.\");\n } catch (Exception ex) {\n LOG.error(\"Problem creating user\", ex);\n throw new SQLException(\"Can't setup privileges for user \" + name, ex);\n } finally {\n conn.executeQuery(\"FLUSH PRIVILEGES\");\n conn.close();\n }\n }", "public void grantPermissionPending(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "@Override\n public boolean hasPermission(Permission permission) {\n // FacesContext context = FacesContext.getCurrentInstance();\n String imp = (String)ADFContext.getCurrent().getSessionScope().get(\"isImpersonationOn\");\n// String imp = (String)context.getExternalContext().getSessionMap().get(\"isImpersonationOn\");\n if(imp == null || !imp.equals(\"Y\")){\n return super.hasPermission(permission);\n }\n else{\n return true;\n \n }\n \n }", "@Override\n public void onClick(View view) {\n String platform = checkPlatform();\n if (platform.equals(\"Marshmallow\")) {\n Log.d(TAG, \"Runtime permission required\");\n //Step 2. check the permission\n boolean permissionStatus = checkPermission();\n if (permissionStatus) {\n //Permission already granted\n Log.d(TAG, \"Permission already granted\");\n } else {\n //Permission not granted\n //Step 3. Explain permission i.e show an explanation\n Log.d(TAG, \"Explain permission\");\n explainPermission();\n //Step 4. Request Permissions\n Log.d(TAG, \"Request Permission\");\n requestPermission();\n }\n\n } else {\n Log.d(TAG, \"onClick: Runtime permission not required\");\n }\n\n\n }", "public synchronized void grantAdminPrivilege(Integer userId) {\n grantAdminPrivilege(userDAO.findByPK(userId));\n }", "private void requestPermission(){\r\n ActivityCompat.requestPermissions(activity,new String[]{Manifest.permission.ACCESS_FINE_LOCATION},1);\r\n }", "private void requirePermission(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;\n if (ActivityCompat.checkSelfPermission(MainActivity2.this, permission)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MainActivity2.this, new String[]{permission},123);\n }\n }\n }", "@Override\r\n\tpublic void updateSysPrivilege(SysPrivilege sysPrivilege) {\n\t\tsysPrivilegeDao.saveOrUpdate(sysPrivilege);\r\n\t}", "private void requestReadAndSendSmsPermission()\n {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.READ_SMS))\n {\n\n }\n ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.READ_SMS,\n android.Manifest.permission.SEND_SMS,\n android.Manifest.permission.RECEIVE_SMS,\n Manifest.permission.READ_PHONE_STATE}, 1);\n }", "public static void addGuestMemberPermission(String permission)\r\n throws CreateException, DatabaseException, ForeignKeyNotFoundException {\r\n \r\n MemberXML.addGuestMemberPermission(permission);\r\n }", "int setCanStatus(int canRegno, int action);", "private void askPermission() {\n if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n Parameters.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_PERMISSION_SETTING) {\n checkPermission();\n }\n }", "void askForPermissions();", "public static void checkAccess() throws SecurityException {\n if(isSystemThread.get()) {\n return;\n }\n //TODO: Add Admin Checking Code\n// if(getCurrentUser() != null && getCurrentUser().isAdmin()) {\n// return;\n// }\n throw new SecurityException(\"Invalid Permissions\");\n }", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "public void permission_check() {\n //Usage Permission\n if (!isAccessGranted()) {\n new LovelyStandardDialog(MainActivity.this)\n .setTopColorRes(R.color.colorPrimaryDark)\n .setIcon(R.drawable.ic_perm_device_information_white_48dp)\n .setTitle(getString(R.string.permission_check_title))\n .setMessage(getString(R.string.permission_check_message))\n .setPositiveButton(android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);\n startActivity(intent);\n }\n })\n .setNegativeButton(android.R.string.no, null)\n .show();\n }\n }", "public void doPermissions(RunData data, Context context)\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\t// should we save here?\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, new TreeSet());\n\n\t\t// get the current home collection id and the related site\n\t\tString collectionId = (String) state.getAttribute (STATE_HOME_COLLECTION_ID);\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\n\t\t// setup for editing the permissions of the site for this tool, using the roles of this site, too\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis1\")\n\t\t\t\t+ SiteService.getSiteDisplay(ref.getContext()));\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}", "public void addPermission(T object, Permission permission);", "public void EnableRuntimePermission(){\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(EditProfileActivity.this,\n Manifest.permission.CAMERA))\n {\n\n Toast.makeText(getApplicationContext(),\"CAMERA permission allows us to Access CAMERA app\", Toast.LENGTH_LONG).show();\n\n } else {\n\n ActivityCompat.requestPermissions(EditProfileActivity.this,new String[]{\n Manifest.permission.CAMERA}, RequestPermissionCode);\n\n }\n }", "boolean isWritePermissionGranted();", "public boolean isPermissionGranted(String permission){\n return true;\n// else\n// return false;\n }", "public void setNegativePermissions();", "public boolean createSystemAdmin(String userName, String password, String fullName) {\n if (!validateParams(userName, password, fullName)) {\n return false;\n }\n\n admin = userController.createUser(userName, password, fullName, UserType.SYSTEM_ADMIN, true, null);\n return true;\n }", "@TargetApi(23)\r\n public void requestPermission() {\r\n ArrayList<String> arrayList;\r\n String[] strArr = this.mPermissions;\r\n for (String str : strArr) {\r\n if (this.mActivity.checkCallingOrSelfPermission(str) != 0) {\r\n if (shouldShowRequestPermissionRationale(str) || !PermissionUtils.isNeverShowEnabled(PermissionUtils.getRequestCode(str))) {\r\n if (this.normalPermissions == null) {\r\n this.normalPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.normalPermissions;\r\n } else {\r\n if (this.settingsPermissions == null) {\r\n this.settingsPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.settingsPermissions;\r\n }\r\n arrayList.add(str);\r\n }\r\n }\r\n Log.d(TAG, \"requestPermission() settingsPermissions:\" + this.settingsPermissions);\r\n Log.d(TAG, \"requestPermission() normalPermissions:\" + this.normalPermissions);\r\n ArrayList<String> arrayList2 = this.normalPermissions;\r\n if (arrayList2 == null || arrayList2.size() <= 0) {\r\n ArrayList<String> arrayList3 = this.settingsPermissions;\r\n if (arrayList3 == null || arrayList3.size() <= 0) {\r\n IGrantedTask iGrantedTask = this.mTask;\r\n if (iGrantedTask != null) {\r\n iGrantedTask.doTask();\r\n }\r\n } else {\r\n Activity activity = this.mActivity;\r\n PermissionUtils.showPermissionSettingsDialog(activity, activity.getResources().getString(R.string.app_name), this.settingsPermissions, true);\r\n this.settingsPermissions = null;\r\n }\r\n finishFragment();\r\n return;\r\n }\r\n requestPermissions((String[]) this.normalPermissions.toArray(new String[this.normalPermissions.size()]), 5003);\r\n this.normalPermissions = null;\r\n }", "public void askForPermissionsGrant(){\n int res =ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION);\n int res2 =ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION);\n if (res!= PackageManager.PERMISSION_GRANTED || res2!= PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"We need to access your location\")\n .setMessage(\"We want to track every breath you take\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.READ_CONTACTS},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n });\n builder.create().show();\n }\n else {\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n } else {\n // Permission has already been granted\n publishLastLocation();\n }\n\n }", "ISModifyRequiredRole createISModifyRequiredRole();", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "public interface SysPermissionService {\n}", "private void requestPermissionAccessLocation() {\n int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n Log.d(TAG, \"permissionCheck: \" + permissionCheck);\n\n if (permissionCheck == PackageManager.PERMISSION_GRANTED) {\n updateFragmentOnLocationSuccess();\n } else {\n ActivityCompat\n .requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_PERMISSION_LOCATION);\n }\n }", "public void addUserToAccessControlList(Site site, String permission) {\n \t\n \tString gcalid = getGoogleCalendarID( site);\n \tif (gcalid == null){\n \t\tM_log.error(\"Google calendar id not found in site properties for site: \" + site.getId());\n \t\treturn;\n \t}\n \t\n \tString currentUserId = getCurrentUserId();\n \t\n \tCalendar client;\n \t\n \tPreferences prefs = (PreferencesEdit)m_preferencesService.getPreferences(currentUserId);\n\t\tResourceProperties props = prefs.getProperties(GOOGLE_CALENDAR_PREFS);\n\t\tString googleCalendarPrefPropValue = props.getProperty(gcalid);\n\t\tboolean isSuper = securityService.isSuperUser(currentUserId);\n \t\n\t\t// if the current user is a valid user in the site or a superuser\n\t\t// and if the current user is not in google calendar acl (access control list)\n\t\t// OR if their permissions have changed\n\t\t// add the current user to the google calendar acl (access control list)\t\t\n\t\tif (site.getMember(currentUserId) != null \n\t\t\t\t&& ( googleCalendarPrefPropValue == null || !googleCalendarPrefPropValue.equals(permission) )\n\t\t\t\t|| isSuper ) {\n\t\t\t\n\t\t\t// Site creator \n\t\t\tString siteCreatorEmailAddress = site.getCreatedBy().getEmail();\n\t\t\t\n\t\t\t// no email associated with the site owner results in the call to Google to fail.\n\t\t\tif ( null == siteCreatorEmailAddress || siteCreatorEmailAddress.isEmpty() ) {\n\t\t\t\t// TODO: error message to the user here?\n\t\t\t\tM_log.error(\"Missing email address for site creator - unable to create google calender. Site \" + site.getId() + \" creator \" + site.getCreatedBy().getSortName() );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Create ACL using site creator email\n\t\t\tGoogleCredential credential = getGoogleCredential(siteCreatorEmailAddress);\n\t\t\t\n\t\t\tif (credential == null) {\n\t\t\t\tM_log.error(\"addUserToAccessControlList: bad credentials for \" + site.getId() + \" creator \" + siteCreatorEmailAddress);\n\t\t\t\treturn; // user not authorized\n\t\t\t}\n\n\t\t\tclient = getGoogleClient( credential );\n\t\t\t\t\n\t\t\tString currentUserEmailAddress = getUserEmailAddress();\n\t\t\tAclRule rule = new AclRule();\n\t\t\tScope scope = new Scope();\n\n\t\t\tscope.setType(SakaiGCalendarServiceStaticVariables.RULE_SCOPE_TYPE_USER);\n\t\t\tscope.setValue(currentUserEmailAddress);\n\t\t\trule.setScope(scope);\n\t\t\t\n\t\t\t// Determine Google calendar permissions based on Sakai permissions\n\t\t\tif ( permission.equals(org.sakaiproject.site.api.SiteService.SECURE_UPDATE_SITE_MEMBERSHIP)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_OWNER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_EDIT)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_WRITER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW_ALL) || isSuper) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_READER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_FREEBUSYREADER);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_FREEBUSYREADER); // should never fall through\n\t\t\t}\n\t\t\t// TODO: although this seems to work, we should update the role if it already exists AND we should test the return\n\t\t\ttry {\n\t\t\t\tAclRule createdRule = client.acl().insert(gcalid, rule).execute();\n\t\t\t} catch (IOException e) {\n\t\t\t\tM_log.error(\"addUserToAccessControlList for site \" + site.getId() + \" \" + e.getMessage());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Save gcalid in user preferences (so we know the user has been added to the google calendar ACL)\t\t\n\t\t\tsaveGCalProperty(currentUserId, gcalid, permission);\n \t}\n }", "void setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission);", "protected void checkSetPolicyPermission() {\n\tSecurityManager sm = System.getSecurityManager();\n\tif (sm != null) {\n\t if (setPolicyPermission == null) {\n\t\tsetPolicyPermission = new java.security.SecurityPermission(\"setPolicy\");\n\t }\n\t sm.checkPermission(setPolicyPermission);\n\t}\n }", "abstract public void getPermission();", "UserPermissionsType createUserPermissionsType();", "void addRoleToUser(int userID,int roleID);", "protected void setPrivileges(PrivilegeSet ps) { this.privileges = ps; }", "public String getFloodPerm() throws PermissionDeniedException;", "@Override\r\n protected void mayProceed() throws InsufficientPermissionException {\n if (ub.isSysAdmin() || ub.isTechAdmin()) {\r\n return;\r\n }\r\n// if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) {// ?\r\n// ?\r\n// return;\r\n// }\r\n\r\n addPageMessage(respage.getString(\"no_have_correct_privilege_current_study\") + respage.getString(\"change_study_contact_sysadmin\"));\r\n throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString(\"not_allowed_access_extract_data_servlet\"), \"1\");// TODO\r\n // above copied from create dataset servlet, needs to be changed to\r\n // allow only admin-level users\r\n\r\n }", "private void changePermissionsInUI(int position) {\n if (permissions.get(position).equals(\"Viewer\")) {\n permissions.set(position, \"Editor\");\n items.set(position, users.get(position) + \": Editor\");\n Toast.makeText(RoomSettingsActivity.this, users.get(position) + \" has been changed to an Editor\", Toast.LENGTH_SHORT).show();\n } else if (permissions.get(position).equals(\"Editor\")) {\n permissions.set(position, \"Viewer\");\n items.set(position, users.get(position) + \": Viewer\");\n Toast.makeText(RoomSettingsActivity.this, users.get(position) + \" has been changed to a Viewer\", Toast.LENGTH_SHORT).show();\n }\n }", "public void createSystemUser(String nam, String surnam, String id, String username, String password) {\n\t\ttry {\n\t\t\trestaurant.addUser(nam, surnam, id, username, password);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void fineLocationPermissionGranted() {\n UtilityService.addGeofences(this);\n UtilityService.requestLocation(this);\n }", "private void requestLocationPermission() {\n Log.d(MainActivity.TAG,\"Requesting location permission.\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (shouldShowRequestPermissionRationale(\n android.Manifest.permission.ACCESS_FINE_LOCATION)) {\n Toast.makeText(this, R.string.location_permission_request_rationale, Toast.LENGTH_SHORT).show();\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n }\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n MainActivity.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "public boolean addPermission(Permission permission);", "private static void createAdmin(SecurityService service,\n\t\t\tString securityDomainId, Actor requestingActor, Actor adminActor,\n\t\t\tString groupId) {\n\t\tBooleanResultResponse boolResp = service.createAceActionByActorIdByRoleId(securityDomainId, adminActor, \"USRGADM\", groupId, requestingActor);\n\t\tSystem.out.println(\"after inserting admins>>>>\" + boolResp);\n\t}", "private void requestPermission() {\n if (shouldShowRequestPermissionRationale(android.Manifest.permission.ACCESS_FINE_LOCATION)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(this.getResources().getString(R.string.request_location_permission_message))\n .setPositiveButton(this.getResources().getString(R.string.OK), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},\n REQUEST_LOCATION);\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n } else {\n ActivityCompat.requestPermissions((Activity) mContext,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},\n REQUEST_LOCATION);\n }\n }", "private void setPerms() {\n int oPerm = 0; // Owner permissions\n int gPerm = 0; // Group permissions\n int aPerm = 0; // All (other) permissions\n\n // Set owner permissions digit\n if (ownerRead.isSelected()) oPerm += 4; // Read\n if (ownerWrite.isSelected()) oPerm += 2; // Write\n if (ownerExe.isSelected()) oPerm += 1; // Execute\n\n // Set group permissions digit\n if (groupRead.isSelected()) gPerm += 4; // Read\n if (groupWrite.isSelected()) gPerm += 2; // Write\n if (groupExe.isSelected()) gPerm += 1; // Execute\n\n // Set all permissions digit\n if (allRead.isSelected()) aPerm += 4; // Read\n if (allWrite.isSelected()) aPerm += 2; // Write\n if (allExe.isSelected()) aPerm += 1; // Execute\n\n // Concatenate digits into chmod code\n String perms = Integer.toString(oPerm) + Integer.toString(gPerm) + Integer.toString(aPerm);\n //System.out.println(perms); // just for testing\n\n FTPReply chmodReply;\n try {\n // Set file permissions\n chmodReply = client.sendSiteCommand(\"chmod \" + perms + \" \" + theFile);\n System.out.println(chmodReply.toString());\n }\n catch (FTPIllegalReplyException | IOException e) {\n e.printStackTrace();\n }\n }", "private void requestLocationPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n\n new AlertDialog.Builder(this)\n .setTitle(\"Permission needed\")\n .setMessage(\"Location Permission is needed to show your current location on the map\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(ScavengerHunt.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n Toast.makeText(ScavengerHunt.this, \"Location Permission is needed to update the map\", Toast.LENGTH_SHORT).show();\n }\n })\n .create()\n .show();\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n }", "private void requestCameraPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.CAMERA)) {\n // Provide an additional rationale to the user if the permission was not granted\n // and the user would benefit from additional context for the use of the permission.\n // Display a SnackBar with a button to request the missing permission.\n Snackbar.make(mLayoutMap, \"Location access is required to display restaurants near you.\",\n Snackbar.LENGTH_INDEFINITE).setAction(\"OK\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n // Request the permission\n ActivityCompat.requestPermissions(MapsActivity.this,\n new String[]{Manifest.permission.CAMERA},\n PERMISSION_REQUEST_CAMERA);\n }\n }).show();\n\n } else {\n Snackbar.make(mLayoutMap,\n \"Permission is not available. Requesting location permission.\",\n Snackbar.LENGTH_SHORT).show();\n // Request the permission. The result will be received in onRequestPermissionResult().\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},\n PERMISSION_REQUEST_CAMERA);\n }\n }", "public void getLocationPermission() {\n if (!isPermissionGranted())\n // get the location permission from user\n // this will prompt user a dialog to give the location permission\n requestPermissionLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION);\n /*ActivityCompat.requestPermissions(activity,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);*/\n }", "public void requestCameraPermission() {\n int currentapiVersion = Build.VERSION.SDK_INT;\n if (currentapiVersion >= Build.VERSION_CODES.M) {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE},\n 1);\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE},\n 1);\n }\n }\n }\n }", "private void requestPermissions() {\n String[] PERMISSIONS = {android.Manifest.permission.WRITE_EXTERNAL_STORAGE};\r\n ActivityCompat.requestPermissions(this, PERMISSIONS, 112);\r\n\r\n ActivityCompat.requestPermissions(this,\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 1000);\r\n\r\n // Check for GPS usage permission\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED\r\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n ActivityCompat.requestPermissions(this,\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 1000);\r\n\r\n }\r\n }", "private void permissionLocationRequest() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int hasLocationPermission = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);\n if (hasLocationPermission != PackageManager.PERMISSION_GRANTED) {\n if (!shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)) {\n showMessageOKCancel(\"You need to allow access to Location\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n });\n }\n }\n\n }\n }", "@Override\n public void checkPermission(Permission perm, Object context) {\n }", "protected void requestPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n PERMISSION_REQUEST_WRITE_EXTERNAL_STORATE);\n\n } else {\n // Request the permission. The result will be received in onRequestPermissionResult().\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n PERMISSION_REQUEST_WRITE_EXTERNAL_STORATE);\n }\n }", "@Override\n protected String requiredGetPermission() {\n return \"user\";\n }" ]
[ "0.7000365", "0.64439744", "0.59101325", "0.5786038", "0.564631", "0.5631921", "0.5619662", "0.5504023", "0.5468869", "0.5385709", "0.5376446", "0.5351213", "0.53469026", "0.53373563", "0.53299046", "0.5325347", "0.5324954", "0.5300362", "0.52917325", "0.52895164", "0.5281453", "0.5267852", "0.52408147", "0.52179", "0.5217333", "0.52160555", "0.51992065", "0.51890796", "0.5150246", "0.5139444", "0.513794", "0.510095", "0.5099558", "0.5075972", "0.50632983", "0.50600713", "0.50521797", "0.50447065", "0.5042792", "0.50343174", "0.50317985", "0.50217694", "0.5020742", "0.5018363", "0.5010249", "0.5009647", "0.50032616", "0.49965322", "0.499145", "0.49889192", "0.4981593", "0.498081", "0.4978031", "0.4964827", "0.4952005", "0.49450865", "0.49340272", "0.4915309", "0.4906749", "0.49016878", "0.48906916", "0.48899707", "0.48832446", "0.48752663", "0.4870207", "0.4859484", "0.48530033", "0.48528937", "0.48523062", "0.48478556", "0.4845782", "0.4843651", "0.48368013", "0.48270047", "0.48242435", "0.4820737", "0.48201805", "0.48201284", "0.48199007", "0.48136765", "0.4812566", "0.48117927", "0.48064512", "0.48032036", "0.48021674", "0.48007175", "0.47926483", "0.478966", "0.4787665", "0.47870368", "0.47794592", "0.4770345", "0.47677317", "0.476299", "0.4761509", "0.4756253", "0.47560036", "0.47522187", "0.4751923", "0.4745837" ]
0.586449
3
Grants a tablelevel permission to a user or role.
public GrantPermissionTableResponse grantPermissionTable(GrantPermissionTableRequest request) throws GPUdbException { GrantPermissionTableResponse actualResponse_ = new GrantPermissionTableResponse(); submitRequest("/grant/permission/table", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "protected void grantPrivileges() {\n if (!PRIVILEGES_FEATURE_ENABLED.contains(dbType)) {\n return;\n }\n\n // The case where all are to be granted on the default schemas.\n if (!(updateFhirSchema || grantFhirSchema || updateOauthSchema\n || grantOauthSchema || updateJavaBatchSchema || grantJavaBatchSchema)) {\n grantOauthSchema = true;\n grantFhirSchema = true;\n grantJavaBatchSchema = true;\n }\n\n // Build/update the tables as well as the stored procedures\n PhysicalDataModel pdm = new PhysicalDataModel();\n buildCommonModel(pdm, updateFhirSchema || grantFhirSchema, updateOauthSchema || grantOauthSchema,\n updateJavaBatchSchema || grantJavaBatchSchema);\n\n final IDatabaseAdapter adapter = getDbAdapter(dbType, connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n try {\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_USER_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_BATCH_GRANT_GROUP, grantTo);\n } catch (DataAccessException x) {\n // Something went wrong, so mark the transaction as failed\n tx.setRollbackOnly();\n throw x;\n }\n }\n }", "public TableRole getTableRole();", "@Test(dependsOnMethods = \"testRoleAdd\", groups = \"role\", priority = 1)\n public void testRoleGrantPermission() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient\n .roleGrantPermission(rootRole, rootRolekeyRangeBegin, rootkeyRangeEnd,\n Permission.Type.READWRITE).get();\n this.authDisabledAuthClient\n .roleGrantPermission(userRole, userRolekeyRangeBegin, userRolekeyRangeEnd, Type.READWRITE)\n .get();\n }", "private void createRolePermissionsTableIfNotExist() {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n conn.setAutoCommit(false);\n query = queryManager.getQuery(conn, QueryManager.CREATE_ROLE_PERMISSIONS_TABLE_QUERY);\n ps = conn.prepareStatement(query);\n ps.executeUpdate();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to create the '\" + QueryManager.ROLE_PERMISSIONS_TABLE +\n \"' table.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public GrantPermissionTableResponse grantPermissionTable(String name, String permission, String tableName, String filterExpression, Map<String, String> options) throws GPUdbException {\n GrantPermissionTableRequest actualRequest_ = new GrantPermissionTableRequest(name, permission, tableName, filterExpression, options);\n GrantPermissionTableResponse actualResponse_ = new GrantPermissionTableResponse();\n submitRequest(\"/grant/permission/table\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void addPermission(T object, Permission permission, User user);", "@Override\n public void grantPrivileges(String sessID, String name, UserLevel level) throws SQLException, SessionExpiredException {\n PooledConnection conn = ConnectionController.connectPooled(sessID);\n try {\n String dbName = ConnectionController.getDBName(sessID);\n LOG.info(\"Granting \" + level + \" privileges to \" + name + \" on \" + dbName + \"...\");\n switch (level) {\n case ADMIN:\n conn.executePreparedUpdate(\"GRANT ALTER, RELOAD, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, CREATE USER, DELETE, DROP, FILE, GRANT OPTION, INSERT, SELECT, UPDATE ON *.* TO ?\", name);\n conn.executePreparedUpdate(String.format(\"GRANT GRANT OPTION ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT ALTER, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, DELETE, DROP, INSERT, SELECT, UPDATE ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.db TO ?\", name);\n break;\n case USER:\n conn.executePreparedUpdate(String.format(\"GRANT CREATE TEMPORARY TABLES, SELECT ON %s.* TO ?\", dbName), name);\n\n //grant read/write/delete on region sets.\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set_membership TO ?\", dbName), name);\n\n //Grant read/write/delete on cohorts.\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort_membership TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n break;\n case GUEST:\n conn.executePreparedUpdate(String.format(\"GRANT SELECT ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.server_log TO ?\", dbName), name);\n // Grant permissions to write comments\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.variant_starred TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n\n break;\n }\n\n SettingsManager.getInstance().addSetting(sessID, DATABASE_USER_KEY_PREFIX + name, level.name());\n LOG.info(\"... granted.\");\n } catch (Exception ex) {\n LOG.error(\"Problem creating user\", ex);\n throw new SQLException(\"Can't setup privileges for user \" + name, ex);\n } finally {\n conn.executeQuery(\"FLUSH PRIVILEGES\");\n conn.close();\n }\n }", "void grant(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n n |= rights;\n\n rightsMap.put(dbobject, n);\n }", "int insertSelective(RolePermission record);", "public boolean hasPermission(T object, Permission permission, User user);", "public void grantAdministrate(User user) throws ServiceException{\n }", "void check(Permission permission, DBObject dBObject) throws T2DBException;", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "public void addPermission(T object, Permission permission);", "int insertSelective(TUserPermission record);", "boolean check(Permission permission, DBObject dBObject,\n\t\t\tboolean permissionRequired) throws T2DBException;", "@Override\n\tpublic void grant(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public synchronized void grantAdminPrivilege(UserEntity userEntity) {\n final PrivilegeEntity adminPrivilege = new PrivilegeEntity();\n adminPrivilege.setPermission(permissionDAO.findAmbariAdminPermission());\n adminPrivilege.setPrincipal(userEntity.getPrincipal());\n adminPrivilege.setResource(resourceDAO.findAmbariResource());\n if (!userEntity.getPrincipal().getPrivileges().contains(adminPrivilege)) {\n privilegeDAO.create(adminPrivilege);\n userEntity.getPrincipal().getPrivileges().add(adminPrivilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n }\n }", "boolean check(Permission permission, Surrogate surrogate, boolean permissionRequired) throws T2DBException;", "String[] listGrantedTablePrivileges(HsqlName name) {\n return GranteeManager.getRightsArray(rightsMap.get(name, 0));\n }", "public void setLevel(Level level) throws SQLException\r\n\t{\r\n\t\tif (level == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString SQL_USER = \"UPDATE user SET level =? 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.setString(1, level.name());\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->setLevel(Level \"+ level.name() + \")\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\r\n\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}", "int insertSelective(SysRoleUser record);", "int insertSelective(PlatformAdminRoleUser record);", "public void grantPermission(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "void changePermissions(Training training, User user, Permission permission, String token) throws AuthenticationException;", "@Test\n\tpublic void testIsPermitted_5()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "void setPermission(String perm, boolean add);", "void addRoleToUser(int userID,int roleID);", "protected void grantAdminAuthority( ApplicationContext ctx ) {\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n // Grant all roles to test user.\n TestingAuthenticationToken token = new TestingAuthenticationToken( \"administrator\", \"administrator\",\n new GrantedAuthority[] { new GrantedAuthorityImpl( \"GROUP_ADMIN\" ) } );\n\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "void permissionGranted(int requestCode);", "int insertSelective(SysRoleFunction record);", "@Test\n\tpublic void testIsPermitted_9()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "int insert(TUserPermission record);", "@Test\n\tpublic void testIsPermitted_6()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n\tpublic void testIsPermitted_7()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "void requestNeededPermissions(int requestCode);", "@Override\n public boolean userCanAccess(int id) {\n return true;\n }", "int insert(RolePermission record);", "private void fillRoleTable() {\n try (Connection connection = this.getConnection();\n Statement statement = connection.createStatement();\n PreparedStatement ps = connection.prepareStatement(INIT.FILL_ROLES.toString())) {\n ResultSet rs = statement.executeQuery(INIT.GET_ALL_ROLES.toString());\n if(!rs.next()) {\n connection.setAutoCommit(false);\n ps.setString(1, \"user\");\n ps.setString(2, \"No permissions\");\n ps.addBatch();\n ps.setString(1, \"moderator\");\n ps.setString(2, \"Some permissions\");\n ps.addBatch();\n ps.setString(1, \"admin\");\n ps.setString(2, \"All permissions\");\n ps.addBatch();\n ps.executeBatch();\n connection.commit();\n connection.setAutoCommit(true);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "public synchronized void grantAdminPrivilege(Integer userId) {\n grantAdminPrivilege(userDAO.findByPK(userId));\n }", "@Test\n\tpublic void testIsPermitted_8()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(null);\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public abstract boolean canEditAccessRights(OwObject object_p) throws Exception;", "public void grantRole(String roleName, User user) throws UserManagementException;", "public static void requireSuperAdmin() throws InsufficientPrivilegeException {\n Principal principal = PrincipalContext.getPrincipal();\n if (principal == null) {\n throw new InsufficientPrivilegeException();\n }\n List<RoleType> roles = principal.getRoles();\n assertContainRole(roles, RoleType.SUPER_ADMIN);\n }", "public static void addGuestMemberPermission(String permission)\r\n throws CreateException, DatabaseException, ForeignKeyNotFoundException {\r\n \r\n MemberXML.addGuestMemberPermission(permission);\r\n }", "public void insertSelective(UserPermission record) {\n\t\tgetSqlMapClientTemplate().insert(\"userpermission.insertSelective\",\n\t\t\t\trecord);\n\t}", "private GitLabFolderACL aclFromPermissionTable(Map<String, Object> tableData) {\n GitLabGrantedPermissions grantedPermissions = new GitLabGrantedPermissions();\n\n for (Entry<String, Object> identityPermission : tableData.entrySet()) {\n GitLabPermissionIdentity identity = null;\n String[] identityValue = identityPermission.getKey().split(\":\");\n\n if (identityValue.length == 2) {\n IdentityType type = IdentityType.valueOf(identityValue[0]);\n String id = identityValue[1];\n\n switch (type) {\n case GITLAB:\n identity = GitLabPermissionIdentity.getGitLabIdentityFromAccessLevel(\n GitLabAccessLevel.getAccessLevelWithName(id));\n break;\n case JENKINS:\n identity = GitLabPermissionIdentity.getJenkinsIdentityFromAccessLevel(\n JenkinsAccessLevel.getAccessLevelWithName(id));\n break;\n case GROUP:\n identity = GitLabPermissionIdentity.group(id);\n break;\n case USER:\n identity = GitLabPermissionIdentity.user(id);\n break;\n }\n }\n\n Map<String, Object> value = (JSONObject)identityPermission.getValue();\n\n for (Entry<String, Object> valueSet : value.entrySet()) {\n if ((Boolean)valueSet.getValue() && identity != null) {\n grantedPermissions.addPermission(identity, Permission.fromId(valueSet.getKey()));\n }\n }\n }\n\n return new GitLabFolderACL(grantedPermissions);\n }", "UserPermissionsType createUserPermissionsType();", "@Test\n\t// Delivery 2 Use Case 1. Grant/Deny Access to commands based on profile's role\n\tpublic void test() {\n\n\t\tUsers user1 = new Users(\"Test1\", \"PARENT\");\n\t\tUsers user2 = new Users(\"Test2\", \"STRANGER\");\n\t\tUsers user3 = new Users(\"Test3\", \"CHILDREN\");\n\t\tUsers user4 = new Users(\"Test4\", \"GUEST\");\n\n\t\t// Checking if users have permissions\n\t\tassertEquals(\"PARENT\", user1.getPermission());\n\t\tassertEquals(\"STRANGER\", user2.getPermission());\n\t\tassertEquals(\"CHILDREN\", user3.getPermission());\n\t\tassertEquals(\"GUEST\", user4.getPermission());\n\n\t}", "@Override\n public boolean hasAccessPermission(String user, NamespaceKey key, DatasetConfig datasetConfig) {\n return userPredicate.test(user);\n }", "boolean makeAdmin(User user);", "void check(Object dbobject, int rights) throws HsqlException {\n Trace.check(isAccessible(dbobject, rights), Trace.ACCESS_IS_DENIED);\n }", "@Test\n\tpublic void testCheckPermission_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tfixture.checkPermission(permission);\n\n\t\t// add additional test code here\n\t}", "boolean memberHasPermission(String perm, Member m);", "boolean isAccessible(Object dbobject, int rights) throws HsqlException {\n\n /*\n * The deep recusion is all done in getAllRoles(). This method\n * only recurses one level into isDirectlyAccessible().\n */\n if (isDirectlyAccessible(dbobject, rights)) {\n return true;\n }\n\n if (pubGrantee != null && pubGrantee.isAccessible(dbobject, rights)) {\n return true;\n }\n\n RoleManager rm = getRoleManager();\n Iterator it = getAllRoles().iterator();\n\n while (it.hasNext()) {\n if (((Grantee) rm.getGrantee(\n (String) it.next())).isDirectlyAccessible(\n dbobject, rights)) {\n return true;\n }\n }\n\n return false;\n }", "void check(Permission permission, Surrogate surrogate) throws T2DBException;", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "public void grantOper2Role(final Role role, final String operId);", "int insertSelective(GroupRoleUserRel record);", "public void grantPermission(Permission permission, Role role) {\n List<Role> roles = new ArrayList<>();\n roles.add(role);\n if (hasPermission(roles, permission)) {\n return;\n }\n\n Connection conn = null;\n PreparedStatement ps = null;\n String uuid = PermissionUtil.createPermissionID(permission);\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.GRANT_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, uuid);\n ps.setString(2, permission.getAppName());\n ps.setString(3, permission.getPermissionString());\n ps.setString(4, role.getId());\n ps.executeUpdate();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to grant permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void insert(UserPermission record) {\n\t\tgetSqlMapClientTemplate().insert(\"userpermission.insert\", record);\n\t}", "public interface PermissionChecker {\n\n\t/**\n\t * Check if a permission is available on a database object. Depending on\n\t * <code>permissionRequired</code> throw an exception or return false on\n\t * failure.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param dBObject\n\t * a database object\n\t * @param permissionRequired\n\t * if true throw an exception on failure else return false\n\t * @return true if the permission is available, else false\n\t * @throws T2DBException\n\t */\n\tboolean check(Permission permission, DBObject dBObject,\n\t\t\tboolean permissionRequired) throws T2DBException;\n\n\t/**\n\t * Check if a permission is available on a database object. Throw an\n\t * exception if not.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param dBObject\n\t * a database object\n\t * @throws T2DBException\n\t */\n\tvoid check(Permission permission, DBObject dBObject) throws T2DBException;\n\t\n\t/**\n\t * Check if a permission is available on a database object. Depending on\n\t * <code>permissionRequired</code> throw an exception or return false on\n\t * failure.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param surrogate\n\t * a surrogate identifying a database object\n\t * @param permissionRequired\n\t * if true throw an exception on failure else return false\n\t * @return true if the permission is available, else false\n\t * @throws T2DBException\n\t */\n\tboolean check(Permission permission, Surrogate surrogate, boolean permissionRequired) throws T2DBException;\n\n\t/**\n\t * Check if a permission is available on a database object. Throw an\n\t * exception if not.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param surrogate\n\t * if true throw an exception on failure else return false\n\t * @throws T2DBException\n\t */\n\tvoid check(Permission permission, Surrogate surrogate) throws T2DBException;\n\t\n}", "@Override\n public void setRequiredActions(KeycloakSession session, RealmModel realm, UserModel user) {\n }", "@Override\n public void setParent(InheritedAccessEnabled newAccess, InheritedAccessEnabled parentAccess,\n Role role) {\n ((Preference) (newAccess)).setVisibleAtRole(role);\n }", "@Test\n\tpublic void testIsPermitted_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public void addEditorRoleToIndividualAcl(Individual i);", "@Test\n\tpublic void testIsPermitted_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = null;\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "void add(User user) throws AccessControlException;", "public static void addMemberPermission(String username, String permission)\r\n throws ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException {\r\n \r\n MemberXML.addMemberPermission(username, permission);\r\n }", "private static boolean hasPermission(String username, Permission requiredPermission) throws IOException, SQLException {\n ArrayList<Boolean> userPermissions = retrieveUserPermissionsFromDb(username);\n switch (requiredPermission) {\n case CreateBillboard:\n if (userPermissions.get(0)) return true;\n return false;\n case EditBillboard:\n if (userPermissions.get(1)) return true;\n return false;\n case ScheduleBillboard:\n if (userPermissions.get(2)) return true;\n return false;\n case EditUser:\n if (userPermissions.get(3)) return true;\n return false;\n default:\n return false; // Default to false if permission cannot be identified\n }\n }", "@Override\r\n\tpublic int insertRoleandPermission(AdminRoleandpermission record) {\n\t\treturn adminRoleandpermissionDao.insert(record);\r\n\t}", "@Override\r\n protected void mayProceed() throws InsufficientPermissionException {\n if (ub.isSysAdmin() || ub.isTechAdmin()) {\r\n return;\r\n }\r\n// if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) {// ?\r\n// ?\r\n// return;\r\n// }\r\n\r\n addPageMessage(respage.getString(\"no_have_correct_privilege_current_study\") + respage.getString(\"change_study_contact_sysadmin\"));\r\n throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString(\"not_allowed_access_extract_data_servlet\"), \"1\");// TODO\r\n // above copied from create dataset servlet, needs to be changed to\r\n // allow only admin-level users\r\n\r\n }", "public void createIndividualAcl(Individual i);", "int insertSelective(SysRole record);", "@Override\n\tpublic Users checkRole(String t) {\n\t\treturn genericDAO.checkRole(t);\n\t}", "public void loadPermissionLevel(final Layer model) {\r\n \t\tif(model != null) {\t\t\t\r\n \t\t\tUserData currentUser = authenticationController.getLoggedInUser();\r\n \t\t\tif(currentUser != null) {\r\n \t\t\t\tAclUtils.getHighestPermissionLevel(NodeType.LAYER, model.getId(), nodeService, new AsyncCallback<PermissionLevel>() {\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onSuccess(PermissionLevel result) {\r\n \t\t\t\t\t\tiisAdministrator = false;\r\n \t\t\t\t\t\tccanEdit = false;\r\n \t\t\t\t\t\tif(result == PermissionLevel.CAN_EDIT) {\r\n \t\t\t\t\t\t\tccanEdit = true;\r\n \t\t\t\t\t\t} else if(result == PermissionLevel.CAN_ADMINISTER) {\r\n \t\t\t\t\t\t\tccanEdit = true;\r\n \t\t\t\t\t\t\tiisAdministrator = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tsetLayerDetails(model, iisAdministrator, ccanEdit);\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onFailure(Throwable caught) {\t\t\t\t\r\n \t\t\t\t\t\tview.showErrorMessage(DisplayConstants.ERROR_GETTING_PERMISSIONS_TEXT);\r\n \t\t\t\t\t\tiisAdministrator = false;\r\n \t\t\t\t\t\tccanEdit = false;\r\n \t\t\t\t\t\tsetLayerDetails(model, iisAdministrator, ccanEdit);\r\n \t\t\t\t\t}\t\t\t\r\n \t\t\t\t});\r\n \t\t\t} else {\r\n \t\t\t\t// because this is a public page, they can view\r\n \t\t\t\tiisAdministrator = false;\r\n \t\t\t\tccanEdit = false;\r\n \t\t\t\tsetLayerDetails(model, iisAdministrator, ccanEdit);\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t}", "void checkPermission(T request) throws AuthorizationException;", "int updateByPrimaryKeySelective(SysRoleUser record);", "public void allowAllPermissionsToUser(String messageBoxId, String user)\n throws MessageBoxException {\n try {\n\n // if there is no role with this role add the role and assign the role to the user\n UserStoreManager userStoreManager = Utils.getUserRelam().getUserStoreManager();\n if (!userStoreManager.isExistingRole(user)){\n userStoreManager.addRole(user, new String[]{user}, new Permission[0]);\n }\n \n AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();\n\n String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + \"/\" +\n messageBoxId;\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_DELETE_MESSAGE);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_CHANGE_MESSAGE_VISIBILITY);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_GET_QUEUE_ATTRIBUTES);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_RECEIVE_MESSAGE);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_SEND_MESSAGE);\n\n } catch (UserStoreException e) {\n String error = \"Failed to allow permissions to user \" + user + \" for message box \" + messageBoxId;\n log.error(error);\n throw new MessageBoxException(error, e);\n }\n }", "public boolean hasPermission(String permission)\n throws Exception\n {\n Permission permissionObject = null;\n try\n {\n permissionObject = securityService.getPermissionManager().getPermissionByName(permission);\n }\n catch (UnknownEntityException e)\n {\n if(initialize)\n {\n permissionObject = securityService.getPermissionManager().getPermissionInstance(permission);\n securityService.getPermissionManager().addPermission(permissionObject);\n\n Role role = null;\n TurbineAccessControlList<?> acl = data.getACL();\n RoleSet roles = acl.getRoles();\n if(roles.size() > 0)\n {\n\t\t\t\t\trole = roles.toArray(new Role[0])[0];\n\t\t\t\t}\n\n if(role == null)\n {\n /*\n * The User within data has no roles yet, let us grant the permission\n * to the first role available through SecurityService.\n */\n roles = securityService.getRoleManager().getAllRoles();\n if(roles.size() > 0)\n {\n\t\t\t\t\t\trole = roles.toArray(new Role[0])[0];\n\t\t\t\t\t}\n }\n\n if(role != null)\n {\n /*\n * If we have no role, there is nothing we can do about it. So only grant it,\n * if we have a role to grant it to.\n */\n TurbineModelManager modelManager = (TurbineModelManager)securityService.getModelManager();\n modelManager.grant(role, permissionObject);\n }\n }\n else\n {\n throw(e);\n }\n }\n\n return hasPermission(permissionObject);\n }", "abstract public void getPermission();", "@Test\n\tpublic void testCheckPermissions_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "int setCanStatus(int canRegno, int action);", "@Override\n protected String requiredGetPermission() {\n return \"user\";\n }", "int insertSelective(UUserRole record);", "protected void loadSectionPermissions(ActionRequest req, SmarttrakRoleVO role) throws AuthorizationException {\n\t\tAccountPermissionAction apa = new AccountPermissionAction();\n\t\tapa.setDBConnection((SMTDBConnection)getAttribute(DB_CONN));\n\t\tapa.setAttributes(getInitVals());\n\t\ttry {\n\t\t\t//retrieve the permission tree for this account\n\t\t\tapa.retrieve(req);\n\t\t\tModuleVO mod = (ModuleVO) apa.getAttribute(Constants.MODULE_DATA);\n\t\t\tSmarttrakTree t = (SmarttrakTree) mod.getActionData();\n\n\t\t\t//iterate the nodes and attach parent level tokens to each, at each level. spine. spine~bone. spine~bone~fragment. etc.\n\t\t\tt.buildNodePaths();\n\n\t\t\t//attach the list of permissions to the user's role object\n\t\t\trole.setAccountRoles(t.preorderList());\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new AuthorizationException(\"could not load Smartrak permissions\", e);\n\t\t}\n\t\tlog.debug(\"loaded \" + role.getAccountRoles().size() + \" account permissions into the roleVO\");\n\t}", "int updateByPrimaryKeySelective(PlatformAdminRoleUser record);", "@Override\n public void checkPermission(Permission perm) {\n }", "boolean isDirectlyAccessible(Object dbobject,\n int rights) throws HsqlException {\n\n if (isAdministrator) {\n return true;\n }\n\n if (dbobject instanceof String) {\n if (((String) dbobject).startsWith(\"org.hsqldb.Library\")\n || ((String) dbobject).startsWith(\"java.lang.Math\")) {\n return true;\n }\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n != 0) {\n return (n & rights) != 0;\n }\n\n return false;\n }", "public int checkLevel(int level, String requestTask) {\n\t\tint ret = 1;\n\t\tswitch(requestTask) {\n\t\tcase \"add\":\n\t\t\tif(level == 2)\n\t\t\t\tret = 1;\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\tcase \"modify\":\n\t\t\tif(level == 3)\n\t\t\t\tret = 1;\n\t\t}\n\t\treturn ret;\n\t}", "@Override\n\tpublic void apply( final ApplyFn fn ) throws AccessDeniedException;", "@Override\n protected String requiredDeletePermission() {\n return \"admin\";\n }", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "@Override\n\tpublic void modifierUser(User c) {\n\t\t\n\t}", "public void addPrivileges(int privilege, String... roleList) {\r\n\t\tif (null != roleList) {\r\n\t\t\tif (null == privileges)\r\n\t\t\t\tprivileges = new HashMap<Integer, Set<String>>();\r\n\t\t\tSet<String> roles = privileges.get(privilege);\r\n\t\t\tif (null == roles) {\r\n\t\t\t\troles = new HashSet<String>();\r\n\t\t\t\tprivileges.put(privilege, roles);\r\n\t\t\t}\r\n\t\t\tfor (String role : roleList)\r\n\t\t\t\troles.add(role);\r\n\t\t}\r\n\t}", "int insert(PlatformAdminRoleUser record);", "@Override\r\n\tpublic AdminRole selectPermissionsByroleID(int roleid) {\n\t\treturn adminRoleDao.selectPermissionsByroleID(roleid);\r\n\t}", "private void copyRoleAccess(InheritedAccessEnabled parentAccess, Role role,\n AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n // copy the new access\n final InheritedAccessEnabled newAccess = (InheritedAccessEnabled) DalUtil.copy(\n (BaseOBObject) parentAccess, false);\n injector.setParent(newAccess, parentAccess, role);\n newAccess.setInheritedFrom(injector.getRole(parentAccess));\n OBDal.getInstance().save(newAccess);\n } finally {\n OBContext.restorePreviousMode();\n }\n }" ]
[ "0.56306934", "0.5565354", "0.5491463", "0.5461215", "0.5423845", "0.53027135", "0.5210587", "0.51806647", "0.51361084", "0.50486827", "0.50237733", "0.5014636", "0.5000765", "0.4958094", "0.4955476", "0.4934473", "0.49234784", "0.4918136", "0.49132958", "0.4868854", "0.48609245", "0.4856425", "0.48337072", "0.48303", "0.48116988", "0.47933498", "0.47825015", "0.47653243", "0.47626704", "0.47610027", "0.4758633", "0.4744533", "0.4741797", "0.4724777", "0.47247738", "0.47097784", "0.47069374", "0.47010782", "0.4699361", "0.4693225", "0.4677399", "0.46663392", "0.46650836", "0.46545154", "0.46521038", "0.4648663", "0.46443573", "0.46216074", "0.4603314", "0.45992267", "0.45969588", "0.4596644", "0.45883456", "0.45706213", "0.4569963", "0.45683762", "0.4566103", "0.45558247", "0.45517907", "0.4539608", "0.45394078", "0.45385054", "0.45359305", "0.4525369", "0.45225337", "0.45144224", "0.45101416", "0.45089728", "0.45064712", "0.45049328", "0.44977176", "0.44955066", "0.44843307", "0.44830072", "0.44810227", "0.4479496", "0.44762346", "0.44686598", "0.4459688", "0.44554782", "0.44550738", "0.4452903", "0.44514295", "0.44467115", "0.44428185", "0.44264323", "0.44161537", "0.4415531", "0.44141522", "0.4410427", "0.44090578", "0.44073686", "0.4406965", "0.44045487", "0.4403523", "0.44032857", "0.44028902", "0.43985823", "0.43956017", "0.43945885" ]
0.5767975
0
Grants a tablelevel permission to a user or role.
public GrantPermissionTableResponse grantPermissionTable(String name, String permission, String tableName, String filterExpression, Map<String, String> options) throws GPUdbException { GrantPermissionTableRequest actualRequest_ = new GrantPermissionTableRequest(name, permission, tableName, filterExpression, options); GrantPermissionTableResponse actualResponse_ = new GrantPermissionTableResponse(); submitRequest("/grant/permission/table", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GrantPermissionTableResponse grantPermissionTable(GrantPermissionTableRequest request) throws GPUdbException {\n GrantPermissionTableResponse actualResponse_ = new GrantPermissionTableResponse();\n submitRequest(\"/grant/permission/table\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "protected void grantPrivileges() {\n if (!PRIVILEGES_FEATURE_ENABLED.contains(dbType)) {\n return;\n }\n\n // The case where all are to be granted on the default schemas.\n if (!(updateFhirSchema || grantFhirSchema || updateOauthSchema\n || grantOauthSchema || updateJavaBatchSchema || grantJavaBatchSchema)) {\n grantOauthSchema = true;\n grantFhirSchema = true;\n grantJavaBatchSchema = true;\n }\n\n // Build/update the tables as well as the stored procedures\n PhysicalDataModel pdm = new PhysicalDataModel();\n buildCommonModel(pdm, updateFhirSchema || grantFhirSchema, updateOauthSchema || grantOauthSchema,\n updateJavaBatchSchema || grantJavaBatchSchema);\n\n final IDatabaseAdapter adapter = getDbAdapter(dbType, connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n try {\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_USER_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, grantTo);\n pdm.applyGrants(adapter, FhirSchemaConstants.FHIR_BATCH_GRANT_GROUP, grantTo);\n } catch (DataAccessException x) {\n // Something went wrong, so mark the transaction as failed\n tx.setRollbackOnly();\n throw x;\n }\n }\n }", "public TableRole getTableRole();", "@Test(dependsOnMethods = \"testRoleAdd\", groups = \"role\", priority = 1)\n public void testRoleGrantPermission() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient\n .roleGrantPermission(rootRole, rootRolekeyRangeBegin, rootkeyRangeEnd,\n Permission.Type.READWRITE).get();\n this.authDisabledAuthClient\n .roleGrantPermission(userRole, userRolekeyRangeBegin, userRolekeyRangeEnd, Type.READWRITE)\n .get();\n }", "private void createRolePermissionsTableIfNotExist() {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n conn.setAutoCommit(false);\n query = queryManager.getQuery(conn, QueryManager.CREATE_ROLE_PERMISSIONS_TABLE_QUERY);\n ps = conn.prepareStatement(query);\n ps.executeUpdate();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to create the '\" + QueryManager.ROLE_PERMISSIONS_TABLE +\n \"' table.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void addPermission(T object, Permission permission, User user);", "@Override\n public void grantPrivileges(String sessID, String name, UserLevel level) throws SQLException, SessionExpiredException {\n PooledConnection conn = ConnectionController.connectPooled(sessID);\n try {\n String dbName = ConnectionController.getDBName(sessID);\n LOG.info(\"Granting \" + level + \" privileges to \" + name + \" on \" + dbName + \"...\");\n switch (level) {\n case ADMIN:\n conn.executePreparedUpdate(\"GRANT ALTER, RELOAD, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, CREATE USER, DELETE, DROP, FILE, GRANT OPTION, INSERT, SELECT, UPDATE ON *.* TO ?\", name);\n conn.executePreparedUpdate(String.format(\"GRANT GRANT OPTION ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT ALTER, CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, DELETE, DROP, INSERT, SELECT, UPDATE ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT ON mysql.db TO ?\", name);\n break;\n case USER:\n conn.executePreparedUpdate(String.format(\"GRANT CREATE TEMPORARY TABLES, SELECT ON %s.* TO ?\", dbName), name);\n\n //grant read/write/delete on region sets.\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT SELECT,INSERT,UPDATE,DELETE ON %s.region_set_membership TO ?\", dbName), name);\n\n //Grant read/write/delete on cohorts.\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort TO ?\", dbName), name);\n conn.executePreparedUpdate(String.format(\"GRANT INSERT,SELECT,UPDATE,DELETE ON %s.cohort_membership TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n break;\n case GUEST:\n conn.executePreparedUpdate(String.format(\"GRANT SELECT ON %s.* TO ?\", dbName), name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_user_priv) ON mysql.user TO ?\", name);\n conn.executePreparedUpdate(\"GRANT SELECT (user, Create_tmp_table_priv) ON mysql.db TO ?\", name);\n\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.server_log TO ?\", dbName), name);\n // Grant permissions to write comments\n conn.executePreparedUpdate(String.format(\"GRANT INSERT ON %s.variant_starred TO ?\", dbName), name);\n\n conn.executePreparedUpdate(\"GRANT FILE ON *.* TO ?\", name);\n\n break;\n }\n\n SettingsManager.getInstance().addSetting(sessID, DATABASE_USER_KEY_PREFIX + name, level.name());\n LOG.info(\"... granted.\");\n } catch (Exception ex) {\n LOG.error(\"Problem creating user\", ex);\n throw new SQLException(\"Can't setup privileges for user \" + name, ex);\n } finally {\n conn.executeQuery(\"FLUSH PRIVILEGES\");\n conn.close();\n }\n }", "void grant(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n n |= rights;\n\n rightsMap.put(dbobject, n);\n }", "int insertSelective(RolePermission record);", "public boolean hasPermission(T object, Permission permission, User user);", "public void grantAdministrate(User user) throws ServiceException{\n }", "void check(Permission permission, DBObject dBObject) throws T2DBException;", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "public void addPermission(T object, Permission permission);", "int insertSelective(TUserPermission record);", "boolean check(Permission permission, DBObject dBObject,\n\t\t\tboolean permissionRequired) throws T2DBException;", "@Override\n\tpublic void grant(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public synchronized void grantAdminPrivilege(UserEntity userEntity) {\n final PrivilegeEntity adminPrivilege = new PrivilegeEntity();\n adminPrivilege.setPermission(permissionDAO.findAmbariAdminPermission());\n adminPrivilege.setPrincipal(userEntity.getPrincipal());\n adminPrivilege.setResource(resourceDAO.findAmbariResource());\n if (!userEntity.getPrincipal().getPrivileges().contains(adminPrivilege)) {\n privilegeDAO.create(adminPrivilege);\n userEntity.getPrincipal().getPrivileges().add(adminPrivilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n }\n }", "boolean check(Permission permission, Surrogate surrogate, boolean permissionRequired) throws T2DBException;", "String[] listGrantedTablePrivileges(HsqlName name) {\n return GranteeManager.getRightsArray(rightsMap.get(name, 0));\n }", "public void setLevel(Level level) throws SQLException\r\n\t{\r\n\t\tif (level == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString SQL_USER = \"UPDATE user SET level =? 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.setString(1, level.name());\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->setLevel(Level \"+ level.name() + \")\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\r\n\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}", "int insertSelective(SysRoleUser record);", "int insertSelective(PlatformAdminRoleUser record);", "public void grantPermission(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "void changePermissions(Training training, User user, Permission permission, String token) throws AuthenticationException;", "@Test\n\tpublic void testIsPermitted_5()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "void setPermission(String perm, boolean add);", "void addRoleToUser(int userID,int roleID);", "protected void grantAdminAuthority( ApplicationContext ctx ) {\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n // Grant all roles to test user.\n TestingAuthenticationToken token = new TestingAuthenticationToken( \"administrator\", \"administrator\",\n new GrantedAuthority[] { new GrantedAuthorityImpl( \"GROUP_ADMIN\" ) } );\n\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "void permissionGranted(int requestCode);", "int insertSelective(SysRoleFunction record);", "@Test\n\tpublic void testIsPermitted_9()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "int insert(TUserPermission record);", "@Test\n\tpublic void testIsPermitted_6()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n\tpublic void testIsPermitted_7()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "void requestNeededPermissions(int requestCode);", "@Override\n public boolean userCanAccess(int id) {\n return true;\n }", "int insert(RolePermission record);", "private void fillRoleTable() {\n try (Connection connection = this.getConnection();\n Statement statement = connection.createStatement();\n PreparedStatement ps = connection.prepareStatement(INIT.FILL_ROLES.toString())) {\n ResultSet rs = statement.executeQuery(INIT.GET_ALL_ROLES.toString());\n if(!rs.next()) {\n connection.setAutoCommit(false);\n ps.setString(1, \"user\");\n ps.setString(2, \"No permissions\");\n ps.addBatch();\n ps.setString(1, \"moderator\");\n ps.setString(2, \"Some permissions\");\n ps.addBatch();\n ps.setString(1, \"admin\");\n ps.setString(2, \"All permissions\");\n ps.addBatch();\n ps.executeBatch();\n connection.commit();\n connection.setAutoCommit(true);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "public synchronized void grantAdminPrivilege(Integer userId) {\n grantAdminPrivilege(userDAO.findByPK(userId));\n }", "@Test\n\tpublic void testIsPermitted_8()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(null);\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public abstract boolean canEditAccessRights(OwObject object_p) throws Exception;", "public void grantRole(String roleName, User user) throws UserManagementException;", "public static void requireSuperAdmin() throws InsufficientPrivilegeException {\n Principal principal = PrincipalContext.getPrincipal();\n if (principal == null) {\n throw new InsufficientPrivilegeException();\n }\n List<RoleType> roles = principal.getRoles();\n assertContainRole(roles, RoleType.SUPER_ADMIN);\n }", "public static void addGuestMemberPermission(String permission)\r\n throws CreateException, DatabaseException, ForeignKeyNotFoundException {\r\n \r\n MemberXML.addGuestMemberPermission(permission);\r\n }", "public void insertSelective(UserPermission record) {\n\t\tgetSqlMapClientTemplate().insert(\"userpermission.insertSelective\",\n\t\t\t\trecord);\n\t}", "private GitLabFolderACL aclFromPermissionTable(Map<String, Object> tableData) {\n GitLabGrantedPermissions grantedPermissions = new GitLabGrantedPermissions();\n\n for (Entry<String, Object> identityPermission : tableData.entrySet()) {\n GitLabPermissionIdentity identity = null;\n String[] identityValue = identityPermission.getKey().split(\":\");\n\n if (identityValue.length == 2) {\n IdentityType type = IdentityType.valueOf(identityValue[0]);\n String id = identityValue[1];\n\n switch (type) {\n case GITLAB:\n identity = GitLabPermissionIdentity.getGitLabIdentityFromAccessLevel(\n GitLabAccessLevel.getAccessLevelWithName(id));\n break;\n case JENKINS:\n identity = GitLabPermissionIdentity.getJenkinsIdentityFromAccessLevel(\n JenkinsAccessLevel.getAccessLevelWithName(id));\n break;\n case GROUP:\n identity = GitLabPermissionIdentity.group(id);\n break;\n case USER:\n identity = GitLabPermissionIdentity.user(id);\n break;\n }\n }\n\n Map<String, Object> value = (JSONObject)identityPermission.getValue();\n\n for (Entry<String, Object> valueSet : value.entrySet()) {\n if ((Boolean)valueSet.getValue() && identity != null) {\n grantedPermissions.addPermission(identity, Permission.fromId(valueSet.getKey()));\n }\n }\n }\n\n return new GitLabFolderACL(grantedPermissions);\n }", "UserPermissionsType createUserPermissionsType();", "@Test\n\t// Delivery 2 Use Case 1. Grant/Deny Access to commands based on profile's role\n\tpublic void test() {\n\n\t\tUsers user1 = new Users(\"Test1\", \"PARENT\");\n\t\tUsers user2 = new Users(\"Test2\", \"STRANGER\");\n\t\tUsers user3 = new Users(\"Test3\", \"CHILDREN\");\n\t\tUsers user4 = new Users(\"Test4\", \"GUEST\");\n\n\t\t// Checking if users have permissions\n\t\tassertEquals(\"PARENT\", user1.getPermission());\n\t\tassertEquals(\"STRANGER\", user2.getPermission());\n\t\tassertEquals(\"CHILDREN\", user3.getPermission());\n\t\tassertEquals(\"GUEST\", user4.getPermission());\n\n\t}", "@Override\n public boolean hasAccessPermission(String user, NamespaceKey key, DatasetConfig datasetConfig) {\n return userPredicate.test(user);\n }", "boolean makeAdmin(User user);", "void check(Object dbobject, int rights) throws HsqlException {\n Trace.check(isAccessible(dbobject, rights), Trace.ACCESS_IS_DENIED);\n }", "@Test\n\tpublic void testCheckPermission_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tfixture.checkPermission(permission);\n\n\t\t// add additional test code here\n\t}", "boolean memberHasPermission(String perm, Member m);", "boolean isAccessible(Object dbobject, int rights) throws HsqlException {\n\n /*\n * The deep recusion is all done in getAllRoles(). This method\n * only recurses one level into isDirectlyAccessible().\n */\n if (isDirectlyAccessible(dbobject, rights)) {\n return true;\n }\n\n if (pubGrantee != null && pubGrantee.isAccessible(dbobject, rights)) {\n return true;\n }\n\n RoleManager rm = getRoleManager();\n Iterator it = getAllRoles().iterator();\n\n while (it.hasNext()) {\n if (((Grantee) rm.getGrantee(\n (String) it.next())).isDirectlyAccessible(\n dbobject, rights)) {\n return true;\n }\n }\n\n return false;\n }", "void check(Permission permission, Surrogate surrogate) throws T2DBException;", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "public void grantOper2Role(final Role role, final String operId);", "int insertSelective(GroupRoleUserRel record);", "public void grantPermission(Permission permission, Role role) {\n List<Role> roles = new ArrayList<>();\n roles.add(role);\n if (hasPermission(roles, permission)) {\n return;\n }\n\n Connection conn = null;\n PreparedStatement ps = null;\n String uuid = PermissionUtil.createPermissionID(permission);\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.GRANT_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, uuid);\n ps.setString(2, permission.getAppName());\n ps.setString(3, permission.getPermissionString());\n ps.setString(4, role.getId());\n ps.executeUpdate();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to grant permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void insert(UserPermission record) {\n\t\tgetSqlMapClientTemplate().insert(\"userpermission.insert\", record);\n\t}", "public interface PermissionChecker {\n\n\t/**\n\t * Check if a permission is available on a database object. Depending on\n\t * <code>permissionRequired</code> throw an exception or return false on\n\t * failure.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param dBObject\n\t * a database object\n\t * @param permissionRequired\n\t * if true throw an exception on failure else return false\n\t * @return true if the permission is available, else false\n\t * @throws T2DBException\n\t */\n\tboolean check(Permission permission, DBObject dBObject,\n\t\t\tboolean permissionRequired) throws T2DBException;\n\n\t/**\n\t * Check if a permission is available on a database object. Throw an\n\t * exception if not.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param dBObject\n\t * a database object\n\t * @throws T2DBException\n\t */\n\tvoid check(Permission permission, DBObject dBObject) throws T2DBException;\n\t\n\t/**\n\t * Check if a permission is available on a database object. Depending on\n\t * <code>permissionRequired</code> throw an exception or return false on\n\t * failure.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param surrogate\n\t * a surrogate identifying a database object\n\t * @param permissionRequired\n\t * if true throw an exception on failure else return false\n\t * @return true if the permission is available, else false\n\t * @throws T2DBException\n\t */\n\tboolean check(Permission permission, Surrogate surrogate, boolean permissionRequired) throws T2DBException;\n\n\t/**\n\t * Check if a permission is available on a database object. Throw an\n\t * exception if not.\n\t * \n\t * @param permission\n\t * a permission\n\t * @param surrogate\n\t * if true throw an exception on failure else return false\n\t * @throws T2DBException\n\t */\n\tvoid check(Permission permission, Surrogate surrogate) throws T2DBException;\n\t\n}", "@Override\n public void setRequiredActions(KeycloakSession session, RealmModel realm, UserModel user) {\n }", "@Override\n public void setParent(InheritedAccessEnabled newAccess, InheritedAccessEnabled parentAccess,\n Role role) {\n ((Preference) (newAccess)).setVisibleAtRole(role);\n }", "@Test\n\tpublic void testIsPermitted_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public void addEditorRoleToIndividualAcl(Individual i);", "@Test\n\tpublic void testIsPermitted_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = null;\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "void add(User user) throws AccessControlException;", "public static void addMemberPermission(String username, String permission)\r\n throws ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException {\r\n \r\n MemberXML.addMemberPermission(username, permission);\r\n }", "private static boolean hasPermission(String username, Permission requiredPermission) throws IOException, SQLException {\n ArrayList<Boolean> userPermissions = retrieveUserPermissionsFromDb(username);\n switch (requiredPermission) {\n case CreateBillboard:\n if (userPermissions.get(0)) return true;\n return false;\n case EditBillboard:\n if (userPermissions.get(1)) return true;\n return false;\n case ScheduleBillboard:\n if (userPermissions.get(2)) return true;\n return false;\n case EditUser:\n if (userPermissions.get(3)) return true;\n return false;\n default:\n return false; // Default to false if permission cannot be identified\n }\n }", "@Override\r\n\tpublic int insertRoleandPermission(AdminRoleandpermission record) {\n\t\treturn adminRoleandpermissionDao.insert(record);\r\n\t}", "@Override\r\n protected void mayProceed() throws InsufficientPermissionException {\n if (ub.isSysAdmin() || ub.isTechAdmin()) {\r\n return;\r\n }\r\n// if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) {// ?\r\n// ?\r\n// return;\r\n// }\r\n\r\n addPageMessage(respage.getString(\"no_have_correct_privilege_current_study\") + respage.getString(\"change_study_contact_sysadmin\"));\r\n throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString(\"not_allowed_access_extract_data_servlet\"), \"1\");// TODO\r\n // above copied from create dataset servlet, needs to be changed to\r\n // allow only admin-level users\r\n\r\n }", "public void createIndividualAcl(Individual i);", "int insertSelective(SysRole record);", "@Override\n\tpublic Users checkRole(String t) {\n\t\treturn genericDAO.checkRole(t);\n\t}", "public void loadPermissionLevel(final Layer model) {\r\n \t\tif(model != null) {\t\t\t\r\n \t\t\tUserData currentUser = authenticationController.getLoggedInUser();\r\n \t\t\tif(currentUser != null) {\r\n \t\t\t\tAclUtils.getHighestPermissionLevel(NodeType.LAYER, model.getId(), nodeService, new AsyncCallback<PermissionLevel>() {\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onSuccess(PermissionLevel result) {\r\n \t\t\t\t\t\tiisAdministrator = false;\r\n \t\t\t\t\t\tccanEdit = false;\r\n \t\t\t\t\t\tif(result == PermissionLevel.CAN_EDIT) {\r\n \t\t\t\t\t\t\tccanEdit = true;\r\n \t\t\t\t\t\t} else if(result == PermissionLevel.CAN_ADMINISTER) {\r\n \t\t\t\t\t\t\tccanEdit = true;\r\n \t\t\t\t\t\t\tiisAdministrator = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tsetLayerDetails(model, iisAdministrator, ccanEdit);\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t\t@Override\r\n \t\t\t\t\tpublic void onFailure(Throwable caught) {\t\t\t\t\r\n \t\t\t\t\t\tview.showErrorMessage(DisplayConstants.ERROR_GETTING_PERMISSIONS_TEXT);\r\n \t\t\t\t\t\tiisAdministrator = false;\r\n \t\t\t\t\t\tccanEdit = false;\r\n \t\t\t\t\t\tsetLayerDetails(model, iisAdministrator, ccanEdit);\r\n \t\t\t\t\t}\t\t\t\r\n \t\t\t\t});\r\n \t\t\t} else {\r\n \t\t\t\t// because this is a public page, they can view\r\n \t\t\t\tiisAdministrator = false;\r\n \t\t\t\tccanEdit = false;\r\n \t\t\t\tsetLayerDetails(model, iisAdministrator, ccanEdit);\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t}", "void checkPermission(T request) throws AuthorizationException;", "int updateByPrimaryKeySelective(SysRoleUser record);", "public void allowAllPermissionsToUser(String messageBoxId, String user)\n throws MessageBoxException {\n try {\n\n // if there is no role with this role add the role and assign the role to the user\n UserStoreManager userStoreManager = Utils.getUserRelam().getUserStoreManager();\n if (!userStoreManager.isExistingRole(user)){\n userStoreManager.addRole(user, new String[]{user}, new Permission[0]);\n }\n \n AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();\n\n String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + \"/\" +\n messageBoxId;\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_DELETE_MESSAGE);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_CHANGE_MESSAGE_VISIBILITY);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_GET_QUEUE_ATTRIBUTES);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_RECEIVE_MESSAGE);\n authorizationManager.authorizeRole(user, messageBoxPath,\n MessageBoxConstants.SQS_OPERATION_SEND_MESSAGE);\n\n } catch (UserStoreException e) {\n String error = \"Failed to allow permissions to user \" + user + \" for message box \" + messageBoxId;\n log.error(error);\n throw new MessageBoxException(error, e);\n }\n }", "public boolean hasPermission(String permission)\n throws Exception\n {\n Permission permissionObject = null;\n try\n {\n permissionObject = securityService.getPermissionManager().getPermissionByName(permission);\n }\n catch (UnknownEntityException e)\n {\n if(initialize)\n {\n permissionObject = securityService.getPermissionManager().getPermissionInstance(permission);\n securityService.getPermissionManager().addPermission(permissionObject);\n\n Role role = null;\n TurbineAccessControlList<?> acl = data.getACL();\n RoleSet roles = acl.getRoles();\n if(roles.size() > 0)\n {\n\t\t\t\t\trole = roles.toArray(new Role[0])[0];\n\t\t\t\t}\n\n if(role == null)\n {\n /*\n * The User within data has no roles yet, let us grant the permission\n * to the first role available through SecurityService.\n */\n roles = securityService.getRoleManager().getAllRoles();\n if(roles.size() > 0)\n {\n\t\t\t\t\t\trole = roles.toArray(new Role[0])[0];\n\t\t\t\t\t}\n }\n\n if(role != null)\n {\n /*\n * If we have no role, there is nothing we can do about it. So only grant it,\n * if we have a role to grant it to.\n */\n TurbineModelManager modelManager = (TurbineModelManager)securityService.getModelManager();\n modelManager.grant(role, permissionObject);\n }\n }\n else\n {\n throw(e);\n }\n }\n\n return hasPermission(permissionObject);\n }", "abstract public void getPermission();", "@Test\n\tpublic void testCheckPermissions_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "int setCanStatus(int canRegno, int action);", "@Override\n protected String requiredGetPermission() {\n return \"user\";\n }", "int insertSelective(UUserRole record);", "protected void loadSectionPermissions(ActionRequest req, SmarttrakRoleVO role) throws AuthorizationException {\n\t\tAccountPermissionAction apa = new AccountPermissionAction();\n\t\tapa.setDBConnection((SMTDBConnection)getAttribute(DB_CONN));\n\t\tapa.setAttributes(getInitVals());\n\t\ttry {\n\t\t\t//retrieve the permission tree for this account\n\t\t\tapa.retrieve(req);\n\t\t\tModuleVO mod = (ModuleVO) apa.getAttribute(Constants.MODULE_DATA);\n\t\t\tSmarttrakTree t = (SmarttrakTree) mod.getActionData();\n\n\t\t\t//iterate the nodes and attach parent level tokens to each, at each level. spine. spine~bone. spine~bone~fragment. etc.\n\t\t\tt.buildNodePaths();\n\n\t\t\t//attach the list of permissions to the user's role object\n\t\t\trole.setAccountRoles(t.preorderList());\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new AuthorizationException(\"could not load Smartrak permissions\", e);\n\t\t}\n\t\tlog.debug(\"loaded \" + role.getAccountRoles().size() + \" account permissions into the roleVO\");\n\t}", "int updateByPrimaryKeySelective(PlatformAdminRoleUser record);", "@Override\n public void checkPermission(Permission perm) {\n }", "boolean isDirectlyAccessible(Object dbobject,\n int rights) throws HsqlException {\n\n if (isAdministrator) {\n return true;\n }\n\n if (dbobject instanceof String) {\n if (((String) dbobject).startsWith(\"org.hsqldb.Library\")\n || ((String) dbobject).startsWith(\"java.lang.Math\")) {\n return true;\n }\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n != 0) {\n return (n & rights) != 0;\n }\n\n return false;\n }", "public int checkLevel(int level, String requestTask) {\n\t\tint ret = 1;\n\t\tswitch(requestTask) {\n\t\tcase \"add\":\n\t\t\tif(level == 2)\n\t\t\t\tret = 1;\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\tcase \"modify\":\n\t\t\tif(level == 3)\n\t\t\t\tret = 1;\n\t\t}\n\t\treturn ret;\n\t}", "@Override\n\tpublic void apply( final ApplyFn fn ) throws AccessDeniedException;", "@Override\n protected String requiredDeletePermission() {\n return \"admin\";\n }", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "@Override\n\tpublic void modifierUser(User c) {\n\t\t\n\t}", "public void addPrivileges(int privilege, String... roleList) {\r\n\t\tif (null != roleList) {\r\n\t\t\tif (null == privileges)\r\n\t\t\t\tprivileges = new HashMap<Integer, Set<String>>();\r\n\t\t\tSet<String> roles = privileges.get(privilege);\r\n\t\t\tif (null == roles) {\r\n\t\t\t\troles = new HashSet<String>();\r\n\t\t\t\tprivileges.put(privilege, roles);\r\n\t\t\t}\r\n\t\t\tfor (String role : roleList)\r\n\t\t\t\troles.add(role);\r\n\t\t}\r\n\t}", "int insert(PlatformAdminRoleUser record);", "@Override\r\n\tpublic AdminRole selectPermissionsByroleID(int roleid) {\n\t\treturn adminRoleDao.selectPermissionsByroleID(roleid);\r\n\t}", "private void copyRoleAccess(InheritedAccessEnabled parentAccess, Role role,\n AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n // copy the new access\n final InheritedAccessEnabled newAccess = (InheritedAccessEnabled) DalUtil.copy(\n (BaseOBObject) parentAccess, false);\n injector.setParent(newAccess, parentAccess, role);\n newAccess.setInheritedFrom(injector.getRole(parentAccess));\n OBDal.getInstance().save(newAccess);\n } finally {\n OBContext.restorePreviousMode();\n }\n }" ]
[ "0.5767975", "0.56306934", "0.5565354", "0.5491463", "0.5461215", "0.5423845", "0.5210587", "0.51806647", "0.51361084", "0.50486827", "0.50237733", "0.5014636", "0.5000765", "0.4958094", "0.4955476", "0.4934473", "0.49234784", "0.4918136", "0.49132958", "0.4868854", "0.48609245", "0.4856425", "0.48337072", "0.48303", "0.48116988", "0.47933498", "0.47825015", "0.47653243", "0.47626704", "0.47610027", "0.4758633", "0.4744533", "0.4741797", "0.4724777", "0.47247738", "0.47097784", "0.47069374", "0.47010782", "0.4699361", "0.4693225", "0.4677399", "0.46663392", "0.46650836", "0.46545154", "0.46521038", "0.4648663", "0.46443573", "0.46216074", "0.4603314", "0.45992267", "0.45969588", "0.4596644", "0.45883456", "0.45706213", "0.4569963", "0.45683762", "0.4566103", "0.45558247", "0.45517907", "0.4539608", "0.45394078", "0.45385054", "0.45359305", "0.4525369", "0.45225337", "0.45144224", "0.45101416", "0.45089728", "0.45064712", "0.45049328", "0.44977176", "0.44955066", "0.44843307", "0.44830072", "0.44810227", "0.4479496", "0.44762346", "0.44686598", "0.4459688", "0.44554782", "0.44550738", "0.4452903", "0.44514295", "0.44467115", "0.44428185", "0.44264323", "0.44161537", "0.4415531", "0.44141522", "0.4410427", "0.44090578", "0.44073686", "0.4406965", "0.44045487", "0.4403523", "0.44032857", "0.44028902", "0.43985823", "0.43956017", "0.43945885" ]
0.53027135
6
Grants membership in a role to a user or role.
public GrantRoleResponse grantRole(GrantRoleRequest request) throws GPUdbException { GrantRoleResponse actualResponse_ = new GrantRoleResponse(); submitRequest("/grant/role", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasRole();", "@Test(dependsOnMethods = \"testRoleAdd\", groups = \"role\", priority = 1)\n public void testRoleGrantPermission() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient\n .roleGrantPermission(rootRole, rootRolekeyRangeBegin, rootkeyRangeEnd,\n Permission.Type.READWRITE).get();\n this.authDisabledAuthClient\n .roleGrantPermission(userRole, userRolekeyRangeBegin, userRolekeyRangeEnd, Type.READWRITE)\n .get();\n }", "public void grantRole(String roleName, User user) throws UserManagementException;", "void addRoleToUser(int userID,int roleID);", "boolean anyGranted(String roles);", "public void grantOper2Role(final Role role, final String operId);", "public void testRequiredRolesMultipleGroupsOk() {\n User elmer = RoleFactory.createUser(\"elmer\");\n User pepe = RoleFactory.createUser(\"pepe\");\n User bugs = RoleFactory.createUser(\"bugs\");\n User daffy = RoleFactory.createUser(\"daffy\");\n \n Group administrators = RoleFactory.createGroup(\"administrators\");\n administrators.addRequiredMember(m_anyone);\n administrators.addMember(elmer);\n administrators.addMember(pepe);\n administrators.addMember(bugs);\n\n Group family = RoleFactory.createGroup(\"family\");\n family.addRequiredMember(m_anyone);\n family.addMember(elmer);\n family.addMember(pepe);\n family.addMember(daffy);\n\n Group alarmSystemActivation = RoleFactory.createGroup(\"alarmSystemActivation\");\n alarmSystemActivation.addRequiredMember(m_anyone);\n alarmSystemActivation.addMember(administrators);\n alarmSystemActivation.addMember(family);\n\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, elmer));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, pepe));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, bugs));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, daffy));\n }", "boolean allGranted(String roles);", "public void testRequiredRolesMultipleRequiredGroupsOk() {\n User elmer = RoleFactory.createUser(\"elmer\");\n User pepe = RoleFactory.createUser(\"pepe\");\n User bugs = RoleFactory.createUser(\"bugs\");\n User daffy = RoleFactory.createUser(\"daffy\");\n \n Group administrators = RoleFactory.createGroup(\"administrators\");\n administrators.addRequiredMember(m_anyone);\n administrators.addMember(elmer);\n administrators.addMember(pepe);\n administrators.addMember(bugs);\n\n Group family = RoleFactory.createGroup(\"family\");\n family.addRequiredMember(m_anyone);\n family.addMember(elmer);\n family.addMember(pepe);\n family.addMember(daffy);\n\n Group alarmSystemActivation = RoleFactory.createGroup(\"alarmSystemActivation\");\n alarmSystemActivation.addMember(m_anyone);\n alarmSystemActivation.addRequiredMember(administrators);\n alarmSystemActivation.addRequiredMember(family);\n\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, elmer));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, pepe));\n assertFalse(m_roleChecker.isImpliedBy(alarmSystemActivation, bugs));\n assertFalse(m_roleChecker.isImpliedBy(alarmSystemActivation, daffy));\n }", "public boolean hasRole(String roleName);", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "public boolean assignUser(String u, String r){//--------------------------------------------> HAVE DIFFERENT VERSIONS FOR RBAC VERSIONS\n\t\tArrayList<GraphNode> userNodes = authGraph.findNodesByLabel(values.get(1).get(u),1);\n\t\tArrayList<GraphNode> roleNodes = authGraph.findNodesByLabel(values.get(2).get(r),2);\n\t\tboolean returnFlag = false;\n\t\tfor (int i = 0; i < userNodes.size();i++){\n\t\t\tfor (int j = 0; j < roleNodes.size(); j++){\n\t\t\t\tSystem.out.println(\"user \"+ u + \"assigned \" + r + \" with \" + values.get(2).get(r));\n\t\t\t\tuserNodes.get(i).addEdge(roleNodes.get(j), values.get(2).get(r),\"Common\"); returnFlag = true;\n\t\t\t}\n\t\t}\n\t\treturn returnFlag;\n\t}", "public interface User {\r\n\r\n /**\r\n * Is this user in a specified role?\r\n * @param roleName the name of the role\r\n * @return true if in role\r\n */\r\n public boolean hasRole(String roleName);\r\n\r\n /**\r\n * Remove a role. Implementation is optional\r\n */\r\n public void removeRole(String roleName) throws UnsupportedOperationException;\r\n\r\n /**\r\n * Adds a role to this user. Implementation is optional\r\n * @param roleName the name of the role\r\n */\r\n public void addRole(String roleName) throws UnsupportedOperationException;\r\n\r\n /**\r\n * Is this user in a specified group?\r\n * @param groupName\r\n * @return true if in group\r\n */\r\n public boolean inGroup(String groupName);\r\n\r\n /**\r\n * Remove a group. Implementation is optional\r\n * @param groupName\r\n */\r\n public void removeGroup(String groupName) throws UnsupportedOperationException;\r\n\r\n /**\r\n * Adds this user to a group. Implementation is optional\r\n * @param groupName\r\n */\r\n public void addGroup(String groupName) throws UnsupportedOperationException;\r\n\r\n /**\r\n * get user language\r\n * @return language string\r\n */\r\n\r\n public abstract String getLanguage();\r\n\r\n /**\r\n * get user name\r\n * @return name string\r\n */\r\n public abstract String getName();\r\n\r\n /**\r\n * get user password\r\n * @return password string\r\n */\r\n public abstract String getPassword();\r\n\r\n /**\r\n * get groups that user is in\r\n * @return\r\n */\r\n public abstract Collection getGroups();\r\n\r\n /**\r\n * get roles tha are assigned to user\r\n * @return\r\n */\r\n public abstract Collection getRoles();\r\n}", "void changeRole(User user, Role role, String token) throws AuthenticationException;", "boolean hasAttackerRoleId();", "@Override\n\tpublic void addRole(Role r) {\n\t\t\n\t}", "@Override\n public Boolean isGradeManger(UserDTO user) {\n return user.getRoles().contains(RoleTypeEnum.GRADE);\n }", "public boolean addSupportRole(Role ... r) {\n\t\tif (getGuild() == null || r == null) { return false; }\n\t\tfor (Role role : r) { if (role.getGuild().equals(getGuild())) supportRoles.add(role); }\n\t\tconfig.save();\n\t\tif (!config.isLoading()) { TMEventManager.departmentChange(this, ChangeType.Dept.ROLES); }\n\t\treturn true;\n\t}", "String getRole();", "String getRole();", "@Override\n\t\tpublic boolean isUserInRole(String role) {\n\t\t\treturn false;\n\t\t}", "boolean memberHasPermission(String perm, Member m);", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public void testVotersRequiredMembersOk() {\n Group citizens = RoleFactory.createGroup(\"citizen\");\n citizens.addRequiredMember(m_anyone);\n \n Group adults = RoleFactory.createGroup(\"adult\");\n adults.addRequiredMember(m_anyone);\n \n Group voters = RoleFactory.createGroup(\"voter\");\n voters.addRequiredMember(citizens);\n voters.addRequiredMember(adults);\n voters.addMember(m_anyone);\n \n \n // Elmer belongs to the citizens and adults...\n User elmer = RoleFactory.createUser(\"elmer\");\n citizens.addMember(elmer);\n adults.addMember(elmer);\n \n // Pepe belongs to the citizens, but is not an adult...\n User pepe = RoleFactory.createUser(\"pepe\");\n citizens.addMember(pepe);\n \n // Bugs is an adult, but is not a citizen...\n User bugs = RoleFactory.createUser(\"bugs\");\n adults.addMember(bugs);\n \n // Daffy is not an adult, neither a citizen...\n User daffy = RoleFactory.createUser(\"daffy\");\n\n assertTrue(m_roleChecker.isImpliedBy(voters, elmer));\n assertFalse(m_roleChecker.isImpliedBy(voters, pepe));\n assertFalse(m_roleChecker.isImpliedBy(voters, bugs));\n assertFalse(m_roleChecker.isImpliedBy(voters, daffy));\n }", "public void grantAdministrate(User user) throws ServiceException{\n }", "public boolean isUserInRole(String role) {\r\n\t\treturn true;\r\n\t}", "private boolean hasRole(Roles role) {\n\t\tSecurityContext context = SecurityContextHolder.getContext();\n\t\t\n\t\tif(context == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tAuthentication aut = context.getAuthentication();\n\t\tif(aut == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tCollection<? extends GrantedAuthority> autohotities = aut.getAuthorities();\n\t\tfor(GrantedAuthority ga : autohotities) {\n\t\t\tif(role.toString().equals(ga.getAuthority())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "Result<? extends HibRole> getRolesWithPerm(HibBaseElement element, InternalPermission perm);", "long addUserRole(UserRole userRole);", "String computeRole();", "@Override\n\tpublic boolean isRole() {\n\t\treturn true;\n\t}", "public void testAssignBlogContributors() {\n rootBlog.setProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY, \"user1\");\n assertEquals(\"user1\", rootBlog.getProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY));\n assertEquals(\"user1\", rootBlog.getBlogContributors());\n\n Collection users = rootBlog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);\n assertEquals(1, users.size());\n assertTrue(users.contains(\"user1\"));\n\n rootBlog.setProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY, \"user1,user2\");\n assertEquals(\"user1,user2\", rootBlog.getProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY));\n assertEquals(\"user1,user2\", rootBlog.getBlogContributors());\n\n users = rootBlog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);\n assertEquals(2, users.size());\n assertTrue(users.contains(\"user1\"));\n assertTrue(users.contains(\"user2\"));\n }", "public GraphNode addRole(String role){\n\t\tInteger intValue = addElement(role, 2);\n\t\t//System.out.println(role + \" Added with : \" + intValue);\n\t\tGraphNode roleVar = new GraphNode(intValue, 2);\n\t\tauthGraph.addVertex(roleVar);\n\t\treturn roleVar;\n\t}", "SecurityRole getRole();", "public void testUserIsBlogContributor() {\n rootBlog.setProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY, \"user1\");\n assertTrue(rootBlog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, \"user1\"));\n assertFalse(rootBlog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, \"user2\"));\n }", "private static boolean rolesContainRole(Identity userIdentity, String roleName)\r\n {\r\n if (roleName.equals(\"PILOT\"))\r\n return (userIdentity instanceof Pilot) || (userIdentity instanceof SystemAdministrator);\r\n if (roleName.equals(\"GENERAL\"))\r\n return (userIdentity instanceof General) || (userIdentity instanceof SystemAdministrator);\r\n if (roleName.equals(\"ADMIN\"))\r\n return (userIdentity instanceof SystemAdministrator);\r\n return false;\r\n }", "private boolean userHasAllowedRole(User u, String[] allowedRoles) {\n\n for (GroupRef group : u.getGroups()) {\n\n if (Arrays.binarySearch(allowedRoles, group.getDisplay()) >= 0) {\n return true;\n }\n }\n\n return false;\n }", "private void onAddRole() {\n\t\troleProxy.addRoleToUser(user, selectedRole);\n\t}", "public abstract boolean checkRolesAllowed(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "private Map<ClaimMapping, String> setRoleAsUserAttributes(String role, AuthenticationContext context) {\n Map<ClaimMapping, String> userAttributes =\n context.getSequenceConfig().getAuthenticatedUser().getUserAttributes();\n Map<String, String> roles = new HashMap<>();\n //String roleClaimUri = \"dynamic_role\";\n roles.put(roleClaimURI, role);\n if (log.isDebugEnabled()) {\n log.debug(String.format(\"Setting role %s as user role with claimURI %s\", role, roleClaimURI));\n }\n Map<ClaimMapping, String> rolesClaims = FrameworkUtils.buildClaimMappings(roles);\n\n // Add the role claim from XACML policy\n for (Map.Entry<ClaimMapping, String> entry : rolesClaims.entrySet()) {\n log.info(entry.getKey() + \" = \" + entry.getValue());\n userAttributes.put(entry.getKey(), entry.getValue());\n }\n\n context.getSequenceConfig().getAuthenticatedUser().setUserAttributes(userAttributes);\n return userAttributes;\n }", "@Test(groups = \"role\", priority = 1)\n public void testRoleAdd() throws ExecutionException, InterruptedException {\n this.authDisabledAuthClient.roleAdd(rootRole).get();\n this.authDisabledAuthClient.roleAdd(userRole).get();\n }", "public void setRole(String role)\n {\n _role=role;\n }", "@Override\n\tpublic void grant(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "protected void grantAdminAuthority( ApplicationContext ctx ) {\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n // Grant all roles to test user.\n TestingAuthenticationToken token = new TestingAuthenticationToken( \"administrator\", \"administrator\",\n new GrantedAuthority[] { new GrantedAuthorityImpl( \"GROUP_ADMIN\" ) } );\n\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "public boolean hasRole(String role) throws Exception\n {\n Role roleObject = null;\n\n try\n {\n roleObject = securityService.getRoleManager().getRoleByName(role);\n }\n catch (UnknownEntityException e)\n {\n if(initialize)\n {\n roleObject = securityService.getRoleManager().getRoleInstance(role);\n securityService.getRoleManager().addRole(roleObject);\n TurbineModelManager modelManager = (TurbineModelManager)securityService.getModelManager();\n if (data.getUser() == null) {\n throw new UnknownEntityException(\"user is null\");\n }\n modelManager.grant(data.getUser().getUserDelegate(), modelManager.getGlobalGroup(), roleObject);\n }\n else\n {\n throw(e);\n }\n }\n\n return hasRole(roleObject);\n }", "VerbRole getRole();", "private void processRoleGrantOrRevoke(boolean grant) throws HsqlException {\n\n String token;\n HsqlArrayList list = new HsqlArrayList();\n String role;\n GranteeManager granteeManager = database.getGranteeManager();\n\n do {\n role = tokenizer.getSimpleToken();\n\n Trace.check(granteeManager.isRole(role),\n (grant ? Trace.NO_SUCH_ROLE_GRANT\n : Trace.NO_SUCH_ROLE_REVOKE));\n list.add(role);\n } while (tokenizer.isGetThis(Token.T_COMMA));\n\n tokenizer.getThis(grant ? Token.T_TO\n : Token.T_FROM);\n\n token = getUserIdentifier();\n\n GranteeManager gm = database.getGranteeManager();\n\n for (int i = 0; i < list.size(); i++) {\n if (grant) {\n gm.grant(token, (String) list.get(i));\n } else {\n gm.revoke(token, (String) list.get(i));\n }\n }\n }", "public boolean hasRole() {\n return fieldSetFlags()[6];\n }", "LoggedUser changeRole(String roleId) throws IOException;", "@Override\n\tpublic boolean isUserInRole(String arg0) {\n\t\treturn false;\n\t}", "public Userrole getUserrole() {\n return getEntity();\n }", "@Override\n\tpublic boolean hasRole(Class<? extends IRole> role) {\n\t\treturn getInnerObject().hasRole(role);\n\t}", "public void addRole(String roleName) throws UnsupportedOperationException;", "GroupQueryBuilder addUserConnectedByRole(User user);", "public void addRole(Role theRole) {\r\n\t\tthis.roles.add(theRole);\r\n\t\ttheRole.getUsers().add(this);\r\n\t}", "public abstract void setRoleManager(OwRoleManager roleManager_p);", "public void testUserImpliesImpliedGroup() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addRequiredMember(m_anyone);\n group.addMember(user);\n\n assertTrue(m_roleChecker.isImpliedBy(group, user));\n }", "Collection<? extends Role> getIsPerformOf();", "@Override\n\tpublic List<UserRole> buscarUserRoleSemPermissoes() {\n\t\t// TODO Auto-generated method stub\n\t\tQuery query = getCurrentSession().createQuery(\"select ur from UserRole ur where ur.permissions\");\n\t\treturn query.list();\n\t}", "boolean hasRole(@NotNull String role);", "public void setRole(String role) {\r\n this.role = role;\r\n }", "public interface RoleGrantedAuthorityMapper extends GrantedAuthoritiesMapper {\n\n GrantedAuthority mapRole(String role);\n\n Set<GrantedAuthority> mapRoles(Collection<String> roles);\n}", "@Override\n public boolean isUserInRole(String string) {\n String imp = (String)ADFContext.getCurrent().getSessionScope().get(\"isImpersonationOn\");\n if(imp == null || !imp.equals(\"Y\")){\n return super.isUserInRole(string);\n }\n else{\n List<String> userRoles = (List<String>)ADFContext.getCurrent().getSessionScope().get(\"userRoles\");\n if(userRoles != null && userRoles.contains(string)){\n return true;\n }\n else{\n return false;\n }\n \n }\n \n }", "boolean hasRoleID();", "RoleType getRoleType();", "@Test\n\t// Delivery 2 Use Case 1. Grant/Deny Access to commands based on profile's role\n\tpublic void test() {\n\n\t\tUsers user1 = new Users(\"Test1\", \"PARENT\");\n\t\tUsers user2 = new Users(\"Test2\", \"STRANGER\");\n\t\tUsers user3 = new Users(\"Test3\", \"CHILDREN\");\n\t\tUsers user4 = new Users(\"Test4\", \"GUEST\");\n\n\t\t// Checking if users have permissions\n\t\tassertEquals(\"PARENT\", user1.getPermission());\n\t\tassertEquals(\"STRANGER\", user2.getPermission());\n\t\tassertEquals(\"CHILDREN\", user3.getPermission());\n\t\tassertEquals(\"GUEST\", user4.getPermission());\n\n\t}", "User addMember(final User user, GroupAssociation groupAssociation);", "@Override\r\n\tpublic int addRole(Role role) {\n\t\treturn 0;\r\n\t}", "public final void addRole(RepoUserRole role){\n if(!rolesAsEnum.contains(role)){\n try{\n rolesAsEnum.add(role);\n } catch(UnsupportedOperationException ex){\n LOGGER.warn(\"Adding roles is not supported for this instance of RepoUser with roles {}. Probably, the user is inactive.\", rolesAsEnum);\n }\n }\n }", "void setRole(final SecurityRole role);", "@Override\n public Boolean isCollegeManger(UserDTO user) {\n return user.getRoles().contains(RoleTypeEnum.COLLEGE);\n }", "public boolean hasMemberInvitePrivilages(User user, Chatroom chatroom) {\n\t\treturn isOwner(user, chatroom) || isAdmin(user, chatroom); // only the owner and admins can send member\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// invitation\n\t}", "PermissionInfo getRolePermissions(HibBaseElement element, InternalActionContext ac, String roleUuid);", "@Test\n public void testDenyAccessWithNegateRoleCondition() {\n denyAccessWithRoleCondition(true);\n }", "public void setRole(String role) {\r\n this.role = role;\r\n }", "boolean noneGranted(String roles);", "@Override\n public boolean isUserInRole(final String roleName) {\n return scopes.contains(roleName);\n }", "public static boolean isCurrentUserInRole(String role) {\n WorkflowUserManager workflowUserManager = (WorkflowUserManager) appContext.getBean(\"workflowUserManager\");\n boolean result = workflowUserManager.isCurrentUserInRole(role);\n return result;\n }", "boolean isAdmin() {\n\n if (isAdminDirect()) {\n return true;\n }\n\n RoleManager rm = getRoleManager();\n Iterator it = getAllRoles().iterator();\n\n while (it.hasNext()) {\n try {\n if (((Grantee) rm.getGrantee(\n (String) it.next())).isAdminDirect()) {\n return true;\n }\n } catch (HsqlException he) {\n throw Trace.runtimeError(Trace.RETRIEVE_NEST_ROLE_FAIL,\n he.getMessage());\n }\n }\n\n return false;\n }", "public String getRole() { return this.role; }", "@Test(expected = org.jsecurity.authz.UnauthorizedException.class)\n\tpublic void testCheckRole_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString role = \"\";\n\n\t\tfixture.checkRole(role);\n\n\t\t// add additional test code here\n\t}", "@FunctionalInterface\n private interface RoleChecker {\n public void checkAndRedirect(String role, String redirectAddress) throws IOException;\n }", "public void setRole(String role) {\n this.role = role;\n }", "Set getRoles();", "ISModifyRequiredRole createISModifyRequiredRole();", "@Override\n public boolean isPermitted(HttpServletRequest request, int permittedRole) {\n boolean result = false;\n HttpSession session = request.getSession();\n String userName = (String) session.getAttribute(\"userName\");\n String token = (String) session.getAttribute(\"token\");\n int role = Integer.parseInt((String) session.getAttribute(\"role\"));\n if (userName != null && token != null) {\n CrUser user = userRepo.findByUserName(userName);\n if (user != null && isTokenValid(user, token) && role == permittedRole) {\n result = true;\n }\n }\n return result;\n }", "private void checkUserRoleAssignment(final VOUserDetails consideredUser,\n final String... roleNames) throws Exception {\n runTX(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n PlatformUser user = dm.getReference(PlatformUser.class,\n consideredUser.getKey());\n Set<RoleAssignment> assignedRoles = user.getAssignedRoles();\n assertEquals(roleNames.length, assignedRoles.size());\n for (String roleName : roleNames) {\n boolean roleFound = false;\n for (RoleAssignment roleAssignment : assignedRoles) {\n if (roleAssignment.getRole().getRoleName().name()\n .equals(roleName)) {\n roleFound = true;\n }\n }\n assertTrue(\"User is missing the required role \" + roleName,\n roleFound);\n }\n return null;\n }\n });\n }", "@Test\n\tpublic void testHasRole_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tboolean result = fixture.hasRole(roleName);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public boolean doesUserHaveRole(int inRole) {\r\n if (roles != null) {\r\n for (Iterator iter = roles.iterator(); iter.hasNext();) {\r\n UserRole userRole = (UserRole)iter.next();\r\n if (userRole.getId().intValue() == inRole) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "@Override\r\n\tpublic int updRole(Role role) {\n\t\treturn 0;\r\n\t}", "public void addRole(String username, String role) throws UserNotExistsException ;", "public void addRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"No roles can be attached to user [ Anonymous ]\");\r\n }", "public void setRole(java.lang.String value) {\n this.role = value;\n }", "private Authentication grantAdminRole(UserInfo u, Authentication authentication) throws AuthenticationException\n\t{\n\t\tList<GrantedAuthority> rights = new ArrayList<GrantedAuthority>();\n\t\trights.add(new SimpleGrantedAuthority(ADMIN));\n\t\t// Return valid authentication token.\n\t\tUsernamePasswordAuthenticationToken token;\n\t\ttoken = new UsernamePasswordAuthenticationToken(authentication.getPrincipal(),\n\t\t\t\tauthentication.getCredentials(),\n\t\t\t\trights);\n\t\treturn token;\n\t}", "void setRole(String roles);", "@Test(groups = \"wso2.ds.dashboard\", description = \"Adding user to admin console and assign editor or viewer roles\"\n + \" to newly added users\")\n public void testAddUserAssignRoles()\n throws MalformedURLException, XPathExpressionException {\n addUser(USERNAME_EDITOR, PASSWORD_EDITOR, RETYPE_PASSWORD_EDITOR);\n addRole(EDITOR_ROLE);\n assignRoleToUser(new String[]{USERNAME_EDITOR});\n addUser(USERNAME_VIEWER, PASSWORD_VIEWER, RETYPE_PASSWORD_VIEWER);\n addRole(VIEWER_ROLE);\n assignRoleToUser(new String[]{USERNAME_VIEWER});\n logoutFromAdminConsole();\n }", "public String getGroupRole()\n {\n return this.groupRole;\n }", "@Test\n\tpublic void testCheckRole_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString role = \"\";\n\n\t\tfixture.checkRole(role);\n\n\t\t// add additional test code here\n\t}", "public void setUserRole(Byte userRole) {\r\n this.userRole = userRole;\r\n }", "public String getRole() {\r\n return role;\r\n }" ]
[ "0.6404846", "0.6227043", "0.62260604", "0.61801875", "0.61591625", "0.6089815", "0.6034564", "0.59705555", "0.59195846", "0.5859952", "0.5814662", "0.5736948", "0.5718554", "0.57069725", "0.5675069", "0.5648498", "0.5640451", "0.56355846", "0.5632578", "0.5632578", "0.5603044", "0.55733734", "0.55717754", "0.55535954", "0.55234534", "0.5519091", "0.54985124", "0.5495819", "0.5463211", "0.54579914", "0.5432247", "0.54271066", "0.54268616", "0.54167557", "0.54053867", "0.539711", "0.5393988", "0.53754467", "0.53638124", "0.5354209", "0.5354067", "0.53505266", "0.5340892", "0.5338164", "0.53319114", "0.53288484", "0.532657", "0.5323703", "0.5321436", "0.5321358", "0.5304434", "0.5295235", "0.52948475", "0.52818686", "0.5280941", "0.5278092", "0.5269227", "0.5256154", "0.5251551", "0.523881", "0.52373236", "0.52299833", "0.5226346", "0.5214649", "0.52092624", "0.5208854", "0.5203912", "0.5203406", "0.5195608", "0.51938254", "0.51910603", "0.5187883", "0.5184952", "0.5177811", "0.5177306", "0.5159478", "0.51512486", "0.51433665", "0.5132832", "0.51322776", "0.5130459", "0.51285547", "0.5126348", "0.5123071", "0.51197374", "0.51152134", "0.5112488", "0.51012987", "0.5095776", "0.5092909", "0.5086843", "0.5083813", "0.5080305", "0.5071873", "0.5062704", "0.50619465", "0.5057851", "0.50538665", "0.5046007", "0.5041855" ]
0.5079732
93
Checks the existence of a proc with the given name.
public HasProcResponse hasProc(HasProcRequest request) throws GPUdbException { HasProcResponse actualResponse_ = new HasProcResponse(); submitRequest("/has/proc", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasProcedure(String procedureName) throws Exception;", "public HasProcResponse hasProc(String procName, Map<String, String> options) throws GPUdbException {\n HasProcRequest actualRequest_ = new HasProcRequest(procName, options);\n HasProcResponse actualResponse_ = new HasProcResponse();\n submitRequest(\"/has/proc\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "boolean hasProcedureNames();", "public boolean existsInstance(String name)\r\n\t{\r\n\t\treturn obtainOntResource(name) != null;\r\n\t}", "boolean existsByName(String name);", "boolean hasApplicationProcessName();", "public boolean exists(String name) throws IOException;", "public boolean hasParam(String name)\r\n {\r\n try {\r\n return lookup.get(name) != null;\r\n } catch(Exception e) {}\r\n \r\n return false;\r\n }", "public static boolean isStoredProcedureWhitelisted(String name) {\r\n return storedProceduresWhitelist.contains(name.toUpperCase());\r\n }", "public boolean hasProcedureNames() {\n return procedureNames_ != null;\n }", "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\n\t}", "public abstract boolean isInCallingProcedure(SDGNode n);", "boolean isProcedure(Object groupID) throws Exception;", "public boolean removeProcedureByName(String name){\n\t\tboolean result=false;\n\t\tfor(Procedure p: proceduresList){\n\t\t\tif(p.getName().equals(name)){\n\t\t\t\tsummaryPrice-=p.getPrice();\n\t\t\t\tproceduresList.remove(p);\n\t\t\t\tresult=true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "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 void checkShProcess(String processName, CallBack<String> callBack) {\n\n Log.d(TAG, \"checkShProcess ... start ...\");\n\n Process process = null;\n Runtime runtime = Runtime.getRuntime();\n try {\n\n// String cmd = \"busybox ps -e|grep \\\"<processName>\\\"|grep -v grep|wc -l\";\n String cmd = \"busybox ps -e|grep \\\"\" + processName + \"\\\"|grep -v grep|wc -l\";\n process = runtime.exec(new String[]{\"su\", \"-c\", cmd});\n InputStream is = process.getInputStream();\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n String line;\n while ((line = reader.readLine()) != null) {\n Log.d(TAG, \"checkShProcess line result : \" + line);\n if (line.equals(\"0\")) {\n callBack.onResult(\"0\"); // No\n } else callBack.onResult(\"1\"); // Ok\n }\n\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n e.printStackTrace();\n callBack.onResult(\"error\");\n } finally {\n try {\n process.destroy();\n } catch (Exception e){}\n }\n }", "public static boolean exists(String path, String name) {\n return new File(path + name).exists();\n }", "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 }", "public boolean hasRequest (String name)\n {\n org.omg.CORBA.portable.InputStream $in = null;\n try {\n org.omg.CORBA.portable.OutputStream $out = _request (\"hasRequest\", true);\n $out.write_string (name);\n $in = _invoke ($out);\n boolean $result = $in.read_boolean ();\n return $result;\n } catch (org.omg.CORBA.portable.ApplicationException $ex) {\n $in = $ex.getInputStream ();\n String _id = $ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException $rm) {\n return hasRequest (name );\n } finally {\n _releaseReply ($in);\n }\n }", "public boolean hasProcedureNames() {\n return procedureNamesBuilder_ != null || procedureNames_ != null;\n }", "boolean hasFunction(String functionName);", "public boolean containFunction(String name) {\n\t\tif (!global.containFunction(name)) {\r\n\t\t\treturn this.fnMap.containsKey(name);\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\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 nameExists(String name){\n //What is going to return\n boolean result = true;\n \n //Values to do the query\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n \n \n \n try{\n //The process goes here...\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/process_checkout\",\"root\",\"\"\n );\n \n String query = \"SELECT * FROM area WHERE name = (?)\";\n \n ps = conn.prepareStatement(query);\n ps.setString(1, name);\n rs = ps.executeQuery();\n result = rs.next();\n \n }catch(SQLException e){\n \n } catch (ClassNotFoundException ex) {\n \n }finally{\n try {\n if(rs != null)rs.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(ps != null)ps.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(conn != null)conn.close();\n } catch (SQLException e) {\n /* ignored */ }\n }\n //What is going to return goes here...\n return result;\n \n }", "public boolean valid() {\n\t\tif (newFlag) {\n\t\t\tif (procNameText.getText() == null || StringUtil.isEmpty(procNameText.getText())) {\n\t\t\t\tCommonUITool.openErrorBox(getShell(), Messages.errInputProcedureName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!ValidateUtil.isValidIdentifier(procNameText.getText())) {\n\t\t\t\tCommonUITool.openErrorBox(getShell(),\n\t\t\t\t\t\tMessages.bind(Messages.errInputParameterNameValid, procNameText.getText()));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (procNameText.getText().length() > ValidateUtil.MAX_SCHEMA_NAME_LENGTH) {\n\t\t\t\tCommonUITool.openErrorBox(Messages.bind(Messages.errInputFunctionNameLength, \"procedure\",\n\t\t\t\t\t\tValidateUtil.MAX_SCHEMA_NAME_LENGTH));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tString javaName = javaNameText.getText();\n\t\tif (javaName == null || \"\".equals(javaName)) {\n\t\t\tCommonUITool.openErrorBox(getShell(), Messages.errInputJavaProcedureName);\n\t\t\treturn false;\n\t\t}\n\n\t\tString[] javaNames = javaName.split(\"\\\\.\");\n\t\tboolean isValidJavaName = true;\n\t\tif (javaNames == null || javaNames.length != 2) {\n\t\t\tisValidJavaName = false;\n\t\t}\n\t\tfor (int i = 0; isValidJavaName && i < javaNames.length; i++) {\n\t\t\tif (!javaNames[i].matches(\"^[a-zA-Z_\\\\$].*\")) {\n\t\t\t\tisValidJavaName = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int j = 0; isValidJavaName && j < javaNames[i].length(); j++) {\n\t\t\t\tif (!Character.isJavaIdentifierPart(javaNames[i].charAt(j))) {\n\t\t\t\t\tisValidJavaName = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!isValidJavaName) {\n\t\t\tCommonUITool.openErrorBox(getShell(), Messages.errValidJavaFunctionName);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean existsInstance(String instanceName, String className)\r\n\t{\r\n\t\tif(!existsInstance(instanceName))\r\n\t\t\treturn false;\r\n\t\treturn isInstanceOf(instanceName, className);\r\n\t\t\r\n\t}", "public void removeProcedure(String name) {\n String nameInLowerCase = Ascii.toLowerCase(name);\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(procedures.containsKey(nameInLowerCase));\n procedures.remove(nameInLowerCase);\n }", "public static boolean isNamedProcess(Context context, String processName) {\n if (context == null) {\n return false;\n }\n\n int pid = android.os.Process.myPid();\n ActivityManager manager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);\n List<ActivityManager.RunningAppProcessInfo> processInfoList = manager.getRunningAppProcesses();\n if (processInfoList == null) {\n return true;\n }\n\n for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {\n if (processInfo.pid == pid && ObjectUtils.isEquals(processName, processInfo.processName)) {\n return true;\n }\n }\n return false;\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 }", "public static boolean isName( String name )\n {\n return isOs( null, name, null, null );\n }", "public static boolean checkName(String name) {\n\t\tMatcher matcher = NAME_PATTERN.matcher(name);\n\t\treturn matcher.find();\n\t}", "boolean hasModbusProc();", "public boolean hasGlyph(String name) throws IOException;", "boolean exists(String userName);", "public static boolean checkName(String name) {\r\n\t\tboolean result = false;\r\n\t\tif (check(name) && name.matches(CommandParameter.REG_EXP_NAME)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private boolean programIfExists(String compiledPath) {\n\t\tboolean itExists = false;\n\n\t\tif (Files.exists(Paths.get(compiledPath))) {\n\t\t\titExists = true;\n\t\t}\n\n\t\treturn itExists;\n\t}", "public boolean hasMethod( final String name )\n {\n return getMethod( name ) != null;\n }", "boolean hasVName();", "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 }", "boolean nameExists(Key name);", "boolean isResolvable(String name);", "public boolean checkName(String name)\n {\n return true;\n }", "public static boolean is_callable(String _name) {\n\t\treturn false;\n\t}", "private boolean checkHook(PluginHook name)\n\t{\n\t\tif (hooks.containsKey(name))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean isSetProcStat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(PROCSTAT$16) != 0;\n }\n }", "public boolean existPrinter(String printerName)\n {\n return getPrinterMap().containsKey(printerName);\n }", "public boolean existsClass(String name)\r\n\t{\r\n\t\treturn obtainOntClass(name) != null;\r\n\t}", "public boolean exists(String name) {\n \n for (String keyName : options.keySet()) {\n if (keyName.equals(name)) {\n return true;\n }\n }\n return false;\n }", "private boolean existsSymbol(String symbol) {\r\n\t\treturn ts.containsKey(symbol.hashCode());\r\n\t}", "public boolean exists (java.lang.String userClassName) { throw new RuntimeException(); }", "public boolean contains(String name) {\n return generators.containsKey(name);\n }", "public boolean findUserIsExist(String name) {\n\t\treturn false;\r\n\t}", "public abstract boolean doesExist();", "boolean hasServiceCmd();", "public boolean getExists() {\n try {\n return getExecutable(new Launcher.LocalLauncher(new StreamTaskListener(new NullStream()))) != null;\n } catch(IOException ex) {\n return false;\n } catch(InterruptedException e) {\n return false;\n }\n }", "public boolean sequenceExists(String sequenceName) {\r\n\tboolean result = false;\r\n\r\n\tPreparedStatement pr = null;\r\n\tResultSet rs = null;\r\n\r\n\ttry {\r\n\t pr = conn\r\n\t\t .prepareStatement(\"select count(1) from sqlite_sequence where name=?;\");\r\n\t pr.setString(1, sequenceName);\r\n\r\n\t rs = pr.executeQuery();\r\n\r\n\t if (rs.next()) {\r\n\t\tlong seqCount = rs.getInt(1);\r\n\r\n\t\tif (seqCount == 1) {\r\n\t\t result = true;\r\n\t\t}\r\n\t }\r\n\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t} finally {\r\n\t Cleanup(pr, rs);\r\n\t}\r\n\r\n\treturn result;\r\n }", "public boolean isBound(String name)\n {\n try\n {\n InitialContext ctx = new InitialContext();\n Object ds = ctx.lookup(name);\n if (ds == null) {\n return false;\n }\n return true;\n }\n catch (NamingException e)\n {\n return false;\n } // end of catch\n \n }", "public final boolean checkIfExistsTask(final String taskName) throws ValetSchedulerException {\n\n\t\ttry {\n\t\t\treturn checkIfExistJob(taskName);\n\t\t} catch (SchedulerException e) {\n\t\t\tString errorMsg = Language.getFormatResQuartzGeneral(IQuartzGeneralMessages.LOGMQ05, new Object[ ] { taskName, getSchedulerGroup() });\n\t\t\tthrow new ValetSchedulerException(IValetException.COD_185, errorMsg, e);\n\t\t}\n\n\t}", "ACommand CheckCommand(String NameCommand);", "public void setProcedureName(String procedureName){\n this.procedureName = procedureName;\n }", "private boolean isTypeExists(Context context, String typeName) throws Exception\r\n {\r\n boolean typeExists = false;\r\n //String command = \"temp query bus '\" + typeName + \"' * *\";\r\n String command = \"temp query bus $1 $2 $3\";\r\n\r\n String result = MqlUtil.mqlCommand(context, command,typeName,\"*\",\"*\");\r\n if (result != null && !result.isEmpty())\r\n {\r\n typeExists = true;\r\n }\r\n return typeExists;\r\n }", "public void verifyContractNotExistByName(int chainId, int groupId, String name, String path) {\n TbContract contract = tbContractMapper.getContract(chainId, groupId, name, path);\n if (Objects.nonNull(contract)) {\n log.warn(\"contract is exist. groupId:{} name:{} path:{}\", groupId, name, path);\n throw new BaseException(ConstantCode.CONTRACT_EXISTS);\n }\n }", "public static void main(String[] args) {\n\t\tisExistProgram prog = new isExistProgram();\n\t\t\n\t\tString fileName = \"BATCH01.EXE\";\n\t\tint isExist = prog.subDirList(\"./BATCH\", fileName);\n\t\tif(isExist == 1) {\n\t\t\tSystem.out.println(\"FILE EXIST\");\n\t\t}\n\t}", "public boolean exsitName(String name) {\n\t\tKynamic kynamic = this.kynamicDao.getKynamicByName(name);\r\n\t\treturn kynamic!=null?true:false;\r\n\t}", "boolean isNilPoolName();", "public boolean existsProperty(String name)\r\n\t{\r\n\t\treturn obtainOntProperty(name) != null;\r\n\t}", "public static boolean checkHasMethod(Class<?> clazz, String name, Object[] args) {\n\t\tif (!containers.containsKey(clazz)) containers.put(clazz, new DynamicMethodContainer(clazz));\n\t\treturn containers.get(clazz).containsMethod(args, name);\n\t}", "public static boolean doesClassExist(String nameWithPackage, Object instanceToGetClassloaderFrom) {\n boolean exists = false;\n\n try {\n Class.forName(nameWithPackage, false, instanceToGetClassloaderFrom.getClass().getClassLoader());\n exists = true;\n } catch (ClassNotFoundException e) {\n exists = false;\n }\n\n return exists;\n }", "public boolean isExist(String fileName){\n\t\tFile f = new File(fileName);\n\t\treturn f.exists();\n\t}", "@Override\n\tpublic boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean checkName(String name)\n\t{\n\t\treturn (robotHM.containsKey(name));\n\t}", "boolean existsByNameAndId(String name, int id);", "public boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean exists(String arg0) {\n\t\treturn false;\n\t}", "private boolean searchSystem(String name) {\n for (ExternalSystem system : connectedExternalSystems) {\n if (system.getSystemName().equals(name)){\n return true;\n }\n }\n\n return false;\n }", "public boolean fileExists(String name){\r\n try{\r\n new BufferedReader(new FileReader(\"../profiles/\" + name + \".profile\"));\r\n return true;\r\n }\r\n catch(FileNotFoundException e){\r\n return false;\r\n }\r\n }", "@Override\n\tpublic IProcedure getProcedure(String instanceId) throws NoSuchProcedure\n\t{\n\t\treturn m_models.getProcedure(instanceId);\n\t}" ]
[ "0.79082996", "0.6941644", "0.65984803", "0.6067599", "0.6027771", "0.5869049", "0.5859453", "0.5834725", "0.5767791", "0.5730782", "0.57125473", "0.5690937", "0.5684757", "0.5669646", "0.56615406", "0.56325454", "0.56137735", "0.5599155", "0.5505548", "0.53939694", "0.53921646", "0.53794277", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.536711", "0.53637826", "0.53546923", "0.53385115", "0.5297015", "0.52829605", "0.5272865", "0.5241779", "0.52397764", "0.5237056", "0.5229348", "0.5215466", "0.52138966", "0.5208732", "0.5189679", "0.517476", "0.5168022", "0.51666224", "0.5166221", "0.51503634", "0.5148093", "0.51415884", "0.5141317", "0.513344", "0.51328427", "0.5123252", "0.5120376", "0.5087081", "0.5075348", "0.5059516", "0.505864", "0.5057427", "0.50490296", "0.5045019", "0.50350577", "0.500852", "0.49960056", "0.49921995", "0.49890378", "0.49822572", "0.49812436", "0.49772522", "0.49766478", "0.49765", "0.4970351", "0.49593624", "0.49589232", "0.49474525", "0.49452338", "0.4935637", "0.4935637", "0.4935637", "0.49297118", "0.49282148", "0.49193308" ]
0.64253753
3
Checks the existence of a proc with the given name.
public HasProcResponse hasProc(String procName, Map<String, String> options) throws GPUdbException { HasProcRequest actualRequest_ = new HasProcRequest(procName, options); HasProcResponse actualResponse_ = new HasProcResponse(); submitRequest("/has/proc", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasProcedure(String procedureName) throws Exception;", "boolean hasProcedureNames();", "public HasProcResponse hasProc(HasProcRequest request) throws GPUdbException {\n HasProcResponse actualResponse_ = new HasProcResponse();\n submitRequest(\"/has/proc\", request, actualResponse_, false);\n return actualResponse_;\n }", "public boolean existsInstance(String name)\r\n\t{\r\n\t\treturn obtainOntResource(name) != null;\r\n\t}", "boolean existsByName(String name);", "boolean hasApplicationProcessName();", "public boolean exists(String name) throws IOException;", "public boolean hasParam(String name)\r\n {\r\n try {\r\n return lookup.get(name) != null;\r\n } catch(Exception e) {}\r\n \r\n return false;\r\n }", "public static boolean isStoredProcedureWhitelisted(String name) {\r\n return storedProceduresWhitelist.contains(name.toUpperCase());\r\n }", "public boolean hasProcedureNames() {\n return procedureNames_ != null;\n }", "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\n\t}", "public abstract boolean isInCallingProcedure(SDGNode n);", "boolean isProcedure(Object groupID) throws Exception;", "public boolean removeProcedureByName(String name){\n\t\tboolean result=false;\n\t\tfor(Procedure p: proceduresList){\n\t\t\tif(p.getName().equals(name)){\n\t\t\t\tsummaryPrice-=p.getPrice();\n\t\t\t\tproceduresList.remove(p);\n\t\t\t\tresult=true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "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 void checkShProcess(String processName, CallBack<String> callBack) {\n\n Log.d(TAG, \"checkShProcess ... start ...\");\n\n Process process = null;\n Runtime runtime = Runtime.getRuntime();\n try {\n\n// String cmd = \"busybox ps -e|grep \\\"<processName>\\\"|grep -v grep|wc -l\";\n String cmd = \"busybox ps -e|grep \\\"\" + processName + \"\\\"|grep -v grep|wc -l\";\n process = runtime.exec(new String[]{\"su\", \"-c\", cmd});\n InputStream is = process.getInputStream();\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n String line;\n while ((line = reader.readLine()) != null) {\n Log.d(TAG, \"checkShProcess line result : \" + line);\n if (line.equals(\"0\")) {\n callBack.onResult(\"0\"); // No\n } else callBack.onResult(\"1\"); // Ok\n }\n\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n e.printStackTrace();\n callBack.onResult(\"error\");\n } finally {\n try {\n process.destroy();\n } catch (Exception e){}\n }\n }", "public static boolean exists(String path, String name) {\n return new File(path + name).exists();\n }", "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 }", "public boolean hasRequest (String name)\n {\n org.omg.CORBA.portable.InputStream $in = null;\n try {\n org.omg.CORBA.portable.OutputStream $out = _request (\"hasRequest\", true);\n $out.write_string (name);\n $in = _invoke ($out);\n boolean $result = $in.read_boolean ();\n return $result;\n } catch (org.omg.CORBA.portable.ApplicationException $ex) {\n $in = $ex.getInputStream ();\n String _id = $ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException $rm) {\n return hasRequest (name );\n } finally {\n _releaseReply ($in);\n }\n }", "public boolean hasProcedureNames() {\n return procedureNamesBuilder_ != null || procedureNames_ != null;\n }", "boolean hasFunction(String functionName);", "public boolean containFunction(String name) {\n\t\tif (!global.containFunction(name)) {\r\n\t\t\treturn this.fnMap.containsKey(name);\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\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 nameExists(String name){\n //What is going to return\n boolean result = true;\n \n //Values to do the query\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n \n \n \n try{\n //The process goes here...\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/process_checkout\",\"root\",\"\"\n );\n \n String query = \"SELECT * FROM area WHERE name = (?)\";\n \n ps = conn.prepareStatement(query);\n ps.setString(1, name);\n rs = ps.executeQuery();\n result = rs.next();\n \n }catch(SQLException e){\n \n } catch (ClassNotFoundException ex) {\n \n }finally{\n try {\n if(rs != null)rs.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(ps != null)ps.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(conn != null)conn.close();\n } catch (SQLException e) {\n /* ignored */ }\n }\n //What is going to return goes here...\n return result;\n \n }", "public boolean valid() {\n\t\tif (newFlag) {\n\t\t\tif (procNameText.getText() == null || StringUtil.isEmpty(procNameText.getText())) {\n\t\t\t\tCommonUITool.openErrorBox(getShell(), Messages.errInputProcedureName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!ValidateUtil.isValidIdentifier(procNameText.getText())) {\n\t\t\t\tCommonUITool.openErrorBox(getShell(),\n\t\t\t\t\t\tMessages.bind(Messages.errInputParameterNameValid, procNameText.getText()));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (procNameText.getText().length() > ValidateUtil.MAX_SCHEMA_NAME_LENGTH) {\n\t\t\t\tCommonUITool.openErrorBox(Messages.bind(Messages.errInputFunctionNameLength, \"procedure\",\n\t\t\t\t\t\tValidateUtil.MAX_SCHEMA_NAME_LENGTH));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tString javaName = javaNameText.getText();\n\t\tif (javaName == null || \"\".equals(javaName)) {\n\t\t\tCommonUITool.openErrorBox(getShell(), Messages.errInputJavaProcedureName);\n\t\t\treturn false;\n\t\t}\n\n\t\tString[] javaNames = javaName.split(\"\\\\.\");\n\t\tboolean isValidJavaName = true;\n\t\tif (javaNames == null || javaNames.length != 2) {\n\t\t\tisValidJavaName = false;\n\t\t}\n\t\tfor (int i = 0; isValidJavaName && i < javaNames.length; i++) {\n\t\t\tif (!javaNames[i].matches(\"^[a-zA-Z_\\\\$].*\")) {\n\t\t\t\tisValidJavaName = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int j = 0; isValidJavaName && j < javaNames[i].length(); j++) {\n\t\t\t\tif (!Character.isJavaIdentifierPart(javaNames[i].charAt(j))) {\n\t\t\t\t\tisValidJavaName = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!isValidJavaName) {\n\t\t\tCommonUITool.openErrorBox(getShell(), Messages.errValidJavaFunctionName);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean existsInstance(String instanceName, String className)\r\n\t{\r\n\t\tif(!existsInstance(instanceName))\r\n\t\t\treturn false;\r\n\t\treturn isInstanceOf(instanceName, className);\r\n\t\t\r\n\t}", "public void removeProcedure(String name) {\n String nameInLowerCase = Ascii.toLowerCase(name);\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(procedures.containsKey(nameInLowerCase));\n procedures.remove(nameInLowerCase);\n }", "public static boolean isNamedProcess(Context context, String processName) {\n if (context == null) {\n return false;\n }\n\n int pid = android.os.Process.myPid();\n ActivityManager manager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);\n List<ActivityManager.RunningAppProcessInfo> processInfoList = manager.getRunningAppProcesses();\n if (processInfoList == null) {\n return true;\n }\n\n for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {\n if (processInfo.pid == pid && ObjectUtils.isEquals(processName, processInfo.processName)) {\n return true;\n }\n }\n return false;\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 }", "public static boolean isName( String name )\n {\n return isOs( null, name, null, null );\n }", "public static boolean checkName(String name) {\n\t\tMatcher matcher = NAME_PATTERN.matcher(name);\n\t\treturn matcher.find();\n\t}", "boolean hasModbusProc();", "public boolean hasGlyph(String name) throws IOException;", "boolean exists(String userName);", "public static boolean checkName(String name) {\r\n\t\tboolean result = false;\r\n\t\tif (check(name) && name.matches(CommandParameter.REG_EXP_NAME)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private boolean programIfExists(String compiledPath) {\n\t\tboolean itExists = false;\n\n\t\tif (Files.exists(Paths.get(compiledPath))) {\n\t\t\titExists = true;\n\t\t}\n\n\t\treturn itExists;\n\t}", "public boolean hasMethod( final String name )\n {\n return getMethod( name ) != null;\n }", "boolean hasVName();", "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 }", "boolean nameExists(Key name);", "boolean isResolvable(String name);", "public boolean checkName(String name)\n {\n return true;\n }", "public static boolean is_callable(String _name) {\n\t\treturn false;\n\t}", "private boolean checkHook(PluginHook name)\n\t{\n\t\tif (hooks.containsKey(name))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean isSetProcStat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(PROCSTAT$16) != 0;\n }\n }", "public boolean existPrinter(String printerName)\n {\n return getPrinterMap().containsKey(printerName);\n }", "public boolean existsClass(String name)\r\n\t{\r\n\t\treturn obtainOntClass(name) != null;\r\n\t}", "public boolean exists(String name) {\n \n for (String keyName : options.keySet()) {\n if (keyName.equals(name)) {\n return true;\n }\n }\n return false;\n }", "private boolean existsSymbol(String symbol) {\r\n\t\treturn ts.containsKey(symbol.hashCode());\r\n\t}", "public boolean exists (java.lang.String userClassName) { throw new RuntimeException(); }", "public boolean contains(String name) {\n return generators.containsKey(name);\n }", "public boolean findUserIsExist(String name) {\n\t\treturn false;\r\n\t}", "public abstract boolean doesExist();", "boolean hasServiceCmd();", "public boolean getExists() {\n try {\n return getExecutable(new Launcher.LocalLauncher(new StreamTaskListener(new NullStream()))) != null;\n } catch(IOException ex) {\n return false;\n } catch(InterruptedException e) {\n return false;\n }\n }", "public boolean sequenceExists(String sequenceName) {\r\n\tboolean result = false;\r\n\r\n\tPreparedStatement pr = null;\r\n\tResultSet rs = null;\r\n\r\n\ttry {\r\n\t pr = conn\r\n\t\t .prepareStatement(\"select count(1) from sqlite_sequence where name=?;\");\r\n\t pr.setString(1, sequenceName);\r\n\r\n\t rs = pr.executeQuery();\r\n\r\n\t if (rs.next()) {\r\n\t\tlong seqCount = rs.getInt(1);\r\n\r\n\t\tif (seqCount == 1) {\r\n\t\t result = true;\r\n\t\t}\r\n\t }\r\n\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t} finally {\r\n\t Cleanup(pr, rs);\r\n\t}\r\n\r\n\treturn result;\r\n }", "public boolean isBound(String name)\n {\n try\n {\n InitialContext ctx = new InitialContext();\n Object ds = ctx.lookup(name);\n if (ds == null) {\n return false;\n }\n return true;\n }\n catch (NamingException e)\n {\n return false;\n } // end of catch\n \n }", "public final boolean checkIfExistsTask(final String taskName) throws ValetSchedulerException {\n\n\t\ttry {\n\t\t\treturn checkIfExistJob(taskName);\n\t\t} catch (SchedulerException e) {\n\t\t\tString errorMsg = Language.getFormatResQuartzGeneral(IQuartzGeneralMessages.LOGMQ05, new Object[ ] { taskName, getSchedulerGroup() });\n\t\t\tthrow new ValetSchedulerException(IValetException.COD_185, errorMsg, e);\n\t\t}\n\n\t}", "ACommand CheckCommand(String NameCommand);", "public void setProcedureName(String procedureName){\n this.procedureName = procedureName;\n }", "private boolean isTypeExists(Context context, String typeName) throws Exception\r\n {\r\n boolean typeExists = false;\r\n //String command = \"temp query bus '\" + typeName + \"' * *\";\r\n String command = \"temp query bus $1 $2 $3\";\r\n\r\n String result = MqlUtil.mqlCommand(context, command,typeName,\"*\",\"*\");\r\n if (result != null && !result.isEmpty())\r\n {\r\n typeExists = true;\r\n }\r\n return typeExists;\r\n }", "public void verifyContractNotExistByName(int chainId, int groupId, String name, String path) {\n TbContract contract = tbContractMapper.getContract(chainId, groupId, name, path);\n if (Objects.nonNull(contract)) {\n log.warn(\"contract is exist. groupId:{} name:{} path:{}\", groupId, name, path);\n throw new BaseException(ConstantCode.CONTRACT_EXISTS);\n }\n }", "public static void main(String[] args) {\n\t\tisExistProgram prog = new isExistProgram();\n\t\t\n\t\tString fileName = \"BATCH01.EXE\";\n\t\tint isExist = prog.subDirList(\"./BATCH\", fileName);\n\t\tif(isExist == 1) {\n\t\t\tSystem.out.println(\"FILE EXIST\");\n\t\t}\n\t}", "public boolean exsitName(String name) {\n\t\tKynamic kynamic = this.kynamicDao.getKynamicByName(name);\r\n\t\treturn kynamic!=null?true:false;\r\n\t}", "boolean isNilPoolName();", "public boolean existsProperty(String name)\r\n\t{\r\n\t\treturn obtainOntProperty(name) != null;\r\n\t}", "public static boolean checkHasMethod(Class<?> clazz, String name, Object[] args) {\n\t\tif (!containers.containsKey(clazz)) containers.put(clazz, new DynamicMethodContainer(clazz));\n\t\treturn containers.get(clazz).containsMethod(args, name);\n\t}", "public static boolean doesClassExist(String nameWithPackage, Object instanceToGetClassloaderFrom) {\n boolean exists = false;\n\n try {\n Class.forName(nameWithPackage, false, instanceToGetClassloaderFrom.getClass().getClassLoader());\n exists = true;\n } catch (ClassNotFoundException e) {\n exists = false;\n }\n\n return exists;\n }", "public boolean isExist(String fileName){\n\t\tFile f = new File(fileName);\n\t\treturn f.exists();\n\t}", "@Override\n\tpublic boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean checkName(String name)\n\t{\n\t\treturn (robotHM.containsKey(name));\n\t}", "boolean existsByNameAndId(String name, int id);", "public boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean exists(String arg0) {\n\t\treturn false;\n\t}", "private boolean searchSystem(String name) {\n for (ExternalSystem system : connectedExternalSystems) {\n if (system.getSystemName().equals(name)){\n return true;\n }\n }\n\n return false;\n }", "public boolean fileExists(String name){\r\n try{\r\n new BufferedReader(new FileReader(\"../profiles/\" + name + \".profile\"));\r\n return true;\r\n }\r\n catch(FileNotFoundException e){\r\n return false;\r\n }\r\n }", "@Override\n\tpublic IProcedure getProcedure(String instanceId) throws NoSuchProcedure\n\t{\n\t\treturn m_models.getProcedure(instanceId);\n\t}" ]
[ "0.79082996", "0.65984803", "0.64253753", "0.6067599", "0.6027771", "0.5869049", "0.5859453", "0.5834725", "0.5767791", "0.5730782", "0.57125473", "0.5690937", "0.5684757", "0.5669646", "0.56615406", "0.56325454", "0.56137735", "0.5599155", "0.5505548", "0.53939694", "0.53921646", "0.53794277", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.5378585", "0.536711", "0.53637826", "0.53546923", "0.53385115", "0.5297015", "0.52829605", "0.5272865", "0.5241779", "0.52397764", "0.5237056", "0.5229348", "0.5215466", "0.52138966", "0.5208732", "0.5189679", "0.517476", "0.5168022", "0.51666224", "0.5166221", "0.51503634", "0.5148093", "0.51415884", "0.5141317", "0.513344", "0.51328427", "0.5123252", "0.5120376", "0.5087081", "0.5075348", "0.5059516", "0.505864", "0.5057427", "0.50490296", "0.5045019", "0.50350577", "0.500852", "0.49960056", "0.49921995", "0.49890378", "0.49822572", "0.49812436", "0.49772522", "0.49766478", "0.49765", "0.4970351", "0.49593624", "0.49589232", "0.49474525", "0.49452338", "0.4935637", "0.4935637", "0.4935637", "0.49297118", "0.49282148", "0.49193308" ]
0.6941644
1
Checks for the existence of a table with the given name.
public HasTableResponse hasTable(HasTableRequest request) throws GPUdbException { HasTableResponse actualResponse_ = new HasTableResponse(); submitRequest("/has/table", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean table_exists(String table_name);", "public static boolean tableIsExist(String name) throws Exception {\n init();\n TableName tableName = TableName.valueOf(name);\n boolean flag = admin.tableExists(tableName);\n close();\n return flag;\n }", "private boolean tableExists(String tableName) {\n Connection conn = null;\n PreparedStatement stmt = null;\n String query = null;\n ResultSet rs = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.TABLE_CHECK_QUERY);\n stmt = conn.prepareStatement(query.replace(QueryManager.TABLE_NAME_PLACEHOLDER, tableName));\n rs = stmt.executeQuery();\n return true;\n } catch (SQLException e) {\n log.debug(\"Table '{}' assumed to not exist since its existence check query {} resulted \"\n + \"in exception {}.\", tableName, query, e.getMessage());\n return false;\n } finally {\n closeConnection(conn, stmt, rs);\n }\n }", "@Override\n public boolean doesTableExist(String table_name) {\n\n // silently return if connection is closed\n if (!is_open) {\n return false;\n }\n\n // loop through list of tables in metadata and check for table name\n try {\n DatabaseMetaData md = connection.getMetaData();\n\n // retrieve all of the tables from the connection edu.wpi.cs3733d18.teamS.database\n ResultSet rs = md.getTables(null, null, \"%\", null);\n\n while (rs.next()) {\n // table name is the third entry in the table object\n String extractedName = rs.getString(3).toLowerCase();\n\n if (extractedName.equals(table_name.toLowerCase())) {\n //System.out.println(\"Table with name \" + tableName + \" found!\");\n return true;\n }\n }\n } catch (SQLException e) {\n System.out.println(\"Table could not be found.\");\n e.printStackTrace();\n }\n\n // default return\n return false;\n\n }", "private boolean tableExists(String table) throws SQLException {\n if (HAVE_DB) {\n Connection con = DriverManager.getConnection(dbConnection, dbUser, dbPass);\n Statement stmt = con.createStatement();\n ResultSet rs;\n \n if (dbType.equals(\"mysql\")) {\n rs = stmt.executeQuery(\"SHOW TABLES\");\n }\n else {\n rs = stmt.executeQuery(\"select * from pg_tables\");\n }\n while(rs.next()) {\n String result = rs.getString(1);\n if (result.equals(table)) {\n return true;\n }\n }\n rs.close();\n stmt.close();\n con.close();\n return false;\n }\n else {\n return true;\n }\n }", "private boolean isTableExists(SQLiteDatabase db, String tableName) {\n boolean ret = false;\n String query = new StringBuilder(\"SELECT name FROM sqlite_master WHERE type='table' AND name='\")\n .append(tableName)\n .append(\"';\")\n .toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n if (resQuery.length() > 0) ret = true;\n return ret;\n }", "public boolean tableExists(String pTableName)\n {\n \t// Busca en el esquema la existencia de la tabla.\n \treturn true;\n }", "private boolean isTableExist(String tableName){\n\t\tboolean isExist = false;\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = dbReadable.rawQuery(\"select count(*) from \"+ tableName, null);\n\t\t\tisExist = true;\n\t\t} catch (Exception e) {\n\t\t\tisExist = false;\n\t\t} finally {\n\t\t\tif(cursor != null)\n\t\t\t\tcursor.close();\n\t\t}\n\t\t\n\t\treturn isExist;\n\t}", "private static boolean tableExists(Connection con, String table)\n {\n int numRows = 0;\n try\n {\n DatabaseMetaData dbmd = con.getMetaData();\n ResultSet rs = dbmd.getTables(null, null, table.toUpperCase(), null);\n while (rs.next())\n {\n ++numRows;\n }\n }\n catch (SQLException e)\n {\n String theError = e.getSQLState();\n System.out.println(\"Can't query DB metadata: \" + theError);\n System.exit(1);\n }\n return numRows > 0;\n }", "private boolean tableExists(String pTableName) {\r\n\t\tboolean returnedValue = false;\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\tCursor cursor = getDatabse().rawQuery(\"SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name = ?\", new String[] { pTableName });\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcursor.moveToLast();\r\n\t\t\t\t\tcursor.moveToFirst();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (cursor.getCount() > 0) {\r\n\t\t\t\t\t\treturnedValue = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tcursor.close();\r\n\t\t\t\t\tcursor = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "protected boolean hasTable(String tableName) {\n\t\tboolean tableNameAlreadyExists = false;\n\t\ttry {\n\t\t\tDatabaseMetaData dbm = conn.getMetaData();\n\t\t\t\n\t\t\tResultSet tableNameSet = dbm.getTables(null, null, \"Persons\", null);\n\t\t\tif (tableNameSet.next()) {\n\t\t\t\ttableNameAlreadyExists = true;\n\t\t\t}\n\t\t\ttableNameSet.close();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"ERROR in addTable(String tableName)...\");\n\t\t}\n\t\treturn tableNameAlreadyExists;\n\t}", "private boolean studentTableExists() throws SQLException{\n\n String checkTablePresentQuery = \"SHOW TABLES LIKE '\" + STUDENT_TABLE_NAME + \"'\"; //Can query the database schema\n ResultSet tablesRS = ConnectDB.statement.executeQuery(checkTablePresentQuery);\n return (tablesRS.next());\n }", "abstract boolean tableExist() throws SQLException;", "public static boolean \n\ttableExists\n\t(Activity actv, String dbName, String tableName) {\n\t\t// The table exists?\n\t\tDBUtils dbu = new DBUtils(actv, dbName);\n\t\t\n\t\t//\n\t\tSQLiteDatabase rdb = dbu.getReadableDatabase();\n\n\t\tCursor cursor = rdb.rawQuery(\n\t\t\t\t\"SELECT * FROM sqlite_master WHERE tbl_name = '\" + \n\t\t\t\t\t\ttableName + \"'\", null);\n\t\t\n\t\tactv.startManagingCursor(cursor);\n//\t\tactv.startManagingCursor(cursor);\n\t\t\n\t\t// Judge\n\t\tif (cursor.getCount() > 0) {\n\t\t\n\t\t\trdb.close();\n\t\t\treturn true;\n\t\t\t\n\t\t} else {//if (cursor.getCount() > 0)\n\t\t\t\n\t\t\trdb.close();\n\t\t\treturn false;\n\t\t\t\n\t\t}//if (cursor.getCount() > 0)\n\t\t\n\t}", "public static boolean existTable(String tableName) throws IOException {\n\t\tHBaseAdmin admin = new HBaseAdmin(Conf);\n\t\treturn admin.tableExists(tableName);\n\t}", "boolean tableExists(ObjectPath tablePath) throws CatalogException;", "public boolean isTableExists(String tableName, boolean openDb) {\n if (openDb)\n {\n if (db == null || !db.isOpen())\n {\n\n }\n\n if (!db.isReadOnly()) {\n\n\n }\n }\n\n Cursor cursor = db.rawQuery(\"select DISTINCT tbl_name from sqlite_master where tbl_name = '\" + tableName + \"'\", null);\n if (cursor != null) {\n if (cursor.getCount() > 0) {\n cursor.close();\n return true;\n }\n cursor.close();\n }\n return false;\n }", "private boolean checkTableExists(String plate){\n //there is no need to close or start connection\n //function is only used in the context of an already created connection\n \n try {\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(plate.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false;\n }", "private boolean isTableInDb() throws SQLException\n {\n final String sqlQuery = \"SELECT name FROM sqlite_master WHERE type='table' AND name='\" + TABLE_NAME +\n \"'\";\n\n try (\n final PreparedStatement statement = database.connection().prepareStatement(sqlQuery);\n final ResultSet resultSet = statement.executeQuery();\n )\n {\n if (!resultSet.next())\n return false;\n\n // read table name\n final String tableName = resultSet.getString(1);\n if (resultSet.wasNull() || !tableName.equals(TABLE_NAME))\n return false;\n }\n\n return true;\n }", "public boolean createTable(String name) {\n\t\tif (!tables.containsKey(name)) {\n\t\t\tTable newTable = new Table(name);\n\t\t\ttables.put(name, newTable);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static void checkTableForReg(Connection con, String tableName, String createTableQuery)\n throws SQLException\n {\n \tSystem.out.println(\"Checking for table \"+tableName);\n if(con.isValid(0))\n {\n Statement stmt = con.createStatement();\n DatabaseMetaData md = con.getMetaData();\n ResultSet rs = md.getTables(null, null, \"%\", null);\n if( !rs.next() )\n {\n \tSystem.out.println(\"Creating Table --> +\"+tableName);\n stmt.executeUpdate(createTableQuery);\n }\n else\n {\n do\n {\n if( tableName.equals(rs.getString(3)) )\n {\n \tSystem.out.println(\"Table \"+tableName+\" already present\");\n stmt.close();\n return;\n }\n }while (rs.next());\n System.out.println(\"Creating Table --> +\"+tableName);\n stmt.executeUpdate(createTableQuery);\n }\n stmt.close();\n System.out.println(\"Checking \"+tableName+\" done!!\");\n }\n }", "public static boolean tableExists(Connection connection, String tableName) throws SQLException {\n\t\tDatabaseMetaData databaseMetaData = connection.getMetaData();\n\t\tResultSet resultSet = null;\n\t\tString rsTableName = null;\n\n\t\ttry {\n\t\t\tresultSet = databaseMetaData.getTables(connection.getCatalog(), \"%\", \"%\", null);\n\t\t\twhile (resultSet.next()) {\n\t\t\t\trsTableName = resultSet.getString(\"TABLE_NAME\");\n\t\t\t\tif (rsTableName.equalsIgnoreCase(tableName)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tresultSet.close();\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean doesTableExist(Connection connection) throws SQLException {\n\tboolean bTableExists = false;\n \n\t// check the meta data of the connection\n\tDatabaseMetaData dmd = connection.getMetaData();\n\tResultSet rs = dmd.getTables (null, null, \"CREDIT\", null);\n\twhile (rs.next()){\n\t bTableExists = true;\n\t}\n\trs.close(); // close the result set\n\treturn bTableExists; \n }", "private boolean tableAlreadyExists(SQLException e) {\r\n boolean exists;\r\n if(e.getSQLState().equals(\"X0Y32\")) {\r\n exists = true;\r\n } else {\r\n exists = false;\r\n }\r\n return exists;\r\n }", "private boolean tableExistsAndIsOK() throws SQLException {\n trace(\"tableExistsAndIsOK\");\n boolean result;\n Statement stmt = _connection.createStatement();\n try {\n stmt.setMaxRows(1);\n String command = \"SELECT \" + LONG_VALUE + \" FROM \" + _tableName;\n ResultSet rs = stmt.executeQuery(command);\n rs.close();\n result = true;\n } catch (SQLException e) {\n result = false;\n }\n stmt.close();\n return result;\n }", "public static boolean checkOrCreateTable(jsqlite.Database db, String tableName){\n\t\t\n\t\tif (db != null){\n\t\t\t\n\t String query = \"SELECT name FROM sqlite_master WHERE type='table' AND name='\"+tableName+\"'\";\n\n\t boolean found = false;\n\t try {\n\t Stmt stmt = db.prepare(query);\n\t if( stmt.step() ) {\n\t String nomeStr = stmt.column_string(0);\n\t found = true;\n\t Log.v(\"SPATIALITE_UTILS\", \"Found table: \"+nomeStr);\n\t }\n\t stmt.close();\n\t } catch (Exception e) {\n\t Log.e(\"SPATIALITE_UTILS\", Log.getStackTraceString(e));\n\t return false;\n\t }\n\n\t\t\tif(found){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t// Table not found creating\n Log.v(\"SPATIALITE_UTILS\", \"Table \"+tableName+\" not found, creating..\");\n\t\t\t\t\n if(tableName.equalsIgnoreCase(\"punti_accumulo_data\")){\n\n \tString create_stmt = \"CREATE TABLE 'punti_accumulo_data' (\" +\n \t\t\t\"'PK_UID' INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n \t\t\t\"'ORIGIN_ID' TEXT, \" +\n \t\t\t\"'DATA_SCHEDA' TEXT, \" +\n \t\t\t\"'DATA_AGG' TEXT, \" +\n \t\t\t\"'NOME_RILEVATORE' TEXT, \" +\n \t\t\t\"'COGNOME_RILEVATORE' TEXT, \" +\n \t\t\t\"'ENTE_RILEVATORE' TEXT, \" +\n \t\t\t\"'TIPOLOGIA_SEGNALAZIONE' TEXT, \" +\n \t\t\t\"'PROVENIENZA_SEGNALAZIONE' TEXT, \" +\n \t\t\t\"'CODICE_DISCARICA' TEXT, \" +\n \t\t\t\"'TIPOLOGIA_RIFIUTO' TEXT, \" +\n \t\t\t\"'COMUNE' TEXT, \" +\n \t\t\t\"'LOCALITA' TEXT, \" +\n \t\t\t\"'INDIRIZZO' TEXT, \" +\n \t\t\t\"'CIVICO' TEXT, \" +\n \t\t\t\"'PRESA_IN_CARICO' TEXT, \" +\n \t\t\t\"'EMAIL' TEXT, \" +\n \t\t\t\"'RIMOZIONE' TEXT, \" +\n \t\t\t\"'SEQUESTRO' TEXT, \" +\n \t\t\t\"'RESPONSABILE_ABBANDONO' TEXT, \" +\n \t\t\t\"'QUANTITA_PRESUNTA' NUMERIC);\";\n\n \tString add_geom_stmt = \"SELECT AddGeometryColumn('punti_accumulo_data', 'GEOMETRY', 4326, 'POINT', 'XY');\";\n \tString create_idx_stmt = \"SELECT CreateSpatialIndex('punti_accumulo_data', 'GEOMETRY');\";\n \n \t// TODO: check if all statements are complete\n \t\n \ttry { \t\n \t\tStmt stmt01 = db.prepare(create_stmt);\n\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t\t//TODO This will never happen, CREATE statements return empty results\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Table Created\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// TODO: Check if created, fail otherwise\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01 = db.prepare(add_geom_stmt);\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Geometry Column Added \"+stmt01.column_string(0));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01 = db.prepare(create_idx_stmt);\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Index Created\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01.close();\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (jsqlite.Exception e) {\n\t\t\t\t\t\tLog.e(\"UTILS\", Log.getStackTraceString(e));\n\t\t\t\t\t}\n \treturn true;\n }\n\t\t\t}\n\t\t}else{\n\t\t\tLog.w(\"UTILS\", \"No valid database received, aborting..\");\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static boolean tableExists(Properties loginProperties, String redshiftURL, String tableName) {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(redshiftURL, loginProperties);\n\n Statement stmt = conn.createStatement();\n stmt.executeQuery(\"SELECT * FROM \" + tableName + \" LIMIT 1;\");\n stmt.close();\n conn.close();\n return true;\n } catch (SQLException e) {\n LOG.error(e);\n try {\n conn.close();\n } catch (Exception e1) {\n }\n return false;\n }\n }", "public static void checkTable( Connection con, String tableName, String createTableQuery)\n \t\tthrows SQLException, ClassNotFoundException\n {\n \tif(con.isValid(0))\n {\n Statement stmt = con.createStatement();\n DatabaseMetaData md = con.getMetaData();\n ResultSet rs = md.getTables(null, null, \"%\", null);\n if( !rs.next() )\n {\n stmt.executeUpdate(createTableQuery);\n stmt.close();\n return;\n }\n else\n {\n do\n {\n if( tableName.equals(rs.getString(3)) )\n {\n String query = \"drop table \"+ tableName +\";\";\n stmt.executeUpdate(query);\n stmt.executeUpdate(createTableQuery);\n }\n }while (rs.next());\n }\n stmt.close();\n }\n }", "public boolean existsMain(String table_name) {\n Cursor c = db.rawQuery(\"SELECT * FROM \" + MAIN_TABLE_NAME + \" WHERE \" + KEY_TABLE_NAME_MAIN + \" = '\" + table_name + \"'\", null);\n boolean exist = (c.getCount() > 0);\n c.close();\n return exist;\n }", "public boolean tableExists()\n throws DBException\n {\n DBConnection dbc = null;\n Statement stmt = null;\n ResultSet rs = null;\n boolean innodb = this.isMySQLInnoDB();\n try {\n int provID = DBProvider.getProvider().getID();\n\n /* connection */\n dbc = DBConnection.getDBConnection_read();\n\n /* check for SQLServer */\n if (provID == DBProvider.DB_SQLSERVER) {\n // - SQLServer \"COUNT(*)\"\n // - expect SQLException if does not exist\n boolean CUSTOM_SQLSERVER_EXISTS = false;\n String existsSel;\n if (CUSTOM_SQLSERVER_EXISTS) {\n // -- A full \"COUNT(*)\" runs slow on SQL Server.\n // -- \"SELECT COUNT(*) FROM (SELECT TOP 1 * FROM MSeventdata ) t\"\n StringBuffer sb = new StringBuffer();\n sb.append(\"SELECT COUNT(*) FROM (SELECT TOP 1 * FROM \");\n sb.append(this.getTranslatedTableName());\n sb.append(\" ) t;\"); // <-- is trailing \";\" required??\n existsSel = sb.toString();\n } else {\n // -- \"SELECT COUNT(*) FROM table\" \n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n existsSel = dsel.toString();\n }\n stmt = dbc.execute(existsSel); // may throw DBException, SQLException\n return true; // assume exists if no SQLException\n }\n\n /* check for non-MySQL */\n if (provID != DBProvider.DB_MYSQL) {\n // -- non-MySQL \"COUNT(*)\" \n // - \"SELECT COUNT(*) FROM table\"\n // - expect SQLException if does not exist\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n stmt = dbc.execute(dsel.toString()); // may throw DBException, SQLException\n return true; // assume exists if no SQLException\n }\n\n // ---------------------------------------------\n // MySQL below\n // SELECT COUNT(*) FROM (SELECT * FROM EventData LIMIT 1) EventData;\n\n /* InnoDB? */\n if (innodb) {\n // do not use \"COUNT(*)\" for table existance on InnoDB\n // \"SHOW COLUMNS FROM table\"\n //Print.logInfo(\"Using 'show columns' method for table existence ... \" + this.getTranslatedTableName());\n String xtableName = this.getTranslatedTableName();\n String sqlExists = \"SHOW COLUMNS FROM \" + this.getTranslatedTableName();\n stmt = dbc.execute(sqlExists); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n }\n\n /* get table existence */\n if (DBFactory.mysqlTableExistsUseSelectCount()) {\n /* VERY slow on Windows or InnoDB */ \n // \"SELECT COUNT(*) FROM table\"\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n stmt = dbc.execute(dsel.toString()); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n }\n\n /* alternate method for MySQL */ \n // \"SHOW COLUMNS FROM table\"\n //Print.logInfo(\"Using 'show columns' method for table existence ... \" + this.getTranslatedTableName());\n String xtableName = this.getTranslatedTableName();\n String sqlExists = \"SHOW COLUMNS FROM \" + this.getTranslatedTableName();\n stmt = dbc.execute(sqlExists); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n\n } catch (SQLException sqe) {\n\n String sqlMsg = sqe.getMessage();\n int errCode = sqe.getErrorCode();\n if (errCode == SQLERR_TABLE_NONEXIST) { // MySQL: ?\n return false;\n } else\n if (errCode == SQLERR_UNKNOWN_DATABASE) { // MySQL: ?\n String dbName = DBProvider.getDBName();\n Print.logError(\"Database does not exist '\" + dbName + \"'\"); // thus, table does not exist\n return false;\n } else\n if (errCode == MSQL_ERR_INVALID_OBJECT) { // SQLServer: :\n return false;\n } else\n if (sqlMsg.indexOf(\"does not exist\") >= 0) { // PostgreSQL: ?\n return false;\n } else {\n String dbName = DBProvider.getDBName();\n throw new DBException(\"Table Existance '\" + dbName + \"'\", sqe);\n }\n\n } finally {\n if (rs != null) { try { rs.close(); } catch (Throwable t) {} }\n if (stmt != null) { try { stmt.close(); } catch (Throwable t) {} }\n DBConnection.release(dbc);\n }\n\n }", "private boolean distBeltExists(){ \n String table = \"DISTBELT\";\n \n try {\n stmt = conn.createStatement();\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(table.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n stmt.close();\n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false; \n }", "public HasTableResponse hasTable(String tableName, Map<String, String> options) throws GPUdbException {\n HasTableRequest actualRequest_ = new HasTableRequest(tableName, options);\n HasTableResponse actualResponse_ = new HasTableResponse();\n submitRequest(\"/has/table\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public boolean lookup(String name){\n return table.containsKey(name);\n }", "public static void existOrCreateTable(Class classz){\n String tname = classz.getSimpleName();\n NLog.i(\"sqlo table name:%s\", tname);\n if( tables.get(tname) == null )\n createTable(classz);\n }", "boolean existsByName(String name);", "private boolean checkInputTableName(AccessInputMeta meta){\n if (meta.getTableName()==null || meta.getTableName().length()<1)\n {\n MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );\n mb.setMessage(BaseMessages.getString(PKG, \"AccessInputDialog.TableMissing.DialogMessage\"));\n mb.setText(BaseMessages.getString(PKG, \"System.Dialog.Error.Title\"));\n mb.open(); \n\n return false;\n }\n else\n {\n \treturn true;\n }\n\t}", "@Override\n\tpublic String ifTable(String table) {\n\t\treturn \"select 1 from user_tables where table_name ='\"+table+\"'\";\n\t}", "private static boolean checkTables(final SQLParser parser, final Map<String, TableData> catalog)\n\t{\n\t\tfinal Map<String, String> tables = parser.getFROM();\n\n\t\tfor(final String table : tables.values())\n\t\t{\n\t\t\tif(!catalog.containsKey(table))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Table \\\"\" + table + \"\\\" does not exist.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public Node findTable(String name) {\n\tNodeList tree = total.getDocumentElement().getChildNodes();\n\tfor (int i = 0; i < tree.getLength(); i++) {\n Node n = tree.item(i);\n if (n.getNodeName().equals(\"table\") &&\n n.getAttributes().getNamedItem(\"name\").getNodeValue().equals(name))\n return n;\n }\n throw new RuntimeException(\"Can't find table \" + name);\n }", "public boolean exists(String name) throws IOException;", "public static void main(String args[]) throws IOException {\n\t\tboolean bool = HBaseUtil.getAdmin().tableExists(\n\t\t\t\tTableName.valueOf(HBaseUtil.TABLE_NAME));\n\t\tSystem.out.println(bool);\n\t}", "public static boolean checkTableForLogIn( Connection con, String tableName )\n \t\tthrows SQLException\n {\n if(con.isValid(0))\n {\n DatabaseMetaData md = con.getMetaData();\n ResultSet rs = md.getTables(null, null, \"%\", null);\n if( !rs.next() )\n {\n return false;\n }\n else\n {\n do\n {\n if( tableName.equals(rs.getString(3)) )\n {\n return true;\n }\n }while (rs.next());\n }\n }\n return false;\n }", "public boolean openTable(String tblName)\r\n {\r\n String sql = \"Select * From \" + tblName;\r\n return querySql(sql);\r\n }", "public boolean doesGroupsTableExist() {\r\n\r\n\t\t// Variable Declarations\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement stmt = null;\r\n\r\n\t\ttry {\r\n\t\t\t// Connect to Database\r\n\t\t\tClass.forName(JDBC_DRIVER);\r\n\t\t\tconn = DriverManager.getConnection(DATABASE, USER, PASS);\r\n\r\n\t\t\t// Create SQL Statement\r\n\t\t\tString sql = \"SELECT name FROM sqlite_master\";\r\n\t\t\tstmt = conn.prepareStatement(sql);\r\n\r\n\t\t\t// Get ResultSet by Column Name\r\n\t\t\tResultSet rs = stmt.executeQuery();\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tString tName = rs.getString(\"name\");\r\n\t\t\t\tif (tName.equals(\"groups\")) {\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException se) {\r\n\t\t\t// Handle Errors for JDBC\r\n\t\t\tse.printStackTrace();\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// Handle Errors for Class\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t// Close Resources\r\n\t\t\ttry {\r\n\t\t\t\tif (stmt != null)\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t} catch (SQLException se2) {\r\n\t\t\t} // Nothing to do\r\n\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException se) {\r\n\t\t\t\tse.printStackTrace();\r\n\t\t\t} // End Finally Try/Catch\r\n\t\t} // End Try/Catch\r\n\r\n\t\treturn false;\r\n\t}", "public boolean tableHasRecords(String tableName) {\n\n int count = 0;\n\n try{\n PreparedStatement query = conn.prepareStatement(\"SELECT COUNT(id) AS 'count' FROM \" + tableName + \";\");\n ResultSet results = query.executeQuery();\n\n while (results.next()){\n count = results.getInt(\"count\");\n } \n\n if(count > 0){\n return true;\n }\n\n } catch (SQLException e){\n e.printStackTrace();\n }\n\n return false;\n }", "public boolean checkMasterdataTables(){\n boolean cat = tableExists(\"select c from Category c\");\n boolean quest = tableExists(\"select t from Question t\");\n\n if (!cat){\n System.out.println(\"Tabelle 'Category' exisitiert nicht!\");\n }\n\n if (!quest){\n System.out.println(\"Tabelle 'Question' exisitiert nicht!\");\n }\n\n if (cat && quest){\n // all tables exist\n return true;\n\n } else {\n // one or more tables dont exist\n return false;\n }\n }", "public boolean updateInformationSchemaTable(){\n\t\tSchema currentSchema = Schema.getSchemaInstance();\n\t\tString currentSchemaName = currentSchema.getCurrentSchema();\n\t\tboolean isFound = false;\n\t\ttry {\n\t\t\tRandomAccessFile tablesTableFile = new RandomAccessFile(\"information_schema.table.tbl\", \"rw\");\n\n\t\t\t//Searching to see if the information schema is present or not\n\t\t\twhile(tablesTableFile.getFilePointer() < tablesTableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tbyte varcharLength = tablesTableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tablesTableFile.readByte();\n\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\n\t\t\t\t\tString readTableName = \"\";\n\t\t\t\t\tbyte varcharTableLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < varcharTableLength; j++)\n\t\t\t\t\t\treadTableName += (char)tablesTableFile.readByte();\n\n\t\t\t\t\tif(readTableName.equals(tableName)){\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tSystem.out.println(\"Table '\" + tableName + \"' already exits...\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t} else {\n\t\t\t\t\tbyte traverseLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < traverseLength; j++)\n\t\t\t\t\t\ttablesTableFile.readByte();\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tif(!isFound){\n\t\t\t\t//Traversing to the end of file\n\t\t\t\ttablesTableFile.seek(tablesTableFile.length());\n\t\t\t\ttablesTableFile.writeByte(currentSchemaName.length()); // TABLE_SCHEMA\n\t\t\t\ttablesTableFile.writeBytes(currentSchemaName);\n\t\t\t\ttablesTableFile.writeByte(tableName.length()); // TABLE_NAME\n\t\t\t\ttablesTableFile.writeBytes(tableName);\n\t\t\t\ttablesTableFile.writeLong(0); // TABLE_ROWS\n\t\t\t}\n\n\t\t\ttablesTableFile.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}\t\n\t\treturn isFound;\n\t}", "public boolean checkTable(int layerId)\n\n {\n boolean isAvailable = false;\n try {\n\n //This statement will fetch all tables available in database.\n\n ResultSet rs1 = conn.getMetaData().getTables(null, null, null, null);\n while (rs1.next()) {\n\n String ld = rs1.getString(\"TABLE_NAME\");\n\n //This statement will extract digits from table names.\n if(!(ld.equals(\"PurgeTable\")||ld.equals(\"UserToCertMap\"))){\n String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n }\n /* String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n //This statement will compare layerid with digits of table names.*/\n\n }\n rs1.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return isAvailable;\n }", "private void checkTableRecord(final String value) {\n final DataSource dsValidatation = DataSourceFactory.createDataSource();\n dsValidatation.addTable(AFM_TBLS);\n dsValidatation.addField(TABLE_NAME);\n dsValidatation.addRestriction(Restrictions.eq(AFM_TBLS, TABLE_NAME, value));\n if (dsValidatation.getRecords().isEmpty() && !isTableNameSelected(value)) {\n this.requiredTablesNames.add(value);\n this.isDependencyNeeded = true;\n }\n }", "public boolean maketable() {\n String query = \"\";\n if (connect != null) {\n try {\n java.sql.DatabaseMetaData dbmd = connect.getMetaData();\n ResultSet rs = dbmd.getTables(null, null, \"PLAYERNAME\", null);\n if (rs.next()) {//If it is existed\n System.out.println(\"table exists\");\n } else {//otherwise, create the table\n query = \"create table score(\\n\"\n + \"nickname varchar(40) not null,\\n\"\n + \"levels integer not null,\\n\"\n + \"highscore integer,\\n\"\n + \"numberkill integer,\\n\"\n + \"constraint pk_nickname_score PRIMARY KEY (nickname)\\n\"\n + \")\";\n ps = connect.prepareStatement(query);\n ps.execute();//Execute the SQL statement\n System.out.println(\"new table created\");\n }\n } catch (SQLException ex) {\n System.out.println(\"table create failed\");\n ex.printStackTrace();\n }\n } else {\n System.out.println(\"Connect failed.\");\n }\n return true;\n }", "boolean nameExists(Key name);", "private boolean exists() {\n try {\n DatabaseMetaData md = conn.getMetaData();\n ResultSet rs = md.getTables(null, null, \"settings\", null);\n return rs.next();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n return false;\n }\n }", "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\n\t}", "private boolean matchesTable (List tableNames, ColumnElement column)\n\t{\t\n\t\treturn ((column == null) ? true : tableNames.contains(\n\t\t\tcolumn.getDeclaringTable().getName().getName()));\n\t}", "private boolean isTableNameSelected(final String tableName) {\n \n final DataSource tableDataSource = DataSourceFactory.createDataSource();\n tableDataSource.addTable(ProjectUpdateWizardConstants.AFM_FLDS_TRANS);\n tableDataSource.addField(\"autonumbered_id\");\n tableDataSource.addRestriction(Restrictions.in(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n CHANGE_TYPE, DifferenceMessage.TBL_IS_NEW.name()));\n tableDataSource.addRestriction(Restrictions.eq(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n CHOSEN_ACTION, Actions.APPLY_CHANGE.getMessage()));\n tableDataSource.addRestriction(Restrictions.eq(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n TABLE_NAME, tableName));\n\n return tableDataSource.getRecords().size() > 0;\n }", "public boolean hasHeader(String headerName) {\n return nameTable.containsKey(headerName.toLowerCase());\n }", "String getTableName(String name);", "public boolean hasParentTable(String utableName)\n {\n return this.parentTables.contains(utableName);\n }", "private boolean pathHasValidTableName(String parent, String tableName) {\n String tableDirectory = \"/\" + tableName + \"/\";\n return !Strings.isNullOrEmpty(tableName) && parent.contains(tableDirectory) && !parent.endsWith(\"/\" + tableName);\n }", "public boolean checkEmptyTable(String table) {\n // Select query\n String selectQuery = \"SELECT count(*) FROM \" + table;\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n if (cursor != null) { cursor.moveToFirst(); }\n\n int countRows = cursor.getInt(0);\n\n return !(countRows > 0);\n }", "String printTable(String name) {\n\n try {\n return tables.get(name).getTable();\n } catch (IndexOutOfBoundsException e) {\n return \"ERROR: Cant print table\";\n } catch (NullPointerException e) {\n return \"ERROR: Cant print table\";\n }\n }", "@Test\n public void testVentas() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM ventas\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table ventas exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'ventas' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "public boolean databaseExists(String dbName) throws Exception;", "@Test\n public void testCaja() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM caja\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table caja exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'caja' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "@Test\n public void testUsuarios() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM usuarios\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table usuarios exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'usuarios' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "private boolean validTable(\n final Table table,\n final String tableName,\n final String databaseName,\n final List<ColumnDataType> columnTypes) {\n return table.getName().equals(tableName)\n && table.getDatabase().equals(databaseName)\n && columnsMatch(table, columnTypes);\n }", "public void checkIfHistoryTableExists() {\r\n\t\tWebElement element = getDriver().findElement(\r\n\t\t\t\tBy.cssSelector(\".lfr-search-container\"));\r\n\t\tboolean isDisplayed = false;\r\n\r\n\t\tif (element.isDisplayed()) {\r\n\t\t\tisDisplayed = true;\r\n\t\t}\r\n\t\tAssert.assertTrue(\"Table is not displayed\", isDisplayed);\r\n\t}", "boolean isUsingTable(UUID u) {\n return usingTables.getOrDefault(u, false);\n }", "String loadTable(String name) {\n\n\n String l;\n String[] line;\n String[] colNames;\n String[] colTypes;\n String[] values;\n\n\n try {\n\n if (tables.get(name) != null) {\n tables.remove(name);\n }\n FileReader fr = new FileReader(name + \".tbl\");\n BufferedReader bf = new BufferedReader(fr);\n\n\n if ((l = bf.readLine()) != null) {\n line = l.split(\"\\\\s*(,|\\\\s)\\\\s*\");\n } else {\n return \"ERROR: Empty Table\";\n }\n colNames = new String[line.length / 2];\n colTypes = new String[line.length / 2];\n\n int j = 0, k = 0;\n\n for (int i = 0; i < line.length; i += 1) {\n if (i % 2 == 0) {\n colNames[j] = line[i];\n j += 1;\n } else {\n colTypes[k] = line[i];\n k += 1;\n }\n\n }\n\n Table t = new Table(name, colNames, colTypes);\n tables.put(name, t);\n\n while ((l = bf.readLine()) != null) {\n values = l.split(\"\\\\s*(,)\\\\s*\");\n t.insertLastRow(values);\n }\n\n bf.close();\n return \"\";\n\n } catch (NullPointerException e) {\n return \"ERROR: \" + e;\n } catch (ArrayIndexOutOfBoundsException e) {\n return \"ERROR: \" + e;\n } catch (NumberFormatException e) {\n return \"ERROR: \" + e;\n } catch (IllegalArgumentException e) {\n return \"ERROR: \" + e;\n } catch (IOException e) {\n return \"ERROR: \" + e;\n } \n }", "public boolean checkIfRowExists(String tablename, int m) throws SQLException {\n String sql = \"SELECT * FROM \" + tablename + \" WHERE m = ?\";\n PreparedStatement preparedStatement = (PreparedStatement) this.getConn().prepareStatement(sql);\n preparedStatement.setInt(1, m);\n return ((ResultSet) preparedStatement.executeQuery()).next();\n }", "public void dropTableIfExists(String tableName) throws SQLException{\n\t\tStatement stmt = connection.createStatement();\n\t\tstmt.execute(\"DROP TABLE IF EXISTS \\\"\" + tableName + \"\\\"\"); \n\t\tstmt.close();\n\t}", "public TapTable findOneTable(String tableName);", "@Test\n public void testCorte_de_caja() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM corte_caja\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table corte_caja exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'corte_caja' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "public boolean createTable(SQLiteDatabase db, String tableName) {\n\t\t//\n//\t\tif (!tableExists(db, tableName)) {\n\t\tif (tableExists(db, tableName)) {\n\t\t\t// Log\n\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Table exists => \" + tableName);\n\t\t\t\n\t\t\treturn false;\n\t\t}//if (!tableExists(SQLiteDatabase db, String tableName))\n\t\t\n\t\t//\n\t\tString sql = \"CREATE TABLE \" + tableName + \" (\"\n\t\t\t\t+ android.provider.BaseColumns._ID\n\t\t\t\t+ \" INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n\t\t\t\t\"store TEXT, name TEXT, price INTEGER, genre TEXT);\";\n\t\t\n\t\t//\n\t\ttry {\n\t\t\tdb.execSQL(sql);\n\t\t\t\n\t\t\t// Log\n\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Table created => \" + tableName);\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e) {\n\t\t\t// Log\n\t\t\tLog.d(\"MemoDBHelper.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Exception => \" + e.toString());\n\t\t\t\n\t\t\treturn false;\n\t\t}//try\n\t\t\n\t}", "String createNewTable(String name,\n String[] colNames, String[] colTypes) {\n\n try {\n if (tables.get(name) != null) {\n return \"ERROR: Table already exists\";\n\n }\n Table t = new Table(name, colNames, colTypes);\n tables.put(name, t);\n\n return \"\";\n } catch (NullPointerException e) {\n return \"ERROR: Malformed Table\";\n } catch (IllegalArgumentException e) {\n return \"ERROR: Malformed Table\";\n }\n\n\n }", "public static boolean isTableClass(String utableName, Class<?> tableClass)\n {\n return DBFactory.isTableClass(DBFactory.getFactoryByName(utableName), tableClass);\n }", "@Test\n public void testProductos() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM productos\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table productos exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'productos' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "public boolean columExists(String pTableName, String pColumnName)\n {\n \t// Busca en la tabla la columna deseada.\n \treturn true;\n }", "public boolean isSetTableName() {\n return this.tableName != null;\n }", "public boolean nameExists(String name){\n //What is going to return\n boolean result = true;\n \n //Values to do the query\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n \n \n \n try{\n //The process goes here...\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/process_checkout\",\"root\",\"\"\n );\n \n String query = \"SELECT * FROM area WHERE name = (?)\";\n \n ps = conn.prepareStatement(query);\n ps.setString(1, name);\n rs = ps.executeQuery();\n result = rs.next();\n \n }catch(SQLException e){\n \n } catch (ClassNotFoundException ex) {\n \n }finally{\n try {\n if(rs != null)rs.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(ps != null)ps.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(conn != null)conn.close();\n } catch (SQLException e) {\n /* ignored */ }\n }\n //What is going to return goes here...\n return result;\n \n }", "void delete_table(String table_name) {\n //table does not exist\n if (!get_table_names().contains(table_name) && !table_name.equals(\"relationship\")) {\n throw new RuntimeException(\"Table does not exists and can therefore not be deleted.\");\n }\n\n String sql = \"drop table if exists \" + table_name;\n\n execute_statement(sql, false);\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean checkIfDatabaseExists() {\r\n return database.exists();\r\n }", "boolean dbExists(String dbName);", "public boolean supportsTableCheck() {\n \t\treturn true;\n \t}", "public BigQueryTable ensureExists() {\n if (!exists()) {\n create();\n }\n return this;\n }", "@Test\n void testAddTablesByName() {\n when(bigQueryResourceProviderMock.getTables(anyString(), anyList()))\n .thenReturn(List.of(exampleTableInDefaultProject));\n\n // Add the tables by name\n bigQueryCatalog.addTables(List.of(exampleTableInDefaultProject.getFullName()));\n\n // Verify the BigQueryCatalog got the tables from the BigQueryResourceProvider\n verify(bigQueryResourceProviderMock, times(1)).getTables(anyString(), anyList());\n\n // Verify the test table was added to the catalog\n List<List<String>> pathsWhereTableShouldBe =\n this.buildPathsWhereResourceShouldBe(exampleTableInDefaultProject.getFullName());\n assertTableExistsAtPaths(bigQueryCatalog, pathsWhereTableShouldBe);\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 }", "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}", "String dropTable(String name) {\n\n\n try {\n if (tables.get(name).equals(null)) {\n return \"ERROR: Table Does Not Exist\";\n }\n tables.remove(name);\n return \"\";\n } catch (NoSuchElementException e) {\n return \"ERROR: Delete operation failed.\";\n\n } catch (DirectoryIteratorException e) {\n return \"ERROR: Delete operation failed.\";\n } catch (NullPointerException e) {\n return \"ERROR: Delete operation failed.\";\n }\n\n }", "private static int getTableCount(ISession session, String tableName) {\n int result = -1;\n ResultSet rs = null;\n try {\n String sql = \"select count(*) from \"+tableName; \n rs = executeQuery(session, sql);\n if (rs.next()) {\n result = rs.getInt(1);\n }\n } catch (Exception e) {\n /* Do Nothing - this can happen when the table doesn't exist */\n } finally {\n SQLUtilities.closeResultSet(rs, true);\n }\n return result; \n }", "public boolean exists(String databaseName) {\n return context.databaseExists(databaseName);\n }", "public static boolean existPlayer(String name) throws SQLException, BaseDeDonnéesExcetion, ClassNotFoundException {\r\n Connection conn = null;\r\n String query = \"SELECT * FROM PokerPlayer2 WHERE name = ?\";\r\n try {\r\n conn = DriverManagerP.getConnection();\r\n PreparedStatement preparedStmt = conn.prepareStatement(query);\r\n preparedStmt.setString(1, name);\r\n ResultSet result = preparedStmt.executeQuery();\r\n if (result.next()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } catch (SQLException e) {\r\n throw new SQLException(\" impossible to find player \" + name + \" \" + e.getMessage());\r\n }\r\n\r\n }", "public void setTableName(String name) {\n this.tableName = name;\n }", "public static int createTable(String query,String tableName){\n\t\tDatabaseMetaData databaseMetaData ;\n\t\tResultSet resultSet = null;\n\t\tStatement statement = null;\n\t\tint result = 0;\n\t\ttry{\n\t\t\tconnectDatabase();\n\t\t\tdatabaseMetaData = connection.getMetaData();\n\t\t\t// find if any table with same name exists\n\t\t\tresultSet = databaseMetaData.getTables(null,null,tableName,null);\n\t\t\tif (!resultSet.next()) {\n\t\t\t\t// if not the create one\n\t\t\t\tstatement = connection.createStatement();\n\t\t\t\tresult = statement.executeUpdate(query);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry{\n\t\t\t\tif (statement != null) statement.close();\n\t\t\t\tif (resultSet != null) resultSet.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tdisconnectDatabase();\n\t\t}\n\t\treturn result;\n\t}", "boolean createTable(\n String tableName,\n MapStoreTableKey tableKey\n );" ]
[ "0.7990203", "0.79363775", "0.77897185", "0.7623444", "0.74957997", "0.74624455", "0.7400743", "0.73315364", "0.7202418", "0.7199996", "0.7108825", "0.70996547", "0.70572335", "0.70517", "0.7022819", "0.69696844", "0.69575983", "0.69402516", "0.6932222", "0.6885275", "0.6838837", "0.6781066", "0.66603917", "0.6539595", "0.65179944", "0.64671445", "0.64527863", "0.6410946", "0.63843673", "0.62631345", "0.61779785", "0.61652756", "0.61064994", "0.61062616", "0.6072468", "0.60534865", "0.6051514", "0.60053277", "0.58952624", "0.5885939", "0.5871634", "0.5856789", "0.5852432", "0.58482045", "0.5830211", "0.5821443", "0.5812073", "0.5774884", "0.57399946", "0.57259905", "0.5713557", "0.56929", "0.5655591", "0.5650722", "0.5649156", "0.5643715", "0.5640085", "0.56048864", "0.56027675", "0.55865204", "0.55787647", "0.55768275", "0.5547735", "0.55371636", "0.55193025", "0.551866", "0.55012053", "0.548539", "0.5475855", "0.54673266", "0.5466166", "0.5460386", "0.54592407", "0.5452092", "0.5441351", "0.54090333", "0.5400897", "0.53990346", "0.538658", "0.53862095", "0.5366463", "0.5364784", "0.5364784", "0.5364784", "0.5364784", "0.5364784", "0.53556037", "0.53521246", "0.5347551", "0.53374064", "0.5332564", "0.5316687", "0.53005016", "0.52941024", "0.52841264", "0.52775866", "0.5269102", "0.5259443", "0.52435714", "0.52399236" ]
0.63706344
29
Checks for the existence of a table with the given name.
public HasTableResponse hasTable(String tableName, Map<String, String> options) throws GPUdbException { HasTableRequest actualRequest_ = new HasTableRequest(tableName, options); HasTableResponse actualResponse_ = new HasTableResponse(); submitRequest("/has/table", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean table_exists(String table_name);", "public static boolean tableIsExist(String name) throws Exception {\n init();\n TableName tableName = TableName.valueOf(name);\n boolean flag = admin.tableExists(tableName);\n close();\n return flag;\n }", "private boolean tableExists(String tableName) {\n Connection conn = null;\n PreparedStatement stmt = null;\n String query = null;\n ResultSet rs = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.TABLE_CHECK_QUERY);\n stmt = conn.prepareStatement(query.replace(QueryManager.TABLE_NAME_PLACEHOLDER, tableName));\n rs = stmt.executeQuery();\n return true;\n } catch (SQLException e) {\n log.debug(\"Table '{}' assumed to not exist since its existence check query {} resulted \"\n + \"in exception {}.\", tableName, query, e.getMessage());\n return false;\n } finally {\n closeConnection(conn, stmt, rs);\n }\n }", "@Override\n public boolean doesTableExist(String table_name) {\n\n // silently return if connection is closed\n if (!is_open) {\n return false;\n }\n\n // loop through list of tables in metadata and check for table name\n try {\n DatabaseMetaData md = connection.getMetaData();\n\n // retrieve all of the tables from the connection edu.wpi.cs3733d18.teamS.database\n ResultSet rs = md.getTables(null, null, \"%\", null);\n\n while (rs.next()) {\n // table name is the third entry in the table object\n String extractedName = rs.getString(3).toLowerCase();\n\n if (extractedName.equals(table_name.toLowerCase())) {\n //System.out.println(\"Table with name \" + tableName + \" found!\");\n return true;\n }\n }\n } catch (SQLException e) {\n System.out.println(\"Table could not be found.\");\n e.printStackTrace();\n }\n\n // default return\n return false;\n\n }", "private boolean tableExists(String table) throws SQLException {\n if (HAVE_DB) {\n Connection con = DriverManager.getConnection(dbConnection, dbUser, dbPass);\n Statement stmt = con.createStatement();\n ResultSet rs;\n \n if (dbType.equals(\"mysql\")) {\n rs = stmt.executeQuery(\"SHOW TABLES\");\n }\n else {\n rs = stmt.executeQuery(\"select * from pg_tables\");\n }\n while(rs.next()) {\n String result = rs.getString(1);\n if (result.equals(table)) {\n return true;\n }\n }\n rs.close();\n stmt.close();\n con.close();\n return false;\n }\n else {\n return true;\n }\n }", "private boolean isTableExists(SQLiteDatabase db, String tableName) {\n boolean ret = false;\n String query = new StringBuilder(\"SELECT name FROM sqlite_master WHERE type='table' AND name='\")\n .append(tableName)\n .append(\"';\")\n .toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n if (resQuery.length() > 0) ret = true;\n return ret;\n }", "public boolean tableExists(String pTableName)\n {\n \t// Busca en el esquema la existencia de la tabla.\n \treturn true;\n }", "private boolean isTableExist(String tableName){\n\t\tboolean isExist = false;\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = dbReadable.rawQuery(\"select count(*) from \"+ tableName, null);\n\t\t\tisExist = true;\n\t\t} catch (Exception e) {\n\t\t\tisExist = false;\n\t\t} finally {\n\t\t\tif(cursor != null)\n\t\t\t\tcursor.close();\n\t\t}\n\t\t\n\t\treturn isExist;\n\t}", "private static boolean tableExists(Connection con, String table)\n {\n int numRows = 0;\n try\n {\n DatabaseMetaData dbmd = con.getMetaData();\n ResultSet rs = dbmd.getTables(null, null, table.toUpperCase(), null);\n while (rs.next())\n {\n ++numRows;\n }\n }\n catch (SQLException e)\n {\n String theError = e.getSQLState();\n System.out.println(\"Can't query DB metadata: \" + theError);\n System.exit(1);\n }\n return numRows > 0;\n }", "private boolean tableExists(String pTableName) {\r\n\t\tboolean returnedValue = false;\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\tCursor cursor = getDatabse().rawQuery(\"SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name = ?\", new String[] { pTableName });\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcursor.moveToLast();\r\n\t\t\t\t\tcursor.moveToFirst();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (cursor.getCount() > 0) {\r\n\t\t\t\t\t\treturnedValue = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tcursor.close();\r\n\t\t\t\t\tcursor = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "protected boolean hasTable(String tableName) {\n\t\tboolean tableNameAlreadyExists = false;\n\t\ttry {\n\t\t\tDatabaseMetaData dbm = conn.getMetaData();\n\t\t\t\n\t\t\tResultSet tableNameSet = dbm.getTables(null, null, \"Persons\", null);\n\t\t\tif (tableNameSet.next()) {\n\t\t\t\ttableNameAlreadyExists = true;\n\t\t\t}\n\t\t\ttableNameSet.close();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"ERROR in addTable(String tableName)...\");\n\t\t}\n\t\treturn tableNameAlreadyExists;\n\t}", "private boolean studentTableExists() throws SQLException{\n\n String checkTablePresentQuery = \"SHOW TABLES LIKE '\" + STUDENT_TABLE_NAME + \"'\"; //Can query the database schema\n ResultSet tablesRS = ConnectDB.statement.executeQuery(checkTablePresentQuery);\n return (tablesRS.next());\n }", "abstract boolean tableExist() throws SQLException;", "public static boolean \n\ttableExists\n\t(Activity actv, String dbName, String tableName) {\n\t\t// The table exists?\n\t\tDBUtils dbu = new DBUtils(actv, dbName);\n\t\t\n\t\t//\n\t\tSQLiteDatabase rdb = dbu.getReadableDatabase();\n\n\t\tCursor cursor = rdb.rawQuery(\n\t\t\t\t\"SELECT * FROM sqlite_master WHERE tbl_name = '\" + \n\t\t\t\t\t\ttableName + \"'\", null);\n\t\t\n\t\tactv.startManagingCursor(cursor);\n//\t\tactv.startManagingCursor(cursor);\n\t\t\n\t\t// Judge\n\t\tif (cursor.getCount() > 0) {\n\t\t\n\t\t\trdb.close();\n\t\t\treturn true;\n\t\t\t\n\t\t} else {//if (cursor.getCount() > 0)\n\t\t\t\n\t\t\trdb.close();\n\t\t\treturn false;\n\t\t\t\n\t\t}//if (cursor.getCount() > 0)\n\t\t\n\t}", "public static boolean existTable(String tableName) throws IOException {\n\t\tHBaseAdmin admin = new HBaseAdmin(Conf);\n\t\treturn admin.tableExists(tableName);\n\t}", "boolean tableExists(ObjectPath tablePath) throws CatalogException;", "public boolean isTableExists(String tableName, boolean openDb) {\n if (openDb)\n {\n if (db == null || !db.isOpen())\n {\n\n }\n\n if (!db.isReadOnly()) {\n\n\n }\n }\n\n Cursor cursor = db.rawQuery(\"select DISTINCT tbl_name from sqlite_master where tbl_name = '\" + tableName + \"'\", null);\n if (cursor != null) {\n if (cursor.getCount() > 0) {\n cursor.close();\n return true;\n }\n cursor.close();\n }\n return false;\n }", "private boolean checkTableExists(String plate){\n //there is no need to close or start connection\n //function is only used in the context of an already created connection\n \n try {\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(plate.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false;\n }", "private boolean isTableInDb() throws SQLException\n {\n final String sqlQuery = \"SELECT name FROM sqlite_master WHERE type='table' AND name='\" + TABLE_NAME +\n \"'\";\n\n try (\n final PreparedStatement statement = database.connection().prepareStatement(sqlQuery);\n final ResultSet resultSet = statement.executeQuery();\n )\n {\n if (!resultSet.next())\n return false;\n\n // read table name\n final String tableName = resultSet.getString(1);\n if (resultSet.wasNull() || !tableName.equals(TABLE_NAME))\n return false;\n }\n\n return true;\n }", "public boolean createTable(String name) {\n\t\tif (!tables.containsKey(name)) {\n\t\t\tTable newTable = new Table(name);\n\t\t\ttables.put(name, newTable);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static void checkTableForReg(Connection con, String tableName, String createTableQuery)\n throws SQLException\n {\n \tSystem.out.println(\"Checking for table \"+tableName);\n if(con.isValid(0))\n {\n Statement stmt = con.createStatement();\n DatabaseMetaData md = con.getMetaData();\n ResultSet rs = md.getTables(null, null, \"%\", null);\n if( !rs.next() )\n {\n \tSystem.out.println(\"Creating Table --> +\"+tableName);\n stmt.executeUpdate(createTableQuery);\n }\n else\n {\n do\n {\n if( tableName.equals(rs.getString(3)) )\n {\n \tSystem.out.println(\"Table \"+tableName+\" already present\");\n stmt.close();\n return;\n }\n }while (rs.next());\n System.out.println(\"Creating Table --> +\"+tableName);\n stmt.executeUpdate(createTableQuery);\n }\n stmt.close();\n System.out.println(\"Checking \"+tableName+\" done!!\");\n }\n }", "public static boolean tableExists(Connection connection, String tableName) throws SQLException {\n\t\tDatabaseMetaData databaseMetaData = connection.getMetaData();\n\t\tResultSet resultSet = null;\n\t\tString rsTableName = null;\n\n\t\ttry {\n\t\t\tresultSet = databaseMetaData.getTables(connection.getCatalog(), \"%\", \"%\", null);\n\t\t\twhile (resultSet.next()) {\n\t\t\t\trsTableName = resultSet.getString(\"TABLE_NAME\");\n\t\t\t\tif (rsTableName.equalsIgnoreCase(tableName)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tresultSet.close();\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean doesTableExist(Connection connection) throws SQLException {\n\tboolean bTableExists = false;\n \n\t// check the meta data of the connection\n\tDatabaseMetaData dmd = connection.getMetaData();\n\tResultSet rs = dmd.getTables (null, null, \"CREDIT\", null);\n\twhile (rs.next()){\n\t bTableExists = true;\n\t}\n\trs.close(); // close the result set\n\treturn bTableExists; \n }", "private boolean tableAlreadyExists(SQLException e) {\r\n boolean exists;\r\n if(e.getSQLState().equals(\"X0Y32\")) {\r\n exists = true;\r\n } else {\r\n exists = false;\r\n }\r\n return exists;\r\n }", "private boolean tableExistsAndIsOK() throws SQLException {\n trace(\"tableExistsAndIsOK\");\n boolean result;\n Statement stmt = _connection.createStatement();\n try {\n stmt.setMaxRows(1);\n String command = \"SELECT \" + LONG_VALUE + \" FROM \" + _tableName;\n ResultSet rs = stmt.executeQuery(command);\n rs.close();\n result = true;\n } catch (SQLException e) {\n result = false;\n }\n stmt.close();\n return result;\n }", "public static boolean checkOrCreateTable(jsqlite.Database db, String tableName){\n\t\t\n\t\tif (db != null){\n\t\t\t\n\t String query = \"SELECT name FROM sqlite_master WHERE type='table' AND name='\"+tableName+\"'\";\n\n\t boolean found = false;\n\t try {\n\t Stmt stmt = db.prepare(query);\n\t if( stmt.step() ) {\n\t String nomeStr = stmt.column_string(0);\n\t found = true;\n\t Log.v(\"SPATIALITE_UTILS\", \"Found table: \"+nomeStr);\n\t }\n\t stmt.close();\n\t } catch (Exception e) {\n\t Log.e(\"SPATIALITE_UTILS\", Log.getStackTraceString(e));\n\t return false;\n\t }\n\n\t\t\tif(found){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t// Table not found creating\n Log.v(\"SPATIALITE_UTILS\", \"Table \"+tableName+\" not found, creating..\");\n\t\t\t\t\n if(tableName.equalsIgnoreCase(\"punti_accumulo_data\")){\n\n \tString create_stmt = \"CREATE TABLE 'punti_accumulo_data' (\" +\n \t\t\t\"'PK_UID' INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n \t\t\t\"'ORIGIN_ID' TEXT, \" +\n \t\t\t\"'DATA_SCHEDA' TEXT, \" +\n \t\t\t\"'DATA_AGG' TEXT, \" +\n \t\t\t\"'NOME_RILEVATORE' TEXT, \" +\n \t\t\t\"'COGNOME_RILEVATORE' TEXT, \" +\n \t\t\t\"'ENTE_RILEVATORE' TEXT, \" +\n \t\t\t\"'TIPOLOGIA_SEGNALAZIONE' TEXT, \" +\n \t\t\t\"'PROVENIENZA_SEGNALAZIONE' TEXT, \" +\n \t\t\t\"'CODICE_DISCARICA' TEXT, \" +\n \t\t\t\"'TIPOLOGIA_RIFIUTO' TEXT, \" +\n \t\t\t\"'COMUNE' TEXT, \" +\n \t\t\t\"'LOCALITA' TEXT, \" +\n \t\t\t\"'INDIRIZZO' TEXT, \" +\n \t\t\t\"'CIVICO' TEXT, \" +\n \t\t\t\"'PRESA_IN_CARICO' TEXT, \" +\n \t\t\t\"'EMAIL' TEXT, \" +\n \t\t\t\"'RIMOZIONE' TEXT, \" +\n \t\t\t\"'SEQUESTRO' TEXT, \" +\n \t\t\t\"'RESPONSABILE_ABBANDONO' TEXT, \" +\n \t\t\t\"'QUANTITA_PRESUNTA' NUMERIC);\";\n\n \tString add_geom_stmt = \"SELECT AddGeometryColumn('punti_accumulo_data', 'GEOMETRY', 4326, 'POINT', 'XY');\";\n \tString create_idx_stmt = \"SELECT CreateSpatialIndex('punti_accumulo_data', 'GEOMETRY');\";\n \n \t// TODO: check if all statements are complete\n \t\n \ttry { \t\n \t\tStmt stmt01 = db.prepare(create_stmt);\n\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t\t//TODO This will never happen, CREATE statements return empty results\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Table Created\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// TODO: Check if created, fail otherwise\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01 = db.prepare(add_geom_stmt);\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Geometry Column Added \"+stmt01.column_string(0));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01 = db.prepare(create_idx_stmt);\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Index Created\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01.close();\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (jsqlite.Exception e) {\n\t\t\t\t\t\tLog.e(\"UTILS\", Log.getStackTraceString(e));\n\t\t\t\t\t}\n \treturn true;\n }\n\t\t\t}\n\t\t}else{\n\t\t\tLog.w(\"UTILS\", \"No valid database received, aborting..\");\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static boolean tableExists(Properties loginProperties, String redshiftURL, String tableName) {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(redshiftURL, loginProperties);\n\n Statement stmt = conn.createStatement();\n stmt.executeQuery(\"SELECT * FROM \" + tableName + \" LIMIT 1;\");\n stmt.close();\n conn.close();\n return true;\n } catch (SQLException e) {\n LOG.error(e);\n try {\n conn.close();\n } catch (Exception e1) {\n }\n return false;\n }\n }", "public static void checkTable( Connection con, String tableName, String createTableQuery)\n \t\tthrows SQLException, ClassNotFoundException\n {\n \tif(con.isValid(0))\n {\n Statement stmt = con.createStatement();\n DatabaseMetaData md = con.getMetaData();\n ResultSet rs = md.getTables(null, null, \"%\", null);\n if( !rs.next() )\n {\n stmt.executeUpdate(createTableQuery);\n stmt.close();\n return;\n }\n else\n {\n do\n {\n if( tableName.equals(rs.getString(3)) )\n {\n String query = \"drop table \"+ tableName +\";\";\n stmt.executeUpdate(query);\n stmt.executeUpdate(createTableQuery);\n }\n }while (rs.next());\n }\n stmt.close();\n }\n }", "public boolean existsMain(String table_name) {\n Cursor c = db.rawQuery(\"SELECT * FROM \" + MAIN_TABLE_NAME + \" WHERE \" + KEY_TABLE_NAME_MAIN + \" = '\" + table_name + \"'\", null);\n boolean exist = (c.getCount() > 0);\n c.close();\n return exist;\n }", "public HasTableResponse hasTable(HasTableRequest request) throws GPUdbException {\n HasTableResponse actualResponse_ = new HasTableResponse();\n submitRequest(\"/has/table\", request, actualResponse_, false);\n return actualResponse_;\n }", "public boolean tableExists()\n throws DBException\n {\n DBConnection dbc = null;\n Statement stmt = null;\n ResultSet rs = null;\n boolean innodb = this.isMySQLInnoDB();\n try {\n int provID = DBProvider.getProvider().getID();\n\n /* connection */\n dbc = DBConnection.getDBConnection_read();\n\n /* check for SQLServer */\n if (provID == DBProvider.DB_SQLSERVER) {\n // - SQLServer \"COUNT(*)\"\n // - expect SQLException if does not exist\n boolean CUSTOM_SQLSERVER_EXISTS = false;\n String existsSel;\n if (CUSTOM_SQLSERVER_EXISTS) {\n // -- A full \"COUNT(*)\" runs slow on SQL Server.\n // -- \"SELECT COUNT(*) FROM (SELECT TOP 1 * FROM MSeventdata ) t\"\n StringBuffer sb = new StringBuffer();\n sb.append(\"SELECT COUNT(*) FROM (SELECT TOP 1 * FROM \");\n sb.append(this.getTranslatedTableName());\n sb.append(\" ) t;\"); // <-- is trailing \";\" required??\n existsSel = sb.toString();\n } else {\n // -- \"SELECT COUNT(*) FROM table\" \n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n existsSel = dsel.toString();\n }\n stmt = dbc.execute(existsSel); // may throw DBException, SQLException\n return true; // assume exists if no SQLException\n }\n\n /* check for non-MySQL */\n if (provID != DBProvider.DB_MYSQL) {\n // -- non-MySQL \"COUNT(*)\" \n // - \"SELECT COUNT(*) FROM table\"\n // - expect SQLException if does not exist\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n stmt = dbc.execute(dsel.toString()); // may throw DBException, SQLException\n return true; // assume exists if no SQLException\n }\n\n // ---------------------------------------------\n // MySQL below\n // SELECT COUNT(*) FROM (SELECT * FROM EventData LIMIT 1) EventData;\n\n /* InnoDB? */\n if (innodb) {\n // do not use \"COUNT(*)\" for table existance on InnoDB\n // \"SHOW COLUMNS FROM table\"\n //Print.logInfo(\"Using 'show columns' method for table existence ... \" + this.getTranslatedTableName());\n String xtableName = this.getTranslatedTableName();\n String sqlExists = \"SHOW COLUMNS FROM \" + this.getTranslatedTableName();\n stmt = dbc.execute(sqlExists); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n }\n\n /* get table existence */\n if (DBFactory.mysqlTableExistsUseSelectCount()) {\n /* VERY slow on Windows or InnoDB */ \n // \"SELECT COUNT(*) FROM table\"\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n stmt = dbc.execute(dsel.toString()); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n }\n\n /* alternate method for MySQL */ \n // \"SHOW COLUMNS FROM table\"\n //Print.logInfo(\"Using 'show columns' method for table existence ... \" + this.getTranslatedTableName());\n String xtableName = this.getTranslatedTableName();\n String sqlExists = \"SHOW COLUMNS FROM \" + this.getTranslatedTableName();\n stmt = dbc.execute(sqlExists); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n\n } catch (SQLException sqe) {\n\n String sqlMsg = sqe.getMessage();\n int errCode = sqe.getErrorCode();\n if (errCode == SQLERR_TABLE_NONEXIST) { // MySQL: ?\n return false;\n } else\n if (errCode == SQLERR_UNKNOWN_DATABASE) { // MySQL: ?\n String dbName = DBProvider.getDBName();\n Print.logError(\"Database does not exist '\" + dbName + \"'\"); // thus, table does not exist\n return false;\n } else\n if (errCode == MSQL_ERR_INVALID_OBJECT) { // SQLServer: :\n return false;\n } else\n if (sqlMsg.indexOf(\"does not exist\") >= 0) { // PostgreSQL: ?\n return false;\n } else {\n String dbName = DBProvider.getDBName();\n throw new DBException(\"Table Existance '\" + dbName + \"'\", sqe);\n }\n\n } finally {\n if (rs != null) { try { rs.close(); } catch (Throwable t) {} }\n if (stmt != null) { try { stmt.close(); } catch (Throwable t) {} }\n DBConnection.release(dbc);\n }\n\n }", "private boolean distBeltExists(){ \n String table = \"DISTBELT\";\n \n try {\n stmt = conn.createStatement();\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(table.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n stmt.close();\n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false; \n }", "public boolean lookup(String name){\n return table.containsKey(name);\n }", "public static void existOrCreateTable(Class classz){\n String tname = classz.getSimpleName();\n NLog.i(\"sqlo table name:%s\", tname);\n if( tables.get(tname) == null )\n createTable(classz);\n }", "boolean existsByName(String name);", "private boolean checkInputTableName(AccessInputMeta meta){\n if (meta.getTableName()==null || meta.getTableName().length()<1)\n {\n MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );\n mb.setMessage(BaseMessages.getString(PKG, \"AccessInputDialog.TableMissing.DialogMessage\"));\n mb.setText(BaseMessages.getString(PKG, \"System.Dialog.Error.Title\"));\n mb.open(); \n\n return false;\n }\n else\n {\n \treturn true;\n }\n\t}", "@Override\n\tpublic String ifTable(String table) {\n\t\treturn \"select 1 from user_tables where table_name ='\"+table+\"'\";\n\t}", "private static boolean checkTables(final SQLParser parser, final Map<String, TableData> catalog)\n\t{\n\t\tfinal Map<String, String> tables = parser.getFROM();\n\n\t\tfor(final String table : tables.values())\n\t\t{\n\t\t\tif(!catalog.containsKey(table))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Table \\\"\" + table + \"\\\" does not exist.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public Node findTable(String name) {\n\tNodeList tree = total.getDocumentElement().getChildNodes();\n\tfor (int i = 0; i < tree.getLength(); i++) {\n Node n = tree.item(i);\n if (n.getNodeName().equals(\"table\") &&\n n.getAttributes().getNamedItem(\"name\").getNodeValue().equals(name))\n return n;\n }\n throw new RuntimeException(\"Can't find table \" + name);\n }", "public boolean exists(String name) throws IOException;", "public static void main(String args[]) throws IOException {\n\t\tboolean bool = HBaseUtil.getAdmin().tableExists(\n\t\t\t\tTableName.valueOf(HBaseUtil.TABLE_NAME));\n\t\tSystem.out.println(bool);\n\t}", "public static boolean checkTableForLogIn( Connection con, String tableName )\n \t\tthrows SQLException\n {\n if(con.isValid(0))\n {\n DatabaseMetaData md = con.getMetaData();\n ResultSet rs = md.getTables(null, null, \"%\", null);\n if( !rs.next() )\n {\n return false;\n }\n else\n {\n do\n {\n if( tableName.equals(rs.getString(3)) )\n {\n return true;\n }\n }while (rs.next());\n }\n }\n return false;\n }", "public boolean openTable(String tblName)\r\n {\r\n String sql = \"Select * From \" + tblName;\r\n return querySql(sql);\r\n }", "public boolean doesGroupsTableExist() {\r\n\r\n\t\t// Variable Declarations\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement stmt = null;\r\n\r\n\t\ttry {\r\n\t\t\t// Connect to Database\r\n\t\t\tClass.forName(JDBC_DRIVER);\r\n\t\t\tconn = DriverManager.getConnection(DATABASE, USER, PASS);\r\n\r\n\t\t\t// Create SQL Statement\r\n\t\t\tString sql = \"SELECT name FROM sqlite_master\";\r\n\t\t\tstmt = conn.prepareStatement(sql);\r\n\r\n\t\t\t// Get ResultSet by Column Name\r\n\t\t\tResultSet rs = stmt.executeQuery();\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tString tName = rs.getString(\"name\");\r\n\t\t\t\tif (tName.equals(\"groups\")) {\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException se) {\r\n\t\t\t// Handle Errors for JDBC\r\n\t\t\tse.printStackTrace();\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// Handle Errors for Class\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t// Close Resources\r\n\t\t\ttry {\r\n\t\t\t\tif (stmt != null)\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t} catch (SQLException se2) {\r\n\t\t\t} // Nothing to do\r\n\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException se) {\r\n\t\t\t\tse.printStackTrace();\r\n\t\t\t} // End Finally Try/Catch\r\n\t\t} // End Try/Catch\r\n\r\n\t\treturn false;\r\n\t}", "public boolean tableHasRecords(String tableName) {\n\n int count = 0;\n\n try{\n PreparedStatement query = conn.prepareStatement(\"SELECT COUNT(id) AS 'count' FROM \" + tableName + \";\");\n ResultSet results = query.executeQuery();\n\n while (results.next()){\n count = results.getInt(\"count\");\n } \n\n if(count > 0){\n return true;\n }\n\n } catch (SQLException e){\n e.printStackTrace();\n }\n\n return false;\n }", "public boolean checkMasterdataTables(){\n boolean cat = tableExists(\"select c from Category c\");\n boolean quest = tableExists(\"select t from Question t\");\n\n if (!cat){\n System.out.println(\"Tabelle 'Category' exisitiert nicht!\");\n }\n\n if (!quest){\n System.out.println(\"Tabelle 'Question' exisitiert nicht!\");\n }\n\n if (cat && quest){\n // all tables exist\n return true;\n\n } else {\n // one or more tables dont exist\n return false;\n }\n }", "public boolean updateInformationSchemaTable(){\n\t\tSchema currentSchema = Schema.getSchemaInstance();\n\t\tString currentSchemaName = currentSchema.getCurrentSchema();\n\t\tboolean isFound = false;\n\t\ttry {\n\t\t\tRandomAccessFile tablesTableFile = new RandomAccessFile(\"information_schema.table.tbl\", \"rw\");\n\n\t\t\t//Searching to see if the information schema is present or not\n\t\t\twhile(tablesTableFile.getFilePointer() < tablesTableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tbyte varcharLength = tablesTableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tablesTableFile.readByte();\n\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\n\t\t\t\t\tString readTableName = \"\";\n\t\t\t\t\tbyte varcharTableLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < varcharTableLength; j++)\n\t\t\t\t\t\treadTableName += (char)tablesTableFile.readByte();\n\n\t\t\t\t\tif(readTableName.equals(tableName)){\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tSystem.out.println(\"Table '\" + tableName + \"' already exits...\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t} else {\n\t\t\t\t\tbyte traverseLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < traverseLength; j++)\n\t\t\t\t\t\ttablesTableFile.readByte();\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tif(!isFound){\n\t\t\t\t//Traversing to the end of file\n\t\t\t\ttablesTableFile.seek(tablesTableFile.length());\n\t\t\t\ttablesTableFile.writeByte(currentSchemaName.length()); // TABLE_SCHEMA\n\t\t\t\ttablesTableFile.writeBytes(currentSchemaName);\n\t\t\t\ttablesTableFile.writeByte(tableName.length()); // TABLE_NAME\n\t\t\t\ttablesTableFile.writeBytes(tableName);\n\t\t\t\ttablesTableFile.writeLong(0); // TABLE_ROWS\n\t\t\t}\n\n\t\t\ttablesTableFile.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}\t\n\t\treturn isFound;\n\t}", "public boolean checkTable(int layerId)\n\n {\n boolean isAvailable = false;\n try {\n\n //This statement will fetch all tables available in database.\n\n ResultSet rs1 = conn.getMetaData().getTables(null, null, null, null);\n while (rs1.next()) {\n\n String ld = rs1.getString(\"TABLE_NAME\");\n\n //This statement will extract digits from table names.\n if(!(ld.equals(\"PurgeTable\")||ld.equals(\"UserToCertMap\"))){\n String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n }\n /* String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n //This statement will compare layerid with digits of table names.*/\n\n }\n rs1.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return isAvailable;\n }", "private void checkTableRecord(final String value) {\n final DataSource dsValidatation = DataSourceFactory.createDataSource();\n dsValidatation.addTable(AFM_TBLS);\n dsValidatation.addField(TABLE_NAME);\n dsValidatation.addRestriction(Restrictions.eq(AFM_TBLS, TABLE_NAME, value));\n if (dsValidatation.getRecords().isEmpty() && !isTableNameSelected(value)) {\n this.requiredTablesNames.add(value);\n this.isDependencyNeeded = true;\n }\n }", "public boolean maketable() {\n String query = \"\";\n if (connect != null) {\n try {\n java.sql.DatabaseMetaData dbmd = connect.getMetaData();\n ResultSet rs = dbmd.getTables(null, null, \"PLAYERNAME\", null);\n if (rs.next()) {//If it is existed\n System.out.println(\"table exists\");\n } else {//otherwise, create the table\n query = \"create table score(\\n\"\n + \"nickname varchar(40) not null,\\n\"\n + \"levels integer not null,\\n\"\n + \"highscore integer,\\n\"\n + \"numberkill integer,\\n\"\n + \"constraint pk_nickname_score PRIMARY KEY (nickname)\\n\"\n + \")\";\n ps = connect.prepareStatement(query);\n ps.execute();//Execute the SQL statement\n System.out.println(\"new table created\");\n }\n } catch (SQLException ex) {\n System.out.println(\"table create failed\");\n ex.printStackTrace();\n }\n } else {\n System.out.println(\"Connect failed.\");\n }\n return true;\n }", "boolean nameExists(Key name);", "private boolean exists() {\n try {\n DatabaseMetaData md = conn.getMetaData();\n ResultSet rs = md.getTables(null, null, \"settings\", null);\n return rs.next();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n return false;\n }\n }", "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\n\t}", "private boolean matchesTable (List tableNames, ColumnElement column)\n\t{\t\n\t\treturn ((column == null) ? true : tableNames.contains(\n\t\t\tcolumn.getDeclaringTable().getName().getName()));\n\t}", "private boolean isTableNameSelected(final String tableName) {\n \n final DataSource tableDataSource = DataSourceFactory.createDataSource();\n tableDataSource.addTable(ProjectUpdateWizardConstants.AFM_FLDS_TRANS);\n tableDataSource.addField(\"autonumbered_id\");\n tableDataSource.addRestriction(Restrictions.in(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n CHANGE_TYPE, DifferenceMessage.TBL_IS_NEW.name()));\n tableDataSource.addRestriction(Restrictions.eq(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n CHOSEN_ACTION, Actions.APPLY_CHANGE.getMessage()));\n tableDataSource.addRestriction(Restrictions.eq(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n TABLE_NAME, tableName));\n\n return tableDataSource.getRecords().size() > 0;\n }", "public boolean hasHeader(String headerName) {\n return nameTable.containsKey(headerName.toLowerCase());\n }", "String getTableName(String name);", "public boolean hasParentTable(String utableName)\n {\n return this.parentTables.contains(utableName);\n }", "private boolean pathHasValidTableName(String parent, String tableName) {\n String tableDirectory = \"/\" + tableName + \"/\";\n return !Strings.isNullOrEmpty(tableName) && parent.contains(tableDirectory) && !parent.endsWith(\"/\" + tableName);\n }", "public boolean checkEmptyTable(String table) {\n // Select query\n String selectQuery = \"SELECT count(*) FROM \" + table;\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n if (cursor != null) { cursor.moveToFirst(); }\n\n int countRows = cursor.getInt(0);\n\n return !(countRows > 0);\n }", "String printTable(String name) {\n\n try {\n return tables.get(name).getTable();\n } catch (IndexOutOfBoundsException e) {\n return \"ERROR: Cant print table\";\n } catch (NullPointerException e) {\n return \"ERROR: Cant print table\";\n }\n }", "@Test\n public void testVentas() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM ventas\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table ventas exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'ventas' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "public boolean databaseExists(String dbName) throws Exception;", "@Test\n public void testCaja() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM caja\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table caja exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'caja' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "@Test\n public void testUsuarios() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM usuarios\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table usuarios exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'usuarios' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "private boolean validTable(\n final Table table,\n final String tableName,\n final String databaseName,\n final List<ColumnDataType> columnTypes) {\n return table.getName().equals(tableName)\n && table.getDatabase().equals(databaseName)\n && columnsMatch(table, columnTypes);\n }", "public void checkIfHistoryTableExists() {\r\n\t\tWebElement element = getDriver().findElement(\r\n\t\t\t\tBy.cssSelector(\".lfr-search-container\"));\r\n\t\tboolean isDisplayed = false;\r\n\r\n\t\tif (element.isDisplayed()) {\r\n\t\t\tisDisplayed = true;\r\n\t\t}\r\n\t\tAssert.assertTrue(\"Table is not displayed\", isDisplayed);\r\n\t}", "boolean isUsingTable(UUID u) {\n return usingTables.getOrDefault(u, false);\n }", "String loadTable(String name) {\n\n\n String l;\n String[] line;\n String[] colNames;\n String[] colTypes;\n String[] values;\n\n\n try {\n\n if (tables.get(name) != null) {\n tables.remove(name);\n }\n FileReader fr = new FileReader(name + \".tbl\");\n BufferedReader bf = new BufferedReader(fr);\n\n\n if ((l = bf.readLine()) != null) {\n line = l.split(\"\\\\s*(,|\\\\s)\\\\s*\");\n } else {\n return \"ERROR: Empty Table\";\n }\n colNames = new String[line.length / 2];\n colTypes = new String[line.length / 2];\n\n int j = 0, k = 0;\n\n for (int i = 0; i < line.length; i += 1) {\n if (i % 2 == 0) {\n colNames[j] = line[i];\n j += 1;\n } else {\n colTypes[k] = line[i];\n k += 1;\n }\n\n }\n\n Table t = new Table(name, colNames, colTypes);\n tables.put(name, t);\n\n while ((l = bf.readLine()) != null) {\n values = l.split(\"\\\\s*(,)\\\\s*\");\n t.insertLastRow(values);\n }\n\n bf.close();\n return \"\";\n\n } catch (NullPointerException e) {\n return \"ERROR: \" + e;\n } catch (ArrayIndexOutOfBoundsException e) {\n return \"ERROR: \" + e;\n } catch (NumberFormatException e) {\n return \"ERROR: \" + e;\n } catch (IllegalArgumentException e) {\n return \"ERROR: \" + e;\n } catch (IOException e) {\n return \"ERROR: \" + e;\n } \n }", "public boolean checkIfRowExists(String tablename, int m) throws SQLException {\n String sql = \"SELECT * FROM \" + tablename + \" WHERE m = ?\";\n PreparedStatement preparedStatement = (PreparedStatement) this.getConn().prepareStatement(sql);\n preparedStatement.setInt(1, m);\n return ((ResultSet) preparedStatement.executeQuery()).next();\n }", "public void dropTableIfExists(String tableName) throws SQLException{\n\t\tStatement stmt = connection.createStatement();\n\t\tstmt.execute(\"DROP TABLE IF EXISTS \\\"\" + tableName + \"\\\"\"); \n\t\tstmt.close();\n\t}", "public TapTable findOneTable(String tableName);", "@Test\n public void testCorte_de_caja() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM corte_caja\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table corte_caja exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'corte_caja' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "public boolean createTable(SQLiteDatabase db, String tableName) {\n\t\t//\n//\t\tif (!tableExists(db, tableName)) {\n\t\tif (tableExists(db, tableName)) {\n\t\t\t// Log\n\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Table exists => \" + tableName);\n\t\t\t\n\t\t\treturn false;\n\t\t}//if (!tableExists(SQLiteDatabase db, String tableName))\n\t\t\n\t\t//\n\t\tString sql = \"CREATE TABLE \" + tableName + \" (\"\n\t\t\t\t+ android.provider.BaseColumns._ID\n\t\t\t\t+ \" INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n\t\t\t\t\"store TEXT, name TEXT, price INTEGER, genre TEXT);\";\n\t\t\n\t\t//\n\t\ttry {\n\t\t\tdb.execSQL(sql);\n\t\t\t\n\t\t\t// Log\n\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Table created => \" + tableName);\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e) {\n\t\t\t// Log\n\t\t\tLog.d(\"MemoDBHelper.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Exception => \" + e.toString());\n\t\t\t\n\t\t\treturn false;\n\t\t}//try\n\t\t\n\t}", "String createNewTable(String name,\n String[] colNames, String[] colTypes) {\n\n try {\n if (tables.get(name) != null) {\n return \"ERROR: Table already exists\";\n\n }\n Table t = new Table(name, colNames, colTypes);\n tables.put(name, t);\n\n return \"\";\n } catch (NullPointerException e) {\n return \"ERROR: Malformed Table\";\n } catch (IllegalArgumentException e) {\n return \"ERROR: Malformed Table\";\n }\n\n\n }", "public static boolean isTableClass(String utableName, Class<?> tableClass)\n {\n return DBFactory.isTableClass(DBFactory.getFactoryByName(utableName), tableClass);\n }", "@Test\n public void testProductos() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM productos\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table productos exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'productos' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "public boolean columExists(String pTableName, String pColumnName)\n {\n \t// Busca en la tabla la columna deseada.\n \treturn true;\n }", "public boolean isSetTableName() {\n return this.tableName != null;\n }", "public boolean nameExists(String name){\n //What is going to return\n boolean result = true;\n \n //Values to do the query\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n \n \n \n try{\n //The process goes here...\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/process_checkout\",\"root\",\"\"\n );\n \n String query = \"SELECT * FROM area WHERE name = (?)\";\n \n ps = conn.prepareStatement(query);\n ps.setString(1, name);\n rs = ps.executeQuery();\n result = rs.next();\n \n }catch(SQLException e){\n \n } catch (ClassNotFoundException ex) {\n \n }finally{\n try {\n if(rs != null)rs.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(ps != null)ps.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(conn != null)conn.close();\n } catch (SQLException e) {\n /* ignored */ }\n }\n //What is going to return goes here...\n return result;\n \n }", "void delete_table(String table_name) {\n //table does not exist\n if (!get_table_names().contains(table_name) && !table_name.equals(\"relationship\")) {\n throw new RuntimeException(\"Table does not exists and can therefore not be deleted.\");\n }\n\n String sql = \"drop table if exists \" + table_name;\n\n execute_statement(sql, false);\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean isSetTableName() {\r\n return this.tableName != null;\r\n }", "public boolean checkIfDatabaseExists() {\r\n return database.exists();\r\n }", "boolean dbExists(String dbName);", "public boolean supportsTableCheck() {\n \t\treturn true;\n \t}", "public BigQueryTable ensureExists() {\n if (!exists()) {\n create();\n }\n return this;\n }", "@Test\n void testAddTablesByName() {\n when(bigQueryResourceProviderMock.getTables(anyString(), anyList()))\n .thenReturn(List.of(exampleTableInDefaultProject));\n\n // Add the tables by name\n bigQueryCatalog.addTables(List.of(exampleTableInDefaultProject.getFullName()));\n\n // Verify the BigQueryCatalog got the tables from the BigQueryResourceProvider\n verify(bigQueryResourceProviderMock, times(1)).getTables(anyString(), anyList());\n\n // Verify the test table was added to the catalog\n List<List<String>> pathsWhereTableShouldBe =\n this.buildPathsWhereResourceShouldBe(exampleTableInDefaultProject.getFullName());\n assertTableExistsAtPaths(bigQueryCatalog, pathsWhereTableShouldBe);\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 }", "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}", "String dropTable(String name) {\n\n\n try {\n if (tables.get(name).equals(null)) {\n return \"ERROR: Table Does Not Exist\";\n }\n tables.remove(name);\n return \"\";\n } catch (NoSuchElementException e) {\n return \"ERROR: Delete operation failed.\";\n\n } catch (DirectoryIteratorException e) {\n return \"ERROR: Delete operation failed.\";\n } catch (NullPointerException e) {\n return \"ERROR: Delete operation failed.\";\n }\n\n }", "private static int getTableCount(ISession session, String tableName) {\n int result = -1;\n ResultSet rs = null;\n try {\n String sql = \"select count(*) from \"+tableName; \n rs = executeQuery(session, sql);\n if (rs.next()) {\n result = rs.getInt(1);\n }\n } catch (Exception e) {\n /* Do Nothing - this can happen when the table doesn't exist */\n } finally {\n SQLUtilities.closeResultSet(rs, true);\n }\n return result; \n }", "public boolean exists(String databaseName) {\n return context.databaseExists(databaseName);\n }", "public static boolean existPlayer(String name) throws SQLException, BaseDeDonnéesExcetion, ClassNotFoundException {\r\n Connection conn = null;\r\n String query = \"SELECT * FROM PokerPlayer2 WHERE name = ?\";\r\n try {\r\n conn = DriverManagerP.getConnection();\r\n PreparedStatement preparedStmt = conn.prepareStatement(query);\r\n preparedStmt.setString(1, name);\r\n ResultSet result = preparedStmt.executeQuery();\r\n if (result.next()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } catch (SQLException e) {\r\n throw new SQLException(\" impossible to find player \" + name + \" \" + e.getMessage());\r\n }\r\n\r\n }", "public void setTableName(String name) {\n this.tableName = name;\n }", "public static int createTable(String query,String tableName){\n\t\tDatabaseMetaData databaseMetaData ;\n\t\tResultSet resultSet = null;\n\t\tStatement statement = null;\n\t\tint result = 0;\n\t\ttry{\n\t\t\tconnectDatabase();\n\t\t\tdatabaseMetaData = connection.getMetaData();\n\t\t\t// find if any table with same name exists\n\t\t\tresultSet = databaseMetaData.getTables(null,null,tableName,null);\n\t\t\tif (!resultSet.next()) {\n\t\t\t\t// if not the create one\n\t\t\t\tstatement = connection.createStatement();\n\t\t\t\tresult = statement.executeUpdate(query);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry{\n\t\t\t\tif (statement != null) statement.close();\n\t\t\t\tif (resultSet != null) resultSet.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tdisconnectDatabase();\n\t\t}\n\t\treturn result;\n\t}", "boolean createTable(\n String tableName,\n MapStoreTableKey tableKey\n );" ]
[ "0.7990203", "0.79363775", "0.77897185", "0.7623444", "0.74957997", "0.74624455", "0.7400743", "0.73315364", "0.7202418", "0.7199996", "0.7108825", "0.70996547", "0.70572335", "0.70517", "0.7022819", "0.69696844", "0.69575983", "0.69402516", "0.6932222", "0.6885275", "0.6838837", "0.6781066", "0.66603917", "0.6539595", "0.65179944", "0.64671445", "0.64527863", "0.6410946", "0.63843673", "0.63706344", "0.62631345", "0.61779785", "0.61064994", "0.61062616", "0.6072468", "0.60534865", "0.6051514", "0.60053277", "0.58952624", "0.5885939", "0.5871634", "0.5856789", "0.5852432", "0.58482045", "0.5830211", "0.5821443", "0.5812073", "0.5774884", "0.57399946", "0.57259905", "0.5713557", "0.56929", "0.5655591", "0.5650722", "0.5649156", "0.5643715", "0.5640085", "0.56048864", "0.56027675", "0.55865204", "0.55787647", "0.55768275", "0.5547735", "0.55371636", "0.55193025", "0.551866", "0.55012053", "0.548539", "0.5475855", "0.54673266", "0.5466166", "0.5460386", "0.54592407", "0.5452092", "0.5441351", "0.54090333", "0.5400897", "0.53990346", "0.538658", "0.53862095", "0.5366463", "0.5364784", "0.5364784", "0.5364784", "0.5364784", "0.5364784", "0.53556037", "0.53521246", "0.5347551", "0.53374064", "0.5332564", "0.5316687", "0.53005016", "0.52941024", "0.52841264", "0.52775866", "0.5269102", "0.5259443", "0.52435714", "0.52399236" ]
0.61652756
32
Check for the existence of a type.
public HasTypeResponse hasType(HasTypeRequest request) throws GPUdbException { HasTypeResponse actualResponse_ = new HasTypeResponse(); submitRequest("/has/type", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "boolean hasType();", "private boolean isTypeExists(Context context, String typeName) throws Exception\r\n {\r\n boolean typeExists = false;\r\n //String command = \"temp query bus '\" + typeName + \"' * *\";\r\n String command = \"temp query bus $1 $2 $3\";\r\n\r\n String result = MqlUtil.mqlCommand(context, command,typeName,\"*\",\"*\");\r\n if (result != null && !result.isEmpty())\r\n {\r\n typeExists = true;\r\n }\r\n return typeExists;\r\n }", "private static boolean checkType(String type) {\n ParameterHelpers.checkParameter(type, \"type\");\n\n if (type.equals(TYPE_REGISTERED)) {\n return true;\n } else if (type.equals(TYPE_UNREGISTERED)) {\n return false;\n } else {\n throw new IllegalArgumentException(\"type must be 'Registered' or 'Unregistered'\");\n }\n }", "abstract protected boolean checkType(String myType);", "public abstract boolean isTypeOf(ItemType type);", "public TypeDefinition isType(String name){\n return((TypeDefinition)typeDefs.get(getDefName(name)));\n }", "protected static boolean checkTypeReferences() {\n Map<Class<?>, LinkedList<Class<?>>> missingTypes = new HashMap<>();\n for (Map.Entry<String, ClassProperties> entry : classToClassProperties.entrySet()) {\n String className = entry.getKey();\n Class<?> c = lookupClass(className);\n Short n = entry.getValue().typeNum;\n if (marshalledTypeNum(n)) {\n Class<?> superclass = getValidSuperclass(c);\n if (superclass != null)\n checkClassPresent(c, superclass, missingTypes);\n LinkedList<Field> fields = getValidClassFields(c);\n for (Field f : fields) {\n Class<?> fieldType = getFieldType(f);\n checkClassPresent(c, fieldType, missingTypes);\n }\n }\n }\n if (missingTypes.size() > 0) {\n for (Map.Entry<Class<?>, LinkedList<Class<?>>> entry : missingTypes.entrySet()) {\n Class<?> c = entry.getKey();\n LinkedList<Class<?>> refs = entry.getValue();\n String s = \"\";\n for (Class<?> ref : refs) {\n if (s != \"\")\n s += \", \";\n s += \"'\" + getSimpleClassName(ref) + \"'\";\n }\n Log.error(\"Missing type '\" + getSimpleClassName(c) + \"' is referred to by type(s) \" + s);\n }\n Log.error(\"Aborting code generation due to missing types\");\n return false;\n }\n else\n return true;\n }", "public boolean hasComponent(Class<? extends Component> componentType);", "boolean isResolvable(String name, Class<?> type);", "boolean hasStoredType();", "<T> boolean canProvide(Class<T> type);", "public boolean isType(String type) {\n return m_Type.equals(type);\n }", "public boolean isTypeAvailable(Class<? extends Resource> resourceType, OgemaLocale locale);", "boolean isResolvable(Class<?> type);", "boolean isHandled(Class<?> type);", "public boolean existsClass(String name)\r\n\t{\r\n\t\treturn obtainOntClass(name) != null;\r\n\t}", "public boolean handlesType(Class<?> clazz);", "boolean hasClassname();", "public boolean isServiceTypeInstalled(String fullTypeName) {\r\n ServiceData sd = ServiceData.getLocalInstance();\r\n\r\n if (!sd.containsServiceType(fullTypeName)) {\r\n log.error(\"unknown service {}\", fullTypeName);\r\n return false;\r\n }\r\n\r\n Set<Library> libraries = getUnfulfilledDependencies(fullTypeName);\r\n if (libraries.size() > 0) {\r\n // log.info(\"{} is NOT installed\", fullTypeName);\r\n return false;\r\n }\r\n\r\n // log.info(\"{} is installed\", fullTypeName);\r\n return true;\r\n }", "public boolean findType(int typeId){ //Checks if the typeId is registered - true if it's found\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(TYPE_BY_ID + typeId);\n ResultSet rs = ps.executeQuery()){\n \n if(rs.isBeforeFirst()){ //If the resultset has data\n return true;\n }\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n } \n return false;\n }", "boolean isTypeKey(String key);", "boolean is(Class<? extends DownloaderConfiguration> type);", "public boolean hasType() {\n return fieldSetFlags()[0];\n }", "public boolean isSetTypeId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(TYPEID$2) != 0;\n }\n }", "private boolean isType(String type, Object value) {\n boolean ret = false;\n String val = String.valueOf(value).toUpperCase();\n if (val.equals(\"NULL\")) {\n ret = true;\n } else if (val.contains(\"BASE64\")) {\n ret = true;\n } else {\n if (type.equals(\"NULL\") && value instanceof JSONObject) ret = true;\n if (type.equals(\"TEXT\") && value instanceof String) ret = true;\n if (type.equals(\"INTEGER\") && value instanceof Integer) ret = true;\n if (type.equals(\"INTEGER\") && value instanceof Long) ret = true;\n if (type.equals(\"REAL\") && value instanceof Float) ret = true;\n if (type.equals(\"BLOB\") && value instanceof Blob) ret = true;\n }\n return ret;\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "boolean hasCardType();", "@Override\n\tpublic boolean checkTypes() {\n\t\treturn false;\n\t}", "private static boolean classExists(String className) {\n\t\tClass<?> theLogicClass = null;\n\t\ttry {\n\t\t\ttheLogicClass = ClassLoaderManager.getInstance().getLogicClassFromName(className);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\t// Do nothing\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tlog.debug(\"SystemBusinessLogicFinder.classExists : candidate logic class \" + \n\t\t\t\t\t\tclassName + \" was not found - ignoring\");\n\t\t\t\tif (ex.getCause() == null || ! (ex.getCause() instanceof ClassNotFoundException)) {\n\t\t\t\t\tlog.debug(\"Error while loading logic class \" + className, ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theLogicClass != null;\n\t}", "public boolean isOfType(int index, JSONType type) {\n\t\tif(!has(index)) return false;\n\t\treturn JSONType.isOfType(get(index), type);\n\t}", "public static boolean isUsableType(byte t) {\n switch (t) {\n case UNKNOWN: return false ;\n case NULL: return false ;\n case ERROR: return false ;\n default :return true ;\n }\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean exists() {\n \t\treturn (type != UNKNOWN && isValid() && ((type == STRING) ? !sVal.equals(\"\") : true));\n \t}", "boolean hasResourceType();", "private static boolean hasClass(String className) {\n try {\n Class.forName(className);\n return true;\n } catch (ClassNotFoundException ex) {\n return false;\n }\n }", "boolean hasDocumentType();", "public void check()\n {\n typeDec.check();\n }", "boolean hasGoodsType();", "@Override\n\tpublic boolean contains(Type t) {\n\t\treturn true;\n\t}", "public boolean isTypeAvailable(RemoteJmxConnectionBean connection,\r\n\t\t\tString domain, String type) {\r\n\t\tboolean ret = false;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tActivateConnection(connection);\r\n\t\t\r\n\t\t\tObjectName obj;\r\n\t\t\tobj = new ObjectName(domain + \":type=\" + type+ \",*\");\r\n\t\t\tSet<ObjectName> set;\r\n\t\t\tset = connection.getActiveConnection().queryNames(obj, null);\r\n\t\t\tIterator<ObjectName> it = set.iterator();\r\n\t\t\tif(it.hasNext()) {\r\n\t\t\t\t\r\n\t\t\t\tret = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tobj = new ObjectName(domain + \":Type=\" + type+ \",*\");\r\n\t\t\t \r\n\t\t\tset = connection.getActiveConnection().queryNames(obj, null);\r\n\t\t\t it = set.iterator();\r\n\t\t\tif(it.hasNext()) {\r\n\t\t\t\t\r\n\t\t\t\tret = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog(e.getMessage(),IStatus.ERROR,e);\r\n\t\t}\r\n\t\treturn ret;\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t}", "public static boolean isType(ClassifierFacade classifier, String typeName)\r\n {\r\n boolean isType = false;\r\n if (classifier != null && typeName != null)\r\n {\r\n final String type = StringUtils.trimToEmpty(typeName);\r\n String name = StringUtils.trimToEmpty(classifier.getFullyQualifiedName(true));\r\n isType = name.equals(type);\r\n // if this isn't a type defined by typeName, see if we can find any\r\n // types that inherit from the type.\r\n if (!isType)\r\n {\r\n isType = CollectionUtils.find(classifier.getAllGeneralizations(), new Predicate()\r\n {\r\n public boolean evaluate(Object object)\r\n {\r\n String name = StringUtils.trimToEmpty(\r\n ((ModelElementFacade)object).getFullyQualifiedName(true));\r\n return name.equals(type);\r\n }\r\n }) != null;\r\n }\r\n }\r\n return isType;\r\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "boolean hasInfoType();", "public boolean hasType() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }" ]
[ "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.81739265", "0.72542596", "0.6621073", "0.6520686", "0.6425585", "0.64149714", "0.63653", "0.6323482", "0.6320612", "0.6249764", "0.6238005", "0.6202715", "0.61206734", "0.6118931", "0.6031392", "0.6020327", "0.6015432", "0.595361", "0.5949397", "0.5933611", "0.5926368", "0.59234315", "0.59199786", "0.5919059", "0.58878726", "0.58452415", "0.58430713", "0.5794999", "0.5784365", "0.57821226", "0.5777223", "0.5772488", "0.57698464", "0.57580346", "0.5756613", "0.5755004", "0.5753127", "0.5751596", "0.57414067", "0.5720956", "0.5715573", "0.57152975", "0.57152975", "0.57152975", "0.57150245", "0.5712996", "0.5700978", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.56998795", "0.5695543", "0.5688449" ]
0.6517477
45
Generates a specified number of random records and adds them to the given table. There is an optional parameter that allows the user to customize the ranges of the column values. It also allows the user to specify linear profiles for some or all columns in which case linear values are generated rather than random ones. Only individual tables are supported for this operation. This operation is synchronous, meaning that a response will not be returned until all random records are fully available.
public InsertRecordsRandomResponse insertRecordsRandom(InsertRecordsRandomRequest request) throws GPUdbException { InsertRecordsRandomResponse actualResponse_ = new InsertRecordsRandomResponse(); submitRequest("/insert/records/random", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void createTables(int n, int upperBound) {\r\n\t\tRandom randomGenerator = new Random();\r\n\t\tint [][] randomArray = new int [n][n];\r\n\t\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\trandomArray[i][j] = 0;\r\n\t\t\t\t} else if(i > j) {\r\n\t\t\t\t\trandomArray[i][j] = INFINITY;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trandomArray[i][j] = randomGenerator.nextInt(upperBound) + 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\twriteOutput(randomArray);\r\n\t}", "@ParameterizedTest\n @MethodSource(\"randomRecord\")\n public void testAutoCreateTable(Fixture fixture,\n Integer offset,\n Row row,\n SinkRecord record) {\n Map<String, String> props = fixture.props;\n String newTableName = TestUtils.createUniqueAlias();\n\n props.put(ConnectorUtils.TABLE_CONFIG, newTableName);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_SKELETON_COLUMN_CONFIG, Fixture.SKELETON_COLUMN_ID);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_SKELETON_SUFFIX_CONFIG, \"_skeleton\");\n\n this.task.start(props);\n this.task.put(Collections.singletonList(record));\n this.task.flush(new HashMap());\n\n // Sleep 1 second, our flush interval\n try {\n Thread.sleep(1100);\n } catch (Exception e) {\n throw new Error(\"Unexpected exception\", e);\n }\n\n Timespec ts = new Timespec(record.timestamp());\n TimeRange[] ranges = { new TimeRange(ts, ts.plusNanos(1)) };\n\n Reader reader = Table.reader(TestUtils.createSession(), newTableName, ranges);\n assertEquals(true, reader.hasNext());\n\n Row row2 = reader.next();\n assertEquals(row, row2);\n assertEquals(false, reader.hasNext());\n\n this.task.stop();\n }", "private static void assembleRosterTable(){\n for (int i = 0; i < 10; i++) {\n rosterTable.insertRow(i);\n }\n }", "@Before\n public void setUp() {\n table = new Table();\n ArrayList<Column> col = new ArrayList<Column>();\n col.add(new NumberColumn(\"numbers\"));\n\n table.add(new Record(col, new Value[] {new NumberValue(11)}));\n table.add(new Record(col, new Value[] {new NumberValue(13)}));\n table.add(new Record(col, new Value[] {new NumberValue(22)}));\n table.add(new Record(col, new Value[] {new NumberValue(28)}));\n table.add(new Record(col, new Value[] {new NumberValue(44)}));\n table.add(new Record(col, new Value[] {new NumberValue(23)}));\n table.add(new Record(col, new Value[] {new NumberValue(46)}));\n table.add(new Record(col, new Value[] {new NumberValue(56)}));\n table.add(new Record(col, new Value[] {new NumberValue(45)}));\n table.add(new Record(col, new Value[] {new NumberValue(45)}));\n table.add(new Record(col, new Value[] {new NullValue()}));\n table.add(new Record(col, new Value[] {new NumberValue(45)}));\n table.add(new Record(col, new Value[] {new NumberValue(34)}));\n table.add(new Record(col, new Value[] {new NumberValue(5)}));\n table.add(new Record(col, new Value[] {new NumberValue(123)}));\n table.add(new Record(col, new Value[] {new NumberValue(48)}));\n table.add(new Record(col, new Value[] {new NumberValue(50)}));\n table.add(new Record(col, new Value[] {new NumberValue(13)}));\n }", "public int[] fillDatabase()\n {\n int [] db = new int [20];\n \n \n for (int i = 0; i < db.length; i++)\n {\n db[i] = new java.util.Random().nextInt(25);\n }\n return db;\n }", "@ParameterizedTest\n @MethodSource(\"randomRecords\")\n public void testPutRows(Fixture fixture, Integer offset, Collection<SinkRecord> records) {\n Map<String, String> props = fixture.props;\n props.put(ConnectorUtils.TABLE_FROM_TOPIC_CONFIG, \"true\");\n\n this.task.start(props);\n this.task.put(records);\n this.task.flush(new HashMap<>());\n\n this.task.stop();\n }", "public static void hastableMethod(int numberOfIntegers) {\n\n\t\tHashtable<Integer, Integer> table = new Hashtable<>();\n\t\tRandom rand = new Random();\n\n\t\tfor (int i = 0; i < numberOfIntegers; i++) {\n\t\t\ttable.put(i, rand.nextInt(numberOfIntegers));\n\t\t}\n\n\t\tfor (int i = 0; i < numberOfIntegers; i++) {\n\t\t\ttable.remove(i);\n\t\t}\n\n\t}", "public static void seed() {\n\n // Get locations, employees, and custodians from database.\n ArrayList<Location> locations = new ArrayList(LocationTable.getLocations().values());\n ArrayList<User> employees = UserTable.getEmployees();\n ArrayList<User> custodians = UserTable.getCustodians();\n\n // Generate random sanitation requests\n Random rand = new Random();\n final int numEntries = 30;\n for (int i = 0; i < numEntries; i++) {\n\n // Generate location (uniform)\n Location location = locations.get(rand.nextInt(locations.size()));\n\n // Generate priority (uniform)\n Priority priority;\n switch (rand.nextInt(3)) {\n case 0: priority = Priority.HIGH; break;\n case 1: priority = Priority.MEDIUM; break;\n default: priority = Priority.LOW; break;\n }\n\n // Generate requester\n User requester = employees.get(rand.nextInt(employees.size()));\n\n // Generate request time (uniform current time + ~12 hours)\n Timestamp requestTime = new Timestamp(\n new Date().getTime() + rand.nextInt(43200000));\n\n // Generate description\n String description;\n switch (rand.nextInt(3)) {\n case 0: description = \"Drink spill\";\n case 1: description = \"Vomit\";\n default: description = \"Radioactive waste\";\n }\n\n // Add request to database\n SanitationRequest request = new SanitationRequest(\n 0, location, priority, Status.INCOMPLETE, description,\n requester, requestTime,\n null, null, null);\n\n // Mark 2/3 of requests as claimed\n int claimFlag = rand.nextInt(3);\n if (claimFlag > 0) {\n\n // Mark as claimed within 1 hour of request\n User servicer = custodians.get(rand.nextInt(custodians.size()));\n Timestamp claimedTime = new Timestamp(\n requestTime.getTime() + rand.nextInt(3600000));\n request.setServicer(servicer);\n request.setClaimedTime(claimedTime);\n\n // Mark half of claimed requests as completed within 2 hours of claim\n if (claimFlag == 2) {\n Timestamp completedTime = new Timestamp(\n claimedTime.getTime() + rand.nextInt(7200000));\n request.setCompletedTime(completedTime);\n request.setStatus(Status.COMPLETE);\n }\n\n // Update request in database\n editSanitationRequest(request);\n }\n\n // Add request to database\n addSanitationRequest(request);\n }\n }", "private void createStressTestControlTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(true);\n Column clientCommitSleepMs = new Column(\"CLIENT_COMMIT_SLEEP_MS\");\n clientCommitSleepMs.setMappedType(\"BIGINT\");\n Column clientCommitRows = new Column(\"CLIENT_COMMIT_ROWS\");\n clientCommitRows.setMappedType(\"BIGINT\");\n Column serverCommitSleepMs = new Column(\"SERVER_COMMIT_SLEEP_MS\");\n serverCommitSleepMs.setMappedType(\"BIGINT\");\n Column serverCommitRows = new Column(\"SERVER_COMMIT_ROWS\");\n serverCommitRows.setMappedType(\"BIGINT\");\n Column payloadColumns = new Column(\"PAYLOAD_COLUMNS\");\n payloadColumns.setMappedType(\"INTEGER\");\n Column initialSeedSize = new Column(\"INITIAL_SEED_SIZE\");\n initialSeedSize.setMappedType(\"BIGINT\");\n Column duration = new Column(\"DURATION_MINUTES\");\n duration.setMappedType(\"BIGINT\");\n\n Table table = new Table(STRESS_TEST_CONTROL, runId, clientCommitSleepMs, clientCommitRows, serverCommitSleepMs, serverCommitRows,\n payloadColumns, initialSeedSize, duration);\n engine.getDatabasePlatform().createTables(true, true, table);\n }", "public void fillTable(long firstRow, long lastRow){\n dbconnector.execWrite(\"INSERT INTO DW_station_sampled (id, id_station, timestamp_start, timestamp_end, \" +\n \"movement_mean, availability_mean, velib_nb_mean, weather) \" +\n \"(select null, ss.id_station, (ss.last_update * 0.001) as time_start, \" +\n \"unix_timestamp(addtime(FROM_UNIXTIME(ss.last_update * 0.001), '00:30:00')) as time_end, \" +\n \"round(AVG(ss.movements),1), round(AVG(ss.available_bike_stands),1), round(AVG(ss.available_bikes),1), \" +\n \"(select w.weather_group from DW_weather w, DW_station s \" +\n \"where w.calculation_time >= time_start and w.calculation_time <= time_end\"+ // lastRangeEnd +\n \" and w.city_id = s.city_id \" +\n \"and ss.id_station = s.id limit 1) \" +\n \"from DW_station_state ss \" +\n \"WHERE ss.id >= \" + firstRow +\" AND ss.id < \" + lastRow +\n \" GROUP BY ss.id_station, round(time_start / 1800))\");\n }", "Rows createRows();", "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}", "public abstract void initiateRandomCells(double probabilityForEachCell);", "@ParameterizedTest\n @MethodSource(\"randomRecord\")\n public void testAutoCreateTableWithStaticTags(Fixture fixture,\n Integer offset,\n Row row,\n SinkRecord record) {\n Map<String, String> props = fixture.props;\n String newTableName = TestUtils.createUniqueAlias();\n List<String> newTableTags = Arrays.asList(TestUtils.createUniqueAlias(),\n TestUtils.createUniqueAlias());\n\n props.put(ConnectorUtils.TABLE_CONFIG, newTableName);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_SKELETON_COLUMN_CONFIG, Fixture.SKELETON_COLUMN_ID);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_TAGS_CONFIG, String.join(\",\", newTableTags));\n\n this.task.start(props);\n this.task.put(Collections.singletonList(record));\n this.task.flush(new HashMap());\n\n for (String tag : newTableTags) {\n Tables tables = Tables.ofTag(TestUtils.createSession(), tag);\n\n assertEquals(true, tables.hasTableWithName(newTableName));\n }\n\n this.task.stop();\n }", "public void loadRandomGeneratedProfiles(int numberOfProfiles) {\n for (int i = 0; i < numberOfProfiles; i++) {\n ProfileModel model = ProfileModel.randomModel();\n profiles.put(model.getId(), model);\n }\n }", "public static void resample(){\n System.out.println(\"Type in how many random people you want in the db\");\n String s = sc.nextLine();\n int sampleSize = getValidSampleCount(s);\n Db.getDb().resampleDb(sampleSize);\n System.out.println(\"New sample of \" + s + \" generated.\");\n }", "public static void main(String[] args) {\n\t\tint num=(int)(Math.random()*20);\r\n //table(number);\r\n\t\ttable(num);\r\n\t}", "private void createStressTestRowIncomingTable(int payloadColumns) {\n Column[] defaultColumns = getDefaultStressTestRowColumns();\n Table table = new Table(STRESS_TEST_ROW_INCOMING, defaultColumns);\n List<Column> payloads = getPayloadColumns(payloadColumns);\n\n table.addColumns(payloads);\n engine.getDatabasePlatform().createTables(true, true, table);\n }", "@ParameterizedTest\n @MethodSource(\"randomRecord\")\n public void testAutoCreateTableWithColumnTags(Fixture fixture,\n Integer offset,\n Row row,\n SinkRecord record) {\n Map<String, String> props = fixture.props;\n String newTableName = TestUtils.createUniqueAlias();\n\n props.put(ConnectorUtils.TABLE_CONFIG, newTableName);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_SKELETON_COLUMN_CONFIG, Fixture.SKELETON_COLUMN_ID);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_TAGS_COLUMN_CONFIG, Fixture.TAGS_COLUMN_ID);\n\n this.task.start(props);\n this.task.put(Collections.singletonList(record));\n this.task.flush(new HashMap());\n\n // Figure out which tags are expected\n String[] newTableTags = fixture.tags[offset];\n\n for (String tag : newTableTags) {\n Tables tables = Tables.ofTag(TestUtils.createSession(), tag);\n\n assertEquals(true, tables.hasTableWithName(newTableName));\n }\n\n this.task.stop();\n }", "public static void main(String[] args) {\n\tint cnt = 4;\n\t\tfor (int i = 4; i <= 30;i++) {\n\t\t\tfor (int k = 0; k < 5; k++) {\n\t\t\t\tif(cnt <= 30) {\n\t\t\t\tfor (int j = 10 * (i - 4) + 11; j < 10 * (i - 3) + 11; j++) {\n\t\t\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\t\t\"insert into tblTestPercent (seqTestPercent, seqRegCourse, seqBasicTest, writtenPercent, practicalPercent, attendancePercent) \"\n\t\t\t\t\t\t\t\t\t+ \"values (seqTestPercent.nextVal, %d, %d, 40, 40, 20);\",\n\t\t\t\t\t\t\tj,cnt ));\n\t\t\t\t}\n\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\n//\tRandom rand = new Random();\n//\n//\tfor (int i = 31; i < 300; i++) {\n//\t\tint writ = 0;\n//\t\tint prac = 0;\n//\t\tint attend = 0;\n//\t\twhile (writ + prac + attend != 100) {\n//\t\t\twrit = rand.nextInt(70)+31;\n//\t\t\tprac = rand.nextInt(60)+41;\n//\t\t\tattend = rand.nextInt(80)+21;\n//\t\t}\n//\t\tSystem.out.println(String.format(\n//\t\t\t\t\"insert into tblTestScore (seqTestScore, seqTestPercent, writtenScore, practicalScore, attendanceScore) values (seqTestScore.nextVal, %d, %d, %d, %d);\",i,writ,prac,attend));\n//\t}\n\t\n\t\n//\tint writ = 0;\n//\tint prac = 0;\n//\tint attend = 0;\n//\twhile (writ + prac + attend != 100) {\n//\t\t\n//\t\twrit = rand.nextInt(70)+31;\n//\t\tprac = rand.nextInt(60)+41;\n//\t\tattend = rand.nextInt(80)+21;\n//\t\tSystem.out.println(\"필기: \" + writ);\n//\t\tSystem.out.println(\"실기: \" + prac);\n//\t\tSystem.out.println(\"출결: \" +attend);\n//\t}\n//\tSystem.out.println(writ);\n//\tSystem.out.println(prac);\n//\tSystem.out.println(attend);\n//\t\n\t\n}", "void setupTableWithRegionReplica(TableName tablename, int replicaCount) throws Exception {\n HTableDescriptor desc = new HTableDescriptor(tablename);\n desc.setRegionReplication(replicaCount);\n HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM));\n desc.addFamily(hcd); // If a table has no CF's it doesn't get checked\n createTable(TEST_UTIL, desc, SPLITS);\n\n tbl = (HTable) connection.getTable(tablename, tableExecutorService);\n List<Put> puts = new ArrayList<Put>();\n for (byte[] row : ROWKEYS) {\n Put p = new Put(row);\n p.add(FAM, Bytes.toBytes(\"val\"), row);\n puts.add(p);\n }\n tbl.put(puts);\n tbl.flushCommits();\n }", "public List<LotReportRow> generateReportOnAllLots(int start, int numOfRows) throws MiddlewareQueryException;", "public static void subTables(List<Individual> rows, Connection c, List<Column> allColumns) throws IOException {\n\t\tMenu menu = new AutoMenu();\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tString[] tables = menu.getTables();\n\t\t\tfor (int i = 0; i < tables.length; i++) {\n\t\t\t\tString table = tables[i];\n\t\t\t\tString subCreate = \"CREATE TABLE \" + table + \"( \";\n\t\t\t\tList<Column> cols = menu.getTableCols(table, allColumns); //assume they'll say id\n\t\t\t\tMap<Column, String> sampleVals = rows.get(0).getValues();\n\t\t\t\tfor (Column col : cols) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tInteger.parseInt(sampleVals.get(col));\n\t\t\t\t\t\tsubCreate = subCreate + col.datatype + \" BIGINT NOT NULL, \";\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\tsubCreate = subCreate + col.datatype + \" VARCHAR NOT NULL, \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsubCreate = subCreate.substring(0, subCreate.length() - 2) + \");\";\n\t\t\t\t\t//don't need primary or foreign keys in these tables\n\t\t\t\tstmt = c.prepareStatement(subCreate);\n\t\t\t\tstmt.executeUpdate();\t\n\t\t\t\n\t\t\t\tdouble prob = menu.getProbability(table);\n\t\t\t\tfor (Individual person : rows) {\n\t\t\t\t\tdouble random = Math.random();\n\t\t\t\t\t\tif (random <= prob) { //put in both\n\t\t\t\t\t\t\tString insert = writeIndividual(person, tables[i], cols);\n\t\t\t\t\t\t\tstmt = c.prepareStatement(insert);\n\t\t\t\t\t\t\tstmt.executeUpdate();\n\t\t\t\t\t\t} \n\t\t\t\t}\t\t\n\t\t\t}\t\t\t\n\t\t\tstmt.close();\n\t\t\taddDbCols(rows, c, tables, allColumns);\n\t\t}\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\t\tSystem.exit(0);\n\t\t\t}\t\t\t\t\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 void doCreateTable();", "private void createStressTestRowOutgoingTable(int payloadColumns) {\n Column[] defaultColumns = getDefaultStressTestRowColumns();\n Table table = new Table(STRESS_TEST_ROW_OUTGOING, defaultColumns);\n List<Column> payloads = getPayloadColumns(payloadColumns);\n\n table.addColumns(payloads);\n engine.getDatabasePlatform().createTables(true, true, table);\n }", "private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }", "public static void createEntriesInBatch(Map<byte[], Double> table)\n throws RocksDBException {\n byte[] keyword;\n double weight;\n\n for (Entry<byte[], Double> it : table.entrySet()) {\n keyword = it.getKey();\n weight = it.getValue();\n db.put(keyword, ByteIntUtilities.doubleToByteArray(weight));\n }\n }", "public void populateHiveTable(GenericService genericService, String nonce) {\n // Get the current method name\n String methodName = new Throwable().getStackTrace()[0].getMethodName();\n\n // To time how long function takes to run\n Stopwatch stopwatch = Stopwatch.createStarted();\n\n String numberColName = \"number\";\n if (!genericService.getTableName().equals(\"blocks\")\n && !genericService.getTableName().equals(\"block_timestamp_mapping\")) {\n numberColName = \"block_number\";\n }\n\n String liveTableCols = genericService.getFieldDescriptors().stream()\n .map(s -> String.format(\"`%s`\", s.getName()))\n .collect(Collectors.joining(\",\"));\n\n // Generate all columns of table\n String columns = genericService.getFieldDescriptors().stream()\n .map(s -> String.format(\"a.`%s`\", s.getName()))\n .collect(Collectors.joining(\",\"));\n\n // Strict mode insertion (for multi-user environment)\n // Use this mode when multiple imports are happening at once\n// String sql =\n// \"INSERT INTO %s.%s (%s) \"\n// + \"SELECT %s FROM %s a \"\n// + \"LEFT OUTER JOIN %s.%s b ON a.%s = b.%s \"\n// + \"WHERE b.%s IS NULL\";\n// String query = String.format(\n// sql,\n// schema,\n// genericService.getTableName(),\n// liveTableCols,\n// columns,\n// genericService.getTmpTableName() + \"_\" + nonce,\n// schema,\n// genericService.getTableName(),\n// numberColName,\n// numberColName,\n// numberColName\n// );\n\n // Non-strict mode insertion\n String sql =\n \"INSERT INTO %s.%s (%s) \"\n + \"SELECT %s FROM %s a\";\n String query = String.format(\n sql,\n schema,\n genericService.getTableName(),\n liveTableCols,\n columns,\n genericService.getTmpTableName() + \"_\" + nonce\n );\n \n jdbcTemplate.execute(query);\n\n stopwatch.stop(); // Optional\n log.info(\"[{} - {}] -> Time elapsed: [{}] ms\",\n genericService.getTableName(),\n methodName,\n stopwatch.elapsed(TimeUnit.MILLISECONDS)\n );\n }", "tbls createtbls();", "static Stream<Arguments> randomRecord() throws IOException {\n final int MAX_ROWS = 10;\n\n // For each struct type, generate a fixture that holds schema/records\n // of that type.\n return (IntStream.range(0, SCHEMA_TYPES.length))\n .mapToObj((i) -> {\n try {\n return Fixture.of(TestUtils.createSession()).withRecords(SCHEMA_TYPES[i]);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n })\n .flatMap((fixture) -> {\n return IntStream.range(0, Math.min(MAX_ROWS, fixture.records.length))\n .mapToObj((i) -> {\n return Arguments.of(i, fixture.rows[i], fixture.records[i]);\n })\n .flatMap((args) -> {\n Integer offset = (Integer)args.get()[0];\n Row[] rows = (Row[])args.get()[1];\n SinkRecord[] records = (SinkRecord[])args.get()[2];\n return IntStream.range(0, Math.min(MAX_ROWS, records.length))\n .mapToObj((j) ->\n {\n return Arguments.of(fixture,\n offset,\n rows[j],\n records[j]);\n });\n });\n });\n }", "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}", "public void populateAccountsTable() {\n Account account1 = createAccountFromFile(\"DummyAccount1.json\");\n Account account2 = createAccountFromFile(\"DummyAccount2.json\");\n\n // Account 1 will have both contacts associated to it\n account1.setContactIds(Set.of(contacts.get(0).getUid(), contacts.get(1).getUid()));\n\n // Account 2 will only have 1 contact associated to it\n account2.setContactIds(Set.of(contacts.get(0).getUid()));\n\n accountService.postAccount(account1);\n accountService.postAccount(account2);\n }", "public String getRandomCharecter(){\n\n\tif (!dataprepared){\n\t prepareData();\n\t}\n\t\n\tAssert.pre(table!=null,\"data must be prepared\");\n\n\treturn (String)table.get(r.nextInt(total));\n\n\t\n }", "@ParameterizedTest\n @MethodSource(\"randomRecord\")\n public void testResolveTableFromColumn(Fixture fixture,\n Integer offset,\n Row row,\n SinkRecord record) {\n Map<String, String> props = fixture.props;\n\n props.put(ConnectorUtils.TABLE_FROM_COLUMN_CONFIG, Fixture.TABLE_COLUMN_ID);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_SKELETON_COLUMN_CONFIG, Fixture.SKELETON_COLUMN_ID);\n\n this.task.start(props);\n this.task.put(Collections.singletonList(record));\n this.task.flush(new HashMap());\n\n // Sleep 1 second, our flush interval\n try {\n Thread.sleep(1100);\n } catch (Exception e) {\n throw new Error(\"Unexpected exception\", e);\n }\n\n String tableFromColumnName = fixture.tableFromColumnName[offset];\n\n Timespec ts = new Timespec(record.timestamp());\n TimeRange[] ranges = { new TimeRange(ts, ts.plusNanos(1)) };\n Reader reader = Table.reader(TestUtils.createSession(), tableFromColumnName, ranges);\n assertEquals(true, reader.hasNext());\n\n\n\n\n this.task.stop();\n }", "private void generateData(int popsize, int ntrials) {\n data = new double[ntrials][100];\n \n for (int i = 0; i < ntrials; i++) {\n Population pop = new Population(popsize, rand);\n for (int j = 0; j < 100; j++) {\n data[i][j] = pop.totalA();\n pop.advance();\n }\n }\n }", "public void initTable();", "private void seedOutgoing(int runId, long rows, int payloadColumns) {\n long currentRows = outgoingCounts.containsKey(runId) ? outgoingCounts.get(runId) : 0;\n String sql = buildInsertSql(STRESS_TEST_ROW_OUTGOING, payloadColumns);\n while (currentRows < rows) {\n insert(sql, currentRows, runId, payloadColumns);\n currentRows++;\n }\n\n outgoingCounts.put(runId, currentRows);\n }", "void insertBatch(List<TABLE41> recordLst);", "static Stream<Arguments> randomRecords() throws IOException {\n return (IntStream.range(0, SCHEMA_TYPES.length))\n .mapToObj((i) -> {\n try {\n return Fixture.of(TestUtils.createSession()).withRecords(SCHEMA_TYPES[i]);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n })\n .flatMap((fixture) -> {\n return IntStream.range(0, fixture.records.length)\n .mapToObj((i) -> {\n return Arguments.of(fixture, i, Arrays.asList(fixture.records[i]));\n });\n });\n }", "private void setNewTable() {\n\n for (List<Entity> list:\n masterList) {\n for (Entity entity :\n list) {\n entity.removeFromWorld();\n }\n list.clear();\n }\n\n gameFacade.setGameTable(gameFacade.newFullPlayableTable(\"asd\",\n 6, 0.5, 2, 2));\n for (Bumper bumper :\n gameFacade.getBumpers()) {\n Entity bumperEntity = factory.newBumperEntity(bumper);\n targets.add(bumperEntity);\n getGameWorld().addEntity(bumperEntity);\n }\n\n for (Target target :\n gameFacade.getTargets()) {\n Entity targetEntity = factory.newTargetEntity(target);\n targets.add(targetEntity);\n getGameWorld().addEntity(targetEntity);\n }\n }", "private void generateTemporaryTable(String tableName, Collection<?> items, SQLProcessor sqlP)\n throws GenericEntityException {\n //Ensure connection is created\n sqlP.getConnection();\n\n //Determine the data type to create based on the item element type\n //Right now this only works for SQL server so we hardcode the SQL server data types\n //And we only support numbers and strings at this point\n Object firstItem = items.iterator().next();\n String dataType;\n if (firstItem instanceof Number) {\n dataType = \"bigint\";\n } else {\n dataType = \"varchar(8000)\"; //8000 is max size of varchar for SQL server\n }\n\n sqlP.executeUpdate(\"create table #\" + tableName + \" (item \" + dataType + \" primary key)\");\n\n //Insert data into this temporary table\n sqlP.prepareStatement(\"insert into #\" + tableName + \" (item) values (?)\");\n PreparedStatement stat = sqlP.getPreparedStatement();\n try {\n for (Object item : items) {\n if (item instanceof Number) {\n stat.setLong(1, ((Number) item).longValue());\n } else if (item instanceof String) {\n stat.setString(1, (String) item);\n } else {\n stat.setObject(1, item);\n }\n\n stat.addBatch();\n }\n stat.executeBatch();\n } catch (SQLException e) {\n throw new GenericEntityException(e.getMessage(), e);\n } finally {\n try {\n stat.close();\n } catch (SQLException ignore) {\n }\n }\n }", "@ParameterizedTest\n @MethodSource(\"randomRecord\")\n public void testResolveTableFromCompositeColumns(Fixture fixture,\n Integer offset,\n Row row,\n SinkRecord record) {\n Map<String, String> props = fixture.props;\n\n\n String tableNameDelim = fixture.tableCompositeColumnDelim[offset];\n String[] tableNameParts = fixture.tableCompositeColumnParts[offset];\n\n props.put(ConnectorUtils.TABLE_FROM_COMPOSITE_COLUMNS_CONFIG, String.join(\",\", Fixture.TABLE_COMPOSITE_COLUMNS_IDS));\n props.put(ConnectorUtils.TABLE_FROM_COMPOSITE_COLUMNS_DELIM_CONFIG, tableNameDelim);\n props.put(ConnectorUtils.TABLE_AUTOCREATE_SKELETON_COLUMN_CONFIG, Fixture.SKELETON_COLUMN_ID);\n\n this.task.start(props);\n this.task.put(Collections.singletonList(record));\n this.task.flush(new HashMap());\n\n // Sleep 1 second, our flush interval\n try {\n Thread.sleep(1100);\n } catch (Exception e) {\n throw new Error(\"Unexpected exception\", e);\n }\n\n Timespec ts = new Timespec(record.timestamp());\n TimeRange[] ranges = { new TimeRange(ts, ts.plusNanos(1)) };\n\n String tableName = String.join(tableNameDelim, tableNameParts);\n\n Reader reader = Table.reader(TestUtils.createSession(), tableName, ranges);\n assertEquals(true, reader.hasNext());\n\n\n this.task.stop();\n }", "public void appendRecord(float num) throws IOException {\n\tDocument doc = parseFile();\n\tElements transactions = doc.select(\"table[id=transactions]\");\n\tElement last = null;\n\tfor (Element el: transactions) {\n\t last = el;\n\t}\n\tElements tbody = last.select(\"tbody\");\n\tfor (Element el: tbody) {\n\t last = el;\n\t}\n\tString text = String.format(\"%.2f\", num);\n\tlast.appendElement(\"tr\").appendElement(\"td\").text(text);\n\tString newcontents = doc.html();\n\tif (newcontents != null) {\n\t htmlrandom.seek(0);\n\t BufferedWriter out = new BufferedWriter(new OutputStreamWriter(Channels.newOutputStream(htmlrandom.getChannel())));\n\t out.write(newcontents);\n\t out.flush();\n\t htmlrandom.setLength(newcontents.length());\n\t}\n }", "private GenericTableView populateSeriesSamplesTableView(String viewName) {\n\t GenericTable table = assembler.createTable();\n GenericTableView tableView = new GenericTableView (viewName, 5, table);\n tableView.setRowsSelectable();\n\t\ttableView.addCollection(0, 0);\n tableView.setCollectionBottons(1);\n tableView.setDisplayTotals(false);\n //tableView.setColAlignment(2, 0);\n tableView.setColAlignment(5, 0);\n tableView.setColAlignment(6, 0);\n \n return tableView;\n }", "private DataSet constantDataSet(){\n DataSet dataSet = new DataSet();\n Task[] tasks = new Task[NUM_DISTINCT_TASKS];\n //generate taks with all 50 mills\n for(int i=0; i < NUM_DISTINCT_TASKS; i++){\n UUID uuid = UUID.randomUUID();\n tasks[i] = new Task(TARGET_MEAN, uuid);\n }\n for(int i=0; i < NUM_TASKS; i++){\n dataSet.getTasks().add(tasks[random.nextInt(NUM_DISTINCT_TASKS)]);\n }\n return dataSet;\n }", "protected abstract void initialiseTable();", "void initTable();", "public void generateImpatedRecords ()\r\n\t{\n\t\tRequest req = table.createRequest();\r\n\t\treq.setXPathFilter(path_to_id.format()+\"='\" + id +\"'\");\r\n\t\tRequestResult res = req.execute();\r\n\t\tshow(\"got results \" + res.getSize() );\r\n\t\tAdaptation ada = res.nextAdaptation();\r\n\t\tshow (\"STARTDATE: \" + startdate + \" ENDDATE: \" + enddate);\r\n\t\tshow(\"________________________________________________\");\r\n\t\twhile (ada!=null)\r\n\t\t{ \r\n\t\t\t\r\n\t\t\tDate adaStartDate = ada.getDate(path_to_start);\r\n\t\t\tDate adaEndDate = ada.getDate(path_to_end);\r\n\t\t\t//check im not me!\r\n\t\t\tif (!(ada.getOccurrencePrimaryKey().format().equals(newRecord.getOccurrencePrimaryKey().format())))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t// the record has been updated but date has not changed\r\n\t\t\t\tif (enddate!=null&&adaEndDate!=null&&(adaStartDate.equals(startdate)&&adaEndDate.equals(enddate)))\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tshow(\"The Record needs Spliting\");\r\n\t\t\t\t\trecordToSplit = ada;\r\n\t\t\t\t\tnewEndDate = addDays(startdate,-1);\r\n\t\t\t\t\tbeforeRecord = ada;\r\n\t\t\t\t\tnewStartDate = addDays(enddate,+1);\r\n\t\t\t\t\tafterRecord = ada;\r\n\t\t\t\t}\r\n\t\t\t\telse if (enddate!=null&&adaEndDate!=null&&(adaStartDate.before(startdate)&&adaEndDate.after(enddate)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tshow(\"The Record needs Spliting\");\r\n\t\t\t\t\t\t\trecordToSplit = ada;\r\n\t\t\t\t\t\t\tnewEndDate = addDays(startdate,-1);\r\n\t\t\t\t\t\t\tbeforeRecord = ada;\r\n\t\t\t\t\t\t\tnewStartDate = addDays(enddate,+1);\r\n\t\t\t\t\t\t\tafterRecord = ada;\r\n\t\t\t\t\t\t}\r\n\t\t\t\telse if (adaStartDate == null && adaEndDate == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tshow (\"set end date on existing record\");\r\n\t\t\t\t\tbeforeRecord= ada;\r\n\t\t\t\t\tnewEndDate = addDays (startdate, -1);\r\n\t\t\t\t}\r\n\t\t\t\t\t\telse if (adaStartDate.before(startdate)&& adaEndDate==null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tshow (\"set end date on existing record\");\r\n\t\t\t\t\t\t\tbeforeRecord= ada;\r\n\t\t\t\t\t\t\tnewEndDate = addDays (startdate, -1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\telse if (adaStartDate.before(startdate) && adaEndDate.after(startdate))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tshow (\"need to move existing end date\");\r\n\t\t\t\t\t\t\tbeforeRecord= ada;\r\n\t\t\t\t\t\t\tnewEndDate = addDays (startdate, -1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (enddate!=null&&enddate==null&&adaStartDate.after(enddate))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tshow (\"need to end date new record\");\r\n\t\t\t\t\t\t\tbeforeRecord = newRecord;\r\n\t\t\t\t\t\t\tnewEndDate = addDays(adaStartDate, -1);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\tada = res.nextAdaptation();\r\n\t}\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }", "final private void prepareTableWithValues(final Connection conn, final int nRows) throws Exception {\n conn.createStatement().execute(\"create table \" + tableName + \"\\n\" +\n \" (i1 integer not null, i2 integer not null\\n\" +\n \" CONSTRAINT pk PRIMARY KEY (i1,i2))\");\n \n final PreparedStatement stmt = conn.prepareStatement(\n \"upsert into \" + tableName + \n \" VALUES (?, ?)\");\n for (int i = 0; i < nRows; i++) {\n stmt.setInt(1, i);\n stmt.setInt(2, i*100);\n stmt.execute();\n }\n conn.commit();\n \n conn.createStatement().execute(\"UPDATE STATISTICS \" + tableName);\n \n //Prepare for second table\n conn.createStatement().execute(\"create table \" + joinedTableName + \"\\n\" +\n \" (i1 integer not null, i2 integer not null\\n\" +\n \" CONSTRAINT pk PRIMARY KEY (i1,i2))\");\n \n final PreparedStatement stmt2 = conn.prepareStatement(\n \"upsert into \" + joinedTableName + \n \" VALUES (?, ?)\");\n for (int i = 0; i < nRows; i++) {\n stmt2.setInt(1, i);\n stmt2.setInt(2, i*-100);\n stmt2.execute();\n }\n conn.commit();\n conn.createStatement().execute(\"UPDATE STATISTICS \" + joinedTableName);\n }", "public void createT5(int rows) {\n\t\tExecutorService dataExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable worker1 = new RepeatDataThread(4, Application.THREAD_ONE_PATH\n\t\t\t\t+ \"t5\", 42);\n\t\tRunnable worker2 = new RepeatDataThread(4, Application.THREAD_TWO_PATH\n\t\t\t\t+ \"t5\", 42);\n\t\tRunnable worker3 = new RepeatDataThread(4,\n\t\t\t\tApplication.THREAD_THREE_PATH + \"t5\", 42);\n\t\tRunnable worker4 = new RepeatDataThread(4, Application.THREAD_FOUR_PATH\n\t\t\t\t+ \"t5\", 42);\n\t\tdataExecutor.execute(worker1);\n\t\tdataExecutor.execute(worker2);\n\t\tdataExecutor.execute(worker3);\n\t\tdataExecutor.execute(worker4);\n\t\tdataExecutor.shutdown();\n\t\ttry {\n\t\t\tdataExecutor.awaitTermination(1, TimeUnit.MINUTES);\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\t\n\t\t// find directory that contains data\n\t\tFile[] files = new File[4];\n\t\tfiles[0] = new File(Application.THREAD_ONE_PATH + \"t5\");\n\t\tfiles[1] = new File(Application.THREAD_TWO_PATH + \"t5\");\n\t\tfiles[2] = new File(Application.THREAD_THREE_PATH + \"t5\");\n\t\tfiles[3] = new File(Application.THREAD_FOUR_PATH + \"t5\");\n\t\tFile outputFile = null;\n\n\t\tfor (File f : files) {\n\t\t\tif (FileUtils.folderSize(f) > 0) {\n\t\t\t\toutputFile = new File(f.toString());\n\t\t\t}\n\t\t}\n\n\t\tif (outputFile == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"unable to avoid initialization exception for table 5.\");\n\t\t}\n\t\t\n\t\tExecutorService loadExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable loadWorker = new LoadThread(outputFile.toString());\n\t\tloadExecutor.execute(loadWorker);\n\t\tloadExecutor.shutdown();\n\t\ttry {\n\t\t\tloadExecutor.awaitTermination(10, TimeUnit.MINUTES);\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\tcleanDirs();\n\t}", "TABLE createTABLE();", "private void generateRows() {\n\t\tfor (int i=0; i<squares.length; i++) {\n\t\t\trows[i]=new Row(squares[i]);\n\t\t}\n\t}", "private void loadAllToTable() {\n \n try {\n ArrayList<CustomerDTO> allCustomers=cusCon.getAllCustomers();\n DefaultTableModel dtm=(DefaultTableModel) tblCustomers.getModel();\n dtm.setRowCount(0);\n \n if(allCustomers!=null){\n for(CustomerDTO customer:allCustomers){\n \n Object[] rowdata={\n customer.getcId(),\n customer.getcName(),\n customer.getContact(),\n customer.getCreditLimit(),\n customer.getCreditDays()\n };\n dtm.addRow(rowdata);\n \n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AddCustomer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void create_dataset(double sampling_rate, double freq, int n) {\n double amplitude = 10.0d;\n double constant = freq/sampling_rate*2.0d*Math.PI;\n double sumTWD=0.0d;\n\n for (int i = 0; i < n; i++) {\n NavigationTools.TWD.add((Math.sin((double)i*constant)+Math.random()*0.2d)*amplitude);\n sumTWD += NavigationTools.TWD.getLast();\n }\n\n NavigationTools.TWD_longAVG=sumTWD/(double)n;\n }", "private static void manageTableCreation(int upperBound) {\r\n\t\tcreateTables(100, upperBound);\r\n\t\tcreateTables(200, upperBound);\r\n\t\tcreateTables(400, upperBound);\r\n\t\tcreateTables(600, upperBound);\r\n\t\tcreateTables(800, upperBound);\t\t\r\n\t}", "private void generateNRandomTasks() {\n\t\tthis.averageServiceTime = 0;\n\t\tfor (int i = 1; i <= this.numberOfClients; i++) {\n\t\t\tRandom rand = new Random();\n\t\t\tint processingTime = 0;\n\t\t\tint arrivalTime = 0;\n\t\t\ttry {\n\t\t\t\tprocessingTime = rand.ints(minProcessingTime, maxProcessingTime).limit(1).findFirst().getAsInt();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tprocessingTime = minProcessingTime;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tarrivalTime = rand.ints(minArrivingTime, maxArrivingTime).limit(1).findFirst().getAsInt();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tarrivalTime = minArrivingTime;\n\t\t\t}\n\t\t\tTask task = new Task(arrivalTime, processingTime, i);\n\t\t\tgeneratedTasks.add(task);\n\t\t\taverageServiceTime += processingTime;\n\t\t}\n\t\t// sort tasks based on their arrival time\n\t\tCollections.sort(generatedTasks, new ArrivalTimeComparator());\n\t\taverageServiceTime /= this.numberOfClients;\n\t}", "protected abstract void addTables();", "@ParameterizedTest\n @MethodSource(\"randomRecord\")\n public void testPutRow(Fixture fixture, Integer offset, Row row, SinkRecord record) {\n Map<String, String> props = fixture.props;\n props.put(ConnectorUtils.TABLE_FROM_TOPIC_CONFIG, \"true\");\n\n this.task.start(props);\n this.task.put(Collections.singletonList(record));\n this.task.stop();\n }", "@Test\r\n\tpublic void test() {\r\n\t\tfor(int i=0;i<100;i++) {\r\n\t\t\tinsert();\r\n\t\t}\r\n\t\tselectAll();\r\n\t}", "public static List<SequentialTargetQuery> randomGenerate(int n, int m, RaptorModel model) {\n\t\tList<SequentialTargetQuery> queries = new ArrayList<SequentialTargetQuery>();\n\t\t\n\t\tList<RaptorStop> stops = new ArrayList<RaptorStop>(model.getStops().values());\n//\t\tList<String> days = new ArrayList<String>(\n//\t\t\t\tArrays.asList(\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"));\n\t\tList<String> days = new ArrayList<String>(\n\t\t\t\tArrays.asList(\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"));\n\t\t\n\t\tList<Integer> sampledIds = new ArrayList<Integer>();\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tRandom rd = new Random();\n\t\t\t\n\t\t\t// randomly generate source and target stops\n\t\t\tint sourceId = rd.nextInt(model.getStops().size());\n\t\t\tsampledIds.add(new Integer(sourceId));\n\t\t\t\n\t\t\tList<String> ts = new ArrayList<String>();\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\tint targetId;\n\t\t\t\tdo {\n\t\t\t\t\ttargetId = rd.nextInt(model.getStops().size());\n\t\t\t\t} while (sampledIds.contains(new Integer(targetId)));\n\t\t\t\tts.add(stops.get(targetId).getId());\n\t\t\t\tsampledIds.add(new Integer(sourceId));\n\t\t\t}\n\t\t\t\n\t\t\t// randomly generate day\n\t\t\tint id = rd.nextInt(days.size());\n\t\t\tString day = days.get(id);\n\t\t\t\n\t\t\t// randomly generate now\n\t\t\tint now = rd.nextInt(ModelBuilder.secondsPerDay);\n\t\t\t\n\t\t\tSequentialTargetQuery query = new SequentialTargetQuery(stops.get(sourceId).getId(), null, day, now, ts);\n\t\t\tqueries.add(query);\n\t\t}\n\t\t\n\t\treturn queries;\n\t}", "private void loadTable(List<Functions> readAll) {\n Vector cols = new Vector();\n cols.add(\"Name\");\n cols.add(\"Description\");\n\n Vector rows = new Vector();\n for (Functions f : readAll) {\n Vector row = new Vector();\n row.add(f.getName());\n row.add(f.getDes());\n rows.add(row);\n }\n\n tblFunction.setModel(new DefaultTableModel(rows, cols));\n tblFunction.updateUI();\n spnFunction.setViewportView(this.tblFunction);\n }", "public static void write(List<Individual> rows, List<Column> allColumns) {\n\t\tConnection c = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tc = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/microsim\", \"postgres\", \"microsim2016\");\n\t\t\tc.setAutoCommit(false);\n\t\t\n\t\t\tString create = \"CREATE TABLE TOTAL(\";\n\t\t\tMap<Column, String> values = rows.get(0).getValues();\n\t\t\tfor (Column col : values.keySet()) {\n\t\t\t\tSource s = col.source;\n\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tInteger.parseInt(values.get(col));\n\t\t\t\t\t\tcreate = create + col.datatype + \" BIGINT \" + \"NOT NULL, \";\n\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\tcreate = create + col.datatype + \" VARCHAR \" + \"NOT NULL, \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreate = create + \" PRIMARY KEY(id));\"; \n\t\t\tstmt = c.prepareStatement(create);\t\t\t\n\t\t\tstmt.executeUpdate();\n\t\t\tfor (Individual i : rows) {\n\t\t\t\tString insert = \"INSERT INTO TOTAL \" +\n\t\t\t\t\t\t\t\t\"VALUES (\";\n\t\t\t\t\n\t\t\t\tMap<Column, String> iValues = i.getValues();\n\t\t\t\tfor (Column col : iValues.keySet()) {\n\t\t\t\t\tSource sc = col.source;\n\t\t\t\t\tif (!sc.equals(Source.MULTI_VALUE) && !sc.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\tString s = iValues.get(col);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tInteger.parseInt(s);\n\t\t\t\t\t\t\tinsert = insert + \" \" + s + \",\"; \n\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\tinsert = insert + \" '\" + s + \"', \"; //doing this each time because need to add '' if a string and no user input\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tinsert = insert.substring(0, insert.length() - 2); //cut off last , \n\t\t\t\tinsert = insert + \");\"; \n\t\t\t\tstmt = c.prepareStatement(insert);\n\t\t\t\tstmt.executeUpdate();\t\t\t\n\t\t\t}\n\t\t\tstmt.close();\n\t\t\tsubTables(rows, c, allColumns);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n\t System.exit(0);\n\t\t}\t\t\t\t\n\t}", "@Test\n\tpublic static void PersonTest01() {\n\t\t\tString targetTable = \"DATA_TEST\";\n\t\t\ttargetTable = \"test_sample\";\n\t\t\ttry{\n\t\t\tPriorDAO DAO = new PriorDAO();\n\t\t\tDAO.DropTempTable(targetTable);\n\t\t\tString[] inArgs ={\"CREATE_EMPTY_FACT_TABLE\",targetTable};\n\t\t\tDAO.RunProcedure(inArgs, null, null);\n\t\tGenerator Gen = new Generator();\n\t\tint crowedSize = 10000;\n\t\tcrowedSize = 1000;\n\t\tmakePop(Gen, crowedSize, targetTable);\n\t\tGeneratorType2 Gen2 = new GeneratorType2();\n\t\tmakePop(Gen2, crowedSize, targetTable);\n\t\tPrint(\"Finished\");\n\t\t\t}catch(Exception e)\n\t\t\t{\n\t\t\t\tPrint(\"Failed :\"+e.getMessage());\n\t\t\t}\n\t}", "public GenerateRandomInstances(int n) {\r\n this.sources = new Source[n];\r\n this.sources[0] = new Factory(\"S\" + 0, (int) (Math.random() * 50) + 10);\r\n for (int i = 1; i < n; i++) { // generate random values for supply\r\n this.sources[i] = new Warehouse(\"S\" + i, (int) (Math.random() * 50) + 10);\r\n //sum += this.sources[i].getSupply();\r\n }\r\n this.destinations = new Destination[n];\r\n for (int i = 0; i < n; i++) { // generate random values for supply\r\n this.destinations[i] = new Destination(\"D\" + i, (int) (Math.random() * 50) + 10);\r\n }\r\n this.costMatrix = new int[n][n];\r\n for (int k = 0; k < n; k++) { // generate random values for cost matrix\r\n for (int j = 0; j < n; j++) {\r\n this.costMatrix[k][j] = (int) (Math.random() * 9) + 1;\r\n }\r\n }\r\n }", "List<User> getRandomUsers(List<User> uList, int num);", "private void uploadBatchTable(InsertAllRequest insertAllRequest) {\n final Stopwatch stopwatch = stopwatchProvider.get();\n final ImmutableMultimap.Builder<TableId, InsertAllResponse> responseMapBuilder =\n ImmutableMultimap.builder();\n final StringBuilder performanceStringBuilder = new StringBuilder();\n issueInsertAllRequest(\n stopwatch, responseMapBuilder, performanceStringBuilder, insertAllRequest);\n log.info(performanceStringBuilder.toString());\n // Check response and abort the process if any error happens. In this case, verify_snapshot\n // won't have the 'successful' record, hence we know that is a \"bad\" dataset.\n checkResponse(responseMapBuilder.build());\n }", "public void generateGenes() {\n\t\tfor(int i = 0; i < geneNumber; i++){\n\t\t\tdouble[] vector = new double[NUM_HEURISTICS];\n\t\t\tfor(int j = 0; j < NUM_HEURISTICS; j++){\n\t\t\t\t// To get a number in [-0.5, 0.5)\n\t\t\t\tvector[j] = Math.random() - 0.5;\n\t\t\t}\n\t\t\tGene newGene = new Gene(vector, true);\n\t\t\tgenepool.add(newGene);\n\t\t}\n\t}", "public List<TransactionReportRow> generateReportOnAllReserveTransactions(int start, int numOfRows) throws MiddlewareQueryException;", "void populateMaps(int tableSize, PersistentCorfuTable<String, Long> table1, PersistentCorfuTable<String, Long> table2) {\n for (int i = 0; i < tableSize; i++) {\n try {\n table1.insert(String.valueOf(i), (long) i);\n table2.insert(String.valueOf(i), (long) 0);\n } catch (TrimmedException te) {\n // shouldn't happen\n te.printStackTrace();\n throw te;\n }\n }\n }", "public abstract void createTables() throws DataServiceException;", "public void createTable() {\r\n\t\tclient.createTable();\r\n\t}", "private List<Integer> generateRandom() {\n Integer[] randArr = new Integer[numCols*numRows];\n\n int start = 0;\n int end;\n for(int i = 0; i < myStateMap.size(); i++) {\n int amt = myStateMap.get(i).getAmount();\n end = amt + start;\n for(int j = start; j < end; j++) {\n if(end > randArr.length) {\n break;\n }\n randArr[j] = myStateMap.get(i).getType();\n }\n start = end;\n }\n\n List<Integer> arr = new ArrayList<>(Arrays.asList(randArr));\n Collections.shuffle(arr);\n return arr;\n }", "void createArray(int n) {\n numbers = new int[n];\n for ( int i = 0; i < n; i++){\n numbers[i] = random.nextInt(1000);\n }\n }", "private static void addRow(VectorizedRowBatch b, long rowIdx, long rndValue) {\n ((LongColumnVector) b.cols[0]).vector[b.size] = rndValue;\n // column s2: STRUCT<fs: DECIMAL(20, 6)> alternate null values at STRUCT, no nulls on CHILD\n if (rowIdx % 2 == 0) {\n b.cols[1].noNulls = false;\n b.cols[1].isNull[b.size] = true;\n } else {\n HiveDecimalWritable d = new HiveDecimalWritable();\n d.setFromLongAndScale(rndValue, scale);\n ((DecimalColumnVector) ((StructColumnVector) b.cols[1]).fields[0]).vector[b.size] = d;\n ((BytesColumnVector) ((StructColumnVector) b.cols[1]).fields[1])\n .setVal(b.size, String.valueOf(rndValue).getBytes(StandardCharsets.UTF_8));\n }\n // column u3: UNION<LONG, STRING> repeat, NULL, LONG, STRING\n if (rowIdx % 3 == 0) {\n b.cols[2].noNulls = false;\n b.cols[2].isNull[b.size] = true;\n } else if (rowIdx % 3 == 1) {\n ((UnionColumnVector) b.cols[2]).tags[b.size] = 0;\n ((LongColumnVector) ((UnionColumnVector) b.cols[2]).fields[0]).vector[b.size] = rndValue;\n } else {\n ((UnionColumnVector) b.cols[2]).tags[b.size] = 1;\n ((BytesColumnVector) ((UnionColumnVector) b.cols[2]).fields[1])\n .setVal(b.size, String.valueOf(rndValue).getBytes(StandardCharsets.UTF_8));\n }\n // column f4: STRING\n ((BytesColumnVector) b.cols[3])\n .setVal(b.size, String.valueOf(rndValue).getBytes(StandardCharsets.UTF_8));\n // column ridx: LONG\n ((LongColumnVector) b.cols[4]).vector[b.size] = rowIdx;\n }", "private void createSavingsAccountsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE savingsAccounts \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY ( START WITH 2000000001, INCREMENT BY 1), \" + \"owner INT, \"\n\t\t\t\t\t+ \"balance DOUBLE, \" + \"intRate DOUBLE, \"\n\t\t\t\t\t+ \"timeCreated BIGINT, \" + \"lastPaidInterest DOUBLE, \"\n\t\t\t\t\t+ \"dateOfLastPaidInterest BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table SavingsAccounts\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of SavingsAccounts table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "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}", "private void populateTable() {\n this.allLogs = this.auditLogService.getAllLogs();\n // Creat columns for users\n\n\n TableColumn<Map, String> actionColumn = new TableColumn<>(\"Action\");\n actionColumn.setCellValueFactory(new MapValueFactory<>(\"action\"));\n\n TableColumn<Map, String> actionByColumn = new TableColumn<>(\"By\");\n actionByColumn.setCellValueFactory(new MapValueFactory<>(\"actionByUserId\"));\n\n TableColumn<Map, String> actionAt = new TableColumn<>(\"At\");\n actionAt.setCellValueFactory(new MapValueFactory<>(\"createdAt\"));\n this.listOfLogs.getColumns().add(actionColumn);\n this.listOfLogs.getColumns().add(actionByColumn);\n this.listOfLogs.getColumns().add(actionAt);\n // Create an observable list to add customers to\n ObservableList<Map<String, Object>> items = FXCollections.<Map<String, Object>>observableArrayList();\n\n this.allLogs.forEach(log -> {\n Map<String, Object> obj = new HashMap<>();\n // Forces int to be string to be converted back to int\n obj.put(\"action\", log.getAction());\n obj.put(\"actionByUserId\", log.getActionByUserId().getName());\n obj.put(\"createdAt\", log.getCreatedAt());\n items.add(obj);\n });\n\n // Add all the users to the table\n this.listOfLogs.getItems().addAll(items);\n }", "private void populateStudentAndFaculty() {\n for (int i = 0; i < 25; i++) {\n System.out\n .println(\"INSERT INTO `4400`.`StudentAndFaculty` (`username`, `firstName`, `lastName`, `dob`, `gender`, `email`, `address`, `isFaculty`, `isDebarred`, `dept`, `penalty`) VALUES ('user\"\n + i\n + \"', '\"\n + MALE_NAMES[i]\n + \"', '\"\n + LAST_NAMES[i]\n + \"', '19\"\n + randomInt(50, 96)\n + \"-\"\n + MONTHS[randomInt(0, MONTHS.length - 1)]\n + \"-\"\n + randomInt(1, 27)\n + \"', 'male', '\"\n + MALE_NAMES[i]\n + LAST_NAMES[i]\n + \"@\"\n + EMAILS[randomInt(0, EMAILS.length - 1)]\n + \"', '\"\n + ADDRESSES[i] + \"', '0', '0', NULL, '0.00');\");\n }\n for (int i = 0; i < 25; i++) {\n System.out\n .println(\"INSERT INTO `4400`.`StudentAndFaculty` (`username`, `firstName`, `lastName`, `dob`, `gender`, `email`, `address`, `isFaculty`, `isDebarred`, `dept`, `penalty`) VALUES ('user\"\n + (i + 25)\n + \"', '\"\n + FEMALE_NAMES[i]\n + \"', '\"\n + LAST_NAMES[i + 25]\n + \"', '19\"\n + randomInt(50, 96)\n + \"-\"\n + MONTHS[randomInt(0, MONTHS.length - 1)]\n + \"-\"\n + randomInt(1, 27)\n + \"', 'female', '\"\n + FEMALE_NAMES[i]\n + LAST_NAMES[i + 25]\n + \"@\"\n + EMAILS[randomInt(0, EMAILS.length - 1)]\n + \"', '\"\n + ADDRESSES[i + 25] + \"', '0', '0', NULL, '0.00');\");\n }\n }", "public static void rand_generator(int[] ran,int n,int min, int max){\r\n Random r1 = new Random(); // rand function\r\n for(int i=0;i<n;i++)\r\n {\r\n ran[i] = r1.nextInt((max - min) + 1) + min; // saving the random values in the corresponding arrays\r\n }\r\n }", "private List<Record> generateRecords(int tenantId, String tableName, long time, int timeOffset,int errorMessages,int infoMessages) {\n\t\tList<Record> result = new ArrayList<Record>();\n\n for (int i = 0; i < errorMessages; i++) {\n result.add(generateRecord(tenantId, tableName, \"ERROR\", \"[ERROR] /get failed for tenant:\" + tenantId,\n time, timeOffset, true));\n }\n for (int i = 0; i < infoMessages; i++) {\n result.add(generateRecord(tenantId, tableName, \"INFO\", \"[INFO] the request success for tenant:\" + tenantId,\n time, timeOffset, true));\n }\n return result;\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic void migrateDataByBatch() {\n\t\tpool = new HTablePool(conf, 1024);\n\t\tSQLExporter sqlExporter = \n\t\t\tnew SQLExporter(url, username, password, catalog);\n\t\twhile(sqlExporter.hasNextDataTable()) {\n\t\t\tEntry entry = sqlExporter.next();\n\t\t\tString tableName = REGION + \".\" + (String) entry.getKey();\n\t\t\tList<Map<String, Object>> list = (List<Map<String, Object>>) entry.getValue();\n\t\t\t/**\n\t\t\t * table to migrate data.\n\t\t\t */\n\t\t\tHTable table = (HTable) pool.getTable(tableName);\n\t\t\t\n\t\t\t/**\n\t\t\t * set write buffer size.\n\t\t\t */\n\t\t\ttry {\n\t\t\t\ttable.setWriteBufferSize(WRITE_BUFFER_SIZE);\n\t\t\t\ttable.setAutoFlush(false);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tint counter = 0;\n\t\t\tList<Put> puts = new ArrayList<Put>();\n\t\t\tint size = list.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\t\n\t\t\t\tPut put = new Put((new Integer(i)).toString().getBytes());\n\t\t\t\t\n\t\t\t\tMap<String, Object> map = list.get(i);\n\t\t\t\tcounter ++;\n\t\t\t\t/**\n\t\t\t\t * add one row to be put.\n\t\t\t\t */\n\t\t\t\tfor (Map.Entry<String, Object> m : map.entrySet()) {\t\n\t\t\t\t\tput.add(FAMILY.getBytes(), m.getKey().getBytes(), \n\t\t\t\t\t\t\tm.getValue().toString().getBytes());\t\n\t\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * add `put` to list puts. \n\t\t\t\t */\n\t\t\t\tputs.add(put);\n\t\t\t\t\n\t\t\t\tif ((counter % LIST_PUTS_COUNTER == 0) || (i == size - 1)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttable.put(puts);\n\t\t\t\t\t\ttable.flushCommits();\n\t\t\t\t\t\tputs.clear();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else continue;\n\t\t\t}\n\t\t}\n\t}", "public void generateRandomArray() {\n for (int i = 0; i < arraySize; i++) {\n theArray[i] = (int) (Math.random() * 10) + 10;\n }\n }", "@Override\n\tpublic DataTable sample(int newSize) {\n\t\tint rowCount = getRowNumber();\n\t\tif (rowCount <= newSize) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// initialize sampled indices\n\t\tint[] sampledSelectedIndices = new int[rowCount];\n\t\tfor (int i = 0; i < rowCount; ++i) {\n\t\t\tsampledSelectedIndices[i] = i;\n\t\t}\n\n\t\t// shuffle sampled indices\n\t\tRandom rng = new Random(0);\n\t\tint swapIdx;\n\t\tint tmpValue;\n\t\tfor (int i = 0; i < rowCount; ++i) {\n\t\t\tswapIdx = rng.nextInt(rowCount);\n\t\t\ttmpValue = sampledSelectedIndices[swapIdx];\n\t\t\tsampledSelectedIndices[swapIdx] = sampledSelectedIndices[i];\n\t\t\tsampledSelectedIndices[i] = tmpValue;\n\t\t}\n\n\t\t// convert prefix of sampled indices to vector and set as selected indices for sampled data\n\t\t// table view\n\t\tDataTableView sampledDataTable = new DataTableView(this);\n\t\tVector<Integer> sampledSelectedIndicesVector = new Vector<Integer>(newSize);\n\t\tfor (int i = 0; i < newSize; ++i) {\n\t\t\tsampledSelectedIndicesVector.add(sampledSelectedIndices[i]);\n\t\t}\n\t\tsampledDataTable.setSelectedIndices(sampledSelectedIndicesVector);\n\n\t\treturn new SortedDataTableView(sampledDataTable, sortProvider);\n\t}", "public static void createMultiPartitionTable(\n DynamoDB dynamodb,\n CreateTableRequest partialRequest,\n int partitions,\n long readRate,\n long writeRate) throws InterruptedException {\n\n System.out.println(\"Getting Table \" + partialRequest.getTableName());\n Table table = dynamodb.getTable(partialRequest.getTableName());\n partialRequest.setProvisionedThroughput(new ProvisionedThroughput(750L * partitions, 750L * partitions));\n try {\n table.describe();\n } catch (ResourceNotFoundException e) {\n System.out.println(\"Creating Table with \" + partitions + \" partitions\");\n table = dynamodb.createTable(partialRequest);\n }\n System.out.println(\"Awaiting Active\");\n table.waitForActive();\n // Dial Down\n if (table.getDescription().getProvisionedThroughput().getWriteCapacityUnits() != writeRate) {\n System.out.println(\"Dialing down to \" + writeRate + \" WCUs\");\n table.updateTable(new ProvisionedThroughput(readRate, writeRate));\n System.out.println(\"Awaiting Active\");\n table.waitForActive();\n }\n System.out.println(\"Table \" + table.getTableName() + \" is Active\");\n }", "public void createTable() {\r\n CreateTableRequest request = new CreateTableRequest()\r\n .withAttributeDefinitions(new AttributeDefinition(\r\n \"Username\", ScalarAttributeType.S))\r\n .withKeySchema(new KeySchemaElement(\"Username\", KeyType.HASH))\r\n .withProvisionedThroughput(new ProvisionedThroughput(\r\n new Long(5), new Long(5)))\r\n .withTableName(\"IST440Users\");\r\n\r\n creds = new BasicAWSCredentials(\"no\", \"nope\");\r\n client = AmazonDynamoDBClientBuilder.standard().\r\n withRegion(\"us-east-1\")\r\n .withCredentials(new AWSStaticCredentialsProvider(creds))\r\n .build();\r\n\r\n db = new DynamoDB(client);\r\n table = db.getTable(\"IST440Users\");\r\n \r\n \r\n tableDescription = table.describe();\r\n System.out.printf(\"%s: %s \\t ReadCapacityUnits: %d \\t WriteCapacityUnits: %d\\n\",\r\n tableDescription.getTableStatus(),\r\n tableDescription.getTableName(),\r\n tableDescription.getProvisionedThroughput().getReadCapacityUnits(),\r\n tableDescription.getProvisionedThroughput().getWriteCapacityUnits()); \r\n }", "@Override\n public void run() {\n try {\n TableDataInsertAllResponse response = bigquery.tabledata()\n .insertAll(projectId, DATASET_ID, TABLE_ID, new TableDataInsertAllRequest()\n .setRows(ImmutableList.of(new TableDataInsertAllRequest.Rows()\n .setInsertId(insertId)\n .setJson(new ImmutableMap.Builder<String, Object>()\n .put(\"path\", path)\n .put(\"method\", method)\n .put(\"tld\", tld)\n .put(\"start_time\", startTime)\n .put(\"end_time\", endTime)\n .put(\"response_code\", responseCode)\n .put(\"activity\", activity)\n .build())))).execute();\n if (response.getInsertErrors() != null && !response.getInsertErrors().isEmpty()) {\n throw new RuntimeException(Joiner.on('\\n').join(FluentIterable\n .from(response.getInsertErrors())\n .transform(new Function<InsertErrors, String>() {\n @Override\n public String apply(InsertErrors error) {\n try {\n return error.toPrettyString();\n } catch (IOException e) {\n return error.toString();\n }\n }})));\n }\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public void populateDataOnTable() {\n /*Defining default table model*/\n DefaultTableModel dtm = new DefaultTableModel(){\n\n @Override\n public boolean isCellEditable(int row, int column) {\n //all cells false\n return false;\n }\n };\n \n try{\n dtm.addColumn(\"Client Id\");\n dtm.addColumn(\"Request Date\");\n dtm.addColumn(\"Request Id\");\n dtm.addColumn(\"Request Subject\");\n dtm.addColumn(\"Description\");\n dtm.addColumn(\"Response Date\");\n dtm.addColumn(\"Response Id\");\n dtm.addColumn(\"Response Subject\");\n dtm.addColumn(\"Description\");\n \n /*Getting the value of clientId and setting it to the request and response*/\n BLRequestResponse blRequestResponse = new BLRequestResponse();\n ResultSet rs = blRequestResponse.selectParticularClientRequestResponse(txt_username.getText()); \n \n while(rs.next()) {\n Object objData[] = new Object[9];\n //objData[0] = this.setInt(num);\n objData[0] = rs.getInt(\"clientId\");\n objData[1] = rs.getString(\"reqDate\");\n objData[2] = rs.getInt(\"requestId\");\n objData[3] = rs.getString(\"requestSubject\");\n objData[4] = rs.getString(\"requestDescrip\");\n objData[5] = rs.getString(\"resDate\");\n objData[6] = rs.getInt(\"responseId\");\n objData[7] = rs.getString(\"responseSubject\");\n objData[8] = rs.getString(\"responseDescrip\");\n \n dtm.addRow(objData);\n }\n this.jTable1.setModel(dtm);\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"Exception\", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "private Line[] makeTenRandomLines() {\n Random rand = new Random(); // create a random-number generator\n Line[] lines = new Line[NUM_LINE];\n for (int i = 0; i < NUM_LINE; ++i) {\n int x1 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y1 = rand.nextInt(300) + 1; // get integer in range 1-300\n int x2 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y2 = rand.nextInt(300) + 1; // get integer in range 1-300\n lines[i] = new Line(x1, y1, x2, y2);\n }\n return lines;\n }", "public List<TransactionReportRow> generateReportOnAllWithdrawalTransactions(int start, int numOfRows) throws MiddlewareQueryException;", "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 }", "@Disabled\r\n\t@Test\r\n\tvoid saveBatch ( ) {\r\n\r\n\t\tlogger.info( Utils.testHeader( ) ) ;\r\n\r\n\t\tvar testEmployees = IntStream.rangeClosed( 1, TEST_RECORD_COUNT )\r\n\t\t\t\t.mapToObj( EmpHelpers::buildRandomizeEmployee )\r\n\t\t\t\t.collect( Collectors.toList( ) ) ;\r\n\r\n\t\temployeeRepository.saveAll( testEmployees ) ;\r\n\r\n\t}", "private void fillIncoming(int runId, long duration, long commitRows, long sleepMs, int payloadColumns) {\n long currentRows = 0;\n long startTime = System.currentTimeMillis();\n long durationMs = duration * 60000;\n\n String sql = buildInsertSql(STRESS_TEST_ROW_INCOMING, payloadColumns);\n while (System.currentTimeMillis() - startTime < durationMs) {\n for (long commitRow = 0; commitRow < commitRows; commitRow++) {\n insert(sql, currentRows + commitRow, runId, payloadColumns);\n }\n currentRows += commitRows;\n AppUtils.sleep(sleepMs);\n }\n }", "public void createT4(int rows) {\n\t\tExecutorService dataExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable worker1 = new RepeatDataThread(3, Application.THREAD_ONE_PATH\n\t\t\t\t+ \"t4\", 42);\n\t\tRunnable worker2 = new RepeatDataThread(3, Application.THREAD_TWO_PATH\n\t\t\t\t+ \"t4\", 42);\n\t\tRunnable worker3 = new RepeatDataThread(3,\n\t\t\t\tApplication.THREAD_THREE_PATH + \"t4\", 42);\n\t\tRunnable worker4 = new RepeatDataThread(3, Application.THREAD_FOUR_PATH\n\t\t\t\t+ \"t4\", 42);\n\t\tdataExecutor.execute(worker1);\n\t\tdataExecutor.execute(worker2);\n\t\tdataExecutor.execute(worker3);\n\t\tdataExecutor.execute(worker4);\n\t\tdataExecutor.shutdown();\n\t\ttry {\n\t\t\tdataExecutor.awaitTermination(1, TimeUnit.MINUTES);\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\t// find directory that contains data\n\t\tFile[] files = new File[4];\n\t\tfiles[0] = new File(Application.THREAD_ONE_PATH + \"t4\");\n\t\tfiles[1] = new File(Application.THREAD_TWO_PATH + \"t4\");\n\t\tfiles[2] = new File(Application.THREAD_THREE_PATH + \"t4\");\n\t\tfiles[3] = new File(Application.THREAD_FOUR_PATH + \"t4\");\n\t\tFile outputFile = null;\n\n\t\tfor (File f : files) {\n\t\t\tif (FileUtils.folderSize(f) > 0) {\n\t\t\t\toutputFile = new File(f.toString());\n\t\t\t}\n\t\t}\n\n\t\tif (outputFile == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"unable to avoid initialization exception for table 4.\");\n\t\t}\n\t\t\n\t\tExecutorService loadExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable loadWorker = new LoadThread(outputFile.toString());\n\t\tloadExecutor.execute(loadWorker);\n\t\tloadExecutor.shutdown();\n\t\ttry {\n\t\t\tloadExecutor.awaitTermination(10, TimeUnit.MINUTES);\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\tcleanDirs();\n\t}", "private void stream(int i, int[] seeds) throws Exception {\n\n\t\tExecutorService dataExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\t/**\n\t\t * which table we're currently working on\n\t\t */\n\t\tint tableType = i % 3;\n\t\tRunnable worker1 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_ONE_PATH + \"t\" + (tableType + 1), seeds[0]);\n\t\tRunnable worker2 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_TWO_PATH + \"t\" + (tableType + 1), seeds[1]);\n\t\tRunnable worker3 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_THREE_PATH + \"t\" + (tableType + 1), seeds[2]);\n\t\tRunnable worker4 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_FOUR_PATH + \"t\" + (tableType + 1), seeds[3]);\n\t\tdataExecutor.execute(worker1);\n\t\tdataExecutor.execute(worker2);\n\t\tdataExecutor.execute(worker3);\n\t\tdataExecutor.execute(worker4);\n\t\tdataExecutor.shutdown();\n\t\t// Wait until all threads are finish\n\t\t// if a table takes more than (approx) 40mins then the row size\n\t\t// is set too high, and load may fail.\n\t\tdataExecutor.awaitTermination(40, TimeUnit.MINUTES);\n\t\tSystem.out.println(\"loading tables\");\n\t\tExecutorService loadExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable loadWorker1 = new LoadThread(Application.THREAD_ONE_PATH + \"t\" + (tableType + 1)); \n\t\tRunnable loadWorker2 = new LoadThread(Application.THREAD_TWO_PATH + \"t\" + (tableType + 1));\n\t\tRunnable loadWorker3 = new LoadThread(Application.THREAD_THREE_PATH + \"t\" + (tableType + 1)); \n\t\tRunnable loadWorker4 = new LoadThread(Application.THREAD_FOUR_PATH + \"t\" + (tableType + 1));\n\t\tloadExecutor.execute(loadWorker1); \n\t\tloadExecutor.execute(loadWorker2);\n\t\tloadExecutor.execute(loadWorker3); \n\t\tloadExecutor.execute(loadWorker4);\n\t\tloadExecutor.shutdown(); \n\t\tloadExecutor.awaitTermination(40,TimeUnit.MINUTES);\n\t\tcleanDirs();\n\n\t\tSystem.out.println(\"Finished all threads\");\n\n\t}", "Table createTable();", "public Double generateRow() {\n return leftLimit + new Random().nextDouble() * (this.rightLimit - this.leftLimit);\r\n }", "public void generateRandomVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"LOCAL_DATA\") && !var.getType().equals(\"OUTPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void populateTable(List<String[]> entries) throws SQLException;" ]
[ "0.55436265", "0.5451209", "0.53448194", "0.5314561", "0.52354133", "0.52292013", "0.5212282", "0.50846326", "0.50354356", "0.50307626", "0.49821848", "0.49520016", "0.494397", "0.49438494", "0.49329388", "0.4901358", "0.48868468", "0.48674345", "0.48651937", "0.4855954", "0.484204", "0.47913146", "0.47908384", "0.47855648", "0.47772273", "0.47603813", "0.47599882", "0.47431722", "0.47423294", "0.4719396", "0.4714126", "0.47094104", "0.4707142", "0.46985787", "0.46873695", "0.46741343", "0.4673075", "0.46724778", "0.46683416", "0.46653736", "0.46650174", "0.46569195", "0.4646437", "0.46385744", "0.46371773", "0.4628693", "0.46155733", "0.45985675", "0.4586094", "0.45821387", "0.45792246", "0.45754358", "0.45583782", "0.4555353", "0.4550965", "0.45378026", "0.45337838", "0.45331714", "0.4518132", "0.4516498", "0.45132494", "0.45021877", "0.4500142", "0.44932625", "0.44924667", "0.44779724", "0.4475132", "0.4473875", "0.44729888", "0.44658354", "0.44626728", "0.44551286", "0.44499868", "0.44498998", "0.44498563", "0.4449729", "0.4448299", "0.4447774", "0.44362447", "0.4433276", "0.4432373", "0.44302347", "0.44275734", "0.44103944", "0.4410273", "0.4409219", "0.44080213", "0.4405097", "0.43908334", "0.43839243", "0.43804312", "0.4375186", "0.43739268", "0.43729916", "0.43670723", "0.4359562", "0.43583417", "0.43567753", "0.435277", "0.43510255" ]
0.6116561
0
Adds a symbol or icon (i.e. an image) to represent data points when data is rendered visually. Users must provide the symbol identifier (string), a format (currently supported: 'svg' and 'svg_path'), the data for the symbol, and any additional optional parameter (e.g. color). To have a symbol used for rendering create a table with a string column named 'SYMBOLCODE' (along with 'x' or 'y' for example). Then when the table is rendered (via WMS) if the 'dosymbology' parameter is 'true' then the value of the 'SYMBOLCODE' column is used to pick the symbol displayed for each point.
public InsertSymbolResponse insertSymbol(InsertSymbolRequest request) throws GPUdbException { InsertSymbolResponse actualResponse_ = new InsertSymbolResponse(); submitRequest("/insert/symbol", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ISymbol {\n\n\tBufferedImage getImage();\n\n\tvoid setImage(String icon);\n\n\tvoid setValue(int value);\n\n\tint getValue();\n}", "protected void addTacticalSymbols()\r\n {\n RenderableLayer layer = new RenderableLayer();\r\n layer.setName(\"Tactical Symbols\");\r\n \r\n // Create a tactical symbol for the MIL-STD-2525 symbology set. The symbol identifier specifies a\r\n // MIL-STD-2525 friendly Special Operations Forces Drone Aircraft. The position places the tactical symbol\r\n // at 3km above mean sea level.\r\n TacticalSymbol symbol = new MilStd2525TacticalSymbol(\"SFAPMFQM------A\",\r\n Position.fromDegrees(34.4934, -117.6003, 3000));\r\n symbol.setValue(AVKey.DISPLAY_NAME, \"MIL-STD-2525 Tactical Symbol\"); // Tool tip text.\r\n layer.addRenderable(symbol);\r\n \r\n // Add the symbol layer to the World Wind model.\r\n this.getWwd().getModel().getLayers().add(layer);\r\n \r\n // Update the layer panel to display the symbol layer.\r\n this.getLayerPanel().update(this.getWwd());\r\n }", "public BufferedImage RenderMilStdSymbolAsIcon(String symbolID, int iconSize, \n Boolean showDisplayModifiers)\n {\n return RenderMilStdSymbolAsIcon(symbolID, iconSize, showDisplayModifiers, \n RendererSettings.getInstance().getSymbologyStandard());\n }", "SymbolImageType createSymbolImageType();", "public void addReportMarker(MarkupSymbol symbol) {\n symbol.addToMap();\n mReportMarker = symbol;\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(symbol.getPoint(), 12));\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic Bitmap createSymbolImage(Symbol symbol, Geometry geometry, int width, int height, int color)\n\t{\n\t\treturn getObject().createSymbolImage(symbol, geometry, width, height, color);\n\t}", "public void Draw(MilStdSymbol symbol, Graphics2D destination) throws RendererException\n {\n ArrayList<MilStdSymbol> symbols = new ArrayList<MilStdSymbol>();\n symbols.add(symbol);\n Draw(symbols, destination, 0, 0);\n }", "public MilStd2525PointGraphic(String sidc)\n {\n this.symbol = this.createSymbol(sidc);\n }", "public abstract String getSymbol();", "public void updateGraphic(int id, Symbol symbol)\n\t{\n\t\tgetObject().updateGraphic(id, symbol);\n\t\treturn;\n\t}", "@SuppressWarnings(\"deprecation\")\n\tpublic Bitmap[] createSymbolImages(Symbol[] symbol, Geometry[] geometry, int width, int height, int color)\n\t{\n\t\treturn getObject().createSymbolImages(symbol, geometry, width, height, color);\n\t}", "public final void setSymbol(String symbol)\n {\n String newSymbol = \"None\";\n if (\"paragraph\".equals(symbol))\n {\n newSymbol = \"P\";\n }\n annot.setString(COSName.SY, newSymbol);\n }", "public void setSymbol(String symbol) {\n this.symbol = symbol;\n }", "java.lang.String getSymbolId();", "private void Draw(ArrayList<MilStdSymbol> symbols, Graphics2D destination, int offsetX, int offsetY) throws RendererException\n {\n try\n {\n\n if(symbols != null && destination != null)\n {\n\n SymbolDraw.Draw(symbols, destination, offsetX, offsetY);\n\n }\n else\n {\n //parameters are bad, throw exception\n String badValues = \"Bad parameters passed: \";\n if(symbols == null)\n badValues += \" symbols\";\n if(destination == null)\n badValues += \" destination\";\n\n RendererException re = new RendererException(badValues, null);\n //ErrorLogger.LogException(this.getClass().getName() ,\"Draw()\",re);\n System.err.println(re.getMessage());\n throw re;\n\n }\n\n }\n catch(Exception exc)\n {\n RendererException re2 = new RendererException(\"Draw Operation Failed\", exc);\n ErrorLogger.LogException(this.getClass().getName() ,\"Draw()\",re2);\n throw re2;\n }\n }", "String getSymbol();", "void put(String symbol, int id);", "private void createGraphics() {\n\n Graphic graphic;\n // create spatial reference for the points\n SpatialReference spatialReference = SpatialReference.create(4326);\n\n // create points to place markers\n List<Point> points = new ArrayList<>();\n points.add(new Point(-2.641, 56.077, spatialReference));\n points.add(new Point(-2.669, 56.058, spatialReference));\n points.add(new Point(-2.718, 56.060, spatialReference));\n points.add(new Point(-2.720, 56.073, spatialReference));\n\n // create simple marker symbols for the points\n markers = new ArrayList<>();\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, RED, 10));\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.TRIANGLE, PURPLE, 10));\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CROSS, GREEN, 10));\n markers.add(new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.DIAMOND, BLUE, 10));\n\n // create a list of names for graphics\n List<String> names = new ArrayList<>();\n names.add(\"LAMB\");\n names.add(\"CANTY BAY\");\n names.add(\"NORTH BERWICK\");\n names.add(\"FIDRA\");\n\n // create a list of descriptions for graphics\n List<String> descriptions = new ArrayList<>();\n descriptions.add(\"Just opposite of Bass Rock.\");\n descriptions.add(\"100m long and 50m wide.\");\n descriptions.add(\"Lighthouse in northern section.\");\n descriptions.add(\"Also known as Barley Farmstead.\");\n\n // create four graphics with attributes and add to graphics overlay\n for (int i = 0; i < 4; i++) {\n graphic = new Graphic(points.get(i), markers.get(i));\n graphic.getAttributes().put(\"NAME\", names.get(i));\n graphic.getAttributes().put(\"DESCRIPTION\", descriptions.get(i));\n graphicsOverlay.getGraphics().add(graphic);\n }\n }", "public void DrawDB(MilStdSymbol symbol, Graphics2D destination, Rectangle clip) throws RendererException\n {\n ArrayList<MilStdSymbol> symbols = new ArrayList<MilStdSymbol>();\n symbols.add(symbol);\n DrawDB(symbols, destination, clip);\n }", "@Override\r\n public void doDrop(DropTargetDropEvent dtde) {\r\n SymbolPalette.ItemData data = extractPaletteData(dtde.getTransferable());\r\n if (data == null) {\r\n dtde.rejectDrop();\r\n return;\r\n }\r\n clearDragImage();\r\n\r\n // NOTE: For reference, the following method doesn't compute the correct latitude when the \r\n // view is tilted and zoomed in.\r\n // getViewer().getWwd().getView().computePositionFromScreenPoint(dtde.getLocation().x, dtde.getLocation().y);\r\n // Get the lat/lon of the drop point to use for the symbol\r\n Position position = Positions.fromScreenPoint(dtde.getLocation().x, dtde.getLocation().y);\r\n if (position == null) {\r\n // This can occur when the point is above the horizon. Just log the error and fail softly.\r\n logger.severe(\"The screen point could not be converted to a lat/lon. The symbol was not created.\");\r\n return;\r\n }\r\n // Create a model Symbol object from the tactical symbol identifier stored in the \r\n // TransferData and place it at the drop point. \r\n // HACK: The altitude must be zero else WW dragger for moving the object will mess up.\r\n BasicSymbol model = new BasicSymbol(data.getIdentifier(),\r\n GeoCoord3D.fromDegrees(position.latitude.degrees, position.longitude.degrees)); // no altitude!\r\n model.setName(data.getDisplayName());\r\n model.setType(data.getType());\r\n model.setQuantity(data.getQuantity());\r\n \r\n\r\n // Create the Symbol file using the model Symbol object; create it in the current project.\r\n FileObject folder = null;\r\n Project currentProject = ProjectUtil.getCurrentProject();\r\n if (currentProject != null) {\r\n SymbolManager manager = currentProject.getLookup().lookup(SymbolManager.class);\r\n if (manager != null) {\r\n folder = manager.getFolder();\r\n }\r\n } \r\n // After writing, the new symbol be read from the disk and displayed on the globe\r\n BasicSymbolWriter writer = new BasicSymbolWriter(folder, model);\r\n Document doc = writer.write();\r\n if (doc == null) {\r\n logger.severe(\"A BasicSymbol object was not found in the DataObject. The symbol was not created.\");\r\n dtde.rejectDrop();\r\n return;\r\n }\r\n dtde.acceptDrop(DnDConstants.ACTION_COPY);\r\n }", "public void Draw(ArrayList<MilStdSymbol> symbols, Graphics2D destination) throws RendererException\n {\n Draw(symbols, destination, 0, 0);\n }", "@Source(\"create.gif\")\n\tpublic DataResource createIconResource();", "public void mark_icon(Graphics g, int log_num, int x, int y, int h, float track);", "protected void addSymbolToRenderer(Symbol symbol) {\n Symbol.Renderer renderer = getSymbolRenderer();\r\n if (renderer != null) {\r\n logger.fine(Bundle.info_adding_symbol_to_renderer(symbol.getName()));\r\n renderer.addSymbol(symbol);\r\n }\r\n // Queue symbols while waiting for a renderer to show up.\r\n else {\r\n logger.warning(Bundle.err_symbol_renderer_not_found(symbol.getName()));\r\n pendingAdds.add(symbol);\r\n }\r\n }", "public SymbolicFeature(String symbol) {\r\n\t\tthis.symbol = symbol;\r\n\t\tthis.isResolved = false;\r\n\t}", "public static void initSymbol(String fileName, Parser parser, SymbolTable symbol) {\n\n //add the R0,R1 ...\n for (int i = 0; i < 16; i++) {\n symbol.addEntry(\"R\" + i, i);\n }\n\n //add the save symbols\n symbol.addEntry(\"SCREEN\", 16384);\n symbol.addEntry(\"KBD\", 24576);\n symbol.addEntry(\"SP\", 0);\n symbol.addEntry(\"LCL\", 1);\n symbol.addEntry(\"ARG\", 2);\n symbol.addEntry(\"THIS\", 3);\n symbol.addEntry(\"THAT\", 4);\n\n int counterCommands = 0;\n List<String> symbolToAdd = new ArrayList<String>();\n //add the label command\n while (parser.hasMoreCommands()) {\n parser.advance();\n String type = parser.commandType();\n if (!type.equals(\"L_COMMAND\")) {\n if (symbolToAdd.size() > 0) {\n for (String s : symbolToAdd) {\n symbol.addEntry(s, counterCommands);\n }\n if (symbolToAdd.size() > 0) {\n symbolToAdd.subList(0, symbolToAdd.size()).clear();\n }\n }\n counterCommands++;\n }\n if (type.equals(\"L_COMMAND\")) {\n symbolToAdd.add(parser.symbol());\n }\n }\n\n }", "public void put(String symbol, D data) {\n if (isEmpty()) {\n openScope();\n }\n scopes.get(currentScopeLevel).put(symbol, data);\n }", "public void addSymbol(String key, Symbol token) {\n this.variables.put(key, token);\n }", "public void buildImage(String INPUT_XML_SYMBOL) throws IOException, JAXBException, XMLStreamException {\n\n\t\tFile xmlFile = new File(OUTPUT_FILE_TEMP);\n\n\t\tString outputFileName = (INPUT_XML_SYMBOL).replaceAll(\".xml\", \".png\");\n\t\t\n\n\t\tint resolutionX = 500;\n\t\tJaxbErrorLogRepository errorRep = new JaxbErrorLogRepository(xmlFile);\n\t\tInputRepository inputRep = new JaxbInputRepository(xmlFile);\n\t\tGraphicFactory gFac = new ImageFactory_PNG();\n\t\tGraphicBuilder gBuilder = new GraphicBuilder(inputRep, gFac, errorRep);\n\t\tBufferedImage image = gBuilder.buildImage(resolutionX, outputFileName);\n\t\timage = trim(image);\n\n\t\t// Writing image now:\n\n\t\t// Get all possible Image Writers that are actually available for the\n\t\t// type PNG\n\t\tIterator<ImageWriter> imageWriters = ImageIO.getImageWritersBySuffix(\"PNG\");\n\n\t\t// Ok, we need the output file of course\n\t\tFile file = new File(outputFileName);\n\t\t\n\t\t// select the first found Writer\n\t\tImageWriter imageWriter = (ImageWriter) imageWriters.next();\n\n\t\t// Now we define the output stream\n\t\ttry (ImageOutputStream ios = ImageIO.createImageOutputStream(file)) {\n\t\t\timageWriter.setOutput(ios);\n\n\t\t\t// Here we add the Listener which reports to the logger, so we can\n\t\t\t// see\n\t\t\t// the progress\n\t\t\timageWriter.addIIOWriteProgressListener(new GraphicBuilderImageWriteListener());\n\n\t\t\t// Now start writing the image\n\t\t\timageWriter.write(image);\n\t\t}\n\n\t\t// delete errorLog and output_file_temp\n\t\tString errorLog = OUTPUT_FILE_TEMP.replace(\".xml\", \".graphic_errors.xml\");\n\t\tFile tempErrorLogFile = new File(errorLog);\n\t\ttempErrorLogFile.delete();\n\n\t\txmlFile.delete();\n\n\t}", "private void renderPoint(Feature feature, PointSymbolizer symbolizer) {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"rendering a point from \" + feature);\n }\n \n Graphic sldgraphic = symbolizer.getGraphic();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"sldgraphic = \" + sldgraphic);\n }\n \n String geomName = symbolizer.geometryPropertyName();\n Geometry geom = findGeometry(feature, geomName);\n \n if (geom.isEmpty()) {\n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"empty geometry\");\n }\n \n return;\n }\n \n // TODO: consider if mark and externalgraphic should share an ancestor?\n \n /*\n if (null != (Object)sldgraphic.getExternalGraphics()){\n LOGGER.finer(\"rendering External graphic\");\n renderExternalGraphic(geom, sldgraphic, feature);\n } else{\n LOGGER.finer(\"rendering mark\");\n renderMark(geom, sldgraphic, feature);\n }\n */\n Symbol[] symbols = sldgraphic.getSymbols();\n boolean flag = false;\n \n for (int i = 0; i < symbols.length; i++) {\n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"trying to render symbol \" + i);\n }\n \n if (symbols[i] instanceof ExternalGraphic) {\n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"rendering External graphic\");\n }\n \n BufferedImage img = getImage((ExternalGraphic) symbols[i]);\n flag = renderExternalGraphic(geom, sldgraphic, feature, img);\n \n if (flag) {\n return;\n }\n }\n \n if (symbols[i] instanceof Mark) {\n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"rendering mark @ PointRenderer \" + symbols[i].toString());\n }\n \n flag = renderMark(geom, sldgraphic, feature, (Mark) symbols[i]);\n \n if (flag) {\n return;\n }\n }\n \n if (symbols[i] instanceof TextMark) {\n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"rendering text symbol\");\n }\n \n flag = renderTextSymbol(geom, sldgraphic, feature, (TextMark) symbols[i]);\n \n if (flag) {\n return;\n }\n }\n }\n }", "private void ProcessSymbolGeometryBulk(ArrayList<MilStdSymbol> symbols, IPointConversion converter, Rectangle2D clipBounds) throws RendererException\n {\n try\n {\n\n String basicSymbolID = \"\";\n int count = symbols.size();\n String message = null;\n String symbolID = null;\n \n SymbolDef symbolDef = null;\n if(_SymbolDefTable == null)\n _SymbolDefTable = SymbolDefTable.getInstance();\n\n\n MilStdSymbol symbol;\n for(int lcv = 0; lcv < count; lcv++)\n {\n symbol = symbols.get(lcv);\n int pointCount = 0;\n if(symbol.getCoordinates()!=null)\n {\n pointCount=symbol.getCoordinates().size();\n }\n \n symbolID = symbol.getSymbolID();\n if(SymbolUtilities.isTacticalGraphic(symbolID)==true || pointCount>1)\n {\n basicSymbolID = SymbolUtilities.getBasicSymbolID(symbol.getSymbolID());\n symbolDef = _SymbolDefTable.getSymbolDef(basicSymbolID,symbol.getSymbologyStandard());\n \n if(symbolDef == null)\n {//if bad symbol code, replace with action point or boundary\n if(symbol.getCoordinates().size() <= 1)\n {\n if(symbol.getModifier(ModifiersTG.H_ADDITIONAL_INFO_1)!=null)\n symbol.setModifier(ModifiersTG.H1_ADDITIONAL_INFO_2,symbol.getModifier(ModifiersTG.H_ADDITIONAL_INFO_1));\n symbol.setModifier(ModifiersTG.H_ADDITIONAL_INFO_1,symbolID.substring(0, 10));\n\n symbol.setSymbolID(\"G\" + SymbolUtilities.getAffiliation(symbolID) + \n \"G\" + SymbolUtilities.getStatus(symbolID) + \"GPP---****X\");\n symbol.setLineColor(SymbolUtilities.getLineColorOfAffiliation(symbolID));\n symbol.setFillColor(SymbolUtilities.getFillColorOfAffiliation(symbolID));\n }\n else\n {\n symbol.setSymbolID(\"G\" + SymbolUtilities.getAffiliation(symbolID) + \n \"G\" + SymbolUtilities.getStatus(symbolID) + \"GLB---****X\");\n symbol.setLineColor(SymbolUtilities.getLineColorOfAffiliation(symbolID));\n symbol.setFillColor(null);\n }\n basicSymbolID = SymbolUtilities.getBasicSymbolID(symbol.getSymbolID());\n symbolDef = _SymbolDefTable.getSymbolDef(basicSymbolID,symbol.getSymbologyStandard());\n }\n \n if(symbolDef != null)\n {\n if(symbolDef.getDrawCategory() == SymbolDef.DRAW_CATEGORY_POINT)\n {\n _SPR.ProcessSPSymbol(symbol, converter);\n }\n else\n {\n //send to multipointRendering\n _MPR.render(symbol, converter, clipBounds);\n //ProcessTGSymbol(symbol, converter,clipBounds);\n }\n }\n else\n {\n message = \"Cannot draw: \" + symbolID + \" (\" + basicSymbolID + \"), lookup failed.\";\n throw new RendererException(message);\n }\n }\n else// if(SymbolUtilities.isWarfighting(symbol.getSymbolID()))\n {\n //Pass to Unit rendering\n _SPR.ProcessUnitSymbol(symbol,converter);\n }\n }\n }\n catch(Exception exc)\n {\n throw new RendererException(exc.getMessage(), exc);\n }\n }", "public String getSymbol() {\n }", "Stock retrieveStockChartData(String symbol);", "public void\nsetCharSymbol(DrawCharObject drawObject)\nthrows Exception\n{\n\tthis.setCharSymbol(drawObject.getDrawChar(), ((DrawCharObject)drawObject).getFont());\n\tthis.setUseSymbol(true);\n}", "public String getSymbol()\n {\n return annot.getString(COSName.SY);\n }", "public void addSymbol(Symbol symbol) {\n this.symbols.add(symbol);\n symbol.setProject(this);\n }", "void setSymbol(Environment environment, Character newSymbol);", "public void registerIcon(String spellName, Icon icon);", "public void addOperation(String symbol, Class<?> clazz) {\n checkForNull(symbol);\n checkForNull(clazz);\n\n try {\n Double.parseDouble(symbol);\n\n // exception was not caught - \"symbol\" is a number\n throw new IllegalArgumentException(SYMBOL_IS_NUMBER_EXCEPTION_MESSAGE +\n \"\\\"\" + symbol + \"\\\"\");\n } catch (NumberFormatException e) {\n // normal case - \"symbol\" is not a number\n }\n\n map.put(symbol, clazz);\n }", "Icon getPlotterIcon();", "public static String getBinarySymbolByID(String symbol)\n {\n return \"frx\" + symbol;\n }", "@Test\n public void fieldSymbol() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Below are three ways to use a SYMBOL field to display a single character.\n // 1 - Add a SYMBOL field which displays the © (Copyright) symbol, specified by an ANSI character code:\n FieldSymbol field = (FieldSymbol) builder.insertField(FieldType.FIELD_SYMBOL, true);\n\n // The ANSI character code \"U+00A9\", or \"169\" in integer form, is reserved for the copyright symbol.\n field.setCharacterCode(Integer.toString(0x00a9));\n field.isAnsi(true);\n\n Assert.assertEquals(field.getFieldCode(), \" SYMBOL 169 \\\\a\");\n\n builder.writeln(\" Line 1\");\n\n // 2 - Add a SYMBOL field which displays the ∞ (Infinity) symbol, and modify its appearance:\n field = (FieldSymbol) builder.insertField(FieldType.FIELD_SYMBOL, true);\n\n // In Unicode, the infinity symbol occupies the \"221E\" code.\n field.setCharacterCode(Integer.toString(0x221E));\n field.isUnicode(true);\n\n // Change the font of our symbol after using the Windows Character Map\n // to ensure that the font can represent that symbol.\n field.setFontName(\"Calibri\");\n field.setFontSize(\"24\");\n\n // We can set this flag for tall symbols to make them not push down the rest of the text on their line.\n field.setDontAffectsLineSpacing(true);\n\n Assert.assertEquals(field.getFieldCode(), \" SYMBOL 8734 \\\\u \\\\f Calibri \\\\s 24 \\\\h\");\n\n builder.writeln(\"Line 2\");\n\n // 3 - Add a SYMBOL field which displays the あ character,\n // with a font that supports Shift-JIS (Windows-932) codepage:\n field = (FieldSymbol) builder.insertField(FieldType.FIELD_SYMBOL, true);\n field.setFontName(\"MS Gothic\");\n field.setCharacterCode(Integer.toString(0x82A0));\n field.isShiftJis(true);\n\n Assert.assertEquals(field.getFieldCode(), \" SYMBOL 33440 \\\\f \\\"MS Gothic\\\" \\\\j\");\n\n builder.write(\"Line 3\");\n\n doc.save(getArtifactsDir() + \"Field.SYMBOL.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.SYMBOL.docx\");\n\n field = (FieldSymbol) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_SYMBOL, \" SYMBOL 169 \\\\a\", \"\", field);\n Assert.assertEquals(Integer.toString(0x00a9), field.getCharacterCode());\n Assert.assertTrue(field.isAnsi());\n Assert.assertEquals(\"©\", field.getDisplayResult());\n\n field = (FieldSymbol) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_SYMBOL, \" SYMBOL 8734 \\\\u \\\\f Calibri \\\\s 24 \\\\h\", \"\", field);\n Assert.assertEquals(Integer.toString(0x221E), field.getCharacterCode());\n Assert.assertEquals(\"Calibri\", field.getFontName());\n Assert.assertEquals(\"24\", field.getFontSize());\n Assert.assertTrue(field.isUnicode());\n Assert.assertTrue(field.getDontAffectsLineSpacing());\n Assert.assertEquals(\"∞\", field.getDisplayResult());\n\n field = (FieldSymbol) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_SYMBOL, \" SYMBOL 33440 \\\\f \\\"MS Gothic\\\" \\\\j\", \"\", field);\n Assert.assertEquals(Integer.toString(0x82A0), field.getCharacterCode());\n Assert.assertEquals(\"MS Gothic\", field.getFontName());\n Assert.assertTrue(field.isShiftJis());\n }", "@Override\n public String getSymbol() {\n return SYMBOL;\n }", "public void\r DisplayIcon(CType display_context, int x, int y, int icon_number);", "public interface WriteableSymbolTable extends SymbolTable {\n\n /**\n * Return the id of the mapping for the given symbol or add the symbol as a new mapping and\n * return the newly assigned id\n * @param symbol\n * @return\n */\n int getOrAdd(String symbol);\n\n /**\n * This puts the given mapping in with the specified id; you cannot use this to overwrite mappings.\n * If you call this and it tries to do that, it will throw an IllegalArgumentException. Overwriting\n * mappings should be done via `remove()` then `getOrAdd()`. This is only useful in small circumstances\n * where you need to ensure that the mappings between two tables are the same.\n * @param symbol\n * @param id the next mapping assigned by this symbol table will be updated to respect this\n */\n void put(String symbol, int id);\n\n}", "@Override\n\tpublic String getSymbolName()\n\t{\n\t\treturn getFormattedText();\n\t}", "public void setSymbol(Symbol symbol) {\r\n\t\tthis.symbol = symbol;\r\n\t}", "private void setUpMarkerLayer() {\n map.addLayer( new SymbolLayer( MARKER_LAYER_ID, geojsonSourceId ).withProperties( iconImage( MARKER_IMAGE_ID ), iconAllowOverlap( false )));\n }", "@Override public String symbol() {\n return symbol;\n }", "Icon createIcon();", "protected TacticalGraphicSymbol createSymbol(String sidc)\n {\n TacticalGraphicSymbol symbol = new TacticalGraphicSymbol(sidc);\n symbol.setAttributes(this.activeSymbolAttributes);\n symbol.setDelegateOwner(this);\n return symbol;\n }", "@Override\r\n\t\tpublic void requestIcon(String arg0) {\n\t\t\t\r\n\t\t}", "public Builder setSymbolId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n symbolId_ = value;\n onChanged();\n return this;\n }", "protected void applyAttributesToSymbol(TacticalGraphicAttributes graphicAttributes,\n TacticalSymbolAttributes symbolAttributes)\n {\n // Line and area graphics distinguish between interior and outline opacity. Tactical symbols only support one\n // opacity, so use the interior opacity.\n Double value = graphicAttributes.getInteriorOpacity();\n if (value != null)\n {\n symbolAttributes.setOpacity(value);\n }\n\n value = graphicAttributes.getScale();\n if (value != null)\n {\n symbolAttributes.setScale(value);\n }\n\n Material material = graphicAttributes.getInteriorMaterial();\n symbolAttributes.setInteriorMaterial(material);\n\n Font font = graphicAttributes.getTextModifierFont();\n if (font != null)\n {\n symbolAttributes.setTextModifierFont(font);\n }\n\n material = graphicAttributes.getTextModifierMaterial();\n if (material != null)\n {\n symbolAttributes.setTextModifierMaterial(material);\n }\n }", "public abstract String typeIcon();", "public Builder setSymbol(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n symbol_ = value;\n onChanged();\n return this;\n }", "protected void addTacticalGraphics()\r\n {\n RenderableLayer layer = new RenderableLayer();\r\n layer.setName(\"Tactical Graphics\");\r\n \r\n // Define the control point positions for the tactical graphic we create below.\r\n List<Position> positions = Arrays.asList(\r\n Position.fromDegrees(34.4980, -117.5541, 0),\r\n Position.fromDegrees(34.4951, -117.4667, 0),\r\n Position.fromDegrees(34.4733, -117.4303, 0),\r\n Position.fromDegrees(34.4217, -117.4056, 0),\r\n Position.fromDegrees(34.4780, -117.5300, 0));\r\n \r\n // Create a tactical graphic for the MIL-STD-2525 symbology set. The graphic identifies a MIL-STD-2525\r\n // friendly Supporting Attack.\r\n TacticalGraphicFactory factory = new MilStd2525GraphicFactory();\r\n TacticalGraphic graphic = factory.createGraphic(\"GFGPOLAGS-----X\", positions, null);\r\n graphic.setValue(AVKey.DISPLAY_NAME, \"MIL-STD-2525 Tactical Graphic\"); // Tool tip text.\r\n layer.addRenderable(graphic);\r\n \r\n // Create point placemarks to mark each of the control points used to define the tactical graphic. This\r\n // provides a visualization of how the control point positions affect the displayed graphic.\r\n this.addControlPoints(positions, layer);\r\n \r\n // Add the graphic layer to the World Wind model.\r\n this.getWwd().getModel().getLayers().add(layer);\r\n \r\n // Update the layer panel to display the graphic layer.\r\n this.getLayerPanel().update(this.getWwd());\r\n }", "@Override\n public void saveSymbol(SecuritySymbols symbol) {\n\n }", "@Override\n\tpublic String asText() {\n\t\treturn symbol;\n\t}", "public Boolean CanRender(String symbolCode, \n ArrayList<Point2D.Double> coords,\n int symStd)\n {\n String message = null;\n String basicSymbolID = symbolCode;\n basicSymbolID = SymbolUtilities.getBasicSymbolIDStrict(basicSymbolID);\n //ErrorLogger.LogMessage(\"TEST\");\n try\n {\n // message = \"Cannot draw: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n if(SymbolUtilities.isTacticalGraphic(basicSymbolID))\n {\n if(_SymbolDefTable == null)\n _SymbolDefTable = SymbolDefTable.getInstance();\n\n SymbolDef sd = _SymbolDefTable.getSymbolDef(basicSymbolID,symStd);\n if(sd != null)\n {\n int pointCount = 0;\n if(coords != null)\n {\n pointCount = coords.size();\n }\n\n int dc = sd.getDrawCategory();\n if (dc == SymbolDef.DRAW_CATEGORY_POINT)//make sure we can find the character in the font.\n {\n int index = -1;\n index = SinglePointLookup.getInstance().getCharCodeFromSymbol(symbolCode,symStd);\n if(index > 0)\n return true;\n else\n message = \"Bad font lookup for: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n else if(dc > 0 && dc < 99)\n {\n if(sd.getMinPoints() == sd.getMaxPoints())\n { //complex graphic like ambush\n\n if(pointCount == sd.getMinPoints())\n return true;\n else\n message = \"Specific point count not met for: \" + symbolCode + \" (\" + basicSymbolID + \") - Had: \" + String.valueOf(pointCount) + \" Needed: \" + String.valueOf(sd.getMinPoints());\n }\n else if(pointCount >= sd.getMinPoints())\n {\n return true;\n }\n else if(sd.getDrawCategory() == SymbolDef.DRAW_CATEGORY_POLYGON\n && pointCount == 2 && sd.getMinPoints() == 3 && sd.getMaxPoints() > 100)\n {//areas with 2 points are allowable.\n return true;\n }\n else if(pointCount < sd.getMinPoints())\n {\n message = symbolCode + \" had less than the required number of points. Had: \" + String.valueOf(coords.size()) + \" Needed: \" + String.valueOf(sd.getMinPoints());\n }\n }\n else\n {\n message = \"Cannot draw: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n\n }\n else\n {\n message = \"Cannot draw symbolID: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n }\n else\n {\n //UnitDef ud = UnitDefTable.getInstance().getUnitDef(basicSymbolID,symStd);\n UnitFontLookupInfo ufli = UnitFontLookup.getInstance().getLookupInfo(basicSymbolID,symStd);\n if(ufli != null)\n {\n return true;\n }\n else\n {\n message = \"JavaRenderer.CanRender() - Cannot draw symbolID: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n }\n\n if(message != null && !message.equals(\"\"))\n {\n ErrorLogger.LogMessage(this.getClass().getName(), \"CanRender()\", message,Level.FINE);\n //System.err.println(message);\n //System.out.println(\"\");\n //System.out.println(\"INFO: CanRender - \" + message);\n //Exception foo = new Exception(\"Stack?\");\n //foo.printStackTrace();\n }\n }\n catch(Exception exc)\n {\n System.err.println(String.valueOf(message));\n System.err.println(exc.getMessage());\n }\n return false;\n }", "@Override\n public void add(Symbol symbol) {\n\n super.add(symbol);\n\n Symbol_MultiPart multiPartSymbol = (Symbol_MultiPart) symbol;\n\n multiPart_Index_ByID.put(new Integer(multiPartSymbol.ID), multiPartSymbol);\n\n multiPart_Index_ByMultiPartName.put(multiPartSymbol.name_MultiPart, multiPartSymbol);\n multiPart_Index_ByName.put(multiPartSymbol.name, multiPartSymbol);\n multiPart_Index_ByName_IdentFormat.put(multiPartSymbol.name_IdentFormat, multiPartSymbol);\n\n multiPart_List.add(multiPartSymbol);\n\n singleAndMultiPart_SymbolIndex_ByID.put(new Integer(symbol.ID), symbol);\n\n\n }", "private BufferedImage createPlotImage() {\r\n final BufferedImage img = new BufferedImage(getWidth(), getHeight(), \r\n Transparency.BITMASK);\r\n final Graphics g = img.getGraphics();\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, \r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n \r\n g.setColor(GUIConstants.color6);\r\n for(int i = 0; i < scatterData.size; i++) {\r\n drawItem(g, scatterData.xAxis.co[i], \r\n scatterData.yAxis.co[i], false, false);\r\n }\r\n return img;\r\n }", "private StockData addSymbolToCurrentWatchList(String symbol)\r\n {\r\n debug(\"addSymbolToCurrentWatchList(\" + symbol + \")\");\r\n // Get the index into the current selected Tabpane\r\n int index = tabPane.getSelectedIndex();\r\n // Now grab our Table and Models\r\n HGTable table = (HGTable) tableVector.elementAt(index);\r\n StockDataTableModel dataModel = (StockDataTableModel) modelVector.elementAt(index);\r\n // Get the current Selected Row.\r\n int row = ((table.getSelectedRow() >= 0) ? table.getSelectedRow() : 0);\r\n\r\n debug(\"Insert Row After row [\" + row + \"] The Row being inserted is \" + (row + 1));\r\n dataModel.insert(row + 1);\r\n // Fire a notification that we are changing the table\r\n table.tableChanged(\r\n new TableModelEvent(dataModel, row + 1, row + 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT));\r\n // Set the row to be selected\r\n table.setRowSelectionInterval(row, row);\r\n table.repaint();\r\n // Now Get the StockData Obj at that row\r\n StockData sd = (StockData) dataModel.getData().elementAt(row + 1);\r\n // Now we have the Object - We still Need to pre-fill in the data\r\n sd.setSymbol(symbol, 0.00);\r\n // Set the Name as we are still Searching\r\n sd.setName(\"Search for \" + symbol);\r\n // Lets Load the Historic Data.\r\n this.loadHistoricData(sd);\r\n // We are done now.\r\n debug(\"addSymbolToCurrentWatchList(\" + symbol + \") - complete\");\r\n\r\n return sd;\r\n }", "public Builder setSymbol(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n symbol_ = value;\n onChanged();\n return this;\n }", "protected abstract String getAddDataIconDefaultCaption () ;", "public ImageInfo RenderMilStdSymbolAsImageInfo(String symbolCode, String UUID, ArrayList<Point2D.Double> coords, Map<String, String> Modifiers, IPointConversion converter, Rectangle2D clipBounds)\n {\n ImageInfo returnVal = null;\n try\n {\n MilStdSymbol symbol = new MilStdSymbol(symbolCode, UUID, coords, Modifiers);\n ProcessSymbolGeometry(symbol, converter, clipBounds);\n returnVal = symbol.toImageInfo();\n }\n catch(Exception exc)\n {\n //ErrorLogger.LogException(\"JavaRenderer\", \"RenderMilStdSymbolAsImageInfo\", exc);\n System.err.println(exc.getMessage());\n }\n return returnVal;\n }", "public void setPageSymbol(ItemStack page, String symbol);", "public String getSymbol(){\n return this.symbol;\n }", "public ImageInfo RenderMilStdSymbolAsImageInfo(MilStdSymbol symbol, IPointConversion converter, Rectangle2D clipBounds)\n {\n ImageInfo returnVal = null;\n try\n {\n ProcessSymbolGeometry(symbol, converter, clipBounds);\n returnVal = symbol.toImageInfo();\n }\n catch(Exception exc)\n {\n //ErrorLogger.LogException(\"JavaRenderer\", \"RenderSinglePointAsImageInfo\", exc);\n System.err.println(exc.getMessage());\n }\n return returnVal;\n }", "public String getSymbol() {\n return symbol;\n }", "private void putSymbol(String symbol, String type, String eqn){\n System.out.println(symbol+ \" \"+ type + \" \"+ eqn);\n }", "public String getSymbol() {\n return symbol;\n }", "@Override\n\tpublic LSystemBuilder registerCommand(char symbol, String command) {\n\t\tcommands.put(symbol, command);\n\t\treturn this;\n\t}", "public String getSymbol() {\r\n\t\treturn symbol;\r\n\t}", "public String getSymbol() {\r\n\t\treturn symbol;\r\n\t}", "@Test\n\tpublic void testAddSymbolFromCatalog() throws Exception {\n\n\t\t// Choose a symbol which is not in the list, click \"Add\" and \"OK\"\n\t\tString selectedSymbol;\n\t\tboolean bSelectSymbolNotInList;\n\t\tint nListCount;\n\t\tint nIndex = 1;\n\t\tdo {\n\t\t\tmathEditSymbolsDlgViewControl.click(100 * nIndex, 10);\n\t\t\t// risk:after 6 or 7 circles, this will click out of ViewControl\n\t\t\tselectedSymbol = mathEditSymbolsDlgSymbol.getText();\n\t\t\tnIndex++;\n\t\t\t// Find if the selected symbol is already in the list\n\t\t\tbSelectSymbolNotInList = false;\n\t\t\tnListCount = mathEditSymbolsDlgSymbol.getItemCount();\n\t\t\tfor (int i = 0; i < nListCount; i++) {\n\t\t\t\tif (selectedSymbol.equals(mathEditSymbolsDlgSymbol\n\t\t\t\t\t\t.getItemText(i))) {\n\t\t\t\t\tbSelectSymbolNotInList = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (bSelectSymbolNotInList);\n\t\tmathEditSymbolsDlgAdd.click();\n\t\tmathEditSymbolsDlg.ok();\n\n\t\t// Verify if the symbol is added to Symbol set\n\t\tmathSymbolsDlgEditButton.click();\n\t\tbSelectSymbolNotInList = false;\n\t\tnListCount = mathEditSymbolsDlgSymbol.getItemCount();\n\t\tfor (int i = 0; i < nListCount; i++) {\n\t\t\tif (selectedSymbol.equals(mathEditSymbolsDlgSymbol.getItemText(i))) {\n\t\t\t\tbSelectSymbolNotInList = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tassertTrue(\"Symbol is not added to Symbol set\", bSelectSymbolNotInList);\n\t}", "private void ProcessSymbolGeometry(MilStdSymbol symbol, IPointConversion converter, Rectangle2D clipBounds) throws RendererException\n {\n ArrayList<MilStdSymbol> symbols = new ArrayList<MilStdSymbol>();\n symbols.add(symbol);\n ProcessSymbolGeometryBulk(symbols, converter, clipBounds);\n\n }", "JFreeChart generateDot();", "public String getSymbol() {\n return this.symbol ;\n }", "com.google.protobuf.ByteString\n getSymbolBytes();", "public void setSymbol(char symbol) {\n\t\tthis.symbol = symbol;\n\t}", "public void addIcon(Direction dir, Color clr){\r\n\t\t \r\n\t\t Graphics2D g = bufferedImage.createGraphics();\r\n\t\t BufferedImage imgPiece;\r\n\t\t File fileImg = new File(\"src/main/java/data/smallfollower_0.png\");\r\n\t \t try {\r\n\t\t\timgPiece = ImageIO.read(fileImg);\r\n\r\n\t\t\t Graphics2D g1 = imgPiece.createGraphics();\t\r\n\t\t\t for (int x = 0; x < imgPiece.getWidth(); x++) {\r\n\t\t\t\t for (int y = 0; y < imgPiece.getHeight(); y++) {\r\n\t\t\t\t\t int color = imgPiece.getRGB(x,y);\r\n\t\t\t\t\t if(color == -65281){\r\n\t\t\t\t\t\t g1.setColor(clr);\r\n\t\t\t\t\t\t g1.fillRect(x,y,1,1);\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t g.drawImage(imgPiece, getX(dir), getY(dir), 20, 20, null);\r\n\t\t }\r\n\t\t catch (IOException e) {\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t }", "public void draw(Graphics graphics) {\n graphics.drawImage(\n Util.getImage(icon),\n position.getScreenHorizontalCoord(),\n position.getScreenVerticalCoord(),\n Cell.CELL_PIXELS,\n Cell.CELL_PIXELS,\n null\n );\n }", "private boolean renderTextSymbol(Geometry geom, Graphic graphic, Feature feature, TextMark mark) {\n int size = 6; // size in pixels\n double rotation = 0.0; // rotation in degrees\n size = ((Number) graphic.getSize().getValue(feature)).intValue();\n rotation = (((Number) graphic.getRotation().getValue(feature)).doubleValue() * Math.PI) / 180d;\n \n if (!(geom instanceof Point)) {\n geom = geom.getCentroid();\n }\n \n return fillDrawTextMark(graphics, (Point) geom, mark, size, rotation, feature);\n }", "private void drawMarker1(LatLng point){\n MarkerOptions markerOptions=new MarkerOptions();\r\n\r\n // Setting latitude and longitude for the marker\r\n markerOptions.position(point);\r\n\r\n markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\r\n\r\n // Adding marker on the Google Map\r\n mMap.addMarker(markerOptions);\r\n\r\n // marker.showInfoWindow();\r\n }", "public Builder setSymbolBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n symbol_ = value;\n onChanged();\n return this;\n }", "public interface Symbol {\r\n String getFullId();\r\n String getId(); // scoped to parent id\r\n String getFullParentId();\r\n String getDescriptiveName();\r\n String getHRef(String preDir);\r\n String getFileLocation();\r\n\r\n Type getType();\r\n\r\n enum Type {\r\n Dir,File,Other\r\n }\r\n}", "public String getSymbol() {\n\t\treturn symbol;\n\t}", "public void displayIcon(Graphics g, int xPos, int yPos){\n\t\t\n\t}", "public abstract String getVertexSymbol(int vertexIndex);", "@Override\n public String createData() {\n String data = getTypeIcon()\n + \"\"\n + getStatusIcon()\n + \" \"\n + this.command;\n return data;\n }", "public void setXpeIcon(String value) {\n setAttributeInternal(XPEICON, value);\n }", "public static void markDSIStableStart(String symbol) {\n\t\tSQLOperation.findDSIStableSP(\"SPY\", 5, 200.0f, 10.0f, 100.0f, 10.0f,\r\n\t\t\t\t100.0f, 20.0f);\r\n\t\tSystem.out.println(\"DSI Stable points marked...\");\r\n\r\n\t}", "boolean hasSymbolId();", "public Builder setSymbolIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n symbolId_ = value;\n onChanged();\n return this;\n }", "public String getSymbol( )\n {\n return symbol;\n }", "public Color getSymbolColour() {\n return this.symbolColour;\n }", "public LineSymbolPainter getSymbolPainter() {\n return symbolPainter;\n }", "public String getPageSymbol(ItemStack page);", "@Source(\"create.gif\")\n\tpublic ImageResource createIcon();" ]
[ "0.62083", "0.59512126", "0.5775953", "0.5747916", "0.56288725", "0.55319965", "0.5459038", "0.5449158", "0.5269143", "0.5265533", "0.51891035", "0.5166383", "0.51569253", "0.5132566", "0.5119229", "0.51155514", "0.5069886", "0.5046791", "0.4989928", "0.49791583", "0.49701345", "0.4956332", "0.49551898", "0.49394998", "0.49322236", "0.49273208", "0.49099106", "0.48812765", "0.48769668", "0.48700398", "0.4866444", "0.48584664", "0.48434845", "0.4838689", "0.48181555", "0.48107517", "0.47926465", "0.4780368", "0.47753528", "0.47748944", "0.4768384", "0.47506002", "0.47412705", "0.47338673", "0.47255936", "0.47204626", "0.47161332", "0.47113648", "0.47072455", "0.4706652", "0.4696999", "0.46915346", "0.4689609", "0.46857256", "0.4685313", "0.4681928", "0.46757084", "0.46751642", "0.4670639", "0.46668082", "0.46641374", "0.46624157", "0.46574393", "0.46573508", "0.46519315", "0.46432504", "0.46324992", "0.46313173", "0.46308172", "0.4628174", "0.46262985", "0.46158162", "0.46019047", "0.45999044", "0.45999044", "0.4599244", "0.45921987", "0.45901152", "0.45897663", "0.45621443", "0.4550295", "0.45336303", "0.45261872", "0.4520549", "0.45203236", "0.45168388", "0.45030645", "0.45024085", "0.4495666", "0.4493624", "0.448513", "0.447739", "0.44754282", "0.44742987", "0.44660914", "0.44491223", "0.4449041", "0.44470102", "0.44467536", "0.4439825" ]
0.5326613
8
Kills a running proc instance.
public KillProcResponse killProc(KillProcRequest request) throws GPUdbException { KillProcResponse actualResponse_ = new KillProcResponse(); submitRequest("/kill/proc", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void kill(long procid);", "public void kill();", "public void kill();", "public final void kill() {\n doKill();\n }", "@DELETE\n @ApiOperation(\"Forcefully stops a process\")\n @javax.ws.rs.Path(\"/{id}\")\n @WithTimer\n public void kill(@ApiParam @PathParam(\"id\") UUID instanceId) {\n ProcessKey processKey = assertProcessKey(instanceId);\n processManager.kill(processKey);\n }", "void instanceKilled(String pid, IKilledResult result);", "public void kill()\n\t{\n\t\tisKilled = true;\n\t}", "@Override\n public void kill()\n {\n }", "public static synchronized void stop() {\n\n if (proc != null) {\n proc.destroy();\n try {\n // wait for the process to really stop\n proc.waitFor();\n } catch (InterruptedException e) {\n // ignore\n }\n try {\n // leeway since sometimes the unbind happens after\n Thread.sleep(500);\n } catch (InterruptedException e) {\n // ignore\n }\n proc = null;\n }\n }", "@Override\n\tpublic void kill() {\n\n\t}", "public void Kill();", "public void stopPropose(int instanceId);", "@Override\n\tpublic void killProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.info(\"Killing procedure \" + instanceId, Level.PROC, this);\n\t\tif (isLocallyLoaded(instanceId))\n\t\t{\n\t\t\tkillLocalProcedure(instanceId, monitor);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunloadRemoteProcedure(instanceId, true, monitor);\n\t\t}\n\t}", "void abortProcess(Long processInstanceId);", "protected abstract void doKill();", "public void killIt() {\n isRunning = false;\n killed = true;\n hardKill = true;\n\n dumpState();\n if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_killing_cpm__INFO\",\n new Object[] { Thread.currentThread().getName() });\n }\n if (workQueue != null) {\n while (workQueue.getCurrentSize() > 0) {\n workQueue.dequeue();\n }\n }\n if (outputQueue != null) {\n while (outputQueue.getCurrentSize() > 0) {\n outputQueue.dequeue();\n }\n }\n if (casPool != null) {\n synchronized (casPool) {\n casPool.notifyAll();\n }\n }\n if (workQueue != null) {\n Object[] eofToken = new Object[1];\n // only need one member in the array\n eofToken[0] = new EOFToken();\n workQueue.enqueue(eofToken);\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_terminate_pipelines__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(killed) });\n // synchronized (workQueue) { // redundant - enqueue call above does this\n // workQueue.notifyAll();\n // }\n }\n\n }", "public boolean stopProgram(String progamId);", "void stop()\n {\n log.info(\"Begin stop(), instance = '\" + instance + \"'\");\n\n if (isAlive())\n {\n processor.stop();\n try { t.join(); } catch (InterruptedException e) {}\n running = false;\n }\n\n log.info(\"End stop(), instance = '\" + instance + \"'\");\n }", "private void nativeKill()\n {\n if (process == null)\n {\n return;\n }\n for (Field f : process.getClass().getDeclaredFields())\n {\n if (\"pid\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n int pid = f.getInt(process);\n Runtime.getRuntime().exec(\n new String[] {\"kill\", \"-9\", Integer.toString(pid)});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n else if (\"handle\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n long handleId = f.getLong(process);\n\n Kernel32 kernel = Kernel32.INSTANCE;\n HANDLE handle = new HANDLE();\n handle.setPointer(Pointer.createConstant(handleId));\n int pid = kernel.GetProcessId(handle);\n Runtime.getRuntime().exec(\n new String[] {\"taskkill\", \"/PID\", Integer.toString(pid), \"/F\"});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n }\n }", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public void stop() {\n\t\texec.stop();\n\t}", "public static void cancelProcess() {\r\n\r\n if (m_Proc != null) {\r\n if (m_bProcInterruptible) {\r\n m_Proc.destroy();\r\n m_Proc = null;\r\n m_bProcCanceled = true;\r\n }\r\n }\r\n\r\n }", "public void killExecution() {\n \n \t\tcancelOrKillExecution(false);\n \t}", "public void stopProcess() {\r\n\t\tprocess = false;\r\n\t}", "public void kill() { _isAlive = false; }", "public void stop() {\n System.out.println(\"STOP!\");\n xp.stop();\n }", "@Override\n public void onKill() {\n }", "protected void kill() {\n\t\tsetDeathTime(0.6);\n\t}", "private void killLocalProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.debug(\"killLocalProcedure()\", Level.PROC, this);\n\t\t\n\t\tmonitor.beginTask(\"Kill procedure\", 3);\n\t\tIProcedure model = getProcedure(instanceId);\n\n\t\tmonitor.subTask(\"Removing local model\");\n\t\tmonitor.worked(1);\n\n\t\t// Remove the model directly\n\t\tm_models.deleteLocalProcedureModel(instanceId);\n\n\t\tif (!s_ctx.isConnected())\n\t\t{\n\t\t\tmonitor.worked(3);\n\t\t\tmonitor.done();\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check condition: the client mode shall be controlling\n\t\t\t\tmonitor.subTask(\"Checking client mode\");\n\t\t\t\tClientMode mode = model.getRuntimeInformation().getClientMode();\n\t\t\t\tif (mode != ClientMode.CONTROL)\n\t\t\t\t{\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Cannot kill this procedure while in monitoring mode\");\n\t\t\t\t}\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\n\t\t\t\tmonitor.subTask(\"Killing process\");\n\t\t\t\t// Request context to close the procedure\n\t\t\t\tLogger.debug(\"Requesting context to kill procedure : \" + instanceId, Level.PROC, this);\n\t\t\t\tif (!s_ctx.killExecutor(instanceId))\n\t\t\t\t{\n\t\t\t\t\t// The context command was sent but it raised an error\n\t\t\t\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \" on the server\");\n\t\t\t\t}\n\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\t\t\t}\n\t\t\tcatch (ContextError err)\n\t\t\t{\n\t\t\t\tLogger.error(err.getLocalizedMessage(), Level.PROC, this);\n\t\t\t\t// The procedure could not be unloaded due to an error in the\n\t\t\t\t// context\n\t\t\t\t// processing\n\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\tmonitor.done();\n\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \": \" + err.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\t\t// Reached to this point we have the model of the procedure created.\n\t\t// Now notify any plugin extensions implementing the ProcedureView\n\t\t// support.\n\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t}", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void abort()\n\t{\n\t\tif(process != null)\n\t\t\tprocess.destroy();\n\t}", "public void Kill() {\n\tif (process != null) {\n\t process.destroy();\n\t childStdin.Kill();\n\t childStdout.Kill();\n\t childStderr.Kill();\n\t}\n\tprocess = null;\n }", "public void stopPropose(int instanceId, int destination);", "public KillProcResponse killProc(String runId, Map<String, String> options) throws GPUdbException {\n KillProcRequest actualRequest_ = new KillProcRequest(runId, options);\n KillProcResponse actualResponse_ = new KillProcResponse();\n submitRequest(\"/kill/proc\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void stop() {}", "public void stop() {\n log.info(\"Stopped\");\n execFactory.shutdown();\n cg.close();\n }", "public void kill() {\n this.server.stop();\n }", "public static boolean kill(@NonNull TaskExecutionContext request) {\n try {\n logger.info(\"Begin kill task instance, processId: {}\", request.getProcessId());\n int processId = request.getProcessId();\n if (processId == 0) {\n logger.error(\"Task instance kill failed, processId is not exist\");\n return false;\n }\n\n String cmd = String.format(\"kill -9 %s\", getPidsStr(processId));\n cmd = OSUtils.getSudoCmd(request.getTenantCode(), cmd);\n logger.info(\"process id:{}, cmd:{}\", processId, cmd);\n\n OSUtils.exeCmd(cmd);\n logger.info(\"Success kill task instance, processId: {}\", request.getProcessId());\n return true;\n } catch (Exception e) {\n logger.error(\"Kill task instance error, processId: {}\", request.getProcessId(), e);\n return false;\n }\n }", "protected void kill() {\n\t\tsynchronized (this) // Don't allow shutdown during startup.\n\t\t{\n\t\t\t// Only execute for the first caller.\n\t\t\tif (shutdownMutex.acquire()) {\n\t\t\t\t// Shutdown payer thread.\n\t\t\t\tpayerThread.interrupt();\n\n\t\t\t\tfor (int i = 0; i < sets.length; i++) {\n\t\t\t\t\tsets[i].kill();\n\t\t\t\t}\n\n\t\t\t\t// Shutdown the thread pools.\n\t\t\t\tproducerThreadPool.kill();\n\n\t\t\t\t// Let the GC figure the rest out.\n\t\t\t}\n\t\t}\n\t}", "public void kill(int tk, int ts) {\n\t\tSystem.out.println(\"Total kills: \"+tk);\r\n\t\tSystem.out.println(\"Total Score: \"+ts);\r\n\t}", "@Override \n public void commandKill(int id) {\n\n }", "public void stop()\n {\n printerSimulator.stop();\n }", "public void terminate() {\n\t\trunning = false;\n\t}", "public void stopIt() {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_stop_cpm__FINEST\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(killed) });\n\n dumpState();\n\n stopped = true;\n killed = true;\n if (!isRunning) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_already_stopped__FINEST\",\n new Object[] { Thread.currentThread().getName() });\n // Already stopped\n return;\n }\n // try {\n // Change global status\n isRunning = false;\n // terminate this thread if the thread has been previously suspended\n synchronized (lockForPause) {\n if (pause) {\n pause = false;\n lockForPause.notifyAll();\n }\n }\n // Let processing threads finish their work by emptying all queues. Even during a hard\n // stop we should try to clean things up as best as we can. First empty process queue or work\n // queue, dump result of analysis into output queue and let the consumers process that.\n // When all queues are empty we are done.\n\n // The logic below (now commented out) has a race condition -\n // The workQueue / outputQueue can become (temporarily) empty, but then\n // can be filled with the eof token\n // But this code proceeds to stop all the CAS processors,\n // which results in a hang because the pool isn't empty and the process thread waits for\n // an available cas processor forever.\n\n // Fix is to not kill the cas processors. Just let them finish normally. The artifact producer\n // will stop sending new CASes and send through an eof token, which causes normal shutdown to\n // occur for all the threads.\n\n /*\n * if (workQueue != null) { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb( Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_consuming_queue__FINEST\", new Object[]\n * { Thread.currentThread().getName(), workQueue.getName(),\n * String.valueOf(workQueue.getCurrentSize()) });\n * \n * } int cc = workQueue.getCurrentSize(); while (workQueue.getCurrentSize() > 0) {\n * sleep(MAX_WAIT_ON_QUEUE); if (System.getProperty(\"DEBUG\") != null) { if (cc <\n * workQueue.getCurrentSize()) { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb( Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_wait_consuming_queue__FINEST\", new\n * Object[] { Thread.currentThread().getName(), workQueue.getName(),\n * String.valueOf(workQueue.getCurrentSize()) });\n * \n * } cc = workQueue.getCurrentSize(); } } } } if (outputQueue != null) { while\n * (outputQueue.getCurrentSize() > 0) { sleep(MAX_WAIT_ON_QUEUE); if\n * (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb( Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_wait_consuming_queue__FINEST\", new\n * Object[] { Thread.currentThread().getName(), outputQueue.getName(),\n * String.valueOf(outputQueue.getCurrentSize()) }); } } if\n * (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_done_consuming_queue__FINEST\", new\n * Object[] { Thread.currentThread().getName() }); } }\n * \n * for (int i = 0; processingUnits != null && i < processingUnits.length && processingUnits[i]\n * != null; i++) { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_stop_processors__FINEST\", new Object[]\n * { Thread.currentThread().getName(), String.valueOf(i) }); }\n * processingUnits[i].stopCasProcessors(false); }\n * \n * } catch (Exception e) { if (UIMAFramework.getLogger().isLoggable(Level.FINER)) {\n * e.printStackTrace(); } UIMAFramework.getLogger(this.getClass()).logrb(Level.FINER,\n * this.getClass().getName(), \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,\n * \"UIMA_CPM_exception__FINER\", new Object[] { Thread.currentThread().getName(), e.getMessage()\n * }); }\n */\n }", "public void stopped();", "public void kill() {\n this.hp = 0;\n }", "public void close() {\n myProcess.destroy();\n }", "@Override\n public void stopPoisonPill() {\n Thread.currentThread().stop();\n }", "private static void kill() {\n if (redirectErr != null) {\n redirectErr.close();\n redirectErr.interrupt();\n redirectErr = null;\n }\n\n if (redirectOut != null) {\n redirectOut.close();\n redirectOut.interrupt();\n redirectOut = null;\n }\n\n if (JVM != null) {\n JVM.destroy();\n JVM = null;\n }\n\n JVMrunning = false;\n\n println(\"JVM reset on \" + java.util.Calendar.getInstance().getTime().toString(), progErr);\n }", "public void terminate(){\n running = false;\n }", "public void stop() {\n }", "public void stop() {\n }", "public void stop()\n {\n }", "public void kill()\n\t{\n\t\tthis.isDead = true;\n\t\tSystem.out.println(name + \" died!\");\n\t\t//GamePanel.player.playerCombatant.awardXP(this.getXP());\n\n\t\t//TODO: Reload last save or Exit\n\t}", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "public void terminate();", "public void Kill(){\n this.dead.getAndSet(true);\n if(this.registry != null){\n try {\n UnicastRemoteObject.unexportObject(this.registry, true);\n } catch(Exception e){\n System.out.println(\"None reference\");\n }\n }\n }", "public void stop() {\n\t\tthis.close(this.btcomm);\n\t}", "public void cmdKill(User teller) {\n exit(3, \"Quitting at the request of {0}. Bye!\", teller);\n }", "public boolean stop();", "public void terminate() {\r\n running = false;\r\n }", "public void cancelCurrentProcess()\n\t{\n\t\tcurrentProcess = Processes.peek();\n\t\tProcesses.dequeue();\n\t}", "public void stop() {\n\t}", "public void stop(){\n }", "public void stop() {\n\t\tthis.controller.terminate();\n\t}", "public void terminate()\n\t{\n\t\tsynchronized (this) { this.running = false; }\n\t}", "public void stop() {\n try {\n mSessionBinder.stop(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling stop.\", e);\n }\n }", "public void stop(){\n\t\t\n\t}", "void doKill() throws IOException\n\t{\n\t\tif (m_session == null)\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"programNotBeingRun\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\tif (yesNoQuery(getLocalizationManager().getLocalizedTextString(\"askKillProgram\"))) //$NON-NLS-1$\n\t\t\t\texitSession();\n\t\t}\n\t}", "public void stop() {\n\t\t\n\t}" ]
[ "0.78652304", "0.70465654", "0.70465654", "0.69710106", "0.6873967", "0.67987525", "0.67323947", "0.6667108", "0.6564794", "0.6552479", "0.65388316", "0.639262", "0.634378", "0.62975484", "0.6239727", "0.6228993", "0.61607844", "0.6148038", "0.61348015", "0.61077523", "0.6097003", "0.6055435", "0.6035832", "0.60003287", "0.5989351", "0.59793067", "0.5939568", "0.58277345", "0.57931453", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.57523763", "0.5729321", "0.57280195", "0.57251155", "0.5719754", "0.57096213", "0.56941056", "0.5682067", "0.5677802", "0.567359", "0.566418", "0.5632888", "0.56192696", "0.5606722", "0.5597563", "0.5595145", "0.5592103", "0.5583347", "0.55740625", "0.5570374", "0.5565859", "0.5565859", "0.55366695", "0.5536461", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55293787", "0.5527955", "0.55260396", "0.5519965", "0.5515172", "0.5508428", "0.5476231", "0.5474203", "0.54705304", "0.5461687", "0.5455977", "0.54463893", "0.5430599", "0.5424847", "0.54136634" ]
0.6498637
11
Kills a running proc instance.
public KillProcResponse killProc(String runId, Map<String, String> options) throws GPUdbException { KillProcRequest actualRequest_ = new KillProcRequest(runId, options); KillProcResponse actualResponse_ = new KillProcResponse(); submitRequest("/kill/proc", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void kill(long procid);", "public void kill();", "public void kill();", "public final void kill() {\n doKill();\n }", "@DELETE\n @ApiOperation(\"Forcefully stops a process\")\n @javax.ws.rs.Path(\"/{id}\")\n @WithTimer\n public void kill(@ApiParam @PathParam(\"id\") UUID instanceId) {\n ProcessKey processKey = assertProcessKey(instanceId);\n processManager.kill(processKey);\n }", "void instanceKilled(String pid, IKilledResult result);", "public void kill()\n\t{\n\t\tisKilled = true;\n\t}", "@Override\n public void kill()\n {\n }", "public static synchronized void stop() {\n\n if (proc != null) {\n proc.destroy();\n try {\n // wait for the process to really stop\n proc.waitFor();\n } catch (InterruptedException e) {\n // ignore\n }\n try {\n // leeway since sometimes the unbind happens after\n Thread.sleep(500);\n } catch (InterruptedException e) {\n // ignore\n }\n proc = null;\n }\n }", "@Override\n\tpublic void kill() {\n\n\t}", "public void Kill();", "public KillProcResponse killProc(KillProcRequest request) throws GPUdbException {\n KillProcResponse actualResponse_ = new KillProcResponse();\n submitRequest(\"/kill/proc\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void stopPropose(int instanceId);", "@Override\n\tpublic void killProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.info(\"Killing procedure \" + instanceId, Level.PROC, this);\n\t\tif (isLocallyLoaded(instanceId))\n\t\t{\n\t\t\tkillLocalProcedure(instanceId, monitor);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunloadRemoteProcedure(instanceId, true, monitor);\n\t\t}\n\t}", "void abortProcess(Long processInstanceId);", "protected abstract void doKill();", "public void killIt() {\n isRunning = false;\n killed = true;\n hardKill = true;\n\n dumpState();\n if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_killing_cpm__INFO\",\n new Object[] { Thread.currentThread().getName() });\n }\n if (workQueue != null) {\n while (workQueue.getCurrentSize() > 0) {\n workQueue.dequeue();\n }\n }\n if (outputQueue != null) {\n while (outputQueue.getCurrentSize() > 0) {\n outputQueue.dequeue();\n }\n }\n if (casPool != null) {\n synchronized (casPool) {\n casPool.notifyAll();\n }\n }\n if (workQueue != null) {\n Object[] eofToken = new Object[1];\n // only need one member in the array\n eofToken[0] = new EOFToken();\n workQueue.enqueue(eofToken);\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_terminate_pipelines__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(killed) });\n // synchronized (workQueue) { // redundant - enqueue call above does this\n // workQueue.notifyAll();\n // }\n }\n\n }", "public boolean stopProgram(String progamId);", "void stop()\n {\n log.info(\"Begin stop(), instance = '\" + instance + \"'\");\n\n if (isAlive())\n {\n processor.stop();\n try { t.join(); } catch (InterruptedException e) {}\n running = false;\n }\n\n log.info(\"End stop(), instance = '\" + instance + \"'\");\n }", "private void nativeKill()\n {\n if (process == null)\n {\n return;\n }\n for (Field f : process.getClass().getDeclaredFields())\n {\n if (\"pid\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n int pid = f.getInt(process);\n Runtime.getRuntime().exec(\n new String[] {\"kill\", \"-9\", Integer.toString(pid)});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n else if (\"handle\".equals(f.getName()))\n {\n if (makeFieldAccessible(f))\n {\n try\n {\n long handleId = f.getLong(process);\n\n Kernel32 kernel = Kernel32.INSTANCE;\n HANDLE handle = new HANDLE();\n handle.setPointer(Pointer.createConstant(handleId));\n int pid = kernel.GetProcessId(handle);\n Runtime.getRuntime().exec(\n new String[] {\"taskkill\", \"/PID\", Integer.toString(pid), \"/F\"});\n }\n catch (Throwable e)\n {\n // Ignore, we tried our best\n }\n }\n break;\n }\n }\n }", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public void stop() {\n\t\texec.stop();\n\t}", "public static void cancelProcess() {\r\n\r\n if (m_Proc != null) {\r\n if (m_bProcInterruptible) {\r\n m_Proc.destroy();\r\n m_Proc = null;\r\n m_bProcCanceled = true;\r\n }\r\n }\r\n\r\n }", "public void killExecution() {\n \n \t\tcancelOrKillExecution(false);\n \t}", "public void stopProcess() {\r\n\t\tprocess = false;\r\n\t}", "public void kill() { _isAlive = false; }", "public void stop() {\n System.out.println(\"STOP!\");\n xp.stop();\n }", "@Override\n public void onKill() {\n }", "protected void kill() {\n\t\tsetDeathTime(0.6);\n\t}", "private void killLocalProcedure(String instanceId, IProgressMonitor monitor) throws UnloadFailed\n\t{\n\t\tLogger.debug(\"killLocalProcedure()\", Level.PROC, this);\n\t\t\n\t\tmonitor.beginTask(\"Kill procedure\", 3);\n\t\tIProcedure model = getProcedure(instanceId);\n\n\t\tmonitor.subTask(\"Removing local model\");\n\t\tmonitor.worked(1);\n\n\t\t// Remove the model directly\n\t\tm_models.deleteLocalProcedureModel(instanceId);\n\n\t\tif (!s_ctx.isConnected())\n\t\t{\n\t\t\tmonitor.worked(3);\n\t\t\tmonitor.done();\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check condition: the client mode shall be controlling\n\t\t\t\tmonitor.subTask(\"Checking client mode\");\n\t\t\t\tClientMode mode = model.getRuntimeInformation().getClientMode();\n\t\t\t\tif (mode != ClientMode.CONTROL)\n\t\t\t\t{\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Cannot kill this procedure while in monitoring mode\");\n\t\t\t\t}\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\n\t\t\t\tmonitor.subTask(\"Killing process\");\n\t\t\t\t// Request context to close the procedure\n\t\t\t\tLogger.debug(\"Requesting context to kill procedure : \" + instanceId, Level.PROC, this);\n\t\t\t\tif (!s_ctx.killExecutor(instanceId))\n\t\t\t\t{\n\t\t\t\t\t// The context command was sent but it raised an error\n\t\t\t\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\t\tmonitor.done();\n\t\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \" on the server\");\n\t\t\t\t}\n\n\t\t\t\t// Report progress\n\t\t\t\tmonitor.worked(1);\n\t\t\t}\n\t\t\tcatch (ContextError err)\n\t\t\t{\n\t\t\t\tLogger.error(err.getLocalizedMessage(), Level.PROC, this);\n\t\t\t\t// The procedure could not be unloaded due to an error in the\n\t\t\t\t// context\n\t\t\t\t// processing\n\t\t\t\tmonitor.setCanceled(true);\n\t\t\t\tmonitor.done();\n\t\t\t\tthrow new UnloadFailed(\"Failed to close the procedure \" + instanceId + \": \" + err.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\t\t// Reached to this point we have the model of the procedure created.\n\t\t// Now notify any plugin extensions implementing the ProcedureView\n\t\t// support.\n\t\tProcedureNotifications.get().fireModelUnloaded(model, UnloadType.CONTROLLED_KILLED);\n\t}", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void abort()\n\t{\n\t\tif(process != null)\n\t\t\tprocess.destroy();\n\t}", "public void Kill() {\n\tif (process != null) {\n\t process.destroy();\n\t childStdin.Kill();\n\t childStdout.Kill();\n\t childStderr.Kill();\n\t}\n\tprocess = null;\n }", "public void stopPropose(int instanceId, int destination);", "public void stop() {}", "public void stop() {\n log.info(\"Stopped\");\n execFactory.shutdown();\n cg.close();\n }", "public void kill() {\n this.server.stop();\n }", "public static boolean kill(@NonNull TaskExecutionContext request) {\n try {\n logger.info(\"Begin kill task instance, processId: {}\", request.getProcessId());\n int processId = request.getProcessId();\n if (processId == 0) {\n logger.error(\"Task instance kill failed, processId is not exist\");\n return false;\n }\n\n String cmd = String.format(\"kill -9 %s\", getPidsStr(processId));\n cmd = OSUtils.getSudoCmd(request.getTenantCode(), cmd);\n logger.info(\"process id:{}, cmd:{}\", processId, cmd);\n\n OSUtils.exeCmd(cmd);\n logger.info(\"Success kill task instance, processId: {}\", request.getProcessId());\n return true;\n } catch (Exception e) {\n logger.error(\"Kill task instance error, processId: {}\", request.getProcessId(), e);\n return false;\n }\n }", "protected void kill() {\n\t\tsynchronized (this) // Don't allow shutdown during startup.\n\t\t{\n\t\t\t// Only execute for the first caller.\n\t\t\tif (shutdownMutex.acquire()) {\n\t\t\t\t// Shutdown payer thread.\n\t\t\t\tpayerThread.interrupt();\n\n\t\t\t\tfor (int i = 0; i < sets.length; i++) {\n\t\t\t\t\tsets[i].kill();\n\t\t\t\t}\n\n\t\t\t\t// Shutdown the thread pools.\n\t\t\t\tproducerThreadPool.kill();\n\n\t\t\t\t// Let the GC figure the rest out.\n\t\t\t}\n\t\t}\n\t}", "public void kill(int tk, int ts) {\n\t\tSystem.out.println(\"Total kills: \"+tk);\r\n\t\tSystem.out.println(\"Total Score: \"+ts);\r\n\t}", "@Override \n public void commandKill(int id) {\n\n }", "public void stop()\n {\n printerSimulator.stop();\n }", "public void terminate() {\n\t\trunning = false;\n\t}", "public void stopIt() {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_stop_cpm__FINEST\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(killed) });\n\n dumpState();\n\n stopped = true;\n killed = true;\n if (!isRunning) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_already_stopped__FINEST\",\n new Object[] { Thread.currentThread().getName() });\n // Already stopped\n return;\n }\n // try {\n // Change global status\n isRunning = false;\n // terminate this thread if the thread has been previously suspended\n synchronized (lockForPause) {\n if (pause) {\n pause = false;\n lockForPause.notifyAll();\n }\n }\n // Let processing threads finish their work by emptying all queues. Even during a hard\n // stop we should try to clean things up as best as we can. First empty process queue or work\n // queue, dump result of analysis into output queue and let the consumers process that.\n // When all queues are empty we are done.\n\n // The logic below (now commented out) has a race condition -\n // The workQueue / outputQueue can become (temporarily) empty, but then\n // can be filled with the eof token\n // But this code proceeds to stop all the CAS processors,\n // which results in a hang because the pool isn't empty and the process thread waits for\n // an available cas processor forever.\n\n // Fix is to not kill the cas processors. Just let them finish normally. The artifact producer\n // will stop sending new CASes and send through an eof token, which causes normal shutdown to\n // occur for all the threads.\n\n /*\n * if (workQueue != null) { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb( Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_consuming_queue__FINEST\", new Object[]\n * { Thread.currentThread().getName(), workQueue.getName(),\n * String.valueOf(workQueue.getCurrentSize()) });\n * \n * } int cc = workQueue.getCurrentSize(); while (workQueue.getCurrentSize() > 0) {\n * sleep(MAX_WAIT_ON_QUEUE); if (System.getProperty(\"DEBUG\") != null) { if (cc <\n * workQueue.getCurrentSize()) { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb( Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_wait_consuming_queue__FINEST\", new\n * Object[] { Thread.currentThread().getName(), workQueue.getName(),\n * String.valueOf(workQueue.getCurrentSize()) });\n * \n * } cc = workQueue.getCurrentSize(); } } } } if (outputQueue != null) { while\n * (outputQueue.getCurrentSize() > 0) { sleep(MAX_WAIT_ON_QUEUE); if\n * (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb( Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_wait_consuming_queue__FINEST\", new\n * Object[] { Thread.currentThread().getName(), outputQueue.getName(),\n * String.valueOf(outputQueue.getCurrentSize()) }); } } if\n * (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_done_consuming_queue__FINEST\", new\n * Object[] { Thread.currentThread().getName() }); } }\n * \n * for (int i = 0; processingUnits != null && i < processingUnits.length && processingUnits[i]\n * != null; i++) { if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {\n * UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),\n * \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_stop_processors__FINEST\", new Object[]\n * { Thread.currentThread().getName(), String.valueOf(i) }); }\n * processingUnits[i].stopCasProcessors(false); }\n * \n * } catch (Exception e) { if (UIMAFramework.getLogger().isLoggable(Level.FINER)) {\n * e.printStackTrace(); } UIMAFramework.getLogger(this.getClass()).logrb(Level.FINER,\n * this.getClass().getName(), \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,\n * \"UIMA_CPM_exception__FINER\", new Object[] { Thread.currentThread().getName(), e.getMessage()\n * }); }\n */\n }", "public void stopped();", "public void kill() {\n this.hp = 0;\n }", "public void close() {\n myProcess.destroy();\n }", "@Override\n public void stopPoisonPill() {\n Thread.currentThread().stop();\n }", "private static void kill() {\n if (redirectErr != null) {\n redirectErr.close();\n redirectErr.interrupt();\n redirectErr = null;\n }\n\n if (redirectOut != null) {\n redirectOut.close();\n redirectOut.interrupt();\n redirectOut = null;\n }\n\n if (JVM != null) {\n JVM.destroy();\n JVM = null;\n }\n\n JVMrunning = false;\n\n println(\"JVM reset on \" + java.util.Calendar.getInstance().getTime().toString(), progErr);\n }", "public void terminate(){\n running = false;\n }", "public void stop() {\n }", "public void stop() {\n }", "public void stop()\n {\n }", "public void kill()\n\t{\n\t\tthis.isDead = true;\n\t\tSystem.out.println(name + \" died!\");\n\t\t//GamePanel.player.playerCombatant.awardXP(this.getXP());\n\n\t\t//TODO: Reload last save or Exit\n\t}", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "public void terminate();", "public void Kill(){\n this.dead.getAndSet(true);\n if(this.registry != null){\n try {\n UnicastRemoteObject.unexportObject(this.registry, true);\n } catch(Exception e){\n System.out.println(\"None reference\");\n }\n }\n }", "public void stop() {\n\t\tthis.close(this.btcomm);\n\t}", "public void cmdKill(User teller) {\n exit(3, \"Quitting at the request of {0}. Bye!\", teller);\n }", "public boolean stop();", "public void terminate() {\r\n running = false;\r\n }", "public void cancelCurrentProcess()\n\t{\n\t\tcurrentProcess = Processes.peek();\n\t\tProcesses.dequeue();\n\t}", "public void stop() {\n\t}", "public void stop(){\n }", "public void stop() {\n\t\tthis.controller.terminate();\n\t}", "public void terminate()\n\t{\n\t\tsynchronized (this) { this.running = false; }\n\t}", "public void stop() {\n try {\n mSessionBinder.stop(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling stop.\", e);\n }\n }", "public void stop(){\n\t\t\n\t}", "void doKill() throws IOException\n\t{\n\t\tif (m_session == null)\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"programNotBeingRun\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\tif (yesNoQuery(getLocalizationManager().getLocalizedTextString(\"askKillProgram\"))) //$NON-NLS-1$\n\t\t\t\texitSession();\n\t\t}\n\t}", "public void stop() {\n\t\t\n\t}" ]
[ "0.78652304", "0.70465654", "0.70465654", "0.69710106", "0.6873967", "0.67987525", "0.67323947", "0.6667108", "0.6564794", "0.6552479", "0.65388316", "0.6498637", "0.639262", "0.634378", "0.62975484", "0.6239727", "0.6228993", "0.61607844", "0.6148038", "0.61348015", "0.61077523", "0.6097003", "0.6055435", "0.6035832", "0.60003287", "0.5989351", "0.59793067", "0.5939568", "0.58277345", "0.57931453", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.5766728", "0.57523763", "0.5729321", "0.57280195", "0.5719754", "0.57096213", "0.56941056", "0.5682067", "0.5677802", "0.567359", "0.566418", "0.5632888", "0.56192696", "0.5606722", "0.5597563", "0.5595145", "0.5592103", "0.5583347", "0.55740625", "0.5570374", "0.5565859", "0.5565859", "0.55366695", "0.5536461", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55303484", "0.55293787", "0.5527955", "0.55260396", "0.5519965", "0.5515172", "0.5508428", "0.5476231", "0.5474203", "0.54705304", "0.5461687", "0.5455977", "0.54463893", "0.5430599", "0.5424847", "0.54136634" ]
0.57251155
48
Revokes a systemlevel permission from a user or role.
public RevokePermissionSystemResponse revokePermissionSystem(RevokePermissionSystemRequest request) throws GPUdbException { RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse(); submitRequest("/revoke/permission/system", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RevokePermissionSystemResponse revokePermissionSystem(String name, String permission, Map<String, String> options) throws GPUdbException {\n RevokePermissionSystemRequest actualRequest_ = new RevokePermissionSystemRequest(name, permission, options);\n RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse();\n submitRequest(\"/revoke/permission/system\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void declinePermission(String objectId, User user) throws UserManagementException;", "@Override\n\tpublic void revoke(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "public void revokePermission(Permission permission) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void revokeRole(String roleName, User user) throws UserManagementException;", "public void revokePermission(Permission permission, Role role) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_ROLE_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.setString(3, role.getId());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void removeAdminOnIndividualFromSystemUser(Individual i, SystemUser user);", "public void revoke() {\n WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mObject);\n }", "public void revokePermission(String permissionID) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_PERMISSION_ID_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permissionID);\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void removePermission(T object, Permission permission, User user);", "public void removeSysRole(final Long roleId);", "public void revokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject);", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "public synchronized void revokeAdminPrivilege(Integer userId) {\n revokeAdminPrivilege(userDAO.findByPK(userId));\n }", "@Override\r\n\tpublic void deleSysPrivilege(SysPrivilege sysPrivilege) {\n\t\tsysPrivilegeDao.delete(sysPrivilege);\r\n\t}", "void stopShellPermissionIdentityDelegation();", "public boolean removePermission(Permission permission);", "void revoke(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n == 0) {\n return;\n }\n\n rights = n & (GranteeManager.ALL - rights);\n\n if (rights == 0) {\n rightsMap.remove(dbobject);\n } else {\n rightsMap.put(dbobject, rights);\n }\n }", "@Override\r\n\tpublic void deleSysPrivilege(Long id) {\n\t\tsysPrivilegeDao.deleteByKey(id);\r\n\t}", "public void revokeAccess(CommandSender sender, String[] args) {\n if (sender instanceof Player && ( ((Player) sender).hasPermission(\"mf.revokeaccess\") || ((Player) sender).hasPermission(\"mf.default\")) ) {\n\n Player player = (Player) sender;\n\n if (args.length > 1) {\n if (args[1].equalsIgnoreCase(\"cancel\")) {\n if (main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.remove(player.getName());\n player.sendMessage(ChatColor.GREEN + \"Cancelled!\");\n return;\n }\n }\n }\n else {\n player.sendMessage(ChatColor.RED + \"Usage: /mf revokeaccess (player-name)\");\n return;\n }\n\n if (!main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.put(player.getName(), args[1]);\n player.sendMessage(ChatColor.GREEN + \"Right click a locked block to revoke this player's access to it! Type '/mf revokeaccess cancel' to cancel!\");\n }\n else {\n player.sendMessage(ChatColor.RED + \"You have already entered this command! Type '/mf revokeaccess cancel' to cancel!\");\n }\n\n }\n\n }", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "public void removeByApproved(boolean approved)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException {\n RevokeRoleResponse actualResponse_ = new RevokeRoleResponse();\n submitRequest(\"/revoke/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void setNegativePermissions();", "public void removeRole(String roleName) throws UnsupportedOperationException;", "void resetRuntimePermissions(@NonNull AndroidPackage pkg,\n @UserIdInt int userId);", "@Override\r\n\tpublic int delPermission(int id) {\n\t\treturn 0;\r\n\t}", "void remove(User user) throws AccessControlException;", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "public abstract void revokeModerator(String nickname);", "void exitPermission() throws RemoteException;", "public void supprimerRole(Long idRoUt);", "public void removeSystemUser(DietTreatmentSystemUserBO systemUser)\n {\n _dietTreatment.removeSystemUsers(systemUser);\n\n }", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "public void revoke();", "@Override\n public RemovePermissionResult removePermission(RemovePermissionRequest request) {\n request = beforeClientExecution(request);\n return executeRemovePermission(request);\n }", "void unmute() {\n execute(\"player.muted = false\");\n }", "public RevokePermissionTableResponse revokePermissionTable(String name, String permission, String tableName, Map<String, String> options) throws GPUdbException {\n RevokePermissionTableRequest actualRequest_ = new RevokePermissionTableRequest(name, permission, tableName, options);\n RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse();\n submitRequest(\"/revoke/permission/table\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void revokePermissionsFor(String userName, String fileName) throws InterruptedException {\n Log.i(\"revokePermissionsFor\",\n \"About to revoke permissions for \" + userName + \" on file \" + fileName);\n String userPublicKey = getUserKeyFromUserName(userName);\n Log.i(\"revokePermissionsFor\", \"About to revoke permissions for \" + userPublicKey);\n database.delete(\"FileKeys\", \"UserPublicKey = ? AND File = ?\", new String[]{\n userPublicKey, fileName\n });\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n updateDatabaseFile();\n Log.i(\"AsyncTask\", \"database file updated\");\n finished = true;\n }\n });\n customWait();\n }", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "void revokeDbObject(Object dbobject) {\n rightsMap.remove(dbobject);\n }", "void unsetSystem();", "@Test\n public void testNoResidualPermissionsOnUninstall_part2() throws Exception {\n assertAllPermissionsRevoked();\n }", "public RevokePermissionTableResponse revokePermissionTable(RevokePermissionTableRequest request) throws GPUdbException {\n RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse();\n submitRequest(\"/revoke/permission/table\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)\n public void removeOnPermissionsChangeListener(\n @NonNull PackageManager.OnPermissionsChangedListener listener) {\n synchronized (mPermissionListeners) {\n final IOnPermissionsChangeListener delegate = mPermissionListeners.get(listener);\n if (delegate != null) {\n try {\n mPermissionManager.removeOnPermissionsChangeListener(delegate);\n mPermissionListeners.remove(listener);\n } catch (RemoteException e) {\n throw e.rethrowFromSystemServer();\n }\n }\n }\n }", "@Override\n public void clearPermissions(Class<? extends AeroCommandBase<?>> command) {\n permissions.remove(command);\n }", "public static void disablePermissionCache() {\n sPermissionCache.disableLocal();\n }", "@Override\n\tpublic void removeGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "boolean unblockUser(User user);", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "@Override\n public void clearPermissions() {\n permissions.clear();\n }", "public void removeSysUserType(final Long id);", "@Override\n\tpublic void removeGamePlayRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "void clearPrivileges() {\n\n roles.clear();\n rightsMap.clear();\n\n isAdministrator = false;\n }", "private void removePolicy(){\n\texcludedPermissions = null;\n\tuncheckedPermissions = null;\n\trolePermissionsTable = null;\n\tremovePolicyFile(true);\n\tremovePolicyFile(false);\n\tremovePolicyContextDirectory();\n\tinitLinkTable();\n\tpolicy = null;\n\twriteOnCommit = true;\n }", "private void revokeLogin(long studentID) throws Exception {\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[login_enabled]=0\";\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n }", "public SecurityIdentityType<T> removeRunAs()\n {\n childNode.remove(\"run-as\");\n return this;\n }", "@DefaultMessage(\"This action will remove all the permissions for this user and make it inactive. The user itself will not be removed.\")\n @Key(\"systemUser.deleteUserMessage\")\n String systemUser_deleteUserMessage();", "public void confirmPermission(String objectId, User user) throws UserManagementException;", "private void deleteRoleAccess(Role inheritFromToDelete,\n List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n String inheritFromId = inheritFromToDelete.getId();\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled ih : roleAccessList) {\n String inheritedFromId = ih.getInheritedFrom() != null ? ih.getInheritedFrom().getId() : \"\";\n if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {\n iaeToDelete.add(ih);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n Role owner = injector.getRole(iae);\n if (!owner.isTemplate()) {\n // Perform this operation for not template roles, because for template roles is already\n // done\n // in the event handler\n injector.removeReferenceInParentList(iae);\n }\n OBDal.getInstance().remove(iae);\n }\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "void cronClearPermissionsCache();", "private void removePendingAction(PermissionsResultAction paramPermissionsResultAction) {\n }", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Test\n public void testRevokePropagatedOnUpgradeNewToNewModel_part2() throws Exception {\n assertPermissionsGrantState(new String[] {Manifest.permission.READ_CALENDAR},\n PackageManager.PERMISSION_GRANTED);\n // Also make sure one of the not granted permissions is still not granted\n assertPermissionsGrantState(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE},\n PackageManager.PERMISSION_DENIED);\n }", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "public void removeRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"User [ Anonymous ] has no roles\");\r\n }", "private void revokeGooglePlusAccess() {\n if (mGoogleApiClient.isConnected()) {\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)\n .setResultCallback(new ResultCallback<Status>() {\n @Override\n public void onResult(Status arg0) {\n Log.e(TAG, \"User access revoked!\");\n mGoogleApiClient.connect();\n }\n\n });\n }\n }", "int deleteByExample(SysRoleDOExample example);", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public void removePermission(String messageBoxId, PermissionLabel permissionLabel)\n throws MessageBoxException {\n try {\n AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();\n\n String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + \"/\" +\n messageBoxId;\n\n for (String sharedUser : permissionLabel.getSharedUsers()) {\n for (String operation : permissionLabel.getOperations()) {\n authorizationManager.clearUserAuthorization(sharedUser, messageBoxPath, operation);\n }\n }\n } catch (UserStoreException e) {\n String error = \"Failed to clear permissions authorized for \" + messageBoxId +\n \" with permission label \" + permissionLabel.getLabelName();\n log.error(error);\n throw new MessageBoxException(error, e);\n }\n }", "@Override\n\tpublic void undo() {\n\t\tsecurity.off();\n\t}", "public void removeViewRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_viewRole);\r\n }", "public void removeUncheckedPolicy()\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tcheckSetPolicyPermission();\t\n\n\tif (uncheckedPermissions != null) {\n\t uncheckedPermissions = null;\n\t writeOnCommit = true;\n\t}\n }", "public void removeAppRestriction(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: cm.android.mdm.manager.PackageManager2.removeAppRestriction(int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: cm.android.mdm.manager.PackageManager2.removeAppRestriction(int):void\");\n }", "protected void unconfigureAbilityModifiers(Ability ability) {\n int count = ability.getLimitationCount();\n for (int i = 0; i < count; i++) {\n //if ( ability.getIndexedBooleanValue(i, \"Limitation\", \"FRAMEWORKLIMITATION\") ) {\n Limitation lim = ability.getLimitation(i);\n if (lim.isAddedByFramework()) {\n ability.removeLimitation(i);\n count--;\n }\n }\n }", "@Test\n public void revokeRequested() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n /*\n * When\n */\n DatasetGrant revoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(revoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "@Test\n public void revokeRevoked() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant firstRevoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n DatasetGrant secondRevoked = firstRevoked.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(firstRevoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n })\n .isEqualTo(secondRevoked);\n }", "public SystemMessage removeSystemMessage(SystemMessage sysMsg){\n\t\treturn removeSystemMessage(sysMsg.iID);\n\t}", "@Override\r\n\tpublic int updPermission(Permission perms) {\n\t\treturn 0;\r\n\t}", "public void revert()\n {\n throw new UnsupportedOperationException(\"this is a security delegate object\"); \n }", "public void clearAccess();", "public void removeEditorRoleFromIndividualAcl(Individual i);", "public void removeModerateRight(Moderator moderator) throws ServiceException{\n }", "@Test\n public void testRevokeAffectsWholeGroup_part2() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.READ_CALENDAR));\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CALENDAR));\n }", "@TestApi\n @RequiresPermission(Manifest.permission.REVOKE_POST_NOTIFICATIONS_WITHOUT_KILL)\n public void revokePostNotificationPermissionWithoutKillForTest(@NonNull String packageName,\n int userId) {\n try {\n mPermissionManager.revokePostNotificationPermissionWithoutKillForTest(packageName,\n userId);\n } catch (RemoteException e) {\n e.rethrowFromSystemServer();\n }\n }", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "void unblock(User user) throws RepositoryException;", "public abstract void revokeMembership(String nickname);", "private void revokeGplusAccess() {\n if (mGoogleApiClient.isConnected()) {\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)\n .setResultCallback(new ResultCallback<Status>() {\n @Override\n public void onResult(Status arg0) {\n Log.e(TAG, \"User access revoked!\");\n mGoogleApiClient.connect();\n updateUI(false);\n }\n });\n }\n }", "private void revokeUserLoginAndUpdateNotes(long studentID) throws Exception {\n int fee = getPendingFee(studentID);\n fee += 25;\n\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[description]=Owes $\" + fee;\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n\n revokeLogin(studentID);\n\n }", "int deleteByExample(RoleSystemauthorityExample example);", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "boolean transactTo_removePolicy(int code, String policyName, String transactName, ComponentName who, int userId, int customType) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeInt(userId);\n _data.writeString(policyName);\n _data.writeInt(customType);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }", "public void removeUsedPermission(final String name) {\n final List<Element> elementsToRemove = new LinkedList<Element>();\n for (final Element child : manifestElement.getChildren(ELEMENT_USES_PERMISSION)) {\n if (name.equals(child.getAttributeValue(ATTRIBUTE_NAME))) {\n elementsToRemove.add(child);\n }\n }\n\n for (final Element element : elementsToRemove) {\n removeElementAndPrefix(element);\n }\n }", "@Override\r\n\tpublic int editRolePermission(RolePermission rolePermission) {\n\t\treturn rolePermissionMapper.updateByPrimaryKeySelective(rolePermission);\r\n\t}", "private void onRemoveRole() {\n\t\troleProxy.removeRoleFromUser(user, selectedRole);\n\t}", "public void remModify(){\n rem(MetaDMSAG.__modify);\n }" ]
[ "0.68788135", "0.6685131", "0.6589349", "0.6560699", "0.645731", "0.63172144", "0.6284462", "0.6131901", "0.6054395", "0.5928337", "0.59233767", "0.59229565", "0.58746934", "0.5807738", "0.58045256", "0.58000106", "0.5773001", "0.5704775", "0.5641189", "0.5641036", "0.5587416", "0.55827564", "0.5569804", "0.5517975", "0.5515949", "0.5501796", "0.54827297", "0.5482384", "0.54547554", "0.5438211", "0.5430732", "0.5425343", "0.54218054", "0.5413192", "0.5394991", "0.5345224", "0.5260156", "0.52485645", "0.5246169", "0.5240273", "0.52308595", "0.52151096", "0.52118075", "0.5209955", "0.5202323", "0.5177874", "0.51629275", "0.51599133", "0.5159894", "0.51525044", "0.5147919", "0.5093689", "0.5093219", "0.50861245", "0.5082911", "0.5082356", "0.50642616", "0.50601494", "0.50397086", "0.50370896", "0.500394", "0.49942213", "0.49839556", "0.4983841", "0.49632424", "0.49497244", "0.4928491", "0.49274537", "0.49263296", "0.49245057", "0.49198794", "0.49024782", "0.48986435", "0.4878266", "0.48600706", "0.48598933", "0.48574066", "0.48561084", "0.4850882", "0.48502022", "0.4849841", "0.48481995", "0.48276067", "0.48132685", "0.4806427", "0.4805986", "0.48047343", "0.48016885", "0.47849655", "0.47783247", "0.47772864", "0.47741795", "0.47660524", "0.47618353", "0.47557798", "0.47547948", "0.47511828", "0.47483778", "0.47409558", "0.4736102" ]
0.74695617
0
Revokes a systemlevel permission from a user or role.
public RevokePermissionSystemResponse revokePermissionSystem(String name, String permission, Map<String, String> options) throws GPUdbException { RevokePermissionSystemRequest actualRequest_ = new RevokePermissionSystemRequest(name, permission, options); RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse(); submitRequest("/revoke/permission/system", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RevokePermissionSystemResponse revokePermissionSystem(RevokePermissionSystemRequest request) throws GPUdbException {\n RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse();\n submitRequest(\"/revoke/permission/system\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void declinePermission(String objectId, User user) throws UserManagementException;", "@Override\n\tpublic void revoke(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "public void revokePermission(Permission permission) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void revokeRole(String roleName, User user) throws UserManagementException;", "public void revokePermission(Permission permission, Role role) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_ROLE_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.setString(3, role.getId());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void removeAdminOnIndividualFromSystemUser(Individual i, SystemUser user);", "public void revoke() {\n WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mObject);\n }", "public void revokePermission(String permissionID) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_PERMISSION_ID_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permissionID);\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void removePermission(T object, Permission permission, User user);", "public void removeSysRole(final Long roleId);", "public void revokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject);", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "public synchronized void revokeAdminPrivilege(Integer userId) {\n revokeAdminPrivilege(userDAO.findByPK(userId));\n }", "@Override\r\n\tpublic void deleSysPrivilege(SysPrivilege sysPrivilege) {\n\t\tsysPrivilegeDao.delete(sysPrivilege);\r\n\t}", "void stopShellPermissionIdentityDelegation();", "public boolean removePermission(Permission permission);", "void revoke(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n == 0) {\n return;\n }\n\n rights = n & (GranteeManager.ALL - rights);\n\n if (rights == 0) {\n rightsMap.remove(dbobject);\n } else {\n rightsMap.put(dbobject, rights);\n }\n }", "@Override\r\n\tpublic void deleSysPrivilege(Long id) {\n\t\tsysPrivilegeDao.deleteByKey(id);\r\n\t}", "public void revokeAccess(CommandSender sender, String[] args) {\n if (sender instanceof Player && ( ((Player) sender).hasPermission(\"mf.revokeaccess\") || ((Player) sender).hasPermission(\"mf.default\")) ) {\n\n Player player = (Player) sender;\n\n if (args.length > 1) {\n if (args[1].equalsIgnoreCase(\"cancel\")) {\n if (main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.remove(player.getName());\n player.sendMessage(ChatColor.GREEN + \"Cancelled!\");\n return;\n }\n }\n }\n else {\n player.sendMessage(ChatColor.RED + \"Usage: /mf revokeaccess (player-name)\");\n return;\n }\n\n if (!main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.put(player.getName(), args[1]);\n player.sendMessage(ChatColor.GREEN + \"Right click a locked block to revoke this player's access to it! Type '/mf revokeaccess cancel' to cancel!\");\n }\n else {\n player.sendMessage(ChatColor.RED + \"You have already entered this command! Type '/mf revokeaccess cancel' to cancel!\");\n }\n\n }\n\n }", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "public void removeByApproved(boolean approved)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException {\n RevokeRoleResponse actualResponse_ = new RevokeRoleResponse();\n submitRequest(\"/revoke/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void setNegativePermissions();", "public void removeRole(String roleName) throws UnsupportedOperationException;", "void resetRuntimePermissions(@NonNull AndroidPackage pkg,\n @UserIdInt int userId);", "@Override\r\n\tpublic int delPermission(int id) {\n\t\treturn 0;\r\n\t}", "void remove(User user) throws AccessControlException;", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "public abstract void revokeModerator(String nickname);", "void exitPermission() throws RemoteException;", "public void supprimerRole(Long idRoUt);", "public void removeSystemUser(DietTreatmentSystemUserBO systemUser)\n {\n _dietTreatment.removeSystemUsers(systemUser);\n\n }", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "public void revoke();", "@Override\n public RemovePermissionResult removePermission(RemovePermissionRequest request) {\n request = beforeClientExecution(request);\n return executeRemovePermission(request);\n }", "void unmute() {\n execute(\"player.muted = false\");\n }", "public RevokePermissionTableResponse revokePermissionTable(String name, String permission, String tableName, Map<String, String> options) throws GPUdbException {\n RevokePermissionTableRequest actualRequest_ = new RevokePermissionTableRequest(name, permission, tableName, options);\n RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse();\n submitRequest(\"/revoke/permission/table\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void revokePermissionsFor(String userName, String fileName) throws InterruptedException {\n Log.i(\"revokePermissionsFor\",\n \"About to revoke permissions for \" + userName + \" on file \" + fileName);\n String userPublicKey = getUserKeyFromUserName(userName);\n Log.i(\"revokePermissionsFor\", \"About to revoke permissions for \" + userPublicKey);\n database.delete(\"FileKeys\", \"UserPublicKey = ? AND File = ?\", new String[]{\n userPublicKey, fileName\n });\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n updateDatabaseFile();\n Log.i(\"AsyncTask\", \"database file updated\");\n finished = true;\n }\n });\n customWait();\n }", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "void revokeDbObject(Object dbobject) {\n rightsMap.remove(dbobject);\n }", "void unsetSystem();", "@Test\n public void testNoResidualPermissionsOnUninstall_part2() throws Exception {\n assertAllPermissionsRevoked();\n }", "public RevokePermissionTableResponse revokePermissionTable(RevokePermissionTableRequest request) throws GPUdbException {\n RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse();\n submitRequest(\"/revoke/permission/table\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)\n public void removeOnPermissionsChangeListener(\n @NonNull PackageManager.OnPermissionsChangedListener listener) {\n synchronized (mPermissionListeners) {\n final IOnPermissionsChangeListener delegate = mPermissionListeners.get(listener);\n if (delegate != null) {\n try {\n mPermissionManager.removeOnPermissionsChangeListener(delegate);\n mPermissionListeners.remove(listener);\n } catch (RemoteException e) {\n throw e.rethrowFromSystemServer();\n }\n }\n }\n }", "@Override\n public void clearPermissions(Class<? extends AeroCommandBase<?>> command) {\n permissions.remove(command);\n }", "public static void disablePermissionCache() {\n sPermissionCache.disableLocal();\n }", "@Override\n\tpublic void removeGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "boolean unblockUser(User user);", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "@Override\n public void clearPermissions() {\n permissions.clear();\n }", "public void removeSysUserType(final Long id);", "@Override\n\tpublic void removeGamePlayRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "void clearPrivileges() {\n\n roles.clear();\n rightsMap.clear();\n\n isAdministrator = false;\n }", "private void removePolicy(){\n\texcludedPermissions = null;\n\tuncheckedPermissions = null;\n\trolePermissionsTable = null;\n\tremovePolicyFile(true);\n\tremovePolicyFile(false);\n\tremovePolicyContextDirectory();\n\tinitLinkTable();\n\tpolicy = null;\n\twriteOnCommit = true;\n }", "private void revokeLogin(long studentID) throws Exception {\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[login_enabled]=0\";\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n }", "public SecurityIdentityType<T> removeRunAs()\n {\n childNode.remove(\"run-as\");\n return this;\n }", "@DefaultMessage(\"This action will remove all the permissions for this user and make it inactive. The user itself will not be removed.\")\n @Key(\"systemUser.deleteUserMessage\")\n String systemUser_deleteUserMessage();", "public void confirmPermission(String objectId, User user) throws UserManagementException;", "private void deleteRoleAccess(Role inheritFromToDelete,\n List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n String inheritFromId = inheritFromToDelete.getId();\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled ih : roleAccessList) {\n String inheritedFromId = ih.getInheritedFrom() != null ? ih.getInheritedFrom().getId() : \"\";\n if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {\n iaeToDelete.add(ih);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n Role owner = injector.getRole(iae);\n if (!owner.isTemplate()) {\n // Perform this operation for not template roles, because for template roles is already\n // done\n // in the event handler\n injector.removeReferenceInParentList(iae);\n }\n OBDal.getInstance().remove(iae);\n }\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "void cronClearPermissionsCache();", "private void removePendingAction(PermissionsResultAction paramPermissionsResultAction) {\n }", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Test\n public void testRevokePropagatedOnUpgradeNewToNewModel_part2() throws Exception {\n assertPermissionsGrantState(new String[] {Manifest.permission.READ_CALENDAR},\n PackageManager.PERMISSION_GRANTED);\n // Also make sure one of the not granted permissions is still not granted\n assertPermissionsGrantState(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE},\n PackageManager.PERMISSION_DENIED);\n }", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "public void removeRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"User [ Anonymous ] has no roles\");\r\n }", "private void revokeGooglePlusAccess() {\n if (mGoogleApiClient.isConnected()) {\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)\n .setResultCallback(new ResultCallback<Status>() {\n @Override\n public void onResult(Status arg0) {\n Log.e(TAG, \"User access revoked!\");\n mGoogleApiClient.connect();\n }\n\n });\n }\n }", "int deleteByExample(SysRoleDOExample example);", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public void removePermission(String messageBoxId, PermissionLabel permissionLabel)\n throws MessageBoxException {\n try {\n AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();\n\n String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + \"/\" +\n messageBoxId;\n\n for (String sharedUser : permissionLabel.getSharedUsers()) {\n for (String operation : permissionLabel.getOperations()) {\n authorizationManager.clearUserAuthorization(sharedUser, messageBoxPath, operation);\n }\n }\n } catch (UserStoreException e) {\n String error = \"Failed to clear permissions authorized for \" + messageBoxId +\n \" with permission label \" + permissionLabel.getLabelName();\n log.error(error);\n throw new MessageBoxException(error, e);\n }\n }", "@Override\n\tpublic void undo() {\n\t\tsecurity.off();\n\t}", "public void removeViewRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_viewRole);\r\n }", "public void removeUncheckedPolicy()\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tcheckSetPolicyPermission();\t\n\n\tif (uncheckedPermissions != null) {\n\t uncheckedPermissions = null;\n\t writeOnCommit = true;\n\t}\n }", "public void removeAppRestriction(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: cm.android.mdm.manager.PackageManager2.removeAppRestriction(int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: cm.android.mdm.manager.PackageManager2.removeAppRestriction(int):void\");\n }", "protected void unconfigureAbilityModifiers(Ability ability) {\n int count = ability.getLimitationCount();\n for (int i = 0; i < count; i++) {\n //if ( ability.getIndexedBooleanValue(i, \"Limitation\", \"FRAMEWORKLIMITATION\") ) {\n Limitation lim = ability.getLimitation(i);\n if (lim.isAddedByFramework()) {\n ability.removeLimitation(i);\n count--;\n }\n }\n }", "@Test\n public void revokeRequested() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n /*\n * When\n */\n DatasetGrant revoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(revoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "@Test\n public void revokeRevoked() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant firstRevoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n DatasetGrant secondRevoked = firstRevoked.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(firstRevoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n })\n .isEqualTo(secondRevoked);\n }", "public SystemMessage removeSystemMessage(SystemMessage sysMsg){\n\t\treturn removeSystemMessage(sysMsg.iID);\n\t}", "@Override\r\n\tpublic int updPermission(Permission perms) {\n\t\treturn 0;\r\n\t}", "public void revert()\n {\n throw new UnsupportedOperationException(\"this is a security delegate object\"); \n }", "public void clearAccess();", "public void removeEditorRoleFromIndividualAcl(Individual i);", "public void removeModerateRight(Moderator moderator) throws ServiceException{\n }", "@Test\n public void testRevokeAffectsWholeGroup_part2() throws Exception {\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.READ_CALENDAR));\n assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext()\n .checkSelfPermission(Manifest.permission.WRITE_CALENDAR));\n }", "@TestApi\n @RequiresPermission(Manifest.permission.REVOKE_POST_NOTIFICATIONS_WITHOUT_KILL)\n public void revokePostNotificationPermissionWithoutKillForTest(@NonNull String packageName,\n int userId) {\n try {\n mPermissionManager.revokePostNotificationPermissionWithoutKillForTest(packageName,\n userId);\n } catch (RemoteException e) {\n e.rethrowFromSystemServer();\n }\n }", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "void unblock(User user) throws RepositoryException;", "public abstract void revokeMembership(String nickname);", "private void revokeGplusAccess() {\n if (mGoogleApiClient.isConnected()) {\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)\n .setResultCallback(new ResultCallback<Status>() {\n @Override\n public void onResult(Status arg0) {\n Log.e(TAG, \"User access revoked!\");\n mGoogleApiClient.connect();\n updateUI(false);\n }\n });\n }\n }", "private void revokeUserLoginAndUpdateNotes(long studentID) throws Exception {\n int fee = getPendingFee(studentID);\n fee += 25;\n\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[description]=Owes $\" + fee;\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n\n revokeLogin(studentID);\n\n }", "int deleteByExample(RoleSystemauthorityExample example);", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "boolean transactTo_removePolicy(int code, String policyName, String transactName, ComponentName who, int userId, int customType) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeInt(userId);\n _data.writeString(policyName);\n _data.writeInt(customType);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }", "public void removeUsedPermission(final String name) {\n final List<Element> elementsToRemove = new LinkedList<Element>();\n for (final Element child : manifestElement.getChildren(ELEMENT_USES_PERMISSION)) {\n if (name.equals(child.getAttributeValue(ATTRIBUTE_NAME))) {\n elementsToRemove.add(child);\n }\n }\n\n for (final Element element : elementsToRemove) {\n removeElementAndPrefix(element);\n }\n }", "@Override\r\n\tpublic int editRolePermission(RolePermission rolePermission) {\n\t\treturn rolePermissionMapper.updateByPrimaryKeySelective(rolePermission);\r\n\t}", "private void onRemoveRole() {\n\t\troleProxy.removeRoleFromUser(user, selectedRole);\n\t}", "public void remModify(){\n rem(MetaDMSAG.__modify);\n }" ]
[ "0.74695617", "0.6685131", "0.6589349", "0.6560699", "0.645731", "0.63172144", "0.6284462", "0.6131901", "0.6054395", "0.5928337", "0.59233767", "0.59229565", "0.58746934", "0.5807738", "0.58045256", "0.58000106", "0.5773001", "0.5704775", "0.5641189", "0.5641036", "0.5587416", "0.55827564", "0.5569804", "0.5517975", "0.5515949", "0.5501796", "0.54827297", "0.5482384", "0.54547554", "0.5438211", "0.5430732", "0.5425343", "0.54218054", "0.5413192", "0.5394991", "0.5345224", "0.5260156", "0.52485645", "0.5246169", "0.5240273", "0.52308595", "0.52151096", "0.52118075", "0.5209955", "0.5202323", "0.5177874", "0.51629275", "0.51599133", "0.5159894", "0.51525044", "0.5147919", "0.5093689", "0.5093219", "0.50861245", "0.5082911", "0.5082356", "0.50642616", "0.50601494", "0.50397086", "0.50370896", "0.500394", "0.49942213", "0.49839556", "0.4983841", "0.49632424", "0.49497244", "0.4928491", "0.49274537", "0.49263296", "0.49245057", "0.49198794", "0.49024782", "0.48986435", "0.4878266", "0.48600706", "0.48598933", "0.48574066", "0.48561084", "0.4850882", "0.48502022", "0.4849841", "0.48481995", "0.48276067", "0.48132685", "0.4806427", "0.4805986", "0.48047343", "0.48016885", "0.47849655", "0.47783247", "0.47772864", "0.47741795", "0.47660524", "0.47618353", "0.47557798", "0.47547948", "0.47511828", "0.47483778", "0.47409558", "0.4736102" ]
0.68788135
1
Revokes a tablelevel permission from a user or role.
public RevokePermissionTableResponse revokePermissionTable(RevokePermissionTableRequest request) throws GPUdbException { RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse(); submitRequest("/revoke/permission/table", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RevokePermissionTableResponse revokePermissionTable(String name, String permission, String tableName, Map<String, String> options) throws GPUdbException {\n RevokePermissionTableRequest actualRequest_ = new RevokePermissionTableRequest(name, permission, tableName, options);\n RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse();\n submitRequest(\"/revoke/permission/table\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void revokePermission(Permission permission) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "@Override\n\tpublic void revoke(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public void revokePermission(Permission permission, Role role) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_ROLE_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.setString(3, role.getId());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void declinePermission(String objectId, User user) throws UserManagementException;", "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "public void removePermission(T object, Permission permission, User user);", "public void revokePermission(String permissionID) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_PERMISSION_ID_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permissionID);\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void revokeRole(String roleName, User user) throws UserManagementException;", "public void supprimerRole(Long idRoUt);", "void revokeDbObject(Object dbobject) {\n rightsMap.remove(dbobject);\n }", "void revoke(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n == 0) {\n return;\n }\n\n rights = n & (GranteeManager.ALL - rights);\n\n if (rights == 0) {\n rightsMap.remove(dbobject);\n } else {\n rightsMap.put(dbobject, rights);\n }\n }", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "public synchronized void revokeAdminPrivilege(Integer userId) {\n revokeAdminPrivilege(userDAO.findByPK(userId));\n }", "public RevokePermissionSystemResponse revokePermissionSystem(RevokePermissionSystemRequest request) throws GPUdbException {\n RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse();\n submitRequest(\"/revoke/permission/system\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delPermission(int id) {\n\t\treturn 0;\r\n\t}", "public void revoke() {\n WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mObject);\n }", "public abstract void revokeModerator(String nickname);", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "public void revokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject);", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Delete({\n \"delete from A_USER_ROLE\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);", "public int deleteAllPermissions() throws DAOException;", "public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException {\n RevokeRoleResponse actualResponse_ = new RevokeRoleResponse();\n submitRequest(\"/revoke/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void deleteRole(long id) {\n\t\t\n\t}", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "private void deleteRoleAccess(Role inheritFromToDelete,\n List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n String inheritFromId = inheritFromToDelete.getId();\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled ih : roleAccessList) {\n String inheritedFromId = ih.getInheritedFrom() != null ? ih.getInheritedFrom().getId() : \"\";\n if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {\n iaeToDelete.add(ih);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n Role owner = injector.getRole(iae);\n if (!owner.isTemplate()) {\n // Perform this operation for not template roles, because for template roles is already\n // done\n // in the event handler\n injector.removeReferenceInParentList(iae);\n }\n OBDal.getInstance().remove(iae);\n }\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "@Override\n\tpublic void deleteRolemenuByRoleId(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from menurole where roleid=?\",roleid);\n\t}", "public void revokeAccess(CommandSender sender, String[] args) {\n if (sender instanceof Player && ( ((Player) sender).hasPermission(\"mf.revokeaccess\") || ((Player) sender).hasPermission(\"mf.default\")) ) {\n\n Player player = (Player) sender;\n\n if (args.length > 1) {\n if (args[1].equalsIgnoreCase(\"cancel\")) {\n if (main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.remove(player.getName());\n player.sendMessage(ChatColor.GREEN + \"Cancelled!\");\n return;\n }\n }\n }\n else {\n player.sendMessage(ChatColor.RED + \"Usage: /mf revokeaccess (player-name)\");\n return;\n }\n\n if (!main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.put(player.getName(), args[1]);\n player.sendMessage(ChatColor.GREEN + \"Right click a locked block to revoke this player's access to it! Type '/mf revokeaccess cancel' to cancel!\");\n }\n else {\n player.sendMessage(ChatColor.RED + \"You have already entered this command! Type '/mf revokeaccess cancel' to cancel!\");\n }\n\n }\n\n }", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "public void revoke();", "@Override\n\t@TriggersRemove(cacheName=\"baseCache\",when=When.AFTER_METHOD_INVOCATION,removeAll=true)\n\tpublic int deleteByRole(Integer roleid) {\n\t\treturn permissionRoleMapper.deleteByRole(roleid);\n\t}", "int deleteByExample(TUserPermissionExample example);", "int deleteByPrimaryKey(Long permsId);", "List<MenuPermissionEntity> deleteByUserGroup(UserGroupEntity userGroup);", "@Override\r\n\tpublic void deleSysPrivilege(Long id) {\n\t\tsysPrivilegeDao.deleteByKey(id);\r\n\t}", "void remove(User user) throws AccessControlException;", "public int deleteByPrimaryKey(String id) {\n\t\tUserPermission key = new UserPermission();\n\t\tkey.setId(id);\n\t\tint rows = getSqlMapClientTemplate().delete(\n\t\t\t\t\"userpermission.deleteByPrimaryKey\", key);\n\t\treturn rows;\n\t}", "public void delete(SecRole entity);", "public boolean removePermission(Permission permission);", "private void removePolicy(){\n\texcludedPermissions = null;\n\tuncheckedPermissions = null;\n\trolePermissionsTable = null;\n\tremovePolicyFile(true);\n\tremovePolicyFile(false);\n\tremovePolicyContextDirectory();\n\tinitLinkTable();\n\tpolicy = null;\n\twriteOnCommit = true;\n }", "int deleteByPrimaryKey(T00RolePostKey key);", "public void removeSysRole(final Long roleId);", "public void removeAdminOnIndividualFromSystemUser(Individual i, SystemUser user);", "void deleteAllAccesses(Role role) {\n for (AccessTypeInjector accessType : getAccessTypeOrderByPriority(true)) {\n List<? extends InheritedAccessEnabled> roleAccessList = accessType.getAccessList(role);\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled iae : roleAccessList) {\n // Not inherited accesses should not be deleted\n if (iae.getInheritedFrom() != null) {\n iaeToDelete.add(iae);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n accessType.clearInheritFromFieldInChilds(iae, true);\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n OBDal.getInstance().remove(iae);\n }\n }\n OBDal.getInstance().commitAndClose();\n }", "void removeRole(String id) throws DataException;", "int deleteByPrimaryKey(Integer roleId);", "int deleteByPrimaryKey(Integer roleId);", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "int deleteByExample(SysRoleDOExample example);", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "public void removeEditorRoleFromIndividualAcl(Individual i);", "public RevokePermissionSystemResponse revokePermissionSystem(String name, String permission, Map<String, String> options) throws GPUdbException {\n RevokePermissionSystemRequest actualRequest_ = new RevokePermissionSystemRequest(name, permission, options);\n RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse();\n submitRequest(\"/revoke/permission/system\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void deletRole(int id) {\n\trolesDao.deleteById(id);\n\t}", "@Test\n public void revokeRevoked() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant firstRevoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n DatasetGrant secondRevoked = firstRevoked.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(firstRevoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n })\n .isEqualTo(secondRevoked);\n }", "@Override\r\n\tpublic void deletePsermission(Permission permission) {\n\t\tpermissionDao.deletePsermission(permission);\r\n\t}", "public void deletePrivilege(Privilege p) {\n\n Session session = ConnectionFactory.getInstance().getSession();\n\n Transaction tx = null;\n\n try {\n\n tx = session.beginTransaction();\n\n session.delete(p);\n tx.commit();\n } catch (HibernateException e) {\n try {\n tx.rollback(); //error\n } catch (HibernateException he) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n }", "@Override\n\tpublic void delete(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from role where id=?\",roleid);\n\t}", "void stopShellPermissionIdentityDelegation();", "@Override\n public void clearPermissions(Class<? extends AeroCommandBase<?>> command) {\n permissions.remove(command);\n }", "public void removeByApproved(boolean approved)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "int deleteByExample(MyUserRoleRelationExample example);", "public void removeViewRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_viewRole);\r\n }", "public abstract void revokeMembership(String nickname);", "@Override\n\tpublic Integer delete(Integer id) {\n\t\treturn roleDao.delete(id);\n\t}", "public void removeRole(String roleName) throws UnsupportedOperationException;", "@Override\n\tpublic int deleteRoleInfo(int roleid) throws Exception {\n\t\tDBContextHolder.setDBType(\"0\");\n\t\treturn froleMapper.deleteRoleInfo(roleid);\n\t}", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "public void revokePermissionsFor(String userName, String fileName) throws InterruptedException {\n Log.i(\"revokePermissionsFor\",\n \"About to revoke permissions for \" + userName + \" on file \" + fileName);\n String userPublicKey = getUserKeyFromUserName(userName);\n Log.i(\"revokePermissionsFor\", \"About to revoke permissions for \" + userPublicKey);\n database.delete(\"FileKeys\", \"UserPublicKey = ? AND File = ?\", new String[]{\n userPublicKey, fileName\n });\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n updateDatabaseFile();\n Log.i(\"AsyncTask\", \"database file updated\");\n finished = true;\n }\n });\n customWait();\n }", "public void setNegativePermissions();", "Integer deleteByRoleAndPermission(@Param(\"roleId\") Integer roleId,\n @Param(\"permissionId\") Integer permissionId);", "@Test\n public void revokeRequested() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n /*\n * When\n */\n DatasetGrant revoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(revoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "void deleteLevel(int level) throws IllegalArgumentException;", "@Override\r\n\tpublic void deleSysPrivilege(SysPrivilege sysPrivilege) {\n\t\tsysPrivilegeDao.delete(sysPrivilege);\r\n\t}", "@Override\r\n\tpublic void deleteRole(Role role) {\n\t\tgetHibernateTemplate().delete(role);\r\n\t}", "@Override\n\tpublic void deleteUserRole(UserDto userDto, RoleDto role) {\n\t\t\n\t}", "int deleteByPrimaryKey(TawRoleDomainKey key);", "@Override\r\n\tpublic void deleteMenmberMode(MenmberMode menmberMode) {\n\t\tgetHibernateTemplate().delete(menmberMode);\r\n\t}", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "int deleteByExample(UUserRoleExample example);", "@Override\r\n\tpublic int deleteRoleandPermission(int roleid, int permissionid) {\n\t\treturn adminRoleandpermissionDao.deleteByPrimaryKey(roleid, permissionid);\r\n\t}", "int deleteByPrimaryKey(Integer roleResId);", "int deleteByExample(SystemRoleUserMapperExample example);", "@Override\n\tpublic void removeGamePlayRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "@Override\r\n\tpublic int editRolePermission(RolePermission rolePermission) {\n\t\treturn rolePermissionMapper.updateByPrimaryKeySelective(rolePermission);\r\n\t}", "@Override\n\tpublic void deleteRole(MaintenanceDTO dto) {\n\t\tmd.deleteRole(dto);\n\t}", "public void removeModerateRight(Moderator moderator) throws ServiceException{\n }", "void exitPermission() throws RemoteException;", "public TableRole getTableRole();", "public void deleteIndividualAcl(Individual i);", "int updateByPrimaryKeySelective(Permission record);", "int updateByPrimaryKeySelective(SysRoleUser record);", "@Override\n\tpublic void removeGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "@Test\n public void revokeApproved() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant revoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(revoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "void resetRuntimePermissions(@NonNull AndroidPackage pkg,\n @UserIdInt int userId);", "int deleteByExample(RoleSystemauthorityExample example);", "@Override\n protected String requiredDeletePermission() {\n return \"admin\";\n }", "int deleteByExample(UserRoleExample example);" ]
[ "0.65073824", "0.63034195", "0.6202743", "0.61666495", "0.6147576", "0.61054677", "0.5973677", "0.59040105", "0.58650655", "0.5792938", "0.57462656", "0.5707786", "0.565", "0.56242687", "0.56081146", "0.5571606", "0.54658884", "0.54442465", "0.54293114", "0.5370701", "0.5358474", "0.5350146", "0.5327825", "0.5321039", "0.530931", "0.5305665", "0.5264483", "0.522892", "0.5223184", "0.52220064", "0.521495", "0.5214202", "0.51762974", "0.5149598", "0.5137137", "0.5133303", "0.51190627", "0.5115775", "0.50909925", "0.50868183", "0.5077953", "0.5077354", "0.50752074", "0.5066341", "0.50553817", "0.5046349", "0.5014802", "0.5011553", "0.50089884", "0.50089884", "0.49987456", "0.49590716", "0.4940404", "0.4938781", "0.49367815", "0.49190548", "0.4893401", "0.48762813", "0.48696697", "0.48548353", "0.48522872", "0.4850676", "0.48494983", "0.48248675", "0.48152855", "0.4797699", "0.4792863", "0.47870386", "0.47865498", "0.47858807", "0.47851276", "0.47813708", "0.47787258", "0.4778578", "0.47697514", "0.47666538", "0.47647792", "0.4762341", "0.4762103", "0.4760819", "0.47584775", "0.4756261", "0.47457913", "0.47426644", "0.47292387", "0.47268498", "0.47264892", "0.4722793", "0.47210225", "0.47094277", "0.47053084", "0.4701415", "0.4691565", "0.46634617", "0.46602723", "0.4655894", "0.46546802", "0.46532616", "0.46526355", "0.4650978" ]
0.6860742
0
Revokes a tablelevel permission from a user or role.
public RevokePermissionTableResponse revokePermissionTable(String name, String permission, String tableName, Map<String, String> options) throws GPUdbException { RevokePermissionTableRequest actualRequest_ = new RevokePermissionTableRequest(name, permission, tableName, options); RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse(); submitRequest("/revoke/permission/table", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RevokePermissionTableResponse revokePermissionTable(RevokePermissionTableRequest request) throws GPUdbException {\n RevokePermissionTableResponse actualResponse_ = new RevokePermissionTableResponse();\n submitRequest(\"/revoke/permission/table\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void revokePermission(Permission permission) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "@Override\n\tpublic void revoke(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public void revokePermission(Permission permission, Role role) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_ROLE_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.setString(3, role.getId());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void declinePermission(String objectId, User user) throws UserManagementException;", "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "public void removePermission(T object, Permission permission, User user);", "public void revokePermission(String permissionID) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_PERMISSION_ID_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permissionID);\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void revokeRole(String roleName, User user) throws UserManagementException;", "public void supprimerRole(Long idRoUt);", "void revokeDbObject(Object dbobject) {\n rightsMap.remove(dbobject);\n }", "void revoke(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n == 0) {\n return;\n }\n\n rights = n & (GranteeManager.ALL - rights);\n\n if (rights == 0) {\n rightsMap.remove(dbobject);\n } else {\n rightsMap.put(dbobject, rights);\n }\n }", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "public synchronized void revokeAdminPrivilege(Integer userId) {\n revokeAdminPrivilege(userDAO.findByPK(userId));\n }", "public RevokePermissionSystemResponse revokePermissionSystem(RevokePermissionSystemRequest request) throws GPUdbException {\n RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse();\n submitRequest(\"/revoke/permission/system\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delPermission(int id) {\n\t\treturn 0;\r\n\t}", "public void revoke() {\n WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mObject);\n }", "public abstract void revokeModerator(String nickname);", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "public void revokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject);", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Delete({\n \"delete from A_USER_ROLE\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);", "public int deleteAllPermissions() throws DAOException;", "public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException {\n RevokeRoleResponse actualResponse_ = new RevokeRoleResponse();\n submitRequest(\"/revoke/role\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void deleteRole(long id) {\n\t\t\n\t}", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "private void deleteRoleAccess(Role inheritFromToDelete,\n List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n String inheritFromId = inheritFromToDelete.getId();\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled ih : roleAccessList) {\n String inheritedFromId = ih.getInheritedFrom() != null ? ih.getInheritedFrom().getId() : \"\";\n if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {\n iaeToDelete.add(ih);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n Role owner = injector.getRole(iae);\n if (!owner.isTemplate()) {\n // Perform this operation for not template roles, because for template roles is already\n // done\n // in the event handler\n injector.removeReferenceInParentList(iae);\n }\n OBDal.getInstance().remove(iae);\n }\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "@Override\n\tpublic void deleteRolemenuByRoleId(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from menurole where roleid=?\",roleid);\n\t}", "public void revokeAccess(CommandSender sender, String[] args) {\n if (sender instanceof Player && ( ((Player) sender).hasPermission(\"mf.revokeaccess\") || ((Player) sender).hasPermission(\"mf.default\")) ) {\n\n Player player = (Player) sender;\n\n if (args.length > 1) {\n if (args[1].equalsIgnoreCase(\"cancel\")) {\n if (main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.remove(player.getName());\n player.sendMessage(ChatColor.GREEN + \"Cancelled!\");\n return;\n }\n }\n }\n else {\n player.sendMessage(ChatColor.RED + \"Usage: /mf revokeaccess (player-name)\");\n return;\n }\n\n if (!main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.put(player.getName(), args[1]);\n player.sendMessage(ChatColor.GREEN + \"Right click a locked block to revoke this player's access to it! Type '/mf revokeaccess cancel' to cancel!\");\n }\n else {\n player.sendMessage(ChatColor.RED + \"You have already entered this command! Type '/mf revokeaccess cancel' to cancel!\");\n }\n\n }\n\n }", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "public void revoke();", "@Override\n\t@TriggersRemove(cacheName=\"baseCache\",when=When.AFTER_METHOD_INVOCATION,removeAll=true)\n\tpublic int deleteByRole(Integer roleid) {\n\t\treturn permissionRoleMapper.deleteByRole(roleid);\n\t}", "int deleteByExample(TUserPermissionExample example);", "int deleteByPrimaryKey(Long permsId);", "List<MenuPermissionEntity> deleteByUserGroup(UserGroupEntity userGroup);", "@Override\r\n\tpublic void deleSysPrivilege(Long id) {\n\t\tsysPrivilegeDao.deleteByKey(id);\r\n\t}", "void remove(User user) throws AccessControlException;", "public int deleteByPrimaryKey(String id) {\n\t\tUserPermission key = new UserPermission();\n\t\tkey.setId(id);\n\t\tint rows = getSqlMapClientTemplate().delete(\n\t\t\t\t\"userpermission.deleteByPrimaryKey\", key);\n\t\treturn rows;\n\t}", "public void delete(SecRole entity);", "public boolean removePermission(Permission permission);", "private void removePolicy(){\n\texcludedPermissions = null;\n\tuncheckedPermissions = null;\n\trolePermissionsTable = null;\n\tremovePolicyFile(true);\n\tremovePolicyFile(false);\n\tremovePolicyContextDirectory();\n\tinitLinkTable();\n\tpolicy = null;\n\twriteOnCommit = true;\n }", "int deleteByPrimaryKey(T00RolePostKey key);", "public void removeSysRole(final Long roleId);", "public void removeAdminOnIndividualFromSystemUser(Individual i, SystemUser user);", "void deleteAllAccesses(Role role) {\n for (AccessTypeInjector accessType : getAccessTypeOrderByPriority(true)) {\n List<? extends InheritedAccessEnabled> roleAccessList = accessType.getAccessList(role);\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled iae : roleAccessList) {\n // Not inherited accesses should not be deleted\n if (iae.getInheritedFrom() != null) {\n iaeToDelete.add(iae);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n accessType.clearInheritFromFieldInChilds(iae, true);\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n OBDal.getInstance().remove(iae);\n }\n }\n OBDal.getInstance().commitAndClose();\n }", "void removeRole(String id) throws DataException;", "int deleteByPrimaryKey(Integer roleId);", "int deleteByPrimaryKey(Integer roleId);", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "int deleteByExample(SysRoleDOExample example);", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "public void removeEditorRoleFromIndividualAcl(Individual i);", "public RevokePermissionSystemResponse revokePermissionSystem(String name, String permission, Map<String, String> options) throws GPUdbException {\n RevokePermissionSystemRequest actualRequest_ = new RevokePermissionSystemRequest(name, permission, options);\n RevokePermissionSystemResponse actualResponse_ = new RevokePermissionSystemResponse();\n submitRequest(\"/revoke/permission/system\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void deletRole(int id) {\n\trolesDao.deleteById(id);\n\t}", "@Test\n public void revokeRevoked() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant firstRevoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n DatasetGrant secondRevoked = firstRevoked.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(firstRevoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n })\n .isEqualTo(secondRevoked);\n }", "@Override\r\n\tpublic void deletePsermission(Permission permission) {\n\t\tpermissionDao.deletePsermission(permission);\r\n\t}", "public void deletePrivilege(Privilege p) {\n\n Session session = ConnectionFactory.getInstance().getSession();\n\n Transaction tx = null;\n\n try {\n\n tx = session.beginTransaction();\n\n session.delete(p);\n tx.commit();\n } catch (HibernateException e) {\n try {\n tx.rollback(); //error\n } catch (HibernateException he) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n }", "@Override\n\tpublic void delete(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from role where id=?\",roleid);\n\t}", "void stopShellPermissionIdentityDelegation();", "@Override\n public void clearPermissions(Class<? extends AeroCommandBase<?>> command) {\n permissions.remove(command);\n }", "public void removeByApproved(boolean approved)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "int deleteByExample(MyUserRoleRelationExample example);", "public void removeViewRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_viewRole);\r\n }", "public abstract void revokeMembership(String nickname);", "@Override\n\tpublic Integer delete(Integer id) {\n\t\treturn roleDao.delete(id);\n\t}", "public void removeRole(String roleName) throws UnsupportedOperationException;", "@Override\n\tpublic int deleteRoleInfo(int roleid) throws Exception {\n\t\tDBContextHolder.setDBType(\"0\");\n\t\treturn froleMapper.deleteRoleInfo(roleid);\n\t}", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "public void revokePermissionsFor(String userName, String fileName) throws InterruptedException {\n Log.i(\"revokePermissionsFor\",\n \"About to revoke permissions for \" + userName + \" on file \" + fileName);\n String userPublicKey = getUserKeyFromUserName(userName);\n Log.i(\"revokePermissionsFor\", \"About to revoke permissions for \" + userPublicKey);\n database.delete(\"FileKeys\", \"UserPublicKey = ? AND File = ?\", new String[]{\n userPublicKey, fileName\n });\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n updateDatabaseFile();\n Log.i(\"AsyncTask\", \"database file updated\");\n finished = true;\n }\n });\n customWait();\n }", "public void setNegativePermissions();", "Integer deleteByRoleAndPermission(@Param(\"roleId\") Integer roleId,\n @Param(\"permissionId\") Integer permissionId);", "@Test\n public void revokeRequested() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n /*\n * When\n */\n DatasetGrant revoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(revoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "void deleteLevel(int level) throws IllegalArgumentException;", "@Override\r\n\tpublic void deleSysPrivilege(SysPrivilege sysPrivilege) {\n\t\tsysPrivilegeDao.delete(sysPrivilege);\r\n\t}", "@Override\r\n\tpublic void deleteRole(Role role) {\n\t\tgetHibernateTemplate().delete(role);\r\n\t}", "@Override\n\tpublic void deleteUserRole(UserDto userDto, RoleDto role) {\n\t\t\n\t}", "int deleteByPrimaryKey(TawRoleDomainKey key);", "@Override\r\n\tpublic void deleteMenmberMode(MenmberMode menmberMode) {\n\t\tgetHibernateTemplate().delete(menmberMode);\r\n\t}", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "int deleteByExample(UUserRoleExample example);", "@Override\r\n\tpublic int deleteRoleandPermission(int roleid, int permissionid) {\n\t\treturn adminRoleandpermissionDao.deleteByPrimaryKey(roleid, permissionid);\r\n\t}", "int deleteByPrimaryKey(Integer roleResId);", "int deleteByExample(SystemRoleUserMapperExample example);", "@Override\n\tpublic void removeGamePlayRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "@Override\r\n\tpublic int editRolePermission(RolePermission rolePermission) {\n\t\treturn rolePermissionMapper.updateByPrimaryKeySelective(rolePermission);\r\n\t}", "@Override\n\tpublic void deleteRole(MaintenanceDTO dto) {\n\t\tmd.deleteRole(dto);\n\t}", "public void removeModerateRight(Moderator moderator) throws ServiceException{\n }", "void exitPermission() throws RemoteException;", "public TableRole getTableRole();", "public void deleteIndividualAcl(Individual i);", "int updateByPrimaryKeySelective(Permission record);", "int updateByPrimaryKeySelective(SysRoleUser record);", "@Override\n\tpublic void removeGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "@Test\n public void revokeApproved() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant revoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(revoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "void resetRuntimePermissions(@NonNull AndroidPackage pkg,\n @UserIdInt int userId);", "int deleteByExample(RoleSystemauthorityExample example);", "@Override\n protected String requiredDeletePermission() {\n return \"admin\";\n }", "int deleteByExample(UserRoleExample example);" ]
[ "0.6860742", "0.63034195", "0.6202743", "0.61666495", "0.6147576", "0.61054677", "0.5973677", "0.59040105", "0.58650655", "0.5792938", "0.57462656", "0.5707786", "0.565", "0.56242687", "0.56081146", "0.5571606", "0.54658884", "0.54442465", "0.54293114", "0.5370701", "0.5358474", "0.5350146", "0.5327825", "0.5321039", "0.530931", "0.5305665", "0.5264483", "0.522892", "0.5223184", "0.52220064", "0.521495", "0.5214202", "0.51762974", "0.5149598", "0.5137137", "0.5133303", "0.51190627", "0.5115775", "0.50909925", "0.50868183", "0.5077953", "0.5077354", "0.50752074", "0.5066341", "0.50553817", "0.5046349", "0.5014802", "0.5011553", "0.50089884", "0.50089884", "0.49987456", "0.49590716", "0.4940404", "0.4938781", "0.49367815", "0.49190548", "0.4893401", "0.48762813", "0.48696697", "0.48548353", "0.48522872", "0.4850676", "0.48494983", "0.48248675", "0.48152855", "0.4797699", "0.4792863", "0.47870386", "0.47865498", "0.47858807", "0.47851276", "0.47813708", "0.47787258", "0.4778578", "0.47697514", "0.47666538", "0.47647792", "0.4762341", "0.4762103", "0.4760819", "0.47584775", "0.4756261", "0.47457913", "0.47426644", "0.47292387", "0.47268498", "0.47264892", "0.4722793", "0.47210225", "0.47094277", "0.47053084", "0.4701415", "0.4691565", "0.46634617", "0.46602723", "0.4655894", "0.46546802", "0.46532616", "0.46526355", "0.4650978" ]
0.65073824
1
Revokes membership in a role from a user or role.
public RevokeRoleResponse revokeRole(RevokeRoleRequest request) throws GPUdbException { RevokeRoleResponse actualResponse_ = new RevokeRoleResponse(); submitRequest("/revoke/role", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void revokeRole(String roleName, User user) throws UserManagementException;", "public void removeRole(String roleName) throws UnsupportedOperationException;", "@Override\n\tpublic void revoke(User subject, Permission permission)\n\t{\n\t\t//TODO figure out how to implement since we're using role based permissions\n\t}", "public void revokeRole(String role, boolean recursive) {\n\t\tif (path != null) {\n\t\t\tMain.get().securityPopup.status.setFlag_update();\n\t\t\tauthService.revokeRole(path, role, recursive, callbackRevokeRole);\n\t\t}\n\t}", "private void onRemoveRole() {\n\t\troleProxy.removeRoleFromUser(user, selectedRole);\n\t}", "public void revoke(String role) throws HsqlException {\n Trace.check(hasRoleDirect(role), Trace.DONT_HAVE_ROLE, role);\n roles.remove(role);\n }", "public void supprimerRole(Long idRoUt);", "public void delRole( String role )\n {\n if ( this.roles != null )\n {\n this.roles.remove( role );\n }\n }", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "public void revokePermission(Permission permission, Role role) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_BY_ROLE_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.setString(3, role.getId());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "void removeRole(String id) throws DataException;", "@Override\n\tpublic void deleteRole(long id) {\n\t\t\n\t}", "public void removeSysRole(final Long roleId);", "void changeRole(User user, Role role, String token) throws AuthenticationException;", "public void deletRole(int id) {\n\trolesDao.deleteById(id);\n\t}", "public void removeRole(String roleName) throws UnsupportedOperationException {\r\n log.debug(\"User [ Anonymous ] has no roles\");\r\n }", "public abstract void revokeMembership(String nickname);", "public void removeRole(Role role) {\n if (this.roles.contains(role)) {\n this.roles.remove(role);\n }\n }", "@Test\n public void removeRole() throws Exception {\n\n doReturn(role).when(roleRepository).findOne(anyLong());\n doAnswer(invocationOnMock -> users).when(userRepository).findUsersByRolesContains(any(Role.class));\n doAnswer(invocationOnMock -> users).when(userRepository).save(any(List.class));\n doNothing().when(roleRepository).delete(any(Role.class));\n\n boolean result = roleService.removeRole(anyLong());\n\n Assert.assertTrue(\"Remove role failed\", result);\n }", "public IBusinessObject removeFromRole(IIID useriid, IIID roleiid, boolean recurse)\n throws OculusException;", "void removeIsPerformOf(Role oldIsPerformOf);", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "@Override\n\tpublic void delRole(String roleid) {\n\t\troleMapper.delRole(roleid);\n\t}", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "public abstract void revokeModerator(String nickname);", "public void removeViewRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_viewRole);\r\n }", "public void declinePermission(String objectId, User user) throws UserManagementException;", "@Override\n\tpublic void deleteUserRole(UserDto userDto, RoleDto role) {\n\t\t\n\t}", "void deleteRole(UserRole role) {\n\t\tuserRoleRepository.delete(role.getId());\n\t}", "public boolean removeSupportRole(Role ... r) {\n\t\tif (getGuild() == null || r == null) { return false; }\n\t\tfor (Role role : r) { if (role.getGuild().equals(getGuild())) supportRoles.remove(role); }\n\t\tconfig.save();\n\t\tif (!config.isLoading()) { TMEventManager.departmentChange(this, ChangeType.Dept.ROLES); }\n\t\treturn true;\n\t}", "public void removeRole(String roleName)\n\tthrows PolicyContextException{\n\n assertStateIsOpen();\n\n\tassert roleName != null;\n\n\tif(roleName != null && rolePermissionsTable != null) {\n\t checkSetPolicyPermission();\n\t if (rolePermissionsTable.remove(roleName) != null) {\n\t\tif (rolePermissionsTable.isEmpty()) {\n\t\t rolePermissionsTable = null;\n\t\t}\n\t\twriteOnCommit = true;\n\t } else if (roleName.equals(\"*\")) {\n\t\tboolean wasEmpty = rolePermissionsTable.isEmpty();\n\t\tif (!wasEmpty) {\n\t\t rolePermissionsTable.clear();\n\t\t}\n\t\trolePermissionsTable = null;\n\t\tif (!wasEmpty) {\n\t\t writeOnCommit = true;\n\t\t}\n\t }\n\t}\n }", "public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearRole() {\n role = null;\n fieldSetFlags()[6] = false;\n return this;\n }", "@Override\r\n\tpublic boolean deleteRole(Long id) {\n\t\tdeleteById(id);\r\n\t\treturn true;\r\n\t}", "public IBusinessObject removeFromRole(IIID useriid, IIID roleiid)\n throws OculusException;", "LoggedUser changeRole(String roleId) throws IOException;", "public void onGuildMemberRoleRemove(GuildMemberRoleRemoveEvent e) {\n\t\tif(e.getMember().getUser().isBot() == false) {\n\t\t\tFunctions funcao = new Functions(e);\n\t\t\ttry {\n\t\t\tfuncao.cargoRemovido();\n\t\t\t}catch(StringIndexOutOfBoundsException exception) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@PreRemove\n private void removeRolesFromUsers() {\n for (User user : users) {\n user.getRoles().remove(this);\n }\n }", "@Override\n\tpublic void deleteRole(MaintenanceDTO dto) {\n\t\tmd.deleteRole(dto);\n\t}", "public void removeEditorRoleFromIndividualAcl(Individual i);", "public void removeRole(Role role) {\n\t\tif (role.parentRole != null) {\n\t\t\trole.parentRole.subRoles.remove(role);\n\t\t\trole.parentRole = null;\n\t\t}\n\t}", "@Override\n\tpublic void removeGamePlayRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "@Override\r\n\tpublic void deleteRole(Role role) {\n\t\tgetHibernateTemplate().delete(role);\r\n\t}", "UserGroup removeMember(String companyId, String name, String memberEmail);", "public void revoke();", "@Override\n\tpublic void deleteRole(int id) {\n\t\tthis.roleMapper.deleteByPrimaryKey(id);\n\t}", "private void deleteRoleAccess(Role inheritFromToDelete,\n List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n String inheritFromId = inheritFromToDelete.getId();\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled ih : roleAccessList) {\n String inheritedFromId = ih.getInheritedFrom() != null ? ih.getInheritedFrom().getId() : \"\";\n if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {\n iaeToDelete.add(ih);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n Role owner = injector.getRole(iae);\n if (!owner.isTemplate()) {\n // Perform this operation for not template roles, because for template roles is already\n // done\n // in the event handler\n injector.removeReferenceInParentList(iae);\n }\n OBDal.getInstance().remove(iae);\n }\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "public void removePermission(T object, Permission permission, User user);", "public void removeAdminOnIndividualFromSystemUser(Individual i, SystemUser user);", "public PeerRole planToRemoveChannelPeerRoleListWithNode(PeerRole peerRole, String nodeId, Map<String,Object> options)throws Exception;", "void remove(User user) throws AccessControlException;", "public void execute() {\n TerroristAgent agent = (TerroristAgent)((TNSRole)oldRole).getAgent();\n Hashtable relationshipTable = agent.getRelationshipTable();\n String relationshipName = null;\n Vector relationshipNames = ((TNSRole)oldRole).getRelationships();\n Iterator i = relationshipNames.iterator();\n while (i.hasNext()) {\n relationshipName = (String)i.next();\n Object temp = relationshipTable.get(relationshipName);\n if (temp instanceof Vector) {\n Vector removeRelationships = (Vector)temp;\n Vector copyOfRelationshipVector = new Vector();\n Iterator i2 = removeRelationships.iterator();\n while (i2.hasNext()) {\n Relationship r = (Relationship)i2.next();\n copyOfRelationshipVector.add(r);\n } // end while\n i2 = copyOfRelationshipVector.iterator();\n while (i2.hasNext()) {\n Relationship removeRelationship = (Relationship)i2.next();\n // System.out.println(\"Attempting to remove \" + agent.getEntityName() + \" from relationship \" + removeRelationship.toString());\n if (removeRelationship.getMembers().contains(agent)) {\n removeRelationship.removeAgent(agent);\n } else {\n // System.out.println(\"Not in this relationship.\");\n } // end if-else\n } // end while\n /* System.out.println(\"Remaining relationships\");\n i2 = removeRelationships.iterator();\n while (i2.hasNext()) {\n Relationship r = (Relationship)i2.next();\n System.out.println(r.toString());\n } // end while*/\n relationshipTable.remove(relationshipName);\n } // end if\n } // end while\n agent.removeRole(oldRole);\n Role addRole = createRole(newRole, agent);\n ((TerroristAgent)agent).addRole(addRole);\n }", "public void delete(SecRole entity);", "public void revokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject);", "protected synchronized void removeRoleProvider(RoleProvider roleProvider) {\n logger.debug(\"Removing {} from the list of role providers\", roleProvider);\n roleProviders.remove(roleProvider);\n }", "public synchronized void revokeAdminPrivilege(Integer userId) {\n revokeAdminPrivilege(userDAO.findByPK(userId));\n }", "@Override\n\tpublic void deleteRole(Integer id) {\n\t\tlogger.debug(\"RoleServiceImpl::deleteRole id = {}\", id);\n\t\troleMapper.deleteRole(id);\n\t}", "public static int removeRoleFromDb(String roleName)\n\t{\t\t\n\t\t//Remove user data from table BSM_USER\n\t\tString sql = String.format(\"DELETE FROM BSM_ROLE WHERE ROLE_NAME='%s'\", roleName);\n\t\tint ret = DBUtil.executeSQL(sql);\n\t\treturn ret;\n\t}", "public void revokeAccess(CommandSender sender, String[] args) {\n if (sender instanceof Player && ( ((Player) sender).hasPermission(\"mf.revokeaccess\") || ((Player) sender).hasPermission(\"mf.default\")) ) {\n\n Player player = (Player) sender;\n\n if (args.length > 1) {\n if (args[1].equalsIgnoreCase(\"cancel\")) {\n if (main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.remove(player.getName());\n player.sendMessage(ChatColor.GREEN + \"Cancelled!\");\n return;\n }\n }\n }\n else {\n player.sendMessage(ChatColor.RED + \"Usage: /mf revokeaccess (player-name)\");\n return;\n }\n\n if (!main.playersRevokingAccess.containsKey(player.getName())) {\n main.playersRevokingAccess.put(player.getName(), args[1]);\n player.sendMessage(ChatColor.GREEN + \"Right click a locked block to revoke this player's access to it! Type '/mf revokeaccess cancel' to cancel!\");\n }\n else {\n player.sendMessage(ChatColor.RED + \"You have already entered this command! Type '/mf revokeaccess cancel' to cancel!\");\n }\n\n }\n\n }", "void revoke(Object dbobject, int rights) {\n\n if (rights == 0) {\n return;\n }\n\n int n = rightsMap.get(dbobject, 0);\n\n if (n == 0) {\n return;\n }\n\n rights = n & (GranteeManager.ALL - rights);\n\n if (rights == 0) {\n rightsMap.remove(dbobject);\n } else {\n rightsMap.put(dbobject, rights);\n }\n }", "public void removeDocumenterRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_documenterRole);\r\n }", "@Override\r\n\tpublic int updRole(Role role) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void removeMember(User user) throws Exception {\n\n\t}", "public synchronized void demoteAdmin(User user) throws AmbariException {\n removeRoleFromUser(user, getAdminRole());\n }", "public void clearSupportRoles() {\n\t\tsupportRoles.clear();\n\t\tconfig.save();\n\t\tif (!config.isLoading()) { TMEventManager.departmentChange(this, ChangeType.Dept.ROLES); }\n\t}", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@Override\n\tpublic void editRole(Role role) {\n\t\trd.editRole(role);\n\t}", "@Override\n\tpublic void deleteRolemenuByRoleId(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from menurole where roleid=?\",roleid);\n\t}", "@Override\r\n\tpublic int deleteRole(int roleid) {\n\t\treturn adminRoleDao.deleteByPrimaryKey(roleid);\r\n\t}", "boolean unblockUser(User user);", "@Override\r\n\tpublic void cancelRole(String idList, String companyId) {\n\t\t\r\n\t}", "public void revokePermission(Permission permission) {\n Connection conn = null;\n PreparedStatement ps = null;\n String query = null;\n try {\n conn = getConnection();\n query = queryManager.getQuery(conn, QueryManager.REVOKE_PERMISSION_QUERY);\n conn.setAutoCommit(false);\n ps = conn.prepareStatement(query);\n ps.setString(1, permission.getAppName());\n ps.setString(2, permission.getPermissionString());\n ps.execute();\n conn.commit();\n } catch (SQLException e) {\n log.debug(\"Failed to execute SQL query {}\", query);\n throw new PermissionException(\"Unable to revoke permission.\", e);\n } finally {\n closeConnection(conn, ps, null);\n }\n }", "public PeerRole planToRemoveChannelPeerRoleListWithChannel(PeerRole peerRole, String channelId, Map<String,Object> options)throws Exception;", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "int deleteByPrimaryKey(Integer roleId);", "int deleteByPrimaryKey(Integer roleId);", "UserGroup removeMember(String companyId, String name, String memberEmail, boolean isGroupLead);", "public void resetCurrentRole(String role) throws ProcessManagerException {\r\n if (role != null && role.length() > 0)\r\n this.currentRole = role;\r\n \r\n resetCreationRights();\r\n resetProcessFilter();\r\n resetCurrentProcessList();\r\n resetCurrentProcessListHeaders();\r\n }", "@Override\n\tpublic void removeGameRoomManagementRights(RevocableToken adminToken,\n\t\t\tGameUId gameuid, AccountUId accountuid)\n\t\t\tthrows RevokedTokenException, InvalidAccountUIdException,\n\t\t\tRightsManagementException {\n\n\t}", "@Override\n\tpublic void delete(UserRole vo) {\n\n\t}", "private void deleteMembership(User user, Chatroom chatroom) {\n\t\tList<Chatroom> chatrooms = user.getMemberOfChatrooms();\n\t\tList<User> users = chatroom.getMembers();\n\t\tList<Membership> memberships = user.getMemberships();\n\t\t// if the user has received invite\n\t\tif (isMember(user, chatroom)) {\n\t\t\t// delete the relation\n\t\t\tchatrooms.remove(chatroom);\n\t\t\tusers.remove(user);\n\t\t\t// delete the membership\n\t\t\t// delete the membership\n\t\t\tfor (Membership m : memberships) {\n\t\t\t\tif (m.getChatroom() == chatroom) {\n\t\t\t\t\tmemberships.remove(m);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// save the chatroom, and update its relations\n\t\t\tchatroomRepository.save(chatroom);\n\t\t}\n\t}", "int deleteByExample(SysRoleDOExample example);", "VerbRole getRole();", "int deleteByPrimaryKey(Integer roleResId);", "@Override\n\tpublic void deleteRoleUtilisateur(Integer idR) {\n\t\troleUtilisateurDAO.deleteRoleUtilsiateur(idR);\n\t}", "@Override\n\t@TriggersRemove(cacheName=\"baseCache\",when=When.AFTER_METHOD_INVOCATION,removeAll=true)\n\tpublic int deleteByRole(Integer roleid) {\n\t\treturn permissionRoleMapper.deleteByRole(roleid);\n\t}", "void unblock(User user) throws RepositoryException;", "public void removeProjectRoleTermsOfUse(int projectId, int resourceRoleId, long termsOfUseId, int groupIndex)\r\n throws EntityNotFoundException, TermsOfUsePersistenceException;", "@Override\n\tpublic Integer delete(Integer id) {\n\t\treturn roleDao.delete(id);\n\t}", "private static void remove(final String username, final Role role, final String relPath)\n\t{\n\t\tif (username != null && username2accesses.containsKey(username))\n\t\t{\n\t\t\tfinal List<Access> accesses = username2accesses.get(username);\n\t\t\tfor (int i = 0; i < accesses.size(); i++)\n\t\t\t{\n\t\t\t\tfinal String dbUsername = accesses.get(i).getUsername();\n\t\t\t\tfinal Role dbRole = accesses.get(i).getRole();\n\t\t\t\tfinal String dbRelPath = accesses.get(i).getRelPath();\n\t\t\t\tif (dbUsername.equals(username) && dbRole.equals(role) && dbRelPath.equals(relPath))\n\t\t\t\t{\n\t\t\t\t\taccesses.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//--- if accesses length is zero, the username (key) can be removed from the hash map ---//\n\t\t\tif (accesses.size() > 0) username2accesses.replace(username, accesses);\n\t\t\telse username2accesses.remove(username);\n\t\t}\n\t}", "@Test\n public void revokeRevoked() {\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant = DatasetGrant.createApproved(\n uid, user, privilege,\n executor, granted, Markdown.lorem());\n\n /*\n * When\n */\n DatasetGrant firstRevoked = grant.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n DatasetGrant secondRevoked = firstRevoked.revoke(UserId.random(), Instant.now(), Markdown.lorem());\n\n /*\n * Then\n */\n assertThat(firstRevoked)\n .as(\"The request is closed and not active after it is revoked\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n })\n .isEqualTo(secondRevoked);\n }", "void revokeDbObject(Object dbobject) {\n rightsMap.remove(dbobject);\n }", "@Override\n public void removeUser(Project project, Developer developer) {\n TracCommand removeUserFromRoleCommand = new TracRemoveUserFromRoleCommand(configuration, developer.getId(), project);\n TracCommand removeUserCommand = new TracRemoveUserCommand(developer, configuration, project);\n try {\n executor.addCommand(removeUserFromRoleCommand);\n executor.addCommand(removeUserCommand);\n success = executor.executeBatch();\n } catch (Exception e) {\n // TODO Auto-generated catch block\n logger.error(e.getMessage(), e);\n }\n }", "void removeMember(Item item) throws AccessManagementException;", "@Override\r\n\tpublic void updateRole(Role role) {\n\t\troleDao.updateRole(role);\r\n\t}", "public void revokeOffer(OfferMgmtVO offerMgmtVO) throws MISPException {\n\n\t\tlogger.entering(\"revokeOffer\", offerMgmtVO);\n\n\t\ttry {\n\n\t\t\tthis.customerSubsManager.revokeOffer(offerMgmtVO);\n\n\t\t} catch (DBException exception) {\n\t\t\tlogger.error(\"An exception occured while revoking Offer.\",\n\t\t\t\t\texception);\n\t\t\tthrow new MISPException(exception);\n\n\t\t}\n\n\t\tlogger.exiting(\"revokeOffer\");\n\n\t}", "public void deleteUserRole(UserRole userRole) throws ClassNotFoundException, SQLException {\n\t\tsave(\"delete from user_role where id = ?\", new Object[] { userRole.getId() });\n\t}", "void removeMember(final PartyMember member);", "public void removeTeamMember(final Artifact artifact);" ]
[ "0.73907965", "0.66951925", "0.6592869", "0.65347254", "0.653382", "0.6482568", "0.6337995", "0.62517977", "0.6238532", "0.6218036", "0.62153965", "0.62116545", "0.6130652", "0.61120725", "0.6098708", "0.6094198", "0.6061421", "0.60484755", "0.6047952", "0.60305715", "0.59963894", "0.59894407", "0.59745276", "0.59315807", "0.5928359", "0.5898049", "0.5842432", "0.57784176", "0.57724315", "0.57596755", "0.57546896", "0.57223797", "0.57163596", "0.56927425", "0.56856674", "0.5650423", "0.5641662", "0.56314737", "0.56183696", "0.5610079", "0.5606991", "0.56053275", "0.55971014", "0.5574385", "0.55695945", "0.5559914", "0.5556911", "0.55468273", "0.5533145", "0.55302376", "0.5518421", "0.5481789", "0.5458619", "0.54569614", "0.54206616", "0.5419089", "0.5404034", "0.5397765", "0.5392416", "0.5391896", "0.5379105", "0.5373881", "0.5372889", "0.5364077", "0.53542286", "0.53530043", "0.53515935", "0.53443384", "0.53254515", "0.53238755", "0.53115207", "0.5309973", "0.5306544", "0.53033274", "0.53028274", "0.5299856", "0.5299856", "0.52975696", "0.52964926", "0.5272172", "0.527089", "0.5252246", "0.5226232", "0.52034074", "0.51995194", "0.51937234", "0.51907074", "0.5190244", "0.5189858", "0.5189556", "0.51819307", "0.517822", "0.5174498", "0.5171731", "0.51612276", "0.5145134", "0.5140438", "0.5132858", "0.5122291", "0.510429" ]
0.65978116
2
Shows information about a proc.
public ShowProcResponse showProc(ShowProcRequest request) throws GPUdbException { ShowProcResponse actualResponse_ = new ShowProcResponse(); submitRequest("/show/proc", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void p_show_info_program() {\n System.out.println(\"╔══════════════════════════════╗\");\n System.out.println(\"║ SoftCalculator V1.2 ║\");\n System.out.println(\"║ Oscar Javier Cardozo Diaz ║\");\n System.out.println(\"║ 16/04/2021 ║\");\n System.out.println(\"╚══════════════════════════════╝\");\n }", "public void Display() {\n\t\tSystem.out.println(Integer.toHexString(PID) + \"\\t\" + Integer.toString(CreationTime) + \"\\t\"+ Integer.toHexString(CommandCounter) + \"\\t\" + ProcessStatus.toString() \n\t\t+ \"\\t\" + Integer.toString(MemoryVolume) + \"\\t\" + Integer.toHexString(Priority) + \"\\t\" + ((MemorySegments != null)? MemorySegments.toString() : \"null\"));\n\t}", "private void cmdInfoProg() {\n long total = Runtime.getRuntime().totalMemory();\n long free = Runtime.getRuntime().freeMemory();\n NumberFormat nf = NumberFormat.getInstance();\n Log.println(\"(mem: \"\n + NumberFormat.getPercentInstance().format(\n (double) free / (double) total) + \" = \"\n + nf.format(free) + \" bytes free, \" + nf.format(total)\n + \" bytes total)\");\n }", "public void showInformation() {\n\t\tSystem.out.println(\"Title: \" + getTitle());\n\t\tSystem.out.println(\"Time: \" + getTime());\n\t\tSystem.out.println(\"Number: \" + getNumber());\n\t}", "public synchronized void displayPidInfo(int lineNum)\n {\n dashboard.displayPrintf(\n lineNum, \"%s:Target=%.1f,Input=%.1f,Error=%.1f\", instanceName, setPoint, currInput, currError);\n dashboard.displayPrintf(\n lineNum + 1, \"minOutput=%.1f,Output=%.1f,maxOutput=%.1f\", minOutput, output, maxOutput);\n }", "public void getInfo(){\n System.out.println(\"Name: \" + name + \"\\n\" + \"Address: \" + address);\n }", "public void printInfo(){\n\t\tSystem.out.println(\"id : \" + id + \" label : \" + label);\n\t\tSystem.out.println(\"vms : \" );\n\t\tfor(VirtualMachine v : vms){\n\t\t\tv.printInfo();\n\t\t}\n\t}", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "public void info()\n {\n System.out.println(toString());\n }", "public void printPidInfo()\n {\n printPidInfo(null, false, null);\n }", "@Override\n\tpublic String toString() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(ThmProcessUtil.isaActProc + \" \" + name);\n\t\t\n\t\tif (!param.isEmpty()) {\n\t\t\tsb.append (\" = \\n\");\n\t\t\tfor (String s : param) {\n\t\t\t\tsb.append(s + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tsb.append(\"\\n\");\n\t\t\n\t\tsb.append(ThmProcessUtil.isaProcBegin + \"\\n\" + \n\t\t\t\t body + \"\\n\" + ThmProcessUtil.isaProcEnd);\n\n\t\treturn sb.toString();\n\t}", "public void printInfo(){\n\t}", "public void printInfo(){\n\t}", "public static void showMemoryInfo()\r\n\t{ \r\n\t\tRuntime rt = Runtime.getRuntime(); \r\n\t\tpf(\"Maxx : \\t %d Kb\\n\", rt.maxMemory() / 1024); \r\n\t\tpf(\"Free : \\t %d Kb\\n\", rt.freeMemory() / 1024); \r\n\t\tpf(\"Totl : \\t %d Kb\\n\", rt.totalMemory() / 1024); \r\n\t\tpf(\"Used : \\t %d Kb\\n\", (rt.totalMemory()-rt.freeMemory()) / 1024); \r\n\t}", "public abstract void displayInfo();", "void printInfo();", "public void showProcesses() {\n\t\tList<RunningAppProcessInfo> infos=am.getRunningAppProcesses();\n\t\tadapter.clear();\n\t\t\n\t\t\n\t\tProcessesListCellData data;\n\t\t\n\t\tfor (RunningAppProcessInfo info : infos) {\n\t\t\t\n\t\t\tdata=new ProcessesListCellData(this,info);\n\t\t\tif (data.appName!=null&&!data.appName.equals(\"\")) {\n\t\t\t\tadapter.addCellData(data);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tMemoryInfo memInfo=new MemoryInfo();\n\t\tam.getMemoryInfo(memInfo);\n\t\tsetTitle(\"进程管理器,可用内存:\"+memInfo.availMem/1024/1024+\"M\");\n\t}", "public void showInfo(Member member) {\n\n if (member != null) {\n System.out.println(member.getInfo());\n } else {\n System.out.println(\"Felaktigt medlemsnummer\");\n }\n }", "public String doShowProcesses() throws Exception\n\t{\n\t\treturn \"successShowProcesses\";\n\t}", "private void showInfo() {\n JOptionPane.showMessageDialog(\n this,\n \"Пока что никакой\\nинформации тут нет.\\nДа и вряд ли будет.\",\n \"^^(,oO,)^^\",\n JOptionPane.INFORMATION_MESSAGE);\n }", "public void showInfo()\n\t{\n\t\tSystem.out.println(\"Account Number : \"+getAccountNumber());\n\t\tSystem.out.println(\"Balance : \"+getBalance());\n\t\tSystem.out.println(\"Tenure Year : \"+tenureYear);\n\t}", "public String show() {\r\n\t\treturn \"show\";\r\n\t}", "void printInfo(String name) {\n System.out.println(\"Info for \" + name + \": \");\n showStyle();\n showDim();\n System.out.println(\"Area is \" + area());\n }", "public static void printInfo(){\n }", "void show_info() {\n\t\tsetAlwaysOnTop(false);\n\n\t\tString msg = \"<html><ul><li>Shortcuts:<br/>\"\n\t\t\t\t+ \"(\\\") start macro<br/>\"\n\t\t\t\t+ \"(esc) exit<br/><br/>\"\n\t\t\t\t+ \"<li>Author: <b>Can Kurt</b></ul></html>\";\n\n\t\tJLabel label = new JLabel(msg);\n\t\tlabel.setFont(new Font(\"arial\", Font.PLAIN, 15));\n\n\t\tJOptionPane.showMessageDialog(null, label ,\"Info\", JOptionPane.INFORMATION_MESSAGE);\n\n\t\tsetAlwaysOnTop(true);\n\t}", "public void info(){\r\n System.out.println(\"Title : \" + title);\r\n System.out.println(\"Author . \" + author);\r\n System.out.println(\"Location : \" + location);\r\n if (isAvailable){\r\n System.out.println(\"Available\");\r\n }\r\n else {\r\n System.out.println(\"Not available\");\r\n }\r\n\r\n }", "void display() {\r\n\t\tSystem.out.println(id + \" \" + name);\r\n\t}", "public void getInfo() {\n System.out.println(\"Content : \" + content);\n System.out.println(\"Name : \" + name);\n System.out.println(\"Location : (\" + locX + \",\" + locY + \")\");\n System.out.println(\"Weight : \" + String.format(\"%.5f\", weight) + \" kg/day\");\n System.out.println(\"Habitat : \" + habitat);\n System.out.println(\"Type : \" + type);\n System.out.println(\"Diet : \" + diet);\n System.out.println(\"Fodder : \" + String.format(\"%.5f\", getFodder()) + \" kg\");\n System.out.println(tamed ? \"Tame : Yes \" : \"Tame : No \");\n System.out.println(\"Number of Legs : \" + legs);\n }", "public void showInfo(){\n\t\tfor (int i = 0; i < this.cd.size(); i++) {\n\t\t\tthis.cd.get(i).showInfo();\n\t\t}\n\t\tSystem.out.println(\"\\tToatl amount: \" + calTotalAmount());\n\t}", "void display() {\n System.out.println(id + \" \" + name);\n }", "public static void printAdd(Process process) {\n\t\tSystem.out.println(\"Added: \"+ process.getName() + \" of size \" + process.getSize() \n\t\t\t\t\t+ \" and duration \"\t+ process.getDuration()\t);\t\t\n\t}", "@Override\n public String displayInfo() {\n String str = getPluginName() + \"\\n\";\n str += \"Status: \";\n if (isRunning())\n str += \"running\";\n else\n str += \"stop\";\n str += \"\\nPort:\" + params.getUnifyExportPort();\n return str;\n }", "@Override\n\tpublic void showInfo() {\n\t\tSystem.out.println(\"Machine Interface \" + id);\n\t}", "public String showDetails() {\n\t\treturn \"Person Name is : \" + name + \"\\n\" + \"Person Address is : \" + address;\n\t}", "public void printDetails()\n {\n System.out.println(title);\n System.out.println(\"by \" + author);\n System.out.println(\"no. of pages: \" + pages);\n \n if(refNumber == \"\"){\n System.out.println(\"reference no.: zzz\");\n }\n else{\n System.out.println(\"reference no.: \" + refNumber);\n }\n \n System.out.println(\"no. of times borrowed: \" + borrowed);\n }", "public void showInfo() {\n\t\tfor (String key : list.keySet()) {\n\t\t\tSystem.out.println(\"\\tID: \" + key + list.get(key).toString());\n\t\t}\n\t}", "public void printPidInfo(TrcDbgTrace tracer)\n {\n printPidInfo(tracer, false, null);\n }", "public void printInfo() {\r\n System.out.printf(\"%-25s\", \"Nomor Rekam Medis Pasien\");\r\n System.out.println(\": \" + getNomorRekamMedis());\r\n System.out.printf(\"%-25s\", \"Nama Pasien\");\r\n System.out.println(\": \" + getNama());\r\n System.out.printf(\"%-25s\", \"Tempat, Tanggal Lahir\");\r\n System.out.print(\": \" + getTempatLahir() + \" , \");\r\n getTanggalKelahiran();\r\n System.out.printf(\"%-25s\", \"Alamat\");\r\n System.out.println(\": \" + getAlamat());\r\n System.out.println(\"\");\r\n }", "public void showInfo() {\n System.out.println(\"Showtime ID \" + showtimeID + \", Movie title: \" + movieTitle + \", Datetime: \" + dateTime.get(Calendar.YEAR) + \" \" + (dateTime.get(Calendar.MONTH) + 1) + \" \" + dateTime.get(Calendar.DATE) + \" \" + dateTime.get(Calendar.HOUR_OF_DAY) + \" \" + dateTime.get(Calendar.MINUTE));\n }", "public String printInfo()\r\n {\r\n String info;\r\n \r\n info = \"Inputed number = \" + mark;\r\n \r\n return info;\r\n }", "public void printDetails() {\r\n\t\tSystem.out.println(\" \");\r\n\t\tSystem.out.println(showtimeId + \" \" + movie.getTitle() + \" starts at \" + startTime.toString());\r\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"Pasos dados por \" + a.nombre + \" \" + a.distancia + \" m = \" + pasosActividad + \" / Pasos en total = \" + pasosTotal);\n\t}", "void getInfo() {\n\tSystem.out.println(\"My name is \"+name+\" and I am going to \"+school+\" and my grade is \"+grade);\n\t}", "abstract public void printInfo();", "public void display(){\r\n System.out.println(\"The Vacancy Number is : \" + getVacancyNumber());\r\n System.out.println(\"The Designation is : \" + getDesignation());\r\n System.out.println(\"The Job Type is : \" + getJobType());\r\n }", "public void printInformation() {\n\n System.out.println(\"Name: \" + name);\n System.out.println(\"Weight: \" + weight);\n System.out.println(\"Shape: \" + shape);\n System.out.println(\"Color: \" + color);\n }", "public String printInfo() {\n\t\treturn \"\\n=====================================================================\"+\r\n\t\t\t\t\"\\n Gaming Center Information\"+\r\n\t\t\t\t\"\\n=====================================================================\"+\r\n\t\t\t\t\"\\n Gaming center Name \\t= \" + centerName +\r\n\t\t\t\t\"\\n Location \\t\\t= \" + location + \r\n\t\t\t\t\"\\n Contact Number \\t= \" + contact+\r\n\t\t\t\t\"\\n Operating hour \\t= \"+ operatingHour+\r\n\t\t\t\t\"\\n Number of Employee \\t= \"+ noOfEmployee+ \" pax\";\r\n\t}", "public static void shoInfo() {\n\t\tSystem.out.println(description);\n\t \n\t}", "public void showName() {\n\t\tSystem.out.println(\"Object id: \" + id + \", \" + description + \": \" + name);\n\t\t//System.out.println(description);\n\t}", "public synchronized void printPidInfo(TrcDbgTrace tracer, boolean verbose, TrcRobotBattery battery)\n {\n final String funcName = \"printPidInfo\";\n\n if (tracer == null)\n {\n tracer = dbgTrace;\n }\n\n if (tracer != null)\n {\n StringBuilder msg = new StringBuilder();\n\n msg.append(String.format(\n Locale.US, \"[%.3f] %s: Target=%6.1f, Input=%6.1f, Error=%6.1f, Output=%6.3f(%6.3f/%5.3f)\",\n TrcUtil.getModeElapsedTime(), instanceName, setPoint, currInput, currError, output, minOutput,\n maxOutput));\n\n if (verbose)\n {\n msg.append(String.format(\n Locale.US, \", PIDTerms=%6.3f/%6.3f/%6.3f/%6.3f\", pTerm, iTerm, dTerm, fTerm));\n }\n\n if (battery != null)\n {\n msg.append(String.format(Locale.US, \", Volt=%.1f(%.1f)\",\n battery.getVoltage(), battery.getLowestVoltage()));\n }\n\n tracer.traceInfo(funcName, msg.toString());\n }\n }", "@Override\n\tpublic void show() {\n\t\tsuper.show();\n\t\tSystem.out.println(\"task: \"+ task);\n\t}", "public InfoCommand() {\n\n\t\tsuper(\"info\", Command.ArgumentType.NONE, Command.Category.UTILITY);\n\t}", "public void displaySongInfo() {\n\t\tSystem.out.println(\"Track number: \" + this.trackNumber + \"\\n\");\n\t\tSystem.out.println(\"Title: \" + this.songTitle + \"\\n\");\n\t\tSystem.out.println(\"Composer_Name: \" + this.composerName + \"\\n\");\n\t\tSystem.out.println(\"Voices: \" + this.voiceMap.keySet() + \"\\n\");\n\t\tSystem.out.println(\"Meter: \" + this.meter + \"\\n\");\n\t\tSystem.out.println(\"Default note length: \" + this.Length_Default + \"\\n\");\n\t\tSystem.out.println(\"Tempo: \" + this.tempo + \"\\n\");\n\t\tSystem.out.println(\"Key signature: \" + this.key + \"\\n\");\n\t}", "public void showDetails(){\r\n\t\tSystem.out.println(\"Length is : \"+getLength());\r\n\t\tSystem.out.println(\"Width is : \"+getWidth());\r\n\t\tSystem.out.println(\"Area Of Rectangle is : \"+area());\r\n\t}", "private void cmdInfo(String line) throws NoSystemException {\n StringTokenizer tokenizer = new StringTokenizer(line);\n try {\n String subCmd = tokenizer.nextToken();\n if (subCmd.equals(\"class\")) {\n String arg = tokenizer.nextToken();\n cmdInfoClass(arg);\n } else if (subCmd.equals(\"model\")) {\n cmdInfoModel();\n } else if (subCmd.equals(\"state\")) {\n cmdInfoState();\n } else if (subCmd.equals(\"opstack\")) {\n cmdInfoOpStack();\n } else if (subCmd.equals(\"prog\")) {\n cmdInfoProg();\n } else if (subCmd.equals(\"vars\")) {\n cmdInfoVars();\n } else\n Log.error(\"Syntax error in info command. Try `help'.\");\n } catch (NoSuchElementException ex) {\n Log.error(\"Missing argument to `info' command. Try `help'.\");\n }\n }", "public InfoCommand() {\n super(\"info\", \"info <Spieler>\", \"Gib dir Informationen über den Chunk oder Spieler\", SubCommand.NONE_PERMISSION);\n }", "public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "public void printTask() {\r\n\t\tSystem.out.println(\"ID: \" + this.id + \" | Description: \" + this.description + \" | Processor: \" + this.processor);\r\n\t\tSystem.out.println(\"Status: \" + this.status + \" | Fälligkeitsdatum: \" + this.formatedDueDate);\r\n\t\tSystem.out.println(\"----------\");\r\n\t}", "public void displayCharacter() {\n System.out.println(\"**************************\");\n System.out.println(p.showDetails());\n System.out.println(\"**************************\"+\"\\n\");\n\n }", "public void printDetails()\r\n\t{\r\n\t\tSystem.out.println(flightNumber);\r\n\t\tSystem.out.println(departurePoint);\r\n\t\tSystem.out.println(destination);\r\n\t\tSystem.out.println(departureTime);\r\n\t\tSystem.out.println(arrivalTime);\r\n\t\tSystem.out.println(checkedInPassengers);\r\n\t\tif(status == 'S')\r\n\t\t\tSystem.out.println(\"Scheduled\");\r\n\t\t\t\r\n\t\tif(status == 'B')\r\n\t\t\tSystem.out.println(\"Boarding\");\r\n\t\tif(status == 'D')\r\n\t\t\tSystem.out.println(\"Departed\");\r\n\t\tif(status == 'C')\r\n\t\t\tSystem.out.println(\"Canceled\");\r\n\t\t\r\n\t\t\t\t\r\n\t}", "private void cmdInfoClass(String classname) throws NoSystemException {\n MSystem system = system();\n MClass cls = system.model().getClass(classname);\n if (cls == null)\n Log.error(\"Class `\" + classname + \"' not found.\");\n else {\n MMVisitor v = new MMPrintVisitor(new PrintWriter(System.out, true));\n cls.processWithVisitor(v);\n int numObjects = system.state().objectsOfClass(cls).size();\n System.out.println(numObjects + \" object\"\n + ((numObjects == 1) ? \"\" : \"s\")\n + \" of this class in current state.\");\n }\n }", "public void printMetrics() {\n System.out.println(\"\\nPROG_SIZE = \" + Metrics.getProgSize() + '\\n' + \"EXEC_TIME = \" + Metrics.getExecTime() + \" ms\" + '\\n' + \"EXEC_MOVE = \" + Metrics.getExecMove() + '\\n' + \"DATA_MOVE = \" + Metrics.getDataMove() + '\\n' + \"DATA_READ = \" + Metrics.getDataRead() + '\\n' + \"DATA_WRITE = \" + Metrics.getDataWrite() + '\\n');\n }", "void showProcessList(TimelyResultProcessor resultProcessor);", "public int getProcID() {\n\t\treturn procID;\n\t}", "void display()\n\t {\n\t\t System.out.println(\"Student ID: \"+id);\n\t\t System.out.println(\"Student Name: \"+name);\n\t\t System.out.println();\n\t }", "public void display(){\r\n System.out.println(\"_____________________valuues of__[th]__constuctor_________________________\");\r\n System.out.println(\"No_of_people = \"+NO_OF_PEOPLE);\r\n System.out.println(\"EVENT_NUBMBER = \"+EVENT_NUMBER);}", "private void mostrarInformacionP(){\n System.out.println(\"Nombre: \"+this.nombre);\n System.out.println(\"Sexo: \"+ this.sexo);\n System.out.println(\"Edad: \" + edad);\n\n }", "public void showInfo(A a) {\n System.out.println(a.toString());\n }", "public void showInformationMessage(String msg) {\r\n JOptionPane.showMessageDialog(this,\r\n\t\t\t\t msg, TmplResourceSingleton.getString(\"info.dialog.header\"),\r\n\t\t\t\t JOptionPane.INFORMATION_MESSAGE);\r\n }", "public void display()\n\t{\n\t\tSystem.out.println(\"Bike No.\\t\"+\n\t\t\t\t\"Phone no.\\t\"+\n\t\t\t\t\"Name\\t\"+\n\t\t\t\t\"No. of days\\t\"+\n\t\t\t\t\"Charge\");\n\t\tSystem.out.println(bno+\n\t\t\t\t\"\\t\"+phno+\n\t\t\t\t\"\\t\"+name+\n\t\t\t\t\"\\t\"+days+\n\t\t\t\t\"\\t\"+charge);\n\t}", "public String show() {\r\n return \"show\";\r\n }", "public void startInfo() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Enter your name:\");\n\t\tString name = this.getInputString();\n\t\tSystem.out.println(\"Enter your mobile number:\");\n\t\tint number = this.getInputInteger();\n\t\tSystem.out.println(\"Enter your email:\");\n\t\tString email = this.getInputString();\n\t}", "public void printDetails()\n {\n System.out.println(\"Name: \" + foreName + \" \"\n + lastName + \"\\nEmail: \" + emailAddress);\n }", "public void show() {\n\tSystem.out.println(\"show-method\");\t\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(name);\n\t}", "private void displayChampionshipDetails()\n {\n displayLine();\n System.out.println(\"########Formula 9131 Championship Details########\");\n displayLine();\n System.out.println(getDrivers().getChampionshipDetails());\n }", "private static void printUsage()\n {\n HelpFormatter hf = new HelpFormatter();\n String header = String.format(\n \"%nAvailable commands: ring, cluster, info, cleanup, compact, cfstats, snapshot [name], clearsnapshot, bootstrap\");\n String usage = String.format(\"java %s -host <arg> <command>%n\", NodeProbe.class.getName());\n hf.printHelp(usage, \"\", options, header);\n }", "public void printInfo() {\n System.out.println(\"\\n\" + name + \"#\" + id);\n System.out.println(\"Wall clock time: \" + endWallClockTime + \" ms ~ \" + convertFromMillisToSec(endWallClockTime) + \" sec\");\n System.out.println(\"User time: \" + endUserTimeNano + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano) + \" sec\");\n System.out.println(\"System time: \" + endSystemTimeNano + \" ns ~ \" + convertFromNanoToSec(endSystemTimeNano) + \" sec\");\n System.out.println(\"CPU time: \" + (endUserTimeNano + endSystemTimeNano) + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano + endSystemTimeNano) + \" sec\\n\");\n }", "void display(){\n\t \t\r\n\t \t\r\n\t \tSystem.out.println(\"Student id :\" +id);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \tSystem.out.println(\"Student name: \" +name);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \tSystem.out.println(\"Student marks: \" +marks);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \t\r\n\t \t}", "public void showInfo() {\n\t\tsuper.showInfo();\n\t\tSystem.out.println(\n\t\t\t\t\" Your Savings Account Features: \" +\n\t\t\t\t\"\\n debitCardNumber: \" + debitCardNumber + \n\t\t\t\t\"\\n debitCardPIN: \" + debitCardPIN);\n\t}", "@Override\n public void information() {\n System.out.println(\"\");\n System.out.println(\"Dog :\");\n System.out.println(\"Age : \" + getAge());\n System.out.println(\"Name : \" + getName());\n System.out.println(\"\");\n }", "public void show() {\n\t\tSystem.out.println(getId());\n\t}", "public abstract void showStat();", "void show() {\r\n System.out.println(\"Weight of the Cycle is = \" + weight);\r\n System.out.println(\"Name of the Cycle is = \" + name);\r\n }", "public void printStudentInfo(){\r\n System.out.println(\"Name: \" + getName());\r\n System.out.println(\"Student Id: \" + getId());\r\n printMarks();\r\n System.out.println(\"\\nAverage \" + getAverage() + \"%\");\r\n printNumberOfCoursesInEachLetterGradeCategory();\r\n }", "public static void printVMinfo(VirtualMachine vm) throws IOException, InterruptedException{\n\t\t\t\n\t\t\t\tvm.getResourcePool();\n\t\t\t\tSystem.out.println(\"Hello \" + vm.getName());\n\t\t\t\tSystem.out.println(\"Status \" + vm.getGuestHeartbeatStatus());\n\t\t\t\tSystem.out.println(\"get ip \"+ vm.getSummary().getGuest().getIpAddress());\n\t\t\t\tSystem.out.println(\"get id \"+ vm.getSummary().getGuest().getGuestId());\n\t\t\t\tSystem.out.println(\"get toolstatus \"+ vm.getSummary().getGuest().toolsRunningStatus);\n\t\t\t\tSystem.out.println(\"get hostname \"+ vm.getSummary().getGuest().getHostName());\n\t\t\t\tSystem.out.println(\"GuestOS: \" + vm.getConfig().getGuestFullName());\n\t\t\t\tSystem.out.println(\"vm version: \" + vm.getConfig().version);\n\t\t\t\tSystem.out.println(\"meomery: \" + vm.getConfig().getHardware().memoryMB + \"MB\");\n\t\t\t\t//System.out.println(\"meomery overhead: \" + vm.getConfig().memoryAllocation.reservation.toString() + \"MB\");\n\t\t\t\tSystem.out.println(\"cpu: \" + vm.getConfig().getHardware().numCPU);\n\t\t\t\tSystem.out.println(\"Multiple snapshot supported: \" + vm.getCapability().isMultipleSnapshotsSupported());\n\t\t\t\tSystem.out.println(\"====================================================================\");\n\t\t\t}", "public String printDetails(){\n System.out.println(\"This is the Title of the book:\");\n return title;\n System.out.println(\"This is the Author of the book:\");\n return author;\n System.out.println(\"This is how many pages there are:\");\n return pages;\n System.out.println(\"This is the Ref Number:\");\n return refNumber;\n \n }", "public void printInfo() {\n\t\tSystem.out.println(\"User: \" + userName);\n\t\tSystem.out.println(\"Login: \" + loginName);\n\t\tSystem.out.println(\"Host: \" + hostName);\n\t}", "public void getSystemInfo(){\n //get system info\n System.out.println(\"System Information\");\n System.out.println(\"------------------\");\n System.out.println(\"Available Processors: \"+Runtime.getRuntime().availableProcessors());\n System.out.println(\"Max Memory to JVM: \"+String.valueOf(Runtime.getRuntime().maxMemory()/1000000)+\" MB\");\n System.out.println(\"------------------\");\n System.out.println();\n }", "@Override\n\tpublic void printInfo() {\n\t\tsuper.printInfo();\n\t\tmessage();\n\t\tdoInternet();\n\t\tmailing();\n\t\tcalling();\n\t\twatchingTV();\n\n\t}", "public void printCustomerDetails()\r\n {\r\n System.out.println(title + \" \" + firstName + \" \" \r\n + lastName + \"\\n\" +getAddress() \r\n + \"\\nCard Number: \" + cardNumber \r\n + \"\\nPoints available: \" + points);\r\n }", "void show() {\r\n System.out.println(\"regno:\"+regno + \"\\n name\"+ name + \"\\n marks :\" + m1+\",\"+m2+\",\"+m3);\r\n }", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "public void showInfo() throws SQLException { //to show the info when the page is loaded\n \tshowInfoDump();\n \tshowInfoMatl();\n }", "public static void show(Petrinet pn) {\n\t\tint[] M_i = pn.getM();\n\t\tint curr_places = pn.numberOfPlaces();\n\t\tJDDConsole.out.print(\"M_i = [\");\n\t\tfor(int i = 0; i < curr_places; i++) {\n\t\t\tif(i != 0) JDDConsole.out.print(\", \");\n\t\t\tJDDConsole.out.print( \"\" + M_i[i]);\n\t\t}\n\t\tJDDConsole.out.println(\"]\");\n\n\t\tJDDConsole.out.println(\"A-\"); pn.getAMinus().show();\n\t\tJDDConsole.out.println(\"A+\"); pn.getAPlus().show();\n\t}", "public void printTheInstance() {\n System.out.println(\"The instance is: \");\n this.printSources();\n System.out.print(\"\\n\");\n this.printDestinations();\n System.out.print(\"\\n\");\n this.printCosts();\n }", "public void PrimInfo(ActionEvent actionEvent)\n {\n try {\n Desktop.getDesktop().browse(new URL(\"https://en.wikipedia.org/wiki/Prim%27s_algorithm\").toURI());\n } catch (IOException e) {\n e.printStackTrace();\n } catch (URISyntaxException e)\n {\n e.printStackTrace();\n }\n }", "public String getProcedureName(){\n return this.procedureName;\n }", "public void printPidInfo(TrcDbgTrace tracer, boolean verbose)\n {\n printPidInfo(tracer, verbose, null);\n }", "public void printPIDF() {\n SmartDashboard.putNumber(\"P \" + name, p);\n SmartDashboard.putNumber(\"I \" + name, i);\n SmartDashboard.putNumber(\"D \" + name, d);\n SmartDashboard.putNumber(\"F \" + name, f);\n }" ]
[ "0.65330976", "0.6326408", "0.6229531", "0.6221855", "0.6094922", "0.6057179", "0.59697765", "0.59662557", "0.59388924", "0.58317775", "0.58145386", "0.5741641", "0.5741641", "0.5654209", "0.564562", "0.5633938", "0.5605732", "0.5592696", "0.5499312", "0.549638", "0.54959697", "0.54864955", "0.5481106", "0.54788756", "0.54654723", "0.5463403", "0.5443684", "0.5435075", "0.5424455", "0.5421143", "0.5418695", "0.54162794", "0.54133403", "0.5405912", "0.5402535", "0.5400805", "0.5397573", "0.5395929", "0.5370159", "0.5369885", "0.53660166", "0.5356454", "0.5344002", "0.53428185", "0.5340195", "0.5331985", "0.5323702", "0.5321991", "0.53024983", "0.52912796", "0.52902323", "0.528324", "0.5249909", "0.5245205", "0.52416426", "0.52272904", "0.5222241", "0.5219314", "0.5214439", "0.5213586", "0.52068967", "0.5192318", "0.51855737", "0.51806706", "0.5169723", "0.515372", "0.5153002", "0.5151404", "0.5148896", "0.51407063", "0.51390207", "0.5138919", "0.51324356", "0.5128918", "0.51245236", "0.51207983", "0.51184654", "0.5115351", "0.5110339", "0.51019335", "0.50960565", "0.5095156", "0.50947607", "0.50918764", "0.5076941", "0.5075978", "0.5075909", "0.5074531", "0.5069612", "0.5066701", "0.50629705", "0.50592506", "0.504838", "0.5042576", "0.5039933", "0.5037704", "0.50376433", "0.5037397", "0.5035809", "0.5035747" ]
0.7025233
0
Shows security information relating to users and/or roles. If the caller is not a system administrator, only information relating to the caller and their roles is returned.
public ShowSecurityResponse showSecurity(ShowSecurityRequest request) throws GPUdbException { ShowSecurityResponse actualResponse_ = new ShowSecurityResponse(); submitRequest("/show/security", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Path(\"admin_area\")\n @GET\n @View(\"admin_page.jsp\")\n @RolesAllowed(\"admin\")\n public void sayRole(@Context SecurityContext securityContext) {\n\n logger.info(\"AdminRole :: \" + securityContext.isUserInRole(\"AdminRole\"));\n logger.info(\"admin :: \" + securityContext.isUserInRole(\"admin\"));\n logger.info(\"INFO :: \" + securityContext.isSecure());\n\n }", "@Path(\"app\")\n @GET\n @View(\"hello.jsp\")\n public void sayHello(@Context SecurityContext securityContext) {\n\n logger.info(\"AdminRole :: \" + securityContext.isUserInRole(\"AdminRole\"));\n logger.info(\"admin :: \" + securityContext.isUserInRole(\"admin\"));\n logger.info(\"INFO :: \" + securityContext.isSecure());\n\n }", "public ShowSecurityResponse showSecurity(List<String> names, Map<String, String> options) throws GPUdbException {\n ShowSecurityRequest actualRequest_ = new ShowSecurityRequest(names, options);\n ShowSecurityResponse actualResponse_ = new ShowSecurityResponse();\n submitRequest(\"/show/security\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n public JSONObject viewSLCustomersByAdmin() {\n\n return in_salescustdao.viewSLCustomerByAdmin();\n }", "@Override\n public User getUserInfo() {\n return User.AUTHORIZED_USER;\n }", "@GetMapping(Mappings.SYSTEMS)\n\tpublic String showSystems() {\n\n\t\treturn ViewNames.ADMIN_PANEL;\n\t}", "public Integer getSecurity() {\n return security;\n }", "public String getUserSubMenuRole() {\n return sessionData.getUserSubMenuRole();\n }", "public Security getSecurity()\n {\n return __m_Security;\n }", "public List<String> displayuser() {\n\t\t// TODO Auto-generated method stub\n\t\tList<String> list = new ArrayList<>();\n\t\tlist = crud1.displayUsers();\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Admin> viewlogs() {\n\t\treturn user.viewlogs();\r\n\t}", "@RequestMapping(\"/admin\")\n public String admin() {\n \t//当前用户凭证\n\t\tSeller principal = (Seller)SecurityUtils.getSubject().getPrincipal();\n\t\tSystem.out.println(\"拿取用户凭证\"+principal);\n return \"index管理员\";\n\n }", "public List getSysRoles(SysRole sysRole);", "java.lang.String getXUsersInfo();", "public List<TbccUser> getSysAdmin() {\n\t\treturn userdao.getSysAdmin();\n\t}", "@Override\n\t\tpublic SecurityDirector getSecurity() {\n\t\t\treturn null;\n\t\t}", "@Override\n public SecurityInfo getInfo() {\n return info;\n }", "private String getUserData() { \n\t\t \n\t\tString userName;\n\t\tObject principial = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\t\n\t\tif(principial instanceof UserDetails) {\n\t\t\tuserName = ((UserDetails) principial).getUsername();\n\t\t} else {\n\t\t\tuserName = principial.toString(); \n\t\t}\n\t\treturn userName; \n\t}", "public void viewUser() {\n\t\tsuper.viewUser();\n\t}", "@Override\n protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {\n SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();\n info.setRoles(new HashSet<>(Arrays.asList(\"ROLE_USER\", \"ROLE_ADMIN\")));\n info.setStringPermissions(new HashSet<>());\n return info;\n }", "public void printUserInfo(){\n System.out.print(\"Username: \"+ getName() + \"\\n\" + \"Birthday: \"+getBirthday()+ \"\\n\"+ \"Hometown: \"+getHome()+ \"\\n\"+ \"About: \" +getAbout()+ \" \\n\"+ \"Subscribers: \" + getSubscriptions());\n\t}", "@RequestMapping(value = {\"/profile\"})\n @PreAuthorize(\"hasRole('logon')\")\n public String showProfile(HttpServletRequest request, ModelMap model)\n {\n User currentUser = userService.getPrincipalUser();\n model.addAttribute(\"currentUser\", currentUser);\n return \"protected/profile\";\n }", "@RequestMapping(path = \"/controlpanel/userdetails\", method = RequestMethod.GET)\r\n\tModelAndView userContactInfo(Principal principal) {\r\n\t\treturn new ModelAndView(USERDETAILS, \"user\", userService.findByUsername(principal.getName()));\r\n\t}", "public void displayUserInformations() {\n println(\"getLocation(): \"+user.getLocation());\n println(\"getFriendsCount(): \"+user.getFriendsCount());\n println(\"getFollowersCount(): \"+user.getFollowersCount());\n println(\"getDescription(): \"+user.getDescription());\n println(\"getCreatedAt() : \"+user.getCreatedAt() );\n println(\"getDescriptionURLEntities(): \"+user.getDescriptionURLEntities());\n println(\"getFavouritesCount() : \"+user.getFavouritesCount() );\n }", "public void displayDetails() {\r\n\t\tSystem.out.println(\"*******************Profile Details*********************\");\r\n\t\tSystem.out.println(\"\\tUsername :\\t\" + uName);\r\n\t\tSystem.out.println(\"\\tFull Name :\\t\" + fullName);\r\n\t\tSystem.out.println(\"\\tPhone :\\t\" + phone);\r\n\t\tSystem.out.println(\"\\tE-Mail :\\t\" + email);\r\n\t}", "@Override\n public void showCustomerDetails() {\n System.out.println(customerLoggedIn);\n }", "@RequestMapping(\"page\")\n\tpublic String toList(HttpServletRequest request) {\n\t\trequest.setAttribute(\"listUsrSecurityView\", iUsrSecurityService.mySelectUserList());\n\t\trequest.setAttribute(\"listUsrInformation\", iUsrInformationService.list());\n\t\treturn \"/admin/usr/usrSecurity_list\";\n\t}", "public wbemdisp.ISWbemSecurity getSecurity_ () throws java.io.IOException, com.linar.jintegra.AutomationException;", "public String verUsuarios() {\n\t\tString stringIdRol = session.getAttribute(\"rol\").toString();\n\t\tInteger idRol = Integer.parseInt(stringIdRol);\n\n\t\tif (idRol == 1) {\n\t\t\treturn \"TodosLosUsuarios\";\n\t\t}\n\n\t\treturn \"home\";\n\t}", "public static String toStringCurrentUser() {\n return new StringBuilder()\n .append(CURRENT_USER.getName())\n .append(\" - \")\n .append(CURRENT_USER.getEmployee().getName())\n .toString();\n }", "@Override\n public String toString() {\n return \"userName \" + this.userName + \", pasword \" + this.passWord + \"sex \" + userSex.name();\n }", "@Override\n public String toString() {\n \treturn \"lastname : \"+this.userLastname+\" firstname: \"+this.userFirstname+\" username: \"+this.userLogin+\" email: \"+this.userEmail+\" role: \"+this.roles;\n }", "@Override\n public String toString() {\n String output = \"User Info for: \" + getId();\n output += \"\\n\\tName: \" + getFirstName() + \" \" + getLastName();\n output += \"\\n\\tCreated on: \" + DF.format(getEnrolDate());\n output += \"\\n\\tLast access: \" + DF.format(getLastAccess());\n \n return output;\n }", "public UserInfo getUserInfo() {\n Authentication authentication = getAuthentication();\n if(authentication == null) {\n throw new AuthenticationCredentialsNotFoundException(\"No user is currently logged in.\");\n }\n return (UserInfo) authentication.getPrincipal();\n }", "@Override\n public String toString(){\n return String.format(\"ApplicationUser ehrId: '%s', shimmerId: '%s', shimKey: '%s', is logged in: '%s'\", applicationUserId.getEhrId(), shimmerId, getApplicationUserId().getShimKey());\n }", "public static void checkAccess() throws SecurityException {\n if(isSystemThread.get()) {\n return;\n }\n //TODO: Add Admin Checking Code\n// if(getCurrentUser() != null && getCurrentUser().isAdmin()) {\n// return;\n// }\n throw new SecurityException(\"Invalid Permissions\");\n }", "@GetMapping(\"/whoami\")\n public User whoAmI() {\n return userService.findCurrentUser();\n }", "public static void ShowAdminPreferences() {\n if (Controller.permission.GetUserPermission(\"EditUser\")) {\n ToggleVisibility(UsersPage.adminWindow);\n } else {\n DialogWindow.NoAccessTo(\"Admin options\");\n }\n }", "@PermitAll\n @Override\n public List<Role> getCurrentUserRoles() {\n Map params = new HashMap<String, Object>();\n params.put(CommonSqlProvider.PARAM_QUERY, Role.QUERY_GET_ROLES_BY_USER_NAME);\n params.put(User.PARAM_USERNAME, this.getUserName());\n return getRepository().getEntityList(Role.class, params);\n }", "@RequestMapping(value = \"/403\", method = RequestMethod.GET)\n\tpublic ModelAndView accesssDenied() {\n\t\tModelAndView model = new ModelAndView();\n\t\t// check if user is login\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tif (!(auth instanceof AnonymousAuthenticationToken)) {\n\t\t\tUserDetails userDetail = (UserDetails) auth.getPrincipal();\n\t\t\tSystem.out.println(userDetail);\n\t\t\tmodel.addObject(\"username\", userDetail.getUsername());\n\n\t\t}\n\t\tmodel.setViewName(\"403\");\n\t\treturn model;\n\t}", "String getRole();", "String getRole();", "@PostAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(returnObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"returnObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"isAnonymous() OR returnObject.username == principal.username\")\r\n \tpublic SystemUserDTO getSystemUserByUsername(String username);", "@Override\n\tprotected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {\n\t\tif (principals == null) {\n\t\t\tthrow new AuthorizationException(\"PrincipalCollection method argument cannot be null.\");\n\t\t}\n\t\tPrincipal principal = (Principal) getAvailablePrincipal(principals);\n\t\tString username = principal.getUsername();\n\t\tSet<String> roleCodes = new HashSet<String>(repository.findRoleCodesByUsername(username));\n\t\tList<? extends Permission> permissions = repository.findPermissionsByUsername(username);\n\t\tList<String> resourceRightCodes = new ArrayList<String>(permissions.size());\n\t\tfor (Permission permission : permissions) {\n\t\t\tresourceRightCodes.add(permission.getResourceSymbol());\n\t\t}\n\t\tSet<String> perms = PermissionUtils.toStringPermissions(resourceRightCodes, repository);\n\t\tSimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roleCodes);\n\t\tinfo.setStringPermissions(perms);\n\t\treturn info;\n\t}", "public List<String> showPersonalDetails()\n {\n return userFan.showPersonalDetails();\n }", "public List<SecRole> getRolesByUser(SecUser aUser);", "public List<String> show () {\n\t\treturn userDao.show();\n\t}", "public String showUser(){\n String dataUser = \"\";\n for(int i = 0; i<MAX_USER; i++){\n if(user[i] != null){\n dataUser += user[i].showDataUser();\n }\n }\n return dataUser;\n }", "@Override\n public String toString(){\n return role;\n }", "public List<StudentVM> getAllStudentDetailsAdmin(String userUuid);", "List<SysRole> getUserRoles(int userId);", "@GET\n @Path(\"/roles\")\n @Produces(MediaType.TEXT_PLAIN)\n @RolesAllowed(\"Subscriber\")\n public String helloRoles() {\n return sub;\n }", "public int getMetaPrivileges();", "public boolean securityStatus()\n {\n return m_bSecurity;\n }", "public List<String> getAuthorizedSeriesSecurityGroups() {\n return getAuthorizedSeriesSecurityGroups(RoleType.READ);\n }", "@GetMapping(\"/myCompetitionAdminRequest\")\n\tpublic ModelAndView showCompAdminRequest() {\n\n\t\tAuthentication authentication = SecurityContextHolder.getContext().getAuthentication();\n\t\tString currentPrincipalName = authentication.getName();\n\n\t\tModelAndView mav = new ModelAndView(\"compAdminRequests/compAdminRequestDetails\");\n\t\tmav.addObject(this.compAdminRequestService.findCompAdminRequestByUsername(currentPrincipalName));\n\t\treturn mav;\n\t}", "java.lang.String getAdmin();", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getUserArn() != null)\n sb.append(\"UserArn: \").append(getUserArn()).append(\",\");\n if (getProjectRole() != null)\n sb.append(\"ProjectRole: \").append(getProjectRole()).append(\",\");\n if (getRemoteAccessAllowed() != null)\n sb.append(\"RemoteAccessAllowed: \").append(getRemoteAccessAllowed());\n sb.append(\"}\");\n return sb.toString();\n }", "public List<String> grantpermission() {\n\t\tList<Integer> userids = new ArrayList<>();\n\t\tuserids = crud1.grantPermission();\n\t\tList<String> username = new ArrayList<>();\n\t\tfor (Integer x : userids) {\n\n\t\t\tusername.add(crud1.findById(x).get().getUsername());\n\t\t}\n\t\treturn username;\n\t}", "@Override\n public String getUserGroupsQuery()\n {\n return \"SELECT ROLE_NAME FROM INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS WHERE GRANTEE=? AND ROLE_NAME!=GRANTEE;\";\n }", "@PostAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(returnObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"returnObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"(hasRole('REVISIONER') AND returnObject.type.typeLabel == 'REVISIONER') OR \"\r\n \t\t\t+ \"returnObject.username == principal.username\")\r\n \tpublic SystemUserDTO read(Long id);", "private void showUser() {\n\t\tCommonADO ado=CommonADO.getCommonADO();\r\n\t\tString sql=\"select * from Users\";\r\n\t\tResultSet rs=ado.executeSelect(sql);\r\n\t\tString str=\"\";\r\n\t\ttry {\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tString user=rs.getString(\"UserName\");\r\n\t\t\t\tString pass=rs.getString(\"Password\");\r\n\t\t\t\tString type=rs.getString(\"UserType\");\r\n\t\t\t\tif(type.equals(\"管理员\"))\r\n\t\t\t\t\tpass=\"******\";\r\n\t\t\t\tif(user.length()<12){\r\n\t\t\t\t\tfor(int i=user.length();i<=12;i++)\r\n\t\t\t\t\t\tuser+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(pass.length()<12){\r\n\t\t\t\t\tfor(int i=pass.length();i<=12;i++)\r\n\t\t\t\t\t\tpass+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(type.length()<12){\r\n\t\t\t\t\tfor(int i=type.length();i<=12;i++)\r\n\t\t\t\t\t\ttype+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tstr+=\"用户名:\"+user;\r\n\t\t\t\tstr+=\" 密码:\"+pass;\r\n\t\t\t\tstr+=\" 用户类型:\"+type+\"\\n\";\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttextAreaUser.setText(str);\r\n\t}", "public String usuarioconectado() {\n\t\tString nome;\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\n\t\tif (principal instanceof UserDetails) {\n\t\t\tnome = ((UserDetails) principal).getUsername();\n\t\t} else {\n\t\t\tnome = principal.toString();\n\t\t}\n\t\t// System.out.println(nome);\n\t\treturn nome;\n\t}", "String getValue() throws AccessDeniedException {\n\t performSecurityManagerCheck();\n\t return town;\n\t }", "java.lang.String getUser();", "public SecurityContext getSecurityContext();", "SecurityProfile securityProfile();", "@Override\n public String RolesStatistics() {\n List<Employee> allEmployees = payrollService.AllEmployees();\n int ceo=0,manager=0,project_manager=0,employee=0;\n\n StringBuilder sb = new StringBuilder(\"\");\n for(int i=0;i<allEmployees.size();i++) {\n Employee e = allEmployees.get(i);\n if(e.getRole().getTitle().equals(\"CEO\"))\n ceo++;\n else if(e.getRole().getTitle().equals(\"Manager\"))\n manager++;\n else if(e.getRole().getTitle().equals(\"Project Manager\"))\n project_manager++;\n else if(e.getRole().getTitle().equals(\"Employee\"))\n employee++;\n }\n sb.append(\"Employees: \"+employee+\"\\n\");\n sb.append(\"Project Managers: \"+project_manager+\"\\n\");\n sb.append(\"Managers: \"+manager+\"\\n\");\n sb.append(\"CEOs: \"+ceo+\"\\n\");\n\n return sb.toString();\n }", "public String toString() {\n return (\"Principal's username: \" + name);\n }", "public java.lang.String getUserRole() {\r\n return userRole;\r\n }", "public org.tempuri.GetUserAccessRightWithUserDetailsResponseGetUserAccessRightWithUserDetailsResult getUserAccessRightWithUserDetails(java.lang.String msg, java.lang.String systemCode, java.lang.String companyCode) throws java.rmi.RemoteException;", "@GetMapping(path = \"/secure/hello\")\n\t@PreAuthorize(\"hasRole('USER') and #oauth2.hasScope('read')\")\n\tpublic String getSecureHello() {\n\t\treturn \"Hello Secure\";\n\t}", "@GetMapping(\"/adminShowList\")\n public String adminSList(@RequestParam(required = false, value=\"creator\") String userFilter, Model model){\n String nextPage = \"login\";\n User currentUser = (User) model.getAttribute(\"currentUser\");\n if (isValid(currentUser)){\n nextPage = \"adminShowList\";\n if (userFilter == null || userFilter.length() <=0)\n model.addAttribute(\"showList\", showRepo.findAll());\n else{\n User filteredUser = userRepo.findByUserName(userFilter).get(0);\n if (filteredUser != null)\n model.addAttribute(\"showList\", showRepo.findByUser(filteredUser));\n else\n model.addAttribute(\"showList\", showRepo.findAll());\n }\n } else{\n User user = new User();\n model.addAttribute(\"currentUser\", null);\n model.addAttribute(\"newUser\", user);\n }\n model.addAttribute(\"creators\", userRepo.findByUserRole(\"creator\"));\n return nextPage;\n }", "public float getSecurity() {\n return security;\n }", "@DOMSupport(DomLevel.ONE)\r\n @Property String getSecurity();", "private void displayMenu() {\r\n\t\tif (this.user instanceof Administrator) {\r\n\t\t\tnew AdminMenu(this.database, (Administrator) this.user);\r\n\t\t} else {\r\n\t\t\tnew BorrowerMenu(this.database);\r\n\t\t}\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn wcRole.toString();\n\t}", "@Override\r\n\tprotected AuthorizationInfo doGetAuthorizationInfo(final PrincipalCollection principals) {\n\t\tfinal String email = (String) principals.getPrimaryPrincipal();\r\n\t\tfinal User user = userRepository.findByEmailAndActive(email, true);\r\n\t\tif (user == null) {\r\n\t\t\tthrow new UnknownAccountException(\"Account does not exist\");\r\n\t\t}\r\n\t\tfinal int totalRoles = user.getRoles().size();\r\n\t\tfinal Set<String> roleNames = new LinkedHashSet<>(totalRoles);\r\n\t\tfinal Set<String> permissionNames = new LinkedHashSet<>();\r\n\t\tif (totalRoles > 0) {\r\n\t\t\tfor (Role role : user.getRoles()) {\r\n\t\t\t\troleNames.add(role.getName());\r\n\t\t\t\tfor (Permission permission : role.getPermissions()) {\r\n\t\t\t\t\tpermissionNames.add(permission.getName());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinal SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roleNames);\r\n\t\tinfo.setStringPermissions(permissionNames);\r\n\t\treturn info;\r\n\t}", "public List<UserCombinedDTO> getUserDetails(AdminBean adminBean, UserAccountDTO currentUser) {\r\n\t\t\r\n\t\tArrayList<UserCombinedDTO> returnValue = new ArrayList<UserCombinedDTO>();\r\n\t\ttry{\r\n\t\t\treturnValue = adminDAO.getUserDetails(adminBean.getGroupCode(), currentUser);\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\tadminBean.setReturnMessage(\"Failed to retrieve admin User Details list\");\r\n\t\t}\t\t\r\n\t\treturn returnValue;\r\n\t}", "public String toString() {\n return \"RoleName:DisplayName:Affiliate \" + getName() + \":\" + getDisplayName() + \":\" + getAffiliate().displayValue;\n }", "public int getCountAllSecRoles();", "public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(getClass().getName());\n buffer.append(\"@\");\n buffer.append(Integer.toHexString(hashCode()));\n buffer.append(\" [\");\n buffer.append(\"userId\").append(\"='\").append(userId).append(\"' \");\n buffer.append(\"role\").append(\"='\").append(role).append(\"' \");\n buffer.append(\"]\");\n\n return buffer.toString();\n }", "public String get_snmpsecurityname()\r\n\t{\r\n\t\treturn this.snmpsecurityname;\r\n\t}", "private void getUserInfo() {\n\t}", "@RequestMapping(value = \"/403\", method = RequestMethod.GET)\n \tpublic ModelAndView accesssDenied() {\n\n \t ModelAndView model = new ModelAndView();\n \t\t\n \t //check if user is login\n \t Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n \t if (!(auth instanceof AnonymousAuthenticationToken)) {\n \t\tUserDetails userDetail = (UserDetails) auth.getPrincipal();\t\n \t\tmodel.addObject(\"username\", userDetail.getUsername());\n \t }\n \t\t\n \t model.setViewName(\"403\");\n \t return model;\n\n \t}", "private String getLoggedInUser() {\r\n\t\tOptional<Authentication> authentication = Optional\r\n\t\t\t\t.ofNullable(SecurityContextHolder.getContext().getAuthentication());\r\n\t\treturn authentication.map(Authentication::getPrincipal).map(obj -> (UserDetails) obj)\r\n\t\t\t\t.map(UserDetails::getUsername).orElse(null);\r\n\t}", "@Override\n\tpublic Map<String, Object> getUserInfoDetail(Map<String, Object> reqs) {\n\t\treturn joaSimpleDao.retrieve(\"tp_users\", reqs);\n\t}", "public String getAdminUserName() {\n return adminUserName;\n }", "public void printUserInfo(int index) {\n System.out.print(userInfo.get(index).getUserId() + \" -> \");\n System.out.print(userInfo.get(index).getUserRole() + \" \");\n System.out.print(userInfo.get(index).getFirstName() + \" \");\n System.out.print(userInfo.get(index).getLastName() + \" \");\n System.out.print(userInfo.get(index).getAddress() + \" \");\n System.out.print(userInfo.get(index).getCity() + \" \");\n System.out.print(userInfo.get(index).getBasicSalary() + \" \");\n System.out.println(userInfo.get(index).getMobileNumber() + \" \");\n\n }", "SecurityRole getRole();", "public int getL1UserInformation();", "@Override\n public JSONObject viewSLCustomerListByFnManager(String username) {\n\n return in_salescustdao.viewSLCustomerByFnManager(username);\n }", "public UserInfo getCurrentUser() {\n UserInfo currentUserLU;\n if (this.mInjector.checkCallingPermission(\"android.permission.INTERACT_ACROSS_USERS\") != 0 && this.mInjector.checkCallingPermission(\"android.permission.INTERACT_ACROSS_USERS_FULL\") != 0) {\n String msg = \"Permission Denial: getCurrentUser() from pid=\" + Binder.getCallingPid() + \", uid=\" + Binder.getCallingUid() + \" requires \" + \"android.permission.INTERACT_ACROSS_USERS\";\n Slog.w(\"ActivityManager\", msg);\n throw new SecurityException(msg);\n } else if (this.mTargetUserId == -10000) {\n return getUserInfo(this.mCurrentUserId);\n } else {\n synchronized (this.mLock) {\n currentUserLU = getCurrentUserLU();\n }\n return currentUserLU;\n }\n }", "public Set<Role> getCallerRoles() {\n return callerRoles;\n }", "@GetMapping(\"/my-info\")\n\t@Secured({Roles.ADMIN, Roles.BOSS, Roles.WORKER})\n\tpublic ResponseEntity<EmployeeDto> getMyInfo() {\n\t\tLogStepIn();\n\n\t\t// Gets the currently logged in user's name\n\t\tString username = SecurityContextHolder.getContext().getAuthentication().getName();\n\n\t\tEmployee employee = userRepository.findByName(username).getEmployee();\n\t\treturn LogStepOut(ResponseEntity.ok(toDto(employee)));\n\t}", "public List<Yng_Security> findAll() {\n\t\treturn securityDao.findAll();\r\n\t}", "public ArrayList<Role> getRoles()\r\n {\r\n return this.securityInfo.getRoles();\r\n }", "public String listUsers(){\n \tStringBuilder sb = new StringBuilder();\n \tif(users.isEmpty()){\n \t\tsb.append(\"No existing Users yet\\n\");\n \t}else{\n \t\tsb.append(\"Meeting Manager Users:\\n\");\n \t\tfor(User u : users){\n \t\t\tsb.append(\"*\"+u.getEmail()+\" \"+ u.getPassword()+\" \\n\"+u.listInterests()+\"\\n\");\n \t\t}\n \t}\n \treturn sb.toString();\n }", "public String getCurrentLoggedUserinfo() {\n\n\t\tClient client = Client.create();\n\n\t\tWebResource webResource = client.resource(\"http://localhost:8083/UserAccounts/UserAccountService/User_logins\");\n\n\t\tClientResponse response = webResource.accept(\"application/json\").get(ClientResponse.class);\n\n\t\tString output = response.getEntity(String.class);\n\n\t\tSystem.out.println(output);\n\n\t\treturn output;\n\n\t}", "@Override\n public String getTypeForDisplay() {\n return \"User\";\n }" ]
[ "0.6023763", "0.59623015", "0.5757635", "0.55424106", "0.55361867", "0.54337543", "0.542844", "0.54110146", "0.53906715", "0.5351928", "0.5350035", "0.5300452", "0.5288586", "0.5267127", "0.5265061", "0.5262446", "0.525708", "0.5253359", "0.5248268", "0.5215554", "0.52115524", "0.52111584", "0.52044207", "0.5198692", "0.51797503", "0.517296", "0.5169548", "0.5168821", "0.5163434", "0.51619786", "0.51569504", "0.5155764", "0.5145004", "0.51448625", "0.51408434", "0.51323557", "0.5132185", "0.51317686", "0.5127223", "0.5122444", "0.5120188", "0.5120188", "0.5104769", "0.509013", "0.50897497", "0.5081039", "0.50793266", "0.5078651", "0.5076769", "0.5069333", "0.50672024", "0.5063016", "0.5059725", "0.5058421", "0.5058232", "0.5058012", "0.5057872", "0.5042504", "0.5030773", "0.5024281", "0.5018622", "0.5015052", "0.50076854", "0.5007401", "0.50030345", "0.49962986", "0.49946895", "0.4987934", "0.49853584", "0.49830055", "0.49823025", "0.49753347", "0.49750325", "0.49682674", "0.4966673", "0.4961358", "0.49606743", "0.49486306", "0.49450642", "0.49422905", "0.49394193", "0.49335667", "0.49294043", "0.4928747", "0.49274123", "0.49268565", "0.49266753", "0.49159613", "0.49159482", "0.49125588", "0.49068", "0.49061447", "0.48999888", "0.48888355", "0.48796365", "0.48675424", "0.4854855", "0.4854758", "0.48525083", "0.4850825" ]
0.61724496
0
Shows security information relating to users and/or roles. If the caller is not a system administrator, only information relating to the caller and their roles is returned.
public ShowSecurityResponse showSecurity(List<String> names, Map<String, String> options) throws GPUdbException { ShowSecurityRequest actualRequest_ = new ShowSecurityRequest(names, options); ShowSecurityResponse actualResponse_ = new ShowSecurityResponse(); submitRequest("/show/security", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ShowSecurityResponse showSecurity(ShowSecurityRequest request) throws GPUdbException {\n ShowSecurityResponse actualResponse_ = new ShowSecurityResponse();\n submitRequest(\"/show/security\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Path(\"admin_area\")\n @GET\n @View(\"admin_page.jsp\")\n @RolesAllowed(\"admin\")\n public void sayRole(@Context SecurityContext securityContext) {\n\n logger.info(\"AdminRole :: \" + securityContext.isUserInRole(\"AdminRole\"));\n logger.info(\"admin :: \" + securityContext.isUserInRole(\"admin\"));\n logger.info(\"INFO :: \" + securityContext.isSecure());\n\n }", "@Path(\"app\")\n @GET\n @View(\"hello.jsp\")\n public void sayHello(@Context SecurityContext securityContext) {\n\n logger.info(\"AdminRole :: \" + securityContext.isUserInRole(\"AdminRole\"));\n logger.info(\"admin :: \" + securityContext.isUserInRole(\"admin\"));\n logger.info(\"INFO :: \" + securityContext.isSecure());\n\n }", "@Override\n public JSONObject viewSLCustomersByAdmin() {\n\n return in_salescustdao.viewSLCustomerByAdmin();\n }", "@Override\n public User getUserInfo() {\n return User.AUTHORIZED_USER;\n }", "@GetMapping(Mappings.SYSTEMS)\n\tpublic String showSystems() {\n\n\t\treturn ViewNames.ADMIN_PANEL;\n\t}", "public Integer getSecurity() {\n return security;\n }", "public String getUserSubMenuRole() {\n return sessionData.getUserSubMenuRole();\n }", "public Security getSecurity()\n {\n return __m_Security;\n }", "public List<String> displayuser() {\n\t\t// TODO Auto-generated method stub\n\t\tList<String> list = new ArrayList<>();\n\t\tlist = crud1.displayUsers();\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Admin> viewlogs() {\n\t\treturn user.viewlogs();\r\n\t}", "@RequestMapping(\"/admin\")\n public String admin() {\n \t//当前用户凭证\n\t\tSeller principal = (Seller)SecurityUtils.getSubject().getPrincipal();\n\t\tSystem.out.println(\"拿取用户凭证\"+principal);\n return \"index管理员\";\n\n }", "public List getSysRoles(SysRole sysRole);", "java.lang.String getXUsersInfo();", "public List<TbccUser> getSysAdmin() {\n\t\treturn userdao.getSysAdmin();\n\t}", "@Override\n\t\tpublic SecurityDirector getSecurity() {\n\t\t\treturn null;\n\t\t}", "@Override\n public SecurityInfo getInfo() {\n return info;\n }", "private String getUserData() { \n\t\t \n\t\tString userName;\n\t\tObject principial = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\t\n\t\tif(principial instanceof UserDetails) {\n\t\t\tuserName = ((UserDetails) principial).getUsername();\n\t\t} else {\n\t\t\tuserName = principial.toString(); \n\t\t}\n\t\treturn userName; \n\t}", "public void viewUser() {\n\t\tsuper.viewUser();\n\t}", "@Override\n protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {\n SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();\n info.setRoles(new HashSet<>(Arrays.asList(\"ROLE_USER\", \"ROLE_ADMIN\")));\n info.setStringPermissions(new HashSet<>());\n return info;\n }", "public void printUserInfo(){\n System.out.print(\"Username: \"+ getName() + \"\\n\" + \"Birthday: \"+getBirthday()+ \"\\n\"+ \"Hometown: \"+getHome()+ \"\\n\"+ \"About: \" +getAbout()+ \" \\n\"+ \"Subscribers: \" + getSubscriptions());\n\t}", "@RequestMapping(value = {\"/profile\"})\n @PreAuthorize(\"hasRole('logon')\")\n public String showProfile(HttpServletRequest request, ModelMap model)\n {\n User currentUser = userService.getPrincipalUser();\n model.addAttribute(\"currentUser\", currentUser);\n return \"protected/profile\";\n }", "@RequestMapping(path = \"/controlpanel/userdetails\", method = RequestMethod.GET)\r\n\tModelAndView userContactInfo(Principal principal) {\r\n\t\treturn new ModelAndView(USERDETAILS, \"user\", userService.findByUsername(principal.getName()));\r\n\t}", "public void displayUserInformations() {\n println(\"getLocation(): \"+user.getLocation());\n println(\"getFriendsCount(): \"+user.getFriendsCount());\n println(\"getFollowersCount(): \"+user.getFollowersCount());\n println(\"getDescription(): \"+user.getDescription());\n println(\"getCreatedAt() : \"+user.getCreatedAt() );\n println(\"getDescriptionURLEntities(): \"+user.getDescriptionURLEntities());\n println(\"getFavouritesCount() : \"+user.getFavouritesCount() );\n }", "public void displayDetails() {\r\n\t\tSystem.out.println(\"*******************Profile Details*********************\");\r\n\t\tSystem.out.println(\"\\tUsername :\\t\" + uName);\r\n\t\tSystem.out.println(\"\\tFull Name :\\t\" + fullName);\r\n\t\tSystem.out.println(\"\\tPhone :\\t\" + phone);\r\n\t\tSystem.out.println(\"\\tE-Mail :\\t\" + email);\r\n\t}", "@Override\n public void showCustomerDetails() {\n System.out.println(customerLoggedIn);\n }", "@RequestMapping(\"page\")\n\tpublic String toList(HttpServletRequest request) {\n\t\trequest.setAttribute(\"listUsrSecurityView\", iUsrSecurityService.mySelectUserList());\n\t\trequest.setAttribute(\"listUsrInformation\", iUsrInformationService.list());\n\t\treturn \"/admin/usr/usrSecurity_list\";\n\t}", "public wbemdisp.ISWbemSecurity getSecurity_ () throws java.io.IOException, com.linar.jintegra.AutomationException;", "public String verUsuarios() {\n\t\tString stringIdRol = session.getAttribute(\"rol\").toString();\n\t\tInteger idRol = Integer.parseInt(stringIdRol);\n\n\t\tif (idRol == 1) {\n\t\t\treturn \"TodosLosUsuarios\";\n\t\t}\n\n\t\treturn \"home\";\n\t}", "public static String toStringCurrentUser() {\n return new StringBuilder()\n .append(CURRENT_USER.getName())\n .append(\" - \")\n .append(CURRENT_USER.getEmployee().getName())\n .toString();\n }", "@Override\n public String toString() {\n return \"userName \" + this.userName + \", pasword \" + this.passWord + \"sex \" + userSex.name();\n }", "@Override\n public String toString() {\n \treturn \"lastname : \"+this.userLastname+\" firstname: \"+this.userFirstname+\" username: \"+this.userLogin+\" email: \"+this.userEmail+\" role: \"+this.roles;\n }", "@Override\n public String toString() {\n String output = \"User Info for: \" + getId();\n output += \"\\n\\tName: \" + getFirstName() + \" \" + getLastName();\n output += \"\\n\\tCreated on: \" + DF.format(getEnrolDate());\n output += \"\\n\\tLast access: \" + DF.format(getLastAccess());\n \n return output;\n }", "public UserInfo getUserInfo() {\n Authentication authentication = getAuthentication();\n if(authentication == null) {\n throw new AuthenticationCredentialsNotFoundException(\"No user is currently logged in.\");\n }\n return (UserInfo) authentication.getPrincipal();\n }", "@Override\n public String toString(){\n return String.format(\"ApplicationUser ehrId: '%s', shimmerId: '%s', shimKey: '%s', is logged in: '%s'\", applicationUserId.getEhrId(), shimmerId, getApplicationUserId().getShimKey());\n }", "public static void checkAccess() throws SecurityException {\n if(isSystemThread.get()) {\n return;\n }\n //TODO: Add Admin Checking Code\n// if(getCurrentUser() != null && getCurrentUser().isAdmin()) {\n// return;\n// }\n throw new SecurityException(\"Invalid Permissions\");\n }", "@GetMapping(\"/whoami\")\n public User whoAmI() {\n return userService.findCurrentUser();\n }", "public static void ShowAdminPreferences() {\n if (Controller.permission.GetUserPermission(\"EditUser\")) {\n ToggleVisibility(UsersPage.adminWindow);\n } else {\n DialogWindow.NoAccessTo(\"Admin options\");\n }\n }", "@PermitAll\n @Override\n public List<Role> getCurrentUserRoles() {\n Map params = new HashMap<String, Object>();\n params.put(CommonSqlProvider.PARAM_QUERY, Role.QUERY_GET_ROLES_BY_USER_NAME);\n params.put(User.PARAM_USERNAME, this.getUserName());\n return getRepository().getEntityList(Role.class, params);\n }", "@RequestMapping(value = \"/403\", method = RequestMethod.GET)\n\tpublic ModelAndView accesssDenied() {\n\t\tModelAndView model = new ModelAndView();\n\t\t// check if user is login\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tif (!(auth instanceof AnonymousAuthenticationToken)) {\n\t\t\tUserDetails userDetail = (UserDetails) auth.getPrincipal();\n\t\t\tSystem.out.println(userDetail);\n\t\t\tmodel.addObject(\"username\", userDetail.getUsername());\n\n\t\t}\n\t\tmodel.setViewName(\"403\");\n\t\treturn model;\n\t}", "String getRole();", "String getRole();", "@PostAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(returnObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"returnObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"isAnonymous() OR returnObject.username == principal.username\")\r\n \tpublic SystemUserDTO getSystemUserByUsername(String username);", "@Override\n\tprotected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {\n\t\tif (principals == null) {\n\t\t\tthrow new AuthorizationException(\"PrincipalCollection method argument cannot be null.\");\n\t\t}\n\t\tPrincipal principal = (Principal) getAvailablePrincipal(principals);\n\t\tString username = principal.getUsername();\n\t\tSet<String> roleCodes = new HashSet<String>(repository.findRoleCodesByUsername(username));\n\t\tList<? extends Permission> permissions = repository.findPermissionsByUsername(username);\n\t\tList<String> resourceRightCodes = new ArrayList<String>(permissions.size());\n\t\tfor (Permission permission : permissions) {\n\t\t\tresourceRightCodes.add(permission.getResourceSymbol());\n\t\t}\n\t\tSet<String> perms = PermissionUtils.toStringPermissions(resourceRightCodes, repository);\n\t\tSimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roleCodes);\n\t\tinfo.setStringPermissions(perms);\n\t\treturn info;\n\t}", "public List<String> showPersonalDetails()\n {\n return userFan.showPersonalDetails();\n }", "public List<SecRole> getRolesByUser(SecUser aUser);", "public List<String> show () {\n\t\treturn userDao.show();\n\t}", "public String showUser(){\n String dataUser = \"\";\n for(int i = 0; i<MAX_USER; i++){\n if(user[i] != null){\n dataUser += user[i].showDataUser();\n }\n }\n return dataUser;\n }", "@Override\n public String toString(){\n return role;\n }", "public List<StudentVM> getAllStudentDetailsAdmin(String userUuid);", "List<SysRole> getUserRoles(int userId);", "@GET\n @Path(\"/roles\")\n @Produces(MediaType.TEXT_PLAIN)\n @RolesAllowed(\"Subscriber\")\n public String helloRoles() {\n return sub;\n }", "public int getMetaPrivileges();", "public boolean securityStatus()\n {\n return m_bSecurity;\n }", "public List<String> getAuthorizedSeriesSecurityGroups() {\n return getAuthorizedSeriesSecurityGroups(RoleType.READ);\n }", "@GetMapping(\"/myCompetitionAdminRequest\")\n\tpublic ModelAndView showCompAdminRequest() {\n\n\t\tAuthentication authentication = SecurityContextHolder.getContext().getAuthentication();\n\t\tString currentPrincipalName = authentication.getName();\n\n\t\tModelAndView mav = new ModelAndView(\"compAdminRequests/compAdminRequestDetails\");\n\t\tmav.addObject(this.compAdminRequestService.findCompAdminRequestByUsername(currentPrincipalName));\n\t\treturn mav;\n\t}", "java.lang.String getAdmin();", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getUserArn() != null)\n sb.append(\"UserArn: \").append(getUserArn()).append(\",\");\n if (getProjectRole() != null)\n sb.append(\"ProjectRole: \").append(getProjectRole()).append(\",\");\n if (getRemoteAccessAllowed() != null)\n sb.append(\"RemoteAccessAllowed: \").append(getRemoteAccessAllowed());\n sb.append(\"}\");\n return sb.toString();\n }", "public List<String> grantpermission() {\n\t\tList<Integer> userids = new ArrayList<>();\n\t\tuserids = crud1.grantPermission();\n\t\tList<String> username = new ArrayList<>();\n\t\tfor (Integer x : userids) {\n\n\t\t\tusername.add(crud1.findById(x).get().getUsername());\n\t\t}\n\t\treturn username;\n\t}", "@Override\n public String getUserGroupsQuery()\n {\n return \"SELECT ROLE_NAME FROM INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS WHERE GRANTEE=? AND ROLE_NAME!=GRANTEE;\";\n }", "@PostAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(returnObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"returnObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"(hasRole('REVISIONER') AND returnObject.type.typeLabel == 'REVISIONER') OR \"\r\n \t\t\t+ \"returnObject.username == principal.username\")\r\n \tpublic SystemUserDTO read(Long id);", "private void showUser() {\n\t\tCommonADO ado=CommonADO.getCommonADO();\r\n\t\tString sql=\"select * from Users\";\r\n\t\tResultSet rs=ado.executeSelect(sql);\r\n\t\tString str=\"\";\r\n\t\ttry {\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tString user=rs.getString(\"UserName\");\r\n\t\t\t\tString pass=rs.getString(\"Password\");\r\n\t\t\t\tString type=rs.getString(\"UserType\");\r\n\t\t\t\tif(type.equals(\"管理员\"))\r\n\t\t\t\t\tpass=\"******\";\r\n\t\t\t\tif(user.length()<12){\r\n\t\t\t\t\tfor(int i=user.length();i<=12;i++)\r\n\t\t\t\t\t\tuser+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(pass.length()<12){\r\n\t\t\t\t\tfor(int i=pass.length();i<=12;i++)\r\n\t\t\t\t\t\tpass+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(type.length()<12){\r\n\t\t\t\t\tfor(int i=type.length();i<=12;i++)\r\n\t\t\t\t\t\ttype+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tstr+=\"用户名:\"+user;\r\n\t\t\t\tstr+=\" 密码:\"+pass;\r\n\t\t\t\tstr+=\" 用户类型:\"+type+\"\\n\";\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttextAreaUser.setText(str);\r\n\t}", "public String usuarioconectado() {\n\t\tString nome;\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\n\t\tif (principal instanceof UserDetails) {\n\t\t\tnome = ((UserDetails) principal).getUsername();\n\t\t} else {\n\t\t\tnome = principal.toString();\n\t\t}\n\t\t// System.out.println(nome);\n\t\treturn nome;\n\t}", "String getValue() throws AccessDeniedException {\n\t performSecurityManagerCheck();\n\t return town;\n\t }", "java.lang.String getUser();", "public SecurityContext getSecurityContext();", "SecurityProfile securityProfile();", "@Override\n public String RolesStatistics() {\n List<Employee> allEmployees = payrollService.AllEmployees();\n int ceo=0,manager=0,project_manager=0,employee=0;\n\n StringBuilder sb = new StringBuilder(\"\");\n for(int i=0;i<allEmployees.size();i++) {\n Employee e = allEmployees.get(i);\n if(e.getRole().getTitle().equals(\"CEO\"))\n ceo++;\n else if(e.getRole().getTitle().equals(\"Manager\"))\n manager++;\n else if(e.getRole().getTitle().equals(\"Project Manager\"))\n project_manager++;\n else if(e.getRole().getTitle().equals(\"Employee\"))\n employee++;\n }\n sb.append(\"Employees: \"+employee+\"\\n\");\n sb.append(\"Project Managers: \"+project_manager+\"\\n\");\n sb.append(\"Managers: \"+manager+\"\\n\");\n sb.append(\"CEOs: \"+ceo+\"\\n\");\n\n return sb.toString();\n }", "public String toString() {\n return (\"Principal's username: \" + name);\n }", "public java.lang.String getUserRole() {\r\n return userRole;\r\n }", "public org.tempuri.GetUserAccessRightWithUserDetailsResponseGetUserAccessRightWithUserDetailsResult getUserAccessRightWithUserDetails(java.lang.String msg, java.lang.String systemCode, java.lang.String companyCode) throws java.rmi.RemoteException;", "@GetMapping(path = \"/secure/hello\")\n\t@PreAuthorize(\"hasRole('USER') and #oauth2.hasScope('read')\")\n\tpublic String getSecureHello() {\n\t\treturn \"Hello Secure\";\n\t}", "@GetMapping(\"/adminShowList\")\n public String adminSList(@RequestParam(required = false, value=\"creator\") String userFilter, Model model){\n String nextPage = \"login\";\n User currentUser = (User) model.getAttribute(\"currentUser\");\n if (isValid(currentUser)){\n nextPage = \"adminShowList\";\n if (userFilter == null || userFilter.length() <=0)\n model.addAttribute(\"showList\", showRepo.findAll());\n else{\n User filteredUser = userRepo.findByUserName(userFilter).get(0);\n if (filteredUser != null)\n model.addAttribute(\"showList\", showRepo.findByUser(filteredUser));\n else\n model.addAttribute(\"showList\", showRepo.findAll());\n }\n } else{\n User user = new User();\n model.addAttribute(\"currentUser\", null);\n model.addAttribute(\"newUser\", user);\n }\n model.addAttribute(\"creators\", userRepo.findByUserRole(\"creator\"));\n return nextPage;\n }", "public float getSecurity() {\n return security;\n }", "@DOMSupport(DomLevel.ONE)\r\n @Property String getSecurity();", "private void displayMenu() {\r\n\t\tif (this.user instanceof Administrator) {\r\n\t\t\tnew AdminMenu(this.database, (Administrator) this.user);\r\n\t\t} else {\r\n\t\t\tnew BorrowerMenu(this.database);\r\n\t\t}\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn wcRole.toString();\n\t}", "@Override\r\n\tprotected AuthorizationInfo doGetAuthorizationInfo(final PrincipalCollection principals) {\n\t\tfinal String email = (String) principals.getPrimaryPrincipal();\r\n\t\tfinal User user = userRepository.findByEmailAndActive(email, true);\r\n\t\tif (user == null) {\r\n\t\t\tthrow new UnknownAccountException(\"Account does not exist\");\r\n\t\t}\r\n\t\tfinal int totalRoles = user.getRoles().size();\r\n\t\tfinal Set<String> roleNames = new LinkedHashSet<>(totalRoles);\r\n\t\tfinal Set<String> permissionNames = new LinkedHashSet<>();\r\n\t\tif (totalRoles > 0) {\r\n\t\t\tfor (Role role : user.getRoles()) {\r\n\t\t\t\troleNames.add(role.getName());\r\n\t\t\t\tfor (Permission permission : role.getPermissions()) {\r\n\t\t\t\t\tpermissionNames.add(permission.getName());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinal SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roleNames);\r\n\t\tinfo.setStringPermissions(permissionNames);\r\n\t\treturn info;\r\n\t}", "public List<UserCombinedDTO> getUserDetails(AdminBean adminBean, UserAccountDTO currentUser) {\r\n\t\t\r\n\t\tArrayList<UserCombinedDTO> returnValue = new ArrayList<UserCombinedDTO>();\r\n\t\ttry{\r\n\t\t\treturnValue = adminDAO.getUserDetails(adminBean.getGroupCode(), currentUser);\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\tadminBean.setReturnMessage(\"Failed to retrieve admin User Details list\");\r\n\t\t}\t\t\r\n\t\treturn returnValue;\r\n\t}", "public String toString() {\n return \"RoleName:DisplayName:Affiliate \" + getName() + \":\" + getDisplayName() + \":\" + getAffiliate().displayValue;\n }", "public int getCountAllSecRoles();", "public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(getClass().getName());\n buffer.append(\"@\");\n buffer.append(Integer.toHexString(hashCode()));\n buffer.append(\" [\");\n buffer.append(\"userId\").append(\"='\").append(userId).append(\"' \");\n buffer.append(\"role\").append(\"='\").append(role).append(\"' \");\n buffer.append(\"]\");\n\n return buffer.toString();\n }", "public String get_snmpsecurityname()\r\n\t{\r\n\t\treturn this.snmpsecurityname;\r\n\t}", "private void getUserInfo() {\n\t}", "@RequestMapping(value = \"/403\", method = RequestMethod.GET)\n \tpublic ModelAndView accesssDenied() {\n\n \t ModelAndView model = new ModelAndView();\n \t\t\n \t //check if user is login\n \t Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n \t if (!(auth instanceof AnonymousAuthenticationToken)) {\n \t\tUserDetails userDetail = (UserDetails) auth.getPrincipal();\t\n \t\tmodel.addObject(\"username\", userDetail.getUsername());\n \t }\n \t\t\n \t model.setViewName(\"403\");\n \t return model;\n\n \t}", "private String getLoggedInUser() {\r\n\t\tOptional<Authentication> authentication = Optional\r\n\t\t\t\t.ofNullable(SecurityContextHolder.getContext().getAuthentication());\r\n\t\treturn authentication.map(Authentication::getPrincipal).map(obj -> (UserDetails) obj)\r\n\t\t\t\t.map(UserDetails::getUsername).orElse(null);\r\n\t}", "@Override\n\tpublic Map<String, Object> getUserInfoDetail(Map<String, Object> reqs) {\n\t\treturn joaSimpleDao.retrieve(\"tp_users\", reqs);\n\t}", "public String getAdminUserName() {\n return adminUserName;\n }", "public void printUserInfo(int index) {\n System.out.print(userInfo.get(index).getUserId() + \" -> \");\n System.out.print(userInfo.get(index).getUserRole() + \" \");\n System.out.print(userInfo.get(index).getFirstName() + \" \");\n System.out.print(userInfo.get(index).getLastName() + \" \");\n System.out.print(userInfo.get(index).getAddress() + \" \");\n System.out.print(userInfo.get(index).getCity() + \" \");\n System.out.print(userInfo.get(index).getBasicSalary() + \" \");\n System.out.println(userInfo.get(index).getMobileNumber() + \" \");\n\n }", "SecurityRole getRole();", "public int getL1UserInformation();", "@Override\n public JSONObject viewSLCustomerListByFnManager(String username) {\n\n return in_salescustdao.viewSLCustomerByFnManager(username);\n }", "public UserInfo getCurrentUser() {\n UserInfo currentUserLU;\n if (this.mInjector.checkCallingPermission(\"android.permission.INTERACT_ACROSS_USERS\") != 0 && this.mInjector.checkCallingPermission(\"android.permission.INTERACT_ACROSS_USERS_FULL\") != 0) {\n String msg = \"Permission Denial: getCurrentUser() from pid=\" + Binder.getCallingPid() + \", uid=\" + Binder.getCallingUid() + \" requires \" + \"android.permission.INTERACT_ACROSS_USERS\";\n Slog.w(\"ActivityManager\", msg);\n throw new SecurityException(msg);\n } else if (this.mTargetUserId == -10000) {\n return getUserInfo(this.mCurrentUserId);\n } else {\n synchronized (this.mLock) {\n currentUserLU = getCurrentUserLU();\n }\n return currentUserLU;\n }\n }", "public Set<Role> getCallerRoles() {\n return callerRoles;\n }", "@GetMapping(\"/my-info\")\n\t@Secured({Roles.ADMIN, Roles.BOSS, Roles.WORKER})\n\tpublic ResponseEntity<EmployeeDto> getMyInfo() {\n\t\tLogStepIn();\n\n\t\t// Gets the currently logged in user's name\n\t\tString username = SecurityContextHolder.getContext().getAuthentication().getName();\n\n\t\tEmployee employee = userRepository.findByName(username).getEmployee();\n\t\treturn LogStepOut(ResponseEntity.ok(toDto(employee)));\n\t}", "public List<Yng_Security> findAll() {\n\t\treturn securityDao.findAll();\r\n\t}", "public ArrayList<Role> getRoles()\r\n {\r\n return this.securityInfo.getRoles();\r\n }", "public String listUsers(){\n \tStringBuilder sb = new StringBuilder();\n \tif(users.isEmpty()){\n \t\tsb.append(\"No existing Users yet\\n\");\n \t}else{\n \t\tsb.append(\"Meeting Manager Users:\\n\");\n \t\tfor(User u : users){\n \t\t\tsb.append(\"*\"+u.getEmail()+\" \"+ u.getPassword()+\" \\n\"+u.listInterests()+\"\\n\");\n \t\t}\n \t}\n \treturn sb.toString();\n }", "public String getCurrentLoggedUserinfo() {\n\n\t\tClient client = Client.create();\n\n\t\tWebResource webResource = client.resource(\"http://localhost:8083/UserAccounts/UserAccountService/User_logins\");\n\n\t\tClientResponse response = webResource.accept(\"application/json\").get(ClientResponse.class);\n\n\t\tString output = response.getEntity(String.class);\n\n\t\tSystem.out.println(output);\n\n\t\treturn output;\n\n\t}", "@Override\n public String getTypeForDisplay() {\n return \"User\";\n }" ]
[ "0.61724496", "0.6023763", "0.59623015", "0.55424106", "0.55361867", "0.54337543", "0.542844", "0.54110146", "0.53906715", "0.5351928", "0.5350035", "0.5300452", "0.5288586", "0.5267127", "0.5265061", "0.5262446", "0.525708", "0.5253359", "0.5248268", "0.5215554", "0.52115524", "0.52111584", "0.52044207", "0.5198692", "0.51797503", "0.517296", "0.5169548", "0.5168821", "0.5163434", "0.51619786", "0.51569504", "0.5155764", "0.5145004", "0.51448625", "0.51408434", "0.51323557", "0.5132185", "0.51317686", "0.5127223", "0.5122444", "0.5120188", "0.5120188", "0.5104769", "0.509013", "0.50897497", "0.5081039", "0.50793266", "0.5078651", "0.5076769", "0.5069333", "0.50672024", "0.5063016", "0.5059725", "0.5058421", "0.5058232", "0.5058012", "0.5057872", "0.5042504", "0.5030773", "0.5024281", "0.5018622", "0.5015052", "0.50076854", "0.5007401", "0.50030345", "0.49962986", "0.49946895", "0.4987934", "0.49853584", "0.49830055", "0.49823025", "0.49753347", "0.49750325", "0.49682674", "0.4966673", "0.4961358", "0.49606743", "0.49486306", "0.49450642", "0.49422905", "0.49394193", "0.49335667", "0.49294043", "0.4928747", "0.49274123", "0.49268565", "0.49266753", "0.49159613", "0.49159482", "0.49125588", "0.49068", "0.49061447", "0.48999888", "0.48888355", "0.48796365", "0.48675424", "0.4854855", "0.4854758", "0.48525083", "0.4850825" ]
0.5757635
3
Returns server configuration and version related information to the caller. The admin tool uses it to present server related information to the user.
public ShowSystemPropertiesResponse showSystemProperties(ShowSystemPropertiesRequest request) throws GPUdbException { ShowSystemPropertiesResponse actualResponse_ = new ShowSystemPropertiesResponse(); submitRequest("/show/system/properties", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServerDetails();", "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}", "private String getServerDetails() {\n String sServerLine = \"Server: Ramon's Killer \";\n String sSocketType = (bIsSecure ? \"(SECURE)\" : \"(unsecure)\");\n sServerLine = sServerLine + sSocketType + \" Server\";\n return sServerLine;\n }", "public String getServerVersion();", "public static ServerConfiguration getServerConfiguration() {\n return getOctaneDescriptor().getServerConfiguration();\n }", "public String configurationInfo();", "public String getServer()\n {\n return server;\n }", "public String getServerDescription();", "public String getServer() {\r\n return server;\r\n }", "public static String getServer() {\n\t\tif(produccion){\n\t\t\treturn server_produccion;\n\t\t}else{\n\t\t\treturn server;\n\t\t}\t\t\n\t}", "@Deprecated\n public synchronized ODocument getServerInfo() throws IOException {\n checkConnected();\n return remote.getServerInfo(user, password);\n }", "public LocalServerConfig getConfig() {\n return serverConfig;\n }", "public String getServerName();", "public String getSERVER() {\n \t\treturn SERVER;\n \t}", "public ServerProperties getServerProperties()\n\t{\n\t\tif (serverProperties == null)\n\t\t{\n\t\t\tConfig config = configService.getConfig(\"Server\");\n\t\t\tserverProperties = (ServerConfigElement)config.getConfigElement(ServerConfigElement.CONFIG_ELEMENT_ID);\n\t\t}\n\t\treturn serverProperties;\n\t}", "private JsonObject getServerData() {\n // Minecraft specific data\n int playerAmount = Server.getInstance().getOnlinePlayers().size();\n int onlineMode = Server.getInstance().getPropertyBoolean(\"xbox-auth\", true) ? 1 : 0;\n String softwareVersion = Server.getInstance().getApiVersion() + \" (MC: \" + Server.getInstance().getVersion().substring(1) + \")\";\n String softwareName = Server.getInstance().getName();\n \n // OS/Java specific data\n String javaVersion = System.getProperty(\"java.version\");\n String osName = System.getProperty(\"os.name\");\n String osArch = System.getProperty(\"os.arch\");\n String osVersion = System.getProperty(\"os.version\");\n int coreCount = Runtime.getRuntime().availableProcessors();\n \n JsonObject data = new JsonObject();\n \n data.addProperty(\"serverUUID\", serverUUID);\n \n data.addProperty(\"playerAmount\", playerAmount);\n data.addProperty(\"onlineMode\", onlineMode);\n data.addProperty(\"bukkitVersion\", softwareVersion);\n data.addProperty(\"bukkitName\", softwareName);\n \n data.addProperty(\"javaVersion\", javaVersion);\n data.addProperty(\"osName\", osName);\n data.addProperty(\"osArch\", osArch);\n data.addProperty(\"osVersion\", osVersion);\n data.addProperty(\"coreCount\", coreCount);\n \n return data;\n }", "public Long getServerVersion() {\n\t\treturn serverVersion;\n\t}", "public String getServerVersion() throws IOException {\n\t\treturn Core.getServerVersion(getHttpMethodExecutor());\n\t}", "@GetMapping()\n public String getServerVersion() {\n return versionProperties.getVersion();\n }", "@Override\n public String getServerDisplayName() {\n return serverDisplayName;\n }", "public static server getServer(){\n return thisServer;\n }", "private String getConfigInfo(boolean verbose) {\r\n StringBuilder builder = new StringBuilder();\r\n\r\n GridHubConfiguration config = getRegistry().getConfiguration();\r\n builder.append(\"<b>Config for the hub :</b><br/>\");\r\n builder.append(prettyHtmlPrint(config));\r\n\r\n if (verbose) {\r\n\r\n GridHubConfiguration tmp = new GridHubConfiguration();\r\n\r\n builder.append(\"<b>Config details :</b><br/>\");\r\n builder.append(\"<b>hub launched with :</b>\");\r\n builder.append(tmp.hubConfig);\r\n\r\n\r\n builder.append(\"<br/><b>the final configuration comes from :</b><br/>\");\r\n builder.append(\"<b>the default :</b><br/>\");\r\n builder.append(prettyHtmlPrint(tmp));\r\n\r\n builder.append(prettyHtmlPrint(tmp));\r\n }\r\n return builder.toString();\r\n }", "public String getServername() {\r\n return servername;\r\n }", "public String getServerName(){\n return this.serverName;\n }", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "public String getStunServer();", "public Properties getProperties() {\n return this.serverProperties;\n }", "@Override\n\tprotected String getServerAdapter() {\n\t\treturn \"Container Development Environment 3.2\";\n\t}", "public String getServerName() {\n return serverName;\n }", "public String getServerName() {\n return serverName;\n }", "private void updateServerInfo() {\n ServerInfo serverInfo = new ServerInfo(serverConfig.getBaseURL(), serverConfig.getInfoURL(), serverRepositories.keySet());\n String serverInfoJson = new GsonBuilder().setPrettyPrinting().create().toJson(serverInfo);\n try {\n Files.write(Paths.get(\"\").resolve(Filenames.FILENAME_SERVERINFO), serverInfoJson.getBytes(StandardCharsets.UTF_8));\n } catch (IOException e) {\n log.error(\"could not write serverinfo file.\", e);\n }\n }", "ServerEntry getServer();", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "private static ServerConfigPOJO defaultServerConfig() {\n return ServerConfigParser.readServerConfig();\n }", "public GENServer getServer() {\n return server;\n }", "public String[] getConnessionDetails() {\r\n\t\treturn new String[]{server.getText(),port.getText(),database.getText(),user.getText(),password.getText()};\r\n\t}", "public ServerConfigManager getServerConfigManager() {\n return this.serverConfigManager;\n }", "S getServer();", "private static String getVersion(Server server) {\n final String packageName = server.getClass().getPackage().getName();\n return packageName.substring(packageName.lastIndexOf('.') + 1);\n }", "String getServerName() {\n return game.z.C;\n }", "void askServerInfo();", "public Server getServer() {\n return server;\n }", "public String getPortalInfo() {\r\n return getPortalName() + \"/\" + getPortalVersion();\r\n }", "public void clientInfo() {\n uiService.underDevelopment();\n }", "public List<Server> getServerList() {\n return serverList;\n }", "@Override\n\tpublic List<String> getServersDescription() {\n\t\treturn null;\n\t}", "public String getServerURL() {\n return serverURL;\n }", "public ServerInfo(Server server) {\n if (server == null) {\n throw new NullArgumentException(\"Server must not be null\");\n }\n\n this.logger = server.getLogger();\n\n BufferedImage image;\n\n try {\n image = ImageIO.read(new File(\"server-icon.png\"));\n }\n catch (Exception e) {\n image = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);\n }\n\n this.setImage(image);\n this.setMotd(server.getMotd());\n }", "public String supportedServerVersions() {\n return this.supportedServerVersions;\n }", "public MinecraftServer getServer() {\n\t\treturn MinecraftServer.getServer();\n\t}", "public interface GlobalServerConfiguration {\n\n /**\n * Gets the location for the AdapterConfig for the specified namespace\n */\n public String getAdapterConfigLocation(String namespace);\n\n /**\n * Gets the location of the FeedConfig for the specified namespace\n */\n public String getFeedConfigLocation(String namespace);\n\n /**\n * Gets the Feed Configuration suffix\n */\n public String getFeedConfigSuffix();\n\n /**\n * Gets the namespace\n */\n public String getFeedNamespace(String namespace);\n\n /**\n * Gets the namespace prefix\n */\n public String getFeedNamespacePrefix(String namespace);\n\n /**\n * Gets the Server port\n */\n public int getPort();\n\n /**\n * Gets the URI for the feedserver with the specified namespace\n */\n public String getServerUri(String namespace);\n\n /**\n * Gets URI prefix for Feeds\n */\n public String getFeedPathPrefix();\n\n /**\n * Gets the {@link FeedConfiguration} for the specified feed in the namespace\n * \n * @param namespace The namespace the feed is in\n * @param feedId The feed to get the {@link FeedConfiguration} for\n * @param userId User email of per user feed requested; null if not per user feed\n */\n public FeedConfiguration getFeedConfiguration(String namespace, String feedId, String userId)\n throws FeedConfigStoreException;\n\n /**\n * Get the fully qualified class name for adapter wrapper manager.\n * \n * @return fully qualified class name for adapter wrapper manager.\n */\n public String getWrapperManagerClassName();\n\n /**\n * Gets the {@link FeedConfigStore} for the Server Configuration\n */\n public FeedConfigStore getFeedConfigStore();\n\n /**\n * Get the fully qualified class name of the provider that will be used for\n * this server.\n * \n * @return fully qualified class name of the Provider.\n */\n public String getProviderClassName();\n\n @SuppressWarnings(\"unchecked\")\n public AdapterBackendPool getAdapterBackendPool(String poolId);\n\n @SuppressWarnings(\"unchecked\")\n public void setAdapterBackendPool(String poolId, AdapterBackendPool pool);\n\n public AclValidator getAclValidator();\n\n public void setAclValidator(AclValidator aclValidator);\n\n}", "public String[] updateInfoAdmin(Session session) throws RemoteException {\n\t\tSystem.out.println(\"Server model invokes updateInfoAdmin() method\");\n\t\treturn null;\n\t}", "@Override\n\t\tpublic String getServerName() {\n\t\t\treturn null;\n\t\t}", "public String getEventingServer() {\n\t\treturn eventingServer;\n\t}", "protected void buildServerInfoStore() {\n\n if (serverInfoStore != null)\n return;\n\n serverInfoStore = new DefaultVOMSServerInfoStore.Builder()\n .lookupStrategy(vomsesLookupStrategy).storeListener(storeListener)\n .vomsesPaths(vomsesLocations).build();\n }", "@RequestMapping(value = { \"/\", \"/version\" }, method = RequestMethod.GET)\n\tpublic @ResponseBody Map<String, String> version() {\n\t\tMap<String, String> message = new HashMap<String, String>();\n\n\t\tmessage.put(\"name\", props.getProperty(\"build.artifact\"));\n\t\tmessage.put(\"version\", props.getProperty(\"build.version\"));\n\t\tmessage.put(\"timestamp\", props.getProperty(\"build.time\"));\n\n\t\treturn message;\n\t}", "public static LinkedHashMap<String, String> getServerEnvi() {\n return _m_server_envi;\n }", "public String getServerAddress() {\r\n\t\treturn this.serverAddress;\r\n\t}", "public String getServerUrl() {\n return mServerUrl;\n }", "public String getIpServer()\n \t{\n \t\treturn ipServer;\n \t}", "@Override\n public String getServletInfo() {\n return \"Servlet is serving eBooksStoreAdminUsersPage.jsp\";\n }", "private static String getServerUrl() {\n\t\treturn \"http://jfabricationgames.ddns.net:5715/genesis_project_server/genesis_project/genesis_project/\";\n\t}", "protected final String getServerUrl() {\n return this.serverUrl;\n }", "@Override\n public String getServletInfo() {\n return \"Adds a Username and Password to the Database. \"\n + \"Written by Michael Zijlstra 10/06/2016.\";\n }", "public Object server() {\n return this.server;\n }", "public ServerList getServers() {\r\n return this.servers;\r\n }", "public String getTutRepositoryServerName()\n {\n return tutRepositoryServerName;\n }", "ServerFormatter getServerFormatter()\n {\n return this.srv_fmt;\n }", "public static interface ServerCommon\n\t{\n\t\t/**\n\t\t * Return player list.\n\t\t * @return Set<Player> currently connected players.\n\t\t * @throws RpcException On connection error.\n\t\t * @throws StateMachineNotExpectedEventException If server is not in GameCreation state.\n\t\t */\n\t\tMap<String, IPlayerConfig> getPlayerList() throws RpcException, StateMachineNotExpectedEventException;\n\t\t\n\t\t/**\n\t\t * Return the current game config.\n\t\t * @return GameConfig current game config.\n\t\t * @throws RpcException On connection error.\n\t\t * @throws StateMachineNotExpectedEventException.\n\t\t */\n\t\tIGameConfig getGameConfig() throws RpcException, StateMachineNotExpectedEventException;\t\t\t\t\t\t\t\t\n\t}", "private String getZkServers(ServletContext context){\n Configuration config = new Configuration();\n config.addResource(\"pxf-site.xml\");\n String zk_hosts = config.get(\"zookeeper\");\n if(LOG.isDebugEnabled())\n LOG.debug(\"zookeeper server is :\" + zk_hosts);\n\n return zk_hosts;\n }", "@Override\n @GET\n @Path(\"/servers\")\n @Produces(\"application/json\")\n public Response getServers() throws Exception {\n log.trace(\"getServers() started.\");\n JSONArray json = new JSONArray();\n for (Server server : cluster.getServerList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/servers/%d\", rootUri, server.getServerId());\n String serverUri = String.format(\"/providers/%d/servers/%d\", provider.getProviderId(), server.getServerId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", serverUri);\n json.put(o);\n }\n\n log.trace(\"getServers() finished successfully.\");\n return Response.ok(json.toString()).build();\n }", "public static server getNameServer(){\n return nameServer;\n }", "protected static AuoServer getServer() {\n return server;\n }", "public String getServerName() {\n if (server == null) {\n final String version = OpenEjbVersion.get().getVersion();\n final String os = System.getProperty(\"os.name\") + \"/\" + System.getProperty(\"os.version\") + \" (\" + System.getProperty(\"os.arch\") + \")\";\n server = \"OpenEJB/\" + version + \" \" + os;\n }\n return server;\n }", "public ServerConfig() {\n initComponents();\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public String getServerName() {\n\t\treturn m_serverName;\n\t}", "public List<ServerHardware> getServers();", "private ApiInfo apiInfo() {\n\t\treturn new ApiInfo(\"Langton ant app\", \"rest api for langton ant app\", version, null,\n\t\t\t\tnew Contact(\"leclerc\", \"N/A\", \"[email protected]\"), null, null, Collections.EMPTY_LIST);\n\t}", "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}", "ServerInfo stub()\n {\n return new ServerInfo(NAMING_IP, REGISTRATION_PORT);\n }", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "public String getConfig();", "public static String getServerUrl(Context context) {\n if (mServerUrl == null) {\n ApplicationInfo appInfo = null;\n try {\n appInfo = context.getPackageManager()\n .getApplicationInfo(context.getPackageName(),\n PackageManager.GET_META_DATA);\n mServerUrl = appInfo.metaData.getString(\"WHISPER_SERVER_ADDRESS\");\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n }\n return mServerUrl;\n }", "public String getServerAddress() {\n\t\treturn mServerAddress;\n\t}", "String getServletInfo();", "public abstract String globalInfo();", "public String getAppletInfo() {\r\n return \"NanoGong applet version \" + VERSION_NUMBER + \" by the Gong Project (http://gong.ust.hk)\";\r\n }", "public ServerInfo() {\n this.logger = null;\n }", "public String getHttpServer() {\n return httpServer;\n }", "public ArrayList<Server> getServers(){\n return this.serversList;\n }", "@Override\n public String getServletInfo() {\n return \"Louie Info Home\";\n }", "void doGetAdminInfo() {\n\t\tlog.config(\"doGetAdminInfo()...\");\n\t\tthis.rpcService.getAdminInfo(new AsyncCallback<DtoAdminInfo>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tString errorMessage = \"Error when getting admin info! : \" + caught.getMessage();\n\t\t\t\tlog.severe(errorMessage);\n\t\t\t\tgetAdminPanel().setActionResult(errorMessage, ResultType.error);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(DtoAdminInfo adminInfo) {\n\t\t\t\tlog.config(\"getAdminInfo() on success - \" + adminInfo.getListLogFilenames().size() + \" logs filenames.\");\n\t\t\t\tgetAdminPanel().setAdminInfo(adminInfo);\n\t\t\t}\n\t\t});\n\t}", "private ApiInfo getApiInfo() {\n\t\treturn new ApiInfoBuilder().title(\"Online Salon Appointment API\").version(\"1.0\")\n\t\t\t\t.description(\"API for online salon appointment.\").contact(new Contact(\"TEAM 1\",\n\t\t\t\t\t\t\"http://localhost:8100/OnlineSalonAppointment/swagger-ui/\", \"[email protected]\"))\n\t\t\t\t.license(\"Apache License Version 2.0\").build();\n\t}", "public List<Server> getAllServers(){\n\t\tlogger.info(\"Getting the all server details\");\n\t\treturn new ArrayList<Server>(servers.values());\n\t}", "@Override\n public Observable<ServerConfigBean> getServerConfig() {\n\n return Observable.create(new Observable.OnSubscribe<ServerConfigBean>() {\n @Override\n public void call(Subscriber<? super ServerConfigBean> subscriber) {\n ServerConfigBean bean = new ServerConfigBean();\n bean.setSplashUrl(\"http://biggar.image.alimmdn.com/1464166847649\");\n subscriber.onNext(bean);\n }\n }\n\n );\n }", "public abstract String getConfig();", "protected void getInfoFromServer(String testName) {\r\n\t\tapplicationId = getApplicationId();\r\n\t\tversionId = getVersionId();\r\n\t\tenvironmentId = getEnvironmentId();\r\n\t\t\r\n\t\tif (testName != null) {\r\n\t\t\ttestCaseId = getTestCaseId(testName);\r\n\t\t}\r\n\t}", "public LocalServer getServer() {\n return server;\n }", "public String getCurrentUrlConfig() {\n String primary = AbstractConfigHandler.getPrimaryDataServer();\n if (primary == null) {\n logger.debug(\"No primary dataserver found\");\n urlUnset();\n return null;\n } else {\n String url = addressHandler.getHttpAddress(primary);\n if (url == null) {\n logger.debug(\"No url set for dataserver: \" + primary);\n urlUnset();\n return null;\n } else {\n return verifyHttpProcess(url);\n }\n }\n }", "public String getServerUrl() {\n return ipAddress;\n }" ]
[ "0.70755666", "0.7050102", "0.6964623", "0.67212886", "0.6697325", "0.6594034", "0.65837944", "0.64689654", "0.64579946", "0.6393907", "0.6383796", "0.62876964", "0.62447894", "0.62373567", "0.619785", "0.6194958", "0.61531776", "0.6131783", "0.60944957", "0.6080584", "0.60801125", "0.6075833", "0.6060407", "0.60555434", "0.6024839", "0.6022797", "0.5962692", "0.59562576", "0.5946316", "0.5946316", "0.5936285", "0.59343606", "0.59268343", "0.5908522", "0.5879262", "0.5876481", "0.5833233", "0.5824272", "0.58173543", "0.580089", "0.57904893", "0.5768081", "0.5760078", "0.5752995", "0.5742771", "0.57396513", "0.57380396", "0.57367057", "0.57202053", "0.57159674", "0.5696403", "0.569055", "0.5674782", "0.5673058", "0.566519", "0.5664395", "0.5658624", "0.5655548", "0.5647135", "0.5644605", "0.56440806", "0.56414676", "0.5638805", "0.5635795", "0.56279135", "0.5627228", "0.56213206", "0.5617095", "0.5612952", "0.5608315", "0.56059813", "0.5601174", "0.56003165", "0.5594616", "0.5592816", "0.55892056", "0.55667394", "0.55542165", "0.55265695", "0.5523307", "0.55026394", "0.55026394", "0.5492915", "0.54831487", "0.5483067", "0.5476487", "0.547567", "0.5473823", "0.5466042", "0.5459359", "0.54588884", "0.54495466", "0.54489845", "0.54375345", "0.5435344", "0.5433859", "0.5432899", "0.5419928", "0.5407508", "0.5401896", "0.5398543" ]
0.0
-1
Returns server configuration and version related information to the caller. The admin tool uses it to present server related information to the user.
public ShowSystemPropertiesResponse showSystemProperties(Map<String, String> options) throws GPUdbException { ShowSystemPropertiesRequest actualRequest_ = new ShowSystemPropertiesRequest(options); ShowSystemPropertiesResponse actualResponse_ = new ShowSystemPropertiesResponse(); submitRequest("/show/system/properties", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServerDetails();", "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}", "private String getServerDetails() {\n String sServerLine = \"Server: Ramon's Killer \";\n String sSocketType = (bIsSecure ? \"(SECURE)\" : \"(unsecure)\");\n sServerLine = sServerLine + sSocketType + \" Server\";\n return sServerLine;\n }", "public String getServerVersion();", "public static ServerConfiguration getServerConfiguration() {\n return getOctaneDescriptor().getServerConfiguration();\n }", "public String configurationInfo();", "public String getServer()\n {\n return server;\n }", "public String getServerDescription();", "public String getServer() {\r\n return server;\r\n }", "public static String getServer() {\n\t\tif(produccion){\n\t\t\treturn server_produccion;\n\t\t}else{\n\t\t\treturn server;\n\t\t}\t\t\n\t}", "@Deprecated\n public synchronized ODocument getServerInfo() throws IOException {\n checkConnected();\n return remote.getServerInfo(user, password);\n }", "public LocalServerConfig getConfig() {\n return serverConfig;\n }", "public String getServerName();", "public String getSERVER() {\n \t\treturn SERVER;\n \t}", "public ServerProperties getServerProperties()\n\t{\n\t\tif (serverProperties == null)\n\t\t{\n\t\t\tConfig config = configService.getConfig(\"Server\");\n\t\t\tserverProperties = (ServerConfigElement)config.getConfigElement(ServerConfigElement.CONFIG_ELEMENT_ID);\n\t\t}\n\t\treturn serverProperties;\n\t}", "private JsonObject getServerData() {\n // Minecraft specific data\n int playerAmount = Server.getInstance().getOnlinePlayers().size();\n int onlineMode = Server.getInstance().getPropertyBoolean(\"xbox-auth\", true) ? 1 : 0;\n String softwareVersion = Server.getInstance().getApiVersion() + \" (MC: \" + Server.getInstance().getVersion().substring(1) + \")\";\n String softwareName = Server.getInstance().getName();\n \n // OS/Java specific data\n String javaVersion = System.getProperty(\"java.version\");\n String osName = System.getProperty(\"os.name\");\n String osArch = System.getProperty(\"os.arch\");\n String osVersion = System.getProperty(\"os.version\");\n int coreCount = Runtime.getRuntime().availableProcessors();\n \n JsonObject data = new JsonObject();\n \n data.addProperty(\"serverUUID\", serverUUID);\n \n data.addProperty(\"playerAmount\", playerAmount);\n data.addProperty(\"onlineMode\", onlineMode);\n data.addProperty(\"bukkitVersion\", softwareVersion);\n data.addProperty(\"bukkitName\", softwareName);\n \n data.addProperty(\"javaVersion\", javaVersion);\n data.addProperty(\"osName\", osName);\n data.addProperty(\"osArch\", osArch);\n data.addProperty(\"osVersion\", osVersion);\n data.addProperty(\"coreCount\", coreCount);\n \n return data;\n }", "public Long getServerVersion() {\n\t\treturn serverVersion;\n\t}", "public String getServerVersion() throws IOException {\n\t\treturn Core.getServerVersion(getHttpMethodExecutor());\n\t}", "@GetMapping()\n public String getServerVersion() {\n return versionProperties.getVersion();\n }", "@Override\n public String getServerDisplayName() {\n return serverDisplayName;\n }", "public static server getServer(){\n return thisServer;\n }", "private String getConfigInfo(boolean verbose) {\r\n StringBuilder builder = new StringBuilder();\r\n\r\n GridHubConfiguration config = getRegistry().getConfiguration();\r\n builder.append(\"<b>Config for the hub :</b><br/>\");\r\n builder.append(prettyHtmlPrint(config));\r\n\r\n if (verbose) {\r\n\r\n GridHubConfiguration tmp = new GridHubConfiguration();\r\n\r\n builder.append(\"<b>Config details :</b><br/>\");\r\n builder.append(\"<b>hub launched with :</b>\");\r\n builder.append(tmp.hubConfig);\r\n\r\n\r\n builder.append(\"<br/><b>the final configuration comes from :</b><br/>\");\r\n builder.append(\"<b>the default :</b><br/>\");\r\n builder.append(prettyHtmlPrint(tmp));\r\n\r\n builder.append(prettyHtmlPrint(tmp));\r\n }\r\n return builder.toString();\r\n }", "public String getServername() {\r\n return servername;\r\n }", "public String getServerName(){\n return this.serverName;\n }", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "public String getStunServer();", "public Properties getProperties() {\n return this.serverProperties;\n }", "@Override\n\tprotected String getServerAdapter() {\n\t\treturn \"Container Development Environment 3.2\";\n\t}", "public String getServerName() {\n return serverName;\n }", "public String getServerName() {\n return serverName;\n }", "private void updateServerInfo() {\n ServerInfo serverInfo = new ServerInfo(serverConfig.getBaseURL(), serverConfig.getInfoURL(), serverRepositories.keySet());\n String serverInfoJson = new GsonBuilder().setPrettyPrinting().create().toJson(serverInfo);\n try {\n Files.write(Paths.get(\"\").resolve(Filenames.FILENAME_SERVERINFO), serverInfoJson.getBytes(StandardCharsets.UTF_8));\n } catch (IOException e) {\n log.error(\"could not write serverinfo file.\", e);\n }\n }", "ServerEntry getServer();", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "private static ServerConfigPOJO defaultServerConfig() {\n return ServerConfigParser.readServerConfig();\n }", "public GENServer getServer() {\n return server;\n }", "public String[] getConnessionDetails() {\r\n\t\treturn new String[]{server.getText(),port.getText(),database.getText(),user.getText(),password.getText()};\r\n\t}", "public ServerConfigManager getServerConfigManager() {\n return this.serverConfigManager;\n }", "S getServer();", "private static String getVersion(Server server) {\n final String packageName = server.getClass().getPackage().getName();\n return packageName.substring(packageName.lastIndexOf('.') + 1);\n }", "String getServerName() {\n return game.z.C;\n }", "void askServerInfo();", "public Server getServer() {\n return server;\n }", "public String getPortalInfo() {\r\n return getPortalName() + \"/\" + getPortalVersion();\r\n }", "public void clientInfo() {\n uiService.underDevelopment();\n }", "public List<Server> getServerList() {\n return serverList;\n }", "@Override\n\tpublic List<String> getServersDescription() {\n\t\treturn null;\n\t}", "public String getServerURL() {\n return serverURL;\n }", "public ServerInfo(Server server) {\n if (server == null) {\n throw new NullArgumentException(\"Server must not be null\");\n }\n\n this.logger = server.getLogger();\n\n BufferedImage image;\n\n try {\n image = ImageIO.read(new File(\"server-icon.png\"));\n }\n catch (Exception e) {\n image = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);\n }\n\n this.setImage(image);\n this.setMotd(server.getMotd());\n }", "public String supportedServerVersions() {\n return this.supportedServerVersions;\n }", "public MinecraftServer getServer() {\n\t\treturn MinecraftServer.getServer();\n\t}", "public interface GlobalServerConfiguration {\n\n /**\n * Gets the location for the AdapterConfig for the specified namespace\n */\n public String getAdapterConfigLocation(String namespace);\n\n /**\n * Gets the location of the FeedConfig for the specified namespace\n */\n public String getFeedConfigLocation(String namespace);\n\n /**\n * Gets the Feed Configuration suffix\n */\n public String getFeedConfigSuffix();\n\n /**\n * Gets the namespace\n */\n public String getFeedNamespace(String namespace);\n\n /**\n * Gets the namespace prefix\n */\n public String getFeedNamespacePrefix(String namespace);\n\n /**\n * Gets the Server port\n */\n public int getPort();\n\n /**\n * Gets the URI for the feedserver with the specified namespace\n */\n public String getServerUri(String namespace);\n\n /**\n * Gets URI prefix for Feeds\n */\n public String getFeedPathPrefix();\n\n /**\n * Gets the {@link FeedConfiguration} for the specified feed in the namespace\n * \n * @param namespace The namespace the feed is in\n * @param feedId The feed to get the {@link FeedConfiguration} for\n * @param userId User email of per user feed requested; null if not per user feed\n */\n public FeedConfiguration getFeedConfiguration(String namespace, String feedId, String userId)\n throws FeedConfigStoreException;\n\n /**\n * Get the fully qualified class name for adapter wrapper manager.\n * \n * @return fully qualified class name for adapter wrapper manager.\n */\n public String getWrapperManagerClassName();\n\n /**\n * Gets the {@link FeedConfigStore} for the Server Configuration\n */\n public FeedConfigStore getFeedConfigStore();\n\n /**\n * Get the fully qualified class name of the provider that will be used for\n * this server.\n * \n * @return fully qualified class name of the Provider.\n */\n public String getProviderClassName();\n\n @SuppressWarnings(\"unchecked\")\n public AdapterBackendPool getAdapterBackendPool(String poolId);\n\n @SuppressWarnings(\"unchecked\")\n public void setAdapterBackendPool(String poolId, AdapterBackendPool pool);\n\n public AclValidator getAclValidator();\n\n public void setAclValidator(AclValidator aclValidator);\n\n}", "public String[] updateInfoAdmin(Session session) throws RemoteException {\n\t\tSystem.out.println(\"Server model invokes updateInfoAdmin() method\");\n\t\treturn null;\n\t}", "@Override\n\t\tpublic String getServerName() {\n\t\t\treturn null;\n\t\t}", "public String getEventingServer() {\n\t\treturn eventingServer;\n\t}", "protected void buildServerInfoStore() {\n\n if (serverInfoStore != null)\n return;\n\n serverInfoStore = new DefaultVOMSServerInfoStore.Builder()\n .lookupStrategy(vomsesLookupStrategy).storeListener(storeListener)\n .vomsesPaths(vomsesLocations).build();\n }", "@RequestMapping(value = { \"/\", \"/version\" }, method = RequestMethod.GET)\n\tpublic @ResponseBody Map<String, String> version() {\n\t\tMap<String, String> message = new HashMap<String, String>();\n\n\t\tmessage.put(\"name\", props.getProperty(\"build.artifact\"));\n\t\tmessage.put(\"version\", props.getProperty(\"build.version\"));\n\t\tmessage.put(\"timestamp\", props.getProperty(\"build.time\"));\n\n\t\treturn message;\n\t}", "public static LinkedHashMap<String, String> getServerEnvi() {\n return _m_server_envi;\n }", "public String getServerAddress() {\r\n\t\treturn this.serverAddress;\r\n\t}", "public String getServerUrl() {\n return mServerUrl;\n }", "public String getIpServer()\n \t{\n \t\treturn ipServer;\n \t}", "@Override\n public String getServletInfo() {\n return \"Servlet is serving eBooksStoreAdminUsersPage.jsp\";\n }", "private static String getServerUrl() {\n\t\treturn \"http://jfabricationgames.ddns.net:5715/genesis_project_server/genesis_project/genesis_project/\";\n\t}", "protected final String getServerUrl() {\n return this.serverUrl;\n }", "@Override\n public String getServletInfo() {\n return \"Adds a Username and Password to the Database. \"\n + \"Written by Michael Zijlstra 10/06/2016.\";\n }", "public Object server() {\n return this.server;\n }", "public ServerList getServers() {\r\n return this.servers;\r\n }", "public String getTutRepositoryServerName()\n {\n return tutRepositoryServerName;\n }", "ServerFormatter getServerFormatter()\n {\n return this.srv_fmt;\n }", "public static interface ServerCommon\n\t{\n\t\t/**\n\t\t * Return player list.\n\t\t * @return Set<Player> currently connected players.\n\t\t * @throws RpcException On connection error.\n\t\t * @throws StateMachineNotExpectedEventException If server is not in GameCreation state.\n\t\t */\n\t\tMap<String, IPlayerConfig> getPlayerList() throws RpcException, StateMachineNotExpectedEventException;\n\t\t\n\t\t/**\n\t\t * Return the current game config.\n\t\t * @return GameConfig current game config.\n\t\t * @throws RpcException On connection error.\n\t\t * @throws StateMachineNotExpectedEventException.\n\t\t */\n\t\tIGameConfig getGameConfig() throws RpcException, StateMachineNotExpectedEventException;\t\t\t\t\t\t\t\t\n\t}", "private String getZkServers(ServletContext context){\n Configuration config = new Configuration();\n config.addResource(\"pxf-site.xml\");\n String zk_hosts = config.get(\"zookeeper\");\n if(LOG.isDebugEnabled())\n LOG.debug(\"zookeeper server is :\" + zk_hosts);\n\n return zk_hosts;\n }", "@Override\n @GET\n @Path(\"/servers\")\n @Produces(\"application/json\")\n public Response getServers() throws Exception {\n log.trace(\"getServers() started.\");\n JSONArray json = new JSONArray();\n for (Server server : cluster.getServerList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/servers/%d\", rootUri, server.getServerId());\n String serverUri = String.format(\"/providers/%d/servers/%d\", provider.getProviderId(), server.getServerId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", serverUri);\n json.put(o);\n }\n\n log.trace(\"getServers() finished successfully.\");\n return Response.ok(json.toString()).build();\n }", "public static server getNameServer(){\n return nameServer;\n }", "protected static AuoServer getServer() {\n return server;\n }", "public String getServerName() {\n if (server == null) {\n final String version = OpenEjbVersion.get().getVersion();\n final String os = System.getProperty(\"os.name\") + \"/\" + System.getProperty(\"os.version\") + \" (\" + System.getProperty(\"os.arch\") + \")\";\n server = \"OpenEJB/\" + version + \" \" + os;\n }\n return server;\n }", "public ServerConfig() {\n initComponents();\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public String getServerName() {\n\t\treturn m_serverName;\n\t}", "public List<ServerHardware> getServers();", "private ApiInfo apiInfo() {\n\t\treturn new ApiInfo(\"Langton ant app\", \"rest api for langton ant app\", version, null,\n\t\t\t\tnew Contact(\"leclerc\", \"N/A\", \"[email protected]\"), null, null, Collections.EMPTY_LIST);\n\t}", "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}", "ServerInfo stub()\n {\n return new ServerInfo(NAMING_IP, REGISTRATION_PORT);\n }", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getServerName() {\n\t\treturn null;\n\t}", "public String getConfig();", "public static String getServerUrl(Context context) {\n if (mServerUrl == null) {\n ApplicationInfo appInfo = null;\n try {\n appInfo = context.getPackageManager()\n .getApplicationInfo(context.getPackageName(),\n PackageManager.GET_META_DATA);\n mServerUrl = appInfo.metaData.getString(\"WHISPER_SERVER_ADDRESS\");\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n }\n return mServerUrl;\n }", "public String getServerAddress() {\n\t\treturn mServerAddress;\n\t}", "String getServletInfo();", "public abstract String globalInfo();", "public String getAppletInfo() {\r\n return \"NanoGong applet version \" + VERSION_NUMBER + \" by the Gong Project (http://gong.ust.hk)\";\r\n }", "public ServerInfo() {\n this.logger = null;\n }", "public String getHttpServer() {\n return httpServer;\n }", "public ArrayList<Server> getServers(){\n return this.serversList;\n }", "@Override\n public String getServletInfo() {\n return \"Louie Info Home\";\n }", "void doGetAdminInfo() {\n\t\tlog.config(\"doGetAdminInfo()...\");\n\t\tthis.rpcService.getAdminInfo(new AsyncCallback<DtoAdminInfo>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tString errorMessage = \"Error when getting admin info! : \" + caught.getMessage();\n\t\t\t\tlog.severe(errorMessage);\n\t\t\t\tgetAdminPanel().setActionResult(errorMessage, ResultType.error);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(DtoAdminInfo adminInfo) {\n\t\t\t\tlog.config(\"getAdminInfo() on success - \" + adminInfo.getListLogFilenames().size() + \" logs filenames.\");\n\t\t\t\tgetAdminPanel().setAdminInfo(adminInfo);\n\t\t\t}\n\t\t});\n\t}", "private ApiInfo getApiInfo() {\n\t\treturn new ApiInfoBuilder().title(\"Online Salon Appointment API\").version(\"1.0\")\n\t\t\t\t.description(\"API for online salon appointment.\").contact(new Contact(\"TEAM 1\",\n\t\t\t\t\t\t\"http://localhost:8100/OnlineSalonAppointment/swagger-ui/\", \"[email protected]\"))\n\t\t\t\t.license(\"Apache License Version 2.0\").build();\n\t}", "public List<Server> getAllServers(){\n\t\tlogger.info(\"Getting the all server details\");\n\t\treturn new ArrayList<Server>(servers.values());\n\t}", "@Override\n public Observable<ServerConfigBean> getServerConfig() {\n\n return Observable.create(new Observable.OnSubscribe<ServerConfigBean>() {\n @Override\n public void call(Subscriber<? super ServerConfigBean> subscriber) {\n ServerConfigBean bean = new ServerConfigBean();\n bean.setSplashUrl(\"http://biggar.image.alimmdn.com/1464166847649\");\n subscriber.onNext(bean);\n }\n }\n\n );\n }", "public abstract String getConfig();", "protected void getInfoFromServer(String testName) {\r\n\t\tapplicationId = getApplicationId();\r\n\t\tversionId = getVersionId();\r\n\t\tenvironmentId = getEnvironmentId();\r\n\t\t\r\n\t\tif (testName != null) {\r\n\t\t\ttestCaseId = getTestCaseId(testName);\r\n\t\t}\r\n\t}", "public LocalServer getServer() {\n return server;\n }", "public String getCurrentUrlConfig() {\n String primary = AbstractConfigHandler.getPrimaryDataServer();\n if (primary == null) {\n logger.debug(\"No primary dataserver found\");\n urlUnset();\n return null;\n } else {\n String url = addressHandler.getHttpAddress(primary);\n if (url == null) {\n logger.debug(\"No url set for dataserver: \" + primary);\n urlUnset();\n return null;\n } else {\n return verifyHttpProcess(url);\n }\n }\n }", "public String getServerUrl() {\n return ipAddress;\n }" ]
[ "0.70755666", "0.7050102", "0.6964623", "0.67212886", "0.6697325", "0.6594034", "0.65837944", "0.64689654", "0.64579946", "0.6393907", "0.6383796", "0.62876964", "0.62447894", "0.62373567", "0.619785", "0.6194958", "0.61531776", "0.6131783", "0.60944957", "0.6080584", "0.60801125", "0.6075833", "0.6060407", "0.60555434", "0.6024839", "0.6022797", "0.5962692", "0.59562576", "0.5946316", "0.5946316", "0.5936285", "0.59343606", "0.59268343", "0.5908522", "0.5879262", "0.5876481", "0.5833233", "0.5824272", "0.58173543", "0.580089", "0.57904893", "0.5768081", "0.5760078", "0.5752995", "0.5742771", "0.57396513", "0.57380396", "0.57367057", "0.57202053", "0.57159674", "0.5696403", "0.569055", "0.5674782", "0.5673058", "0.566519", "0.5664395", "0.5658624", "0.5655548", "0.5647135", "0.5644605", "0.56440806", "0.56414676", "0.5638805", "0.5635795", "0.56279135", "0.5627228", "0.56213206", "0.5617095", "0.5612952", "0.5608315", "0.56059813", "0.5601174", "0.56003165", "0.5594616", "0.5592816", "0.55892056", "0.55667394", "0.55542165", "0.55265695", "0.5523307", "0.55026394", "0.55026394", "0.5492915", "0.54831487", "0.5483067", "0.5476487", "0.547567", "0.5473823", "0.5466042", "0.5459359", "0.54588884", "0.54495466", "0.54489845", "0.54375345", "0.5435344", "0.5433859", "0.5432899", "0.5419928", "0.5407508", "0.5401896", "0.5398543" ]
0.0
-1
Provides server configuration and health related status to the caller. The admin tool uses it to present server related information to the user.
public ShowSystemStatusResponse showSystemStatus(ShowSystemStatusRequest request) throws GPUdbException { ShowSystemStatusResponse actualResponse_ = new ShowSystemStatusResponse(); submitRequest("/show/system/status", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void getStatus() {\n\t\ttry {\n\t\t\tint i = 1;\n\t\t\tList<Object[]>serverDetails = ServerStatus.getServerDetails();\n\t\t\tfor (Object[] servers:serverDetails){\n\t\t\t\tServerStatus.verifyServerStatus(i,(String)servers[0], (String)servers[1], (String)servers[2]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "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}", "private String getServerDetails() {\n String sServerLine = \"Server: Ramon's Killer \";\n String sSocketType = (bIsSecure ? \"(SECURE)\" : \"(unsecure)\");\n sServerLine = sServerLine + sSocketType + \" Server\";\n return sServerLine;\n }", "public NdexStatus getServerStatus() throws IOException, NdexException {\n\t\treturn getServerStatus(false);\t\n }", "public int fetchServerStatus (GUICalcProgressBar progress) {\n\n\t\t// Call the standard function in ServerCmd\n\n\t\tSystem.out.println ();\n\t\tint result = ServerCmd.gui_show_relay_status (progress);\n\n\t\treturn result;\n\t}", "public String getStatus() {\n try {\n ClusterHealthResponse clusterHealthResponse =\n this.client.admin().cluster().health(new ClusterHealthRequest()).get();\n return clusterHealthResponse.getStatus().name();\n } catch (InterruptedException | ExecutionException e) {\n logger.error(\"Error when obtain cluster health\", e);\n throw new ElasticExecutionException(\"Error when trying to obtain the server status\");\n }\n }", "public String getServerDetails();", "public HostStatus() {\n addressesChecker = (AddressesChecker)ServicesRegisterManager.platformWaitForService(Parameters.NETWORK_ADDRESSES);\n hostID = addressesChecker.getHostIdentifier();\n hostAddresses = addressesChecker.getAllAddresses();\n contextManager = (ContextManager)ServicesRegisterManager.platformWaitForService(Parameters.CONTEXT_MANAGER);\n cpuLoad = contextManager.getCpuLoad();\n memoryLoad = contextManager.getMemoryLoad();\n batteryLevel = contextManager.getBatteryLevel();\n numberOfThreads = contextManager.getNumberOfThreads();\n networkPFInputTraffic = contextManager.getPFInputTrafic();\n networkPFOutputTraffic = contextManager.getPFOutputTrafic();\n networkApplicationInputTraffic = contextManager.getApplicationInputTrafic();\n networkApplicationOutputTraffic = contextManager.getApplicationOutputTrafic();\n ContainersManager gestionnaireDeConteneurs = (ContainersManager)ServicesRegisterManager.platformWaitForService(Parameters.CONTAINERS_MANAGER);\n numberOfBCs = gestionnaireDeConteneurs.getComposants().getComponentsNumber();\n numberOfConnectors = gestionnaireDeConteneurs.getConnecteurs().getConnectorsNumber();\n numberOfConnectorsNetworkInputs = gestionnaireDeConteneurs.getConnecteurs().getNetworkInputConnectorsNumber();\n numberOfConnectorsNetworkOutputs = gestionnaireDeConteneurs.getConnecteurs().getNetworkOutputConnectorsNumber();\n }", "GlobalUpdateStatus update(ServerConfiguration serverConfig, @Nullable ProgressMonitor monitor);", "public void getSystemStatus() throws Exception\r\n\t{\r\n\t\tsystemDump.delete(0, systemDump.length());\r\n\r\n\t\tboolean needAlarm = memoryLogging();\r\n\r\n\t\tif (Database.appDatasource != null)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"Database connection status: \\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number database connection\\t\\t\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number busy database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumBusyConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number idle database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumIdleConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number idle database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumUnclosedOrphanedConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\r\n\t\tString queueWarningMessage = \"\";\r\n\r\n\t\tsystemDump.append(\"\\r\\n\");\r\n\t\tsystemDump.append(\"Local queue status: \\r\\n\");\r\n\r\n\t\tfor (String key : QueueFactory.localQueues.keySet())\r\n\t\t{\r\n\t\t\tLocalQueue localQueue = QueueFactory.getLocalQueue(key);\r\n\r\n\t\t\tsystemDump.append(\"Local queue (\");\r\n\t\t\tsystemDump.append(key);\r\n\t\t\tsystemDump.append(\"): \");\r\n\t\t\tsystemDump.append(localQueue.getSize());\r\n\r\n\t\t\tif (localQueue.getMaxSize() > 0)\r\n\t\t\t{\r\n\t\t\t\tsystemDump.append(\"/\");\r\n\t\t\t\tsystemDump.append(localQueue.getMaxSize());\r\n\t\t\t}\r\n\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\t\tif (QueueFactory.getTotalLocalPending() > 0)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"Total pending counter : \");\r\n\t\t\tsystemDump.append(QueueFactory.getTotalLocalPending());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\r\n\t\tif (queueDispatcherEnable)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"Remote queue status: \\r\\n\");\r\n\r\n\t\t\tQueueSession session = null;\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tsession = getQueueSession();\r\n\r\n\t\t\t\tfor (int j = 0; j < externalQueues.length; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (externalQueues[j].equals(\"\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tString queueName = externalQueues[j];\r\n\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tQueue checkQueue = QueueFactory.getQueue(queueName);\r\n\r\n\t\t\t\t\t\tint size = QueueFactory.getQueueSize(session, checkQueue);\r\n\r\n\t\t\t\t\t\tQueueFactory.queueSnapshot.put(queueName, new Integer(size));\r\n\r\n\t\t\t\t\t\tsystemDump.append(\"Total command request for \");\r\n\t\t\t\t\t\tsystemDump.append(queueName);\r\n\t\t\t\t\t\tsystemDump.append(\" : \");\r\n\t\t\t\t\t\tsystemDump.append(size);\r\n\t\t\t\t\t\tsystemDump.append(\"\\r\\n\");\r\n\r\n\t\t\t\t\t\tqueueWarningMessage += queueWarning(checkQueue, queueName, size);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsystemDump.append(\"Error occur when get size of queue \");\r\n\t\t\t\t\t\tsystemDump.append(queueName);\r\n\t\t\t\t\t\tsystemDump.append(\": \");\r\n\t\t\t\t\t\tsystemDump.append(e.getMessage());\r\n\r\n\t\t\t\t\t\tlogMonitor(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\tsystemDump.append(\"Can not get remote queue size: \");\r\n\t\t\t\tsystemDump.append(e.getMessage());\r\n\t\t\t\tsystemDump.append(\"\\r\\n\");\r\n\r\n\t\t\t\tlogMonitor(e);\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tQueueFactory.closeQueue(session);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (needAlarm)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"WARNING: Disk space is running low\");\r\n\t\t}\r\n\t\tif (!queueWarningMessage.equals(\"\"))\r\n\t\t{\r\n\t\t\tneedAlarm = true;\r\n\t\t\tsystemDump.append(queueWarningMessage);\r\n\t\t}\r\n\r\n\t\tlogMonitor(systemDump);\r\n\r\n\t\tif (needAlarm)\r\n\t\t{\r\n\t\t\tsendInstanceAlarm(\"system-resource\", systemDump.toString());\r\n\t\t}\r\n\t}", "public void clientInfo() {\n uiService.underDevelopment();\n }", "@Override\r\n\tpublic String index() {\n\t\treturn \"服务器维护中。。。。\";\r\n\t}", "public String getServerDescription();", "@GET\n @Path(\"/status\")\n @Produces(MediaType.TEXT_PLAIN)\n public String status() {\n Device device = getDevice();\n try {\n StreamingSession session = transportService.getSession(device.getId());\n return \"Status device:[\" + device.getId() + \"]\" + \" session [\" + session.toString() + \"]\";\n } catch (UnknownSessionException e) {\n return e.getMessage();\n }\n }", "public NdexStatus getServerStatus(boolean fullFormat) throws IOException, NdexException {\n \tfinal String route = NdexApiVersion.v2 + \"/admin/status?format=\" + (fullFormat? \"full\": \"standard\") ;\n\n \tNdexStatus status = this.ndexRestClient.getNdexObject(route, \"\", NdexStatus.class);\n \t\n\t\treturn status;\t\n }", "void doGetAdminInfo() {\n\t\tlog.config(\"doGetAdminInfo()...\");\n\t\tthis.rpcService.getAdminInfo(new AsyncCallback<DtoAdminInfo>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tString errorMessage = \"Error when getting admin info! : \" + caught.getMessage();\n\t\t\t\tlog.severe(errorMessage);\n\t\t\t\tgetAdminPanel().setActionResult(errorMessage, ResultType.error);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(DtoAdminInfo adminInfo) {\n\t\t\t\tlog.config(\"getAdminInfo() on success - \" + adminInfo.getListLogFilenames().size() + \" logs filenames.\");\n\t\t\t\tgetAdminPanel().setAdminInfo(adminInfo);\n\t\t\t}\n\t\t});\n\t}", "@Override\n public String getServerDisplayName() {\n return serverDisplayName;\n }", "@RequestMapping(value = \"status\")\n public @ResponseBody ObjectResponse<SystemStatusResponse> systemStatus() {\n SystemStatusResponse response = new SystemStatusResponse();\n response.setApplicationName(pushServiceConfiguration.getPushServerName());\n response.setApplicationDisplayName(pushServiceConfiguration.getPushServerDisplayName());\n response.setApplicationEnvironment(pushServiceConfiguration.getPushServerEnvironment());\n response.setTimestamp(new Date());\n return new ObjectResponse<>(response);\n }", "public ApplicationGatewayBackendHealthServerHealth health() {\n return this.health;\n }", "public String showStatus();", "public String getServer()\n {\n return server;\n }", "@SuppressWarnings(\"SleepWhileInLoop\")\n private StateChange profilingServerStatus() {\n LOGGER.log(Level.FINE,\n \"Profiling mode status hack for {0}\",\n new Object[]{instance.getName()});\n // Save process to be able to stop process waiting for profiler\n // to attach.\n support.setLocalStartProcess(instance.getProcess());\n // Try to sync the states after the profiler attaches.\n NODE_REFRESHER.post(new Runnable() {\n @Override\n public void run() {\n while (!PayaraState.isOnline(instance)) {\n try {\n Thread.sleep(200);\n } catch (InterruptedException ex) {\n }\n }\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n support.refresh();\n }\n });\n }\n });\n return new StateChange(this, TaskState.COMPLETED,\n TaskEvent.CMD_COMPLETED,\n \"MSG_SERVER_STARTED\", instanceName);\n }", "@GetMapping({\"/\", \"actuator/info\"})\n public ResponseEntity<String> info() {\n // Indicate the request succeeded and return the\n // application name and thread name.\n return ResponseEntity\n .ok(mApplicationContext.getId()\n + \" is alive and running on \"\n + Thread.currentThread()\n + \"\\n\");\n }", "public String configurationInfo();", "public String getServer() {\r\n return server;\r\n }", "@RequestMapping(value = \"/health\", method = RequestMethod.GET)\n public ResponseEntity<String> healthCheck() {\n\n return new ResponseEntity<String>(\"Up and Running\", HttpStatus.OK);\n }", "private void applicationHealthHandler(RoutingContext routingContext) {\n HttpServerResponse httpServerResponse = routingContext.response();\n httpServerResponse.setStatusCode(SUCCESS_CODE);\n httpServerResponse.end(\"myRetailApplication is up and running\");\n }", "@GET\n\t@Produces(MediaType.TEXT_HTML)\n\t@TypeHint(String.class)\n\tpublic Response healthCheck()\n\t{\n\t\t// very simple health check to validate the web application is running\n\t\t// just return a hard coded HTML resource (HTTP 200) if we're here\n\t\treturn Response.ok(getClass().getResourceAsStream(\"/html/healthResponse.html\")).cacheControl(noCache).build();\n\t}", "@Override\n public String displayInfo() {\n String str = getPluginName() + \"\\n\";\n str += \"Status: \";\n if (isRunning())\n str += \"running\";\n else\n str += \"stop\";\n str += \"\\nPort:\" + params.getUnifyExportPort();\n return str;\n }", "private void updateServerInfo() {\n ServerInfo serverInfo = new ServerInfo(serverConfig.getBaseURL(), serverConfig.getInfoURL(), serverRepositories.keySet());\n String serverInfoJson = new GsonBuilder().setPrettyPrinting().create().toJson(serverInfo);\n try {\n Files.write(Paths.get(\"\").resolve(Filenames.FILENAME_SERVERINFO), serverInfoJson.getBytes(StandardCharsets.UTF_8));\n } catch (IOException e) {\n log.error(\"could not write serverinfo file.\", e);\n }\n }", "void askServerInfo();", "public String getStunServer();", "public static ServerConfiguration getServerConfiguration() {\n return getOctaneDescriptor().getServerConfiguration();\n }", "public LocalServerConfig getConfig() {\n return serverConfig;\n }", "public String getSERVER() {\n \t\treturn SERVER;\n \t}", "@Override\n public void execute()\n {\n if(levelOfDetail != null)\n {\n if(levelOfDetail.equals(\"simple\"))\n serverStatusFactory = new SimpleFactory();\n else if(!levelOfDetail.equals(\"complex\"))\n throw new InvalidLevelOfDetailException();\n }\n\n status = serverStatusFactory.getServerStatus(id, String.format(template, name));\n\n for (String detail : details)\n {\n switch (detail)\n {\n case \"operations\":\n {\n status = serverStatusFactory.getOperationsDetailedServerStatus(status);\n break;\n }\n case \"extensions\":\n {\n status = serverStatusFactory.getExtensionDetailedServerStatus(status);\n break;\n }\n case \"memory\":\n {\n status = serverStatusFactory.getMemoryDetailedServerStatus(status);\n break;\n }\n default:\n {\n throw new InvalidDetailException();\n }\n }\n }\n status.setStatusDesc(status.generateStatusDesc());\n }", "@Override\n public String getServletInfo() {\n return \"Servlet is serving eBooksStoreAdminUsersPage.jsp\";\n }", "public static server getServer(){\n return thisServer;\n }", "public void showServerStats(double totalTime) {\n System.out.println(\"ServerID \" + \"Efficiency \" + \"CustomersServed \" + \"IdleTime \");\n for(int i = 0; i < cntServer; i++){\n serverArray[i].idleTime = totalTime - serverArray[i].busyTime;\n System.out.println(serverArray[i].toString());\n }\n }", "public String getServerName(){\n return this.serverName;\n }", "public ServerInfo(Server server) {\n if (server == null) {\n throw new NullArgumentException(\"Server must not be null\");\n }\n\n this.logger = server.getLogger();\n\n BufferedImage image;\n\n try {\n image = ImageIO.read(new File(\"server-icon.png\"));\n }\n catch (Exception e) {\n image = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);\n }\n\n this.setImage(image);\n this.setMotd(server.getMotd());\n }", "private String setServerStatusCode()\n\t{\n\t\t\n\t\tString response = null;\n\t HttpClient client = new DefaultHttpClient();\n\t HttpPost post = new HttpPost(\"http://10.184.0.132:8005/ContextAwareFrameworkWebService/apiCheckTest1\");\n\t Log.d(\"Debug\",\"test1\");\n\t // set values you'd like to send\n\t List pairs = new ArrayList();\n\t //pairs.add(new BasicNameValuePair(\"devEmail\", developerEmail));\n\t //pairs.add(new BasicNameValuePair(\"apiKey\", ApiKey));\n\t pairs.add(new BasicNameValuePair(\"pkgName\", appPkgName));\n\t pairs.add(new BasicNameValuePair(\"appId\", appId));\n\t pairs.add(new BasicNameValuePair(\"userEmail\", userEmailId));\n\t pairs.add(new BasicNameValuePair(\"\", deviceId));\n\t pairs.add(new BasicNameValuePair(\"random\", \"randomConstant\"));\n\t try {\n\t post.setEntity(new UrlEncodedFormEntity(pairs));\n\t // set ResponseHandler to handle String responses\n\t ResponseHandler<String> responseHandler = new BasicResponseHandler();\n\t response = client.execute(post, responseHandler);\n\t serverRequestStatus = true;\n\t serverStatus = response;\n\t Log.v(\"HttpPost\", \"Response: \" + serverStatus);\n\t } \n\t catch (Exception e) \n\t {\n\t \tLog.e(\"Debug\",\"Error in post method\");\n\t \te.printStackTrace();\n\t }\n\t \n\t return response;\n\t}", "public ServerConnectionStatusView(){\n\n\t\tserverConnectionStatusLabel.setName(WindowNames.SERVER_CONNECTION_STATUS_LABEL);\n\t\tserverConnectionAcceptanceButton.setName(WindowNames.SERVER_CONNECTION_ACCEPTANCE_BUTTON);\n\t\tserverConnectionInputField.setName(WindowNames.SERVER_CONNECTION_INPUT_FIELD);\n\t\t\n\t\tsetLayout(new GridBagLayout());\n\n\t\tComponentHelp.setAllThreeSizes(serverConnectionStatusLabel, new Dimension(300, 20));\n\t\tComponentHelp.setAllThreeSizes(serverConnectionInputField, new Dimension(200, 28));\n\t\tComponentHelp.setAllThreeSizes(serverConnectionAcceptanceButton, new Dimension(100, 30));\n\t\tserverConnectionAcceptanceButton.setText(\"Connect to server\");\n\t\tserverConnectionAcceptanceButton.setMargin(new Insets(2, 2, 2, 2));\n\t\tFont buttonFond = serverConnectionAcceptanceButton.getFont();\n\t\tserverConnectionAcceptanceButton.setFont( new Font(buttonFond.getName(), Font.BOLD, 9));\n\t\t\n\t\tserverConnectionStatusLabel.setText(ServerConnectionStatus.NotConnected.getText());\n\t\t\n\t\tComponentHelp.addComponent(this, serverConnectionStatusLabel, 0, 0, 3, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE );\n\t\tComponentHelp.addComponent(this, serverConnectionInputField, 0, 1, 2, 1, 0, 0, GridBagConstraints.LINE_START, GridBagConstraints.NONE );\n\t\tComponentHelp.addComponent(this, serverConnectionAcceptanceButton, 2, 1, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.NONE );\n\t\t\n\t\tsetVisible(true);\n\t\t\n\t\tComponentHelp.setAllThreeSizes(this, new Dimension(300, 50));\n\t\tsetBorder(new MatteBorder(1, 1, 1, 1, Color.GRAY));\n\t\t\n\t\tdisableViev();\n\t}", "public String getServerName();", "public ServerInfo() {\n this.logger = null;\n }", "public static void logStatus(){\r\n\t\tLogger log = Logger.getLogger(LOGGER_NAME);\r\n\t\tStringBuilder logString = new StringBuilder(\"\\n*** PlugIn Status ***\\n\");\r\n\t\t\r\n\t\tList<String> storagePlugins = getPluginsByType(PluginType.STORAGE);\r\n\t\tlogString.append(\"Storage PlugIns: \"+storagePlugins.size()+\"\\n\");\r\n\t\t\r\n\t\tlog.info(logString.toString());\r\n\t\treturn;\r\n\t}", "@Override\n @GET\n @Path(\"/servers\")\n @Produces(\"application/json\")\n public Response getServers() throws Exception {\n log.trace(\"getServers() started.\");\n JSONArray json = new JSONArray();\n for (Server server : cluster.getServerList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/servers/%d\", rootUri, server.getServerId());\n String serverUri = String.format(\"/providers/%d/servers/%d\", provider.getProviderId(), server.getServerId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", serverUri);\n json.put(o);\n }\n\n log.trace(\"getServers() finished successfully.\");\n return Response.ok(json.toString()).build();\n }", "public ServerConfig() {\n initComponents();\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "@Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n server.setStatus(MinecraftServer.DetailedStatus.PINGING, true);\n return server;\n }", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/apiservers/{name}/status\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<APIServer> readAPIServerStatus(\n @Path(\"name\") String name);", "public Properties getProperties() {\n return this.serverProperties;\n }", "public static String getServer() {\n\t\tif(produccion){\n\t\t\treturn server_produccion;\n\t\t}else{\n\t\t\treturn server;\n\t\t}\t\t\n\t}", "@ApiOperation(value = \"Get node configuration status.\", notes = \"Returns node configration status for this installation.\", response = Properties.class)\n @ApiResponses({@ApiResponse(code = 200, message = \"An array of propeties\"), @ApiResponse(code = 500, message = \"Unexpected error\")})\n @RequestMapping(value = {\"/xnatTask/checkNodeConfigurationStatus\"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<Properties> getNodeConfigurationStatus() {\n final HttpStatus status = isPermitted();\n if (status != null) {\n return new ResponseEntity<>(status);\n }\n \tfinal Properties prop = new Properties();\n \t// We'll display configuration if we have any configured nodes for this installation.\n \tfor (final XnatNodeInfo nodeInfo : _xnatNodeInfoService.getAll()) {\n \t\tif (!nodeInfo.getNodeId().equals(XnatNode.NODE_ID_NOT_CONFIGURED)) {\n \t\t\tprop.put(\"isConfigured\", String.valueOf(true));\n \t\t\treturn new ResponseEntity<>(prop, HttpStatus.OK);\n \t\t}\n \t\t\n \t}\n \tprop.put(\"isConfigured\", String.valueOf(false));\n return new ResponseEntity<>(prop, HttpStatus.OK);\n }", "protected static AuoServer getServer() {\n return server;\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public void getHealthStatus() {\n getHealthStatusAsync().block();\n }", "public String getServerName() {\n return serverName;\n }", "public String getServerName() {\n return serverName;\n }", "@GetMapping(\"/health\")\n\t@ApiOperation(value = \"Checks the health of Authentication microservice\")\n\tpublic ResponseEntity<String> healthCheckup() {\n\t\tlog.info(\"Health Check for Authentication Microservice\");\n\t\tlog.info(\"health checkup ----->{}\", \"up\");\n\t\treturn new ResponseEntity<>(\"Up and running...\", HttpStatus.OK);\n\t}", "private InformationManager() {\n\t\tlives = ConfigurationManager.getConfigurationManager().getConfiguration().getLives();\n\t\tshields = ConfigurationManager.getConfigurationManager().getConfiguration().getShields();\n\t}", "S getServer();", "@RequestMapping(value = \"/status\", method = RequestMethod.GET)\n public String status()\n {\n return \"status\";\n }", "public String getServername() {\r\n return servername;\r\n }", "protected void printServerConfig(){\n\t\t/*String filePrefix = System.getProperty(\"user.dir\")+\"/src/server/\"+gameName;\n\t\tFile gameFolderServ = new File(filePrefix);\n\t\tString filePrefix2 = System.getProperty(\"user.dir\")+\"/src/auctions/\"+gameName;\n\t\tFile gameFolderAuct = new File(filePrefix2);\n\n\t\tFile server_config = new File(filePrefix+\"/Config_AuctionServer.txt\");\n\t\t*/\n\t\tFile server_config = new File(\"src/server/\"+\"Config_AuctionServer.txt\");\n\t\tif(!server_config.exists()){\n\n\t\t\t try{\n\n\t\t\t\t //gameFolderServ.mkdir();\n\t\t\t\t // gameFolderAuct.mkdir();\n\t\t\t\t server_config.createNewFile();\n\t\t\t\t FileWriter fstream = new FileWriter(server_config);\n\t\t\t\t BufferedWriter out = new BufferedWriter(fstream);\n\t\t\t\t if(localIP){\n\t\t\t\t\t out.write(\"Host_IP:local\\n\");\n\t\t\t\t }else{\n\t\t\t\t\t out.write(\"Host_IP:public\\n\");\n\t\t\t\t }\n\n\t\t\t\t out.write(\"Port_Number:\"+port+\"\\n\");\n\t\t\t\t //out.newLine();\n\n\t\t\t\t out.write(\"Min_Number_Clients:\"+minClients+\"\\n\");\n\t\t\t\t out.write(\"Max_Number_Clients:\"+maxClients+\"\\n\");\n\t\t\t\t out.write(\"Max_Wait_For_Clients:\"+maxWait+\"\\n\");\n\t\t\t\t out.write(\"Response_Time:\"+responseTime);\n\t\t\t\t out.newLine();\n\t\t\t\t if(respTime){\n\t\t\t\t\t out.write(\"Full_Response_Time:true\");\n\t\t\t\t }else{\n\t\t\t\t\t out.write(\"Full_Response_Time:false\");\n\t\t\t\t }\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Server_Log_File:Log_AuctionServer.txt\");\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Server_Results_File:Results_AuctionServer.txt\");\n\t\t\t\t out.newLine();\n\n\t\t\t\t if(maxSeq>1 && maxSim>1){\n\t\t\t\t\t out.write(\"Auction_Type:SequentialAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_Sequential_of_Simultaneous.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSeq>1){\n\t\t\t\t\t out.write(\"Auction_Type:SequentialAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_SequentialAuction_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSim>1){\n\t\t\t\t\t out.write(\"Auction_Type:SimultaneousAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_SimultaneousAuction_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSeq==1 && maxSim==1){\n\t\t\t\t\t out.write(\"Auction_Type:\"+getAuctionName(auctionsSchedule[0])+\"\\n\");\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_\"+getAuctionName(auctionsSchedule[0])+\"_0_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else{\n\t\t\t\t\t System.out.println(\"ERROR: no auctions\");\n\t\t\t\t }\n\n\t\t\t\t out.write(\"Valuation_Type:\"+valueFxn);\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Valuation_Config_File:Config_Valuation\"+valueFxn+\".txt\");\n\n\t\t\t\t out.close();\n\n\t\t\t }catch (IOException e){\n\t\t\t\t\tSystem.out.println(\"file error creating Server Config.\");\n\t\t\t}\n\t\t}\n\t}", "protected Observer getStatusEngine() {\n\t\treturn new GatherStatusEngine(this);\n\t}", "public String status() throws Exception {\n\n \t\tString apiUrl = \"api/status.json\";\n \t\t\n \t\tString url = this.baseUrl + apiUrl;\n\n URL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t} else {\n\t response = \"{'error': 'Something went wrong, looks like the server is down.'}\";\n\t\t}\n\n\t\treturn response; \n \t}", "@ApiOperation(value = \"Check the heart beat.\")\r\n @GetMapping(path = RestfulEndPoints.AUTHENTICATION_HEALTH_CHECK)\r\n public String healthCheck() {\r\n return \"Hello, I am 'Authentication Service' and running quite healthy at port: \"\r\n + env.getProperty(\"local.server.port\");\r\n }", "public void featureStatus(CommandSender sender) {\n\t\tString statusMessage = \"\";\n\t\t\n\t\tif (enabled.adminGUI) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Admin GUI\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Admin GUI\");\n\t\t}\n\t\t\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.publicGUI) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Public GUI\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Public GUI\");\n\t\t}\n\t\t\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.nightVision) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Night Vision\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Night Vision\");\n\t\t}\n\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.discord) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Discord Bot\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Discord Bot\");\n\t\t}\n\t\t\n\t\tEChat.chat(sender, \"Enabled Features: \" + statusMessage);\n\t}", "public ShowSystemStatusResponse showSystemStatus(Map<String, String> options) throws GPUdbException {\n ShowSystemStatusRequest actualRequest_ = new ShowSystemStatusRequest(options);\n ShowSystemStatusResponse actualResponse_ = new ShowSystemStatusResponse();\n submitRequest(\"/show/system/status\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public Map serviceStatus(String id) throws IOException\n\t{\n\t\treturn request(GET, address(id, \"stats\"));\n\t}", "ServerEntry getServer();", "public String getStatusDetails() { return statusDetails; }", "private void loadConfig() throws IOException {\n File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), \"bStats\");\n File configFile = new File(bStatsFolder, \"config.yml\");\n Config config = new Config(configFile);\n \n // Check if the config file exists\n if (!config.exists(\"serverUuid\")) {\n // Add default values\n config.set(\"enabled\", true);\n // Every server gets it's unique random id.\n config.set(\"serverUuid\", UUID.randomUUID().toString());\n // Should failed request be logged?\n config.set(\"logFailedRequests\", false);\n // Should the sent data be logged?\n config.set(\"logSentData\", false);\n // Should the response text be logged?\n config.set(\"logResponseStatusText\", false);\n \n DumperOptions dumperOptions = new DumperOptions();\n dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);\n writeFile(configFile,\n \"# bStats collects some data for plugin authors like how many servers are using their plugins.\",\n \"# To honor their work, you should not disable it.\",\n \"# This has nearly no effect on the server performance!\",\n \"# Check out https://bStats.org/ to learn more :)\",\n new Yaml(dumperOptions).dump(config.getRootSection()));\n }\n \n // Load the data\n enabled = config.getBoolean(\"enabled\", true);\n serverUUID = config.getString(\"serverUuid\");\n logFailedRequests = config.getBoolean(\"logFailedRequests\", false);\n logSentData = config.getBoolean(\"logSentData\", false);\n logResponseStatusText = config.getBoolean(\"logResponseStatusText\", false);\n }", "private String getConfigInfo(boolean verbose) {\r\n StringBuilder builder = new StringBuilder();\r\n\r\n GridHubConfiguration config = getRegistry().getConfiguration();\r\n builder.append(\"<b>Config for the hub :</b><br/>\");\r\n builder.append(prettyHtmlPrint(config));\r\n\r\n if (verbose) {\r\n\r\n GridHubConfiguration tmp = new GridHubConfiguration();\r\n\r\n builder.append(\"<b>Config details :</b><br/>\");\r\n builder.append(\"<b>hub launched with :</b>\");\r\n builder.append(tmp.hubConfig);\r\n\r\n\r\n builder.append(\"<br/><b>the final configuration comes from :</b><br/>\");\r\n builder.append(\"<b>the default :</b><br/>\");\r\n builder.append(prettyHtmlPrint(tmp));\r\n\r\n builder.append(prettyHtmlPrint(tmp));\r\n }\r\n return builder.toString();\r\n }", "@GET\n @Path(\"/metrics\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getStatus(@Context HttpServletRequest request) {\n try {\n BlahguaSession.ensureAdmin(request);\n return RestUtilities.make200OkResponse(SystemManager.getInstance().processMetrics(false));\n } catch (ResourceNotFoundException e) {\n return RestUtilities.make404ResourceNotFoundResponse(request, e);\n } catch (SystemErrorException e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n } catch (Exception e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n }\n }", "public Map<String, BasicServerMetrics> getServerMetrics() {\n return Collections.unmodifiableMap(myServerMetrics);\n }", "public Integer getAdminStatus() {\n return adminStatus;\n }", "public ServerStatus[] getServerStatus() {\r\n ServerStatus[] toReturn = new ServerStatus[0];\r\n\r\n String[] paramFields = {\"item_delimiter\", \"value_delimiter\"};\r\n SocketMessage request = new SocketMessage(\"admin\", \"server_status\",\r\n SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n request.setValue(\"item_delimiter\", ITEM_DELIMITER);\r\n request.setValue(\"value_delimiter\", VALUE_DELIMITER);\r\n\r\n SocketMessage response = handleMessage(request);\r\n if (!isSuccessful(response)) {\r\n if (\"\".equals(response.getErrorCode())) {\r\n setError(\"APIL_0201\", \"couldn't get server status\");\r\n } else {\r\n wrapError(\"APIL_0201\", \"couldn't get server status\");\r\n }\r\n return toReturn;\r\n } else {\r\n String serversString = response.getValue(\"servers\");\r\n StringTokenizer tokenizer = new StringTokenizer(serversString, ITEM_DELIMITER);\r\n toReturn = new ServerStatus[tokenizer.countTokens()];\r\n try {\r\n for (int i = 0; i < toReturn.length; i++) {\r\n String itemString = tokenizer.nextToken();\r\n StringTokenizer itemTokenizer = new StringTokenizer(itemString, VALUE_DELIMITER);\r\n String ip = itemTokenizer.nextToken();\r\n String portString = itemTokenizer.nextToken();\r\n String aliveString = itemTokenizer.nextToken();\r\n String timeString = itemTokenizer.nextToken();\r\n int port = Integer.parseInt(portString.trim());\r\n boolean alive = \"y\".equals(aliveString);\r\n long time = Tools.parseTime(timeString.trim());\r\n toReturn[i] = new ServerStatus(ip, port, time, alive);\r\n }\r\n } catch (Exception e) {\r\n setError(\"APIL_0202\", \"error in parsing status string: \" + serversString);\r\n return new ServerStatus[0];\r\n }\r\n }\r\n\r\n return toReturn;\r\n }", "@GET\n\t@Path(\"/status\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getStatus() {\n\t\treturn new JSONObject().put(\"currFloor\", Constants.currFloor).put(\"movingState\", Constants.movingState).toString();\n\t}", "public void intServerEnv() {\n\t\tServerUtils serverUtils = new ServerUtils();\n\t\tTouchstoneParsers parsers = new TouchstoneParsers();\n\n\t\tString CONFIGFILE = psoResourcePkg + \"/configs/server.properties\";\n\t\tString testConfigFile = ServerUtils.class.getResource(CONFIGFILE).getFile();\n\n\t\tHashMap<String, HashMap<String, String>> configPropsMap = parsers.readPropsFile(new File(testConfigFile));\n\t\thostIP = (configPropsMap.get(\"URL_PARAMS\").get(\"LOCAL_ENV\").equalsIgnoreCase(\"yes\") ? \"localhost\" : serverUtils.getHostIp());\n\n\t\t// JDBC driver name and database URL\n\t\tJDBC_DRIVER=\"com.mysql.jdbc.Driver\";\n\t\tDB_URL=\"jdbc:mysql://\" + hostIP + \"/psotest\";\n\n\t\t// Database credentials\n\t\tUSERID = configPropsMap.get(\"SERVER_ENV\").get(\"USERID\");\n\t\tPASSWORD = configPropsMap.get(\"SERVER_ENV\").get(\"PASSWORD\");\n\n\t\t// Database tables:\n\t\tCLICKS_TABLE = configPropsMap.get(\"SERVER_ENV\").get(\"CLICKS_TABLE\");\n\t\tBEACON_TABLE = configPropsMap.get(\"SERVER_ENV\").get(\"BEACON_TABLE\");\n\n\t}", "private void getloggersStatus() { \n\t\tAppClientFactory.getInjector().getSearchService().isClientSideLoggersEnabled(new SimpleAsyncCallback<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String result) {\n\t\t\t\tAppClientFactory.setClientLoggersEnabled(result);\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "public Server getServer() {\n return server;\n }", "public String getStatus() { return status; }", "private void updateInfo() {\n /* Show the current server address in use */\n String text = String.format(getResources().getString(R.string.main_activity_server_address),\n Utils.getAddress(), Utils.getPort());\n serverTextView.setText(text);\n\n /* Show information about current player */\n Player player = SharedDataManager.getPlayer(this);\n /* No player is logged in */\n if (player == null) {\n playerTextView.setText(getString(R.string.your_nickname));\n return;\n }\n /* Player is logged in, show some information about him */\n text = String.format(getResources().getString(R.string.main_activity_player_title),\n player.getNickname(), player.getScore());\n playerTextView.setText(text);\n }", "public String getHealthinfo() {\n return healthinfo;\n }", "public static final void handleServerStatus(final MapleClient c) {\n final int numPlayer = LoginServer.getUsersOn();\n final int userLimit = LoginServer.getUserLimit();\n if (numPlayer >= userLimit) {\n c.sendPacket(LoginPacket.getServerStatus(2));\n } else if (numPlayer * 2 >= userLimit) {\n c.sendPacket(LoginPacket.getServerStatus(1));\n } else {\n c.sendPacket(LoginPacket.getServerStatus(0));\n }\n }", "public GENServer getServer() {\n return server;\n }", "@GET\n\t@Produces(MediaType.TEXT_PLAIN)\n\t@ApiOperation(value = \"Checks if the application is running\", response = String.class)\n\t@ApiResponses(value = {@ApiResponse(code = 200, message = \"Application is running\", response = String.class)})\n\tpublic Response healthCheck() {\n\t\treturn Response.ok(\"Ok\")\n\t\t\t.build();\n\t}", "private void logAdminUI() {\n\t\tString httpPort = environment.resolvePlaceholders(ADMIN_PORT);\n\t\tAssert.notNull(httpPort, \"Admin server port is not set.\");\n\t\tlogger.info(\"Admin web UI: \"\n\t\t\t\t+ String.format(\"http://%s:%s/%s\", RuntimeUtils.getHost(), httpPort,\n\t\t\t\t\t\tConfigLocations.XD_ADMIN_UI_BASE_PATH));\n\t}", "@Override\n public final void contextInitialized(final ServletContextEvent sce) {\n context = sce.getServletContext();\n\n String apiSrvDaemonPath = context.getRealPath(PS);\n System.setProperty(\"APISrvDaemonPath\", context.getRealPath(\"/\"));\n System.setProperty(\"APISrvDaemonVersion\",\n \"v.0.0.2-22-g2338f25-2338f25-40\");\n\n // Notify execution\n System.out.println(\"--- \" + \"Starting APIServerDaemon \"\n + System.getProperty(\"APISrvDaemonVersion\") + \" ---\");\n System.out.println(\"Java vendor : '\" + VN + \"'\");\n System.out.println(\"Java vertion: '\" + VR + \"'\");\n System.out.println(\"Running as : '\" + US + \"' username\");\n System.out.println(\"Servlet path: '\" + apiSrvDaemonPath + \"'\");\n\n // Initialize log4j logging\n String log4jPropPath =\n apiSrvDaemonPath + \"WEB-INF\" + PS + \"log4j.properties\";\n File log4PropFile = new File(log4jPropPath);\n\n if (log4PropFile.exists()) {\n System.out.println(\"Initializing log4j with: \" + log4jPropPath);\n PropertyConfigurator.configure(log4jPropPath);\n } else {\n System.err.println(\n \"WARNING: '\" + log4jPropPath\n + \" 'file not found, so initializing log4j \"\n + \"with BasicConfigurator\");\n BasicConfigurator.configure();\n }\n\n // Make a test with jdbc/geApiServerPool\n // jdbc/UserTrackingPool\n // jdbc/gehibernatepool connection pools\n String currentPool = \"not yet defined!\";\n String poolPrefix = \"java:/comp/env/\";\n String[] pools = {\"jdbc/fgApiServerPool\",\n \"jdbc/UserTrackingPool\",\n \"jdbc/gehibernatepool\"};\n Connection[] connPools = new Connection[pools.length];\n\n for (int i = 0; i < pools.length; i++) {\n try {\n Context initContext = new InitialContext();\n Context envContext =\n (Context) initContext.lookup(\"java:comp/env\");\n\n currentPool = pools[i];\n\n // DataSource ds =\n // (DataSource)initContext.lookup(poolPrefix+currentPool);\n DataSource ds = (DataSource) envContext.lookup(currentPool);\n\n connPools[i] = ds.getConnection();\n System.out.println(\"PERFECT: \" + currentPool + \" was ok\");\n } catch (Exception e) {\n System.err.println(\"WARNING: \" + currentPool + \" failed\" + LS\n + e.toString());\n } finally {\n try {\n connPools[i].close();\n } catch (Exception e) {\n System.err.println(\"WARNING: \" + currentPool\n + \" failed to close\" + LS + e.toString());\n }\n }\n }\n\n // Register MySQL driver\n APIServerDaemonDB.registerDriver();\n\n // Initializing the daemon\n if (asDaemon == null) {\n asDaemon = new APIServerDaemon();\n }\n\n asDaemon.startup();\n }", "String status();", "String status();", "int getServerState();", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "public int getServerState() {\n return serverState_;\n }", "public interface GlobalServerConfiguration {\n\n /**\n * Gets the location for the AdapterConfig for the specified namespace\n */\n public String getAdapterConfigLocation(String namespace);\n\n /**\n * Gets the location of the FeedConfig for the specified namespace\n */\n public String getFeedConfigLocation(String namespace);\n\n /**\n * Gets the Feed Configuration suffix\n */\n public String getFeedConfigSuffix();\n\n /**\n * Gets the namespace\n */\n public String getFeedNamespace(String namespace);\n\n /**\n * Gets the namespace prefix\n */\n public String getFeedNamespacePrefix(String namespace);\n\n /**\n * Gets the Server port\n */\n public int getPort();\n\n /**\n * Gets the URI for the feedserver with the specified namespace\n */\n public String getServerUri(String namespace);\n\n /**\n * Gets URI prefix for Feeds\n */\n public String getFeedPathPrefix();\n\n /**\n * Gets the {@link FeedConfiguration} for the specified feed in the namespace\n * \n * @param namespace The namespace the feed is in\n * @param feedId The feed to get the {@link FeedConfiguration} for\n * @param userId User email of per user feed requested; null if not per user feed\n */\n public FeedConfiguration getFeedConfiguration(String namespace, String feedId, String userId)\n throws FeedConfigStoreException;\n\n /**\n * Get the fully qualified class name for adapter wrapper manager.\n * \n * @return fully qualified class name for adapter wrapper manager.\n */\n public String getWrapperManagerClassName();\n\n /**\n * Gets the {@link FeedConfigStore} for the Server Configuration\n */\n public FeedConfigStore getFeedConfigStore();\n\n /**\n * Get the fully qualified class name of the provider that will be used for\n * this server.\n * \n * @return fully qualified class name of the Provider.\n */\n public String getProviderClassName();\n\n @SuppressWarnings(\"unchecked\")\n public AdapterBackendPool getAdapterBackendPool(String poolId);\n\n @SuppressWarnings(\"unchecked\")\n public void setAdapterBackendPool(String poolId, AdapterBackendPool pool);\n\n public AclValidator getAclValidator();\n\n public void setAclValidator(AclValidator aclValidator);\n\n}", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "protected StatusService getStatusService() {\n return getLockssDaemon().getStatusService();\n }", "@RequestMapping(value = \"/get\", method = RequestMethod.GET)\n @ResponseBody\n public ResponseVO getStatus() {\n SettingVO settingVO = settingService.getStatus();\n return ResponseVO.success(settingVO);\n }", "@Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n if (server.getDetailedStatus() == MinecraftServer.DetailedStatus.OFFLINE && server.getOfflineSince() == 0) {\n //If the server has gone offline, we update the offline since.\n server.setOfflineSince(server.getLastUpdateTime());\n //We set the boolean to true if the application is running since status are update in real-time on the UI.\n server.setHasOfflineStatusBeenSeen(bindCount > 0);\n }\n return server;\n }", "protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }", "public static server getNameServer(){\n return nameServer;\n }" ]
[ "0.65033966", "0.6388766", "0.6136624", "0.60880727", "0.6080348", "0.59808826", "0.59496915", "0.58884573", "0.5878266", "0.5837793", "0.5832997", "0.5786027", "0.57760894", "0.577477", "0.5736441", "0.57128924", "0.5693972", "0.56865823", "0.5683113", "0.5671153", "0.5665709", "0.5636254", "0.56262296", "0.56146353", "0.56001073", "0.5599379", "0.5585263", "0.55793387", "0.55691355", "0.5552832", "0.55466837", "0.5545928", "0.54875344", "0.54864925", "0.5476018", "0.5468147", "0.5460455", "0.54593164", "0.54523414", "0.54465795", "0.5436187", "0.5401192", "0.53932756", "0.53920645", "0.53567487", "0.53429526", "0.53416425", "0.53411907", "0.53328764", "0.53298223", "0.53234065", "0.53189015", "0.53187144", "0.5313576", "0.5310094", "0.53016067", "0.53016067", "0.52952313", "0.52907443", "0.5289741", "0.5284598", "0.5281147", "0.5278707", "0.52760136", "0.52750164", "0.527203", "0.52716875", "0.52712286", "0.52701426", "0.5267276", "0.52652484", "0.5263452", "0.5243299", "0.52405405", "0.52399707", "0.52394086", "0.52390075", "0.52321476", "0.5231626", "0.5227712", "0.52260786", "0.52216697", "0.52187043", "0.52120364", "0.5207468", "0.5207031", "0.5206696", "0.51984155", "0.51984066", "0.5196635", "0.5196635", "0.5195154", "0.51946133", "0.5190665", "0.5188465", "0.51822126", "0.51820046", "0.5178693", "0.51712495", "0.5163068", "0.51570326" ]
0.0
-1
Provides server configuration and health related status to the caller. The admin tool uses it to present server related information to the user.
public ShowSystemStatusResponse showSystemStatus(Map<String, String> options) throws GPUdbException { ShowSystemStatusRequest actualRequest_ = new ShowSystemStatusRequest(options); ShowSystemStatusResponse actualResponse_ = new ShowSystemStatusResponse(); submitRequest("/show/system/status", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void getStatus() {\n\t\ttry {\n\t\t\tint i = 1;\n\t\t\tList<Object[]>serverDetails = ServerStatus.getServerDetails();\n\t\t\tfor (Object[] servers:serverDetails){\n\t\t\t\tServerStatus.verifyServerStatus(i,(String)servers[0], (String)servers[1], (String)servers[2]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "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}", "private String getServerDetails() {\n String sServerLine = \"Server: Ramon's Killer \";\n String sSocketType = (bIsSecure ? \"(SECURE)\" : \"(unsecure)\");\n sServerLine = sServerLine + sSocketType + \" Server\";\n return sServerLine;\n }", "public NdexStatus getServerStatus() throws IOException, NdexException {\n\t\treturn getServerStatus(false);\t\n }", "public int fetchServerStatus (GUICalcProgressBar progress) {\n\n\t\t// Call the standard function in ServerCmd\n\n\t\tSystem.out.println ();\n\t\tint result = ServerCmd.gui_show_relay_status (progress);\n\n\t\treturn result;\n\t}", "public String getStatus() {\n try {\n ClusterHealthResponse clusterHealthResponse =\n this.client.admin().cluster().health(new ClusterHealthRequest()).get();\n return clusterHealthResponse.getStatus().name();\n } catch (InterruptedException | ExecutionException e) {\n logger.error(\"Error when obtain cluster health\", e);\n throw new ElasticExecutionException(\"Error when trying to obtain the server status\");\n }\n }", "public String getServerDetails();", "public HostStatus() {\n addressesChecker = (AddressesChecker)ServicesRegisterManager.platformWaitForService(Parameters.NETWORK_ADDRESSES);\n hostID = addressesChecker.getHostIdentifier();\n hostAddresses = addressesChecker.getAllAddresses();\n contextManager = (ContextManager)ServicesRegisterManager.platformWaitForService(Parameters.CONTEXT_MANAGER);\n cpuLoad = contextManager.getCpuLoad();\n memoryLoad = contextManager.getMemoryLoad();\n batteryLevel = contextManager.getBatteryLevel();\n numberOfThreads = contextManager.getNumberOfThreads();\n networkPFInputTraffic = contextManager.getPFInputTrafic();\n networkPFOutputTraffic = contextManager.getPFOutputTrafic();\n networkApplicationInputTraffic = contextManager.getApplicationInputTrafic();\n networkApplicationOutputTraffic = contextManager.getApplicationOutputTrafic();\n ContainersManager gestionnaireDeConteneurs = (ContainersManager)ServicesRegisterManager.platformWaitForService(Parameters.CONTAINERS_MANAGER);\n numberOfBCs = gestionnaireDeConteneurs.getComposants().getComponentsNumber();\n numberOfConnectors = gestionnaireDeConteneurs.getConnecteurs().getConnectorsNumber();\n numberOfConnectorsNetworkInputs = gestionnaireDeConteneurs.getConnecteurs().getNetworkInputConnectorsNumber();\n numberOfConnectorsNetworkOutputs = gestionnaireDeConteneurs.getConnecteurs().getNetworkOutputConnectorsNumber();\n }", "GlobalUpdateStatus update(ServerConfiguration serverConfig, @Nullable ProgressMonitor monitor);", "public void getSystemStatus() throws Exception\r\n\t{\r\n\t\tsystemDump.delete(0, systemDump.length());\r\n\r\n\t\tboolean needAlarm = memoryLogging();\r\n\r\n\t\tif (Database.appDatasource != null)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"Database connection status: \\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number database connection\\t\\t\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number busy database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumBusyConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number idle database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumIdleConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number idle database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumUnclosedOrphanedConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\r\n\t\tString queueWarningMessage = \"\";\r\n\r\n\t\tsystemDump.append(\"\\r\\n\");\r\n\t\tsystemDump.append(\"Local queue status: \\r\\n\");\r\n\r\n\t\tfor (String key : QueueFactory.localQueues.keySet())\r\n\t\t{\r\n\t\t\tLocalQueue localQueue = QueueFactory.getLocalQueue(key);\r\n\r\n\t\t\tsystemDump.append(\"Local queue (\");\r\n\t\t\tsystemDump.append(key);\r\n\t\t\tsystemDump.append(\"): \");\r\n\t\t\tsystemDump.append(localQueue.getSize());\r\n\r\n\t\t\tif (localQueue.getMaxSize() > 0)\r\n\t\t\t{\r\n\t\t\t\tsystemDump.append(\"/\");\r\n\t\t\t\tsystemDump.append(localQueue.getMaxSize());\r\n\t\t\t}\r\n\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\t\tif (QueueFactory.getTotalLocalPending() > 0)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"Total pending counter : \");\r\n\t\t\tsystemDump.append(QueueFactory.getTotalLocalPending());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\r\n\t\tif (queueDispatcherEnable)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"Remote queue status: \\r\\n\");\r\n\r\n\t\t\tQueueSession session = null;\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tsession = getQueueSession();\r\n\r\n\t\t\t\tfor (int j = 0; j < externalQueues.length; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (externalQueues[j].equals(\"\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tString queueName = externalQueues[j];\r\n\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tQueue checkQueue = QueueFactory.getQueue(queueName);\r\n\r\n\t\t\t\t\t\tint size = QueueFactory.getQueueSize(session, checkQueue);\r\n\r\n\t\t\t\t\t\tQueueFactory.queueSnapshot.put(queueName, new Integer(size));\r\n\r\n\t\t\t\t\t\tsystemDump.append(\"Total command request for \");\r\n\t\t\t\t\t\tsystemDump.append(queueName);\r\n\t\t\t\t\t\tsystemDump.append(\" : \");\r\n\t\t\t\t\t\tsystemDump.append(size);\r\n\t\t\t\t\t\tsystemDump.append(\"\\r\\n\");\r\n\r\n\t\t\t\t\t\tqueueWarningMessage += queueWarning(checkQueue, queueName, size);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsystemDump.append(\"Error occur when get size of queue \");\r\n\t\t\t\t\t\tsystemDump.append(queueName);\r\n\t\t\t\t\t\tsystemDump.append(\": \");\r\n\t\t\t\t\t\tsystemDump.append(e.getMessage());\r\n\r\n\t\t\t\t\t\tlogMonitor(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\tsystemDump.append(\"Can not get remote queue size: \");\r\n\t\t\t\tsystemDump.append(e.getMessage());\r\n\t\t\t\tsystemDump.append(\"\\r\\n\");\r\n\r\n\t\t\t\tlogMonitor(e);\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tQueueFactory.closeQueue(session);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (needAlarm)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"WARNING: Disk space is running low\");\r\n\t\t}\r\n\t\tif (!queueWarningMessage.equals(\"\"))\r\n\t\t{\r\n\t\t\tneedAlarm = true;\r\n\t\t\tsystemDump.append(queueWarningMessage);\r\n\t\t}\r\n\r\n\t\tlogMonitor(systemDump);\r\n\r\n\t\tif (needAlarm)\r\n\t\t{\r\n\t\t\tsendInstanceAlarm(\"system-resource\", systemDump.toString());\r\n\t\t}\r\n\t}", "public void clientInfo() {\n uiService.underDevelopment();\n }", "@Override\r\n\tpublic String index() {\n\t\treturn \"服务器维护中。。。。\";\r\n\t}", "public String getServerDescription();", "@GET\n @Path(\"/status\")\n @Produces(MediaType.TEXT_PLAIN)\n public String status() {\n Device device = getDevice();\n try {\n StreamingSession session = transportService.getSession(device.getId());\n return \"Status device:[\" + device.getId() + \"]\" + \" session [\" + session.toString() + \"]\";\n } catch (UnknownSessionException e) {\n return e.getMessage();\n }\n }", "public NdexStatus getServerStatus(boolean fullFormat) throws IOException, NdexException {\n \tfinal String route = NdexApiVersion.v2 + \"/admin/status?format=\" + (fullFormat? \"full\": \"standard\") ;\n\n \tNdexStatus status = this.ndexRestClient.getNdexObject(route, \"\", NdexStatus.class);\n \t\n\t\treturn status;\t\n }", "void doGetAdminInfo() {\n\t\tlog.config(\"doGetAdminInfo()...\");\n\t\tthis.rpcService.getAdminInfo(new AsyncCallback<DtoAdminInfo>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tString errorMessage = \"Error when getting admin info! : \" + caught.getMessage();\n\t\t\t\tlog.severe(errorMessage);\n\t\t\t\tgetAdminPanel().setActionResult(errorMessage, ResultType.error);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(DtoAdminInfo adminInfo) {\n\t\t\t\tlog.config(\"getAdminInfo() on success - \" + adminInfo.getListLogFilenames().size() + \" logs filenames.\");\n\t\t\t\tgetAdminPanel().setAdminInfo(adminInfo);\n\t\t\t}\n\t\t});\n\t}", "@Override\n public String getServerDisplayName() {\n return serverDisplayName;\n }", "@RequestMapping(value = \"status\")\n public @ResponseBody ObjectResponse<SystemStatusResponse> systemStatus() {\n SystemStatusResponse response = new SystemStatusResponse();\n response.setApplicationName(pushServiceConfiguration.getPushServerName());\n response.setApplicationDisplayName(pushServiceConfiguration.getPushServerDisplayName());\n response.setApplicationEnvironment(pushServiceConfiguration.getPushServerEnvironment());\n response.setTimestamp(new Date());\n return new ObjectResponse<>(response);\n }", "public ApplicationGatewayBackendHealthServerHealth health() {\n return this.health;\n }", "public String showStatus();", "public String getServer()\n {\n return server;\n }", "@SuppressWarnings(\"SleepWhileInLoop\")\n private StateChange profilingServerStatus() {\n LOGGER.log(Level.FINE,\n \"Profiling mode status hack for {0}\",\n new Object[]{instance.getName()});\n // Save process to be able to stop process waiting for profiler\n // to attach.\n support.setLocalStartProcess(instance.getProcess());\n // Try to sync the states after the profiler attaches.\n NODE_REFRESHER.post(new Runnable() {\n @Override\n public void run() {\n while (!PayaraState.isOnline(instance)) {\n try {\n Thread.sleep(200);\n } catch (InterruptedException ex) {\n }\n }\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n support.refresh();\n }\n });\n }\n });\n return new StateChange(this, TaskState.COMPLETED,\n TaskEvent.CMD_COMPLETED,\n \"MSG_SERVER_STARTED\", instanceName);\n }", "@GetMapping({\"/\", \"actuator/info\"})\n public ResponseEntity<String> info() {\n // Indicate the request succeeded and return the\n // application name and thread name.\n return ResponseEntity\n .ok(mApplicationContext.getId()\n + \" is alive and running on \"\n + Thread.currentThread()\n + \"\\n\");\n }", "public String configurationInfo();", "public String getServer() {\r\n return server;\r\n }", "@RequestMapping(value = \"/health\", method = RequestMethod.GET)\n public ResponseEntity<String> healthCheck() {\n\n return new ResponseEntity<String>(\"Up and Running\", HttpStatus.OK);\n }", "private void applicationHealthHandler(RoutingContext routingContext) {\n HttpServerResponse httpServerResponse = routingContext.response();\n httpServerResponse.setStatusCode(SUCCESS_CODE);\n httpServerResponse.end(\"myRetailApplication is up and running\");\n }", "@GET\n\t@Produces(MediaType.TEXT_HTML)\n\t@TypeHint(String.class)\n\tpublic Response healthCheck()\n\t{\n\t\t// very simple health check to validate the web application is running\n\t\t// just return a hard coded HTML resource (HTTP 200) if we're here\n\t\treturn Response.ok(getClass().getResourceAsStream(\"/html/healthResponse.html\")).cacheControl(noCache).build();\n\t}", "@Override\n public String displayInfo() {\n String str = getPluginName() + \"\\n\";\n str += \"Status: \";\n if (isRunning())\n str += \"running\";\n else\n str += \"stop\";\n str += \"\\nPort:\" + params.getUnifyExportPort();\n return str;\n }", "private void updateServerInfo() {\n ServerInfo serverInfo = new ServerInfo(serverConfig.getBaseURL(), serverConfig.getInfoURL(), serverRepositories.keySet());\n String serverInfoJson = new GsonBuilder().setPrettyPrinting().create().toJson(serverInfo);\n try {\n Files.write(Paths.get(\"\").resolve(Filenames.FILENAME_SERVERINFO), serverInfoJson.getBytes(StandardCharsets.UTF_8));\n } catch (IOException e) {\n log.error(\"could not write serverinfo file.\", e);\n }\n }", "void askServerInfo();", "public String getStunServer();", "public static ServerConfiguration getServerConfiguration() {\n return getOctaneDescriptor().getServerConfiguration();\n }", "public LocalServerConfig getConfig() {\n return serverConfig;\n }", "public String getSERVER() {\n \t\treturn SERVER;\n \t}", "@Override\n public void execute()\n {\n if(levelOfDetail != null)\n {\n if(levelOfDetail.equals(\"simple\"))\n serverStatusFactory = new SimpleFactory();\n else if(!levelOfDetail.equals(\"complex\"))\n throw new InvalidLevelOfDetailException();\n }\n\n status = serverStatusFactory.getServerStatus(id, String.format(template, name));\n\n for (String detail : details)\n {\n switch (detail)\n {\n case \"operations\":\n {\n status = serverStatusFactory.getOperationsDetailedServerStatus(status);\n break;\n }\n case \"extensions\":\n {\n status = serverStatusFactory.getExtensionDetailedServerStatus(status);\n break;\n }\n case \"memory\":\n {\n status = serverStatusFactory.getMemoryDetailedServerStatus(status);\n break;\n }\n default:\n {\n throw new InvalidDetailException();\n }\n }\n }\n status.setStatusDesc(status.generateStatusDesc());\n }", "@Override\n public String getServletInfo() {\n return \"Servlet is serving eBooksStoreAdminUsersPage.jsp\";\n }", "public static server getServer(){\n return thisServer;\n }", "public void showServerStats(double totalTime) {\n System.out.println(\"ServerID \" + \"Efficiency \" + \"CustomersServed \" + \"IdleTime \");\n for(int i = 0; i < cntServer; i++){\n serverArray[i].idleTime = totalTime - serverArray[i].busyTime;\n System.out.println(serverArray[i].toString());\n }\n }", "public String getServerName(){\n return this.serverName;\n }", "public ServerInfo(Server server) {\n if (server == null) {\n throw new NullArgumentException(\"Server must not be null\");\n }\n\n this.logger = server.getLogger();\n\n BufferedImage image;\n\n try {\n image = ImageIO.read(new File(\"server-icon.png\"));\n }\n catch (Exception e) {\n image = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);\n }\n\n this.setImage(image);\n this.setMotd(server.getMotd());\n }", "private String setServerStatusCode()\n\t{\n\t\t\n\t\tString response = null;\n\t HttpClient client = new DefaultHttpClient();\n\t HttpPost post = new HttpPost(\"http://10.184.0.132:8005/ContextAwareFrameworkWebService/apiCheckTest1\");\n\t Log.d(\"Debug\",\"test1\");\n\t // set values you'd like to send\n\t List pairs = new ArrayList();\n\t //pairs.add(new BasicNameValuePair(\"devEmail\", developerEmail));\n\t //pairs.add(new BasicNameValuePair(\"apiKey\", ApiKey));\n\t pairs.add(new BasicNameValuePair(\"pkgName\", appPkgName));\n\t pairs.add(new BasicNameValuePair(\"appId\", appId));\n\t pairs.add(new BasicNameValuePair(\"userEmail\", userEmailId));\n\t pairs.add(new BasicNameValuePair(\"\", deviceId));\n\t pairs.add(new BasicNameValuePair(\"random\", \"randomConstant\"));\n\t try {\n\t post.setEntity(new UrlEncodedFormEntity(pairs));\n\t // set ResponseHandler to handle String responses\n\t ResponseHandler<String> responseHandler = new BasicResponseHandler();\n\t response = client.execute(post, responseHandler);\n\t serverRequestStatus = true;\n\t serverStatus = response;\n\t Log.v(\"HttpPost\", \"Response: \" + serverStatus);\n\t } \n\t catch (Exception e) \n\t {\n\t \tLog.e(\"Debug\",\"Error in post method\");\n\t \te.printStackTrace();\n\t }\n\t \n\t return response;\n\t}", "public ServerConnectionStatusView(){\n\n\t\tserverConnectionStatusLabel.setName(WindowNames.SERVER_CONNECTION_STATUS_LABEL);\n\t\tserverConnectionAcceptanceButton.setName(WindowNames.SERVER_CONNECTION_ACCEPTANCE_BUTTON);\n\t\tserverConnectionInputField.setName(WindowNames.SERVER_CONNECTION_INPUT_FIELD);\n\t\t\n\t\tsetLayout(new GridBagLayout());\n\n\t\tComponentHelp.setAllThreeSizes(serverConnectionStatusLabel, new Dimension(300, 20));\n\t\tComponentHelp.setAllThreeSizes(serverConnectionInputField, new Dimension(200, 28));\n\t\tComponentHelp.setAllThreeSizes(serverConnectionAcceptanceButton, new Dimension(100, 30));\n\t\tserverConnectionAcceptanceButton.setText(\"Connect to server\");\n\t\tserverConnectionAcceptanceButton.setMargin(new Insets(2, 2, 2, 2));\n\t\tFont buttonFond = serverConnectionAcceptanceButton.getFont();\n\t\tserverConnectionAcceptanceButton.setFont( new Font(buttonFond.getName(), Font.BOLD, 9));\n\t\t\n\t\tserverConnectionStatusLabel.setText(ServerConnectionStatus.NotConnected.getText());\n\t\t\n\t\tComponentHelp.addComponent(this, serverConnectionStatusLabel, 0, 0, 3, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE );\n\t\tComponentHelp.addComponent(this, serverConnectionInputField, 0, 1, 2, 1, 0, 0, GridBagConstraints.LINE_START, GridBagConstraints.NONE );\n\t\tComponentHelp.addComponent(this, serverConnectionAcceptanceButton, 2, 1, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.NONE );\n\t\t\n\t\tsetVisible(true);\n\t\t\n\t\tComponentHelp.setAllThreeSizes(this, new Dimension(300, 50));\n\t\tsetBorder(new MatteBorder(1, 1, 1, 1, Color.GRAY));\n\t\t\n\t\tdisableViev();\n\t}", "public String getServerName();", "public ServerInfo() {\n this.logger = null;\n }", "public static void logStatus(){\r\n\t\tLogger log = Logger.getLogger(LOGGER_NAME);\r\n\t\tStringBuilder logString = new StringBuilder(\"\\n*** PlugIn Status ***\\n\");\r\n\t\t\r\n\t\tList<String> storagePlugins = getPluginsByType(PluginType.STORAGE);\r\n\t\tlogString.append(\"Storage PlugIns: \"+storagePlugins.size()+\"\\n\");\r\n\t\t\r\n\t\tlog.info(logString.toString());\r\n\t\treturn;\r\n\t}", "@Override\n @GET\n @Path(\"/servers\")\n @Produces(\"application/json\")\n public Response getServers() throws Exception {\n log.trace(\"getServers() started.\");\n JSONArray json = new JSONArray();\n for (Server server : cluster.getServerList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/servers/%d\", rootUri, server.getServerId());\n String serverUri = String.format(\"/providers/%d/servers/%d\", provider.getProviderId(), server.getServerId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", serverUri);\n json.put(o);\n }\n\n log.trace(\"getServers() finished successfully.\");\n return Response.ok(json.toString()).build();\n }", "public ServerConfig() {\n initComponents();\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "@Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n server.setStatus(MinecraftServer.DetailedStatus.PINGING, true);\n return server;\n }", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/apiservers/{name}/status\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<APIServer> readAPIServerStatus(\n @Path(\"name\") String name);", "public Properties getProperties() {\n return this.serverProperties;\n }", "public static String getServer() {\n\t\tif(produccion){\n\t\t\treturn server_produccion;\n\t\t}else{\n\t\t\treturn server;\n\t\t}\t\t\n\t}", "@ApiOperation(value = \"Get node configuration status.\", notes = \"Returns node configration status for this installation.\", response = Properties.class)\n @ApiResponses({@ApiResponse(code = 200, message = \"An array of propeties\"), @ApiResponse(code = 500, message = \"Unexpected error\")})\n @RequestMapping(value = {\"/xnatTask/checkNodeConfigurationStatus\"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<Properties> getNodeConfigurationStatus() {\n final HttpStatus status = isPermitted();\n if (status != null) {\n return new ResponseEntity<>(status);\n }\n \tfinal Properties prop = new Properties();\n \t// We'll display configuration if we have any configured nodes for this installation.\n \tfor (final XnatNodeInfo nodeInfo : _xnatNodeInfoService.getAll()) {\n \t\tif (!nodeInfo.getNodeId().equals(XnatNode.NODE_ID_NOT_CONFIGURED)) {\n \t\t\tprop.put(\"isConfigured\", String.valueOf(true));\n \t\t\treturn new ResponseEntity<>(prop, HttpStatus.OK);\n \t\t}\n \t\t\n \t}\n \tprop.put(\"isConfigured\", String.valueOf(false));\n return new ResponseEntity<>(prop, HttpStatus.OK);\n }", "protected static AuoServer getServer() {\n return server;\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public void getHealthStatus() {\n getHealthStatusAsync().block();\n }", "public String getServerName() {\n return serverName;\n }", "public String getServerName() {\n return serverName;\n }", "@GetMapping(\"/health\")\n\t@ApiOperation(value = \"Checks the health of Authentication microservice\")\n\tpublic ResponseEntity<String> healthCheckup() {\n\t\tlog.info(\"Health Check for Authentication Microservice\");\n\t\tlog.info(\"health checkup ----->{}\", \"up\");\n\t\treturn new ResponseEntity<>(\"Up and running...\", HttpStatus.OK);\n\t}", "private InformationManager() {\n\t\tlives = ConfigurationManager.getConfigurationManager().getConfiguration().getLives();\n\t\tshields = ConfigurationManager.getConfigurationManager().getConfiguration().getShields();\n\t}", "S getServer();", "@RequestMapping(value = \"/status\", method = RequestMethod.GET)\n public String status()\n {\n return \"status\";\n }", "public String getServername() {\r\n return servername;\r\n }", "protected void printServerConfig(){\n\t\t/*String filePrefix = System.getProperty(\"user.dir\")+\"/src/server/\"+gameName;\n\t\tFile gameFolderServ = new File(filePrefix);\n\t\tString filePrefix2 = System.getProperty(\"user.dir\")+\"/src/auctions/\"+gameName;\n\t\tFile gameFolderAuct = new File(filePrefix2);\n\n\t\tFile server_config = new File(filePrefix+\"/Config_AuctionServer.txt\");\n\t\t*/\n\t\tFile server_config = new File(\"src/server/\"+\"Config_AuctionServer.txt\");\n\t\tif(!server_config.exists()){\n\n\t\t\t try{\n\n\t\t\t\t //gameFolderServ.mkdir();\n\t\t\t\t // gameFolderAuct.mkdir();\n\t\t\t\t server_config.createNewFile();\n\t\t\t\t FileWriter fstream = new FileWriter(server_config);\n\t\t\t\t BufferedWriter out = new BufferedWriter(fstream);\n\t\t\t\t if(localIP){\n\t\t\t\t\t out.write(\"Host_IP:local\\n\");\n\t\t\t\t }else{\n\t\t\t\t\t out.write(\"Host_IP:public\\n\");\n\t\t\t\t }\n\n\t\t\t\t out.write(\"Port_Number:\"+port+\"\\n\");\n\t\t\t\t //out.newLine();\n\n\t\t\t\t out.write(\"Min_Number_Clients:\"+minClients+\"\\n\");\n\t\t\t\t out.write(\"Max_Number_Clients:\"+maxClients+\"\\n\");\n\t\t\t\t out.write(\"Max_Wait_For_Clients:\"+maxWait+\"\\n\");\n\t\t\t\t out.write(\"Response_Time:\"+responseTime);\n\t\t\t\t out.newLine();\n\t\t\t\t if(respTime){\n\t\t\t\t\t out.write(\"Full_Response_Time:true\");\n\t\t\t\t }else{\n\t\t\t\t\t out.write(\"Full_Response_Time:false\");\n\t\t\t\t }\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Server_Log_File:Log_AuctionServer.txt\");\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Server_Results_File:Results_AuctionServer.txt\");\n\t\t\t\t out.newLine();\n\n\t\t\t\t if(maxSeq>1 && maxSim>1){\n\t\t\t\t\t out.write(\"Auction_Type:SequentialAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_Sequential_of_Simultaneous.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSeq>1){\n\t\t\t\t\t out.write(\"Auction_Type:SequentialAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_SequentialAuction_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSim>1){\n\t\t\t\t\t out.write(\"Auction_Type:SimultaneousAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_SimultaneousAuction_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSeq==1 && maxSim==1){\n\t\t\t\t\t out.write(\"Auction_Type:\"+getAuctionName(auctionsSchedule[0])+\"\\n\");\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_\"+getAuctionName(auctionsSchedule[0])+\"_0_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else{\n\t\t\t\t\t System.out.println(\"ERROR: no auctions\");\n\t\t\t\t }\n\n\t\t\t\t out.write(\"Valuation_Type:\"+valueFxn);\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Valuation_Config_File:Config_Valuation\"+valueFxn+\".txt\");\n\n\t\t\t\t out.close();\n\n\t\t\t }catch (IOException e){\n\t\t\t\t\tSystem.out.println(\"file error creating Server Config.\");\n\t\t\t}\n\t\t}\n\t}", "protected Observer getStatusEngine() {\n\t\treturn new GatherStatusEngine(this);\n\t}", "public String status() throws Exception {\n\n \t\tString apiUrl = \"api/status.json\";\n \t\t\n \t\tString url = this.baseUrl + apiUrl;\n\n URL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t} else {\n\t response = \"{'error': 'Something went wrong, looks like the server is down.'}\";\n\t\t}\n\n\t\treturn response; \n \t}", "@ApiOperation(value = \"Check the heart beat.\")\r\n @GetMapping(path = RestfulEndPoints.AUTHENTICATION_HEALTH_CHECK)\r\n public String healthCheck() {\r\n return \"Hello, I am 'Authentication Service' and running quite healthy at port: \"\r\n + env.getProperty(\"local.server.port\");\r\n }", "public void featureStatus(CommandSender sender) {\n\t\tString statusMessage = \"\";\n\t\t\n\t\tif (enabled.adminGUI) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Admin GUI\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Admin GUI\");\n\t\t}\n\t\t\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.publicGUI) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Public GUI\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Public GUI\");\n\t\t}\n\t\t\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.nightVision) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Night Vision\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Night Vision\");\n\t\t}\n\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.discord) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Discord Bot\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Discord Bot\");\n\t\t}\n\t\t\n\t\tEChat.chat(sender, \"Enabled Features: \" + statusMessage);\n\t}", "public Map serviceStatus(String id) throws IOException\n\t{\n\t\treturn request(GET, address(id, \"stats\"));\n\t}", "ServerEntry getServer();", "public String getStatusDetails() { return statusDetails; }", "private void loadConfig() throws IOException {\n File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), \"bStats\");\n File configFile = new File(bStatsFolder, \"config.yml\");\n Config config = new Config(configFile);\n \n // Check if the config file exists\n if (!config.exists(\"serverUuid\")) {\n // Add default values\n config.set(\"enabled\", true);\n // Every server gets it's unique random id.\n config.set(\"serverUuid\", UUID.randomUUID().toString());\n // Should failed request be logged?\n config.set(\"logFailedRequests\", false);\n // Should the sent data be logged?\n config.set(\"logSentData\", false);\n // Should the response text be logged?\n config.set(\"logResponseStatusText\", false);\n \n DumperOptions dumperOptions = new DumperOptions();\n dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);\n writeFile(configFile,\n \"# bStats collects some data for plugin authors like how many servers are using their plugins.\",\n \"# To honor their work, you should not disable it.\",\n \"# This has nearly no effect on the server performance!\",\n \"# Check out https://bStats.org/ to learn more :)\",\n new Yaml(dumperOptions).dump(config.getRootSection()));\n }\n \n // Load the data\n enabled = config.getBoolean(\"enabled\", true);\n serverUUID = config.getString(\"serverUuid\");\n logFailedRequests = config.getBoolean(\"logFailedRequests\", false);\n logSentData = config.getBoolean(\"logSentData\", false);\n logResponseStatusText = config.getBoolean(\"logResponseStatusText\", false);\n }", "private String getConfigInfo(boolean verbose) {\r\n StringBuilder builder = new StringBuilder();\r\n\r\n GridHubConfiguration config = getRegistry().getConfiguration();\r\n builder.append(\"<b>Config for the hub :</b><br/>\");\r\n builder.append(prettyHtmlPrint(config));\r\n\r\n if (verbose) {\r\n\r\n GridHubConfiguration tmp = new GridHubConfiguration();\r\n\r\n builder.append(\"<b>Config details :</b><br/>\");\r\n builder.append(\"<b>hub launched with :</b>\");\r\n builder.append(tmp.hubConfig);\r\n\r\n\r\n builder.append(\"<br/><b>the final configuration comes from :</b><br/>\");\r\n builder.append(\"<b>the default :</b><br/>\");\r\n builder.append(prettyHtmlPrint(tmp));\r\n\r\n builder.append(prettyHtmlPrint(tmp));\r\n }\r\n return builder.toString();\r\n }", "@GET\n @Path(\"/metrics\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getStatus(@Context HttpServletRequest request) {\n try {\n BlahguaSession.ensureAdmin(request);\n return RestUtilities.make200OkResponse(SystemManager.getInstance().processMetrics(false));\n } catch (ResourceNotFoundException e) {\n return RestUtilities.make404ResourceNotFoundResponse(request, e);\n } catch (SystemErrorException e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n } catch (Exception e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n }\n }", "public Map<String, BasicServerMetrics> getServerMetrics() {\n return Collections.unmodifiableMap(myServerMetrics);\n }", "public Integer getAdminStatus() {\n return adminStatus;\n }", "public ServerStatus[] getServerStatus() {\r\n ServerStatus[] toReturn = new ServerStatus[0];\r\n\r\n String[] paramFields = {\"item_delimiter\", \"value_delimiter\"};\r\n SocketMessage request = new SocketMessage(\"admin\", \"server_status\",\r\n SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n request.setValue(\"item_delimiter\", ITEM_DELIMITER);\r\n request.setValue(\"value_delimiter\", VALUE_DELIMITER);\r\n\r\n SocketMessage response = handleMessage(request);\r\n if (!isSuccessful(response)) {\r\n if (\"\".equals(response.getErrorCode())) {\r\n setError(\"APIL_0201\", \"couldn't get server status\");\r\n } else {\r\n wrapError(\"APIL_0201\", \"couldn't get server status\");\r\n }\r\n return toReturn;\r\n } else {\r\n String serversString = response.getValue(\"servers\");\r\n StringTokenizer tokenizer = new StringTokenizer(serversString, ITEM_DELIMITER);\r\n toReturn = new ServerStatus[tokenizer.countTokens()];\r\n try {\r\n for (int i = 0; i < toReturn.length; i++) {\r\n String itemString = tokenizer.nextToken();\r\n StringTokenizer itemTokenizer = new StringTokenizer(itemString, VALUE_DELIMITER);\r\n String ip = itemTokenizer.nextToken();\r\n String portString = itemTokenizer.nextToken();\r\n String aliveString = itemTokenizer.nextToken();\r\n String timeString = itemTokenizer.nextToken();\r\n int port = Integer.parseInt(portString.trim());\r\n boolean alive = \"y\".equals(aliveString);\r\n long time = Tools.parseTime(timeString.trim());\r\n toReturn[i] = new ServerStatus(ip, port, time, alive);\r\n }\r\n } catch (Exception e) {\r\n setError(\"APIL_0202\", \"error in parsing status string: \" + serversString);\r\n return new ServerStatus[0];\r\n }\r\n }\r\n\r\n return toReturn;\r\n }", "@GET\n\t@Path(\"/status\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getStatus() {\n\t\treturn new JSONObject().put(\"currFloor\", Constants.currFloor).put(\"movingState\", Constants.movingState).toString();\n\t}", "public void intServerEnv() {\n\t\tServerUtils serverUtils = new ServerUtils();\n\t\tTouchstoneParsers parsers = new TouchstoneParsers();\n\n\t\tString CONFIGFILE = psoResourcePkg + \"/configs/server.properties\";\n\t\tString testConfigFile = ServerUtils.class.getResource(CONFIGFILE).getFile();\n\n\t\tHashMap<String, HashMap<String, String>> configPropsMap = parsers.readPropsFile(new File(testConfigFile));\n\t\thostIP = (configPropsMap.get(\"URL_PARAMS\").get(\"LOCAL_ENV\").equalsIgnoreCase(\"yes\") ? \"localhost\" : serverUtils.getHostIp());\n\n\t\t// JDBC driver name and database URL\n\t\tJDBC_DRIVER=\"com.mysql.jdbc.Driver\";\n\t\tDB_URL=\"jdbc:mysql://\" + hostIP + \"/psotest\";\n\n\t\t// Database credentials\n\t\tUSERID = configPropsMap.get(\"SERVER_ENV\").get(\"USERID\");\n\t\tPASSWORD = configPropsMap.get(\"SERVER_ENV\").get(\"PASSWORD\");\n\n\t\t// Database tables:\n\t\tCLICKS_TABLE = configPropsMap.get(\"SERVER_ENV\").get(\"CLICKS_TABLE\");\n\t\tBEACON_TABLE = configPropsMap.get(\"SERVER_ENV\").get(\"BEACON_TABLE\");\n\n\t}", "private void getloggersStatus() { \n\t\tAppClientFactory.getInjector().getSearchService().isClientSideLoggersEnabled(new SimpleAsyncCallback<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String result) {\n\t\t\t\tAppClientFactory.setClientLoggersEnabled(result);\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "public Server getServer() {\n return server;\n }", "public String getStatus() { return status; }", "private void updateInfo() {\n /* Show the current server address in use */\n String text = String.format(getResources().getString(R.string.main_activity_server_address),\n Utils.getAddress(), Utils.getPort());\n serverTextView.setText(text);\n\n /* Show information about current player */\n Player player = SharedDataManager.getPlayer(this);\n /* No player is logged in */\n if (player == null) {\n playerTextView.setText(getString(R.string.your_nickname));\n return;\n }\n /* Player is logged in, show some information about him */\n text = String.format(getResources().getString(R.string.main_activity_player_title),\n player.getNickname(), player.getScore());\n playerTextView.setText(text);\n }", "public String getHealthinfo() {\n return healthinfo;\n }", "public static final void handleServerStatus(final MapleClient c) {\n final int numPlayer = LoginServer.getUsersOn();\n final int userLimit = LoginServer.getUserLimit();\n if (numPlayer >= userLimit) {\n c.sendPacket(LoginPacket.getServerStatus(2));\n } else if (numPlayer * 2 >= userLimit) {\n c.sendPacket(LoginPacket.getServerStatus(1));\n } else {\n c.sendPacket(LoginPacket.getServerStatus(0));\n }\n }", "public GENServer getServer() {\n return server;\n }", "@GET\n\t@Produces(MediaType.TEXT_PLAIN)\n\t@ApiOperation(value = \"Checks if the application is running\", response = String.class)\n\t@ApiResponses(value = {@ApiResponse(code = 200, message = \"Application is running\", response = String.class)})\n\tpublic Response healthCheck() {\n\t\treturn Response.ok(\"Ok\")\n\t\t\t.build();\n\t}", "private void logAdminUI() {\n\t\tString httpPort = environment.resolvePlaceholders(ADMIN_PORT);\n\t\tAssert.notNull(httpPort, \"Admin server port is not set.\");\n\t\tlogger.info(\"Admin web UI: \"\n\t\t\t\t+ String.format(\"http://%s:%s/%s\", RuntimeUtils.getHost(), httpPort,\n\t\t\t\t\t\tConfigLocations.XD_ADMIN_UI_BASE_PATH));\n\t}", "@Override\n public final void contextInitialized(final ServletContextEvent sce) {\n context = sce.getServletContext();\n\n String apiSrvDaemonPath = context.getRealPath(PS);\n System.setProperty(\"APISrvDaemonPath\", context.getRealPath(\"/\"));\n System.setProperty(\"APISrvDaemonVersion\",\n \"v.0.0.2-22-g2338f25-2338f25-40\");\n\n // Notify execution\n System.out.println(\"--- \" + \"Starting APIServerDaemon \"\n + System.getProperty(\"APISrvDaemonVersion\") + \" ---\");\n System.out.println(\"Java vendor : '\" + VN + \"'\");\n System.out.println(\"Java vertion: '\" + VR + \"'\");\n System.out.println(\"Running as : '\" + US + \"' username\");\n System.out.println(\"Servlet path: '\" + apiSrvDaemonPath + \"'\");\n\n // Initialize log4j logging\n String log4jPropPath =\n apiSrvDaemonPath + \"WEB-INF\" + PS + \"log4j.properties\";\n File log4PropFile = new File(log4jPropPath);\n\n if (log4PropFile.exists()) {\n System.out.println(\"Initializing log4j with: \" + log4jPropPath);\n PropertyConfigurator.configure(log4jPropPath);\n } else {\n System.err.println(\n \"WARNING: '\" + log4jPropPath\n + \" 'file not found, so initializing log4j \"\n + \"with BasicConfigurator\");\n BasicConfigurator.configure();\n }\n\n // Make a test with jdbc/geApiServerPool\n // jdbc/UserTrackingPool\n // jdbc/gehibernatepool connection pools\n String currentPool = \"not yet defined!\";\n String poolPrefix = \"java:/comp/env/\";\n String[] pools = {\"jdbc/fgApiServerPool\",\n \"jdbc/UserTrackingPool\",\n \"jdbc/gehibernatepool\"};\n Connection[] connPools = new Connection[pools.length];\n\n for (int i = 0; i < pools.length; i++) {\n try {\n Context initContext = new InitialContext();\n Context envContext =\n (Context) initContext.lookup(\"java:comp/env\");\n\n currentPool = pools[i];\n\n // DataSource ds =\n // (DataSource)initContext.lookup(poolPrefix+currentPool);\n DataSource ds = (DataSource) envContext.lookup(currentPool);\n\n connPools[i] = ds.getConnection();\n System.out.println(\"PERFECT: \" + currentPool + \" was ok\");\n } catch (Exception e) {\n System.err.println(\"WARNING: \" + currentPool + \" failed\" + LS\n + e.toString());\n } finally {\n try {\n connPools[i].close();\n } catch (Exception e) {\n System.err.println(\"WARNING: \" + currentPool\n + \" failed to close\" + LS + e.toString());\n }\n }\n }\n\n // Register MySQL driver\n APIServerDaemonDB.registerDriver();\n\n // Initializing the daemon\n if (asDaemon == null) {\n asDaemon = new APIServerDaemon();\n }\n\n asDaemon.startup();\n }", "String status();", "String status();", "int getServerState();", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "public int getServerState() {\n return serverState_;\n }", "public interface GlobalServerConfiguration {\n\n /**\n * Gets the location for the AdapterConfig for the specified namespace\n */\n public String getAdapterConfigLocation(String namespace);\n\n /**\n * Gets the location of the FeedConfig for the specified namespace\n */\n public String getFeedConfigLocation(String namespace);\n\n /**\n * Gets the Feed Configuration suffix\n */\n public String getFeedConfigSuffix();\n\n /**\n * Gets the namespace\n */\n public String getFeedNamespace(String namespace);\n\n /**\n * Gets the namespace prefix\n */\n public String getFeedNamespacePrefix(String namespace);\n\n /**\n * Gets the Server port\n */\n public int getPort();\n\n /**\n * Gets the URI for the feedserver with the specified namespace\n */\n public String getServerUri(String namespace);\n\n /**\n * Gets URI prefix for Feeds\n */\n public String getFeedPathPrefix();\n\n /**\n * Gets the {@link FeedConfiguration} for the specified feed in the namespace\n * \n * @param namespace The namespace the feed is in\n * @param feedId The feed to get the {@link FeedConfiguration} for\n * @param userId User email of per user feed requested; null if not per user feed\n */\n public FeedConfiguration getFeedConfiguration(String namespace, String feedId, String userId)\n throws FeedConfigStoreException;\n\n /**\n * Get the fully qualified class name for adapter wrapper manager.\n * \n * @return fully qualified class name for adapter wrapper manager.\n */\n public String getWrapperManagerClassName();\n\n /**\n * Gets the {@link FeedConfigStore} for the Server Configuration\n */\n public FeedConfigStore getFeedConfigStore();\n\n /**\n * Get the fully qualified class name of the provider that will be used for\n * this server.\n * \n * @return fully qualified class name of the Provider.\n */\n public String getProviderClassName();\n\n @SuppressWarnings(\"unchecked\")\n public AdapterBackendPool getAdapterBackendPool(String poolId);\n\n @SuppressWarnings(\"unchecked\")\n public void setAdapterBackendPool(String poolId, AdapterBackendPool pool);\n\n public AclValidator getAclValidator();\n\n public void setAclValidator(AclValidator aclValidator);\n\n}", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "protected StatusService getStatusService() {\n return getLockssDaemon().getStatusService();\n }", "@RequestMapping(value = \"/get\", method = RequestMethod.GET)\n @ResponseBody\n public ResponseVO getStatus() {\n SettingVO settingVO = settingService.getStatus();\n return ResponseVO.success(settingVO);\n }", "@Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n if (server.getDetailedStatus() == MinecraftServer.DetailedStatus.OFFLINE && server.getOfflineSince() == 0) {\n //If the server has gone offline, we update the offline since.\n server.setOfflineSince(server.getLastUpdateTime());\n //We set the boolean to true if the application is running since status are update in real-time on the UI.\n server.setHasOfflineStatusBeenSeen(bindCount > 0);\n }\n return server;\n }", "protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }", "public static server getNameServer(){\n return nameServer;\n }" ]
[ "0.65033966", "0.6388766", "0.6136624", "0.60880727", "0.6080348", "0.59808826", "0.59496915", "0.58884573", "0.5878266", "0.5837793", "0.5832997", "0.5786027", "0.57760894", "0.577477", "0.5736441", "0.57128924", "0.5693972", "0.56865823", "0.5683113", "0.5671153", "0.5665709", "0.5636254", "0.56262296", "0.56146353", "0.56001073", "0.5599379", "0.5585263", "0.55793387", "0.55691355", "0.5552832", "0.55466837", "0.5545928", "0.54875344", "0.54864925", "0.5476018", "0.5468147", "0.5460455", "0.54593164", "0.54523414", "0.54465795", "0.5436187", "0.5401192", "0.53932756", "0.53920645", "0.53567487", "0.53429526", "0.53416425", "0.53411907", "0.53328764", "0.53298223", "0.53234065", "0.53189015", "0.53187144", "0.5313576", "0.5310094", "0.53016067", "0.53016067", "0.52952313", "0.52907443", "0.5289741", "0.5284598", "0.5281147", "0.5278707", "0.52760136", "0.52750164", "0.527203", "0.52716875", "0.52701426", "0.5267276", "0.52652484", "0.5263452", "0.5243299", "0.52405405", "0.52399707", "0.52394086", "0.52390075", "0.52321476", "0.5231626", "0.5227712", "0.52260786", "0.52216697", "0.52187043", "0.52120364", "0.5207468", "0.5207031", "0.5206696", "0.51984155", "0.51984066", "0.5196635", "0.5196635", "0.5195154", "0.51946133", "0.5190665", "0.5188465", "0.51822126", "0.51820046", "0.5178693", "0.51712495", "0.5163068", "0.51570326" ]
0.52712286
67
Returns the last 100 database requests along with the request timing and internal job id. The admin tool uses it to present request timing information to the user.
public ShowSystemTimingResponse showSystemTiming(ShowSystemTimingRequest request) throws GPUdbException { ShowSystemTimingResponse actualResponse_ = new ShowSystemTimingResponse(); submitRequest("/show/system/timing", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static long getRequests() {\n return requests;\n }", "long getLastFetchTimeMs();", "public int getBatchDownloadWaitTime()\n {\n return 1000; \n }", "private void viewPendingRequests() {\n\n\t}", "public int getRequests()\n\t{\n\t\tint requests=0;\n\t\tString query=\"select count(*) from requests where status=?\";\n\t\ttry\n\t\t{\n\t\t\tConnection con=DBInfo.getConn();\t\n\t\t\tPreparedStatement ps=con.prepareStatement(query);\n\t\t\tps.setString(1, \"Confirm\");\n\t\t\tResultSet res=ps.executeQuery();\n\t\t\twhile(res.next())\n\t\t\t{\n\t\t\t\trequests=res.getInt(1);\n\t\t\t}\n\t\t\tcon.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn requests;\n\t}", "default long getLastFetchTimeMs() {\n return 0;\n }", "public Long get_cachetotpetrequests() throws Exception {\n\t\treturn this.cachetotpetrequests;\n\t}", "public Date getLastRequest() {\n\t\treturn _last_request;\n\t}", "SdkHttpRequest getLastRequest();", "@Override\r\n\tpublic RequestsTracker getRecentRequests() {\r\n\t\treturn recentRequestsTracker.snapshot(true);\r\n\t}", "public final String getMaximumOutstandingRequests() {\n return properties.get(MAXIMUM_OUTSTANDING_REQUESTS_PROPERTY);\n }", "public Long get_cachetotrequests() throws Exception {\n\t\treturn this.cachetotrequests;\n\t}", "List<RequestHistory> getQueries() throws RemoteException;", "public Long get_cachetotparameterizedrequests() throws Exception {\n\t\treturn this.cachetotparameterizedrequests;\n\t}", "public int getCountRequests() {\n/* 415 */ return this.countRequests;\n/* */ }", "public static void main(String[] args) throws InterruptedException {\n\n Random random = new Random();\n RateLimitingVOne rateLimiter = new RateLimitingVOne();\n UUID userId = UUID.randomUUID();\n\n List<Request> allRequests = new ArrayList<>();\n\n long start = System.currentTimeMillis();\n for (int i = 1; i < 100; i++) {\n int count = random.nextInt(10);\n Request nr = new Request(count> 0 ? count : 1, System.currentTimeMillis(), i);\n allRequests.add(nr);\n rateLimiter.handleNewRequest(nr, userId);\n// sleep(random.nextInt(350));\n sleep(250);\n }\n\n long elapsed = System.currentTimeMillis() - start;\n\n System.out.println(\"Time ---- >> \"+ elapsed);\n\n for (Request tr : allRequests) {\n long since = (tr.timestamp - start);\n int count = tr.isRejected ? -tr.requestsCount : tr.requestsCount;\n System.out.println(tr.sequence+\", \"+ since + \" , \" + count);\n }\n\n\n Request r = rateLimiter.userRequestLog.get(userId);\n int count =0;\n while (r.previous != null) {\n count++;\n r = r.previous;\n }\n\n System.out.println(count);\n\n\n }", "public int getMaxRequestUrlsReported() {\n return maxRequestUrlsReported;\n }", "public List<CustomerRequest> getCurrentRequests();", "long getRequestsCount();", "void getRequests();", "public final int getDeferredRequests() {\n return deferredRequests;\n }", "public long getRequestTime() {\n return requestTime_;\n }", "public static ArrayList<Request> loadRequests() {\n ArrayList<Request> requests = new ArrayList<Request>();\n try {\n Connection connection = DBHelper.getConnection();\n PreparedStatement statement = connection.prepareStatement(\"SELECT * \" + \n \"FROM requestsToApprove\");\n ResultSet results = statement.executeQuery();\n while (results.next()) {\n\n Resource tempResource = Resource.getResource(results.getInt(\"rID\"));\n if (tempResource != null) {\n // resource exits\n requests.add(new Request(results.getString(\"username\"),\n tempResource));\n } // otherwise do nothing. Should warn user\n\n }\n return requests;\n\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Long get_cachetotparameterizedinvalidationrequests() throws Exception {\n\t\treturn this.cachetotparameterizedinvalidationrequests;\n\t}", "public List<Integer> getRequests () {\n return requests;\n }", "ConcurrentHashMap<SQLiteConnection, QueryAndTime> getCurrentQueries() {\n return currentQueries;\n }", "public long getRequestTime() {\n return requestTime_;\n }", "Rsp.RequestFromSelf getRequests(int index);", "private int getLatestRuns() {\n // return 90 for simplicity\n return 90;\n }", "public Long get_cachetotnonparameterizedinvalidationrequests() throws Exception {\n\t\treturn this.cachetotnonparameterizedinvalidationrequests;\n\t}", "private void getBatchStatisticsRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_BATCH_STATISTICS.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\t\taddReportingBatchId(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "public Long get_cachetotinvalidationrequests() throws Exception {\n\t\treturn this.cachetotinvalidationrequests;\n\t}", "public synchronized List<Request> getAllDescending() {\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(false));\n\t\treturn all;\n\t}", "@Override\n public String toString()\n {\n return String.format(\"request in Thread %d(%s): \", reqID, masterThread); \n }", "public List getPendingRequests(PendingRequest pendingRequest);", "public List<RequestJob> getAllJob() {\n List<RequestJob> allJob = null;\n if (allJob == null) {\n allJob = requestJobMapper.selectByExample(new RequestJobExample());\n }\n MemCacheUtil.set(\"job-list\", allJob);\n return allJob;\n }", "public Long getWaiting_query_secs() {\n return waiting_query_secs;\n }", "public static int getPendingRequests() {\n\t\treturn writeQueue.size() + requestsBeingSending.intValue();\n\t}", "public void sendGetRequest() {\r\n\t\tString[] requests = this.input.substring(4, this.input.length()).split(\" \"); \r\n\t\t\r\n\t\tif(requests.length <= 1 || !(MyMiddleware.readSharded)){\r\n\t\t\tnumOfRecipients = 1;\r\n\t\t\trecipient = servers.get(loadBalance());\r\n\r\n\t\t\trecipient.send(this, input);\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\t\r\n\t\t\tif(requests.length <= 1) {\r\n\t\t\t\tnumOfGets++;\r\n\t\t\t\ttype= \"10\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumOfMultiGets++;\r\n\t\t\t\ttype = requests.length+\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString reply = recipient.receive();\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\t\r\n\t\t\tint hit = 0;\r\n\t\t\thit += reply.split(\"VALUE\").length - 1;\r\n\t\t\tmiss += requests.length-hit;\r\n\r\n\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsendBack(currentJob.getClient(), reply);\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnumOfMultiGets++;\r\n\t\t\ttype = requests.length+\"\";\r\n\t\t\tnumOfRecipients = servers.size();\r\n\t\t\trequestsPerServer = requests.length / servers.size();\r\n\t\t\tremainingRequests = requests.length % servers.size() ;\r\n\t\t\t\r\n\t\t\t//The worker thread sends a number of requests to each server equal to requestsPerServer \r\n\t\t\t//and at most requestsPerServer + remainingRequests\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < servers.size(); i++) {\r\n\t\t\t\tmessage = requestType;\r\n\t\t\t\tfor(int j = 0; j < requestsPerServer; j++){\r\n\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\tmessage += requests[requestsPerServer*i+j];\r\n\t\t\t\t\tif(i < remainingRequests) {\r\n\t\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\t\tmessage += requests[requests.length - remainingRequests + i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tservers.get(i).send(this, message);\r\n\t\t\t}\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\tint hit = 0;\r\n\t\t\tfor(ServerHandler s : servers) {\r\n\t\t\t\tString ricevuto = s.receive();\r\n\t\t\t\thit += ricevuto.split(\"VALUE\").length - 1;\r\n\t\t\t\treplies.add(ricevuto);\r\n\t\t\t}\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\r\n\t\t\tmiss += requests.length-hit;\r\n\t\t\t\r\n\t\t\tfinalReply = \"\";\r\n\t\t\tfor(String reply : replies) {\r\n\t\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\t\treplies.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treply = reply.substring(0, reply.length() - 3);\r\n\t\t\t\t\tfinalReply += reply;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalReply += \"END\";\r\n\t\t\tsendBack(currentJob.getClient(), finalReply);\r\n\t\t\treplies.clear();\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "long getLastTimeRequestSentMillis() {\n\t\treturn lastTimeRequestSentMillis;\n\t}", "public static String retrieveDataLake() {\n return CoreUtil.constructPageFromList(DrillConnector.getQueryExecutionResponse(QUERY_RETRIEVE_DATABASES, 1));\n }", "@Override\r\n\tpublic RequestsTracker getAllRequests() {\r\n\t\treturn allRequestsTracker;\r\n\t}", "public static long getApiMaxInflightRequests() {\n return 5000L;\n }", "public List<TimeSpan> getRequestedTimes()\r\n {\r\n return myRequestedTimes;\r\n }", "public java.lang.String getTimeLimitAction();", "@GetMapping(\"/job-bids\")\n @Timed\n public List<JobBid> getAllJobBids() {\n log.debug(\"REST request to get all JobBids\");\n return jobBidRepository.findAll();\n }", "@RequestMapping(path = \"/last24hCanceledRoutes\", method = RequestMethod.GET)\n public List<RouteCanceled> getLast24hCanceledRoutes() {\n Query queryObject = new Query(\"Select * from route_canceled\", \"blablamove\");\n QueryResult queryResult = BlablamovebackendApplication.influxDB.query(queryObject);\n\n InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();\n System.out.println(\"queryResult : \" + queryResult);\n List<RouteCanceled> routeCanceledList = resultMapper\n .toPOJO(queryResult, RouteCanceled.class);\n\n LocalDateTime stop = LocalDateTime.now().minusHours(0);\n LocalDateTime start = LocalDateTime.now().minusHours(24).withSecond(0).withMinute(0).withNano(0);\n\n return routeCanceledList.stream().filter(routeCanceled -> instantIsBetweenDates(routeCanceled.getTime(), start, stop)).collect(Collectors.toList());\n }", "private void getLargeOrderList(){\n sendPacket(CustomerTableAccess.getConnection().getLargeOrderList());\n \n }", "@GetMapping(\"/last-connections\")\n @Timed\n public ResponseEntity<LastConnectionDTO> getMyLastConnection() {\n log.debug(\"REST request to get My LastConnection\");\n LastConnectionDTO lastConnectionDTO = lastConnectionService.findOneByNumCptExt(MockUtil.NUM_COMPTE_EXT);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(lastConnectionDTO));\n }", "List<SdkHttpRequest> getRequests();", "public Map<String,Long> getCurrentOnJobWorkerNums(String accessKey, Set<String> entityIds) throws org.apache.thrift.TException;", "private List<Integer> getTimeReports(HttpServletRequest request, int nbrOfReports) {\n\t\tList<Integer> timeReports = new ArrayList<Integer>();\n\t\tfor (int i=1; i<=nbrOfReports; i++) {\n\t\t\tString reportIDstr = request.getParameter(\"reportIDs\"+i);\n\t\t\tif (reportIDstr != null) {\n\t\t\t\tint reportID = Integer.parseInt(reportIDstr);\n\t\t\t\ttimeReports.add(reportID);\n\t\t\t}\n\t\t}\n\t\treturn timeReports;\n\t}", "public void listJobExecutions() {\r\n\t\tRestCall caller = new RestCall();\r\n\t\tHttpURLConnection connection = caller.connect(endpoint + tenantId\r\n\t\t\t\t+ \"/job-executions\", null, \"GET\", token);\r\n\t\ttry {\r\n\t\t\tconnection.connect();\r\n\t\t\tSystem.out.println(caller.getResponse(connection));\r\n\t\t\tconnection.disconnect();\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public ActionForward showBatchList( ActionMapping mapping, ActionForm form, HttpServletRequest request,\r\n HttpServletResponse response )\r\n throws IOException, ServletException\r\n {\r\n\r\n response.setContentType( \"text/html\" );\r\n ServletOutputStream out = response.getOutputStream();\r\n out.println( \"<html>\" );\r\n out.println( \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"theme/charte_v03_001/css/master.css\\\">\" );\r\n out.println( \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"theme/welcom-001.css\\\">\" );\r\n out.println( \"<body>\" );\r\n out.println( \"<H1>Server batch admin</H1>\" );\r\n out.println( \"Pool size : \" + WatchedTaskManager.getInstance( request ).getWorkQueue().getPoolSize() + \"<BR>\" );\r\n out.println( \"Waiting tasks : \" + WatchedTaskManager.getInstance( request ).getWorkQueue().getWaitingTasks()\r\n + \"<BR>\" );\r\n\r\n out.println( \"<table class=\\\"tblh\\\"><thead><tr><th>ID</th><th>impl</th><th>progress</th><th>status</th><th>errors</th><th>age(ms)</th></tr></thead>\" );\r\n try\r\n {\r\n Collection colTasks = WatchedTaskManager.getInstance( request ).getAllTasks();\r\n\r\n synchronized ( colTasks )\r\n {\r\n\r\n long now = System.currentTimeMillis();\r\n Iterator iter = colTasks.iterator();\r\n final String myClassLignePaire = \"clair\";// WelcomConfigurator.getMessage(WelcomConfigurator.getCharte().getWelcomConfigFullPrefix()\r\n // + \".cols.even\");\r\n int i = 0;\r\n while ( iter.hasNext() )\r\n {\r\n i++;\r\n\r\n if ( i % 2 == 0 )\r\n {\r\n out.print( \"<tr class=\\\"\" + myClassLignePaire + \"\\\">\" );\r\n }\r\n else\r\n {\r\n out.print( \"<tr class=\\\"\\\">\" );\r\n }\r\n\r\n WatchedTask batch = (WatchedTask) iter.next();\r\n Object taskId = WatchedTaskManager.getInstance( request ).getTaskId( batch );\r\n long ageTache = now - batch.getProgress().getCreationDate();\r\n\r\n out.print( \"<td>\" + taskId + \"</td>\" );\r\n out.print( \"<td>\" + batch.getClass().getName() + \"</td>\" );\r\n out.print( \"<td>\" + batch.getProgress().getPercentComplete() + \"</td>\" );\r\n out.print( \"<td>\" + batch.getStatus() + \"</td>\" );\r\n out.print( \"<td>\" + batch.getErrors() + \"</td>\" );\r\n out.print( \"<td>\" + ageTache + \"</td>\" );\r\n /*\r\n * LIen pour la suppression de la tache out.print( \"<td><a href=\" + request.getContextPath() +\r\n * request.getServletPath() + \"?action=killBatch&taskId=\" + taskId + \">kill</a>\" + \"</td>\");\r\n */\r\n out.println( \"</tr>\" );\r\n }\r\n out.println( \"</tfoot></table></body></html>\" );\r\n }\r\n\r\n }\r\n catch ( Exception e )\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n return null;\r\n }", "int getRequestsCount();", "int getRequestsCount();", "public List findRequests(RequestCriteria _criteria) throws RequestManagerException, PersistenceResourceAccessException;", "Page<HrDocumentRequest> getPendingDocumentRequests(Pageable pageRequest);", "public Long getSendRequestTimes()\r\n {\r\n return sendRequestTimes;\r\n }", "public List<PerfBenchmarkDetail> getRecentDetailList(int limit, String testName);", "@GET\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic List<CohabitRequestInfo> listAllCohabitRequests(){\r\n\t\t\r\n\t\tEntityManager em = getEntityManager();\r\n\t\tManageRequestService service = new ManageRequestService(em);\r\n\t\tList<CohabitRequest> cohabitRequests = service.viewAllRequests();\r\n\t\tList<CohabitRequestInfo> requests = CohabitRequestInfo.wrap(cohabitRequests);\r\n\t\tem.close();\r\n\t\t\r\n\t\treturn requests;\r\n\t}", "public Object[] getSql_Qry_Hist(String UserId,String L_SysCd,String L_JobCd,\r\n \t\tString Cbo_ReqCd, String L_ItemId)\tthrows SQLException, Exception {\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tPreparedStatement pstmt2 = null;\r\n\t\tResultSet rs = null;\r\n\t\tResultSet rs2 = null;\r\n\t\tStringBuffer strQuery = new StringBuffer();\r\n\t\tArrayList<HashMap<String, String>> rtList = new ArrayList<HashMap<String, String>>();\r\n\t\tHashMap<String, String>\t\t\t rst\t\t = null;\r\n\r\n\t\tConnectionContext connectionContext = new ConnectionResource();\r\n\t\ttry {\r\n\t\t\tconn = connectionContext.getConnection();\r\n\r\n\t\t strQuery.setLength(0);\r\n\t \tstrQuery.append(\"select a.cr_acptno,a.cr_aplydate,a.cr_status, \\n\");\r\n\t \tstrQuery.append(\" a.cr_rsrccd,a.cr_qrycd,b.cm_username,c.cm_codename, \\n\");\r\n\t \tstrQuery.append(\" d.cr_qrycd qrycd,d.cr_sayu,d.cr_passok,d.cr_passcd \\n\");\r\n\t \tstrQuery.append(\" , to_char(d.cr_acptdate,'yyyy-mm-dd hh24:mi:ss') cr_acptdate \\n\");\r\n\t \tstrQuery.append(\" , to_char(a.cr_prcdate,'yyyy-mm-dd hh24:mi:ss') cr_prcdate \\n\");\r\n\t \tstrQuery.append(\" , d.cr_itsmtitle , d.cr_itsmid \\n\");\r\n\t \tstrQuery.append(\" from cmr1010 a,cmr1000 d,cmm0040 b,cmm0020 c \\n\");\r\n\t \tstrQuery.append(\" where a.cr_itemid=? and \\n\"); //L_ItemId\r\n if (!Cbo_ReqCd.equals(\"ALL\")){\r\n \tstrQuery.append(\" d.cr_qrycd=? and \\n\"); //Cbo_ReqCd\r\n }\r\n strQuery.append(\" a.cr_acptno=d.cr_acptno and \\n\");\r\n strQuery.append(\" a.cr_editor=b.cm_userid and \\n\");\r\n strQuery.append(\" c.cm_macode='REQUEST' and d.cr_qrycd=c.cm_micode \\n\");\r\n if (Cbo_ReqCd.equals(\"ALL\") || Cbo_ReqCd.equals(\"04\")){\r\n\t strQuery.append(\" union \\n\");\r\n\t strQuery.append(\" select b.cr_acptno,'' as cr_aplydate,'9' cr_status,a.cr_rsrccd, \\n\");\r\n\t strQuery.append(\" decode(b.cr_qrycd,'03','최초이행','추가이행') as cr_qrycd,c.cm_username, \\n\");\r\n\t strQuery.append(\" decode(b.cr_qrycd,'03','최초이행','추가이행') as cm_codename, \\n\");\r\n\t strQuery.append(\" '04' as qrycd, \\n\");\r\n\t strQuery.append(\" '형상관리 일괄이행' as cr_passcd, '0' as cr_passok,'형상관리 일괄이행' as cr_passcd \\n\"); \r\n\t strQuery.append(\" , to_char(b.cr_acptdate,'yyyy-mm-dd hh24:mi:ss') as cr_acptdate \\n\");\r\n\t strQuery.append(\" , to_char(b.cr_acptdate,'yyyy-mm-dd hh24:mi:ss') as cr_prcdate \\n\");\r\n\t strQuery.append(\" , '' as cr_itsmtitle , '' as cr_itsmid\\n\");\r\n\t strQuery.append(\" from cmr0020 a,cmr0021 b,cmm0040 c \\n\");\r\n\t strQuery.append(\" where a.cr_itemid=? and \\n\"); //L_ItemId\r\n\t strQuery.append(\" b.cr_qrycd in ('03','05') and \\n\");\r\n\t strQuery.append(\" a.cr_itemid = b.cr_itemid and \\n\");\r\n\t strQuery.append(\" b.cr_editor=c.cm_userid \\n\");\r\n }\r\n strQuery.append(\" order by cr_prcdate desc \\n\");\r\n\r\n\t\t //pstmt = conn.prepareStatement(strQuery.toString());\r\n\t\t pstmt = new LoggableStatement(conn, strQuery.toString());\r\n\t\t int CNT = 0;\r\n\t \tpstmt.setString(++CNT, L_ItemId);\r\n\t \tif (!Cbo_ReqCd.equals(\"ALL\")) pstmt.setString(++CNT, Cbo_ReqCd);\r\n\t \tif (Cbo_ReqCd.equals(\"ALL\") || Cbo_ReqCd.equals(\"04\")) pstmt.setString(++CNT, L_ItemId);\r\n\t \tecamsLogger.error(((LoggableStatement)pstmt).getQueryString());\r\n\t \trs = pstmt.executeQuery();\r\n\t\t while (rs.next()){\r\n\t\t\t\trst = new HashMap<String,String>();\r\n\t\t\t\t//rst.put(\"NO\",Integer.toString(rs.getRow()));\r\n\t\t\t\trst.put(\"SubItems1\",rs.getString(\"cr_acptdate\"));//rs.getString(\"cr_acptdate\").substring(0,rs.getString(\"cr_acptdate\").length()-2)\r\n\t\t\t\trst.put(\"SubItems2\",rs.getString(\"cm_username\"));\r\n\r\n\t\t\t\trst.put(\"SubItems3\",rs.getString(\"cm_codename\"));\r\n\t\t\t\tif (rs.getString(\"cr_acptno\").substring(4,6).equals(\"04\")){\r\n\t\t\t\t\tstrQuery.setLength(0);\r\n\t\t\t\t\tstrQuery.append(\"select cm_codename from cmm0020 where cm_macode='CHECKIN' and cm_micode=? \\n\");\r\n\t\t\t\t pstmt2 = conn.prepareStatement(strQuery.toString());\r\n\t\t\t\t pstmt2.setString(1, rs.getString(\"cr_qrycd\"));\r\n\t\t\t \trs2 = pstmt2.executeQuery();\r\n\t\t\t \tif (rs2.next())\r\n\t\t\t \t\trst.put(\"SubItems3\",rs.getString(\"cm_codename\") + \"[\" + rs2.getString(\"cm_codename\") + \"]\");\r\n\t\t\t \trs2.close();\r\n\t\t\t \tpstmt2.close();\r\n }\r\n rst.put(\"qrycd\", rs.getString(\"qrycd\"));\r\n rst.put(\"SubItems4\",rs.getString(\"cr_acptno\").substring(6));\r\n\r\n if (!rs.getString(\"qrycd\").equals(\"04\")){\r\n\t rst.put(\"SubItems5\",\"\");\r\n }else{\r\n \tstrQuery.setLength(0);\r\n \tstrQuery.append(\"select cm_codename from cmm0020 \\n\");\r\n \tstrQuery.append(\"where cm_macode='REQPASS' and cm_micode=? \\n\");//cr_passok\r\n \tpstmt2 = conn.prepareStatement(strQuery.toString());\r\n \tpstmt2.setString(1, rs.getString(\"cr_passok\"));\r\n\t\t\t \trs2 = pstmt2.executeQuery();\r\n\t\t\t \tif (rs2.next())\r\n\t\t\t \t\trst.put(\"SubItems5\",rs2.getString(\"cm_codename\"));\r\n\t\t\t \trs2.close();\r\n\t\t\t \tpstmt2.close();\r\n\r\n\t\t\t\t\tif (rs.getString(\"cr_aplydate\") != null){\r\n\t if (rs.getString(\"cr_aplydate\").equals(\"9\"))\r\n\t \trst.put(\"SubItems5\",\"적용제외\");\r\n\t else\r\n\t \trst.put(\"SubItems5\",\"적용일시적용[\"+rs.getString(\"cr_aplydate\").substring(0,4)\r\n\t \t\t\t+\"/\"+rs.getString(\"cr_aplydate\").substring(4,6)+\"/\"+rs.getString(\"cr_aplydate\").substring(6,8)\r\n\t \t\t\t+\" \"+rs.getString(\"cr_aplydate\").substring(8,10)+\":\"+rs.getString(\"cr_aplydate\").substring(10,12)+\"]\");\r\n\t\t\t\t\t}\r\n }\r\n\r\n if (rs.getString(\"cr_prcdate\") != null){\r\n\t if (rs.getString(\"cr_prcdate\").length() > 0){\r\n\t \tif (rs.getString(\"cr_status\").equals(\"3\"))\r\n\t\t \t rst.put(\"SubItems6\", \"[반송]\" + rs.getString(\"cr_prcdate\"));//rs.getString(\"cr_prcdate\").substring(5,rs.getString(\"cr_prcdate\").length()-2)\r\n\t \telse\r\n\t \t rst.put(\"SubItems6\", rs.getString(\"cr_prcdate\"));//rs.getString(\"cr_prcdate\").substring(5,rs.getString(\"cr_prcdate\").length()-2)\r\n\t \t//rst.put(\"SubItems6\", rs.getString(\"cr_prcdate\").substring(5,7) + \"/\" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(8,10) + \" \" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(10,12) + \":\" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(12,14) + \":\" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(14));\r\n\t }\r\n } else {\r\n \trst.put(\"SubItems6\",\"진행중\");\r\n }\r\n if ( rs.getString(\"cr_sayu\") !=null ){\r\n \trst.put(\"SubItems7\", rs.getString(\"cr_sayu\"));//신청사유\r\n } else {\r\n \trst.put(\"SubItems7\", \"\");//신청사유\r\n }\r\n \r\n if ( rs.getString(\"cr_itsmid\") != null ) {\r\n \trst.put(\"srinfo\", \"[\" + rs.getString(\"cr_itsmid\") + \"]\" + rs.getString(\"cr_itsmtitle\") );\r\n } else {\r\n \trst.put(\"srinfo\", \"\" );\r\n }\r\n rst.put(\"SubItems8\", rs.getString(\"cr_acptno\"));\r\n rst.put(\"SubItems9\", rs.getString(\"cr_status\"));\r\n rtList.add(rst);\r\n rst = null;\r\n\t\t }\r\n\t\t rs.close();\r\n\t\t pstmt.close();\r\n\t\t conn.close();\r\n\t\t rs = null;\r\n\t\t pstmt = null;\r\n\t\t conn = null;\r\n\r\n\t\t\treturn rtList.toArray();\r\n\r\n\t\t} catch (SQLException sqlexception) {\r\n\t\t\tif (conn != null){\r\n\t\t\t\tconn.close();conn = null;\r\n\t\t\t}\r\n\t\t\tsqlexception.printStackTrace();\r\n\t\t\tthrow sqlexception;\r\n\t\t} catch (Exception exception) {\r\n\t\t\tif (conn != null){\r\n\t\t\t\tconn.close();conn = null;\r\n\t\t\t}\r\n\t\t\texception.printStackTrace();\r\n\t\t\tthrow exception;\r\n\t\t}finally{\r\n\t\t\tif (strQuery != null)\tstrQuery = null;\r\n\t\t\tif (rtList != null)\trtList = null;\r\n\t\t\tif (rs != null) try{rs.close();}catch (Exception ex){ex.printStackTrace();}\r\n\t\t\tif (pstmt != null) try{pstmt.close();}catch (Exception ex2){ex2.printStackTrace();}\r\n\t\t\tif (conn != null){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tConnectionResource.release(conn);\r\n\t\t\t\t}catch(Exception ex3){\r\n\t\t\t\t\tex3.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }", "int getActiveBlockRequestsNumber() {\n return blockRequests.size();\n }", "private List<TOMMessage> getRequestsToRelay() {\n\n List<TOMMessage> messages = lcManager.getCurrentRequestTimedOut();\n\n if (messages == null) {\n\n messages = new LinkedList<>();\n }\n\n // Include requests from STOP messages in my own STOP message\n List<TOMMessage> messagesFromSTOP = lcManager.getRequestsFromSTOP();\n if (messagesFromSTOP != null) {\n\n for (TOMMessage m : messagesFromSTOP) {\n\n if (!messages.contains(m)) {\n\n messages.add(m);\n }\n }\n }\n\n logger.debug(\"I need to relay \" + messages.size() + \" requests\");\n\n return messages;\n }", "@Override\n public int getMaxJobsPerAcquisition() {\n return myMaxJobsPerAcquisition;\n }", "TrackerAdminRequests getTrackerAdminRequests(final Integer id);", "public RequestFromSelf getRequests(int index) {\n return instance.getRequests(index);\n }", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "int getServerWorkIterations();", "DataResult<List<Job>> getAll();", "public List<Request> viewPending(int id) {\n\t\tList<Request> list = null;\n\t\tRequest request = null;\n\t\t\t\t\n\t\ttry {\n\t\t\tlist = new ArrayList<Request>();\n\t\t\tString sql = \"select * from requests \"+\n\t\t\t\t \"where employee_id = \"+id+\" and status = 'pending'\";\n\n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(sql);\n\t\t\t\n\t\t\twhile(resultSet.next()) {\n\t\t\t\trequest = new Request();\n\t\t\t\trequest.setId(resultSet.getInt(\"request_id\"));\t\t\t\t\t\t\n\t\t\t\trequest.setEmpId(resultSet.getInt(\"employee_id\"));\n\t\t\t\trequest.setMgrId(resultSet.getInt(\"manager_id\"));\n\t\t\t\trequest.setRequestAmount(resultSet.getInt(\"request_amount\"));\n\t\t\t\trequest.setExpenseDate(resultSet.getString(\"expense_date\"));\n\t\t\t\trequest.setStatus(resultSet.getString(\"status\"));\n\t\t\t\trequest.setDecision(resultSet.getString(\"decision\"));\n\t\t\t\tlist.add(request);\n\t\t\t}\n\t\t\t\treturn list;\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\treturn null;\n\t}", "@Override\n public List<Integer> getAllWorklogIds() {\n List<Integer> worklogIds;\n\n try (Connection connection = database.connect();\n PreparedStatement stmt = connection.prepareStatement(GET_ALL_WORKLOG_IDS_SQL)) {\n worklogIds = worklogIdDataMapper.toDTO(stmt.executeQuery());\n } catch (SQLException e) {\n logger.logToDatabase(getClass().getName(), \"getAllWorklogIds\", e);\n throw new InternalServerErrorException(e.getMessage());\n }\n return worklogIds;\n }", "public String getLimit_Base();", "java.util.List<Rsp.RequestFromSelf>\n getRequestsList();", "long getEvictions();", "@Nonnegative\n @CheckReturnValue\n public abstract int getRemainingRequests();", "int getQueryTimeNsec();", "public long getTimeLimit() {\n\t\treturn timeLimit;\n\t}", "long getLastAccessed( );", "private void checkRequests()\n\t{\n\t\t// to be honest I don't see why this can't be 5 seconds, but I'm trying 1 second\n\t\t// now as the existing 0.1 second is crazy given we're checking for events that occur\n\t\t// at 60+ second intervals\n\n\t\tif ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ){\n\n\t\t\treturn;\n\t\t}\n\n\t\tfinal long now =SystemTime.getCurrentTime();\n\n\t\t//for every connection\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\t\tfor (int i =peer_transports.size() -1; i >=0 ; i--)\n\t\t{\n\t\t\tfinal PEPeerTransport pc =(PEPeerTransport)peer_transports.get(i);\n\t\t\tif (pc.getPeerState() ==PEPeer.TRANSFERING)\n\t\t\t{\n\t\t\t\tfinal List expired = pc.getExpiredRequests();\n\t\t\t\tif (expired !=null &&expired.size() >0)\n\t\t\t\t{ // now we know there's a request that's > 60 seconds old\n\t\t\t\t\tfinal boolean isSeed =pc.isSeed();\n\t\t\t\t\t// snub peers that haven't sent any good data for a minute\n\t\t\t\t\tfinal long timeSinceGoodData =pc.getTimeSinceGoodDataReceived();\n\t\t\t\t\tif (timeSinceGoodData <0 ||timeSinceGoodData >60 *1000)\n\t\t\t\t\t\tpc.setSnubbed(true);\n\n\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\tDiskManagerReadRequest request =(DiskManagerReadRequest) expired.get(0);\n\n\t\t\t\t\tfinal long timeSinceData =pc.getTimeSinceLastDataMessageReceived();\n\t\t\t\t\tfinal boolean noData =(timeSinceData <0) ||timeSinceData >(1000 *(isSeed ?120 :60));\n\t\t\t\t\tfinal long timeSinceOldestRequest = now - request.getTimeCreated(now);\n\n\n\t\t\t\t\t//for every expired request \n\t\t\t\t\tfor (int j = (timeSinceOldestRequest >120 *1000 && noData) ? 0 : 1; j < expired.size(); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the request object\n\t\t\t\t\t\trequest =(DiskManagerReadRequest) expired.get(j);\n\t\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\t\tpc.sendCancel(request);\t\t\t\t//cancel the request object\n\t\t\t\t\t\t//get the piece number\n\t\t\t\t\t\tfinal int pieceNumber = request.getPieceNumber();\n\t\t\t\t\t\tPEPiece\tpe_piece = pePieces[pieceNumber];\n\t\t\t\t\t\t//unmark the request on the block\n\t\t\t\t\t\tif ( pe_piece != null )\n\t\t\t\t\t\t\tpe_piece.clearRequested(request.getOffset() /DiskManager.BLOCK_SIZE);\n\t\t\t\t\t\t// remove piece if empty so peers can choose something else, except in end game\n\t\t\t\t\t\tif (!piecePicker.isInEndGameMode())\n\t\t\t\t\t\t\tcheckEmptyPiece(pieceNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "@GetMapping(\"/stats.latest\")\n @ResponseBody\n public List<ShortUrl> latestStats() {\n\n // Simple return of last 10 urls and access records. This would need a lot more\n // work to scale, including creating a more granular API\n\n List<ShortUrl> latest = repository.findTop10ByOrderByCreatedOnDesc();\n\n return latest;\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException\n\t{\n\t\tfor (int i = 0; i < NUM_LOOPS; i++)\n\t\t{\n\t\t\tTuple tuple = Tuple.defaultTuple();\n\t\t\tCounterWorkCallable task = new CounterWorkCallable(\"counter\" + i, shardedCounterService, tuple);\n\t\t\ttry\n\t\t\t{\n\t\t\t\ttask.call();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tint actualIncrements = 0;\n\t\tlogger.info(\"Expected \" + (NUM_INCREMENTS_PER_LOOPS * NUM_LOOPS) + \" Increments. Actual Increments: \"\n\t\t\t+ actualIncrements);\n\n\t}", "public int getLastTimetable() {\n return lastTimetable;\n }", "public int getRequestRetryCount() {\n \t\treturn 1;\n \t}", "public void dump(String name) {\n String date = new SimpleDateFormat(\"c\",Locale.getDefault()).format(startDate);\n Log.v(\"Maply\", String.format(\"---MaplyTileFetcher %s Stats since %s---\",name,date));\n Log.v(\"Maply\", String.format(\" Active Requests = %d\",activeRequests) );\n Log.v(\"Maply\", String.format(\" Max Active Requests = %d\",maxActiveRequests) );\n Log.v(\"Maply\", String.format(\" Total Requests = %d\",totalRequests) );\n Log.v(\"Maply\", String.format(\" Canceled Requests = %d\",totalCancels) );\n Log.v(\"Maply\", String.format(\" Failed Requests = %d\",totalFails) );\n Log.v(\"Maply\", String.format(\" Data Transferred = %.2fMB\",(float)remoteData) );\n if (remoteRequests > 0) {\n Log.v(\"Maply\", String.format(\" Latency per request = %.2fms\",totalLatency / remoteRequests * 1000.0) );\n Log.v(\"Maply\", String.format(\" Average request size = %.2fKB\",remoteData / remoteRequests / 1024.0) );\n }\n Log.v(\"Maply\", String.format(\" Cached Data = %.2fMB\",localData / (1024.0*1024.0)) );\n }", "com.google.cloud.talent.v4.Job getJobs(int index);", "public long getRequestGapMillis()\n {\n return requestGapMillis;\n }", "public Long get_cacheparameterizedrequestsrate() throws Exception {\n\t\treturn this.cacheparameterizedrequestsrate;\n\t}", "public Request loadRequestDetail(long _requestId) throws RequestManagerException, PersistenceResourceAccessException;", "@RequestMapping(path = \"/last24hDeliveredItems\", method = RequestMethod.GET)\n public List<DeliveredItem> getLast24hDeliveredItems() {\n Query queryObject = new Query(\"Select * from delivery_item\", \"blablamove\");\n QueryResult queryResult = BlablamovebackendApplication.influxDB.query(queryObject);\n\n InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();\n System.out.println(\"queryResult : \" + queryResult);\n List<DeliveredItem> deliveredItemList = resultMapper\n .toPOJO(queryResult, DeliveredItem.class);\n\n LocalDateTime stop = LocalDateTime.now().minusHours(0);\n LocalDateTime start = LocalDateTime.now().minusHours(24).withSecond(0).withMinute(0).withNano(0);\n\n return deliveredItemList.stream().filter(deliveredItem -> instantIsBetweenDates(deliveredItem.getTime(), start, stop)).collect(Collectors.toList());\n }", "List<ResourceUsage> getLast30DaysMemoryInfo() {\n return daoInterface.getLast30DaysMemoryInfo();\n\n }", "void requestRateLimited();", "@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355562000000\"; //--multi-dist\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multi\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"multidist\");\r\n\t\t\t\t//multiCounter.printResponse(req, \"multidist\");\r\n\t\t\t\t//use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"multidist\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}", "public int getBatchDownloadFailureCountdown()\n {\n return 0; \n }", "int getCacheConcurrency();", "@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 }", "BigInteger getResponse_time();", "public int getDelay() {\n return Math.abs(currentRequest.getRequestToFloor() - currentRequest.getRequestFromFloor()) * 1000;\n }", "protected List<Long> getMoreIds(int requestSize) {\n\n String sql = getSql(requestSize);\n\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n try {\n connection = dataSource.getConnection();\n\n statement = connection.prepareStatement(sql);\n resultSet = statement.executeQuery();\n\n List<Long> newIds = readIds(resultSet, requestSize);\n if (newIds.isEmpty()) {\n throw new PersistenceException(\"Always expecting more than 1 row from \" + sql);\n }\n\n return newIds;\n\n } catch (SQLException e) {\n if (e.getMessage().contains(\"Database is already closed\")) {\n String msg = \"Error getting SEQ when DB shutting down \" + e.getMessage();\n log.log(ERROR, msg);\n System.out.println(msg);\n return Collections.emptyList();\n } else {\n throw new PersistenceException(\"Error getting sequence nextval\", e);\n }\n } finally {\n closeResources(connection, statement, resultSet);\n }\n }", "@GET\n @Deprecated\n @Path(\"jobs\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response jobGet(@QueryParam(\"created_before\") String createdBefore,\n @QueryParam(\"created_after\") String createdAfter) throws Exception {\n //List<LGJob> jobs;\n boolean doCreatedBefore = false;\n boolean doCreatedAfter = false;\n Date beforeDate = null;\n Date afterDate = null;\n\n // Parse created_before if present\n if ((createdBefore != null) && (!createdBefore.equals(\"\"))) {\n Instant beforeInstant = null;\n try {\n beforeInstant = Instant.parse(createdBefore);\n } catch (DateTimeParseException e) {\n return Response.status(201).entity(\"Invalid created_on Date format [\" + createdBefore + \"]\").build();\n }\n beforeDate = Date.from(beforeInstant);\n doCreatedBefore = true;\n }\n\n // Parse created_after if present\n if ((createdAfter != null) && (!createdAfter.equals(\"\"))) {\n Instant afterInstant = null;\n try {\n afterInstant = Instant.parse(createdAfter);\n } catch (DateTimeParseException e) {\n return Response.status(201).entity(\"Invalid created_after Date format [\" + createdAfter + \"]\").build();\n }\n afterDate = Date.from(afterInstant);\n doCreatedAfter = true;\n }\n\n\n JSONObject graphJobs = new JSONObject();\n try {\n graphJobs = Utils.getLemongraphJob(request, \"\", null);//this considers createdBefore/createdAfter params\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n JSONArray ids = new JSONArray();\n Iterator<String> idIterator = graphJobs.keys();\n while (idIterator.hasNext()) {\n String id = idIterator.next();\n ids.put(id);\n }\n\n JSONObject ob = new JSONObject();\n if(ids.length() > 0) {\n // Build response\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMM dd,yyyy HH:mm:ss\");\n JSONObject mongoJobs = Utils.getMongoJobs(ids);\n Iterator iterator = mongoJobs.keySet().iterator();\n while (iterator.hasNext()) {\n String id = iterator.next().toString();\n try {\n JSONObject mongoJob = mongoJobs.getJSONObject(id);\n JSONObject job = new JSONObject();\n\n //Default value checks\n if (!mongoJob.has(\"reason\")) {\n mongoJob.put(\"reason\", \"\");\n }\n if (!mongoJob.has(\"endTime\")) {\n mongoJob.put(\"endTime\", 0);\n }\n if (!mongoJob.has(\"totalRunningTimeSeconds\")) {\n mongoJob.put(\"totalRunningTimeSeconds\", 0);\n }\n if (!mongoJob.has(\"approvedAdapterNames\")) {\n mongoJob.put(\"approvedAdapterNames\", new JSONArray());\n }\n if (!mongoJob.has(\"startTime\")) {\n mongoJob.put(\"startTime\", 0);\n }\n if (!mongoJob.has(\"jobErrors\")) {\n mongoJob.put(\"jobErrors\", new JSONArray());\n }\n if (!mongoJob.has(\"taskMap\")) {\n mongoJob.put(\"taskMap\", new JSONObject());\n }\n if (!mongoJob.has(\"jobConfig\")) {\n mongoJob.put(\"jobConfig\", new JSONObject());\n }\n if (!mongoJob.has(\"expireDate\")) {\n mongoJob.put(\"expireDate\", 0);\n }\n if (!mongoJob.has(\"graphActivity\")) {\n mongoJob.put(\"graphActivity\", 0);\n }\n if (!mongoJob.has(\"createDate\")) {\n mongoJob.put(\"createDate\", 0);\n }\n if (!mongoJob.has(\"status\")) {\n mongoJob.put(\"status\", 0);\n }\n\n job.put(\"reason\", mongoJob.get(\"reason\"));\n job.put(\"endtime\", sdf.format(mongoJob.get(\"endTime\")));\n job.put(\"runtime\", mongoJob.get(\"totalRunningTimeSeconds\"));\n job.put(\"approvedadapters\", mongoJob.getJSONArray(\"approvedAdapterNames\"));\n job.put(\"starttime\", sdf.format(mongoJob.get(\"startTime\")));\n job.put(\"error_count\", mongoJob.getJSONArray(\"jobErrors\").length());\n job.put(\"task_count\", mongoJob.getJSONObject(\"taskMap\").length());\n job.put(\"job_config\", new JSONObject(mongoJob.get(\"jobConfig\").toString()));\n job.put(\"expire_date\", sdf.format(mongoJob.get(\"expireDate\")));\n job.put(\"job_id\", id);\n job.put(\"graph_activity\", mongoJob.get(\"graphActivity\"));\n job.put(\"create_date\", sdf.format(mongoJob.get(\"createDate\")));\n int status = mongoJob.getInt(\"status\");\n job.put(\"status\", LGJob.getStatusString(status));\n\n int active = 0;\n try {\n if (status == LGJob.STATUS_PROCESSING) { //only processing jobs have non-zero active_task_count\n ArrayList<Document> docs = new MongoDBStore().getTasksFromJob(id);\n JSONObject tasks = MongoDBStore.toJSON(docs);\n active = LGJob.getActiveTaskCount(tasks);\n }\n } catch (Exception e) {\n log.debug(\"Couldn't fetch active task count for job:\" + id + \" Error:\" + e.getMessage());\n }\n\n job.put(\"active_task_count\", active);\n ob.put(id, job);\n } catch (Exception e) {\n log.info(\"Invalid job:\" + id + \" Error:\" + e.getMessage());\n }\n }\n }\n return Response.status(200).entity(ob.toString()).build();\n }", "@Postprocess\n public void getReport() {\n try {\n BufferedWriter bufferWriter = new BufferedWriter(new FileWriter(logfile, false));\n if (!results.isEmpty()) {\n bufferWriter.write(\"===========================================================\\n\");\n bufferWriter.write(\"sys_milli,\\t\\tdb_micro,\\t\\ttime_diff\\n\");\n Collections.sort(results);\n for (MysqlheartbeatBean mhb : results) {\n bufferWriter.write(String.valueOf(mhb.getSysMilli()) + \",\\t\\t\"\n + String.valueOf(mhb.getDbMicro()) + \",\\t\\t\"\n + String.valueOf(mhb.getDbMicro() - mhb.getSysMilli()) + \"\\n\");\n }\n bufferWriter.flush();\n }\n bufferWriter.close();\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"{0}: {1}\", new Object[]{toolName, ex.getMessage()});\n }\n }" ]
[ "0.6010472", "0.55152375", "0.54980797", "0.5445995", "0.53925824", "0.5274115", "0.52588093", "0.5256573", "0.5233699", "0.5233337", "0.5227398", "0.5207003", "0.5204901", "0.5190923", "0.51746196", "0.51650524", "0.51414007", "0.51365685", "0.51299906", "0.50985545", "0.5092214", "0.50710493", "0.50641114", "0.50634277", "0.50346214", "0.503005", "0.50273055", "0.5024869", "0.4988147", "0.49875572", "0.4970316", "0.49672037", "0.49510142", "0.4947802", "0.49284336", "0.4900666", "0.48773482", "0.48715177", "0.48703316", "0.48698992", "0.4862389", "0.4847513", "0.483783", "0.48309317", "0.48300347", "0.48197618", "0.48135507", "0.4813273", "0.4804473", "0.48008752", "0.4791657", "0.47903347", "0.47871482", "0.4786492", "0.47801444", "0.47801444", "0.47778174", "0.4777254", "0.47741127", "0.47697216", "0.47388127", "0.4735772", "0.47326794", "0.47253898", "0.4720612", "0.47163367", "0.47110805", "0.47077307", "0.4704709", "0.4695723", "0.46947822", "0.46927896", "0.46750054", "0.4670516", "0.4663885", "0.46631026", "0.46491995", "0.46472105", "0.46456695", "0.46335775", "0.4630546", "0.462766", "0.46249804", "0.4624699", "0.46229595", "0.46125874", "0.46102083", "0.46101096", "0.46013755", "0.45991057", "0.45986426", "0.45944005", "0.45873055", "0.4581335", "0.45803145", "0.45798314", "0.45758656", "0.45752934", "0.45737723", "0.45731422", "0.457264" ]
0.0
-1
Returns the last 100 database requests along with the request timing and internal job id. The admin tool uses it to present request timing information to the user.
public ShowSystemTimingResponse showSystemTiming(Map<String, String> options) throws GPUdbException { ShowSystemTimingRequest actualRequest_ = new ShowSystemTimingRequest(options); ShowSystemTimingResponse actualResponse_ = new ShowSystemTimingResponse(); submitRequest("/show/system/timing", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static long getRequests() {\n return requests;\n }", "long getLastFetchTimeMs();", "public int getBatchDownloadWaitTime()\n {\n return 1000; \n }", "private void viewPendingRequests() {\n\n\t}", "public int getRequests()\n\t{\n\t\tint requests=0;\n\t\tString query=\"select count(*) from requests where status=?\";\n\t\ttry\n\t\t{\n\t\t\tConnection con=DBInfo.getConn();\t\n\t\t\tPreparedStatement ps=con.prepareStatement(query);\n\t\t\tps.setString(1, \"Confirm\");\n\t\t\tResultSet res=ps.executeQuery();\n\t\t\twhile(res.next())\n\t\t\t{\n\t\t\t\trequests=res.getInt(1);\n\t\t\t}\n\t\t\tcon.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn requests;\n\t}", "default long getLastFetchTimeMs() {\n return 0;\n }", "public Long get_cachetotpetrequests() throws Exception {\n\t\treturn this.cachetotpetrequests;\n\t}", "public Date getLastRequest() {\n\t\treturn _last_request;\n\t}", "SdkHttpRequest getLastRequest();", "@Override\r\n\tpublic RequestsTracker getRecentRequests() {\r\n\t\treturn recentRequestsTracker.snapshot(true);\r\n\t}", "public final String getMaximumOutstandingRequests() {\n return properties.get(MAXIMUM_OUTSTANDING_REQUESTS_PROPERTY);\n }", "public Long get_cachetotrequests() throws Exception {\n\t\treturn this.cachetotrequests;\n\t}", "List<RequestHistory> getQueries() throws RemoteException;", "public Long get_cachetotparameterizedrequests() throws Exception {\n\t\treturn this.cachetotparameterizedrequests;\n\t}", "public int getCountRequests() {\n/* 415 */ return this.countRequests;\n/* */ }", "public static void main(String[] args) throws InterruptedException {\n\n Random random = new Random();\n RateLimitingVOne rateLimiter = new RateLimitingVOne();\n UUID userId = UUID.randomUUID();\n\n List<Request> allRequests = new ArrayList<>();\n\n long start = System.currentTimeMillis();\n for (int i = 1; i < 100; i++) {\n int count = random.nextInt(10);\n Request nr = new Request(count> 0 ? count : 1, System.currentTimeMillis(), i);\n allRequests.add(nr);\n rateLimiter.handleNewRequest(nr, userId);\n// sleep(random.nextInt(350));\n sleep(250);\n }\n\n long elapsed = System.currentTimeMillis() - start;\n\n System.out.println(\"Time ---- >> \"+ elapsed);\n\n for (Request tr : allRequests) {\n long since = (tr.timestamp - start);\n int count = tr.isRejected ? -tr.requestsCount : tr.requestsCount;\n System.out.println(tr.sequence+\", \"+ since + \" , \" + count);\n }\n\n\n Request r = rateLimiter.userRequestLog.get(userId);\n int count =0;\n while (r.previous != null) {\n count++;\n r = r.previous;\n }\n\n System.out.println(count);\n\n\n }", "public int getMaxRequestUrlsReported() {\n return maxRequestUrlsReported;\n }", "public List<CustomerRequest> getCurrentRequests();", "long getRequestsCount();", "void getRequests();", "public final int getDeferredRequests() {\n return deferredRequests;\n }", "public long getRequestTime() {\n return requestTime_;\n }", "public static ArrayList<Request> loadRequests() {\n ArrayList<Request> requests = new ArrayList<Request>();\n try {\n Connection connection = DBHelper.getConnection();\n PreparedStatement statement = connection.prepareStatement(\"SELECT * \" + \n \"FROM requestsToApprove\");\n ResultSet results = statement.executeQuery();\n while (results.next()) {\n\n Resource tempResource = Resource.getResource(results.getInt(\"rID\"));\n if (tempResource != null) {\n // resource exits\n requests.add(new Request(results.getString(\"username\"),\n tempResource));\n } // otherwise do nothing. Should warn user\n\n }\n return requests;\n\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Long get_cachetotparameterizedinvalidationrequests() throws Exception {\n\t\treturn this.cachetotparameterizedinvalidationrequests;\n\t}", "public List<Integer> getRequests () {\n return requests;\n }", "ConcurrentHashMap<SQLiteConnection, QueryAndTime> getCurrentQueries() {\n return currentQueries;\n }", "public long getRequestTime() {\n return requestTime_;\n }", "Rsp.RequestFromSelf getRequests(int index);", "private int getLatestRuns() {\n // return 90 for simplicity\n return 90;\n }", "public Long get_cachetotnonparameterizedinvalidationrequests() throws Exception {\n\t\treturn this.cachetotnonparameterizedinvalidationrequests;\n\t}", "private void getBatchStatisticsRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_BATCH_STATISTICS.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\t\taddReportingBatchId(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "public Long get_cachetotinvalidationrequests() throws Exception {\n\t\treturn this.cachetotinvalidationrequests;\n\t}", "public synchronized List<Request> getAllDescending() {\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(false));\n\t\treturn all;\n\t}", "@Override\n public String toString()\n {\n return String.format(\"request in Thread %d(%s): \", reqID, masterThread); \n }", "public List getPendingRequests(PendingRequest pendingRequest);", "public List<RequestJob> getAllJob() {\n List<RequestJob> allJob = null;\n if (allJob == null) {\n allJob = requestJobMapper.selectByExample(new RequestJobExample());\n }\n MemCacheUtil.set(\"job-list\", allJob);\n return allJob;\n }", "public Long getWaiting_query_secs() {\n return waiting_query_secs;\n }", "public static int getPendingRequests() {\n\t\treturn writeQueue.size() + requestsBeingSending.intValue();\n\t}", "public void sendGetRequest() {\r\n\t\tString[] requests = this.input.substring(4, this.input.length()).split(\" \"); \r\n\t\t\r\n\t\tif(requests.length <= 1 || !(MyMiddleware.readSharded)){\r\n\t\t\tnumOfRecipients = 1;\r\n\t\t\trecipient = servers.get(loadBalance());\r\n\r\n\t\t\trecipient.send(this, input);\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\t\r\n\t\t\tif(requests.length <= 1) {\r\n\t\t\t\tnumOfGets++;\r\n\t\t\t\ttype= \"10\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumOfMultiGets++;\r\n\t\t\t\ttype = requests.length+\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString reply = recipient.receive();\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\t\r\n\t\t\tint hit = 0;\r\n\t\t\thit += reply.split(\"VALUE\").length - 1;\r\n\t\t\tmiss += requests.length-hit;\r\n\r\n\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsendBack(currentJob.getClient(), reply);\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnumOfMultiGets++;\r\n\t\t\ttype = requests.length+\"\";\r\n\t\t\tnumOfRecipients = servers.size();\r\n\t\t\trequestsPerServer = requests.length / servers.size();\r\n\t\t\tremainingRequests = requests.length % servers.size() ;\r\n\t\t\t\r\n\t\t\t//The worker thread sends a number of requests to each server equal to requestsPerServer \r\n\t\t\t//and at most requestsPerServer + remainingRequests\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < servers.size(); i++) {\r\n\t\t\t\tmessage = requestType;\r\n\t\t\t\tfor(int j = 0; j < requestsPerServer; j++){\r\n\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\tmessage += requests[requestsPerServer*i+j];\r\n\t\t\t\t\tif(i < remainingRequests) {\r\n\t\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\t\tmessage += requests[requests.length - remainingRequests + i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tservers.get(i).send(this, message);\r\n\t\t\t}\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\tint hit = 0;\r\n\t\t\tfor(ServerHandler s : servers) {\r\n\t\t\t\tString ricevuto = s.receive();\r\n\t\t\t\thit += ricevuto.split(\"VALUE\").length - 1;\r\n\t\t\t\treplies.add(ricevuto);\r\n\t\t\t}\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\r\n\t\t\tmiss += requests.length-hit;\r\n\t\t\t\r\n\t\t\tfinalReply = \"\";\r\n\t\t\tfor(String reply : replies) {\r\n\t\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\t\treplies.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treply = reply.substring(0, reply.length() - 3);\r\n\t\t\t\t\tfinalReply += reply;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalReply += \"END\";\r\n\t\t\tsendBack(currentJob.getClient(), finalReply);\r\n\t\t\treplies.clear();\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "long getLastTimeRequestSentMillis() {\n\t\treturn lastTimeRequestSentMillis;\n\t}", "public static String retrieveDataLake() {\n return CoreUtil.constructPageFromList(DrillConnector.getQueryExecutionResponse(QUERY_RETRIEVE_DATABASES, 1));\n }", "@Override\r\n\tpublic RequestsTracker getAllRequests() {\r\n\t\treturn allRequestsTracker;\r\n\t}", "public static long getApiMaxInflightRequests() {\n return 5000L;\n }", "public List<TimeSpan> getRequestedTimes()\r\n {\r\n return myRequestedTimes;\r\n }", "public java.lang.String getTimeLimitAction();", "@GetMapping(\"/job-bids\")\n @Timed\n public List<JobBid> getAllJobBids() {\n log.debug(\"REST request to get all JobBids\");\n return jobBidRepository.findAll();\n }", "@RequestMapping(path = \"/last24hCanceledRoutes\", method = RequestMethod.GET)\n public List<RouteCanceled> getLast24hCanceledRoutes() {\n Query queryObject = new Query(\"Select * from route_canceled\", \"blablamove\");\n QueryResult queryResult = BlablamovebackendApplication.influxDB.query(queryObject);\n\n InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();\n System.out.println(\"queryResult : \" + queryResult);\n List<RouteCanceled> routeCanceledList = resultMapper\n .toPOJO(queryResult, RouteCanceled.class);\n\n LocalDateTime stop = LocalDateTime.now().minusHours(0);\n LocalDateTime start = LocalDateTime.now().minusHours(24).withSecond(0).withMinute(0).withNano(0);\n\n return routeCanceledList.stream().filter(routeCanceled -> instantIsBetweenDates(routeCanceled.getTime(), start, stop)).collect(Collectors.toList());\n }", "private void getLargeOrderList(){\n sendPacket(CustomerTableAccess.getConnection().getLargeOrderList());\n \n }", "@GetMapping(\"/last-connections\")\n @Timed\n public ResponseEntity<LastConnectionDTO> getMyLastConnection() {\n log.debug(\"REST request to get My LastConnection\");\n LastConnectionDTO lastConnectionDTO = lastConnectionService.findOneByNumCptExt(MockUtil.NUM_COMPTE_EXT);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(lastConnectionDTO));\n }", "List<SdkHttpRequest> getRequests();", "public Map<String,Long> getCurrentOnJobWorkerNums(String accessKey, Set<String> entityIds) throws org.apache.thrift.TException;", "private List<Integer> getTimeReports(HttpServletRequest request, int nbrOfReports) {\n\t\tList<Integer> timeReports = new ArrayList<Integer>();\n\t\tfor (int i=1; i<=nbrOfReports; i++) {\n\t\t\tString reportIDstr = request.getParameter(\"reportIDs\"+i);\n\t\t\tif (reportIDstr != null) {\n\t\t\t\tint reportID = Integer.parseInt(reportIDstr);\n\t\t\t\ttimeReports.add(reportID);\n\t\t\t}\n\t\t}\n\t\treturn timeReports;\n\t}", "public void listJobExecutions() {\r\n\t\tRestCall caller = new RestCall();\r\n\t\tHttpURLConnection connection = caller.connect(endpoint + tenantId\r\n\t\t\t\t+ \"/job-executions\", null, \"GET\", token);\r\n\t\ttry {\r\n\t\t\tconnection.connect();\r\n\t\t\tSystem.out.println(caller.getResponse(connection));\r\n\t\t\tconnection.disconnect();\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public ActionForward showBatchList( ActionMapping mapping, ActionForm form, HttpServletRequest request,\r\n HttpServletResponse response )\r\n throws IOException, ServletException\r\n {\r\n\r\n response.setContentType( \"text/html\" );\r\n ServletOutputStream out = response.getOutputStream();\r\n out.println( \"<html>\" );\r\n out.println( \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"theme/charte_v03_001/css/master.css\\\">\" );\r\n out.println( \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"theme/welcom-001.css\\\">\" );\r\n out.println( \"<body>\" );\r\n out.println( \"<H1>Server batch admin</H1>\" );\r\n out.println( \"Pool size : \" + WatchedTaskManager.getInstance( request ).getWorkQueue().getPoolSize() + \"<BR>\" );\r\n out.println( \"Waiting tasks : \" + WatchedTaskManager.getInstance( request ).getWorkQueue().getWaitingTasks()\r\n + \"<BR>\" );\r\n\r\n out.println( \"<table class=\\\"tblh\\\"><thead><tr><th>ID</th><th>impl</th><th>progress</th><th>status</th><th>errors</th><th>age(ms)</th></tr></thead>\" );\r\n try\r\n {\r\n Collection colTasks = WatchedTaskManager.getInstance( request ).getAllTasks();\r\n\r\n synchronized ( colTasks )\r\n {\r\n\r\n long now = System.currentTimeMillis();\r\n Iterator iter = colTasks.iterator();\r\n final String myClassLignePaire = \"clair\";// WelcomConfigurator.getMessage(WelcomConfigurator.getCharte().getWelcomConfigFullPrefix()\r\n // + \".cols.even\");\r\n int i = 0;\r\n while ( iter.hasNext() )\r\n {\r\n i++;\r\n\r\n if ( i % 2 == 0 )\r\n {\r\n out.print( \"<tr class=\\\"\" + myClassLignePaire + \"\\\">\" );\r\n }\r\n else\r\n {\r\n out.print( \"<tr class=\\\"\\\">\" );\r\n }\r\n\r\n WatchedTask batch = (WatchedTask) iter.next();\r\n Object taskId = WatchedTaskManager.getInstance( request ).getTaskId( batch );\r\n long ageTache = now - batch.getProgress().getCreationDate();\r\n\r\n out.print( \"<td>\" + taskId + \"</td>\" );\r\n out.print( \"<td>\" + batch.getClass().getName() + \"</td>\" );\r\n out.print( \"<td>\" + batch.getProgress().getPercentComplete() + \"</td>\" );\r\n out.print( \"<td>\" + batch.getStatus() + \"</td>\" );\r\n out.print( \"<td>\" + batch.getErrors() + \"</td>\" );\r\n out.print( \"<td>\" + ageTache + \"</td>\" );\r\n /*\r\n * LIen pour la suppression de la tache out.print( \"<td><a href=\" + request.getContextPath() +\r\n * request.getServletPath() + \"?action=killBatch&taskId=\" + taskId + \">kill</a>\" + \"</td>\");\r\n */\r\n out.println( \"</tr>\" );\r\n }\r\n out.println( \"</tfoot></table></body></html>\" );\r\n }\r\n\r\n }\r\n catch ( Exception e )\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n return null;\r\n }", "int getRequestsCount();", "int getRequestsCount();", "public List findRequests(RequestCriteria _criteria) throws RequestManagerException, PersistenceResourceAccessException;", "Page<HrDocumentRequest> getPendingDocumentRequests(Pageable pageRequest);", "public Long getSendRequestTimes()\r\n {\r\n return sendRequestTimes;\r\n }", "public List<PerfBenchmarkDetail> getRecentDetailList(int limit, String testName);", "@GET\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic List<CohabitRequestInfo> listAllCohabitRequests(){\r\n\t\t\r\n\t\tEntityManager em = getEntityManager();\r\n\t\tManageRequestService service = new ManageRequestService(em);\r\n\t\tList<CohabitRequest> cohabitRequests = service.viewAllRequests();\r\n\t\tList<CohabitRequestInfo> requests = CohabitRequestInfo.wrap(cohabitRequests);\r\n\t\tem.close();\r\n\t\t\r\n\t\treturn requests;\r\n\t}", "public Object[] getSql_Qry_Hist(String UserId,String L_SysCd,String L_JobCd,\r\n \t\tString Cbo_ReqCd, String L_ItemId)\tthrows SQLException, Exception {\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tPreparedStatement pstmt2 = null;\r\n\t\tResultSet rs = null;\r\n\t\tResultSet rs2 = null;\r\n\t\tStringBuffer strQuery = new StringBuffer();\r\n\t\tArrayList<HashMap<String, String>> rtList = new ArrayList<HashMap<String, String>>();\r\n\t\tHashMap<String, String>\t\t\t rst\t\t = null;\r\n\r\n\t\tConnectionContext connectionContext = new ConnectionResource();\r\n\t\ttry {\r\n\t\t\tconn = connectionContext.getConnection();\r\n\r\n\t\t strQuery.setLength(0);\r\n\t \tstrQuery.append(\"select a.cr_acptno,a.cr_aplydate,a.cr_status, \\n\");\r\n\t \tstrQuery.append(\" a.cr_rsrccd,a.cr_qrycd,b.cm_username,c.cm_codename, \\n\");\r\n\t \tstrQuery.append(\" d.cr_qrycd qrycd,d.cr_sayu,d.cr_passok,d.cr_passcd \\n\");\r\n\t \tstrQuery.append(\" , to_char(d.cr_acptdate,'yyyy-mm-dd hh24:mi:ss') cr_acptdate \\n\");\r\n\t \tstrQuery.append(\" , to_char(a.cr_prcdate,'yyyy-mm-dd hh24:mi:ss') cr_prcdate \\n\");\r\n\t \tstrQuery.append(\" , d.cr_itsmtitle , d.cr_itsmid \\n\");\r\n\t \tstrQuery.append(\" from cmr1010 a,cmr1000 d,cmm0040 b,cmm0020 c \\n\");\r\n\t \tstrQuery.append(\" where a.cr_itemid=? and \\n\"); //L_ItemId\r\n if (!Cbo_ReqCd.equals(\"ALL\")){\r\n \tstrQuery.append(\" d.cr_qrycd=? and \\n\"); //Cbo_ReqCd\r\n }\r\n strQuery.append(\" a.cr_acptno=d.cr_acptno and \\n\");\r\n strQuery.append(\" a.cr_editor=b.cm_userid and \\n\");\r\n strQuery.append(\" c.cm_macode='REQUEST' and d.cr_qrycd=c.cm_micode \\n\");\r\n if (Cbo_ReqCd.equals(\"ALL\") || Cbo_ReqCd.equals(\"04\")){\r\n\t strQuery.append(\" union \\n\");\r\n\t strQuery.append(\" select b.cr_acptno,'' as cr_aplydate,'9' cr_status,a.cr_rsrccd, \\n\");\r\n\t strQuery.append(\" decode(b.cr_qrycd,'03','최초이행','추가이행') as cr_qrycd,c.cm_username, \\n\");\r\n\t strQuery.append(\" decode(b.cr_qrycd,'03','최초이행','추가이행') as cm_codename, \\n\");\r\n\t strQuery.append(\" '04' as qrycd, \\n\");\r\n\t strQuery.append(\" '형상관리 일괄이행' as cr_passcd, '0' as cr_passok,'형상관리 일괄이행' as cr_passcd \\n\"); \r\n\t strQuery.append(\" , to_char(b.cr_acptdate,'yyyy-mm-dd hh24:mi:ss') as cr_acptdate \\n\");\r\n\t strQuery.append(\" , to_char(b.cr_acptdate,'yyyy-mm-dd hh24:mi:ss') as cr_prcdate \\n\");\r\n\t strQuery.append(\" , '' as cr_itsmtitle , '' as cr_itsmid\\n\");\r\n\t strQuery.append(\" from cmr0020 a,cmr0021 b,cmm0040 c \\n\");\r\n\t strQuery.append(\" where a.cr_itemid=? and \\n\"); //L_ItemId\r\n\t strQuery.append(\" b.cr_qrycd in ('03','05') and \\n\");\r\n\t strQuery.append(\" a.cr_itemid = b.cr_itemid and \\n\");\r\n\t strQuery.append(\" b.cr_editor=c.cm_userid \\n\");\r\n }\r\n strQuery.append(\" order by cr_prcdate desc \\n\");\r\n\r\n\t\t //pstmt = conn.prepareStatement(strQuery.toString());\r\n\t\t pstmt = new LoggableStatement(conn, strQuery.toString());\r\n\t\t int CNT = 0;\r\n\t \tpstmt.setString(++CNT, L_ItemId);\r\n\t \tif (!Cbo_ReqCd.equals(\"ALL\")) pstmt.setString(++CNT, Cbo_ReqCd);\r\n\t \tif (Cbo_ReqCd.equals(\"ALL\") || Cbo_ReqCd.equals(\"04\")) pstmt.setString(++CNT, L_ItemId);\r\n\t \tecamsLogger.error(((LoggableStatement)pstmt).getQueryString());\r\n\t \trs = pstmt.executeQuery();\r\n\t\t while (rs.next()){\r\n\t\t\t\trst = new HashMap<String,String>();\r\n\t\t\t\t//rst.put(\"NO\",Integer.toString(rs.getRow()));\r\n\t\t\t\trst.put(\"SubItems1\",rs.getString(\"cr_acptdate\"));//rs.getString(\"cr_acptdate\").substring(0,rs.getString(\"cr_acptdate\").length()-2)\r\n\t\t\t\trst.put(\"SubItems2\",rs.getString(\"cm_username\"));\r\n\r\n\t\t\t\trst.put(\"SubItems3\",rs.getString(\"cm_codename\"));\r\n\t\t\t\tif (rs.getString(\"cr_acptno\").substring(4,6).equals(\"04\")){\r\n\t\t\t\t\tstrQuery.setLength(0);\r\n\t\t\t\t\tstrQuery.append(\"select cm_codename from cmm0020 where cm_macode='CHECKIN' and cm_micode=? \\n\");\r\n\t\t\t\t pstmt2 = conn.prepareStatement(strQuery.toString());\r\n\t\t\t\t pstmt2.setString(1, rs.getString(\"cr_qrycd\"));\r\n\t\t\t \trs2 = pstmt2.executeQuery();\r\n\t\t\t \tif (rs2.next())\r\n\t\t\t \t\trst.put(\"SubItems3\",rs.getString(\"cm_codename\") + \"[\" + rs2.getString(\"cm_codename\") + \"]\");\r\n\t\t\t \trs2.close();\r\n\t\t\t \tpstmt2.close();\r\n }\r\n rst.put(\"qrycd\", rs.getString(\"qrycd\"));\r\n rst.put(\"SubItems4\",rs.getString(\"cr_acptno\").substring(6));\r\n\r\n if (!rs.getString(\"qrycd\").equals(\"04\")){\r\n\t rst.put(\"SubItems5\",\"\");\r\n }else{\r\n \tstrQuery.setLength(0);\r\n \tstrQuery.append(\"select cm_codename from cmm0020 \\n\");\r\n \tstrQuery.append(\"where cm_macode='REQPASS' and cm_micode=? \\n\");//cr_passok\r\n \tpstmt2 = conn.prepareStatement(strQuery.toString());\r\n \tpstmt2.setString(1, rs.getString(\"cr_passok\"));\r\n\t\t\t \trs2 = pstmt2.executeQuery();\r\n\t\t\t \tif (rs2.next())\r\n\t\t\t \t\trst.put(\"SubItems5\",rs2.getString(\"cm_codename\"));\r\n\t\t\t \trs2.close();\r\n\t\t\t \tpstmt2.close();\r\n\r\n\t\t\t\t\tif (rs.getString(\"cr_aplydate\") != null){\r\n\t if (rs.getString(\"cr_aplydate\").equals(\"9\"))\r\n\t \trst.put(\"SubItems5\",\"적용제외\");\r\n\t else\r\n\t \trst.put(\"SubItems5\",\"적용일시적용[\"+rs.getString(\"cr_aplydate\").substring(0,4)\r\n\t \t\t\t+\"/\"+rs.getString(\"cr_aplydate\").substring(4,6)+\"/\"+rs.getString(\"cr_aplydate\").substring(6,8)\r\n\t \t\t\t+\" \"+rs.getString(\"cr_aplydate\").substring(8,10)+\":\"+rs.getString(\"cr_aplydate\").substring(10,12)+\"]\");\r\n\t\t\t\t\t}\r\n }\r\n\r\n if (rs.getString(\"cr_prcdate\") != null){\r\n\t if (rs.getString(\"cr_prcdate\").length() > 0){\r\n\t \tif (rs.getString(\"cr_status\").equals(\"3\"))\r\n\t\t \t rst.put(\"SubItems6\", \"[반송]\" + rs.getString(\"cr_prcdate\"));//rs.getString(\"cr_prcdate\").substring(5,rs.getString(\"cr_prcdate\").length()-2)\r\n\t \telse\r\n\t \t rst.put(\"SubItems6\", rs.getString(\"cr_prcdate\"));//rs.getString(\"cr_prcdate\").substring(5,rs.getString(\"cr_prcdate\").length()-2)\r\n\t \t//rst.put(\"SubItems6\", rs.getString(\"cr_prcdate\").substring(5,7) + \"/\" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(8,10) + \" \" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(10,12) + \":\" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(12,14) + \":\" +\r\n\t \t\t//rs.getString(\"cr_prcdate\").substring(14));\r\n\t }\r\n } else {\r\n \trst.put(\"SubItems6\",\"진행중\");\r\n }\r\n if ( rs.getString(\"cr_sayu\") !=null ){\r\n \trst.put(\"SubItems7\", rs.getString(\"cr_sayu\"));//신청사유\r\n } else {\r\n \trst.put(\"SubItems7\", \"\");//신청사유\r\n }\r\n \r\n if ( rs.getString(\"cr_itsmid\") != null ) {\r\n \trst.put(\"srinfo\", \"[\" + rs.getString(\"cr_itsmid\") + \"]\" + rs.getString(\"cr_itsmtitle\") );\r\n } else {\r\n \trst.put(\"srinfo\", \"\" );\r\n }\r\n rst.put(\"SubItems8\", rs.getString(\"cr_acptno\"));\r\n rst.put(\"SubItems9\", rs.getString(\"cr_status\"));\r\n rtList.add(rst);\r\n rst = null;\r\n\t\t }\r\n\t\t rs.close();\r\n\t\t pstmt.close();\r\n\t\t conn.close();\r\n\t\t rs = null;\r\n\t\t pstmt = null;\r\n\t\t conn = null;\r\n\r\n\t\t\treturn rtList.toArray();\r\n\r\n\t\t} catch (SQLException sqlexception) {\r\n\t\t\tif (conn != null){\r\n\t\t\t\tconn.close();conn = null;\r\n\t\t\t}\r\n\t\t\tsqlexception.printStackTrace();\r\n\t\t\tthrow sqlexception;\r\n\t\t} catch (Exception exception) {\r\n\t\t\tif (conn != null){\r\n\t\t\t\tconn.close();conn = null;\r\n\t\t\t}\r\n\t\t\texception.printStackTrace();\r\n\t\t\tthrow exception;\r\n\t\t}finally{\r\n\t\t\tif (strQuery != null)\tstrQuery = null;\r\n\t\t\tif (rtList != null)\trtList = null;\r\n\t\t\tif (rs != null) try{rs.close();}catch (Exception ex){ex.printStackTrace();}\r\n\t\t\tif (pstmt != null) try{pstmt.close();}catch (Exception ex2){ex2.printStackTrace();}\r\n\t\t\tif (conn != null){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tConnectionResource.release(conn);\r\n\t\t\t\t}catch(Exception ex3){\r\n\t\t\t\t\tex3.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }", "int getActiveBlockRequestsNumber() {\n return blockRequests.size();\n }", "private List<TOMMessage> getRequestsToRelay() {\n\n List<TOMMessage> messages = lcManager.getCurrentRequestTimedOut();\n\n if (messages == null) {\n\n messages = new LinkedList<>();\n }\n\n // Include requests from STOP messages in my own STOP message\n List<TOMMessage> messagesFromSTOP = lcManager.getRequestsFromSTOP();\n if (messagesFromSTOP != null) {\n\n for (TOMMessage m : messagesFromSTOP) {\n\n if (!messages.contains(m)) {\n\n messages.add(m);\n }\n }\n }\n\n logger.debug(\"I need to relay \" + messages.size() + \" requests\");\n\n return messages;\n }", "@Override\n public int getMaxJobsPerAcquisition() {\n return myMaxJobsPerAcquisition;\n }", "TrackerAdminRequests getTrackerAdminRequests(final Integer id);", "public RequestFromSelf getRequests(int index) {\n return instance.getRequests(index);\n }", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "int getServerWorkIterations();", "DataResult<List<Job>> getAll();", "public List<Request> viewPending(int id) {\n\t\tList<Request> list = null;\n\t\tRequest request = null;\n\t\t\t\t\n\t\ttry {\n\t\t\tlist = new ArrayList<Request>();\n\t\t\tString sql = \"select * from requests \"+\n\t\t\t\t \"where employee_id = \"+id+\" and status = 'pending'\";\n\n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(sql);\n\t\t\t\n\t\t\twhile(resultSet.next()) {\n\t\t\t\trequest = new Request();\n\t\t\t\trequest.setId(resultSet.getInt(\"request_id\"));\t\t\t\t\t\t\n\t\t\t\trequest.setEmpId(resultSet.getInt(\"employee_id\"));\n\t\t\t\trequest.setMgrId(resultSet.getInt(\"manager_id\"));\n\t\t\t\trequest.setRequestAmount(resultSet.getInt(\"request_amount\"));\n\t\t\t\trequest.setExpenseDate(resultSet.getString(\"expense_date\"));\n\t\t\t\trequest.setStatus(resultSet.getString(\"status\"));\n\t\t\t\trequest.setDecision(resultSet.getString(\"decision\"));\n\t\t\t\tlist.add(request);\n\t\t\t}\n\t\t\t\treturn list;\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\treturn null;\n\t}", "@Override\n public List<Integer> getAllWorklogIds() {\n List<Integer> worklogIds;\n\n try (Connection connection = database.connect();\n PreparedStatement stmt = connection.prepareStatement(GET_ALL_WORKLOG_IDS_SQL)) {\n worklogIds = worklogIdDataMapper.toDTO(stmt.executeQuery());\n } catch (SQLException e) {\n logger.logToDatabase(getClass().getName(), \"getAllWorklogIds\", e);\n throw new InternalServerErrorException(e.getMessage());\n }\n return worklogIds;\n }", "public String getLimit_Base();", "java.util.List<Rsp.RequestFromSelf>\n getRequestsList();", "long getEvictions();", "@Nonnegative\n @CheckReturnValue\n public abstract int getRemainingRequests();", "int getQueryTimeNsec();", "public long getTimeLimit() {\n\t\treturn timeLimit;\n\t}", "long getLastAccessed( );", "private void checkRequests()\n\t{\n\t\t// to be honest I don't see why this can't be 5 seconds, but I'm trying 1 second\n\t\t// now as the existing 0.1 second is crazy given we're checking for events that occur\n\t\t// at 60+ second intervals\n\n\t\tif ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ){\n\n\t\t\treturn;\n\t\t}\n\n\t\tfinal long now =SystemTime.getCurrentTime();\n\n\t\t//for every connection\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\t\tfor (int i =peer_transports.size() -1; i >=0 ; i--)\n\t\t{\n\t\t\tfinal PEPeerTransport pc =(PEPeerTransport)peer_transports.get(i);\n\t\t\tif (pc.getPeerState() ==PEPeer.TRANSFERING)\n\t\t\t{\n\t\t\t\tfinal List expired = pc.getExpiredRequests();\n\t\t\t\tif (expired !=null &&expired.size() >0)\n\t\t\t\t{ // now we know there's a request that's > 60 seconds old\n\t\t\t\t\tfinal boolean isSeed =pc.isSeed();\n\t\t\t\t\t// snub peers that haven't sent any good data for a minute\n\t\t\t\t\tfinal long timeSinceGoodData =pc.getTimeSinceGoodDataReceived();\n\t\t\t\t\tif (timeSinceGoodData <0 ||timeSinceGoodData >60 *1000)\n\t\t\t\t\t\tpc.setSnubbed(true);\n\n\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\tDiskManagerReadRequest request =(DiskManagerReadRequest) expired.get(0);\n\n\t\t\t\t\tfinal long timeSinceData =pc.getTimeSinceLastDataMessageReceived();\n\t\t\t\t\tfinal boolean noData =(timeSinceData <0) ||timeSinceData >(1000 *(isSeed ?120 :60));\n\t\t\t\t\tfinal long timeSinceOldestRequest = now - request.getTimeCreated(now);\n\n\n\t\t\t\t\t//for every expired request \n\t\t\t\t\tfor (int j = (timeSinceOldestRequest >120 *1000 && noData) ? 0 : 1; j < expired.size(); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the request object\n\t\t\t\t\t\trequest =(DiskManagerReadRequest) expired.get(j);\n\t\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\t\tpc.sendCancel(request);\t\t\t\t//cancel the request object\n\t\t\t\t\t\t//get the piece number\n\t\t\t\t\t\tfinal int pieceNumber = request.getPieceNumber();\n\t\t\t\t\t\tPEPiece\tpe_piece = pePieces[pieceNumber];\n\t\t\t\t\t\t//unmark the request on the block\n\t\t\t\t\t\tif ( pe_piece != null )\n\t\t\t\t\t\t\tpe_piece.clearRequested(request.getOffset() /DiskManager.BLOCK_SIZE);\n\t\t\t\t\t\t// remove piece if empty so peers can choose something else, except in end game\n\t\t\t\t\t\tif (!piecePicker.isInEndGameMode())\n\t\t\t\t\t\t\tcheckEmptyPiece(pieceNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "@GetMapping(\"/stats.latest\")\n @ResponseBody\n public List<ShortUrl> latestStats() {\n\n // Simple return of last 10 urls and access records. This would need a lot more\n // work to scale, including creating a more granular API\n\n List<ShortUrl> latest = repository.findTop10ByOrderByCreatedOnDesc();\n\n return latest;\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException\n\t{\n\t\tfor (int i = 0; i < NUM_LOOPS; i++)\n\t\t{\n\t\t\tTuple tuple = Tuple.defaultTuple();\n\t\t\tCounterWorkCallable task = new CounterWorkCallable(\"counter\" + i, shardedCounterService, tuple);\n\t\t\ttry\n\t\t\t{\n\t\t\t\ttask.call();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tint actualIncrements = 0;\n\t\tlogger.info(\"Expected \" + (NUM_INCREMENTS_PER_LOOPS * NUM_LOOPS) + \" Increments. Actual Increments: \"\n\t\t\t+ actualIncrements);\n\n\t}", "public int getLastTimetable() {\n return lastTimetable;\n }", "public int getRequestRetryCount() {\n \t\treturn 1;\n \t}", "public void dump(String name) {\n String date = new SimpleDateFormat(\"c\",Locale.getDefault()).format(startDate);\n Log.v(\"Maply\", String.format(\"---MaplyTileFetcher %s Stats since %s---\",name,date));\n Log.v(\"Maply\", String.format(\" Active Requests = %d\",activeRequests) );\n Log.v(\"Maply\", String.format(\" Max Active Requests = %d\",maxActiveRequests) );\n Log.v(\"Maply\", String.format(\" Total Requests = %d\",totalRequests) );\n Log.v(\"Maply\", String.format(\" Canceled Requests = %d\",totalCancels) );\n Log.v(\"Maply\", String.format(\" Failed Requests = %d\",totalFails) );\n Log.v(\"Maply\", String.format(\" Data Transferred = %.2fMB\",(float)remoteData) );\n if (remoteRequests > 0) {\n Log.v(\"Maply\", String.format(\" Latency per request = %.2fms\",totalLatency / remoteRequests * 1000.0) );\n Log.v(\"Maply\", String.format(\" Average request size = %.2fKB\",remoteData / remoteRequests / 1024.0) );\n }\n Log.v(\"Maply\", String.format(\" Cached Data = %.2fMB\",localData / (1024.0*1024.0)) );\n }", "com.google.cloud.talent.v4.Job getJobs(int index);", "public long getRequestGapMillis()\n {\n return requestGapMillis;\n }", "public Long get_cacheparameterizedrequestsrate() throws Exception {\n\t\treturn this.cacheparameterizedrequestsrate;\n\t}", "public Request loadRequestDetail(long _requestId) throws RequestManagerException, PersistenceResourceAccessException;", "@RequestMapping(path = \"/last24hDeliveredItems\", method = RequestMethod.GET)\n public List<DeliveredItem> getLast24hDeliveredItems() {\n Query queryObject = new Query(\"Select * from delivery_item\", \"blablamove\");\n QueryResult queryResult = BlablamovebackendApplication.influxDB.query(queryObject);\n\n InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();\n System.out.println(\"queryResult : \" + queryResult);\n List<DeliveredItem> deliveredItemList = resultMapper\n .toPOJO(queryResult, DeliveredItem.class);\n\n LocalDateTime stop = LocalDateTime.now().minusHours(0);\n LocalDateTime start = LocalDateTime.now().minusHours(24).withSecond(0).withMinute(0).withNano(0);\n\n return deliveredItemList.stream().filter(deliveredItem -> instantIsBetweenDates(deliveredItem.getTime(), start, stop)).collect(Collectors.toList());\n }", "List<ResourceUsage> getLast30DaysMemoryInfo() {\n return daoInterface.getLast30DaysMemoryInfo();\n\n }", "void requestRateLimited();", "@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355562000000\"; //--multi-dist\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multi\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"multidist\");\r\n\t\t\t\t//multiCounter.printResponse(req, \"multidist\");\r\n\t\t\t\t//use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"multidist\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}", "public int getBatchDownloadFailureCountdown()\n {\n return 0; \n }", "int getCacheConcurrency();", "@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 }", "BigInteger getResponse_time();", "public int getDelay() {\n return Math.abs(currentRequest.getRequestToFloor() - currentRequest.getRequestFromFloor()) * 1000;\n }", "protected List<Long> getMoreIds(int requestSize) {\n\n String sql = getSql(requestSize);\n\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n try {\n connection = dataSource.getConnection();\n\n statement = connection.prepareStatement(sql);\n resultSet = statement.executeQuery();\n\n List<Long> newIds = readIds(resultSet, requestSize);\n if (newIds.isEmpty()) {\n throw new PersistenceException(\"Always expecting more than 1 row from \" + sql);\n }\n\n return newIds;\n\n } catch (SQLException e) {\n if (e.getMessage().contains(\"Database is already closed\")) {\n String msg = \"Error getting SEQ when DB shutting down \" + e.getMessage();\n log.log(ERROR, msg);\n System.out.println(msg);\n return Collections.emptyList();\n } else {\n throw new PersistenceException(\"Error getting sequence nextval\", e);\n }\n } finally {\n closeResources(connection, statement, resultSet);\n }\n }", "@GET\n @Deprecated\n @Path(\"jobs\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response jobGet(@QueryParam(\"created_before\") String createdBefore,\n @QueryParam(\"created_after\") String createdAfter) throws Exception {\n //List<LGJob> jobs;\n boolean doCreatedBefore = false;\n boolean doCreatedAfter = false;\n Date beforeDate = null;\n Date afterDate = null;\n\n // Parse created_before if present\n if ((createdBefore != null) && (!createdBefore.equals(\"\"))) {\n Instant beforeInstant = null;\n try {\n beforeInstant = Instant.parse(createdBefore);\n } catch (DateTimeParseException e) {\n return Response.status(201).entity(\"Invalid created_on Date format [\" + createdBefore + \"]\").build();\n }\n beforeDate = Date.from(beforeInstant);\n doCreatedBefore = true;\n }\n\n // Parse created_after if present\n if ((createdAfter != null) && (!createdAfter.equals(\"\"))) {\n Instant afterInstant = null;\n try {\n afterInstant = Instant.parse(createdAfter);\n } catch (DateTimeParseException e) {\n return Response.status(201).entity(\"Invalid created_after Date format [\" + createdAfter + \"]\").build();\n }\n afterDate = Date.from(afterInstant);\n doCreatedAfter = true;\n }\n\n\n JSONObject graphJobs = new JSONObject();\n try {\n graphJobs = Utils.getLemongraphJob(request, \"\", null);//this considers createdBefore/createdAfter params\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n JSONArray ids = new JSONArray();\n Iterator<String> idIterator = graphJobs.keys();\n while (idIterator.hasNext()) {\n String id = idIterator.next();\n ids.put(id);\n }\n\n JSONObject ob = new JSONObject();\n if(ids.length() > 0) {\n // Build response\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMM dd,yyyy HH:mm:ss\");\n JSONObject mongoJobs = Utils.getMongoJobs(ids);\n Iterator iterator = mongoJobs.keySet().iterator();\n while (iterator.hasNext()) {\n String id = iterator.next().toString();\n try {\n JSONObject mongoJob = mongoJobs.getJSONObject(id);\n JSONObject job = new JSONObject();\n\n //Default value checks\n if (!mongoJob.has(\"reason\")) {\n mongoJob.put(\"reason\", \"\");\n }\n if (!mongoJob.has(\"endTime\")) {\n mongoJob.put(\"endTime\", 0);\n }\n if (!mongoJob.has(\"totalRunningTimeSeconds\")) {\n mongoJob.put(\"totalRunningTimeSeconds\", 0);\n }\n if (!mongoJob.has(\"approvedAdapterNames\")) {\n mongoJob.put(\"approvedAdapterNames\", new JSONArray());\n }\n if (!mongoJob.has(\"startTime\")) {\n mongoJob.put(\"startTime\", 0);\n }\n if (!mongoJob.has(\"jobErrors\")) {\n mongoJob.put(\"jobErrors\", new JSONArray());\n }\n if (!mongoJob.has(\"taskMap\")) {\n mongoJob.put(\"taskMap\", new JSONObject());\n }\n if (!mongoJob.has(\"jobConfig\")) {\n mongoJob.put(\"jobConfig\", new JSONObject());\n }\n if (!mongoJob.has(\"expireDate\")) {\n mongoJob.put(\"expireDate\", 0);\n }\n if (!mongoJob.has(\"graphActivity\")) {\n mongoJob.put(\"graphActivity\", 0);\n }\n if (!mongoJob.has(\"createDate\")) {\n mongoJob.put(\"createDate\", 0);\n }\n if (!mongoJob.has(\"status\")) {\n mongoJob.put(\"status\", 0);\n }\n\n job.put(\"reason\", mongoJob.get(\"reason\"));\n job.put(\"endtime\", sdf.format(mongoJob.get(\"endTime\")));\n job.put(\"runtime\", mongoJob.get(\"totalRunningTimeSeconds\"));\n job.put(\"approvedadapters\", mongoJob.getJSONArray(\"approvedAdapterNames\"));\n job.put(\"starttime\", sdf.format(mongoJob.get(\"startTime\")));\n job.put(\"error_count\", mongoJob.getJSONArray(\"jobErrors\").length());\n job.put(\"task_count\", mongoJob.getJSONObject(\"taskMap\").length());\n job.put(\"job_config\", new JSONObject(mongoJob.get(\"jobConfig\").toString()));\n job.put(\"expire_date\", sdf.format(mongoJob.get(\"expireDate\")));\n job.put(\"job_id\", id);\n job.put(\"graph_activity\", mongoJob.get(\"graphActivity\"));\n job.put(\"create_date\", sdf.format(mongoJob.get(\"createDate\")));\n int status = mongoJob.getInt(\"status\");\n job.put(\"status\", LGJob.getStatusString(status));\n\n int active = 0;\n try {\n if (status == LGJob.STATUS_PROCESSING) { //only processing jobs have non-zero active_task_count\n ArrayList<Document> docs = new MongoDBStore().getTasksFromJob(id);\n JSONObject tasks = MongoDBStore.toJSON(docs);\n active = LGJob.getActiveTaskCount(tasks);\n }\n } catch (Exception e) {\n log.debug(\"Couldn't fetch active task count for job:\" + id + \" Error:\" + e.getMessage());\n }\n\n job.put(\"active_task_count\", active);\n ob.put(id, job);\n } catch (Exception e) {\n log.info(\"Invalid job:\" + id + \" Error:\" + e.getMessage());\n }\n }\n }\n return Response.status(200).entity(ob.toString()).build();\n }", "@Postprocess\n public void getReport() {\n try {\n BufferedWriter bufferWriter = new BufferedWriter(new FileWriter(logfile, false));\n if (!results.isEmpty()) {\n bufferWriter.write(\"===========================================================\\n\");\n bufferWriter.write(\"sys_milli,\\t\\tdb_micro,\\t\\ttime_diff\\n\");\n Collections.sort(results);\n for (MysqlheartbeatBean mhb : results) {\n bufferWriter.write(String.valueOf(mhb.getSysMilli()) + \",\\t\\t\"\n + String.valueOf(mhb.getDbMicro()) + \",\\t\\t\"\n + String.valueOf(mhb.getDbMicro() - mhb.getSysMilli()) + \"\\n\");\n }\n bufferWriter.flush();\n }\n bufferWriter.close();\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"{0}: {1}\", new Object[]{toolName, ex.getMessage()});\n }\n }" ]
[ "0.6010472", "0.55152375", "0.54980797", "0.5445995", "0.53925824", "0.5274115", "0.52588093", "0.5256573", "0.5233699", "0.5233337", "0.5227398", "0.5207003", "0.5204901", "0.5190923", "0.51746196", "0.51650524", "0.51414007", "0.51365685", "0.51299906", "0.50985545", "0.5092214", "0.50710493", "0.50641114", "0.50634277", "0.50346214", "0.503005", "0.50273055", "0.5024869", "0.4988147", "0.49875572", "0.4970316", "0.49672037", "0.49510142", "0.4947802", "0.49284336", "0.4900666", "0.48773482", "0.48715177", "0.48703316", "0.48698992", "0.4862389", "0.4847513", "0.483783", "0.48309317", "0.48300347", "0.48197618", "0.48135507", "0.4813273", "0.4804473", "0.48008752", "0.4791657", "0.47903347", "0.47871482", "0.4786492", "0.47801444", "0.47801444", "0.47778174", "0.4777254", "0.47741127", "0.47697216", "0.47388127", "0.4735772", "0.47326794", "0.47253898", "0.4720612", "0.47163367", "0.47110805", "0.47077307", "0.4704709", "0.4695723", "0.46947822", "0.46927896", "0.46750054", "0.4670516", "0.4663885", "0.46631026", "0.46491995", "0.46472105", "0.46456695", "0.46335775", "0.4630546", "0.462766", "0.46249804", "0.4624699", "0.46229595", "0.46125874", "0.46102083", "0.46101096", "0.46013755", "0.45991057", "0.45986426", "0.45944005", "0.45873055", "0.4581335", "0.45803145", "0.45798314", "0.45758656", "0.45752934", "0.45737723", "0.45731422", "0.457264" ]
0.0
-1
Retrieves the user provided metadata for the specified tables.
public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException { ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse(); submitRequest("/show/table/metadata", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "<K, C> TableMetadata<K, C> getTableMetadata(TableName tableName);", "public ShowTableMetadataResponse showTableMetadata(List<String> tableNames, Map<String, String> options) throws GPUdbException {\n ShowTableMetadataRequest actualRequest_ = new ShowTableMetadataRequest(tableNames, options);\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "Map<String, Object> getAllMetadata();", "private List<Table> getTables() {\n List<Table> tables = new ArrayList<>();\n\n DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n Query query = new Query(\"Table\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n String firstName = (String) entity.getProperty(\"firstName\");\n String lastName = (String) entity.getProperty(\"lastName\");\n String email = (String) entity.getProperty(\"email\");\n String phoneNumber = (String) entity.getProperty(\"phoneNumber\");\n String restName = (String) entity.getProperty(\"restName\");\n String restAdd = (String) entity.getProperty(\"restAdd\");\n String restDescrip = (String) entity.getProperty(\"restDescrip\");\n String dateTime = (String) entity.getProperty(\"dateTime\");\n String maxSize = (String) entity.getProperty(\"maxSize\");\n String otherNotes = (String) entity.getProperty(\"otherNotes\");\n List members = (List) entity.getProperty(\"members\");\n double lat = (double) entity.getProperty(\"lat\");\n double lng = (double) entity.getProperty(\"lng\");\n\n\n \n\n Table table = new Table(firstName, lastName, email, phoneNumber, restName, restAdd, restDescrip, dateTime, maxSize, otherNotes, members, lat, lng);\n tables.add(table);\n }\n return tables;\n }", "public List<SchemaInfo> getAllUserTablesInfo() {\n\t\tList<DefaultSchemaNode> tableNodes = getAllTablesNode();\n\t\tList<SchemaInfo> tables = new ArrayList<SchemaInfo>();\n\n\t\tfor (DefaultSchemaNode node : tableNodes) {\n\t\t\tSchemaInfo table = dbNode.getDatabaseInfo().getSchemaInfo(\n\t\t\t\t\tnode.getName());\n\t\t\tif (null != table) {\n\t\t\t\ttables.add(table);\n\t\t\t}\n\t\t}\n\n\t\treturn tables;\n\t}", "Object getTables();", "@Override\n\tpublic Map<String, Object> getUserInfoDetail(Map<String, Object> reqs) {\n\t\treturn joaSimpleDao.retrieve(\"tp_users\", reqs);\n\t}", "private void retrieveAllUserData() {\n retrieveBasicUserInfo();\n retrieveUsersRecentMedia();\n retrieveUsersLikedMedia();\n }", "public List<String> getUserTables() {\n\t\ttry (Connection con = getReadOnlyConnection()) {\n\t\t\treturn dbFacade.getUserTables(con);\n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public SnmpMibTable getRegisteredTableMeta(String paramString) {\n/* 670 */ if (this.metadatas == null) return null; \n/* 671 */ if (paramString == null) return null; \n/* 672 */ return this.metadatas.get(paramString);\n/* */ }", "public Map<String, String> getUserMetedata(String keyName)\n {\n S3Object o = s3.getObject(bucketName, keyName);\n return o.getObjectMetadata().getUserMetadata();\n }", "private void createSchemaInfo() {\n\t\tfor (String tableName : tableSchemas.keySet()) {\n\t\t\tERWinSchemaInfo schemaInfo = new ERWinSchemaInfo();\n\t\t\tschemaInfo.setType(\"user\");\n\t\t\tschemaInfo.setUniqueName(tableName);\n\t\t\tschemaInfos.put(tableName, schemaInfo);\n\t\t}\n\n\t\tinitCache();\n\t\tparseKeyGroupGroups();\n\n\t\tparseEntityProps();\n\t\tparseRelationGroups();\n\t\tparseAttributes();\n\n\t\tcreateSchemaDDL();\n\t}", "@Override\n\tpublic List<HashMap<String, Object>> getMetaListByTableName(String tableName,String condition) {\n\t\tList<HashMap<String, Object>> hm = metaDao.getMetaListByTableName(tableName,condition);\n\t\treturn hm;\n\t}", "Metadata getMetaData();", "private String[] getTables() {\r\n\t\tString[] returnedValue = null;\r\n\t\tList<String> tablesList = new ArrayList<String>();\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\tCursor cursor = getDatabse().rawQuery(\"SELECT DISTINCT tbl_name FROM sqlite_master\", null);\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcursor.moveToLast();\r\n\t\t\t\t\tcursor.moveToFirst();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (cursor.getCount() > 0) {\r\n\t\t\t\t\t\tdo{\r\n\t\t\t\t\t\t\tString tableName = cursor.getString(0);\r\n\t\t\t\t\t\t\tif (tableName != null && tableName.trim() != \"\") {\r\n\t\t\t\t\t\t\t\tif (!tableName.trim().toLowerCase().equals(\"android_metadata\") &&\r\n\t\t\t\t\t\t\t\t\t!tableName.trim().toLowerCase().equals(\"sqlite_sequence\")) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttablesList.add(tableName);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} while(cursor.moveToNext());\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tcursor.close();\r\n\t\t\t\t\tcursor = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (tablesList.size() > 0) {\r\n\t\t\treturnedValue = tablesList.toArray(new String[tablesList.size()]);\r\n\t\t}\r\n\t\ttablesList.clear();\r\n\t\ttablesList = null;\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "public static ImmutableList<ColumnMetadata> getColumnMetaFromJson(String schemaName, String tableName, String metaDir) {\n long startTime = System.currentTimeMillis();\n ImmutableList.Builder<ColumnMetadata> columnsMetadata = ImmutableList.builder();\n try {\n String jsonStr = readTableJson(schemaName, tableName, metaDir);\n JSONObject obj = new JSONObject(jsonStr);\n JSONArray cols = obj.getJSONArray(JSON_TABLEMETA_COLUMNES);\n for (int i = 0; i < cols.length(); i++) {\n JSONObject temp = new JSONObject(cols.getString(i));\n String family = temp.getString(JSON_TABLEMETA_FAMILY);\n String columnName = temp.getString(JSON_TABLEMETA_COLUMNNAME);\n String type = temp.getString(JSON_TABLEMETA_TYPE);\n columnsMetadata.add(new HBaseColumnMetadata(family, columnName, matchType(type)));\n }\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n } finally {\n logger.info(String.format(\"Read COLUMN meta info of TABLE %s.%s from json, totally used %d ms.\",\n schemaName, tableName, (System.currentTimeMillis() - startTime)));\n }\n return columnsMetadata.build();\n }", "public Map<String, String> getUserMetaData() {\n\t\treturn userMetaData;\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new TraitSalaire(), new HashMap<String, MetaData>()\r\n \t\t\t\t\t, new ArrayList<String>());\r\n \t\t} catch (InstantiationException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (IllegalAccessException 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 interface HiveMetaDao {\n String getLocationByDbAndTable(Map<String, String> map);\n List<String> getDbsByUser(String userName);\n List<Map<String, Object>> getTablesByDbNameAndUser(Map<String, String> map);\n Long getPartitionSize(Map<String, String> map);\n List<String> getPartitions(Map<String, String> map);\n List<Map<String, Object>> getColumns(Map<String, String> map);\n List<Map<String, Object>> getPartitionKeys(Map<String, String> map);\n String getTableComment(@Param(\"DbName\") String DbName, @Param(\"tableName\") String tableName);\n}", "<K, C> void declareTable(TableMetadata<K, C> metadata);", "public void showTables(){\n\t\tSchema schemaTable = Schema.getSchemaInstance();\n\t\tString currentSchemaName = schemaTable.getCurrentSchema();\n\n\t\ttry{\n\t\t\tArrayList<String> tableList = new ArrayList<String>();\n\n\t\t\tRandomAccessFile tableFile = new RandomAccessFile(\"information_schema.table.tbl\",\"rw\");\n\n\t\t\twhile(tableFile.getFilePointer() < tableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tString readTableName = \"\";\n\n\t\t\t\t//Looks for matching schema name\n\t\t\t\tbyte varcharLength = tableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tableFile.readByte();\n\n\t\t\t\tbyte varcharTableLength = tableFile.readByte();\n\t\t\t\tfor(int k = 0; k < varcharTableLength; k++)\n\t\t\t\t\treadTableName += (char)tableFile.readByte();\n\t\t\t\t//Looks for matching table name\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\t\n\t\t\t\t\ttableList.add(readTableName);\n\t\t\t\t}\n\t\t\t\t//To skip the number of rows part\n\t\t\t\ttableFile.readLong();\n\t\t\t}\n\n\t\t\tif(tableList.size() != 0){\n\t\t\t\t//Printing current Tables in the schema\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"Table_in_\" + currentSchemaName);\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\tfor(int i = 0; i < tableList.size() ; i++)\n\t\t\t\t\tSystem.out.println(tableList.get(i));\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\n\t\t\t\t//Clearing table list contents\n\t\t\t\ttableList.removeAll(tableList);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Empty Set...\");\n\t\t\t}\n\n\t\t\t//Closing the file\n\t\t\ttableFile.close();\n\t\t}catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected String getTableNameForMetadata(String tableName) {\n return (tableName == null) ? IdentifierUtil.PERCENT :\n getTableNameForMetadata(DBIdentifier.newTable(tableName));\n }", "@Override\n\tpublic Map<String, Object> getUserDetail(Map<String, Object> reqs) {\n\t\treturn null;\n\t}", "@GET\n @Path(\"/getTable\")\n public Response getTableInfo(\n @QueryParam(\"tableName\") String tableName\n ) throws UnsupportedEncodingException {\n\n //System.out.println(\"Hit End Point\");\n // check whether no parameters were passed\n if (tableName == null) {\n String msg = \"missing parameter tableName\";\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(msg)\n .build();\n }\n start();\n //System.out.print(\"Table name entered\");\n if (!tables.contains(tableName)) {\n String msg = \"table not found\";\n System.out.println(msg);\n Logging.getLOG().debug(\"user requested to get table, table name not found. \");\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(msg)\n .build();\n }\n\n //System.out.println(\"Valid name entered\");\n if (tableName.equals(ALGORITHMS_TABLE)) {\n algorithmsTable = AlgorithmsTable.openTable(ALGORITHMS_TABLE, dbConnector);\n Logging.getLOG().debug(\"user requested to get table, table: \" + ALGORITHMS_TABLE);\n return Response.ok(URLEncoder.encode(algorithmsTable.toJSON(), \"UTF-8\")).build();\n\n } else if (tableName.equals(DATA_STRUCTURES_TABLE)) {\n dataStructuresTable = DataStructuresTable.openTable(DATA_STRUCTURES_TABLE, dbConnector);\n Logging.getLOG().debug(\"user requested to get table, table: \" + DATA_STRUCTURES_TABLE);\n return Response.ok(URLEncoder.encode(dataStructuresTable.toJSON(), \"UTF-8\")).build();\n\n } else if (tableName.equals(SOFTWARE_DESIGN_TABLE)) {\n softwareDesignTable = SoftwareDesignTable.openTable(SOFTWARE_DESIGN_TABLE, dbConnector);\n Logging.getLOG().debug(\"user requested to get table, table: \" + SOFTWARE_DESIGN_TABLE);\n return Response.ok(URLEncoder.encode(softwareDesignTable.toJSON(), \"UTF-8\")).build();\n\n } else {\n // if it doesn't return that, then return an error\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(\"Something went wrong\")\n .build();\n }\n }", "@Override\n public java.util.List<Table> getTablesList() {\n return tables_;\n }", "Map<String, String> getCustomMetadata();", "public MetaData getMetaData();", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<ColumnSpecification> metadata();", "protected Map<String, Object> extractSystemMetadataAttrs(SystemMetadata systemMetadata,\n String tableName) {\n\n Map<String, Object> attrMap = new HashMap<String, Object>();\n \n // get seriesId\n Identifier seriesId = systemMetadata.getSeriesId();\n String seriesIdStr = seriesId == null ? null : seriesId.getValue();\n attrMap.put(\"series_id\", seriesIdStr);\n\n // get serial_version\n BigInteger serialVersion = systemMetadata.getSerialVersion();\n String versionStr = serialVersion.toString() == null ? null : serialVersion.toString();\n attrMap.put(\"serial_version\", versionStr);\n\n // get date_uploaded\n Date dateUploaded = systemMetadata.getDateUploaded();\n Timestamp uploadedTime = dateUploaded == null ? null\n : new Timestamp(dateUploaded.getTime());\n attrMap.put(\"date_uploaded\", uploadedTime);\n\n // get rights_holder\n Subject rightsHolder = systemMetadata.getRightsHolder();\n String rightsHolderStr = rightsHolder == null ? null : rightsHolder.getValue();\n attrMap.put(\"rights_holder\", rightsHolderStr);\n\n // get checksum\n Checksum checksum = systemMetadata.getChecksum();\n String checksumStr = checksum == null ? null : checksum.getValue();\n attrMap.put(\"checksum\", checksumStr);\n\n // get checksum_algorithm\n String algorithm = null;\n if (checksum != null) {\n algorithm = checksum.getAlgorithm();\n algorithm = algorithm == null ? null : algorithm;\n\n }\n attrMap.put(\"checksum_algorithm\", algorithm);\n\n // get origin_member_node\n NodeReference originNodeid = systemMetadata.getOriginMemberNode();\n String originNodeidStr = originNodeid == null ? null : originNodeid.getValue();\n attrMap.put(\"origin_member_node\", originNodeidStr);\n\n // get authoritive_member_node\n NodeReference authNodeid = systemMetadata.getAuthoritativeMemberNode();\n String authNodeidStr = authNodeid == null ? null : authNodeid.getValue();\n attrMap.put(\"authoritive_member_node\", authNodeidStr);\n\n // get date_modified\n Date dateModified = systemMetadata.getDateSysMetadataModified();\n Timestamp modTime = dateModified == null ? null : new Timestamp(dateModified.getTime());\n attrMap.put(\"date_modified\", modTime);\n\n // get submitter\n Subject submitter = systemMetadata.getSubmitter();\n String submitterStr = submitter == null ? null : submitter.getValue();\n attrMap.put(\"submitter\", submitterStr);\n\n // get object_format\n ObjectFormatIdentifier formatId = systemMetadata.getFormatId();\n String formatIdStr = formatId == null ? null : formatId.getValue();\n attrMap.put(\"object_format\", formatIdStr);\n\n // get size\n BigInteger size = systemMetadata.getSize();\n String sizeStr = size == null ? null : size.toString();\n attrMap.put(\"size\", sizeStr);\n\n // get archived\n Boolean archived = systemMetadata.getArchived();\n archived = archived == null ? false : archived;\n attrMap.put(\"archived\", archived);\n\n // get replication_allowed\n // get number_replicas\n Boolean replicationAllowed = null;\n Integer numberReplicas = null;\n ReplicationPolicy replicationPolicy = systemMetadata.getReplicationPolicy();\n if (replicationPolicy != null) {\n replicationAllowed = replicationPolicy.getReplicationAllowed();\n replicationAllowed = replicationAllowed == null ? false : replicationAllowed;\n numberReplicas = replicationPolicy.getNumberReplicas();\n replicationAllowed = replicationAllowed == null ? false : replicationAllowed;\n numberReplicas = numberReplicas == null ? -1 : numberReplicas;\n }\n attrMap.put(\"replication_allowed\", replicationAllowed);\n attrMap.put(\"number_replicas\", numberReplicas);\n\n // get obsoletes\n Identifier obsoletes = systemMetadata.getObsoletes();\n String obsoletesStr = obsoletes == null ? null : obsoletes.getValue();\n attrMap.put(\"obsoletes\", obsoletesStr);\n\n // get obsoleted_by\n Identifier obsoletedBy = systemMetadata.getObsoletedBy();\n String obsoletedByStr = obsoletedBy == null ? null : obsoletedBy.getValue();\n attrMap.put(\"obsoleted_by\", obsoletedByStr);\n\n // get guid\n Identifier pid = systemMetadata.getIdentifier();\n String pidStr = pid == null ? null : pid.getValue();\n attrMap.put(\"guid\", pidStr);\n\n return attrMap;\n }", "public void showTableFields(final boolean canEdit) {\n addMetadata.showFields(canEdit);\n addMetadata.setVisible(canEdit);\n dispatch.execute(new ListUserMetadataFields(false), new AsyncCallback<ListUserMetadataFieldsResult>() {\n public void onFailure(Throwable caught) {\n GWT.log(\"Error retrieving available list of User Specified Metadata fields\", caught);\n }\n\n public void onSuccess(ListUserMetadataFieldsResult result) {\n availableFields = result.getFieldsSortedByName();\n GWT.log(\"available fields: \" + availableFields);\n if (availableFields.size() > 0) {\n\n dispatch.execute(new GetUserMetadataFields(uri), new AsyncCallback<GetUserMetadataFieldsResult>() {\n public void onFailure(Throwable caught) {\n GWT.log(\"Error retrieving User Specified Information\", caught);\n }\n\n public void onSuccess(GetUserMetadataFieldsResult result) {\n Set<String> predicates = result.getThingsOrderedByName().keySet();\n if (predicates.size() == 0) {\n addNoFields();\n } else {\n for (String predicate : predicates ) {\n String label = result.getThingNames().get(predicate);\n String description = getDescription(predicate);\n SortedSet<UserMetadataValue> values = NamedThing.orderByName(result.getValues().get(predicate));\n addNewField(predicate, label, description, values, canEdit);\n }\n }\n }\n });\n\n }\n }\n });\n }", "public List<String> tables() {\n return this.tables;\n }", "public TableMetaData getTable(TSConnection conn, TableId tableid) {\n\t\treturn conn.getTable(tableid);\n\t}", "@Override\n public List<String> ListTables() throws IOException {\n\n LOGGER.info(\": {}\", hbaseDmlDao);\n\n// return listTables;\n return null;\n }", "@GET\n @Path( \"/databaseMetadata\" )\n @Produces( { APPLICATION_XML, APPLICATION_JSON } )\n public IDatabaseConnection getDatabaseMetadata() {\n return stagingDatabase.getDatbaseMetadata();\n }", "com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata();", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "public static void displayTable(Connection con, String tableName) throws SQLException \r\n\t{\r\n\t\tStatement st = null;\r\n\t\tResultSet rs = null;\r\n\r\n\t\tst = con.createStatement(); \r\n\r\n\t\trs = st.executeQuery(\"SELECT userID, firstName, lastName, countryCode FROM \" + tableName);\r\n\r\n\t\twhile(rs.next()) {\r\n\t\t\t// can retrieve by position\r\n\t\t\tint userId = rs.getInt(1);\r\n\t\t\t// or by column name \r\n\t\t\tString firstName = rs.getString(\"firstname\");\r\n\t\t\tString lastName = rs.getString(3);\r\n\t\t\tString countryCode = rs.getString(\"countryCode\");\r\n\r\n\t\t\tSystem.out.println(userId + \". \" + lastName + \", \" +\r\n\t\t\t\t\tfirstName + \" (\" + countryCode + \")\");\r\n\t\t}\r\n\r\n\t}", "@Override\n public java.util.List<? extends TableOrBuilder>\n getTablesOrBuilderList() {\n return tables_;\n }", "public String[] getTableSchema(String tableName){\n return tableSchemaMap.get(tableName);\n }", "public int getMetaUsers();", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "String getTableName();", "private String[] getTableFields(String pTableName) {\r\n\t\tString[] returnedValue = null;\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\t\r\n\t\t\tCursor cursor = getDatabse().query(pTableName, null, null, null, null, null, null);\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\treturnedValue = cursor.getColumnNames();\r\n\t\t\t}\r\n\t\t\tcursor.close();\r\n\t\t\tcursor = null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "java.util.List<Table>\n getTablesList();", "public ArrayList getTables(String IRI) throws Exception{\r\n\t\tResultSet rsTable=null;\r\n\t\tResultSet rsColumn=null;\r\n\t\tDatabaseMetaData dbMetaData=null;\r\n\t\tArrayList<TableMetaData> listTableMetaData = new ArrayList<TableMetaData>();\r\n\t\tTableMetaData tmetaData=null;\r\n\t\tHashtable <String,Object> pk;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (IRI.equals(\"IRI_CATALOG_DERBY\")) {\r\n\t\t\t\tdbMetaData=cm.getCatalogMetadata();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tTransactionMonitor tm=TransactionMonitor.getTransactionMonitor();\r\n\t\t\t\tdbMetaData=tm.getDatabaseMetadata(IRI);\r\n\t\t\t}\r\n\t\t\tif (dbMetaData== null){\r\n\t\t\t\tthrow new Exception(\"Could not get Table MetaData\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tString[] table= {\"TABLE\"};\r\n\t\t\t\tString tableName=null,columnName=null;\r\n\t\t\t\tint columnSize,columnIsNull,columnType;\r\n\t\t\t\tboolean isPrimaryKey=false;\r\n\t\t\t\tColumnMetaData colMetaData=null;\r\n\t\t\t\tArrayList<ColumnMetaData> listColumns=new ArrayList<ColumnMetaData>();\r\n\t\t\t\tResultSet rsPrimaryKey=null;\r\n\t\t\t\r\n\t\t\t\trsTable=dbMetaData.getTables(null,null,null,table);\r\n\t\t\t\twhile (rsTable.next()){\r\n\t\t\t\t\ttmetaData=new TableMetaData();\r\n\t\t\t\t\ttableName=rsTable.getString(\"TABLE_NAME\");\r\n\t\t\t\t\ttmetaData.setTableName(tableName);\r\n\t\t\t\t\t\r\n\t\t\t\t\trsPrimaryKey=dbMetaData.getPrimaryKeys(null,null,tableName);\r\n\t\t\t\t\tpk=new Hashtable<String, Object>();\r\n\t\t\t\t\twhile (rsPrimaryKey.next()){\r\n\t\t\t\t\t\tpk.put(rsPrimaryKey.getString(\"COLUMN_NAME\"),null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\trsPrimaryKey.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\trsColumn=dbMetaData.getColumns(null,null,tableName,null);\r\n\t\t\t\t\twhile (rsColumn.next()) {\r\n\t\t\t\t\t\tcolumnName=rsColumn.getString(\"COLUMN_NAME\");\r\n\t\t\t\t\t\tcolumnType=rsColumn.getInt(\"COLUMN_TYPE\");\r\n\t\t\t\t\t\tcolumnSize=rsColumn.getInt(\"COLUMN_SIZE\");\r\n\t\t\t\t\t\tcolumnIsNull=rsColumn.getInt(\"NULLABLE\");\r\n\t\t\t\t\t\tif (pk.containsKey(columnName))\r\n\t\t\t\t\t\t\tisPrimaryKey=true;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tisPrimaryKey=false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcolMetaData=new ColumnMetaData(columnName,columnType,columnSize,columnIsNull,isPrimaryKey);\r\n\t\t\t\t\t\tlistColumns.add(colMetaData);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\trsColumn.close();\r\n\t\t\t\t\ttmetaData.setColumnMetaData(listColumns);\r\n\t\t\t\t\tlistTableMetaData.add(tmetaData);\r\n\t\t\t\t\t}\r\n\t\t\t\trsTable.close();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException sqle) {\r\n\t\t\tthrow new Exception (\"Error while accessing DataBaseMetaData info\"+sqle.getMessage());\r\n\t\t}\r\n\t\tcatch (CatalogException ce){\r\n\t\t\tthrow new Exception (\"Error during acessing catalog from DatabaseMetadata\"+ce.getMessage());\r\n\t\t}\r\n\t\tcatch (TransactionMonitorException tme) {\r\n\t\t\tthrow new Exception (\"Error accessing Transaction Monitor from DatabaseMetadata\"+tme.getMessage());\r\n\t\t}\r\n\t\treturn listTableMetaData;\r\n\t}", "public abstract String [] listTables();", "public String[] getTableNames()\n {\n return tableNames;\n }", "public List<TableMetadata> tables()\n {\n if (version == UNDEFINED) {\n return Collections.emptyList();\n }\n if (version == NOT_FETCHED) {\n synchronized (this) {\n List<TableMetadata> catalogTables = base.tablesForSchema(schema.name());\n for (TableMetadata table : catalogTables) {\n cache.put(table.id().name(), new TableEntry(table));\n }\n }\n }\n List<TableMetadata> orderedTables = new ArrayList<>();\n\n // Get the list of actual tables; excluding any cached \"misses\".\n cache.forEach((k, v) -> {\n if (v.table != null) {\n orderedTables.add(v.table);\n }\n });\n orderedTables.sort((e1, e2) -> e1.id().name().compareTo(e2.id().name()));\n return orderedTables;\n }", "private Tables() {\n\t\tsuper(\"TABLES\", org.jooq.util.mysql.information_schema.InformationSchema.INFORMATION_SCHEMA);\n\t}", "@Override\n\tpublic String getTableName() {\n\t\treturn \"user\";\n\t}", "public void listTables() {\r\n\t\tfor (Table table : tables) {\r\n\t\t\tSystem.out.println(table.getName());\r\n\t\t}\r\n\t}", "public void getArtistsMetaDataFromDevice(){\n // implement a cursorLoader\n ContentResolver resolver = getContentResolver();\n Cursor cursor = resolver.query(MediaStore.Audio.Artists.INTERNAL_CONTENT_URI,null,null,null,MediaStore.Audio.ArtistColumns.ARTIST);\n }", "private void retrieveNewMetadata() {\n\n Runnable loadProviders = new Runnable() {\n @Override\n public void run() {\n getAvailableDataProviders();\n }\n };\n\n Runnable loadDataSets = new Runnable() {\n @Override\n public void run() {\n getAvailableDataSets();\n }\n };\n\n Runnable loadParameters = new Runnable() {\n @Override\n public void run() {\n getAvailableParameters();\n }\n };\n\n Runnable loadLevels = new Runnable() {\n @Override\n public void run() {\n getAvailableLevels();\n }\n };\n\n Runnable[] runnables = new Runnable[] { loadProviders, loadDataSets,\n loadParameters, loadLevels };\n FutureTask<?>[] tasks = new FutureTask[runnables.length];\n ExecutorService executor = Executors\n .newFixedThreadPool(runnables.length);\n for (int i = 0; i < runnables.length; i++) {\n FutureTask<Void> task = new FutureTask<Void>(runnables[i], null);\n tasks[i] = task;\n executor.submit(task);\n }\n\n for (FutureTask<?> task : tasks) {\n try {\n task.get();\n } catch (Exception e) {\n statusHandler.handle(Priority.WARN, \"Unable to load metadata\",\n e);\n }\n }\n }", "protected Map<String, String> getMetaData(Response response) {\r\n\t\tMap<String, String> metadata = new HashMap<String, String>();\r\n Request request = response.getRequest();\r\n\r\n User authUser = request.getActiveUser();\r\n String user = \"?\";\r\n if (authUser != null) {\r\n user = authUser.getUserId();\r\n }\r\n\r\n\t\tmetadata.put(\"user\", encodeValue(user));\r\n\t\tmetadata.put(\"request\", encodeValue(RequestUtil.getRequestURL(request).toString()));\r\n\t\tmetadata.put(\"status\", encodeValue(\"ok\"));\r\n\r\n\r\n\t\tif ( null != request ) {\r\n\t\t\tmetadata.put(\"startTime\", metaDataTimeFormat.format(request.getCreateTime()));\r\n\t\t\tmetadata.put(\"endTime\", metaDataTimeFormat.format(System.currentTimeMillis()));\r\n\t\t}\r\n\r\n\t\treturn metadata;\r\n\t}", "String[] getMetadataNames();", "public WorkspaceUserMetadata getMetadata() {\n\t\treturn meta;\n\t}", "public WorkspaceUserMetadata getMetadata() {\n\t\t\treturn meta;\n\t\t}", "public DataTableCollection tables() {\r\n return _tables;\r\n }", "public ArrayList<Table> getAllTables() {\r\n\t\treturn tables;\r\n\t}", "public List<Map<String, String>> getTable(String tableName) {\n return getTable(tableName, 1, 9999);\n\n }", "List<Map<String, Object>> getTableValuesWithHeaders(TableParameters tableParameters);", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "@RequestMapping(value = \"/data/{srcEnv}/{srcDB}/{pid}\", method = {RequestMethod.GET})\n @ResponseBody\n public RestWrapper getTableData(@PathVariable(\"srcEnv\") String srcEnv, @PathVariable(\"srcDB\") String srcDB, @PathVariable(\"pid\") String pid) {\n RestWrapper restWrapper = null;\n LOGGER.info(srcEnv + \"srcEnvi\");\n LOGGER.info(srcDB + \"srcDB\");\n try {\n Class.forName(driverName);\n connection = DriverManager.getConnection(\"jdbc:hive2://\" + srcEnv + \"/\" + srcDB.toLowerCase(), \"\", \"\");\n String tableName=\"ML_\"+pid;\n ResultSet rs = connection.createStatement().executeQuery(\"select * from \" + srcDB + \".\" + tableName);\n\n ResultSetMetaData metaData = rs.getMetaData();\n List<Map<String, Object>> tables = new ArrayList<Map<String, Object>>();\n while (rs.next()) {\n Map<String,Object> m=new LinkedHashMap<>();\n for(int j=1;j<=metaData.getColumnCount();j++){\n\n String colName = metaData.getColumnLabel(j).replaceFirst(tableName.toLowerCase()+\".\", \"\");\n if(!colName.equals(\"features\") && !colName.equals(\"rawprediction\") && !colName.equals(\"probability\")){\n Object colValue=rs.getObject(j);\n m.put(colName,colValue);}\n }\n tables.add(m);\n }\n restWrapper = new RestWrapper(tables, RestWrapperOptions.OK);\n\n } catch (Exception e) {\n LOGGER.error(\"error occured \" + e);\n restWrapper = new RestWrapper(e.getMessage(), RestWrapper.ERROR);\n }\n return restWrapper;\n }", "public void createTables() throws Exception{\n\t\tcreate_table(\"tab_global\", \"param\", 1);\n\t\t\n\t\tPut put = new Put(Bytes.toBytes(\"row_userid\"));\n\t\tlong id = 0;\n\t\tput.add(Bytes.toBytes(\"param\"), \n\t\t\t\tBytes.toBytes(\"userid\"), \n\t\t\t\tBytes.toBytes(id));\n\t\tHTable ht = new HTable(conf, \"tab_global\");\n\t\tht.put(put);\n\t\t\n\t\tcreate_table(\"tab_user2id\", \"info\", 1);\n\t\tcreate_table(\"tab_id2user\", \"info\", 1);\n\t\t\n\t\t//table_follow\t{userid}\tname:{userid}\n\t\tcreate_table(\"tab_follow\", \"name\", 1);\n\t\t\n\t\t//table_followed\trowkey:{userid}_{userid} CF:userid\n\t\tcreate_table(\"tab_followed\", \"userid\", 1);\n\t\t\n\t\t//tab_post\trowkey:postid\tCF:post:username post:content post:ts\n\t\tcreate_table(\"tab_post\", \"post\", 1);\n\t\tput = new Put(Bytes.toBytes(\"row_postid\"));\n\t\tid = 0;\n\t\tput.add(Bytes.toBytes(\"param\"), \n\t\t\t\tBytes.toBytes(\"postid\"), \n\t\t\t\tBytes.toBytes(id));\n\t\tht.put(put);\n\t\t\n\t\t//tab_inbox\t\trowkey:userid+postid\tCF:postid\n\t\tcreate_table(\"tab_inbox\", \"postid\", 1);\n\t\tht.close();\n\t}", "void setTables(Object tables);", "public Collection getTables(String serviceProviderCode, String callerID) throws AAException, RemoteException;", "public ResultSet getAll(String tableName)\n {\n\n String selectStr;\n ResultSet rs=null;\n\n try{\n\n selectStr=\"SELECT * FROM \"+tableName;\n rs = stmt.executeQuery(selectStr);\n\n\n\n\n\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return rs;\n }", "public void getComponents(DatabaseMetaData meta) throws SQLException {\n String[] types = {\"TABLE\"};\n ResultSet rs = meta.getTables(null, null, null, types);\n while(rs.next()){\n Table t = new MysqlTable(rs.getString(\"TABLE_NAME\"), rs.getString(\"TABLE_TYPE\"));\n //t.getComponents(meta);\n this.setTables(t);\n }\n try{\n rs.close();\n } catch (Exception ignored){\n } finally { rs.close(); /*Anyway*/ }\n }", "@Override\n\tpublic void getFields(List<String> table) {\n\t\t\n\t}", "@Override\n protected AdqlValidator.ValidatorTable[] getExtraTables() {\n TopcatModel[] tcModels = getTopcatModels();\n List<AdqlValidator.ValidatorTable> vtList =\n new ArrayList<AdqlValidator.ValidatorTable>();\n for ( int it = 0; it < tcModels.length; it++ ) {\n TopcatModel tcModel = tcModels[ it ];\n String[] aliases = getUploadAliases( tcModel );\n for ( int ia = 0; ia < aliases.length; ia++ ) {\n String tname = \"TAP_UPLOAD.\" + aliases[ ia ];\n vtList.add( toValidatorTable( tcModel, tname ) );\n }\n }\n return vtList.toArray( new AdqlValidator.ValidatorTable[ 0 ] );\n }", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic ArrayList<TableColumnsInfo> getColumnsInfo(\n\t\t\tArrayList<String> arrTblNames) {\n\t\tArrayList<TableColumnsInfo> tableColumnsInfoArray = new ArrayList<TableColumnsInfo>();\n\t\tif (arrTblNames.size() == 0)\n\t\t\treturn tableColumnsInfoArray;\n\n\t\tfor (int j = 0; j < arrTblNames.size(); j++) {\n\t\t\tString tblName = arrTblNames.get(j);\n\t\t\tString[] columnNames;\n\n\t\t\tCursor c = ourDatabase.rawQuery(\"SELECT * FROM \" + tblName\n\t\t\t\t\t+ \" WHERE 0\", null);\n\t\t\ttry {\n\t\t\t\tcolumnNames = c.getColumnNames();\n\t\t\t} finally {\n\t\t\t\tc.close();\n\t\t\t}\n\n\t\t\t// SQLiteDatabase db = ourHelper.getWritableDatabase();\n\t\t\tCursor cursor = ourDatabase.rawQuery(\"PRAGMA table_info(\" + tblName\n\t\t\t\t\t+ \")\", null);\n\t\t\tcursor.moveToFirst();\n\t\t\tArrayList<ColumnInfo> colInfoArray = new ArrayList<DatabasesInterface.ColumnInfo>();\n\t\t\twhile (!cursor.isAfterLast()) {\n\t\t\t\ttry {\n\t\t\t\t\tint nameIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[0]);\n\t\t\t\t\tint typeIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[1]);\n\t\t\t\t\tint notNullIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[2]);\n\t\t\t\t\tint dfltValueIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[3]);\n\t\t\t\t\tint primaryKeyIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[4]);\n\n\t\t\t\t\tString name = cursor.getString(nameIdx);\n\t\t\t\t\tString type = cursor.getString(typeIdx);\n\t\t\t\t\tint notNull = cursor.getInt(notNullIdx);\n\t\t\t\t\tString dfltValue = cursor.getString(dfltValueIdx);\n\t\t\t\t\tint primaryKey = cursor.getInt(primaryKeyIdx);\n\n\t\t\t\t\tColumnInfo colInfo = new ColumnInfo(name, type, notNull,\n\t\t\t\t\t\t\tdfltValue, primaryKey);\n\t\t\t\t\tcolInfoArray.add(colInfo);\n\t\t\t\t} finally {\n\t\t\t\t\tcursor.moveToNext();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcursor.close();\n\t\t\tTableColumnsInfo tblInfo = new TableColumnsInfo(tblName,\n\t\t\t\t\tcolInfoArray);\n\t\t\ttableColumnsInfoArray.add(tblInfo);\n\t\t}\n\t\treturn tableColumnsInfoArray;\n\n\t}", "List<Map<String, Object>> getTableValuesWithHeaders();", "java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();", "java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();", "public abstract Object getMetadata(String key);", "public ResultSet getAllDemographyInfo () throws Exception {\r\n String sql = \"SELECT * FROM public.demographyinfo ORDER BY user;\";\r\n return stmt.executeQuery(sql);\r\n }", "public static Hashtable<String, Vector<String>> getMetaData3(String tablename) {\n\t\tHashtable<String, Vector<String>> temp = new Hashtable<String, Vector<String>>();\n\t\tBufferedReader fileReader = null;\n\t\tString[] array;\n\n\t\ttry {\n\t\t\tString l = \"\";\n\t\t\tfileReader = new BufferedReader(new FileReader(\"src/main/resources/metadata.csv\"));\n\t\t\twhile ((l = fileReader.readLine()) != null) {\n\t\t\t\tVector<String> v = new Vector<>();\n\t\t\t\tarray = l.split(\",\");\n\t\t\t\tif (array[0].equals(tablename)) {\n\t\t\t\t\tv.add(array[5]);\n\t\t\t\t\tv.add(array[6]);\n\t\t\t\t\ttemp.put(array[1], v);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.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\t\treturn temp;\n\t}", "private void dumpMeta(TableName tableName) throws IOException {\n List<byte[]> metaRows = TEST_UTIL.getMetaTableRows(tableName);\n for (byte[] row : metaRows) {\n LOG.info(Bytes.toString(row));\n }\n }", "public ArrayList<Table> getTables(String schema) {\r\n try {\r\n Statement stmt = conexion.createStatement();\r\n String sql;\r\n sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '\" + schema + \"'\";\r\n ResultSet rs = stmt.executeQuery(sql);\r\n ArrayList<Table> tables = new ArrayList();\r\n while (rs.next()) {\r\n Table_Base table = new Table_Base();\r\n table.setTitle(rs.getString(3));//TABLE_NAME\r\n table.setDescription(rs.getString(21));//TABLE_COMMENT\r\n System.out.println(\"isuued table.. \"+rs.getString(15)+\"/\"+rs.getString(3));\r\n table.setIssued(rs.getString(15));//CREATE_TIME\r\n if(rs.getString(16) != null){\r\n table.setModified(rs.getString(16));//UPDATE_TIME\r\n \r\n }else\r\n {\r\n table.setModified(\"\");//UPDATE_TIME\r\n \r\n }\r\n table.setMediaType(\"application/sql\");\r\n table.setFormat(\"application/sql\");\r\n table.setByteSize(getByteSizeDBTable(rs.getString(10), rs.getString(12)));\r\n table.setCharacterSet(getCharacterSetTableDB(schema, rs.getString(3)));\r\n table.setDefaultDecimalSeparator(\".\");//default standard mysql\r\n table.setOverrallRecordCount(rs.getString(8));\r\n ArrayList<Column> columns = getColumns(schema, table.getTitle());\r\n table.setColumnas(columns);\r\n tables.add(table);\r\n }\r\n return tables;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(DAOBaseDatos.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n\r\n }", "@Override\n public List<Complex> findAllMetaData() throws PersistentException {\n ComplexDao complexDao = transaction.createDao(ComplexDao.class);\n List<Complex> complexes = complexDao.readComplex();\n readTrainerLogin(complexes);\n readVisitorLogin(complexes);\n return complexes;\n }", "private void get_tables_from_db() {\n\t\t\n\t\tDBUtils dbu = new DBUtils(this, MainActv.dbName);\n\t\t\n\t\tSQLiteDatabase rdb = dbu.getReadableDatabase();\n\n\t\t// Log\n\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \"]\", \"rdb.getPath(): \" + rdb.getPath());\n\t\t\n\t\t\n\t\t// REF=> http://stackoverflow.com/questions/82875/how-do-i-list-the-tables-in-a-sqlite-database-file\n\t\tString sql = \"SELECT * FROM sqlite_master WHERE type='table'\";\n\t\t\n\t\tCursor c = rdb.rawQuery(sql, null);\n\t\t\n\t\tstartManagingCursor(c);\n\t\t\n\t\t// Log\n\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \"]\", \"Tables: c.getCount()\" + c.getCount());\n\t\t\n\t\tc.moveToFirst();\n\t\t\n\t\tfor (int i = 0; i < c.getCount(); i++) {\n\t\t\t\n\t\t\t// Log\n\t\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"name: \" + c.getString(1));\n\t\t\t\n\t\t\tc.moveToNext();\n\t\t\t\n\t\t}//for (int i = 0; i < c.getCount(); i++)\n\t\t\n\t\trdb.close();\n\t\t\n\t}", "private JSObject getTableColumnNamesTypes(SQLiteDatabase db, String tableName) throws JSONException {\n JSObject ret = new JSObject();\n ArrayList<String> names = new ArrayList<String>();\n ArrayList<String> types = new ArrayList<String>();\n String query = new StringBuilder(\"PRAGMA table_info(\").append(tableName).append(\");\").toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n List<JSObject> lQuery = resQuery.toList();\n if (resQuery.length() > 0) {\n for (JSObject obj : lQuery) {\n names.add(obj.getString(\"name\"));\n types.add(obj.getString(\"type\"));\n }\n ret.put(\"names\", names);\n ret.put(\"types\", types);\n }\n return ret;\n }", "@Override\n public Object getTables(Long serverId, String statementExample)\n {\n return null;\n }", "protected List<Map<String, Object>> show() {\n List<Map<String, Object>> output = new ArrayList<>();\n try {\n ResultSet rs;\n try (PreparedStatement stmt = DBConnect.getConnection()\n .prepareStatement(String.format(\"SELECT * FROM %s WHERE userID = ?\", table))) {\n stmt.setLong(1, userId);\n rs = stmt.executeQuery();\n }\n output = DBConnect.resultsList(rs);\n rs.close();\n DBConnect.close();\n } catch (SQLException e) {\n Logger.getLogger(DBConnect.class.getName()).log(Level.SEVERE, \"Failed select\", e);\n }\n return output;\n }", "public String[] getTableList() {\n\t\treturn adapter.getTableList(adapter.queryToArray());\n\t}", "public HashMap getMetaData() ;", "private void initTables() {\n insert(\"CREATE TABLE IF NOT EXISTS `player_info` (`player` VARCHAR(64) PRIMARY KEY NOT NULL, `json` LONGTEXT)\");\n }", "@Override\n\tpublic ArrayList<String> getTablesNames() {\n\t\tArrayList<String> arrTblNames = new ArrayList<String>();\n\t\tCursor c = ourDatabase.rawQuery(\n\t\t\t\t\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n\t\tif (c.moveToFirst()) {\n\t\t\twhile (!c.isAfterLast()) {\n\t\t\t\tarrTblNames.add(c.getString(c.getColumnIndex(\"name\")));\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t}\n\t\treturn arrTblNames;\n\t}", "@SneakyThrows\n public List<Map<String, String>> getTable(String tableName, int page, int pageSize) {\n try (CloseableHttpClient client = HttpClientBuilder.create()\n .setDefaultRequestConfig(getRequestConfig())\n .build()) {\n String url = KodexaPlatform.getUrl() + \"/api/stores/\" + ref.replace(\":\", \"/\") + \"/rows\";\n log.info(\"Connecting to [\" + url + \"]\");\n\n URIBuilder builder = new URIBuilder(url);\n builder.setParameter(\"page\", String.valueOf(page)).setParameter(\"pageSize\", String.valueOf(pageSize)).setParameter(\"table\", tableName);\n\n HttpGet httpGet = new HttpGet(builder.build());\n httpGet.addHeader(\"x-access-token\", KodexaPlatform.getAccessToken());\n\n HttpResponse response = client.execute(httpGet);\n\n if (response.getStatusLine().getStatusCode() != 200) {\n throw new KodexaException(\"Unable to create a session, check your access token and URL [\" + response.getStatusLine().getStatusCode() + \"]\");\n }\n\n String responseJson = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);\n Page<StoredRow> rowPage = jsonOm.readValue(responseJson, new TypeReference<Page<StoredRow>>() {\n });\n\n return rowPage.getContent().stream().map(StoredRow::getData).collect(Collectors.toList());\n\n\n } catch (IOException e) {\n throw new KodexaException(\"Unable to create a session on Kodexa\", e);\n }\n }", "public TapTable findOneTable(String tableName);", "public TableInfo getTableInfo() {\r\n\t\treturn ti;\r\n\t}", "public String[] getTableNames(SQLiteDatabase db) {\n Cursor c = db.rawQuery(\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n List<String> list = new ArrayList<>();\n if (c.moveToFirst()) {\n do {\n String table = c.getString(0);\n if (!PRIVATE_TABLE_NAMES.contains(table)) {\n list.add(table);\n }\n } while (c.moveToNext());\n }\n c.close();\n return list.toArray(new String[list.size()]);\n }", "public List<String> getTableNames() throws IOException {\n List<String> tableList = new ArrayList<String>();\n TableName[] tableNames = hBaseAdmin.listTableNames();\n for (TableName tableName : tableNames) {\n //if (pattern.matcher(tableName.toString()).find()) {\n tableList.add(tableName.toString());\n //}\n }\n return tableList;\n }", "public static Map<String, String> getTableMap() {\n return tableMap;\n }", "private Map<String, AttributeInfo> getUserSchemaMap() {\n if (userSchemaMap == null) {\n schema();\n }\n return userSchemaMap;\n }", "Map<String,QualitativeJSONTableModel> getQualitativeData(OAuth2Authentication oauth);", "private HashMap<Long, String> getTable() {\n return table;\n }", "private void getMetadata() {\n masterRoot = AbstractMetadata.getAbstractedMetadata(sourceProduct);\n masterMetadata = new MetadataDoris(masterRoot);\n masterOrbit = new OrbitsDoris();\n masterOrbit.setOrbit(masterRoot);\n \n // SLAVE METADATA\n // hash table or just map for slaves - now it supports only a single sourceSlave image\n slaveRoot = sourceProduct.getMetadataRoot().getElement(AbstractMetadata.SLAVE_METADATA_ROOT).getElementAt(0);\n slaveMetadata = new MetadataDoris(slaveRoot);\n slaveOrbit = new OrbitsDoris();\n slaveOrbit.setOrbit(slaveRoot);\n }", "public HTableDescriptor[] listTables() throws IOException {\n return getAdmin().listTables();\n }" ]
[ "0.64158714", "0.6209229", "0.601656", "0.58934593", "0.57758844", "0.5603615", "0.5524146", "0.5335439", "0.52740157", "0.51767653", "0.5175336", "0.5147729", "0.5125018", "0.5118521", "0.51141125", "0.51131123", "0.5107667", "0.51004833", "0.50887954", "0.50763327", "0.50689894", "0.50658554", "0.50484914", "0.5045261", "0.504335", "0.5038258", "0.5031863", "0.5018724", "0.50181216", "0.5005102", "0.49950653", "0.49864736", "0.49573192", "0.49494764", "0.49445635", "0.49399728", "0.49308053", "0.49284714", "0.49196917", "0.49174425", "0.4911193", "0.49086282", "0.48914003", "0.4889989", "0.488984", "0.48877156", "0.4879263", "0.48775503", "0.48773435", "0.4874705", "0.48615277", "0.4852086", "0.48519", "0.48424664", "0.48282915", "0.4825858", "0.4825212", "0.48156834", "0.4804306", "0.47999632", "0.47950202", "0.47853947", "0.47710347", "0.47611886", "0.4758254", "0.47547466", "0.47543246", "0.4750922", "0.4744584", "0.47442725", "0.47434995", "0.47412995", "0.4734172", "0.47329876", "0.47329876", "0.47294495", "0.4723595", "0.4716504", "0.4710997", "0.4709781", "0.4709636", "0.46951205", "0.4692517", "0.46909988", "0.4682302", "0.46808228", "0.46744725", "0.46693012", "0.46681458", "0.46457228", "0.46413714", "0.46355277", "0.46332863", "0.46252328", "0.46219656", "0.4620587", "0.4620094", "0.461845", "0.46114752", "0.46061563" ]
0.5837652
4
Retrieves the user provided metadata for the specified tables.
public ShowTableMetadataResponse showTableMetadata(List<String> tableNames, Map<String, String> options) throws GPUdbException { ShowTableMetadataRequest actualRequest_ = new ShowTableMetadataRequest(tableNames, options); ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse(); submitRequest("/show/table/metadata", actualRequest_, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "<K, C> TableMetadata<K, C> getTableMetadata(TableName tableName);", "Map<String, Object> getAllMetadata();", "private List<Table> getTables() {\n List<Table> tables = new ArrayList<>();\n\n DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n Query query = new Query(\"Table\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n String firstName = (String) entity.getProperty(\"firstName\");\n String lastName = (String) entity.getProperty(\"lastName\");\n String email = (String) entity.getProperty(\"email\");\n String phoneNumber = (String) entity.getProperty(\"phoneNumber\");\n String restName = (String) entity.getProperty(\"restName\");\n String restAdd = (String) entity.getProperty(\"restAdd\");\n String restDescrip = (String) entity.getProperty(\"restDescrip\");\n String dateTime = (String) entity.getProperty(\"dateTime\");\n String maxSize = (String) entity.getProperty(\"maxSize\");\n String otherNotes = (String) entity.getProperty(\"otherNotes\");\n List members = (List) entity.getProperty(\"members\");\n double lat = (double) entity.getProperty(\"lat\");\n double lng = (double) entity.getProperty(\"lng\");\n\n\n \n\n Table table = new Table(firstName, lastName, email, phoneNumber, restName, restAdd, restDescrip, dateTime, maxSize, otherNotes, members, lat, lng);\n tables.add(table);\n }\n return tables;\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public List<SchemaInfo> getAllUserTablesInfo() {\n\t\tList<DefaultSchemaNode> tableNodes = getAllTablesNode();\n\t\tList<SchemaInfo> tables = new ArrayList<SchemaInfo>();\n\n\t\tfor (DefaultSchemaNode node : tableNodes) {\n\t\t\tSchemaInfo table = dbNode.getDatabaseInfo().getSchemaInfo(\n\t\t\t\t\tnode.getName());\n\t\t\tif (null != table) {\n\t\t\t\ttables.add(table);\n\t\t\t}\n\t\t}\n\n\t\treturn tables;\n\t}", "Object getTables();", "@Override\n\tpublic Map<String, Object> getUserInfoDetail(Map<String, Object> reqs) {\n\t\treturn joaSimpleDao.retrieve(\"tp_users\", reqs);\n\t}", "private void retrieveAllUserData() {\n retrieveBasicUserInfo();\n retrieveUsersRecentMedia();\n retrieveUsersLikedMedia();\n }", "public List<String> getUserTables() {\n\t\ttry (Connection con = getReadOnlyConnection()) {\n\t\t\treturn dbFacade.getUserTables(con);\n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public SnmpMibTable getRegisteredTableMeta(String paramString) {\n/* 670 */ if (this.metadatas == null) return null; \n/* 671 */ if (paramString == null) return null; \n/* 672 */ return this.metadatas.get(paramString);\n/* */ }", "public Map<String, String> getUserMetedata(String keyName)\n {\n S3Object o = s3.getObject(bucketName, keyName);\n return o.getObjectMetadata().getUserMetadata();\n }", "private void createSchemaInfo() {\n\t\tfor (String tableName : tableSchemas.keySet()) {\n\t\t\tERWinSchemaInfo schemaInfo = new ERWinSchemaInfo();\n\t\t\tschemaInfo.setType(\"user\");\n\t\t\tschemaInfo.setUniqueName(tableName);\n\t\t\tschemaInfos.put(tableName, schemaInfo);\n\t\t}\n\n\t\tinitCache();\n\t\tparseKeyGroupGroups();\n\n\t\tparseEntityProps();\n\t\tparseRelationGroups();\n\t\tparseAttributes();\n\n\t\tcreateSchemaDDL();\n\t}", "@Override\n\tpublic List<HashMap<String, Object>> getMetaListByTableName(String tableName,String condition) {\n\t\tList<HashMap<String, Object>> hm = metaDao.getMetaListByTableName(tableName,condition);\n\t\treturn hm;\n\t}", "Metadata getMetaData();", "private String[] getTables() {\r\n\t\tString[] returnedValue = null;\r\n\t\tList<String> tablesList = new ArrayList<String>();\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\tCursor cursor = getDatabse().rawQuery(\"SELECT DISTINCT tbl_name FROM sqlite_master\", null);\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcursor.moveToLast();\r\n\t\t\t\t\tcursor.moveToFirst();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (cursor.getCount() > 0) {\r\n\t\t\t\t\t\tdo{\r\n\t\t\t\t\t\t\tString tableName = cursor.getString(0);\r\n\t\t\t\t\t\t\tif (tableName != null && tableName.trim() != \"\") {\r\n\t\t\t\t\t\t\t\tif (!tableName.trim().toLowerCase().equals(\"android_metadata\") &&\r\n\t\t\t\t\t\t\t\t\t!tableName.trim().toLowerCase().equals(\"sqlite_sequence\")) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttablesList.add(tableName);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} while(cursor.moveToNext());\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tcursor.close();\r\n\t\t\t\t\tcursor = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (tablesList.size() > 0) {\r\n\t\t\treturnedValue = tablesList.toArray(new String[tablesList.size()]);\r\n\t\t}\r\n\t\ttablesList.clear();\r\n\t\ttablesList = null;\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "public static ImmutableList<ColumnMetadata> getColumnMetaFromJson(String schemaName, String tableName, String metaDir) {\n long startTime = System.currentTimeMillis();\n ImmutableList.Builder<ColumnMetadata> columnsMetadata = ImmutableList.builder();\n try {\n String jsonStr = readTableJson(schemaName, tableName, metaDir);\n JSONObject obj = new JSONObject(jsonStr);\n JSONArray cols = obj.getJSONArray(JSON_TABLEMETA_COLUMNES);\n for (int i = 0; i < cols.length(); i++) {\n JSONObject temp = new JSONObject(cols.getString(i));\n String family = temp.getString(JSON_TABLEMETA_FAMILY);\n String columnName = temp.getString(JSON_TABLEMETA_COLUMNNAME);\n String type = temp.getString(JSON_TABLEMETA_TYPE);\n columnsMetadata.add(new HBaseColumnMetadata(family, columnName, matchType(type)));\n }\n } catch (Exception e) {\n logger.error(e.getMessage(), e);\n } finally {\n logger.info(String.format(\"Read COLUMN meta info of TABLE %s.%s from json, totally used %d ms.\",\n schemaName, tableName, (System.currentTimeMillis() - startTime)));\n }\n return columnsMetadata.build();\n }", "public Map<String, String> getUserMetaData() {\n\t\treturn userMetaData;\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new TraitSalaire(), new HashMap<String, MetaData>()\r\n \t\t\t\t\t, new ArrayList<String>());\r\n \t\t} catch (InstantiationException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (IllegalAccessException 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 interface HiveMetaDao {\n String getLocationByDbAndTable(Map<String, String> map);\n List<String> getDbsByUser(String userName);\n List<Map<String, Object>> getTablesByDbNameAndUser(Map<String, String> map);\n Long getPartitionSize(Map<String, String> map);\n List<String> getPartitions(Map<String, String> map);\n List<Map<String, Object>> getColumns(Map<String, String> map);\n List<Map<String, Object>> getPartitionKeys(Map<String, String> map);\n String getTableComment(@Param(\"DbName\") String DbName, @Param(\"tableName\") String tableName);\n}", "<K, C> void declareTable(TableMetadata<K, C> metadata);", "public void showTables(){\n\t\tSchema schemaTable = Schema.getSchemaInstance();\n\t\tString currentSchemaName = schemaTable.getCurrentSchema();\n\n\t\ttry{\n\t\t\tArrayList<String> tableList = new ArrayList<String>();\n\n\t\t\tRandomAccessFile tableFile = new RandomAccessFile(\"information_schema.table.tbl\",\"rw\");\n\n\t\t\twhile(tableFile.getFilePointer() < tableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tString readTableName = \"\";\n\n\t\t\t\t//Looks for matching schema name\n\t\t\t\tbyte varcharLength = tableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tableFile.readByte();\n\n\t\t\t\tbyte varcharTableLength = tableFile.readByte();\n\t\t\t\tfor(int k = 0; k < varcharTableLength; k++)\n\t\t\t\t\treadTableName += (char)tableFile.readByte();\n\t\t\t\t//Looks for matching table name\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\t\n\t\t\t\t\ttableList.add(readTableName);\n\t\t\t\t}\n\t\t\t\t//To skip the number of rows part\n\t\t\t\ttableFile.readLong();\n\t\t\t}\n\n\t\t\tif(tableList.size() != 0){\n\t\t\t\t//Printing current Tables in the schema\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"Table_in_\" + currentSchemaName);\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\tfor(int i = 0; i < tableList.size() ; i++)\n\t\t\t\t\tSystem.out.println(tableList.get(i));\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\n\t\t\t\t//Clearing table list contents\n\t\t\t\ttableList.removeAll(tableList);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Empty Set...\");\n\t\t\t}\n\n\t\t\t//Closing the file\n\t\t\ttableFile.close();\n\t\t}catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected String getTableNameForMetadata(String tableName) {\n return (tableName == null) ? IdentifierUtil.PERCENT :\n getTableNameForMetadata(DBIdentifier.newTable(tableName));\n }", "@Override\n\tpublic Map<String, Object> getUserDetail(Map<String, Object> reqs) {\n\t\treturn null;\n\t}", "@GET\n @Path(\"/getTable\")\n public Response getTableInfo(\n @QueryParam(\"tableName\") String tableName\n ) throws UnsupportedEncodingException {\n\n //System.out.println(\"Hit End Point\");\n // check whether no parameters were passed\n if (tableName == null) {\n String msg = \"missing parameter tableName\";\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(msg)\n .build();\n }\n start();\n //System.out.print(\"Table name entered\");\n if (!tables.contains(tableName)) {\n String msg = \"table not found\";\n System.out.println(msg);\n Logging.getLOG().debug(\"user requested to get table, table name not found. \");\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(msg)\n .build();\n }\n\n //System.out.println(\"Valid name entered\");\n if (tableName.equals(ALGORITHMS_TABLE)) {\n algorithmsTable = AlgorithmsTable.openTable(ALGORITHMS_TABLE, dbConnector);\n Logging.getLOG().debug(\"user requested to get table, table: \" + ALGORITHMS_TABLE);\n return Response.ok(URLEncoder.encode(algorithmsTable.toJSON(), \"UTF-8\")).build();\n\n } else if (tableName.equals(DATA_STRUCTURES_TABLE)) {\n dataStructuresTable = DataStructuresTable.openTable(DATA_STRUCTURES_TABLE, dbConnector);\n Logging.getLOG().debug(\"user requested to get table, table: \" + DATA_STRUCTURES_TABLE);\n return Response.ok(URLEncoder.encode(dataStructuresTable.toJSON(), \"UTF-8\")).build();\n\n } else if (tableName.equals(SOFTWARE_DESIGN_TABLE)) {\n softwareDesignTable = SoftwareDesignTable.openTable(SOFTWARE_DESIGN_TABLE, dbConnector);\n Logging.getLOG().debug(\"user requested to get table, table: \" + SOFTWARE_DESIGN_TABLE);\n return Response.ok(URLEncoder.encode(softwareDesignTable.toJSON(), \"UTF-8\")).build();\n\n } else {\n // if it doesn't return that, then return an error\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(\"Something went wrong\")\n .build();\n }\n }", "@Override\n public java.util.List<Table> getTablesList() {\n return tables_;\n }", "Map<String, String> getCustomMetadata();", "public MetaData getMetaData();", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<ColumnSpecification> metadata();", "protected Map<String, Object> extractSystemMetadataAttrs(SystemMetadata systemMetadata,\n String tableName) {\n\n Map<String, Object> attrMap = new HashMap<String, Object>();\n \n // get seriesId\n Identifier seriesId = systemMetadata.getSeriesId();\n String seriesIdStr = seriesId == null ? null : seriesId.getValue();\n attrMap.put(\"series_id\", seriesIdStr);\n\n // get serial_version\n BigInteger serialVersion = systemMetadata.getSerialVersion();\n String versionStr = serialVersion.toString() == null ? null : serialVersion.toString();\n attrMap.put(\"serial_version\", versionStr);\n\n // get date_uploaded\n Date dateUploaded = systemMetadata.getDateUploaded();\n Timestamp uploadedTime = dateUploaded == null ? null\n : new Timestamp(dateUploaded.getTime());\n attrMap.put(\"date_uploaded\", uploadedTime);\n\n // get rights_holder\n Subject rightsHolder = systemMetadata.getRightsHolder();\n String rightsHolderStr = rightsHolder == null ? null : rightsHolder.getValue();\n attrMap.put(\"rights_holder\", rightsHolderStr);\n\n // get checksum\n Checksum checksum = systemMetadata.getChecksum();\n String checksumStr = checksum == null ? null : checksum.getValue();\n attrMap.put(\"checksum\", checksumStr);\n\n // get checksum_algorithm\n String algorithm = null;\n if (checksum != null) {\n algorithm = checksum.getAlgorithm();\n algorithm = algorithm == null ? null : algorithm;\n\n }\n attrMap.put(\"checksum_algorithm\", algorithm);\n\n // get origin_member_node\n NodeReference originNodeid = systemMetadata.getOriginMemberNode();\n String originNodeidStr = originNodeid == null ? null : originNodeid.getValue();\n attrMap.put(\"origin_member_node\", originNodeidStr);\n\n // get authoritive_member_node\n NodeReference authNodeid = systemMetadata.getAuthoritativeMemberNode();\n String authNodeidStr = authNodeid == null ? null : authNodeid.getValue();\n attrMap.put(\"authoritive_member_node\", authNodeidStr);\n\n // get date_modified\n Date dateModified = systemMetadata.getDateSysMetadataModified();\n Timestamp modTime = dateModified == null ? null : new Timestamp(dateModified.getTime());\n attrMap.put(\"date_modified\", modTime);\n\n // get submitter\n Subject submitter = systemMetadata.getSubmitter();\n String submitterStr = submitter == null ? null : submitter.getValue();\n attrMap.put(\"submitter\", submitterStr);\n\n // get object_format\n ObjectFormatIdentifier formatId = systemMetadata.getFormatId();\n String formatIdStr = formatId == null ? null : formatId.getValue();\n attrMap.put(\"object_format\", formatIdStr);\n\n // get size\n BigInteger size = systemMetadata.getSize();\n String sizeStr = size == null ? null : size.toString();\n attrMap.put(\"size\", sizeStr);\n\n // get archived\n Boolean archived = systemMetadata.getArchived();\n archived = archived == null ? false : archived;\n attrMap.put(\"archived\", archived);\n\n // get replication_allowed\n // get number_replicas\n Boolean replicationAllowed = null;\n Integer numberReplicas = null;\n ReplicationPolicy replicationPolicy = systemMetadata.getReplicationPolicy();\n if (replicationPolicy != null) {\n replicationAllowed = replicationPolicy.getReplicationAllowed();\n replicationAllowed = replicationAllowed == null ? false : replicationAllowed;\n numberReplicas = replicationPolicy.getNumberReplicas();\n replicationAllowed = replicationAllowed == null ? false : replicationAllowed;\n numberReplicas = numberReplicas == null ? -1 : numberReplicas;\n }\n attrMap.put(\"replication_allowed\", replicationAllowed);\n attrMap.put(\"number_replicas\", numberReplicas);\n\n // get obsoletes\n Identifier obsoletes = systemMetadata.getObsoletes();\n String obsoletesStr = obsoletes == null ? null : obsoletes.getValue();\n attrMap.put(\"obsoletes\", obsoletesStr);\n\n // get obsoleted_by\n Identifier obsoletedBy = systemMetadata.getObsoletedBy();\n String obsoletedByStr = obsoletedBy == null ? null : obsoletedBy.getValue();\n attrMap.put(\"obsoleted_by\", obsoletedByStr);\n\n // get guid\n Identifier pid = systemMetadata.getIdentifier();\n String pidStr = pid == null ? null : pid.getValue();\n attrMap.put(\"guid\", pidStr);\n\n return attrMap;\n }", "public void showTableFields(final boolean canEdit) {\n addMetadata.showFields(canEdit);\n addMetadata.setVisible(canEdit);\n dispatch.execute(new ListUserMetadataFields(false), new AsyncCallback<ListUserMetadataFieldsResult>() {\n public void onFailure(Throwable caught) {\n GWT.log(\"Error retrieving available list of User Specified Metadata fields\", caught);\n }\n\n public void onSuccess(ListUserMetadataFieldsResult result) {\n availableFields = result.getFieldsSortedByName();\n GWT.log(\"available fields: \" + availableFields);\n if (availableFields.size() > 0) {\n\n dispatch.execute(new GetUserMetadataFields(uri), new AsyncCallback<GetUserMetadataFieldsResult>() {\n public void onFailure(Throwable caught) {\n GWT.log(\"Error retrieving User Specified Information\", caught);\n }\n\n public void onSuccess(GetUserMetadataFieldsResult result) {\n Set<String> predicates = result.getThingsOrderedByName().keySet();\n if (predicates.size() == 0) {\n addNoFields();\n } else {\n for (String predicate : predicates ) {\n String label = result.getThingNames().get(predicate);\n String description = getDescription(predicate);\n SortedSet<UserMetadataValue> values = NamedThing.orderByName(result.getValues().get(predicate));\n addNewField(predicate, label, description, values, canEdit);\n }\n }\n }\n });\n\n }\n }\n });\n }", "public List<String> tables() {\n return this.tables;\n }", "public TableMetaData getTable(TSConnection conn, TableId tableid) {\n\t\treturn conn.getTable(tableid);\n\t}", "@Override\n public List<String> ListTables() throws IOException {\n\n LOGGER.info(\": {}\", hbaseDmlDao);\n\n// return listTables;\n return null;\n }", "@GET\n @Path( \"/databaseMetadata\" )\n @Produces( { APPLICATION_XML, APPLICATION_JSON } )\n public IDatabaseConnection getDatabaseMetadata() {\n return stagingDatabase.getDatbaseMetadata();\n }", "com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata();", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "public static void displayTable(Connection con, String tableName) throws SQLException \r\n\t{\r\n\t\tStatement st = null;\r\n\t\tResultSet rs = null;\r\n\r\n\t\tst = con.createStatement(); \r\n\r\n\t\trs = st.executeQuery(\"SELECT userID, firstName, lastName, countryCode FROM \" + tableName);\r\n\r\n\t\twhile(rs.next()) {\r\n\t\t\t// can retrieve by position\r\n\t\t\tint userId = rs.getInt(1);\r\n\t\t\t// or by column name \r\n\t\t\tString firstName = rs.getString(\"firstname\");\r\n\t\t\tString lastName = rs.getString(3);\r\n\t\t\tString countryCode = rs.getString(\"countryCode\");\r\n\r\n\t\t\tSystem.out.println(userId + \". \" + lastName + \", \" +\r\n\t\t\t\t\tfirstName + \" (\" + countryCode + \")\");\r\n\t\t}\r\n\r\n\t}", "@Override\n public java.util.List<? extends TableOrBuilder>\n getTablesOrBuilderList() {\n return tables_;\n }", "public String[] getTableSchema(String tableName){\n return tableSchemaMap.get(tableName);\n }", "public int getMetaUsers();", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "String getTableName();", "private String[] getTableFields(String pTableName) {\r\n\t\tString[] returnedValue = null;\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\t\r\n\t\t\tCursor cursor = getDatabse().query(pTableName, null, null, null, null, null, null);\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\treturnedValue = cursor.getColumnNames();\r\n\t\t\t}\r\n\t\t\tcursor.close();\r\n\t\t\tcursor = null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "java.util.List<Table>\n getTablesList();", "public ArrayList getTables(String IRI) throws Exception{\r\n\t\tResultSet rsTable=null;\r\n\t\tResultSet rsColumn=null;\r\n\t\tDatabaseMetaData dbMetaData=null;\r\n\t\tArrayList<TableMetaData> listTableMetaData = new ArrayList<TableMetaData>();\r\n\t\tTableMetaData tmetaData=null;\r\n\t\tHashtable <String,Object> pk;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (IRI.equals(\"IRI_CATALOG_DERBY\")) {\r\n\t\t\t\tdbMetaData=cm.getCatalogMetadata();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tTransactionMonitor tm=TransactionMonitor.getTransactionMonitor();\r\n\t\t\t\tdbMetaData=tm.getDatabaseMetadata(IRI);\r\n\t\t\t}\r\n\t\t\tif (dbMetaData== null){\r\n\t\t\t\tthrow new Exception(\"Could not get Table MetaData\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tString[] table= {\"TABLE\"};\r\n\t\t\t\tString tableName=null,columnName=null;\r\n\t\t\t\tint columnSize,columnIsNull,columnType;\r\n\t\t\t\tboolean isPrimaryKey=false;\r\n\t\t\t\tColumnMetaData colMetaData=null;\r\n\t\t\t\tArrayList<ColumnMetaData> listColumns=new ArrayList<ColumnMetaData>();\r\n\t\t\t\tResultSet rsPrimaryKey=null;\r\n\t\t\t\r\n\t\t\t\trsTable=dbMetaData.getTables(null,null,null,table);\r\n\t\t\t\twhile (rsTable.next()){\r\n\t\t\t\t\ttmetaData=new TableMetaData();\r\n\t\t\t\t\ttableName=rsTable.getString(\"TABLE_NAME\");\r\n\t\t\t\t\ttmetaData.setTableName(tableName);\r\n\t\t\t\t\t\r\n\t\t\t\t\trsPrimaryKey=dbMetaData.getPrimaryKeys(null,null,tableName);\r\n\t\t\t\t\tpk=new Hashtable<String, Object>();\r\n\t\t\t\t\twhile (rsPrimaryKey.next()){\r\n\t\t\t\t\t\tpk.put(rsPrimaryKey.getString(\"COLUMN_NAME\"),null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\trsPrimaryKey.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\trsColumn=dbMetaData.getColumns(null,null,tableName,null);\r\n\t\t\t\t\twhile (rsColumn.next()) {\r\n\t\t\t\t\t\tcolumnName=rsColumn.getString(\"COLUMN_NAME\");\r\n\t\t\t\t\t\tcolumnType=rsColumn.getInt(\"COLUMN_TYPE\");\r\n\t\t\t\t\t\tcolumnSize=rsColumn.getInt(\"COLUMN_SIZE\");\r\n\t\t\t\t\t\tcolumnIsNull=rsColumn.getInt(\"NULLABLE\");\r\n\t\t\t\t\t\tif (pk.containsKey(columnName))\r\n\t\t\t\t\t\t\tisPrimaryKey=true;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tisPrimaryKey=false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcolMetaData=new ColumnMetaData(columnName,columnType,columnSize,columnIsNull,isPrimaryKey);\r\n\t\t\t\t\t\tlistColumns.add(colMetaData);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\trsColumn.close();\r\n\t\t\t\t\ttmetaData.setColumnMetaData(listColumns);\r\n\t\t\t\t\tlistTableMetaData.add(tmetaData);\r\n\t\t\t\t\t}\r\n\t\t\t\trsTable.close();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException sqle) {\r\n\t\t\tthrow new Exception (\"Error while accessing DataBaseMetaData info\"+sqle.getMessage());\r\n\t\t}\r\n\t\tcatch (CatalogException ce){\r\n\t\t\tthrow new Exception (\"Error during acessing catalog from DatabaseMetadata\"+ce.getMessage());\r\n\t\t}\r\n\t\tcatch (TransactionMonitorException tme) {\r\n\t\t\tthrow new Exception (\"Error accessing Transaction Monitor from DatabaseMetadata\"+tme.getMessage());\r\n\t\t}\r\n\t\treturn listTableMetaData;\r\n\t}", "public abstract String [] listTables();", "public String[] getTableNames()\n {\n return tableNames;\n }", "public List<TableMetadata> tables()\n {\n if (version == UNDEFINED) {\n return Collections.emptyList();\n }\n if (version == NOT_FETCHED) {\n synchronized (this) {\n List<TableMetadata> catalogTables = base.tablesForSchema(schema.name());\n for (TableMetadata table : catalogTables) {\n cache.put(table.id().name(), new TableEntry(table));\n }\n }\n }\n List<TableMetadata> orderedTables = new ArrayList<>();\n\n // Get the list of actual tables; excluding any cached \"misses\".\n cache.forEach((k, v) -> {\n if (v.table != null) {\n orderedTables.add(v.table);\n }\n });\n orderedTables.sort((e1, e2) -> e1.id().name().compareTo(e2.id().name()));\n return orderedTables;\n }", "private Tables() {\n\t\tsuper(\"TABLES\", org.jooq.util.mysql.information_schema.InformationSchema.INFORMATION_SCHEMA);\n\t}", "@Override\n\tpublic String getTableName() {\n\t\treturn \"user\";\n\t}", "public void listTables() {\r\n\t\tfor (Table table : tables) {\r\n\t\t\tSystem.out.println(table.getName());\r\n\t\t}\r\n\t}", "public void getArtistsMetaDataFromDevice(){\n // implement a cursorLoader\n ContentResolver resolver = getContentResolver();\n Cursor cursor = resolver.query(MediaStore.Audio.Artists.INTERNAL_CONTENT_URI,null,null,null,MediaStore.Audio.ArtistColumns.ARTIST);\n }", "private void retrieveNewMetadata() {\n\n Runnable loadProviders = new Runnable() {\n @Override\n public void run() {\n getAvailableDataProviders();\n }\n };\n\n Runnable loadDataSets = new Runnable() {\n @Override\n public void run() {\n getAvailableDataSets();\n }\n };\n\n Runnable loadParameters = new Runnable() {\n @Override\n public void run() {\n getAvailableParameters();\n }\n };\n\n Runnable loadLevels = new Runnable() {\n @Override\n public void run() {\n getAvailableLevels();\n }\n };\n\n Runnable[] runnables = new Runnable[] { loadProviders, loadDataSets,\n loadParameters, loadLevels };\n FutureTask<?>[] tasks = new FutureTask[runnables.length];\n ExecutorService executor = Executors\n .newFixedThreadPool(runnables.length);\n for (int i = 0; i < runnables.length; i++) {\n FutureTask<Void> task = new FutureTask<Void>(runnables[i], null);\n tasks[i] = task;\n executor.submit(task);\n }\n\n for (FutureTask<?> task : tasks) {\n try {\n task.get();\n } catch (Exception e) {\n statusHandler.handle(Priority.WARN, \"Unable to load metadata\",\n e);\n }\n }\n }", "protected Map<String, String> getMetaData(Response response) {\r\n\t\tMap<String, String> metadata = new HashMap<String, String>();\r\n Request request = response.getRequest();\r\n\r\n User authUser = request.getActiveUser();\r\n String user = \"?\";\r\n if (authUser != null) {\r\n user = authUser.getUserId();\r\n }\r\n\r\n\t\tmetadata.put(\"user\", encodeValue(user));\r\n\t\tmetadata.put(\"request\", encodeValue(RequestUtil.getRequestURL(request).toString()));\r\n\t\tmetadata.put(\"status\", encodeValue(\"ok\"));\r\n\r\n\r\n\t\tif ( null != request ) {\r\n\t\t\tmetadata.put(\"startTime\", metaDataTimeFormat.format(request.getCreateTime()));\r\n\t\t\tmetadata.put(\"endTime\", metaDataTimeFormat.format(System.currentTimeMillis()));\r\n\t\t}\r\n\r\n\t\treturn metadata;\r\n\t}", "String[] getMetadataNames();", "public WorkspaceUserMetadata getMetadata() {\n\t\treturn meta;\n\t}", "public WorkspaceUserMetadata getMetadata() {\n\t\t\treturn meta;\n\t\t}", "public DataTableCollection tables() {\r\n return _tables;\r\n }", "public ArrayList<Table> getAllTables() {\r\n\t\treturn tables;\r\n\t}", "public List<Map<String, String>> getTable(String tableName) {\n return getTable(tableName, 1, 9999);\n\n }", "List<Map<String, Object>> getTableValuesWithHeaders(TableParameters tableParameters);", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "@RequestMapping(value = \"/data/{srcEnv}/{srcDB}/{pid}\", method = {RequestMethod.GET})\n @ResponseBody\n public RestWrapper getTableData(@PathVariable(\"srcEnv\") String srcEnv, @PathVariable(\"srcDB\") String srcDB, @PathVariable(\"pid\") String pid) {\n RestWrapper restWrapper = null;\n LOGGER.info(srcEnv + \"srcEnvi\");\n LOGGER.info(srcDB + \"srcDB\");\n try {\n Class.forName(driverName);\n connection = DriverManager.getConnection(\"jdbc:hive2://\" + srcEnv + \"/\" + srcDB.toLowerCase(), \"\", \"\");\n String tableName=\"ML_\"+pid;\n ResultSet rs = connection.createStatement().executeQuery(\"select * from \" + srcDB + \".\" + tableName);\n\n ResultSetMetaData metaData = rs.getMetaData();\n List<Map<String, Object>> tables = new ArrayList<Map<String, Object>>();\n while (rs.next()) {\n Map<String,Object> m=new LinkedHashMap<>();\n for(int j=1;j<=metaData.getColumnCount();j++){\n\n String colName = metaData.getColumnLabel(j).replaceFirst(tableName.toLowerCase()+\".\", \"\");\n if(!colName.equals(\"features\") && !colName.equals(\"rawprediction\") && !colName.equals(\"probability\")){\n Object colValue=rs.getObject(j);\n m.put(colName,colValue);}\n }\n tables.add(m);\n }\n restWrapper = new RestWrapper(tables, RestWrapperOptions.OK);\n\n } catch (Exception e) {\n LOGGER.error(\"error occured \" + e);\n restWrapper = new RestWrapper(e.getMessage(), RestWrapper.ERROR);\n }\n return restWrapper;\n }", "public void createTables() throws Exception{\n\t\tcreate_table(\"tab_global\", \"param\", 1);\n\t\t\n\t\tPut put = new Put(Bytes.toBytes(\"row_userid\"));\n\t\tlong id = 0;\n\t\tput.add(Bytes.toBytes(\"param\"), \n\t\t\t\tBytes.toBytes(\"userid\"), \n\t\t\t\tBytes.toBytes(id));\n\t\tHTable ht = new HTable(conf, \"tab_global\");\n\t\tht.put(put);\n\t\t\n\t\tcreate_table(\"tab_user2id\", \"info\", 1);\n\t\tcreate_table(\"tab_id2user\", \"info\", 1);\n\t\t\n\t\t//table_follow\t{userid}\tname:{userid}\n\t\tcreate_table(\"tab_follow\", \"name\", 1);\n\t\t\n\t\t//table_followed\trowkey:{userid}_{userid} CF:userid\n\t\tcreate_table(\"tab_followed\", \"userid\", 1);\n\t\t\n\t\t//tab_post\trowkey:postid\tCF:post:username post:content post:ts\n\t\tcreate_table(\"tab_post\", \"post\", 1);\n\t\tput = new Put(Bytes.toBytes(\"row_postid\"));\n\t\tid = 0;\n\t\tput.add(Bytes.toBytes(\"param\"), \n\t\t\t\tBytes.toBytes(\"postid\"), \n\t\t\t\tBytes.toBytes(id));\n\t\tht.put(put);\n\t\t\n\t\t//tab_inbox\t\trowkey:userid+postid\tCF:postid\n\t\tcreate_table(\"tab_inbox\", \"postid\", 1);\n\t\tht.close();\n\t}", "void setTables(Object tables);", "public Collection getTables(String serviceProviderCode, String callerID) throws AAException, RemoteException;", "public ResultSet getAll(String tableName)\n {\n\n String selectStr;\n ResultSet rs=null;\n\n try{\n\n selectStr=\"SELECT * FROM \"+tableName;\n rs = stmt.executeQuery(selectStr);\n\n\n\n\n\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return rs;\n }", "public void getComponents(DatabaseMetaData meta) throws SQLException {\n String[] types = {\"TABLE\"};\n ResultSet rs = meta.getTables(null, null, null, types);\n while(rs.next()){\n Table t = new MysqlTable(rs.getString(\"TABLE_NAME\"), rs.getString(\"TABLE_TYPE\"));\n //t.getComponents(meta);\n this.setTables(t);\n }\n try{\n rs.close();\n } catch (Exception ignored){\n } finally { rs.close(); /*Anyway*/ }\n }", "@Override\n\tpublic void getFields(List<String> table) {\n\t\t\n\t}", "@Override\n protected AdqlValidator.ValidatorTable[] getExtraTables() {\n TopcatModel[] tcModels = getTopcatModels();\n List<AdqlValidator.ValidatorTable> vtList =\n new ArrayList<AdqlValidator.ValidatorTable>();\n for ( int it = 0; it < tcModels.length; it++ ) {\n TopcatModel tcModel = tcModels[ it ];\n String[] aliases = getUploadAliases( tcModel );\n for ( int ia = 0; ia < aliases.length; ia++ ) {\n String tname = \"TAP_UPLOAD.\" + aliases[ ia ];\n vtList.add( toValidatorTable( tcModel, tname ) );\n }\n }\n return vtList.toArray( new AdqlValidator.ValidatorTable[ 0 ] );\n }", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic ArrayList<TableColumnsInfo> getColumnsInfo(\n\t\t\tArrayList<String> arrTblNames) {\n\t\tArrayList<TableColumnsInfo> tableColumnsInfoArray = new ArrayList<TableColumnsInfo>();\n\t\tif (arrTblNames.size() == 0)\n\t\t\treturn tableColumnsInfoArray;\n\n\t\tfor (int j = 0; j < arrTblNames.size(); j++) {\n\t\t\tString tblName = arrTblNames.get(j);\n\t\t\tString[] columnNames;\n\n\t\t\tCursor c = ourDatabase.rawQuery(\"SELECT * FROM \" + tblName\n\t\t\t\t\t+ \" WHERE 0\", null);\n\t\t\ttry {\n\t\t\t\tcolumnNames = c.getColumnNames();\n\t\t\t} finally {\n\t\t\t\tc.close();\n\t\t\t}\n\n\t\t\t// SQLiteDatabase db = ourHelper.getWritableDatabase();\n\t\t\tCursor cursor = ourDatabase.rawQuery(\"PRAGMA table_info(\" + tblName\n\t\t\t\t\t+ \")\", null);\n\t\t\tcursor.moveToFirst();\n\t\t\tArrayList<ColumnInfo> colInfoArray = new ArrayList<DatabasesInterface.ColumnInfo>();\n\t\t\twhile (!cursor.isAfterLast()) {\n\t\t\t\ttry {\n\t\t\t\t\tint nameIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[0]);\n\t\t\t\t\tint typeIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[1]);\n\t\t\t\t\tint notNullIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[2]);\n\t\t\t\t\tint dfltValueIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[3]);\n\t\t\t\t\tint primaryKeyIdx = cursor\n\t\t\t\t\t\t\t.getColumnIndexOrThrow(sqliteColumnsInfoNames[4]);\n\n\t\t\t\t\tString name = cursor.getString(nameIdx);\n\t\t\t\t\tString type = cursor.getString(typeIdx);\n\t\t\t\t\tint notNull = cursor.getInt(notNullIdx);\n\t\t\t\t\tString dfltValue = cursor.getString(dfltValueIdx);\n\t\t\t\t\tint primaryKey = cursor.getInt(primaryKeyIdx);\n\n\t\t\t\t\tColumnInfo colInfo = new ColumnInfo(name, type, notNull,\n\t\t\t\t\t\t\tdfltValue, primaryKey);\n\t\t\t\t\tcolInfoArray.add(colInfo);\n\t\t\t\t} finally {\n\t\t\t\t\tcursor.moveToNext();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcursor.close();\n\t\t\tTableColumnsInfo tblInfo = new TableColumnsInfo(tblName,\n\t\t\t\t\tcolInfoArray);\n\t\t\ttableColumnsInfoArray.add(tblInfo);\n\t\t}\n\t\treturn tableColumnsInfoArray;\n\n\t}", "List<Map<String, Object>> getTableValuesWithHeaders();", "java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();", "java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();", "public abstract Object getMetadata(String key);", "public ResultSet getAllDemographyInfo () throws Exception {\r\n String sql = \"SELECT * FROM public.demographyinfo ORDER BY user;\";\r\n return stmt.executeQuery(sql);\r\n }", "public static Hashtable<String, Vector<String>> getMetaData3(String tablename) {\n\t\tHashtable<String, Vector<String>> temp = new Hashtable<String, Vector<String>>();\n\t\tBufferedReader fileReader = null;\n\t\tString[] array;\n\n\t\ttry {\n\t\t\tString l = \"\";\n\t\t\tfileReader = new BufferedReader(new FileReader(\"src/main/resources/metadata.csv\"));\n\t\t\twhile ((l = fileReader.readLine()) != null) {\n\t\t\t\tVector<String> v = new Vector<>();\n\t\t\t\tarray = l.split(\",\");\n\t\t\t\tif (array[0].equals(tablename)) {\n\t\t\t\t\tv.add(array[5]);\n\t\t\t\t\tv.add(array[6]);\n\t\t\t\t\ttemp.put(array[1], v);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.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\t\treturn temp;\n\t}", "private void dumpMeta(TableName tableName) throws IOException {\n List<byte[]> metaRows = TEST_UTIL.getMetaTableRows(tableName);\n for (byte[] row : metaRows) {\n LOG.info(Bytes.toString(row));\n }\n }", "public ArrayList<Table> getTables(String schema) {\r\n try {\r\n Statement stmt = conexion.createStatement();\r\n String sql;\r\n sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '\" + schema + \"'\";\r\n ResultSet rs = stmt.executeQuery(sql);\r\n ArrayList<Table> tables = new ArrayList();\r\n while (rs.next()) {\r\n Table_Base table = new Table_Base();\r\n table.setTitle(rs.getString(3));//TABLE_NAME\r\n table.setDescription(rs.getString(21));//TABLE_COMMENT\r\n System.out.println(\"isuued table.. \"+rs.getString(15)+\"/\"+rs.getString(3));\r\n table.setIssued(rs.getString(15));//CREATE_TIME\r\n if(rs.getString(16) != null){\r\n table.setModified(rs.getString(16));//UPDATE_TIME\r\n \r\n }else\r\n {\r\n table.setModified(\"\");//UPDATE_TIME\r\n \r\n }\r\n table.setMediaType(\"application/sql\");\r\n table.setFormat(\"application/sql\");\r\n table.setByteSize(getByteSizeDBTable(rs.getString(10), rs.getString(12)));\r\n table.setCharacterSet(getCharacterSetTableDB(schema, rs.getString(3)));\r\n table.setDefaultDecimalSeparator(\".\");//default standard mysql\r\n table.setOverrallRecordCount(rs.getString(8));\r\n ArrayList<Column> columns = getColumns(schema, table.getTitle());\r\n table.setColumnas(columns);\r\n tables.add(table);\r\n }\r\n return tables;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(DAOBaseDatos.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n\r\n }", "@Override\n public List<Complex> findAllMetaData() throws PersistentException {\n ComplexDao complexDao = transaction.createDao(ComplexDao.class);\n List<Complex> complexes = complexDao.readComplex();\n readTrainerLogin(complexes);\n readVisitorLogin(complexes);\n return complexes;\n }", "private void get_tables_from_db() {\n\t\t\n\t\tDBUtils dbu = new DBUtils(this, MainActv.dbName);\n\t\t\n\t\tSQLiteDatabase rdb = dbu.getReadableDatabase();\n\n\t\t// Log\n\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \"]\", \"rdb.getPath(): \" + rdb.getPath());\n\t\t\n\t\t\n\t\t// REF=> http://stackoverflow.com/questions/82875/how-do-i-list-the-tables-in-a-sqlite-database-file\n\t\tString sql = \"SELECT * FROM sqlite_master WHERE type='table'\";\n\t\t\n\t\tCursor c = rdb.rawQuery(sql, null);\n\t\t\n\t\tstartManagingCursor(c);\n\t\t\n\t\t// Log\n\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \"]\", \"Tables: c.getCount()\" + c.getCount());\n\t\t\n\t\tc.moveToFirst();\n\t\t\n\t\tfor (int i = 0; i < c.getCount(); i++) {\n\t\t\t\n\t\t\t// Log\n\t\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"name: \" + c.getString(1));\n\t\t\t\n\t\t\tc.moveToNext();\n\t\t\t\n\t\t}//for (int i = 0; i < c.getCount(); i++)\n\t\t\n\t\trdb.close();\n\t\t\n\t}", "private JSObject getTableColumnNamesTypes(SQLiteDatabase db, String tableName) throws JSONException {\n JSObject ret = new JSObject();\n ArrayList<String> names = new ArrayList<String>();\n ArrayList<String> types = new ArrayList<String>();\n String query = new StringBuilder(\"PRAGMA table_info(\").append(tableName).append(\");\").toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n List<JSObject> lQuery = resQuery.toList();\n if (resQuery.length() > 0) {\n for (JSObject obj : lQuery) {\n names.add(obj.getString(\"name\"));\n types.add(obj.getString(\"type\"));\n }\n ret.put(\"names\", names);\n ret.put(\"types\", types);\n }\n return ret;\n }", "@Override\n public Object getTables(Long serverId, String statementExample)\n {\n return null;\n }", "protected List<Map<String, Object>> show() {\n List<Map<String, Object>> output = new ArrayList<>();\n try {\n ResultSet rs;\n try (PreparedStatement stmt = DBConnect.getConnection()\n .prepareStatement(String.format(\"SELECT * FROM %s WHERE userID = ?\", table))) {\n stmt.setLong(1, userId);\n rs = stmt.executeQuery();\n }\n output = DBConnect.resultsList(rs);\n rs.close();\n DBConnect.close();\n } catch (SQLException e) {\n Logger.getLogger(DBConnect.class.getName()).log(Level.SEVERE, \"Failed select\", e);\n }\n return output;\n }", "public String[] getTableList() {\n\t\treturn adapter.getTableList(adapter.queryToArray());\n\t}", "public HashMap getMetaData() ;", "private void initTables() {\n insert(\"CREATE TABLE IF NOT EXISTS `player_info` (`player` VARCHAR(64) PRIMARY KEY NOT NULL, `json` LONGTEXT)\");\n }", "@Override\n\tpublic ArrayList<String> getTablesNames() {\n\t\tArrayList<String> arrTblNames = new ArrayList<String>();\n\t\tCursor c = ourDatabase.rawQuery(\n\t\t\t\t\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n\t\tif (c.moveToFirst()) {\n\t\t\twhile (!c.isAfterLast()) {\n\t\t\t\tarrTblNames.add(c.getString(c.getColumnIndex(\"name\")));\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t}\n\t\treturn arrTblNames;\n\t}", "@SneakyThrows\n public List<Map<String, String>> getTable(String tableName, int page, int pageSize) {\n try (CloseableHttpClient client = HttpClientBuilder.create()\n .setDefaultRequestConfig(getRequestConfig())\n .build()) {\n String url = KodexaPlatform.getUrl() + \"/api/stores/\" + ref.replace(\":\", \"/\") + \"/rows\";\n log.info(\"Connecting to [\" + url + \"]\");\n\n URIBuilder builder = new URIBuilder(url);\n builder.setParameter(\"page\", String.valueOf(page)).setParameter(\"pageSize\", String.valueOf(pageSize)).setParameter(\"table\", tableName);\n\n HttpGet httpGet = new HttpGet(builder.build());\n httpGet.addHeader(\"x-access-token\", KodexaPlatform.getAccessToken());\n\n HttpResponse response = client.execute(httpGet);\n\n if (response.getStatusLine().getStatusCode() != 200) {\n throw new KodexaException(\"Unable to create a session, check your access token and URL [\" + response.getStatusLine().getStatusCode() + \"]\");\n }\n\n String responseJson = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);\n Page<StoredRow> rowPage = jsonOm.readValue(responseJson, new TypeReference<Page<StoredRow>>() {\n });\n\n return rowPage.getContent().stream().map(StoredRow::getData).collect(Collectors.toList());\n\n\n } catch (IOException e) {\n throw new KodexaException(\"Unable to create a session on Kodexa\", e);\n }\n }", "public TapTable findOneTable(String tableName);", "public TableInfo getTableInfo() {\r\n\t\treturn ti;\r\n\t}", "public String[] getTableNames(SQLiteDatabase db) {\n Cursor c = db.rawQuery(\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n List<String> list = new ArrayList<>();\n if (c.moveToFirst()) {\n do {\n String table = c.getString(0);\n if (!PRIVATE_TABLE_NAMES.contains(table)) {\n list.add(table);\n }\n } while (c.moveToNext());\n }\n c.close();\n return list.toArray(new String[list.size()]);\n }", "public List<String> getTableNames() throws IOException {\n List<String> tableList = new ArrayList<String>();\n TableName[] tableNames = hBaseAdmin.listTableNames();\n for (TableName tableName : tableNames) {\n //if (pattern.matcher(tableName.toString()).find()) {\n tableList.add(tableName.toString());\n //}\n }\n return tableList;\n }", "public static Map<String, String> getTableMap() {\n return tableMap;\n }", "private Map<String, AttributeInfo> getUserSchemaMap() {\n if (userSchemaMap == null) {\n schema();\n }\n return userSchemaMap;\n }", "Map<String,QualitativeJSONTableModel> getQualitativeData(OAuth2Authentication oauth);", "private HashMap<Long, String> getTable() {\n return table;\n }", "private void getMetadata() {\n masterRoot = AbstractMetadata.getAbstractedMetadata(sourceProduct);\n masterMetadata = new MetadataDoris(masterRoot);\n masterOrbit = new OrbitsDoris();\n masterOrbit.setOrbit(masterRoot);\n \n // SLAVE METADATA\n // hash table or just map for slaves - now it supports only a single sourceSlave image\n slaveRoot = sourceProduct.getMetadataRoot().getElement(AbstractMetadata.SLAVE_METADATA_ROOT).getElementAt(0);\n slaveMetadata = new MetadataDoris(slaveRoot);\n slaveOrbit = new OrbitsDoris();\n slaveOrbit.setOrbit(slaveRoot);\n }", "public HTableDescriptor[] listTables() throws IOException {\n return getAdmin().listTables();\n }" ]
[ "0.64158714", "0.601656", "0.58934593", "0.5837652", "0.57758844", "0.5603615", "0.5524146", "0.5335439", "0.52740157", "0.51767653", "0.5175336", "0.5147729", "0.5125018", "0.5118521", "0.51141125", "0.51131123", "0.5107667", "0.51004833", "0.50887954", "0.50763327", "0.50689894", "0.50658554", "0.50484914", "0.5045261", "0.504335", "0.5038258", "0.5031863", "0.5018724", "0.50181216", "0.5005102", "0.49950653", "0.49864736", "0.49573192", "0.49494764", "0.49445635", "0.49399728", "0.49308053", "0.49284714", "0.49196917", "0.49174425", "0.4911193", "0.49086282", "0.48914003", "0.4889989", "0.488984", "0.48877156", "0.4879263", "0.48775503", "0.48773435", "0.4874705", "0.48615277", "0.4852086", "0.48519", "0.48424664", "0.48282915", "0.4825858", "0.4825212", "0.48156834", "0.4804306", "0.47999632", "0.47950202", "0.47853947", "0.47710347", "0.47611886", "0.4758254", "0.47547466", "0.47543246", "0.4750922", "0.4744584", "0.47442725", "0.47434995", "0.47412995", "0.4734172", "0.47329876", "0.47329876", "0.47294495", "0.4723595", "0.4716504", "0.4710997", "0.4709781", "0.4709636", "0.46951205", "0.4692517", "0.46909988", "0.4682302", "0.46808228", "0.46744725", "0.46693012", "0.46681458", "0.46457228", "0.46413714", "0.46355277", "0.46332863", "0.46252328", "0.46219656", "0.4620587", "0.4620094", "0.461845", "0.46114752", "0.46061563" ]
0.6209229
1
Gets names of the tables whose type matches the given criteria. Each table has a particular type. This type is made out of the type label, schema of the table, and the semantic type of the table. This function allows a look up of the existing tables based on full or partial type information. The operation is synchronous.
public ShowTablesByTypeResponse showTablesByType(ShowTablesByTypeRequest request) throws GPUdbException { ShowTablesByTypeResponse actualResponse_ = new ShowTablesByTypeResponse(); submitRequest("/show/tables/bytype", request, actualResponse_, false); return actualResponse_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract DataSet getTablesByType(String catalog, String schema,\r\n String pattern, String type)\r\n throws Exception;", "@Override\n\tpublic ResultSet getTables(String catalog, String schemaPattern,\n\t\t\tString tableNamePattern, String[] types) throws SQLException {\n\t\t\n\t\tPreparedStatement ps = con.prepareStatement(\"SELECT tbl_name FROM sqlite_master WHERE tbl_name = ?\");\n\t\tps.setString(1, tableNamePattern);\n\t\tResultSet rs = ps.executeQuery();\n\t\t\n\t\treturn rs;\n\t}", "public Set<Class<? extends RealmModel>> getDBTableTypes(){\n try {\n if (this.realmConfiguration == null) {\n this.realmConfiguration = DatabaseUtilities\n .buildRealmConfig(context, null, null, null);\n }\n } catch (Exception e){\n e.printStackTrace();\n }\n\n if(realmConfiguration == null){\n return null;\n }\n return realmConfiguration.getRealmObjectClasses();\n }", "private List<Table> getTableFromStringTableName(String tableName) throws HyracksDataException {\n\n // Get all the tables\n if (generateAllTables) {\n // Remove the DBGEN_VERSION table and all children tables, parent tables will generate them\n return Table.getBaseTables().stream()\n .filter(table -> !table.equals(Table.DBGEN_VERSION) && !table.isChild())\n .collect(Collectors.toList());\n }\n\n // Search for the table\n List<Table> matchedTables = Table.getBaseTables().stream()\n .filter(table -> tableName.equalsIgnoreCase(table.getName())).collect(Collectors.toList());\n\n // Ensure the table was found\n if (matchedTables.isEmpty()) {\n throw new RuntimeDataException(ErrorCode.TPCDS_INVALID_TABLE_NAME, getFunctionIdentifier().getName(),\n tableName);\n }\n\n return matchedTables;\n }", "public static ColumnData listTables(File home, String catalog, String schemaPattern, String tableNamePattern, String[] types) {\n Column[] columns = {new Column(\"Table1\"), new Column(\"Table2\"), new Column(\"Table3\"), new Column(\"Table4\")};\n Data data = new Data(columns);\n CSVFileFilter ff = new CSVFileFilter();\n for (String type : types) {\n if (type.equalsIgnoreCase(\"table\")) {\n for (File f : home.listFiles((FileFilter) ff)) {\n String name = f.getName();\n String tableName = name.substring(0, name.length() - 4);\n data.add(new String[]{tableName, tableName, tableName, tableName});\n }\n } else if (type.equalsIgnoreCase(\"view\")) {\n for (File f : home.listFiles(new SqlQueryFileFilter())) {\n String name = f.getName();\n String tableName = name.substring(0, name.length() - 4);\n data.add(new String[]{tableName, tableName, tableName, tableName});\n }\n }\n }\n return data;\n }", "public abstract DataSet getTablesByType(InputStream inputSteam,\r\n String name, String pattern, String type)\r\n throws Exception;", "private JSObject getTableColumnNamesTypes(SQLiteDatabase db, String tableName) throws JSONException {\n JSObject ret = new JSObject();\n ArrayList<String> names = new ArrayList<String>();\n ArrayList<String> types = new ArrayList<String>();\n String query = new StringBuilder(\"PRAGMA table_info(\").append(tableName).append(\");\").toString();\n JSArray resQuery = this.selectSQL(db, query, new ArrayList<String>());\n List<JSObject> lQuery = resQuery.toList();\n if (resQuery.length() > 0) {\n for (JSObject obj : lQuery) {\n names.add(obj.getString(\"name\"));\n types.add(obj.getString(\"type\"));\n }\n ret.put(\"names\", names);\n ret.put(\"types\", types);\n }\n return ret;\n }", "Object getTables();", "public List<String> get_table_names() {\n LinkedList<String> res = new LinkedList<>();\n\n //the table name information is stored in sqlite_master\n ResultSet resultSet = execute_statement(\"SELECT name FROM sqlite_master WHERE type='table'\" +\n \"AND name <> 'sqlite_sequence' AND name <> 'relationship'\", true);\n\n try {\n while (resultSet.next()) {\n res.add(resultSet.getString(1));\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return res;\n }", "public List<String> getTableTypes()\r\n throws Exception\r\n {\r\n List<String> list = new ArrayList<String>();\r\n \r\n list.add(TYPE_TABLES);\r\n \r\n return list;\r\n }", "private List<Table> getTables() {\n List<Table> tables = new ArrayList<>();\n\n DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n Query query = new Query(\"Table\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n String firstName = (String) entity.getProperty(\"firstName\");\n String lastName = (String) entity.getProperty(\"lastName\");\n String email = (String) entity.getProperty(\"email\");\n String phoneNumber = (String) entity.getProperty(\"phoneNumber\");\n String restName = (String) entity.getProperty(\"restName\");\n String restAdd = (String) entity.getProperty(\"restAdd\");\n String restDescrip = (String) entity.getProperty(\"restDescrip\");\n String dateTime = (String) entity.getProperty(\"dateTime\");\n String maxSize = (String) entity.getProperty(\"maxSize\");\n String otherNotes = (String) entity.getProperty(\"otherNotes\");\n List members = (List) entity.getProperty(\"members\");\n double lat = (double) entity.getProperty(\"lat\");\n double lng = (double) entity.getProperty(\"lng\");\n\n\n \n\n Table table = new Table(firstName, lastName, email, phoneNumber, restName, restAdd, restDescrip, dateTime, maxSize, otherNotes, members, lat, lng);\n tables.add(table);\n }\n return tables;\n }", "public Collection<TapTable> findAllTables();", "private String[] getTables() {\r\n\t\tString[] returnedValue = null;\r\n\t\tList<String> tablesList = new ArrayList<String>();\r\n\t\t\r\n\t\tif (getDatabse() != null && getDatabse().isOpen()) {\r\n\t\t\tCursor cursor = getDatabse().rawQuery(\"SELECT DISTINCT tbl_name FROM sqlite_master\", null);\r\n\t\t\tif (cursor != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcursor.moveToLast();\r\n\t\t\t\t\tcursor.moveToFirst();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (cursor.getCount() > 0) {\r\n\t\t\t\t\t\tdo{\r\n\t\t\t\t\t\t\tString tableName = cursor.getString(0);\r\n\t\t\t\t\t\t\tif (tableName != null && tableName.trim() != \"\") {\r\n\t\t\t\t\t\t\t\tif (!tableName.trim().toLowerCase().equals(\"android_metadata\") &&\r\n\t\t\t\t\t\t\t\t\t!tableName.trim().toLowerCase().equals(\"sqlite_sequence\")) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttablesList.add(tableName);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} while(cursor.moveToNext());\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tcursor.close();\r\n\t\t\t\t\tcursor = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (tablesList.size() > 0) {\r\n\t\t\treturnedValue = tablesList.toArray(new String[tablesList.size()]);\r\n\t\t}\r\n\t\ttablesList.clear();\r\n\t\ttablesList = null;\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}", "public List<? extends BeanType<?>> beanTypes(String tableName) {\n return tableToDescMap.get(tableName.toLowerCase());\n }", "@Override\n\tpublic ArrayList<String> getTablesNames() {\n\t\tArrayList<String> arrTblNames = new ArrayList<String>();\n\t\tCursor c = ourDatabase.rawQuery(\n\t\t\t\t\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n\t\tif (c.moveToFirst()) {\n\t\t\twhile (!c.isAfterLast()) {\n\t\t\t\tarrTblNames.add(c.getString(c.getColumnIndex(\"name\")));\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t}\n\t\treturn arrTblNames;\n\t}", "public List<String> getTableNames() {\r\n\t\tList<String> TBL_LIST = new ArrayList<String>();\r\n\t\tConnection con = null;\r\n\t\tString sql = \"select LOGIC_TBL_NM from TBL_DTL\";\r\n\t\ttry {\r\n\r\n\t\t\tcon = ConnectionMgt.getConnectionObject();\r\n\t\t\tsql = \"select * from tbl_dtl order by PHYS_TBL_NM\";\r\n\t\t\tPreparedStatement stmt = null;\r\n\t\t\tstmt = con.prepareStatement(sql);\r\n\t\t\tResultSet rst = stmt.executeQuery();\r\n\t\t\twhile (rst.next()) {\r\n\t\t\t\tTBL_LIST.add(rst.getString(\"LOGIC_TBL_NM\"));\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException 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 TBL_LIST;\r\n\r\n\t}", "public List<String> getTableNames() throws IOException {\n List<String> tableList = new ArrayList<String>();\n TableName[] tableNames = hBaseAdmin.listTableNames();\n for (TableName tableName : tableNames) {\n //if (pattern.matcher(tableName.toString()).find()) {\n tableList.add(tableName.toString());\n //}\n }\n return tableList;\n }", "String getTableName(String name);", "private void get_tables_from_db() {\n\t\t\n\t\tDBUtils dbu = new DBUtils(this, MainActv.dbName);\n\t\t\n\t\tSQLiteDatabase rdb = dbu.getReadableDatabase();\n\n\t\t// Log\n\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \"]\", \"rdb.getPath(): \" + rdb.getPath());\n\t\t\n\t\t\n\t\t// REF=> http://stackoverflow.com/questions/82875/how-do-i-list-the-tables-in-a-sqlite-database-file\n\t\tString sql = \"SELECT * FROM sqlite_master WHERE type='table'\";\n\t\t\n\t\tCursor c = rdb.rawQuery(sql, null);\n\t\t\n\t\tstartManagingCursor(c);\n\t\t\n\t\t// Log\n\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \"]\", \"Tables: c.getCount()\" + c.getCount());\n\t\t\n\t\tc.moveToFirst();\n\t\t\n\t\tfor (int i = 0; i < c.getCount(); i++) {\n\t\t\t\n\t\t\t// Log\n\t\t\tLog.d(\"TNActv.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"name: \" + c.getString(1));\n\t\t\t\n\t\t\tc.moveToNext();\n\t\t\t\n\t\t}//for (int i = 0; i < c.getCount(); i++)\n\t\t\n\t\trdb.close();\n\t\t\n\t}", "public ArrayList<Table> getTables(String schema) {\r\n try {\r\n Statement stmt = conexion.createStatement();\r\n String sql;\r\n sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '\" + schema + \"'\";\r\n ResultSet rs = stmt.executeQuery(sql);\r\n ArrayList<Table> tables = new ArrayList();\r\n while (rs.next()) {\r\n Table_Base table = new Table_Base();\r\n table.setTitle(rs.getString(3));//TABLE_NAME\r\n table.setDescription(rs.getString(21));//TABLE_COMMENT\r\n System.out.println(\"isuued table.. \"+rs.getString(15)+\"/\"+rs.getString(3));\r\n table.setIssued(rs.getString(15));//CREATE_TIME\r\n if(rs.getString(16) != null){\r\n table.setModified(rs.getString(16));//UPDATE_TIME\r\n \r\n }else\r\n {\r\n table.setModified(\"\");//UPDATE_TIME\r\n \r\n }\r\n table.setMediaType(\"application/sql\");\r\n table.setFormat(\"application/sql\");\r\n table.setByteSize(getByteSizeDBTable(rs.getString(10), rs.getString(12)));\r\n table.setCharacterSet(getCharacterSetTableDB(schema, rs.getString(3)));\r\n table.setDefaultDecimalSeparator(\".\");//default standard mysql\r\n table.setOverrallRecordCount(rs.getString(8));\r\n ArrayList<Column> columns = getColumns(schema, table.getTitle());\r\n table.setColumnas(columns);\r\n tables.add(table);\r\n }\r\n return tables;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(DAOBaseDatos.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n\r\n }", "private ArrayList<String> getJoinedAttributeTypes(List<Table> tables) {\n\t\tArrayList<String> rtn = new ArrayList<String>(); \n\n\t\ttry {\n\t\t\tfor(int iterator = 0; iterator < tables.size(); iterator++) {\n\t\t\t\tTable table = tables.get(iterator);\n\t\t\t\tFile root = new File(\"src\");\n\t\t\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { root.toURI().toURL() });\n\t\t\t\tClass<?> cl = Class.forName(table.getName(), true, classLoader);\n\t\t\t\t\n\t\t\t\tField fields[] = cl.getDeclaredFields();\n\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\tField field = fields[i];\n\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\trtn.add(field.getType().getName());\n\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (MalformedURLException e)\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn rtn;\n\t}", "java.util.List<Table>\n getTablesList();", "public TapTable findOneTable(String tableName);", "public void extractTableNames(ResultSet rs) {\n\t\ttry {\n\t\t\tif(rs.first())\n\t\t\t\tfor(rs.first(); !rs.isAfterLast(); rs.next()) \n\t\t\t\t\t_tables.add(rs.getString(1));\n\t\t} catch (SQLException e) { _error = true; }\n\t}", "public String[] getTableNames(SQLiteDatabase db) {\n Cursor c = db.rawQuery(\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n List<String> list = new ArrayList<>();\n if (c.moveToFirst()) {\n do {\n String table = c.getString(0);\n if (!PRIVATE_TABLE_NAMES.contains(table)) {\n list.add(table);\n }\n } while (c.moveToNext());\n }\n c.close();\n return list.toArray(new String[list.size()]);\n }", "protected List<LogicalTable> getTablesInvolved( LogicalModel model, List<Selection> selections,\n List<Constraint> conditions, List<Order> orderBy, Map<Constraint, SqlOpenFormula> constraintFormulaMap,\n Map<String, Object> parameters, boolean genAsPreparedStatement, DatabaseMeta databaseMeta, String locale,\n Constraint securityConstraint ) {\n Set<LogicalTable> treeSet = new TreeSet<LogicalTable>();\n\n // Figure out which tables are involved in the SELECT\n //\n for ( Selection selection : selections ) {\n // We need to figure out which tables are involved in the formula.\n // This could simply be the parent table, but it could also be another one too.\n //\n // If we want to know all the tables involved in the query, we need to parse all the formula first\n // TODO: We re-use the static method below, maybe there is a better way to clean this up a bit.\n //\n\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, selection, null, parameters, genAsPreparedStatement, databaseMeta, locale );\n\n // Add the involved tables to the list...\n //\n for ( LogicalTable businessTable : sqlAndTables.getUsedTables() ) {\n treeSet.add( businessTable );\n }\n }\n\n // Figure out which tables are involved in the WHERE\n //\n for ( Constraint condition : conditions ) {\n SqlOpenFormula formula = constraintFormulaMap.get( condition );\n List<Selection> cols = formula.getSelections();\n for ( Selection selection : cols ) {\n LogicalTable businessTable = selection.getLogicalColumn().getLogicalTable();\n treeSet.add( businessTable );\n }\n }\n\n // Figure out which tables are involved in the ORDER BY\n //\n for ( Order order : orderBy ) {\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, order.getSelection(), null, parameters, genAsPreparedStatement, databaseMeta,\n locale );\n\n // Add the involved tables to the list...\n //\n for ( LogicalTable businessTable : sqlAndTables.getUsedTables() ) {\n treeSet.add( businessTable );\n }\n }\n\n // find any tables listed in the security constraint\n\n if ( securityConstraint != null ) {\n SqlOpenFormula formula = constraintFormulaMap.get( securityConstraint );\n\n List<Selection> cols = formula.getSelections();\n for ( Selection selection : cols ) {\n treeSet.add( selection.getLogicalColumn().getLogicalTable() );\n }\n }\n\n return new ArrayList<LogicalTable>( treeSet );\n }", "public abstract Map<String, Integer> getColumnTypes(String tableName);", "List<Type> getTypeList(String type);", "public abstract String [] listTables();", "protected void createTableForEntityType(String type) throws SQLException {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tsb.append(\"CREATE TABLE \") // LOCAL TEMPORARY \n\t\t\t.append(getTableNameForEntityType(type))\n\t\t\t.append(\" (\");\n\t\t\n\t\tsb.append(\"id VARCHAR(50) PRIMARY KEY\"); // TODO maybe 30 is not enough?\n\t\t\n\t\tfor (Attribute<? extends IValue> a: entityType2attributes.get(type)) {\n\t\t\tsb.append(\", \");\n\t\t\t\n\t\t\t// colname\n\t\t\tsb.append(getAttributeColNameForType(type, a));\n\t\t\tsb.append(\" \");\n\t\t\t\n\t\t\t// type\n\t\t\tsb.append(getSQLTypeForAttribute(a));\n\t\t\tsb.append(\" \");\n\t\t\t\n\t\t}\n\t\tsb.append(\")\");\n\t\tfinal String qry = sb.toString();\n\t\t\n\t\t// execute \n\t\tlogger.info(\"creating table for type {} with SQL query: {}\", type, qry);\n\t\tStatement s = connection.createStatement();\t\t\t\t\n\t\ts.execute(qry);\n\t\ts.close();\n\t\t\n\t\t// create indexes\n\t\tSet<String> setIndex = new HashSet<>();\n\t\ttable2createdIndex.put(getTableNameForEntityType(type), setIndex);\n\t\t\n\t\tStatement s2 = connection.createStatement();\t\t\t\t\n\t\tfor (Attribute<? extends IValue> a: entityType2attributes.get(type)) {\n \n\t\t\tsb = new StringBuffer();\n\t\t\tsb.append(\"CREATE INDEX idx_\")\n\t\t\t\t.append(getTableNameForEntityType(type))\n\t\t\t\t.append(\"_\")\n\t\t\t\t.append(getAttributeColNameForType(type, a));\n\t\t\tsb.append(\" ON \");\n\t\t\tsb.append(getTableNameForEntityType(type));\n\t\t\tsb.append(\" (\");\n\t\t\tsb.append(getAttributeColNameForType(type, a));\n\t\t\tsb.append(\")\");\n\t\t\ts2.execute(sb.toString());\n\t\t\t\n\t\t\tsetIndex.add(getAttributeColNameForType(type, a));\n\t\t}\n\t\ts2.close();\n\t}", "protected abstract TableName getTableNameByConvention(Class<?> beanClass);", "List<ReportType> findTypes();", "private Map<String, Integer> getUserTableTypeMetaData(Connection conn, String name) throws SQLException{\n\t\t\n\t\tMap<String, Integer> colNameType = new HashMap<String, Integer>();\n\t\tPreparedStatement preparedStatement = conn.prepareStatement(TestCDTAnyDB.USER_TABLE_TYPE_QUERY);\n\t\tpreparedStatement.setString(1, name);\n\t\tResultSet rs = preparedStatement.executeQuery();\n\n\t while (rs.next()) {\n\t String colName = rs.getString(\"name\");\n\t String colType = rs.getString(\"type\");\n\t if (TYPE_MAPPING.get(colType) == null ) {\n\t \tLOG.error(\"SQL Server type \" + colType + \" hasn't been mapped in JDBC types \");\n\t \t//throw new Exception(\"wsef\");\n\t }\n\t colNameType.put(colName, TYPE_MAPPING.get(colType));\n\t }\n\t \n\t return colNameType;\t \n\t}", "Table getTables(int index);", "String getTableName();", "@SuppressWarnings(\"unchecked\")\n \t@Override\n public List<SysTableKind> getFullSysTableKind(String orgCode){\n \tString hql = \"from \" + this.getPersistentClass().getSimpleName() + \"\";\t\n\t\thql += \" ORDER BY sn ASC\";\n\t\tList<SysTableKind> sysTableKinds = this.getHibernateTemplate().find( hql);\n\t\treturn sysTableKinds;\n }", "ArrayList<String> getTables() throws SQLException {\n\t\tArrayList<String> tables = new ArrayList<String>();\n\t\tDatabaseMetaData md = con.getMetaData();\n\t\tfor (ResultSet rs = md.getTables(null, null, \"%\", null); rs.next(); tables\n\t\t\t\t.add(rs.getString(3)))\n\t\t\t;\n\t\treturn tables;\n\t}", "public List<ModelType> findAllModelTypes() {\r\n\t\t// sparql\r\n\t\tString sparql = \"SELECT ?modelType WHERE {?modelType rdfs:subClassOf onto:ModelType.}\";\r\n\t\t// test\r\n\t\tString jsonString = findJsonResult(sparql);\r\n\t\tSystem.out.println(\"findAllModelTypes:\" + jsonString);\r\n\t\t// result\r\n\t\tJSONObject json;\r\n\t\ttry {\r\n\t\t\tjson = new JSONObject(jsonString);\r\n\t\t\tJSONArray jsonArray = json.getJSONObject(\"results\").getJSONArray(\"bindings\");\r\n\t\t\tList<ModelType> list = new ArrayList<ModelType>();\r\n\t\t\tfor (int i = 0; i < jsonArray.length(); i++) {\r\n\t\t\t\tJSONObject jsonObject = (JSONObject) jsonArray.get(i);\r\n\t\t\t\tModelType modelType = new ModelType();\r\n\t\t\t\tif (jsonObject.has(\"modelType\")) {\r\n\t\t\t\t\tmodelType.setModelTypeName(jsonObject.getJSONObject(\"modelType\").getString(\"value\").split(\"#\")[1]);\r\n\t\t\t\t}\r\n\t\t\t\tlist.add(modelType);\r\n\t\t\t}\r\n\t\t\treturn list;\r\n\t\t} catch (JSONException 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 ArrayList getAllTables(TableSelectExpression selExp) {\r\n\t\tArrayList sourceTableList = new ArrayList();\r\n\r\n\t\t// from clause in select statement\r\n\t\tFromClause fromclause = selExp.from_clause;\r\n\t\tArrayList def_list = fromclause.def_list;\r\n\t\tfor (int i = 0; i < def_list.size(); i++) {\r\n\t\t\tFromTableDef table_def = (FromTableDef) def_list.get(i);\r\n\t\t\tString tableName = table_def.getName();\r\n\t\t\t// if the table is a subquery table\r\n\t\t\tif (table_def.isSubQueryTable()) {\r\n\t\t\t\tTableSelectExpression sub_query = table_def.getTableSelectExpression();\r\n\t\t\t\tArrayList tablesInSubQuery = getAllTables(sub_query);\r\n\t\t\t\tfor (int j = 0; j < tablesInSubQuery.size(); j++) {\r\n\t\t\t\t\tsourceTableList.add(tablesInSubQuery.get(j));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsourceTableList.add(tableName);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// where clause in select statement\r\n\t\tSearchExpression where = (SearchExpression) selExp.where_clause;\r\n\t\tExpression whereExp = where.getFromExpression();\r\n\t\tif (whereExp != null) {\r\n\t\t\tfor (int i = 0; i < whereExp.allElements().size(); i++) {\r\n\t\t\t\tObject element = whereExp.allElements().get(i);\r\n\t\t\t\t// if existing sub query in where clause\r\n\t\t\t\tif (element.getClass().getName().equals(\"com.teradata.sqlparser.interpret.TableSelectExpression\")) {\r\n\t\t\t\t\tTableSelectExpression tablesel = (TableSelectExpression) element;\r\n\t\t\t\t\tArrayList tablesInWhere = getAllTables(tablesel);\r\n\t\t\t\t\tfor (int j = 0; j < tablesInWhere.size(); j++) {\r\n\t\t\t\t\t\tsourceTableList.add(tablesInWhere.get(j));\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\t// 处理union语句\r\n\t\twhile (selExp.composite_function != -1) {\r\n\t\t\tselExp = selExp.next_composite;\r\n\t\t\tArrayList tablesInUnion = getAllTables(selExp);\r\n\t\t\tfor (int j = 0; j < tablesInUnion.size(); j++) {\r\n\t\t\t\tsourceTableList.add(tablesInUnion.get(j));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sourceTableList;\r\n\t}", "public ArrayList<Table> find(DataEntry entry) {\n\t\tArrayList<Table> foundTables = new ArrayList<>();\n\t\tfor (Table table : tables.values()) {\n\t\t\tif (table.contains(entry)) {\n\t\t\t\tfoundTables.add(table);\n\t\t\t}\n\t\t}\n\t\treturn foundTables;\n\t}", "Table fetchSchema(LogSequenceNumber lsn, String tableName);", "void gen_table_names(Connection c, PreparedStatement pst ) throws ClassNotFoundException, SQLException\n\t{\n\t String lambda_term_query = \"select subgoal_names from view2subgoals where view = '\"+ name +\"'\";\n\n\t\t\n\t pst = c.prepareStatement(lambda_term_query);\n\t \n\t ResultSet rs = pst.executeQuery();\n\t \n\t if(!rs.wasNull())\n\t {\n\t \twhile(rs.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(rs.getString(1));\n\t\t }\n\t }\n\t \n\t else\n\t {\n\t \tlambda_term_query = \"select subgoal from web_view_table where renamed_view = '\"+ name +\"'\";\n\n\t\t\t\n\t\t pst = c.prepareStatement(lambda_term_query);\n\t\t \n\t\t ResultSet r = pst.executeQuery();\n\n\t\t while(r.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(r.getString(1));\n\t\t }\n\t }\n\t \n\t \n\t \n\n\t}", "private void addTables() {\r\n for (SQLTable table : getType().getTables()) {\r\n if (getExpr4Tables().get(table) == null) {\r\n getExpr4Tables().put(table, new HashMap<String,AttributeTypeInterface>());\r\n }\r\n }\r\n\r\n }", "public List<TableMetadata> tables()\n {\n if (version == UNDEFINED) {\n return Collections.emptyList();\n }\n if (version == NOT_FETCHED) {\n synchronized (this) {\n List<TableMetadata> catalogTables = base.tablesForSchema(schema.name());\n for (TableMetadata table : catalogTables) {\n cache.put(table.id().name(), new TableEntry(table));\n }\n }\n }\n List<TableMetadata> orderedTables = new ArrayList<>();\n\n // Get the list of actual tables; excluding any cached \"misses\".\n cache.forEach((k, v) -> {\n if (v.table != null) {\n orderedTables.add(v.table);\n }\n });\n orderedTables.sort((e1, e2) -> e1.id().name().compareTo(e2.id().name()));\n return orderedTables;\n }", "private static List<Table<?>> getTablesFromContext(final DSLContext dslContext, final List<String> constraints) {\n final Set<String> accessedTableNames = new HashSet<>();\n constraints.forEach(constraint -> {\n final ViewsWithChecks viewsWithChecks = ViewsWithChecks.fromString(constraint);\n final ExtractAccessedTables visitor = new ExtractAccessedTables(accessedTableNames);\n visitor.process(viewsWithChecks.getCreateView());\n viewsWithChecks.getCheckExpression().ifPresent(visitor::process);\n });\n\n final Meta dslMeta = dslContext.meta();\n final List<Table<?>> tables = new ArrayList<>();\n for (final Table<?> t : dslMeta.getTables()) {\n // Only access the tables that are referenced by the constraints.\n if (accessedTableNames.contains(t.getName())) {\n tables.add(t);\n\n // Also add tables referenced by foreign keys.\n t.getReferences().forEach(\n fk -> tables.add(fk.getKey().getTable())\n );\n }\n }\n return tables;\n }", "private List<String> getObjectsByType(String typeName) throws SQLException {\n return jdbcTemplate.queryForStringList(\"SELECT OBJECT_NAME FROM ALL_OBJECTS WHERE OWNER = ? AND OBJECT_TYPE = ?\",\n name, typeName);\n }", "public TableTypes getTableTypes() {\n return tableTypes;\n }", "public List<Map<String, Object>> searchDBTableDate(String condition) {\n log.info(new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(new Date()) + \"search db table data\");\n// TrafferCurrentDB();\n List<Map<String, Object>> list = queryMap(condition);\n if (StringUtils.isEmpty(list)) {\n throw new SQLException(SQLError, SQLError);\n }\n if (list.size() == 0) {\n List<String> tableNameList = (List<String>) session.getAttribute(\"list\");\n String DBName = (String) session.getAttribute(\"dbName\");\n tableNameList.forEach(\n tableName -> {\n if (condition.contains(tableName)) {\n queryMap(\n \"SELECT column_name FROM information_schema.columns WHERE table_name='\" + dbNameTrim(tableName) + \"' And table_schema='\" + dbNameTrim(DBName) + \"'\").forEach(\n stringObjectMap -> {\n if (!list.contains(stringObjectMap)) {\n list.add(stringObjectMap);\n }\n }\n );\n }\n }\n );\n\n }\n return list;\n }", "public List<T> findAll() {\n\n\t\tConnection dbConnection = ConnectionFactory.getConnection();\n\t\tPreparedStatement findStatement = null;\n\t\tResultSet rs = null;\n\t\tString findStatementString = \"SELECT * FROM \" + type.getSimpleName();\n\n\t\ttry {\n\t\t\tfindStatement = dbConnection.prepareStatement(findStatementString);\n\t\t\trs = findStatement.executeQuery();\n\t\t\treturn createObjects(rs);\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.log(Level.WARNING, type.getName() + \"DAO:findAll\" + e.getMessage());\n\t\t} finally {\n\t\t\tConnectionFactory.close(rs);\n\t\t\tConnectionFactory.close(findStatement);\n\t\t\tConnectionFactory.close(dbConnection);\n\t\t}\n\t\treturn null;\n\t}", "ResultSet searchType(String type) {\n \ttry {\n \t\tStatement search = this.conn.createStatement();\n \tString query = \"SELECT * \"\n \t\t\t+ \"FROM Pokemon AS P, Types AS T \"\n \t\t\t+ \"WHERE (P.Type1=T.TypeID OR P.Type2 = T.TypeID) AND \"\n \t\t\t+ \"T.name = \" + \"'\" + type + \"'\";\n \t\n \treturn search.executeQuery(query);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n }", "public String getTableTypeString() {\n \t\treturn \"\";\n \t}", "<T> Set<T> lookupAll(Class<T> type);", "TableOrBuilder getTablesOrBuilder(\n int index);", "public ArrayList<Table> getTable(String status)\n {\n ArrayList<Table> tables = new ArrayList();\n \n \n // First open a database connnection\n DatabaseConnection connection = new DatabaseConnection();\n if(connection.openConnection())\n {\n // If a connection was successfully setup, execute the SELECT statement.\n ResultSet resultset = connection.executeSQLSelectStatement(\n \"SELECT * FROM `tafel` WHERE tafelStatus = '\"+status+\"';\");\n\n if(resultset != null)\n {\n try\n {\n while(resultset.next())\n {\n Table newTable = new Table(\n \n resultset.getInt(\"tafelNummer\"),\n resultset.getString(\"tafelStatus\"),\n resultset.getInt(\"aantalpersonen\"));\n\n tables.add(newTable);\n }\n \n }\n catch(SQLException e)\n {\n System.out.println(e);\n tables = null;\n }\n }\n\n connection.closeConnection();\n }\n \n return tables;\n }", "public static void loadPOTables(){\n\t\ttry {\n\t\t\tfor(TableInfo tableInfo:tables.values()){\n\t\t\t\tClass c = Class.forName(DBManager.getConfiguration().getPoPackage()+\".\"+StringUtils.firstCharUpperCase(tableInfo.getTname()));\n\t\t\t\tpoClassTableMap.put(c, tableInfo);\n\t\t\t}\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "List<String> listTables(String databaseName) throws DatabaseNotExistException, CatalogException;", "public JSONArray getTablesForConnection(ConnectionModel connectionModel) throws SQLException {\n\t\tJSONArray jsonArray = new JSONArray();\n\t\ttry (Connection connection = getConnection(connectionModel, true);\n\t\t\t\tStatement statement = connection.createStatement()) {\n\t\t\tString query = connectionModel.getDatabaseType() == DATABASETYPE.MYSQL ? MYSQL_SQL_FETCH_ALL_TABLES\n\t\t\t\t\t: connectionModel.getDatabaseType() == DATABASETYPE.POSTGRESQL ? POSTGRES_SQL_FETCH_ALL_TABLES\n\t\t\t\t\t\t\t: ORACLE_SQL_FETCH_ALL_TABLES;\n\n\t\t\tString formatedQuery = String.format(query, connectionModel.getDatabaseName());\n\t\t\tResultSet resultSet = statement.executeQuery(formatedQuery);\n\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tString tableName = \"\";\n\t\t\t\tif (connectionModel.getDatabaseType() == DATABASETYPE.MYSQL)\n\t\t\t\t\ttableName = resultSet.getString(1);\n\t\t\t\tif (connectionModel.getDatabaseType() == DATABASETYPE.POSTGRESQL)\n\t\t\t\t\ttableName = resultSet.getString(\"table_name\");\n\t\t\t\tif (connectionModel.getDatabaseType() == DATABASETYPE.ORACLE)\n\t\t\t\t\ttableName = resultSet.getString(\"table_name\");\n\t\t\t\tjsonArray.add(tableName);\n\t\t\t}\n\t\t}\n\n\t\treturn jsonArray;\n\t}", "public List<String> getUserTables() {\n\t\ttry (Connection con = getReadOnlyConnection()) {\n\t\t\treturn dbFacade.getUserTables(con);\n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "@Override\r\n\tpublic List<Type> getTypes() {\n\t\treturn (List<Type>)BaseDao.select(\"select * from type\", Type.class);\r\n\t}", "@Override\n\tpublic List<Record> getRecordsByType(Type type) {\n\t\tSession session=HibernateSessionFactory.getSession();\n\t\tTransaction tx=session.beginTransaction();\n\t\tList<Record> list=new ArrayList<Record>();\n\t\tRecordDAO recordDAO=new RecordDAO();\n\t\t\n\t\ttry{\n\t\t\tlist=recordDAO.getRecordsByType(type);\n\t\t\ttx.commit();\n\t\t}catch(RuntimeException e){\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t\treturn list;\n\t}", "public List findMatchingTypes(\n String typeField, String toMatch, DatasetItem dataset, boolean matchAny) {\n\n String query = null;\n if (typeField.equals(\"transactionTypeTool\")) {\n query = FIND_TOOL_TYPES;\n } else if (typeField.equals(\"transactionTypeTutor\")) {\n query = FIND_TUTOR_TYPES;\n } else if (typeField.equals(\"transactionSubtypeTool\")) {\n query = FIND_TOOL_SUBTYPES;\n } else if (typeField.equals(\"transactionSubtypeTutor\")) {\n query = FIND_TUTOR_SUBTYPES;\n } else {\n throw new IllegalArgumentException(\"typeField does not match any expected values. \"\n + \"'\" + typeField + \"'\");\n }\n\n toMatch = matchAny ? \"%\" + toMatch.toUpperCase() + \"%\" : toMatch.toUpperCase() + \"%\";\n\n Object[] paramArray = new Object[2];\n paramArray[0] = dataset.getId();\n paramArray[1] = toMatch;\n\n return getHibernateTemplate().find(\n query, paramArray);\n }", "public Collection getTables(String serviceProviderCode, String callerID) throws AAException, RemoteException;", "public abstract String getDatabaseTableName(String entityName);", "private String getTableName(Class<?> clz) {\n\t\tif (clz.isAnnotationPresent(TableName.class)) {\n\t\t\treturn ((TableName) clz.getAnnotation(TableName.class)).value();\n\t\t}\n\t\treturn clz.getSimpleName();\n\t}", "@SuppressWarnings({\"unchecked\", \"fallthrough\"})\n public static Class<? extends DataObject> modelFromTables(Connection connection, String classname, Action action, String... tablenames) throws Exception {\n\n /*\n SQL generation\n\n INSERT INTO T ( cols ) VALUES ( vals );\n UPDATE T SET cols WHERE vals;\n DELETE FROM T WHERE vals;\n SELECT * FROM cols WHERE vals;\n */\n\n ClassPool pool = ClassPool.getDefault();\n // this line is necessary for web applications (web container class loader in play)\n pool.appendClassPath(new LoaderClassPath(org.xillium.data.DataObject.class.getClassLoader()));\n\n CtClass cc = pool.makeClass(classname);\n cc.addInterface(pool.getCtClass(\"org.xillium.data.DataObject\"));\n ConstPool cp = cc.getClassFile().getConstPool();\n\n List<String> fragments = new ArrayList<String>();\n Set<String> unique = new HashSet<String>();\n\n/*SQL*/ StringBuilder\n cols = new StringBuilder(), // CREATE: COLUMNS, RETRIEVE: TABLES, UPDATE: SET CLAUSES, DELETE: (not used), SEARCH: TABLES\n vals = new StringBuilder(), // CREATE: VALUES, RETRIEVE: COND'S, UPDATE: COND'S, DELETE: COND'S, SEARCH: COND'S\n flds = new StringBuilder();\n\n // for SEARCH only\n Map<String, List<Pair<Integer, Integer>>> voptional = new HashMap<String, List<Pair<Integer, Integer>>>();\n Map<String, List<Pair<Integer, Integer>>> foptional = new HashMap<String, List<Pair<Integer, Integer>>>();\n Map<String, String> nametrans = new HashMap<String, String>();\n\n DatabaseMetaData meta = connection.getMetaData();\n String schema = meta.getUserName();\n List<String> dominant = new ArrayList<String>();\n\n for (int i = 0; i < tablenames.length; ++i) {\n // Dominant tables are recognized and maintained in 'dominant' list\n if (tablenames[i].charAt(0) == DOMINANT_INDICATOR) {\n tablenames[i] = tablenames[i].substring(1);\n dominant.add(tablenames[i]);\n }\n\n PreparedStatement stmt = connection.prepareStatement(\"SELECT * FROM \" + tablenames[i]);\n ResultSetMetaData rsmeta = stmt.getMetaData();\n Map<String, Integer> colref = new HashMap<String, Integer>();\n for (int j = 1, jj = rsmeta.getColumnCount(); j <= jj; ++j) {\n colref.put(rsmeta.getColumnLabel(j), new Integer(j));\n }\n\n Set<String> primaryKeys = new HashSet<String>();\n ResultSet keys = meta.getPrimaryKeys(connection.getCatalog(), schema, tablenames[i]);\n while (keys.next()) {\n primaryKeys.add(keys.getString(PKEY_COLUMN));\n }\n keys.close();\n\n // RETRIEVE is not compatible with tables without a primary key\n if (primaryKeys.isEmpty() && action.op == Operation.RETRIEVE) {\n throw new RuntimeException(\"Primary key expected for RETRIEVE command, but missing on table \" + tablenames[i]);\n }\n\n // ISA keys and table join conditions\n Set<String> isaKeys = new HashSet<String>();\n if (i > 0) {\n keys = meta.getImportedKeys(connection.getCatalog(), schema, tablenames[i]);\n while (keys.next()) {\n String jointable = null;\n for (int j = 0; j < i; ++j) {\n if (keys.getString(FKEY_REFERENCED_TABLE).equals(tablenames[j])) {\n jointable = tablenames[j];\n break;\n }\n }\n if (jointable != null) {\n String column = keys.getString(FKEY_REFERENCING_COLUMN);\n isaKeys.add(column);\n if (action.op == Operation.RETRIEVE || action.op == Operation.SEARCH) {\n /*SQL*/ vals.append(tablenames[i]).append('.').append(column).append('=').append(jointable).append('.').append(column).append(\" AND \");\n }\n }\n }\n keys.close();\n }\n\n String alias = ((action.op == Operation.RETRIEVE || action.op == Operation.SEARCH) && tablenames.length > 1) ? tablenames[i]+'.' : \"\";\n\n if (action.op != Operation.RETRIEVE && action.op != Operation.SEARCH) {\n cols.setLength(0);\n vals.setLength(0);\n flds.setLength(0);\n } else {\n /*SQL*/ if (cols.length() > 0) cols.append(',');\n /*SQL*/ cols.append(tablenames[i]);\n }\n\n // Go through all columns in action.args for UPDATE and SEARCH operations\n Set<String> requested = new HashSet<String>();\n Set<String> required = new HashSet<String>();\n if (action.op == Operation.UPDATE) {\n // UPDATE: the elements in the SET clause => cols\n for (String column: calcUpdateColumns(action.args, colref, primaryKeys)) {\n // skip all key columns, which might be legally included through the restriction list\n if (primaryKeys.contains(column)) continue;\n // ... and SET others\n Integer idx = colref.get(column);\n if (idx != null) {\n /*SQL*/ if (cols.length() > 0) cols.append(',');\n /*SQL*/ String restriction = action.restriction == null ? null : action.restriction.get(column);\n if (restriction == null) {\n boolean reqd = action.isRequired(column);\n if (reqd) {\n /*SQL*/ cols.append(column).append(\"=?\");\n } else {\n /*SQL*/ cols.append(column).append(\"=COALESCE(?,\").append(column).append(')');\n }\n /*SQL*/ if (flds.length() > 0) flds.append(',');\n flds.append(fieldName(tablenames[i], column)).append(':').append(rsmeta.getColumnType(idx.intValue()));\n requested.add(column);\n if (reqd) required.add(column);\n } else {\n /*SQL*/ cols.append(column).append('=').append(restriction);\n }\n }\n }\n } else if (action.op == Operation.SEARCH && action.args != null) {\n // SEARCH: the elements in the WHERE clause => vals\n for (int c = 0; c < action.args.length; ++c) {\n // skip all ISA columns, which might be legally included through the restriction list\n if (isaKeys.contains(action.args[c])) continue;\n // else ...\n Integer idx = colref.get(action.args[c]);\n if (idx != null) {\n /*SQL*/ String restriction = action.restriction == null ? null : action.restriction.get(action.args[c]);\n /*SQL*/ if (restriction == null || restriction.charAt(0) == NEGATIVE_INDICATOR) {\n if (restriction != null) {\n /*SQL*/ vals.append(tablenames[i]).append('.').append(action.args[c]).append(\"<>\").append(restriction.substring(1)).append(\" AND \");\n }\n int vstart = vals.length(), fstart = flds.length();\n /*SQL*/ vals.append(tablenames[i]).append('.').append(action.args[c]).append(action.cmps[c]).append(\"? AND \");\n flds.append(fieldName(tablenames[i], action.args[c])).append(':').append(rsmeta.getColumnType(idx.intValue())).append(',');\n if (!action.reqd[c]) {\n traceOptional(voptional, action.args[c], vstart, vals.length());\n traceOptional(foptional, action.args[c], fstart, flds.length());\n }\n requested.add(action.args[c]);\n if (action.reqd[c]) required.add(action.args[c]);\n } else {\n /*SQL*/ vals.append(tablenames[i]).append('.').append(action.args[c]).append('=').append(restriction).append(\" AND \");\n }\n }\n }\n }\n\n ResultSet columns = meta.getColumns(connection.getCatalog(), schema, tablenames[i], \"%\");\n columns:while (columns.next()) {\n String name = columns.getString(COLUMN_NAME), fname = fieldName(tablenames[i], name);\n int idx = colref.get(name).intValue();\n\n if ((action.op == Operation.RETRIEVE || action.op == Operation.DELETE) && !primaryKeys.contains(name)) {\n continue;\n } else if (action.op == Operation.UPDATE && !requested.contains(name) && !primaryKeys.contains(name)) {\n continue;\n } else if (action.op == Operation.SEARCH && !requested.contains(name)) {\n continue;\n }\n\n /*SQL*/ String restriction = action.restriction == null ? null : action.restriction.get(name);\n switch (action.op) {\n case CREATE:\n if (action.args != null) for (int j = 0; j < action.args.length; ++j) {\n if (action.args[j].equals(name)) continue columns;\n }\n /*SQL*/ if (cols.length() > 0) {\n /*SQL*/ cols.append(',');\n /*SQL*/ vals.append(',');\n /*SQL*/ }\n /*SQL*/ cols.append(name);\n /*SQL*/ if (restriction == null || restriction.charAt(0) == NEGATIVE_INDICATOR) {\n /*SQL*/ vals.append('?');\n /*SQL*/ if (flds.length() > 0) flds.append(',');\n flds.append(fname).append(':').append(rsmeta.getColumnType(idx));\n } else {\n /*SQL*/ vals.append(restriction);\n }\n break;\n case RETRIEVE:\n if (i > 0) {\n // NOTE: ISA relation dictates that sub-tables' primary key == super-table's primary key\n // therefore the join condition generated above is sufficient already\n break;\n }\n // fall through for the super-table\n case DELETE:\n // only primary key columns\n generateCondition(restriction, vals, flds, alias + name, fname, rsmeta.getColumnType(idx));\n break;\n case UPDATE:\n // only primary key & updating columns\n if (primaryKeys.contains(name)) {\n generateCondition(restriction, vals, flds, name, fname, rsmeta.getColumnType(idx));\n }\n break;\n case SEARCH:\n // file optionals lists under field names\n nametrans.put(name, fname);\n voptional.put(fname, voptional.get(name));\n foptional.put(fname, foptional.get(name));\n break;\n }\n\n if ((restriction != null && restriction.charAt(0) != NEGATIVE_INDICATOR) || isaKeys.contains(name)) {\n continue;\n } else if (unique.contains(name)) {\n continue;\n //throw new RuntimeException(\"Duplicate column in ISA relationship detected \" + tablenames[i] + ':' + name);\n } else {\n unique.add(name);\n }\n\n CtField field = new CtField(pool.getCtClass(MetaDataHelper.getClassName(rsmeta, idx)), fname, cc);\n field.setModifiers(java.lang.reflect.Modifier.PUBLIC);\n AnnotationsAttribute attr = new AnnotationsAttribute(cp, AnnotationsAttribute.visibleTag);\n\n if (required.contains(name)) {\n addAnnotation(attr, cp, \"org.xillium.data.validation.required\");\n } else if (columns.getInt(IS_NULLABLE) == DatabaseMetaData.attributeNoNulls) {\n if ((action.op != Operation.UPDATE || primaryKeys.contains(name)) && action.op != Operation.SEARCH) {\n addAnnotation(attr, cp, \"org.xillium.data.validation.required\");\n }\n }\n\n if (rsmeta.getPrecision(idx) != 0) {\n addAnnotation(attr, cp, \"org.xillium.data.validation.size\", \"value\", new IntegerMemberValue(cp, rsmeta.getPrecision(idx)));\n }\n\n addAnnotation(attr, cp, \"org.xillium.data.persistence.crud.tablename\", \"value\", new StringMemberValue(tablenames[i], cp));\n\n field.getFieldInfo().addAttribute(attr);\n cc.addField(field);\n }\n columns.close();\n stmt.close();\n\n switch (action.op) {\n case CREATE:\n fragments.add(\"org.xillium.data.persistence.ParametricStatement\");\n fragments.add(flds.toString());\n fragments.add(\"INSERT INTO \" + tablenames[i] + '(' + cols.toString() + \") VALUES(\" + vals.toString() + ')');\n fragments.add(Strings.toCamelCase(tablenames[i], '_'));\n break;\n case UPDATE:\n if (cols.length() > 0) {\n fragments.add(\"org.xillium.data.persistence.ParametricStatement\");\n fragments.add(flds.toString());\n fragments.add(\"UPDATE \" + tablenames[i] + \" SET \" + cols.toString() + \" WHERE \" + vals.toString().replaceAll(\" AND *$\", \"\"));\n fragments.add(Strings.toCamelCase(tablenames[i], '_'));\n }\n break;\n case DELETE:\n fragments.add(\"org.xillium.data.persistence.ParametricStatement\");\n fragments.add(flds.toString());\n fragments.add(\"DELETE FROM \" + tablenames[i] + \" WHERE \" + vals.toString().replaceAll(\" AND *$\", \"\"));\n fragments.add(Strings.toCamelCase(tablenames[i], '_'));\n break;\n case RETRIEVE:\n case SEARCH:\n break;\n }\n }\n\n if (action.op == Operation.RETRIEVE) {\n fragments.add(\"org.xillium.data.persistence.ParametricQuery\");\n fragments.add(flds.toString());\n fragments.add(\"SELECT \" + selectTarget(dominant) + \" FROM \" + cols + \" WHERE \" + vals.toString().replaceAll(\" AND *$\", \"\"));\n fragments.add(\"\");\n } else if (action.op == Operation.SEARCH) {\n if (action.opts != null) {\n for (int i = 0; i < action.opts.length; ++i) {\n action.opts[i] = nametrans.get(action.opts[i]);\n }\n int count = 1 << action.opts.length;\n\n String vtext = vals.toString(), ftext = flds.toString();\n for (int i = 0; i < count; ++i) {\n char[] vchars = vtext.toCharArray(), fchars = ftext.toCharArray();\n for (int j = 0; j < action.opts.length; ++j) {\n List<Pair<Integer, Integer>> vlist = voptional.get(action.opts[j]);\n List<Pair<Integer, Integer>> flist = foptional.get(action.opts[j]);\n if (vlist == null || flist == null) {\n throw new RuntimeException(\"Column{\"+action.opts[j]+\"}NotInRelevantTables\");\n }\n if ((i & (1 << j)) == 0) {\n for (Pair<Integer, Integer> part: vlist) Arrays.fill(vchars, part.first, part.second, ' ');\n for (Pair<Integer, Integer> part: flist) Arrays.fill(fchars, part.first, part.second, ' ');\n }\n }\n\n fragments.add(\"org.xillium.data.persistence.ParametricQuery\");\n fragments.add(new String(fchars).replaceAll(\"\\\\s+\", \" \"));\n String vals0 = new String(vchars).replaceAll(\"\\\\s+\", \" \").replaceAll(\" AND *$\", \"\").trim();\n if (vals0.length() > 0) {\n fragments.add(\"SELECT \" + selectTarget(dominant) + \" FROM \" + cols + \" WHERE \" + vals0);\n } else {\n fragments.add(\"SELECT \" + selectTarget(dominant) + \" FROM \" + cols);\n }\n fragments.add(\"\");\n }\n } else {\n fragments.add(\"org.xillium.data.persistence.ParametricQuery\");\n fragments.add(flds.toString());\n if (vals.length() > 0) {\n fragments.add(\"SELECT \" + selectTarget(dominant) + \" FROM \" + cols + \" WHERE \" + vals.toString().replaceAll(\" AND *$\", \"\"));\n } else {\n fragments.add(\"SELECT \" + selectTarget(dominant) + \" FROM \" + cols);\n }\n fragments.add(\"\");\n }\n }\n\n CtField field = new CtField(pool.getCtClass(\"org.xillium.data.persistence.ParametricStatement[]\"), STATEMENT_FIELD_NAME, cc);\n field.setModifiers(java.lang.reflect.Modifier.PUBLIC | java.lang.reflect.Modifier.STATIC | java.lang.reflect.Modifier.FINAL);\n cc.addField(field, CtField.Initializer.byCallWithParams(\n pool.getCtClass(CrudCommand.class.getName()), \"buildStatements\", fragments.toArray(new String[fragments.size()])\n ));\n\n return (Class<? extends DataObject>)cc.toClass(CrudCommand.class.getClassLoader(), CrudCommand.class.getProtectionDomain());\n }", "public void listTables() {\r\n\t\tfor (Table table : tables) {\r\n\t\t\tSystem.out.println(table.getName());\r\n\t\t}\r\n\t}", "public DBTableDescriptor[] listTables() throws IOException {\n return this.connection.listTables();\n }", "@Deprecated\n public String[] getTableNames(Pattern pattern) throws IOException {\n List<String> matched = new ArrayList<String>();\n\tDBTableDescriptor[] tables = listTables();\n\tif (tables != null) { \n\t for (DBTableDescriptor table : tables) { \n\t\tString name = table.getNameAsString();\n if (pattern.matcher(name).matches()) \n matched.add(name);\n }\n }\n return matched.toArray(new String[matched.size()]);\n }", "List<Type> getAllTypeList();", "public List getSubtotalTableNames(String baseName) throws Exception {\n\t\tList list = new ArrayList();\r\n\t\tSession session = getSession();\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement ps = null;\r\n\t\tResultSet rs = null;\r\n\t\tString sql = \"show tables like ?\";\r\n\t\ttry {\r\n\t\t\tconn = session.connection();\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.setString(1, baseName + '%');\r\n\t\t\trs = ps.executeQuery();\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tlist.add(rs.getString(1));\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tthrow e;\r\n\t\t} finally {\r\n\t\t\tif(rs != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t} catch(Exception ex) {}\r\n\t\t\t}\r\n\t\t\tif(ps != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tps.close();\r\n\t\t\t\t} catch(Exception ex) {}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "String getTempTableName(String name);", "public Tables getTables(){\n\t\tTables result=null;\n\t\tTable t1=(column1==null || column1.getTableName()==null)?(null):new Table(column1.getTableName());\t\t\n\t\tTable t2=(column2==null || column2.getTableName()==null)?(null):new Table(column2.getTableName());\n\t\tif (t1!=null) { \n\t\t\tresult=new Tables(t1);\n\t\t\tresult.add(t2);\n\t\t} else if(t2!=null){\n\t\t\tresult=new Tables(t2);\n\t\t}\n\t\treturn result;\n\t}", "java.util.List<? extends TableOrBuilder>\n getTablesOrBuilderList();", "public List<String> getBodyTables() {\r\n\t\tList<String> tableNames = new ArrayList<String>();\r\n\t\tfor (Atom a: getBody()) {\r\n\t\t\tif(!a.isNeg() && !a.isSkolem())\r\n\t\t\t\ttableNames.add(a.toString3());\r\n\t\t}\r\n\t\treturn tableNames;\r\n\t}", "public Set<String> getTableNames(String schema)\n {\n requireNonNull(schema, \"schema is null\");\n return metaManager.getTableNames(schema);\n }", "public String getAllContactsTypes() {\n\t\treturn \"SELECT * FROM CONTACTSTYPES\";\n\t}", "public String composeTableNamesQuery() {\n\t\treturn String.format(\"show tables;\");\n\t}", "public Items[] findWhereTypeEquals(String type) throws ItemsDaoException;", "public List<E> findAll(Class<E> type){\n transaction.begin();\n List<E> types = entityManager.createQuery(\" from \" + type.getName()).getResultList();\n transaction.commit();\n return types;\n }", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "public List findRecords(String informationType, String queryString) throws DatabaseException;", "public void showTables(){\n\t\tSchema schemaTable = Schema.getSchemaInstance();\n\t\tString currentSchemaName = schemaTable.getCurrentSchema();\n\n\t\ttry{\n\t\t\tArrayList<String> tableList = new ArrayList<String>();\n\n\t\t\tRandomAccessFile tableFile = new RandomAccessFile(\"information_schema.table.tbl\",\"rw\");\n\n\t\t\twhile(tableFile.getFilePointer() < tableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tString readTableName = \"\";\n\n\t\t\t\t//Looks for matching schema name\n\t\t\t\tbyte varcharLength = tableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tableFile.readByte();\n\n\t\t\t\tbyte varcharTableLength = tableFile.readByte();\n\t\t\t\tfor(int k = 0; k < varcharTableLength; k++)\n\t\t\t\t\treadTableName += (char)tableFile.readByte();\n\t\t\t\t//Looks for matching table name\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\t\n\t\t\t\t\ttableList.add(readTableName);\n\t\t\t\t}\n\t\t\t\t//To skip the number of rows part\n\t\t\t\ttableFile.readLong();\n\t\t\t}\n\n\t\t\tif(tableList.size() != 0){\n\t\t\t\t//Printing current Tables in the schema\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"Table_in_\" + currentSchemaName);\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\tfor(int i = 0; i < tableList.size() ; i++)\n\t\t\t\t\tSystem.out.println(tableList.get(i));\n\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\n\t\t\t\t//Clearing table list contents\n\t\t\t\ttableList.removeAll(tableList);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Empty Set...\");\n\t\t\t}\n\n\t\t\t//Closing the file\n\t\t\ttableFile.close();\n\t\t}catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "List<AccountTypeDTO> lookupAccountTypes();", "public String[] getTableSchema(String tableName){\n return tableSchemaMap.get(tableName);\n }", "public static List<String> getTemporaryTables(final String toAppend) {\n return appendAll(TABLES, toAppend);\n }", "public List<SecTyp> getAllTypes();", "public List<String> getAllTables() throws Exception {\n\t\tList<String> result = new ArrayList<String>();\n\n\t\tDatabaseMetaData metaData = conn.getMetaData();\n\t\tString[] types = { \"TABLE\" };\n\t\t// Retrieving the columns in the database\n\t\tResultSet tables = metaData.getTables(null, null, \"%\", types);\n\t\twhile (tables.next()) {\n\t\t\tresult.add(tables.getString(\"TABLE_NAME\"));\n\t\t}\n\t\treturn result;\n\t}", "public List<SensoryType> findAllSensoryTypes() {\r\n\t\t// sparql\r\n\t\tString sparql = \"SELECT ?dataSourceType WHERE {?dataSourceType rdfs:subClassOf onto:DataSourceType.}\";\r\n\t\t// test\r\n\t\tString jsonString = findJsonResult(sparql);\r\n\t\tSystem.out.println(\"findAllDataSourceTypes:\" + jsonString);\r\n\t\t// result\r\n\t\tJSONObject json;\r\n\t\ttry {\r\n\t\t\tjson = new JSONObject(jsonString);\r\n\t\t\tJSONArray jsonArray = json.getJSONObject(\"results\").getJSONArray(\"bindings\");\r\n\t\t\tList<SensoryType> list = new ArrayList<SensoryType>();\r\n\t\t\tfor (int i = 0; i < jsonArray.length(); i++) {\r\n\t\t\t\tJSONObject jsonObject = (JSONObject) jsonArray.get(i);\r\n\t\t\t\tSensoryType sensoryType = new SensoryType();\r\n\t\t\t\tif (jsonObject.has(\"dataSourceType\")) {\r\n\t\t\t\t\tsensoryType.setSensoryTypeName(jsonObject.getJSONObject(\"dataSourceType\").getString(\"value\").split(\"#\")[1]);\r\n\t\t\t\t}\r\n\t\t\t\tlist.add(sensoryType);\r\n\t\t\t}\r\n\t\t\treturn list;\r\n\t\t} catch (JSONException 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 List<Type> getAll();", "public static List<String> getTableNames(final Configuration conf) {\n requireNonNull(conf);\n return Collections.unmodifiableList(\n makeTableNames(ConfigUtils.getTablePrefix(conf) ) );\n }", "List<PhysicalTable> getPhysicalTables();", "public final <T extends Table> T getTable(final Class<T> type) throws NoSuchTableException {\n Table table;\n synchronized (tables) {\n table = tables.get(type);\n if (table != null && table.canReuse) {\n table.canReuse = false;\n } else {\n if (table != null) {\n table = table.clone();\n } else try {\n final Constructor<T> c = type.getConstructor(Database.class);\n c.setAccessible(true);\n table = c.newInstance(this);\n } catch (ReflectiveOperationException exception) {\n throw new NoSuchTableException(Classes.getShortName(type), exception);\n }\n tables.put(type, table);\n }\n }\n return type.cast(table);\n }", "@Override\r\n\tpublic String getTableName(String[] sql) {\n\t\treturn sql[2];\r\n\t}", "public ArrayList<Table> getAllTables() {\r\n\t\treturn tables;\r\n\t}", "@Test void testInterpretTableFunctionWithDynamicType() {\n SchemaPlus schema = rootSchema.add(\"s\", new AbstractSchema());\n final TableFunction table1 =\n TableFunctionImpl.create(Smalls.DYNAMIC_ROW_TYPE_TABLE_METHOD);\n schema.add(\"dynamicRowTypeTable\", table1);\n final String sql = \"select *\\n\"\n + \"from table(\\\"s\\\".\\\"dynamicRowTypeTable\\\"('\"\n + \"{\\\"nullable\\\":false,\\\"fields\\\":[\"\n + \" {\\\"name\\\":\\\"i\\\",\\\"type\\\":\\\"INTEGER\\\",\\\"nullable\\\":false},\"\n + \" {\\\"name\\\":\\\"d\\\",\\\"type\\\":\\\"DATE\\\",\\\"nullable\\\":true}\"\n + \"]}', 0))\\n\"\n + \"where \\\"i\\\" < 0 and \\\"d\\\" is not null\";\n sql(sql).returnsRows();\n }", "public static CRDTTableType get_Table_Type(String titleStr)\n\t{\n\n\t\tString annotStr = get_Table_Type_Annotation(titleStr);\n\t\tif(annotStr.equals(\"\"))\n\t\t\treturn CRDTTableType.NONCRDTTABLE;\n\t\telse\n\t\t\treturn CRDTTableType.valueOf(annotStr);\n\n\t}", "public List introspectTables(TableConfiguration tc) throws SQLException {\n\n // get the raw columns from the DB\n Map columns = getColumns(tc);\n \n if (columns.isEmpty()) {\n warnings.add(Messages.getString(\"Warning.19\", tc.getCatalog(), //$NON-NLS-1$\n tc.getSchema(), tc.getTableName()));\n return null;\n }\n \n removeIgnoredColumns(tc, columns);\n calculateExtraColumnInformation(tc, columns);\n applyColumnOverrides(tc, columns);\n calculateIdentityColumns(tc, columns);\n \n List introspectedTables = calculateIntrospectedTables(tc, columns);\n \n Iterator iter = introspectedTables.iterator();\n while (iter.hasNext()) {\n IntrospectedTableImpl it = (IntrospectedTableImpl) iter.next();\n calculatePrimaryKey(it);\n }\n \n // now introspectedTables has all the columns from all the \n // tables in the configuration. Do some validation...\n\n iter = introspectedTables.iterator();\n while (iter.hasNext()) {\n IntrospectedTableImpl introspectedTable = (IntrospectedTableImpl) iter.next();\n \n ColumnDefinitions cds = introspectedTable.getColumnDefinitions();\n \n if (!cds.hasAnyColumns()) {\n // add warning that the table has no columns, remove from the list\n warnings.add(Messages.getString(\"Warning.1\", introspectedTable.getTable().toString())); //$NON-NLS-1$\n iter.remove();\n } else if (!cds.hasPrimaryKeyColumns()\n && !cds.hasBaseColumns()) {\n // add warning that the table has only BLOB columns, remove from the list\n warnings.add(Messages.getString(\"Warning.18\", introspectedTable.getTable().toString())); //$NON-NLS-1$\n iter.remove();\n } else {\n // now make sure that all columns called out in the configuration\n // actually exist\n reportIntrospectionWarnings(cds, tc, introspectedTable.getTable());\n }\n }\n\n return introspectedTables;\n }", "public String getTableDbName() { return \"t_trxtypes\"; }", "String getTypeFilter(String column, Collection<FxType> types);", "public abstract String[] createTablesStatementStrings();" ]
[ "0.6286592", "0.62529194", "0.59267855", "0.5871607", "0.5580929", "0.55417985", "0.5531622", "0.55273736", "0.5466176", "0.5446969", "0.5432479", "0.54017496", "0.5398554", "0.53925824", "0.53811413", "0.53792274", "0.536307", "0.5358843", "0.5354428", "0.5297518", "0.5264596", "0.5256564", "0.5244291", "0.52314055", "0.5174563", "0.51571524", "0.5125063", "0.5113772", "0.5108247", "0.50664675", "0.5045937", "0.5042214", "0.5012597", "0.50109285", "0.5000733", "0.5000114", "0.49986708", "0.49980754", "0.49945357", "0.49847385", "0.49773976", "0.49734417", "0.49622917", "0.4956513", "0.4948737", "0.4934996", "0.49295992", "0.4903021", "0.49011463", "0.48990855", "0.4890921", "0.4883794", "0.4827422", "0.4819432", "0.48100272", "0.4805139", "0.4800168", "0.47844946", "0.47805807", "0.47733155", "0.47717798", "0.4750834", "0.47381148", "0.4733741", "0.4729533", "0.4726923", "0.47231323", "0.46908933", "0.46762854", "0.46753186", "0.46684626", "0.46669555", "0.4657713", "0.4653908", "0.46526387", "0.46496972", "0.4641196", "0.46363014", "0.46338215", "0.4629223", "0.4618128", "0.46119955", "0.46049598", "0.45963192", "0.45956784", "0.45893413", "0.45867634", "0.45617786", "0.45520717", "0.45518136", "0.45507926", "0.45435244", "0.45426962", "0.45295495", "0.4525459", "0.45245513", "0.4523457", "0.4515244", "0.45112157", "0.4505469" ]
0.63792187
0