blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aeff6d772bd1fc2e812a5c33bf8d134fe7d9816d | 2d7181a3c0f2d1191dffd355fd826aa829e5fd39 | /src/test/java/cn/spsilab/locatethings/ExampleUnitTest.java | 03712c0f043794ec1eedd546f79b1bdb3b854657 | [] | no_license | spsi308/LocateThings | 74f8fb0599acfbef0a525879fcebaeec7f288584 | ce3bf8922ebbdb9f73277ffa0130f93d663791a4 | refs/heads/master | 2021-01-19T11:57:58.093046 | 2017-03-07T02:48:13 | 2017-03-07T02:48:13 | 82,274,154 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package cn.spsilab.locatethings;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"feng_sh@outlook.com"
] | feng_sh@outlook.com |
86ea0359ce677210bff35e375f9f31545a86ffe7 | 5d4cc5c19edcd3d92c14074be439897b14c3d563 | /model/src/main/java/tarce/model/FindProductByConditionResponse.java | 71e98385009745053e26d535ac9f18fbdc46df7f | [] | no_license | zouwansheng/MyOdoo | 752325a6f60a936c9ed42fdadfe5fa6c92cafe0a | df18ec69164020fac6604b68022b9122aa5c206f | refs/heads/master | 2021-01-22T07:42:36.469579 | 2017-05-27T05:21:52 | 2017-05-27T05:21:52 | 92,573,104 | 1 | 0 | null | 2017-05-27T05:25:02 | 2017-05-27T05:25:02 | null | UTF-8 | Java | false | false | 5,957 | java | package tarce.model;
import java.io.Serializable;
import java.text.DecimalFormat;
/**
* Created by Daniel.Xu on 2017/2/8.
*/
public class FindProductByConditionResponse {
/**
* jsonrpc : 2.0
* id : null
* result : {"res_data":{"product":{"area":{"id":false,"name":false},"image_medium":"http://192.168.2.111:8069/linkloving_app_api/get_product_image?product_id=48204","id":46537,"product_name":" HS310-成品(星夜·追梦人)-RT-CN"},"theoretical_qty":-387,"product_qty":0},"res_msg":"","res_code":1}
*/
private String jsonrpc;
private Object id;
private ResultBean result;
public String getJsonrpc() {
return jsonrpc;
}
public void setJsonrpc(String jsonrpc) {
this.jsonrpc = jsonrpc;
}
public Object getId() {
return id;
}
public void setId(Object id) {
this.id = id;
}
public ResultBean getResult() {
return result;
}
public void setResult(ResultBean result) {
this.result = result;
}
public static class ResultBean {
/**
* res_data : {"product":{"area":{"id":false,"name":false},"image_medium":"http://192.168.2.111:8069/linkloving_app_api/get_product_image?product_id=48204","id":46537,"product_name":" HS310-成品(星夜·追梦人)-RT-CN"},"theoretical_qty":-387,"product_qty":0}
* res_msg :
* res_code : 1
*/
private ResDataBean res_data;
private String res_msg;
private int res_code;
public ResDataBean getRes_data() {
return res_data;
}
public void setRes_data(ResDataBean res_data) {
this.res_data = res_data;
}
public String getRes_msg() {
return res_msg;
}
public void setRes_msg(String res_msg) {
this.res_msg = res_msg;
}
public int getRes_code() {
return res_code;
}
public void setRes_code(int res_code) {
this.res_code = res_code;
}
public static class ResDataBean implements Serializable{
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
/**
* product : {"area":{"id":false,"name":false},"image_medium":"http://192.168.2.111:8069/linkloving_app_api/get_product_image?product_id=48204","id":46537,"product_name":" HS310-成品(星夜·追梦人)-RT-CN"}
* theoretical_qty : -387
* product_qty : 0
*/
private String error ;
private ProductBean product;
private int theoretical_qty;
private int product_qty;
public ProductBean getProduct() {
return product;
}
public void setProduct(ProductBean product) {
this.product = product;
}
public int getTheoretical_qty() {
return theoretical_qty;
}
public void setTheoretical_qty(int theoretical_qty) {
this.theoretical_qty = theoretical_qty;
}
public int getProduct_qty() {
return product_qty;
}
public void setProduct_qty(int product_qty) {
this.product_qty = product_qty;
}
public static class ProductBean {
/**
* area : {"id":false,"name":false}
* image_medium : http://192.168.2.111:8069/linkloving_app_api/get_product_image?product_id=48204
* id : 46537
* product_name : HS310-成品(星夜·追梦人)-RT-CN
*/
private AreaBean area;
private String image_medium;
private int id;
private String product_name;
public AreaBean getArea() {
return area;
}
public void setArea(AreaBean area) {
this.area = area;
}
public String getImage_medium() {
return image_medium;
}
public void setImage_medium(String image_medium) {
this.image_medium = image_medium;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getProduct_name() {
return product_name;
}
public void setProduct_name(String product_name) {
this.product_name = product_name;
}
public static class AreaBean {
/**
* id : false
* name : false
*/
private Object id;
private Object name;
public Object getId() {
if (id instanceof Boolean){
id = 0 ;
}if (id instanceof Double){
id = Integer.parseInt(new DecimalFormat("0").format(id));
}
return id;
}
public void setId(int id) {
this.id = id;
}
public Object getName() {
if (name instanceof Boolean){
name = "";
}
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
}
}
}
| [
"997399759@qq.com"
] | 997399759@qq.com |
91ca3c70033331ddf018f21e1ec467a7d131cfbc | e895898ba0b622ae8a01d82d444c5c5827cd7861 | /src/main/java/org/prettycat/dataflow/asm/XMLProtocol.java | 4d1929cccde0830b0bd23912ab8e0873e6ca929a | [] | no_license | lschuetze/asm-dataflow | 4142885268bb3b37258d288e59518ba75be870f1 | dfdcd8dbc77ac981827139fdc05ca16c8d88dba0 | refs/heads/master | 2021-01-21T10:19:41.094799 | 2017-08-31T12:05:53 | 2017-08-31T12:05:53 | 101,978,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,618 | java | package org.prettycat.dataflow.asm;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class XMLProtocol {
public static final String NAMESPACE = "https://xmlns.zombofant.net/prettycat/1.0/asm";
public static Element createASMElement(
Document doc)
{
Element result = doc.createElementNS(NAMESPACE, "asm");
return result;
}
public static Element createMethodElement(
Document doc,
String fqmn)
{
Element result = doc.createElementNS(NAMESPACE, "method");
result.setAttribute("id", fqmn);
return result;
}
public static Element createParametersElement(
Document doc)
{
Element result = doc.createElementNS(NAMESPACE, "parameters");
return result;
}
public static Element createParameterElement(
Document doc,
String uid,
String fqtn)
{
Element result = doc.createElementNS(NAMESPACE, "parameter");
result.setAttribute("id", uid);
result.setAttribute("type", fqtn);
return result;
}
public static Element createInstructionsElement(
Document doc)
{
Element result = doc.createElementNS(NAMESPACE, "insns");
return result;
}
public static Element createInstructionElement(
Document doc,
int opcode,
int lineNumber,
String uid)
{
Element result = doc.createElementNS(NAMESPACE, "insn");
result.setAttribute("opcode", ""+opcode);
result.setAttribute("line", ""+lineNumber);
result.setAttribute("id", uid);
return result;
}
public static Element createExitsElement(
Document doc)
{
Element result = doc.createElementNS(NAMESPACE, "exits");
return result;
}
public static Element createExitElement(
Document doc,
String uid,
boolean exceptional)
{
Element result = doc.createElementNS(NAMESPACE, "exit");
result.setAttribute("to", uid);
result.setAttribute("exceptional", ""+exceptional);
return result;
}
public static Element createInputsElement(
Document doc)
{
Element result = doc.createElementNS(NAMESPACE, "inputs");
return result;
}
public static Element createInputElement(
Document doc)
{
Element result = doc.createElementNS(NAMESPACE, "input");
return result;
}
public static Element createValueOfElement(Document doc, String uid) {
Element result = doc.createElementNS(NAMESPACE, "value-of");
result.setAttribute("from", uid);
return result;
}
public static Element createUnknownElement(Document doc) {
Element result = doc.createElementNS(NAMESPACE, "unknown");
return result;
}
public static Element createMergeElement(Document doc) {
Element result = doc.createElementNS(NAMESPACE, "merge");
return result;
}
}
| [
"jonas@wielicki.name"
] | jonas@wielicki.name |
f9c888b185de3e5a5f37d76bd8b6ad88e7684e77 | e1256cf6e84d0abdffffb0846ba5fb8020ebb7b6 | /src/edu/cmu/weikunl/mochifitness/MainFragment.java | 93971427a99f0f227a43c637da39893d5a130360 | [] | no_license | weikunliang/MochiFitness | 3fb9aecf0090cfad9eb107cf99f4ef0ad17b4f39 | f3457feb34d2cd570977a25de3311c8a2bf2b411 | refs/heads/master | 2021-01-23T07:26:07.498015 | 2015-02-07T08:08:17 | 2015-02-07T08:08:17 | 30,441,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,747 | java | package edu.cmu.weikunl.mochifitness;
import java.util.Arrays;
import com.facebook.Session;
import com.facebook.SessionState;
import com.facebook.UiLifecycleHelper;
import com.facebook.widget.LoginButton;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class MainFragment extends Fragment {
private static final String TAG = "MainFragment";
private UiLifecycleHelper uiHelper;
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_main, container, false);
LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setFragment(this);
authButton.setReadPermissions(Arrays.asList("user_likes", "user_status"));
return view;
}
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if (state.isOpened()) {
Log.i(TAG, "Logged in...");
} else if (state.isClosed()) {
Log.i(TAG, "Logged out...");
}
}
private Session.StatusCallback callback = new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
onSessionStateChange(session, state, exception);
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
uiHelper = new UiLifecycleHelper(getActivity(), callback);
uiHelper.onCreate(savedInstanceState);
}
@Override
public void onResume() {
super.onResume();
// For scenarios where the main activity is launched and user
// session is not null, the session state change notification
// may not be triggered. Trigger it if it's open/closed.
Session session = Session.getActiveSession();
if (session != null &&
(session.isOpened() || session.isClosed()) ) {
onSessionStateChange(session, session.getState(), null);
}
uiHelper.onResume();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
uiHelper.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onPause() {
super.onPause();
uiHelper.onPause();
}
@Override
public void onDestroy() {
super.onDestroy();
uiHelper.onDestroy();
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
uiHelper.onSaveInstanceState(outState);
}
}
| [
"weikunl@andrew.cmu.edu"
] | weikunl@andrew.cmu.edu |
8397e58ab370dd1d48b0814b741acd7de266bd86 | 2aa2f5549c554f5e3c2028d72f9dcb07be910bc2 | /src/controller/ClienteController.java | 2f0fe83700503cc2683a61c478132ee087b5d855 | [] | no_license | BrunoMCarnauba/sistema_assistencia_tecnica | d79db0c6a11af9e0f82f3bdf0ee935f2ca93f3e5 | d4462091f038eb7ba9dfab8b8d0908791f68a839 | refs/heads/master | 2022-12-30T21:49:41.435851 | 2020-10-07T01:03:51 | 2020-10-07T01:03:51 | 301,885,986 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 3,218 | java | package controller;
import java.io.Serializable;
import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;
import dao.ClienteDao;
import model.ClienteBean;
import utilities.FacesUtil;
@SuppressWarnings("serial") //Para sumir com uma advertência - https://youtu.be/iHwaZU2YSbo?t=402
@ManagedBean // Diz que essa classe é um ManagedBean, responsável pela lógica da tela. No xhtml ela vai ser chamada de clienteController.
@ViewScoped // O Bean que tem ViewScoped, só irá existir em memória quando estiver manipulando a tela dele.
public class ClienteController implements Serializable {
private ClienteBean cliente = new ClienteBean();
private ClienteDao clienteDAO = new ClienteDao();
public ClienteBean getCliente() {
return cliente;
}
public void setCliente(ClienteBean cliente) {
this.cliente = cliente;
}
public ArrayList<ClienteBean> listarClientes(){
return this.clienteDAO.listarClientes();
}
public void novoCliente() {
this.cliente = new ClienteBean();
}
public void btnSalvar() { //Serve tanto para o cadastro quanto para o editar
if(this.cliente.getId() == 0) { //O id é gerado automaticamente e não setado pelo usuário, então se não existir, quer dizer que é um novo cadastro e não edição. https://stackoverflow.com/questions/13747859/how-to-check-if-an-int-is-a-null
this.cadastrarCliente();
} else {
this.editarCliente();
}
}
private boolean validarCamposCustom() {
//Outras validações
boolean validacaoAprovada = true;
if(this.cliente.getTelefone_celular().equals("") && this.cliente.getTelefone_fixo().equals("")) {
FacesUtil.adicionarMensagemErro("Você precisa preencher pelo menos um campo de telefone");
validacaoAprovada = false;
}
return validacaoAprovada;
}
public void cadastrarCliente() {
if(this.validarCamposCustom() == true) { //Se passar na validação
if(this.clienteDAO.cadastrarCliente(this.cliente) == true) {
FacesUtil.adicionarMensagemInfo("Cliente cadastrado com sucesso!");
novoCliente(); //Para limpar o objeto e consequentemente os campos do formulário com o auxilio da propriedade update do commandButton.
} else {
FacesUtil.adicionarMensagemErro("Houve um erro ao tentar cadastrar o cliente.");
}
}
}
public void btnEditar(ActionEvent evento) {
this.cliente = (ClienteBean) evento.getComponent().getAttributes().get("clienteSelecionado");
}
public void editarCliente() {
if(this.validarCamposCustom() == true) { //Se passar na validação
if(this.clienteDAO.editarCliente(this.cliente) == true) {
FacesUtil.adicionarMensagemInfo("Cliente editado com sucesso!");
} else {
FacesUtil.adicionarMensagemErro("Houve um erro ao tentar editar o cliente.");
}
}
}
public void deletarCliente(ActionEvent evento) {
this.cliente = (ClienteBean) evento.getComponent().getAttributes().get("clienteSelecionado");
if(this.clienteDAO.deletarCliente(this.cliente) == true) {
FacesUtil.adicionarMensagemInfo("Cliente deletado com sucesso!");
} else {
FacesUtil.adicionarMensagemErro("Houve um erro ao tentar deletar o cliente.");
}
}
}
| [
"brunomc.contato@gmail.com"
] | brunomc.contato@gmail.com |
7ab8f98229f320bd998239631f55ff7215e81584 | 851059c566b1f74e4378329f193e7b78f967c417 | /android/app/src/main/java/com/clock/MainApplication.java | 2035300a0143259c693781a2f907b7b52221bac4 | [] | no_license | adrianowead/react-native-clock | 971d2cffd00b39402eb6e388703a56a11031fb5d | f5adbade1ae6b53382f9bdad9ab4483772e2c759 | refs/heads/master | 2020-05-22T07:09:13.248299 | 2019-05-12T13:29:59 | 2019-05-12T13:29:59 | 186,258,595 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,041 | java | package com.clock;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"adriano_mail@hotmail.com"
] | adriano_mail@hotmail.com |
f42eb3a0abd2978124351443664c3b8f3824dd05 | 40d8b6f24e4a549dfd91552acf1a49b47eff0113 | /src/main/java/com/shieldbug1/core/api/package-info.java | c4a262bb12c913d401f97d27d9d6dc5572ec724e | [] | no_license | TheGreyGhost/S1Core | b224d97229dc049967f848e00826c5ef7201fe04 | 673a712e8784055d637d9ea861ee2cd5faf430d2 | refs/heads/master | 2020-12-03T06:32:41.704471 | 2014-12-30T11:46:59 | 2014-12-30T11:46:59 | 29,300,358 | 1 | 1 | null | 2015-01-15T14:14:24 | 2015-01-15T14:14:22 | Java | UTF-8 | Java | false | false | 2,819 | java | /**
* This package is all public 'api'. Anything here is less library based, and more based more on modding.
* This allows interfaces, methods, etc, to be stripped at runtime through use of {@code @Optional.*} annotations.
* <br></br>
* The {@link S1CoreAPI} class contains methods intended to be used by other mods, as these methods are guaranteed
* not to change on short notice.
* <br></br>
* The API contract:
* <br></br>
* <ol>
* <li>Deprecation Phases</li>
* <ol>
* <li>
* Available: This applies to most things included in this API. If something is 'available', it is the
* 'recommended' way of doing something. Something marked as 'Available' cannot be removed without going
* through the deprecation cycle.
* </li>
* <li>
* Beta: This applies to anything that is marked with a {@code @Beta} annotation. If something is marked
* as Beta, it can be changed or removed at any time. If a class file is marked as beta, both the class
* and any material contained by the class should be assumed as Beta. Material marked as 'Beta' could also
* be relatively safe to use - look for any JavaDoc to see any further information. Reasons something may
* be marked as 'Beta' include:
* <ul>
* <li>Instability</li>
* <li>Known bugs</li>
* <li>New/Developing Idea</li>
* </ul>
* </li>
* <li>
* Deprecated: This applies to anything that is marked with a {@code @Deprecated} annotation. If something
* from the available state is going to be removed, it will be marked as deprecated for the duration of:
* <ul>
* <li>Two weeks - if the feature is small, or relatively unused,</li>
* <li>The next minor version change of the API, if the feature is relatively small,
* but requires medium to large changes of code, or</li>
* <li>The next major version change of the API, if the feature is large and/or requires a large
* amount of change in code.</li>
* </ul>
* Material marked as 'Deprecated' will always also contain an alternative and an explanation for
* deprecation, as well as the deprecation date. Please note that there is another reason for the use
* of the {@code @Deprecated} annotation, which is on material that should not be accessed as it
* is there for internal purposes only.
* </li>
* </ol>
* </ol>
*/
@API(apiVersion = "1.0", owner = S1Core.MOD_ID, provides = "S1CORE|API")
package com.shieldbug1.core.api; //TODO continue API contract
import net.minecraftforge.fml.common.API;
import com.shieldbug1.core.S1Core;
| [
"gal.aharon99@gmail.com"
] | gal.aharon99@gmail.com |
4afd9730fcf58bd377ff5df4d845882dbe216a7b | f1c15ca8530a06bbb827f770cfd0fffafa5d7f2c | /app/src/main/java/com/absolute/groove/mcentral/activities/LicenseActivity.java | 2ebd952318d511a370c6b5769cb1b4dcf0ecd3a2 | [] | no_license | rohitnotes/Music_Central | 24313aa21cc43c8b1d7ebcabd635d69d30bcfef0 | 9f45cfa251b4578de134f81338712c1f59f944ff | refs/heads/master | 2022-11-08T16:27:35.075339 | 2020-07-10T05:16:40 | 2020-07-10T05:16:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,110 | java | /*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 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 General Public License for more details.
*/
package com.absolute.groove.mcentral.activities;
import android.graphics.Color;
import android.os.Bundle;
import android.view.MenuItem;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar;
import org.jetbrains.annotations.Nullable;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import com.absolute.groove.appthemehelper.ThemeStore;
import com.absolute.groove.appthemehelper.util.ATHUtil;
import com.absolute.groove.appthemehelper.util.ColorUtil;
import com.absolute.groove.appthemehelper.util.ToolbarContentTintHelper;
import com.absolute.groove.mcentral.R;
import com.absolute.groove.mcentral.activities.base.AbsBaseActivity;
/**
* Created by hemanths on 2019-09-27.
*/
public class LicenseActivity extends AbsBaseActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
setDrawUnderStatusBar();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_license);
setStatusbarColorAuto();
setNavigationbarColorAuto();
setLightNavigationBar(true);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ToolbarContentTintHelper.colorBackButton(toolbar);
toolbar.setBackgroundColor(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface));
WebView webView = findViewById(R.id.license);
try {
StringBuilder buf = new StringBuilder();
InputStream json = getAssets().open("oldindex.html");
BufferedReader in = new BufferedReader(new InputStreamReader(json, StandardCharsets.UTF_8));
String str;
while ((str = in.readLine()) != null) {
buf.append(str);
}
in.close();
// Inject color values for WebView body background and links
final boolean isDark = ATHUtil.INSTANCE.isWindowBackgroundDark(this);
final String backgroundColor = colorToCSS(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface,
Color.parseColor(isDark ? "#424242" : "#ffffff")));
final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000"));
final String changeLog = buf.toString()
.replace("{style-placeholder}",
String.format("body { background-color: %s; color: %s; }", backgroundColor, contentColor))
.replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this)))
.replace("{link-color-active}",
colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this))));
webView.loadData(changeLog, "text/html", "UTF-8");
} catch (Throwable e) {
webView.loadData("<h1>Unable to load</h1><p>" + e.getLocalizedMessage() + "</p>", "text/html", "UTF-8");
}
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
private String colorToCSS(int color) {
return String.format("rgb(%d, %d, %d)", Color.red(color), Color.green(color),
Color.blue(color)); // on API 29, WebView doesn't load with hex colors
}
}
| [
"vidit135g@gmail.com"
] | vidit135g@gmail.com |
60cfe8d547d4008d10e26a809b8e600b340a840e | 220a40330fe9682ece590e0d78ba76e5ec525be0 | /EasyClinic/src/org/xortican/controller/EditDet.java | ea6e7fdb010a87f89adf78da7000f445f3d81ed0 | [] | no_license | augustinbca/Eacyclinic | adeb88a42699ab8628504e098abb56ca9915e2de | 8391c9d9886c9c952256632a7ab26126e429e0a1 | refs/heads/master | 2020-04-30T14:22:59.175309 | 2019-03-21T07:37:53 | 2019-03-21T07:37:53 | 176,889,331 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,746 | java | package org.xortican.controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.xortican.util.JdbcCon;
/**
* Servlet implementation class EditDet
*/
@WebServlet("/EditDet")
public class EditDet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public EditDet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
String id=request.getParameter("userId");
System.out.println(id);
RequestDispatcher dispatcher = request.getRequestDispatcher("Process.jsp");
dispatcher.forward(request, response);
}
}
| [
"Augustin@DESKTOP-BDTIHEQ"
] | Augustin@DESKTOP-BDTIHEQ |
9ae4f7d78d0ddfdbeddaae0c40e9deec3a939fa0 | 417bbe4b144239de79afa0fbc57b079aff5b3d5c | /src/main/java/com/example/demo/dao/UserMapper.java | e443b10a3a7f89fdcdcfd68fa7d9f5f35b9d0902 | [] | no_license | Holly0203/Homework02 | be4b4ad4604717369b33580aeda275fa4b679345 | 3e47386cf026fbd81c338f5e4239b7c66bbe0851 | refs/heads/master | 2020-04-13T03:47:24.272951 | 2018-12-24T02:45:19 | 2018-12-24T02:45:19 | 162,942,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package com.example.demo.dao;
import com.example.demo.Model.User;
import org.springframework.stereotype.Repository;
@Repository
public interface UserMapper {
public void insertuser(String phone,String password);
public User queryuser(String phone);
}
| [
"holley125@yeah.net"
] | holley125@yeah.net |
d6828713eb071dafd99ee2e454bb34ca9ddde993 | 5be8c5c03c12e05d845c3102ff0a2948cf6638a8 | /core/camel-support/src/main/java/org/apache/camel/support/resume/ResumeActionAwareAdapter.java | 563f64c88892656ac716b16b26802dadf6d8917e | [
"Apache-2.0"
] | permissive | Talend/apache-camel | cfc4657dc28a6c5701854b0889b9e0d090675b05 | fe9484bf5236f7af665c35cc7ed29527def8fe48 | refs/heads/master | 2023-08-10T14:15:19.145861 | 2023-06-28T06:30:44 | 2023-06-28T06:30:44 | 35,226,644 | 15 | 61 | Apache-2.0 | 2023-08-29T11:53:02 | 2015-05-07T15:03:34 | Java | UTF-8 | Java | false | false | 2,804 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.camel.support.resume;
import java.nio.ByteBuffer;
import org.apache.camel.resume.Cacheable;
import org.apache.camel.resume.Deserializable;
import org.apache.camel.resume.Offset;
import org.apache.camel.resume.OffsetKey;
import org.apache.camel.resume.ResumeAction;
import org.apache.camel.resume.ResumeActionAware;
import org.apache.camel.resume.ResumeAdapter;
import org.apache.camel.resume.cache.ResumeCache;
import org.apache.camel.spi.annotations.JdkService;
/**
* A simple resume adapter that support caching, deserialization and actions. This is usually suitable for supporting
* resume operations that have simple cache storage requirements, but delegate the resume action to the integrations
* (i.e.: such as when resuming from database components, where the resume operation can only be determined by the
* integration itself)
*/
@JdkService(ResumeAdapter.RESUME_ADAPTER_FACTORY)
public class ResumeActionAwareAdapter implements ResumeActionAware, Cacheable, Deserializable {
private ResumeCache<Object> cache;
private ResumeAction resumeAction;
@Override
public void setResumeAction(ResumeAction resumeAction) {
this.resumeAction = resumeAction;
}
@Override
public void resume() {
cache.forEach(resumeAction::evalEntry);
}
private boolean add(Object key, Object offset) {
cache.add(key, offset);
return true;
}
@Override
public boolean add(OffsetKey<?> key, Offset<?> offset) {
return add(key.getValue(), offset.getValue());
}
@Override
public void setCache(ResumeCache<?> cache) {
this.cache = (ResumeCache<Object>) cache;
}
@Override
public ResumeCache<?> getCache() {
return cache;
}
@Override
public boolean deserialize(ByteBuffer keyBuffer, ByteBuffer valueBuffer) {
Object key = deserializeKey(keyBuffer);
Object value = deserializeValue(valueBuffer);
return add(key, value);
}
}
| [
"orpiske@users.noreply.github.com"
] | orpiske@users.noreply.github.com |
3c582fb06cd6b1f22894af4bc807a2badd1d3231 | cbc61ffb33570a1bc55bb1e754510192b0366de2 | /ole-common/ole-utility/src/main/java/org/kuali/ole/docstore/model/xmlpojo/work/license/onixpl/TimePointIDTypeCode.java | f2965540817a4a88bdc0eac59925ddea2db05aea | [
"ECL-2.0"
] | permissive | VU-libtech/OLE-INST | 42b3656d145a50deeb22f496f6f430f1d55283cb | 9f5efae4dfaf810fa671c6ac6670a6051303b43d | refs/heads/master | 2021-07-08T11:01:19.692655 | 2015-05-15T14:40:50 | 2015-05-15T14:40:50 | 24,459,494 | 1 | 0 | ECL-2.0 | 2021-04-26T17:01:11 | 2014-09-25T13:40:33 | Java | UTF-8 | Java | false | false | 1,528 | java |
package org.kuali.ole.docstore.model.xmlpojo.work.license.onixpl;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Created by IntelliJ IDEA.
* User: Pranitha
* Date: 5/30/12
* Time: 1:18 PM
* To change this template use File | Settings | File Templates.
* <p/>
* <p>Java class for TimePointIDTypeCode.
* <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
* <p/>
* <pre>
* <simpleType name="TimePointIDTypeCode">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="onixPL:YYYYMMDD"/>
* </restriction>
* </simpleType>
* </pre>
*/
@XmlType(name = "TimePointIDTypeCode", namespace = "http://www.editeur.org/onix-pl")
@XmlEnum
public enum TimePointIDTypeCode {
/**
* A date according to the Gregorian Calendar expressed as year month day.
*/
@XmlEnumValue("onixPL:YYYYMMDD")
ONIX_PL_YYYYMMDD("onixPL:YYYYMMDD");
private final String value;
TimePointIDTypeCode(String v) {
value = v;
}
public String value() {
return value;
}
public static TimePointIDTypeCode fromValue(String v) {
for (TimePointIDTypeCode c : TimePointIDTypeCode.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"david.lacy@villanova.edu"
] | david.lacy@villanova.edu |
27dd5d3006747247e80c676d504dd404a96d43ba | 40665051fadf3fb75e5a8f655362126c1a2a3af6 | /ibinti-bugvm/389dda9293e5de1e85cc1b1250b3ce1dc7486a67/4954/AsymmetricCipherKeyPairGenerator.java | 919f92b3f113a1a70735ecd785201ad486ddf363 | [] | no_license | fermadeiral/StyleErrors | 6f44379207e8490ba618365c54bdfef554fc4fde | d1a6149d9526eb757cf053bc971dbd92b2bfcdf1 | refs/heads/master | 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | package com.bugvm.bouncycastle.crypto;
/**
* interface that a public/private key pair generator should conform to.
*/
public interface AsymmetricCipherKeyPairGenerator
{
/**
* intialise the key pair generator.
*
* @param param the parameters the key pair is to be initialised with.
*/
public void init(KeyGenerationParameters param);
/**
* return an AsymmetricCipherKeyPair containing the generated keys.
*
* @return an AsymmetricCipherKeyPair containing the generated keys.
*/
public AsymmetricCipherKeyPair generateKeyPair();
}
| [
"fer.madeiral@gmail.com"
] | fer.madeiral@gmail.com |
25b8ec324f7a1c3f6166fb463d5a3929052a48ad | f55f1023c90a0b7dbfee8e57e4dd1fb3e0e5663f | /android/app/src/main/java/com/pushnotification/MainApplication.java | 0da569e068169d1de69a85cb80dd76a4acf4e7b7 | [] | no_license | tpmabdulkareem/Push-Notification-App | 02d5675f5a446fac5210b84266e90c772fa3e78f | ec028b9c98d2cfbde888a13a0c54e1d1a84d323d | refs/heads/master | 2023-02-04T01:36:01.267899 | 2020-04-08T10:43:40 | 2020-04-08T10:43:40 | 254,030,183 | 2 | 0 | null | 2023-01-26T19:13:00 | 2020-04-08T08:32:57 | Java | UTF-8 | Java | false | false | 2,710 | java | package com.pushnotification;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new ReactNativePushNotificationPackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.pushnotification.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"kareem@bluecast.tech"
] | kareem@bluecast.tech |
5c6cfed86340ada4a2c8d3043318b0f2db64d8a1 | f5049214ff99cdd7c37da74619b60ac4a26fc6ba | /runtime/security/eu.agno3.runtime.security/src/main/java/eu/agno3/runtime/security/password/internal/DateMatcher.java | 564ae4b5271fa019056ea4011ec9e5497e55cf15 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | AgNO3/code | d17313709ee5db1eac38e5811244cecfdfc23f93 | b40a4559a10b3e84840994c3fd15d5f53b89168f | refs/heads/main | 2023-07-28T17:27:53.045940 | 2021-09-17T14:25:01 | 2021-09-17T14:31:41 | 407,567,058 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 7,306 | java | /**
* © 2015 AgNO3 Gmbh & Co. KG
* All right reserved.
*
* Created: 21.03.2015 by mbechler
*/
package eu.agno3.runtime.security.password.internal;
import java.util.Collection;
import java.util.LinkedList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author mbechler
*
*/
public class DateMatcher implements PasswordMatcher {
private static final Pattern YEAR_PATTERN = Pattern.compile("19\\d\\d|200\\d|201\\d/"); //$NON-NLS-1$
private static final Pattern DATE_WITHOUT_SEP_PATTERN = Pattern.compile("\\d{4,8}"); //$NON-NLS-1$
private static final Pattern DATE_SEP_PREFIX_PATTERN = Pattern
.compile("(\\d{1,2})(\\s|-|/|\\\\|_|\\.)(\\d{1,2})\\2(19\\d{2}|200\\d|201\\d|\\d{2})"); //$NON-NLS-1$
private static final Pattern DATE_SEP_SUFFIX_PATTERN = Pattern
.compile("(19\\d{2}|200\\d|201\\d|\\d{2})(\\s|-|/|\\\\|_|\\.)(\\d{1,2})\\2(\\d{1,2})"); //$NON-NLS-1$
/**
* {@inheritDoc}
*
* @see eu.agno3.runtime.security.password.internal.PasswordMatcher#match(java.lang.String)
*/
@Override
public Collection<MatchEntry> match ( String password ) {
Collection<MatchEntry> matches = new LinkedList<>();
addYearMatches(matches, password);
addDateWithSepMatches(matches, password);
addDateWithoutSepMatches(matches, password);
return matches;
}
/**
* @param matches
* @param password
*/
private static void addDateWithoutSepMatches ( Collection<MatchEntry> matches, String password ) {
Matcher matcher = DATE_WITHOUT_SEP_PATTERN.matcher(password);
int pos = 0;
while ( matcher.find(pos) ) {
int newPos = -1;
if ( matcher.group().length() <= 6 ) {
// try 2 digit year suffix
newPos = Math.max(
newPos,
tryMatchWithoutSep(
matches,
password,
matcher,
pos,
matcher.group().substring(0, matcher.group().length() - 2),
Integer.parseInt(matcher.group().substring(matcher.group().length() - 2)),
true));
// try 2 digit year prefix
newPos = Math.max(
newPos,
tryMatchWithoutSep(
matches,
password,
matcher,
pos,
matcher.group().substring(2),
Integer.parseInt(matcher.group().substring(0, 2)),
true));
}
else {
// try 4 digit year suffix
newPos = Math.max(
newPos,
tryMatchWithoutSep(
matches,
password,
matcher,
pos,
matcher.group().substring(0, matcher.group().length() - 4),
Integer.parseInt(matcher.group().substring(matcher.group().length() - 4)),
false));
// try 4 digit year prefix
newPos = Math.max(
newPos,
tryMatchWithoutSep(
matches,
password,
matcher,
pos,
matcher.group().substring(4),
Integer.parseInt(matcher.group().substring(0, 4)),
false));
}
if ( newPos < 0 ) {
pos += 1;
}
else {
pos = newPos;
}
}
}
/**
* @param matches
* @param password
* @param matcher
* @param pos
* @param dayOrMonth1
* @param dayOrMonth2
* @param year
* @return
*/
private static int tryMatchWithoutSep ( Collection<MatchEntry> matches, String password, Matcher matcher, int pos, String dayAndMonth, int year,
boolean shortYear ) {
int dayOrMonth1;
int dayOrMonth2;
if ( dayAndMonth.length() == 2 ) {
dayOrMonth1 = Integer.parseInt(dayAndMonth.substring(0, 1));
dayOrMonth2 = Integer.parseInt(dayAndMonth.substring(1));
}
else if ( dayAndMonth.length() >= 3 ) {
dayOrMonth1 = Integer.parseInt(dayAndMonth.substring(0, 2));
dayOrMonth2 = Integer.parseInt(dayAndMonth.substring(2));
}
else {
return -1;
}
if ( validDate(dayOrMonth1, dayOrMonth2, year, shortYear) ) {
matches.add(new DateMatchEntry(password.substring(matcher.start(), matcher.end()), matcher.start(), year, false));
return matcher.end();
}
return -1;
}
/**
* @param matches
* @param password
*/
private static void addDateWithSepMatches ( Collection<MatchEntry> matches, String password ) {
Matcher matcher = DATE_SEP_PREFIX_PATTERN.matcher(password);
int pos = 0;
while ( matcher.find(pos) ) {
int dayOrMonth1 = Integer.parseInt(matcher.group(1));
int dayOrMonth2 = Integer.parseInt(matcher.group(3));
int year = Integer.parseInt(matcher.group(4));
if ( validDate(dayOrMonth1, dayOrMonth2, year, year <= 100) ) {
matches.add(new DateMatchEntry(password.substring(matcher.start(), matcher.end()), matcher.start(), year, true));
}
pos = matcher.end();
}
pos = 0;
matcher = DATE_SEP_SUFFIX_PATTERN.matcher(password);
while ( matcher.find(pos) ) {
int dayOrMonth1 = Integer.parseInt(matcher.group(1));
int dayOrMonth2 = Integer.parseInt(matcher.group(3));
int year = Integer.parseInt(matcher.group(4));
if ( validDate(dayOrMonth1, dayOrMonth2, year, year <= 100) ) {
matches.add(new DateMatchEntry(password.substring(matcher.start(), matcher.end()), matcher.start(), year, true));
}
pos = matcher.end();
}
}
/**
* @param dayOrMonth1
* @param dayOrMonth2
* @param year
* @return
*/
private static boolean validDate ( int dayOrMonth1, int dayOrMonth2, int year, boolean shortYear ) {
if ( dayOrMonth1 > 31 || dayOrMonth2 > 31 ) {
return false;
}
if ( dayOrMonth1 > 12 && dayOrMonth2 > 12 ) {
return false;
}
// zxcvbn checks for year range in 1900 - 2019
if ( !shortYear && ( year < 1900 || year > 2019 ) ) {
return false;
}
return true;
}
/**
* @param matches
* @param password
*/
private static void addYearMatches ( Collection<MatchEntry> matches, String password ) {
Matcher matcher = YEAR_PATTERN.matcher(password);
int pos = 0;
while ( matcher.find(pos) ) {
matches.add(new MatchEntry(password.substring(matcher.start(), matcher.end()), matcher.start(), MatchType.YEAR));
pos = matcher.end();
}
}
}
| [
"bechler@agno3.eu"
] | bechler@agno3.eu |
b4f942d838558a7fe75ba6004d2d5571cdf94548 | 73b3dbf5df68a1f67e569e231543c6f33aa71ffd | /chapter 6/Computer_Assisted_InstructionTest.java | 1a3e636a53e6ce591a916e5ef45c8144f52a0853 | [] | no_license | ray-abel12/Deitel-Java-How-to-Program-Solutions | 5d50b06bad5dee764b75400bdc3d931ed176b36b | 33eb9741804cc3f53b82540c6d3d3458f0306bee | refs/heads/master | 2020-08-09T21:19:12.043649 | 2020-05-03T06:25:03 | 2020-05-03T06:25:03 | 214,176,773 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 208 | java | package exercises;
public class Computer_Assisted_InstructionTest {
public static void main(String[] args) {
//Computer_Assisted_Instruction.question();
Computer_Assisted_Instruction.solve();
//
}
}
| [
"rayabel12@outlook.com"
] | rayabel12@outlook.com |
2778f11737a9f7a2683d727ebd84c798dad5861f | c0b960db047482c249b1e7e74abaaf5171a56b8f | /src/algorithm/OrdenarVetor.java | e15b6382155cf63941b5ec1094456ad3698cea39 | [] | no_license | jonatasrd/logica | 7e0054f69391a78a1b3561a176928157fd5c09aa | 7e614f135f1c8e7dfaa2a58ec416f077da8abe82 | refs/heads/master | 2021-09-09T17:49:58.661154 | 2018-03-18T18:09:27 | 2018-03-18T18:09:27 | 125,625,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | package algorithm;
public class OrdenarVetor {
public static void main(String[] args) {
int quantidade = 10000;
int[] vetor = new int[quantidade];
for (int i = 0; i < vetor.length; i++) {
vetor[i] = (int) (Math.random() * quantidade);
}
long tempoInicial = System.currentTimeMillis();
ordernaVetor(vetor);
long tempoFinal = System.currentTimeMillis();
System.out.println("Executado em = " + (tempoFinal - tempoInicial) + " ms");
}
public static int[] ordernaVetor(int vetor[]) {
for (int i = 0; i < vetor.length; i++) {
for (int j = i + 1; j < vetor.length; j++) {
int temp;
if (vetor[i] > vetor[j]) {
temp = vetor[j];
vetor[j] = vetor[i];
vetor[i] = temp;
}
}
}
return vetor;
}
}
| [
"jonatasrd@gmail.com"
] | jonatasrd@gmail.com |
34608449b552a98bfe1c613c22a495968607dcea | 9cdc32db10ceccb342163d5f63646cf3c1ae004b | /blog.server/src/main/java/com/zlz/blog/server/config/GlobalExceptionHandler.java | ba22090ca141bceb22918af6253bb6d17cff996b | [] | no_license | githubzlz/blog-service-show | 4c9f45dfc6ac931d5583f01a58d6df3dbe4a85b8 | 1843897fd2aca96638c789f8967612cad89d9abf | refs/heads/master | 2023-01-05T00:33:20.721615 | 2020-11-04T00:49:27 | 2020-11-04T00:49:27 | 286,966,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,031 | java | package com.zlz.blog.server.config;
import com.zlz.blog.common.exception.BlogException;
import com.zlz.blog.common.response.ResultSet;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
/**
* @author zhulinzhong
* @version 1.0 CreateTime:2020-06-06 09:17
* @description 全局统一异常处理
*/
@ControllerAdvice
@RestController
@Log4j2
public class GlobalExceptionHandler {
@ExceptionHandler(value = Exception.class)
public ResultSet exceptionHandler(Exception e) {
if (e instanceof BlogException) {
log.error("异常[{}]", e);
return ResultSet.error(e.getMessage());
// return ResultSet.error("哦吼,发生错误了,请重试一次吧!");
} else {
log.error("异常[{}]", e);
return ResultSet.error("未知错误,请联系管理员!");
}
}
}
| [
"sdbz_zlz@163.com"
] | sdbz_zlz@163.com |
086dc2c1b07bf9dfe285902cb6e99cea1014e763 | 4d99c23aafa01d2ce6f7ca3cf944751e304f4b68 | /BSc-Assignments-master/Vote-Counting/Candidate.java | ae526db11c0581ce04113a4e84d73dcbd39f73f3 | [] | no_license | sam-o-floinn/academic | c53b82de1f0080e9a75313ab5bf05b7cee82c80b | e69aae9c610185ef0f18aa54fd3d0156abdadca0 | refs/heads/master | 2022-04-21T05:56:17.864851 | 2020-04-14T16:59:53 | 2020-04-14T16:59:53 | 255,659,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | /* @author Sam O'Floinn, 109539794. Created for Assignment A4, CS2504, Kieran Herley.
* This class creates a candidate to be elected in an election.
* Here, we define their name and party, and also the methods for users to retrieve these.
* */
public class Candidate
{
/* The candidate's name and party are defined at object-creation time by the user. */
public Candidate(String name, String party)
{
candidateName = name;
candidateParty = party;
}
/* These two getter methods retrieve both the candidate's name and party. */
public String getName()
{
return candidateName;
}
public String getParty()
{
return candidateParty;
}
private String candidateName;
private String candidateParty;
} | [
"samofloinn@protonmail.com"
] | samofloinn@protonmail.com |
bb45c7a330d8044791d7f3b61f270a745db5a849 | 467b6b19c4a4d269a91eb42f2963d3722d0be229 | /word2javabean/src/main/java/poi/ExportDocImpl.java | 231093cdb389b7e45b584e4f452f2775d976198b | [] | no_license | newxpp/hello-world | 7b2f15efe84854733af2e06ad87ee8f7d496fe72 | a33d4f30ad21dbbf07dabbf04de87e0bc494bb41 | refs/heads/master | 2020-06-04T21:04:27.951389 | 2015-02-11T18:02:15 | 2015-02-11T18:02:15 | 30,657,306 | 0 | 0 | null | 2015-02-11T16:45:20 | 2015-02-11T16:28:44 | null | GB18030 | Java | false | false | 2,919 | java | package poi;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.usermodel.Paragraph;
import org.apache.poi.hwpf.usermodel.Range;
import org.apache.poi.hwpf.usermodel.Table;
import org.apache.poi.hwpf.usermodel.TableCell;
import org.apache.poi.hwpf.usermodel.TableIterator;
import org.apache.poi.hwpf.usermodel.TableRow;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import freemarker.Test;
import freemarker.UpperFirstCharacter;
import freemarker.template.Configuration;
import freemarker.template.Template;
public class ExportDocImpl {
public static void main(String[] args) {
Configuration cfg = new Configuration();
try {
cfg.setClassForTemplateLoading(Test.class, "/"); // 指定模板所在的classpath目录
cfg.setSharedVariable("upperFC", new UpperFirstCharacter()); // 添加一个"宏"共享变量用来将属性名首字母大写
Template t = cfg.getTemplate("javabean.temp"); // 指定模板
FileOutputStream fos = new FileOutputStream(new File(
"c:/Student.java")); // java文件的生成目录
FileInputStream in = new FileInputStream("c:\\test.doc");// 载入文档
POIFSFileSystem pfs = new POIFSFileSystem(in);
HWPFDocument hwpf = new HWPFDocument(pfs);
Range range = hwpf.getRange();// 得到文档的读取范围
TableIterator it = new TableIterator(range);
// 迭代文档中的表格
while (it.hasNext()) {
Table tb = (Table) it.next();
// 模拟数据源
Map data = new HashMap();
data.put("package", "edu"); // 包名
data.put("className", "Student");
List<Map> pros = new ArrayList<>();
// 迭代行,默认从0开始
for (int i = 0; i < tb.numRows(); i++) {
TableRow tr = tb.getRow(i);
Map pro = new HashMap();
// 迭代列,默认从0开始
pro.put("proType", getCellValue(tr, 2));
pro.put("proComment", getCellValue(tr, 1));
pro.put("proName", getCellValue(tr, 0));
pros.add(pro);
} // end for
data.put("properties", pros);
t.process(data, new OutputStreamWriter(fos, "utf-8")); //
fos.flush();
} // end while
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
}// end method
private static String getCellValue(TableRow tr, int columnIndex) {
TableCell td = tr.getCell(columnIndex);// 取得单元格
// 取得单元格的内容
StringBuilder sb = new StringBuilder();
for (int k = 0; k < td.numParagraphs(); k++) {
Paragraph para = td.getParagraph(k);
String s = para.text();
sb.append(s.replaceAll("\\W$", ""));
} // end for
return sb.toString();
}
} | [
"Administrator@BZWMYY3XVYQXGMP"
] | Administrator@BZWMYY3XVYQXGMP |
117e04b3cc11f6adc3b90eba633f263371d07504 | c0c8defcda70990410a6de6e53d59b9d38c70fba | /backend/src/main/java/br/com/cadastro/clientes/model/entity/Cliente.java | f6c5b69d68e08e9cf3001871941eb18bc8e4e1cd | [] | no_license | yancarlos99/cadastro-clientes | 40f66f11f64e3bdd51a0ff24967e944e6a9e05f0 | ac5a57a1f38a5b91c705f1bdd5dde00c724feca7 | refs/heads/master | 2023-01-19T01:22:11.427954 | 2020-11-26T16:52:10 | 2020-11-26T16:52:10 | 313,498,642 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,235 | java | package br.com.cadastro.clientes.model.entity;
import java.time.LocalDate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.br.CPF;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Cliente {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotEmpty(message = "{campo.nome.obrigatorio}")
@Column(nullable = false, length = 150)
private String nome;
@NotNull(message = "{campo.cpf.obrigatorio}")
@CPF(message = "{campo.cpf.invalido}")
@Column(nullable = false, length = 11)
private String cpf;
@Column(name = "data_cadastro", updatable = false)
@JsonFormat(pattern = "dd/MM/yyyy")
private LocalDate dataCadastro;
@PrePersist
public void prePrersist() {
setDataCadastro(LocalDate.now());
}
}
| [
"yancarlos_99@outlook.com"
] | yancarlos_99@outlook.com |
124be08cab3e9c2adc9c1cb295541af18745b5c5 | bf6bcaf9dc3a91bdd78e3f1134972cccda978caa | /Runtime/src/reflect-thunk/Constructor.java | 143c999572312c1d978c382d3864d3507bdd8d26 | [] | no_license | fenghaitao/Harpoon | 3eac8f4e99b94d593d30f58b5c31755eaaa13d64 | bcec08dbbaed226fe653203e18d6a2c3a8b105a9 | refs/heads/master | 2021-01-18T19:41:17.512746 | 2011-02-20T17:52:44 | 2011-02-20T17:52:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,387 | java | package java.lang.reflect;
/**
* The Constructor class represents a constructor of a class. It also allows
* dynamic creation of an object, via reflection. Invocation on Constructor
* objects knows how to do widening conversions, but throws
* {@link IllegalArgumentException} if a narrowing conversion would be
* necessary. You can query for information on this Constructor regardless
* of location, but construction access may be limited by Java language
* access controls. If you can't do it in the compiler, you can't normally
* do it here either.<p>
*
* <B>Note:</B> This class returns and accepts types as Classes, even
* primitive types; there are Class types defined that represent each
* different primitive type. They are <code>java.lang.Boolean.TYPE,
* java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
* byte.class</code>, etc. These are not to be confused with the
* classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
* real classes.<p>
*
* Also note that this is not a serializable class. It is entirely feasible
* to make it serializable using the Externalizable interface, but this is
* on Sun, not me.
*
* @author C. Scott Ananian <cananian@alumni.princeton.edu>
* @author John Keiser
* @author Eric Blake <ebb9@email.byu.edu>
* @see Member
* @see Class
* @see java.lang.Class#getConstructor(Object[])
* @see java.lang.Class#getDeclaredConstructor(Object[])
* @see java.lang.Class#getConstructors()
* @see java.lang.Class#getDeclaredConstructors()
* @since 1.1
* @status updated to 1.4
*/
public final class Constructor
extends AccessibleObject implements Member
{
// uninstantiable: all instances are static
private Constructor() { }
// native methods
public native Class getDeclaringClass();
public native String getName();
public native int getModifiers();
public native Class[] getParameterTypes();
public native Class[] getExceptionTypes();
public native Object newInstance(Object[] oa)
throws InstantiationException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException;
// object-contract methods.
public boolean equals(Object o) {
Method m;
if (this==o) return true; // common case.
try { m = (Method) o; } catch (ClassCastException e) { return false; }
if (!getDeclaringClass().equals(m.getDeclaringClass())) return false;
Class[] mypt=getParameterTypes(), yourpt=m.getParameterTypes();
if (mypt.length!=yourpt.length) return false;
for (int i=0; i<mypt.length; i++)
if (!mypt[i].equals(yourpt[i])) return false;
return true;
}
public int hashCode() {
return getDeclaringClass().getName().hashCode();
}
public String toString() {
StringBuffer r = new StringBuffer();
int m = getModifiers();
if (m!=0) {
r.append(Modifier.toString(m));
r.append(' ');
}
r.append(Field.getTypeName(getDeclaringClass()));
r.append('(');
Class hcp[] = getParameterTypes();
for (int i=0; i<hcp.length; i++) {
r.append(Field.getTypeName(hcp[i]));
if (i < hcp.length-1)
r.append(',');
}
r.append(')');
Class ecp[] = getExceptionTypes();
if (ecp.length > 0) {
r.append(" throws ");
for (int i=0; i<ecp.length; i++) {
r.append(ecp[i].getName());// can't be primitive or array type.
if (i < ecp.length-1)
r.append(',');
}
}
return r.toString();
}
}
| [
"cananian@alumni.princeton.edu"
] | cananian@alumni.princeton.edu |
099015fb9a6dbbbbf4310ac462d807b0e512504f | 61cf3109eaf4561e071d93f9daf0d3cf9155ca9f | /src/com/rbt/index/testSearch.java | c1e793fa00597a223abdc0ad6337f7f5e83e4846 | [] | no_license | haoouwen/epf | b620fe05c93db178a122cfef778d31c036a2a822 | abe0f1ed564f33dcf766591c5f9b04ce2b5e8094 | refs/heads/master | 2021-01-19T13:46:10.278247 | 2017-08-20T10:40:12 | 2017-08-20T10:40:12 | 100,859,509 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,034 | java | package com.rbt.index;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.search.highlight.InvalidTokenOffsetsException;
import com.browseengine.bobo.api.BrowseException;
public class testSearch {
public static void main(String args[]) throws IOException, ParseException, InvalidTokenOffsetsException, BrowseException {
List paraList = new ArrayList();
ParaModel pm = new ParaModel();
/*
String[] fields = {"title","attr_desc"};
pm.setSearch_type(Constants.MULTI);
pm.setFields(fields);
pm.setSearch_value("2346564772");
*/
// String[] fields = {"cat_id"};
// pm.setFields(fields);
// pm.setSearch_type(Constants.MULTI);
// pm.setSearch_value("1121137758");
pm.setSearch_key("cat_name");
pm.setSearch_type(Constants.NORMAL);
pm.setSearch_value("女双肩包");
paraList.add(pm);
// lucene排序
// Sort sort=new Sort();
// SortField sf=new SortField("supply_id", SortField.STRING,true);//升序
// sort.setSort(new SortField[]{sf});
List list = new SearchIndex("goods").search(paraList, null, 1, 20);
System.out.println(list.size()+"===========");
// 循环输出
// List list = new SearchIndex("categoryattr").search(paraList, null, 0, 0);
System.out.println("我的查询结果列表是:");
// System.out.println(list.toString());
for (int i = 0; i < list.size(); i++) {
HashMap listMap=(HashMap)list.get(i);
String attr_desc="",cat_attr="",supply_id="",title="",area_attr="";
if(listMap.get("goods_name")!=null){
area_attr=listMap.get("goods_name").toString();
}
if(listMap.get("cat_attr")!=null){
cat_attr=listMap.get("cat_attr").toString();
}
System.out.println(title+"========="+cat_attr+"======");
}
List lista = new SearchIndex("goods").catInfoNum(paraList);
System.out.println(lista);
//new SearchIndex("supply").areaInfoNum(paraList,"1111111111");
}
}
| [
"Administrator@USER-20170608NM"
] | Administrator@USER-20170608NM |
95a3c7ee28c16007292eaa2a6a43dce90068afef | cc52c565fcd82b34c6f49552b57cc21a48433871 | /src/commands/CallbackInterface.java | 56022441b4396dd8dd92c63ac0f1bb81535fe588 | [] | no_license | christ0208/CashlessPay | 025a171f7ecc28be421dee761b0ebb229b2499b2 | bdaf9ec36b0e18bac14735a54e4a542279b4b53c | refs/heads/master | 2022-04-20T01:17:51.792217 | 2020-04-03T00:44:09 | 2020-04-03T00:44:09 | 239,225,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 82 | java | package commands;
public interface CallbackInterface {
public void execute();
}
| [
"christopherlimawan@gmail.com"
] | christopherlimawan@gmail.com |
14bff07818921c4d1bbb5823558551b5ceaaa3f5 | 092c76fcc6c411ee77deef508e725c1b8277a2fe | /hybris/bin/ext-accelerator/b2bpunchout/src/de/hybris/platform/b2b/punchout/PunchOutUtils.java | be52162801f70ab7a3fdda9cfdeaff9adac3dc60 | [
"MIT"
] | permissive | BaggaShivanshu2/hybris-bookstore-tutorial | 4de5d667bae82851fe4743025d9cf0a4f03c5e65 | 699ab7fd8514ac56792cb911ee9c1578d58fc0e3 | refs/heads/master | 2022-11-28T12:15:32.049256 | 2020-08-05T11:29:14 | 2020-08-05T11:29:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,080 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package de.hybris.platform.b2b.punchout;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.PropertyException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.sax.SAXSource;
import org.apache.commons.codec.binary.Base64;
import org.cxml.CXML;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import com.sun.org.apache.xerces.internal.impl.Constants;
public class PunchOutUtils
{
private static final String XML_WITHOUT_STANDALONE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
private static final String DOCTYPE = "<!DOCTYPE cXML SYSTEM \"http://xml.cXML.org/schemas/cXML/1.2.024/cXML.dtd\">";
protected static final String LOAD_EXTERNAL_DTD = Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
protected static final String EXTERNAL_GENERAL_ENTITIES = Constants.SAX_FEATURE_PREFIX
+ Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
protected static final String EXTERNAL_PARAMETER_ENTITIES = Constants.SAX_FEATURE_PREFIX
+ Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
public static CXML unmarshallCXMLFromFile(final String relativeFilePath) throws FileNotFoundException
{
final InputStream fileInputStream = PunchOutUtils.class.getClassLoader().getResourceAsStream(relativeFilePath);
if (fileInputStream == null)
{
throw new FileNotFoundException("Could not find file [" + relativeFilePath + "]");
}
try
{
final JAXBContext jaxbContext = JAXBContext.newInstance(CXML.class);
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
final SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
spf.setFeature(LOAD_EXTERNAL_DTD, false);
spf.setFeature(EXTERNAL_GENERAL_ENTITIES, false);
spf.setFeature(EXTERNAL_PARAMETER_ENTITIES, false);
spf.setXIncludeAware(false);
final SAXParser parser = spf.newSAXParser();
final XMLReader xmlReader = parser.getXMLReader();
final SAXSource source = new SAXSource(xmlReader, new InputSource(fileInputStream));
return (CXML) unmarshaller.unmarshal(source);
}
catch (final Exception e)
{
throw new PunchOutException(PunchOutResponseCode.INTERNAL_SERVER_ERROR, e.getMessage(), e);
}
}
public static String marshallFromBeanTree(final CXML cxml)
{
final StringWriter writer = new StringWriter();
try
{
final JAXBContext context = JAXBContext.newInstance(CXML.class);
final Marshaller m = context.createMarshaller();
removeStandalone(m);
setHeader(m);
m.marshal(cxml, writer);
}
catch (final JAXBException e)
{
throw new PunchOutException(e.getErrorCode(), e.getMessage(), e);
}
// FIXME - just testing - do it properly
String xml = writer.toString();
xml = XML_WITHOUT_STANDALONE + DOCTYPE + xml;
return xml;
}
public static void removeStandalone(final Marshaller marshaller) throws PropertyException
{
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
}
public static void setHeader(final Marshaller m) throws PropertyException
{
m.setProperty("com.sun.xml.internal.bind.xmlHeaders", XML_WITHOUT_STANDALONE + DOCTYPE);
}
/**
* Transforms a CXML into a Base64 String.
*
* @param cxml
* the cxml object.
* @return Base64 String
*/
public static String transformCXMLToBase64(final CXML cxml)
{
final String cXML = marshallFromBeanTree(cxml);
final String cXMLEncoded = Base64.encodeBase64String(cXML.getBytes());
return cXMLEncoded;
}
}
| [
"xelilim@hotmail.com"
] | xelilim@hotmail.com |
3eb205710d861153935e2acf38b5e521b0a1c821 | 0b058a8dbdf9210212801fc902f874a21fe4480a | /museum-highcharts/src/main/java/com/qingruan/highcharts/api/Credits.java | 5be0837b26e477f710c728c65ac88d1afcd01a4c | [] | no_license | Leibosite/museum-parent | feaa30a152757ae322c5150e5b4394ec5e9ddd2d | ff47cbc5deda44f107490da7e0f62c34058c4095 | refs/heads/master | 2016-08-12T18:31:03.772954 | 2016-03-02T06:01:39 | 2016-03-02T06:01:39 | 52,937,951 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.qingruan.highcharts.api;
import com.qingruan.highcharts.api.base.BaseObject;
public class Credits extends BaseObject {
private Boolean enabled;
public boolean istEnabled() {
return enabled;
}
public Credits setEnabled(boolean enabled) {
this.enabled = enabled;
return this;
}
}
| [
"leidebao@14cells.com"
] | leidebao@14cells.com |
2b4d9ca6e4e4a81d0403b7ac2857fd996bce276f | c796230089b71e116050676580a8bf6687b05108 | /src/test/java/com/fortunes/test/wanda/BirthOncePlusTest.java | 33001ef7c8dd7865c026a027636a0d7109ed067a | [] | no_license | yaoyuanloo/gdsb | 3b0639df4f9a11fdd63ccecaa454c348b9aeb2e4 | fd1a7f9f2e744717e03563ac808f6e8e7ef4f110 | refs/heads/master | 2020-03-26T10:32:05.244458 | 2018-08-15T03:56:45 | 2018-08-15T03:56:45 | 144,802,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,172 | java | package com.fortunes.test.wanda;
import com.fortunes.javamg.common.utils.DateUtils;
import com.fortunes.test.DubboTest;
import com.wondersgroup.interfaceServiceVS.unemploymentVS.u1.f14030102.F14030102Service;
import com.wondersgroup.interfaceServiceVS.unemploymentVS.u1.f14030102.params.*;
import org.junit.Test;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.text.ParseException;
/**
* Created by cxd on 2016/10/30 0030.
*/
public class BirthOncePlusTest extends DubboTest {
@Autowired
F14030102Service service;
/**
* 生育一次性待遇查询 checkOnceTreatmentOfBirth;
*
* OnceTreatmentOfBirthIP基类,该基类包含以下几个字段:
* Long aac001; // 人员ID
* String aaa027; // 统筹区编码
*
* OnceTreatmentOfBirthOP基类,该基类包含以下几个字段:
* boolean bizSuccess;
* String errorCode;
* String message;
* Long aae211; //待遇核定年月
* Long aae210; //待遇享受开始时间
* Long aic301; //待遇享受结束时间
* Long ajc099; // 剩余领取月数
* Double aae128; //待遇金额
*/
@Test
public void test(){
OnceTreatmentOfBirthIP p = new OnceTreatmentOfBirthIP();
p.setAaa027("440000");
p.setAac001(1000001694L);
OnceTreatmentOfBirthOP o = service.checkOnceTreatmentOfBirth(p);
out(o);
}
/**
* 生育一次性待遇计算 queryOnceTreatmentOfBirth
*
* QueryOnceTreatmentOfBirthIP基类,该基类包含以下几个字段:
* Long aae211; //待遇核定年月
* Long ajc099; // 剩余领取月数
* Double aae128; //待遇金额
* String aaa027; // 统筹区编码
* Long aac001; // 人员ID
*
* QueryOnceTreatmentOfBirthOP基类,该基类包含以下几个字段:
* boolean bizSuccess; //业务是否成功true表示成功,false表示失败
* String errorCode; //错误码
* String message; //信息
* int totalCounts;// 总记录条数
* int totalPage; // 总页数
* int currentPage;// 当前页码
* int rows; // Pagesize每页大小
* List<OnceCalculationDetail> onceCalculationDetail ;
*
* OnceCalculationDetail实体包含以下字段:
* String aaa036; //待遇项目名称
* Double aae128; //待遇金额
* String aae013; //备注
*/
@Test
public void test1(){
QueryOnceTreatmentOfBirthIP p = new QueryOnceTreatmentOfBirthIP();
p.setAaa027("440000");
p.setAae128(4800D);
p.setAjc099(6L);
p.setAac001(1000001694L);
p.setAae211(20161028L);
QueryOnceTreatmentOfBirthOP o = service.queryOnceTreatmentOfBirth(p);
out(o);
}
/**
* 生育一次性保存 saveOnceTreatmentOfBirth
*
* SaveOnceTreatmentOfBirthIP基类,该基类包含以下几个字段:
* Long aae211; //待遇核定年月
* Long aae210; //待遇享受开始时间
* Long aic301; //待遇享受结束时间
* Long ajc099; // 剩余领取月数
* Double aae128; //待遇金额
* Long aac001; // 人员ID
* String aaa027; // 统筹区编码
* Date bmc001; //生育日期
* List<OnceCalculationDetail> onceCalculationDetail ;
*
* OnceCalculationDetail包括一下字段:
* String aaa036; //待遇项目名称
* Double aae128; //待遇金额
* String aae013; //备注
*
* SaveOnceTreatmentOfBirthOP基类,该基类包含以下几个字段:
* boolean bizSuccess;
* String errorCode;
* String message;
* 错误码和提示信息如下:
* GDYLSY_001:传入参数为空
* GDYLSY_002:基础信息错误
* GDYLSY_003:操作不成功
*/
@Test
public void test2(){
//查询
OnceTreatmentOfBirthIP p1 = new OnceTreatmentOfBirthIP();
p1.setAaa027("440000");
p1.setAac001(1000001694L);
OnceTreatmentOfBirthOP o1 = service.checkOnceTreatmentOfBirth(p1);
out(o1);
//计算
QueryOnceTreatmentOfBirthIP p2 = new QueryOnceTreatmentOfBirthIP();
p2.setAaa027("440000");
p2.setAae128(4800D);
p2.setAjc099(6L);
p2.setAac001(1000001694L);
p2.setAae211(20161028L);
QueryOnceTreatmentOfBirthOP o2 = service.queryOnceTreatmentOfBirth(p2);
out(o2);
//保存
SaveOnceTreatmentOfBirthIP p = new SaveOnceTreatmentOfBirthIP();
p.setAac001(1000001694L);
p.setAaa027("440000");
try {
p.setBmc001(DateUtils.parseDate("20161001", "yyyyMMdd"));
} catch (ParseException e) {
e.printStackTrace();
}
BeanUtils.copyProperties(p1, p);
BeanUtils.copyProperties(o1, p);
BeanUtils.copyProperties(o2, p);
SaveOnceTreatmentOfBirthOP o = service.saveOnceTreatmentOfBirth(p);
out(o);
}
}
| [
"472357203@qq.com"
] | 472357203@qq.com |
ddcc6eab88f177ac0959af3285f0780adb33012e | b7fa70ab07e567614556b0e8d5cd3d18c22246bc | /src/main/java/hudson/plugins/clearcase/history/Filter.java | 01221c48ce43e0536b704c9a9c41023b61a39b40 | [] | no_license | jglick/clearcase-plugin | 6979d9c3eb9a87400b97c3e4304760f108460c54 | b5d381d339abb2625f7d66e4e0771976f15ec278 | refs/heads/master | 2021-01-16T19:51:11.623136 | 2013-07-18T14:15:24 | 2013-07-18T14:15:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,531 | java | /**
* The MIT License
*
* Copyright (c) 2007-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Erik Ramfelt,
* Henrik Lynggaard, Peter Liljenberg, Andrew Bayer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.plugins.clearcase.history;
/**
* @author Henrik L. Hansen (henrik.lynggaard@gmail.com)
*/
public interface Filter {
public boolean accept(HistoryEntry element);
public boolean requiresMinorEvents();
}
| [
"raspy@dev.java.net"
] | raspy@dev.java.net |
d677b4bb8fc3bc486094dc7601973ce6f6430762 | 1011ed798a29c101bbb91c44f680cb77d9fe21cf | /test_study/test_ActivityforResult/app/src/main/java/com/example/ybbaek/test_activityforresult/MainActivity.java | d2d9799f31f58b17370c92fe84c0f46f6df9d1f4 | [] | no_license | yunbum/Android | fe431552389355794821fdc3d50afad8339b4255 | 66693270f68bb0922bdd53730011968e9be6de16 | refs/heads/master | 2020-03-19T14:33:02.952262 | 2018-09-28T23:43:45 | 2018-09-28T23:43:45 | 136,628,171 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,518 | java | package com.example.ybbaek.test_activityforresult;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
public static final int REQUEST_CODE = 1000;
private EditText mNameEdtxt;
private EditText mAgeEdtxt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mNameEdtxt = findViewById(R.id.edtxt_name);
mAgeEdtxt = findViewById(R.id.edtxt_age);
findViewById(R.id.btn_submit).setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra("name", mNameEdtxt.getText().toString());
intent.putExtra("age", mAgeEdtxt.getText().toString());
//startActivity(intent);
startActivityForResult(intent, REQUEST_CODE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK && data != null){
String result = data.getStringExtra("result");
Toast.makeText(this, result, Toast.LENGTH_SHORT).show();
}
}
}
| [
"byb76@hanmail.net"
] | byb76@hanmail.net |
781bc66deb7b66870e046dec08bc4380c80b053c | 4223c2c2353743f82c5089227b0efed5d92df51c | /core/core-service/src/main/java/com/dreameddeath/core/service/model/common/ServiceInfoVersionInstanceDescription.java | 8e903cf857adc446b0223c649e9b4224c6df92d1 | [] | no_license | dreameddeath/couchbase-testing | 8623f168c327c01eda140e1329fe5b396791b636 | 127c8a8ba0bfc82f521d607f7640d567bb08f195 | refs/heads/master | 2021-01-23T15:54:17.274829 | 2018-09-03T00:16:17 | 2018-09-03T00:16:17 | 17,785,813 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,556 | java | /*
*
* * Copyright Christophe Jeunesse
* *
* * 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.dreameddeath.core.service.model.common;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;
/**
* Created by Christophe Jeunesse on 02/10/2015.
*/
public class ServiceInfoVersionInstanceDescription {
@JsonProperty("uid")
private String uid;
@JsonProperty("address")
private String address;
@JsonProperty("port")
private Integer port;
@JsonProperty("uriSpec")
private String uriSpec;
@JsonProperty("daemonUid")
private String daemonUid;
@JsonProperty("webServerUid")
private String webServerUid;
@JsonProperty("protocols")
private Set<String> protocols=new TreeSet<>();
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public String getUriSpec() {
return uriSpec;
}
public void setUriSpec(String uriSpec) {
this.uriSpec = uriSpec;
}
public String getDaemonUid() {
return daemonUid;
}
public void setDaemonUid(String daemonUid) {
this.daemonUid = daemonUid;
}
public String getWebServerUid() {
return webServerUid;
}
public void setWebServerUid(String webServerUid) {
this.webServerUid = webServerUid;
}
public Set<String> getProtocols() {
return Collections.unmodifiableSet(protocols);
}
public void setProtocols(Collection<String> protocols) {
this.protocols.clear();
this.protocols.addAll(protocols);
}
}
| [
"christophejeunesse@hotmail.com"
] | christophejeunesse@hotmail.com |
8b260729eacbb8906fa1d459d5a26d327f52fd40 | 6f2e3a609e5a1601d4e590c47954c167b7d56142 | /HFDP/Ch6/.metadata/.plugins/org.eclipse.core.resources/.history/33/1070da4d0ba500111b8fd8be7e19507f | 964b056eec9c6718fb1a87928544d44c1c210fc7 | [] | no_license | nathanh89/training | ba005091b8508f64420ef2bdd6c91e2ac1ea46a8 | 00f296eef3ffa373f3a38769d3b959f77530fe79 | refs/heads/master | 2020-06-01T04:35:21.208871 | 2012-11-08T11:05:57 | 2012-11-08T11:05:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | package com.visionarysoftwaresolutions.hfdpch6.bookstyle.remotecontrol;
public class CeilingFanOnCommand implements Command {
CeilingFan ceilingFan;
public CeilingFanOnCommand(CeilingFan ceilingFan) {
this.ceilingFan = ceilingFan;
}
public void execute() {
ceilingFan.high();
}
public void undo(){
ceilingFan.off();
}
}
| [
"nathanuhutcheson@gmail.com"
] | nathanuhutcheson@gmail.com | |
65f73cb703fc0ed3716b960a7bf2e54422565723 | 19b756a4af96ad186575e8a4a0f47d8e16ce0192 | /src/Generic/Node.java | 224e3f12912faa4f82866a9febbad84e1d62e1ce | [] | no_license | 842Mono/CSEN901_AISearchStrategies_Project1 | c150adcaf4769d6e9171eb9b19c0b4ea161d86da | a42380a6fd0ef24f6cb5d3f3fc8a1b295cd65929 | refs/heads/master | 2020-03-30T08:02:11.134988 | 2018-10-19T16:35:04 | 2018-10-19T16:35:04 | 150,983,633 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package Generic;
public class Node
{
public Node parent;
public Operator operator; //how this node was reached.
public int totalCost;
public int depth;
public int heuristic;
public Node() {}
public Node(Node parent, Operator operator, int cost, int depth)
{
this.parent = parent;
this.operator = operator;
this.totalCost = cost;
this.depth = depth;
this.heuristic = 0;
}
}
| [
"842mono@gmail.com"
] | 842mono@gmail.com |
5d8b85d304ac343b75d0bd3b8132f83f88f8022f | 1d0bde75c3d3270ebf9e768c30684b9ccf10bf3c | /BaseLibrary/src/main/java/io/github/trylovecatch/baselibrary/log/LogPrinter.java | 75d76b895d445cacfb0f7605152a3e1b9a7ceb1b | [] | no_license | TryLoveCatch/ganhuo | c1b73628e621f8de36af78bc798dd02cc946e446 | c536fcc09dd07b37d932c39b5a44f478e68b60d1 | refs/heads/master | 2021-01-10T15:17:06.523912 | 2017-07-04T11:47:40 | 2017-07-04T11:47:40 | 46,768,653 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,565 | java | package io.github.trylovecatch.baselibrary.log;
import android.support.annotation.NonNull;
public final class LogPrinter extends Timber.DebugTree {
private PrintStyle style;
/**
* 因为如果设置了tag,那么会在timber中多走一个方法,方法栈会发生变化,造成不准确的情况。
*/
private boolean isCustomTag = true;
private final LogBuilder logBuilder;
private static final String PROPERTY = System.getProperty("line.separator");
LogPrinter(LogBuilder logBuilder) {
this.logBuilder = logBuilder;
this.style = logBuilder.style;
}
/**
* Auto tag
*/
@Override
protected String createStackElementTag(StackTraceElement ignored) {
String tag;
isCustomTag = false;
if (logBuilder.globalTag != null) {
tag = logBuilder.globalTag;
} else {
int offset = Logger.STACK_OFFSET + logBuilder.methodOffset - 2; // 调整栈的位置
final StackTraceElement[] stackTrace = new Throwable().getStackTrace();
final int length = stackTrace.length;
tag = super.createStackElementTag(length > offset ? stackTrace[offset] : stackTrace[length - 1]);
}
return maybeAddPrefix(tag);
}
public String maybeAddPrefix(String tag) {
String tagPrefix = logBuilder.tagPrefix;
if (tagPrefix != null) {
tag = tagPrefix + "-" + tag;
}
return tag;
}
/**
* @param tag from {@link #createStackElementTag(StackTraceElement)}
*/
@Override
protected void log(int priority, String tag, @NonNull String message, Throwable ignored) {
if (style.beforePrint() != null) {
super.log(priority, tag, style.beforePrint(), null);
}
String[] lines = message.split(PROPERTY);
for (int i = 0, length = lines.length; i < length; i++) {
String logStr = style.printLog(lines[i], i, length);
super.log(priority, tag, logStr, null);
}
if (style.afterPrint() != null) {
super.log((priority), tag, style.afterPrint(), null);
}
isCustomTag = true;
}
/**
* 根据级别显示log
*
* @return 默认所有级别都显示
*/
@Override
protected boolean isLoggable(String tag, int priority) {
return priority >= logBuilder.priority;
}
boolean isCustomTag() {
return isCustomTag;
}
public LogBuilder getLogBuilder() {
return logBuilder;
}
}
| [
"lipeng21@baidu.com"
] | lipeng21@baidu.com |
f285b36cbae947d4e285d482e3180eb2f1e6f3cf | 3578f72df5b5c12b08c60f4e7f8946522a054480 | /app/src/main/java/com/example/desarrollo/Entidades/MensajesPersuasivos.java | 6713c3837c72939a4e9ecf9f1fe32f2b8a6a55e9 | [] | no_license | todostodo/qwerty123zxcvbnmasdfghjkl | 327b791938ef613319f51c1f23a7bc85ffe5af10 | 2e438447beb5fec6e3632cb68d97ebcdaef5d5e0 | refs/heads/master | 2020-12-12T19:02:02.288589 | 2020-07-11T01:14:18 | 2020-07-11T01:14:18 | 234,205,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | package com.example.desarrollo.Entidades;
public class MensajesPersuasivos {
private String idMsgPersuasivo;
private String titulo;
private String mensaje;
public MensajesPersuasivos(String id, String titulo, String mensaje) {
this.idMsgPersuasivo = id;
this.titulo = titulo;
this.mensaje = mensaje;
}
public String getIdMsgPersuasivo() {
return idMsgPersuasivo;
}
public String getTitulo() {
return titulo;
}
public String getMensaje() {
return mensaje;
}
}
| [
"37948654+mrmarcodetk@users.noreply.github.com"
] | 37948654+mrmarcodetk@users.noreply.github.com |
7d8f5ea54ce32c87729b23720211eb1a229dd054 | b7caa44bcde98cf612b71e5770e1a425bed8c883 | /app/src/main/java/com/example/myapplication/otpsignin.java | 21db888fdefd114a52b1d83a5a4e93a7ce872e65 | [] | no_license | quoraboy/RENTCAR | c8a5bf77577ce68418da337de94e771df5ceba7a | 5e2a5c266510e06f8d3a5daf26c7044d64cb0c08 | refs/heads/master | 2022-11-30T23:34:23.270594 | 2020-08-12T09:48:31 | 2020-08-12T09:48:31 | 202,772,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,071 | java | package com.example.myapplication;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthProvider;
import java.util.concurrent.TimeUnit;
public class otpsignin extends AppCompatActivity {
private EditText phonetxt;
private EditText codetxt;
private Button btnOTP;
private FirebaseAuth mAuth;
private String TAG ="xyz";
private int btntype=0;
private PhoneAuthProvider.OnVerificationStateChangedCallbacks mcallback;
private String mVerificationId;
private PhoneAuthProvider.ForceResendingToken mResendToken;
public static String phonenumber ;
public static String mDeviceNum;
SharedPreferences sharedPref;
SharedPreferences.Editor editor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_otpsignin);
mAuth=FirebaseAuth.getInstance();
phonetxt=(EditText) findViewById(R.id.phoneEditText);
codetxt=(EditText) findViewById(R.id.codeEditText);
btnOTP= (Button) findViewById(R.id.btnotp);
codetxt.setEnabled(false);
btnOTP.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(btntype==0)
{
phonenumber=phonetxt.getText().toString();
phonetxt.setEnabled(true);
codetxt.setEnabled(true);
PhoneAuthProvider.getInstance().
verifyPhoneNumber(phonenumber,60, TimeUnit.SECONDS,
otpsignin.this,
mcallback);
}
else
{
String verificationcode=codetxt.getText().toString(); //verificationcode contain the OTP
PhoneAuthCredential cridential=PhoneAuthProvider.getCredential(mVerificationId,verificationcode);
signInWithPhoneAuthCredential(cridential);
}
}
});
mcallback=new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
//When the code is send and the enter
// phone no. is in the phone in which app is runing this meathod is going to run
Toast.makeText(otpsignin.this,"Code send to your phone",Toast.LENGTH_SHORT).show();
signInWithPhoneAuthCredential(phoneAuthCredential);
}
@Override
public void onVerificationFailed(FirebaseException e) {
//If sms didn't receive this gonna call
Toast.makeText(otpsignin.this,"Something went wrong",Toast.LENGTH_SHORT).show();
}
@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token) {
//This meathod is call when ever the enter
// phone no. is in the other mobile other than the installed app phone no.
// The SMS verification code has been sent to the provided phone number, we
// now need to ask the user to enter the code and then construct a credential
// by combining the code with a verification ID.
Toast.makeText(otpsignin.this, verificationId, Toast.LENGTH_SHORT).show();
Log.d(TAG, "onCodeSent:" + verificationId);
Toast.makeText(otpsignin.this,"On code sent meathod",Toast.LENGTH_SHORT).show();
// Save verification ID and resending token so we can use them later
btntype=1;
mVerificationId = verificationId;
mResendToken = token;
btnOTP.setText("Verify code");
// ...
}
};
}
private void signInWithPhoneAuthCredential(PhoneAuthCredential credential) {
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener <AuthResult>() {
@Override
public void onComplete(@NonNull Task <AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInWithCredential:success");
FirebaseUser user = task.getResult().getUser();
mDeviceNum = phonenumber;
sharedPref = getSharedPreferences("num", Context.MODE_PRIVATE);
editor = sharedPref.edit();
editor.putString("Phone",phonenumber);
editor.commit();
Intent intent=new Intent(otpsignin.this, NavigationDrawer.class);
//intent.putExtra( "phoneno",);
startActivity(intent);
finish();
// ...
} else {
// Sign in failed, display a message and update the UI
Toast.makeText(otpsignin.this,"ERROR",Toast.LENGTH_SHORT).show();
Log.w(TAG, "signInWithCredential:failure", task.getException());
if (task.getException() instanceof FirebaseAuthInvalidCredentialsException) {
// The verification code entered was invalid
}
}
}
});
}
int backButtonCount = 0;
@Override
public void onBackPressed() {
backButtonCount++;
// Toast.makeText(this,String.valueOf(backButtonCount) , Toast.LENGTH_SHORT).show();
// DrawerLayout drawer = findViewById(R.id.drawer_layout);
// if (drawer.isDrawerOpen(GravityCompat.START)) {
// drawer.closeDrawer(GravityCompat.START);
// backButtonCount=0;
// }
if(backButtonCount > 1)
{
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
// Toast.makeText(this, "aaaaaaaaaaa", Toast.LENGTH_SHORT).show();
backButtonCount=0;
}
else
{
Toast.makeText(this, "Press the back button once again to close the application.", Toast.LENGTH_SHORT).show();
// backButtonCount++;
}
// else {
// super.onBackPressed();
// }
}
}
| [
"sachin.s.pathak1998@gmail.com"
] | sachin.s.pathak1998@gmail.com |
63f0e024fc95628b37c78dcf40f2bade1c409a21 | 0800f457bf20efdcc41ef1262ea30ebdf56c2a6e | /src/main/java/decorator/Surgeon.java | 59c3e8f24a595aad86a3ccfad4d0dc9b9af35a95 | [] | no_license | blokhina1605/CDP | a4f4983af4b9192cfda8d8fc39cf4963c71b91e9 | b21257b0d68bf40cbbc3021b1c6ca6221f64d842 | refs/heads/master | 2021-01-19T14:57:29.815410 | 2015-09-16T18:19:12 | 2015-09-16T18:19:12 | 42,604,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package decorator;
/**
* Created by Yevheniia_Blokhina on 9/16/2015.
*/
public class Surgeon extends Specialty {
public Surgeon(InterfaceDoctor doctor) {
super(doctor);
}
@Override
public String treat() {
return super.treat() + "And your hand will soon disappear. ";
}
}
| [
"Yevheniia_Blokhina@epam.com"
] | Yevheniia_Blokhina@epam.com |
ee0e1ebb23c48d2d1b763b218a81ae38fb915aa4 | 1c91bade6df69b364f185b168553485363207aed | /app/src/main/java/cn/ewhale/dispatchingeventstest/ViewPageEx.java | 25898c47b2d1e8e5559b143774ec1ec42c243483 | [] | no_license | YGLLL/DispatchingEventsTest | f89efb829b67238668d40fd2615eb39cb89dfc47 | 70b4dc2538ba987a6f25dc46708b6956d419260c | refs/heads/master | 2020-05-21T00:20:42.728564 | 2019-05-09T15:22:04 | 2019-05-09T15:22:04 | 185,824,205 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,474 | java | package cn.ewhale.dispatchingeventstest;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
/**
* create by ygl
* 2019/5/9 8:12
*/
public class ViewPageEx extends ViewPager {
private static final String TAG = "ViewPageEx";
public ViewPageEx(@NonNull Context context) {
super(context);
}
public ViewPageEx(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if(ev.getAction()==MotionEvent.ACTION_DOWN) {
return false;
}else {
return true;
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getAction()){
case MotionEvent.ACTION_DOWN:
Log.e(TAG,"MotionEvent.ACTION_DOWN");
break;
case MotionEvent.ACTION_MOVE:
Log.e(TAG,"MotionEvent.ACTION_MOVE");
break;
case MotionEvent.ACTION_UP:
Log.e(TAG,"MotionEvent.ACTION_UP");
break;
case MotionEvent.ACTION_CANCEL:
Log.e(TAG,"MotionEvent.ACTION_CANCEL");
break;
}
return super.onTouchEvent(ev);
}
}
| [
"2369015621@qq.com"
] | 2369015621@qq.com |
9d033b37e7d2f61734959042d18523002007285b | 755d29db8d0f7b47a3c6c9c1f3fd4b2fa8e3c785 | /Android/app/src/main/java/com/example/sree/outlaymanagement/ElectricitybillActivity.java | 5ae84a50f0cce59f16c05d18c7a053817a725f37 | [] | no_license | sreelakshmishaji/Outlay_management | 0ed76d32e246ce36e33ffd0eed952c5f830d54e0 | ea30c0edc8477b52f38b00f199063512274a9eb1 | refs/heads/master | 2020-04-07T17:35:25.092372 | 2018-11-23T05:01:38 | 2018-11-23T05:01:38 | 158,575,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,230 | java | package com.example.sree.outlaymanagement;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONObject;
public class ElectricitybillActivity extends AppCompatActivity implements View.OnClickListener {
Button confirm;
EditText serviceno;
SharedPreferences sh;
String id;
String sh_name = "MyData";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_electricitybill);
Toast.makeText(this, "hello", Toast.LENGTH_SHORT).show();
confirm = findViewById(R.id.btnconform);
confirm.setOnClickListener(this);
serviceno = findViewById(R.id.edtserviceno);
sh = getSharedPreferences(sh_name, MODE_PRIVATE);
id = sh.getString("User_id", " ");
}
@Override
public void onClick(View view) {
if (view == confirm) {
String servicenum = serviceno.getText().toString();
if (servicenum.equals("")) {
serviceno.setError("Enter Serviceno");
} else if (!(servicenum.length() >= 9 && servicenum.length() <= 13)) {
serviceno.setError("Enter a Valid Service Number");
} else {
Bill data = new Bill();
data.execute(id,servicenum);
// Intent i = new Intent(this, PayElectricityActivity.class);
// i.putExtra("service", servicenum);
// startActivity(i);
}
}
}
private class Bill extends AsyncTask<String, String, String> {
@Override
protected String doInBackground(String... strings) {
WebServiceCaller wc = new WebServiceCaller();
wc.setSoapObject("ebillservice");
wc.addProperty("Personid", strings[0]);
wc.addProperty("Serviceno", strings[1]);
wc.callWebService();
return wc.getResponse();
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
// Toast.makeText(ElectricitybillActivity.this, s, Toast.LENGTH_SHORT).show();
String bill="";
JSONArray ji= null;
try {
ji = new JSONArray(s);
JSONObject jos = ji.getJSONObject(0);
bill = jos.getString("BillNo");
if(bill.equals("0"))
{
Toast.makeText(ElectricitybillActivity.this, "Incorrect Service Number", Toast.LENGTH_SHORT).show();
serviceno.setText("");
}
else
{
Intent i = new Intent(ElectricitybillActivity.this, PayElectricityActivity.class);
i.putExtra("service", s);
startActivity(i);
}
}
catch(Exception e)
{
}
}
}
}
| [
"sreelakshmianns@gmail.com"
] | sreelakshmianns@gmail.com |
40d2462e70c3c9fa2522eaf673d15fce4c7a65d3 | 5ebd630076f9eb6af7a01b7d2edcb9c184bc86f8 | /src/NewJFrame.java | c2935522cedfab3f7b6ac861414007b5e6bc4345 | [] | no_license | swatikp99/calc-java | 1e37d3cb177126ac7710994ebfbc6d413b127dc0 | 09f9f28d3100a0e4fe89942520a445191a83ccc1 | refs/heads/main | 2023-03-03T14:00:35.529603 | 2021-02-12T19:31:27 | 2021-02-12T19:31:27 | 338,413,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,600 | java | /*
* 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.
*/
/**
*
* @author Swatik
*/
public class NewJFrame extends javax.swing.JFrame {
/**
* Creates new form NewJFrame
*/
public NewJFrame() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jTextField2 = new javax.swing.JTextField();
jTextField1 = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(230, 230, 230));
jTextField2.setBackground(new java.awt.Color(204, 255, 204));
jTextField2.setFont(new java.awt.Font("Bahnschrift", 0, 14)); // NOI18N
jTextField2.setForeground(new java.awt.Color(102, 102, 102));
jTextField2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
jTextField2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField2ActionPerformed(evt);
}
});
jTextField1.setBackground(new java.awt.Color(204, 255, 204));
jTextField1.setFont(new java.awt.Font("Bahnschrift", 0, 24)); // NOI18N
jTextField1.setForeground(new java.awt.Color(102, 102, 102));
jTextField1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
jTextField1.setBorder(null);
jTextField1.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(19, Short.MAX_VALUE)))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 109, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 266, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed
// TODO add your handling code here:
jTextField1.setText(jTextField1.getText()+0);
}//GEN-LAST:event_jTextField2ActionPerformed
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
jTextField1.setText(jTextField1.getText()+0);
}//GEN-LAST:event_jTextField1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
// End of variables declaration//GEN-END:variables
}
| [
"swatikp99@gmail.com"
] | swatikp99@gmail.com |
f853004d1dd19f9b830ebe4573b3f3c4ff69e227 | 1b30ae6b34099a060cccec21b25e90d3b24f1b33 | /src/test/java/org/certificatic/dao/test/AlumnoDAOTest.java | 9ca337e32aabd07dbe872b8ef75fa349f494ba79 | [] | no_license | EduardoCM/SpringAnotacionesJdbc | 206550154069b847125e5b81e543e5b4b126f822 | 6cf140edfadb88b70378c21bf10fc44d69935408 | refs/heads/master | 2020-03-30T18:20:32.157709 | 2018-10-04T05:03:05 | 2018-10-04T05:03:05 | 151,495,377 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,854 | java | package org.certificatic.dao.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.certificatic.bean.Alumno;
import org.certificatic.dao.AlumnoDAO;
import org.certificatic.dao.AlumnoDAOImpl;
import org.certificatic.service.AlumnoService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "file:src/main/resources/spring-config.xml" })
public class AlumnoDAOTest {
private static final Logger logger =
Logger.getLogger(AlumnoDAOTest.class);
@Autowired
AlumnoService alumnoService;
@Test
public void testSave() {
Alumno alumno = new Alumno();
alumno.setNombre("EduardoService");
alumno.setApellido("CastilloService");
assertTrue(alumnoService.save(alumno));
}
@Test
public void testFindAll() {
List<Alumno> alumnos = alumnoService.findAll();
assertTrue(alumnos.size() > 0);
}
@Test
public void testFindById() {
Alumno alumno = alumnoService.findById(1);
logger.info(alumno);
assertNotNull(alumno);
}
@Test
public void testFindByNombre() {
List<Alumno> alumnosNombre = alumnoService.findByNombre("Eduardo");
assertNotNull(alumnosNombre);
}
@Test
public void testUpdateAlumno() {
Alumno alumnoNew = new Alumno();
alumnoNew.setIdAlumno(1);
alumnoNew.setNombre("NombreActualizadoDos");
alumnoNew.setApellido("ApellidoActualizadoDos");
assertTrue(alumnoService.update(alumnoNew));
}
@Test
public void testDeleteAlumno() {
alumnoService.delete(4);
}
}
| [
"eduardocastillo@Eduardos-MacBook-Pro.local"
] | eduardocastillo@Eduardos-MacBook-Pro.local |
59057dffe7cfc682c8bd99d6d5d9fe09012b91c0 | 6d1162784f17d17a498fc0ca080eeb8e7cd2c582 | /Concurrent/SourceCode/Concurrency/src/main/java/com/mmall/concurrency/example/publish/Escape.java | 86ebcb6d424efc6a38822e3defdf1a136b91f8d2 | [
"MIT"
] | permissive | Gravitational-Field/GF-Concurrent | caae412f3f84ab258dda11f6fa8e52e2bffff92a | 9ff3ba6ad932de610cc2d2a56802faaaf41bf03f | refs/heads/main | 2023-03-13T13:58:58.213762 | 2021-03-16T01:57:55 | 2021-03-16T01:57:55 | 348,181,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package main.java.com.mmall.concurrency.example.publish;
import main.java.com.mmall.concurrency.annoations.NotRecommend;
import main.java.com.mmall.concurrency.annoations.NotThreadSafe;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@NotThreadSafe
@NotRecommend
public class Escape {
private int thisCanBeEscape = 0;
public Escape () {
new InnerClass();
}
private class InnerClass {
public InnerClass() {
log.info("{}", Escape.this.thisCanBeEscape);
}
}
public static void main(String[] args) {
new Escape();
}
}
| [
"lizhangjie316@163.com"
] | lizhangjie316@163.com |
bf62fe8ca7bc166c471ceb113042ba8a4993586b | a77691f0bda37126f424d4280fb7fb9606f3781e | /src/main/java/org/frekele/cielo/lio/remote/client/converter/deserialize/BigDecimalJsonDeserialize.java | fc83a72ddaaa444df07b1e0d70ac23db0f136f47 | [
"MIT"
] | permissive | frekele/cielo-lio-remote-client | e75089a5ae8dfba590a506b01b64968b089cf4eb | 7f97dda6b7aa48bb9086f0d51029025642e3685b | refs/heads/master | 2023-05-25T05:16:27.867824 | 2020-05-25T06:00:34 | 2020-05-25T06:00:34 | 117,420,215 | 6 | 1 | MIT | 2023-05-09T18:06:47 | 2018-01-14T10:17:23 | Java | UTF-8 | Java | false | false | 1,003 | java | package org.frekele.cielo.lio.remote.client.converter.deserialize;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.math.BigDecimal;
/**
* @author frekele - Leandro Kersting de Freitas
*/
public class BigDecimalJsonDeserialize extends StdDeserializer<BigDecimal> {
private static final int SCALE = 2;
protected BigDecimalJsonDeserialize() {
super(BigDecimal.class);
}
@Override
public BigDecimal deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {
if (jsonParser != null) {
Long value = jsonParser.readValueAs(Long.class);
if (value != null) {
return BigDecimal.valueOf(value, SCALE);
}
}
return null;
}
}
| [
"leandro.freitas@softdevelop.com.br"
] | leandro.freitas@softdevelop.com.br |
cc5ea05c6142690af797e53a6cf93680b30f1b87 | c6428967f87dec95b050ba2ab6309e4ac9a54b70 | /hangugi77-tobytv7/src/main/java/com/daou/tobytv7/Practice.java | 79e3fa24727bdd7989fa5a17f25772fbcf6e21b2 | [] | no_license | mskwak/hangugi77 | aefc3298a936c982af501d23d9fa685ab9aa6b57 | 6b7bac33b17f7003b410f0021b8522e751ea9298 | refs/heads/master | 2022-10-17T17:41:42.185808 | 2019-10-14T13:52:15 | 2019-10-14T13:52:15 | 135,868,642 | 0 | 0 | null | 2023-08-24T20:27:00 | 2018-06-03T02:55:34 | Java | UTF-8 | Java | false | false | 180 | java | package com.daou.tobytv7;
import reactor.core.publisher.Flux;
public class Practice {
public static void main(String[] args) {
Flux.just("test").subscribe();
}
}
| [
"kdamduck77@gmail.com"
] | kdamduck77@gmail.com |
5a2d3f1843d354e389fcd9dd6c50264fc4d287ce | a1a6244fa3ef089d9c277e44c17be2c68eba493c | /app/src/main/java/a/a/a/Ix.java | ce80471625d07c9d39f8ca4fa109fa9c8b753eeb | [] | no_license | AnandaRauf/Sketchware-Pro | 69a6aafebbb17bdd1968bc4d694ff00c26b7ad7a | f78cade7ed456711c672772e9b4f2279ab9d50d7 | refs/heads/main | 2023-08-14T19:00:47.907198 | 2021-09-12T15:35:16 | 2021-09-12T15:35:16 | 405,687,323 | 1 | 0 | null | 2021-09-12T16:04:08 | 2021-09-12T16:04:07 | null | UTF-8 | Java | false | false | 17,690 | java | package a.a.a;
import android.Manifest;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Intent;
import com.besome.sketch.beans.ProjectFileBean;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.HashMap;
import mod.agus.jcoderz.handle.component.ConstVarManifest;
import mod.agus.jcoderz.lib.FilePathUtil;
import mod.agus.jcoderz.lib.FileResConfig;
import mod.agus.jcoderz.lib.FileUtil;
import mod.hey.studios.build.BuildSettings;
import mod.hey.studios.project.ProjectSettings;
import mod.hey.studios.util.Helper;
import mod.hilal.saif.android_manifest.AndroidManifestInjector;
public class Ix {
public Nx a = new Nx("manifest");
public ArrayList<ProjectFileBean> b;
public BuildSettings buildSettings;
public jq c;
public FilePathUtil fpu = new FilePathUtil();
public FileResConfig frc;
public ProjectSettings settings;
public Ix(jq jq, ArrayList<ProjectFileBean> projectFileBeans) {
c = jq;
b = projectFileBeans;
buildSettings = new BuildSettings(jq.sc_id);
frc = new FileResConfig(c.sc_id);
a.a("xmlns", "android", "http://schemas.android.com/apk/res/android");
}
/**
* Adds FileProvider metadata to AndroidManifest.
*
* @param nx AndroidManifest {@link Nx} object
* @return The {@code provider} {@link Nx} tag
*/
public final Nx a(Nx nx) {
Nx providerTag = new Nx("provider");
providerTag.a("android", "authorities", c.a + ".provider");
providerTag.a("android", "name", "androidx.core.content.FileProvider");
providerTag.a("android", "exported", "false");
providerTag.a("android", "grantUriPermissions", "true");
Nx metadataTag = new Nx("meta-data");
metadataTag.a("android", "name", "android.support.FILE_PROVIDER_PATHS");
metadataTag.a("android", "resource", "@xml/provider_paths");
providerTag.a(metadataTag);
nx.a(providerTag);
return providerTag;
}
/**
* Adds a permission to AndroidManifest.
*
* @param nx AndroidManifest {@link Nx} object
* @param str The {@code uses-permission} {@link Nx} tag
*/
public final void a(Nx nx, String str) {
Nx usesPermissionTag = new Nx("uses-permission");
usesPermissionTag.a("android", "name", str);
nx.a(usesPermissionTag);
}
/**
* Adds Firebase metadata to AndroidManifest.
*
* @param nx AndroidManifest {@link Nx} object
* @return The {@code provider} {@link Nx} tag
*/
public final Nx b(Nx nx) {
Nx providerTag = new Nx("provider");
providerTag.a("android", "name", "com.google.firebase.provider.FirebaseInitProvider");
providerTag.a("android", "authorities", c.a + ".firebaseinitprovider");
providerTag.a("android", "exported", "false");
providerTag.a("android", "initOrder", "100");
nx.a(providerTag);
Nx serviceTag = new Nx("service");
serviceTag.a("android", "name", "com.google.firebase.components.ComponentDiscoveryService");
serviceTag.a("android", "exported", "false");
if (c.i) {
Nx metadataTag = new Nx("meta-data");
metadataTag.a("android", "name", "com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar");
metadataTag.a("android", "value", "com.google.firebase.components.ComponentRegistrar");
serviceTag.a(metadataTag);
}
if (c.j) {
Nx metadataTag = new Nx("meta-data");
metadataTag.a("android", "name", "com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar");
metadataTag.a("android", "value", "com.google.firebase.components.ComponentRegistrar");
serviceTag.a(metadataTag);
}
if (c.k) {
Nx metadataTag = new Nx("meta-data");
metadataTag.a("android", "name", "com.google.firebase.components:com.google.firebase.storage.StorageRegistrar");
metadataTag.a("android", "value", "com.google.firebase.components.ComponentRegistrar");
serviceTag.a(metadataTag);
}
ConstVarManifest.handleMetadata(serviceTag, c.x);
nx.a(serviceTag);
return providerTag;
}
/**
* Adds the Google Maps SDK API key metadata to AndroidManifest.
*
* @param nx AndroidManifest {@link Nx} object
* @return The {@code meta-data} {@link Nx} tag
*/
public final Nx c(Nx nx) {
Nx metadataTag = new Nx("meta-data");
metadataTag.a("android", "name", "com.google.android.geo.API_KEY");
metadataTag.a("android", "value", "@string/google_maps_key");
nx.a(metadataTag);
return metadataTag;
}
/**
* Specifies in AndroidManifest that the app uses Apache HTTP legacy library.
*
* @param nx AndroidManifest {@link Nx} object
* @return The {@code uses-library} {@link Nx} tag
*/
public final Nx d(Nx nx) {
Nx usesLibraryTag = new Nx("uses-library");
usesLibraryTag.a("android", "name", "org.apache.http.legacy");
usesLibraryTag.a("android", "required", "false");
nx.a(usesLibraryTag);
return usesLibraryTag;
}
/**
* Adds metadata about the GMS library version (a resource integer).
*
* @param nx {@link Nx} object to add the {@code meta-data} tag to
* @return The {@code meta-data} {@link Nx} object
*/
public final Nx e(Nx nx) {
Nx metadataTag = new Nx("meta-data");
metadataTag.a("android", "name", "com.google.android.gms.version");
metadataTag.a("android", "value", "@integer/google_play_services_version");
nx.a(metadataTag);
return metadataTag;
}
public void f(Nx nx) {
ConstVarManifest.handleAttrComponent(nx, c.x);
}
/**
* Registers a {@link BroadcastReceiver} in AndroidManifest.
*
* @param nx AndroidManifest {@link Nx} object
* @param componentName The component name of the broadcast
* @see ComponentName
*/
public final void writeBroadcast(Nx nx, String componentName) {
Nx receiverTag = new Nx("receiver");
receiverTag.a("android", "name", componentName);
Nx intentFilterTag = new Nx("intent-filter");
Nx actionTag = new Nx("action");
actionTag.a("android", "name", componentName);
intentFilterTag.a(actionTag);
receiverTag.a(intentFilterTag);
nx.a(receiverTag);
}
/**
* Registers a {@link Service} in AndroidManifest.
*
* @param nx AndroidManifest {@link Nx} object
* @param str The component name of the service
*/
public final void writeService(Nx nx, String str) {
Nx serviceTag = new Nx("service");
serviceTag.a("android", "name", str);
serviceTag.a("android", "enabled", "true");
nx.a(serviceTag);
}
public void setYq(yq yqVar) {
settings = new ProjectSettings(yqVar.b);
}
/**
* Builds an AndroidManifest.
*
* @return The AndroidManifest as {@link String}
*/
public String a() {
boolean addRequestLegacyExternalStorage = false;
a.a("", "package", c.a);
if (!c.a()) {
if (c.b(jq.PERMISSION_CALL_PHONE)) {
a(a, Manifest.permission.CALL_PHONE);
}
if (c.b(jq.PERMISSION_INTERNET)) {
a(a, Manifest.permission.INTERNET);
}
if (c.b(jq.PERMISSION_VIBRATE)) {
a(a, Manifest.permission.VIBRATE);
}
if (c.b(jq.PERMISSION_ACCESS_NETWORK_STATE)) {
a(a, Manifest.permission.ACCESS_NETWORK_STATE);
}
if (c.b(jq.PERMISSION_CAMERA)) {
a(a, Manifest.permission.CAMERA);
}
if (c.b(jq.PERMISSION_READ_EXTERNAL_STORAGE)) {
try {
if (Integer.parseInt(settings.getValue(ProjectSettings.SETTING_TARGET_SDK_VERSION, "28")) >= 28) {
addRequestLegacyExternalStorage = true;
}
} catch (NumberFormatException ignored) {
}
a(a, Manifest.permission.READ_EXTERNAL_STORAGE);
}
if (c.b(jq.PERMISSION_WRITE_EXTERNAL_STORAGE)) {
a(a, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
if (c.b(jq.PERMISSION_RECORD_AUDIO)) {
a(a, Manifest.permission.RECORD_AUDIO);
}
if (c.b(jq.PERMISSION_BLUETOOTH)) {
a(a, Manifest.permission.BLUETOOTH);
}
if (c.b(jq.PERMISSION_BLUETOOTH_ADMIN)) {
a(a, Manifest.permission.BLUETOOTH_ADMIN);
}
if (c.b(jq.PERMISSION_ACCESS_FINE_LOCATION)) {
a(a, Manifest.permission.ACCESS_FINE_LOCATION);
}
}
if (FileUtil.isExistFile(fpu.getPathPermission(c.sc_id))) {
for (String s : frc.getPermissionList()) {
a(a, s);
}
}
ConstVarManifest.handlePermissionComponent(a, c.x);
AndroidManifestInjector.getP(a, c.sc_id);
Nx applicationTag = new Nx("application");
applicationTag.a("android", "allowBackup", "true");
applicationTag.a("android", "label", "@string/app_name");
if (addRequestLegacyExternalStorage) {
applicationTag.a("android", "requestLegacyExternalStorage", "true");
}
applicationTag.a("android", "icon", "@drawable/app_icon");
if (!buildSettings.getValue(BuildSettings.SETTING_NO_HTTP_LEGACY, BuildSettings.SETTING_GENERIC_VALUE_FALSE)
.equals(BuildSettings.SETTING_GENERIC_VALUE_TRUE)) {
applicationTag.a("android", "usesCleartextTraffic", "true");
}
if (c.f) {
applicationTag.a("android", "name",
settings.getValue(ProjectSettings.SETTING_APPLICATION_CLASS, ".SketchApplication"));
}
AndroidManifestInjector.getAppAttrs(applicationTag, c.sc_id);
for (ProjectFileBean projectFileBean : b) {
if (!projectFileBean.fileName.contains("_fragment")) {
Nx activityTag = new Nx("activity");
String javaName = projectFileBean.getJavaName();
activityTag.a("android", "name", "." + javaName.substring(0, javaName.indexOf(".java")));
if (!AndroidManifestInjector.getActivityAttrs(activityTag, c.sc_id, projectFileBean.getJavaName())) {
activityTag.a("android", "configChanges", "orientation|screenSize|keyboardHidden|smallestScreenSize|screenLayout");
activityTag.a("android", "hardwareAccelerated", "true");
activityTag.a("android", "supportsPictureInPicture", "true");
}
if (!AndroidManifestInjector.isActivityThemeUsed(activityTag, c.sc_id, projectFileBean.getJavaName())) {
if (c.g) {
if (projectFileBean.hasActivityOption(2)) {
activityTag.a("android", "theme", "@style/AppTheme.FullScreen");
}
} else if (projectFileBean.hasActivityOption(ProjectFileBean.PROJECT_FILE_TYPE_DRAWER)) {
if (projectFileBean.hasActivityOption(ProjectFileBean.OPTION_ACTIVITY_TOOLBAR)) {
activityTag.a("android", "theme", "@style/NoStatusBar");
} else {
activityTag.a("android", "theme", "@style/FullScreen");
}
} else if (!projectFileBean.hasActivityOption(ProjectFileBean.OPTION_ACTIVITY_TOOLBAR)) {
activityTag.a("android", "theme", "@style/NoActionBar");
}
}
if (!AndroidManifestInjector.isActivityOrientationUsed(activityTag, c.sc_id, projectFileBean.getJavaName())) {
int orientation = projectFileBean.orientation;
if (orientation == ProjectFileBean.ORIENTATION_PORTRAIT) {
activityTag.a("android", "screenOrientation", "portrait");
} else if (orientation == ProjectFileBean.ORIENTATION_LANDSCAPE) {
activityTag.a("android", "screenOrientation", "landscape");
}
}
f(activityTag);
if (!AndroidManifestInjector.isActivityKeyboardUsed(activityTag, c.sc_id, projectFileBean.getJavaName())) {
String keyboardSetting = vq.a(projectFileBean.keyboardSetting);
if (keyboardSetting.length() > 0) {
activityTag.a("android", "windowSoftInputMode", keyboardSetting);
}
}
if (projectFileBean.fileName.equals(AndroidManifestInjector.getLauncherActivity(c.sc_id))) {
Nx intentFilterTag = new Nx("intent-filter");
Nx actionTag = new Nx("action");
actionTag.a("android", "name", Intent.ACTION_MAIN);
intentFilterTag.a(actionTag);
Nx categoryTag = new Nx("category");
categoryTag.a("android", "name", Intent.CATEGORY_LAUNCHER);
intentFilterTag.a(categoryTag);
activityTag.a(intentFilterTag);
}
applicationTag.a(activityTag);
}
}
if (c.f) {
Nx activityTag = new Nx("activity");
activityTag.a("android", "name", ".DebugActivity");
activityTag.a("android", "screenOrientation", "portrait");
applicationTag.a(activityTag);
}
if (c.l) {
Nx activityTag = new Nx("activity");
activityTag.a("android", "name", "com.google.android.gms.ads.AdActivity");
activityTag.a("android", "configChanges", "keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize");
activityTag.a("android", "theme", "@android:style/Theme.Translucent");
applicationTag.a(activityTag);
}
if (c.h || c.l || c.m) {
e(applicationTag);
}
if (c.h) {
b(applicationTag);
}
if (c.u) {
a(applicationTag);
}
if (c.m) {
c(applicationTag);
}
ConstVarManifest.handleBgTaskComponent(applicationTag, c.x);
if (FileUtil.isExistFile(fpu.getManifestJava(c.sc_id))) {
ArrayList<HashMap<String, Object>> activityAttrs = getActivityAttrs();
for (String s : frc.getJavaManifestList()) {
writeJava(applicationTag, s, activityAttrs);
}
}
if (buildSettings.getValue(BuildSettings.SETTING_NO_HTTP_LEGACY, BuildSettings.SETTING_GENERIC_VALUE_FALSE)
.equals(BuildSettings.SETTING_GENERIC_VALUE_FALSE)) {
d(applicationTag);
}
if (FileUtil.isExistFile(fpu.getManifestService(c.sc_id))) {
for (String s : frc.getServiceManifestList()) {
writeService(applicationTag, s);
}
}
if (FileUtil.isExistFile(fpu.getManifestBroadcast(c.sc_id))) {
for (String s : frc.getBroadcastManifestList()) {
writeBroadcast(applicationTag, s);
}
}
a.a(applicationTag);
return AndroidManifestInjector.mHolder(a.b(), c.sc_id);
}
public final void writeJava(Nx nx, String activityName, ArrayList<HashMap<String, Object>> arrayList) {
Nx activityTag = new Nx("activity");
boolean specifiedActivityName = false;
boolean specifiedConfigChanges = false;
for (HashMap<String, Object> hashMap : arrayList) {
if (hashMap.containsKey("name") && hashMap.containsKey("value")) {
Object nameObject = hashMap.get("name");
Object valueObject = hashMap.get("value");
if (nameObject instanceof String && valueObject instanceof String) {
String name = nameObject.toString();
String value = valueObject.toString();
if (name.equals(activityName)) {
activityTag.b(value);
if (value.contains("android:name=")) {
specifiedActivityName = true;
} else if (value.contains("android:configChanges=")) {
specifiedConfigChanges = true;
}
}
}
}
}
if (!specifiedActivityName) {
activityTag.a("android", "name", activityName);
}
if (!specifiedConfigChanges) {
activityTag.a("android", "configChanges", "orientation|screenSize");
}
nx.a(activityTag);
}
public ArrayList<HashMap<String, Object>> getActivityAttrs() {
String activityAttributesPath = FileUtil.getExternalStorageDir().concat("/.sketchware/data/").concat(c.sc_id).concat("/Injection/androidmanifest/attributes.json");
if (FileUtil.isExistFile(activityAttributesPath)) {
try {
return new Gson().fromJson(FileUtil.readFile(activityAttributesPath), Helper.TYPE_MAP_LIST);
} catch (Exception ignored) {
}
}
return new ArrayList<>();
}
}
| [
"40118124+JavkhlanK@users.noreply.github.com"
] | 40118124+JavkhlanK@users.noreply.github.com |
75affd081a0ee0846cb5bf89628af134963b0e83 | 7e6ffe33851173968c33936d7db54e01c9e612f6 | /src/GenericError.java | 2b33df6832165984f58505b9eb16e090bff25621 | [] | no_license | zebaslam/Custom-Tree-API | babaeda4374b66c8af7756511512ad95ebd06c72 | 48dffb6c95ae53c3d422ddf0be0541423b582e48 | refs/heads/master | 2020-12-11T05:55:20.902749 | 2014-01-11T06:57:04 | 2014-01-11T06:57:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | /**
* A generic Exception handling class used to handle various exceptions within this assignment
* @author Zeb Aslam 108041523
*
*/
public class GenericError extends Error {
//used this to satisfy compiler
private static final long serialVersionUID = -6690154863361458021L;
/**
* The constructor takes in a string that will be used to generate the error message using the super constructor from the error class.
* @param x -The value that the message will have
*/
public GenericError(String x){
super(x);
}
}
| [
"oblivionlionheart724@gmail.com"
] | oblivionlionheart724@gmail.com |
7d99cbfbfc3c73dcc5fa7d624d52a5c0f3184629 | d7c5121237c705b5847e374974b39f47fae13e10 | /airspan.netspan/src/main/java/Netspan/NBI_15_5/Server/CtsGetResponse.java | 849c93e727ee0c980170836701141fbeb0e6803d | [] | no_license | AirspanNetworks/SWITModules | 8ae768e0b864fa57dcb17168d015f6585d4455aa | 7089a4b6456621a3abd601cc4592d4b52a948b57 | refs/heads/master | 2022-11-24T11:20:29.041478 | 2020-08-09T07:20:03 | 2020-08-09T07:20:03 | 184,545,627 | 1 | 0 | null | 2022-11-16T12:35:12 | 2019-05-02T08:21:55 | Java | UTF-8 | Java | false | false | 1,568 | java |
package Netspan.NBI_15_5.Server;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="CtsGetResult" type="{http://Airspan.Netspan.WebServices}CtsGetResult" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"ctsGetResult"
})
@XmlRootElement(name = "CtsGetResponse")
public class CtsGetResponse {
@XmlElement(name = "CtsGetResult")
protected CtsGetResult ctsGetResult;
/**
* Gets the value of the ctsGetResult property.
*
* @return
* possible object is
* {@link CtsGetResult }
*
*/
public CtsGetResult getCtsGetResult() {
return ctsGetResult;
}
/**
* Sets the value of the ctsGetResult property.
*
* @param value
* allowed object is
* {@link CtsGetResult }
*
*/
public void setCtsGetResult(CtsGetResult value) {
this.ctsGetResult = value;
}
}
| [
"build.Airspan.com"
] | build.Airspan.com |
ae1d15adb6370006036e5e1b56302b7da07d0469 | 071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495 | /corpus/norm-class/tomcat70/307.java | fd814fe5c3cbd2d5bf1b0aea03acb714e3961bcc | [
"MIT"
] | permissive | masud-technope/ACER-Replication-Package-ASE2017 | 41a7603117f01382e7e16f2f6ae899e6ff3ad6bb | cb7318a729eb1403004d451a164c851af2d81f7a | refs/heads/master | 2021-06-21T02:19:43.602864 | 2021-02-13T20:44:09 | 2021-02-13T20:44:09 | 187,748,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | licensed apache software foundation asf contributor license agreements notice file distributed work additional copyright ownership asf licenses file apache license version license file compliance license copy license http apache org licenses license required applicable law agreed writing software distributed license distributed basis warranties conditions kind express implied license specific language governing permissions limitations license org apache util java input stream inputstream tester suppress warnings suppresswarnings unused test a testa input stream inputstream param string param suppress warnings suppresswarnings unused test a testa param string param suppress warnings suppresswarnings unused test b testb input stream inputstream param string param suppress warnings suppresswarnings unused test b testb param string param suppress warnings suppresswarnings unused test c testc param suppress warnings suppresswarnings unused test d testd string param | [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
da4d640b912675affc78576972077f0fadf9ddff | acb78a78fff1c2a75d0e159c9f8d6a619872cc91 | /src/whitehole/smg/DemoObject.java | def997e41a22894fb8ab02925c19fdaeba9da01e | [] | no_license | DJRolls/Whitehole | 042da75183d522ff9e1371924399d947ed30dba0 | f63fe72fdd5533d5277662b8925557c3335f88a1 | refs/heads/master | 2023-01-04T17:31:28.191977 | 2020-11-03T10:54:17 | 2020-11-03T10:54:17 | 301,265,131 | 1 | 0 | null | 2020-10-05T01:35:49 | 2020-10-05T01:33:48 | null | UTF-8 | Java | false | false | 5,548 | java | /*
Copyright 2012 The Whitehole team
This file is part of Whitehole.
Whitehole is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
Whitehole 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with Whitehole. If not, see http://www.gnu.org/licenses/.
*/
package whitehole.smg;
import whitehole.PropertyGrid;
import whitehole.vectors.Vector3;
public class DemoObject extends LevelObject
{
public DemoObject(ZoneArchive zone, String filepath, Bcsv.Entry entry)
{
this.zone = zone;
String[] stuff = filepath.split("/");
directory = stuff[0];
layer = stuff[1].toLowerCase();
file = stuff[2];
data = entry;
name = (String)data.get("TimeSheetName");
loadDBInfo();
renderer = null;
uniqueID = -1;
position = new Vector3((float)data.get("pos_x"), (float)data.get("pos_y"), (float)data.get("pos_z"));
rotation = new Vector3((float)data.get("dir_x"), (float)data.get("dir_y"), (float)data.get("dir_z"));
scale = new Vector3((float)data.get("scale_x"), (float)data.get("scale_y"), (float)data.get("scale_z"));
}
public DemoObject(ZoneArchive zone, String filepath, int game, String objname, Vector3 pos)
{
this.zone = zone;
String[] stuff = filepath.split("/");
directory = stuff[0];
layer = stuff[1].toLowerCase();
file = stuff[2];
data = new Bcsv.Entry();
name = objname;
loadDBInfo();
renderer = null;
uniqueID = -1;
position = pos;
rotation = new Vector3(0f, 0f, 0f);
scale = new Vector3(1f, 1f, 1f);
data.put("name", name);
data.put("pos_x", position.x); data.put("pos_y", position.y); data.put("pos_z", position.z);
data.put("dir_x", rotation.x); data.put("dir_y", rotation.y); data.put("dir_z", rotation.z);
data.put("scale_x", scale.x); data.put("scale_y", scale.y); data.put("scale_z", scale.z);
data.put("SW_APPEAR", -1);
data.put("SW_DEAD", -1);
data.put("SW_A", -1);
data.put("SW_B", -1);
if (game == 2)
data.put("SW_AWAKE", -1);
else
data.put("SW_SLEEP", -1);
data.put("l_id", 0);
data.put("name", 0);
data.put("DemoName", 0);
data.put("TimeSheetName", 0);
data.put("DemoSkip", 0);
}
@Override
public void save()
{
data.put("name", name);
data.put("pos_x", position.x); data.put("pos_y", position.y); data.put("pos_z", position.z);
data.put("dir_x", rotation.x); data.put("dir_y", rotation.y); data.put("dir_z", rotation.z);
data.put("scale_x", scale.x); data.put("scale_y", scale.y); data.put("scale_z", scale.z);
}
@Override
public void getProperties(PropertyGrid panel)
{
panel.addCategory("obj_position", "Position");
panel.addField("pos_x", "X position", "float", null, position.x);
panel.addField("pos_y", "Y position", "float", null, position.y);
panel.addField("pos_z", "Z position", "float", null, position.z);
panel.addField("dir_x", "X rotation", "float", null, rotation.x);
panel.addField("dir_y", "Y rotation", "float", null, rotation.y);
panel.addField("dir_z", "Z rotation", "float", null, rotation.z);
panel.addField("scale_x", "X scale", "float", null, scale.x);
panel.addField("scale_y", "Y scale", "float", null, scale.y);
panel.addField("scale_z", "Z scale", "float", null, scale.z);
panel.addCategory("obj_eventinfo", "Event IDs");
panel.addField("SW_APPEAR", "SW_APPEAR", "int", null, data.get("SW_APPEAR"));
panel.addField("SW_DEAD", "SW_DEAD", "int", null, data.get("SW_DEAD"));
panel.addField("SW_A", "SW_A", "int", null, data.get("SW_A"));
panel.addField("SW_B", "SW_B", "int", null, data.get("SW_B"));
if (zone.gameMask == 2)
panel.addField("SW_AWAKE", "SW_AWAKE", "int", null, data.get("SW_AWAKE"));
else
panel.addField("SW_SLEEP", "SW_SLEEP", "int", null, data.get("SW_SLEEP"));
panel.addCategory("obj_objinfo", "Object settings");
panel.addField("l_id", "Object ID", "int", null, data.get("l_id"));
panel.addField("name", "Name", "int", null, data.get("Name"));
panel.addField("DemoName", "DemoName", "int", null, data.get("DemoName"));
panel.addField("TimeSheetName", "TimeSheetName", "int", null, data.get("TimeSheetName"));
panel.addField("DemoSkip", "DemoSkip", "int", null, data.get("DemoSkip"));
}
/*@Override
public void render(GLRenderer.RenderInfo info)
{
// TODO some good rendering?
}*/
@Override
public String toString()
{
String l = layer.equals("common") ? "Common" : "Layer"+layer.substring(5).toUpperCase();
return dbInfo.name + " [" + l + "]";
}
}
| [
"Superninja16@comcast.net"
] | Superninja16@comcast.net |
5266bd396e9cb1420397abc8e0dad7a51ce8a9db | 6141823cac3e32036e711e0063ffb4b7ad2d809e | /ExamenTPJunio/Practica6/src/es/ucm/fdi/tp/basecode/bgame/model/FiniteRectBoard.java | fda76dbec974c324b5e1722d5ef080eb0e310be5 | [] | no_license | Nhala86/ExamenTP | 1665e254952e7b2fed38364cd98a4d0127daa70a | 5e5763b9dd4c7ed1147602208626c2472d084658 | refs/heads/master | 2020-04-06T07:10:57.873463 | 2016-08-25T11:02:09 | 2016-08-25T11:02:09 | 63,145,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,807 | java | package es.ucm.fdi.tp.basecode.bgame.model;
/**
* An implementation of a finite rectangular board.
*
* <p>
* Implementacion de un tablero rectangular de dimensión finita.
*
*/
public class FiniteRectBoard extends BasicBoard {
private static final long serialVersionUID = 1L;
/**
* The internal representation of the board. Simply a matrix of objects of
* type {@link Piece}.
*
* <p>
* Representacion interna del tablero: una matriz de objetos de tipo
* {@link Piece}.
*/
private Piece[][] board;
/**
* The number of occupied cells in the board.
*
* <p>
* Numero de casillas ocupadas en el tablero.
*/
private int occupied;
/**
* The number of cells in the board -- {@code rows*cols}. Just to avoid
* recalculating the value, etc.
*
* <p>
* Numero total de casillas en el tablero --{@code rows*cols}. Se utiliza
* para evitar recalcular el valor.
*/
private int numOfCells;
/**
* Number of columns in the board.
* <p>
* Numero de columnas del tablero.
*/
private int cols;
/**
* Number of rows in the board.
* <p>
* Numero de filas del tablero.
*/
private int rows;
/**
* This constructor constructs a finite rectangular board of a given
* dimension.
*
* <p>
* Construye un tablero rectangular finito de una dimension determinada.
*
* @param rows
* Number of rows.
* <p>
* Numero de filas.
* @param cols
* Number of columns.
* <p>
* Numero de columnas.
*/
public FiniteRectBoard(int rows, int cols) {
if (rows <= 0 || cols <= 0) {
throw new GameError("Invalid finte rectangular board size (" + rows + "," + cols + ")");
}
this.rows = rows;
this.cols = cols;
board = new Piece[rows][cols];
occupied = 0;
numOfCells = rows * cols;
}
@Override
public void setPosition(int row, int col, Piece p) {
if (row < 0 || row >= rows || col < 0 || col >= cols) {
throw new GameError("Trying to access an invalid position (" + row + "," + col + ")");
}
Piece q = board[row][col]; // we get the current piece at position
// (row,col) just to correctly update the
// number of occupied cells.
if (p == null && q != null)
occupied--;
else if (p != null && q == null)
occupied++;
board[row][col] = p;
}
@Override
public Piece getPosition(int row, int col) {
if (row < 0 || row >= rows || col < 0 || col >= cols) {
throw new GameError("Trying to access an invalid position (" + row + "," + col + ")");
}
return board[row][col];
}
@Override
public int getRows() {
return rows;
}
@Override
public int getCols() {
return cols;
}
private void copyTo(FiniteRectBoard newboard) {
// ask the super class to copy its stuff first.
super.copyTo(newboard);
// copy the actual board
newboard.board = new Piece[rows][cols];
for (int i = 0; i < rows; i++)
for (int j = 0; j < cols; j++)
newboard.board[i][j] = board[i][j];
newboard.cols = cols;
newboard.rows = rows;
// copy cell count information
newboard.occupied = occupied;
newboard.numOfCells = numOfCells;
}
@Override
public Board copy() {
FiniteRectBoard newboard = new FiniteRectBoard(rows, cols);
copyTo(newboard);
return newboard;
}
@Override
public boolean isFull() {
return occupied == numOfCells;
}
@Override
public boolean isEmpty() {
return occupied == 0;
}
/**
* Generates a string that represents the board. The symbols used to print
* the board are the first characters of the piece identifier.
*
* <p>
* Genera un string que representa el tablero. El simbolo utilizado para
* cada ficha es el primer caracter de su id.
*
* @return A string representation of the board.
*/
@Override
public String toString() {
StringBuilder render = new StringBuilder();
int height = getRows();
int width = getCols();
for (int r = 0; r < height; ++r) {
render.append(" +");
for (int c = 0; c < width; ++c)
render.append("---+");
render.append("\n");
render.append("" + (r % 10) + " |");
for (int c = 0; c < width; ++c) {
if (getPosition(r, c) == null) {
render.append(" |");
} else {
render.append(" " + getPosition(r, c).toString().charAt(0) + " |");
}
} // for columns
render.append("\n");
} // for rows
render.append(" +");
for (int c = 0; c < width; ++c)
render.append("---+");
render.append("\n");
render.append(" ");
for (int c = 0; c < width; ++c)
render.append(" " + (c % 10) + " ");
render.append("\n");
return render.toString();
}
}
| [
"lidiga03@ucm.es"
] | lidiga03@ucm.es |
8f3bab8be88c6e30aa5615371e150dd84602c026 | 7559bead0c8a6ad16f016094ea821a62df31348a | /src/com/vmware/vim25/VmAutoRenameEvent.java | 82f3a929305a7f33b714e6c112665422380b4e9d | [] | no_license | ZhaoxuepengS/VsphereTest | 09ba2af6f0a02d673feb9579daf14e82b7317c36 | 59ddb972ce666534bf58d84322d8547ad3493b6e | refs/heads/master | 2021-07-21T13:03:32.346381 | 2017-11-01T12:30:18 | 2017-11-01T12:30:18 | 109,128,993 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,038 | java |
package com.vmware.vim25;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for VmAutoRenameEvent complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="VmAutoRenameEvent">
* <complexContent>
* <extension base="{urn:vim25}VmEvent">
* <sequence>
* <element name="oldName" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="newName" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VmAutoRenameEvent", propOrder = {
"oldName",
"newName"
})
public class VmAutoRenameEvent
extends VmEvent
{
@XmlElement(required = true)
protected String oldName;
@XmlElement(required = true)
protected String newName;
/**
* Gets the value of the oldName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getOldName() {
return oldName;
}
/**
* Sets the value of the oldName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setOldName(String value) {
this.oldName = value;
}
/**
* Gets the value of the newName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewName() {
return newName;
}
/**
* Sets the value of the newName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewName(String value) {
this.newName = value;
}
}
| [
"495149700@qq.com"
] | 495149700@qq.com |
5572967597cc81a3371f500bad8bad9d2d9f43c9 | 8526b8ef292657e24d72571905a5f56ec1a2ff2f | /core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableFilterToCalcRule.java | db260a011f9b7c6e89c75268e2e9552df5433235 | [
"Apache-2.0",
"MIT"
] | permissive | jh3507/calcite | cac7e8f08ddefe7e80f12d97d842a6bc1f0d8938 | 532f903fe495d741053619c13a51537e57dcd619 | refs/heads/master | 2021-06-27T17:43:24.208096 | 2020-10-03T23:33:29 | 2020-10-07T17:49:59 | 162,769,449 | 2 | 1 | Apache-2.0 | 2018-12-22T00:32:51 | 2018-12-22T00:32:51 | null | UTF-8 | Java | false | false | 2,911 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.calcite.adapter.enumerable;
import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.plan.RelRule;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rex.RexBuilder;
import org.apache.calcite.rex.RexProgram;
import org.apache.calcite.rex.RexProgramBuilder;
import org.apache.calcite.tools.RelBuilderFactory;
/** Variant of {@link org.apache.calcite.rel.rules.FilterToCalcRule} for
* {@link org.apache.calcite.adapter.enumerable.EnumerableConvention enumerable calling convention}.
*
* @see EnumerableRules#ENUMERABLE_FILTER_TO_CALC_RULE */
public class EnumerableFilterToCalcRule
extends RelRule<EnumerableFilterToCalcRule.Config> {
/** Creates an EnumerableFilterToCalcRule. */
protected EnumerableFilterToCalcRule(Config config) {
super(config);
}
@Deprecated // to be removed before 2.0
public EnumerableFilterToCalcRule(RelBuilderFactory relBuilderFactory) {
this(Config.DEFAULT.withRelBuilderFactory(relBuilderFactory)
.as(Config.class));
}
@Override public void onMatch(RelOptRuleCall call) {
final EnumerableFilter filter = call.rel(0);
final RelNode input = filter.getInput();
// Create a program containing a filter.
final RexBuilder rexBuilder = filter.getCluster().getRexBuilder();
final RelDataType inputRowType = input.getRowType();
final RexProgramBuilder programBuilder =
new RexProgramBuilder(inputRowType, rexBuilder);
programBuilder.addIdentity();
programBuilder.addCondition(filter.getCondition());
final RexProgram program = programBuilder.getProgram();
final EnumerableCalc calc = EnumerableCalc.create(input, program);
call.transformTo(calc);
}
/** Rule configuration. */
public interface Config extends RelRule.Config {
Config DEFAULT = EMPTY
.withOperandSupplier(b ->
b.operand(EnumerableFilter.class).anyInputs())
.as(Config.class);
@Override default EnumerableFilterToCalcRule toRule() {
return new EnumerableFilterToCalcRule(this);
}
}
}
| [
"jhyde@apache.org"
] | jhyde@apache.org |
239172c388e1524ac9b177a874dcc6ecf1886052 | ef6e6c17f857d04c5f92c7795b699379fa9897c4 | /Javahe HTTP Web Server Asynchr -1.0.0/src/Server.java | 75748d115f95bc6e405f746b4107bef3e36228a1 | [] | no_license | yvelikov/Java-Web-Fundamentals | d405b859280ce8f8daa616e98bee66fd3e89f0b8 | fcff8e2580e0d94f2a1ee6b294c48130b6b0f82a | refs/heads/master | 2021-05-10T11:17:37.564641 | 2018-02-22T06:05:38 | 2018-02-22T06:05:38 | 118,407,874 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,121 | java | import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.concurrent.FutureTask;
public class Server {
private int port;
private int timeouts;
private ServerSocket server;
public Server(int port) {
this.port = port;
this.timeouts = 0;
}
public void run() throws IOException {
this.server = new ServerSocket(this.port);
this.server.setSoTimeout(5000);
System.out.println("Listening on port: " + this.port);
while(true) {
try(Socket clientSocket = this.server.accept()) {
clientSocket.setSoTimeout(5000);
System.out.println("Client connected: " + clientSocket.getPort());
RequestHandler requestHandler = new RequestHandler(clientSocket);
FutureTask<?> task = new FutureTask<>(requestHandler, null);
task.run();
} catch(SocketTimeoutException e) {
System.out.println("Timeout detected!");
this.timeouts++;
}
}
}
} | [
"Powerslave#88"
] | Powerslave#88 |
8df8497d9c28605a35ed0ff29e6f97d3a356bb1f | c374fd6fa69c7dc002f67ba957525469d7c471a8 | /SQLite/obj/Debug/android/sqlite/sqlite/R.java | 5d557e1d2fd68cc59441edb4e81413f32c1e7923 | [] | no_license | rahul51193/SQLite | 83fdf4fe2855eaa3036ba2c01890e783cd7ce985 | 061dc629c514a379ab538a03eb46a4452260f07f | refs/heads/master | 2021-08-22T05:55:05.415925 | 2017-11-29T12:12:46 | 2017-11-29T12:12:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,500 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package sqlite.sqlite;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
public static final int rescyou=0x7f020001;
public static final int rescyoularge=0x7f020002;
}
public static final class id {
public static final int btn_reg_create=0x7f060008;
public static final int btnlogin=0x7f060004;
public static final int btnregister=0x7f060005;
public static final int textView1=0x7f060001;
public static final int txt_reg_password=0x7f060007;
public static final int txt_reg_username=0x7f060006;
public static final int txtpwd=0x7f060003;
public static final int txtusername=0x7f060002;
public static final int welcomeMesssage=0x7f060000;
}
public static final class integer {
public static final int google_play_services_version=0x7f040000;
}
public static final class layout {
public static final int home=0x7f030000;
public static final int main=0x7f030001;
public static final int newuser=0x7f030002;
}
public static final class string {
public static final int ApplicationName=0x7f050001;
public static final int Hello=0x7f050000;
}
}
| [
"suhas.shetty@galepartners.com"
] | suhas.shetty@galepartners.com |
c9cb3ff2e1d76088c119d93367471a50ca1278c4 | 8583886aef23ff8b2b611a6c6bd70e691b845ad0 | /RabbitRssReader/src/com/jackey/android/rss/model/RssSite.java | 6c730cb8066f2da15634259292cf80d94e5fb05e | [] | no_license | hejackey/heproject | 9f596c7e5f4d57d4f7aa1661a3314a313c965fd3 | 3efad5550a9d7500b808d0d8cc7d384267ef2785 | refs/heads/master | 2016-09-05T09:16:55.396484 | 2012-09-06T16:13:45 | 2012-09-06T16:13:45 | 41,244,232 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.jackey.android.rss.model;
public class RssSite {
private String title;
private String url;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
| [
"xiaohu0901@hotmail.com"
] | xiaohu0901@hotmail.com |
bbc889b374c2236416b26531abc2948171f67c83 | b7581364a567f3720ae22d9bac4ad1e726b7ed44 | /Stage4/bootgiftsec_springboot/service/src/test/java/com/epam/esm/common_service/TestConfig.java | a5584514f6f602225d30a04fae1f53784708e59e | [] | no_license | romanoidprg/MJC_School | bd9197be81fca7ccb0e8a9a42c84074ecf1cb6ae | a327f5b465bd5cfcc8fbf0cbfd4532d4175d8637 | refs/heads/main | 2023-06-26T00:02:44.501317 | 2021-08-01T17:04:50 | 2021-08-01T17:04:50 | 371,099,505 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,999 | java | package com.epam.esm.common_service;
import com.epam.esm.common_service.impl.CertRepoService;
import com.epam.esm.common_service.impl.OrderRepoService;
import com.epam.esm.common_service.impl.TagRepoService;
import com.epam.esm.common_service.impl.UserRepoService;
import com.epam.esm.dao.CertRepo;
import com.epam.esm.dao.CommonDao;
import com.epam.esm.dao.CustomCertDao;
import com.epam.esm.dao.CustomTagDao;
import com.epam.esm.dao.OrderRepo;
import com.epam.esm.dao.TagRepo;
import com.epam.esm.dao.UserRepo;
import com.epam.esm.model.CertCriteria;
import com.epam.esm.model.GiftCertificate;
import com.epam.esm.model.Order;
import com.epam.esm.model.OrderCriteria;
import com.epam.esm.model.Tag;
import com.epam.esm.model.TagCriteria;
import com.epam.esm.model.User;
import com.epam.esm.model.UserCriteria;
import org.aspectj.weaver.ast.Or;
import org.hibernate.SessionFactory;
import org.hibernate.internal.SessionFactoryImpl;
import org.mockito.Mockito;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import javax.jws.soap.SOAPBinding;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import static org.mockito.ArgumentMatchers.*;
@SpringBootConfiguration
public class TestConfig {
// @Bean
// public SessionFactory sessionFactory() {
// SessionFactory sf = Mockito.mock(SessionFactoryImpl.class);
// return sf;
// }
@Bean
public CommonService<GiftCertificate> certRepoService() {
return new CertRepoService();
}
@Bean
public CustomCertService customCertRepoService() {
return new CertRepoService();
}
@Bean
public CommonService<User> userRepoService() {
return new UserRepoService();
}
@Bean
public CommonService<Order> orderRepoService() {
return new OrderRepoService();
}
@Bean
public CommonService<Tag> tagRepoService() {
return new TagRepoService();
}
@Bean
public CustomTagService customTagRepoService() {
return new TagRepoService();
}
@Bean
public CertRepo certRepo() {
GiftCertificate cert = new GiftCertificate();
GiftCertificate cert1 = new GiftCertificate();
cert.setId(1L);
cert1.setId(1L);
CertRepo mockCertRepo = Mockito.mock(CertRepo.class);
Mockito.when(mockCertRepo.save(any())).thenReturn(cert);
Mockito.when(mockCertRepo.exists(any())).thenReturn(false);
Mockito.when(mockCertRepo.findById(anyLong())).thenReturn(Optional.of(cert));
Mockito.when(mockCertRepo.findByNameContainingAndDescriptionContainingAndTagsNameContaining(any(), any(), any(), any()))
.thenReturn(new PageImpl<>(Arrays.asList(cert, cert1)));
return mockCertRepo;
}
@Bean
public TagRepo tagRepo() {
Tag tag = new Tag();
tag.setId(1L);
Tag tag1 = new Tag();
tag1.setId(1L);
TagRepo mockTagRepo = Mockito.mock(TagRepo.class);
Mockito.when(mockTagRepo.save(any())).thenReturn(tag);
Mockito.when(mockTagRepo.exists(any())).thenReturn(false);
Mockito.when(mockTagRepo.findById(anyLong())).thenReturn(Optional.of(new Tag()));
Mockito.when(mockTagRepo.findAll(any(),any(Pageable.class)))
.thenReturn(new PageImpl<>(Arrays.asList(tag,tag1)));
Mockito.when(mockTagRepo.getIdOfMostUsefullTagByUserId(anyLong())).thenReturn(Arrays.asList(1L,2L));
return mockTagRepo;
}
@Bean
public OrderRepo orderRepo() {
Order order = new Order();
Order order1 = new Order();
order.setId(1L);
order1.setId(1L);
OrderRepo mockOrderRepo = Mockito.mock(OrderRepo.class);
Mockito.when(mockOrderRepo.save(any())).thenReturn(order);
Mockito.when(mockOrderRepo.exists(any())).thenReturn(false);
Mockito.when(mockOrderRepo.findById(anyLong())).thenReturn(Optional.of(new Order()));
Mockito.when(mockOrderRepo.findAll(any(),any(Pageable.class)))
.thenReturn(new PageImpl<>(Arrays.asList(order,order1)));
return mockOrderRepo;
}
@Bean
public UserRepo userRepo () {
User user = new User();
User user1 = new User();
user.setId(1L);
user1.setId(1L);
UserRepo mockUserRepo = Mockito.mock(UserRepo.class);
Mockito.when(mockUserRepo.save(any())).thenReturn(user);
Mockito.when(mockUserRepo.exists(any())).thenReturn(false);
Mockito.when(mockUserRepo.findById(anyLong())).thenReturn(Optional.of(new User()));
Mockito.when(mockUserRepo.findAll(any(),any(Pageable.class)))
.thenReturn(new PageImpl<>(Arrays.asList(user,user1)));
return mockUserRepo;
}
} | [
"romanoidprg@mail.ru"
] | romanoidprg@mail.ru |
d79d41c9200bc9fc142391d9560949632a12d316 | 2f4e9d56b6c85c7de119818e6e09f01d488d26d0 | /app/src/main/java/cn/dianedun/bean/WaterChartBean.java | c8aef587f074eadd56c4c5f748cd562a56c40e3a | [] | no_license | PengLius/dianedun | 5044f42a2e368da0c8d9fad7a59d97c6da141c7b | c6ad63c9460cc8d02edbcddf8e64faf454159a66 | refs/heads/master | 2021-01-02T09:16:01.426964 | 2018-03-30T02:38:02 | 2018-03-30T02:38:02 | 99,173,413 | 0 | 2 | null | 2018-03-29T06:58:18 | 2017-08-03T00:40:00 | Java | UTF-8 | Java | false | false | 3,332 | java | package cn.dianedun.bean;
import java.util.List;
/**
* Created by Administrator on 2017/10/21.
*/
public class WaterChartBean {
/**
* code : 0
* msg : 成功
* data : {"waterList":["0","0","0","0","0","0","1","1","0","0","0","0","1","1","0","0","0","0","1","1","1","1","0","0","0","0","0","0","1","1","0","0","1","1","0","0","0","0","1","1","0","0","1","1","0","0","0","0","1","1","1","1","0","1","1","1","0","0","1","1","0","0","0","0","0","0","0","0","0","0","0","0","1","1","0","0","0","1","0","0","0","0","1","1","0","0","0","0","0","0","0","0","0","0"],"xList":["2017-09-26 00:45","2017-09-26 00:48","2017-09-26 01:15","2017-09-26 01:18","2017-09-26 01:45","2017-09-26 01:48","2017-09-26 02:15","2017-09-26 02:18","2017-09-26 02:45","2017-09-26 02:48","2017-09-26 03:15","2017-09-26 03:18","2017-09-26 03:45","2017-09-26 03:48","2017-09-26 04:15","2017-09-26 04:18","2017-09-26 04:45","2017-09-26 04:48","2017-09-26 05:15","2017-09-26 05:18","2017-09-26 06:15","2017-09-26 06:18","2017-09-26 06:45","2017-09-26 06:48","2017-09-26 07:15","2017-09-26 07:18","2017-09-26 07:45","2017-09-26 07:48","2017-09-26 08:15","2017-09-26 08:18","2017-09-26 08:45","2017-09-26 08:48","2017-09-26 09:15","2017-09-26 09:18","2017-09-26 09:45","2017-09-26 09:48","2017-09-26 10:15","2017-09-26 10:18","2017-09-26 10:45","2017-09-26 10:48","2017-09-26 11:15","2017-09-26 11:18","2017-09-26 11:45","2017-09-26 11:48","2017-09-26 12:15","2017-09-26 12:18","2017-09-26 12:45","2017-09-26 12:48","2017-09-26 13:15","2017-09-26 13:18","2017-09-26 13:45","2017-09-26 13:48","2017-09-26 14:15","2017-09-26 14:18","2017-09-26 14:45","2017-09-26 14:48","2017-09-26 15:15","2017-09-26 15:18","2017-09-26 15:45","2017-09-26 15:48","2017-09-26 16:15","2017-09-26 16:18","2017-09-26 16:45","2017-09-26 16:48","2017-09-26 17:15","2017-09-26 17:18","2017-09-26 17:45","2017-09-26 17:48","2017-09-26 18:15","2017-09-26 18:18","2017-09-26 18:45","2017-09-26 18:48","2017-09-26 19:15","2017-09-26 19:18","2017-09-26 19:45","2017-09-26 19:48","2017-09-26 20:15","2017-09-26 20:18","2017-09-26 20:45","2017-09-26 20:48","2017-09-26 21:15","2017-09-26 21:18","2017-09-26 21:45","2017-09-26 21:48","2017-09-26 22:15","2017-09-26 22:18","2017-09-26 22:45","2017-09-26 22:48","2017-09-26 23:15","2017-09-26 23:18","2017-09-26 23:45","2017-09-26 23:48","2017-09-27 00:15","2017-09-27 00:18"]}
*/
private int code;
private String msg;
private DataBean data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean {
private List<String> waterList;
private List<String> xList;
public List<String> getWaterList() {
return waterList;
}
public void setWaterList(List<String> waterList) {
this.waterList = waterList;
}
public List<String> getXList() {
return xList;
}
public void setXList(List<String> xList) {
this.xList = xList;
}
}
}
| [
"20091016xe"
] | 20091016xe |
9af736c7f68f568a03ce4f791e8ea59c2436c8b7 | 472566e5ce6bde442b996054c23fe3b7bb209454 | /src/main/java/com/fangminx/anno/AdminOnly.java | 7666847d952f5eb3d9da9c8be9137af510f453ed | [] | no_license | fangminx/execution-demo | d7c303e081e31e39feb6eb500edfd831bf6eee1a | 4a34b2de6b058c2a9ce00dc4d8239c382b6e5029 | refs/heads/master | 2021-05-16T12:06:14.287708 | 2017-09-28T16:31:35 | 2017-09-28T16:31:35 | 105,172,150 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 286 | java | package com.fangminx.anno;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface AdminOnly {
}
| [
"1261869845@qq.com"
] | 1261869845@qq.com |
4aabc31f3979005fa8c3bd9e34280b78da778078 | c8c262e04f601cdfceaeee82f29701f3d9dbc720 | /src/designpattern/combined/djview/BeatModelInterface.java | 6168bb37e255409e7b63f362cc4d0b2b58ae611b | [] | no_license | ShashiUpadhyay/DesignPatterns | 8db090d3ac9847abe5cf86bb649da57a1204ddeb | 78bb84d23b9ae733da7359db2173ba9f9fe8f536 | refs/heads/master | 2021-01-12T06:44:31.208324 | 2016-12-27T05:54:01 | 2016-12-27T05:54:01 | 77,429,663 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package designpattern.combined.djview;
public interface BeatModelInterface {
void initialize();
void on();
void off();
void setBPM(int bpm);
int getBPM();
void registerObserver(BeatObserver o);
void removeObserver(BeatObserver o);
void registerObserver(BPMObserver o);
void removeObserver(BPMObserver o);
}
| [
"supadhy2@binghamton.edu"
] | supadhy2@binghamton.edu |
0b3887906c9f1b1b87010fc50836d87a529714ea | 401c3cf04507f577bfc285da86a6af25ecea7a69 | /CoastLine 2.1/app/src/main/java/com/coastline20/activity/miaoli/tongxiao/Tongxiao3Activity.java | 1f595d9e2555d4baeff9f390ffb55d78cfc22763 | [] | no_license | SpicyBoyd/CoastLineApp | 59139e76f7fa7af8b8e55955320ee53e4ddf6578 | 8f24f63de925f4c30ac35527f7efd21f13b481b4 | refs/heads/master | 2021-09-14T09:15:35.834398 | 2018-05-11T04:24:55 | 2018-05-11T04:24:55 | 124,340,147 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,447 | java | package com.coastline20.activity.miaoli.tongxiao;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import com.coastline20.R;
import com.coastline20.entity.SpotEntity;
import com.coastline20.adapter.SpotPagerAdapter;
public class Tongxiao3Activity extends AppCompatActivity {
private CollapsingToolbarLayout toolbarLayout;
private ImageView imageView;
private Toolbar toolbar;
private TabLayout tabLayout;
private ViewPager viewPager;
private String[] titles;
private SpotEntity entity;
// Spot 修改資料的地方
private void init() {
toolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);
imageView = (ImageView) findViewById(R.id.toolbar_image);
toolbar = (Toolbar) findViewById(R.id.toolbar);
tabLayout = (TabLayout) findViewById(R.id.tab_layout);
viewPager = (ViewPager) findViewById(R.id.view_pager);
entity = new SpotEntity(
getResources(),
R.drawable.tongxiaospot3,
R.array.tongxiao_spot_name,
3,
new int[]{R.drawable.tongxiaospot3_1,
R.drawable.tongxiaospot3_2, R.drawable.tongxiaospot3_3},
R.array.tongxiao3_info,
R.array.tongxiao_spot_address);
titles = getResources().getStringArray(entity.getTabTitle());
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_spot);
init();
setToolbar();
setToolbarLayout();
setTabLayout();
setViewPager();
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
}
// 設定 CollapsingToolbarLayout
private void setToolbarLayout() {
imageView.setImageResource(entity.getToolbarImage());
toolbarLayout.setTitle(getResources().getStringArray(entity.getSpotName())[entity.getSpotNum()]);
toolbarLayout.setCollapsedTitleTextColor(Color.WHITE);
toolbarLayout.setExpandedTitleColor(Color.WHITE);
}
// 設定 Toolbar
private void setToolbar() {
setSupportActionBar(toolbar);
}
// 設定 TabLayout
private void setTabLayout() {
for (String title : titles) {
tabLayout.addTab(tabLayout.newTab().setText(title));
}
}
// 設定 ViewPager
private void setViewPager() {
SpotPagerAdapter pagerAdapter = new SpotPagerAdapter(getSupportFragmentManager(), titles, entity.getFragmentList());
viewPager.setAdapter(pagerAdapter);
tabLayout.setupWithViewPager(viewPager);
}
// 設定 FloatingActionButton
public void mapGuide(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" +
getResources().getStringArray(entity.getAddress())[entity.getSpotNum()]));
startActivity(intent);
}
}
| [
"greenyu0510@gmail.com"
] | greenyu0510@gmail.com |
fed419f9a32ca16cee08f2ea5467152a6bbb6051 | e03e04b0329a252dc5a1bb65efb271b4251deca1 | /src/test/java/io/github/incplusplus/peerprocessing/server/QueryProcessingReassignmentIT.java | 5ac8b54d1215866e26ea8f7646af30d6bcbafa69 | [
"MIT"
] | permissive | IncPlusPlus/NetProgFinalProject | 6b380b6b5c0df8af340c4ca83f5b685c97bf395e | e39d651fca9c8bf905aaac49274933719e53904d | refs/heads/master | 2020-08-28T06:46:19.633219 | 2019-12-13T05:04:50 | 2019-12-13T05:04:50 | 217,625,419 | 0 | 0 | MIT | 2020-08-19T06:47:27 | 2019-10-25T22:50:33 | Java | UTF-8 | Java | false | false | 5,507 | java | package io.github.incplusplus.peerprocessing.server;
import static io.github.incplusplus.peerprocessing.NormalIT.VERBOSE_TEST_OUTPUT;
import static io.github.incplusplus.peerprocessing.common.MiscUtils.randInt;
import io.github.incplusplus.peerprocessing.client.Client;
import io.github.incplusplus.peerprocessing.linear.BigDecimalMatrix;
import io.github.incplusplus.peerprocessing.slave.Slave;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.*;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
@Timeout(value = 5, unit = TimeUnit.MINUTES)
class QueryProcessingReassignmentIT {
private static int serverPort;
private static final Server server = new Server();
@BeforeAll
static void setUp() throws IOException {
serverPort = server.start(9999, VERBOSE_TEST_OUTPUT);
//noinspection StatementWithEmptyBody
while (!server.started()) {}
}
@AfterAll
static void tearDown() throws IOException {
server.stop();
}
@ParameterizedTest
@MethodSource("io.github.incplusplus.peerprocessing.NormalIT#provideMatrices")
void whenSlaveDisconnects_IfSlaveHeldJobs_ThenJobsGetReassigned(
BigDecimalMatrix matrix1, BigDecimalMatrix matrix2)
throws IOException, ExecutionException, InterruptedException {
FutureTask<BigDecimalMatrix> task;
try (Client myClient = new Client("localhost", serverPort)) {
ExecutorService executor = Executors.newSingleThreadExecutor();
SlaveFuzzer slaveFuzzer = new SlaveFuzzer("localhost", serverPort, 10);
myClient.setVerbose(VERBOSE_TEST_OUTPUT);
myClient.begin();
slaveFuzzer.begin();
task = myClient.multiply(matrix1, matrix2);
//noinspection StatementWithEmptyBody
while (!myClient.isPolite()) {}
executor.submit(task);
task.get();
executor.shutdown();
slaveFuzzer.stop();
}
}
private class SlaveFuzzer {
private final String hostname;
private final int portNum;
final List<Slave> slaveList = Collections.synchronizedList(new ArrayList<>());
Thread randomSlaveSlayer;
Thread randomSlaveCreator;
SlaveFuzzer(String hostname, int portNum, int initNumSlaves) {
this.hostname = hostname;
this.portNum = portNum;
for (int i = 0; i < initNumSlaves; i++) {
slaveList.add(new Slave(hostname, portNum));
}
randomSlaveSlayer =
new Thread(
() -> {
while (true) {
// If we've obviously overhunted, wait a while longer
if (slaveList.size() < initNumSlaves / 2) {
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
break;
// we could get interrupted here. It's fine
}
}
int index = randInt(1, slaveList.size());
Slave sacrificialLamb = slaveList.get(index);
// if the slave to kill hasn't introduced itself yet
// go looking somewhere else
if (!sacrificialLamb.isPolite()) continue;
try {
synchronized (slaveList) {
slaveList.remove(sacrificialLamb);
sacrificialLamb.close();
}
// Don't be constantly killing slaves or nothing will ever get done
Thread.sleep(500);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException ignored) {
break;
// we expect to be interrupted. Don't panic
}
}
});
randomSlaveSlayer.setDaemon(true);
randomSlaveSlayer.setName("Random slave slayer");
randomSlaveCreator =
new Thread(
() -> {
while (true) {
Slave newSlave = new Slave(this.hostname, this.portNum);
slaveList.add(newSlave);
try {
newSlave.begin();
// don't expand the list infinitely
Thread.sleep(500);
} catch (IOException e) {
System.out.println(
"Encountered an error in SlaveFuzzer. "
+ "This could be expected behavior. "
+ "Message below:");
System.out.println(e.toString());
} catch (InterruptedException ignored) {
break;
// we expect to be interrupted. Don't panic
}
}
});
randomSlaveCreator.setDaemon(true);
randomSlaveCreator.setName("Random slave creator");
}
void begin() throws IOException {
for (Slave i : slaveList) {
i.begin();
}
randomSlaveCreator.start();
randomSlaveSlayer.start();
}
void stop() throws IOException {
randomSlaveCreator.interrupt();
randomSlaveSlayer.interrupt();
synchronized (slaveList) {
for (Slave i : slaveList) {
i.close();
}
}
}
}
}
| [
"cloherty.ryan@gmail.com"
] | cloherty.ryan@gmail.com |
8e11d34abab13ca4cb47a751358bbdaec87fd12c | 48cf60a24eb76a141620cde3870c056419ea8d92 | /mplayer2/app/src/main/java/vip/jokor/im/model/stores_bean/MMGroup.java | b271cbb2c90e195cf1b756e7bf593301c7cff330 | [] | no_license | culturer/jokor_android | 6322e9e4d7a723852b5214568a140905491d39be | b24bc0a6cfeeebc368bac5778dfd7d34344ea8ad | refs/heads/master | 2020-12-20T18:02:16.823472 | 2020-02-05T18:46:06 | 2020-02-05T18:46:06 | 236,161,750 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,596 | java | package vip.jokor.im.model.stores_bean;
public class MMGroup {
//群聊
/**
* id : 3
* UserId : 29
* Icon : img_29groupIcon1552616428051
* Name : 测试群!
* Count : 1
* MaxCount : 100
* Msg : 测试介绍
* CId : 6668436802967175170
* IsVIP : false
* VIPStart : 0
* VIPEnd : 0
* IsHome : false
* HomeUrl :
* IsShop : false
* ShopId : 0
* IsChange : false
*/
private long id;
private long UserId;
private String Icon;
private String Name;
private int Count;
private int MaxCount;
private String Msg;
private long CId;
private boolean IsVIP;
private long VIPStart;
private long VIPEnd;
private boolean IsHome;
private String HomeUrl;
private boolean IsShop;
private long ShopId;
private boolean IsChange;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getUserId() {
return UserId;
}
public void setUserId(long UserId) {
this.UserId = UserId;
}
public String getIcon() {
return Icon;
}
public void setIcon(String Icon) {
this.Icon = Icon;
}
public String getName() {
return Name;
}
public void setName(String Name) {
this.Name = Name;
}
public int getCount() {
return Count;
}
public void setCount(int Count) {
this.Count = Count;
}
public int getMaxCount() {
return MaxCount;
}
public void setMaxCount(int MaxCount) {
this.MaxCount = MaxCount;
}
public String getMsg() {
return Msg;
}
public void setMsg(String Msg) {
this.Msg = Msg;
}
public long getCId() {
return CId;
}
public void setCId(long CId) {
this.CId = CId;
}
public boolean isIsVIP() {
return IsVIP;
}
public void setIsVIP(boolean IsVIP) {
this.IsVIP = IsVIP;
}
public long getVIPStart() {
return VIPStart;
}
public void setVIPStart(long VIPStart) {
this.VIPStart = VIPStart;
}
public long getVIPEnd() {
return VIPEnd;
}
public void setVIPEnd(long VIPEnd) {
this.VIPEnd = VIPEnd;
}
public boolean isIsHome() {
return IsHome;
}
public void setIsHome(boolean IsHome) {
this.IsHome = IsHome;
}
public String getHomeUrl() {
return HomeUrl;
}
public void setHomeUrl(String HomeUrl) {
this.HomeUrl = HomeUrl;
}
public boolean isIsShop() {
return IsShop;
}
public void setIsShop(boolean IsShop) {
this.IsShop = IsShop;
}
public long getShopId() {
return ShopId;
}
public void setShopId(long ShopId) {
this.ShopId = ShopId;
}
public boolean isIsChange() {
return IsChange;
}
public void setIsChange(boolean IsChange) {
this.IsChange = IsChange;
}
}
| [
"78901214@qq.com"
] | 78901214@qq.com |
2ef952a975d612abeedc538af3cd1a65e8a905b4 | f4e7f6b83f1754e3570e5846d6f6786c5090e9c7 | /src/model/common/Address.java | 241257e00ea05e4bc015481abea6556ab4d63e71 | [] | no_license | MYunFeiYang/Network_recuiting_system | f80e426ce4139bdc2cece65e4c13bbc15eb4b935 | d529965b415c95cc680d226741a0687be8e5c9c5 | refs/heads/master | 2023-01-07T00:46:22.804127 | 2019-06-10T14:06:59 | 2019-06-10T14:06:59 | 108,945,526 | 1 | 0 | null | 2023-01-03T21:01:06 | 2017-10-31T04:31:36 | JavaScript | UTF-8 | Java | false | false | 359 | java | package model.common;
public class Address {
private String href;
private String text;
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
| [
"2728363142@qq.com"
] | 2728363142@qq.com |
6ebcaa3356ebc0b28c389cc39ece56ece694bbdc | b68f17b8b89eb844dfd6c9e61ca9d839a894a0e3 | /Edu_system_v1.1/src/cn/nuist_bjxy/zhangzheng/bean/MysqlUser.java | fbdf5c5878bb228c0c2f455fcd67d471ce1cb92c | [] | no_license | user-zz/EduAS | 75111f85966a214aa0adebbf4945ce3c5ae759ee | bf7af425187bd41640fb1bc568fa24506b3f8cc7 | refs/heads/master | 2020-05-20T03:01:25.071859 | 2019-05-20T02:02:47 | 2019-05-20T02:02:47 | 185,345,210 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 678 | java | package cn.nuist_bjxy.zhangzheng.bean;
public class MysqlUser {
private String uri="jdbc:mysql://localhost/eduas_db?serverTimezone=UTC&characterEncoding=UTF-8"; //数据库地址
private String username="root"; //数据库用户名
private String password="123456"; //数据库密码
public MysqlUser() {
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"sclzzzheng@163.com"
] | sclzzzheng@163.com |
36cd09b06f0cd7ba896681db258ee3fc49696f22 | 16336a110efa22b60dfb5972f9c217d7d68c1873 | /src/main/java/com/demo/controller/EmployeeController.java | e967ce37d7921cc241819a52bef651e38ddc32e4 | [] | no_license | 1583229961/SpringMvc | fde6c62a98a1f384339a68865d2f233b8cf43368 | 60264a106b3468f6a1023fb17cd0695c1cd8be76 | refs/heads/master | 2022-12-21T12:37:38.118834 | 2019-12-13T07:30:07 | 2019-12-13T07:30:07 | 224,399,486 | 0 | 0 | null | 2022-12-16T04:24:16 | 2019-11-27T09:58:53 | Java | UTF-8 | Java | false | false | 1,278 | java | package com.demo.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.demo.Model.Employee;
import com.demo.Service.EmployeeService;
import com.demo.Service.imp.EmployeeLogin;
import ch.qos.logback.core.status.Status;
@Controller
public class EmployeeController {
@Autowired
EmployeeService employeeService;
@RequestMapping(value = "/hello.do")
public String hello(){
System.out.println("接收到请求 ,Hello");
return "hi";
}
@RequestMapping(value = "/login.do",method = RequestMethod.GET)
public String login(){
return "Login";
}
@ResponseBody
@RequestMapping(value = "/login.do",method = RequestMethod.POST)
public Employee login(@RequestBody Employee employee)
{
Employee employee1=employeeService.Login(employee.getId(),employee.getPassword());
System.out.println(employee1.getPassword());
return employee1;
}
}
| [
"49240654+1583229961@users.noreply.github.com"
] | 49240654+1583229961@users.noreply.github.com |
87d1dd44b0fe782c2ebc148d15f298c5df162090 | 95252e1c24e019b0658a46159d2374cc042640a1 | /ARCC/2015_11_19_EngineeringPrinciples/java/src/com/rwb/restaurant/BananaItem.java | 66f3e82462fed4161568b150c1d15600e4410c41 | [] | no_license | donaldsawyer/Demos | 4d89a5cf605b2ab2f05fc56f78ff1452567b7e20 | cd897b5dd7b393076a3fdd6c9950bbeccd72b6e1 | refs/heads/master | 2021-06-21T17:59:10.278854 | 2021-06-16T14:51:21 | 2021-06-16T14:51:21 | 46,322,661 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | package com.rwb.restaurant;
import com.rwb.strategies.ExemptTaxMenuItem;
/**
* Created by Donald on 11/19/2015.
*/
public class BananaItem extends ExemptTaxMenuItem
{
public BananaItem()
{
name = "Banana";
price = 0.50;
}
}
| [
"donald.sawyer@gmail.com"
] | donald.sawyer@gmail.com |
af1dfa54ed0e13a5ede653ce07ab0bc20dd52519 | 99fdff0158ad26dd3f0e2d5eda56ee5d76bb3beb | /mark/src/main/java/com/replay/limty/model/common/OrderInfo.java | 43e58085c2fd2e5edf7f936edaf1fbebac2c562d | [] | no_license | tome34/Pay | e15abef62bfa50d73d6d540bc634615851f5f74e | f515101fcececfcfe8eacd8756f65c682181d701 | refs/heads/master | 2021-01-21T20:54:20.910300 | 2017-05-24T12:32:39 | 2017-05-24T12:32:39 | 92,289,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,351 | java | package com.replay.limty.model.common;
/**
* Created by Administrator on 2017/4/17 0017.
*/
public class OrderInfo {
/**
* 商品名
*/
private String body;
/**
* 订单号
*/
private String orderNumber;
/**
* 订单金额
*/
private String money;
/**
* 支付类型
*/
private String payType;
/**
* 自定义参数
*/
private String attach;
public static OrderInfo instance;
private OrderInfo() {
}
public static OrderInfo getInstance(){
if(instance == null){
instance = new OrderInfo();
}
return instance;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
@Override
public String toString() {
return "OrderInfo{" +
"body='" + body + '\'' +
", orderNumber='" + orderNumber + '\'' +
", money='" + money + '\'' +
'}';
}
}
| [
"yangch0915@sina.com"
] | yangch0915@sina.com |
a6617dc209a6b686821f4b1a99732b2e5732d2f7 | 93731a2f39afe1e2316fe98d137de4a8f6fdbc26 | /Taller2ReverseEng/src/generated/Alt.java | beb6882a6de30c7ddc6fee4b77796dbdbb876637 | [] | no_license | gzapataz/EclipseWS | 21c12e9dd102daf7fcc59dc54b0c26edd7654283 | 3cb1c7ce7ff4792fd2d08fdcf649bb178e767b52 | refs/heads/master | 2021-01-21T16:14:50.204232 | 2016-09-20T14:38:44 | 2016-09-20T14:38:44 | 68,662,109 | 0 | 0 | null | 2016-09-20T14:38:44 | 2016-09-20T01:37:58 | null | UTF-8 | Java | false | false | 1,768 | java | //
// Este archivo ha sido generado por la arquitectura JavaTM para la implantación de la referencia de enlace (JAXB) XML v2.2.8-b130911.1802
// Visite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Todas las modificaciones realizadas en este archivo se perderán si se vuelve a compilar el esquema de origen.
// Generado el: 2016.09.18 a las 11:10:44 AM COT
//
package generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Clase Java para anonymous complex type.
*
* <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
*
* <pre>
* <complexType>
* <complexContent>
* <extension base="{}parent">
* <attribute name="mandatory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "alt")
public class Alt
extends Parent
{
@XmlAttribute(name = "mandatory")
protected Boolean mandatory;
/**
* Obtiene el valor de la propiedad mandatory.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isMandatory() {
return mandatory;
}
/**
* Define el valor de la propiedad mandatory.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setMandatory(Boolean value) {
this.mandatory = value;
}
}
| [
"gab.zapata@uniandes.edu.co"
] | gab.zapata@uniandes.edu.co |
0f0f96f4c0c1895031bde0634e90af16f9a9ef33 | 06dc0fe82ce8a45ebc079c0fd6c205cd4751b6a0 | /EnverHW/src/JavaHomework/StaticVariable.java | f8e472f459d5fc97518fa2ab05d94dfaf7a46821 | [] | no_license | ANWAIERJUMAI/WeekenedHW | c11bd9fd4407755e8dc91bb116e2f07d33d8fa9c | 4d67a060bef763b126c1f5228ee875492aab3446 | refs/heads/master | 2020-03-27T19:35:09.651533 | 2018-09-01T13:09:44 | 2018-09-01T13:09:44 | 146,998,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 297 | java | package JavaHomework;
public class StaticVariable {
//static variable
static String name="Enver";
static int age=26;
public static void main(String[] args) {
System.out.println("my name is:" + name);
System.out.println("my age is:" + age);
}
}
| [
"enlem@DESKTOP-KFSKP86"
] | enlem@DESKTOP-KFSKP86 |
219a0d5eda396ca90d80dbb6bd56db760c0559b8 | ee558e092d301acb7c56c9a7f91a31dacdd1d063 | /editorcore/src/test/java/com/zarbosoft/merman/editorcore/display/MockFreeDisplayNode.java | 8413063d4520a2fe1b3811d5b8a9bf0ada0a3de7 | [
"BSD-2-Clause"
] | permissive | psh-baxter/alligatoroid | b17c5e3c91f63f1cab8a7543b6661c77a1b1a733 | d777ee3a33a56897a1961719fdc97b07c869bf9b | refs/heads/master | 2023-07-13T09:45:44.591547 | 2021-09-01T10:54:31 | 2021-09-01T10:54:31 | 402,027,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package com.zarbosoft.merman.editorcore.display;
public abstract class MockFreeDisplayNode extends MockeryDisplayNode {
public double transverse;
@Override
public double transverse() {
return transverse;
}
}
| [
""
] | |
ec258611e2dc2eea51984504d038fd1a90b31c1f | 02d5244ce8854f3d1bc71e6de11838d065f3b394 | /448_Find_All_Numbers_Disappeared_in_an_Array/derek.java | 3245707622d88a6dbf55f43ed81cb087ac5d0a29 | [] | no_license | wychi/The_LeetCode_Awakens | 05f702cf0ba492872c11527ae6dc1f02f862d57c | f1a762f0f680fe23c6d370505adecb7349086446 | refs/heads/master | 2021-07-08T12:15:15.387044 | 2019-03-14T02:55:00 | 2019-03-14T02:55:00 | 105,601,347 | 4 | 1 | null | 2017-10-03T01:03:18 | 2017-10-03T01:03:18 | null | UTF-8 | Java | false | false | 570 | java | class Solution {
//Key:
//1. negative each number
//Time: O(N)
//Space:O(1)
public List<Integer> findDisappearedNumbers(int[] nums) {
List<Integer> result = new ArrayList<Integer>();
int idx = 0;
for (int i = 0 ; i< nums.length; i++) {
idx = Math.abs(nums[i]);
if (nums[idx-1] > 0)
nums[idx-1] = -nums[idx-1];
}
for (int i = 0 ; i<nums.length; i++) {
if (nums[i] > 0) {
result.add(i+1);
}
}
return result;
}
}
| [
"derek.lai@ileopard.com"
] | derek.lai@ileopard.com |
098d00c56268cd85c36af1307c961c81ad033098 | e2229b7966a7862237984f733a3316660dfde593 | /siscogescorp/src/java/com/siscogescorp/servicios/DocumentosServicios.java | 6132df8dc09c7ed9b11afc374f102f4711d18962 | [
"Apache-2.0"
] | permissive | estalisto/siscgc | da636392e3e52b45147feab4f1c5fc3c65dd14d0 | b8d9d0331fdc291ed539db2fd5b1a9faab3dfd8e | refs/heads/master | 2020-03-10T20:00:29.394281 | 2018-07-11T11:08:22 | 2018-07-11T11:08:22 | 129,560,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,180 | java | /*
* 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 com.siscogescorp.servicios;
import com.siscogescorp.modelo.HibernateUtil;
import com.siscogescorp.modelo.LcAgencia;
import com.siscogescorp.modelo.LcClientes;
import com.siscogescorp.modelo.LcDocumentos;
import com.siscogescorp.utils.Conexion;
import java.math.BigInteger;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
/**
*
* @author CIMA2015
*/
public class DocumentosServicios {
public List<LcDocumentos> getLcDocumentos(){
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx= session.beginTransaction();
// hacemos la transaccion
//ArrayList<LcDocumentos> arreglo = new ArrayList<LcEmpresa>();
Query q = session.createQuery("from LcDocumentos E WHERE E.estado = :estado");
q.setParameter("estado", "A");
List<LcDocumentos> lista=q.list();
for(LcDocumentos list:lista )
{
System.out.print("datos: "+list.getIdDocumento()+list.getNombreDocumento()+list.getIdCliente()+list.getFechaRegistro()+list.getFechaActualizado());
}
tx.commit();
session.close();
return lista;
}
public void addDocumentos(LcDocumentos documentos){
SessionFactory factory=HibernateUtil.getSessionFactory();
Session session= factory.openSession();
Transaction tx=session.beginTransaction();
session.save(documentos);
tx.commit();
session.close();
}
public Long getNext() {
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx = session.beginTransaction();
Query query = session.createSQLQuery("select nextval('lc_documentos_id_documento_seq')");
Long key = ((BigInteger) query.uniqueResult()).longValue();
tx.commit();
session.close();
return key;
}
public List<LcAgencia> getLcAgenciasxEmpresa(int empresa) {
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx = session.beginTransaction();
ArrayList<LcAgencia> arreglo = new ArrayList<LcAgencia>();
Query q = session.createQuery("from LcAgencia E WHERE E.lcEmpresa.idEmpresa= :idEmpresa and E.estado = :estado ");
q.setParameter("idEmpresa", empresa);
q.setParameter("estado", "A");
List<LcAgencia> lista = q.list();
for (LcAgencia mrol : lista) {
System.out.println("ok: " + mrol.getIdAgencia()+mrol.getLcEmpresa().getIdEmpresa() + ", " + mrol.getLcEmpresa().getRazonSocial()+mrol.getIdAgencia()+mrol.getNombre());
}
tx.commit();
session.close();
return lista;
}
public List<LcClientes> getClientesxempresa(int empresa){
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx= session.beginTransaction();
Query q = session.createQuery("from LcClientes E WHERE E.lcEmpresa.idEmpresa= :idEmpresa and E.estado = :estado ");
q.setParameter("idEmpresa",empresa);
q.setParameter("estado","A");
List<LcClientes> lista=q.list();
for(LcClientes mrol:lista )
{
System.out.println("ok: "+mrol.getIdCliente()+", "+mrol.getLcEmpresa().getRazonSocial());
}
tx.commit();
session.close();
return lista;
}
public List<LcDocumentos> ConsultaDataDoc(int idDoc){
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx= session.beginTransaction();
Query q = session.createQuery("from LcDocumentos E WHERE E.idDocumento= :idDocumento and E.estado = :estado ");
q.setParameter("idDocumento",idDoc);
q.setParameter("estado","A");
List<LcDocumentos> lista=q.list();
for(LcDocumentos mrol:lista )
{
System.out.println("ok: "+mrol.getIdDocumento());
}
tx.commit();
session.close();
return lista;
}
public void updateDocumento(int idDocumento, int empresa, int sucursal, int cartera, String nombre_doc, String saludo, String cuerpo, String despedida, String firma){
SessionFactory factory=HibernateUtil.getSessionFactory();
Session session= factory.openSession();
Transaction tx=session.beginTransaction();
LcDocumentos agen = (LcDocumentos)session.get(LcDocumentos.class, idDocumento);
agen.setIdEmpresa(empresa);
agen.setIdAgencia(sucursal);
agen.setIdCliente(cartera);
agen.setNombreDocumento(nombre_doc);
agen.setSaludo(saludo);
agen.setCuerpo(cuerpo);
agen.setDespedida(despedida);
agen.setFirma(firma);
session.update(agen);
tx.commit();
session.close();
}
public Long getNextTicket() {
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx = session.beginTransaction();
Query query = session.createSQLQuery("select nextval('lc_ticket')");
Long key = ((BigInteger) query.uniqueResult()).longValue();
tx.commit();
session.close();
return key; // return ((BigInteger) query.uniqueResult()).longValue();
}
public Integer getEjecutaSQL(String trama, int ticket)
{
int valor = 0;
try{
Conexion conexion=new Conexion();
PreparedStatement pst;
ResultSet rs;
pst = conexion.getconexion().prepareStatement("select fnc_ejecuta_sentencia('"+trama+"',"+ticket+");");
rs = pst.executeQuery();
while(rs.next()) //Mientras haya una sig. tupla
{
valor=rs.getInt(1);
}
rs.close();
pst.close();
conexion.cierraConexion();
}catch (SQLException ex) {
System.err.println( ex.getMessage() );
}
return valor;
}
public void deleteDocumento(int id){
SessionFactory factory=HibernateUtil.getSessionFactory();
Session session= factory.openSession();
Transaction tx=session.beginTransaction();
LcDocumentos agen = (LcDocumentos)session.get(LcDocumentos.class, id);
agen.setEstado("I");
session.update(agen);
tx.commit();
session.close();
}
public String getMisDocumentos(int id_empresa, int id_sucursal){
JSONObject json = new JSONObject();
JSONArray itemSelectedJson = new JSONArray();
SessionFactory sesion = HibernateUtil.getSessionFactory();
Session session;
session = sesion.openSession();
Transaction tx= session.beginTransaction();
Query q = session.createQuery("from LcDocumentos E WHERE E.idEmpresa= :idEmpresa and E.idAgencia= :idAgencia and E.estado = :estado ");
q.setParameter("idEmpresa",id_empresa);
q.setParameter("idAgencia",id_sucursal);
q.setParameter("estado","A");
List<LcDocumentos> lista=q.list();
for(LcDocumentos datos:lista )
{
//
json = new JSONObject();
json.put("idDocumento",datos.getIdDocumento());
json.put("nombreDocumento", datos.getNombreDocumento());
itemSelectedJson.add(json);
}
tx.commit();
session.close();
return itemSelectedJson.toString();
}
}
| [
"barcestalyn@gmail.com"
] | barcestalyn@gmail.com |
a5c0667025b6809dbcf1bd7d95c649d526378382 | 9d6ca9d3d1c228ae42e5aa4c1821f66e6632d317 | /app/src/main/java/com/dgcheshang/cheji/netty/init/ZdClientHandler.java | 1bed732b60c88d81066e330d20df616abad3fbf5 | [] | no_license | linzhibin66/lilunji-master4-wk_face | ff69f8924ddbbd3d7fc5cb3caebba480fd717262 | 9af6003de00a612acf2c4388dc7788895808ce33 | refs/heads/master | 2020-04-27T17:19:27.280497 | 2019-03-08T09:52:27 | 2019-03-08T09:52:27 | 174,511,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,055 | java | package com.dgcheshang.cheji.netty.init;
import android.util.Log;
import com.dgcheshang.cheji.netty.conf.NettyConf;
import com.dgcheshang.cheji.netty.timer.ConTimer;
import com.dgcheshang.cheji.netty.util.GatewayService;
import com.dgcheshang.cheji.netty.util.MsgUtil;
import com.dgcheshang.cheji.netty.util.ZdUtil;
import org.apache.commons.lang3.StringUtils;
import java.util.Timer;
import java.util.TimerTask;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
public class ZdClientHandler extends SimpleChannelInboundHandler<String> {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
Log.e("TAG","连接异常!");
super.exceptionCaught(ctx, cause);
}
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
Log.e("TAG","终端连接服务器激活成功");
GatewayService.addGatewayChannel("serverChannel",ctx);
NettyConf.constate=1;
if(ZdClient.conTimer!=null){
ZdClient.conTimer.cancel();
ZdClient.conTimer=null;
}
if(NettyConf.zcstate==0){
//没注册过注册
ZdUtil.sendZdzc();
}else if(NettyConf.zcstate==1&NettyConf.jqstate==0){
//发送终端鉴权
ZdUtil.sendZdjqHex();
}
super.channelActive(ctx);
}
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (IdleStateEvent.class.isAssignableFrom(evt.getClass())) {
IdleStateEvent event = (IdleStateEvent) evt;
if (event.state() == IdleState.READER_IDLE){
System.out.println("read idle");
}
else if (event.state() == IdleState.WRITER_IDLE){
String hexmsg= MsgUtil.getXthf(NettyConf.mobile);
if(StringUtils.isNotEmpty(hexmsg)){
ctx.writeAndFlush(hexmsg);
}
}
else if (event.state() == IdleState.ALL_IDLE){
System.out.println("all idle");
}
}
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, String msg)
throws Exception {
// 收到消息直接打印输出
if(NettyConf.debug) {
Log.e("TAG", ctx.channel().remoteAddress() + " server say: " + msg);
}
if(StringUtils.isEmpty(msg)){
//消息为空直接丢弃
}else{
ZdHandleMsg zm=new ZdHandleMsg(msg);
Thread th=new Thread(zm);
th.start();
}
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
GatewayService.removeGatewayChannel("serverChannel");
NettyConf.constate=0;
NettyConf.jqstate=0;
Log.e("TAG","断开连接重连!");
if(ZdClient.conTimer==null){
Timer timer=new Timer();
TimerTask timerTask=new ConTimer();
timer.schedule(timerTask,1000,35*1000);
ZdClient.conTimer=timer;//记录下来
}
/*final EventLoop eventLoop = ctx.channel().eventLoop();
eventLoop.schedule(new Runnable() {
@Override
public void run() {
ZdClient.doConnect();
}
}, 1L, TimeUnit.SECONDS);*/
super.channelInactive(ctx);
}
}
| [
"878204935@qq.com"
] | 878204935@qq.com |
49eab9494620ca6d8220619af0777fedfeadfe71 | 20077acbb398e76fcefe39e56161d14a69b3fcdf | /app/src/main/java/lt/mm/weatherly/network/LoadResultListener.java | af2c81473a78f055a3cf78d705438e1cc7587664 | [] | no_license | marius-m/android_openweather | 60ac97dc3c1730e620d6492578acc02b12993f20 | 6d8df75c5c15f47aaa99eee805710c4ce11641ed | refs/heads/master | 2021-01-01T20:17:49.392025 | 2015-08-23T13:00:27 | 2015-08-23T13:00:27 | 41,248,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package lt.mm.weatherly.network;
/**
* An interface that reports networking state changes
*/
public interface LoadResultListener<Type> {
/**
* Callback with a string response from the server
* @param response
*/
void onLoadSuccess(Type response);
/**
* Callback with a fail message from the server
* @param error
*/
void onLoadFail(String error);
}
| [
"marius.m@ito.lt"
] | marius.m@ito.lt |
9aab7dd4c434078dd81aa32881035f8e6fa5edd8 | 44aa08f6174cb485f42855d277122957cec2a595 | /storage/src/test/java/com/sunland/rocketmq/AppendAndGetRocksdbTest.java | d5c43df66437e8eb8c78304fa1698e5df446e696 | [
"Apache-2.0"
] | permissive | breezecoolyang/DLedger_rocksdb | 17b71c0a190b8727b6d82592d8d9c883efef8f3f | 78a404e30d95d0e9778d38f2edd4feb8081be83b | refs/heads/master | 2020-05-14T12:52:04.818390 | 2019-05-10T08:27:16 | 2019-05-10T08:27:16 | 181,800,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,335 | java | package com.sunland.rocketmq;
import com.sunland.rocketmq.entry.DLedgerEntry;
import com.sunland.rocketmq.client.DLedgerClient;
import com.sunland.rocketmq.protocol.AppendEntryResponse;
import com.sunland.rocketmq.protocol.DLedgerResponseCode;
import com.sunland.rocketmq.protocol.GetEntriesResponse;
import com.sunland.rocketmq.protocol.GetListEntriesResponse;
import com.sunland.rocketmq.protocol.AppendEntryRequest;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
public class AppendAndGetRocksdbTest extends ServerTestHarness{
@Test
public void testSingleServerInRocksdb() throws Exception {
String group = UUID.randomUUID().toString();
String selfId = "n0";
String peers = "n0-localhost:10005";
launchServer(group, peers, selfId, selfId, DLedgerConfig.ROCKSDB);
DLedgerClient dLedgerClient = launchClient(group, peers);
for (long i = 0; i < 10; i++) {
AppendEntryResponse appendEntryResponse = dLedgerClient.append(1536811267, ("HelloSingleServerInRocksdb" + i).getBytes());
Assert.assertEquals(i, appendEntryResponse.getIndex());
}
GetListEntriesResponse getEntriesResponse = dLedgerClient.getByTime(1536811267);
Assert.assertEquals(10, getEntriesResponse.getEntries().size());
for (long i = 0; i < 10; i++) {
Assert.assertEquals(i, getEntriesResponse.getEntries().get((int)i).getIndex());
Assert.assertArrayEquals(("HelloSingleServerInRocksdb" + i).getBytes(), getEntriesResponse.getEntries().get((int)i).getBody());
}
}
@Test
public void testSingleServerInRocksdbGet() throws Exception {
String group = UUID.randomUUID().toString();
String selfId = "n0";
String peers = String.format("n0-localhost:%d", nextPort());
launchServer(group, peers, selfId, selfId, DLedgerConfig.ROCKSDB);
DLedgerClient dLedgerClient = launchClient(group, peers);
for (long i = 0; i < 10; i++) {
AppendEntryResponse appendEntryResponse = dLedgerClient.append(1536811267, ("HelloSingleServerInRocksdbGet" + i).getBytes());
Assert.assertEquals(i, appendEntryResponse.getIndex());
}
for (long i = 0; i < 10; i++) {
GetEntriesResponse getEntriesResponse = dLedgerClient.get(i);
Assert.assertEquals(1, getEntriesResponse.getEntries().size());
Assert.assertEquals(i, getEntriesResponse.getEntries().get(0).getIndex());
Assert.assertArrayEquals(("HelloSingleServerInRocksdbGet" + i).getBytes(), getEntriesResponse.getEntries().get(0).getBody());
}
}
@Test
public void testThreeServerInRocksdb() throws Exception {
String group = UUID.randomUUID().toString();
String peers = "n0-localhost:10006;n1-localhost:10007;n2-localhost:10008";
DLedgerServer dLedgerServer0 = launchServer(group, peers, "n0", "n1", DLedgerConfig.ROCKSDB);
DLedgerServer dLedgerServer1 = launchServer(group, peers, "n1", "n1", DLedgerConfig.ROCKSDB);
DLedgerServer dLedgerServer2 = launchServer(group, peers, "n2", "n1", DLedgerConfig.ROCKSDB);
DLedgerClient dLedgerClient = launchClient(group, peers);
long timestamp = System.currentTimeMillis()/1000;
for (int i = 0; i < 10; i++) {
AppendEntryResponse appendEntryResponse = dLedgerClient.append(timestamp, ("HelloSingleServerInRocksdb" + i).getBytes());
Assert.assertEquals(appendEntryResponse.getCode(), DLedgerResponseCode.SUCCESS.getCode());
Assert.assertEquals(i, appendEntryResponse.getIndex());
}
Thread.sleep(100);
Assert.assertEquals(9, dLedgerServer0.getdLedgerStore().getLedgerEndIndex());
Assert.assertEquals(9, dLedgerServer1.getdLedgerStore().getLedgerEndIndex());
Assert.assertEquals(9, dLedgerServer2.getdLedgerStore().getLedgerEndIndex());
GetListEntriesResponse getEntriesResponse = dLedgerClient.getByTime(timestamp);
Assert.assertEquals(10, getEntriesResponse.getEntries().size());
for (int i = 0; i < 10; i++) {
Assert.assertEquals(i, getEntriesResponse.getEntries().get(i).getIndex());
Assert.assertArrayEquals(("HelloSingleServerInRocksdb" + i).getBytes(), getEntriesResponse.getEntries().get(i).getBody());
}
}
@Test
public void testThreeServerInRocksdbWithAsyncRequests() throws Exception {
String group = UUID.randomUUID().toString();
String peers = String.format("n0-localhost:%d;n1-localhost:%d;n2-localhost:%d", nextPort(), nextPort(), nextPort());
DLedgerServer dLedgerServer0 = launchServer(group, peers, "n0", "n1", DLedgerConfig.ROCKSDB);
DLedgerServer dLedgerServer1 = launchServer(group, peers, "n1", "n1", DLedgerConfig.ROCKSDB);
DLedgerServer dLedgerServer2 = launchServer(group, peers, "n2", "n1", DLedgerConfig.ROCKSDB);
List<CompletableFuture<AppendEntryResponse>> futures = new ArrayList<>();
long timestamp = System.currentTimeMillis()/1000;
for (int i = 0; i < 10; i++) {
AppendEntryRequest request = new AppendEntryRequest();
request.setGroup(group);
request.setRemoteId(dLedgerServer1.getMemberState().getSelfId());
request.setTimestamp(timestamp);
request.setBody(("testThreeServerInRocksdbWithAsyncRequests" + i).getBytes());
futures.add(dLedgerServer1.handleAppend(request));
}
Thread.sleep(500);
Assert.assertEquals(9, dLedgerServer0.getdLedgerStore().getLedgerEndIndex());
Assert.assertEquals(9, dLedgerServer1.getdLedgerStore().getLedgerEndIndex());
Assert.assertEquals(9, dLedgerServer2.getdLedgerStore().getLedgerEndIndex());
DLedgerClient dLedgerClient = launchClient(group, peers);
for (int i = 0; i < futures.size(); i++) {
CompletableFuture<AppendEntryResponse> future = futures.get(i);
Assert.assertTrue(future.isDone());
Assert.assertEquals(i, future.get().getIndex());
Assert.assertEquals(DLedgerResponseCode.SUCCESS.getCode(), future.get().getCode());
GetEntriesResponse getEntriesResponse = dLedgerClient.get(i);
DLedgerEntry entry = getEntriesResponse.getEntries().get(0);
Assert.assertEquals(1, getEntriesResponse.getEntries().size());
Assert.assertEquals(i, getEntriesResponse.getEntries().get(0).getIndex());
Assert.assertArrayEquals(("testThreeServerInRocksdbWithAsyncRequests" + i).getBytes(), entry.getBody());
}
GetListEntriesResponse getEntriesResponse = dLedgerClient.getByTime(timestamp);
Assert.assertEquals(10, getEntriesResponse.getEntries().size());
for (int i = 0; i < 10; i++) {
Assert.assertEquals(i, getEntriesResponse.getEntries().get(i).getIndex());
Assert.assertArrayEquals(("testThreeServerInRocksdbWithAsyncRequests" + i).getBytes(), getEntriesResponse.getEntries().get(i).getBody());
}
}
}
| [
"fengqing@sunlands.com"
] | fengqing@sunlands.com |
98163deb8762ae8d5bbdfd68b652acc4f358730b | a552aa8f554d5345a12c11a963f9cd3ffac48a12 | /app/src/main/java/com/nayra/gowhite/model/Country.java | 85b40cbd34db87d6fa8b3b4f780ebe03c393d51d | [] | no_license | nayra/testProj | f77d5edfdce70384e54371aafd1078254e4bda32 | 41ff52ada528cd67267ad520d3b8632afb77d33e | refs/heads/master | 2021-04-29T03:23:53.061523 | 2018-04-26T05:43:58 | 2018-04-26T05:43:58 | 121,814,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package com.nayra.gowhite.model;
import com.google.gson.annotations.SerializedName;
/**
* Created by nayrael-sayed on 2/17/18.
*/
public class Country {
@SerializedName("Name")
private String en_name;
@SerializedName("NameAr")
private String ar_name;
@SerializedName("CountryID")
private int countryID;
public String getEn_name() {
return en_name;
}
public void setEn_name(String en_name) {
this.en_name = en_name;
}
public String getAr_name() {
return ar_name;
}
public void setAr_name(String ar_name) {
this.ar_name = ar_name;
}
public int getCountryID() {
return countryID;
}
public void setCountryID(int countryID) {
this.countryID = countryID;
}
}
| [
"123nany"
] | 123nany |
9205b505b60542ad159bf3b215d9ea5b40f298e1 | 1bf2492f45b32316ceb6bf39f3202237be44fa1a | /1.JavaSyntax/src/com/javarush/task/task06/task0614/Cat.java | fb4396f5224c6ea06bb4df72149ed3a3d4e5e4c4 | [] | no_license | KiruhaZ/JavaRushTasks | 49b3ad65a759a74d3968259ccf1092521f7922e6 | 6065fcf7a991108a74858d7d95bdff55032ba3bc | refs/heads/master | 2021-04-15T15:33:37.299558 | 2018-03-30T17:03:45 | 2018-03-30T17:03:45 | 125,765,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package com.javarush.task.task06.task0614;
import java.util.ArrayList;
/*
Статические коты
*/
public class Cat {
//напишите тут ваш код
public static ArrayList<Cat> cats = new ArrayList<>();
public Cat() {
}
public static void main(String[] args) {
//напишите тут ваш код
for (int i = 0; i < 10; i++) {
cats.add(new Cat());
}
printCats();
}
public static void printCats() {
//напишите тут ваш код
for (Cat i : cats) {
System.out.println(i);
}
}
}
| [
"zabaluev.kirill.v@gmail.com"
] | zabaluev.kirill.v@gmail.com |
0ce01827804cdcbb8b89f07534dfe0a4fa7ac93a | 47c2ba713fe1c5830c6e1a39621445da48a9b3fd | /src/patterns/patternsdemonstrator/StateDemonstrator.java | 17529efee438ba97883151019ff3d9b9846be5ac | [] | no_license | Artemap98/Lab_patterns | 55fc1c232a7d9ba8643dbfa4985327be9edbaa6a | 75b13cca16e98783a8a9248d261cf919a208ff1a | refs/heads/master | 2023-03-01T15:21:47.516684 | 2021-02-04T09:56:45 | 2021-02-04T09:56:45 | 333,013,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,269 | java | package patterns.patternsdemonstrator;
import core.Examination;
import core.ForeignStudent;
import core.LanguageTest;
import interfaces.SkillType;
import patterns.delegate.punctuationSkill.GreatPunctuationSkill;
import patterns.delegate.speakingSkill.GreatSpeakingSkill;
import patterns.delegate.syntaxSkill.GreatSyntaxSkill;
import patterns.state.MonoTestStudent;
public class StateDemonstrator {
public void Run(){
//create some student and add skills
MonoTestStudent ada = new MonoTestStudent("England", "Ada Lovelace");
ada.AddLanguageSkill(new GreatPunctuationSkill());
ada.AddLanguageSkill(new GreatSpeakingSkill());
ada.AddLanguageSkill(new GreatSyntaxSkill());
//create test
LanguageTest test = new LanguageTest();
test.AddSkillType(SkillType.PUNCTUATION);
test.AddSkillType(SkillType.SPEAKING);
LanguageTest test2 = new LanguageTest();
test2.AddSkillType(SkillType.SYNTAX);
test2.AddSkillType(SkillType.SPEAKING);
//create standard exam
Examination exam = new Examination();
ada.EndTest();
ada.BeginTest(exam, test);
ada.BeginTest(exam, test2);
ada.EndTest();
System.out.println('\n');
}
}
| [
"artemap98@gmail.com"
] | artemap98@gmail.com |
95d96a46ac3313d02efd60594c0ca88594c24b78 | df4eb7b3e3d53c85108d2d0d412aa85d6ffb2c76 | /main/java/dtx/src/main/java/com/oodrive/nuage/dtx/SyncEventHandler.java | a2451da2dc7e2e53d13be155eb6401c02ccaa3f8 | [] | no_license | cyrinux/eguan | 8526c418480f30a3a3ccd5eca2237a68fd2bbc8f | 9e20281655838c8c300f1aa97ad03448e16328c8 | refs/heads/master | 2021-01-17T20:21:35.000299 | 2015-02-19T15:22:46 | 2015-02-19T15:22:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,899 | java | package com.oodrive.nuage.dtx;
/*
* #%L
* Project eguan
* %%
* Copyright (C) 2012 - 2015 Oodrive
* %%
* 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.
* #L%
*/
import static com.oodrive.nuage.dtx.DtxResourceManagerState.LATE;
import static com.oodrive.nuage.dtx.DtxResourceManagerState.SYNCHRONIZING;
import static com.oodrive.nuage.dtx.DtxResourceManagerState.UNDETERMINED;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Nonnull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
import com.oodrive.nuage.dtx.events.DtxResourceManagerEvent;
/**
* Event handler for triggering synchronization actions.
*
* @author oodrive
* @author pwehrle
*
*/
public final class SyncEventHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(SyncEventHandler.class);
/**
* Intercepts {@link DtxResourceManagerEvent}s for {@link DtxResourceManagerState#LATE} resource managers and
* triggers synchronization.
*
* @param event
* the posted {@link DtxResourceManagerEvent}
*/
@Subscribe
@AllowConcurrentEvents
public final void handleDtxResourceManagerEvent(@Nonnull final DtxResourceManagerEvent event) {
final DtxResourceManagerState newState = event.getNewState();
if (LATE != newState) {
// not late, i.e. do not trigger synchronization
return;
}
final UUID resId = event.getResourceManagerId();
final DtxManager dtxManager = event.getSource();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Triggering synchronization; node=" + dtxManager.getNodeId() + ", resourceId=" + resId);
}
final TransactionManager txManager = dtxManager.getTxManager();
if (txManager == null) {
LOGGER.warn("Transaction manager is null, abandoning synchronization");
return;
}
txManager.setResManagerSyncState(resId, SYNCHRONIZING);
try {
long lastLocalTxId = txManager.getLastCompleteTxIdForResMgr(resId);
final Map<DtxNode, Long> updateMap = dtxManager.getClusterMapInfo(resId, Long.valueOf(lastLocalTxId));
if (updateMap.isEmpty()) {
return;
}
final long maxTxId = Collections.max(updateMap.values()).longValue();
// TODO: choose update source more wisely
final Iterator<DtxNode> nodeIter = updateMap.keySet().iterator();
while (nodeIter.hasNext() && (lastLocalTxId < maxTxId)) {
final DtxNode targetNode = nodeIter.next();
final long targetNodeLastTxId = updateMap.get(targetNode).longValue();
if (targetNodeLastTxId > lastLocalTxId) {
lastLocalTxId = dtxManager
.synchronizeWithNode(resId, targetNode, lastLocalTxId, targetNodeLastTxId);
}
}
}
finally {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Synchronization finished; node=" + dtxManager.getNodeId() + ", resourceId=" + resId);
}
txManager.setResManagerSyncState(resId, UNDETERMINED);
}
}
}
| [
"p.wehrle@oodrive.com"
] | p.wehrle@oodrive.com |
0bd4f2dd8fe59b8cacdffde5aed926b5e97cafe1 | aed778974ac3d88e634b98db318326d5bd8d96c9 | /client/src/main/java/class139.java | 042178fb9bb20b234b542a9b442184fb8da69cea | [] | no_license | kyleescobar/avernic | 89bfe47cceb1286a64cb57bde31a17a39b8b8987 | f8306ae0b45d681ab4082c35ddc152d41142b032 | refs/heads/master | 2023-07-14T04:32:50.785244 | 2021-09-03T06:18:42 | 2021-09-03T06:18:42 | 400,934,182 | 7 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,647 | java | import java.io.IOException;
public class class139 extends class349 {
static class223 field1522 = new class223(64);
static class275 archive4;
static class277 field1525;
public int field1523 = 0;
class139() {
}
public static void method2345(String var0, boolean var1, boolean var2) {
class42.method766(var0, var1, "openjs", var2);
}
void method2336(Buffer var1) {
while(true) {
int var3 = var1.readUnsignedByte();
if (var3 == 0) {
return;
}
this.method2344(var1, var3);
}
}
void method2344(Buffer var1, int var2) {
if (var2 == 2) {
this.field1523 = var1.readUnsignedShort();
}
}
public static byte[] method2346() {
byte[] var1 = new byte[24];
try {
class131.field1471.method5795(0L);
class131.field1471.method5797(var1);
int var2;
for(var2 = 0; var2 < 24 && 0 == var1[var2]; ++var2) {
}
if (var2 >= 24) {
throw new IOException();
}
} catch (Exception var4) {
for(int var3 = 0; var3 < 24; ++var3) {
var1[var3] = -1;
}
}
return var1;
}
static int method2339(int var0, class59 var1, boolean var2) {
Interface var4;
if (var0 >= 2000) {
var0 -= 1000;
var4 = class87.getComponent(class51.field747[--class51.field746]);
} else {
var4 = var2 ? class286.field3660 : class51.field750;
}
String var5 = class51.field738[--class2.field4];
int[] var6 = null;
if (var5.length() > 0 && var5.charAt(var5.length() - 1) == 'Y') {
int var7 = class51.field747[--class51.field746];
if (var7 > 0) {
for(var6 = new int[var7]; var7-- > 0; var6[var7] = class51.field747[--class51.field746]) {
}
}
var5 = var5.substring(0, var5.length() - 1);
}
Object[] var9 = new Object[var5.length() + 1];
int var8;
for(var8 = var9.length - 1; var8 >= 1; --var8) {
if (var5.charAt(var8 - 1) == 's') {
var9[var8] = class51.field738[--class2.field4];
} else {
var9[var8] = new Integer(class51.field747[--class51.field746]);
}
}
var8 = class51.field747[--class51.field746];
if (-1 != var8) {
var9[0] = new Integer(var8);
} else {
var9 = null;
}
if (1400 == var0) {
var4.field3046 = var9;
} else if (1401 == var0) {
var4.field3049 = var9;
} else if (var0 == 1402) {
var4.field2955 = var9;
} else if (var0 == 1403) {
var4.field3050 = var9;
} else if (1404 == var0) {
var4.field3052 = var9;
} else if (1405 == var0) {
var4.field2995 = var9;
} else if (1406 == var0) {
var4.field3056 = var9;
} else if (var0 == 1407) {
var4.field3057 = var9;
var4.field3058 = var6;
} else if (var0 == 1408) {
var4.field3017 = var9;
} else if (1409 == var0) {
var4.field3055 = var9;
} else if (var0 == 1410) {
var4.field3081 = var9;
} else if (var0 == 1411) {
var4.field3047 = var9;
} else if (1412 == var0) {
var4.field3051 = var9;
} else if (var0 == 1414) {
var4.field3083 = var9;
var4.field3060 = var6;
} else if (var0 == 1415) {
var4.field2996 = var9;
var4.field3062 = var6;
} else if (1416 == var0) {
var4.field2974 = var9;
} else if (1417 == var0) {
var4.field3065 = var9;
} else if (1418 == var0) {
var4.field3066 = var9;
} else if (var0 == 1419) {
var4.field3067 = var9;
} else if (1420 == var0) {
var4.field3070 = var9;
} else if (1421 == var0) {
var4.field3059 = var9;
} else if (var0 == 1422) {
var4.field3074 = var9;
} else if (var0 == 1423) {
var4.field3008 = var9;
} else if (var0 == 1424) {
var4.field3076 = var9;
} else if (1425 == var0) {
var4.field2982 = var9;
} else if (1426 == var0) {
var4.field3079 = var9;
} else if (var0 == 1427) {
var4.field3072 = var9;
} else if (var0 == 1428) {
var4.field3075 = var9;
} else if (var0 == 1429) {
var4.field3073 = var9;
} else if (var0 == 1430) {
var4.field3068 = var9;
} else {
if (var0 != 1431) {
return 2;
}
var4.field3069 = var9;
}
var4.field3044 = true;
return 1;
}
}
| [
"82987787+kyleescobar@users.noreply.github.com"
] | 82987787+kyleescobar@users.noreply.github.com |
dd80cb6df6bd5fd50bba3b486b7a0735f3dadf46 | 0cd792f2415775d68ff2523e0cdca36fbbcf39f7 | /generatorSqlmapCustom2/src/com/yxtk/po/base/PublishBase.java | 46900b7c4d12f25b26dd9c68f08c09d5b846ab19 | [] | no_license | redenna/mybatis-mapper-sql- | 55e3b43e73e304179872d6fc341992febc1a3916 | bd946291d94c3ebe51dd49d284461b502b8a2862 | refs/heads/master | 2021-01-19T23:09:02.473677 | 2017-03-04T01:03:19 | 2017-03-04T01:03:19 | 83,784,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,483 | java | package com.yxtk.po.base;
public abstract class PublishBase extends BasePo{
private Integer userId;
private String title;
private String imgUrl1;
private String imgUrl2;
private String imgUrl3;
private Integer publishTypeId;
private Integer admCheck;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getImgUrl1() {
return imgUrl1;
}
public void setImgUrl1(String imgUrl1) {
this.imgUrl1 = imgUrl1 == null ? null : imgUrl1.trim();
}
public String getImgUrl2() {
return imgUrl2;
}
public void setImgUrl2(String imgUrl2) {
this.imgUrl2 = imgUrl2 == null ? null : imgUrl2.trim();
}
public String getImgUrl3() {
return imgUrl3;
}
public void setImgUrl3(String imgUrl3) {
this.imgUrl3 = imgUrl3 == null ? null : imgUrl3.trim();
}
public Integer getPublishTypeId() {
return publishTypeId;
}
public void setPublishTypeId(Integer publishTypeId) {
this.publishTypeId = publishTypeId;
}
public Integer getAdmCheck() {
return admCheck;
}
public void setAdmCheck(Integer admCheck) {
this.admCheck = admCheck;
}
} | [
"2661658075@qq.com"
] | 2661658075@qq.com |
5cebaea30e8bcfb8069685e6a37493f705b5ad6d | 7373b3165be7a858e852e14cc3b4d954bb27b591 | /app/src/main/java/com/microsoft/band/sdk/sampleapp/BandStreamingAppActivity.java | aaec79908e4d4c0627835a31e7806bd27aa53c9c | [] | no_license | minjaes/BandStreamingApp-1 | 6a9b668b9f3fd6a2022997578dd7a82b928d1d1d | b474396e6668f4e440af1c84b017f78c59194246 | refs/heads/master | 2016-09-05T19:23:29.294307 | 2015-08-26T20:35:30 | 2015-08-26T20:35:30 | 41,448,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,703 | java | //Copyright (c) Microsoft Corporation All rights reserved.
//
//MIT License:
//
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
//documentation files (the "Software"), to deal in the Software without restriction, including without limitation
//the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
//to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of
//the Software.
//
//THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
//THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
//CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
//IN THE SOFTWARE.
package com.microsoft.band.sdk.sampleapp;
import com.aware.utils.Https;
import com.microsoft.band.BandClient;
import com.microsoft.band.BandClientManager;
import com.microsoft.band.BandException;
import com.microsoft.band.BandInfo;
import com.microsoft.band.BandIOException;
import com.microsoft.band.ConnectionState;
import com.microsoft.band.UserConsent;
//import com.microsoft.band.sdk.sampleapp.streaming.R;
import com.microsoft.band.sensors.BandAccelerometerEvent;
import com.microsoft.band.sensors.BandAccelerometerEventListener;
import com.microsoft.band.sensors.BandHeartRateEvent;
import com.microsoft.band.sensors.BandHeartRateEventListener;
import com.microsoft.band.sensors.HeartRateConsentListener;
import com.microsoft.band.sensors.SampleRate;
import com.microsoft.band.sensors.BandPedometerEvent;
import com.microsoft.band.sensors.BandPedometerEventListener;
import com.microsoft.band.sensors.BandCaloriesEvent;
import com.microsoft.band.sensors.BandCaloriesEventListener;
import com.microsoft.band.sensors.BandSkinTemperatureEvent;
import com.microsoft.band.sensors.BandSkinTemperatureEventListener;
import com.microsoft.band.sensors.BandDistanceEvent;
import com.microsoft.band.sensors.BandDistanceEventListener;
import com.microsoft.band.sensors.BandContactEvent;
import com.microsoft.band.sensors.BandContactEventListener;
import com.microsoft.band.sensors.BandContactState;
import com.microsoft.band.sensors.BandUVEvent;
import com.microsoft.band.sensors.BandUVEventListener;
import com.microsoft.band.sensors.BandGyroscopeEvent;
import com.microsoft.band.sensors.BandGyroscopeEventListener;
import com.microsoft.band.sensors.UVIndexLevel;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.provider.CalendarContract;
import android.provider.Settings;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.app.Activity;
import android.os.AsyncTask;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.StringBufferInputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Calendar;
import java.io.File;
import android.os.Environment;
import java.util.Date;
import java.sql.Timestamp;
import java.util.TimeZone;
import com.aware.Aware;
import com.aware.Aware_Preferences;
import com.aware.utils.Aware_Plugin;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
public class BandStreamingAppActivity extends Aware_Plugin {
private BandClient client = null;
private Button btnStart;
private TextView txtStatus;
private File sdCard;
private File dir;
private File file;
private int heartRate;
private float x;
private float y;
private float z;
private long steps;
private float skinTemp;
private long calories;
private float distance;
private BandContactState contact;
private UVIndexLevel UV;
private int gyroscope;
private String heartRateL = "Unix Timestamp,Local Timestamp,Heart Rate\n";
private String accelerometerL = "Unix Timestamp,Local Timestamp,x,y,z\n";
private String stepsL = "Unix Timestamp,Local Timestamp,steps\n";
private String skinTempL ="Unix Timestamp,Local Timestamp,Skin Temperature\n";
private String caloriesL = "Unix Timestamp,Local Timestamp,Calories\n";
private String distanceL = "Unix Timestamp,Local Timestamp,Distance\n";
private String UVL = "Unix Timestamp,Local Timestamp,UV\n";
private static class Params {
String filename;
String update;
String firstLine;
Params(String filename, String update, String firstLine) {
this.filename = filename;
this.update = update;
this.firstLine = firstLine;
}
}
@Override
public void onCreate() {
super.onCreate();
// ArrayList<NameValuePair> request = new ArrayList<NameValuePair>();
// request.add(new BasicNameValuePair("Time", "3333"));
// request.add(new BasicNameValuePair("Value", "23"));
// new Https(getApplicationContext()).dataPOST( "https://api.awareframework.com/index.php/webservice/index/421/31wEGFcTZDnY" + "/" + "band" + "/insert", request, true);
new appTask().execute(); //runs receivers on background thread
sdCard = Environment.getExternalStorageDirectory();
dir = new File (sdCard.getAbsolutePath() + "/band");
dir.mkdirs();
}
@Override
public int onStartCommand(Intent intent, int x, int y){
super.onStartCommand(intent,x,y);
new appTask().execute(); //runs receivers on background thread
sdCard = Environment.getExternalStorageDirectory();
dir = new File (sdCard.getAbsolutePath() + "/band");
dir.mkdirs();
return 1;
}
@Override
public void onDestroy(){
super.onDestroy();
//TODO: unregister everything
try {
client.getSensorManager().unregisterAccelerometerEventListeners();
} catch (BandIOException e) {
appendToUI(e.getMessage());
}
}
private class appTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
try {
if (getConnectedBandClient()) {
appendToUI("Band is connected.\n");
//register receivers
client.getSensorManager().registerAccelerometerEventListener(mAccelerometerEventListener, SampleRate.MS16);
client.getSensorManager().registerPedometerEventListener(mPedometerEventListener);
client.getSensorManager().registerSkinTemperatureEventListener(mSkinTemperatureEventListener);
client.getSensorManager().registerCaloriesEventListener(mCaloriesEventListener);
client.getSensorManager().registerUVEventListener(mUVEventListener);
client.getSensorManager().registerDistanceEventListener(mDistanceEventListener);
if(client.getSensorManager().getCurrentHeartRateConsent() == UserConsent.GRANTED) {
client.getSensorManager().registerHeartRateEventListener(mHeartRateEventListener);
} else {
//TODO: fill in ???
//client.getSensorManager().requestHeartRateConsent(MainActivity.this, mHeartRateConsentListener);
}
} else {
appendToUI("Band isn't connected. Please make sure bluetooth is on and the band is in range.\n");
}
} catch (BandException e) {
String exceptionMessage="";
switch (e.getErrorType()) {
case UNSUPPORTED_SDK_VERSION_ERROR:
exceptionMessage = "Microsoft Health BandService doesn't support your SDK Version. Please update to latest SDK.";
break;
case SERVICE_ERROR:
exceptionMessage = "Microsoft Health BandService is not available. Please make sure Microsoft Health is installed and that you have the correct permissions.";
break;
default:
exceptionMessage = "Unknown error occured: " + e.getMessage();
break;
}
appendToUI(exceptionMessage);
} catch (Exception e) {
appendToUI(e.getMessage());
}
return null;
}
}
private void appendToUI(final String string) {
/*this.runOnUiThread(new Runnable() {
@Override
public void run() {
txtStatus.setText(string);
}
});*/
}
private BandAccelerometerEventListener mAccelerometerEventListener = new BandAccelerometerEventListener() {
@Override
public void onBandAccelerometerChanged(final BandAccelerometerEvent event) {
if (event != null) {
long time = event.getTimestamp();
Date date= new java.util.Date();
x = event.getAccelerationX();
y = event.getAccelerationY();
z = event.getAccelerationZ();
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + x + "," + y + "," + z + "\n");
Params params = new Params("accelerometer.csv",update,accelerometerL);
//new writeOnFile().execute(params);
//writeOnDB(time, 21);
appendToUI(update);
}
}
};
private BandHeartRateEventListener mHeartRateEventListener = new BandHeartRateEventListener() {
@Override
public void onBandHeartRateChanged(final BandHeartRateEvent event) {
if (event != null) {
long time = event.getTimestamp();
Date date= new java.util.Date();
heartRate = event.getHeartRate();
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + heartRate + "\n");
Params params = new Params("heartRate.csv",update,heartRateL);
//new writeOnFile().execute(params);
//writeOnDB(time,heartRate);
appendToUI(update);
}
}
};
private HeartRateConsentListener mHeartRateConsentListener = new HeartRateConsentListener() {
@Override
public void userAccepted(boolean b) {
// handle user's heart rate consent decision
if (!b){
// Consent hasn't been given
appendToUI(String.valueOf(b));
}
}
};
private BandSkinTemperatureEventListener mSkinTemperatureEventListener = new BandSkinTemperatureEventListener() {
@Override
public void onBandSkinTemperatureChanged(BandSkinTemperatureEvent event) {
if (event != null) {
long time = event.getTimestamp();
Date date= new java.util.Date();
skinTemp = event.getTemperature();
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + skinTemp + "\n");
Params params = new Params("skinTemperature.csv",update,skinTempL);
//new writeOnFile().execute(params);
writeOnCalendar(time, skinTemp);
//writeOnDB(time, skinTemp);
/**
try {
// writeOnServer(time, skinTemp);
// uploadUrl("http://epiwork.hcii.cs.cmu.edu/~afsaneh/connection.php", time, skinTemp);
}catch(IOException e){
}**/
appendToUI(update);
}
}
};
private BandPedometerEventListener mPedometerEventListener = new BandPedometerEventListener() {
@Override
public void onBandPedometerChanged(BandPedometerEvent event) {
if (event != null) {
long time = event.getTimestamp();
Date date= new java.util.Date();
steps = event.getTotalSteps();
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + steps + "\n");
Params params = new Params("pedometer.csv",update,stepsL);
//new writeOnFile().execute(params);
appendToUI(update);
}
}
};
private BandCaloriesEventListener mCaloriesEventListener = new BandCaloriesEventListener() {
@Override
public void onBandCaloriesChanged(BandCaloriesEvent event) {
if (event != null) {
long time = event.getTimestamp();
Date date= new java.util.Date();
calories = event.getCalories();
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + calories + "\n");
Params params = new Params("calories.csv",update,caloriesL);
//new writeOnFile().execute(params);
appendToUI(update);
}
}
};
private BandDistanceEventListener mDistanceEventListener = new BandDistanceEventListener() {
@Override
public void onBandDistanceChanged(BandDistanceEvent event) {
if (event != null) {
long time = event.getTimestamp();
Date date= new java.util.Date();
distance = event.getTotalDistance();
//can have motiontype, pace and speed as well
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + distance + "\n");
Params params = new Params("distance.csv",update,distanceL);
//new writeOnFile().execute(params);
appendToUI(update);
}
}
};
private BandUVEventListener mUVEventListener = new BandUVEventListener() {
@Override
public void onBandUVChanged(BandUVEvent event) {
if (event != null){
long time = event.getTimestamp();
Date date= new java.util.Date();
UV = event.getUVIndexLevel();
String update = Long.toString(time);
update += "," + new Timestamp(date.getTime());
update += ("," + UV + "\n");
Params params = new Params("UV.csv",update,UVL);
//new writeOnFile().execute(params);
appendToUI(update);
}
}
};
/*
is this information needed?
private BandGyroscopeEventListener mGyrosocopeEventListener = new BandGyroscopeEventListener() {
@Override
public void onBandGyroscopeChanged(BandGyroscopeEvent event) {
if (event != null){
time = event.getTimestamp();
}
}
};
*/
private BandContactEventListener mContactEventListener = new BandContactEventListener() {
@Override
public void onBandContactChanged(BandContactEvent event) {
if (event != null) {
long time = event.getTimestamp();
contact = event.getContactState();
}
}
};
private boolean getConnectedBandClient() throws InterruptedException, BandException {
if (client == null) {
BandInfo[] devices = BandClientManager.getInstance().getPairedBands();
if (devices.length == 0) {
appendToUI("Band isn't paired with your phone.\n");
return false;
}
client = BandClientManager.getInstance().create(getBaseContext(), devices[0]);
} else if (ConnectionState.CONNECTED == client.getConnectionState()) {
return true;
}
appendToUI("Band is connecting...\n");
return ConnectionState.CONNECTED == client.connect().await();
}
private class writeOnFile extends AsyncTask<Params, Void, Void>{
@Override
protected Void doInBackground(Params...params) {
String filename = params[0].filename;
String update = params[0].update;
String firstLine = params[0].firstLine;
file = new File(dir, filename);
if(!file.exists()) {
try {
file.createNewFile();
FileOutputStream nfos = null;
try {
nfos = new FileOutputStream(file,true);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
OutputStreamWriter nosw = new OutputStreamWriter(nfos);
try {
nosw.write(firstLine);
nosw.flush();
nosw.close();
} catch (Exception ex) {
Log.e("DEBUG", "HERE");
ex.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
}
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file,true);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
OutputStreamWriter osw = new OutputStreamWriter(fos);
try {
osw.write(update);
osw.flush();
osw.close();
} catch (Exception ex) {
Log.e("DEBUG", "HERE");
ex.printStackTrace();
}
return null;
}
}
private void writeOnDB (long timeStamp, float value){
//Intent aware = new Intent(this, Aware.class);
// startService(aware);
ContentValues new_data = new ContentValues();
new_data.put(bandProvider.Band_Data.DEVICE_ID, Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID));
new_data.put(bandProvider.Band_Data.TIMESTAMP, timeStamp);
new_data.put(bandProvider.Band_Data._Value, value);
getContentResolver().insert(bandProvider.Band_Data.CONTENT_URI, new_data);
}
/**
private class UploadWebpageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
// params comes from the execute() call: params[0] is the url.
try {
final String result = uploadUrl(urls[0]);
runOnUiThread(new Runnable() {
@Override
public void run() {
resultText.setText(result);
}
});
return uploadUrl(urls[0]);
} catch (IOException e) {
return "Unable to retrieve web page. URL may be invalid.";
}
}
**/
private String uploadUrl(String myurl, long timestamp, float value) throws IOException {
InputStream is = null;
int len = 2500;
URL url = new URL(myurl);
String paramString = "time = " + Long.toString(timestamp) + " " +
"value = " + Float.toString(value);
String urlParameter = "param1="+paramString;
byte[] postData = urlParameter.getBytes(StandardCharsets.UTF_8);
String base64 = Base64.encodeToString(postData, Base64.DEFAULT);
int postDataLength = postData.length;
byte[] uploadData = myurl.getBytes(StandardCharsets.UTF_8);
int uploadDataLength = uploadData.length;
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setInstanceFollowRedirects(false);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("charset", "utf-8");
//conn.setRequestProperty("Content-Length", Integer.toString(postDataLength));
conn.setRequestProperty("Content-Length", Integer.toString(postDataLength));
conn.setUseCaches(false);
try( DataOutputStream wr = new DataOutputStream( conn.getOutputStream())) {
wr.write( postData );
}
String offsetAmount = base64Encoder(timeZoneBuilder());
//DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
//wr.write(uploadData);
conn.getInputStream();
String android_id = Settings.Secure.getString(getBaseContext().getContentResolver(), Settings.Secure.ANDROID_ID);
//String contentAsString = readIt(is, len);
return "uploading data";
}
private String timeZoneBuilder() {
String timeZone = "";
Date now = new Date();
int offsetFromUTC = TimeZone.getDefault().getOffset(now.getTime())/3600000;
String offsetAmount = Integer.toString(offsetFromUTC);
if (offsetFromUTC>=0) {
timeZone = timeZone + "+";
} else if (offsetFromUTC<0) {
timeZone = timeZone + "-";
}
if (Math.abs(offsetFromUTC)<10) {
timeZone = timeZone + "0";
}
timeZone = timeZone + Integer.toString(Math.abs(offsetFromUTC))+ ":00" ;
return timeZone;
}
private String base64Encoder (String stringToEncode) {
byte[] stringToByte = stringToEncode.getBytes(StandardCharsets.UTF_8);
String base64 = Base64.encodeToString(stringToByte, Base64.DEFAULT);
return base64;
}
// onPostExecute displays the results of the AsyncTask.
//Given a URL, establishes an HTTPUrlConnection and uploads
// the data given to it via HTTPPost
public void writeOnServer(long timestamp, float value) throws IOException {
String myURL = "http://epiwork.hcii.cs.cmu.edu/~afsaneh/connection.php";
InputStream is = null;
int len = 2500;
String myurl = "http://epiwork.hcii.cs.cmu.edu/~afsaneh/connection.php";
URL url = new URL("http://epiwork.hcii.cs.cmu.edu/~afsaneh/connection.php");
String paramString = "time = " + Long.toString(timestamp) + " " +
"value = " + Float.toString(value);
String urlParameter = "param1="+paramString;
byte[] postData = urlParameter.getBytes(StandardCharsets.UTF_8);
String base64 = Base64.encodeToString(postData, Base64.DEFAULT);
//int postDataLength = postData.length;
byte[] uploadData = myurl.getBytes(StandardCharsets.UTF_8);
int uploadDataLength = uploadData.length;
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setInstanceFollowRedirects(false);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("charset", "utf-8");
//conn.setRequestProperty("Content-Length", Integer.toString(postDataLength));
conn.setRequestProperty("Content-Length", Integer.toString(uploadDataLength));
conn.setUseCaches(false);
/*
try( DataOutputStream wr = new DataOutputStream( conn.getOutputStream())) {
wr.write( postData );
}
*/
//String offsetAmount = base64Encoder(timeZoneBuilder());
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.write(uploadData);
//conn.getInputStream();
//String android_id = Settings.Secure.getString(getBaseContext().getContentResolver(), Settings.Secure.ANDROID_ID);
//String contentAsString = readIt(is, len);
// return base64Encoder(android_id) + " " + offsetAmount + " " + base64 + " " + uploadData;
}
private void writeOnCalendar (long timeStamp, float value){
ContentValues event = new ContentValues();
ContentResolver cr = getContentResolver();
ContentValues values = new ContentValues();
values.put(CalendarContract.Events.DTSTART, timeStamp);
values.put(CalendarContract.Events.DTEND, timeStamp + 60*60*1000);
values.put(CalendarContract.Events.TITLE, Float.toString(value));
values.put(CalendarContract.Events.CALENDAR_ID, 1);
values.put(CalendarContract.Events.EVENT_TIMEZONE, "New_York");
Uri eventsUri = Uri.parse("content://com.android.calendar/events");
Uri insertedUri = getContentResolver().insert(eventsUri, values);
}
}
| [
"minjaes@andrew.cmu.edu"
] | minjaes@andrew.cmu.edu |
e0b1bbd913d1cc2e7cae287d3790e809a0533019 | 192fc75e245f8834861c2a8dbe9714daa2ec6c2e | /CWE80_XSS/CWE80_XSS__Servlet_PropertiesFile_17.java | bf5caf01efa887a8eda94af5b57df00fecba3ed5 | [] | no_license | Carlosboie/Playtech | 6f8bb72efc6769612a0cb967a9130f6db78d19fc | 684ae94b9b0ff069c8561157227b5b43a7ca1320 | refs/heads/master | 2021-05-27T11:05:24.157218 | 2012-09-12T08:08:30 | 2012-09-12T08:08:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,876 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE80_XSS__Servlet_PropertiesFile_17.java
Label Definition File: CWE80_XSS__Servlet.label.xml
Template File: sources-sink-17.tmpl.java
*/
/*
* @description
* CWE: 80 Cross Site Scripting (XSS)
* BadSource: PropertiesFile Read a value from a .properties file (in property named data)
* GoodSource: A hardcoded string
* BadSink: Servlet querystring parameter not sanitized
* Flow Variant: 17 Control flow: for loops
*
* */
package testcases.CWE80_XSS;
import testcasesupport.*;
import javax.servlet.http.*;
import java.util.Properties;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.logging.Logger;
public class CWE80_XSS__Servlet_PropertiesFile_17 extends AbstractTestCaseServlet
{
/* uses badsource and badsink */
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* We need to have one source outside of a for loop in order
to prevent the Java compiler from generating an error because
data is uninitialized */
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
/* retrieve the property */
Properties props = new Properties();
FileInputStream finstr = null;
try {
finstr = new FileInputStream("../common/config.properties");
props.load(finstr);
data = props.getProperty("data");
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally {
/* clean up stream reading objects */
try {
if( finstr != null )
{
finstr.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
}
for(int for_index_i = 0; for_index_i < 0; for_index_i++)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
if (data != null)
{
/* POTENTIAL FLAW: data not validated */
response.getWriter().println("<br>bad() - Parameter name has value " + data);
}
}
/* goodG2B() - use goodsource and badsink by reversing the block outside the
for statement with the one in the for statement */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
for(int for_index_i = 0; for_index_i < 0; for_index_i++)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
/* retrieve the property */
Properties props = new Properties();
FileInputStream finstr = null;
try
{
finstr = new FileInputStream("../common/config.properties");
props.load(finstr);
data = props.getProperty("data");
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally
{
/* clean up stream reading objects */
try {
if( finstr != null )
{
finstr.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
}
}
if (data != null)
{
/* POTENTIAL FLAW: data not validated */
response.getWriter().println("<br>bad() - Parameter name has value " + data);
}
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"amitf@checkmarx.com"
] | amitf@checkmarx.com |
31f738be2244882b7d230a298a7f7cb865b3f379 | 42d789bc3ea5ac7c0e90a089863c98d6c54c8a3b | /app/src/main/java/com/example/celine/mymoviesapp/MoviesResponse.java | a8b15c63bfd65f9e5b4e911c8b3e1c3255655552 | [] | no_license | ccarlier92/PROJECT_MOBILE | 8fdfe1ba389e69b99f4735677b60b04de792ea20 | 4c72816b7bbdec5e5d1ba5c5d6526822d1c5dfc7 | refs/heads/master | 2020-04-30T22:59:06.244270 | 2019-03-22T12:05:39 | 2019-03-22T12:05:39 | 177,132,996 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | package com.example.projectmobile;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class MoviesResponse {
@SerializedName("page")
@Expose
private int page;
@SerializedName("total_results")
@Expose
private int totalResults;
@SerializedName("results")
@Expose
private List<Movie> movies;
@SerializedName("total_pages")
@Expose
private int totalPages;
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getTotalResults() {
return totalResults;
}
public void setTotalResults(int totalResults) {
this.totalResults = totalResults;
}
public List<Movie> getMovies() {
return movies;
}
public void setMovies(List<Movie> movies) {
this.movies = movies;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
}
| [
"celine.carlier@devinci.fr"
] | celine.carlier@devinci.fr |
011569d3be4214e321b56abbf72c99825b4d5ae5 | f56575a1e6c22fc83ff2bd381c9d6175c3aaeebf | /src/main/java/com/cxf/mblog/base/oauth/OauthOsc.java | dc43bba8c2ca44fe27da8946a2a28c0469649be0 | [] | no_license | Mrchai521/chai-bolg | f3bed9865ba3ee7f390415152d081144655ea6e0 | b227b7de7f00bc0cb3e8880bbe8f7b932a4f7afa | refs/heads/master | 2023-08-05T08:33:01.617427 | 2021-09-24T02:44:36 | 2021-09-24T02:44:36 | 314,513,909 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,988 | java | package com.cxf.mblog.base.oauth;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cxf.mblog.base.oauth.utils.OathConfig;
import com.cxf.mblog.base.oauth.utils.TokenUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.util.HashMap;
import java.util.Map;
public class OauthOsc extends Oauth {
private static final Logger LOGGER = LoggerFactory.getLogger(OauthOsc.class);
private static final String AUTH_URL = "http://www.oschina.net/action/oauth2/authorize";
private static final String TOKEN_URL = "http://www.oschina.net/action/openapi/token";
private static final String USER_INFO_URL = "http://www.oschina.net/action/openapi/user";
private static final String TWEET_PUB = "http://www.oschina.net/action/openapi/tweet_pub";
public static OauthOsc me() {
return new OauthOsc();
}
public OauthOsc() {
setClientId(OathConfig.getValue("openid_osc"));
setClientSecret(OathConfig.getValue("openkey_osc"));
setRedirectUri(OathConfig.getValue("redirect_osc"));
}
public String getAuthorizeUrl(String state) throws UnsupportedEncodingException {
Map<String, String> params = new HashMap<>();
params.put("response_type", "code");
params.put("client_id", getClientId());
params.put("redirect_uri", getRedirectUri());
if (StringUtils.isNotBlank(state)) {
params.put("state", state);
}
return super.getAuthorizeUrl("http://www.oschina.net/action/oauth2/authorize", params);
}
public String getTokenByCode(String code) throws IOException, KeyManagementException, NoSuchAlgorithmException, NoSuchProviderException {
Map<String, String> params = new HashMap<>();
params.put("code", code);
params.put("client_id", getClientId());
params.put("client_secret", getClientSecret());
params.put("grant_type", "authorization_code");
params.put("redirect_uri", getRedirectUri());
String token = TokenUtil.getAccessToken(super.doGet("http://www.oschina.net/action/openapi/token", params));
LOGGER.debug(token);
return token;
}
public JSONObject getUserInfo(String accessToken) throws IOException, KeyManagementException, NoSuchAlgorithmException, NoSuchProviderException {
Map<String, String> params = new HashMap<>();
params.put("access_token", accessToken);
String userInfo = super.doGet("http://www.oschina.net/action/openapi/user", params);
JSONObject dataMap = JSON.parseObject(userInfo);
LOGGER.debug(dataMap.toJSONString());
return dataMap;
}
public JSONObject tweetPub(String accessToken, String msg) {
Map<String, String> params = new HashMap<>();
params.put("access_token", accessToken);
params.put("msg", msg);
try {
JSONObject dataMap = JSON.parseObject(super.doPost("http://www.oschina.net/action/openapi/tweet_pub", params));
LOGGER.debug(JSON.toJSONString(dataMap));
} catch (KeyManagementException | NoSuchAlgorithmException | NoSuchProviderException | IOException e) {
LOGGER.error(e.getMessage(), e);
}
return null;
}
public JSONObject getUserInfoByCode(String code) throws IOException, KeyManagementException, NoSuchAlgorithmException, NoSuchProviderException {
String accessToken = getTokenByCode(code);
if (StringUtils.isBlank(accessToken)) {
return null;
}
JSONObject dataMap = getUserInfo(accessToken);
dataMap.put("access_token", accessToken);
LOGGER.debug(JSON.toJSONString(dataMap));
return dataMap;
}
}
| [
"1261853718@qq.com"
] | 1261853718@qq.com |
4a9e364dbece91b155fdc783325a97daee1643c6 | b2002471733e3fd325bcbd178bdf70d73f907fc4 | /test/KthSmallestPrimeFraction.java | 841869a762f5ac492961cf061c6ce518488d2798 | [] | no_license | kantrar/hacker-rank | c389563e72d885ada803dc464bbfee0b3d4ec161 | bdeb71b8acfdbd011b735e68690d83a9ba697f6e | refs/heads/master | 2022-10-15T03:46:26.781084 | 2019-11-07T14:49:02 | 2019-11-07T14:49:02 | 164,281,437 | 0 | 0 | null | 2022-10-04T23:47:26 | 2019-01-06T06:25:36 | Java | UTF-8 | Java | false | false | 586 | java | import java.util.PriorityQueue;
public class KthSmallestPrimeFraction {
public int[] kthSmallestPrimeFraction(int[] A, int K) {
PriorityQueue<int[]> queue = new PriorityQueue<>((a, b) -> A[a[0]] * A[b[1]] - A[b[0]] * A[a[1]]);
for (int i = 0; i < A.length - 1; i++) {
queue.offer(new int[] {i, A.length - 1});
}
while (K > 1 && !queue.isEmpty()) {
int[] cur = queue.poll();
if (cur[0] + 1 != cur[1]) {
queue.offer(new int[] {cur[0], cur[1] - 1});
}
K--;
}
return queue.isEmpty() ? new int[0] : new int[] {A[queue.peek()[0]], A[queue.peek()[1]]};
}
}
| [
"krantharat@wongnai.com"
] | krantharat@wongnai.com |
f7ae8a1efd78f870b3695f97dc96513d63c94b15 | f473682f61dbb73a8f340570dd6573e1af93cf4a | /recipe/.svn/pristine/f7/f7ae8a1efd78f870b3695f97dc96513d63c94b15.svn-base | 74ee5008f2f02790314bebb37956176aee513231 | [] | no_license | SkyKim1016/A.I-Admin | 37e9ee5551024138c30e754942899fe9a1a51133 | d4eb617c2dbf43e76bb3dcc0145477f6b0abb876 | refs/heads/master | 2021-06-11T00:31:00.755387 | 2017-01-29T23:46:17 | 2017-01-29T23:46:17 | 77,774,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,037 | package com.onethefull.recipe.mapper;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.onethefull.recipe.comm.auth.User;
import com.onethefull.recipe.comm.auth.UserSimple;
import com.onethefull.recipe.comm.vo.DeviceVO;
import com.onethefull.recipe.comm.vo.PageInfoVO;
import com.onethefull.recipe.req.AuthTokenReq;
import com.onethefull.recipe.req.ModifyFavoriteStep1Req;
import com.onethefull.recipe.req.UserDeviceReq;
import com.onethefull.recipe.req.UserReq;
import com.onethefull.recipe.req.UserServiceProviderInfoReq;
import com.onethefull.recipe.vo.CheckActivityVO;
import com.onethefull.recipe.vo.CheckHealthVO;
import com.onethefull.recipe.vo.CheckJobVO;
@Repository("userAuthMapper")
public interface UserAuthMapper {
public User getUserbyAuthToken(User user);
public User findUserbyIdPassword(UserReq req);
public User findUserbyLoginId(UserReq req);
public User findUserbyId(UserReq req);
public User findUserbyProviderUserId(UserServiceProviderInfoReq req);
public User findUserbyDeviceInfo(UserServiceProviderInfoReq req);
public int setAuthToken(AuthTokenReq req);
public int setUserDeviceInfo(UserDeviceReq req);
public DeviceVO getUserDeviceInfo(UserDeviceReq req);
public int setUserServiceProviderInfo(UserServiceProviderInfoReq req);
public int registerUserbyDeviceInfo(UserServiceProviderInfoReq req);
public int modifyFavoriteStep1(ModifyFavoriteStep1Req req);
public List<CheckHealthVO> getCheckHealthList(UserReq req);
public List<CheckJobVO> getCheckJobList(UserReq req);
public CheckActivityVO getCheckActivityLevel(UserReq req);
public CheckActivityVO getAgeLevel(UserReq req);
public void modifyCheckHealth(UserReq req);
public void modifyCheckJob(UserReq req);
public void modifyCheckActivityLevel(UserReq req);
public void modifyAgeLevel(UserReq req);
public PageInfoVO getUsersPageInfo(UserReq req);
public List<UserSimple> getUsersList(UserReq req);
public int updateUser(UserReq userReq);
}
| [
"skykim1016@gmail.com"
] | skykim1016@gmail.com | |
81bb27e887fea125c27f09c6b71b7b43cf4337a3 | 1d59eb18c837a03adcfb79796ce935312df84f73 | /src/main/java/lemon/day16/section01/All_Test_Case1.java | 9b8684c155fa3b48cae19a40dbe6567392d25e2f | [] | no_license | Liyinglong1/LemonStudy_Maven | 7f3c52603c162711a27a2c575fbc06b00aaa30f2 | 98ae415c75a80ac46a7f46d6dea47a93db972a75 | refs/heads/master | 2022-07-20T11:54:11.656996 | 2019-09-23T00:01:42 | 2019-09-23T00:01:42 | 204,883,557 | 0 | 0 | null | 2022-06-29T17:39:10 | 2019-08-28T08:24:39 | Java | UTF-8 | Java | false | false | 1,362 | java | package lemon.day16.section01;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.JsonPath;
/**
* code为2 msg是不存在-->描述成json
* {"code":2,"msg":"账号已存在","msg":"xxxxx"}-->object
* [{"jsonPath":"$.code","expected":2},"jsonPath":"$.msg","expected":"账号已存在"}]
* @author happy
* http://www.lemfix.com/topics/54 -->jsonpath
* http://www.lemfix.com/topics/75
*
*/
public class All_Test_Case1 {
/**
* 数据提供者
* @return 二维数组
*/
@DataProvider
public Object[][] getData() {
return ApiUtils.getData();
}
/**
*
* @param apiCaseDetail
*/
@Test(dataProvider = "getData")
public void test_case(ApiCaseDetail apiCaseDetail) {
String result = HttpUtils.excute(apiCaseDetail);
System.out.println(result);
}
public static void main(String[] args) {
String jsonStr = "{\"code\":2,\"msg\":\"账号已存在\",\"data\":null,\"copyright\":\"Copyright 柠檬班 © 2017-2019 湖南省零檬信息技术有限公司 All Rights Reserved\"}\n" +
"";
String jsonPath = "$.copyright";
Object document = Configuration.defaultConfiguration().jsonProvider().parse(jsonStr);
Object code = JsonPath.read(document, jsonPath);
System.out.println(code);
}
}
| [
"1320694234@qq.com"
] | 1320694234@qq.com |
b4cf1086a9cc585e64b9f1a5ade0ff4081210071 | 8dfd77caab244debdf56f66b6465e06732364cd8 | /projects/jasn1-compiler/src/test/java-gen/org/openmuc/jasn1/compiler/rspdefinitions/DpProprietaryData.java | 535d195e7c5c3706a2541c19d3a71b393f48e245 | [] | no_license | onderson/jasn1 | d195c568b2bf62e9ef558d1caea6e228239ad848 | 6df87b86391360758fa559d55b9aa6fb98c7f507 | refs/heads/master | 2021-08-18T16:30:05.353553 | 2017-07-19T18:39:08 | 2017-07-19T18:39:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,513 | java | /**
* This class file was automatically generated by jASN1 v1.8.2-SNAPSHOT (http://www.openmuc.org)
*/
package org.openmuc.jasn1.compiler.rspdefinitions;
import java.io.IOException;
import java.io.EOFException;
import java.io.InputStream;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
import org.openmuc.jasn1.ber.*;
import org.openmuc.jasn1.ber.types.*;
import org.openmuc.jasn1.ber.types.string.*;
import org.openmuc.jasn1.compiler.pkix1explicit88.Certificate;
import org.openmuc.jasn1.compiler.pkix1explicit88.CertificateList;
import org.openmuc.jasn1.compiler.pkix1explicit88.Time;
import org.openmuc.jasn1.compiler.pkix1implicit88.SubjectKeyIdentifier;
public class DpProprietaryData implements Serializable {
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
public byte[] code = null;
public BerObjectIdentifier dpOid = null;
public DpProprietaryData() {
}
public DpProprietaryData(byte[] code) {
this.code = code;
}
public DpProprietaryData(BerObjectIdentifier dpOid) {
this.dpOid = dpOid;
}
public int encode(BerByteArrayOutputStream os) throws IOException {
return encode(os, true);
}
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
if (code != null) {
for (int i = code.length - 1; i >= 0; i--) {
os.write(code[i]);
}
if (withTag) {
return tag.encode(os) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += dpOid.encode(os, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
os.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(os, codeLength);
if (withTag) {
codeLength += tag.encode(os);
}
return codeLength;
}
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int codeLength = 0;
int subCodeLength = 0;
BerTag berTag = new BerTag();
if (withTag) {
codeLength += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
codeLength += length.decode(is);
int totalLength = length.val;
if (totalLength == -1) {
subCodeLength += berTag.decode(is);
if (berTag.tagNumber == 0 && berTag.tagClass == 0 && berTag.primitive == 0) {
int nextByte = is.read();
if (nextByte != 0) {
if (nextByte == -1) {
throw new EOFException("Unexpected end of input stream.");
}
throw new IOException("Decoded sequence has wrong end of contents octets");
}
codeLength += subCodeLength + 1;
return codeLength;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
dpOid = new BerObjectIdentifier();
subCodeLength += dpOid.decode(is, false);
subCodeLength += berTag.decode(is);
}
int nextByte = is.read();
if (berTag.tagNumber != 0 || berTag.tagClass != 0 || berTag.primitive != 0
|| nextByte != 0) {
if (nextByte == -1) {
throw new EOFException("Unexpected end of input stream.");
}
throw new IOException("Decoded sequence has wrong end of contents octets");
}
codeLength += subCodeLength + 1;
return codeLength;
}
codeLength += totalLength;
subCodeLength += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
dpOid = new BerObjectIdentifier();
subCodeLength += dpOid.decode(is, false);
if (subCodeLength == totalLength) {
return codeLength;
}
}
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
encode(os, false);
code = os.getArray();
}
public String toString() {
StringBuilder sb = new StringBuilder();
appendAsString(sb, 0);
return sb.toString();
}
public void appendAsString(StringBuilder sb, int indentLevel) {
sb.append("{");
sb.append("\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
if (dpOid != null) {
sb.append("dpOid: ").append(dpOid);
}
else {
sb.append("dpOid: <empty-required-field>");
}
sb.append("\n");
for (int i = 0; i < indentLevel; i++) {
sb.append("\t");
}
sb.append("}");
}
}
| [
"stefan.feuerhahn@ise.fraunhofer.de"
] | stefan.feuerhahn@ise.fraunhofer.de |
9c450f604e8732c3e7d138f4228fe4deee11b454 | cfb0bb73ade43a47ba9c22d85109f978508c068e | /thesis-app-proxy/src/main/java/cz/ondrejsmetak/parser/CipherParser.java | 9e78ad319bdfd55fb9f7638059bb9eefa38471dd | [
"Unlicense"
] | permissive | fredomgc/ssl-tls-client-scanner | d8e50b67eae1cd9c4b1b0b80e2bc15a4f2ae46f8 | 72c0557307314ec7835376be5dbb21f3841afcdb | refs/heads/master | 2018-12-19T13:27:19.906716 | 2018-09-16T02:36:49 | 2018-09-16T02:36:49 | 110,525,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,599 | java | package cz.ondrejsmetak.parser;
import cz.ondrejsmetak.CipherSuiteRegister;
import cz.ondrejsmetak.entity.CipherSuite;
import cz.ondrejsmetak.entity.Mode;
import cz.ondrejsmetak.other.XmlParserException;
import cz.ondrejsmetak.ResourceManager;
import cz.ondrejsmetak.tool.Helper;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
*
* @author Ondřej Směták <posta@ondrejsmetak.cz>
*/
public class CipherParser extends BaseParser {
public static final String FILE = "ciphers.xml";
private static final String TAG_CIPHER_SUITES = "cipherSuites";
private static final String TAG_CIPHER_SUITE = "cipherSuite";
private static final String ATTRIBUTE_HEX_VALUE = "hexValue";
private static final String ATTRIBUTE_NAME = "name";
@Override
public void createDefault() throws IOException {
InputStream source = ResourceManager.getDefaultConfigurationXml();
Path destination = new File(FILE).toPath();
Files.copy(source, destination);
}
@Override
public boolean hasDefaultFile() {
return true; //always true, because file is part of resources
}
private void checkNode(Node node) throws XmlParserException {
ArrayList supportedTags = new ArrayList<>(Arrays.asList(new String[]{
TAG_CIPHER_SUITES,
TAG_CIPHER_SUITE}));
if (!supportedTags.contains(node.getNodeName())) {
throw new XmlParserException("Unknown tag [%s]. You must use only supported tags!", node.getNodeName());
}
/**
* Tag "cipherSuite" must have "name" and "hexValue" atribute
*/
if (node.getNodeName().equals(TAG_CIPHER_SUITE)) {
checkAttributesOfNode(node, ATTRIBUTE_HEX_VALUE, ATTRIBUTE_NAME);
}
}
public void parse() throws XmlParserException {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(ResourceManager.getCiphersConfigurationXml());
doc.getDocumentElement().normalize();
NodeList tags = doc.getElementsByTagName("*");
NodeList cipherSuites = doc.getElementsByTagName(TAG_CIPHER_SUITES);
if (cipherSuites.getLength() != 1 || !(cipherSuites.item(0) instanceof Element)) {
throw new XmlParserException(String.format("Tag [%s] must be specified exatly once.", TAG_CIPHER_SUITES));
}
/**
* Parse cipher suites and store them
*/
for (int i = 0; i < tags.getLength(); i++) {
Node node = tags.item(i);
checkNode(node);
if (node.getNodeType() == Node.ELEMENT_NODE) {
/**
* Cipher suite
*/
parseCipherSuite((Element) node);
}
}
} catch (ParserConfigurationException | SAXException | IllegalArgumentException | IOException ex) {
throw new XmlParserException(ex);
}
}
private void parseCipherSuite(Node node) throws XmlParserException {
if (!(node instanceof Element)) {
return;
}
Element element = (Element) node;
if (element.getTagName().equals(TAG_CIPHER_SUITE)) {
String hexValue = element.getAttribute(ATTRIBUTE_HEX_VALUE);
checkHexValue(hexValue, 4);
String name = element.getAttribute(ATTRIBUTE_NAME);
CipherSuite cipherSuite = new CipherSuite(hexValue, name, new Mode(Mode.Type.CAN_BE));
if (cipherSuite.getHex().equals(CipherSuiteRegister.TLS_FALLBACK_SCSV_HEX)) {
throw new XmlParserException("Cipher suite TLS_FALLBACK_SCSV is supported by directive \"tlsFallbackScsv\". "
+ "Please, remove this cipher suite from \"cipherSuites\" section!", cipherSuite);
}
if (CipherSuiteRegister.getInstance().containsCipherSuite(cipherSuite)) {
throw new XmlParserException("Cipher suite [%s] is already present!", cipherSuite);
}
CipherSuiteRegister.getInstance().addCipherSuite(cipherSuite);
}
}
/**
* Check if given value is in valid hexadecimal with expected digits count
*
* @param value
* @param size
* @throws XmlParserException
*/
private void checkHexValue(String value, int digits) throws XmlParserException {
if (!Helper.isHex(value)) {
throw new XmlParserException("Value [%s] isn't valid hexadecimal value!", value);
}
if (value.length() != digits) {
throw new XmlParserException("Value [%s] must have exactly [%s] digit(s)!", value, digits);
}
}
}
| [
"posta@ondrejsmetak.cz"
] | posta@ondrejsmetak.cz |
8cdaecb18612f7512bdc8546d1f0b4104db02e8d | 663b012c2a534afc64a9a08d19f25bdc7226d7fb | /library/common/src/main/java/com/yuepointbusiness/common/base/BaseFragment.java | efeac8ac8b94bddeffa50f76994e250acd9f654e | [] | no_license | lylandroid/hui_share | e562f78246b951b79dbaaa0d409581fd62e044cc | 82423bcec33b06b0952e158f0384eeeb90827b36 | refs/heads/master | 2020-07-06T20:20:53.388333 | 2019-08-27T03:52:41 | 2019-08-27T03:52:41 | 203,129,280 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,286 | java | package com.yuepointbusiness.common.base;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.yuepointbusiness.common.R;
import com.yuepointbusiness.common.baserx.RxManager;
import com.yuepointbusiness.common.commonutils.TUtil;
import com.yuepointbusiness.common.commonutils.ToastUitl;
import com.yuepointbusiness.common.commonwidget.LoadingDialog;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* des:基类fragment
* Created by xsf
* on 2016.07.12:38
*/
/***************使用例子*********************/
//1.mvp模式
//public class SampleFragment extends BaseFragment<NewsChanelPresenter, NewsChannelModel>implements NewsChannelContract.View {
// @Override
// public int getLayoutId() {
// return R.layout.activity_news_channel;
// }
//
// @Override
// public void initPresenter() {
// mPresenter.setVM(this, mModel);
// }
//
// @Override
// public void initView() {
// }
//}
//2.普通模式
//public class SampleFragment extends BaseFragment {
// @Override
// public int getLayoutResource() {
// return R.layout.activity_news_channel;
// }
//
// @Override
// public void initPresenter() {
// }
//
// @Override
// public void initView() {
// }
//}
public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel> extends Fragment {
protected View rootView;
public T mPresenter;
public E mModel;
public RxManager mRxManager;
private Unbinder unbinder;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (rootView == null)
rootView = inflater.inflate(getLayoutResource(), container, false);
mRxManager=new RxManager();
unbinder = ButterKnife.bind(this, rootView);
mPresenter = TUtil.getT(this, 0);
mModel= TUtil.getT(this,1);
if(mPresenter!=null){
mPresenter.mContext=this.getActivity();
}
initPresenter();
initView();
return rootView;
}
//获取布局文件
protected abstract int getLayoutResource();
//简单页面无需mvp就不用管此方法即可,完美兼容各种实际场景的变通
public abstract void initPresenter();
//初始化view
protected abstract void initView();
/**
* 通过Class跳转界面
**/
public void startActivity(Class<?> cls) {
startActivity(cls, null);
}
/**
* 通过Class跳转界面
**/
public void startActivityForResult(Class<?> cls, int requestCode) {
startActivityForResult(cls, null, requestCode);
}
/**
* 含有Bundle通过Class跳转界面
**/
public void startActivityForResult(Class<?> cls, Bundle bundle,
int requestCode) {
Intent intent = new Intent();
intent.setClass(getActivity(), cls);
if (bundle != null) {
intent.putExtras(bundle);
}
startActivityForResult(intent, requestCode);
}
/**
* 含有Bundle通过Class跳转界面
**/
public void startActivity(Class<?> cls, Bundle bundle) {
Intent intent = new Intent();
intent.setClass(getActivity(), cls);
if (bundle != null) {
intent.putExtras(bundle);
}
startActivity(intent);
}
/**
* 开启加载进度条
*/
public void startProgressDialog() {
LoadingDialog.showDialogForLoading(getActivity());
}
/**
* 开启加载进度条
*
* @param msg
*/
public void startProgressDialog(String msg) {
LoadingDialog.showDialogForLoading(getActivity(), msg, true);
}
/**
* 停止加载进度条
*/
public void stopProgressDialog() {
LoadingDialog.cancelDialogForLoading();
}
/**
* 短暂显示Toast提示(来自String)
**/
public void showShortToast(String text) {
ToastUitl.showShort(text);
}
/**
* 短暂显示Toast提示(id)
**/
public void showShortToast(int resId) {
ToastUitl.showShort(resId);
}
/**
* 长时间显示Toast提示(来自res)
**/
public void showLongToast(int resId) {
ToastUitl.showLong(resId);
}
/**
* 长时间显示Toast提示(来自String)
**/
public void showLongToast(String text) {
ToastUitl.showLong(text);
}
public void showToastWithImg(String text,int res) {
ToastUitl.showToastWithImg(text,res);
}
/**
* 网络访问错误提醒
*/
public void showNetErrorTip() {
ToastUitl.showToastWithImg(getText(R.string.net_error).toString(),R.drawable.ic_wifi_off);
}
public void showNetErrorTip(String error) {
ToastUitl.showToastWithImg(error,R.drawable.ic_wifi_off);
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
if (mPresenter != null)
mPresenter.onDestroy();
mRxManager.clear();
}
}
| [
"yilan.luo@zhangmen.com"
] | yilan.luo@zhangmen.com |
cf515a3b13a038501b63b73ed5f21032f5bd9952 | e93ad1115550ed80872a79e10f18176863c0c330 | /conference-java/src/main/java/AppConfig2.java | dfe11411648eb2381bab7d4189c8ca2ba871887f | [] | no_license | jingchen01/SpringProjects | eaea48f5404b2092587aa809d71309cbc0acdb8d | cbe60d67ab07913c7e3b5b2f255319386dc9a2f2 | refs/heads/master | 2022-12-17T14:05:45.529110 | 2020-09-18T08:22:40 | 2020-09-18T08:22:40 | 296,051,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 201 | java | import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan({"com.springdemo"})
public class AppConfig2 {
}
| [
"landscape.chen@gmail.com"
] | landscape.chen@gmail.com |
70d0ce9aacb1621128b40a56bc2254906a3c6ef6 | 19d34b44b6714b33984208435cd62dc67bac047a | /MineCraft2D/src/dev/project/game/gfx/Text.java | a468d3b549934cd1662941f6072a31d96088ec58 | [
"Apache-2.0"
] | permissive | stressedtyagi/MineCraft2D | 998755d609d88982b282d45e3bb68184348e921f | 1e87c76de1c7a4dfd92cb457e12b94f36060178b | refs/heads/master | 2022-02-20T09:01:45.630862 | 2018-06-07T15:53:13 | 2018-06-07T15:53:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package dev.project.game.gfx;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
public class Text {
public static void drawString(Graphics g, String text, int xPos, int yPos, boolean center, Color c, Font font){
g.setColor(c);
g.setFont(font);
int x = xPos;
int y = yPos;
if(center){
FontMetrics fm = g.getFontMetrics(font);
x = xPos - fm.stringWidth(text) / 2;
y = (yPos - fm.getHeight() / 2) + fm.getAscent();
}
g.drawString(text, x, y);
}
}
| [
"divyanshutyagi8@gmail.com"
] | divyanshutyagi8@gmail.com |
4ae8f3ec2ab08d415322d33b59de1fe896eec449 | 04c378bddc6b97385880fe69fa64ce8c474f3fc4 | /JDBC Programs/JdbcAssignment/src/service/EmployeeService.java | 078e74bf3b1ca3bc46ace3c8b72aef92fdc3538c | [] | no_license | Kaleakash/onmobilebangalorejavafullstack | c994ec0c51751e2493708e8867651d1adbabb396 | 4beb86734f1d346cc0fa7b2ddea388a501199ca8 | refs/heads/master | 2023-01-07T16:25:03.156914 | 2019-11-21T10:36:36 | 2019-11-21T10:36:36 | 206,296,478 | 0 | 1 | null | 2023-01-07T11:59:45 | 2019-09-04T10:46:52 | JavaScript | UTF-8 | Java | false | false | 1,083 | java | package service;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import bean.Employee;
import dao.EmployeeDao;
public class EmployeeService {
EmployeeDao ed;
public EmployeeService() {
ed = new EmployeeDao();
}
public String addEmployee(Employee emp) {
if(emp.getSalary()>12000) {
if(ed.storeEmployeeInfo(emp)>0) {
return "Record stored Successfully";
}else {
return "Record not store";
}
}else {
return "Salary must be >12000";
}
}
public List<Employee> getEmployeeInfo() {
/*List<Employee> listOfRec = ed.retrieveAllEmployeeInfo();
Iterator<Employee> li = listOfRec.iterator();
while(li.hasNext()) {
Employee emp = li.next();
emp.setSalary(emp.getSalary()+500);
}
return listOfRec;*/
return ed.retrieveAllEmployeeInfo().stream().map(e->{e.setSalary(e.getSalary()+500);return e;}).
collect(Collectors.toList());
//return ed.retrieveAllEmployeeInfo();
}
}
| [
"TrainerA@hexaware.com"
] | TrainerA@hexaware.com |
c9554380586218431d2390fbc4dc38e7e20e5d3f | 5328a351fb532065075eff48f8a8111f6659be45 | /src/test/java/main/mainTest.java | 753b429b3a0d1dcd09e3594a1ac6157b8533a2f9 | [] | no_license | zhangxiaozhe8023/ZheInter | 87a12c7d8ee91eceb619855ea7364f6199742d59 | 6c51663d4a85b4aa7fec2e0728b11b9e8534762d | refs/heads/master | 2020-04-22T15:21:12.035765 | 2019-02-13T09:04:57 | 2019-02-13T09:04:57 | 170,474,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,712 | java | package main;
import com.alibaba.fastjson.JSONObject;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import io.restassured.response.ResponseBody;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
public class mainTest{
private String Keywor22;
private String response1;
//参数1:接口传入参数 参数2:传入URL 参数3:请求方式 参数4:返回结果
public void sendPost( Map<String, Object> Mapdata, String PostUrl, String ResponType, String ReCode){
//发送post请求
Response response = RestAssured.given()
.contentType("application/json")
.body(Mapdata)
.when().post(PostUrl);
//获得body信息
String response1 = response.getBody().asString();
if(response1==null){
throw new RuntimeException("发送请求不正确");
}else{
}
//获得JSONObject对象并打印
JSONObject obj = JSONObject.parseObject(response1);
System.out.println(obj.toString());
//获取返回值ciphertext字段内容(密文)
String responseText = obj.getString("ciphertext");
}
//参数1:接口传入参数 参数2:传入URL 参数3:请求方式 参数4:返回结果
@Test
public void sendPost2(){
Map<String, String> Mapcookie = new HashMap<String, String>();
//发送post请求
// Response response = RestAssured.given()
//// .contentType("application/json")
// .formParams("username","18310614641","password","123456a")
// .when().post("http://support.ezhixin.com/a/userLogin");
Response response = RestAssured.given()
// .contentType("application/json")
.formParams("account","15168381330","password","123456")
.when().post("https://wsc.wlo.wxfenxiao.com/wlapi/user/loginIndex");
//获得body信息
String response1 = response.getBody().asString();
Mapcookie = response.getCookies();
System.out.println(Mapcookie);
if(response1==null){
throw new RuntimeException("发送请求不正确");
}else{
System.out.println(response1);
}
}
public void sendPost3(Map<String, Object> Mapdata, String PostUrl, String loginCookie, String resultKeyword) {
Keywor22 = resultKeyword;
System.out.println(Keywor22);
ResponseBody response = RestAssured.given().cookie("JSESSIONID", loginCookie)
.contentType("application/json")
.body(Mapdata)
.when().post(PostUrl);
//获得body信息
response1 = response.asString();
if(response1==null){
throw new RuntimeException("发送请求不正确");
}else{
System.out.println(response1);
}
//判断result返回值,是否包含关键字
Assert.assertThat(response1, isLinkinStr());
}
public Matcher<String> isLinkinStr() {
return new BaseMatcher<String>()
{
public boolean matches(Object item)
{
if (!(item instanceof String))
{
return false;
}
return ((String) item).contains(Keywor22);
}
public void describeTo(Description description)
{
description.appendText("字符串必须包含"+Keywor22+"这个单词。。。");
}
};
}
}
| [
"980778026@qq.com"
] | 980778026@qq.com |
840d9b3021e1064c2b912ba51b0bbc6b4e2fef16 | 571fc48d53e6377d2fe266f84c35181aacc80202 | /Fgcm/app/src/main/java/com/fanwang/fgcm/bean/SearchUserIdBean.java | 98a211b21252964917e0231e9325cf6ed81218cf | [] | no_license | edcedc/Fg | 618a381d4399664d3fac9e04dd7a11b62b752f7e | 19fd32837347fd17f9b43e816e3cc9fd0c207eb4 | refs/heads/master | 2020-04-04T10:08:23.469555 | 2019-06-29T06:09:21 | 2019-06-29T06:09:21 | 155,843,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 739 | java | package com.fanwang.fgcm.bean;
import org.litepal.crud.DataSupport;
import java.util.ArrayList;
import java.util.List;
/**
* Created by edison on 2018/4/25.
*/
public class SearchUserIdBean extends DataSupport{
private int id;
private String userId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
private List<SearchListBean> list = new ArrayList<>();
public List<SearchListBean> getList() {
return list;
}
public void setList(List<SearchListBean> list) {
this.list = list;
}
}
| [
"501807647@qq.com"
] | 501807647@qq.com |
937ebc057872c32d513718c9f1393e1054be1121 | 6a13bff310a0f81174eaa8eedf55017bbfe9aad1 | /minecraft/cartasiane/spells/spells/SpellIndex.java | 3db3aae8670c3df927a4e80acfdf08d6c9f71336 | [] | no_license | theDoubi125/Client_server | 05679152a140b8560e4cf22ecf5cd36991bb89b7 | ede42769083ca88f72e5b14f238e443095e9dfe5 | refs/heads/master | 2020-05-18T11:43:25.268538 | 2012-08-06T00:47:19 | 2012-08-06T00:47:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package cartasiane.spells.spells;
import java.util.HashMap;
import java.util.Map;
import cartasiane.spells.SpellEffect;
public class SpellIndex
{
private static SpellEffect[] registeredSpells;
public static SpellEffect arrow;
public static SpellEffect arrowRain;
public static SpellEffect getSpell(int id)
{
return registeredSpells[id];
}
static
{
arrow = new ArrowSpell();
arrowRain = new ArrowRainSpell();
registeredSpells = new SpellEffect[500];
registeredSpells[0] = arrow;
registeredSpells[1] = arrowRain;
}
}
| [
"doubi125@hotmail.fr"
] | doubi125@hotmail.fr |
efa7901660f53f49e7563e8271ab5a3b586f7bcd | d6cb44318d453eb2b2c13fe41048e22d19564117 | /analyticandroid/src/main/java/com/example/analyticandroid/models/DeviceInfoModel.java | ee504dcbeb6fe28027ed3d0f4c437c3884ddcae5 | [] | no_license | BashirAltereh/AnalyticSDk | f87b08a910d1eeaeddf0a2f7dc77bb76d6ac379d | 7b5ce32f7563fd9aeb708e0e372fdac6039e5352 | refs/heads/master | 2020-09-22T11:09:08.852540 | 2019-12-16T09:42:33 | 2019-12-16T09:42:33 | 225,169,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 130 | java | package com.example.analyticandroid.models;
/**
* Created by BashirAltereh on 10/29/2019.
*/
public class DeviceInfoModel {
}
| [
"bashiralterh1998@gmail.com"
] | bashiralterh1998@gmail.com |
7dfe3a8a95a3426afca1ed522586c792bb7acb34 | c5cb0f0efdcac651e5b73db7121e934ef4bbe975 | /src/commands/StudentsWishes.java | 5e6371c3623533d019243e5dd085f5beef8279d5 | [] | no_license | vchorbov/secretSanta | 79994cec0d3b911d043d4e75140eb3f51cb7f2dc | 172be3e270a2484913e0e4268ad89d902eeb56c6 | refs/heads/main | 2023-03-15T05:57:20.329254 | 2021-03-17T10:29:35 | 2021-03-17T10:29:35 | 344,422,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,376 | java | package commands;
import storage.StudentsWishesStorage;
import java.util.*;
public class StudentsWishes {
private StudentsWishesStorage storage;
private final Map<String, ArrayList<String>> studentsWishes;
private final Random RANDOM;
private final Vault vault;
public StudentsWishes(Vault vault, StudentsWishesStorage storage){
this.storage = storage;
this.studentsWishes = storage.getMap();
this.RANDOM = new Random();
this.vault = vault;
}
public String postWish(String arguments) {
String[] argumentsArray = arguments.split(" " );
String username = argumentsArray[0];
String gift = argumentsArray[1];
String client = argumentsArray[2];
if(!vault.userExists(client)){
return String.format("[ Student with username %s is not registered, so they have no permission to post wishes ] " ,client);
}
if (!vault.userIsLoggedIn(client)){
return String.format("[ Student with username %s is not logged in, so they have no permission to post wishes ] " ,client);
}
if(!vault.userExists(username)){
return String.format("[ Student with username %s is not registered ] " ,username);
}
if (!studentsWishes.containsKey(username)) {
studentsWishes.put(username, new ArrayList<>());
} else if (studentsWishes.get(username).contains(gift)) {
return "[ The same gift for student " + username + " was already submitted ]";
}
studentsWishes.get(username).add(gift);
return "[ Gift " + gift + " for student " + username + " submitted successfully ]";
}
public String getWish(String arguments) {
String name = arguments.trim();
List<String> students = new ArrayList<>(studentsWishes.keySet());
List<String> studentsCopy = new ArrayList<>(students);
studentsCopy.remove(name);
if (studentsCopy.isEmpty()) {
return "[ There are no other students present in the wish list]";
}
String randomStudent = studentsCopy.get(RANDOM.nextInt(studentsCopy.size()));
String randomStudentWishes = studentsWishes.get(randomStudent).toString();
studentsWishes.remove(randomStudent);
return "[ " + randomStudent + ": " + randomStudentWishes + " ]";
}
}
| [
"vili.chorbova@gmail.com"
] | vili.chorbova@gmail.com |
32bd97e326c83b50ac073e65653a9170c8bd7d59 | b38f37cf77e341d84733ea5f8e40a9891350ef2e | /eureka-server/src/test/java/com/xiaobai/eurekaserver/EurekaserverApplicationTests.java | 7656b92e124e0d1486f3afc0d7f1b62fa3754319 | [] | no_license | 3ylh3/spring-cloud | 1113cf52b3e75c1a908cfa0bafb4f8a99f14c5b4 | 9c615081d70326d907fec28877ac3f56040439a9 | refs/heads/master | 2020-04-25T21:30:06.784831 | 2019-02-28T09:24:01 | 2019-02-28T09:24:01 | 173,081,721 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package com.xiaobai.eurekaserver;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class EurekaserverApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"781706889@qq.com"
] | 781706889@qq.com |
f4c442ba88febbaafc9c23428d5e44fcdce66e8c | 11b657aa275c210b4513a30f99a33c597d00b63f | /ysf-core/src/main/java/com/xiujing/ysf/core/config/DefaultWebConfig.java | 0ada977752a29f2b10e1acdfd3d088de9d943134 | [
"Apache-2.0"
] | permissive | burningmyself/ysf | 6b23cdbdade9b57f903ca9c9a0e23fc38972ce9f | 939995ae4c703026ea1c92cbb420215bf773e41c | refs/heads/master | 2022-10-20T19:15:36.536030 | 2020-03-24T05:49:33 | 2020-03-24T05:49:33 | 227,541,325 | 0 | 0 | NOASSERTION | 2022-10-12T20:34:59 | 2019-12-12T06:59:27 | Java | UTF-8 | Java | false | false | 2,614 | java | package com.xiujing.ysf.core.config;
import com.xiujing.ysf.core.base.controller.YsfErrorView;
import com.xiujing.ysf.core.exception.YsfException;
import com.xiujing.ysf.core.exception.YsfExceptionEnum;
import com.xiujing.ysf.core.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.regex.Pattern;
@Configuration
public class DefaultWebConfig extends WebMvcConfigurationSupport {
@Autowired
private RequestMappingHandlerAdapter handlerAdapter;
@Bean("error")
public YsfErrorView error() {
return new YsfErrorView();
}
@PostConstruct
public void addConversionConfig() {
ConfigurableWebBindingInitializer initializer = (ConfigurableWebBindingInitializer) handlerAdapter.getWebBindingInitializer();
GenericConversionService genericConversionService = (GenericConversionService) initializer.getConversionService();
genericConversionService.addConverter(new StringToDateConverter());
}
public class StringToDateConverter implements Converter<String, Date> {
@Override
public Date convert(String dateString) {
String patternDate = "\\d{4}-\\d{1,2}-\\d{1,2}";
String patternTimeMinutes = "\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}:\\d{1,2}";
String patternTimeSeconds = "\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}:\\d{1,2}:\\d{1,2}";
boolean dateFlag = Pattern.matches(patternDate, dateString);
boolean timeMinutesFlag = Pattern.matches(patternTimeMinutes, dateString);
boolean timeSecondsFlag = Pattern.matches(patternTimeSeconds, dateString);
if (dateFlag) {
return DateUtil.parseDate(dateString);
} else if (timeMinutesFlag) {
return DateUtil.parseTimeMinutes(dateString);
} else if (timeSecondsFlag) {
return DateUtil.parseTime(dateString);
} else {
throw new YsfException(YsfExceptionEnum.INVLIDE_DATE_STRING);
}
}
}
}
| [
"1928881525@qq.com"
] | 1928881525@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.