blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
2
382
src_encoding
stringclasses
34 values
length_bytes
int64
9
3.8M
score
float64
1.5
4.94
int_score
int64
2
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
9
3.8M
download_success
bool
1 class
8067391b97a35b13db18424900067a41cef5f4e1
Java
a12791602/lotto-cms-core-wl
/src/main/java/com/hhly/cmscore/persistence/payment/dao/PayBankLimitDaoMapper.java
UTF-8
850
1.929688
2
[]
no_license
package com.hhly.cmscore.persistence.payment.dao; import java.util.List; import org.apache.ibatis.annotations.Param; import com.hhly.cmscore.persistence.payment.po.PayBankLimitPO; import com.hhly.skeleton.cms.payment.bo.PayBankLimitBO; import com.hhly.skeleton.cms.payment.vo.PayBankLimitVO; /** * @desc 支付银行卡限制说明表操作 * @author tangxiaobo * @date 2017年3月9日 * @company 益彩网络科技公司 * @version 1.0 */ public interface PayBankLimitDaoMapper { /** * @author tangxiaobo * @Version 1.0 * @CreatDate 2017年3月9日 下午4:00:10 * @param bankId 银行id * @return 银行限额列表 */ List<PayBankLimitBO> find(@Param("bankId") Integer bankId); int saveList(@Param("po") List<PayBankLimitPO> po); int updateList(@Param("po") List<PayBankLimitPO> po); int delete(PayBankLimitVO vo); }
true
d5d2297ef2a0723c666d3c0a33bd8fa9d66167ec
Java
willp-bl/verify-stub-idp
/saml-extensions/src/main/java/uk/gov/ida/saml/core/extensions/eidas/impl/BirthNameImpl.java
UTF-8
1,167
2.34375
2
[ "MIT", "LicenseRef-scancode-proprietary-license" ]
permissive
package uk.gov.ida.saml.core.extensions.eidas.impl; import org.opensaml.core.xml.XMLObject; import org.opensaml.saml.common.AbstractSAMLObject; import uk.gov.ida.saml.core.extensions.eidas.BirthName; import javax.annotation.Nullable; import java.util.List; public class BirthNameImpl extends AbstractSAMLObject implements BirthName { /** String to hold the birth name. */ private String birthName; /** * Constructor. * * @param namespaceURI the namespace the element is in * @param elementLocalName the local name of the XML element this Object represents * @param namespacePrefix the prefix for the given namespace */ protected BirthNameImpl(String namespaceURI, String elementLocalName, String namespacePrefix) { super(namespaceURI, elementLocalName, namespacePrefix); } /** {@inheritDoc} */ public String getBirthName() { return birthName; } /** {@inheritDoc} */ public void setBirthName(String s) { birthName = prepareForAssignment(birthName, s); } @Nullable @Override public List<XMLObject> getOrderedChildren() { return null; } }
true
b0c0d7301e3a1e35435180f2da82b6012436bfcf
Java
UnlimitedBladeWorksV/TelDefender
/app/src/main/java/com/example/ag/teldefender/RecorderActivity.java
UTF-8
7,817
2.28125
2
[]
no_license
package com.example.ag.teldefender; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.PersistableBundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageButton; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Vector; /** * Created by Ag on 2017/6/19. */ public class RecorderActivity extends AppCompatActivity { ArrayList<String> records = new ArrayList<>(); String path = "storage/sdcard/record/"; boolean success = false; private ListView recorder_lv; private ImageButton delete_bt; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recorder); recorder_lv = (ListView) findViewById(R.id.lv_recorder); delete_bt = (ImageButton) findViewById(R.id.ibt_recorderdelete); //状态栏 Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); //toolbar.setNavigationIcon(R.drawable.logo); setSupportActionBar(toolbar); /*测试 records = GetVideoFileName(path); for(int i = 0;i < records.size();i++){ Log.e("brady", "records = " + records.get(i)); } */ delete_bt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(RecorderActivity.this); builder.setMessage("确定删除全部吗?"); builder.setPositiveButton("取消",null); builder.setNegativeButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //deleteAllFiles(new File("/sdcard/BlackListBackups/")); init(); Toast.makeText(RecorderActivity.this,"删除成功",Toast.LENGTH_SHORT).show(); } }).show(); } }); init(); } private void deleteAllFiles(File root) { File files[] = root.listFiles(); if (files != null) for (File f : files) { if (f.isDirectory()) { // 判断是否为文件夹 deleteAllFiles(f); try { f.delete(); } catch (Exception e) { } } else { if (f.exists()) { // 判断是否存在 deleteAllFiles(f); try { f.delete(); } catch (Exception e) { } } } } } public void init(){ records = GetVideoFileName(path); //重新读取 MyAdapter myAdapter = new MyAdapter(records,this); recorder_lv.setAdapter(myAdapter); } public static ArrayList<String> GetVideoFileName(String fileAbsolutePath) { ArrayList<String> vecFile = new ArrayList<String>(); File file = new File(fileAbsolutePath); File[] subFile = file.listFiles(); for (int iFileLength = 0; iFileLength < subFile.length; iFileLength++) { // 判断是否为文件夹 if (!subFile[iFileLength].isDirectory()) { String filename = subFile[iFileLength].getName(); // 判断是否为amr结尾 if (filename.trim().toLowerCase().endsWith(".amr")) { vecFile.add(filename); Log.e("brady", "records = " + filename); } } } return vecFile; } public class MyAdapter extends BaseAdapter { private ArrayList<String> list; private LayoutInflater inflater; public MyAdapter() { } public MyAdapter(ArrayList<String> sList, Context context) { this.list = sList; this.inflater = LayoutInflater.from(context); } public void UpdateList(ArrayList<String> list) { this.list = list; notifyDataSetChanged(); } @Override public int getCount() { return list == null ? 0 : list.size(); } @Override public String getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { final Recorder recorder; if(convertView == null){ recorder = new Recorder(); //加载布局为一个视图 convertView = inflater.inflate(R.layout.recorder_listview, null); //初始化 recorder.record = (TextView) convertView.findViewById(R.id.tv_recorder); recorder.play = (Button) convertView.findViewById(R.id.bt_recorderplay); recorder.delete = (Button) convertView.findViewById(R.id.bt_recorderdelete); //适配内容 final String strrecord = list.get(position); recorder.record.setText(list.get(position)); //事件监听 recorder.play.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { File audioFile = new File("storage/sdcard/record/",strrecord); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://" + audioFile), "audio/amr"); startActivity(intent); } }); recorder.delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(RecorderActivity.this); builder.setMessage("确定删除吗?"); builder.setPositiveButton("取消",null); builder.setNegativeButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { File file = new File("storage/sdcard/record/",strrecord); if(file.exists()){ file.delete(); } init(); Toast.makeText(RecorderActivity.this,"删除成功",Toast.LENGTH_SHORT).show(); } }).show(); } }); }else{ recorder = (Recorder) convertView.getTag(); } return convertView; } class Recorder{ TextView record; Button play,delete; } } /*---end--黑名单ListView适配器---end---*/ }
true
c2c3377bf92cb1943f1b00d96b7f346b1193ab6c
Java
moutainhigh/center-1
/newscenter/src/main/java/com/cmall/newscenter/beauty/model/PostsCosmeticFollowAddInput.java
UTF-8
1,167
1.804688
2
[]
no_license
package com.cmall.newscenter.beauty.model; import java.util.ArrayList; import java.util.List; import com.srnpr.zapcom.baseannotation.ZapcomApi; import com.srnpr.zapcom.topapi.RootInput; /** * 追帖妆品输入类 * @author houwen * date 2015-01-21 * @version 1.0 */ public class PostsCosmeticFollowAddInput extends RootInput { @ZapcomApi(value="帖子ID",remark="帖子ID",demo="MI140630100001",require=1) private String post_code = ""; @ZapcomApi(value="正文",remark="正文",demo="XX化妆品太好用了") private String post_content = ""; @ZapcomApi(value="妆品id",remark="妆品id",demo="8019406881",require=1) private List<String> cosmetic_code = new ArrayList<String>(); public String getPost_content() { return post_content; } public void setPost_content(String post_content) { this.post_content = post_content; } public List<String> getCosmetic_code() { return cosmetic_code; } public void setCosmetic_code(List<String> cosmetic_code) { this.cosmetic_code = cosmetic_code; } public String getPost_code() { return post_code; } public void setPost_code(String post_code) { this.post_code = post_code; } }
true
e581cd45258772151a26ef7187bbc08f026c32c8
Java
m-mercier/poo-project
/simulador_robots/src/Simulador/Ambiente.java
UTF-8
17,565
3.25
3
[]
no_license
package Simulador; import java.io.*; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Ana Guarino * @author Marta Mercier */ public class Ambiente { private int largura; private int comprimento; private int tempo_vida; private final ArrayList<Objecto> objectos; // Array com todos os objectos no ambiente private final ArrayList<Agente> agentes; // Array com todos os agentes no ambiente // constructor da classe Ambiente Ambiente(){ // quando a largura, comprimento e tempo de vida não são definidos em ficheiro, atribuimos estes valores por omissão largura = 10; comprimento = 10; tempo_vida = 5; objectos = new ArrayList<>(); agentes = new ArrayList<>(); } // constructor da classe Ambiente Ambiente(int l, int c, int tv){ largura = l; comprimento = c; tempo_vida = tv; objectos = new ArrayList<>(); agentes = new ArrayList<>(); } /** * Método que altera a largura do ambiente * @param l largura */ public void setLargura(int l) { largura = l; } /** * Método que altera o comprimento do ambiente * @param c comprimento */ public void setComprimento(int c) { comprimento = c; } /** * Método que altera o tempo de vida de um agente * @param tv tempo de vida de um agente */ public void setTV(int tv) { tempo_vida = tv; } /** * Método que devolve a lista de agentes * @return lista de agentes */ public ArrayList<Agente> getListaAgentes (){ return agentes; } /** * Método que executa toda a simulação */ public void run(){ try { // ler informações do ficheiro e configurar o ambiente ler_ficheiro_config(); } catch (IOException ex) { Logger.getLogger(Ambiente.class.getName()).log(Level.SEVERE, null, ex); } // correr o programa -> em ciclo -> nº de iterações = tempo de vida for (Agente a : agentes){ int tv_aux = this.tempo_vida; while(tv_aux>0){ // Agente adquire o seu campo de visão a.adquire_campo_visao(this.objectos, this.comprimento, this.largura); // Agente move-se a.mover(objectos, comprimento, largura); //diminui tempo de vida tv_aux--; } a.calcular_distancia(); // escreve informações em ficheiro try { escrever_ficheiro_objectos("memoria.txt", 0); } catch (IOException ex) { Logger.getLogger(Ambiente.class.getName()).log(Level.SEVERE, null, ex); } try { escrever_ficheiro_objectos("percepcoes.txt", 1); } catch (IOException ex) { Logger.getLogger(Ambiente.class.getName()).log(Level.SEVERE, null, ex); } try { escrever_ficheiro_coordenadas("coordenadas.txt"); } catch (IOException ex) { Logger.getLogger(Ambiente.class.getName()).log(Level.SEVERE, null, ex); } try { escrever_ficheiro_info(); } catch (IOException ex) { Logger.getLogger(Ambiente.class.getName()).log(Level.SEVERE, null, ex); } } } /** * Método que lista objectos - utilizada para debug * @param lista lista de objectos do ambiente */ public void listar_objectos(ArrayList<Objecto> lista){ if (!lista.isEmpty()){ for (Objecto obj : lista){ System.out.println("Objecto "+obj.id); System.out.println("-cor: "+obj.cor); System.out.println("-forma: "+obj.forma_geometrica); System.out.println("-posicao: ("+obj.posicao.getPos_x()+","+obj.posicao.getPos_y()+")"); System.out.println("-tipo: "+obj.getTipo()); System.out.println("------------------------"); } } else{ Interface.janela_popup("A lista está vazia! \n"); } } /** * Método que escreve ficheiro de memória ou de percepções * @param nome nome do ficheiro a criar * @param tipo tipo de ficheiro(tipo=0 ficheiro de memoria tipo!=0 ficheiro de percepções) * @throws IOException */ public void escrever_ficheiro_objectos(String nome, int tipo) throws IOException { int i,tamanho_agentes=agentes.size(); int j,tamanho; try { try (PrintWriter f = new PrintWriter(new FileWriter(new File(nome)))) { for(i=0;i<tamanho_agentes;i++) { if(tipo==0) { tamanho=agentes.get(i).memoria.size(); f.print("A memória do "); if(agentes.get(i).tipo==1) { f.println("Robot Aleatório é: "); } if(agentes.get(i).tipo==2) { f.println("Robot Mais perto é:"); } if(agentes.get(i).tipo==3) { f.println("Robot Máxima diferença é:"); } for(j=0;j<tamanho;j++) { f.println(""); f.println("ID: "+agentes.get(i).memoria.get(j).id); f.println("Cor: "+agentes.get(i).memoria.get(j).cor); f.println("Forma Geometrica: "+agentes.get(i).memoria.get(j).forma_geometrica); f.println("Posição"); f.println("Coordenada x:"+agentes.get(i).memoria.get(j).posicao.getPos_x()); f.println("Coordenada y:"+agentes.get(i).memoria.get(j).posicao.getPos_y()); f.println(""); } }else { tamanho=agentes.get(i).percecoes.size(); f.print("As perceções do "); if(agentes.get(i).tipo==1) { f.println("Robot Aleatório são: "); } if(agentes.get(i).tipo==2) { f.println("Robot Mais perto são:"); } if(agentes.get(i).tipo==3) { f.println("Robot Máxima diferença são:"); } for(j=0;j<tamanho;j++) { f.println("\nID: "+agentes.get(i).percecoes.get(j).id); f.println("Cor: "+agentes.get(i).percecoes.get(j).cor); f.println("Forma Geometrica: "+agentes.get(i).percecoes.get(j).forma_geometrica); f.println("Posição"); f.println("Coordenada x:"+agentes.get(i).percecoes.get(j).posicao.getPos_x()); f.println("Coordenada y:"+agentes.get(i).percecoes.get(j).posicao.getPos_y()+"\n"); } } } f.close(); } } catch (IOException e) { Interface.janela_popup("Erro"); } } /** * Método que escreve ficheiro com o caminho do agente * @param nome nome do ficheiro * @throws IOException */ public void escrever_ficheiro_coordenadas(String nome) throws IOException { int i,tamanho_agentes=agentes.size(); int j,tamanho; try { try (PrintWriter f = new PrintWriter(new FileWriter(new File(nome)))) { for(i=0;i<tamanho_agentes;i++) { tamanho=agentes.get(i).caminho.size(); f.print("O caminho do "); if(agentes.get(i).tipo==1) { f.println("Robot Aleatório foi:\n"); } if(agentes.get(i).tipo==2) { f.println("Robot Mais perto foi:\n"); } if(agentes.get(i).tipo==3) { f.println("Robot Máxima diferença foi:\n"); } for(j=0;j<tamanho;j++) { f.println((j+1)+"ªPosição-("+agentes.get(i).caminho.get(j).getPos_x()+","+agentes.get(i).caminho.get(j).getPos_y()+")\n"); } } f.close(); } } catch (IOException e) { Interface.janela_popup("Erro"); } } /** * Método que escreve ficheiro de estatísticas * @throws IOException */ public void escrever_ficheiro_info () throws IOException{ try{ try(PrintWriter f = new PrintWriter(new FileWriter(new File("info.txt")))){ for(Agente A : agentes){ f.println("Robot "+A.id+":"); f.format("\tDistância Percorrida = %.2f", A.dist_percorrida); f.println(""); f.println("\tNº de objectos diferentes aprendidos: "+A.n_obj_dif); f.println("\tNº de objectos aprendidos: "+A.n_obj); } f.close(); } } catch (IOException e) { Interface.janela_popup("Erro"); } } /** * Método que lê o ficheiro de configurações e configura o ambiente com os dados em ficheiro * @throws IOException */ public void ler_ficheiro_config() throws IOException{ try{ String tipo, cor, forma; int i, id = 0, pos_x, pos_y, campo_visao; try(BufferedReader f = new BufferedReader(new FileReader(new File("config.txt")))){ // lê linhas iniciais do ficheiro for(i=0;i<2;i++){ f.readLine(); } // lê configurações do ambiente String linha = f.readLine(); setLargura(Integer.parseInt(linha.substring(9))); linha = f.readLine(); setComprimento(Integer.parseInt(linha.substring(13))); linha = f.readLine(); setTV(Integer.parseInt(linha.substring(15))); // lê título intermédio do ficheiro for(i=0;i<3;i++){ f.readLine(); } // lê o ficheiro restante até ao fim - configurações de agentes e objectos while((linha = f.readLine()) != null) { if(linha.equals("Agente")){ // lê todas as características do agente linha = f.readLine(); tipo = linha.substring(6); linha = f.readLine(); cor = linha.substring(5); linha = f.readLine(); forma = linha.substring(18); linha = f.readLine(); pos_x = Integer.parseInt(linha.substring(11)); linha = f.readLine(); pos_y = Integer.parseInt(linha.substring(11)); linha = f.readLine(); campo_visao = Integer.parseInt(linha.substring(16)); // cria agente switch(tipo){ case "Aleatório": { Aleatorio agente = new Aleatorio(id++, cor, forma, pos_x, pos_y, campo_visao); // adiciona o agente ao array de agentes agentes.add(agente); // adiciona a primeira posição do agente ao caminho if(verifica_coord(pos_x, pos_y)){ Coordenadas pos = new Coordenadas (pos_x, pos_y); agente.caminho.add(pos); } else{ Interface.janela_popup(String.format("Coordenadas do Agente %d inválidas! Corrija o ficheiro, por favor.\n", agente.id)); System.exit(0); } break; } case "MaxDif": { Max_dif agente = new Max_dif(id++, cor, forma, pos_x, pos_y, campo_visao); // adiciona o agente ao array de agentes agentes.add(agente); // adiciona a primeira posição do agente ao caminho if(verifica_coord(pos_x, pos_y)){ Coordenadas pos = new Coordenadas (pos_x, pos_y); agente.caminho.add(pos); } else{ Interface.janela_popup(String.format("Coordenadas do Agente %d inválidas! Corrija o ficheiro, por favor.\n", agente.id)); System.exit(0); } break; } case "MaisPerto": { Mais_perto agente = new Mais_perto(id++, cor, forma, pos_x, pos_y, campo_visao); // adiciona o agente ao array de agentes agentes.add(agente); // adiciona a primeira posição do agente ao caminho if(verifica_coord(pos_x, pos_y)){ Coordenadas pos = new Coordenadas (pos_x, pos_y); agente.caminho.add(pos); } else{ Interface.janela_popup(String.format("Coordenadas do Agente %d inválidas! Corrija o ficheiro, por favor.\n", agente.id)); System.exit(0); } break; } } // lê linha de intervalo f.readLine(); } else if (linha.equals("Objecto")){ // lê todas as características do objecto linha = f.readLine(); tipo = linha.substring(6); linha = f.readLine(); cor = linha.substring(5); linha = f.readLine(); forma = linha.substring(18); linha = f.readLine(); pos_x = Integer.parseInt(linha.substring(11)); linha = f.readLine(); pos_y = Integer.parseInt(linha.substring(11)); // cria objecto Objecto obj = new Objecto(id++, cor, forma, pos_x, pos_y, tipo); // adiciona o objecto ao array de objectos objectos.add(obj); // lê linha de intervalo f.readLine(); } } f.close(); } catch (FileNotFoundException e){ Interface.janela_popup("Ficheiro inexistente!"); } } catch (IOException e){ Interface.janela_popup("Erro ao ler uma linha do ficheiro."); } } /** * Método que verifica se as coordenadas estão dentro do ambiente * @param pos_x coordenada x * @param pos_y coordenada y * @return true/false caso as coordenadas estejam dentro ou fora do ambiente, respectivamente */ public boolean verifica_coord(int pos_x, int pos_y){ return !(pos_x < 0 || pos_x >= comprimento || pos_y < 0 || pos_y >= largura); } }
true
c8b89331604f20c814e41938ac5a0b19e6a22413
Java
Ivan-SHCH/academy
/academy/src/by/academy/task/array/TaskArray5.java
UTF-8
2,148
4.125
4
[]
no_license
package by.academy.task.array; import java.util.Arrays; import java.util.Random; public class TaskArray5 { // Задача 5. // Создайте 2 массива из 5 случайных целых чисел из отрезка [0;5] каждый, // выведите массивы на экран в двух отдельных строках. Посчитайте среднее арифметическое элементов каждого массива и сообщите, // для какого из массивов это значение оказалось больше (либо сообщите, что их средние арифметические равны). public static void main(String[] args) { int[] arr1 = new int[5]; int[] arr2 = new int[5]; int result1 = 0; int result2 = 0; double midle1; double midle2; Random rand = new Random(); for (int i = 0; i < 5; i++) { arr1[i] = rand.nextInt(5); arr2[i] = rand.nextInt(5); } System.out.println(Arrays.toString(arr1)); System.out.println(Arrays.toString(arr2)); for (int i = 0; i < 5; i++) { result1 += arr1[i]; result2 += arr2[i]; } System.out.println("Сумма первого массива: " + result1); System.out.println("Сумма второго массива: " + result2); System.out.println("Среднеарифметическое число первого массива: " + (midle1 =(double) result1 / 5)); System.out.println("Среднеарифметическое число второго массива: " + (midle2 =(double) result2 / 5)); if(midle1 > midle2) { System.out.println("Среднеарифметическое число" + " первого массива больше чем у второго."); } else if (midle1 == midle2) { System.out.println("Среднеарифметические числа равны!"); } else { System.out.println("Среднеарифметическое число" + " второго массива больше чем у первого."); } } }
true
2839ad72b555fc7d6bd89e6be63374e14b7254f4
Java
bgfintech/bg
/bgwx/src/com/bg/interfaces/entity/internal/CountDetail.java
UTF-8
3,174
1.734375
2
[]
no_license
package com.bg.interfaces.entity.internal; public class CountDetail { private String count_yuangao; private String count_wei_yuangao; private String count_beigao; private String count_wei_beigao; private String count_other; private String count_wei_other; private String money_yuangao; private String money_wei_yuangao; private String money_beigao; private String money_wei_beigao; private String money_other; private String money_wei_other; private String area_stat; private String ay_stat; private String larq_stat; private String jafs_stat; public String getCount_yuangao() { return count_yuangao; } public void setCount_yuangao(String count_yuangao) { this.count_yuangao = count_yuangao; } public String getCount_wei_yuangao() { return count_wei_yuangao; } public void setCount_wei_yuangao(String count_wei_yuangao) { this.count_wei_yuangao = count_wei_yuangao; } public String getCount_beigao() { return count_beigao; } public void setCount_beigao(String count_beigao) { this.count_beigao = count_beigao; } public String getCount_wei_beigao() { return count_wei_beigao; } public void setCount_wei_beigao(String count_wei_beigao) { this.count_wei_beigao = count_wei_beigao; } public String getCount_other() { return count_other; } public void setCount_other(String count_other) { this.count_other = count_other; } public String getCount_wei_other() { return count_wei_other; } public void setCount_wei_other(String count_wei_other) { this.count_wei_other = count_wei_other; } public String getMoney_yuangao() { return money_yuangao; } public void setMoney_yuangao(String money_yuangao) { this.money_yuangao = money_yuangao; } public String getMoney_wei_yuangao() { return money_wei_yuangao; } public void setMoney_wei_yuangao(String money_wei_yuangao) { this.money_wei_yuangao = money_wei_yuangao; } public String getMoney_beigao() { return money_beigao; } public void setMoney_beigao(String money_beigao) { this.money_beigao = money_beigao; } public String getMoney_wei_beigao() { return money_wei_beigao; } public void setMoney_wei_beigao(String money_wei_beigao) { this.money_wei_beigao = money_wei_beigao; } public String getMoney_other() { return money_other; } public void setMoney_other(String money_other) { this.money_other = money_other; } public String getMoney_wei_other() { return money_wei_other; } public void setMoney_wei_other(String money_wei_other) { this.money_wei_other = money_wei_other; } public String getArea_stat() { return area_stat; } public void setArea_stat(String area_stat) { this.area_stat = area_stat; } public String getAy_stat() { return ay_stat; } public void setAy_stat(String ay_stat) { this.ay_stat = ay_stat; } public String getLarq_stat() { return larq_stat; } public void setLarq_stat(String larq_stat) { this.larq_stat = larq_stat; } public String getJafs_stat() { return jafs_stat; } public void setJafs_stat(String jafs_stat) { this.jafs_stat = jafs_stat; } }
true
4b04e9c49562af7e431e36541e86946f9511fb4b
Java
treejames/ProductScanner
/src/com/google/zxing/client/android/ViewfinderView.java
UTF-8
6,841
2.0625
2
[]
no_license
/* * Copyright (C) 2008 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.zxing.client.android ; import java.util.ArrayList ; import java.util.List ; import java.util.concurrent.atomic.AtomicReference ; import org.footoo.productscanner.R ; import android.content.Context ; import android.content.res.Resources ; import android.graphics.Bitmap ; import android.graphics.Canvas ; import android.graphics.Paint ; import android.graphics.Rect ; import android.util.AttributeSet ; import android.view.View ; import com.google.zxing.ResultPoint ; import com.google.zxing.client.android.camera.CameraManager ; /** * This view is overlaid on top of the camera preview. It adds the viewfinder * rectangle and partial transparency outside it, as well as the laser scanner * animation and result points. * * @author dswitkin@google.com (Daniel Switkin) */ public final class ViewfinderView extends View { private static final int[] SCANNER_ALPHA = { 0 , 64 , 128 , 192 , 255 , 192 , 128 , 64 } ; private static final long ANIMATION_DELAY = 80L ; private static final int CURRENT_POINT_OPACITY = 0xA0 ; private static final int MAX_RESULT_POINTS = 20 ; private final Paint paint ; private Bitmap resultBitmap ; private final int maskColor ; private final int resultColor ; private final int frameColor ; private final int laserColor ; private final int resultPointColor ; private int scannerAlpha ; private final AtomicReference< List< ResultPoint >> possibleResultPoints ; private final AtomicReference< List< ResultPoint >> lastPossibleResultPoints ; // This constructor is used when the class is built from an XML resource. public ViewfinderView( Context context , AttributeSet attrs ) { super( context , attrs ) ; // Initialize these once for performance rather than calling them every // time in onDraw(). paint = new Paint() ; Resources resources = getResources() ; maskColor = resources.getColor( R.color.viewfinder_mask ) ; resultColor = resources.getColor( R.color.result_view ) ; frameColor = resources.getColor( R.color.viewfinder_frame ) ; laserColor = resources.getColor( R.color.viewfinder_laser ) ; resultPointColor = resources.getColor( R.color.possible_result_points ) ; scannerAlpha = 0 ; possibleResultPoints = new AtomicReference< List< ResultPoint >>() ; lastPossibleResultPoints = new AtomicReference< List< ResultPoint >>() ; possibleResultPoints.set( new ArrayList< ResultPoint >( 5 ) ) ; } @Override public void onDraw( Canvas canvas ) { Rect frame = CameraManager.get().getFramingRect() ; if( frame == null ) { return ; } int width = canvas.getWidth() ; int height = canvas.getHeight() ; // Draw the exterior (i.e. outside the framing rect) darkened paint.setColor( resultBitmap != null ? resultColor : maskColor ) ; canvas.drawRect( 0 , 0 , width , frame.top , paint ) ; canvas.drawRect( 0 , frame.top , frame.left , frame.bottom + 1 , paint ) ; canvas.drawRect( frame.right + 1 , frame.top , width , frame.bottom + 1 , paint ) ; canvas.drawRect( 0 , frame.bottom + 1 , width , height , paint ) ; if( resultBitmap != null ) { // Draw the opaque result bitmap over the scanning rectangle paint.setAlpha( CURRENT_POINT_OPACITY ) ; canvas.drawBitmap( resultBitmap , null , frame , paint ) ; } else { // Draw a two pixel solid black border inside the framing rect paint.setColor( frameColor ) ; canvas.drawRect( frame.left , frame.top , frame.right + 1 , frame.top + 2 , paint ) ; canvas.drawRect( frame.left , frame.top + 2 , frame.left + 2 , frame.bottom - 1 , paint ) ; canvas.drawRect( frame.right - 1 , frame.top , frame.right + 1 , frame.bottom - 1 , paint ) ; canvas.drawRect( frame.left , frame.bottom - 1 , frame.right + 1 , frame.bottom + 1 , paint ) ; // Draw a red "laser scanner" line through the middle to show // decoding is active paint.setColor( laserColor ) ; paint.setAlpha( SCANNER_ALPHA[ scannerAlpha ] ) ; scannerAlpha = ( scannerAlpha + 1 ) % SCANNER_ALPHA.length ; int middle = frame.height() / 2 + frame.top ; canvas.drawRect( frame.left + 2 , middle - 1 , frame.right - 1 , middle + 2 , paint ) ; Rect previewFrame = CameraManager.get().getFramingRectInPreview() ; float scaleX = frame.width() / ( float )previewFrame.width() ; float scaleY = frame.height() / ( float )previewFrame.height() ; List< ResultPoint > currentPossible = possibleResultPoints.get() ; List< ResultPoint > currentLast = lastPossibleResultPoints.get() ; if( currentPossible.isEmpty() ) { lastPossibleResultPoints.set( null ) ; } else { possibleResultPoints.set( new ArrayList< ResultPoint >( 5 ) ) ; lastPossibleResultPoints.set( currentPossible ) ; paint.setAlpha( CURRENT_POINT_OPACITY ) ; paint.setColor( resultPointColor ) ; for( ResultPoint point : currentPossible ) { canvas.drawCircle( frame.left + ( int )( point.getX() * scaleX ) , frame.top + ( int )( point.getY() * scaleY ) , 6.0f , paint ) ; } } if( currentLast != null ) { paint.setAlpha( CURRENT_POINT_OPACITY / 2 ) ; paint.setColor( resultPointColor ) ; for( ResultPoint point : currentLast ) { canvas.drawCircle( frame.left + ( int )( point.getX() * scaleX ) , frame.top + ( int )( point.getY() * scaleY ) , 3.0f , paint ) ; } } // Request another update at the animation interval, but only // repaint the laser line, // not the entire viewfinder mask. postInvalidateDelayed( ANIMATION_DELAY , frame.left , frame.top , frame.right , frame.bottom ) ; } } public void drawViewfinder() { resultBitmap = null ; invalidate() ; } /** * Draw a bitmap with the result points highlighted instead of the live * scanning display. * * @param barcode * An image of the decoded barcode. */ public void drawResultBitmap( Bitmap barcode ) { resultBitmap = barcode ; invalidate() ; } public void addPossibleResultPoint( ResultPoint point ) { List< ResultPoint > points = possibleResultPoints.get() ; points.add( point ) ; if( points.size() > MAX_RESULT_POINTS ) { // trim it points.subList( 0 , points.size() - MAX_RESULT_POINTS / 2 ).clear() ; } } }
true
77ac4d069fd160081eff06639d4eff0eb8664216
Java
yadav15198/MovieDbApp
/app/src/main/java/com/example/hp/moviedbapp/MoviesFragment.java
UTF-8
5,985
2.109375
2
[]
no_license
package com.example.hp.moviedbapp; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Context; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.app.Fragment; import android.provider.SyncStateContract; import android.support.annotation.RequiresApi; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link MoviesFragment.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link MoviesFragment#newInstance} factory method to * create an instance of this fragment. */ public class MoviesFragment extends android.support.v4.app.Fragment implements ListFragment.OnFragmentInteractionListener{ Bundle bundle1= new Bundle();Bundle bundle2 = new Bundle(); Bundle bundle3 = new Bundle();Bundle bundle4 = new Bundle(); ListFragment listFragment1 = new ListFragment();ListFragment listFragment2 = new ListFragment(); ListFragment listFragment3 = new ListFragment();ListFragment listFragment4 = new ListFragment(); // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; public MoviesFragment() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment MoviesFragment. */ // TODO: Rename and change types and number of parameters public static MoviesFragment newInstance(String param1, String param2) { MoviesFragment fragment = new MoviesFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1) @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View output = inflater.inflate(R.layout.fragment_movies, container, false); android.support.v4.app.FragmentManager manager=getChildFragmentManager(); bundle1.putString(Contracts.TYPE, Contracts.NOW_SHOWING_MOVIES); bundle1.putString(Contracts.FRAGMENT,Contracts.MOVIES_FRAGMENT); listFragment1.setArguments(bundle1); android.support.v4.app.FragmentTransaction transaction1=manager.beginTransaction(); transaction1.replace(R.id.NowshowingContainer,listFragment1); transaction1.commit(); bundle2.putString(Contracts.TYPE, Contracts.POPULAR_MOVIES); bundle2.putString(Contracts.FRAGMENT,Contracts.MOVIES_FRAGMENT); listFragment2.setArguments(bundle2); android.support.v4.app.FragmentTransaction transaction2=manager.beginTransaction(); transaction1.replace(R.id.popularContainer,listFragment2); transaction2.commit(); bundle3.putString(Contracts.TYPE, Contracts.TOP_RATED_MOVIES); bundle3.putString(Contracts.FRAGMENT,Contracts.MOVIES_FRAGMENT); listFragment3.setArguments(bundle3); android.support.v4.app.FragmentTransaction transaction3=manager.beginTransaction(); transaction1.replace(R.id.TopratedContainer,listFragment3); transaction3.commit(); bundle4.putString(Contracts.TYPE, Contracts.UPCOMING_MOVIES); bundle4.putString(Contracts.FRAGMENT,Contracts.MOVIES_FRAGMENT); listFragment4.setArguments(bundle4); android.support.v4.app.FragmentTransaction transaction4=manager.beginTransaction(); transaction1.replace(R.id.UpcomingContainer,listFragment4); transaction4.commit(); return output; } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } } @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else { throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } @Override public void onFragmentInteraction(Uri uri) { } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }
true
f070c846c504c20083dfa76f9a01db44eac08460
Java
cm1997/test
/ELSClientModule/src/main/java/org/cross/elsclient/blimpl/constantblimpl/ConstantInfoImpl.java
UTF-8
2,773
2.234375
2
[]
no_license
package org.cross.elsclient.blimpl.constantblimpl; import org.cross.elsclient.blimpl.blUtility.ConstantInfo; import org.cross.elsclient.vo.ConstantVO; import org.cross.elscommon.po.ConstantPO; import org.cross.elscommon.util.PositionType; import org.cross.elscommon.util.UserType; public class ConstantInfoImpl implements ConstantInfo{ @Override public ConstantVO toConstantVO(ConstantPO po) { ConstantVO vo = new ConstantVO(); vo.baseMoneyForADMINISTRATOR = po.getBaseMoney(PositionType.ADMINISTRATOR); vo.baseMoneyForBUSINESSHALLCLERK = po.getBaseMoney(PositionType.BUSINESSHALLCLERK); vo.baseMoneyForCOUNTER = po.getBaseMoney(PositionType.COUNTER); vo.baseMoneyForCOURIER = po.getBaseMoney(PositionType.COURIER); vo.baseMoneyForMANAGER = po.getBaseMoney(PositionType.MANAGER); vo.baseMoneyForSTOCKKEEPER = po.getBaseMoney(PositionType.STOCKKEEPER); vo.baseMoneyForTRANSITCENTERCLERK = po.getBaseMoney(PositionType.TRANSITCENTERCLERK); vo.baseMoneyForDriver = po.getBaseMoney(PositionType.DRIVER); vo.distance_Beijing_Guangzhou = po.getDistance_Beijing_Guangzhou(); vo.distance_Beijing_Nanjing = po.getDistance_Beijing_Nanjing(); vo.distance_Beijing_Shanghai = po.getDistance_Beijing_Shanghai(); vo.distance_Nanjing_Guangzhou = po.getDistance_Nanjing_Guangzhou(); vo.distance_Nanjing_Shanghai = po.getDistance_Nanjing_Shanghai(); vo.distance_Shanghai_Guangzhou = po.getDistance_Shanghai_Guangzhou(); vo.price = po.getPrice(); vo.timeBykilo = po.getTimeBykilo(); vo.once = po.getOnce(); vo.num = po.getNum(); return vo; } @Override public ConstantPO toConstantPO(ConstantVO vo) { ConstantPO po = new ConstantPO(); po.setBaseMoney(PositionType.ADMINISTRATOR, vo.baseMoneyForADMINISTRATOR); po.setBaseMoney(PositionType.BUSINESSHALLCLERK, vo.baseMoneyForBUSINESSHALLCLERK); po.setBaseMoney(PositionType.COUNTER, vo.baseMoneyForCOUNTER); po.setBaseMoney(PositionType.COURIER, vo.baseMoneyForCOURIER); po.setBaseMoney(PositionType.MANAGER, vo.baseMoneyForMANAGER); po.setBaseMoney(PositionType.STOCKKEEPER, vo.baseMoneyForSTOCKKEEPER); po.setBaseMoney(PositionType.TRANSITCENTERCLERK, vo.baseMoneyForTRANSITCENTERCLERK); po.setBaseMoney(PositionType.DRIVER, vo.baseMoneyForDriver); po.setPrice(vo.price); po.setTimeBykilo(vo.timeBykilo); po.setDistance_Beijing_Guangzhou(vo.distance_Beijing_Guangzhou); po.setDistance_Beijing_Nanjing(vo.distance_Beijing_Nanjing); po.setDistance_Beijing_Shanghai(vo.distance_Beijing_Shanghai); po.setDistance_Nanjing_Guangzhou(vo.distance_Nanjing_Guangzhou); po.setDistance_Nanjing_Shanghai(vo.distance_Nanjing_Shanghai); po.setDistance_Shanghai_Guangzhou(vo.distance_Shanghai_Guangzhou); po.setOnce(vo.once); po.setNum(vo.num); return po; } }
true
47a48fe1c4074f02bdb67e35367e2b4544a995cc
Java
Eazash/hillfog
/core-app/src/org/qifu/core/api/HelloApiController.java
UTF-8
2,453
1.890625
2
[]
no_license
///* // * Copyright 2019-2021 qifu of copyright Chen Xin Nien // * // * Licensed under the Apache License, Version 2.0 (the "License"); // * you may not use this file except in compliance with the License. // * You may obtain a copy of the License at // * // * http://www.apache.org/licenses/LICENSE-2.0 // * // * Unless required by applicable law or agreed to in writing, software // * distributed under the License is distributed on an "AS IS" BASIS, // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // * See the License for the specific language governing permissions and // * limitations under the License. // * // * ----------------------------------------------------------------------- // * // * author: Chen Xin Nien // * contact: chen.xin.nien@gmail.com // * // */ //package org.qifu.core.api; // //import org.qifu.base.model.DefaultResult; //import org.qifu.core.entity.TbAccount; //import org.qifu.core.service.IAccountService; //import org.qifu.core.util.CoreApiSupport; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.stereotype.Controller; //import org.springframework.web.bind.annotation.GetMapping; //import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.ResponseBody; // //import io.swagger.annotations.Api; //import io.swagger.annotations.ApiImplicitParam; //import io.swagger.annotations.ApiOperation; // //@Api //@Controller //@RequestMapping(value = "/helloApi") //public class HelloApiController extends CoreApiSupport { // // private static final long serialVersionUID = -2710621780849674671L; // // @Autowired // IAccountService<TbAccount, String> accountService; // // @ApiOperation(value="測試", notes="測試用的接口") // @ApiImplicitParam(name = "msg", value = "訊息字串", required = true, dataType = "String") // @ResponseBody // @GetMapping("/play") // public String play(String msg) { // // try { // DefaultResult<TbAccount> result = accountService.selectByPrimaryKey("15822da5-25dc-490c-bdfb-be75f5ff4843"); // if (result.getValue() != null) { // System.out.println("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"); // System.out.println( result.getValue().getAccount() ); // } else { // System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); // } // // } catch (Exception e) { // e.printStackTrace(); // } // // return "測試=" + msg; // } // //}
true
4a0a0b65631e94f0aa5c1515c117c007f4c9cc16
Java
ochaloup/transactions-metrics-servlet-test
/src/main/java/org/jboss/qa/ochaloup/utils/Database.java
UTF-8
4,459
2.328125
2
[]
no_license
/* * JBoss, Home of Professional Open Source. * Copyright 2016, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.qa.ochaloup.utils; import javax.sql.DataSource; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; public final class Database { private static final String ID_COLUMN_NAME = "id"; private static final String VALUE_COLUMN_NAME = "a"; private Database() { // just util class } public static void createTable(DataSource ds, String tableName) { try(Connection conn = ds.getConnection()) { conn.createStatement().executeUpdate( String.format("CREATE TABLE %s (%s INT, %s VARCHAR(255))", tableName, ID_COLUMN_NAME, VALUE_COLUMN_NAME)); } catch (Exception sqle) { throw new RuntimeException("can't create table", sqle); } } public static int selectCount(DataSource ds, String tableName) { try(Connection conn = ds.getConnection()) { ResultSet resultset = conn.createStatement().executeQuery(String.format("SELECT count(1) FROM %s", tableName)); if(resultset.next()) { return resultset.getInt(1); } else { return Integer.MIN_VALUE; } } catch (SQLException sqle) { throw new RuntimeException("select failed", sqle); } } public static void doInsert(DataSource ds, String tableName, int id, String value) { try(Connection conn = ds.getConnection()) { int updated = conn.createStatement().executeUpdate( String.format("INSERT INTO %s (id, a) VALUES (%s,'%s')", tableName, id, value)); System.out.println("INSERT to table " + tableName + " outcome: " + updated); } catch (SQLException sqle) { throw new RuntimeException("insert failed", sqle); } } public static void doUpdate(DataSource ds, String tableName, int id, String value) { try(Connection conn = ds.getConnection()) { int updated = conn.createStatement().executeUpdate( String.format("UPDATE %s SET %s='%s' WHERE %s=%s", tableName, VALUE_COLUMN_NAME, value, ID_COLUMN_NAME, id)); System.out.println("UPDATE to table " + tableName + " outcome: " + updated); } catch (SQLException sqle) { throw new RuntimeException("update failed", sqle); } } public static void doDelete(DataSource ds, String tableName) { try(Connection conn = ds.getConnection()) { conn.createStatement().executeUpdate(String.format("DELETE FROM %s", tableName)); } catch (SQLException sqle) { throw new RuntimeException("delete failed", sqle); } } public static List<String> doSelect(DataSource ds, String tableName, int id) { try(Connection conn = ds.getConnection()) { ResultSet resultset = conn.createStatement().executeQuery( String.format("SELECT %s FROM %s WHERE %s = %s", VALUE_COLUMN_NAME, tableName, ID_COLUMN_NAME, id)); List<String> result = new ArrayList<>(); while(resultset.next()) { result.add(resultset.getString(1)); } return result; } catch (SQLException sqle) { throw new RuntimeException("Select of id " + id + " in table " + tableName + " failed", sqle); } } }
true
64256cec71b039e3f2c7c78a99062baa530fa031
Java
kelvinkellner/ICS4UI
/Unit Five/src/project/spaceinvaders/Creature.java
UTF-8
347
2.359375
2
[]
no_license
package project.spaceinvaders; public class Creature extends Element { int bulletType; Creature(int x, int y, int w, int h, String f, int b) { super(x,y,w,h,f); this.bulletType=b; } public void shoot() { if(bulletType==0) new Bullet(super.getxPos(),super.getyPos(),4,4,"BULLET0.jpeg",1,"blue",-1,0,true); } }
true
02c3a87f03e32629f30334b9825ed9d6675aa35c
Java
divijsethi822348/RecyclerView
/app/src/main/java/com/example/recyclerview/Adapters/StoryAdapter.java
UTF-8
1,609
2.359375
2
[]
no_license
package com.example.recyclerview.Adapters; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.example.recyclerview.Activities.Model2; import com.example.recyclerview.R; import java.util.List; import de.hdodenhof.circleimageview.CircleImageView; public class StoryAdapter extends RecyclerView.Adapter<StoryAdapter.MyViewHolder> { private List<Model2> List2; public StoryAdapter(List<Model2> List2) { this.List2=List2; } @NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.stories_child,viewGroup,false); return new StoryAdapter.MyViewHolder(itemView); } @Override public void onBindViewHolder(@NonNull MyViewHolder myViewHolder, int i) { Model2 model2=List2.get(i); myViewHolder.story.setImageResource(model2.getStory()); myViewHolder.snm.setText(model2.getSnm()); } @Override public int getItemCount() { return List2.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { public CircleImageView story; public TextView snm; public MyViewHolder(@NonNull View itemView) { super(itemView); story=(CircleImageView)itemView.findViewById(R.id.story); snm=(TextView)itemView.findViewById(R.id.snm); } } }
true
0010edd22bfd87a0c4add65d09dae6905fd30c78
Java
pmerg/cucumber
/cucumber-expressions/java/src/main/java/io/cucumber/cucumberexpressions/ParameterType.java
UTF-8
1,174
2.375
2
[ "MIT" ]
permissive
package io.cucumber.cucumberexpressions; import java.lang.reflect.Type; import java.util.List; public interface ParameterType<T> { /** * This is used in the type name in typed expressions * * @return human readable type name */ String getName(); Type getType(); List<String> getRegexps(); T transform(String value); /** * Indicates whether or not this is a preferential parameter type when matching text * against a {@link RegularExpression}. In case there are multiple parameter types * with a regexp identical to the capture group's regexp, a preferential parameter type will * win. If there are more than 1 preferential ones, an error will be thrown. * * @return true if this is a preferential type */ boolean preferForRegexpMatch(); /** * Indicates whether or not this is a parameter type that should be used for generating * {@link GeneratedExpression}s from text. Typically, parameter types with greedy regexps * should return false. * * @return true is this parameter type is used for expression generation */ boolean useForSnippets(); }
true
b2832496919c835c4c86a1eaf7d4a6bcd9a5e066
Java
hzieedu/bobo
/bobo-server/src/main/java/com/dudu/bobo/server/support/BoboServer.java
UTF-8
3,339
2.375
2
[]
no_license
package com.dudu.bobo.server.support; import java.util.Properties; import java.io.InputStream; import java.io.IOException; import com.dudu.bobo.common.Node; import com.dudu.bobo.common.InetNode; import com.dudu.bobo.server.RpcSkeletonContainer; import com.dudu.bobo.server.RpcSkeleton; import com.dudu.bobo.server.ServiceRegister; /** * * @author liangy43 * */ public class BoboServer { private static volatile BoboServer instance = null; private BoboServer() { } public static BoboServer getBoboServer() { /* * double check lock */ if (instance == null) { synchronized (NioServingConnector.class) { BoboServer server = new BoboServer(); instance = server; return instance; } } return instance; } // 全局模块 private ServiceRegister serviceRegister; private RpcSkeletonContainer skeletonContainer; private FixThreadPoolExecutor executor; private NioServingConnector serverConnector; private static final Node servingHost; // 从properties配置文件读取服务地址及端口 static { Properties prop = new Properties(); String hostName = "0.0.0.0"; String port = "28800"; try { InputStream in = BoboServer.class.getResourceAsStream("/server.properties"); if (in != null) { prop.load(in); hostName = prop.getProperty("ip").trim(); port = prop.getProperty("port").trim(); } } catch (IOException e) { e.printStackTrace(); } finally { System.out.println(String.format("服务地址: [%s:%s]", hostName, port)); servingHost = new InetNode(hostName, Integer.parseInt(port)); } } /** * 导出并发布服务 * * @param service * @param clazz */ public void export(Object service, Class<?> clazz) { if (clazz.isInstance(service) == false) { return; } // 添加skeleton RpcSkeleton rpcSkeleton = new RpcSkeletonImpl(service, clazz); skeletonContainer.registerRpcSkeleton(rpcSkeleton); // 发布 // serviceRegister.publishService(rpcSkeleton.getClass()); } /** * 导出服务 * * @param service * @param clazz */ public void exportWithoutPublish(Object service, Class<?> clazz) { if (clazz.isInstance(service) == false) { return; } // 添加skeleton RpcSkeleton rpcSkeleton = new RpcSkeletonImpl(service, clazz); skeletonContainer.registerRpcSkeleton(rpcSkeleton); } /** * 实例化, 装配及启动 */ public void startServing() { executor = FixThreadPoolExecutor.getExecutor(); serverConnector = NioServingConnector.getServingConnector(); skeletonContainer = RpcSkeletonContainer.getRpcSkeletonContainer(); executor.setRpcSkeletonContainer(skeletonContainer); executor.setServerConnector(serverConnector); serverConnector.setExecutor(executor); serverConnector.setServingHost(servingHost); executor.start(); serverConnector.start(); } }
true
3acf70fbb7d9c213c53cf430b97320dbb81cc995
Java
pittbullnt/chargen
/src/chargen/Chargen.java
UTF-8
63,661
3.34375
3
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package chargen; import java.util.HashMap; /** * * @author Administrator */ public class Chargen { private final HashMap<Character, Integer> map = new HashMap<>(); private char pixel = 'O'; public Chargen (char pix) { this(); pixel = pix; } /** * Constructor, fills the char map */ public Chargen() { map.put('0', 0x980); map.put('1', 0x988); map.put('2', 0x990); map.put('3', 0x998); map.put('4', 0x9a0); map.put('5', 0x9a8); map.put('6', 0x9b0); map.put('7', 0x9b8); map.put('8', 0x9c0); map.put('9', 0x9c8); map.put('a', 0x808); map.put('b', 0x810); map.put('c', 0x818); map.put('d', 0x820); map.put('e', 0x828); map.put('f', 0x830); map.put('g', 0x838); map.put('h', 0x840); map.put('i', 0x848); map.put('j', 0x850); map.put('k', 0x858); map.put('l', 0x860); map.put('m', 0x868); map.put('n', 0x870); map.put('o', 0x878); map.put('p', 0x880); map.put('q', 0x888); map.put('r', 0x890); map.put('s', 0x898); map.put('t', 0x8a0); map.put('u', 0x8a8); map.put('v', 0x8b0); map.put('w', 0x8b8); map.put('x', 0x8c0); map.put('y', 0x8c8); map.put('z', 0x8d0); map.put('A', 0x008); map.put('B', 0x010); map.put('C', 0x018); map.put('D', 0x020); map.put('E', 0x028); map.put('F', 0x030); map.put('G', 0x038); map.put('H', 0x040); map.put('I', 0x048); map.put('J', 0x050); map.put('K', 0x058); map.put('L', 0x060); map.put('M', 0x068); map.put('N', 0x070); map.put('O', 0x078); map.put('P', 0x080); map.put('Q', 0x088); map.put('R', 0x090); map.put('S', 0x098); map.put('T', 0x0a0); map.put('U', 0x0a8); map.put('V', 0x0b0); map.put('W', 0x0b8); map.put('X', 0x0c0); map.put('Y', 0x0c8); map.put('Z', 0x0d0); map.put('[', 0x8d8); //map.put (); // Pound map.put(']', 0x8e8); map.put('^', 0x8f0); map.put(' ', 0x900); map.put('!', 0x908); map.put('"', 0x910); map.put('#', 0x918); map.put('$', 0x920); map.put('%', 0x928); map.put('&', 0x930); map.put('\'', 0x938); map.put('(', 0x940); map.put(')', 0x948); map.put('*', 0x950); map.put('+', 0x958); map.put(',', 0x960); map.put('-', 0x968); map.put('.', 0x970); map.put('/', 0x978); } /** * Get 8 pixels as chars * @param idx index into charge table * @return char array of pixels in row */ private char[] getRow(int idx) { char[] chrs = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', }; int c = c64Chargen[idx]; int i = 128; for (int s = 0; s < 8; s++) { if ((c & i) == i) { chrs[s] = pixel; } i >>>= 1; } return chrs; } /** * Get all rows of a character * @param idx The starting index of a char * @return two dimensional array */ private char[][] getRows(int idx) { char[][] res = new char[8][8]; for (int s = 0; s < 8; s++) { res[s] = getRow(idx++); } return res; } /** * Get char as printable string * @param idx starting index * @return string that is the char */ private String getCharAt(int idx) { StringBuilder out = new StringBuilder(); for (int s = 0; s < 8; s++) { out.append(getRow(idx++)).append("\n"); } return out.toString(); } /** * Get multiple chars as printable String * @param chars * @return */ public String getLine(int... chars) { StringBuilder out = new StringBuilder(); char[][][] all = new char[chars.length][8][8]; for (int s = 0; s < chars.length; s++) { all[s] = getRows(chars[s]); } for (int r = 0; r < 8; r++) { for (int s = 0; s < chars.length; s++) { out.append(all[s][r]); out.append(" "); } out.append("\n"); } return out.toString(); } /** * Translates a string and then get it as big pixel string * @param in input string * @return output string */ public String translatedLine(String in) { int[] idxs = new int[in.length()]; for (int s = 0; s < in.length(); s++) { char c = in.charAt(s); if (map.containsKey(c)) idxs[s] = map.get(c); else idxs[s] = 0x298; // dummy heart } return getLine(idxs); } /** * @param args the command line arguments */ public static void main(String[] args) { Chargen g = new Chargen('*'); //System.out.println (getCharAt(0)); //System.out.println (gtCharAt(8)); //System.out.println (getCharAt(16)); //System.out.println (getLine (0,8,16)); //System.out.println (getLine (0x800+8,0x800+16,0x800+24)); //System.out.println (translatedLine("HALLO b")); //System.out.println (translatedLine("0123456789")); System.out.println(g.translatedLine("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG")); System.out.println(g.translatedLine("the quick brown fox jumps over the lazy dog")); System.out.println(g.translatedLine("0123456789+-*/")); } private static final byte[] c64Chargen = { (byte) 0x3c, (byte) 0x66, (byte) 0x6e, (byte) 0x6e, (byte) 0x60, (byte) 0x62, (byte) 0x3c, (byte) 0x00, (byte) 0x18, (byte) 0x3c, (byte) 0x66, (byte) 0x7e, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x6c, (byte) 0x78, (byte) 0x00, (byte) 0x7e, (byte) 0x60, (byte) 0x60, (byte) 0x78, (byte) 0x60, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x7e, (byte) 0x60, (byte) 0x60, (byte) 0x78, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x6e, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x7e, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x3c, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x3c, (byte) 0x00, (byte) 0x1e, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x6c, (byte) 0x38, (byte) 0x00, (byte) 0x66, (byte) 0x6c, (byte) 0x78, (byte) 0x70, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x00, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x63, (byte) 0x77, (byte) 0x7f, (byte) 0x6b, (byte) 0x63, (byte) 0x63, (byte) 0x63, (byte) 0x00, (byte) 0x66, (byte) 0x76, (byte) 0x7e, (byte) 0x7e, (byte) 0x6e, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x0e, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x3c, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x00, (byte) 0x63, (byte) 0x63, (byte) 0x63, (byte) 0x6b, (byte) 0x7f, (byte) 0x77, (byte) 0x63, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x7e, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x3c, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x3c, (byte) 0x00, (byte) 0x0c, (byte) 0x12, (byte) 0x30, (byte) 0x7c, (byte) 0x30, (byte) 0x62, (byte) 0xfc, (byte) 0x00, (byte) 0x3c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x3c, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x10, (byte) 0x30, (byte) 0x7f, (byte) 0x7f, (byte) 0x30, (byte) 0x10, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0xff, (byte) 0x66, (byte) 0xff, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x18, (byte) 0x3e, (byte) 0x60, (byte) 0x3c, (byte) 0x06, (byte) 0x7c, (byte) 0x18, (byte) 0x00, (byte) 0x62, (byte) 0x66, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x66, (byte) 0x46, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x3c, (byte) 0x38, (byte) 0x67, (byte) 0x66, (byte) 0x3f, (byte) 0x00, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x18, (byte) 0x0c, (byte) 0x00, (byte) 0x30, (byte) 0x18, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x3c, (byte) 0xff, (byte) 0x3c, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x60, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x6e, (byte) 0x76, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x38, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x7e, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x06, (byte) 0x0c, (byte) 0x30, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x06, (byte) 0x1c, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x06, (byte) 0x0e, (byte) 0x1e, (byte) 0x66, (byte) 0x7f, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x7e, (byte) 0x60, (byte) 0x7c, (byte) 0x06, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x7e, (byte) 0x66, (byte) 0x0c, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x30, (byte) 0x0e, (byte) 0x18, (byte) 0x30, (byte) 0x60, (byte) 0x30, (byte) 0x18, (byte) 0x0e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7e, (byte) 0x00, (byte) 0x7e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x70, (byte) 0x18, (byte) 0x0c, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x70, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x08, (byte) 0x1c, (byte) 0x3e, (byte) 0x7f, (byte) 0x7f, (byte) 0x1c, (byte) 0x3e, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xe0, (byte) 0xf0, (byte) 0x38, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x1c, (byte) 0x0f, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x38, (byte) 0xf0, (byte) 0xe0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xff, (byte) 0xff, (byte) 0xc0, (byte) 0xe0, (byte) 0x70, (byte) 0x38, (byte) 0x1c, (byte) 0x0e, (byte) 0x07, (byte) 0x03, (byte) 0x03, (byte) 0x07, (byte) 0x0e, (byte) 0x1c, (byte) 0x38, (byte) 0x70, (byte) 0xe0, (byte) 0xc0, (byte) 0xff, (byte) 0xff, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xff, (byte) 0xff, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x00, (byte) 0x3c, (byte) 0x7e, (byte) 0x7e, (byte) 0x7e, (byte) 0x7e, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x36, (byte) 0x7f, (byte) 0x7f, (byte) 0x7f, (byte) 0x3e, (byte) 0x1c, (byte) 0x08, (byte) 0x00, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x0f, (byte) 0x1c, (byte) 0x18, (byte) 0x18, (byte) 0xc3, (byte) 0xe7, (byte) 0x7e, (byte) 0x3c, (byte) 0x3c, (byte) 0x7e, (byte) 0xe7, (byte) 0xc3, (byte) 0x00, (byte) 0x3c, (byte) 0x7e, (byte) 0x66, (byte) 0x66, (byte) 0x7e, (byte) 0x3c, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x66, (byte) 0x66, (byte) 0x18, (byte) 0x18, (byte) 0x3c, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x08, (byte) 0x1c, (byte) 0x3e, (byte) 0x7f, (byte) 0x3e, (byte) 0x1c, (byte) 0x08, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xff, (byte) 0xff, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xc0, (byte) 0xc0, (byte) 0x30, (byte) 0x30, (byte) 0xc0, (byte) 0xc0, (byte) 0x30, (byte) 0x30, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x3e, (byte) 0x76, (byte) 0x36, (byte) 0x36, (byte) 0x00, (byte) 0xff, (byte) 0x7f, (byte) 0x3f, (byte) 0x1f, (byte) 0x0f, (byte) 0x07, (byte) 0x03, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xff, (byte) 0xfe, (byte) 0xfc, (byte) 0xf8, (byte) 0xf0, (byte) 0xe0, (byte) 0xc0, (byte) 0x80, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x1f, (byte) 0x1f, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x1f, (byte) 0x1f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf8, (byte) 0xf8, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x1f, (byte) 0x1f, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xf8, (byte) 0xf8, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xf8, (byte) 0xf8, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xc3, (byte) 0x99, (byte) 0x91, (byte) 0x91, (byte) 0x9f, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xe7, (byte) 0xc3, (byte) 0x99, (byte) 0x81, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x93, (byte) 0x87, (byte) 0xff, (byte) 0x81, (byte) 0x9f, (byte) 0x9f, (byte) 0x87, (byte) 0x9f, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0x81, (byte) 0x9f, (byte) 0x9f, (byte) 0x87, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0x91, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x81, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xc3, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xc3, (byte) 0xff, (byte) 0xe1, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0x93, (byte) 0xc7, (byte) 0xff, (byte) 0x99, (byte) 0x93, (byte) 0x87, (byte) 0x8f, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0xff, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0x9c, (byte) 0x88, (byte) 0x80, (byte) 0x94, (byte) 0x9c, (byte) 0x9c, (byte) 0x9c, (byte) 0xff, (byte) 0x99, (byte) 0x89, (byte) 0x81, (byte) 0x81, (byte) 0x91, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xf1, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0xc3, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xff, (byte) 0x9c, (byte) 0x9c, (byte) 0x9c, (byte) 0x94, (byte) 0x80, (byte) 0x88, (byte) 0x9c, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0x81, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0xc3, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xc3, (byte) 0xff, (byte) 0xf3, (byte) 0xed, (byte) 0xcf, (byte) 0x83, (byte) 0xcf, (byte) 0x9d, (byte) 0x03, (byte) 0xff, (byte) 0xc3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xc3, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xef, (byte) 0xcf, (byte) 0x80, (byte) 0x80, (byte) 0xcf, (byte) 0xef, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x00, (byte) 0x99, (byte) 0x00, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xe7, (byte) 0xc1, (byte) 0x9f, (byte) 0xc3, (byte) 0xf9, (byte) 0x83, (byte) 0xe7, (byte) 0xff, (byte) 0x9d, (byte) 0x99, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x99, (byte) 0xb9, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xc3, (byte) 0xc7, (byte) 0x98, (byte) 0x99, (byte) 0xc0, (byte) 0xff, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xe7, (byte) 0xf3, (byte) 0xff, (byte) 0xcf, (byte) 0xe7, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xc3, (byte) 0x00, (byte) 0xc3, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xcf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x81, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xfc, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x9f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x91, (byte) 0x89, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xc7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x81, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xf9, (byte) 0xf3, (byte) 0xcf, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xf9, (byte) 0xe3, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xf9, (byte) 0xf1, (byte) 0xe1, (byte) 0x99, (byte) 0x80, (byte) 0xf9, (byte) 0xf9, (byte) 0xff, (byte) 0x81, (byte) 0x9f, (byte) 0x83, (byte) 0xf9, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x81, (byte) 0x99, (byte) 0xf3, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xcf, (byte) 0xf1, (byte) 0xe7, (byte) 0xcf, (byte) 0x9f, (byte) 0xcf, (byte) 0xe7, (byte) 0xf1, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x81, (byte) 0xff, (byte) 0x81, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x8f, (byte) 0xe7, (byte) 0xf3, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0x8f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf7, (byte) 0xe3, (byte) 0xc1, (byte) 0x80, (byte) 0x80, (byte) 0xe3, (byte) 0xc1, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x1f, (byte) 0x0f, (byte) 0xc7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe3, (byte) 0xf0, (byte) 0xf8, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xc7, (byte) 0x0f, (byte) 0x1f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x00, (byte) 0x00, (byte) 0x3f, (byte) 0x1f, (byte) 0x8f, (byte) 0xc7, (byte) 0xe3, (byte) 0xf1, (byte) 0xf8, (byte) 0xfc, (byte) 0xfc, (byte) 0xf8, (byte) 0xf1, (byte) 0xe3, (byte) 0xc7, (byte) 0x8f, (byte) 0x1f, (byte) 0x3f, (byte) 0x00, (byte) 0x00, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x00, (byte) 0x00, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xff, (byte) 0xc3, (byte) 0x81, (byte) 0x81, (byte) 0x81, (byte) 0x81, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xc9, (byte) 0x80, (byte) 0x80, (byte) 0x80, (byte) 0xc1, (byte) 0xe3, (byte) 0xf7, (byte) 0xff, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf8, (byte) 0xf0, (byte) 0xe3, (byte) 0xe7, (byte) 0xe7, (byte) 0x3c, (byte) 0x18, (byte) 0x81, (byte) 0xc3, (byte) 0xc3, (byte) 0x81, (byte) 0x18, (byte) 0x3c, (byte) 0xff, (byte) 0xc3, (byte) 0x81, (byte) 0x99, (byte) 0x99, (byte) 0x81, (byte) 0xc3, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0x99, (byte) 0x99, (byte) 0xe7, (byte) 0xe7, (byte) 0xc3, (byte) 0xff, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf7, (byte) 0xe3, (byte) 0xc1, (byte) 0x80, (byte) 0xc1, (byte) 0xe3, (byte) 0xf7, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x00, (byte) 0x00, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x3f, (byte) 0x3f, (byte) 0xcf, (byte) 0xcf, (byte) 0x3f, (byte) 0x3f, (byte) 0xcf, (byte) 0xcf, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xfc, (byte) 0xc1, (byte) 0x89, (byte) 0xc9, (byte) 0xc9, (byte) 0xff, (byte) 0x00, (byte) 0x80, (byte) 0xc0, (byte) 0xe0, (byte) 0xf0, (byte) 0xf8, (byte) 0xfc, (byte) 0xfe, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x00, (byte) 0x01, (byte) 0x03, (byte) 0x07, (byte) 0x0f, (byte) 0x1f, (byte) 0x3f, (byte) 0x7f, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe0, (byte) 0xe0, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe0, (byte) 0xe0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x07, (byte) 0x07, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe0, (byte) 0xe0, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x07, (byte) 0x07, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x07, (byte) 0x07, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x3c, (byte) 0x66, (byte) 0x6e, (byte) 0x6e, (byte) 0x60, (byte) 0x62, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3c, (byte) 0x06, (byte) 0x3e, (byte) 0x66, (byte) 0x3e, (byte) 0x00, (byte) 0x00, (byte) 0x60, (byte) 0x60, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3c, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0x3e, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x7e, (byte) 0x60, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x0e, (byte) 0x18, (byte) 0x3e, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3e, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x06, (byte) 0x7c, (byte) 0x00, (byte) 0x60, (byte) 0x60, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x38, (byte) 0x18, (byte) 0x18, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x3c, (byte) 0x00, (byte) 0x60, (byte) 0x60, (byte) 0x6c, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x38, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x7f, (byte) 0x7f, (byte) 0x6b, (byte) 0x63, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x00, (byte) 0x3e, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3e, (byte) 0x60, (byte) 0x3c, (byte) 0x06, (byte) 0x7c, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x0e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x63, (byte) 0x6b, (byte) 0x7f, (byte) 0x3e, (byte) 0x36, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x3c, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x0c, (byte) 0x78, (byte) 0x00, (byte) 0x00, (byte) 0x7e, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x7e, (byte) 0x00, (byte) 0x3c, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x3c, (byte) 0x00, (byte) 0x0c, (byte) 0x12, (byte) 0x30, (byte) 0x7c, (byte) 0x30, (byte) 0x62, (byte) 0xfc, (byte) 0x00, (byte) 0x3c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x3c, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x10, (byte) 0x30, (byte) 0x7f, (byte) 0x7f, (byte) 0x30, (byte) 0x10, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0xff, (byte) 0x66, (byte) 0xff, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x18, (byte) 0x3e, (byte) 0x60, (byte) 0x3c, (byte) 0x06, (byte) 0x7c, (byte) 0x18, (byte) 0x00, (byte) 0x62, (byte) 0x66, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x66, (byte) 0x46, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x3c, (byte) 0x38, (byte) 0x67, (byte) 0x66, (byte) 0x3f, (byte) 0x00, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x18, (byte) 0x0c, (byte) 0x00, (byte) 0x30, (byte) 0x18, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x66, (byte) 0x3c, (byte) 0xff, (byte) 0x3c, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x60, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x6e, (byte) 0x76, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x38, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x7e, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x06, (byte) 0x0c, (byte) 0x30, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x06, (byte) 0x1c, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x06, (byte) 0x0e, (byte) 0x1e, (byte) 0x66, (byte) 0x7f, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x7e, (byte) 0x60, (byte) 0x7c, (byte) 0x06, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x7e, (byte) 0x66, (byte) 0x0c, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x3e, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x30, (byte) 0x0e, (byte) 0x18, (byte) 0x30, (byte) 0x60, (byte) 0x30, (byte) 0x18, (byte) 0x0e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7e, (byte) 0x00, (byte) 0x7e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x70, (byte) 0x18, (byte) 0x0c, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x70, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x3c, (byte) 0x66, (byte) 0x7e, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x6c, (byte) 0x78, (byte) 0x00, (byte) 0x7e, (byte) 0x60, (byte) 0x60, (byte) 0x78, (byte) 0x60, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x7e, (byte) 0x60, (byte) 0x60, (byte) 0x78, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x6e, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x7e, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x3c, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x3c, (byte) 0x00, (byte) 0x1e, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x0c, (byte) 0x6c, (byte) 0x38, (byte) 0x00, (byte) 0x66, (byte) 0x6c, (byte) 0x78, (byte) 0x70, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x00, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x63, (byte) 0x77, (byte) 0x7f, (byte) 0x6b, (byte) 0x63, (byte) 0x63, (byte) 0x63, (byte) 0x00, (byte) 0x66, (byte) 0x76, (byte) 0x7e, (byte) 0x7e, (byte) 0x6e, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x60, (byte) 0x60, (byte) 0x60, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x0e, (byte) 0x00, (byte) 0x7c, (byte) 0x66, (byte) 0x66, (byte) 0x7c, (byte) 0x78, (byte) 0x6c, (byte) 0x66, (byte) 0x00, (byte) 0x3c, (byte) 0x66, (byte) 0x60, (byte) 0x3c, (byte) 0x06, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x7e, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x00, (byte) 0x63, (byte) 0x63, (byte) 0x63, (byte) 0x6b, (byte) 0x7f, (byte) 0x77, (byte) 0x63, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x3c, (byte) 0x66, (byte) 0x66, (byte) 0x00, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x3c, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x7e, (byte) 0x06, (byte) 0x0c, (byte) 0x18, (byte) 0x30, (byte) 0x60, (byte) 0x7e, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xff, (byte) 0xff, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xc0, (byte) 0xc0, (byte) 0x30, (byte) 0x30, (byte) 0xc0, (byte) 0xc0, (byte) 0x30, (byte) 0x30, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x99, (byte) 0xcc, (byte) 0x66, (byte) 0x33, (byte) 0x99, (byte) 0xcc, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0x99, (byte) 0x33, (byte) 0x66, (byte) 0xcc, (byte) 0x99, (byte) 0x33, (byte) 0x66, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x03, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x1f, (byte) 0x1f, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x1f, (byte) 0x1f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf8, (byte) 0xf8, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x1f, (byte) 0x1f, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xf8, (byte) 0xf8, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xc0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x01, (byte) 0x03, (byte) 0x06, (byte) 0x6c, (byte) 0x78, (byte) 0x70, (byte) 0x60, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x18, (byte) 0x18, (byte) 0xf8, (byte) 0xf8, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xc3, (byte) 0x99, (byte) 0x91, (byte) 0x91, (byte) 0x9f, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xc3, (byte) 0xf9, (byte) 0xc1, (byte) 0x99, (byte) 0xc1, (byte) 0xff, (byte) 0xff, (byte) 0x9f, (byte) 0x9f, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xc3, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xf9, (byte) 0xf9, (byte) 0xc1, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x81, (byte) 0x9f, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xe7, (byte) 0xc1, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xc1, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xf9, (byte) 0x83, (byte) 0xff, (byte) 0x9f, (byte) 0x9f, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xc7, (byte) 0xe7, (byte) 0xe7, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xf9, (byte) 0xff, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xf9, (byte) 0xc3, (byte) 0xff, (byte) 0x9f, (byte) 0x9f, (byte) 0x93, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xc7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0x80, (byte) 0x80, (byte) 0x94, (byte) 0x9c, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xff, (byte) 0xc1, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xf9, (byte) 0xf9, (byte) 0xff, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xc1, (byte) 0x9f, (byte) 0xc3, (byte) 0xf9, (byte) 0x83, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xf1, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x9c, (byte) 0x94, (byte) 0x80, (byte) 0xc1, (byte) 0xc9, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xc3, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xf3, (byte) 0x87, (byte) 0xff, (byte) 0xff, (byte) 0x81, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x81, (byte) 0xff, (byte) 0xc3, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xc3, (byte) 0xff, (byte) 0xf3, (byte) 0xed, (byte) 0xcf, (byte) 0x83, (byte) 0xcf, (byte) 0x9d, (byte) 0x03, (byte) 0xff, (byte) 0xc3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xc3, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xef, (byte) 0xcf, (byte) 0x80, (byte) 0x80, (byte) 0xcf, (byte) 0xef, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x00, (byte) 0x99, (byte) 0x00, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xe7, (byte) 0xc1, (byte) 0x9f, (byte) 0xc3, (byte) 0xf9, (byte) 0x83, (byte) 0xe7, (byte) 0xff, (byte) 0x9d, (byte) 0x99, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x99, (byte) 0xb9, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xc3, (byte) 0xc7, (byte) 0x98, (byte) 0x99, (byte) 0xc0, (byte) 0xff, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0xcf, (byte) 0xcf, (byte) 0xe7, (byte) 0xf3, (byte) 0xff, (byte) 0xcf, (byte) 0xe7, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xc3, (byte) 0x00, (byte) 0xc3, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xcf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x81, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xfc, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x9f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x91, (byte) 0x89, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xc7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x81, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xf9, (byte) 0xf3, (byte) 0xcf, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xf9, (byte) 0xe3, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xf9, (byte) 0xf1, (byte) 0xe1, (byte) 0x99, (byte) 0x80, (byte) 0xf9, (byte) 0xf9, (byte) 0xff, (byte) 0x81, (byte) 0x9f, (byte) 0x83, (byte) 0xf9, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x81, (byte) 0x99, (byte) 0xf3, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xc1, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xcf, (byte) 0xf1, (byte) 0xe7, (byte) 0xcf, (byte) 0x9f, (byte) 0xcf, (byte) 0xe7, (byte) 0xf1, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x81, (byte) 0xff, (byte) 0x81, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x8f, (byte) 0xe7, (byte) 0xf3, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0x8f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xff, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xc3, (byte) 0x99, (byte) 0x81, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x93, (byte) 0x87, (byte) 0xff, (byte) 0x81, (byte) 0x9f, (byte) 0x9f, (byte) 0x87, (byte) 0x9f, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0x81, (byte) 0x9f, (byte) 0x9f, (byte) 0x87, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0x91, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x81, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xc3, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xc3, (byte) 0xff, (byte) 0xe1, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0x93, (byte) 0xc7, (byte) 0xff, (byte) 0x99, (byte) 0x93, (byte) 0x87, (byte) 0x8f, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0xff, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0x9c, (byte) 0x88, (byte) 0x80, (byte) 0x94, (byte) 0x9c, (byte) 0x9c, (byte) 0x9c, (byte) 0xff, (byte) 0x99, (byte) 0x89, (byte) 0x81, (byte) 0x81, (byte) 0x91, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x9f, (byte) 0x9f, (byte) 0x9f, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xf1, (byte) 0xff, (byte) 0x83, (byte) 0x99, (byte) 0x99, (byte) 0x83, (byte) 0x87, (byte) 0x93, (byte) 0x99, (byte) 0xff, (byte) 0xc3, (byte) 0x99, (byte) 0x9f, (byte) 0xc3, (byte) 0xf9, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x81, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xff, (byte) 0x9c, (byte) 0x9c, (byte) 0x9c, (byte) 0x94, (byte) 0x80, (byte) 0x88, (byte) 0x9c, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xc3, (byte) 0x99, (byte) 0x99, (byte) 0xff, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0xc3, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0x81, (byte) 0xf9, (byte) 0xf3, (byte) 0xe7, (byte) 0xcf, (byte) 0x9f, (byte) 0x81, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x00, (byte) 0x00, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x3f, (byte) 0x3f, (byte) 0xcf, (byte) 0xcf, (byte) 0x3f, (byte) 0x3f, (byte) 0xcf, (byte) 0xcf, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0x66, (byte) 0x33, (byte) 0x99, (byte) 0xcc, (byte) 0x66, (byte) 0x33, (byte) 0x99, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x33, (byte) 0x33, (byte) 0xcc, (byte) 0xcc, (byte) 0x33, (byte) 0x66, (byte) 0xcc, (byte) 0x99, (byte) 0x33, (byte) 0x66, (byte) 0xcc, (byte) 0x99, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xfc, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe0, (byte) 0xe0, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe0, (byte) 0xe0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x07, (byte) 0x07, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe0, (byte) 0xe0, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x07, (byte) 0x07, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x3f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0xf8, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xfe, (byte) 0xfc, (byte) 0xf9, (byte) 0x93, (byte) 0x87, (byte) 0x8f, (byte) 0x9f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xe7, (byte) 0xe7, (byte) 0xe7, (byte) 0x07, (byte) 0x07, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0x0f, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0 }; }
true
f4728fedddc8d8ed59b401f81e0d8c15cc6defa5
Java
beihuxiansheng/elasticsearch-token
/core/src/main/java/org/elasticsearch/transport/NotSerializableTransportException.java
UTF-8
3,255
1.664063
2
[ "Apache-2.0" ]
permissive
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1 begin_comment comment|/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ end_comment begin_package DECL|package|org.elasticsearch.transport package|package name|org operator|. name|elasticsearch operator|. name|transport package|; end_package begin_import import|import name|org operator|. name|elasticsearch operator|. name|common operator|. name|io operator|. name|stream operator|. name|StreamInput import|; end_import begin_import import|import name|java operator|. name|io operator|. name|IOException import|; end_import begin_class DECL|class|NotSerializableTransportException specifier|public class|class name|NotSerializableTransportException extends|extends name|TransportException block|{ DECL|method|NotSerializableTransportException specifier|public name|NotSerializableTransportException parameter_list|( name|Throwable name|t parameter_list|) block|{ name|super argument_list|( name|buildMessage argument_list|( name|t argument_list|) argument_list|) expr_stmt|; block|} DECL|method|NotSerializableTransportException specifier|public name|NotSerializableTransportException parameter_list|( name|StreamInput name|in parameter_list|) throws|throws name|IOException block|{ name|super argument_list|( name|in argument_list|) expr_stmt|; block|} annotation|@ name|Override DECL|method|fillInStackTrace specifier|public name|Throwable name|fillInStackTrace parameter_list|() block|{ return|return literal|null return|; block|} DECL|method|buildMessage specifier|private specifier|static name|String name|buildMessage parameter_list|( name|Throwable name|t parameter_list|) block|{ name|StringBuilder name|sb init|= operator|new name|StringBuilder argument_list|() decl_stmt|; name|sb operator|. name|append argument_list|( literal|"[" argument_list|) operator|. name|append argument_list|( name|t operator|. name|getClass argument_list|() operator|. name|getName argument_list|() argument_list|) operator|. name|append argument_list|( literal|"] " argument_list|) expr_stmt|; while|while condition|( name|t operator|!= literal|null condition|) block|{ name|sb operator|. name|append argument_list|( name|t operator|. name|getMessage argument_list|() argument_list|) operator|. name|append argument_list|( literal|"; " argument_list|) expr_stmt|; name|t operator|= name|t operator|. name|getCause argument_list|() expr_stmt|; block|} return|return name|sb operator|. name|toString argument_list|() return|; block|} block|} end_class end_unit
true
54999948948d55d20d5d25b50eff99dc6515cf4d
Java
IrinaGolovan/Credible
/src/main/java/steps/PersonalLoanRequestPageSteps.java
UTF-8
983
2.28125
2
[]
no_license
package steps; import data.dataExtraction.LoanPurposeRequestData; import pages.PersonalLoanRequestPage; import pages.ProfileLoanRequestPage; public class PersonalLoanRequestPageSteps { PersonalLoanRequestPage personalLoanRequestPage = new PersonalLoanRequestPage(); public ProfileLoanRequestPage enterPersonalRequestData(LoanPurposeRequestData loanPurposeRequestData){ return personalLoanRequestPage .selectLoanPurpose(loanPurposeRequestData.getLoan_purpose()) .selectLevelOfCompletedEducation(loanPurposeRequestData.getHighest_level_of_completed_education()) .selectEmploymentStatus(loanPurposeRequestData.getCurrect_employment_status()) .typeDateOfBirth(loanPurposeRequestData.getDate_of_birth()) .typeIncome(loanPurposeRequestData.getAnnual_income()) .selectCreditScore(loanPurposeRequestData.getEstimate_credit_score()) .clickContinue(); } }
true
008dec3f63ac70ae0e310fa9fcb04ec04c970f12
Java
101131333/comp3074_project
/app/src/main/java/ca/gbc/comp3074/restaurantguide/TimHortons.java
UTF-8
3,830
2.375
2
[]
no_license
package ca.gbc.comp3074.restaurantguide; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.Button; //TODO LIST: //TODO 1. function of button Direction, need to be fixed. The current location was wrong in the direction when running this function. //TODO 2. function of Rate //TODO 3. function of Share: email, facebook, twitter. Click these buttons and open their app in phone //TODO 4. function of Edit in Menu, navigate to Edit page //TODO 5. function of Delete in Menu, popup confirmation dialog and have function to delete the record. public class TimHortons extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tim_hortons); // create button MAP to show the restaurant location, and display a pin at that location Button btnMap = findViewById(R.id.btn_map); btnMap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //reference: https://developers.google.com/maps/documentation/urls/android-intents Uri location = Uri.parse("geo:0,0?q=2900 Warden Ave, Scarborough+View, Ontario"); Intent openMap = new Intent(Intent.ACTION_VIEW, location); openMap.setPackage("com.google.android.apps.maps"); startActivity(openMap); } }); // create button Direction to show the direction from current location to the restaurant Button btnDirection = findViewById(R.id.btn_direction); btnDirection.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { /* Tips * Uri direction = Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345") * in the above, ? mark is the beginning of query, saddr is start point, daddr is end point, * the value can be latitude and longitude, or street address and city * To start the navigation from the current location, remove the saddr parameter and value. * but the when I try the above, the current location is not right. * * google.navigation:q="", can launch Google Maps navigation with turn-by-turn directions * Uri direction = Uri.parse("google.navigation:q=2900 Warden Ave, Scarborough+View, Ontario"); */ //Uri direction = Uri.parse("google.navigation:q=2900 Warden Ave, Scarborough+View, Ontario"); Uri direction = Uri.parse("http://maps.google.com/maps?daddr=2900 Warden Ave, Scarborough+View, Ontario"); Intent openDirection = new Intent(android.content.Intent.ACTION_VIEW, direction); startActivity(openDirection); } }); } // show the menu of resto_info_menu in TimHortons @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inf = getMenuInflater(); inf.inflate(R.menu.resto_info_menu, menu); return true; } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch(item.getItemId()){ case R.id.menu_edit: //TODO openEdit(); case R.id.menu_delete: //TODO openDelete(); case R.id.menu_back: onBackPressed(); } return super.onOptionsItemSelected(item); } }
true
d490124b92a233b85e27bdb52d02d4fb44f3da19
Java
GluuFederation/oxAuth
/Model/src/main/java/org/gluu/oxauth/model/common/converter/ListConverter.java
UTF-8
1,208
2.9375
3
[ "MIT" ]
permissive
package org.gluu.oxauth.model.common.converter; import com.fasterxml.jackson.databind.util.StdConverter; import org.gluu.oxauth.model.util.StringUtils; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.List; import java.util.Objects; /** * A class to facilitate two-step deserialization. */ public class ListConverter extends StdConverter<Object,List<String>> { /** * Converts a value to a List of Strings. Conversion is attempted only * if parameter obj is already a String or a List. In case of String, a * whitespace is assumed as elements separator * @param obj Input object * @return A list of strings, null if obj is null or does not have the expected type */ public List<String> convert(Object obj) { if (obj != null) { if (List.class.isAssignableFrom(obj.getClass())) { // json data already looks like a list... Stream<String> stream = List.class.cast(obj).stream() .filter(Objects::nonNull).map(Object::toString); return stream.collect(Collectors.toList()); } else if (String.class.equals(obj.getClass())) { return StringUtils.spaceSeparatedToList(obj.toString()); } } return null; } }
true
5458c90556f0b01ac8621c3817c82d6b9f709f8f
Java
shatu/pr-toolkit
/applications/postagging/trunk/src/postagging/model/PosReverseHMM.java
UTF-8
319
2.015625
2
[]
no_license
package postagging.model; import model.chain.hmm.ReverseHMM; import postagging.data.PosCorpus; public class PosReverseHMM extends ReverseHMM{ public PosReverseHMM(PosCorpus c, int nrTags) { super(c,c.getNrWordTypes(),nrTags); } public String getName(){ return "POSTAG Reverse HMM"; } }
true
0788eba62dd7ba05a8a983dbb64d081f861cb0d4
Java
neighbor983/Risk-Opp-Issue
/RiskOppIssue/src/main/java/neighbor983/riskoppissue/Risk/RiskConsequence/RiskConsequenceDaoImpl.java
UTF-8
565
1.976563
2
[]
no_license
package neighbor983.riskoppissue.Risk.RiskConsequence; import java.util.List; public class RiskConsequenceDaoImpl implements RiskConsequenceDao{ public List<RiskConsequence> getAllRiskConsequence() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public RiskConsequence getByLevel(int Level) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }
true
b542dccd93dccbcd329d77ea979f188f8b3a9736
Java
qaed/gzzqhr63
/hrss/src/public/nc/bs/hrss/ta/monthreport/MonthReportForMngApprovePageModel.java
GB18030
4,664
1.546875
2
[]
no_license
package nc.bs.hrss.ta.monthreport; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.Map; import org.apache.commons.lang.StringUtils; import uap.web.bd.pub.AppUtil; import nc.bs.framework.common.NCLocator; import nc.bs.hrss.pub.HrssConsts; import nc.bs.hrss.pub.advpanel.AdvancePageModel; import nc.bs.hrss.pub.advpanel.IPagePanel; import nc.bs.hrss.pub.advpanel.cata.ICatagoryDataProvider; import nc.bs.hrss.pub.advpanel.cata.TestCatagoryDataProvider; import nc.bs.hrss.pub.advpanel.mngdept.MngDeptPanel; import nc.bs.hrss.pub.advpanel.panels.CanvasPanel; import nc.bs.hrss.pub.advpanel.panels.SimpleQueryPanel; import nc.bs.hrss.pub.pf.PFUtil; import nc.bs.hrss.pub.tool.SessionUtil; import nc.bs.hrss.pub.tool.ViewUtil; import nc.bs.hrss.ta.utils.TAUtil; import nc.bs.hrss.ta.utils.TBMPeriodUtil; import nc.bs.hrss.ta.utils.TaAppContextUtil; import nc.itf.uap.pf.IPFWorkflowQry; import nc.uap.ctrl.tpl.bill.gen.BillTemplateConst; import nc.uap.lfw.core.LfwRuntimeEnvironment; import nc.uap.lfw.core.WebContext; import nc.uap.lfw.core.cmd.UifDatasetLoadCmd; import nc.uap.lfw.core.data.Dataset; import nc.uap.lfw.core.log.LfwLogger; import nc.uap.lfw.core.page.LfwView; import nc.uap.lfw.core.page.LfwWindow; import nc.uap.lfw.jsp.uimeta.UIMeta; import nc.uap.wfm.constant.WfmConstants; import nc.uap.wfm.utils.WfmTaskUtil; import nc.vo.ta.monthstat.MonthWorkVO; import nc.vo.ta.timerule.TimeRuleVO; /** * Ա±PageModel * * @author liuhongd * */ public class MonthReportForMngApprovePageModel extends AdvancePageModel { @Override protected LfwWindow createPageMeta() { // String billId = LfwRuntimeEnvironment.getWebContext().getOriginalParameter(UifDatasetLoadCmd.OPEN_BILL_ID); AppUtil.addAppAttr(WfmConstants.WfmAppAttr_BillID, billId); // WebContext contex = LfwRuntimeEnvironment.getWebContext(); // String i1 = WfmTaskUtil.getTaskPkFromSession(); // String i2 = WfmTaskUtil.getTaskPkFromUrlParams(); // IPFWorkflowQry workflowQry = NCLocator.getInstance().lookup(IPFWorkflowQry.class); // workflowQry.queryw // Ƿɱ༭ʶ String billEditable = LfwRuntimeEnvironment.getWebContext().getOriginalParameter(PFUtil.FLAG_BILL_EDITABLED); AppUtil.addAppAttr(PFUtil.FLAG_BILL_EDITABLED, billEditable); // String billType = LfwRuntimeEnvironment.getWebContext().getOriginalParameter(HrssConsts.BILL_TYPE_CODE); AppUtil.addAppAttr(HrssConsts.BILL_TYPE_CODE, billType); // String flowTypePk = LfwRuntimeEnvironment.getWebContext().getAppSession().getOriginalParameter(BillTemplateConst.BILLTYPE); if (!StringUtils.isEmpty(flowTypePk)) { try { flowTypePk = URLDecoder.decode(flowTypePk, "UTF-8"); } catch (UnsupportedEncodingException e) { LfwLogger.error(e.getMessage(), e); } } AppUtil.addAppAttr(WfmConstants.WfmAppAttr_FolwTypePk, flowTypePk); // SessionUtil.setCurrentDept("1001A410000000001MQC", true); LfwWindow pm = super.createPageMeta(); return pm; } @Override protected String getFunCode() { return "E20400911"; } @Override protected void initPageMetaStruct() { SessionUtil.getAppSession().setAttribute(ICatagoryDataProvider.SID_CATAGORY_PROVIDER, TestCatagoryDataProvider.class.getName()); // super.initPageMetaStruct(); // applicationContextԿڵͿڹ TaAppContextUtil.addTaAppContext(); Map<String, String[]> periodMap = TBMPeriodUtil.getPeriodMap(TaAppContextUtil.getHROrg()); TaAppContextUtil.setTBMPeriodVOMap(periodMap); // Сλ setPrecision(); } /** * ݿڹֶαСλ * */ private void setPrecision() { TimeRuleVO timeRuleVO = TaAppContextUtil.getTimeRuleVO(); if (timeRuleVO == null) { return; } String[] fields = new String[] { MonthWorkVO.ACTUALWORKDAYS, MonthWorkVO.ACTUALWORKHOURS, MonthWorkVO.WORKDAYS, MonthWorkVO.WORKHOURS }; Integer mreportdecimal = timeRuleVO.getMreportdecimal(); LfwView view = getPageMeta().getView("MonthReportDetail"); Dataset dsMthDetail = ViewUtil.getDataset(view, "dsMthDetail"); TAUtil.setPrecision(dsMthDetail, mreportdecimal, fields); } @Override protected String getQueryTempletKey() { return null; } @Override protected String getRightPage() { return null; } @Override protected IPagePanel[] getLeftComponents(LfwWindow pm, UIMeta um) { return new IPagePanel[] { new CanvasPanel(), new MngDeptPanel(), new SimpleQueryPanel() }; } }
true
163ae3b53ed00ed074d17c08a0b0767c32a2c9e6
Java
Carlos-zero/Demo
/src/Dao/ReplySqlDao.java
UTF-8
346
1.9375
2
[]
no_license
package Dao; import java.sql.SQLException; public interface ReplySqlDao { //对评论进行回复 Integer sendReply(int comment_id,String content,int from_user_id,int to_user_id) throws SQLException; //对回复进行回复 Integer sendToReply(int reply_id,String content,int from_user_id,int to_user_id) throws SQLException; }
true
a09846d32eeae8bc03242a404181966851669f7c
Java
NickyGon/ExamenAResuleto
/src/main/java/ejerciciosExtra/AbstractFactoryTv/Refrigerador.java
UTF-8
1,069
3.234375
3
[]
no_license
package ejerciciosExtra.AbstractFactoryTv; public class Refrigerador implements iElectronicos{ private String marca; private boolean AI; private String modelo; private int precio; public Refrigerador() { } public String getMarca() { return marca; } public void setMarca(String marca) { this.marca = marca; } public boolean isAI() { return AI; } public void setAI(boolean AI) { this.AI = AI; } public String getModelo() { return modelo; } public void setModelo(String modelo) { this.modelo = modelo; } public int getPrecio() { return precio; } public void setPrecio(int precio) { this.precio = precio; } @Override public void crear() { System.out.println("---Refrigerador---"); System.out.println("Marca:" +marca); System.out.println("Modelo "+modelo); System.out.println("Ingeligencia Artificial: "+AI); System.out.println("Precio: "+precio+"Bs."); } }
true
adfe7a17c983a7df65f783fa95f1b5170cd33bed
Java
Allen97/VotingSystem
/src/com/iss/dbutils/DBUtils.java
GB18030
2,762
2.625
3
[]
no_license
package com.iss.dbutils; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; import org.junit.Test; public class DBUtils { static private Connection conn; static private PreparedStatement pstmt; static private ResultSet rs; @Test public void test() { DBUtils dbUtils = new DBUtils(); String sql = "select * from tb_ticker where id=?"; List<Map<String, Object>> query = dbUtils.query(sql,2); System.out.println(query); } static public Connection getConnection() { try { if (conn == null) { Properties properties = new Properties(); properties.load(DBUtils.class.getResourceAsStream("../../../jdbcConfig.properties")); String driver = properties.getProperty("driverClassName"); String url = properties.getProperty("url"); String username = properties.getProperty("username"); String password = properties.getProperty("password"); Class.forName(driver); conn = DriverManager.getConnection(url, username, password); } return conn; } catch (Exception e) { System.out.println("ݿʧ" + e.getMessage()); } return null; } public int update(String sql, Object... obj) { try { conn = getConnection(); pstmt = conn.prepareStatement(sql); for (int i = 0; i < obj.length; i++) { pstmt.setObject(1, obj[i]); } int i = pstmt.executeUpdate(); return i; } catch (Exception e) { System.out.println("ʧ"); } return 0; } public List<Map<String, Object>> query(String sql, Object... obj) { try { conn = getConnection(); pstmt = conn.prepareStatement(sql); for (int i = 0; i < obj.length; i++) { pstmt.setObject(1, obj[i]); } rs = pstmt.executeQuery(); //////////////////////// ArrayList<Map<String, Object>> arrayList = new ArrayList<Map<String, Object>>(); ResultSetMetaData metaData = rs.getMetaData(); while (rs.next()) { Map<String, Object> map = new HashMap<String, Object>(); for (int i = 0; i < metaData.getColumnCount(); i++) { map.put(metaData.getColumnLabel(i + 1), rs.getObject(i + 1)); } arrayList.add(map); } return arrayList; /////////////////////// } catch (Exception e) { // TODO: handle exception } return null; } public void close() { try { if (rs != null) rs.close(); if (pstmt != null) pstmt.close(); if (conn != null) conn.close(); } catch (Exception e) { System.out.println("??????"); } } }
true
95cb5f06deb88e2c03220dd04f0828b07e7a900f
Java
llnforest/jt808
/src/main/java/org/yzh/web/service/impl/CzJsTrainImgsServiceImpl.java
UTF-8
2,929
2.09375
2
[ "Apache-2.0" ]
permissive
package org.yzh.web.service.impl; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; import org.yzh.web.commons.config.RedisKeyConfig; import org.yzh.web.mapper.CzJsFileAttachmentsMapper; import org.yzh.web.mapper.CzJsStudentsMapper; import org.yzh.web.mapper.CzJsTrainImgsMapper; import org.yzh.web.model.entity.CzJsFileAttachments; import org.yzh.web.model.entity.CzJsStudents; import org.yzh.web.model.entity.CzJsTrainImgs; import org.yzh.web.service.CzJsTrainImgsService; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; /** * @author lynn * @description: TODO * @date 2022/2/10 16:40 */ @Slf4j @Service public class CzJsTrainImgsServiceImpl implements CzJsTrainImgsService { @Autowired private CzJsTrainImgsMapper czJsTrainImgsMapper; @Autowired private CzJsStudentsMapper czJsStudentsMapper; @Autowired private CzJsFileAttachmentsMapper czJsFileAttachmentsMapper; @Autowired private StringRedisTemplate stringRedisTemplate; @Override public List<String> getImgList(int imgId) { List<String> imgList = new ArrayList<>(); CzJsTrainImgs trainImgs = czJsTrainImgsMapper.selectByPrimaryKey(imgId); if(trainImgs != null){ ValueOperations<String,String> operations = stringRedisTemplate.opsForValue(); String key = RedisKeyConfig.studentPhoto+trainImgs.getStunum(); String studentPhoto = operations.get(key); if(studentPhoto == null){ CzJsStudents students = czJsStudentsMapper.find("stunum = "+trainImgs.getStunum()); studentPhoto = students != null && StringUtils.isNotEmpty(students.getPhoto())?students.getPhoto():""; operations.set(key,studentPhoto,60, TimeUnit.MINUTES); } if(StringUtils.isEmpty(studentPhoto)) return imgList; imgList.add(studentPhoto); CzJsFileAttachments fileAttachments = czJsFileAttachmentsMapper.selectByPrimaryKey(Integer.valueOf(trainImgs.getFileid())); if(fileAttachments != null){ imgList.add(fileAttachments.getFilePath()); } } return imgList; } @Override public void updateCheckResult(CzJsTrainImgs trainImgs) { czJsTrainImgsMapper.updateByPrimaryKeySelective(trainImgs); } @Override public void failCheck(int id, int checkType) { CzJsTrainImgs trainImgs = new CzJsTrainImgs(); trainImgs.setId(id); trainImgs.setCheckType(checkType); trainImgs.setCheckStatus(2); trainImgs.setSimilarScore("0"); this.updateCheckResult(trainImgs); } }
true
fff036802575b748228eabe15c4a1d0f610dc187
Java
Danil891/second_task
/src/Grep.java
UTF-8
1,520
2.71875
3
[]
no_license
import java.io.*; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Grep { private boolean ilogic; private boolean vlogic; private boolean rlogic; public Grep (boolean ilogic, boolean vlogic, boolean rlogic){ this.ilogic = ilogic; this.rlogic = rlogic; this.vlogic = vlogic; } public ArrayList<String> grepBot(String word, String file) { ArrayList<String> strings = new ArrayList<>(); String regex = word; Pattern ignIsSelected; if (!rlogic) regex = Pattern.quote(word); if (ilogic) ignIsSelected = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); else ignIsSelected = Pattern.compile(regex); try (BufferedReader reader = Files.newBufferedReader(Paths.get(file))) { Matcher matcher; String currentLine; while ((currentLine = reader.readLine()) != null) { matcher = ignIsSelected.matcher(currentLine); if (matcher.find() != vlogic) strings.add(currentLine); } } catch (IOException e) { e.printStackTrace(); } return strings; } public void sOutResult(ArrayList<String> result) { for (String string : result) { System.out.println(string); } } }
true
cc24ea955b643e3a4321d02b768ac133f2f06a45
Java
sonyjun/Algorithm
/Programmers/VisitedPath.java
UTF-8
2,578
3.71875
4
[]
no_license
package Programmers; public class VisitedPath { static final int U = 0; static final int D = 1; static final int L = 2; static final int R = 3; public static void main(String[] args) { System.out.println(solution("ULURRDLLU")); System.out.println(solution("LULLLLLLU")); } public static int solution(String dirs) { int[][] field = new int[11][11]; boolean[][][] visited = new boolean[11][11][4];// U D L R 이력을 관리. int currentI = 5; int currentJ = 5; int nextI = 0; int nextJ = 0; int count = 0; for (int i = 0; i < dirs.length(); i++) { if (dirs.charAt(i) == 'U') { nextI = currentI - 1; nextJ = currentJ; if (nextI < 0 || nextJ < 0 || nextI >= field.length || nextJ >= field[0].length) { continue;// 못가는 좌표임. } // 갈수 있다면.. 갔던 좌표인지 안갔던 좌표인지 확인. 무조건 가긴 감. if (visited[currentI][currentJ][U] == false) {// 현재 위치에서 위로간 이력이 없다면 count++; visited[currentI][currentJ][U] = true; visited[nextI][nextJ][D] = true;// 위 입장에서는 아래로 간 이력이 있다 해줌 } } else if (dirs.charAt(i) == 'D') { nextI = currentI + 1; nextJ = currentJ; if (nextI < 0 || nextJ < 0 || nextI >= field.length || nextJ >= field[0].length) { continue;// 못가는 좌표임. } if (visited[currentI][currentJ][D] == false) {// 현재 위치에서 아래로 간 이력이 없다면 count++; visited[currentI][currentJ][D] = true; visited[nextI][nextJ][U] = true;// 아래 입장에서는 위로 간 이력이 있다고 해줌 } } else if (dirs.charAt(i) == 'L') { nextI = currentI; nextJ = currentJ - 1; if (nextI < 0 || nextJ < 0 || nextI >= field.length || nextJ >= field[0].length) { continue;// 못가는 좌표임. } if (visited[currentI][currentJ][L] == false) {// 현재 위치에서 왼쪽으로간 이력이 없다면, count++; visited[currentI][currentJ][L] = true; visited[nextI][nextJ][R] = true; } } else if (dirs.charAt(i) == 'R') { nextI = currentI; nextJ = currentJ + 1; if (nextI < 0 || nextJ < 0 || nextI >= field.length || nextJ >= field[0].length) { continue;// 못가는 좌표임. } if (visited[currentI][currentJ][R] == false) {// 현재 위치에서 오른쪽으로 간 이력이 없다면, count++; visited[currentI][currentJ][R] = true; visited[nextI][nextJ][L] = true; } } currentI = nextI; currentJ = nextJ; } return count; } }
true
075b2ea6eb9e1fe0313a2f85f104e91c0aef5132
Java
ironman6121/AutoTestAppium
/app/src/main/java/com/ironman/autotestappium/Case1Activity.java
UTF-8
2,241
2.28125
2
[]
no_license
package com.ironman.autotestappium; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; /** * create by ironman 2018/8/7 */ public class Case1Activity extends AppCompatActivity { private RadioGroup mRadioGroup; private RadioButton rb1; private RadioButton rb2; private RadioButton rb3; private RadioButton rb4; private TextView tvFavoriteFood; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_case1_view); initView(); iniListener(); } private void iniListener() { mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.rb1: tvFavoriteFood.setText(rb1.getText()); tvFavoriteFood.setTextColor(getResources().getColor(R.color.red_fa3649)); break; case R.id.rb2: tvFavoriteFood.setText(rb2.getText()); tvFavoriteFood.setTextColor(getResources().getColor(R.color.red_fa3649)); break; case R.id.rb3: tvFavoriteFood.setText(rb3.getText()); tvFavoriteFood.setTextColor(getResources().getColor(R.color.red_fa3649)); break; case R.id.rb4: tvFavoriteFood.setText(rb4.getText()); tvFavoriteFood.setTextColor(getResources().getColor(R.color.green_1cce18)); break; } } }); } private void initView() { mRadioGroup = findViewById(R.id.mRadioGroup); tvFavoriteFood = findViewById(R.id.tvFavoriteFood); rb1 = findViewById(R.id.rb1); rb2 = findViewById(R.id.rb2); rb3 = findViewById(R.id.rb3); rb4 = findViewById(R.id.rb4); } }
true
10bc1103fff1b67396849d644f8379218badb15b
Java
Kirintale/jts2geojson
/src/main/java/org/wololo/jts2geojson/GeoJsonCoordinateUtilities.java
UTF-8
1,776
3.328125
3
[ "MIT" ]
permissive
package org.wololo.jts2geojson; import com.vividsolutions.jts.algorithm.CGAlgorithms; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateArrays; public class GeoJsonCoordinateUtilities { /** * Rotates if necessary JTS coordinates for conversion to a GeoJson object. This is required as GeoJson expects * outer contours to be anti-clockwise and holes to be clockwise. JTS expects outer contours to be clockwise and * holes to be anti-clockwise * * @param coordinates * the polygon coordinates from a JTS object * @param representsHole * true if the coordinates represent a hole. * @return polygon coordinates ready to be applied to GeoJson objects */ public static Coordinate[] correctPolygonCoordinateRotation(final Coordinate[] coordinates, final boolean representsHole) { if (isAntiClockwise(coordinates)) { // If the coordiantes are anti-clockwise, but they should represent a hole. Reverse their direction. if (representsHole) { CoordinateArrays.reverse(coordinates); } } else { // If the coordiantes are clockwise, but they should not represent a hole. Reverse their direction. if (!representsHole) { CoordinateArrays.reverse(coordinates); } } return coordinates; } /** * Checks if the co-ordinates are anti-clockwise. * * @param coordinates * The co-ordinates to test. * @return True if it is anti-clockwise. */ public static boolean isAntiClockwise(final Coordinate[] coordinates) { return CGAlgorithms.isCCW(coordinates); } }
true
5c065ab12e0f322cd860dd79862fbec5e2ea7f7e
Java
qsfjing/atu_erp
/atu-erp-service/src/main/java/com/atu/erp/service/impl/WorkerServiceImpl.java
UTF-8
5,081
2.25
2
[]
no_license
package com.atu.erp.service.impl; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.atu.erp.domain.PromotionInfo; import com.atu.erp.domain.query.ItemQuery; import com.atu.erp.manager.WorkerManager; import com.atu.erp.service.WorkerService; @Service(value = "workerService") public class WorkerServiceImpl implements WorkerService{ @Autowired private WorkerManager workerManager; private static int offsetOffSheft = 0; // worker分段查询数据库偏移量 private static int offsetOnSheft = 0; // worker分段查询数据库偏移量 private static int offsetStartProm = 0; // worker分段查询数据库偏移量 private static int offsetStopProm = 0; // worker分段查询数据库偏移量 private final static Log LOG = LogFactory.getLog(WorkerServiceImpl.class); /** * 商品自动下架 */ @Override public void offSheft() { LOG.error("-------商品自动下架任务 start-------"); try { //查询所有待下架的商品 List<ItemQuery> itemList=workerManager.queryOffSheftList(offsetOffSheft); if (itemList.isEmpty()) { offsetOffSheft = 0; // 当从数据库中取不到数据时,把偏移量设为0,即初始值 } else { for(ItemQuery item: itemList){ workerManager.offSheft(item); LOG.error("###自动下架处理编号:"+offsetOffSheft+"无异常成功执行###"); LOG.error("###自动下架处理商品编号:"+item.getItemId()+"无异常成功执行###"); }//for end } offsetOffSheft=offsetOffSheft+500; } catch (Exception e) { LOG.error("-----WorkerServiceImpl.offSheft-----", e); e.printStackTrace(); } finally { } LOG.error("-------商品自动下架任务 end-------"); } /** * 商品自动上架 */ @Override public void onSheft() { LOG.error("-------商品自动上架任务 start-------"); try { List<ItemQuery> itemList=workerManager.queryOnSheftList(offsetOnSheft);//查询所有待下架的商品 if (itemList.isEmpty()) { offsetOnSheft = 0; // 当从数据库中取不到数据时,把偏移量设为0,即初始值 } else { for(ItemQuery item: itemList){ workerManager.onSheft(item); LOG.error("###自动下架处理编号:"+offsetOnSheft+"无异常成功执行###"); LOG.error("###自动下架处理商品编号:"+item.getItemId()+"无异常成功执行###"); }//for end } offsetOnSheft=offsetOnSheft+500; } catch (Exception e) { LOG.error("-----WorkerServiceImpl.onSheft-----", e); e.printStackTrace(); } finally { } LOG.error("-------商品自动上架任务 end-------"); } @Override public void sendSms() { // TODO Auto-generated method stub } /** * 自动开启促销 */ @Override public void startPromotion() { LOG.error("-------自动开启促销任务 start-------"); try { //查询所有待下架的商品 List<PromotionInfo> promotionInfoList=workerManager.querystartPromotionList(offsetStartProm); if (promotionInfoList.isEmpty()) { offsetStartProm = 0; // 当从数据库中取不到数据时,把偏移量设为0,即初始值 } else { for(PromotionInfo promotionInfo: promotionInfoList){ workerManager.startPromotion(promotionInfo); LOG.error("###自动开启促销处理编号:"+offsetStartProm+"无异常成功执行###"); LOG.error("###自动开启促销促销编号:"+promotionInfo.getPromotionId()+"无异常成功执行###"); }//for end } offsetStartProm=offsetStartProm+500; } catch (Exception e) { LOG.error("-----WorkerServiceImpl.startPromotion-----", e); e.printStackTrace(); } finally { } LOG.error("-------自动开启促销任务 end-------"); } /** * 自动关闭促销 */ @Override public void stopPromotion() { LOG.error("-------自动关闭促销任务 start-------"); try { //查询所有待下架的商品 List<PromotionInfo> promotionInfoList=workerManager.querystopPromotionList(offsetStopProm); if (promotionInfoList.isEmpty()) { offsetStopProm = 0; // 当从数据库中取不到数据时,把偏移量设为0,即初始值 } else { for(PromotionInfo promotionInfo: promotionInfoList){ workerManager.stopPromotion(promotionInfo); LOG.error("###自动关闭促销处理编号:"+offsetStartProm+"无异常成功执行###"); LOG.error("###自动关闭促销促销编号:"+promotionInfo.getPromotionId()+"无异常成功执行###"); }//for end } offsetStopProm=offsetStopProm+500; } catch (Exception e) { LOG.error("-----WorkerServiceImpl.stopPromotion-----", e); e.printStackTrace(); } finally { } LOG.error("-------自动关闭促销任务 end-------"); } }
true
68644a4eaaf0d448ef81159830a27edad1b2e8be
Java
tigarxie/MycatJavaHomework
/dubbo/dubbo-provider1/src/main/java/com/tigar/dubbo/provider1/HelloServiceImpl.java
UTF-8
335
2.015625
2
[]
no_license
package com.tigar.dubbo.provider1; import com.alibaba.dubbo.config.annotation.Service; import com.tigar.dubbo.api.IHelloService; /** * @author tigar * @date 2019/1/10. */ @Service public class HelloServiceImpl implements IHelloService { @Override public String Say(String str) { return "provider1:" + str; } }
true
8f43618c733d48ec24a38a3e22e67155280562a3
Java
Satyam-Muluk/vaccine-distribution-management-system
/src/vaccine/management/system/updateyouth.java
UTF-8
7,464
2.3125
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package vaccine.management.system; import java.awt.Choice; import java.awt.Color; import java.awt.Font; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.*; import java.sql.ResultSet; import javax.swing.*; import java.awt.event.*; import java.sql.PreparedStatement; public class updateyouth extends JFrame implements ActionListener{ JTextField t1,t2,t3,t4,t5,t6,t7,t8,t9; JButton b1,b2,b3,b4; updateyouth() { getContentPane().setBackground(Color.WHITE); ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("Vaccine/Management/System/icons/yo.jpg")); Image i2 = i1.getImage().getScaledInstance(500,500,Image.SCALE_DEFAULT); ImageIcon i3 = new ImageIcon(i2); JLabel l1 = new JLabel(i3); l1.setBounds(400,100,450,400); add(l1); JLabel l2 = new JLabel("UPDATE YOUTH'S DETAILS"); l2.setForeground(Color.BLUE); l2.setFont(new Font("Tahoma",Font.PLAIN,20)); l2.setBounds(460,30,400,30); add(l2); JLabel name = new JLabel("NAME"); name.setFont(new Font("Tahoma",Font.PLAIN,17)); name.setBounds(60,80,120,30); add(name); t1 = new JTextField(); t1.setBounds(230,80,150,30); add(t1); // t1.setEditable(false); JLabel age = new JLabel("AGE"); age.setFont(new Font("Tahoma",Font.PLAIN,17)); age.setBounds(60,130,120,30); add(age); t2 = new JTextField(); t2.setBounds(230,130,150,30); add(t2); JLabel gender = new JLabel("GENDER"); gender.setFont(new Font("Tahoma",Font.PLAIN,17)); gender.setBounds(60,180,120,30); add(gender); t3 = new JTextField(); t3.setBounds(230,180,150,30); add(t3); t3.setEditable(false); JLabel vacc = new JLabel("Vaccine"); vacc.setFont(new Font("Tahoma",Font.PLAIN,17)); vacc.setBounds(60,230,150,30); add(vacc); t4 = new JTextField(); t4.setBounds(230,230,150,30); add(t4); t4.setEditable(false); JLabel status = new JLabel("Status"); status.setFont(new Font("Tahoma",Font.PLAIN,17)); status.setBounds(60,280,120,30); add( status); t5 = new JTextField(); t5.setBounds(230,280,150,30); add(t5); JLabel phone = new JLabel("PHONE"); phone.setFont(new Font("Tahoma",Font.PLAIN,17)); phone.setBounds(60,330,120,30); add(phone); t6 = new JTextField(); t6.setBounds(230,330,150,30); add(t6); JLabel email = new JLabel("EMAIL"); email.setFont(new Font("Tahoma",Font.PLAIN,17)); email .setBounds(60,380,120,30); add(email); t7 = new JTextField(); t7.setBounds(230,380,150,30); add(t7); JLabel aad = new JLabel("Aadhar"); aad.setFont(new Font("Tahoma",Font.PLAIN,17)); aad.setBounds(60,430,120,30); add(aad); JLabel giv = new JLabel("Please enter adhar number first!"); giv.setFont(new Font("Tahoma",Font.PLAIN,17)); giv.setForeground(Color.RED); giv.setBounds(60,470,250,30); add(giv); t8 = new JTextField(); t8.setBounds(230,430,150,30); add(t8); b1 = new JButton("BACK"); b1.setBackground(Color.BLACK); b1.setForeground(Color.WHITE); b1.setBounds(50,520,120,30); b1.addActionListener(this); add(b1); b2 = new JButton("LOGOUT"); b2.setBackground(Color.BLACK); b2.setForeground(Color.WHITE); b2.setBounds(200,520,120,30); b2.addActionListener(this); add(b2); b3 = new JButton("Load Data"); b3.setBackground(Color.BLACK); b3.setForeground(Color.WHITE); b3.setBounds(350,520,120,30); b3.addActionListener(this); add(b3); b4 = new JButton("Update"); b4.setBackground(Color.BLACK); b4.setForeground(Color.WHITE); b4.setBounds(490,520,120,30); b4.addActionListener(this); add(b4); // JLabel l2 = new JLabel("Update Senior Citizen's Record"); // l2.setForeground(Color.BLUE); // l2.setFont(new Font("Tahoma",Font.PLAIN,30)); // l2.setBounds(430,80,400,30); // add(l2); setLayout(null); setBounds(200,200,900,700); setVisible(true); } public void actionPerformed(ActionEvent ae) { if(ae.getSource()==b1){ // new youth().setVisible(true); this.setVisible(false); } else if(ae.getSource()==b2) { System.exit(0); } else if(ae.getSource()==b3) { try { Conn p = new Conn(); String sql = "select * from youths where aadhar = ?"; PreparedStatement st = p.c.prepareStatement(sql); st.setString(1,t8.getText()); ResultSet rs = st.executeQuery(); while(rs.next()) { t1.setText(rs.getString("name")); t2.setText(rs.getString("age")); t3.setText(rs.getString("gender")); t4.setText(rs.getString("vaccine")); t5.setText(rs.getString("status")); // t5.setText(rs.getString("aadhar")); t6.setText(rs.getString("phone")); t7.setText(rs.getString("email")); System.out.println(rs.getString("email")); } }catch(Exception e) { } } else if(ae.getSource() == b4) { String name = t1.getText(); String age = t2.getText(); String gender = t3.getText(); String vaccine = t4.getText(); String status = t5.getText(); String phone = t6.getText(); String email = t7.getText(); // // // String qry = "update youths set name='"+name+"',age='"+age+"',gender='"+gender+"',vaccine='"+vaccine+"',status='"+status+"',phone='"+phone+"',email='"+email+"' where aadhar="+t8.getText(); try{ Conn conect = new Conn(); int i = conect.s.executeUpdate(qry); if(i>0) JOptionPane.showMessageDialog(null,"Youth's Record Updated"); }catch(Exception ee){ System.out.println(ee); // JOptionPane.showMessageDialog(null,"Invalid Aadhar"); } } } public static void main(String[] args) { new updateyouth().setVisible(true); //object of the class } }
true
298dc7716e207cbf63f13441e90a533607667567
Java
WingedCat/foodie-dev
/foodie-dev-service/src/main/java/edu/xpu/hcp/service/UserAddressService.java
UTF-8
2,170
2.015625
2
[]
no_license
package edu.xpu.hcp.service; import edu.xpu.hcp.bo.UserAddressBO; import edu.xpu.hcp.pojo.UserAddress; import java.util.List; /** ____________________ _ _ < 神兽护体,永无bug! > | |__ _ _ ___| |__ ___ _ __ __ _ _ __ ___ _ __ __ _ -------------------- | '_ \| | | |/ __| '_ \ / _ \ '_ \ / _` | '_ \ / _ \ '_ \ / _` | \ ^__^ | | | | |_| | (__| | | | __/ | | | (_| | |_) | __/ | | | (_| | \ (oo)\_______ |_| |_|\__,_|\___|_| |_|\___|_| |_|\__, | .__/ \___|_| |_|\__, | (__)\ )\/\ |___/|_| |___/ ||----w | || || * @author huchengpeng * @date 2020/11/17 10:56 * @version V1.0.1 * @Description 用户地址Service */ public interface UserAddressService { /** * 根据用户ID查询其所有地址 * @param userId 用户ID * @return List */ List<UserAddress> queryAll(String userId); /** * 新增地址 * @param userAddressBO 地址BO */ void addNewUserAddress(UserAddressBO userAddressBO); /** * 更新地址 * @param userAddressBO 地址BO */ void updateUserAddress(UserAddressBO userAddressBO); /** * 根据用户ID和地址ID删除地址信息 * @param userId 用户ID * @param addressId 地址ID */ void deleteUserAddress(String userId,String addressId); /** * 根据用户ID和地址ID设置默认地址 * @param userId 用户ID * @param addressId 地址ID */ void setDefaultAddress(String userId,String addressId); /** * 根据用户ID和地址ID,查询用户具体地址对象信息 * @param userId 用户ID * @param addressId 地址ID * @return UserAddress */ UserAddress queryUserAddress(String userId,String addressId); }
true
9c5395d00237ebab19586dde20cc487980afdfab
Java
augustingims/spring-boot-jwt-with-social-media
/src/main/java/cm/skysoft/app/service/AgencyService.java
UTF-8
998
2.125
2
[]
no_license
package cm.skysoft.app.service; import cm.skysoft.app.domain.Agency; import cm.skysoft.app.dto.AgencyDTO; import java.util.List; import java.util.Optional; /** * Created by francis on 2/12/21. */ public interface AgencyService { /** * save agency. * @param agency the agency * @return list of agency found. */ Agency save(Agency agency); /** * update agency. * @param agency the agency */ void update(AgencyDTO agency); /** * get agency by id. * @param idAgency the idAgency * @return agency found. */ Agency getAgencyByIdAgency(Long idAgency); Optional<Agency> getAgencyById(Long idAgency); /** * get all agencies. * @return list of agency found. */ List<Agency> findAll(); /** * delete agency. * @param agency the agency */ void delete(AgencyDTO agency); /** * delete agency by Id. * @param id the id */ void deleteById(Long id); }
true
480cd719b4c62e6482b9862842aaf48692e59817
Java
kkirsche/commafeed
/src/main/java/com/commafeed/frontend/model/request/IDRequest.java
UTF-8
623
1.851563
2
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
package com.commafeed.frontend.model.request; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import com.wordnik.swagger.annotations.ApiClass; import com.wordnik.swagger.annotations.ApiProperty; @SuppressWarnings("serial") @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @ApiClass public class IDRequest implements Serializable { @ApiProperty private Long id; public Long getId() { return id; } public void setId(Long id) { this.id = id; } }
true
ea6ab4d9dfce9177246aeddcd90149123981ee3e
Java
SophiaGvt/Java-Programming-II
/test/TextNormalizationTest.java
UTF-8
3,757
2.421875
2
[]
no_license
package javengers; import static org.junit.Assert.assertTrue; import org.junit.Test; import java.util.Arrays; /** * JUnit test for method textNormalization() of Normalization Class. * It also indirectly tests method removeStopWords() of StopWordsRemoval Class. * * @author Nikos */ public class TextNormalizationTest { @Test public final void testTextNormalization() { // case0 English text sample taken from GetText class // from // https://en.wikipedia.org/wiki/2016_San_Pablito_Market_fireworks_explosion String[] expected0 = Normalization.textNormalization("According to the Edomex Secretary of " + " Government José Manzur Quiroga , at least 32 people died, with at least 59 " + "more injured.Of the dead, 26 died at the site of the explosion and six at the " + "hospital. Of the injured, 46 individuals were hospitalized, five of whom were " + "in critical condition . Six children were among the injured, including a girl " + "with burns to over 90% of her body"); String[] actual0 = { "according", "edomex", "secretary", "government", "jose", "manzur", "quiroga", "least", "32", "people", "died", "with", "least", "59", "more", "injured", "dead", "26", "died", "site","explosion", "six", "hospital", "injured", "46", "individuals", "were", "hospitalized", "five", "whom", "were", "critical", "condition", "six", "children", "were", "among", "injured", "including", "girl", "with", "burns", "90", "body" }; assertTrue(Arrays.equals(actual0, expected0)); // case1 Greek text sample taken from GetText class // from // http://euroleague.sport24.gr/article/4446331/o-olympiakos-exase-thn-eykairia.html // used \ to escape special character " String[] expected1 = Normalization.textNormalization("Στην φετινή EuroLeague απαγορεύεται " + "να υποτιμήσεις οποιονδήποτε αντίπαλο, αλλά κακά τα ψέμματα, υπάρχουν ματς που " + "είσαι το φαβορί, που υπερτερείς, επειδή διαθέτεις μεγαλύτερη εμπειρία, " + "προσωπικότητες παικτών, χημεία και ομοιογένεια, ισχύ σαν ομάδα, το... βάρος " + "στην φανέλα. Θα λέγαμε και επειδή διαθέσεις βάθος στον πάγκο, αλλά είναι λογικό " + "ο Ολυμπιακός να μην το διαθέτει αυτή την στιγμή, έχοντας νοκ-άουτ ταυτόχρονα το " + "\"βασικό\" του \"4άρι\", τον Γιώργο Πρίντεζη και τον \"δεύτερο\" πλέι-μέικερ " + "του, Ντάνιελ Χάκετ"); String[] actual1 = { "φετινη", "euroleague", "απαγορευεται", "υποτιμησεις", "οποιονδηποτε", "αντιπαλο", "κακα", "ψεμματα", "υπαρχουν", "ματς", "εισαι", "φαβορι", "υπερτερεις", "διαθετεις", "μεγαλυτερη", "εμπειρια","προσωπικοτητες", "παικτων", "χημεια", "ομοιογενεια", "ισχυ", "ομαδα", "βαρος", "φανελα", "θα", "λεγαμε", "διαθεσεις", "βαθος", "παγκο", "ειναι", "λογικο", "ολυμπιακος", "μην", "διαθετει", "στιγμη", "εχοντας", "νοκ", "αουτ", "ταυτοχρονα", "βασικο", "4αρι", "γιωργο", "πριντεζη", "δευτερο", "πλει", "μεικερ", "ντανιελ", "χακετ" }; assertTrue(Arrays.equals(actual1, expected1)); } }
true
7903cd84208016b853e2a6cd2a3441fdfc00cd06
Java
fedeatanasoff/backtracking-java
/Recursividad/src/mochila/Mochila.java
UTF-8
2,024
3.3125
3
[]
no_license
package mochila; import java.util.Arrays; public class Mochila { private int pesoMaximo; private Elemento[] elementos; private int peso, beneficio; public Mochila(int pesoMaximo, int numElementos) { this.pesoMaximo = pesoMaximo; this.elementos = new Elemento[numElementos]; this.beneficio = 0; this.peso = 0; } public int getPesoMaximo() { return pesoMaximo; } public void setPesoMaximo(int pesoMaximo) { this.pesoMaximo = pesoMaximo; } public Elemento[] getElementos() { return elementos; } public void setElementos(Elemento[] elementos) { this.elementos = elementos; } public int getPeso() { return peso; } public void setPeso(int peso) { this.peso = peso; } public int getBeneficio() { return beneficio; } public void setBeneficio(int beneficio) { this.beneficio = beneficio; } public void addElemento(Elemento elem) { for(int i=0; i < this.elementos.length; i++) { if (this.elementos[i] == null) { this.elementos[i] = elem; this.beneficio += elem.getBeneficio(); this.peso += elem.getPeso(); break; } } } public void clear() { this.peso = 0; this.beneficio = 0; for(int i=0; i < this.elementos.length; i++) { this.elementos[i] = null; } } public void eliminarElemento( Elemento elem ) { for( int i=0; i<this.elementos.length; i++) { if(this.elementos[i].equals(elem)) { this.elementos[i] = null; this.beneficio -= elem.getBeneficio(); this.peso -= elem.getPeso(); break; } } } public boolean existeElemento(Elemento elem) { for(int i=0; i<this.elementos.length; i++) { if(this.elementos[i] != null && this.elementos[i].equals(elem)) { return true; } } return false; } @Override public String toString() { return "Mochila [pesoMaximo=" + pesoMaximo + ", elementos=" + Arrays.toString(elementos) + ", peso=" + peso + ", beneficio=" + beneficio + "]"; } }
true
f40675536c01ee41b9c8b83acb403f720a119259
Java
beisdog/onlinecv
/onlinecv-rest/src/main/java/com/beisert/onlinecv/service/MongoDBSingleton.java
UTF-8
4,680
2.125
2
[]
no_license
package com.beisert.onlinecv.service; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import org.bson.Document; import org.bson.conversions.Bson; import org.jongo.Jongo; import com.beisert.onlinecv.domain.AddressData; import com.beisert.onlinecv.domain.Certification; import com.beisert.onlinecv.domain.CommunicationData; import com.beisert.onlinecv.domain.Education; import com.beisert.onlinecv.domain.GenericContainer; import com.beisert.onlinecv.domain.I18NText; import com.beisert.onlinecv.domain.Job; import com.beisert.onlinecv.domain.LanguageSkill; import com.beisert.onlinecv.domain.OnlineCV; import com.beisert.onlinecv.domain.PersonalData; import com.beisert.onlinecv.domain.Project; import com.beisert.onlinecv.domain.SimpleDate; import com.beisert.onlinecv.domain.UserSkill; import com.beisert.onlinecv.domain.UserSkill.Category; import com.beisert.onlinecv.domain.UserSkill.SkillLevel; import com.beisert.onlinecv.domain.CommunicationData.CommunicationType; import com.beisert.onlinecv.domain.LanguageSkill.LanguageSkillLevel; import com.beisert.onlinecv.domain.LanguageText.Locale; import com.beisert.onlinecv.util.DateUtil; import com.beisert.onlinecv.util.ShellExecute; import com.mongodb.BasicDBObject; import com.mongodb.DB; import com.mongodb.Mongo; import com.mongodb.MongoClient; import com.mongodb.MongoClientOptions; import com.mongodb.MongoCredential; import com.mongodb.MongoException; import com.mongodb.ServerAddress; import com.mongodb.client.MongoDatabase; /** * Singleton to access Mongo DB. Because Mongo does connection pooling itself no * special datasource is needed. */ public class MongoDBSingleton { private static MongoDBSingleton instance; private MongoClient mongoClient; private MongoDatabase db; private String dbHost = "localhost"; private int dbPort = 27017; private String dbName = "testdb"; private Jongo jongo; public static MongoDBSingleton getInstance() { if (instance == null) { instance = new MongoDBSingleton(); } return instance; } public boolean isMongoRunning() { try { if (getMongoDatabase() != null) { return isAlive(mongoClient); } return false; } catch (Exception e) { System.out.println("*** Mongo is not alive!!!!!" + e.getMessage()); return false; } } public boolean isAlive(MongoClient mongo) { try { Collection<String> names = new ArrayList<String>(); mongoClient.listDatabaseNames().into(names); System.out.println("**** Mongo received mongo names db" + names); } catch (Exception e) { System.out.println("*** Mongo is not alive!!!!!" + e.getMessage()); return false; } return true; } /** * New API * * @return */ public MongoDatabase getMongoDatabase() { if (mongoClient == null) { initMongoClient(); } if (db == null) db = mongoClient.getDatabase(dbName); return db; } /** * OR Mapper jongo for the db. * * @return */ public Jongo getJongo() { if (this.jongo == null) { this.jongo = new Jongo(getDB()); } return this.jongo; } /** * Use the deprecated API but compatible with Jongo. * * @return */ public DB getDB() { if (mongoClient == null) { initMongoClient(); // mongoClient = new MongoClient(dbHost, dbPort); } return mongoClient.getDB(dbName); } public void initMongoClient() { List<ServerAddress> seeds = Arrays.asList(new ServerAddress(dbHost, dbPort)); MongoClientOptions options = new MongoClientOptions.Builder().serverSelectionTimeout(500).build(); List<MongoCredential> credentials = new ArrayList<MongoCredential>(); mongoClient = new MongoClient(seeds, credentials , options ); if(!isAlive(mongoClient)) { this.mongoClient = null; System.out.println("Mongo client could not connect..."); } } public static enum MongoEnv { LOCAL("/usr/local/bin/mongod", 27017, "/Users/dbe/Development/tools/mongodb/db", "/Users/dbe/Development/workspaces/gwt/onlinecv/mongo.log"), CODENVY("/usr/bin/mongod", 27017, "/home/user/mongodb/db", "/home/user/mongo.log"); private final String mongodPath; private final int port; private final String dbpath; private final String logpath; private MongoEnv(String mongodPath, int port, String dbpath, String logpath) { this.mongodPath = mongodPath; this.port = port; this.dbpath = dbpath; this.logpath = logpath; } public String getCmdLine() { return mongodPath + " --dbpath " + dbpath + " --port " + port + " --smallfiles --httpinterface --rest --fork --logpath " + logpath; } } public static void startMongo(MongoEnv env) { ShellExecute.run(env.getCmdLine()); } }
true
2c2161ced7bce9ea835875b6490e960b0363a53b
Java
ParthSalat47/covid-tracker
/src/main/java/org/vaadin/covid/service/coronaapi/model/Country.java
UTF-8
464
1.976563
2
[]
no_license
package org.vaadin.covid.service.coronaapi.model; import lombok.Data; import java.util.List; @Data public class Country implements Comparable<Country> { private Coordinates coordinates; private String name; private String code; private Long population; private LatestData latest_data; private List<Timeline> timeline; @Override public int compareTo(Country country) { return name.compareTo(country.getName()); } }
true
c8e8a0b32da4469f2c984e877d331dc76ae687bc
Java
lhualin/ChatDemo1
/app/src/main/java/com/findu/chatdemo/Chat2Activity.java
UTF-8
5,581
1.960938
2
[]
no_license
package com.findu.chatdemo; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.OrientationHelper; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.Spannable; import android.text.SpannableString; import android.text.TextWatcher; import android.text.style.ImageSpan; import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import com.findu.chatdemo.tools.ChatMsg; import com.findu.chatdemo.tools.ChatRecyclerAdapter; import com.findu.chatdemo.tools.MsgData; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; public class Chat2Activity extends AppCompatActivity { RecyclerView recyclerView; Context context = this; List<ChatMsg> chatMsgs; EditText editText; ChatRecyclerAdapter chatRecyclerAdapter; Button sendBtn; ImageButton addImgBtn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chat2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); findview(); innit(); } public void findview() { recyclerView = (RecyclerView) findViewById(R.id.chat_recycle); editText = (EditText) findViewById(R.id.chat_btom_editext); sendBtn = (Button) findViewById(R.id.send_btom_btn); addImgBtn = (ImageButton) findViewById(R.id.add_btom_btn); } public void innit() { //得到数据 MsgData msgData = new MsgData(); chatMsgs = msgData.setData(); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(linearLayoutManager); chatRecyclerAdapter = new ChatRecyclerAdapter(this, chatMsgs); recyclerView.setAdapter(chatRecyclerAdapter); //滚动到最后一条 recyclerView.scrollToPosition(chatRecyclerAdapter.getItemCount() - 1); editText.addTextChangedListener(new TextWatcher() { int l = 0;////////记录字符串被删除字符之前,字符串的长度 int location = 0;//记录光标的位置 @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { l = s.length(); location = editText.getSelectionStart(); } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { //根据是否有输入内容决定显示添加按钮还是发送按钮 if (editText.getText().length() != 0) { addImgBtn.setVisibility(View.INVISIBLE); sendBtn.setVisibility(View.VISIBLE); } else { addImgBtn.setVisibility(View.VISIBLE); sendBtn.setVisibility(View.INVISIBLE); } } }); sendBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //发送信息 sendTextMsg(v); } }); //发送图片,视频 addImgBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendTextMsg(v); } }); } public void sendTextMsg(View v) { SpannableString spannableString = null; switch (v.getId()) { case R.id.add_btom_btn: Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.msg_img); //根据Bitmap对象创建ImageSpan对象 ImageSpan imageSpan = new ImageSpan(context, bitmap); //创建一个SpinnableString对象,以便插入ImageSpan对象封装的图像 spannableString = new SpannableString("replace"); //用ImageSpan对象替换replace字符串 spannableString.setSpan(imageSpan, 0, 7, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); case R.id.send_btom_btn: String contString = editText.getText().toString(); spannableString = new SpannableString(contString); } ChatMsg chatMsg = new ChatMsg("me", getDate(), spannableString, true, R.mipmap.me); chatMsgs.add(chatMsg); //通知adapter数据改变 chatRecyclerAdapter.notifyDataSetChanged(); //清空EditText editText.setText(""); //滚动到最后一条 recyclerView.scrollToPosition(chatRecyclerAdapter.getItemCount() - 1); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); } //得到发送信息的时间 private String getDate() { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); return format.format(new Date()); } }
true
d0a8797046c21d23650471169b9d8a216d029bb7
Java
ssniu/IntroductionToJava10
/chapter02/Exercise06.java
UTF-8
983
4.4375
4
[]
no_license
/** * (Sum the digits in an integer) Write a program that reads an integer * between 0 and 1000 and adds all the digits in the integer. For example, * if an integer is 932, the sum of all its digits is 14. * Hint: Use the % operator to extract digits, and use the / operator to * remove the extracted digit. For instance, 932 % 10 = 2 and 932 / 10 = 93. * */ import java.util.Scanner; public class Exercise06{ public static void main(String[] args){ Scanner input = new Scanner(System.in); //Prompt the user to enter a number between 0 and 1000 System.out.print("Enter a number between 0 and 1000: "); int number = input.nextInt(); int total; //Calculate all digits and sum them total = number % 10; // Compute the ones number = number / 10; total = total + number % 10;//Compute the tens number = number / 10; total = total + number;//Sum all digits //Output the summation of all those numbers System.out.println("The sum of the digits is " + total); } }
true
b541f667a9a1f372d05209ec90efc825a4dd57ee
Java
JPLeoRX/language-classifier
/src/main/java/com/tekleo/language_classifier/neural_network/WordsDataSetStored.java
UTF-8
1,968
2.890625
3
[]
no_license
package com.tekleo.language_classifier.neural_network; import com.tekleo.language_classifier.dictionaries.Dictionary; import java.io.*; import java.util.List; public class WordsDataSetStored implements Serializable, Cloneable { private double ratio; // Ration between training and testing data sets (from 0 to 1) private int batchSize; // Batch size private List<Dictionary> dictionaries; // All dictionaries, each dictionary will be sliced equaly for training and testing public WordsDataSetStored(double ratio, int batchSize, List<Dictionary> dictionaries) { this.ratio = ratio; this.batchSize = batchSize; this.dictionaries = dictionaries; } public WordsDataSetStored(WordsDataSet wordsDataSet) { this(wordsDataSet.getRatio(), wordsDataSet.getBatchSize(), wordsDataSet.getDictionaries()); } public WordsDataSet build() { return new WordsDataSet(ratio, batchSize, dictionaries); } public void writeToFile(String filepath) { try { FileOutputStream fileOutputStream = new FileOutputStream(filepath); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); objectOutputStream.writeObject(this); } catch (Exception e) { throw new RuntimeException(e); } } public static WordsDataSetStored readFromFile(String filepath) { try { FileInputStream fileInputStream = new FileInputStream(filepath); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); WordsDataSetStored wordsDataSetStored = (WordsDataSetStored) objectInputStream.readObject(); return wordsDataSetStored; } catch (Exception e) { throw new RuntimeException(e); } } }
true
56201d05d80a63ff9917738ec829c982f018a86e
Java
NelsonLopez/MultiApp
/MultiApp/src/modelo/Aplicacion.java
UTF-8
4,159
2.96875
3
[]
no_license
package modelo; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; /** * @author Usuario * */ public class Aplicacion { //Relaciones private Usuario avatarRaiz; private Usuario jugador; private Usuario user; private ArrayList<File> listaRegistros; private JuegoHockey juego; //Constructor public Aplicacion() { listaRegistros = new ArrayList<>(); datosRegistro(); user = new Usuario(""); avatarRaiz = new Avatar("", 0, 0, 0, "", "", ""); jugador = new Jugador(""); juego = new JuegoHockey(); } /** * @return the jugador */ public Usuario getJugador() { return jugador; } /** * @return the juego */ public JuegoHockey getJuego() { return juego; } public Avatar getAvatar() { return (Avatar) avatarRaiz; } /** * Este metodo se encarga de cargar los datos de usuarios regristrados. */ public void datosRegistro() { File carp = new File("Files/Registros"); File[] dat= archivos(carp); for (int j = 0; j < dat.length; j++) { listaRegistros.add(dat[j]); } } /** * Este metodo se encarga de almacenar en un arreglo los archivos con datos de los usuarios. * @param ruta * @return */ public File[] archivos(File ruta) { File[] arch = ruta.listFiles(); return arch; } /** * Este metodo se encarga de actualizar los datos del avatar. * @param nombre * @param peso * @param statura * @param edad * @param genero * @param id */ public void setDatosAvatar(String nombre, double peso, double statura, int edad, String genero, String id) { avatarRaiz.setNombre(nombre); ((Avatar) avatarRaiz).setPeso(peso); ((Avatar) avatarRaiz).setStatura(statura); ((Avatar) avatarRaiz).setEdad(edad); ((Avatar) avatarRaiz).setGenero(genero); ((Avatar) avatarRaiz).setId(id); } /** * @return the user */ public Usuario getUser() { return user; } /** * Este metodo se encarga de agregar un avatar dado sus atributos * @param nombre * @param peso * @param statura * @param edad * @param genero * @param id * @param imagen */ public void agregarAvatarObjeto(String nombre, double peso, double statura, int edad, String genero, String id, String imagen) { Avatar se = new Avatar( nombre, peso, statura, edad, genero, id, imagen); if (avatarRaiz == null) { try { avatarRaiz = se; File av = new File("Files/Registros/"+nombre+".txt"); av.createNewFile(); se.modificarArchivoAvatar(av, se, nombre); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }else { try { ((Avatar) avatarRaiz).insertarAvatar(se, nombre); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } /** * Este metodo se encarga de leer un archivo con datos de usuarios * @param regGuardado * @return * @throws IOException */ public String[] leerArchivoDatos(File regGuardado) throws IOException { FileReader read = new FileReader(regGuardado); // para que el archivo pueda ser leido. BufferedReader jum = new BufferedReader(read); // para poder leer el archivo ; String linea= jum.readLine(); String[] nick = null; while(linea != null) { // lee cada linea del documento hasta que sea null. linea= jum.readLine(); if(linea !=null) { nick = linea.split(" "); } } return nick; } /** * Este metodo se encarga de sobrecargar los usuarios del programa */ public void sobreCargarUsuarios() { for (int i = 0; i < listaRegistros.size(); i++) { String[] pr; try { File m = (File) listaRegistros.get(i); pr = leerArchivoDatos(m); Avatar ava = new Avatar(pr[0], Double.parseDouble(pr[1]), Double.parseDouble(pr[2]), Integer.parseInt(pr[3]), pr[4], pr[6], pr[5]); //((Avatar) avatarRaiz).insertarAvatar(ava, nombre); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
true
8eaa42e83880e88170f7edfc7660f414678630db
Java
Minhnhat21/JavaCoBan
/src/Practice/Method/SortThreeNumbers.java
UTF-8
989
3.75
4
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Practice.Method; /** * * @author nguye */ import java.util.Scanner; public class SortThreeNumbers { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter three number: "); double num1 = sc.nextDouble(); double num2 = sc.nextDouble(); double num3 = sc.nextDouble(); displaySortedNumbers(num1, num2, num3); } public static void displaySortedNumbers(double num1, double num2, double num3) { double temp; if (num1 > num2) {temp = num1; num1 = num2; num2 = temp;} if (num1 > num3) {temp = num1; num1 = num3; num3 = temp;} if (num2 > num3) {temp = num2; num2 = num3; num3 = temp;} System.out.println(num1 + " " + num2 + " " + num3); } }
true
f0fe387018f9dac2897b9bb13f8ae5b55019fd1e
Java
lgwind/NER
/NER/src/com/lgwind/util/Excel_interface.java
GB18030
833
2.359375
2
[]
no_license
package com.lgwind.util; import com.lgwind.domain.Datas; public interface Excel_interface { /** * ½excelʹĬ֣ * * @param path· */ public abstract void newXLS(String path); /** * ½excel * * @param path· * @param nameļ */ public abstract void newXLS(String path, String name); /** * дһݣĬݣ */ public abstract void writeXLS(); /** * дһ * * @param rowݵľ */ public abstract void writeXLS(String[] row); /** * дһWork * * @param work */ public abstract void writeXLS(int index, Datas datas); /** * дݲرļ */ public abstract void writeclose(); }
true
ceac006313eb1ac9d53d16f05689b4b8c3a2dca7
Java
janebabra/DroidBooking
/SharedOntology/src/it/uniba/ontology/BookingOntology.java
UTF-8
5,478
2.171875
2
[]
no_license
package it.uniba.ontology; import jade.content.onto.BasicOntology; import jade.content.onto.Introspector; import jade.content.onto.Ontology; import jade.content.onto.OntologyException; import jade.content.onto.ReflectiveIntrospector; import jade.content.schema.ConceptSchema; import jade.content.schema.ObjectSchema; import jade.content.schema.PredicateSchema; import jade.content.schema.PrimitiveSchema; public class BookingOntology extends Ontology { private static final long serialVersionUID = -3052063184483117688L; public BookingOntology(String name, Introspector introspector) { super(name, introspector); } public static final String ONTOLOGY_NAME = "BOOKING_ONTOLOGY"; // Concepts public static final String CENTRO_PRENOTAZIONE = "CENTRO"; public static final String CLIENTE = "CLIENTE"; public static final String INTERVALLOPRENOTAZIONE = "INTERVALLOPRENOTAZIONE"; // Slots Centro public static final String NOME = "NOME"; public static final String TELEFONO = "TELEFONO"; public static final String VIA = "VIA"; public static final String PRESTAZIONI = "PRESTAZIONI"; //Slots Cliente public static final String NOMEC = "NOMECLIENTE"; public static final String COGNOME = "COGNOMECLIENTE"; public static final String TELEFONOC = "TELEFONOCLIENTE"; // Predicates public static final String PRENOTAZIONE = "PRENOTAZIONE"; public static final String PRENOTAZIONE_CON_DATA = "PRENOTAZIONECONDATA"; public static final String CONFERMA = "CONFERMA"; public static final String PROPOSTAINTERVALLI = "PROPOSTAINTERVALLI"; //Slots Prenotazione public static final String PRESTAZIONE = "PRESTAZIONE"; //Slots Prenotazione Completa public static final String DATAPRENOTAZIONE = "DATAPRENOTAZIONE"; //Slots Conferma public static final String INIZIOPRENOTAZIONE = "INIZIOPRENOTAZIONE"; public static final String FINEPRENOTAZIONE = "FINEPRENOTAZIONE"; public static final String ID_PRENOTAZIONE = "ID_PRENOTAZIONE"; //Slots PropostaIntervalli public static final String INTERVALLI="INTERVALLI"; private static BookingOntology theInstance = new BookingOntology(BasicOntology.getInstance()); public static BookingOntology getInstance() { return theInstance; } public BookingOntology(Ontology base) { super(ONTOLOGY_NAME, base, new ReflectiveIntrospector()); try { PrimitiveSchema stringSchema = (PrimitiveSchema)getSchema(BasicOntology.STRING); PrimitiveSchema dateSchema = (PrimitiveSchema)getSchema(BasicOntology.DATE); PrimitiveSchema intSchema = (PrimitiveSchema)getSchema(BasicOntology.INTEGER); //ContentElementListSchema listSchema = (ContentElementListSchema)getSchema(BasicOntology.CONTENT_ELEMENT_LIST); //Definizione schema Centro Prenotazione ConceptSchema centroSchema = new ConceptSchema(CENTRO_PRENOTAZIONE); centroSchema.add(NOME, stringSchema, ObjectSchema.MANDATORY); centroSchema.add(TELEFONO, stringSchema, ObjectSchema.MANDATORY); centroSchema.add(VIA, stringSchema); centroSchema.add(PRESTAZIONI, stringSchema, 1, ObjectSchema.UNLIMITED); add(centroSchema, CentroPrenotazione.class); //Definizione schema Cliente ConceptSchema clienteSchema = new ConceptSchema(CLIENTE); clienteSchema.add(NOMEC, stringSchema, ObjectSchema.MANDATORY); clienteSchema.add(COGNOME, stringSchema, ObjectSchema.MANDATORY); clienteSchema.add(TELEFONOC, stringSchema, ObjectSchema.MANDATORY); add(clienteSchema, Cliente.class); ConceptSchema intervalliSchema = new ConceptSchema(INTERVALLOPRENOTAZIONE); intervalliSchema.add(INIZIOPRENOTAZIONE, dateSchema,ObjectSchema.MANDATORY); intervalliSchema.add(FINEPRENOTAZIONE, dateSchema,ObjectSchema.MANDATORY); add(intervalliSchema, IntervalloPrenotazione.class); //Definizione predicati PredicateSchema prenotazioneSchema = new PredicateSchema(PRENOTAZIONE); prenotazioneSchema.add(CLIENTE, clienteSchema,ObjectSchema.MANDATORY); prenotazioneSchema.add(PRESTAZIONE, stringSchema, ObjectSchema.MANDATORY); add(prenotazioneSchema, Prenotazione.class); PredicateSchema prenotazioneConDataSchema = new PredicateSchema(PRENOTAZIONE_CON_DATA); prenotazioneConDataSchema.add(CLIENTE, clienteSchema,ObjectSchema.MANDATORY); prenotazioneConDataSchema.add(PRESTAZIONE, stringSchema, ObjectSchema.MANDATORY); prenotazioneConDataSchema.add(DATAPRENOTAZIONE, dateSchema, ObjectSchema.OPTIONAL); add(prenotazioneConDataSchema, PrenotazioneConData.class); PredicateSchema confermaSchema = new PredicateSchema(CONFERMA); confermaSchema.add(CENTRO_PRENOTAZIONE, centroSchema, ObjectSchema.MANDATORY); confermaSchema.add(INIZIOPRENOTAZIONE, dateSchema, ObjectSchema.MANDATORY); confermaSchema.add(FINEPRENOTAZIONE, dateSchema, ObjectSchema.MANDATORY); confermaSchema.add(PRESTAZIONE, stringSchema,ObjectSchema.MANDATORY); confermaSchema.add(ID_PRENOTAZIONE, intSchema); add(confermaSchema, Conferma.class); PredicateSchema propostaSchema = new PredicateSchema(PROPOSTAINTERVALLI); propostaSchema.add(INTERVALLI, intervalliSchema,1,ObjectSchema.UNLIMITED); propostaSchema.add(CENTRO_PRENOTAZIONE, centroSchema,ObjectSchema.MANDATORY); add(propostaSchema,PropostaIntervalli.class); } catch(OntologyException oe) { oe.printStackTrace(); } } }
true
d29f2e7db6cf3b65db7d5f36323daf6c16013147
Java
dmichelin/Time-ToDo
/app/src/main/java/com/personal/daniel/timetodo/ItemDbSchema.java
UTF-8
424
2.03125
2
[]
no_license
package com.personal.daniel.timetodo; /** * Created by daniel on 6/29/16. */ public class ItemDbSchema { public static final class ItemTable{ public static final String NAME = "Items"; public static final class Cols{ public static final String UUID = "uuid"; public static final String TITLE = "title"; public static final String TIME = "time"; } } }
true
bb41260ccf2eb90fc7d2f4ddf9e7d6a3252d5879
Java
AI-Jiny/JavaPractice
/chapter06_제네릭과 컬렉션/LinkedListEx2.java
UTF-8
1,082
3.828125
4
[]
no_license
package Collection; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; public class LinkedListEx2 { static void printList(LinkedList<String> m) { Iterator<String> iterator = m.iterator(); while (iterator.hasNext()) { // 다음값이 있으면 아래를 실행해라 String e = iterator.next(); // 값을 읽어서 저장하고 String separator; if (iterator.hasNext()) { separator = "->"; // 마지막이 아니면 } else { separator = "\n"; // 마지막이면 } System.out.print(e + separator); } } public static void main(String[] args) { LinkedList<String> myList = new LinkedList<>(); myList.add("트랜스포머"); myList.add("스타워즈"); myList.add("어벤져스"); myList.add(0, "비긴어게인"); myList.add(2, "스타이즈본"); Collections.sort(myList);//정렬시켜주는 메소드 printList(myList); int index = Collections.binarySearch(myList, "비긴어게인")+1; System.out.println("비긴어게인은 "+index+"번째 요소입니다."); } }
true
269c41d9eb62bb927f0f2f08c3254861ef2b9ed2
Java
JoshuaMasci/Dragons-Reach
/Iamshortman/DragonsReach/Common/Block/BlockDragonsReachSapling.java
UTF-8
2,606
2.234375
2
[]
no_license
package Iamshortman.DragonsReach.Common.Block; import java.util.Random; import Iamshortman.DragonsReach.Common.World.WorldGenBlackWoodTree; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; /** * @Author Iamshortman * File: BlockDragonsReachSapling.java * Created: Jul 27, 2013, 9:01:33 PM * Description: The basic sapling block class. */ public class BlockDragonsReachSapling extends BlockDragonsReach { public BlockDragonsReachSapling(int par1) { super(par1, Material.plants); this.setTickRandomly(true); float f = 0.4F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); this.setCreativeTab(CreativeTabs.tabDecorations); } @Override public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { super.updateTick(par1World, par2, par3, par4, par5Random); int random = par5Random.nextInt(7); System.out.println(random); if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && random == 0) { this.GrowTree(par1World, par2, par3, par4, par5Random); } } } private void GrowTree(World world, int x, int y, int z, Random rand) { world.setBlockToAir(x, y, z); new WorldGenBlackWoodTree(true).generate(world, rand, x, y, z); } @Override public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { if(!this.canPlaceBlockAt(par1World, par2, par3, par4)) { par1World.setBlockToAir(par2, par3, par4); this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); } } @Override public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { int id = par1World.getBlockId(par2, par3 - 1, par4); return id == BlockDragonsReach.grass.blockID || id == BlockDragonsReach.dirt.blockID; } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } @Override public boolean isOpaqueCube() { return false; } @Override public boolean renderAsNormalBlock() { return false; } @Override public int getRenderType() { return 1; } }
true
a163a9dafc5a4a79c4945cfb29f4d542c0487392
Java
30K43/SpringCloud
/src/main/java/com/jeeplus/modules/test/grid/entity/TestCountry.java
UTF-8
1,254
2.234375
2
[]
no_license
/** * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved. */ package com.jeeplus.modules.test.grid.entity; import com.jeeplus.modules.test.grid.entity.TestContinent; import com.jeeplus.core.persistence.DataEntity; import com.jeeplus.common.utils.excel.annotation.ExcelField; /** * 国家Entity * @author lgf * @version 2018-04-10 */ public class TestCountry extends DataEntity<TestCountry> { private static final long serialVersionUID = 1L; private String name; // 国名 private String sum; // 人口 private TestContinent continent; // 所属洲 public TestCountry() { super(); } public TestCountry(String id){ super(id); } @ExcelField(title="国名", align=2, sort=1) public String getName() { return name; } public void setName(String name) { this.name = name; } @ExcelField(title="人口", align=2, sort=2) public String getSum() { return sum; } public void setSum(String sum) { this.sum = sum; } @ExcelField(title="所属洲", fieldType=TestContinent.class, value="continent.name", align=2, sort=3) public TestContinent getContinent() { return continent; } public void setContinent(TestContinent continent) { this.continent = continent; } }
true
f0c883854a3491b3344f1e833b989965c62d3f1a
Java
hendyyou/shopizer
/sm-core/src/main/java/com/salesmanager/core/business/shoppingcart/service/ShoppingCartServiceImpl.java
UTF-8
11,150
2.15625
2
[]
no_license
package com.salesmanager.core.business.shoppingcart.service; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.lang.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.salesmanager.core.business.catalog.product.model.Product; import com.salesmanager.core.business.catalog.product.model.attribute.ProductAttribute; import com.salesmanager.core.business.catalog.product.model.image.ProductImage; import com.salesmanager.core.business.catalog.product.model.price.FinalPrice; import com.salesmanager.core.business.catalog.product.service.PricingService; import com.salesmanager.core.business.catalog.product.service.ProductService; import com.salesmanager.core.business.customer.model.Customer; import com.salesmanager.core.business.generic.exception.ServiceException; import com.salesmanager.core.business.generic.service.SalesManagerEntityServiceImpl; import com.salesmanager.core.business.merchant.model.MerchantStore; import com.salesmanager.core.business.shoppingcart.dao.ShoppingCartDao; import com.salesmanager.core.business.shoppingcart.dao.ShoppingCartItemDao; import com.salesmanager.core.business.shoppingcart.model.ShoppingCart; import com.salesmanager.core.business.shoppingcart.model.ShoppingCartAttributeItem; import com.salesmanager.core.business.shoppingcart.model.ShoppingCartItem; @Service("shoppingCartService") public class ShoppingCartServiceImpl extends SalesManagerEntityServiceImpl<Long, ShoppingCart> implements ShoppingCartService { private ShoppingCartDao shoppingCartDao; @Autowired private ProductService productService; @Autowired private ShoppingCartItemDao shoppingCartItemDao; @Autowired private PricingService pricingService; private static final Logger LOGGER = LoggerFactory.getLogger(ShoppingCartServiceImpl.class); @Autowired public ShoppingCartServiceImpl( ShoppingCartDao shoppingCartDao) { super(shoppingCartDao); this.shoppingCartDao = shoppingCartDao; } /** * Retrieve a {@link ShoppingCart} cart for a given customer */ public ShoppingCart getShoppingCart(Customer customer) throws ServiceException { try { ShoppingCart shoppingCart = shoppingCartDao.getByCustomer(customer); return populateShoppingCart(shoppingCart); } catch (Exception e) { throw new ServiceException(e); } } /** * Save or update a {@link ShoppingCart} for a given customer */ public void saveOrUpdate(ShoppingCart shoppingCart) throws ServiceException { if(shoppingCart.getId()==null || shoppingCart.getId().longValue()==0) { super.create(shoppingCart); } else { super.update(shoppingCart); } } /** * Get a {@link ShoppingCart} for a given id and MerchantStore. Will update the shopping cart * prices and items based on the actual inventory. */ @Override public ShoppingCart getById(Long id, MerchantStore store) throws ServiceException { try { ShoppingCart shoppingCart = shoppingCartDao.getById(id, store); return populateShoppingCart(shoppingCart); } catch (Exception e) { throw new ServiceException(e); } } @Override public ShoppingCart getByCode(String code, MerchantStore store) throws ServiceException { try { ShoppingCart shoppingCart = shoppingCartDao.getByCode(code, store); return populateShoppingCart(shoppingCart); } catch (Exception e) { throw new ServiceException(e); } } @Override public ShoppingCart getByCustomer(Customer customer) throws ServiceException { try { ShoppingCart shoppingCart = shoppingCartDao.getByCustomer(customer); return populateShoppingCart(shoppingCart); } catch (Exception e) { throw new ServiceException(e); } } @Transactional private ShoppingCart populateShoppingCart(ShoppingCart shoppingCart) throws Exception { try { if(shoppingCart!=null) { Set<ShoppingCartItem> items = shoppingCart.getLineItems(); if(items==null || items.size()==0) { shoppingCartDao.delete(shoppingCart); return null; } Set<ShoppingCartItem> shoppingCartItems = new HashSet<ShoppingCartItem>(); for(ShoppingCartItem item : items) { this.populateItem(item); if(item.getProduct()==null) {//product has been removed LOGGER.debug("Removing shopping cart item for product id " + item.getProductId()); shoppingCartItemDao.delete(item); } else { shoppingCartItems.add(item); } } shoppingCart.setLineItems(shoppingCartItems); if(shoppingCart.getLineItems().size()==0) { LOGGER.debug("Deleting cart with id " + shoppingCart.getId()); shoppingCartDao.delete(shoppingCart); return null; } return shoppingCart; } } catch (Exception e) { throw new ServiceException(e); } return null; } public ShoppingCartItem createShoppingCartItem(Product product, List<ProductAttribute> attributes) throws ServiceException { Validate.notNull(product, "Product should not be null"); Validate.notNull(product.getMerchantStore(), "Product.merchantStore should not be null"); return null; } private ShoppingCartItem createShoppingCartItem(ShoppingCart shoppingCart, Product product, List<ProductAttribute> attributes, Customer customer) throws ServiceException { //TODO validate if product already exist ShoppingCartItem item = new ShoppingCartItem(shoppingCart, product); if(attributes!=null && attributes.size()>0) { } /* Set<ProductAttribute> productAttributes = product.getAttributes(); List<ProductAttribute> attributesList = new ArrayList<ProductAttribute>(); if(productAttributes!=null && productAttributes.size()>0 && attributes!=null && attributes.size()>0) { for(ShoppingCartAttributeItem attribute : attributes) { long attributeId = attribute.getProductAttributeId().longValue(); for(ProductAttribute productAttribute : productAttributes) { if(productAttribute.getId().longValue()==attributeId) { attribute.setProductAttribute(productAttribute); attributesList.add(productAttribute); break; } } } } else { if(productAttributes!=null && productAttributes.size()>0) { LOGGER.debug("Removing attributes for shopping cart item " + item.getId()); item.setAttributes(null);//TODO check should update shopping cart } } */ //set item price FinalPrice price = null; if(attributes!=null && attributes.size()>0) { price = pricingService.calculateProductPrice(product, attributes); } else { price = pricingService.calculateProductPrice(product); } item.setItemPrice(price.getFinalPrice()); return item; } @Transactional private void populateItem(ShoppingCartItem item) throws Exception { Long productId = item.getProductId(); Product product = productService.getById(productId); if(product==null) { return; } item.setProduct(product); Set<ShoppingCartAttributeItem> attributes = item.getAttributes(); Set<ProductAttribute> productAttributes = product.getAttributes(); List<ProductAttribute> attributesList = new ArrayList<ProductAttribute>(); if(productAttributes!=null && productAttributes.size()>0 && attributes!=null && attributes.size()>0) { for(ShoppingCartAttributeItem attribute : attributes) { long attributeId = attribute.getProductAttributeId().longValue(); for(ProductAttribute productAttribute : productAttributes) { if(productAttribute.getId().longValue()==attributeId) { attribute.setProductAttribute(productAttribute); attributesList.add(productAttribute); break; } } } } else { if(productAttributes!=null && productAttributes.size()>0) { LOGGER.debug("Removing attributes for shopping cart item " + item.getId()); item.setAttributes(null);//TODO check should update shopping cart } } //set item price FinalPrice price = pricingService.calculateProductPrice(product, attributesList); item.setItemPrice(price.getFinalPrice()); BigDecimal subTotal = item.getItemPrice().multiply(new BigDecimal(item.getQuantity().intValue())); item.setSubTotal(subTotal); } public void calculateShoppingCart(List<ShoppingCartItem> items) throws ServiceException { /* SHOULD BE IN ORDER PACKAGE the model should be completed so that a shopping cart has this structure ShoppingCart List<ShoppingCartItem> items List<ShoppingCartAttributeItem> priceItems only ShoppingCartItem are saved in the database when a customer is logged on This method should return a ShoppingCart entity - price calculation the cart price calculation is based on a workflow. The workflow takes the ShoppingCart as input and populates the ShoppingCartPriceItem based on different calculation steps. The steps are individual item price calculation, sub-total, apply tax (when customer is known), eventually apply custom pricing rules (shopping cart coupons) and other specific rule that can be configured on business rules engine such as drools STEP 1 Unit price item calculation :get the Product from ShoppingCartItem and all ProductAttribute fromShoppingCartAttributeItem :invoke for each product productPriceUtils.getFinalProductPrice :get the final price for each Product :set the price in shoppingCartItem.itemPrice STEP 2 Calculate cart sub total :calculate sub total based on each shoppingCartItem.itemPrice, [create a ShoppingCartPriceItem that will contain this sub total] -- Not sure about that STEP 3 Calculate taxes (if the customer is logged on) taxService + OrderSummary STEP 4 Calculate Cart total WORKFLOW example (package name may not be accurate) <beans:bean id="shoppingCartWorkflow" class="com.salesmanager.core.service.shoppingcart.workflow.WorkflowProcessor"> <beans:property name="processes"> <beans:list> <beans:ref bean="a" /> <beans:ref bean="b" /> <beans:ref bean="c" /> </beans:list> </beans:property> </beans:bean> <beans:bean id="a" class="com.salesmanager.core.service.shoppingcart.workflow.CalculateThis"/> <beans:bean id="b" class="com.salesmanager.core.service.shoppingcart.workflow.CalculateThat"/> <beans:bean id="c" class="com.salesmanager.core.service.shoppingcart.workflow..."/> In the shopping cart service autowire the workflow processor which implements execute */ } }
true
e1b46857487f9396bb96e50e0a907f2e35b74047
Java
dasaipoom/204211-Project
/src/main/java/AppService/SaverAndLoader.java
UTF-8
1,501
2.59375
3
[]
no_license
package AppService; import AppUtil.FilePath; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Paths; public class SaverAndLoader { public static String getFile(String fileName) { return Paths.get(System.getProperty("user.dir"), "save", fileName).toString(); } public static void getFrom(String file) { Gson gson = new Gson(); FileReader reader; try { if (file.contentEquals(FilePath.SETTING.path)) { reader = new FileReader(getFile(file)); SettingManager.setInstance(gson.fromJson(reader, SettingManager.class)); } else if (file.contentEquals(FilePath.TABLE.path)) { // TODO } } catch (FileNotFoundException e) { e.printStackTrace(); } } public static void saveTo(Object object, String file, boolean prettyPrint) { Gson gson; if (prettyPrint) gson = new GsonBuilder().setPrettyPrinting().create(); else gson = new Gson(); FileWriter writer; try { writer = new FileWriter(getFile(file)); gson.toJson(object, writer); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } }
true
393a22d49f032c1ec1004238a2c169f5704066b6
Java
SyedulKhan/Slot-Machine-Program
/SlotMachineProgram/src/SlotMachine.java
UTF-8
12,610
2.96875
3
[]
no_license
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SlotMachine extends JFrame { //all JComponents private JLabel betArea; private JLabel creditArea; private JTextField testArea; private JTextField testArea2; private JTextField testArea3; private JButton addCoin; private JButton betOne; private JButton betMax; private JButton reset; private JButton spin; private JButton stats; private JButton lblImage; private JButton lblImage2; private JButton lblImage3; //3 reels private Reel reel; private Reel reel2; private Reel reel3; //3 worker threads for each reel private MyWorker worker; private MyWorker worker2; private MyWorker worker3; //global variables private boolean isSpin = false; private int reelsStopped = 0; private boolean limit = false; private int credit = 10; private int bet = 0; final private int maxBet = 3; private int wins = 0; private int losses = 0; private int games = 0; private int creditsWon = 0; //constructor public SlotMachine() { //panel for buttons JPanel p1 = new JPanel(); p1.setLayout(new GridLayout(2, 3, 100, 100)); //custom font for buttons and areas Font myFont = new Font("SansSerif", Font.BOLD, 20); Font spinFont = new Font("SansSerif", Font.BOLD, 30); spin = new JButton("Spin"); addCoin = new JButton("Add Coin"); betOne = new JButton("Bet a Credit"); betMax = new JButton("Bet Max Credit"); reset = new JButton("Reset Bet"); stats = new JButton("View Statistics"); p1.add(addCoin); p1.add(spin); p1.add(stats); p1.add(betOne); p1.add(betMax); p1.add(reset); p1.setBackground(Color.RED); spin.setFont(spinFont); addCoin.setFont(myFont); betOne.setFont(myFont); betMax.setFont(myFont); reset.setFont(myFont); stats.setFont(myFont); spin.setForeground(Color.RED); //panel for credit and bet areas JPanel p2 = new JPanel(new BorderLayout(5, 20)); JPanel p3 = new JPanel(new GridLayout(1, 5)); testArea = new JTextField(""); testArea.setEditable(false); testArea.setVisible(false); p3.add(testArea); creditArea = new JLabel("Credit: " + credit); p3.add(creditArea); testArea2 = new JTextField(""); testArea2.setEditable(false); testArea2.setVisible(false); p3.add(testArea2); betArea = new JLabel("Bet: " + bet); p3.add(betArea); testArea3 = new JTextField(""); testArea3.setEditable(false); testArea3.setVisible(false); p3.add(testArea3); creditArea.setFont(myFont); betArea.setFont(myFont); p2.add(p3, BorderLayout.NORTH); p2.add(p1, BorderLayout.CENTER); add(p2, BorderLayout.CENTER); //panel for 3 reels JPanel p4 = new JPanel(new GridLayout(1, 3, 20, 20)); lblImage = new JButton(">>>"); lblImage2 = new JButton(">>"); lblImage3 = new JButton(">"); p4.add(lblImage); p4.add(lblImage2); p4.add(lblImage3); lblImage.setBackground(Color.WHITE); lblImage2.setBackground(Color.WHITE); lblImage3.setBackground(Color.WHITE); lblImage.setForeground(Color.WHITE); lblImage2.setForeground(Color.WHITE); lblImage3.setForeground(Color.WHITE); add(p4, BorderLayout.NORTH); p4.setBackground(Color.BLACK); // created reels reel = new Reel(); Symbol firstImg = reel.spin(); reel2 = new Reel(); Symbol firstImg2 = reel2.spin(); reel3 = new Reel(); Symbol firstImg3 = reel3.spin(); // set the images to display and the values when the user runs the slot machine for the first time lblImage.setIcon(firstImg.getImage()); testArea.setText(Integer.toString(firstImg.getValue())); lblImage2.setIcon(firstImg2.getImage()); testArea2.setText(Integer.toString(firstImg2.getValue())); lblImage3.setIcon(firstImg3.getImage()); testArea3.setText(Integer.toString(firstImg3.getValue())); // event handlers MyListener buttonListener = new MyListener(); spin.addActionListener(buttonListener); addCoin.addActionListener(buttonListener); betOne.addActionListener(buttonListener); betMax.addActionListener(buttonListener); reset.addActionListener(buttonListener); stats.addActionListener(buttonListener); lblImage.addActionListener(buttonListener); lblImage2.addActionListener(buttonListener); lblImage3.addActionListener(buttonListener); } private class MyListener implements ActionListener { @Override public void actionPerformed(ActionEvent evt) { String btnName = evt.getActionCommand(); // event.getActionCommand() returns the button's label switch (btnName) { //each case statement will call a specific method that will be performed during run time case "Spin": if (bet <= 0) { JOptionPane.showMessageDialog(null, "Place a bet first!"); } else { isSpin = true; spinReel(); games++; } break; case "Add Coin": addCoin(); break; case "Bet a Credit": betOne(); break; case "Bet Max Credit": betMax(); break; case "Reset Bet": resetBet(); break; case "View Statistics": //creates new JFrame to view statistics ViewStats viewStats = new ViewStats(games, wins, losses, creditsWon); viewStats.setTitle("Stats"); viewStats.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); viewStats.setVisible(true); viewStats.setSize(1200, 1200); break; //the case statements below will stop the reels spinning and display end game results //when all three reels are stopped case ">>>": if (isSpin == true) { worker.cancel(true); reelsStopped++; if (reelsStopped == 3) { endGameResult(); reelsStopped = 0; isSpin = false; } } else { JOptionPane.showMessageDialog(null, "Place a bet first then Spin"); } break; case ">>": if (isSpin == true) { worker2.cancel(true); reelsStopped++; if (reelsStopped == 3) { endGameResult(); reelsStopped = 0; isSpin = false; } } else { JOptionPane.showMessageDialog(null, "Place a bet first then Spin"); } break; case ">": if (isSpin == true) { worker3.cancel(true); reelsStopped++; if (reelsStopped == 3) { endGameResult(); reelsStopped = 0; isSpin = false; } } else { JOptionPane.showMessageDialog(null, "Place a bet first then Spin"); } break; default: break; } } } //spinReel() spins the three reels using the MyWorker class created that implements a SwingWorker public void spinReel() { worker = new MyWorker(lblImage, testArea); worker2 = new MyWorker(lblImage2, testArea2); worker3 = new MyWorker(lblImage3, testArea3); worker.execute(); worker2.execute(); worker3.execute(); } //endGameResult() displayes the results after the reels have stpped spinning public void endGameResult() { int symbolValue = Integer.parseInt(testArea.getText()); int symbolValue2 = Integer.parseInt(testArea2.getText()); int symbolValue3 = Integer.parseInt(testArea3.getText()); if (symbolValue == symbolValue2) { wins++; JOptionPane.showMessageDialog(null, "You won! You gained an additional " + betCalculation(symbolValue) + " credits!"); } else if (symbolValue == symbolValue3) { wins++; JOptionPane.showMessageDialog(null, "You won! You gained an additional " + betCalculation(symbolValue) + " credits!"); } else if (symbolValue2 == symbolValue3) { wins++; JOptionPane.showMessageDialog(null, "You won! You gained an additional " + betCalculation(symbolValue2) + " credits!"); } else if (symbolValue == symbolValue2 && symbolValue == symbolValue3 && symbolValue2 == symbolValue3) { wins++; JOptionPane.showMessageDialog(null, "You won! You gained an additional " + betCalculation(symbolValue) + " credits!"); } else { bet = 0; betArea.setText("Your Bet: " + bet); losses++; JOptionPane.showMessageDialog(null, "You Lose"); } limit = false; } //addCoin() increments the credit area by 1 public void addCoin() { if (credit > 0) { credit++; creditArea.setText("Credit: " + credit); } else { JOptionPane.showMessageDialog(null, "No more credit!"); } } //betOne() increments the bet area by 1 if there are enough credits in the credit area public void betOne() { if (credit > 0) { bet++; credit--; betArea.setText("Bet: " + bet); creditArea.setText("Credit: " + credit); } else { JOptionPane.showMessageDialog(null, "You ran out of credit!"); } } //betMax() increments the bet area by 3 if there are enough credits in the credit area public void betMax() { if (credit <= 0) { JOptionPane.showMessageDialog(null, "You ran out of credit!"); } else if (limit == false && credit > 2) { bet = bet + maxBet; credit = credit - maxBet; betArea.setText("Bet: " + bet); creditArea.setText("Credit: " + credit); limit = true; } else if (credit < 3) { JOptionPane.showMessageDialog(null, "You don't have credits to use this button!"); } else { //this button can be used once per spin JOptionPane.showMessageDialog(null, "You can't use this button again"); } } //resetBet() resets the bet and returns the value to the credit area public void resetBet() { credit = credit + bet; bet = 0; betArea.setText("Bet: " + bet); creditArea.setText("Credit: " + credit); limit = false; } //betCalculation() performs the end game calculations using the payout in credits from the spec public int betCalculation(int symbolVal) { int result = 0; result = bet * symbolVal; creditsWon = result; credit = credit + (bet * symbolVal); bet = 0; betArea.setText("Bet: " + bet); creditArea.setText("Credit: " + credit); return result; } public static void main(String[] args) { // This will invoke the constructor by allocating an anonymous instance SlotMachine slotMachine = new SlotMachine(); slotMachine.setTitle("Slot Machine"); // sets title to Slot Machine slotMachine.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); slotMachine.setVisible(true); // makes the frame visible to user slotMachine.setSize(1000, 1000); // sets the size of the frame } }
true
f73ffb0b5c35178ac88a050ffd9d9a85326e66ce
Java
nikhil-kumar33/RestAssuredAssignments
/restAssuredAssignments/src/test/java/restAssuredAssignments/Assignment2.java
UTF-8
941
2.421875
2
[]
no_license
package restAssuredAssignments; import org.testng.Assert; import io.cucumber.java.en.Given; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; import io.restassured.response.Response; public class Assignment2 { Response response; String url; @Given("Assignment2_Latest Foreign exchange rates") public void assignment2_latest_Foreign_exchange_rates() { url ="https://api.ratesapi.io/api/latest"; } @When("Assignment2_API is available") public void assignment2_api_is_available() { response= RestAssured.get(url); } @Then("Assignment2_assert the response body") public void assignment1_assert_the_response_body() { Assert.assertFalse(response.getBody().asString().isEmpty()); JsonPath jsonPathEvaluator= response.jsonPath(); Assert.assertTrue(jsonPathEvaluator.get("rates.INR").toString().contains("88.6375")); } }
true
afd83e8841230a9e71b7b666cad1b409baf06ed4
Java
vikas-dolare17/Rest_Spring_Repository
/FactoryMethodCalenderInst/src/main/java/com/java/spring/bean/JavaBeanClass.java
UTF-8
801
2.625
3
[]
no_license
package main.java.com.java.spring.bean; // This is bean class public class JavaBeanClass { private int intVar; private String strVar; private float floatVar; private double doubleVar; public int getIntVar() { return intVar; } public void setIntVar(int intVar) { this.intVar = intVar; } public String getStrVar() { return strVar; } public void setStrVar(String strVar) { this.strVar = strVar; } public float getFloatVar() { return floatVar; } public void setFloatVar(float floatVar) { this.floatVar = floatVar; } public double getDoubleVar() { return doubleVar; } public void setDoubleVar(double doubleVar) { this.doubleVar = doubleVar; } @Override public String toString() { return "JavaBeanClass [intVar=" + intVar + ", strVar=" + strVar + "]"; } }
true
7dde193aeb0a0f3ebfc0b1308876a4a7b627b3bd
Java
quarkusio/quarkus
/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/runtime/HttpServerConfig.java
UTF-8
2,393
2.1875
2
[ "Apache-2.0" ]
permissive
package io.quarkus.micrometer.runtime.config.runtime; import java.util.List; import java.util.Optional; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @ConfigRoot(name = "micrometer.binder.http-server", phase = ConfigPhase.RUN_TIME) public class HttpServerConfig { /** * Comma-separated list of regular expressions used to specify uri * labels in http metrics. * * Vertx instrumentation will attempt to transform parameterized * resource paths, `/item/123`, into a generic form, `/item/{id}`, * to reduce the cardinality of uri label values. * * Patterns specified here will take precedence over those computed * values. * * For example, if `/item/\\\\d+=/item/custom` or * `/item/[0-9]+=/item/custom` is specified in this list, * a request to a matching path (`/item/123`) will use the specified * replacement value (`/item/custom`) as the value for the uri label. * Note that backslashes must be double escaped as `\\\\`. * * @asciidoclet */ @ConfigItem public Optional<List<String>> matchPatterns = Optional.empty(); /** * Comma-separated list of regular expressions defining uri paths * that should be ignored (not measured). */ @ConfigItem public Optional<List<String>> ignorePatterns = Optional.empty(); /** * Suppress non-application uris from metrics collection. * This will suppress all metrics for non-application endpoints using * `${quarkus.http.root-path}/${quarkus.http.non-application-root-path}`. * * Suppressing non-application uris is enabled by default. * * @asciidoclet */ @ConfigItem(defaultValue = "true") public boolean suppressNonApplicationUris; /** * Maximum number of unique URI tag values allowed. After the max number of * tag values is reached, metrics with additional tag values are denied by * filter. */ @ConfigItem(defaultValue = "100") public int maxUriTags; public void mergeDeprecatedConfig(VertxConfig config) { if (!ignorePatterns.isPresent()) { ignorePatterns = config.ignorePatterns; } if (!matchPatterns.isPresent()) { matchPatterns = config.matchPatterns; } } }
true
a7e82c1bdf3d2107a804c3892cfbf2713b47b832
Java
Ko01Nim/SE
/app/src/main/java/com/first/miso/Reserve_Cancel.java
UTF-8
903
2.03125
2
[]
no_license
package com.first.miso; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class Reserve_Cancel extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reserve_cancel); // '예약이 취소되었습니다' 문장 출력후 메인버튼누르면 메인으로 돌아가는 이벤트 Button go_main_button = (Button) findViewById(R.id. go_main_button); go_main_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(Reserve_Cancel.this, MainActivity.class); startActivity(intent); } }); } }
true
6d1a982a6f42071add1173142bd26711e631f37c
Java
royzhuo/foodroot
/fweb/src/main/java/com/service/fwebService.java
UTF-8
240
1.515625
2
[]
no_license
package com.service; import org.springframework.stereotype.Service; /** * Created by roy.zhuo on 2018/9/17. */ @Service public class fwebService { public fwebService(){ System.out.println("fweb service ........"); } }
true
9f41b371bedf29e0f2248ec674422fc4224f6776
Java
moutainhigh/JzgxCloud
/fssp-jzgx-common/fssp-pubjz-foundation/src/main/java/com/inspur/gs/fssp/pubjz/foundation/api/JZBillBeApi.java
UTF-8
802
1.921875
2
[]
no_license
package com.inspur.gs.fssp.pubjz.foundation.api; import com.inspur.gs.fssp.pubjz.foundation.entity.ResultRet; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.util.Map; /** * @Author tangchm01 * @Date 2020/2/11 9:59 * @Version 1.0 */ @Path("/getbillbe") @Produces(MediaType.APPLICATION_JSON) public interface JZBillBeApi { /** * * @param params Formclasscode 表单分类 Formywclasscode 表单业务分类 * First 第一维度 Second 第二维度 * @return */ @POST @Path("/getbeidbybillclassandbillywclass") @Consumes(MediaType.APPLICATION_JSON) ResultRet getBeByBillclassAndBillywclass(Map<String, Object> params); }
true
ef1112d5f53a696b3b2a047370266be961b829e2
Java
emilb/snakebot
/app/src/test/java/se/cygni/snake/apiconversion/GameSettingsConverterTest.java
UTF-8
765
2.578125
3
[ "MIT" ]
permissive
package se.cygni.snake.apiconversion; import org.junit.Test; import se.cygni.snake.api.model.GameSettings; import se.cygni.snake.game.GameFeatures; import static org.junit.Assert.assertEquals; public class GameSettingsConverterTest { @Test public void testToGameSettings() throws Exception { } @Test public void testToGameFeatures() throws Exception { GameSettings gs = new GameSettings.GameSettingsBuilder() .withWidth(33) .withHeight(43) .withMaxNoofPlayers(3) .build(); GameFeatures gf = GameSettingsConverter.toGameFeatures(gs); assertEquals(33, gf.width); assertEquals(43, gf.height); assertEquals(3, gf.maxNoofPlayers); } }
true
baf4f463eb0e179b00c9d42d60914f149512474f
Java
hei731/ms
/ms-auth/src/main/java/com/example/auth/store/CustomTokenEnhancer.java
UTF-8
3,605
1.984375
2
[]
no_license
package com.example.auth.store; import com.example.auth.service.CustomClientDetailsService; import com.example.common.core.constants.SecurityConstants; import com.example.common.core.entity.SysLoginLogVO; import com.example.common.rabbitmq.producer.LoginLogProducer; import com.example.common.resource.entity.CustomUserDetailsUser; import lombok.SneakyThrows; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.provider.ClientDetails; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.token.TokenEnhancer; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.net.InetAddress; import java.util.HashMap; import java.util.Map; /** * @author czx * @title: CustomTokenEnhancer * @projectName ms * @description: TODO * @date 2019/7/2610:12 */ public class CustomTokenEnhancer implements TokenEnhancer { private CustomClientDetailsService customClientDetailsService; @Autowired private LoginLogProducer loginLogProducer; public CustomTokenEnhancer(CustomClientDetailsService customClientDetailsService){ this.customClientDetailsService = customClientDetailsService; } @SneakyThrows @Override public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes(); HttpServletRequest request = servletRequestAttributes.getRequest(); SysLoginLogVO sysLoginLogVO = SysLoginLogVO .builder() .grant_type(authentication.getOAuth2Request().getGrantType()) .request_uri(request.getRequestURI()) .user_agent(request.getHeader("User-Agent")) .request_method(request.getMethod()) .request_ip(InetAddress.getLocalHost().getHostAddress()) .token(accessToken.getValue()) .build(); if (SecurityConstants.CLIENT_CREDENTIALS.equals(authentication.getOAuth2Request().getGrantType())) { ClientDetails clientDetails = customClientDetailsService.loadClientByClientId((String) authentication.getPrincipal()); ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(clientDetails.getAdditionalInformation()); sysLoginLogVO.setClient_id((String) authentication.getPrincipal()); loginLogProducer.send(sysLoginLogVO); return accessToken; } final Map<String, Object> additionalInfo = new HashMap<>(8); CustomUserDetailsUser customUserDetailsUser = (CustomUserDetailsUser) authentication.getUserAuthentication().getPrincipal(); additionalInfo.put(SecurityConstants.USER_ID, customUserDetailsUser.getUserId()); additionalInfo.put(SecurityConstants.LIMIT_LEVEL, customUserDetailsUser.getLimitLevel()); additionalInfo.put(SecurityConstants.USER_NAME, customUserDetailsUser.getUsername()); sysLoginLogVO.setUser_name(customUserDetailsUser.getUsername()); loginLogProducer.send(sysLoginLogVO); ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo); return accessToken; } }
true
e11bdb9004ab2f3dd0fd9b21db341027ac5bdc6c
Java
yasarmatrac/Beylikler
/src/Military/Castle.java
UTF-8
1,619
3.046875
3
[]
no_license
package Military; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import javax.imageio.ImageIO; @SuppressWarnings("serial") public class Castle extends Construction{ String imageFileName = "images/castle.gif"; Image image; ArrayList<Arrow> arrow = new ArrayList<Arrow>(); public Castle(ArrayList<Military> military,int team){ this.military = military; this.team = team; frameRate = 1; hp = 100; str = 10000; defence = 10000; loadImage(); x = 1280-imageWidth; y= 400 - imageHeight/2; objectThread.start(); } private void loadImage (){ URL imageFileUrl = getClass().getClassLoader().getResource(imageFileName); try { image = ImageIO.read(imageFileUrl).getSubimage(70, 40, 413, 446).getScaledInstance(256, 256, 0); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } imageHeight = image.getHeight(this); imageWidth = image.getWidth(this); } @Override public Image getCurrentImage() { return image; } @Override protected void update() { int onCol = onCollision(); if (onCol != -1) attack(military.get(onCol)); } @Override public void paintComponent(Graphics g) { g.drawImage(getCurrentImage(),x,y,null); g.setColor(Color.WHITE); g.drawString(String.valueOf(hp), x, y); for (int i = 0; i < arrow.size(); i++) { if (arrow.get(i) != null) arrow.get(i).paintComponent(g); } } @Override protected void attack(Military m) { arrow.add(new Arrow(x,y,m.x,m.y)); m.defenceAttack(str); } }
true
6e06af0fd4a908fc44c4cd74a89f2bc899acec94
Java
cafeteru/RI-Gauss
/2017/3_cws_arquitectura_skel_ampliacion/src/uo/ri/business/impl/cash/mediosPago/DeleteMedioPago.java
UTF-8
1,109
2.4375
2
[]
no_license
package uo.ri.business.impl.cash.mediosPago; import uo.ri.business.impl.Command; import uo.ri.business.repository.MedioPagoRepository; import uo.ri.conf.Factory; import uo.ri.model.MedioPago; import uo.ri.model.Metalico; import uo.ri.util.exception.BusinessException; import uo.ri.util.exception.Check; public class DeleteMedioPago implements Command<Void> { private MedioPagoRepository rMedios = Factory.repository.forMedioPago(); private Long id; public DeleteMedioPago(Long id) { this.id = id; } @Override public Void execute() throws BusinessException { MedioPago m = rMedios.findById(id); comprobarMetalico(m); comprobarCargos(m); rMedios.remove(m); return null; } private void comprobarMetalico(MedioPago m) throws BusinessException { if (m instanceof Metalico) throw new BusinessException("No se puede borrar metalico"); Check.isNotNull(m, "El medio de pago no existe"); } private void comprobarCargos(MedioPago m) throws BusinessException { int cargos = m.getCargos().size(); if (cargos > 0) throw new BusinessException("No se puede borrar metalico"); } }
true
d9b0cab1def2147c67d6551d15101027290ece44
Java
Oshi41/Dash-core
/src/main/java/dashcore/debug/dimension/DebugDimensionProvider.java
UTF-8
996
2.0625
2
[]
no_license
package dashcore.debug.dimension; import dashcore.registry.DashDimensions; import net.minecraft.init.Biomes; import net.minecraft.world.DimensionType; import net.minecraft.world.WorldProvider; import net.minecraft.world.biome.BiomeProviderSingle; import net.minecraft.world.gen.IChunkGenerator; import javax.annotation.Nullable; public class DebugDimensionProvider extends WorldProvider { @Override protected void init() { biomeProvider = new BiomeProviderSingle(Biomes.VOID); nether = false; hasSkyLight = true; } @Override public IChunkGenerator createChunkGenerator() { return new DebugChunkGenerator(this.world, world.rand.nextLong()); } @Nullable @Override public String getSaveFolder() { return "Ds_Debug"; } @Override public int getAverageGroundLevel() { return 5; } @Override public DimensionType getDimensionType() { return DashDimensions.debugDimension; } }
true
336ec7cb4f5cc9f2fae9fe082906843dac118510
Java
aadanaquesantos/preventa_backend_new
/src/main/java/com/digitalinka/restpreventa/model/response/DispatcherAddressListResponse.java
UTF-8
651
2.078125
2
[]
no_license
package com.digitalinka.restpreventa.model.response; import com.digitalinka.restpreventa.model.DispatchAddress; import java.util.ArrayList; import java.util.List; public class DispatcherAddressListResponse { private List<DispatchAddress> addresses=new ArrayList<>(); StatusResponse status; public List<DispatchAddress> getAddresses() { return addresses; } public void setAddresses(List<DispatchAddress> addresses) { this.addresses = addresses; } public StatusResponse getStatus() { return status; } public void setStatus(StatusResponse status) { this.status = status; } }
true
312ea40180b50d3634c066b22be3249220d3d9bc
Java
azhangxi/UniversityServiceSystem
/main/ui/window/panel/admin/ManagePanels.java
UTF-8
8,795
2.515625
3
[]
no_license
package ui.window.panel.admin; import model.Admin; import model.User; import model.Users; import model.UsersType; import ui.window.panel.common.EditProfilePanel; import ui.window.panel.common.Panels; import ui.window.panel.common.RegisterPanel; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; import javax.swing.table.JTableHeader; import javax.swing.table.TableCellRenderer; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import static java.awt.Color.*; import static model.SuperAdmin.SUPER_ADMIN; import static model.UsersType.ADMIN; import static ui.Main.MAIN_WINDOW; public class ManagePanels extends Panels { private JLayeredPane managePanel; private JPanel bottomPanel; private JScrollPane tablePane; private UsersType type; private Users users; private Admin admin; private JTable table; private int selectedRow = -1; private String[][] data; private String[] tableHeaderContent = {"Username", "Password", "Name", "Gender", "Age"}; private static final int BUTTONS_Y = 550; public ManagePanels(JComponent sourcePanel, UsersType type, Admin admin) { super(sourcePanel); this.type = type; this.admin = admin; if (type == UsersType.STUDENT) { users = students; } else if (type == ADMIN) { users = admins; } else { users = instructors; } bottomPanel = initializeDefaultPanel(); bottomPanel.setBounds(0,0,800, 600); initializeButtons(); initializeTableContent(); } private void initializeJLayeredPane() { managePanel = new JLayeredPane(); managePanel.add(bottomPanel, new Integer(0)); managePanel.add(tablePane, new Integer(10)); } private void initializeButtons() { initializeBackButton(bottomPanel); Dimension smallButton = new Dimension(20, 20); JButton add = new JButton("+"); add.setSize(smallButton); add.setLocation(50, BUTTONS_Y); add.addActionListener(new AddUserAction()); bottomPanel.add(add); JButton remove = new JButton("-"); remove.setSize(smallButton); remove.setLocation(90, BUTTONS_Y); remove.addActionListener(new DeleteUserAction()); bottomPanel.add(remove); JButton modify = new JButton("Modify"); modify.setBounds(150, BUTTONS_Y, 70, 20); modify.addActionListener(new ModifyUserAction()); bottomPanel.add(modify); } private void initializeTableContent() { data = new String[whatsTheSize()][5]; int i = 0; for (User user : users.usersHashMap.values()) { if (!user.equals(SUPER_ADMIN)) { String[] col = new String[]{user.getUserName(), user.getPassWord(), user.getName(), user.getGender(), String.valueOf(user.getAge())}; data[i] = col; i++; } } DefaultTableModel defaultTableModel = new DefaultTableModel(data, tableHeaderContent) { public boolean isCellEditable(int row, int column) { return false; } }; table = new JTable(defaultTableModel); initTableSettings(); } private int whatsTheSize() { return (admin.equals(SUPER_ADMIN) && users.getType() == ADMIN ? users.usersHashMap.size() - 1 : users.usersHashMap.size()); } private void initializeScrollPane() { tablePane = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); tablePane.setBounds(50, 30, 700, 510); } private void initTableSettings() { table.setRowHeight(18); table.setGridColor(BLACK); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.addMouseListener(new TableListener()); initHead(); initCells(); initializeScrollPane(); initializeJLayeredPane(); } private void initHead() { JTableHeader tableHeader = table.getTableHeader(); tableHeader.setPreferredSize(new Dimension(table.getWidth(), 35)); tableHeader.setFont(new Font(Font.DIALOG, Font.PLAIN, 18)); tableHeader.setDefaultRenderer(new HeaderRenderer(table)); // DefaultTableCellHeaderRenderer hr = new DefaultTableCellHeaderRenderer(); // hr.setHorizontalAlignment(JLabel.CENTER); // tableHeader.setDefaultRenderer(hr); } private void initCells() { //Copied from https://blog.csdn.net/MusicEnchanter/article/details/78501004 //then edited; DefaultTableCellRenderer tableCellRenderer = new DefaultTableCellRenderer() { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (row % 2 == 0) { setBackground(white); } else if (row % 2 == 1) { setBackground(LIGHT_GRAY); } return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } }; tableCellRenderer.setHorizontalAlignment(SwingConstants.CENTER); for (int i = 0; i < 5; i++) { table.getColumn(tableHeaderContent[i]).setCellRenderer(tableCellRenderer); } table.setDefaultRenderer(Object.class, tableCellRenderer); } private class AddUserAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { managePanel.setVisible(false); MAIN_WINDOW.getMainWindow().setContentPane(new RegisterPanel( managePanel, users.getType(), admin).getRegisterPanel()); } } private class DeleteUserAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if (selectedRow >= 0) { String username = data[table.getSelectedRow()][0]; users.deleteUser(users.usersHashMap.get(username)); afterDelete(); } else { makeWarningDialog("Select a user to remove"); } } private void afterDelete() { managePanel.setVisible(false); MAIN_WINDOW.getMainWindow().setContentPane(new ManagePanels( sourcePanel, type, admin).getManagePanel()); } } private class ModifyUserAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if (selectedRow >= 0) { String username = data[table.getSelectedRow()][0]; managePanel.setVisible(false); MAIN_WINDOW.getMainWindow().setContentPane(new EditProfilePanel( managePanel, users.usersHashMap.get(username), admin).getEditProfilePanel()); } else { makeWarningDialog("Select a user to modify"); } } } private class TableListener implements MouseListener { @Override public void mouseClicked(MouseEvent e) { selectedRow = table.getSelectedRow(); } @Override public void mousePressed(MouseEvent e) {} @Override public void mouseReleased(MouseEvent e) {} @Override public void mouseEntered(MouseEvent e) {} @Override public void mouseExited(MouseEvent e) {} } // copied from https://stackoverflow.com/questions/7493369/jtable-right-align-header private static class HeaderRenderer implements TableCellRenderer { DefaultTableCellRenderer renderer; HeaderRenderer(JTable table) { renderer = (DefaultTableCellRenderer) table.getTableHeader().getDefaultRenderer(); renderer.setHorizontalAlignment(JLabel.CENTER); } @Override public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { return renderer.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, col); } } // @Override // protected void refresh() { // initializeTableContent(); // tablePane.repaint(); // } public JLayeredPane getManagePanel() { return managePanel; } }
true
9bd9fbd3bb9f957177b503fcf129100136b72b0d
Java
shtayyabtariq/new-sama-news
/app/src/main/java/xeon/com/youtube/MainActivity.java
UTF-8
5,895
2.0625
2
[]
no_license
package xeon.com.youtube; import android.os.Bundle; import android.os.Handler; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.util.Log; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.pierfrancescosoffritti.androidyoutubeplayer.player.PlayerConstants; import com.pierfrancescosoffritti.androidyoutubeplayer.player.YouTubePlayer; import com.pierfrancescosoffritti.androidyoutubeplayer.player.YouTubePlayerView; import com.pierfrancescosoffritti.androidyoutubeplayer.player.listeners.AbstractYouTubePlayerListener; import com.pierfrancescosoffritti.androidyoutubeplayer.player.listeners.YouTubePlayerInitListener; import com.pierfrancescosoffritti.androidyoutubeplayer.player.listeners.YouTubePlayerListener; import com.pierfrancescosoffritti.androidyoutubeplayer.ui.PlayerUIController; import mopub.xeon.com.mopub.MopubManager; public class MainActivity extends AppCompatActivity { YouTubePlayerView youTubePlayerView; String values = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //MopubManager.ShowIntersitial(); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { // Toast.makeText(getApplicationContext(),"it is called",Toast.LENGTH_LONG).show(); MopubManager.ShowIntersitial(); MopubManager.LoadIntersitial(); //Do something after 100ms handler.postDelayed(this, 950000); } }, 5000); } @Override protected void onDestroy() { super.onDestroy(); youTubePlayerView.release(); } @Override protected void onPostResume() { super.onPostResume(); FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.getReference("geonews"); myRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { // This method is called once with the initial value and again // whenever data at this location is updated. final String value = dataSnapshot.getValue(String.class); Log.d("val", "Value is: " + value); //Toast.makeText(getApplication(),value,Toast.LENGTH_LONG).show(); values = value; Initializeyoutube(value); } @Override public void onCancelled(DatabaseError error) { // Failed to read value Log.w("val", "Failed to read value.", error.toException()); } }); //Toast.makeText(getApplicationContext(),"resume called",Toast.LENGTH_LONG).show(); youTubePlayerView = findViewById(R.id.youtube_player_view); getLifecycle().addObserver(youTubePlayerView); } public void Initializeyoutube(final String videoId) { youTubePlayerView.initialize(new YouTubePlayerInitListener() { @Override public void onInitSuccess(@NonNull final YouTubePlayer initializedYouTubePlayer) { initializedYouTubePlayer.addListener(new AbstractYouTubePlayerListener() { @Override public void onReady() { initializedYouTubePlayer.loadVideo(videoId, 0); initializedYouTubePlayer.addListener(new YouTubePlayerListener() { @Override public void onReady() { } @Override public void onStateChange(@NonNull PlayerConstants.PlayerState state) { } @Override public void onPlaybackQualityChange(@NonNull PlayerConstants.PlaybackQuality playbackQuality) { } @Override public void onPlaybackRateChange(@NonNull PlayerConstants.PlaybackRate playbackRate) { } @Override public void onError(@NonNull PlayerConstants.PlayerError error) { } @Override public void onApiChange() { } @Override public void onCurrentSecond(float second) { } @Override public void onVideoDuration(float duration) { } @Override public void onVideoLoadedFraction(float loadedFraction) { } @Override public void onVideoId(@NonNull String videoId) { } }); } }); } }, true); PlayerUIController playerUIController = youTubePlayerView.getPlayerUIController(); playerUIController.enableLiveVideoUI(true); playerUIController.showMenuButton(false); playerUIController.showFullscreenButton(false); playerUIController.showUI(false); getLifecycle().addObserver(youTubePlayerView); } }
true
f05605e2469f9ffa79af6fe9a8b1fa7359256bc7
Java
dizhaung/alarm-manager
/alarm-query/src/main/java/com/cpqd/vppd/alarmmanager/signaling/AlarmWebSocketSignaling.java
UTF-8
4,507
2.296875
2
[]
no_license
package com.cpqd.vppd.alarmmanager.signaling; import com.cpqd.vppd.alarmmanager.core.converter.AlarmJsonConverter; import com.cpqd.vppd.alarmmanager.core.event.AlarmUpdateEvent; import com.cpqd.vppd.alarmmanager.core.event.WBAlarmUpdateEvent; import com.cpqd.vppd.alarmmanager.core.exception.InvalidAlarmJsonException; import com.cpqd.vppd.alarmmanager.core.model.Alarm; import com.cpqd.vppd.alarmmanager.core.model.AlarmSeverity; import com.cpqd.vppd.alarmmanager.core.services.AlarmMetadataServices; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Priority; import javax.ejb.Singleton; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.websocket.CloseReason; import javax.websocket.OnClose; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import java.util.*; import java.util.concurrent.atomic.AtomicLong; /** * Class for alarm updates signaling through a WebSocket. */ @Singleton @ServerEndpoint("/currentupdates/{namespace}") public class AlarmWebSocketSignaling { /** * Logger. */ private static final Logger LOGGER = LoggerFactory.getLogger(AlarmWebSocketSignaling.class); @Inject private AlarmJsonConverter alarmJsonConverter; @Inject private AlarmMetadataServices alarmMetadataServices; /** * Set that holds all the connected sessions. */ private static Set<Session> connectedPeers = Collections.synchronizedSet(new HashSet<Session>()); /** * Method called by the container when a new WebSocket session is opened. * We store the session in the collection of opened sessions so peers can be notified of * alarm updates. * * @param session the opened session. */ @OnOpen public void onOpen(Session session, @PathParam("namespace") String namespace) { LOGGER.info("[{}] WebSocket session opened for namespace {}", session.getId(), namespace); // store the association of this peer with the specified namespace session.getUserProperties().put(namespace, true); connectedPeers.add(session); } /** * Method called by the container when an alarm update event is raised. * @param alarmUpdateEvent the raised event. */ public void onAlarmUpdateEvent(@Observes @WBAlarmUpdateEvent AlarmUpdateEvent alarmUpdateEvent) { // FIXME if the priority of the observers is undefined, we may obtain // FIXME information that is not up to date if (!connectedPeers.isEmpty()) { LOGGER.info("Alarm update event observed. Notifying connected peers"); // the JSON event will be lazily generated String updateJson = null; for (Session session : connectedPeers) { if (Boolean.TRUE.equals(session.getUserProperties().get(alarmUpdateEvent.getAlarm().getNamespace()))) { if (updateJson == null) { Map<AlarmSeverity, AtomicLong> metadata = alarmMetadataServices.getCurrentAlarmsMetadata(alarmUpdateEvent.getAlarm().getNamespace()); Map<String, Object> notification = new HashMap<>(); notification.put("event", alarmUpdateEvent.getEvent()); notification.put("alarm", alarmUpdateEvent.getAlarm()); notification.put("metadata", metadata); try { updateJson = alarmJsonConverter.toJson(notification); } catch (InvalidAlarmJsonException e) { LOGGER.error("Unable to convert alarm update event to JSON. Listeners will not be notified."); return; } } // send the notification to the peer session.getAsyncRemote().sendText(updateJson); } } } } /** * Called by the container when a peer closes a WebSocket session. * The closed session is removed from the collection. * * @param session the closed session. * @param reason the reason. */ @OnClose public void onClose(Session session, CloseReason reason) { LOGGER.info("[{}] WebSocket session closed", session.getId()); connectedPeers.remove(session); } }
true
23066127e1d3119705562744a8472e4288ab32f3
Java
Jiang-Can/BundleCalculator
/src/main/java/com/jc/calculatorRunner/CalculatorRunner.java
UTF-8
1,331
2.3125
2
[]
no_license
package com.jc.calculatorRunner; import com.jc.UserCentre.NewUser; import com.jc.calcutlatorCore.CalculatorCore; import com.jc.input.InputHandler; import com.jc.output.OutputHandler; import com.jc.utils.Utils; import lombok.Data; import lombok.NoArgsConstructor; import java.util.Arrays; import java.util.List; @NoArgsConstructor @Data public class CalculatorRunner { private CalculatorCore calculatorCore; private InputHandler inputHandler; private OutputHandler outputHandler; private NewUser user; public void runCalculator(){ initializeComponents(); calculatorPivot(inputHandler.getAllInputFormatCodes()); outputHandler.outputResult(); } private void calculatorPivot(String[] inputCodes){ Arrays.stream(inputCodes).forEach((code)->{ List<Integer> combination= calculatorCore.processData( inputHandler.getTotalByFormatCode(code), inputHandler.getBundlesArrayByFormatCode(code)); outputHandler.buildOutput(combination, inputHandler.getFormatByFormatCode(code)); }); } private void initializeComponents(){ user=new NewUser(); inputHandler=new InputHandler(user); calculatorCore=new CalculatorCore(); outputHandler=new OutputHandler(user); } }
true
749964a64b91cb1818b3db0fa2bdc761ae500771
Java
Pokemon3108/job-search
/src/main/java/by/daryazalevskaya/finalproject/controller/command/employer/EmployerInfoGetCommand.java
UTF-8
1,951
2.28125
2
[]
no_license
package by.daryazalevskaya.finalproject.controller.command.employer; import by.daryazalevskaya.finalproject.controller.PagePath; import by.daryazalevskaya.finalproject.controller.command.ActionCommand; import by.daryazalevskaya.finalproject.dao.exception.DaoException; import by.daryazalevskaya.finalproject.model.employer.Employer; import by.daryazalevskaya.finalproject.model.type.DaoType; import by.daryazalevskaya.finalproject.service.CountryService; import by.daryazalevskaya.finalproject.service.EmployerService; import by.daryazalevskaya.finalproject.service.utils.SortingService; import lombok.extern.log4j.Log4j2; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Optional; @Log4j2 public class EmployerInfoGetCommand extends ActionCommand { @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { CountryService countryService = (CountryService) serviceFactory.createService(DaoType.COUNTRY); SortingService sortingService = new SortingService(); request.setAttribute("countries", sortingService.sortCountriesByAlphabet(countryService.findAll())); Integer userId = (Integer) request.getSession().getAttribute("user"); EmployerService employerService = (EmployerService) serviceFactory.createService(DaoType.EMPLOYER); Optional<Employer> employer = employerService.read(userId); employer.ifPresent(employer1 -> request.setAttribute("employer", employer.get())); request.getServletContext() .getRequestDispatcher(PagePath.EMPLOYER_INFO) .forward(request, response); } catch (DaoException e) { log.error(e); response.sendError(500); } } }
true
a14fa24fd1dff2202ae6c33af087df5513a0b45f
Java
fuhaiq/umbrella
/LogPercentiles/version2/percentiles-v2/src/main/java/com/riot/percentiles/analyzer/ResponseTimeAnalyzer.java
UTF-8
6,134
2.375
2
[]
no_license
package com.riot.percentiles.analyzer; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.io.Reader; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.PostConstruct; import org.apache.commons.io.FilenameUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.google.common.base.Charsets; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.opencsv.bean.CsvToBeanBuilder; import com.riot.percentiles.partitioner.RangePartitioner; import com.riot.percentiles.pojo.AccessLog; import com.riot.percentiles.pojo.ShuffleFile; import com.riot.percentiles.utils.HttpMethod; @Component public class ResponseTimeAnalyzer { private final Log logger = LogFactory.getLog(ResponseTimeAnalyzer.class); @Value("${log.dir:/var/log/httpd}") private String dir; @Value("${shuffle.dir:/tmp/shuffles}") private String shuffle_dir; @Value("${shuffle.prefix:shuffle-}") private String shuffle_prefix; @Value("${shuffle.deleteOnExit:true}") private boolean deleteOnExit; @Autowired private RangePartitioner partitioner; // total number of READ access logs private long N; // list of shuffle file with number of access logs private List<ShuffleFile> shuffle_files = Lists.newArrayList(); private final List<Double> percents = Lists.newArrayList(0.9d, 0.95d, 0.99d); /** * calculates the 90%, 95% and 99% percentile response time for READ API requests</br> * time-complexity = O(2P+(N/P))</br> * space-complexity = O(2P)</br> * @throws IOException */ @PostConstruct public void analyse() throws IOException { Path tempShuffleDir = shuffle(); sortShuffleFiles(tempShuffleDir); // sort shuffle files by extension name shuffle_files = shuffle_files.stream().sorted((a, b) -> { int partitionA = Integer.valueOf(FilenameUtils.getExtension(a.getPath().toFile().getName())); int partitionB = Integer.valueOf(FilenameUtils.getExtension(b.getPath().toFile().getName())); return partitionA - partitionB; }).collect(Collectors.toList()); for (Double percent : percents) { int target = new Double(percent * N).intValue(); int current = 0; locate: for (ShuffleFile file : shuffle_files) { current += file.getNumberOfLog(); // locate line number in shuffle file if (target <= current) { int line = file.getNumberOfLog() - (current - target); int responseTime = Integer.valueOf(Files.readAllLines(file.getPath()).get(line - 1)); logger.info(percent * 100 + "% of requests return a response in " + responseTime + " ms "); break locate; } } } } /** * shuffle all access log according range partitioner, generate shuffle files under temp shuffle dir</br> * time-complexity = O(P + N)</br> * space-complexity = O(2*(P+N))</br> * @return * @throws IOException */ private Path shuffle() throws IOException { // create temp shuffle dir Path tempShuffleDir = Files.createTempDirectory(Paths.get(shuffle_dir), shuffle_prefix); if (deleteOnExit) { tempShuffleDir.toFile().deleteOnExit(); } // create temp shuffle files, map partition index with file writer Map<Integer, PrintWriter> partition2FileWriter = Maps.newHashMap(); for (int i = 0; i < partitioner.numPartitions() + 1; i++) { Path tmpShufflefile = Files.createTempFile(tempShuffleDir, shuffle_prefix, "." + i); partition2FileWriter.put(i, new PrintWriter(tmpShufflefile.toFile())); if (deleteOnExit) { tmpShufflefile.toFile().deleteOnExit(); } } // walk through log dir, read each access log file then filter all READ request Files.walkFileTree(Paths.get(dir), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attr) throws IOException { try (Reader reader = new FileReader(path.toFile())) { List<AccessLog> logs = new CsvToBeanBuilder<AccessLog>(reader).withType(AccessLog.class).build() .parse().stream().filter(log -> log.getHttpMethod() == HttpMethod.GET) .collect(Collectors.toList()); logs.forEach(log -> { // calculate partition index using range partitioner int partition = partitioner.getPartition(log); // write response time into corresponding shuffle file partition2FileWriter.get(partition).println(log.getResponseTime()); }); } return FileVisitResult.CONTINUE; } }); // close all shuffle files' writers partition2FileWriter.forEach((k, writer) -> writer.close()); return tempShuffleDir; } /** * sort every shuffle file under temp shuffle dir</br> * time-complexity = O(2N + P)</br> * space-complexity = O(N + P)</br> * <i>P refers to number of partitions. * @param temp shuffle dir * @throws IOException */ private void sortShuffleFiles(Path tempShuffleDir) throws IOException { Files.walkFileTree(tempShuffleDir, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attr) throws IOException { ShuffleFile shuffle_file = new ShuffleFile(path); Stream<Integer> stream = Files.readAllLines(path, Charsets.UTF_8).stream().map(Integer::valueOf) .sorted(); try (PrintWriter writer = new PrintWriter(path.toFile())) { stream.forEach(responseTime -> { writer.println(responseTime); shuffle_file.add(); N++; }); } shuffle_files.add(shuffle_file); return FileVisitResult.CONTINUE; } }); } }
true
4396ebf08bf3bf413d3aa5cbeabf66fc9a1ae9a1
Java
chenxm66777123/luckdraw
/src/main/java/com/goldbee/luckdraw/entity/Users.java
UTF-8
1,250
2.171875
2
[]
no_license
package com.goldbee.luckdraw.entity; import java.io.Serializable; import java.util.Date; import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; /** * <p> * 用户信息表 * </p> * * @author chenxm66777123 * @since 2018-12-22 */ @Getter @Setter @Accessors(chain = true) @NoArgsConstructor @TableName("users") @ToString public class Users extends Model<Users> { private static final long serialVersionUID = 1L; /** * id */ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 微信用户唯一标识 */ private String openid; /** * 微信昵称 */ private String nickName; /** * 微信头像 */ private String headimgurl; /** * 性别 0 女 1 男 */ private String sex; /** * 真实姓名 */ private String realName; /** * 电话号码 */ private String telphone; /** * 创建时间 */ private Date createTime; @Override protected Serializable pkVal() { return this.id; } }
true
be6d522e8a62485c9b58a4d690fadb03db10dffa
Java
haffid/MyAppRecyclerContactClase
/app/src/main/java/com/haffid/myapprecyclerfoodclase/MainActivity.java
UTF-8
1,700
2.21875
2
[]
no_license
package com.haffid.myapprecyclerfoodclase; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.os.Bundle; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { private ArrayList<DatosVO> listaVO = new ArrayList<>(); private RecyclerView recyclerView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); recyclerView = findViewById(R.id.recyclerId); recyclerView.setLayoutManager(new LinearLayoutManager(this)); this.insertarDatos(); AdaptadorRecycler adaptadorRecycler = new AdaptadorRecycler(listaVO); recyclerView.setAdapter(adaptadorRecycler); } public void insertarDatos(){ listaVO.add(new DatosVO("Abigail Espina", 57458912, R.drawable.ic_contactom)); listaVO.add(new DatosVO("Heydy Martinez", 57126347, R.drawable.ic_contactom)); listaVO.add(new DatosVO("Omar Espina", 54789678, R.drawable.ic_contacto)); listaVO.add(new DatosVO("Edy Espina", 55879641, R.drawable.ic_contacto)); listaVO.add(new DatosVO("Grace Martinez", 53414578, R.drawable.ic_contactom)); listaVO.add(new DatosVO("Intecap", 1565, R.drawable.ic_contactoi)); listaVO.add(new DatosVO("Trabajo", 247896341, R.drawable.ic_contacto)); listaVO.add(new DatosVO("Hamburguesas", 24789634, R.drawable.ic_contacto)); listaVO.add(new DatosVO("Pollo", 47586932, R.drawable.ic_contacto)); listaVO.add(new DatosVO("Pizza", 46478963, R.drawable.ic_contacto)); } }
true
cf9844a60271033d5193806bfbf344acf0e512c2
Java
badeapatriciaa/CTS-laboratory
/Week6- Builder Prorotype Simple Factory/src/ro/ase/csie/cts/dp/prototype/TestPrototype.java
UTF-8
641
3.328125
3
[]
no_license
package ro.ase.csie.cts.dp.prototype; public class TestPrototype { public static void main(String[] args) throws CloneNotSupportedException { Tree3DModel tree1= new Tree3DModel("Green", 200); Tree3DModel tree2= new Tree3DModel("Red", 150); Tree3DModel tree3= new Tree3DModel("Green", 200); //prototype - don't recreate the objects, clone them //shallow copy : //Tree3DModel tree4 = tree1; //another reference pointing to tree1 Tree3DModel tree4 = (Tree3DModel) tree1.clone(); Tree3DModel tree5 = (Tree3DModel) tree1.clone(); Tree3DModel tree6 = (Tree3DModel) tree1.clone(); System.out.println("The end"); } }
true
eccfdffcf826121d3b1ef81c5e22da74bc925e71
Java
FlightToDenmark/urban-umbrella
/src/programmers/FailureRate.java
UTF-8
1,251
3.453125
3
[]
no_license
package programmers; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.stream.Collectors; public class FailureRate { public static void main(String[] args) { int[] stages1 = { 2, 1, 2, 6, 2, 4, 3, 3 }; int[] answer1 = solution(7, stages1); for (int n : answer1) { System.out.print(n + " "); } System.out.println(); int[] stages2 = { 4, 4, 4, 4, 4 }; int[] answer2 = solution(4, stages2); for (int n : answer2) { System.out.print(n + " "); } } public static int[] solution(int N, int[] stages) { Map<Integer, Double> map = new HashMap<>(); int a, b; double failureRate; for (int n = 1; n <= N; n++) { a = 0; b = 0; for (int x : stages) { if (x > n) { a++; } if (x >= n) { b++; } } failureRate = (b != 0) ? (double) (b - a) / b : 0; map.put(n, failureRate); } map = map.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new)); return map.keySet().stream().mapToInt(i -> i).toArray(); } }
true
7be4ab45aa974c16689a6cb438bc92af8c643a3e
Java
thopvna/projects
/Ikariam/app/src/main/java/com/thopv/projects/ikariam/fight/presentation/views/TroopHolder.java
UTF-8
1,158
2.34375
2
[]
no_license
package com.thopv.projects.ikariam.fight.presentation.views; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.Picasso; import com.thopv.projects.ikariam.R; import com.thopv.projects.ikariam.home.presentation.models.BaseTroop; import com.thopv.projects.ikariam.data.schema.units.units.Unit; import com.thopv.projects.ikariam.data.schema.units.units.UnitFactory; /** * Created by thopv on 11/14/2017. */ public class TroopHolder extends RecyclerView.ViewHolder { private ImageView troopIcon; private TextView amountView; public TroopHolder(View itemView) { super(itemView); troopIcon = itemView.findViewById(R.id.unitIcon); amountView = itemView.findViewById(R.id.unitAmount); } public void setTroopInform(BaseTroop baseTroop){ Unit unit = UnitFactory.getUnit(baseTroop.getUnitName()); Picasso.with(troopIcon.getContext()).load(unit.getDrawable()).fit().into(troopIcon); amountView.setText(String.valueOf(baseTroop.getAmount())); } }
true
9fd3424cc16bc44024af82a280ea94c653980d53
Java
reasoncai/design-pattern2
/src/main/java/com/cai/dp2/observer/jdk/WeatherData.java
UTF-8
1,709
3.375
3
[]
no_license
package com.cai.dp2.observer.jdk; import java.util.HashMap; import java.util.Observable; /** * 天气主题, * Created by reason on 17/8/6. */ public class WeatherData extends Observable { //天气状态值 private float temperature; private float humidity; private float pressure; public WeatherData() { } /** * 天气状态值变化,观察者拉数据 */ public void measurementsChanged() { //将标志位置为已发生了变化 setChanged(); //通知观察者,观察者拉数据 notifyObservers(); } /** * 天气值变化,主题主动推数据 */ public void measurementsChangedAndPush() { setChanged(); HashMap<String, Object> map = new HashMap<>(); map.put("temperature", this.temperature); map.put("humidity", this.humidity); map.put("pressure", this.pressure); notifyObservers(map); } /** * 天气状态值 * * @param temperature * @param humidity * @param pressure */ public void setMeasurements(float temperature, float humidity, float pressure) { this.temperature = temperature; this.humidity = humidity; this.pressure = pressure; //拉模式 this.measurementsChanged(); //推模式 this.measurementsChangedAndPush(); } /** * 使用观察者"拉"的做法,所以要暴露状态属性 * * @return */ public float getTemperature() { return this.temperature; } public float getHumidity() { return humidity; } public float getPressure() { return pressure; } }
true
8dc20a36e188fe890cf56b25280df1d61daa801b
Java
broadinstitute/ddp-study-server
/pepper-apis/dss-core/src/main/java/org/broadinstitute/ddp/model/activity/definition/types/DecimalDef.java
UTF-8
1,155
2.46875
2
[ "BSD-3-Clause" ]
permissive
package org.broadinstitute.ddp.model.activity.definition.types; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; @Value @AllArgsConstructor public class DecimalDef implements Comparable<DecimalDef>, Serializable { @SerializedName("value") BigInteger value; @SerializedName("scale") int scale; public DecimalDef(final BigDecimal decimal) { this(decimal.unscaledValue(), decimal.scale()); } public DecimalDef(final int value) { this(BigDecimal.valueOf(value)); } public DecimalDef(final long value) { this(BigDecimal.valueOf(value)); } public DecimalDef(final String value) { this(new BigDecimal(value)); } @Override public int compareTo(final DecimalDef o) { return toBigDecimal().compareTo(o.toBigDecimal()); } public int compareTo(final BigDecimal o) { return toBigDecimal().compareTo(o); } public BigDecimal toBigDecimal() { return new BigDecimal(value, scale); } }
true
6d030d9c59f6986f2afd9f43acdac50ab0c3430f
Java
way2rakeshr/ospoclogin
/src/main/java/com/hcl/ospoclogin/exception/GlobalException.java
UTF-8
1,207
2.140625
2
[]
no_license
package com.hcl.ospoclogin.exception; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import com.hcl.ospoclogin.utlity.AppConstant; @ControllerAdvice public class GlobalException extends ResponseEntityExceptionHandler { @ExceptionHandler(UserException.class) public ResponseEntity<ErrorResponse> UserErrorException(UserException ex) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.setMessage(ex.getMessage()); errorResponse.setStatus(AppConstant.USER_NOT_EXIST_STATUS); return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST); } @ExceptionHandler(UserPassword.class) public ResponseEntity<ErrorResponse> UserPasswordException(UserPassword ex) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.setMessage(ex.getMessage()); errorResponse.setStatus(AppConstant.PASSWORD_NOT_MATCHING_STATUS); return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST); } }
true
868d4505a6b9b9b8d72fde79ed27f67bb2f88eac
Java
dauquoctoan/Spring-mvc-diamonshop
/src/main/java/DiamonShops/UserService/IProductService.java
UTF-8
390
1.890625
2
[]
no_license
package DiamonShops.UserService; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import DiamonShops.Dto.ProductsDto; @Service public interface IProductService { @Autowired public ProductsDto GetDataProductById(String id); @Autowired public List<ProductsDto> GetDataProductByIdCategory(int id); }
true
26307b188078956c68b83c9a6ee910ed9c882eee
Java
silas97/TCC
/src/test/java/br/edu/fafic/dao/UsuarioDAOTest.java
UTF-8
2,530
2.421875
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.dao; import br.edu.fafic.model.Usuario; import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Silas */ public class UsuarioDAOTest { public UsuarioDAOTest() { } @Ignore @Test public void testInsert() { System.out.println("insert"); Usuario usuario = new Usuario(); UsuarioDAO dao = new UsuarioDAO(); usuario.setBairro("bairro"); usuario.setCep("cep"); usuario.setCidade("cidade"); usuario.setCpf("cpf"); usuario.setEndereco("endereco"); usuario.setEstado("estado"); usuario.setNome("nome"); usuario.setPerfil("perfil"); boolean expResult = true; boolean result = dao.insert(usuario); assertEquals(result, expResult); } @Ignore @Test public void testUpdate() { System.out.println("update"); Usuario usuario = new Usuario(); UsuarioDAO dao = new UsuarioDAO(); Long id = Long.parseLong("24"); usuario.setIdUsuario(id); usuario.setBairro("teste"); usuario.setCep("teste"); usuario.setCidade("teste"); usuario.setCpf("teste"); usuario.setEndereco("teste"); usuario.setEstado("teste"); usuario.setNome("teste"); usuario.setPerfil("teste"); boolean expResult = true; boolean result = dao.update(usuario); assertEquals(result, expResult); } @Ignore @Test public void testDelete() { Usuario usuario = new Usuario(); UsuarioDAO dao = new UsuarioDAO(); Long id = Long.parseLong("23"); usuario.setIdUsuario(id); boolean expResult = true; boolean result = dao.delete(usuario); assertEquals(expResult, result); } @Ignore @Test public void testSelect() { Usuario usuario = new Usuario(); UsuarioDAO dao = new UsuarioDAO(); Long id = Long.parseLong("25"); usuario.setIdUsuario(id); boolean expResult = true; Usuario result = dao.selectID(usuario); boolean resultado; if (result.getIdUsuario() == 25) { resultado = true; } else { resultado = false; } assertEquals(expResult, resultado); } }
true
43c3fdd90dd66cf008276687eb423c363f86c2dd
Java
790396054/MyApp
/designsamaple/src/main/java/com/github/gmm/designsamaple/fragment/ThirdFragment.java
UTF-8
1,772
2.046875
2
[ "Apache-2.0" ]
permissive
package com.github.gmm.designsamaple.fragment; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.github.gmm.designsamaple.R; import com.github.gmm.designsamaple.activity.MainActivity; import com.github.gmm.designsamaple.base.BaseFragment; /** * * @author gmm * @date 2018/6/30 20 * @email miaomiaogong@92gmail.com */ public class ThirdFragment extends BaseFragment { private Toolbar mToolbar; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // Inflate the layout for this fragment return LayoutInflater.from(mActivity).inflate(R.layout.fragment_third, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mToolbar = view.findViewById(R.id.toolbar); mToolbar.setTitle("弓苗苗"); ((MainActivity) getActivity()).initDrawer(mToolbar); view.findViewById(R.id.weixin).setOnClickListener(v-> toWebView("http://weixin.sogou.com/weixin?type=1&query=吴小龙同学")); view.findViewById(R.id.blog).setOnClickListener(v -> toWebView("http://wuxiaolong.me/")); view.findViewById(R.id.github).setOnClickListener(v -> toWebView("https://github.com/WuXiaolong/")); } private void toWebView(String url) { Uri uri = Uri.parse(url); startActivity(new Intent(Intent.ACTION_VIEW, uri)); } }
true
6d8b7152c0c75365f33b8b409d01593ebe576496
Java
doquockhanh/C0220H1-DoQuocKhanh
/Module2/#19SpringDataRepository/BaiTap/My_BlogWeb/src/main/java/com/codegym/services/CategoryService.java
UTF-8
613
2.078125
2
[]
no_license
package com.codegym.services; import com.codegym.models.Category; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; import java.util.Optional; public interface CategoryService { void createCategory(Category category); Page<Category> getAllCategoryPaging(Pageable pageable); void deleteCategory(Integer id); Optional<Category> getCategoryById(Integer id); void saveCategory(Category category); Page<Category> getAllCategoryPagingByKeyWord(String keyWord, Pageable pageable); List<Category> getAllCategory(); }
true
bc4620ac206349b2caa7dd30d574c0155930f0d4
Java
Slimsulex/GitDemo2
/src/test/java/qaclickacademy/AppiumTest.java
UTF-8
261
2.078125
2
[]
no_license
package qaclickacademy; import org.testng.annotations.Test; public class AppiumTest { @Test public void MobileUI() { System.out.println("I am Mobile UI"); } @Test public void MobileBrowser() { System.out.println("I am Mobile Browser"); } }
true
ccb470579bd5aa30220c53f94094727c3504e03d
Java
tpoljak/Lemmagen4J
/src/main/java/si/zitnik/research/lemmagen/impl/LemmatizerSettings.java
UTF-8
1,968
2.5625
3
[]
no_license
package si.zitnik.research.lemmagen.impl; import java.io.Serializable; public class LemmatizerSettings implements Serializable { private static final long serialVersionUID = -1773211074438614276L; public LemmatizerSettings() { } public LemmatizerSettings( Boolean bUseFromInRules, MsdConsideration eMsdConsider, int iMaxRulesPerNode, Boolean bBuildFrontLemmatizer) { super(); this.bUseFromInRules = bUseFromInRules; this.eMsdConsider = eMsdConsider; this.iMaxRulesPerNode = iMaxRulesPerNode; this.bBuildFrontLemmatizer = bBuildFrontLemmatizer; } /// <summary> /// True if from string should be included in rule identifier ([from]->[to]). False if just length of from string is used ([#len]->[to]). /// </summary> public Boolean bUseFromInRules = true; /// <summary> /// Specification how algorithm considers msd tags. /// </summary> public MsdConsideration eMsdConsider = MsdConsideration.Distinct; /// <summary> /// How many of the best rules are kept in memory for each node. Zero means unlimited. /// </summary> public int iMaxRulesPerNode = 0; /// <summary> /// If true, than build proccess uses few more hevristics to build first left to right lemmatizer (lemmatizes front of the word) /// </summary> public Boolean bBuildFrontLemmatizer = false; public LemmatizerSettings CloneDeep() { return new LemmatizerSettings( this.bUseFromInRules, this.eMsdConsider, this.iMaxRulesPerNode, this.bBuildFrontLemmatizer ); } public String toString() { return String.format("%s\t%s\t%d\t%s", this.bUseFromInRules.toString(), this.eMsdConsider.toString(), this.iMaxRulesPerNode, this.bBuildFrontLemmatizer.toString()); } }
true
6ab818e6f471033e5761421e5a4a8096f7425967
Java
panzeradj/tpv_uned
/src/Clientes.java
UTF-8
1,378
2.65625
3
[]
no_license
import java.io.Serializable; public class Clientes implements Serializable { private String nombre; private String apellidos; private int id; private String nif; private String razonSocial; private String domicilio; private String fechaAlta; public boolean estado; Clientes( int id, String nif, String nombre, String apellidos, String razonSocial , String domicilio, String fechaAlta) { this.id=id; this.nif=nif; this.nombre=nombre; this.apellidos=apellidos; this.razonSocial=razonSocial; this.domicilio=domicilio; this.fechaAlta=""; estado=true; } //getter public String getNombre() { return nombre; } public String getApellido() { return apellidos; } public String getNif() { return nif; } public String getRazonSocial() { return razonSocial; } public String getDomicilio() { return domicilio; } public boolean getEstado() { return estado; } public int getId() { return id; } //setter public void setNombre( String variable) { nombre=variable; } public void setApellido( String variable) { apellidos=variable; } public void setNif( String variable) { nif=variable; } public void setRazonSocial( String variable) { razonSocial=variable; } public void setDomicilio( String variable) { domicilio=variable; } public void setEstado(boolean variable) { estado=variable; } }
true
4846182f4452b0818c065e30545ec432b8820404
Java
trueivorian/Warehouse-Shared
/Skeletons/src/Job.java
UTF-8
440
2.96875
3
[]
no_license
import java.util.ArrayList; import java.util.Map.Entry; public class Job{ private Integer jobID; /** * Stores all the items that pertain to each job. */ ArrayList<Entry<Character, Integer>> itemList = new ArrayList<Entry<Character, Integer>>(); public Job(Integer jobID, ArrayList<Entry<Character, Integer>> itemList) { this.jobID = jobID; this.itemList = itemList; } public Integer getJobID() { return jobID; } }
true
2b674e3eba3ab8ef7d2c50a4680c983585b67aab
Java
saumil11/SouqAmrika
/src/com/codelab/souqamrika/service/PortalService.java
UTF-8
372
1.570313
2
[]
no_license
package com.codelab.souqamrika.service; import com.codelab.souqamrika.dto.PortalCustomDTO; import com.codelab.souqamrika.entity.ContactDtl; public interface PortalService { boolean saveCustomerReg(PortalCustomDTO portal) throws Exception; boolean saveContactDtl(ContactDtl contactDtl) throws Exception; void updatePaymentStatus(Long orderId) throws Exception; }
true
5420df1f3716e81b57e867cbc887ff01209d03cd
Java
emanoelmlsilva/ProgramasJava
/ExerPOO/ListaRevisao/Questao1/Main.java
UTF-8
301
2.546875
3
[]
no_license
public class Main{ public static void main(String[]args){ Scanner input = new Scanner(System.in); Retangulo r1 = new Retangulo(4,6); Retangulo r2 = new Retangulo(4,2); System.out.println(r1.toString()); System.out.println(r2.toString()); } }
true
7289a2e333a11a1af588c3d52ccb98e358096532
Java
kothead/ggj15
/core/src/com/ggj15/model/InkIndicator.java
UTF-8
2,685
2.421875
2
[]
no_license
package com.ggj15.model; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.scenes.scene2d.Actor; import com.ggj15.data.ImageCache; /** * Created by kettricken on 24.01.2015. */ public class InkIndicator extends Actor { private Sprite bottomSprite; private Sprite topSprite; private float inkLevel = 0; ShapeRenderer renderer = new ShapeRenderer(); public InkIndicator() { bottomSprite = new Sprite(ImageCache.getTexture("ink-index-mask")); topSprite = new Sprite(ImageCache.getTexture("ink-index")); this.setWidth(bottomSprite.getWidth()); this.setHeight(bottomSprite.getHeight()); this.setBounds(0, 0, this.getWidth(), this.getHeight()); } @Override public void act(float delta) { super.act(delta); bottomSprite.setPosition(this.getX(), this.getY()); bottomSprite.setOrigin(this.getOriginX(), this.getOriginY()); bottomSprite.setRotation(this.getRotation()); bottomSprite.setScale(this.getScaleX(), this.getScaleY()); } @Override public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); bottomSprite.draw(batch); drawTopSprite(batch); } private void drawTopSprite(Batch batch) { batch.end(); Gdx.gl.glClearDepthf(1f); Gdx.gl.glClear(GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glDepthFunc(GL20.GL_LESS); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(true); Gdx.gl.glColorMask(false, false, false, true); renderer.setProjectionMatrix(getStage().getCamera().combined); renderer.begin(ShapeRenderer.ShapeType.Filled); renderer.setColor(1, 1, 1, 1); float width = bottomSprite.getX() + bottomSprite.getWidth() - inkLevel; renderer.rect(width, bottomSprite.getY(), inkLevel, bottomSprite.getHeight()); renderer.end(); batch.flush(); batch.begin(); Gdx.gl.glColorMask(true, true, true, true); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(GL20.GL_EQUAL); batch.draw(topSprite, bottomSprite.getX(), bottomSprite.getY()); batch.flush(); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(false); } public void setInkLevel(float inkLevel) { this.inkLevel = bottomSprite.getWidth() * (inkLevel / 100); } }
true
9b5d8acefb4095f938f389f8dfb1dbb07f6cf8e5
Java
Aleks-Ya/yaal_examples
/Java+/Spring+/Spring3+/AnnotationConfig+/ParentContext/src/scan2/House.java
UTF-8
317
2.25
2
[]
no_license
package scan2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import scan1.Address; @Component public class House { @Autowired private Address address; @Override public String toString() { return "Дом " + address; } }
true
81a0002f8b52addd6b7cbd394d00c2fe047eaeba
Java
dukhniav/oo
/AnatomyOfAClass/InternalCustomer.java
UTF-8
1,595
3.484375
3
[]
no_license
package cs345.orders; /* This class represents an internal customer. That is, a customer * within the same organization. Internal customers don't have * Names and Address but something that is derived from the * other information about internal customers. * * Note that the class says that it implements Customer. That * means that instances of this class can be used where a * Customer is asked for. Because this class implements * Customer, it is required to implement all the methods in * the Customer interface. */ public class InternalCustomer implements Customer { private String org; private String authorizedBy; /* Constructor for internal Customers. */ public InternalCustomer(String org, String authorizedBy) { this.org = org; this.authorizedBy = authorizedBy; } /* Below are the three methods that implement the methods * required by the Customer interface. * * Note that these are all annotated with @Override. This * is in an indication to the compiler that these methods * override methods that are inherited from a superclass or * interface. If any of these methods is not, in fact, * overriding, the compiler will produce an error message. */ @Override public String getName() { return org + " Authorized by: " + authorizedBy; } @Override public String getAddress() { return "<<Internal" + org+ ">>"; } @Override public Money getCreditLimit() { return Currency.USD.zero(); } }
true
96b438cd26d7982be81317fb38dc182640942877
Java
kojoYeboah53i/expo
/android/versioned-abis/expoview-abi37_0_0/src/main/java/abi37_0_0/expo/modules/facedetector/FaceDetectorUtils.java
UTF-8
5,257
2.3125
2
[ "MIT", "BSD-3-Clause", "Apache-2.0" ]
permissive
package abi37_0_0.expo.modules.facedetector; import android.graphics.Rect; import android.os.Bundle; import com.google.android.gms.vision.face.Landmark; import com.google.firebase.ml.vision.common.FirebaseVisionPoint; import com.google.firebase.ml.vision.face.FirebaseVisionFace; import com.google.firebase.ml.vision.face.FirebaseVisionFaceLandmark; public class FaceDetectorUtils { // All the landmarks reported by Google Mobile Vision in constants' order. // https://developers.google.com/android/reference/com/google/android/gms/vision/face/Landmark private enum LandmarkId { BOTTOM_MOUTH(Landmark.BOTTOM_MOUTH, "bottomMouthPosition"), LEFT_CHEEK(Landmark.LEFT_CHEEK, "leftCheekPosition"), LEFT_EAR(Landmark.LEFT_EAR, "leftEarPosition"), LEFT_EAR_TIP(Landmark.LEFT_EAR_TIP, "leftEarTipPosition"), LEFT_EYE(Landmark.LEFT_EYE, "leftEyePosition"), LEFT_MOUTH(Landmark.LEFT_MOUTH, "leftMouthPosition"), NOSE_BASE(Landmark.NOSE_BASE, "noseBasePosition"), RIGHT_CHEEK(Landmark.RIGHT_CHEEK, "rightCheekPosition"), RIGHT_EAR(Landmark.RIGHT_EAR, "rightEarPosition"), RIGHT_EAR_TIP(Landmark.RIGHT_EAR_TIP, "rightEarTipPosition"), RIGHT_EYE(Landmark.RIGHT_EYE, "rightEyePosition"), RIGHT_MOUTH(Landmark.RIGHT_MOUTH, "rightMouthPosition"); private int id; private String name; LandmarkId(int id, String name) { this.id = id; this.name = name; } } public static Bundle serializeFace(FirebaseVisionFace face) { return serializeFace(face, 1, 1); } public static Bundle serializeFace(FirebaseVisionFace face, double scaleX, double scaleY) { Bundle encodedFace = new Bundle(); encodedFace.putInt("faceID", face.getTrackingId()); encodedFace.putDouble("rollAngle", face.getHeadEulerAngleZ()); encodedFace.putDouble("yawAngle", face.getHeadEulerAngleY()); if (face.getSmilingProbability() >= 0) { encodedFace.putDouble("smilingProbability", face.getSmilingProbability()); } if (face.getLeftEyeOpenProbability() >= 0) { encodedFace.putDouble("leftEyeOpenProbability", face.getLeftEyeOpenProbability()); } if (face.getRightEyeOpenProbability() >= 0) { encodedFace.putDouble("rightEyeOpenProbability", face.getRightEyeOpenProbability()); } for (LandmarkId id : LandmarkId.values()) { FirebaseVisionFaceLandmark faceLandmark = face.getLandmark(id.id); if (faceLandmark != null) { encodedFace.putBundle(id.name, mapFromPoint(faceLandmark.getPosition(), scaleX, scaleY)); } } Rect box = face.getBoundingBox(); Bundle origin = new Bundle(2); origin.putDouble("x", box.left * scaleX); origin.putDouble("y", box.top * scaleY); Bundle size = new Bundle(2); size.putDouble("width", (box.right - box.left) * scaleX); size.putDouble("height", (box.bottom - box.top) * scaleY); Bundle bounds = new Bundle(2); bounds.putBundle("origin", origin); bounds.putBundle("size", size); encodedFace.putBundle("bounds", bounds); return mirrorRollAngle(encodedFace); } public static Bundle rotateFaceX(Bundle face, int sourceWidth, double scaleX) { Bundle faceBounds = face.getBundle("bounds"); Bundle oldOrigin = faceBounds.getBundle("origin"); Bundle mirroredOrigin = positionMirroredHorizontally(oldOrigin, sourceWidth, scaleX); double translateX = -faceBounds.getBundle("size").getDouble("width"); Bundle translatedMirroredOrigin = positionTranslatedHorizontally(mirroredOrigin, translateX); Bundle newBounds = new Bundle(faceBounds); newBounds.putBundle("origin", translatedMirroredOrigin); for (LandmarkId id : LandmarkId.values()) { Bundle landmark = face.getBundle(id.name); if (landmark != null) { Bundle mirroredPosition = positionMirroredHorizontally(landmark, sourceWidth, scaleX); face.putBundle(id.name, mirroredPosition); } } face.putBundle("bounds", newBounds); return mirrorYawAngle(mirrorRollAngle(face)); } public static Bundle mirrorRollAngle(Bundle face) { face.putDouble("rollAngle", (-face.getDouble("rollAngle") + 360) % 360); return face; } public static Bundle mirrorYawAngle(Bundle face) { face.putDouble("yawAngle", (-face.getDouble("yawAngle") + 360) % 360); return face; } public static Bundle mapFromPoint(FirebaseVisionPoint point, double scaleX, double scaleY) { Bundle map = new Bundle(); map.putDouble("x", point.getX() * scaleX); map.putDouble("y", point.getY() * scaleY); return map; } public static Bundle positionTranslatedHorizontally(Bundle position, double translateX) { Bundle newPosition = new Bundle(position); newPosition.putDouble("x", position.getDouble("x") + translateX); return newPosition; } public static Bundle positionMirroredHorizontally(Bundle position, int containerWidth, double scaleX) { Bundle newPosition = new Bundle(position); newPosition.putDouble("x", valueMirroredHorizontally(position.getDouble("x"), containerWidth, scaleX)); return newPosition; } public static double valueMirroredHorizontally(double elementX, int containerWidth, double scaleX) { return -elementX + (containerWidth * scaleX); } }
true
e2bc222befe9a1e017c3e2195ca2883f089a67e4
Java
zsabin/PersistentB-Tree
/src/CacheManager.java
UTF-8
6,594
3.15625
3
[]
no_license
import java.util.*; /** * A Cache Manager class */ public class CacheManager { private int size; private List<CacheElement> cache; private FLRAF file; private Stack<Integer> unallocatedBlocks; private int allocatedBlockIndex; private class CacheElement { public boolean modified; public int blockNumber; public byte[] block; public CacheElement(int blockNumber, byte[] block, boolean modified) { this.blockNumber = blockNumber; this.block = block; this.modified = modified; } } /** * Creates a Cache Manager based on the specified properties * * @param size the number of blocks in the cache * @param file the FLRAF to be read from and written to */ public CacheManager(int size, FLRAF file) throws Exception { this(size, file, new Stack<Integer>()); } /** * Creates a Cache Manager based on the specified properties. * * @param size the number of blocks in the cache * @param file the FLRAF to be read from and written to * @param unallocatedBlocks a stack of unallocatedBlocks */ public CacheManager(int size, FLRAF file, Stack<Integer> unallocatedBlocks) throws Exception { this.size = size; this.cache = new ArrayList<CacheElement>(); this.file = file; this.unallocatedBlocks = unallocatedBlocks; this.allocatedBlockIndex = (int)(file.length() / file.getBlockSize()) - 1; } /** * Returns the FLRAF associated with this Cache Manager * * @return the FLRAF associated with this Cache Manager */ public FLRAF getFile() { return file; } /** * Reads the bytes from the cache that correspond to the specified block index. * If the corresponding block index is not found in the cache then reads the bytes * from that block in the FLRAF, adds them as a cache element to the cache and returns them. * If the cache is full of 'modified' elements then flushes the cache and then replaces the * last written cache element with this new one. * * @param blockIndex the index of the block in the FLRAF to be read from * @return the bytes in the specified block as an array */ public byte[] read(int blockIndex) throws Exception { int targetCacheIndex = getCacheIndex(blockIndex); if (targetCacheIndex < 0) { byte block[] = new byte[file.getBlockSize()]; file.read(blockIndex, block); writeNewElementToCache(blockIndex, block, false); return block; } return cache.get(targetCacheIndex).block; } /** * Writes the bytes to the cache at the block with the specified block index. * If the specified block exists in the cache then it overrides the contents of that block. * If the specified block does not exist in the cache then adds the block to the cache. * Marks each written block as 'modified.' Flushes the cache (writes each 'modified' bloc to the * FLRAF) when the cache is full of modified blocks. Otherwise, if the cache is full but contains * unmodified blocks then overwrites an unmodified element in the cache. * * @param blockIndex the index of the block in the FLRAF to be written to * @param block an array of bytes to be written to the FLRAF */ public void write(int blockIndex, byte[] block) throws Exception { CacheElement element = new CacheElement(blockIndex, block, true); int targetCacheIndex = getCacheIndex(blockIndex); if (targetCacheIndex < 0) { writeNewElementToCache(element); } else { cache.set(targetCacheIndex, element); } } private void writeNewElementToCache(CacheElement element) throws Exception { if(cacheIsFull()) { int targetIndex = getLastUnmodifiedIndex(); //Remove the last unmodified element, push everything down the cache, and add the new element to the top if (targetIndex >= 0) { for (int i = targetIndex; i > 0; i--) { cache.set(i, cache.get(i - 1)); } cache.set(0, element); } //flush the cache, push everything down the cache, and add the new element to the top else { flush(); cache.remove(cache.size() - 1); cache.add(0, element); } } //Add the new element to the top of the cache else { cache.add(0, element); } } private void writeNewElementToCache(int blockIndex, byte[] block, boolean modified) throws Exception { writeNewElementToCache(new CacheElement(blockIndex, block, modified)); } //returns the index where the specified block is found in the cache or -1 if it is not found private int getCacheIndex(int blockIndex) { for (int i = 0; i < cache.size(); i++) { if (cache.get(i) != null && cache.get(i).blockNumber == blockIndex) { return i; } } return -1; } //returns the last index in the cache that is unmodified or -1 if one is not found private int getLastUnmodifiedIndex() { for (int i = cache.size() - 1; i >= 0 ; i--) { if (cache.get(i) != null && !cache.get(i).modified) { return i; } } return -1; } /** * Returns the next unallocated block number, either from the list of unallocated * block numbers, or the next block in the file. * * @return the next unallocated block number */ public int getUnallocatedBlockNumber() throws Exception { //Return a block from the list of deallocated blocks if one exists if (!unallocatedBlocks.empty()) { return unallocatedBlocks.pop(); } //Else returns the next largest allocated block number that has never been allocated else { allocatedBlockIndex++; return allocatedBlockIndex; } } /** * Returns the stack of unallocated block numbers * * @return the stack of unallocated block numbers */ public Stack<Integer> getUnallocatedBlockNumbers() { return unallocatedBlocks; } /** * Adds the specified block number to the stack of unallocated block numbers * * @param blockNumber the block number to be added to the stack of unallocated block numbers */ public void deallocateBlock(int blockNumber) { int index = getCacheIndex(blockNumber); if (index >= 0 ) { cache.get(index).modified = false; } unallocatedBlocks.push(blockNumber); } /** * Flushes the cache. Writes any modified blocks to the FLRAF and marks these as 'unmodified' */ public void flush() throws Exception { for(CacheElement element : cache) { if (element.modified) { file.write(element.blockNumber, element.block); element.modified = false; } } } /** * Returns whether the cache is full; * * @return whether the cache is full */ public boolean cacheIsFull() { return cache.size() == size; } /** * Flushes the cache and closes the FLRAF. */ public void close() throws Exception { flush(); file.close(); } }
true
28d5ee0a59d514cd7c716def977a22eeab8593c6
Java
kossovec/Kickstarter
/src/test/java/ua/goit/service/LoginInServiceTest.java
UTF-8
1,121
2.3125
2
[]
no_license
package ua.goit.service; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import ua.goit.dao.UserDao; import ua.goit.model.User; import java.sql.Timestamp; import java.util.Date; public class LoginInServiceTest { @Before public void initMocks() { MockitoAnnotations.initMocks(this); } @Mock private UserDao userDao; @Test public void userWithRightPassword_GetUserFromDBAndCheck_LoginOk() { String login = "login"; String password = "password"; User user = new User(1, "user", login, password, 0, new Timestamp(new Date().getTime())); Mockito.when(userDao.getByLogin(login)).thenReturn(user); UserService userService = new UserServiceImpl(userDao); LoginInService loginInService = new LoginInServiceImpl(userService); User userFromLoginService = loginInService.getUser(login); boolean isRightPass = loginInService.checkPassword(userFromLoginService, password); Assert.assertTrue(isRightPass); Mockito.verify(userDao).getByLogin(login); } }
true
ae6434819119d21210e8fb0e2e7710e9d07d8421
Java
hzhangse/springBasic
/src/main/java/com/train/beanload/order/factory/TestFactoryBean.java
UTF-8
2,526
2.34375
2
[]
no_license
/** * TestFactoryBean.java * * Created on Aug 25, 2011, 4:17:28 PM * Copyright (c) 2001-2008 by G2X, Inc. All Rights Reserved. */ package com.train.beanload.order.factory; import java.util.Iterator; import java.util.Map; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import com.train.beanload.order.bean.TestPropertyBean; /** * This class * * @author Carro.Zhu * @version $Revision$, $Date$, $Author$, $Name$ */ public class TestFactoryBean extends AbstractFactoryBean implements ApplicationContextAware { private ApplicationContext ctxt; private String className; public TestFactoryBean() { System.out.println("TestFactoryBean constructor ..."); } /** * @param className the className to set */ public void setClassName(String className) { this.className = className; } public void setApplicationContext(ApplicationContext ctxt) throws BeansException { System.out.println("--------------------------------------------"); System.out.println("TestFactoryBean.setApplicationContext ..."); System.out.println("--------------------------------------------"); this.ctxt = ctxt; } @Override protected Object createInstance() throws Exception { System.out.println("--------------------------------------------"); System.out.println("TestFactoryBean.createInstance ..."); if (ctxt != null) { Map result = BeanFactoryUtils.beansOfTypeIncludingAncestors(ctxt, Class.forName(className)); Iterator namesIter = result.keySet().iterator(); System.out.println("TestPropertyBean Beans"); while (namesIter.hasNext()) { String name = (String) namesIter.next(); System.out.println("beanName = " + name + ", bean = " + result.get(name)); } System.out.println("--------------------------------------------"); namesIter = result.keySet().iterator(); if (namesIter.hasNext()) { return result.get(namesIter.next()); } } return null; } @Override public Class getObjectType() { System.out.println("--------------------------------------------"); System.out.println("TestFactoryBean.getObjectType ..."); System.out.println("--------------------------------------------"); return TestPropertyBean.class; } }
true
81187a72884665419c1585e4e4300128c85f6b3a
Java
JaineSaconi/Oficina1-Agendamentos
/src/main/java/com/uniagenda/agenda/repository/AgendaAlunoRepository.java
UTF-8
379
1.859375
2
[]
no_license
package com.uniagenda.agenda.repository; import com.uniagenda.agenda.domain.AgendaAluno; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data repository for the AgendaAluno entity. */ @SuppressWarnings("unused") @Repository public interface AgendaAlunoRepository extends JpaRepository<AgendaAluno, Long> { }
true