text
stringlengths 10
2.72M
|
|---|
package com.tianlang.dao;
import com.tianlang.entity.Province;
import com.tianlang.jdbcutil.JDBCUtil;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class QueryDao {
public List<Province> query(){
List<Province> list = new ArrayList<>();
JDBCUtil jdbcUtil = new JDBCUtil();
String sql = "select * from province";
jdbcUtil.getConnection();
PreparedStatement preparedStatement = jdbcUtil.getPrepareStatement(sql);
ResultSet resultSet = null;
try {
resultSet = preparedStatement.executeQuery();
while (resultSet.next()){
Province province1 = new Province();
String province = resultSet.getString("province");
province1.setProvince(province);
list.add(province1);
}
} catch (SQLException e) {
e.printStackTrace();
}finally {
jdbcUtil.close();
}return list;
}
}
|
package ua.nure.timoshenko.summaryTask4;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ ua.nure.timoshenko.summaryTask4.db.RoleTest.class,
ua.nure.timoshenko.summaryTask4.db.StatusTest.class,
ua.nure.timoshenko.summaryTask4.db.bean.CartProductBeanTest.class,
ua.nure.timoshenko.summaryTask4.db.bean.OrderBeanTest.class,
ua.nure.timoshenko.summaryTask4.db.bean.ProductBeanTest.class,
ua.nure.timoshenko.summaryTask4.db.bean.UserBeanTest.class,
ua.nure.timoshenko.summaryTask4.db.bean.UserOrderBeanTest.class,
ua.nure.timoshenko.summaryTask4.db.entity.CartTest.class,
ua.nure.timoshenko.summaryTask4.db.entity.CategoryTest.class,
ua.nure.timoshenko.summaryTask4.db.entity.OrderTest.class,
ua.nure.timoshenko.summaryTask4.db.entity.ProductTest.class,
ua.nure.timoshenko.summaryTask4.db.entity.UserTest.class})
public class AllTests {
}
|
package smart.storage;
import smart.config.AppConfig;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class LocalStorage implements Storage {
public final static String UPLOAD_DIR = AppConfig.getAppDir() + "img" + File.separator;
@Override
public boolean exists(String path) {
return Files.exists(Paths.get(UPLOAD_DIR, path));
}
@Override
public boolean noExists(String path) {
return Files.notExists(Paths.get(UPLOAD_DIR, path));
}
@Override
public void cleanFiles(CanClean canClean) {
}
@Override
public UploadResult upload(InputStream inputStream, String path) {
Path p = Paths.get(UPLOAD_DIR, path);
if (Files.notExists(p)) {
try {
Files.createDirectories(p.getParent());
Files.copy(inputStream, p);
} catch (IOException e) {
e.printStackTrace();
return new UploadResult("服务器IO错误", null);
}
}
return new UploadResult(null, "/img/" + path);
}
@Override
public void close() {
}
}
|
package edu.sjsu.fly5.manager;
import java.rmi.RemoteException;
import edu.sjsu.fly5.pojos.Flight;
import edu.sjsu.fly5.pojos.FlightInstance;
import edu.sjsu.fly5.pojos.Journey;
import edu.sjsu.fly5.pojos.PaymentDetails;
import edu.sjsu.fly5.pojos.Person;
import edu.sjsu.fly5.pojos.Traveller;
import edu.sjsu.fly5.services.JourneyService;
import edu.sjsu.fly5.services.JourneyServiceProxy;
public class JourneyManager {
JourneyServiceProxy journeyServiceProxy = new JourneyServiceProxy();
public boolean bookJourney(Traveller[] traveller,FlightInstance[] flightInstance,PaymentDetails paymentDetails,Person[] person)
{
boolean flag = false;
journeyServiceProxy.setEndpoint("http://localhost:8080/fly5/services/JourneyService?wsdl");
try
{
flag = journeyServiceProxy.bookJourney(traveller, flightInstance, paymentDetails, person);
}
catch (RemoteException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return flag;
}
public Journey[] listOfJourneys() throws RemoteException
{
Journey[] listOfJourneys=null;
journeyServiceProxy.setEndpoint("http://localhost:8080/fly5/services/JourneyService?wsdl");
listOfJourneys=journeyServiceProxy.listAllJourneys();
return listOfJourneys;
}
public Journey[] listAllJourney(String userName)
{
Journey[] listOfJourneysById = null;
journeyServiceProxy.setEndpoint("http://localhost:8080/fly5/services/JourneyService?wsdl");
try
{
listOfJourneysById = journeyServiceProxy.listAllJourney(userName);
}
catch (RemoteException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return listOfJourneysById;
}
}
|
package Domain.Effetti.lista;
import Domain.Carta;
import Domain.Effetti.Effetto;
import Domain.Effetti.lista.effectInterface.Azionabile;
import Domain.Effetti.lista.effectInterface.Validabile;
import Domain.Giocatore;
import Domain.Risorsa;
import Domain.SpazioAzione;
import Exceptions.SpazioAzioneDisabilitatoEffettoException;
import java.io.Serializable;
import java.util.List;
/**
* Created by pietro on 18/05/17.
*/
public class ScambiaRisorse extends Effetto implements Validabile, Azionabile {
Opzioni opzioni;
boolean costo;
public ScambiaRisorse(Risorsa[]costi, Risorsa[]guadagni, boolean costo) {
Integer defaultChoice = null;
if(costo)
defaultChoice = 0;
opzioni = new Opzioni(costi, guadagni, defaultChoice);
this.costo = costo;
opzioni.setOpzione(0);
}
/**
* Permette di settare l'opzione di default per lo scambio di risorse
* @param scelta indice della scelta
*/
public void SetDefaultChoice(Integer scelta)
{
if (this.costo == true && scelta == null)
throw new IllegalArgumentException("non puoi deselezionare un costo!");
if(scelta == null || this.opzioni.pagamento.length > 1)
this.opzioni.setOpzione(scelta);
}
public boolean isCosto() {
return costo;
}
public Risorsa[] getSelectedOption(){
return opzioni.getOpzione();
}
public int getNumeroOpzioni(){
return opzioni.guadagno.length;
}
@Override
public void aziona(Risorsa costo, int valoreAzione, SpazioAzione casella, List<Carta> carteGiocatore, Risorsa risorseAllocate, Risorsa malusRisorsa, Giocatore giocatore) {
opzioni.setOpzione(0);
Risorsa[] opzioneScelta = opzioni.getOpzione();
costo.add(opzioneScelta[0]);
if(opzioneScelta[1].getMonete()==Short.MAX_VALUE){
new Pergamena(1).lanciaPrivilegio(giocatore);
} else{
costo.sub(opzioneScelta[1]);
//Calcolo ed aggiunta del malusAttivazioneBonus SSE non è un costo
if(!this.isCosto()){
Risorsa malus = applicaMalus(opzioneScelta[1], malusRisorsa);
costo.add(malusRisorsa);
}
}
}
@Override
public void valida(Risorsa costo, int valoreAzione, SpazioAzione casella, List<Carta> carteGiocatore, Risorsa risorseAllocate, Risorsa malusRisorsa) throws SpazioAzioneDisabilitatoEffettoException {
Risorsa[] opzioneScelta = opzioni.getOpzione();
costo.add(opzioneScelta[0]);
}
//Anche più possibilità
}
class Opzioni implements Serializable {
Risorsa[] pagamento;
Risorsa[] guadagno;
Integer opzione;
/**
*
* @param pagamento
* @param guadagno
* @param defaultChoice @Nullable, se c'è una sola opzione, viene settata come default
*/
public Opzioni(Risorsa[] pagamento, Risorsa[] guadagno, Integer defaultChoice) {
if (pagamento.length != guadagno.length)
throw new IllegalArgumentException("guadagno e pagamento devono aver la stessa dimensione");
this.pagamento = pagamento;
this.guadagno = guadagno;
this.opzione = defaultChoice;
if(pagamento.length == 1)
this.opzione = 0;
}
public void setOpzione(Integer opzione) {
if(opzione == null){
this.opzione = null;
} else if (opzione < 0 || opzione > pagamento.length) {
throw new ArrayIndexOutOfBoundsException("l'opzione scelta per scambia risorse non c'è: " + opzione);
} else {
this.opzione = opzione;
}
}
public Risorsa[] getOpzione() {
Risorsa[] opzioneCorrente = new Risorsa[2];
if (opzione==null){
return null;
}
opzioneCorrente[0] = pagamento[opzione];
opzioneCorrente[1] = guadagno[opzione];
return opzioneCorrente;
}
}
|
package glam.android.minexp.glam;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.DrawerLayout.DrawerListener;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.OnScrollListener;
import android.support.v7.widget.Toolbar;
import android.support.v7.widget.ActivityChooserView;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import glam.android.minexp.glam.custom.CustomActivity;
import glam.android.minexp.glam.custom.CustomFragment;
import glam.android.minexp.glam.model.Data;
import glam.android.minexp.glam.ui.Checkout;
import glam.android.minexp.glam.ui.LeftNavAdapter;
import glam.android.minexp.glam.ui.MainFragment;
import glam.android.minexp.glam.ui.OnSale;
import glam.android.minexp.glam.ui.Settings;
import java.util.ArrayList;
import glam.android.minexp.glam.R;
@SuppressLint({"InlinedApi"})
public class MainActivity extends CustomActivity {
private static final TypeEvaluator ARGB_EVALUATOR = new ArgbEvaluator();
private DrawerLayout drawerLayout;
private ListView drawerLeft;
private ActionBarDrawerToggle drawerToggle;
private boolean mActionBarAutoHideEnabled = true;
private int mActionBarAutoHideMinY = 0;
private int mActionBarAutoHideSensivity = 0;
private int mActionBarAutoHideSignal = 0;
private boolean mActionBarShown = true;
private ObjectAnimator mStatusBarColorAnimator;
public Toolbar toolbar;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView((int) R.layout.activity_main);
this.toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
setSupportActionBar(this.toolbar);
setupDrawer();
setupContainer(1);
}
private void setupDrawer() {
this.drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
this.drawerLayout.setDrawerShadow((int) R.drawable.drawer_shadow, 8388611);
this.drawerToggle = new ActionBarDrawerToggle(this, this.drawerLayout, R.string.drawer_open, R.string.drawer_close) {
public void onDrawerClosed(View view) {
}
public void onDrawerOpened(View drawerView) {
}
};
this.drawerLayout.setDrawerListener(this.drawerToggle);
this.drawerLayout.closeDrawers();
setupLeftNavDrawer();
this.drawerLayout.setDrawerListener(new DrawerListener() {
@Override
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
}
@Override
public void onDrawerOpened(@NonNull View drawerView) {
MainActivity.this.onNavDrawerStateChanged(true, false);
}
@Override
public void onDrawerClosed(@NonNull View drawerView) {
MainActivity.this.onNavDrawerStateChanged(false, false);
}
@Override
public void onDrawerStateChanged(int newState) {
MainActivity.this.onNavDrawerStateChanged(MainActivity.this.drawerLayout.isDrawerOpen(8388611), newState != 0);
}
});
}
private void onNavDrawerStateChanged(boolean isOpen, boolean isAnimating) {
if (this.mActionBarAutoHideEnabled && isOpen) {
autoShowOrHideActionBar(true);
}
}
private void autoShowOrHideActionBar(boolean show) {
if (show != this.mActionBarShown) {
this.mActionBarShown = show;
onActionBarAutoShowOrHide(show);
}
}
@SuppressLint({"NewApi"})
private void onActionBarAutoShowOrHide(final boolean shown) {
String str;
int color;
if (this.mStatusBarColorAnimator != null) {
this.mStatusBarColorAnimator.cancel();
}
DrawerLayout drawerLayout = this.drawerLayout;
if (this.drawerLayout != null) {
str = "statusBarBackgroundColor";
} else {
str = "statusBarColor";
}
int[] iArr = new int[2];
if (shown) {
color = getResources().getColor(R.color.main_color_dk);
} else {
color = getResources().getColor(R.color.main_color);
}
iArr[0] = color;
if (shown) {
color = getResources().getColor(R.color.main_color);
} else {
color = getResources().getColor(R.color.main_color_dk);
}
iArr[1] = color;
this.mStatusBarColorAnimator = ObjectAnimator.ofInt(drawerLayout, str, iArr).setDuration(250);
if (this.drawerLayout != null) {
this.mStatusBarColorAnimator.addUpdateListener(new AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator valueAnimator) {
ViewCompat.postInvalidateOnAnimation(MainActivity.this.drawerLayout);
if (shown) {
MainActivity.this.getSupportActionBar().show();
if (VERSION.SDK_INT >= 21) {
MainActivity.this.getWindow().setStatusBarColor(MainActivity.this.getResources().getColor(R.color.main_color_dk));
return;
}
return;
}
MainActivity.this.getSupportActionBar().hide();
if (VERSION.SDK_INT >= 21) {
MainActivity.this.getWindow().setStatusBarColor(MainActivity.this.getResources().getColor(R.color.main_color));
}
}
});
}
this.mStatusBarColorAnimator.setEvaluator(ARGB_EVALUATOR);
this.mStatusBarColorAnimator.start();
}
public void enableActionBarAutoHide(RecyclerView recList) {
initActionBarAutoHide();
recList.setOnScrollListener(new OnScrollListener() {
static final int ITEMS_THRESHOLD = 3;
int lastFvi = 0;
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
int i = 0;
super.onScrolled(recyclerView, dx, dy);
try {
int firstVisibleItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstVisibleItemPosition();
MainActivity mainActivity = MainActivity.this;
int i2 = firstVisibleItem <= 3 ? 0 : Integer.MAX_VALUE;
if (this.lastFvi - firstVisibleItem > 0) {
i = Integer.MIN_VALUE;
} else if (this.lastFvi != firstVisibleItem) {
i = Integer.MAX_VALUE;
}
mainActivity.onMainContentScrolled(i2, i);
this.lastFvi = firstVisibleItem;
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
private void onMainContentScrolled(int currentY, int deltaY) {
if (deltaY > this.mActionBarAutoHideSensivity) {
deltaY = this.mActionBarAutoHideSensivity;
} else if (deltaY < (-this.mActionBarAutoHideSensivity)) {
deltaY = -this.mActionBarAutoHideSensivity;
}
if (Math.signum((float) deltaY) * Math.signum((float) this.mActionBarAutoHideSignal) < 0.0f) {
this.mActionBarAutoHideSignal = deltaY;
} else {
this.mActionBarAutoHideSignal += deltaY;
}
boolean shouldShow = currentY < this.mActionBarAutoHideMinY || this.mActionBarAutoHideSignal <= (-this.mActionBarAutoHideSensivity);
autoShowOrHideActionBar(shouldShow);
}
public void initActionBarAutoHide() {
this.mActionBarAutoHideEnabled = true;
this.mActionBarAutoHideMinY = getResources().getDimensionPixelSize(R.dimen.action_bar_auto_hide_min_y);
this.mActionBarAutoHideSensivity = getResources().getDimensionPixelSize(R.dimen.action_bar_auto_hide_sensivity);
}
@SuppressLint({"InflateParams"})
private void setupLeftNavDrawer() {
this.drawerLeft = (ListView) findViewById(R.id.left_drawer);
this.drawerLeft.addHeaderView(getLayoutInflater().inflate(R.layout.left_nav_header, null));
ArrayList<Data> al = new ArrayList();
al.add(new Data(new String[]{"Explore"}, new int[]{R.drawable.ic_nav1, R.drawable.ic_nav1_sel}));
al.add(new Data(new String[]{"Favourites"}, new int[]{R.drawable.ic_nav2, R.drawable.ic_nav2_sel}));
al.add(new Data(new String[]{"Cart"}, new int[]{R.drawable.ic_nav3, R.drawable.ic_nav3_sel}));
al.add(new Data(new String[]{"Settings"}, new int[]{R.drawable.ic_nav4, R.drawable.ic_nav4_sel}));
al.add(new Data(new String[]{"Logout"}, new int[]{R.drawable.ic_nav5, R.drawable.ic_nav5_sel}));
final LeftNavAdapter adp = new LeftNavAdapter(this, al);
this.drawerLeft.setAdapter(adp);
this.drawerLeft.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> adapterView, View arg1, int pos, long arg3) {
if (pos != 0) {
adp.setSelection(pos - 1);
}
MainActivity.this.drawerLayout.closeDrawers();
MainActivity.this.setupContainer(pos);
}
});
}
private void setupContainer(int pos) {
CustomFragment f = null;
CharSequence title = null;
if (pos != 0) {
if (pos == 1) {
f = new MainFragment();
} else if (pos == 2) {
f = new OnSale();
title = "On Sale";
} else if (pos == 3) {
f = new Checkout();
title = "Checkout";
} else if (pos == 4) {
f = new Settings();
title = "Settings";
} else if (pos == 5) {
startActivity(new Intent(this, Login.class));
finish();
}
if (f != null) {
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, f).commit();
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(title);
}
}
}
}
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
this.drawerToggle.syncState();
}
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
this.drawerToggle.onConfigurationChanged(newConfig);
}
public boolean onOptionsItemSelected(MenuItem item) {
if (this.drawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
package one.kii.summer.beans.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by WangYanJiong on 18/04/2017.
*/
public class ArraysAssert {
private static Logger logger = LoggerFactory.getLogger(ArraysAssert.class);
public static <T> boolean same(String[] array, List<T> anotherList, String anotherFieldName) {
if (array == null || anotherList == null) {
return false;
}
if (array.length == 0 && anotherList.size() == 0) {
return true;
}
if (array.length != anotherList.size()) {
return false;
}
List<String> anothers = new ArrayList<>();
for (T another : anotherList) {
if (another == null) {
continue;
}
Field field = null;
try {
field = another.getClass().getDeclaredField(anotherFieldName);
field.setAccessible(true);
} catch (NoSuchFieldException e) {
logger.debug("no-such-field-exception:{}", anotherFieldName, e);
return false;
}
try {
Object object = field.get(another);
if (object != null) {
anothers.add(object.toString());
}
} catch (IllegalAccessException e) {
logger.debug("illegal-access-exception:{}", anotherFieldName, e);
return false;
}
}
String[] anotherArray = anothers.toArray(new String[0]);
if (array.length != anotherArray.length) {
return false;
}
Arrays.sort(array);
Arrays.sort(anotherArray);
return Arrays.equals(array, anotherArray);
}
}
|
package de.cketti.holocolorpicker.demo;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import com.larswerkman.colorpicker.ColorPicker;
import com.larswerkman.colorpicker.ColorPicker.OnColorChangedListener;
import com.larswerkman.colorpicker.OpacityBar;
import com.larswerkman.colorpicker.SVBar;
/**
* Fragment that demonstrates how to use {@link ColorPicker} in combination with {@link SVBar} and
* {@link OpacityBar}.
*/
public class AdvancedColorPickerFragment extends Fragment {
private ColorPicker mColorPicker;
private SVBar mSvBar;
private OpacityBar mOpacityBar;
private View mColorSquare;
private Button mButton;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.advanced_color_picker_fragment, null);
mColorPicker = (ColorPicker) view.findViewById(R.id.color_picker);
mSvBar = (SVBar) view.findViewById(R.id.svbar);
mOpacityBar = (OpacityBar) view.findViewById(R.id.opacitybar);
mColorSquare = view.findViewById(R.id.color_square);
mButton = (Button) view.findViewById(R.id.select_color_button);
mColorPicker.addSVBar(mSvBar);
mColorPicker.addOpacityBar(mOpacityBar);
mColorPicker.setOnColorChangedListener(new OnColorChangedListener() {
@Override
public void onColorChanged(int color) {
mColorSquare.setBackgroundColor(color);
}
});
int color = Color.argb(120, 255, 0, 0);
mColorPicker.setColor(color);
mColorPicker.setOldCenterColor(color);
mButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mColorPicker.setOldCenterColor(mColorPicker.getColor());
}
});
return view;
}
}
|
package com.company;
//qustion: find the rotation count in rotated sorted arrays
public class CountRotationInArray {
public static void main(String[] args) {
//int[] arr={4, 5, 6, 7, 0, 1, 2};
int [] arr={1,2,3,4,5,6,7};
System.out.println("array is raoted : "+ countRotations(arr) + "times");
}
private static int countRotations(int[] arr) {
int pivot=findPivotElement(arr);
if (pivot==-1){
//array is not roted
return 0;
}
return pivot+1;
}
// use this for non dupilicate element
static int findPivotElement(int[] nums) {
int start = 0;
int end = nums.length - 1;
while (start <= end) {
int mid = start + (end - start) / 2;
//4 cases
if (mid < end && nums[mid] > nums[mid + 1]) {
return mid;
}
if (mid > start && nums[mid] < nums[mid - 1]) {
return mid - 1;
}
if (nums[mid] <= nums[start]) {
end = mid - 1;
} else {
start = mid + 1;
}
}
return -1;
}
//use this for duplicates
static int findPivotElementWithDuplicate(int[] nums) {
int start = 0;
int end = nums.length - 1;
while (start <= end) {
int mid = start + (end - start) / 2;
//4 cases
if (mid < end && nums[mid] > nums[mid + 1]) {
return mid;
}
if (mid > start && nums[mid] < nums[mid - 1]) {
return mid - 1;
}
//if element at middle and end,start are equals then just skkipd the duplicates
if (nums[mid]==nums[start]&&nums[mid]==nums[end]){
//skkips the duplicats
//NOTE:what if the element at start and end are the pivot
//check start is pivot
if (nums[start]>nums[start+1]){
return start;
}
start++;
//check end is pivot
if (nums[end]<nums[end-1]){
return end-1;
}
end--;
}
//left side is sorted ,so pivot should be in rightside
else if (nums[start]<nums[mid] || (nums[start]==nums[mid] &&nums[mid]>nums[end])){
start=mid+1;
}
else {
end=mid-1;
}
}
return -1;
}
}
|
// Date: 10/14/2013 7:39:05 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package hyghlander.mods.ports.DragonScales.client.models;
//import hyghlander.mods.ports.DragonScales.common.entities.EntityModDragon;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class ModelModDragon extends ModelBase
{
public static float RightWing1rotateAngleZ;
public static float LeftWing1rotateAngleZ;
//fields
ModelRenderer BackBone;
ModelRenderer BackBone2;
ModelRenderer BackBone3;
ModelRenderer Breast1;
ModelRenderer Breast2;
ModelRenderer Breast3;
ModelRenderer Breast4;
ModelRenderer Body1;
ModelRenderer BackBone4;
ModelRenderer BackBone5;
ModelRenderer BackBone6;
ModelRenderer Nostril1;
ModelRenderer Nostril2;
ModelRenderer Head1;
ModelRenderer Cheek;
ModelRenderer Mouth1;
ModelRenderer Mouth2;
ModelRenderer Neck1;
ModelRenderer Neck2;
ModelRenderer Neck3;
ModelRenderer Neck4;
ModelRenderer Neck5;
ModelRenderer Neck6;
ModelRenderer Neck7;
ModelRenderer Neck8;
ModelRenderer Neck9;
ModelRenderer Neck10;
ModelRenderer Neck11;
ModelRenderer Neck12;
ModelRenderer Neck13;
ModelRenderer Neck14;
ModelRenderer Body2;
ModelRenderer Tail1;
ModelRenderer Tail2;
ModelRenderer Tail3;
ModelRenderer Tail4;
ModelRenderer Tail5;
ModelRenderer Tail6;
ModelRenderer Tail7;
ModelRenderer Tail8;
ModelRenderer Tail9;
ModelRenderer Tail10;
ModelRenderer Tail11;
ModelRenderer Tail12;
ModelRenderer Tail13;
ModelRenderer Tail14;
ModelRenderer Tail15;
ModelRenderer Tail16;
ModelRenderer LeftWing4;
ModelRenderer LeftWing2;
ModelRenderer LeftWing3;
ModelRenderer RightWing1;
ModelRenderer RightWing2;
ModelRenderer RightWing3;
ModelRenderer RightWing4;
ModelRenderer LeftWing1;
ModelRenderer rbl1;
ModelRenderer rbl2;
ModelRenderer rfl1;
ModelRenderer rfl2;
ModelRenderer rfl3;
ModelRenderer lbl3;
ModelRenderer lbl2;
ModelRenderer lbl1;
ModelRenderer rbl3;
ModelRenderer lfl1;
ModelRenderer lfl2;
ModelRenderer lfl3;
ModelRenderer RightWingFlap1;
ModelRenderer RightWingFlap2;
ModelRenderer RightWingFlap3;
ModelRenderer RightWingFlap4;
ModelRenderer LeftWingFlap1;
ModelRenderer LeftWingFlap2;
ModelRenderer LeftWingFlap3;
ModelRenderer LeftWingFlap4;
public ModelModDragon()
{
textureWidth = 256;
textureHeight = 256;
BackBone = new ModelRenderer(this, 100, 0);
BackBone.addBox(-3F, -1F, 0F, 6, 6, 34);
BackBone.setRotationPoint(0F, -6F, 24F);
BackBone.setTextureSize(256, 256);
BackBone.mirror = true;
setRotation(BackBone, 0.0113601F, 0F, 0F);
BackBone2 = new ModelRenderer(this, 100, 0);
BackBone2.addBox(-2.5F, -2F, 0F, 5, 6, 34);
BackBone2.setRotationPoint(0F, -6F, 24F);
BackBone2.setTextureSize(256, 256);
BackBone2.mirror = true;
setRotation(BackBone2, 0.0113601F, 0F, 0F);
BackBone3 = new ModelRenderer(this, 100, 0);
BackBone3.addBox(-4F, -0.5F, 0F, 8, 5, 34);
BackBone3.setRotationPoint(0F, -6F, 24F);
BackBone3.setTextureSize(256, 256);
BackBone3.mirror = true;
setRotation(BackBone3, 0.0113601F, 0F, 0F);
Breast1 = new ModelRenderer(this, 0, 70);
Breast1.addBox(-5.5F, 0F, 0F, 11, 10, 4);
Breast1.setRotationPoint(0F, -4F, 0F);
Breast1.setTextureSize(256, 256);
Breast1.mirror = true;
setRotation(Breast1, -0.2488901F, 0F, 0F);
Breast2 = new ModelRenderer(this, 0, 70);
Breast2.addBox(-4F, 0F, 0F, 8, 10, 4);
Breast2.setRotationPoint(0F, -4F, 0F);
Breast2.setTextureSize(256, 256);
Breast2.mirror = true;
setRotation(Breast2, -0.546319F, 0F, 0F);
Breast3 = new ModelRenderer(this, 0, 70);
Breast3.addBox(-4.5F, 0F, 0F, 9, 10, 5);
Breast3.setRotationPoint(0F, -4F, 0F);
Breast3.setTextureSize(256, 256);
Breast3.mirror = true;
setRotation(Breast3, -1.029641F, 0F, 0F);
Breast4 = new ModelRenderer(this, 0, 70);
Breast4.addBox(-5F, -1F, -4F, 10, 11, 6);
Breast4.setRotationPoint(0F, -4F, 0F);
Breast4.setTextureSize(256, 256);
Breast4.mirror = true;
setRotation(Breast4, -1.289891F, 0F, 0F);
Body1 = new ModelRenderer(this, 100, 0);
Body1.addBox(-5F, 0F, 0F, 10, 10, 25);
Body1.setRotationPoint(0F, -4F, 0F);
Body1.setTextureSize(256, 256);
Body1.mirror = true;
setRotation(Body1, 0.0857174F, 0F, 0F);
BackBone4 = new ModelRenderer(this, 100, 0);
BackBone4.addBox(-3F, -1F, 0F, 6, 6, 25);
BackBone4.setRotationPoint(0F, -4F, 0F);
BackBone4.setTextureSize(256, 256);
BackBone4.mirror = true;
setRotation(BackBone4, 0.0857174F, 0F, 0F);
BackBone5 = new ModelRenderer(this, 100, 0);
BackBone5.addBox(-2.5F, -2F, 0F, 5, 6, 25);
BackBone5.setRotationPoint(0F, -4F, 0F);
BackBone5.setTextureSize(256, 256);
BackBone5.mirror = true;
setRotation(BackBone5, 0.0857174F, 0F, 0F);
BackBone6 = new ModelRenderer(this, 100, 0);
BackBone6.addBox(-4F, -0.5F, 0F, 8, 5, 25);
BackBone6.setRotationPoint(0F, -4F, 0F);
BackBone6.setTextureSize(256, 256);
BackBone6.mirror = true;
setRotation(BackBone6, 0.0857174F, 0F, 0F);
Nostril1 = new ModelRenderer(this, 0, 50);
Nostril1.addBox(-1.5F, -6F, -0.5F, 1, 2, 2);
Nostril1.setRotationPoint(0F, -9.5F, 1F);
Nostril1.setTextureSize(256, 256);
Nostril1.mirror = true;
setRotation(Nostril1, 0F, 0F, 0F);
Nostril2 = new ModelRenderer(this, 7, 50);
Nostril2.addBox(0.5F, -6F, -0.5F, 1, 2, 2);
Nostril2.setRotationPoint(0F, -9.5F, 1F);
Nostril2.setTextureSize(256, 256);
Nostril2.mirror = true;
setRotation(Nostril2, 0F, 0F, 0F);
Head1 = new ModelRenderer(this, 0, 90);
Head1.addBox(-3F, -9F, -2.5F, 6, 9, 6);
Head1.setRotationPoint(0F, -2F, -1F);
Head1.setTextureSize(256, 256);
Head1.mirror = true;
setRotation(Head1, 0.25F, 0F, 0F);
Cheek = new ModelRenderer(this, 0, 59);
Cheek.addBox(-3.5F, -4F, -2.5F, 7, 4, 4);
Cheek.setRotationPoint(0F, 0F, 0.1F);
Cheek.setTextureSize(256, 256);
Cheek.mirror = true;
setRotation(Cheek, 0F, 0F, 0F);
Mouth1 = new ModelRenderer(this, 0, 110);
Mouth1.addBox(-2.5F, -6F, -0.5F, 5, 9, 2);
Mouth1.setRotationPoint(0F, -10F, 0F);
Mouth1.setTextureSize(256, 256);
Mouth1.mirror = true;
setRotation(Mouth1, 0F, 0F, 0F);
Mouth2 = new ModelRenderer(this, 0, 125);
Mouth2.addBox(-2.5F, -6F, -1.5F, 5, 7, 2);
Mouth2.setRotationPoint(0F, -10F, -1F);
Mouth2.setTextureSize(256, 256);
Mouth2.mirror = true;
setRotation(Mouth2, 0.528475F, 0F, 0F);
Neck1 = new ModelRenderer(this, 100, 0);
Neck1.addBox(-4.5F, -1F, -6F, 9, 10, 2); //start neck
Neck1.setRotationPoint(0F, 0F, 0F);
Neck1.setTextureSize(256, 256);
Neck1.mirror = true;
setRotation(Neck1, -0F, 0F, 0F);
Neck2 = new ModelRenderer(this, 100, 0);
Neck2.addBox(-4F, 0F, -7F, 8, 8, 2);
Neck2.setRotationPoint(0F, 1F, 0F);
Neck2.setTextureSize(256, 256);
Neck2.mirror = true;
setRotation(Neck2, -0.2F, 0F, 0F);
Neck3 = new ModelRenderer(this, 100, 0);
Neck3.addBox(-3F, -1F, -4F, 6, 6, 4);
Neck3.setRotationPoint(0F, 1.5F, -5F);
Neck3.setTextureSize(256, 256); //
Neck3.mirror = true;
setRotation(Neck3, -0.2F, 0F, 0F);
Neck4 = new ModelRenderer(this, 100, 0);
Neck4.addBox(-2.5F, -3F, -4F, 5, 6, 4);
Neck4.setRotationPoint(0F, 2F, -3F); //
Neck4.setTextureSize(256, 256);
Neck4.mirror = true;
setRotation(Neck4, -0.01F, 0F, 0F);
Neck5 = new ModelRenderer(this, 100, 0);
Neck5.addBox(-3F, -3F, -4F, 6, 4, 6);
Neck5.setRotationPoint(0F, -1F, -5F);
Neck5.setTextureSize(256, 256);
Neck5.mirror = true;
setRotation(Neck5, 1.4F, 0F, 0F);
Neck6 = new ModelRenderer(this, 100, 0);
Neck6.addBox(-2.5F, -3F, -4F, 5, 4, 6);
Neck6.setRotationPoint(0F, -4F, 0F);
Neck6.setTextureSize(256, 256);
Neck6.mirror = true;
setRotation(Neck6, -0.2F, 0F, 0F);
Neck7 = new ModelRenderer(this, 100, 0);
Neck7.addBox(-3F, -3F, -4F, 6, 4, 6);
Neck7.setRotationPoint(0F, -4F, 0F);
Neck7.setTextureSize(256, 256);
Neck7.mirror = true;
setRotation(Neck7, -0.2F, 0F, 0F);
Neck8 = new ModelRenderer(this, 100, 0);
Neck8.addBox(-2.5F, -3F, -4F, 5, 4, 6); //
Neck8.setRotationPoint(0F, -4F, 0F);
Neck8.setTextureSize(256, 256);
Neck8.mirror = true;
setRotation(Neck8, 0.3F, 0F, 0F);
Neck9 = new ModelRenderer(this, 100, 0);
Neck9.addBox(-3F, -3F, -4F, 6, 4, 6);
Neck9.setRotationPoint(0F, -4F, 0F);
Neck9.setTextureSize(256, 256);
Neck9.mirror = true;
setRotation(Neck9, 0.4F, 0F, 0F);
Neck10 = new ModelRenderer(this, 100, 0);
Neck10.addBox(-2.5F, -3F, -4F, 5, 4, 6);
Neck10.setRotationPoint(0F, -4F, 0F);
Neck10.setTextureSize(256, 256);
Neck10.mirror = true;
setRotation(Neck10, 0.3F, 0F, 0F);
Neck11 = new ModelRenderer(this, 100, 0);
Neck11.addBox(-3F, -3F, -4F, 6, 4, 6);
Neck11.setRotationPoint(0F, -4F, 0F);
Neck11.setTextureSize(256, 256);
Neck11.mirror = true;
setRotation(Neck11, 0.4F, 0F, 0F);
Neck12 = new ModelRenderer(this, 100, 0);
Neck12.addBox(-2.5F, -3F, -4F, 5, 4, 6);
Neck12.setRotationPoint(0F, -4F, 0F);
Neck12.setTextureSize(256, 256);
Neck12.mirror = true;
setRotation(Neck12, 0.1F, 0F, 0F);
Neck13 = new ModelRenderer(this, 100, 0);
Neck13.addBox(-3F, -3F, -4F, 6, 4, 6);
Neck13.setRotationPoint(0F, -4F, 0F);
Neck13.setTextureSize(256, 256);
Neck13.mirror = true;
setRotation(Neck13, 0.5F, 0F, 0F);
Neck14 = new ModelRenderer(this, 100, 0);
Neck14.addBox(-2.5F, -3F, -4F, 5, 4, 6);
Neck14.setRotationPoint(0F, -4F, 0F);
Neck14.setTextureSize(256, 256);
Neck14.mirror = true;
setRotation(Neck14, 0F, 0F, 0F);
Body2 = new ModelRenderer(this, 100, 0);
Body2.addBox(-4.5F, 0F, 0F, 9, 10, 34);
Body2.setRotationPoint(0F, -6F, 24F);
Body2.setTextureSize(256, 256);
Body2.mirror = true;
setRotation(Body2, 0.0113601F, 0F, 0F);
Tail1 = new ModelRenderer(this, 0, 150);
Tail1.addBox(-4F, -4F, 0F, 8, 8, 8);
Tail1.setRotationPoint(0F, 4F, 33F); ////
Tail1.setTextureSize(256, 256);
Tail1.mirror = true;
setRotation(Tail1, 0.1972532F, 0F, 0F);
Tail2 = new ModelRenderer(this, 0, 150);
Tail2.addBox(-3.5F, -3.5F, 0F, 7, 7, 8);
Tail2.setRotationPoint(0F, 0.5F, 7.5F);
Tail2.setTextureSize(256, 256);
Tail2.mirror = true;
setRotation(Tail2, 0.2203249F, 0F, 0F);
Tail3 = new ModelRenderer(this, 0, 150);
Tail3.addBox(-3F, -3F, 0F, 6, 6, 8);
Tail3.setRotationPoint(0F, 0.5F, 7.5F);
Tail3.setTextureSize(256, 256);
Tail3.mirror = true;
setRotation(Tail3, 0.2433965F, 0F, 0F);
Tail4 = new ModelRenderer(this, 0, 150);
Tail4.addBox(-2.5F, -2.5F, 0F, 5, 5, 8);
Tail4.setRotationPoint(0F, 0.5F, 7.5F);
Tail4.setTextureSize(256, 256);
Tail4.mirror = true;
setRotation(Tail4, 0.2036468F, 0F, 0F);
Tail5 = new ModelRenderer(this, 0, 150);
Tail5.addBox(-2.5F, -2.5F, 0F, 5, 5, 8);
Tail5.setRotationPoint(0F, 0.5F, 7.5F);
Tail5.setTextureSize(256, 256);
Tail5.mirror = true;
setRotation(Tail5, 0.263897F, 0F, 0F);
Tail6 = new ModelRenderer(this, 0, 150);
Tail6.addBox(-2.5F, -2.5F, 0F, 5, 5, 8);
Tail6.setRotationPoint(0F, 0.5F, 7.5F);
Tail6.setTextureSize(256, 256);
Tail6.mirror = true;
setRotation(Tail6, 0.224147F, 0F, 0F);
Tail7 = new ModelRenderer(this, 0, 150);
Tail7.addBox(-2.5F, -2.5F, 0F, 5, 5, 8);
Tail7.setRotationPoint(0F, 0.5F, 7.5F);
Tail7.setTextureSize(256, 256);
Tail7.mirror = true;
setRotation(Tail7, 0.247219F, 0F, 0F);
Tail8 = new ModelRenderer(this, 0, 150);
Tail8.addBox(-2F, -2F, 0F, 4, 4, 8);
Tail8.setRotationPoint(0F, 0.F, 7.5F);
Tail8.setTextureSize(256, 256); //
Tail8.mirror = true;
setRotation(Tail8, 0.2F, 0F, 0F);
Tail9 = new ModelRenderer(this, 0, 150);
Tail9.addBox(-2F, -8F, -2F, 4, 8, 4);
Tail9.setRotationPoint(0F, 0.2F, 7.5F);
Tail9.setTextureSize(256, 256);
Tail9.mirror = true;
setRotation(Tail9, -1.2062179F, 0F, 0F);
//
Tail10 = new ModelRenderer(this, 0, 150);
Tail10.addBox(-2F, -8F, -2F, 4, 8, 4);
Tail10.setRotationPoint(0F,-7.5F, -0F);
Tail10.setTextureSize(256, 256); //
Tail10.mirror = true;
setRotation(Tail10, 0.4664682F, 0F, 0F);
//
Tail11 = new ModelRenderer(this, 0, 150);
Tail11.addBox(-2F, -8F, -2F, 4, 8, 4);
Tail11.setRotationPoint(0F,-7.5F, -0F);
Tail11.setTextureSize(256, 256); //
Tail11.mirror = true;
setRotation(Tail11, 0.538254F, 0F, 0F);
//
Tail12 = new ModelRenderer(this, 0, 141);
Tail12.addBox(-0.5F, -4F, -0.5F, 1, 4, 1);
Tail12.setRotationPoint(0F, -6F, 0F);
Tail12.setTextureSize(256, 256); ///
Tail12.mirror = true;
setRotation(Tail12, -0.5F, 0F, 0F);
//
Tail13 = new ModelRenderer(this, 8, 137);
Tail13.addBox(-1F, -8F, -1F, 2, 8, 2);
Tail13.setRotationPoint(0F, -6F, 0F); ///##
Tail13.setTextureSize(256, 256);
Tail13.mirror = true;
setRotation(Tail13, 0.04979F, 0F, 0F);
//
Tail14 = new ModelRenderer(this, 0, 141);
Tail14.addBox(-0.5F, 0F, -0.5F, 1, 4, 1);
Tail14.setRotationPoint(0F, -6F, 0F);
Tail14.setTextureSize(256, 256);
Tail14.mirror = true; ///
setRotation(Tail14, 0F, 0F, 2.5F);
//
Tail15 = new ModelRenderer(this, 0, 141);
Tail15.addBox(-0.5F, -4F, -0.5F, 1, 4, 1);
Tail15.setRotationPoint(0F, -6F, 0F); ///
Tail15.setTextureSize(256, 256);
Tail15.mirror = true;
setRotation(Tail15, 0.5F, 0F, 0F);
//
Tail16 = new ModelRenderer(this, 0, 141);
Tail16.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); ///
Tail16.setRotationPoint(0F, -6F, 0F);
Tail16.setTextureSize(256, 256);
Tail16.mirror = true;
setRotation(Tail16, 0F, 0F, 0.5F);
//
LeftWing4 = new ModelRenderer(this, 0, 170);
LeftWing4.addBox(-1.5F, -31F, -1.5F, 3, 31, 3);
LeftWing4.setRotationPoint(0F, -30F, 0F);
LeftWing4.setTextureSize(256, 256);
LeftWing4.mirror = true;
setRotation(LeftWing4, -0.6F, 0F, 0F);
//
LeftWing2 = new ModelRenderer(this, 0, 170);
LeftWing2.addBox(-1.5F, -31F, -1.5F, 3, 31, 3);
LeftWing2.setRotationPoint(1.5F, 0F, 32F);
LeftWing2.setTextureSize(256, 256);
LeftWing2.mirror = true;
setRotation(LeftWing2, 0F, 0F, 0F);
LeftWing3 = new ModelRenderer(this, 0, 170);
LeftWing3.addBox(-1.5F, -31F, -1.5F, 3, 31, 3);
LeftWing3.setRotationPoint(0F, -30F, 0F);
LeftWing3.setTextureSize(256, 256);
LeftWing3.mirror = true;
setRotation(LeftWing3, -2F, 0F, 0F);
RightWing1 = new ModelRenderer(this, 0, 170);
RightWing1.addBox(-3F, -3F, 0F, 3, 3, 33);
RightWing1.setRotationPoint(-5F, -3F, 1F);
RightWing1.setTextureSize(256, 256);
RightWing1.mirror = true;
setRotation(RightWing1, 0.7807508F, 0F, 0F);
RightWing2 = new ModelRenderer(this, 0, 170);
RightWing2.addBox(-1.5F, -31F, -1.5F, 3, 31, 3);
RightWing2.setRotationPoint(-1.5F, 0F, 32F);
RightWing2.setTextureSize(256, 256);
RightWing2.mirror = true;
setRotation(RightWing2, 0F, 0F, 0F);
RightWing3 = new ModelRenderer(this, 0, 170);
RightWing3.addBox(-1.5F, -31F, -1.5F, 3, 31, 3);
RightWing3.setRotationPoint(0F, -30F, 0F);
RightWing3.setTextureSize(256, 256);
RightWing3.mirror = true;
setRotation(RightWing3, -2F, 0F, 0F);
RightWing4 = new ModelRenderer(this, 0, 170);
RightWing4.addBox(-1.5F, -31F, -1.5F, 3, 31, 3);
RightWing4.setRotationPoint(0F, -30F, 0F);
RightWing4.setTextureSize(256, 256);
RightWing4.mirror = true;
setRotation(RightWing4, -0.6F, 0F, 0F);
LeftWing1 = new ModelRenderer(this, 0, 170);
LeftWing1.addBox(0F, -3F, 0F, 3, 3, 33);
LeftWing1.setRotationPoint(5F, -3F, 1F);
LeftWing1.setTextureSize(256, 256);
LeftWing1.mirror = true;
setRotation(LeftWing1, 0.7807508F, 0F, 0F);
rbl1 = new ModelRenderer(this, 0, 25);
rbl1.addBox(-1F, -3F, -3F, 5, 12, 8);
rbl1.setRotationPoint(-8F, 4F, 45F);
rbl1.setTextureSize(256, 256);
rbl1.mirror = true;
setRotation(rbl1, 0.4833219F, 0F, 0F);
rbl2 = new ModelRenderer(this, 30, 30);
rbl2.addBox(-1.1F, -3F, -3F, 4, 14, 6);
rbl2.setRotationPoint(1F, 9F, 1F);
rbl2.setTextureSize(256, 256);
rbl2.mirror = true;
setRotation(rbl2, -0.4602503F, 0F, 0F);
rbl3 = new ModelRenderer(this, 40, 0);
rbl3.addBox(-3F, -2F, -13F, 5, 3, 13);
rbl3.setRotationPoint(1.5F, 10.5F, 4F);
rbl3.setTextureSize(256, 256);
rbl3.mirror = true;
setRotation(rbl3, 0F, 0F, 0F);
rfl1 = new ModelRenderer(this, 55, 30);
rfl1.addBox(-1F, -3F, -3F, 5, 12, 6);
rfl1.setRotationPoint(-8F, 4F, 6F);
rfl1.setTextureSize(256, 256);
rfl1.mirror = true;
setRotation(rfl1, 0.4833219F, 0F, 0F);
rfl2 = new ModelRenderer(this, 60, 60);
rfl2.addBox(-1.1F, -3F, -3F, 4, 14, 6);
rfl2.setRotationPoint(1F, 9F, -1F);
rfl2.setTextureSize(256, 256);
rfl2.mirror = true;
setRotation(rfl2, -0.4602503F, 0F, 0F);
rfl3 = new ModelRenderer(this, 40, 0);
rfl3.addBox(-3F, -2F, -13F, 5, 3, 13);
rfl3.setRotationPoint(1.5F, 10.5F, 4F);
rfl3.setTextureSize(256, 256);
rfl3.mirror = true;
setRotation(rfl3, 0F, 0F, 0F);
lbl3 = new ModelRenderer(this, 40, 0);
lbl3.addBox(-3F, -2F, -13F, 5, 3, 13);
lbl3.setRotationPoint(1.5F, 10.5F, 4F);
lbl3.setTextureSize(256, 256);
lbl3.mirror = true;
setRotation(lbl3, 0F, 0F, 0F);
lbl2 = new ModelRenderer(this, 30, 30);
lbl2.addBox(-0.9F, -3F, -3F, 4, 14, 6);
lbl2.setRotationPoint(0.5F, 9F, 1F);
lbl2.setTextureSize(256, 256);
lbl2.mirror = true;
setRotation(lbl2, -0.4602503F, 0F, 0F);
lbl1 = new ModelRenderer(this, 0, 25);
lbl1.addBox(-1F, -3F, -3F, 5, 12, 8);
lbl1.setRotationPoint(5F, 4F, 45F);
lbl1.setTextureSize(256, 256);
lbl1.mirror = true;
setRotation(lbl1, 0.4833219F, 0F, 0F);
lfl1 = new ModelRenderer(this, 55, 30);
lfl1.addBox(-1F, -3F, -3F, 5, 12, 6);
lfl1.setRotationPoint(5F, 4F, 6F);
lfl1.setTextureSize(256, 256);
lfl1.mirror = true;
setRotation(lfl1, 0.4833219F, 0F, 0F);
lfl2 = new ModelRenderer(this, 60, 60);
lfl2.addBox(-0.9F, -3F, -3F, 4, 14, 6);
lfl2.setRotationPoint(1F, 9F, -1F);
lfl2.setTextureSize(256, 256);
lfl2.mirror = true;
setRotation(lfl2, -0.4602503F, 0F, 0F);
lfl3 = new ModelRenderer(this, 40, 0);
lfl3.addBox(-3F, -2F, -13F, 5, 3, 13);
lfl3.setRotationPoint(1.5F, 10.5F, 4F);
lfl3.setTextureSize(256, 256);
lfl3.mirror = true;
setRotation(lfl3, 0F, 0F, 0F);
RightWingFlap1 = new ModelRenderer(this, 0, 208);
RightWingFlap1.addBox(0F, 0F, -14F, 1, 18, 28);
RightWingFlap1.setRotationPoint(-1F, 0F, 19.5F);
RightWingFlap1.setTextureSize(256, 256);
RightWingFlap1.mirror = true;
setRotation(RightWingFlap1, 0F, 0F, 0F);
RightWingFlap2 = new ModelRenderer(this, 76, 202);
RightWingFlap2.addBox(-0.5F, -14F, 0.5F, 1, 27, 27);
RightWingFlap2.setRotationPoint(0.5F, -13F, 1F);
RightWingFlap2.setTextureSize(256, 256);
RightWingFlap2.mirror = true;
setRotation(RightWingFlap2, 0F, 0F, 0F);
RightWingFlap3 = new ModelRenderer(this, 134, 202);
RightWingFlap3.addBox(-0.5F, -14F, 0.5F, 1, 27, 27);
RightWingFlap3.setRotationPoint(0F, -16F, 0F);
RightWingFlap3.setTextureSize(256, 256);
RightWingFlap3.mirror = true;
setRotation(RightWingFlap3, 0F, 0F, 0F);
RightWingFlap4 = new ModelRenderer(this, 76, 145);
RightWingFlap4.addBox(-0.5F, -14F, 0.5F, 1, 27, 27);
RightWingFlap4.setRotationPoint(0.4F, -15F, 0F);
RightWingFlap4.setTextureSize(256, 256);
RightWingFlap4.mirror = true;
setRotation(RightWingFlap4, 0F, 0F, 0F);
LeftWingFlap1 = new ModelRenderer(this, 0, 208);
LeftWingFlap1.addBox(0F, 0F, -14F, 1, 18, 28);
LeftWingFlap1.setRotationPoint(1F, 0F, 19.5F);
LeftWingFlap1.setTextureSize(256, 256);
LeftWingFlap1.mirror = true;
setRotation(LeftWingFlap1, 0F, 0F, 0F);
LeftWingFlap2 = new ModelRenderer(this, 76, 202);
LeftWingFlap2.addBox(-0.5F, -14F, 0.5F, 1, 27, 27);
LeftWingFlap2.setRotationPoint(0.5F, -13F, 1F);
LeftWingFlap2.setTextureSize(256, 256);
LeftWingFlap2.mirror = true;
setRotation(LeftWingFlap2, 0.0F, 0F, 0F);
LeftWingFlap3 = new ModelRenderer(this, 134, 202);
LeftWingFlap3.addBox(-0.5F, -14F, 0.5F, 1, 27, 27);
LeftWingFlap3.setRotationPoint(0F, -16F, 0F);
LeftWingFlap3.setTextureSize(256, 256);
LeftWingFlap3.mirror = true;
setRotation(LeftWingFlap3, 0F, 0F, 0F);
LeftWingFlap4 = new ModelRenderer(this, 76, 145);
LeftWingFlap4.addBox(-0.5F, -14F, 0.5F, 1, 27, 27);
LeftWingFlap4.setRotationPoint(0.4F, -15F, 0F);
LeftWingFlap4.setTextureSize(256, 256);
LeftWingFlap4.mirror = true;
setRotation(LeftWingFlap4, 0F, 0F, 0F);
//Head
Head1.addChild(Mouth1);
Head1.addChild(Mouth2);
Head1.addChild(Nostril1);
Head1.addChild(Nostril2);
Head1.addChild(Cheek);
//Neck
Breast4.addChild(Neck1);
Neck1.addChild(Neck2);
Neck2.addChild(Neck3);
Neck3.addChild(Neck4);
Neck4.addChild(Neck5);
Neck5.addChild(Neck6);
Neck6.addChild(Neck7);
Neck7.addChild(Neck8);
Neck8.addChild(Neck9);
Neck9.addChild(Neck10);
Neck10.addChild(Neck11);
Neck11.addChild(Neck12);
Neck12.addChild(Neck13);
Neck13.addChild(Neck14);
Neck14.addChild(Head1);
//Legs
//right front
rfl1.addChild(rfl2);
rfl2.addChild(rfl3);
//left front
lfl1.addChild(lfl2);
lfl2.addChild(lfl3);
//right back
rbl1.addChild(rbl2);
rbl2.addChild(rbl3);
//left back
lbl1.addChild(lbl2);
lbl2.addChild(lbl3);
//wings
LeftWing1.addChild(LeftWing2);
LeftWing1.addChild(LeftWingFlap1);
LeftWing2.addChild(LeftWing3);
LeftWing2.addChild(LeftWingFlap2);
LeftWing3.addChild(LeftWing4);
LeftWing3.addChild(LeftWingFlap3);
LeftWing4.addChild(LeftWingFlap4);
RightWing1.addChild(RightWing2);
RightWing1.addChild(RightWingFlap1);
RightWing2.addChild(RightWing3);
RightWing2.addChild(RightWingFlap2);
RightWing3.addChild(RightWing4);
RightWing3.addChild(RightWingFlap3);
RightWing4.addChild(RightWingFlap4);
//tail
Body2.addChild(Tail1);
Tail1.addChild(Tail2);
Tail2.addChild(Tail3);
Tail3.addChild(Tail4);
Tail4.addChild(Tail5);
Tail5.addChild(Tail6);
Tail6.addChild(Tail7);
Tail7.addChild(Tail8);
Tail8.addChild(Tail9);
Tail9.addChild(Tail10);
Tail10.addChild(Tail11);
Tail13.addChild(Tail12);
Tail11.addChild(Tail13);
Tail13.addChild(Tail14);
Tail13.addChild(Tail15);
Tail13.addChild(Tail16);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
BackBone.render(f5);
BackBone2.render(f5);
BackBone3.render(f5);
Breast1.render(f5);
Breast2.render(f5);
Breast3.render(f5);
Breast4.render(f5);
Body1.render(f5);
BackBone4.render(f5);
BackBone5.render(f5);
BackBone6.render(f5);
Body2.render(f5);
RightWing1.render(f5);
LeftWing1.render(f5);
rbl1.render(f5);
rfl1.render(f5);
lbl1.render(f5);
lfl1.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)
{
//Legs
this.rfl1.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
this.rfl2.rotateAngleX = ((MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2)*-1.1F);
this.lfl1.rotateAngleX = (MathHelper.cos(par1 * 0.6662F) * 1.4F * par2);
this.lfl2.rotateAngleX = (MathHelper.cos(par1 * 0.6662F) * 1.4F * par2)*-1.1F;
this.rbl1.rotateAngleX = (MathHelper.cos(par1 * 0.6662F) * 1.4F * par2);
this.rbl2.rotateAngleX = ((MathHelper.cos(par1 * 0.6662F) * 1.4F * par2)*-1.1F);
this.lbl1.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
this.lbl2.rotateAngleX = (MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2)*-1.1F;
//Wings
//if(EntityModDragon.onGround2 == false){
//float speedd3 = par2;
//this.RightWing1.rotateAngleZ = (((MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * speedd3*-1.1F))*-1/2.5F-0.7F)+((MathHelper.cos(par3/5))/10F)+0.1F;
//this.LeftWing1.rotateAngleZ = (((MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * speedd3*-1.1F))/2.5F+0.7F)+((MathHelper.cos(par3/5 + (float)Math.PI))/10F)-0.1F;
//}
/** //Tail
this.Tail1.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.2F;
this.Tail2.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.3F;
this.Tail3.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.3F;
this.Tail4.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.2F;
this.Tail5.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.2F;
this.Tail6.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.2F;
this.Tail7.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.2F;
this.Tail8.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.2F;
this.Tail9.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+5F;
this.Tail10.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.5F;
this.Tail11.rotateAngleX = ((MathHelper.sin(par3/10)/2)/10F)+0.5F;
**/
//Neck
this.Neck3.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)-0.4F;
this.Neck4.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)-0.3F;
this.Neck5.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)+1.8F;
this.Neck6.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)+0.1F;
this.Neck7.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)+0.1F;
this.Neck9.rotateAngleX = ((MathHelper.sin(par3/10-1)/5)/10F)+0.2F;
this.Neck10.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)+0.2F;
this.Neck11.rotateAngleX = ((MathHelper.sin(par3/10+2)/5)/10F)+0.2F;
this.Neck12.rotateAngleX = ((MathHelper.sin(par3/10-2)/5)/10F)+0.2F;
this.Neck13.rotateAngleX = ((MathHelper.sin(par3/10-2)/5)/10F)+0.2F;
this.Neck14.rotateAngleX = ((MathHelper.sin(par3/10-2)/5)/10F)+0.2F;
}
}
|
package com.wangwentong.sports_api.model;
import java.io.Serializable;
/**
* Created by Wentong WANG on 2016/11/20.
*/
public class NewsInfo implements Serializable {
private String news_title;
private String news_content;
private String news_creator_id;
private String news_create_time;
private String news_place;
private String news_liked;
private String news_likes_total;
private String news_view;
public String getNewsLikesTotal() {
return news_likes_total;
}
public void setNewsLikesTotal(String news_likes_total) {
this.news_likes_total = news_likes_total;
}
public String getNewsTitle() {
return news_title;
}
public void setNewsTitle(String news_title) {
this.news_title = news_title;
}
public String getNewsContent() {
return news_content;
}
public void setNewsContent(String news_content) {
this.news_content = news_content;
}
public String getNewsCreatorId() {
return news_creator_id;
}
public void setNewsCreatorId(String news_creator_id) {
this.news_creator_id = news_creator_id;
}
public String getNewsCreateTime() {
return news_create_time;
}
public void setNewsCreateTime(String news_create_time) {
this.news_create_time = news_create_time;
}
public String getNewsPlace() {
return news_place;
}
public void setNewsPlace(String news_place) {
this.news_place = news_place;
}
public String getNewsLiked() {
return news_liked;
}
public void setNewsLiked(String news_liked) {
this.news_liked = news_liked;
}
public String getNewsView() {
return news_view;
}
public void setNewsView(String news_view) {
this.news_view = news_view;
}
}
|
/*
* Copyright (c) 2011, 2020, Frank Jiang and/or its affiliates. All rights
* reserved. AbstractKernel.java is PROPRIETARY/CONFIDENTIAL built in 2013. Use
* is subject to license terms.
*/
package com.frank.svm.config;
import libsvm.svm_parameter;
/**
* The LIBSVM kernel configuration interface.
*
* @author <a href="mailto:jiangfan0576@gmail.com">Frank Jiang</a>
* @version 1.0.0
* @see svm_parameter#LINEAR
* @see svm_parameter#POLY
* @see svm_parameter#RBF
* @see svm_parameter#SIGMOID
* @see svm_parameter#PRECOMPUTED
*/
public interface Kernel
{
/**
* Configure the kernel information for the specified LIBSVM parameter.
*
* @param param
* the specified LIBSVM parameter
*/
public void configure(svm_parameter param);
}
|
/*
* NAESC Conference is a Google App Engine web application that provides
* a conference registration system.
* Copyright (C) 2010 Speed School Student Council
* This program 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 program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.naesc2011.conference.shared;
import java.util.ArrayList;
import java.util.List;
import javax.jdo.PersistenceManager;
import javax.jdo.annotations.Element;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import com.naesc2011.conference.shared.ConferenceAttendee.VoteStatus;
@PersistenceCapable
public class Council {
/**
* The key.
*/
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
/**
* The council name.
*/
@Persistent
private String name;
/**
* The university.
*/
@Persistent
private String university;
/**
* The location.
*/
@Persistent
private String location;
/**
* The contact.
*/
@Persistent
private String contact;
/**
* The list of attendees.
*/
@Persistent
@Element(dependent = "true")
private List<ConferenceAttendee> attendees;
/**
* The website.
*/
@Persistent
private String website;
/**
* The amount of money the council has Paid
*/
@Persistent
private double amountPaid;
/**
* The notes about the payment.
*/
@Persistent
private String paymentNotes;
/**
* The list of award submissions.
*/
@Persistent
@Element(dependent = "true")
private List<AwardSubmission> awardSubmissions;
/**
* Creates a new instance of the Council class.
*
* @param name
* The council name.
* @param university
* The university.
* @param location
* The location.
* @param contact
* The contact.
*/
public Council(String name, String university, String location,
String contact) {
this.name = "";
this.university = "";
this.location = "";
this.website = "";
this.contact = "";
this.paymentNotes = "";
this.setName(name);
this.setUniversity(university);
this.setLocation(location);
this.setContact(contact);
this.setWebsite("");
this.setAmountPaid(0);
this.setPaymentNotes("");
this.attendees = new ArrayList<ConferenceAttendee>();
this.awardSubmissions = new ArrayList<AwardSubmission>();
}
/**
* Sets the voting delegate to the specified attendee id.
*
* @param id
* The id of the attendee to designate as the voting delegate.
*/
public void SetVotingDelegate(String id) {
for (int i = 0; i < this.attendees.size(); i++) {
ConferenceAttendee att = this.attendees.get(i);
if ((att.getKey().getId() + "").equals(id)) {
att.setVoteStatus(VoteStatus.VOTING);
} else if (att.getVoteStatus() == null) {
att.setVoteStatus(VoteStatus.NONE);
} else if (att.getVoteStatus().equals(VoteStatus.VOTING)) {
att.setVoteStatus(VoteStatus.NONE);
}
}
}
/**
* Sets the alternate delegate to the attendee with the specified id.
*
* @param id
* The id of the attendee to designate as an alternate delegate.
*/
public void SetAlternateDeleaget(String id) {
for (int i = 0; i < this.attendees.size(); i++) {
ConferenceAttendee att = this.attendees.get(i);
if ((att.getKey().getId() + "").equals(id)) {
att.setVoteStatus(VoteStatus.ALTERNATE);
} else if (att.getVoteStatus() == null) {
att.setVoteStatus(VoteStatus.NONE);
} else if (att.getVoteStatus().equals(VoteStatus.ALTERNATE)) {
att.setVoteStatus(VoteStatus.NONE);
}
}
}
/**
* Gets the key.
*
* @return The key.
*/
public Key getKey() {
return key;
}
/**
* Sets the key.
*
* @param key
* The key to set.
*/
public void setKey(Key key) {
this.key = key;
}
/**
* Gets the name.
*
* @return The name.
*/
public String getName() {
return name;
}
/**
* Sets the name.
*
* @param name
* The name to set.
*/
public void setName(String name) {
String s = name.replaceAll("\\<.*?>", "");
if (!this.name.equals(s)) {
this.name = s;
}
}
/**
* Gets the university.
*
* @return The university.
*/
public String getUniversity() {
return university;
}
/**
* Sets the university.
*
* @param university
* The university to set.
*/
public void setUniversity(String university) {
String s = university.replaceAll("\\<.*?>", "");
if (!this.university.equals(s)) {
this.university = s;
}
}
/**
* Gets the location.
*
* @return The location.
*/
public String getLocation() {
return location;
}
/**
* Sets the location.
*
* @param location
* The location to set.
*/
public void setLocation(String location) {
String s = location.replaceAll("\\<.*?>", "");
if (!this.location.equals(s)) {
this.location = s;
}
}
/**
* Gets the contact.
*
* @return The contact.
*/
public String getContact() {
return contact;
}
/**
* Sets the contact.
*
* @param contact
* The contact to set.
*/
public void setContact(String contact) {
String s = contact.replaceAll("\\<.*?>", "");
if (!this.contact.equals(s)) {
this.contact = s;
}
}
/**
* Gets the list of attendees.
*
* @return The attendee list.
*/
public List<ConferenceAttendee> getAttendees() {
return attendees;
}
/**
* Gets the total cost of all of the attendees.
*
* @return The total cost.
*/
public double getAttendeeCost() {
double total = 0;
for (int i = 0; i < this.attendees.size(); i++) {
total += this.attendees.get(i).getRegistartionFee();
}
return total;
}
/**
* Gets the website.
*
* @return The website.
*/
public String getWebsite() {
return website;
}
/**
* Sets the website.
*
* @param website
* The website to set.
*/
public void setWebsite(String website) {
String s = website.replaceAll("\\<.*?>", "");
if (!this.website.equals(s)) {
this.website = s;
}
}
/**
* Gets the amount paid.
*
* @return The amount Paid.
*/
public double getAmountPaid() {
return amountPaid;
}
/**
* Sets the amount paid.
*
* @param amountPaid
* The amountPaid to set.
*/
public void setAmountPaid(double amountPaid) {
this.amountPaid = amountPaid;
}
/**
* Gets the payment notes.
*
* @return The payment Notes.
*/
public String getPaymentNotes() {
return paymentNotes;
}
/**
* Sets the payment notes.
*
* @param paymentNotes
* The paymentNotes to set.
*/
public void setPaymentNotes(String paymentNotes) {
String s = paymentNotes.replaceAll("\\<.*?>", "");
if (!this.paymentNotes.equals(s)) {
this.paymentNotes = s;
}
}
/**
* Gets the award submissions.
*
* @return The awardSubmissions.
*/
public List<AwardSubmission> getAwardSubmissions() {
return awardSubmissions;
}
/**
* Inserts a new council into the datastore.
*
* @param pm
* The PersistenceManager.
* @param council
* The Council to add.
*/
public static void InsertCouncil(PersistenceManager pm, Council council) {
pm.makePersistent(council);
}
/**
* Gets all of the councils.
*
* @param pm
* The PersistenceManager.
* @return A list of all of the councils.
*/
@SuppressWarnings("unchecked")
public static List<Council> GetAllCouncils(PersistenceManager pm) {
String query = "select from " + Council.class.getName()
+ " order by name";
return (List<Council>) pm.newQuery(query).execute();
}
/**
* Gets the specified council.
*
* @param pm
* The PersistenceManager.
* @param id
* The identifier for the council requested.
* @return The requested Council.
*/
public static Council GetCouncil(PersistenceManager pm, String id) {
int i = Integer.parseInt(id);
Key key = KeyFactory.createKey(Council.class.getSimpleName(), i);
Council c = pm.getObjectById(Council.class, key);
return c;
}
/**
* Gets the specified council.
*
* @param pm
* The PersistenceManager.
* @param key
* The key to identify the council.
* @return The requested council.
*/
public static Council GetCouncil(PersistenceManager pm, Key key) {
Council c = pm.getObjectById(Council.class, key);
return c;
}
}
|
/*
* Copyright 2012 JBoss Inc
*
* 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 org.overlord.rtgov.ui.client.local.pages;
import javax.annotation.PostConstruct;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import org.jboss.errai.databinding.client.api.DataBinder;
import org.jboss.errai.databinding.client.api.InitialState;
import org.jboss.errai.ui.nav.client.local.Page;
import org.jboss.errai.ui.nav.client.local.PageState;
import org.jboss.errai.ui.nav.client.local.TransitionAnchor;
import org.jboss.errai.ui.shared.api.annotations.AutoBound;
import org.jboss.errai.ui.shared.api.annotations.Bound;
import org.jboss.errai.ui.shared.api.annotations.DataField;
import org.jboss.errai.ui.shared.api.annotations.Templated;
import org.overlord.commons.gwt.client.local.widgets.HtmlSnippet;
import org.overlord.rtgov.ui.client.local.ClientMessages;
import org.overlord.rtgov.ui.client.local.services.NotificationService;
import org.overlord.rtgov.ui.client.local.services.ServicesServiceCaller;
import org.overlord.rtgov.ui.client.local.services.rpc.IRpcServiceInvocationHandler;
import org.overlord.rtgov.ui.client.local.util.DOMUtil;
import org.overlord.rtgov.ui.client.local.util.DataBindingQNameLocalPartConverter;
import org.overlord.rtgov.ui.client.local.util.DataBindingQNameNamespaceConverter;
import org.overlord.rtgov.ui.client.model.ReferenceBean;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.InlineLabel;
/**
* The Reference Details page.
*
* @author eric.wittmann@redhat.com
*/
@Templated("/org/overlord/rtgov/ui/client/local/site/referenceDetails.html#page")
@Page(path="referenceDetails")
@Dependent
public class ReferenceDetailsPage extends AbstractPage {
@Inject
protected ClientMessages i18n;
@Inject
protected ServicesServiceCaller servicesService;
@Inject
protected NotificationService notificationService;
@PageState
private String id;
@Inject @AutoBound
protected DataBinder<ReferenceBean> reference;
// Breadcrumbs
@Inject @DataField("back-to-dashboard")
private TransitionAnchor<DashboardPage> toDashboardPage;
@Inject @DataField("back-to-services")
private TransitionAnchor<ServicesPage> toServicesPage;
@Inject @DataField("to-situations")
private TransitionAnchor<SituationsPage> toSituationsPage;
// Header
@Inject @DataField @Bound(property="name", converter=DataBindingQNameLocalPartConverter.class)
InlineLabel referenceName;
// Properties
@Inject @DataField @Bound(property="name", converter=DataBindingQNameNamespaceConverter.class)
InlineLabel referenceNamespace;
@Inject @DataField @Bound(property="application", converter=DataBindingQNameNamespaceConverter.class)
InlineLabel applicationNamespace;
@Inject @DataField @Bound(property="application", converter=DataBindingQNameLocalPartConverter.class)
InlineLabel applicationName;
@Inject @DataField @Bound(property="referenceInterface")
InlineLabel referenceInterface;
@Inject @DataField("reference-details-loading-spinner")
protected HtmlSnippet loading;
protected Element pageContent;
/**
* Constructor.
*/
public ReferenceDetailsPage() {
}
/**
* Called after the widget is constructed.
*/
@PostConstruct
protected void onPostConstruct() {
pageContent = DOMUtil.findElementById(getElement(), "reference-details-content-wrapper"); //$NON-NLS-1$
pageContent.addClassName("hide"); //$NON-NLS-1$
}
/**
* @see org.overlord.sramp.ui.client.local.pages.AbstractPage#onPageShowing()
*/
@Override
protected void onPageShowing() {
pageContent.addClassName("hide"); //$NON-NLS-1$
loading.getElement().removeClassName("hide"); //$NON-NLS-1$
servicesService.getReference(id, new IRpcServiceInvocationHandler<ReferenceBean>() {
@Override
public void onReturn(ReferenceBean data) {
updateMetaData(data);
}
@Override
public void onError(Throwable error) {
notificationService.sendErrorNotification(i18n.format("reference-details.error-getting-detail-info"), error); //$NON-NLS-1$
}
});
}
/**
* Called when the reference is loaded.
* @param reference
*/
protected void updateMetaData(ReferenceBean reference) {
this.reference.setModel(reference, InitialState.FROM_MODEL);
loading.getElement().addClassName("hide"); //$NON-NLS-1$
pageContent.removeClassName("hide"); //$NON-NLS-1$
}
}
|
package com.assignment08_sudoku;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import java.util.ArrayList;
public class DatabaseManager extends SQLiteOpenHelper {
final Context context;
static final String DATABASE_NAME="sudoku";
static final int VERSION=1;
static final String TABLENAME="board";
static final String CREATE_TABLE="create table "+TABLENAME+"( _id integer primary key autoincrement, 'difficulty' integer ,'name' TXT, " +
"'_00' integer,'_10' integer,'_20' integer,'_30' integer,'_40' integer,'_50' integer,'_60' integer,'_70' integer,'_80' integer," +
"'_01' integer,'_11' integer,'_21' integer,'_31' integer,'_41' integer,'_51' integer,'_61' integer,'_71' integer,'_81' integer, " +
"'_02' integer,'_12' integer,'_22' integer,'_32' integer,'_42' integer,'_52' integer,'_62' integer,'_72' integer,'_82' integer, " +
"'_03' integer,'_13' integer,'_23' integer,'_33' integer,'_43' integer,'_53' integer,'_63' integer,'_73' integer,'_83' integer, " +
"'_04' integer,'_14' integer,'_24' integer,'_34' integer,'_44' integer,'_54' integer,'_64' integer,'_74' integer,'_84' integer, " +
"'_05' integer,'_15' integer,'_25' integer,'_35' integer,'_45' integer,'_55' integer,'_65' integer,'_75' integer,'_85' integer, " +
"'_06' integer,'_16' integer,'_26' integer,'_36' integer,'_46' integer,'_56' integer,'_66' integer,'_76' integer,'_86' integer, " +
"'_07' integer,'_17' integer,'_27' integer,'_37' integer,'_47' integer,'_57' integer,'_67' integer,'_77' integer,'_87' integer, " +
"'_08' integer, '_18' integer, '_28' integer, '_38' integer, '_48' integer, '_58' integer, '_68' integer, '_78' integer, '_88' integer )";
public DatabaseManager(Context context) throws Exception{
super(context,DATABASE_NAME,null,VERSION);
this.context = context;
}
public ArrayList<String> getBoard(int difficulty, String name){
Log.i(getClass().getSimpleName(), "getBoard: ");
SQLiteDatabase db = this.getReadableDatabase();
//Cursor cursor =db.rawQuery("Select * from "+TABLENAME+" where difficulty=? and name=?",new String[]{String.valueOf(difficulty),name});
Cursor cursor =db.rawQuery("Select * from board where difficulty=? and name=? limit 1",new String[]{String.valueOf(difficulty),name});
ArrayList<String> res = new ArrayList<>();
if (cursor != null) {
cursor.moveToFirst();
try {
for (int i = 0; i <cursor.getColumnCount()-3 ; i++) {
res.add(cursor.getString(i+3));
}
}catch (Exception e) {
e.printStackTrace();
}
}
db.close();
return res;
}
public void insertBoard(ArrayList<int[]> board,String navn,int difficulty){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues input = new ContentValues();
input.put("name",navn);
input.put("difficulty",difficulty);
for (int y = 0; y < board.size(); y++) {
for (int x = 0; x <board.get(y).length ; x++) {
input.put("_"+x+""+y,board.get(y)[x]);
Log.i("dbLoading","_"+x+""+y+" "+board.get(y)[x]);
}
}
db.insert(TABLENAME,null,input);
db.close();
}
public ArrayList<String[]> listNames(int difficulty){
final String NAME_QUERY="select _id,name from "+TABLENAME+" where difficulty=?";
SQLiteDatabase db = this.getReadableDatabase();
ArrayList<String[]> res = new ArrayList<>();
Cursor cursor =
db.rawQuery(NAME_QUERY, new String[]{difficulty+""});
if (cursor != null) {
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
Log.i(getClass().getSimpleName(),"navn: "+cursor.getString(1));
String tempRes[]={cursor.getString(0).replace("_",""),cursor.getString(1)};
res.add(tempRes);
cursor.moveToNext();
}
}
db.close();
return res;
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
Log.i(getClass().getSimpleName(), "onCreate: ");
sqLiteDatabase.execSQL(CREATE_TABLE);
}
//tatt fra eksemplekode i faget
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
Log.d(getClass().getSimpleName(), "onUpdate");
sqLiteDatabase.execSQL("DROP TABLE IF EXISTS "+TABLENAME);
onCreate(sqLiteDatabase);
}
//tatt fra eksemplekode
public void clean() {
SQLiteDatabase db = getWritableDatabase();
onUpgrade(db, 0, 0);
db.close();
}
}
|
package main.Strategy;
public class Pagamento {
FormaPagamentoStrategy formaPagamento;
public Pagamento(FormaPagamentoStrategy formaPagamento) {
this.formaPagamento = formaPagamento;
}
public Double calcularTarifa(Double valorTotal) {
return this.formaPagamento.calcularTaxa(valorTotal);
}
}
|
package ch.heigvd.res.labs.roulette.net.client;
import ch.heigvd.res.labs.roulette.data.JsonObjectMapper;
import ch.heigvd.res.labs.roulette.data.Student;
import ch.heigvd.res.labs.roulette.data.StudentListWrapper;
import ch.heigvd.res.labs.roulette.data.StudentsList;
import ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* This class implements the client side of the protocol specification (version 2).
*
* @author Olivier Liechti
*/
public class RouletteV2ClientImpl extends RouletteV1ClientImpl implements IRouletteV2Client {
@Override
public void clearDataStore() throws IOException {
os.write(simulateInput(RouletteV2Protocol.CMD_CLEAR));
}
@Override
public List<Student> listStudents() throws IOException {
StudentListWrapper studentListWrapper;
os.write(simulateInput(RouletteV2Protocol.CMD_LIST));
is.read(buffer);
String respond = new String(buffer);
studentListWrapper = JsonObjectMapper.parseJson(respond, StudentListWrapper.class);
return studentListWrapper.getStudents();
}
}
|
public class HelloWorldExternalB
{
public void HelloWorldB()
{
System.out.println("HelloWorldB");
}
}
|
package com.ajayb.infoworks;
import java.util.*;
/**
* Using DFS to identify the subgraphs
*/
public class SubgraphIdentifier {
public static <T> List<Set<T>> identifySubgraphs(DirectedAcyclicGraph<T> g) {
List<Set<T>> subGraphs = new ArrayList<Set<T>>();
Set<T> subGraph = new HashSet<T>();
/* Fire off a DFS from each node in the graph. */
for (T node : g) {
if (subGraph.contains(node)) {
continue;
}
subGraph = new HashSet<T>();
explore(node, g, subGraph);
subGraphs.add(subGraph);
}
Collections.sort(subGraphs, Collections.reverseOrder(new Comparator<Set<?>>() {
@Override
public int compare(Set<?> o1, Set<?> o2) {
return Integer.valueOf(o1.size()).compareTo(o2.size());
}
}));
return subGraphs;
}
public static <T> void explore(T node, DirectedAcyclicGraph<T> g,
Set<T> visited) {
visited.add(node);
/* Recursively explore all of the node's predecessors. */
for (T predecessor : g.edgesFrom(node))
explore(predecessor, g, visited);
}
}
|
//Time Limit Exceeded
import java.util.*;
import java.io.*;
public class Fenwick {
public static void main(String[] args) throws IOException {
Scanner nya = new Scanner(System.in);
int n = nya.nextInt();
int ops = nya.nextInt();
nya.nextLine();
FenTree cat = new FenTree(n);
while(ops-->0) {
String[] temp = nya.nextLine().split(" ");
if(temp[0].equals("+"))
cat.update(Integer.parseInt(temp[1]),Integer.parseInt(temp[2]));
else
System.out.println(cat.getSum(Integer.parseInt(temp[1])));
}
}
}
class FenTree {
private int[] BITree;
public FenTree(int n) {
BITree = new int[n+1];
}
public FenTree(int[] arr) {
BITree = new int[arr.length+1];
for (int i = 0; i < arr.length; i++) {
update(i,arr[i]);
}
}
public int getSum(int x) {
//x++;
int sum = 0;
while(x > 0) {
sum += BITree[x];
x -= x & -x;
}
return sum;
}
public void update(int x, int val) {
x++;
while(x <= BITree.length-1) {
BITree[x] += val;
x += x & -x;
}
}
}
|
package com.example.androidtask;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class thirdtask extends AppCompatActivity {
EditText editText;
Button btn;
TextView textView;
int value = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_thirdtask);
editText=(EditText)findViewById(R.id.number);
textView=(TextView)findViewById(R.id.ans);
btn=(Button)findViewById(R.id.submit_button);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
value=Integer.parseInt(editText.getText().toString());
if(value < 0){
textView.setText("Negative Number");
}
else if(value > 0) {
textView.setText("Positive Number");
}
else {
textView.setText("Zero Number");
}
}
});
}
}
|
/*
* 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 software_project;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.stage.Stage;
/**
* FXML Controller class
*
* @author chris
*/
public class AddProductScreenController implements Initializable {
@FXML
private Button addPart_SearchButton;
//Textfields
@FXML
private TextField addProduct_Name;
@FXML
private TextField addProduct_ID;
@FXML
private TextField addProduct_Inv;
@FXML
private TextField addProduct_Price;
@FXML
private TextField addProduct_Max;
@FXML
private TextField addProduct_Min;
@FXML
private TextField addPart_SearchText;
//allParts Table
@FXML
private TableView<Part> addProduct_allPartTable;
@FXML
private TableColumn<Part, Integer> allPartTable_ID;
@FXML
private TableColumn<Part, String> allPartTable_Name;
@FXML
private TableColumn<Part, Integer> allPartTable_Inv;
@FXML
private TableColumn<Part, Double> allPartTable_Price;
//selectedPart or associatedParts Table
@FXML
private TableView<Part> addProduct_selectedPartTable;
@FXML
private TableColumn<Part, Integer> selectedPartTable_ID;
@FXML
private TableColumn<Part, String> selectedPartTable_Name;
@FXML
private TableColumn<Part, Integer> selectedPartTable_Inv;
@FXML
private TableColumn<Part, Double> selectedPartTable_Price;
private ObservableList<Part> linkedParts = FXCollections.observableArrayList();
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
//set top and bottom table values for parts
allPartTable_ID.setCellValueFactory(new PropertyValueFactory<>("iD"));
allPartTable_Name.setCellValueFactory(new PropertyValueFactory<>("name"));
allPartTable_Inv.setCellValueFactory(new PropertyValueFactory<>("stock"));
allPartTable_Price.setCellValueFactory(new PropertyValueFactory<>("price"));
addProduct_allPartTable.setItems(Inventory.getAllParts());
selectedPartTable_ID.setCellValueFactory(new PropertyValueFactory<>("iD"));
selectedPartTable_Name.setCellValueFactory(new PropertyValueFactory<>("name"));
selectedPartTable_Inv.setCellValueFactory(new PropertyValueFactory<>("stock"));
selectedPartTable_Price.setCellValueFactory(new PropertyValueFactory<>("price"));
}
@FXML
private void AddProductsSaveChanges(ActionEvent event) {
/**********
id is generated based on 2 conditions:
1. if list of products is empty id will be 1
2. if list of products has products, the id of the new product will be 1 + the
last product ID (for example, last product has ID of 4, then new product ID will be 5)
**********/
int idGenerator;
if (Inventory.getAllProducts().isEmpty()) {
idGenerator = 0;
}
else {
Product lastOfProducts = Inventory.getAllProducts().get(Inventory.getAllProducts().size()-1);
idGenerator = lastOfProducts.getID();
}
int id = idGenerator + 1;
String name = addProduct_Name.getText();
int inv = Integer.parseInt(addProduct_Inv.getText());
double price = Double.parseDouble(addProduct_Price.getText());
int max = Integer.parseInt(addProduct_Max.getText());
int min = Integer.parseInt(addProduct_Min.getText());
if (Inventory.getAllParts().isEmpty()) {
Alert alert = new Alert(AlertType.ERROR, "Please add a part to inventory before adding a product");
alert.show();
}
else if(linkedParts.isEmpty()) {
Alert alert = new Alert(AlertType.ERROR, "Please select at least one part to associate with this product.");
alert.show();
}
else {
//add new product to Inventory
Product product = new Product(id, name, inv, price, max, min, linkedParts);
Inventory.addProduct(product);
//close window
final Node source = (Node) event.getSource();
final Stage stage = (Stage) source.getScene().getWindow();
stage.close();
}
}
@FXML
private void AddProductsCancelChanges(ActionEvent event) {
Alert alert = new Alert(AlertType.CONFIRMATION, "Are you sure you would like to Cancel?");
alert.showAndWait().ifPresent(response-> {
if(response == ButtonType.OK) {
addProduct_selectedPartTable.getItems().clear();
final Node source = (Node) event.getSource();
final Stage stage = (Stage) source.getScene().getWindow();
stage.close();
System.out.println("Add Products Window Closed.");
}
});
}
@FXML
private void AddtoAssociatedList(ActionEvent event) {
if(addProduct_allPartTable.getSelectionModel().isEmpty()) {
Alert alert = new Alert(AlertType.ERROR, "Please select a part from the list to associate with this product.");
alert.show();
}
else {
//selected Part of array is targeted
Part selectedPart = addProduct_allPartTable.getSelectionModel().getSelectedItem();
//add associatedpart here
linkedParts.add(selectedPart);
//set selectedPartTable Items
addProduct_selectedPartTable.setItems(linkedParts);
//clear selection
addProduct_allPartTable.getSelectionModel().clearSelection();
}
}
@FXML
private void RemoveFromAssociatedList(ActionEvent event) {
if(addProduct_selectedPartTable.getSelectionModel().isEmpty()) {
Alert alert = new Alert(AlertType.ERROR, "Please select a part to delete from the list to dissociate from the product.");
alert.show();
}
else {
Part selectedPart = addProduct_selectedPartTable.getSelectionModel().getSelectedItem();
Alert alert = new Alert(AlertType.CONFIRMATION, "Are you sure you would like to delete this part?");
alert.showAndWait().ifPresent(response-> {
if(response == ButtonType.OK) {
linkedParts.remove(selectedPart);
addProduct_selectedPartTable.setItems(linkedParts);
addProduct_selectedPartTable.getSelectionModel().clearSelection();
}
});
}
}
@FXML
private void AddProductSearchPart(ActionEvent event) {
/***********
search uses a regular expression to determine if input is an integer or string first,
then will display list of appropriately matched products.
if the search is empty, list will simply display all results, if the search is not found the table
will display nothing.
***********/
String partSearchText = addPart_SearchText.getText();
System.out.println(partSearchText);
//checks to see if textfield matches 0-9 in the first char or more
if (partSearchText.matches("[0-9]+")) {
int partSearchInt = Integer.parseInt(partSearchText);
Part searchResultInt = Inventory.lookupPart(partSearchInt);
ObservableList<Part> searchedParts = FXCollections.observableArrayList();
if (searchResultInt != null) {
searchedParts.add(searchResultInt);
addProduct_allPartTable.setItems(searchedParts);
} else {
addPart_SearchText.clear();
addPart_SearchText.setPromptText("No matches found.");
}
} else if (partSearchText.isEmpty()) {
addProduct_allPartTable.setItems(Inventory.getAllParts());
addPart_SearchText.clear();
addPart_SearchText.setPromptText("Displaying all parts.");
} else {
ObservableList<Part> searchedPartsText = Inventory.lookupPart(partSearchText);
if (searchedPartsText.isEmpty()) {
addProduct_allPartTable.setItems(searchedPartsText);
addPart_SearchText.clear();
addPart_SearchText.setPromptText("No matches found.");
} else {
addProduct_allPartTable.setItems(searchedPartsText);
}
}
}
}
|
package Vista;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.SwingConstants;
import javax.swing.JComboBox;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.border.TitledBorder;
import javax.swing.border.EtchedBorder;
import javax.swing.ImageIcon;
import javax.swing.JLayeredPane;
import javax.swing.JTextField;
public class CrearTestPane extends JPanel {
public JTextField nombrePruebaTF;
public JComboBox PreguntaActualCB;
public JButton btnQuitarPregunta;
public JButton btnAddPregunta;
public JButton btnCrearTest;
public JLayeredPane layeredPane;
public JSpinner spinner;
public CrearTestPane() {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
setBackground(new Color(0, 191, 255));
setBounds(0,0,575,501);
setLayout(null);
JLabel requisitoslbl = new JLabel("");
requisitoslbl.setToolTipText("<html><p width=\"500\">"
+"Para que se pueda almacenar su prueba correctamente debe cumplir con los siguientes requisitos:"+"<BR/>"
+ "1) Ningun campo debe estar vacio"+"<BR/>"
+ "2) El tiempo debe estar entre 1 y 86400 segundos."+"<BR/>"
+"</p></html>");
requisitoslbl.setIcon(new ImageIcon(CrearTestPane.class.getResource("/imagenes/preguntaIcono.png")));
requisitoslbl.setBounds(527, 0, 38, 41);
add(requisitoslbl);
JButton fakeButton = new JButton("fake");
add(fakeButton);
fakeButton.requestFocusInWindow();
JSeparator separadorTitulo = new JSeparator();
separadorTitulo.setForeground(new Color(0, 0, 0));
separadorTitulo.setBackground(new Color(0, 0, 0));
separadorTitulo.setBounds(0, 39, 691, 2);
add(separadorTitulo);
JLabel TituloLbl = new JLabel("CREAR TEST");
TituloLbl.setBackground(new Color(30, 144, 255));
TituloLbl.setOpaque(true);
TituloLbl.setHorizontalAlignment(SwingConstants.CENTER);
TituloLbl.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 20));
TituloLbl.setBounds(0, 0, 575, 41);
add(TituloLbl);
btnAddPregunta = new JButton("A\u00F1adir pregunta\r\n");
btnAddPregunta.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
btnAddPregunta.setToolTipText("A\u00F1ade una pregunta al examen.");
btnAddPregunta.setIcon(new ImageIcon(CrearTestPane.class.getResource("/imagenes/crearIcono.png")));
btnAddPregunta.setFont(new Font("Arial Rounded MT Bold", Font.BOLD, 20));
btnAddPregunta.setBounds(10, 369, 281, 57);
add(btnAddPregunta);
JLabel tiempoLbl = new JLabel("TIEMPO (SEGUNDOS)");
tiempoLbl.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 15));
tiempoLbl.setBounds(261, 44, 179, 25);
add(tiempoLbl);
JLabel tiempoIcono = new JLabel("");
tiempoIcono.setIcon(new ImageIcon(CrearTestPane.class.getResource("/imagenes/relojIcono.png")));
tiempoIcono.setBounds(235, 44, 24, 25);
add(tiempoIcono);
JLabel nombrePruebalbl = new JLabel("NOMBRE PRUEBA");
nombrePruebalbl.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 15));
nombrePruebalbl.setBounds(36, 45, 153, 25);
add(nombrePruebalbl);
JLabel nombrePruebaIcono = new JLabel("");
nombrePruebaIcono.setIcon(new ImageIcon(CrearTestPane.class.getResource("/imagenes/nombrePruebaIcono.png")));
nombrePruebaIcono.setBounds(10, 45, 24, 25);
add(nombrePruebaIcono);
nombrePruebaTF = new JTextField();
nombrePruebaTF.setFont(new Font("Arial", Font.PLAIN, 15));
nombrePruebaTF.setToolTipText("Es el nombre de la prueba.");
nombrePruebaTF.setColumns(10);
nombrePruebaTF.setBounds(10, 70, 205, 34);
add(nombrePruebaTF);
layeredPane = new JLayeredPane();
layeredPane.setOpaque(true);
layeredPane.setBorder(new TitledBorder(null, "Datos Pregunta", TitledBorder.CENTER, TitledBorder.TOP, null, null));
layeredPane.setBackground(new Color(255, 255, 255));
layeredPane.setBounds(10, 125, 555, 233);
add(layeredPane);
btnQuitarPregunta = new JButton("Quitar pregunta");
btnQuitarPregunta.setIcon(new ImageIcon(CrearTestPane.class.getResource("/imagenes/eliminarIcono.png")));
btnQuitarPregunta.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
btnQuitarPregunta.setToolTipText("Elimina una pregunta de la prueba.");
btnQuitarPregunta.setFont(new Font("Arial Rounded MT Bold", Font.BOLD, 20));
btnQuitarPregunta.setBounds(10, 433, 281, 57);
add(btnQuitarPregunta);
PreguntaActualCB = new JComboBox();
PreguntaActualCB.setBounds(327, 433, 238, 57);
add(PreguntaActualCB);
PreguntaActualCB.setToolTipText("Es la pregunta que se esta editando actualmente");
PreguntaActualCB.setFont(new Font("Arial Rounded MT Bold", Font.BOLD, 20));
PreguntaActualCB.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(255, 255, 255), new Color(160, 160, 160)), "Pregunta actual", TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 0, 0)));
btnCrearTest = new JButton("Crear Test");
btnCrearTest.setToolTipText("Crea el examen y se guarda.");
btnCrearTest.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
btnCrearTest.setFont(new Font("Arial Rounded MT Bold", Font.BOLD, 20));
btnCrearTest.setIcon(new ImageIcon(CrearTestPane.class.getResource("/imagenes/crearTest.png")));
btnCrearTest.setBounds(327, 369, 238, 57);
add(btnCrearTest);
spinner = new JSpinner();
spinner.setToolTipText("Es el tiempo que durara el examen, no puede ser menor que 1 ni mayor a 86400 (1 dia).");
spinner.setModel(new SpinnerNumberModel(1, 1, 86400, 1));
spinner.setFont(new Font("Arial", Font.PLAIN, 15));
spinner.setBounds(235, 70, 205, 34);
add(spinner);
}
}
|
package com.yi.abhinav0612_pokemon;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import com.yi.abhinav0612_pokemon.databinding.ActivityMainBinding;
import com.yi.abhinav0612_pokemon.fragment.FavoriteFragment;
import com.yi.abhinav0612_pokemon.fragment.PokemonFragment;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private boolean isFavoriteListVisible = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
getSupportFragmentManager().beginTransaction().replace(R.id.frameLayout,new PokemonFragment()).commit();
binding.FavoriteFragment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isFavoriteListVisible){
isFavoriteListVisible = false;
getSupportActionBar().setTitle("Favorites");
binding.FavoriteFragment.setText("Favorites");
getSupportFragmentManager().beginTransaction().replace(R.id.frameLayout,new PokemonFragment()).commit();
}
else {
isFavoriteListVisible = true;
getSupportActionBar().setTitle("Pokemon");
binding.FavoriteFragment.setText("Pokemon");
getSupportFragmentManager().beginTransaction().replace(R.id.frameLayout,new FavoriteFragment()).commit();
}
}
});
}
}
|
package id.go.pekalongankab.laporbupati;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import id.go.pekalongankab.laporbupati.Util.ServerAPI;
public class DetailOpd extends AppCompatActivity {
TextView txopd, txsingkatan, txnama_kepala, txalamat, txno_telp, txemail, txfax, txweb, txdesc;
ImageView foto_opd, bg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_opd);
getSupportActionBar().setTitle("");
getSupportActionBar().setElevation(0);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Bundle bundle = getIntent().getExtras();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
txopd = (TextView) findViewById(R.id.txtnamaopd);
txsingkatan = (TextView) findViewById(R.id.txtsingkatan);
txnama_kepala = (TextView) findViewById(R.id.txtnama_kepala);
txalamat = (TextView) findViewById(R.id.txtalamat);
txno_telp = (TextView) findViewById(R.id.txtno_telp);
txemail = (TextView) findViewById(R.id.txtemail);
txfax = (TextView) findViewById(R.id.txtfax);
txweb = (TextView) findViewById(R.id.txtwebsite);
txdesc = (TextView) findViewById(R.id.txtdesc);
foto_opd = (ImageView) findViewById(R.id.foto_opd);
bg = (ImageView) findViewById(R.id.bg);
txopd.setText(bundle.getString("opd"));
txsingkatan.setText(bundle.getString("singkatan"));
txnama_kepala.setText(bundle.getString("nama_kepala"));
txalamat.setText(bundle.getString("alamat"));
txno_telp.setText(bundle.getString("no_telp"));
txemail.setText(bundle.getString("email"));
if (bundle.getString("fax").equals("")){
txfax.setText("Tidak ada");
}else{
txfax.setText(bundle.getString("fax"));
}
txweb.setText(bundle.getString("website"));
txdesc.setText(bundle.getString("deskripsi"));
Glide.with(getApplicationContext()).load(ServerAPI.URL_FOTO_OPD+bundle.getString("foto"))
.thumbnail(0.5f)
.centerCrop()
.crossFade()
.placeholder(R.drawable.no_image)
.error(R.drawable.no_image)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(foto_opd);
Glide.with(getApplicationContext()).load(ServerAPI.URL_FOTO_OPD+bundle.getString("foto"))
.thumbnail(0.5f)
.centerCrop()
.crossFade()
.placeholder(R.drawable.no_image)
.error(R.drawable.no_image)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(bg);
changeStatusBarColor();
}
@Override
public boolean onSupportNavigateUp(){
finish();
return true;
}
public void changeStatusBarColor() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
// Making notification bar transparent
if (Build.VERSION.SDK_INT >= 21) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
}
}
|
package com.example.kripajha.asytaskgame;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.JsonReader;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = LayoutInflater.from(MainActivity.this);
View view = inflater.inflate(R.layout.activity_main, null);
setContentView(view);
ApiRequestTask obj = new ApiRequestTask(view, MainActivity.this);
obj.execute();
}
}
class ApiRequestTask extends AsyncTask<Void, Void, JSONArray> {
private final Context context;
private View AppView;
TextView txV;
ProgressDialog pb;
ApiRequestTask(View view, Context context) {
this.AppView = view;
this.context = context;
pb = new ProgressDialog(context);
}
private String urlString = "https://jsonplaceholder.typicode.com/posts";
@Override
protected void onPreExecute() {
super.onPreExecute();
txV = AppView.findViewById(R.id.textView);
pb.setMessage("Loading ...");
pb.show();
}
@Override
protected JSONArray doInBackground(Void... params) {
JSONArray response = callingHttpRequest(urlString);
return response;
}
@Override
protected void onPostExecute(JSONArray s) {
super.onPostExecute(s);
if (s != null)
txV.setText(s.toString());
pb.dismiss();
}
private JSONArray callingHttpRequest(String urlString) {
Exception mException = null;
HttpURLConnection urlConnection = null;
URL url;
JSONArray object = null;
InputStream inStream = null;
try {
url = new URL(urlString);
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
inStream = urlConnection.getInputStream();
BufferedReader bReader = new BufferedReader(new InputStreamReader(inStream));
StringBuilder response = new StringBuilder();
String temp;
while ((temp = bReader.readLine()) != null) {
response.append(temp);
}
object = new JSONArray(response.toString());
} catch (Exception e) {
mException = e;
} finally {
if (inStream != null) {
try {
// this will close the bReader as well
inStream.close();
} catch (IOException ignored) {
}
}
if (urlConnection != null) {
urlConnection.disconnect();
}
}
return object;
}
}
|
package com.smxknife.springboot.v1.ex02.children.child1;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@PropertySource("classpath:/child1.properties")
public class Child1Config {
}
|
/* */ package datechooser.model;
/* */
/* */ import java.util.Calendar;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class DateUtils
/* */ {
/* 20 */ private static Calendar calendarCash = null;
/* */
/* */
/* */ public DateUtils() {}
/* */
/* */
/* */ public static int getDay(Calendar date)
/* */ {
/* 28 */ return date.get(5);
/* */ }
/* */
/* */
/* */
/* */
/* */ public static int getMonth(Calendar date)
/* */ {
/* 36 */ return date.get(2);
/* */ }
/* */
/* */
/* */
/* */
/* */ public static int getYear(Calendar date)
/* */ {
/* 44 */ return date.get(1);
/* */ }
/* */
/* */
/* */
/* */
/* */ public static boolean equals(Calendar dat1, Calendar dat2)
/* */ {
/* 52 */ return (getDay(dat1) == getDay(dat2)) && (getMonth(dat1) == getMonth(dat2)) && (getYear(dat1) == getYear(dat2));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean before(Calendar dat1, Calendar dat2)
/* */ {
/* 62 */ if (getYear(dat1) < getYear(dat2))
/* 63 */ return true;
/* 64 */ if (getYear(dat1) > getYear(dat2))
/* 65 */ return false;
/* 66 */ if (getMonth(dat1) < getMonth(dat2))
/* 67 */ return true;
/* 68 */ if (getMonth(dat1) > getMonth(dat2))
/* 69 */ return false;
/* 70 */ if (getDay(dat1) < getDay(dat2)) {
/* 71 */ return true;
/* */ }
/* 73 */ return false;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean after(Calendar dat1, Calendar dat2)
/* */ {
/* 82 */ if (!before(dat1, dat2)) {
/* 83 */ return !equals(dat1, dat2);
/* */ }
/* 85 */ return false;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static void assign(Calendar target, Calendar source)
/* */ {
/* 94 */ target.setTime(source.getTime());
/* */ }
/* */
/* */
/* */
/* */
/* */ public static boolean isNear(Calendar dat1, Calendar dat2)
/* */ {
/* 102 */ Calendar before = null;
/* 103 */ Calendar after = null;
/* */
/* 105 */ if (before(dat1, dat2)) {
/* 106 */ before = dat1;
/* 107 */ after = dat2;
/* */ } else {
/* 109 */ before = dat2;
/* 110 */ after = dat1;
/* */ }
/* */
/* 113 */ initializeCash(before);
/* 114 */ calendarCash.add(5, 1);
/* 115 */ return equals(calendarCash, after);
/* */ }
/* */
/* */ private static void initializeCash(Calendar date) {
/* 119 */ if (calendarCash == null) {
/* 120 */ calendarCash = (Calendar)date.clone();
/* */ } else {
/* 122 */ calendarCash.setTime(date.getTime());
/* */ }
/* */ }
/* */ }
/* Location: /home/work/vm/shared-folder/reverse/ketonix/KetonixUSB-20170310.jar!/datechooser/model/DateUtils.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/
|
package com.tencent.mm.pluginsdk.model;
import android.text.TextUtils;
import com.tencent.mm.ab.b;
import com.tencent.mm.ab.b.a;
import com.tencent.mm.ab.e;
import com.tencent.mm.ab.l;
import com.tencent.mm.network.k;
import com.tencent.mm.network.q;
import com.tencent.mm.protocal.c.bhy;
import com.tencent.mm.protocal.c.byb;
import com.tencent.mm.protocal.c.byd;
import com.tencent.mm.protocal.c.bye;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.storage.g;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import junit.framework.Assert;
public class m extends l implements k {
public int bOh;
public final b diG;
private e diJ;
public String eLb;
public List<String> qyZ;
public String qza;
private List<String> qzb;
private m(String str, String str2, int i) {
this.qyZ = null;
this.bOh = 0;
this.qzb = null;
Assert.assertTrue("This NetSceneVerifyUser init MUST use opcode == MM_VERIFYUSER_VERIFYOK", true);
this.qyZ = new LinkedList();
this.qyZ.add(str);
this.bOh = 3;
a aVar = new a();
aVar.dIG = new byd();
aVar.dIH = new bye();
aVar.uri = "/cgi-bin/micromsg-bin/verifyuser";
aVar.dIF = 137;
aVar.dII = 44;
aVar.dIJ = 1000000044;
this.diG = aVar.KT();
byd byd = (byd) this.diG.dID.dIL;
byd.rfe = 3;
byd.rKZ = "";
LinkedList linkedList = new LinkedList();
byb byb = new byb();
byb.mEl = str;
byb.sud = str2;
byb.rEJ = com.tencent.mm.plugin.d.a.ZN().Gw().XH(str);
byb.siA = null;
linkedList.add(byb);
byd.suk = linkedList;
byd.suj = linkedList.size();
linkedList = new LinkedList();
linkedList.add(Integer.valueOf(i));
byd.sum = linkedList;
byd.sul = linkedList.size();
byd.rTr = new bhy().bq(com.tencent.mm.plugin.normsg.a.b.lFJ.bjE());
x.i("MicroMsg.NetSceneVerifyUser.dkverify", "dkverify scene:%d user:%d ticket:%s anti:%s", new Object[]{Integer.valueOf(byd.suk.size()), Integer.valueOf(byd.sum.size()), str2, byb.rEJ});
}
public m(int i, List<String> list, List<Integer> list2, List<String> list3, String str, String str2, Map<String, Integer> map, String str3, String str4) {
List list32;
int i2;
int i3;
int i4;
this.qyZ = null;
this.bOh = 0;
this.qzb = null;
Assert.assertTrue("This NetSceneVerifyUser init NEVER use opcode == MM_VERIFYUSER_VERIFYOK", i != 3);
this.bOh = i;
this.qyZ = list;
if (list32 == null || list32.size() == 0) {
list32 = new LinkedList();
}
a aVar = new a();
aVar.dIG = new byd();
aVar.dIH = new bye();
aVar.uri = "/cgi-bin/micromsg-bin/verifyuser";
aVar.dIF = 137;
aVar.dII = 44;
aVar.dIJ = 1000000044;
this.diG = aVar.KT();
if (list32 != null && list32.size() > 0) {
if (list32.size() == list.size()) {
i2 = 0;
while (true) {
i3 = i2;
if (i3 >= list32.size()) {
break;
}
com.tencent.mm.plugin.d.a.ZN().Gw().x((String) list.get(i3), 2147483633, (String) list32.get(i3));
i2 = i3 + 1;
}
} else {
x.e("MicroMsg.NetSceneVerifyUser.dkverify", "dkverify Error lstAntispamTicket:%d lstVerifyUser:%d", new Object[]{Integer.valueOf(list32.size()), Integer.valueOf(list.size())});
}
}
if (i == 2) {
i2 = 0;
while (true) {
i4 = i2;
if (i4 >= list.size()) {
break;
}
list32.add(bi.aG(com.tencent.mm.plugin.d.a.ZN().Gw().XH((String) list.get(i4)), ""));
i2 = i4 + 1;
}
}
byd byd = (byd) this.diG.dID.dIL;
byd.rfe = i;
byd.rKZ = str;
this.qza = str;
LinkedList linkedList = new LinkedList();
i4 = 0;
while (true) {
i3 = i4;
if (i3 < list.size()) {
String str5;
byb byb = new byb();
byb.mEl = (String) list.get(i3);
if (str2 == null) {
str5 = "";
} else {
str5 = str2;
}
byb.sud = str5;
g Gw = com.tencent.mm.plugin.d.a.ZN().Gw();
String str6 = byb.mEl;
((Integer) list2.get(i3)).intValue();
byb.rEJ = bi.aG(Gw.XH(str6), "");
if (TextUtils.isEmpty(byb.rEJ) && list32 != null && list32.size() > i3) {
byb.rEJ = (String) list32.get(i3);
}
byb.siA = str3;
if (map != null) {
if (map.containsKey(byb.mEl)) {
byb.sue = ((Integer) map.get(byb.mEl)).intValue();
}
}
byb.sui = str4;
x.i("MicroMsg.NetSceneVerifyUser.dkverify", "dkverify op:%s idx:%s user:%s anti:%s chatroom:%s, reportInfo:%s", new Object[]{Integer.valueOf(this.bOh), Integer.valueOf(i3), byb.mEl, byb.rEJ, str3, str4});
linkedList.add(byb);
i4 = i3 + 1;
} else {
byd.suk = linkedList;
byd.suj = linkedList.size();
LinkedList linkedList2 = new LinkedList();
linkedList2.addAll(list2);
byd.sum = linkedList2;
byd.sul = linkedList2.size();
byd.rTr = new bhy().bq(com.tencent.mm.plugin.normsg.a.b.lFJ.bjE());
x.i("MicroMsg.NetSceneVerifyUser.dkverify", "dkverify op:%d scene:%d user:%d antitickets:%s chatroom:%s stack:%s", new Object[]{Integer.valueOf(this.bOh), Integer.valueOf(byd.suk.size()), Integer.valueOf(byd.sum.size()), bi.c(list32, ","), str3, bi.cjd()});
return;
}
}
}
public m(List<String> list, List<Integer> list2, String str, String str2, Map<String, Integer> map, String str3) {
this(2, list, list2, null, str, str2, map, str3, "");
}
public m(String str, String str2, int i, byte b) {
this(str, str2, i);
}
public m(int i, List<String> list, List<Integer> list2, String str, String str2) {
this(i, list, list2, null, str, str2, null, null, "");
}
public final void fy(String str, String str2) {
Iterator it = ((byd) this.diG.dID.dIL).suk.iterator();
while (it.hasNext()) {
byb byb = (byb) it.next();
byb.suf = str;
byb.sug = str2;
}
}
public final String cby() {
if (this.diG == null || this.diG.dIE == null) {
return "";
}
return ((bye) this.diG.dIE.dIL).hbL;
}
public final int a(com.tencent.mm.network.e eVar, e eVar2) {
this.diJ = eVar2;
return a(eVar, this.diG, this);
}
public final int cbz() {
return this.bOh;
}
public final int getType() {
return 30;
}
public final void a(int i, int i2, int i3, String str, q qVar, byte[] bArr) {
if (!(i2 == 0 && i3 == 0)) {
x.e("MicroMsg.NetSceneVerifyUser.dkverify", "errType:%d, errCode:%d", new Object[]{Integer.valueOf(i2), Integer.valueOf(i3)});
}
this.diJ.a(i2, i3, str, this);
}
}
|
import com.skyley.skstack_ip.api.SKDevice;
import com.skyley.skstack_ip.api.SKEventListener;
import com.skyley.skstack_ip.api.SKUtil;
import com.skyley.skstack_ip.api.skenums.SKEventNumber;
import com.skyley.skstack_ip.api.skenums.SKEventType;
import com.skyley.skstack_ip.api.skenums.SKSecOption;
import com.skyley.skstack_ip.api.skevents.SKERxUdp;
import com.skyley.skstack_ip.api.skevents.SKEvent;
import com.skyley.skstack_ip.api.skevents.SKGeneralEvent;
public class PanaTest implements SKEventListener {
private SKDevice device1; // PAA
private SKDevice device2; // PaC
private SKEventListener oldListener1 = null;
private SKEventListener oldListener2 = null;
private boolean isProcessing;
public PanaTest(SKDevice device1, SKDevice device2) {
this.device1 = device1;
this.device2 = device2;
oldListener1 = device1.getSKEventListener();
oldListener2 = device2.getSKEventListener();
device1.setSKEventListener(this);
device2.setSKEventListener(this);
isProcessing = false;
}
private void waitProcess() {
isProcessing = true;
while (isProcessing) {
SKUtil.pause(1000);
}
}
public void doTest() {
device1.resetStack();
device2.resetStack();
device1.setLongAddress("12345678ABCDEF01");
device1.setPanID(0x8888);
device1.setPSKFromPassword("0123456789AB");
device1.setRouteBID("00112233445566778899AABBCCDDEEFF");
device1.startPAA();
device2.setLongAddress("12345678ABCDEF02");
device2.setPanID(0x8888);
device2.setPSKFromPassword("0123456789AB");
device2.setRouteBID("00112233445566778899AABBCCDDEEFF");
device2.joinPAA("FE80:0000:0000:0000:1034:5678:ABCD:EF01");
waitProcess();
byte[] data1 = {0x12, 0x34, 0x56, 0x78};
byte[] data2 = {0x21, 0x43, 0x65, (byte) 0xFF};
device2.sendUDP((byte)1, "FE80:0000:0000:0000:1034:5678:ABCD:EF01", 0xE1A, SKSecOption.SEC_OR_NO_TX, data1);
device1.sendUDP((byte)1, "FE80:0000:0000:0000:1034:5678:ABCD:EF02", 0xE1A, SKSecOption.SEC_OR_NO_TX, data2);
device2.termPAA();
waitProcess();
device1.setSKEventListener(oldListener1);
device2.setSKEventListener(oldListener2);
}
@Override
public void eventNotified(String port, SKEventType type, SKEvent event) {
// TODO 自動生成されたメソッド・スタブ
switch (type) {
case ERXUDP:
System.out.println("ERXUDP");
System.out.println("Port: " + port);
SKERxUdp erxudp = (SKERxUdp)event;
System.out.println("senderIP=" + erxudp.getSenderIP6Address());
System.out.println("sec=" + erxudp.isSecured());
System.out.println("dataLength=" + erxudp.getDataLength());
System.out.println("data=" + erxudp.getData());
break;
case EVENT:
SKGeneralEvent gevent = (SKGeneralEvent)event;
short number = gevent.getEventNumber();
System.out.println("Event: " + SKEventNumber.getEventName(number));
System.out.println("Port: " + port);
System.out.println("number=" + number);
System.out.println("sender=" + gevent.getSenderAddress());
if (number == SKEventNumber.UDP_TX_DONE.getNumber()) {
System.out.println("Param=" + gevent.getParam());
}
else if (number == SKEventNumber.PANA_CONNECT_DONE.getNumber() ||
number == SKEventNumber.PANA_CONNECT_FAIL.getNumber() ||
number == SKEventNumber.PANA_SESSION_CLOSE_DONE.getNumber() ||
number == SKEventNumber.PANA_SESSION_CLOSE_TIMEOUT.getNumber()) {
isProcessing = false;
}
break;
default:
break;
}
}
}
|
/*
* Copyright (c) 2013 M-Way Solutions GmbH
*
* 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 org.jenkinsci.plugins.relution_publisher.configuration.jobs;
import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.relution_publisher.configuration.global.Store;
import org.jenkinsci.plugins.relution_publisher.configuration.global.StoreConfiguration;
import org.jenkinsci.plugins.relution_publisher.constants.ReleaseStatus;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import java.util.List;
import javax.inject.Inject;
/**
* Represents a publication configured in a Jenkins project. A publication determines which
* Relution Enterprise Appstore an artifact should be uploaded to.
*/
public class Publication extends AbstractDescribableImpl<Publication> {
private String artifactPath;
private String storeId;
private String releaseStatus;
private String name;
private String iconPath;
private String changeLogPath;
private String descriptionPath;
private String versionName;
@DataBoundConstructor
public Publication(
final String artifactPath,
final String storeId,
final String releaseStatus,
final String name,
final String iconPath,
final String changeLogPath,
final String descriptionPath,
final String versionName) {
this.setArtifactPath(artifactPath);
this.setStoreId(storeId);
this.setReleaseStatus(releaseStatus);
this.setName(name);
this.setIconPath(iconPath);
this.setChangeLogPath(changeLogPath);
this.setDescriptionPath(descriptionPath);
this.setVersionName(versionName);
}
/**
* Gets the path of the artifact to be published, relative to the workspace directory.
*/
public String getArtifactPath() {
return this.artifactPath;
}
/**
* Sets the path of the artifact to be published, relative to the workspace directory.
* @param filePath The path of the artifact to be published.
*/
public void setArtifactPath(final String filePath) {
this.artifactPath = filePath;
}
/**
* Gets the identifier of the {@link Store} to which the artifact should be published.
*/
public String getStoreId() {
return this.storeId;
}
/**
* Sets the identifier of the {@link Store} to which the artifact should be publishes.
* @param storeId The {@link Store#getIdentifier() identifier} of a store.
*/
public void setStoreId(final String storeId) {
this.storeId = storeId;
}
/**
* Gets the key of the {@link ReleaseStatus} to use when uploading an artifact to the store.
*/
public String getReleaseStatus() {
return this.releaseStatus;
}
/**
* Sets the key of the {@link ReleaseStatus} to use when uploading an artifact to the store.
* @param releaseStatus The release status to use.
*/
public void setReleaseStatus(final String releaseStatus) {
this.releaseStatus = releaseStatus;
}
/**
* Gets the name to show for the application version uploaded to the store.
*/
public String getName() {
return this.name;
}
/**
* Sets the name to show for the application version uploaded to the store.
* @param name The name to show.
*/
public void setName(final String name) {
this.name = name;
}
/**
* Gets the path of the icon to use for the version when uploading the artifact to the store.
*/
public String getIconPath() {
return this.iconPath;
}
/**
* Sets the path of the icon to use for the version when uploading the artifact to the store.
* @param iconPath The path of the icon to use, or <code>null</code> to use the icon specified
* by the artifact's meta-data.
*/
public void setIconPath(final String iconPath) {
this.iconPath = iconPath;
}
/**
* Gets the path of the file that contains the version's change log.
*/
public String getChangeLogPath() {
return this.changeLogPath;
}
/**
* Sets the path of the file that contains the version's change log.
* @param changeLogPath The path to use for the change log.
*/
public void setChangeLogPath(final String changeLogPath) {
this.changeLogPath = changeLogPath;
}
/**
* Gets the path of the file that contains the version's description.
*/
public String getDescriptionPath() {
return this.descriptionPath;
}
/**
* Sets the path of the file that contains the version's description.
* @param descriptionPath The path to use for the description.
*/
public void setDescriptionPath(final String descriptionPath) {
this.descriptionPath = descriptionPath;
}
/**
* Gets the name to use for the version when uploading the artifact to the store.
*/
public String getVersionName() {
return this.versionName;
}
/**
* Sets the name to use for the version when uploading the artifact to the store.
* <p/>
* This is not the application's name, but its version name, i.e. the human readable version.
* @param versionName The version name to use, or <code>null</code> to use the version name
* specified by the artifact's meta-data.
*/
public void setVersionName(final String versionName) {
this.versionName = versionName;
}
@Extension
public static class PublicationDescriptor extends Descriptor<Publication> {
@Inject
private StoreConfiguration globalConfiguration;
@Override
public String getDisplayName() {
return "Publication";
}
public FormValidation doCheckArtifactPath(@QueryParameter final String value) {
if (StringUtils.isEmpty(value)) {
return FormValidation.error("Path must not be empty");
}
return FormValidation.ok();
}
public FormValidation doCheckVersionName(@QueryParameter final String value) {
if (!StringUtils.isBlank(value)) {
return FormValidation.warning("You are overwriting the human readable version, are you sure this is what you want?");
}
return FormValidation.ok();
}
public ListBoxModel doFillStoreIdItems() {
final List<Store> stores = this.globalConfiguration.getStores();
final ListBoxModel items = new ListBoxModel();
for (final Store store : stores) {
items.add(store.toString(), store.getIdentifier());
}
return items;
}
public ListBoxModel doFillReleaseStatusItems() {
final ListBoxModel items = new ListBoxModel();
ReleaseStatus.fillListBox(items);
return items;
}
}
}
|
package com.tyss.cg.questions;
public interface Prac2Interface {
int A(int a, int b);
double B( double d, int b);
static void print() {
System.out.println("hello Print()");
}
default void show() {
System.out.println("hello Show()");
}
}
|
package com.mcf.base.model;
import java.util.List;
/**
* Title. <br>
* Description.
* <p>
* Copyright: Copyright (c) 2016年12月17日 下午2:37:57
* <p>
* Author: 10003/sunaiqiang saq691@126.com
* <p>
* Version: 1.0
* <p>
*/
public class ResponseData extends BaseModel {
/**
*
*/
private static final long serialVersionUID = 7722020337673847048L;
/**
* 状态
*/
private Boolean status;
/**
* 成功或是失败消息
*/
private String msg;
/**
* 消息集合
*/
private List<Msg> msgs;
public ResponseData() {
super();
}
public ResponseData(Boolean status, String msg) {
super();
this.status = status;
this.msg = msg;
}
public ResponseData(Boolean status, String msg, List<Msg> msgs) {
super();
this.status = status;
this.msg = msg;
this.msgs = msgs;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List<Msg> getMsgs() {
return msgs;
}
public void setMsgs(List<Msg> msgs) {
this.msgs = msgs;
}
}
|
/**
* @Title: MispComDataAccessReqJson.java
* @Package cn.fuego.misp.webservice.json
* @Description: TODO
* @author Tang Jun
* @date 2015-5-22 上午9:16:49
* @version V1.0
*/
package cn.fuego.misp.webservice.json;
/**
* @ClassName: MispComDataAccessReqJson
* @Description: TODO
* @author Tang Jun
* @date 2015-5-22 上午9:16:49
*
*/
public class MispComDataAccessReqJson extends MispBaseReqJson
{
private String table_name;
public String getTable_name()
{
return table_name;
}
public void setTable_name(String table_name)
{
this.table_name = table_name;
}
}
|
package com.tencent.mm.plugin.topstory.ui.home;
class b$3 implements Runnable {
final /* synthetic */ b ozD;
b$3(b bVar) {
this.ozD = bVar;
}
public final void run() {
try {
if (this.ozD.ozz != null && this.ozD.ozz.getView() != null) {
this.ozD.ozz.getView().scrollTo(this.ozD.ozz.getView().getScrollX(), 0);
}
} catch (Throwable th) {
}
}
}
|
package org.opentosca.containerapi.resources.csar;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.List;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import org.opentosca.containerapi.osgi.servicegetter.FileRepositoryServiceHandler;
import org.opentosca.containerapi.osgi.servicegetter.IOpenToscaControlServiceHandler;
import org.opentosca.containerapi.resources.utilities.ResourceConstants;
import org.opentosca.containerapi.resources.utilities.Utilities;
import org.opentosca.containerapi.resources.xlink.Reference;
import org.opentosca.containerapi.resources.xlink.References;
import org.opentosca.containerapi.resources.xlink.XLinkConstants;
import org.opentosca.core.file.service.ICoreFileService;
import org.opentosca.core.model.artifact.file.AbstractFile;
import org.opentosca.core.model.csar.CSARContent;
import org.opentosca.core.model.csar.id.CSARID;
import org.opentosca.exceptions.SystemException;
import org.opentosca.exceptions.UserException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Resource represents a CSAR.<br />
* <br />
*
*
* Copyright 2013 IAAS University of Stuttgart<br />
* <br />
*
* @author Rene Trefft - trefftre@studi.informatik.uni-stuttgart.de
* @author endrescn@fachschaft.informatik.uni-stuttgart.de
*
*
*/
public class CSARResource {
private static final Logger LOG = LoggerFactory.getLogger(CSARContentResource.class);
// If csar is null, CSAR is not stored
private final CSARContent CSAR;
public CSARResource(CSARContent csar) {
this.CSAR = csar;
CSARResource.LOG.info("{} created: {}", this.getClass(), this);
}
@GET
@Produces(ResourceConstants.LINKED_XML)
public Response getReferences(@Context UriInfo uriInfo) {
if (this.CSAR == null) {
return Response.status(404).build();
}
References refs = new References();
refs.getReference().add(new Reference(Utilities.buildURI(uriInfo.getAbsolutePath().toString(), "Content"), XLinkConstants.SIMPLE, "Content"));
refs.getReference().add(new Reference(Utilities.buildURI(uriInfo.getAbsolutePath().toString(), "TopologyPicture"), XLinkConstants.SIMPLE, "TopologyPicture"));
refs.getReference().add(new Reference(Utilities.buildURI(uriInfo.getAbsolutePath().toString(), "Instances"), XLinkConstants.SIMPLE, "Instances"));
refs.getReference().add(new Reference(Utilities.buildURI(uriInfo.getAbsolutePath().toString(), "PublicPlans"), XLinkConstants.SIMPLE, "PublicPlans"));
CSARResource.LOG.info("Number of References in Root: {}", refs.getReference().size());
// selflink
refs.getReference().add(new Reference(uriInfo.getAbsolutePath().toString(), XLinkConstants.SIMPLE, XLinkConstants.SELF));
return Response.ok(refs.getXMLString()).build();
}
@Path("Content")
public CSARContentResource getContent() {
return new CSARContentResource(this.CSAR);
}
@Path("PublicPlans")
public CSARPublicPlanTypesResource getPuplicPlans() {
return new CSARPublicPlanTypesResource(this.CSAR.getCSARID());
}
@Path("Instances")
public CSARInstancesResource getInstances() {
return new CSARInstancesResource(this.CSAR.getCSARID());
}
// "image/*" will be preferred over "text/xml" when requesting an image.
// This is a fix for Webkit Browsers who are too dumb for content
// negotiation.
@Produces("image/*; qs=2.0")
@GET
@Path("TopologyPicture")
public Response getTopologyPicture() throws SystemException {
AbstractFile topologyPicture = this.CSAR.getTopologyPicture();
if (topologyPicture != null) {
MediaType mt = new MediaType("image", "*");
// try {
InputStream is = topologyPicture.getFileAsInputStream();
return Response.ok(is, mt).header("Content-Disposition", "attachment; filename=\"" + topologyPicture.getName() + "\"").build();
// } catch (SystemException exc) {
// CSARResource.LOG.error("An System Exception occured.", exc);
// }
}
return Response.status(Status.NOT_FOUND).type(MediaType.TEXT_PLAIN).entity("No Topology Picture exists in CSAR \"" + this.CSAR.getCSARID() + "\".").build();
}
/**
* Exports this CSAR.
*
* @return CSAR as {@code application/octet-stream}. If an error occurred
* during exporting (e.g. during retrieving files from storage
* provider(s)) 500 (internal server error).
* @throws SystemException
* @throws UserException
*
* @see ICoreFileService#exportCSAR(CSARID)
*
*/
@GET
@Produces(ResourceConstants.OCTET_STREAM)
public Response downloadCSAR() throws SystemException, UserException {
CSARID csarID = this.CSAR.getCSARID();
// try {
java.nio.file.Path csarFile = FileRepositoryServiceHandler.getFileHandler().exportCSAR(csarID);
InputStream csarFileInputStream;
try {
csarFileInputStream = Files.newInputStream(csarFile);
} catch (IOException e) {
throw new SystemException("Retrieving input stream of file \"" + csarFile.toString() + "\" failed.", e);
}
// We add Content Disposition header, because exported CSAR file to
// download should have the correct file name.
return Response.ok("CSAR \"" + csarID + "\" was successfully exported to \"" + csarFile + "\".").entity(csarFileInputStream).header("Content-Disposition", "attachment; filename=\"" + csarID.getFileName() + "\"").build();
// } catch (SystemException exc) {
// CSARResource.LOG.warn("A System Exception occured.", exc);
// } catch (UserException exc) {
// CSARResource.LOG.warn("An User Exception occured.", exc);
// } catch (IOException exc) {
// CSARResource.LOG.warn("An IO Exception occured.", exc);
// }
// return Response.status(Status.INTERNAL_SERVER_ERROR).build();
}
@DELETE
@Produces("text/plain")
public Response delete() {
CSARID csarID = this.CSAR.getCSARID();
CSARResource.LOG.info("Deleting CSAR \"{}\".", csarID);
List<String> errors = IOpenToscaControlServiceHandler.getOpenToscaControlService().deleteCSAR(csarID);
// if (errors.contains("CSAR has instances.")) {
// return Response.notModified("CSAR has instances.").build();
// }
if (errors.isEmpty()) {
return Response.ok("Deletion of CSAR " + "\"" + csarID + "\" was sucessful.").build();
} else {
return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Deletion of CSAR \"" + csarID + "\" failed.").build();
}
}
}
|
package com.aummn.suburb.resource.dto.response;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@ApiModel(description="Output Suburb info ")
public class SuburbWebResponse {
private Long id;
private String name;
private String postcode;
}
|
/*
* 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 control;
import dominio.Cliente;
import dominio.DetalleVenta;
import dominio.Empleado;
import dominio.Producto;
import dominio.Venta;
import fdatos.IDatos;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
*
* @author laura
*/
class ControlVentas {
private ArrayList<DetalleVenta> productos;
private ControlProducto ctrlProductos;
private Venta venta;
private IDatos datos;
/**
* Método constructor que se encarga de inicializar los productos que
* ingresaran a la venta.
*/
public ControlVentas(IDatos datos, ControlProducto ctrlProductos) {
this.datos = datos;
productos = new ArrayList<>();
this.ctrlProductos = ctrlProductos;
}
/**
* Método que se encarga de ingresar los productos a la venta
*
* @param producto Producto que se va a ingresar a la venta
* @param cantidad Cantidad del producto
*/
public boolean ingresarProducto(Producto producto, double cantidad) {
boolean yaExiste = false;
DetalleVenta ventaUnitaria = null;
for (DetalleVenta detalle : productos) {
if (detalle.getProducto().equals(producto)) {
yaExiste = true;
ventaUnitaria = detalle;
break;
}
}
if (yaExiste && ventaUnitaria != null) {
cantidad = ventaUnitaria.getCantidad() + cantidad;
}
if (ctrlProductos.validarDisponibilidad(producto, cantidad)) {
double precioUnitario = producto.getPrecio();
double importe = cantidad * precioUnitario;
ventaUnitaria = new DetalleVenta(cantidad, precioUnitario, importe, producto);
ventaUnitaria.setVenta(venta);
if (yaExiste) {
productos.set(productos.indexOf(ventaUnitaria), ventaUnitaria);
} else {
productos.add(ventaUnitaria);
}
calcularTotal();
return true;
}
return false;
}
public boolean editarDetalleVenta(Producto producto, double cantidad) {
producto = ctrlProductos.buscarProducto(producto.getId());
boolean yaExiste = false;
DetalleVenta ventaUnitaria = null;
for (DetalleVenta detalle : productos) {
if (detalle.getProducto().equals(producto)) {
yaExiste = true;
ventaUnitaria = detalle;
break;
}
}
if (yaExiste && ctrlProductos.validarDisponibilidad(producto, cantidad)) {
double precioUnitario = producto.getPrecio();
double importe = cantidad * precioUnitario;
ventaUnitaria.setImporte(importe);
ventaUnitaria.setCantidad(cantidad);
productos.set(productos.indexOf(ventaUnitaria), ventaUnitaria);
for (DetalleVenta producto1 : productos) {
System.out.println(producto1);
}
calcularTotal();
return true;
}
return false;
}
/**
* Método que calcula el total de la venta con base en cada producto y su
* importe dentro de la venta
*
* @return total de la venta
*/
public double calcularTotal() {
double total = 0;
for (DetalleVenta producto : productos) {
total = total + producto.getImporte();
}
venta.setTotal(total);
return total;
}
public double obtenerTotal() {
return venta.getTotal();
}
/**
* Método que se encarga de mostrar las ventas realizas con base en las
* fechas determinadas.
*
* @param fechaInicio Fecha de inicio
* @param fechaFin Fecha fin
* @return Ventas realizadas
*/
public ArrayList<Venta> consultarVentas(Date fechaInicio, Date fechaFin) {
ArrayList<Venta> ventas = null;
//Conexion bd
return ventas;
}
public Venta crearNuevaVenta() {
productos = new ArrayList<>();
venta = new Venta();
venta.setFecha(new Date());
return venta;
}
public boolean completarVenta(double recibido, Cliente cliente, Empleado empleado) {
venta.setTotal(calcularTotal());
venta.setCliente(cliente);
venta.setEmpleado(empleado);
if (recibido < venta.getTotal()) {
return false;
}
venta.setDetallesVentas(productos);
datos.guardarVenta(venta);
for (DetalleVenta producto : venta.getDetallesVentas()) {
Producto p = producto.getProducto();
p.setStock(p.getStock() - producto.getCantidad());
ctrlProductos.modificar(p);
//ctrlProductos.eliminar(p);
}
crearNuevaVenta();
return true;
}
public List<DetalleVenta> obtenerDetallesVenta() {
return productos;
}
public double obtenerCambio(double recibido) {
return recibido - this.venta.getTotal();
}
public List<DetalleVenta> eliminarProductoCarrito(Producto producto, double cantidad) {
DetalleVenta detalle = obtenerProductoCarrito(producto);
if (detalle != null) {
double diferencia = detalle.getCantidad() - cantidad;
if (diferencia <= 0) {
productos.remove(detalle);
} else {
detalle.setCantidad(diferencia);
productos.set(productos.indexOf(detalle), detalle);
}
}
calcularTotal();
return productos;
}
public List<DetalleVenta> eliminarProductoCarrito(Producto producto) {
DetalleVenta detalle = obtenerProductoCarrito(producto);
if (detalle != null) {
productos.remove(detalle);
}
calcularTotal();
return productos;
}
private DetalleVenta obtenerProductoCarrito(Producto producto) {
for (DetalleVenta prod : productos) {
if (prod.getProducto().equals(producto)) {
return prod;
}
}
return null;
}
}
|
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2015 Paco Avila & Josep Llort
*
* No bytes were intentionally harmed during the development of this application.
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.servlet.frontend;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.google.gwt.user.server.rpc.SerializationPolicy;
import com.openkm.core.Config;
import com.openkm.core.HttpSessionManager;
import com.openkm.frontend.client.bean.GWTWorkspace;
/**
* Extends the RemoteServiceServlet to obtain token auth on development and production
* environments. Config.GWTDS determines the environment development and production values.
*
* @author jllort
*
*/
public class OKMRemoteServiceServlet extends RemoteServiceServlet {
private static Logger log = LoggerFactory.getLogger(OKMRemoteServiceServlet.class);
private static final long serialVersionUID = 1L;
public static final String WORKSPACE = "workspace";
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
@Override
protected SerializationPolicy doGetSerializationPolicy(HttpServletRequest request, String moduleBaseURL, String strongName) {
if (Config.SYSTEM_APACHE_REQUEST_HEADER_FIX) {
// Get base url from the header instead of the body. This way
// Apache reverse proxy with rewrite on header can work.
// Suggested at http://stackoverflow.com/questions/1517290/problem-with-gwt-behind-a-reverse-proxy-either-nginx-or-apache
// ProxyPass /app/ ajp://localhost:8009/OpenKM/
// RequestHeader edit X-GWT-Module-Base ^(.*)/app/(.*)$ $1/OpenKM/$2
String moduleBaseURLHdr = request.getHeader("X-GWT-Module-Base");
log.debug("X-GWT-Module-Base: {}", moduleBaseURLHdr);
if (moduleBaseURLHdr != null) {
moduleBaseURL = moduleBaseURLHdr;
}
}
return super.doGetSerializationPolicy(request, moduleBaseURL, strongName);
}
public void updateSessionManager() {
// Case when servlet is not called from GWT ( mobile access )
if (getThreadLocalRequest() != null) {
HttpSessionManager.getInstance().update(getThreadLocalRequest().getSession().getId());
}
}
/**
* getUserWorkspaceSession
*/
public void saveUserWorkspaceSession(GWTWorkspace workspace) {
// Case when servlet is not called from GWT ( mobile access )
if (getThreadLocalRequest() != null) {
getThreadLocalRequest().getSession().setAttribute(WORKSPACE, workspace);
}
}
/**
* getUserWorkspaceSession
*/
public GWTWorkspace getUserWorkspaceSession() {
// Case when servlet is not called from GWT ( mobile access )
if (getThreadLocalRequest() != null) {
if (getThreadLocalRequest().getSession().getAttribute(WorkspaceServlet.WORKSPACE) != null) {
return (GWTWorkspace) getThreadLocalRequest().getSession().getAttribute(WorkspaceServlet.WORKSPACE);
} else {
return null;
}
} else {
return null;
}
}
/**
* Gets language from HTTP session.
*/
protected String getLanguage() {
HttpServletRequest request = this.getThreadLocalRequest();
if (request != null) {
Object obj = request.getSession().getAttribute("lang");
if (obj instanceof String) {
return (String) obj;
}
}
return null;
}
/**
* Stores language into HTTP session.
*/
protected void setLanguage(String language) {
// Store current language into session
HttpServletRequest request = this.getThreadLocalRequest();
request.getSession().setAttribute("lang", language);
}
}
|
package com.eagle.order.util;
import java.io.*;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
public class ParseIni {
protected Map<String, Properties> sections = new ConcurrentHashMap<>();
private transient String defaultName = "default";
private transient String sectionName;
private transient Properties property;
private Properties parentObj;
/**
* 构造函数
*
* @param filename
* 文件路径
* @throws IOException
*/
public ParseIni(String filename) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF-8"));
read(reader);
reader.close();
}
/**
* 文件读取
*
* @param reader
* @throws IOException
*/
protected void read(BufferedReader reader) throws IOException {
String line;
sectionName = this.defaultName;
property = new Properties();
sections.put(sectionName, property);
while ((line = reader.readLine()) != null) {
parseLine(line);
}
}
/**
* 解析每行数据
*
* @param line
*/
protected void parseLine(String line) {
line = line.trim();
if (line.indexOf('#') == 0 || line.indexOf(';') == 0) {
return;
}
if (line.matches("\\[.*\\]")) {
sectionName = line.replaceFirst("\\[(.*)\\]", "$1").trim();
property = new Properties();
if (sectionName.matches(".*:.*")) {
int pos = sectionName.indexOf(':');
String child = sectionName.substring(0, pos);
String parent = sectionName.substring(pos + 1);
parentObj = this.getSection(parent);
if (parentObj != null) {
property = (Properties) parentObj.clone();
sections.put(child, property);
}
} else {
sections.put(sectionName, property);
}
} else if (line.matches(".*=.*")) {
int i = line.indexOf('=');
String name = line.substring(0, i).trim();
String value = line.substring(i + 1).trim();
if (value.indexOf('"') == 0 || value.indexOf('\'') == 0) {
// 去掉前面符号 " 或 '
value = value.substring(1, value.length());
// 去掉后面 " 或 '
int len = value.length();
if (value.indexOf('"') == len - 1 || value.indexOf('\'') == len - 1) {
value = value.substring(0, len - 1);
}
}
property.setProperty(name, value);
}
}
/**
* 根据节 和 key 获取值
*
* @param section
* @param key
* @return String
*/
public String get(String section, String key) {
if (section == null || "".equals(section))
section = this.defaultName;
Properties property = (Properties) sections.get(section);
if (property == null) {
return null;
}
String value = property.getProperty(key);
if (value == null)
return null;
return value;
}
/**
* 获取节下所有key
*
* @param section
* @return Properties
*/
public Properties getSection(String section) {
if (section.equals(null) || section == "")
section = this.defaultName;
Properties property = (Properties) sections.get(section);
if (property == null) {
sections.put(section, property);
}
return property;
}
/**
* 增加节点 及 值
*
* @param section
* @param key
* @param value
*/
public void set(String section, String key, String value) {
if (property == null)
property = new Properties();
if (section.equals(null) || section == "")
section = this.defaultName;
if (key.equals(null) || key == "") {
System.out.println("key is null");
return;
}
sections.put(section, property);
property.setProperty(key, value);
}
/**
* 增加节点
*
* @param section
*/
public void setSection(String section) {
sections.put(section, property);
}
}
|
package ls.example.t.zero2line.hen_coder_view;
import android.graphics.Paint;
import android.view.View;
import android.content.Context;
import android.util.*;
import android.graphics.Color;
public class HenCoderXfermodeView extends View {
private Paint mPaint;
private static final int langth=100;
private static final int langth_small=80;
private float currentLength;
private static final float xf=2.7f;//圆角的半径
public HenCoderXfermodeView(Context context, AttributeSet attrs) {
super(context, attrs);
}
{
mPaint=new Paint();
//Paint.Style.FILL:仅填充内部
//Paint.Style.STROKE:仅描边
//Paint.Style.FILL_AND_STROKE:描边且填充内部
mPaint.setStyle(Paint.Style.FILL);
mPaint.setAntiAlias(true);
currentLength = dp2px(langth);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onDraw(android.graphics.Canvas canvas) {
super.onDraw(canvas);
//设置背景色
canvas.drawARGB(255, 139, 197, 186);
mPaint.setColor(0xFFFFCC44);
canvas.drawCircle(currentLength/2,currentLength/2,currentLength/2,mPaint);
mPaint.setColor(0xFF66AAFF);
float bottom = currentLength * 1.5f;
canvas.drawRoundRect(currentLength/2,currentLength/2,bottom,bottom,xf,xf,mPaint);
}
public static float dp2px(float dp) {
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
android.content.res.Resources.getSystem().getDisplayMetrics());
}
}
|
package com.sergiienko.xrserver;
import java.util.HashMap;
import java.util.Map;
/**
* State of parsers/sources
* Mostly implemented for integrating with Zabbix
*/
public final class AppState {
/**
* State object, used for collecting last sources' states
*/
private static Map<Integer, Boolean> state = new HashMap<>();
/**
* Dumb constructor
*/
private AppState() {
}
/**
*
* @param parserID ID of the parser (actually, a source's ID)
* @param parserState last state of the parser (related to the certain source, not to parser itself)
*/
public static synchronized void updateState(final Integer parserID, final Boolean parserState) {
state.put(parserID, parserState);
}
/**
* Clear the state
*/
public static void clearState() {
synchronized (AppState.class) {
state = new HashMap<>();
}
}
/**
* Get all sources' last state
* @return sources' state
*/
public static Map<Integer, Boolean> getState() {
return state;
}
}
|
package com.tt.miniapp.launchcache.pkg;
import android.content.Context;
import android.util.Log;
import com.storage.async.Action;
import com.storage.async.Scheduler;
import com.tt.miniapp.errorcode.ErrorCode;
import com.tt.miniapp.launchcache.LaunchCacheDAO;
import com.tt.miniapp.launchcache.RequestType;
import com.tt.miniapp.launchcache.StatusFlagType;
import com.tt.miniapp.thread.ThreadUtil;
import com.tt.miniapphost.AppBrandLogger;
import com.tt.miniapphost.entity.AppInfoEntity;
import com.tt.miniapphost.util.TimeMeter;
import d.f.b.g;
import d.f.b.l;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
public abstract class BasePkgRequester {
public static final Companion Companion = new Companion(null);
private TimeMeter mBeginRequestPkgTime;
private final Context mContext;
private final RequestType mRequestType;
public BasePkgRequester(Context paramContext, RequestType paramRequestType) {
this.mContext = paramContext;
this.mRequestType = paramRequestType;
}
protected final TimeMeter getMBeginRequestPkgTime() {
return this.mBeginRequestPkgTime;
}
protected final Context getMContext() {
return this.mContext;
}
protected final RequestType getMRequestType() {
return this.mRequestType;
}
protected final void onFileReady(PkgRequestContext paramPkgRequestContext) {
String str1;
l.b(paramPkgRequestContext, "requestContext");
AppInfoEntity appInfoEntity = paramPkgRequestContext.getAppInfo();
LaunchCacheDAO launchCacheDAO = LaunchCacheDAO.INSTANCE;
Context context = this.mContext;
String str2 = appInfoEntity.appId;
l.a(str2, "appInfo.appId");
LaunchCacheDAO.CacheAppIdDir cacheAppIdDir = launchCacheDAO.getCacheAppIdDir(context, str2);
LaunchCacheDAO.LockObject lockObject = cacheAppIdDir.lock();
if (lockObject == null) {
str1 = ErrorCode.MAIN.GET_LAUNCHCACHE_FILE_LOCK_FAIL.getCode();
l.a(str1, "ErrorCode.MAIN.GET_LAUNCHCACHE_FILE_LOCK_FAIL.code");
paramPkgRequestContext.setErrCode(str1);
paramPkgRequestContext.setErrMsg("requestPkgSuccess, get lock fail");
paramPkgRequestContext.setMonitorStatus(6012);
onRequestPkgFail(paramPkgRequestContext);
return;
}
try {
HashMap<Object, Object> hashMap = new HashMap<Object, Object>();
LaunchCacheDAO.CacheVersionDir cacheVersionDir = cacheAppIdDir.getCacheVersionDir(((AppInfoEntity)str1).versionCode, this.mRequestType);
PkgDownloadHelper pkgDownloadHelper = PkgDownloadHelper.INSTANCE;
File file = paramPkgRequestContext.getPkgFile();
if (file == null)
l.a();
if (pkgDownloadHelper.isPkgFileValid((AppInfoEntity)str1, file, (Map)hashMap)) {
cacheVersionDir.setStatusFlagLocked(StatusFlagType.Verified);
onRequestPkgSuccess(paramPkgRequestContext);
} else {
str1 = ErrorCode.DOWNLOAD.PKG_MD5_ERROR.getCode();
l.a(str1, "ErrorCode.DOWNLOAD.PKG_MD5_ERROR.code");
paramPkgRequestContext.setErrCode(str1);
paramPkgRequestContext.setErrMsg("md5 verify failed");
paramPkgRequestContext.setExtraInfo((Map)hashMap);
paramPkgRequestContext.setMonitorStatus(1000);
cacheVersionDir.clearLocked();
onRequestPkgFail(paramPkgRequestContext);
}
return;
} finally {
lockObject.unlock();
}
}
protected abstract boolean onLoadLocalPkg(PkgRequestContext paramPkgRequestContext);
protected void onRequestPkgFail(PkgRequestContext paramPkgRequestContext) {
l.b(paramPkgRequestContext, "requestContext");
AppBrandLogger.e("BasePkgRequester", new Object[] { this.mRequestType, paramPkgRequestContext.getErrMsg() });
if (paramPkgRequestContext.getExtraInfo() != null)
AppBrandLogger.e("BasePkgRequester", new Object[] { this.mRequestType, paramPkgRequestContext.getExtraInfo() });
if (paramPkgRequestContext.isNetDownload())
PkgDownloadHelper.INSTANCE.uploadDownloadFailStat(paramPkgRequestContext.getAppInfo(), this.mRequestType, paramPkgRequestContext.getDownloadUrl(), paramPkgRequestContext.getUseTime(), paramPkgRequestContext.getErrMsg(), paramPkgRequestContext.getHttpStatusCode(), paramPkgRequestContext.getHttpContentLength());
PkgDownloadHelper.INSTANCE.uploadDownloadInstallFailMpMonitor(paramPkgRequestContext.getAppInfo(), this.mRequestType, paramPkgRequestContext.getErrMsg(), paramPkgRequestContext.getExtraInfo(), paramPkgRequestContext.getMonitorStatus());
paramPkgRequestContext.getListener().onFail(paramPkgRequestContext.getErrCode(), paramPkgRequestContext.getErrMsg());
}
protected void onRequestPkgSuccess(PkgRequestContext paramPkgRequestContext) {
l.b(paramPkgRequestContext, "requestContext");
if (paramPkgRequestContext.isNetDownload())
PkgDownloadHelper.INSTANCE.uploadDownloadSuccessStat(paramPkgRequestContext.getAppInfo(), this.mRequestType, paramPkgRequestContext.getDownloadUrl(), paramPkgRequestContext.getUseTime(), paramPkgRequestContext.getHttpStatusCode(), paramPkgRequestContext.getHttpContentLength());
PkgDownloadHelper.INSTANCE.uploadDownloadSuccessMpMonitor(paramPkgRequestContext.getAppInfo(), this.mRequestType, paramPkgRequestContext.getErrMsg());
paramPkgRequestContext.getListener().onDownloadingProgress(100, -1L);
StreamDownloadInstallListener streamDownloadInstallListener = paramPkgRequestContext.getListener();
File file = paramPkgRequestContext.getPkgFile();
if (file == null)
l.a();
streamDownloadInstallListener.onDownloadSuccess(file, paramPkgRequestContext.isNetDownload() ^ true);
}
protected abstract void onRequestSync(PkgRequestContext paramPkgRequestContext);
public final void request(AppInfoEntity paramAppInfoEntity, Scheduler paramScheduler, StreamDownloadInstallListener paramStreamDownloadInstallListener) {
l.b(paramAppInfoEntity, "appInfo");
l.b(paramScheduler, "scheduler");
l.b(paramStreamDownloadInstallListener, "streamDownloadInstallListener");
this.mBeginRequestPkgTime = TimeMeter.newAndStart();
ThreadUtil.runOnWorkThread(new BasePkgRequester$request$1(new PkgRequestContext(paramAppInfoEntity, paramStreamDownloadInstallListener)), paramScheduler);
}
protected final void setMBeginRequestPkgTime(TimeMeter paramTimeMeter) {
this.mBeginRequestPkgTime = paramTimeMeter;
}
public static final class Companion {
private Companion() {}
}
static final class BasePkgRequester$request$1 implements Action {
BasePkgRequester$request$1(PkgRequestContext param1PkgRequestContext) {}
public final void act() {
try {
if (!BasePkgRequester.this.onLoadLocalPkg(this.$requestContext)) {
this.$requestContext.setNetDownload(true);
BasePkgRequester.this.onRequestSync(this.$requestContext);
return;
}
} catch (Exception exception) {
AppBrandLogger.e("BasePkgRequester", new Object[] { this.this$0.getMRequestType(), exception });
this.$requestContext.setUseTime(TimeMeter.stop(BasePkgRequester.this.getMBeginRequestPkgTime()));
PkgRequestContext pkgRequestContext = this.$requestContext;
String str2 = ErrorCode.DOWNLOAD.UNKNOWN.getCode();
l.a(str2, "ErrorCode.DOWNLOAD.UNKNOWN.code");
pkgRequestContext.setErrCode(str2);
pkgRequestContext = this.$requestContext;
String str1 = Log.getStackTraceString(exception);
l.a(str1, "Log.getStackTraceString(e)");
pkgRequestContext.setErrMsg(str1);
this.$requestContext.setMonitorStatus(1002);
BasePkgRequester.this.onRequestPkgFail(this.$requestContext);
}
}
}
}
/* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\launchcache\pkg\BasePkgRequester.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/
|
package realizandoejercicios;
import java.util.Scanner;
public class eje3guia {
public static void main(String[] args) {
Double sueldobase, dias, gratificacion, horasextras, comision, bono, colacion, movilizacion, haberes, deberes;
Double afp, isapre, segurocesantia, valorhora=3.500, haberHoras, sueldoliquido;
int opc;
Scanner Teclado = new Scanner(System.in);
System.out.println("ingrese sueldo base: ");
sueldobase = Teclado.nextDouble();
System.out.println("ingrese dias trabajados:");
dias = Teclado.nextDouble();
System.out.println("ingrese % Gratificacion del mes ( 0 a 100 ):");
gratificacion = Teclado.nextDouble();
System.out.println("Ingrese horas extras: ");
horasextras = Teclado.nextDouble();
haberHoras = valorhora*horasextras;
System.out.println("Ingrese dinero comisión del mes: ");
comision = Teclado.nextDouble();
bono = 25.000;
colacion = 8.000;
movilizacion = 15.000;
haberes = bono + colacion + movilizacion + ((sueldobase*gratificacion)/100) + haberHoras +comision;
afp = 0.115;
segurocesantia = 0.0411;
deberes = sueldobase*afp + sueldobase*segurocesantia;
do {
System.out.println("1.-ISAPRE o 2.-FONASAS: ");
opc = Teclado.nextInt();
}while(opc <1 || opc >2 );
switch (opc) {
case 1:
System.out.println("Ingrese & de Plan de isapre: ");
isapre = Teclado.nextDouble();
break;
case 2:
System.out.println("Fonasa 7%: ");
isapre = 0.07;
break;
default:
break;
}
sueldoliquido= sueldobase+haberes+deberes;
System.out.printf("\n Sueldo base: %s ",sueldobase);
System.out.printf("\n Sueldo liquido: &s",sueldoliquido);
}
}
|
package com.klocek.lowrez;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
/**
* Created by Konrad on 2016-04-17.
*/
public class About extends GameScreen {
private Texture aboutTexture;
public About(LowRez game) {
super(game);
aboutTexture = new Texture(Gdx.files.internal("about.png"));
}
@Override
public void render(float delta) {
getBatch().setProjectionMatrix(getCamera().projection);
getBatch().setTransformMatrix(getCamera().view);
Gdx.gl.glClearColor(255, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
getCamera().update();
getViewport().apply();
getBatch().begin();
getBatch().draw(aboutTexture, 0, 128);
getControls().update(delta);
getBatch().end();
if (Gdx.input.justTouched()) {
getGame().backToMenu();
}
}
@Override
public void dispose() {
aboutTexture.dispose();
}
}
|
package com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.AdLandingPageComponent.component;
import com.tencent.mm.modelsfs.FileOp;
import com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.d;
import com.tencent.mm.plugin.sns.ui.OfflineVideoView.a;
import com.tencent.mm.pointers.PString;
import com.tencent.mm.sdk.platformtools.ah;
class x$10 implements a {
final /* synthetic */ x nFL;
x$10(x xVar) {
this.nFL = xVar;
}
public final boolean a(PString pString) {
String str = "adId";
String str2 = x.l(this.nFL).nAN;
String eI = d.eI(str, str2);
if (FileOp.cn(eI)) {
pString.value = eI;
x.m(this.nFL);
return true;
}
d.c(str, str2, false, 62, new 1(this));
return false;
}
public final void wd() {
x.n(this.nFL);
x.o(this.nFL);
}
public final void onStart(int i) {
boolean z = false;
x.p(this.nFL);
x.b(this.nFL, i);
if (this.nFL.nEG.getVideoTotalTime() != i) {
this.nFL.nEG.setVideoTotalTime(x.q(this.nFL));
}
this.nFL.nEG.setVisibility(4);
this.nFL.nEH.setVisibility(0);
if (this.nFL.nFc != null) {
ac acVar = this.nFL.nFc;
if (this.nFL.nEG.getVisibility() == 0) {
z = true;
}
acVar.il(z);
}
this.nFL.bAk();
}
public final void wQ(int i) {
ah.A(new 2(this, i));
}
}
|
package com.paleimitations.schoolsofmagic.common.data.capabilities.magic_data;
import com.paleimitations.schoolsofmagic.common.MagicElement;
import com.paleimitations.schoolsofmagic.common.MagicSchool;
import com.paleimitations.schoolsofmagic.common.spells.Spell;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Tuple;
import javax.annotation.Nullable;
import java.util.List;
public interface IMagicData {
void markDirty();
int getCurrentSpellSlot();
void setCurrentSpellSlot(int spellSlot);
Spell getCurrentSpell();
void setCurrentSpell(Spell spell);
Spell getSpell(int index);
void setSpell(int index, Spell spell);
List<Spell> getSpells();
int getSpellSlots(ItemStack wand);
float getMagicianXP();
void setMagicianXP(float manaXP);
void addMagicianXP(float manaXP);
void removeMagicianXP(float manaXP);
Tuple<Float, Float> getMagicianXPToNextLevel();
int getLevel();
void update(PlayerEntity player);
boolean hasChargeLevel(int chargeLevel);
int getLargestChargeLevel();
boolean canAddCharge(int chargeLevel);
int[] getCharges();
int getMaxCharges(int chargeLevel, int level);
int[] getCountdowns();
float[] getElementXPs();
void setElementXPs(float[] xps);
float getElementXP(MagicElement element);
void setElementXP(MagicElement element, float elementXP);
void addElementXP(MagicElement element, float elementXP);
void removeElementXP(MagicElement element, float elementXP);
int getElementLevel(MagicElement element);
Tuple<Float, Float> getElementXPToNextLevel(MagicElement element);
float[] getSchoolXPs();
void setSchoolXPs(float[] xps);
float getSchoolXP(MagicSchool school);
void setSchoolXP(MagicSchool school, float schoolXP);
void addSchoolXP(MagicSchool school, float schoolXP);
void removeSchoolXP(MagicSchool school, float schoolXP);
int getSchoolLevel(MagicSchool school);
Tuple<Float, Float> getSchoolXPToNextLevel(MagicSchool school);
float getPotionXP();
void setPotionXP(float potionXP);
void addPotionXP(float potionXP);
void removePotionXP(float potionXP);
int getPotionLevel();
Tuple<Float, Float> getPotionXPToNextLevel();
float getSpellXP();
void setSpellXP(float spellXP);
void addSpellXP(float spellXP);
void removeSpellXP(float spellXP);
int getSpellLevel();
Tuple<Float, Float> getSpellXPToNextLevel();
float getRitualXP();
void setRitualXP(float ritualXP);
void addRitualXP(float ritualXP);
void removeRitualXP(float ritualXP);
int getRitualLevel();
Tuple<Float, Float> getRitualXPToNextLevel();
CompoundNBT serializeNBT();
void deserializeNBT(CompoundNBT nbt);
void useCharge(int chargeLevel, List<MagicElement> elements, List<MagicSchool> schools, @Nullable EnumMagicTool tool);
enum EnumMagicTool implements IStringSerializable {
SPELL,
RITUAL,
POTION;
public static EnumMagicTool fromName(String name){
for(EnumMagicTool tool : values()){
if(tool.getSerializedName().equalsIgnoreCase(name))
return tool;
}
return null;
}
@Override
public String getSerializedName() {
return name().toLowerCase();
}
}
}
|
package com.tencent.mm.plugin.appbrand.jsapi.media;
import com.tencent.mm.plugin.appbrand.jsapi.media.JsApiChooseVideo.a;
import java.io.File;
class JsApiChooseVideo$a$2 implements Runnable {
final /* synthetic */ a fUU;
JsApiChooseVideo$a$2(a aVar) {
this.fUU = aVar;
}
public final void run() {
if (new File(a.b(this.fUU)).exists()) {
a.a(this.fUU).bjW = -1;
a.a(this.fUU).fUR = a.a(this.fUU, a.b(this.fUU), a.c(this.fUU).fUQ);
a.b(this.fUU, a.a(this.fUU));
return;
}
a.a(this.fUU).bjW = -2;
a.c(this.fUU, a.a(this.fUU));
}
}
|
package com.example.kcroz.joggr.ViewRoute;
import android.content.Context;
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;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import com.example.kcroz.joggr.DatabaseHelper;
import com.example.kcroz.joggr.R;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ViewRouteDataFragment extends Fragment {
private Context context;
private int runID;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_view_route_data, container, false);
context = getActivity();
runID = Integer.parseInt(getArguments().getString("RUN_ID"));
populateListView(view);
return view;
}
private void populateListView(View view) {
ListView lvRoute = view.findViewById(R.id.lvRoute);
SimpleAdapter adapter = new SimpleAdapter(context,
getRouteList(),
R.layout.listview_route,
new String[] {"PointID", "Latitude", "Longitude", "Timestamp", "RunID"},
new int[] {R.id.tvPointID, R.id.tvLatitude, R.id.tvLongitude, R.id.tvTimeStamp, R.id.tvRunID2});
lvRoute.setAdapter(adapter);
}
private List<Map<String,String>> getRouteList() {
DatabaseHelper dbHelper = new DatabaseHelper(context);
List<Map<String,String>> data = dbHelper.loadPointsForRun(runID);
Map<String, String> map = new HashMap<>();
map.put("PointID", "Point ID");
map.put("Latitude", "Latitude");
map.put("Longitude", "Longitude");
map.put("Timestamp", "Timestamp");
map.put("RunID", "Run ID");
data.add(0, map);
return data;
}
}
|
package io.github.jorelali.commandapi.api.arguments;
import com.mojang.brigadier.LiteralMessage;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import io.github.jorelali.commandapi.api.CommandPermission;
@SuppressWarnings("unchecked")
public class CustomArgument<S> implements Argument, OverrideableSuggestions {
/**
* MessageBuilder used for generating fancy error messages for CustomArguments
*/
public static class MessageBuilder {
StringBuilder builder;
public MessageBuilder() {
builder = new StringBuilder();
}
public MessageBuilder(String str) {
builder = new StringBuilder(str);
}
public MessageBuilder appendArgInput() {
builder.append("%input%");
return this;
}
public MessageBuilder appendFullInput() {
builder.append("%finput%");
return this;
}
public MessageBuilder appendHere() {
builder.append("%here%");
return this;
}
public MessageBuilder append(String str) {
builder.append(str);
return this;
}
public MessageBuilder append(Object obj) {
builder.append(obj);
return this;
}
@Override
public String toString() {
return builder.toString();
}
}
@SuppressWarnings("serial")
public static class CustomArgumentException extends Exception {
final String errorMessage;
final MessageBuilder errorMessageBuilder;
public CustomArgumentException(String errorMessage) {
this.errorMessage = errorMessage;
this.errorMessageBuilder = null;
}
public CustomArgumentException(MessageBuilder errorMessage) {
this.errorMessage = null;
this.errorMessageBuilder = errorMessage;
}
public CommandSyntaxException toCommandSyntax(String result, @SuppressWarnings("rawtypes") CommandContext cmdCtx) {
if(errorMessage == null) {
//Deal with MessageBuilder
String errorMsg = errorMessageBuilder.toString().replace("%input%", result).replace("%finput%", cmdCtx.getInput()).replace("%here%", "<--[HERE]");
return new SimpleCommandExceptionType(() -> {return errorMsg;}).create();
} else {
//Deal with String
return new SimpleCommandExceptionType(new LiteralMessage(errorMessage)).create();
}
}
}
@FunctionalInterface
public static interface CustomArgumentFunction<I, O> {
public O apply(I i) throws CustomArgumentException;
}
public static void throwError(String errorMessage) throws CustomArgumentException {
throw new CustomArgumentException(errorMessage);
}
public static void throwError(MessageBuilder errorMessage) throws CustomArgumentException {
throw new CustomArgumentException(errorMessage);
}
private CustomArgumentFunction<String, S> parser;
/**
* A Custom argument.
*/
public CustomArgument(CustomArgumentFunction<String, S> parser) {
this.parser = parser;
}
@Override
public <T> com.mojang.brigadier.arguments.ArgumentType<T> getRawType() {
return (com.mojang.brigadier.arguments.ArgumentType<T>) StringArgumentType.string();
}
@Override
public Class<S> getPrimitiveType() {
return null;
}
@Override
public boolean isSimple() {
return false;
}
public CustomArgumentFunction<String, S> getParser() {
return parser;
}
private CommandPermission permission = CommandPermission.NONE;
@Override
public CustomArgument<S> withPermission(CommandPermission permission) {
this.permission = permission;
return this;
}
@Override
public CommandPermission getArgumentPermission() {
return permission;
}
private String[] suggestions;
@Override
public CustomArgument<S> overrideSuggestions(String... suggestions) {
this.suggestions = suggestions;
return this;
}
@Override
public String[] getOverriddenSuggestions() {
return suggestions;
}
/*
* TODO:
* - Add DynamicArguments
* - Add documentation to constructor, getParser(), getPredicate etc... methods
*
*/
}
|
// Definition for singly-linked list.
class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
/**
* 92. Reverse Linked List II
*/
class Solution {
public ListNode reverseBetween(ListNode head, int m, int n) {
if (m == n)
return head;
ListNode fakeHead = new ListNode(-1);
fakeHead.next = head;
ListNode p = fakeHead, t, q;
int i = 1;
while (i++ < m)
p = p.next;
t = p.next;
while (i++ <= n) {
q = p.next;
p.next = t.next;
t.next = t.next.next;
p.next.next = q;
}
return fakeHead.next;
}
public static void main(String[] args) {
Solution s = new Solution();
int[] nodes = { 1, 2, 3, 4, 5, 6 };
int m = 1, n = 6;
ListNode fakeHead = new ListNode(-1);
ListNode p = fakeHead;
for (int i = 0; i < nodes.length; i++) {
ListNode t = new ListNode(nodes[i]);
p.next = t;
p = p.next;
}
ListNode r = s.reverseBetween(fakeHead.next, m, n);
while (r != null) {
System.out.print(r.val + " ");
r = r.next;
}
}
}
|
package so.ego.space.domains.project.application.dto;
import lombok.*;
import so.ego.space.domains.project.domain.Member;
import so.ego.space.domains.project.domain.Project;
import java.util.List;
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ProjectFindAllResponse {
// 프로젝트 리스트
// List<Project> projects;
// List<Member> memberList;
List<ProjectDetailDto> projects;
}
|
package com.tencent.mm.ui.chatting.b;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.ui.chatting.b.b.g;
class ah$9 implements Runnable {
final /* synthetic */ ah tSj;
final /* synthetic */ int tSt;
final /* synthetic */ int tSu;
final /* synthetic */ g tSv;
ah$9(ah ahVar, int i, int i2, g gVar) {
this.tSj = ahVar;
this.tSt = i;
this.tSu = i2;
this.tSv = gVar;
}
public final void run() {
this.tSj.bAG.eX(this.tSt, this.tSu);
x.i("MicroMsg.ChattingUI.SilenceMsgComponent", "summerbadcr firstVisiblePosition 222 %s %s %s", new Object[]{Integer.valueOf(this.tSj.bAG.getFirstVisiblePosition()), Integer.valueOf(this.tSj.bAG.getLastVisiblePosition()), Integer.valueOf(this.tSv.getCount())});
}
}
|
/*
* 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 cantante;
import javax.swing.JOptionPane;
/**
*
* @author ESTUDIANTE
*/
public class Canario implements Cantante {
private int peso;
@Override
public void cantar(){
JOptionPane.showMessageDialog(null,"Pio canario");
}
public int getPeso() {
return peso;
}
public void setPeso(int peso) {
this.peso = peso;
}
}
|
package com.tencent.mm.plugin.readerapp.ui;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import com.samsung.android.sdk.look.smartclip.SlookSmartClipMetaTag;
import com.tencent.mm.model.bi;
import com.tencent.mm.plugin.readerapp.b.a;
import com.tencent.mm.plugin.report.service.h;
class ReaderAppUI$9 implements OnClickListener {
final /* synthetic */ int bpX;
final /* synthetic */ ReaderAppUI mnQ;
final /* synthetic */ String mnR;
final /* synthetic */ bi mnS;
final /* synthetic */ int mnT;
ReaderAppUI$9(ReaderAppUI readerAppUI, int i, String str, bi biVar, int i2) {
this.mnQ = readerAppUI;
this.bpX = i;
this.mnR = str;
this.mnS = biVar;
this.mnT = i2;
}
public final void onClick(View view) {
if (20 == this.bpX) {
h.mEJ.h(15413, new Object[]{Integer.valueOf(8), this.mnR, this.mnS.getTitle()});
Intent intent = new Intent();
intent.putExtra("mode", 1);
String url = this.mnS.getUrl();
intent.putExtra("news_svr_id", this.mnS.dCW);
intent.putExtra("news_svr_tweetid", this.mnS.Iv());
intent.putExtra("rawUrl", ReaderAppUI.a(this.mnQ, url));
intent.putExtra(SlookSmartClipMetaTag.TAG_TYPE_TITLE, this.mnS.getName());
intent.putExtra("webpageTitle", this.mnS.getTitle());
intent.putExtra("useJs", true);
intent.putExtra("vertical_scroll", true);
Bundle bundle = new Bundle();
bundle.putInt("snsWebSource", 3);
intent.putExtra("jsapiargs", bundle);
intent.putExtra("shortUrl", this.mnS.Iw());
intent.putExtra("type", this.mnS.type);
intent.putExtra("tweetid", this.mnS.Iv());
intent.putExtra("geta8key_username", "newsapp");
intent.putExtra("KPublisherId", "msg_" + Long.toString(this.mnS.dCW));
intent.putExtra("pre_username", "newsapp");
intent.putExtra("prePublishId", "msg_" + Long.toString(this.mnS.dCW));
intent.putExtra("preUsername", "newsapp");
intent.putExtra("preChatName", "newsapp");
intent.putExtra("preMsgIndex", this.mnT);
intent.putExtra("geta8key_scene", 16);
intent.addFlags(536870912);
a.ezn.j(intent, this.mnQ);
}
}
}
|
package com.example.apo.quizfinal;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
public class Questions extends FragmentActivity implements Question.CommunicationChannel,Questions_Selector.Communictation{
Boolean multiplayer;
Boolean atplayertwo;
String[] userone = new String[2];
int score = 0;
boolean cheated = false;
String[] questions = {"What is 0+1?", "What is 1+1?", "What is 2+1?", "What is 2+2?", "What is 7+1?", "What is 4+1?", "What is 8+1?"};
final String[] answers = {"1", "2", "3", "4", "8", "5", "9"};
final List<Integer> questionsids=new ArrayList<Integer>();
User user=null;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_questions);
Intent myGotoquestionactivity = getIntent(); // gets the previously created intent
multiplayer = myGotoquestionactivity.getBooleanExtra("multiplayer", false);
atplayertwo = myGotoquestionactivity.getBooleanExtra("atplayertwo", false);
userone = myGotoquestionactivity.getStringArrayExtra("userone");
user = (User) myGotoquestionactivity.getSerializableExtra("user");
final EditText inputanswer = (EditText) findViewById(R.id.inputanswer);
final Button viewbtn = (Button) findViewById((R.id.viewbtn));
viewbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
changeShowQuestions();
}
}
);
questionsids.add(1);
questionsids.add(2);
questionsids.add(3);
questionsids.add(4);
questionsids.add(5);
questionsids.add(6);
questionsids.add(7);
changeQuestionById(2);
}
public void changeQuestionById(int qid){
if(questionsids.size()==0){
Intent gotofinalscreen = new Intent(Questions.this, FinalScreen.class);
gotofinalscreen.putExtra("score", score);
gotofinalscreen.putExtra("user", user);
gotofinalscreen.putExtra("multiplayer", multiplayer );
gotofinalscreen.putExtra("userone", userone);
gotofinalscreen.putExtra("atplayertwo", atplayertwo);
startActivity(gotofinalscreen);
}else {
qid -= 1;
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Question questionone = Question.newInstance(questionsids.indexOf(qid+1), questions[qid], answers[qid]);
ft.replace(R.id.question_holder, questionone);
ft.commit();
}
}
public void changeShowQuestions(){
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
String[] arr=new String[questionsids.size()];
for(int i=0;i<questionsids.size();i++){
arr[i]=questions[questionsids.get(i)-1];
}
Questions_Selector qs=Questions_Selector.newInstance(arr);
ft.replace(R.id.question_holder, qs);
ft.commit();
}
@Override
public void setCommunication(String choice,String answer) {
Toast.makeText(getApplicationContext(), "Your score so far is: " + choice, Toast.LENGTH_SHORT).show();
}
@Override
public void setNextButton(boolean correctornot,int qid) {
score+= correctornot ? 1:0;
questionsids.remove(qid);
changeQuestionById(questionsids.size()>0 ? questionsids.get(0):0);
}
@Override
public void setCheatButton(int qid) {
questionsids.remove(qid);
changeQuestionById(questionsids.size()>0 ? questionsids.get(0):0);
}
@Override
public void setSkipButton(int qid) {
if (questionsids.size()>1) {
if(qid==1){
changeQuestionById(questionsids.get(0));
}else{
changeQuestionById(questionsids.get(1));
}
}else{
changeQuestionById(questionsids.get(0));
}
}
@Override
public void setChoice(int id) {
changeQuestionById(questionsids.get(id));
}
}
|
package com.encore.datatype;
/*
* 1. 필드
* int 사이즈, char 컬러, float 가격, String 제조회사, String 재질
* 스크래치 여부를 알수 있는 필드를 추가
*
* 2. 메소드
* 2개 정의
* - 값을 Test 클래스에서 받아서 필드에 입력하는 기능
* - 필드에 입력된, 저장된 값을 콘솔창으로 출력하는 기능
* -----------------------------------------
* 1.
* 변수(Variable)는 사용되는 위치에 따라서 Field와 Local variable로 구분된다
* 필드 --> 클래스 선언 바로 밑, 메소드 블락 바깥
* Local variable(지역변수) --> 메소드 안에서 선언
*
* 2.
* 로컬변수의 이름도 필드와 동일하게 직관적으로 작성한다.
* 이름을 구분할때는 필드 앞에 this를 붙이면 된다.
*/
public class WhiteBoard {
//field
public int size;
public char color;
public float price;
public String company;
public String material;
public boolean scratch;
public void setField(int size, char color, float price, String company, String material, boolean scratch){//local variable
//필드와 로컬변수의 이름이 같을때, 구분하기 위해서 필드앞에 this를 붙인다.
//this는 해당 클래스 자기자식...쯤으로 일단 해석...
this.size = size;
this.color = color;
this.price = price;
this.company = company;
this.material = material;
this.scratch = scratch;
}
public void printInfo() {
System.out.println(size+"\t"+color+"\t"+price+"\t"+company+"\t"+material+"\t"+scratch);//backward slash하면 일정한 간격으로 스페이스
}
}
|
package com.tt.miniapp.chooser;
import android.app.Activity;
import android.app.LoaderManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListPopupWindow;
import android.widget.TextView;
import com.tt.miniapp.chooser.adapter.FolderAdapter;
import com.tt.miniapp.chooser.adapter.MediaGridAdapter;
import com.tt.miniapp.chooser.adapter.SpacingDecoration;
import com.tt.miniapp.chooser.data.DataCallback;
import com.tt.miniapp.chooser.data.ImageLoader;
import com.tt.miniapp.chooser.data.MediaLoader;
import com.tt.miniapp.chooser.data.VideoLoader;
import com.tt.miniapp.entity.Folder;
import com.tt.miniapp.permission.PermissionsManager;
import com.tt.miniapp.permission.PermissionsResultAction;
import com.tt.miniapp.view.swipeback.SwipeBackActivity;
import com.tt.miniapphost.entity.MediaEntity;
import com.tt.miniapphost.host.HostDependManager;
import com.tt.miniapphost.language.LanguageChangeListener;
import com.tt.miniapphost.util.UIUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
public class PickerActivity extends SwipeBackActivity implements View.OnClickListener, DataCallback, LanguageChangeListener {
Intent argsIntent;
Button category_btn;
Button done;
MediaGridAdapter gridAdapter;
public FolderAdapter mFolderAdapter;
ListPopupWindow mFolderPopupWindow;
Button preview;
RecyclerView recyclerView;
public void cancel() {
Intent intent = new Intent();
intent.putParcelableArrayListExtra("select_result", null);
setResult(19901026, intent);
finish();
}
void createAdapter() {
GridLayoutManager gridLayoutManager = new GridLayoutManager((Context)this, PickerConfig.GridSpanCount);
this.recyclerView.setLayoutManager((RecyclerView.i)gridLayoutManager);
this.recyclerView.a((RecyclerView.h)new SpacingDecoration(PickerConfig.GridSpanCount, PickerConfig.GridSpace));
this.recyclerView.setHasFixedSize(true);
ArrayList arrayList1 = new ArrayList();
ArrayList arrayList2 = this.argsIntent.getParcelableArrayListExtra("default_list");
int i = this.argsIntent.getIntExtra("max_select_count", 40);
long l = this.argsIntent.getLongExtra("max_select_size", 188743680L);
this.gridAdapter = new MediaGridAdapter(this.argsIntent.getIntExtra("camerType", 0), arrayList1, (Context)this, arrayList2, i, l);
this.recyclerView.setAdapter((RecyclerView.a)this.gridAdapter);
}
void createFolderAdapter() {
this.mFolderAdapter = new FolderAdapter(new ArrayList(), (Context)this);
this.mFolderPopupWindow = new ListPopupWindow((Context)this);
this.mFolderPopupWindow.setBackgroundDrawable((Drawable)new ColorDrawable(-1));
this.mFolderPopupWindow.setAdapter((ListAdapter)this.mFolderAdapter);
ListPopupWindow listPopupWindow = this.mFolderPopupWindow;
double d = UIUtils.getScreenHeight((Context)this);
Double.isNaN(d);
listPopupWindow.setHeight((int)(d * 0.6D));
this.mFolderPopupWindow.setAnchorView(findViewById(2097545302));
this.mFolderPopupWindow.setModal(true);
this.mFolderPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> param1AdapterView, View param1View, int param1Int, long param1Long) {
PickerActivity.this.mFolderAdapter.setSelectIndex(param1Int);
PickerActivity.this.category_btn.setText((PickerActivity.this.mFolderAdapter.getItem(param1Int)).name);
PickerActivity.this.gridAdapter.updateAdapter(PickerActivity.this.mFolderAdapter.getSelectMedias());
PickerActivity.this.mFolderPopupWindow.dismiss();
}
});
}
public void done(ArrayList<MediaEntity> paramArrayList) {
Intent intent = new Intent();
intent.putParcelableArrayListExtra("select_result", paramArrayList);
setResult(19901026, intent);
finish();
}
void getMediaData() {
HashSet<String> hashSet = new HashSet();
hashSet.add("android.permission.READ_EXTERNAL_STORAGE");
PermissionsManager.getInstance().requestPermissionsIfNecessaryForResult((Activity)this, hashSet, new PermissionsResultAction() {
public void onDenied(String param1String) {}
public void onGranted() {
int i = PickerActivity.this.argsIntent.getIntExtra("select_mode", 101);
if (i == 101) {
LoaderManager loaderManager = PickerActivity.this.getLoaderManager();
PickerActivity pickerActivity = PickerActivity.this;
loaderManager.initLoader(i, null, (LoaderManager.LoaderCallbacks)new MediaLoader((Context)pickerActivity, pickerActivity));
return;
}
if (i == 100) {
LoaderManager loaderManager = PickerActivity.this.getLoaderManager();
PickerActivity pickerActivity = PickerActivity.this;
loaderManager.initLoader(i, null, (LoaderManager.LoaderCallbacks)new ImageLoader((Context)pickerActivity, pickerActivity));
return;
}
if (i == 102) {
LoaderManager loaderManager = PickerActivity.this.getLoaderManager();
PickerActivity pickerActivity = PickerActivity.this;
loaderManager.initLoader(i, null, (LoaderManager.LoaderCallbacks)new VideoLoader((Context)pickerActivity, pickerActivity));
}
}
});
}
public void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent) {
super.onActivityResult(paramInt1, paramInt2, paramIntent);
if (paramInt1 == 8) {
if (paramIntent == null)
return;
ArrayList<MediaEntity> arrayList = paramIntent.getParcelableArrayListExtra("select_result");
if (paramInt2 == 1990) {
this.gridAdapter.updateSelectAdapter(arrayList);
setButtonText();
return;
}
if (paramInt2 == 19901026)
done(arrayList);
return;
}
if (paramInt1 == 9 || paramInt1 == 10) {
String str;
if (paramInt1 == 9) {
str = PickerConfig.currentCameraVideoPath;
} else {
str = PickerConfig.currentCameraPhotoPath;
}
if (paramInt2 == -1 && !TextUtils.isEmpty(str)) {
File file = new File(str);
if (file.exists()) {
ArrayList<MediaEntity> arrayList = new ArrayList();
arrayList.add(new MediaEntity(str, file.getName(), 0L, 0, file.length(), 0, ""));
done(arrayList);
return;
}
}
cancel();
}
}
public void onBackPressed() {
cancel();
}
public void onClick(View paramView) {
int i = paramView.getId();
if (i == 2097545250) {
cancel();
return;
}
if (i == 2097545255) {
if (this.mFolderPopupWindow.isShowing()) {
this.mFolderPopupWindow.dismiss();
return;
}
this.mFolderPopupWindow.show();
return;
}
if (i == 2097545269) {
done(this.gridAdapter.getSelectMedias());
return;
}
if (i == 2097545369) {
if (this.gridAdapter.getSelectMedias().size() <= 0) {
HostDependManager.getInst().showToast((Context)this, null, getString(2097742021), 0L, null);
return;
}
Intent intent = new Intent((Context)this, PreviewActivity.class);
intent.putExtra("max_select_count", this.argsIntent.getIntExtra("max_select_count", 40));
intent.putExtra("pre_raw_List", this.gridAdapter.getSelectMedias());
startActivityForResult(intent, 8);
}
}
public void onCreate(Bundle paramBundle) {
super.onCreate(paramBundle);
this.argsIntent = getIntent();
setContentView(2097676327);
this.recyclerView = (RecyclerView)findViewById(2097545370);
this.recyclerView.setRecyclerListener(new RecyclerView.p() {
public void onViewRecycled(RecyclerView.v param1v) {
if (param1v instanceof MediaGridAdapter.MyViewHolder)
((MediaGridAdapter.MyViewHolder)param1v).media_image.setTag(2097545452, null);
}
});
findViewById(2097545250).setOnClickListener(this);
setTitleBar();
this.done = (Button)findViewById(2097545269);
this.category_btn = (Button)findViewById(2097545255);
this.preview = (Button)findViewById(2097545369);
this.done.setOnClickListener(this);
this.category_btn.setOnClickListener(this);
this.preview.setOnClickListener(this);
createAdapter();
createFolderAdapter();
getMediaData();
}
public void onData(ArrayList<Folder> paramArrayList) {
setView(paramArrayList);
this.category_btn.setText(((Folder)paramArrayList.get(0)).name);
this.mFolderAdapter.updateAdapter(paramArrayList);
}
public void onLanguageChange() {
setTitleBar();
}
public void onRequestPermissionsResult(int paramInt, String[] paramArrayOfString, int[] paramArrayOfint) {
super.onRequestPermissionsResult(paramInt, paramArrayOfString, paramArrayOfint);
if ((paramInt >> 16 & 0xFFFF) == 0)
PermissionsManager.getInstance().notifyPermissionsChange((Activity)this, paramArrayOfString, paramArrayOfint);
}
void setButtonText() {
int i = this.argsIntent.getIntExtra("max_select_count", 40);
Button button = this.done;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(getString(2097741885));
stringBuilder.append("(");
stringBuilder.append(this.gridAdapter.getSelectMedias().size());
stringBuilder.append("/");
stringBuilder.append(i);
stringBuilder.append(")");
button.setText(stringBuilder.toString());
button = this.preview;
stringBuilder = new StringBuilder();
stringBuilder.append(getString(2097741988));
stringBuilder.append("(");
stringBuilder.append(this.gridAdapter.getSelectMedias().size());
stringBuilder.append(")");
button.setText(stringBuilder.toString());
}
public void setTitleBar() {
int i = this.argsIntent.getIntExtra("select_mode", 101);
if (i == 101) {
((TextView)findViewById(2097545248)).setText(getString(2097742022));
return;
}
if (i == 100) {
((TextView)findViewById(2097545248)).setText(getString(2097742020));
return;
}
if (i == 102)
((TextView)findViewById(2097545248)).setText(getString(2097742023));
}
void setView(ArrayList<Folder> paramArrayList) {
this.gridAdapter.updateAdapter(((Folder)paramArrayList.get(0)).getMedias());
setButtonText();
this.gridAdapter.setOnItemClickListener(new MediaGridAdapter.OnRecyclerViewItemClickListener() {
public void onItemClick(View param1View, MediaEntity param1MediaEntity, ArrayList<MediaEntity> param1ArrayList) {
PickerActivity.this.setButtonText();
}
});
}
}
/* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\chooser\PickerActivity.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/
|
package net.learn2develop.moviedata_finaltask10.net;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* U okviru cetvrtog koraka (takodje u paketu Net) potrebno je da definisemo retrofit instancu preko koje ce komunikacija ici. Retrofit nije sastavni
* deo Androida, i zato moramo da uvezemo biblioteku. On nam osigurava da nas zahtev bude pozvan! ApiService nam je objekat
* nad kojim cemo raditi pozive (metode)!
* */
public class RESTService {
public static final String BASE_URL = "https://www.omdbapi.com";
public static final String API_KEY = "c1b22ec7";
public static Retrofit getRetrofitInstance(){
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
return retrofit;
}
public static OMDBApiEndpointInterface apiInterface(){
OMDBApiEndpointInterface apiService = getRetrofitInstance().create(OMDBApiEndpointInterface.class);
return apiService;
}
}
|
package com.google.android.exoplayer2.a;
import com.google.android.exoplayer2.p;
final class f$g {
final p acY;
final long adM;
final long ahd;
/* synthetic */ f$g(p pVar, long j, long j2, byte b) {
this(pVar, j, j2);
}
private f$g(p pVar, long j, long j2) {
this.acY = pVar;
this.ahd = j;
this.adM = j2;
}
}
|
package com.nic.usermanagement.utils;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DBUtils
{
public static ArrayList<HashMap<String,Object>> getListMap(String sql,Connection con,Object[] columnvalues) throws SQLException
{
ArrayList<HashMap<String,Object>> records=new ArrayList<HashMap<String,Object>>();
PreparedStatement ps = con.prepareStatement(sql);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
ResultSetMetaData rm = rs.getMetaData();
int cols = rm.getColumnCount();
if (rs.next())
{
do {
HashMap<String, Object> row = new java.util.HashMap<String, Object>(cols);
for (int i=1; i<=cols; i++) {
String columnName = rm.getColumnName(i);
Object columnValue = rs.getObject(i);
row.put(columnName.trim(), columnValue);
}
records.add(row);
row = null;
}
while (rs.next());
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return records;
}
public static Map<String,Object> getMap(String sql,Connection con,Object[] columnvalues) throws SQLException
{
Map<String,Object> records=new HashMap<String,Object>();
PreparedStatement ps = con.prepareStatement(sql);
System.out.println("PS"+ps);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
ResultSetMetaData rm = rs.getMetaData();
int cols = rm.getColumnCount();
if (rs.next())
{
records = new HashMap<String, Object>(cols);
for (int i=1; i<=cols; i++) {
String columnName = rm.getColumnName(i).toUpperCase();
Object columnValue = rs.getObject(i);
records.put(columnName.trim(), columnValue);
}
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return records;
}
public static Map<String,Object> getMapL(String sql,Connection con,Object[] columnvalues) throws SQLException
{
Map<String,Object> records=new HashMap<String,Object>();
PreparedStatement ps = con.prepareStatement(sql);
System.out.println("PS"+ps);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
ResultSetMetaData rm = rs.getMetaData();
int cols = rm.getColumnCount();
if (rs.next())
{
records = new HashMap<String, Object>(cols);
for (int i=1; i<=cols; i++) {
String columnName = rm.getColumnName(i).toUpperCase();
Object columnValue = rs.getObject(i);
records.put(columnName.trim(), columnValue);
}
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return records;
}
public static List<List<Object>> get2DList(String sql,Connection con,Object[] columnvalues) throws SQLException
{
List<List<Object>> records=new ArrayList<List<Object>>();
PreparedStatement ps = con.prepareStatement(sql);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
ResultSetMetaData rm = rs.getMetaData();
int cols = rm.getColumnCount();
if (rs.next())
{
do {
ArrayList<Object> row = new ArrayList<Object>(cols);
for (int i=1; i<=cols; i++) {
row.add(rs.getObject(i));
}
records.add(row);
row = null;
}
while (rs.next());
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return records;
}
public static List<Object> getList(String sql,Connection con,Object[] columnvalues) throws SQLException
{
List<Object> records=new ArrayList<Object>();
PreparedStatement ps = con.prepareStatement(sql);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
// System.out.println("PS"+sql);
ResultSet rs=ps.executeQuery();
ResultSetMetaData rm = rs.getMetaData();
int cols = rm.getColumnCount();
if(rs.next())
{
records = new ArrayList<Object>();
for (int i=1; i<=cols; i++) {
// System.out.println("RMCOLS"+rs.getObject(i));
records.add(rs.getObject(i));
//System.out.println("RESULT"+i);
}
}
//System.out.println("LENGTH"+records.size());
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return records;
}
public static Long getDBValue(String sql,Connection con,Object[] columnvalues) throws Exception
{
Long val=0L;
PreparedStatement ps = con.prepareStatement(sql);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
if (rs.next())
{
val=rs.getLong(1);
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return val;
}
public static int getDBValueInt(String sql,Connection con,Object[] columnvalues) throws Exception
{
int val=0;
PreparedStatement ps = con.prepareStatement(sql);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
if (rs.next())
{
val=rs.getInt(1);
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return val;
}
public static ArrayList<HashMap<String,Object>> getListMapWithString(String sql,Connection con,Object[] columnvalues) throws SQLException
{
ArrayList<HashMap<String,Object>> records=new ArrayList<HashMap<String,Object>>();
PreparedStatement ps = con.prepareStatement(sql);
if(columnvalues!=null)
{
for(int ci=0;ci<columnvalues.length;ci++)
{
ps.setObject(ci+1, columnvalues[ci]);
}
}
ResultSet rs=ps.executeQuery();
ResultSetMetaData rm = rs.getMetaData();
int cols = rm.getColumnCount();
if (rs.next())
{
do {
HashMap<String, Object> row = new java.util.HashMap<String, Object>(cols);
for (int i=1; i<=cols; i++) {
String columnName = rm.getColumnName(i);
String columnValue = rs.getString(i);
row.put(columnName.trim(), columnValue);
}
records.add(row);
row = null;
}
while (rs.next());
}
//DBPlugin.closeResultSet(rs);
//DBPlugin.closePreparedStatement(ps);
return records;
}
}
|
package com.tencent.mm.plugin.account.ui;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
class l$7 implements OnCancelListener {
final /* synthetic */ l eSI;
l$7(l lVar) {
this.eSI = lVar;
}
public final void onCancel(DialogInterface dialogInterface) {
}
}
|
package com.tencent.mm.plugin.exdevice.service;
import android.os.IInterface;
public interface h extends IInterface {
long a(p pVar);
void a(n nVar);
boolean a(long j, int i, k kVar);
boolean a(i iVar);
boolean a(s sVar);
boolean a(String str, boolean z, q qVar);
long[] aHt();
boolean b(int i, j jVar);
boolean b(long j, int i, k kVar);
boolean b(long j, byte[] bArr, t tVar);
boolean b(i iVar);
boolean c(int i, j jVar);
boolean cT(long j);
boolean cU(long j);
boolean cV(long j);
boolean cW(long j);
boolean d(int i, j jVar);
boolean e(int i, j jVar);
void setChannelSessionKey(long j, byte[] bArr);
}
|
package kütüphaneotomasyonu;
import kütüphaneotomasyonu.AbstractOrnek;
/*
* 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 Sualp
*/
//Abstract yapısı için alt sınıf örneğidir.
public class AbstractAltOrnek extends AbstractOrnek{
@Override
public int topla(int a, int b) {
int sonuc=a+b;
return sonuc;
}
}
|
package com.qiang.graduation.main.conf;
import java.io.FileWriter;
import java.io.IOException;
public class AlipayConfig {
public static String app_id = "2018041602570218";
public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCOSkPJT+57dWsAveOb+Fl6IjJlnyfF3Yu5XkOHJD2Becf1RUES1svMlcobCvr9Wq7OfGhCkkcgLkrGp6uAZxWw6HJavy5E0Ro0U9Q96JWAvtAMrgVVR2jm1yFtIs7QlRy6s4REgwYCCUHTbijXeC1/EBALV+WQ869hTHiHw7yFueRN42GCf/6XCCmNpf1+ENAQk9KJ6jpHp1r64xwF0B04M0E48k+2QJWSBLo+7AvFASwDuXvLqwdkXHDLdnGPTM/HaN2mtCnNxMF3lD7FgVMfNk0JkCYxnz8KWpGpAHCSsmHXXw/qKbrWRFmaAYsKx1yREduwzI/SLMor8ENn+RR9AgMBAAECggEAHC1Usx7jCQu9fs4brp1FiswO0tTrmWE/9BtYoABrNaKaGFX4hvSGMyNOfIB2J4m3qCg2tUgmUZcZM7GsYqcHQpslWhcV4IbP+6DGHORcBrzCkmA7qiGUAnKDqgsEjYWZxNcb0D1qCSkwIeBkshaYW9sgcj6btVKsXkY4cBow0QIszhQIh/CwEAI9B08IgwgwZ8tnSe07wzP3UG/wIwDu9+6XJUP5Hr/IolCMb7pSaMa/2wa5YmQd+U8cfLJgujsWXliJrRyVxMYEsPLs2EIk7l9bYUxAwLJDIu/Ro61Ne7My2ryjKvFBxvP9FiHBeqfExCQwzcTGuorINsbJToBDuQKBgQDUlsZYIfsCDKSfwWXf36kUo1WHxIZF1uJgnz7q3hSSyqFnjLy2ZrgjzJ9kuAPesWbj4V++OgQ1IsRc3Rn1U52Jo3c6JIdPVTFbuSwG4YodByPM4kC9rhuwxaCVCIoLaib6Ti1fFPPzVvw8+7a+Ut74JgjYYtHd1kjclnSDev43LwKBgQCrWJJGLBCGpWg2aBUJ0BmhJwYNb/fJCQ6fnKHulQf/gKxC7otl5Cr/C2YRoC4o/c16Kbdt7x8uJlnoEKChEZf8YKRGLGcbEMiMi3uh6ZZz+6leGBbVf8kShnkeDVRnladTOD/5Wk+G3yc1ZDQBJCND31vDZOin+gu4NwReQhXEEwKBgBtgr3p6JdFFv42zYmNKcoPt5P3vGTu1SMIYwAmPQCcHYXHsdgEniV9S4tQdvqHXRuDiDWp6HkCZkaBD+SvW8Nrg6mHagnJ9DjY5yqm4Mgk6+ilQmfXTjk1dpiiLSPvfV9W0a7NrB1+3PBS+dfJcyco7W7hCQbTH++osliS4mjSRAoGBAIxclAaz1h3WpdXb0VAmjrg6tXSQglTG/Jm3v9cnclPVXke+Dac8EBS5i7VomCewMYCfZ8nAlrRBamj2Jf+L4As4R5nMifHb/81R/ccXCM6eG5Ie/aWLdnWcft8lYD0ylM1RSObFGlyLtRzBpvBAYDsbX5pisUvZQ3x2ZTepvxbNAoGBAMyHh4g16Ann6PFH35v/zwVkq6Dq3U5NosKwtXW5IumhmdRV0Ao/3DfxWcMi9TQMLcv5xR2FwR2zWN6r8oIfir4OS7b5NUEoM6lrftok2O5OWSHPDCIXsVuFfdYrgv+mAgB01Xsltuz0wNcFuaNMJXZQ36j2goFfr6uZuBOeVkBw";
public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw44kDFTKrQ9BVkE7Kmk/l95QXulYl3AhFZMWk+eXRs2MtNZAgNlzCP4MW4QBZmGpfpSgxs+lM1ydyMWKvBvZWJfbR129QVeIM1JJnyY1UPWTaoovCtsbRgliO8ZdH7divz8TQMLCPwqvukthK1800zT1DQrX/vhr190JuZObvi0xV76vqPSWvHOe7vpBJVSkP3yME/M5Fu5OLB0NJsNRKhxy2aK0AaY9pp0lw9nV9aa8o15AJe+Ez4+qWIewRrwik1bjfZLhnaPq5BsVsn14i+/Z8cDAnhrhHNBDuMKuaCqaELUQzv8gW7UfAJ1pWLRgNzg2wkdq9j7X/PWuxX8M6wIDAQAB";
public static String notify_url = "http://www.cjyong.com:8181/pay_notify";
public static String return_url = "http://www.cjyong.com:8181/pay_return";
public static String sign_type = "RSA2";
public static String charset = "utf-8";
public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
public static String log_path = "C:\\";
/**
* 写日志,方便测试(看网站需求,也可以改成把记录存入数据库)
* @param sWord 要写入日志里的文本内容
*/
static void logResult(String sWord) {
FileWriter writer = null;
try {
writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
writer.write(sWord);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
|
package com.saaolheart.mumbai.customer;
import org.springframework.data.jpa.repository.JpaRepository;
public interface CustConsultationSeqRepo extends JpaRepository<CustmerConsultationSeq, Long>{
}
|
package com.duanxr.yith.easy;
/**
* @author 段然 2021/3/8
*/
public class IslandPerimeter {
/**
* You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.
*
* Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).
*
* The island doesn't have "lakes", meaning the water inside isn't connected to the water around the island. One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
*
*
*
* Example 1:
*
*
* Input: grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]
* Output: 16
* Explanation: The perimeter is the 16 yellow stripes in the image above.
* Example 2:
*
* Input: grid = [[1]]
* Output: 4
* Example 3:
*
* Input: grid = [[1,0]]
* Output: 4
*
*
* Constraints:
*
* row == grid.length
* col == grid[i].length
* 1 <= row, col <= 100
* grid[i][j] is 0 or 1.
*
* 给定一个 row x col 的二维网格地图 grid ,其中:grid[i][j] = 1 表示陆地, grid[i][j] = 0 表示水域。
*
* 网格中的格子 水平和垂直 方向相连(对角线方向不相连)。整个网格被水完全包围,但其中恰好有一个岛屿(或者说,一个或多个表示陆地的格子相连组成的岛屿)。
*
* 岛屿中没有“湖”(“湖” 指水域在岛屿内部且不和岛屿周围的水相连)。格子是边长为 1 的正方形。网格为长方形,且宽度和高度均不超过 100 。计算这个岛屿的周长。
*
*
*
* 示例 1:
*
*
*
* 输入:grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]
* 输出:16
* 解释:它的周长是上面图片中的 16 个黄色的边
* 示例 2:
*
* 输入:grid = [[1]]
* 输出:4
* 示例 3:
*
* 输入:grid = [[1,0]]
* 输出:4
*
*
* 提示:
*
* row == grid.length
* col == grid[i].length
* 1 <= row, col <= 100
* grid[i][j] 为 0 或 1
*
*/
class Solution {
public int islandPerimeter(int[][] grid) {
int reuslt = 0;
System.out.println();
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[i].length; j++) {
if (grid[i][j] == 1) {
if (i == 0 || grid[i - 1][j] != 1) {
reuslt++;
}
if (j == 0 || grid[i][j - 1] != 1) {
reuslt++;
}
if (i == grid.length - 1 || grid[i + 1][j] != 1) {
reuslt++;
}
if (j == grid[i].length - 1 || grid[i][j + 1] != 1) {
reuslt++;
}
}
}
}
return reuslt;
}
}
}
|
package br.com.util;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import javax.swing.JFormattedTextField;
import javax.swing.SwingUtilities;
import javax.swing.text.JTextComponent;
import javax.swing.text.MaskFormatter;
public class JTextFieldFocu extends JFormattedTextField{
/**
*
*/
private static final long serialVersionUID = 1L;
public JTextFieldFocu(){
this.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent e) {
selectAll();
setBackground(new Color(219, 237, 254));
}
public void focusLost(FocusEvent e) {
setBackground(Color.WHITE);
setText(getText().toUpperCase());
}
});
}
}
|
package eday4;
import java.util.Arrays;
/*
*
* 0-1 knapsack
* DP
*
* */
public class 배낭 {
public static void main(String[] args) {
int W = 10; //배낭의 무게( 최종 구하고자하는 목표)
int[] w = {0,5,4,6,3}; // 무게(kg)
int[] v = {0,10,40,30,50}; // 가치(만원)
int[][] K = new int[w.length][W+1]; // 최대 배낭에 담은 물건의 가치
for (int i = 1; i < w.length; i++) {
for (int j = 0; j < w[i]; j++) { // 임시배낭의 무게가 물건의 무게보다 적으면 이전차수에서 값을 가져온다
K[i][j] = K[i-1][j];
}
for (int j = w[i]; j <=W ; j++) {
int now = K[i-1][j-w[i]]+ v[i]; // 물건 선택을 고려한 경우
int pre = K[i-1][j];// 물건을 고려하지 않은 경우
K[i][j] = now >=pre ? now :pre;
}
}
for (int i = 0; i < K.length; i++) {
System.out.println(Arrays.toString(K[i]));
}
} //end of main
}// end of class
|
package com.tencent.mm.plugin.walletlock.fingerprint.a;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.tencent.mm.ab.e;
import com.tencent.mm.ab.l;
import com.tencent.mm.plugin.soter.d.b;
import com.tencent.mm.plugin.walletlock.b.g;
import com.tencent.mm.plugin.walletlock.b.h;
import com.tencent.mm.plugin.walletlock.fingerprint.a.d.a;
import com.tencent.mm.sdk.platformtools.ad;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.x;
public final class c implements e, d {
private String eWo = null;
boolean mcv = false;
a pGA = null;
private a pGB = null;
private boolean pGC = false;
public final void a(a aVar, Bundle bundle) {
this.eWo = bundle.getString("key_pay_passwd");
this.pGC = bundle.getBoolean("key_fp_lock_offline_mode");
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo prepare pwd: %s, isOfflineMode: %b", new Object[]{this.eWo, Boolean.valueOf(this.pGC)});
this.pGA = aVar;
this.mcv = false;
g.pIt.pIu = null;
g.pIt.pIv = null;
com.tencent.mm.kernel.g.DF().a(1967, this);
com.tencent.mm.kernel.g.DF().a(1548, this);
if (this.pGC) {
g.pIt.pIu = String.valueOf(System.currentTimeMillis());
jH(false);
return;
}
SharedPreferences chZ = ad.chZ();
if (chZ != null) {
String string = chZ.getString("cpu_id", null);
String string2 = chZ.getString("uid", null);
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo cpuId: %s, uid: %s", new Object[]{string, string2});
if (bi.oW(string) || bi.oW(string2)) {
b.a(true, true, new 2(this, chZ));
} else {
fg(string, string2);
}
} else if (this.pGA != null) {
this.pGA.af(2, "system error");
}
}
private void jH(boolean z) {
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo prepareAuthKey isNeedChangeAuthKey: %b", new Object[]{Boolean.valueOf(z)});
com.tencent.d.b.a.a(new com.tencent.d.b.a.b<com.tencent.d.b.a.c>() {
public final /* synthetic */ void a(com.tencent.d.b.a.e eVar) {
com.tencent.d.b.a.c cVar = (com.tencent.d.b.a.c) eVar;
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo prepareAuthKey onResult errCode: %d, errMsg: %s, isCancelled: %b", new Object[]{Integer.valueOf(cVar.errCode), cVar.Yy, Boolean.valueOf(c.this.mcv)});
if (!c.this.mcv) {
if (cVar.isSuccess()) {
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo update wallet lock auth key success");
if (c.this.pGA != null) {
c.this.pGA.af(0, "prepare auth key ok");
return;
}
return;
}
x.e("MicroMsg.FingerprintLockOpenDelegate", "alvinluo error when prepare auth key");
h.ed(2, cVar.errCode);
if (c.this.pGA != null) {
c.this.pGA.af(2, cVar.Yy);
}
}
}
}, z, 3, this.pGC ? null : new g(this.eWo), new com.tencent.mm.plugin.soter.b.e());
}
static void fg(String str, String str2) {
com.tencent.mm.kernel.g.DF().a(new e(str, str2), 0);
}
public final void a(a aVar, String str, String str2, String str3) {
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo do open fingerprint lock");
this.pGB = aVar;
com.tencent.mm.kernel.g.DF().a(new f(str2, str3, str), 0);
}
public final void release() {
x.d("MicroMsg.FingerprintLockOpenDelegate", "alvinluo release open delegate");
this.pGA = null;
this.pGB = null;
this.mcv = true;
com.tencent.mm.kernel.g.DF().b(1967, this);
com.tencent.mm.kernel.g.DF().b(1548, this);
}
public final void a(int i, int i2, String str, l lVar) {
x.i("MicroMsg.FingerprintLockOpenDelegate", "alvinluo fingerprint wallet lock open delegate errType: %d, errCode: %d, errMsg: %s, cgi type: %d", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), str, Integer.valueOf(lVar.getType())});
if (!this.mcv) {
if (lVar instanceof e) {
if (i == 0 && i2 == 0) {
e eVar = (e) lVar;
g.pIt.pIu = eVar.jgX;
jH(eVar.pGF);
} else if (this.pGA != null) {
this.pGA.af(7, "get challenge failed");
}
} else if (!(lVar instanceof f)) {
} else {
if (i == 0 && i2 == 0) {
h.jL(true);
if (this.pGB != null) {
this.pGB.af(0, "open touch lock ok");
return;
}
return;
}
h.jL(false);
if (this.pGB != null) {
this.pGB.af(6, "open touch lock failed");
}
}
}
}
}
|
package com.uwetrottmann.trakt5.services;
import com.uwetrottmann.trakt5.BaseTestCase;
import com.uwetrottmann.trakt5.TestData;
import com.uwetrottmann.trakt5.entities.Episode;
import com.uwetrottmann.trakt5.entities.Ratings;
import com.uwetrottmann.trakt5.entities.Stats;
import com.uwetrottmann.trakt5.enums.Extended;
import org.junit.Test;
import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
public class EpisodesTest extends BaseTestCase {
@Test
public void test_summary() throws IOException {
Episode episode = executeCall(getTrakt().episodes().summary(String.valueOf(TestData.SHOW_TRAKT_ID),
TestData.EPISODE_SEASON,
TestData.EPISODE_NUMBER, Extended.FULL));
assertThat(episode).isNotNull();
assertThat(episode.title).isEqualTo(TestData.EPISODE_TITLE);
assertThat(episode.season).isEqualTo(TestData.EPISODE_SEASON);
assertThat(episode.number).isEqualTo(TestData.EPISODE_NUMBER);
assertThat(episode.ids.imdb).isEqualTo(TestData.EPISODE_IMDB_ID);
assertThat(episode.ids.tmdb).isEqualTo(TestData.EPISODE_TMDB_ID);
assertThat(episode.ids.tvdb).isEqualTo(TestData.EPISODE_TVDB_ID);
assertThat(episode.runtime).isGreaterThan(0);
assertThat(episode.comment_count).isGreaterThanOrEqualTo(0);
}
@Test
public void test_comments() throws IOException {
executeCall(getTrakt().episodes().comments(TestData.SHOW_SLUG, TestData.EPISODE_SEASON,
TestData.EPISODE_NUMBER, 1, DEFAULT_PAGE_SIZE, null));
}
@Test
public void test_ratings() throws IOException {
Ratings ratings = executeCall(getTrakt().episodes().ratings(TestData.SHOW_SLUG, TestData.EPISODE_SEASON,
TestData.EPISODE_NUMBER));
assertRatings(ratings);
}
@Test
public void test_stats() throws IOException {
Stats stats = executeCall(
getTrakt().episodes().stats(TestData.SHOW_SLUG, TestData.EPISODE_SEASON, TestData.EPISODE_NUMBER));
assertStats(stats);
}
}
|
/*
* 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 util;
import java.sql.Date;
import java.text.SimpleDateFormat;
/**
*
* @author lukin
*/
public class DateChecker {
/**
*
* @param data
* @return
*/
public static Date DateChecker(String data) {
SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy");
java.util.Date date = null;
java.sql.Date sqlStartDate = null;
try {
date = sdf1.parse(data);
java.sql.Date dataSql = new java.sql.Date(date.getTime());
sqlStartDate = dataSql;
} catch (java.text.ParseException | NullPointerException ex) {
//Logger.getLogger(Cadastro.class.getName()).log(Level.SEVERE, null, ex);
sqlStartDate = null;
}
return sqlStartDate;
}
}
|
package com.sojay.testfunction.video.view;
import android.animation.Animator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Camera;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.media.MediaPlayer;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.Scroller;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.sojay.testfunction.R;
import com.sojay.testfunction.utils.BitmapUtil;
import com.sojay.testfunction.video.bean.VideoBean;
import com.sojay.testfunction.video.listener.CAnimatorListener;
import com.sojay.testfunction.video.listener.OnAnimationListener;
/**
* 可翻页的view
* 包含翻页,平移翻页
*/
public class TurnPageView extends FrameLayout {
private FrameLayout mLeftTotalLayout; // 左侧总容器
private FrameLayout mLeftSubLayout; // 左侧子容器
private ImageView mIvRight; // 右侧的图片
private VideoPlayerView mVideoPlayer; // 视频播放
private SurfaceView mSurfaceView;
private Rect mRectLeft = new Rect(); // 左侧的矩阵
private Rect mRectRight = new Rect(); // 右侧的矩阵
private Camera mCamera = new Camera();
private Matrix mMatrix = new Matrix();
private VideoBean mVideoBean;
private Scroller mScroller;
private int mWidth;
private int mHeight;
private boolean isFlipping = false; // 是否正在翻转中
private Bitmap mRightBitmap; // 右侧图片
private String mCourseFilePath; // 根目录
private int mSwitchType; // 底图入场动画类型
private boolean isVideo; // 记录右侧第一个元素是都是视频
private boolean isEndPosition; // 是否是某一个大步的最后一个子步
private boolean isAuto; // 是否自动跳转下一步
private BitmapDrawable mBgDrawable; // 背景图
private int mBitmapWidth = 0; // 图片宽度
private int mBitmapHeight = 0; // 图片高度
private float mLastDownX;
private long downTime = 0L;
private OnAnimationListener mListener;
public TurnPageView(@NonNull Context context) {
this(context, null);
}
public TurnPageView(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public TurnPageView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void init(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());// 减速 // 动画插入器
mIvRight = new ImageView(context);
LayoutParams rightParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mIvRight.setLayoutParams(rightParams);
mIvRight.setScaleType(ImageView.ScaleType.CENTER_CROP);
addView(mIvRight);
mLeftTotalLayout = new FrameLayout(context);
LayoutParams leftTotalParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mLeftTotalLayout.setLayoutParams(leftTotalParams);
mLeftSubLayout = new FrameLayout(context);
LayoutParams leftSubParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mLeftSubLayout.setLayoutParams(leftSubParams);
mLeftTotalLayout.addView(mLeftSubLayout);
addView(mLeftTotalLayout);
mSurfaceView = new SurfaceView(context);
LayoutParams playerParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mSurfaceView.setLayoutParams(playerParams);
mLeftTotalLayout.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN)
mLastDownX = event.getX();
return false;
});
}
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
@Override
public void handleMessage(@NonNull Message msg) {
switch (msg.what) {
case 1:
mLeftSubLayout.removeView(mSurfaceView);
performExitAnimation1();
break;
case 2:
mLeftTotalLayout.animate().cancel();
mLeftTotalLayout.setTranslationX(0f);
mLeftTotalLayout.setAlpha(1f);
mLeftSubLayout.setTranslationX(0f);
mLeftTotalLayout.setBackground(null);
mLeftSubLayout.removeAllViews();
addCurrentVideo(mVideoBean, mCourseFilePath, isEndPosition);
isFlipping = false;
isVideo = false;
mRightBitmap = null;
mIvRight.setImageBitmap(null);
break;
case 3:
mLeftSubLayout.removeView(mSurfaceView);
break;
}
}
};
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mWidth = MeasureSpec.getSize(widthMeasureSpec);
mHeight = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(mWidth, mHeight);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
int count = getChildCount();
//将两个textView放置进去
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
child.layout(0, 0, mWidth, mHeight);
}
mRectLeft.left = 0;
mRectLeft.top = 0;
mRectLeft.right = getWidth() / 2;
mRectLeft.bottom = getHeight();
mRectRight.left = getWidth() / 2;
mRectRight.top = 0;
mRectRight.right = getWidth();
mRectRight.bottom = getHeight();
}
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (!mScroller.isFinished() && mScroller.computeScrollOffset()) {
drawR2L_LeftHalf(canvas);
drawR2L_RightHalf(canvas);
drawR2L_FlipHalf(canvas);
postInvalidate();
}
}
/**
* 由右向左翻页-画左半部分
*/
private void drawR2L_LeftHalf(Canvas canvas) {
canvas.save();
canvas.clipRect(mRectLeft);
View drawView = mLeftTotalLayout;
drawChild(canvas, drawView, 0);
canvas.restore();
}
/**
* 由右向左翻页-画右半部分
*/
private void drawR2L_RightHalf(Canvas canvas) {
canvas.save();
canvas.clipRect(mRectRight);
View drawView = mIvRight;
drawChild(canvas, drawView, 0);
canvas.restore();
}
/**
* 由右向左翻页-画翻页部分
*/
private void drawR2L_FlipHalf(Canvas canvas) {
canvas.save();
mCamera.save();
View view = null;
float deg = getDegX();
if (deg < 90) {
canvas.clipRect(mRectRight);
mCamera.rotateY(-deg);
view = mLeftTotalLayout;
} else if (deg >= 90){
canvas.clipRect(mRectLeft);
mCamera.rotateY(-deg - 180);
view = mIvRight;
}
mCamera.getMatrix(mMatrix);
positionMatrix();
canvas.concat(mMatrix);
if (view != null) {
drawChild(canvas, view, 0);
}
mCamera.restore();
canvas.restore();
}
/**
* 由左向右翻页-画左半部分
*/
private void drawL2R_LeftHalf(Canvas canvas) {
canvas.save();
canvas.clipRect(mRectLeft);
View drawView = mIvRight;
drawChild(canvas, drawView, 0);
canvas.restore();
}
/**
* 由左向右翻页-画右半部分
*/
private void drawL2R_RightHalf(Canvas canvas) {
canvas.save();
canvas.clipRect(mRectRight);
View drawView = mLeftTotalLayout;
drawChild(canvas, drawView, 0);
canvas.restore();
}
/**
* 由左向右翻页-画翻页部分
*/
private void drawL2R_FlipHalf(Canvas canvas) {
canvas.save();
mCamera.save();
View view = null;
float deg = getDegX();
if (deg < 90) {
mCamera.rotateY(deg);
canvas.clipRect(mRectLeft);
view = mLeftTotalLayout;
} else if (deg >= 90) {
mCamera.rotateY(deg + 180);
canvas.clipRect(mRectRight);
view = mIvRight;
}
mCamera.getMatrix(mMatrix);
positionMatrix();
canvas.concat(mMatrix);
if (view != null)
drawChild(canvas, view, 0);
mCamera.restore();
canvas.restore();
}
private float getDegX() {
return mScroller.getCurrX() * 1.0f / mWidth * 180;
}
private void positionMatrix() {
mMatrix.preScale(0.25f, 0.25f);
mMatrix.postScale(4.0f, 4.0f);
mMatrix.preTranslate(-getWidth() / 2f, -getHeight() / 2f);
mMatrix.postTranslate(getWidth() / 2f, getHeight() / 2f);
}
/**
* 直接替换,不需要任何动画
*/
private void startReplacement() {
mHandler.sendEmptyMessageDelayed(2, 0);
}
/**
* 右中移入
*/
private void startTranslationLeftIn() {
if (mRightBitmap == null) {
mLeftTotalLayout.setTranslationX(-mLeftTotalLayout.getWidth());
mLeftTotalLayout.animate().translationX(0).setDuration(1000L);
} else {
mLeftTotalLayout.animate().translationX(mLeftTotalLayout.getWidth()).setDuration(1000L);
mIvRight.setTranslationX(-mIvRight.getWidth());
mIvRight.animate().translationX(0).setDuration(1000L);
}
mHandler.sendEmptyMessageDelayed(2, 950);
}
/**
* 右中移入
*/
private void startTranslationRightIn() {
if (mRightBitmap == null) {
mLeftTotalLayout.setTranslationX(mLeftTotalLayout.getWidth());
mLeftTotalLayout.animate().translationX(0).setDuration(1000L);
} else {
mLeftTotalLayout.animate().translationX(-mLeftTotalLayout.getWidth()).setDuration(1000L);
mIvRight.setTranslationX(mIvRight.getWidth());
mIvRight.animate().translationX(0).setDuration(1000L);
}
mHandler.sendEmptyMessageDelayed(2, 950);
}
/**
* 右移然后翻转
*/
private void startTranslationRightFlip() {
mLeftSubLayout.setTranslationX(0);
mLeftSubLayout.animate().translationX(500).setDuration(1000L).setListener(new CAnimatorListener() {
@Override
public void onAnimationEnd(Animator animation) {
startFlip();
}
});
}
/**
* 左移然后翻转
*/
private void startTranslationLeftFlip() {
mLeftSubLayout.setTranslationX(0);
mLeftSubLayout.animate().translationX(-500).setDuration(1000L).setListener(new CAnimatorListener() {
@Override
public void onAnimationEnd(Animator animation) {
startFlip();
}
});
}
/**
* 居中翻转
*/
private void startFlip() {
MediaPlayer mp = MediaPlayer.create(getContext(), R.raw.fanshu);
mp.start();
mScroller.startScroll(0, 0, mWidth, 0, 1000);
mHandler.sendEmptyMessageDelayed(2, 950);
postInvalidate();
}
/**
* 淡入
*/
private void startAlphaIn() {
if (mRightBitmap == null) {
mLeftTotalLayout.setAlpha(0f);
mLeftTotalLayout.animate().alpha(1).setDuration(1000L);
} else {
mLeftTotalLayout.animate().alpha(0).setDuration(1000L);
}
mHandler.sendEmptyMessageDelayed(2, 950);
}
/********************************************* 对外API **************************************/
public void setBgDrawable(String path1) {
mBgDrawable = BitmapUtil.getLocalBitmapDrawable(path1);
mLeftTotalLayout.setBackground(mBgDrawable);
}
public void setVideoBean(VideoBean videoBean) {
mVideoBean = videoBean;
}
/**
* 设置右侧的底图
*/
public void setNextDrawable(VideoBean videoBean, String courseFilePath, boolean isEndPosition, boolean isVideo) {
this.isVideo = isVideo;
this.isEndPosition = isEndPosition;
this.isAuto = true;
this.mCourseFilePath = courseFilePath;
mVideoBean = videoBean;
mSwitchType = 19;
mRightBitmap = BitmapUtil.getLocalBitmap(courseFilePath + videoBean.getFirstFrame());
mIvRight.setImageBitmap(mRightBitmap);
postInvalidate();
}
/**
* 当前页页面添加视频
*/
public void addCurrentVideo(VideoBean videoBean, String courseFilePath, boolean isEndPosition) {
this.isEndPosition = isEndPosition;
this.isAuto = true;
if (isAdd()) {
mSurfaceView.bringToFront();
} else {
mLeftSubLayout.addView(mSurfaceView);
}
MediaPlayerHelper.getInstance().setSurfaceView(mSurfaceView).playUrl(getContext(), courseFilePath + videoBean.getVideoPath(), true);
MediaPlayerHelper.getInstance().setOnStatusCallbackListener(new MediaPlayerHelper.OnStatusCallbackListener() {
@Override
public void onStatusonStatusCallbackNext(MediaPlayerHelper.CallBackState status, Object... args) {
if(status == MediaPlayerHelper.CallBackState.COMPLETE){
mHandler.sendEmptyMessageDelayed(3, 80);
if (mListener != null)
mListener.onAnimationEnd();
}
}
});
}
/**
* 是否有播放器
*/
public boolean isAdd() {
boolean isAdd = false;
for (int i = 0; i < mLeftSubLayout.getChildCount(); i++) {
if (mLeftSubLayout.getChildAt(i) instanceof VideoPlayerView)
isAdd = true;
}
return isAdd;
}
/**
* 获取音乐播放器层级
*/
public int getLevel() {
for (int i = 0; i < mLeftSubLayout.getChildCount(); i++) {
if (mLeftSubLayout.getChildAt(i) instanceof VideoPlayerView)
return i;
}
return -1;
}
/**
* 当前步是否已经添加图层
*/
public boolean isAddCurrent() {
if (mLeftSubLayout.getChildCount() == 0)
return true;
return false;
}
/**
* 执行离场动画
* 如view处于放大状态,先恢复到正常大小
*/
public void performExitAnimation() {
if (isFlipping)
return;
isFlipping = true;
// if (mLeftSubLayout.getChildCount() > 0) {
// mLeftSubLayout.getChildAt(0).setScaleX(1f);
// mLeftSubLayout.getChildAt(0).setScaleY(1f);
// }
//
// if (mRightBitmap == null) {
// // 淡入
// startAlphaIn();
// return;
// }
if (isAdd()) {
// changeVideo();
mHandler.sendEmptyMessageDelayed(1, 100);
return;
}
performExitAnimation1();
}
/**
* 将视频最后一帧替换成图片
*/
private void changeVideo() {
MediaPlayerHelper.getInstance().stop();
ImageView ivFrame = new ImageView(getContext());
LayoutParams ivFrameParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
ivFrame.setLayoutParams(ivFrameParams);
ivFrame.setImageBitmap(BitmapUtil.getLocalBitmap(mVideoPlayer.getLastFramePath()));
ivFrame.setBackgroundColor(getContext().getResources().getColor(R.color.white));
mLeftSubLayout.addView(ivFrame, getLevel());
//
// ImageView iv = new ImageView(getContext());
// LayoutParams ivParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
// iv.setLayoutParams(ivParams);
// mLeftSubLayout.setDrawingCacheEnabled(true);
// mLeftSubLayout.buildDrawingCache(); //启用DrawingCache并创建位图
// iv.setImageBitmap(Bitmap.createBitmap(mLeftSubLayout.getDrawingCache()));
// mLeftSubLayout.setDrawingCacheEnabled(false);
// mLeftSubLayout.addView(iv);
}
public void performExitAnimation1() {
if (mSwitchType == 3) {
// 左中移入
startTranslationLeftIn();
} else if (mSwitchType == 8) {
// 右中移入
startTranslationRightIn();
} else if (mSwitchType == 19) {
// 正常:居中向左翻页 上一步:居中向右翻页
startFlip();
} else if (mSwitchType == 20) {
// 右移向左翻页
startTranslationRightFlip();
} else {
// 淡入
startAlphaIn();
}
}
/**
* 清空所有的子view
*/
public void clear() {
mLeftSubLayout.removeAllViews();
mSwitchType = 0;
mRightBitmap = null;
mIvRight.setImageBitmap(null);
postInvalidate();
}
public void removeTheLastTwoView() {
if (mLeftSubLayout.getChildCount() == 1) {
mLeftSubLayout.removeView(mLeftSubLayout.getChildAt(mLeftSubLayout.getChildCount() - 1));
} else if (mLeftSubLayout.getChildCount() > 1) {
mLeftSubLayout.removeView(mLeftSubLayout.getChildAt(mLeftSubLayout.getChildCount() - 1));
mLeftSubLayout.removeView(mLeftSubLayout.getChildAt(mLeftSubLayout.getChildCount() - 1));
}
}
public void clearLeft() {
mLeftSubLayout.removeAllViews();
mVideoPlayer.stopPlayer();
}
public VideoPlayerView getVideoPlayer() {
return mVideoPlayer;
}
/**
* 设置翻页监听
*/
public void setOnAnimationListener(OnAnimationListener listener) {
mListener = listener;
}
}
|
package star.orf.app;
import star.orf.app.Frames.AminoAcids;
import star.orf.app.Frames.Bases;
public class Model
{
Bases[] forwardBases;
Bases[] reverseBases;
AminoAcids[] forwardAA;
AminoAcids[] reverseAA;
boolean[] forwardDecodes;
boolean[] reverseDecodes;
}
|
package com.mi.model;
public class T_Car {
private String car_id;
private String user_id;
private String commodity_id;
private String commodity_size;
public String getCommodity_size() {
return commodity_size;
}
public void setCommodity_size(String commodity_size) {
this.commodity_size = commodity_size;
}
private int car_account;
public String getCar_id() {
return car_id;
}
public void setCar_id(String car_id) {
this.car_id = car_id;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getCommodity_id() {
return commodity_id;
}
public void setCommodity_id(String commodity_id) {
this.commodity_id = commodity_id;
}
public int getCar_account() {
return car_account;
}
public void setCar_account(int car_account) {
this.car_account = car_account;
}
}
|
package www.gemini.dao;
import java.util.List;
import www.gemini.model.AccPrjMaster;
public interface AccPrjMasterDao {
public void addRecord(AccPrjMaster master);
public List<AccPrjMaster> listOfMaster();
public void removeMasterDao(int accId);
}
|
package com.diozero.sampleapps.util;
/*
* #%L
* Organisation: diozero
* Project: diozero - Sample applications
* Filename: SysFsTest.java
*
* This file is part of the diozero project. More information about this project
* can be found at https://www.diozero.com/.
* %%
* Copyright (C) 2016 - 2023 diozero
* %%
* 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.
* #L%
*/
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class SysFsTest {
public static void main(String[] args) {
try {
test(12);
} catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static void test(int gpio) throws IOException, InterruptedException {
Path direction_path = Paths.get("/sys/class/gpio/gpio" + gpio + "/direction");
File direction_file = direction_path.toFile();
if (! direction_file.exists()) {
String export_file = "/sys/class/gpio/export";
System.out.println("echo \"" + gpio + "\" > " + export_file);
try (FileWriter export = new FileWriter(export_file)) {
export.write(Integer.toString(gpio));
}
}
long max_wait = 500;
long start = System.currentTimeMillis();
while (! direction_file.canWrite()) {
System.out.println("Can't write, waiting");
Thread.sleep(20);
if (System.currentTimeMillis() - start > max_wait) {
System.out.println("Waited too long");
return;
}
}
boolean append = true;
String dir = "out";
System.out.println("echo \"" + dir + "\" " + (append ? ">> " : "> ") + direction_file);
System.out.println(direction_file.exists() + ", " + direction_file.canRead() + ", " + direction_file.canWrite());
try (OutputStream os = Files.newOutputStream(direction_path, StandardOpenOption.APPEND)) {
os.write(dir.getBytes());
}
System.out.println("Opening value file");
try (RandomAccessFile raf = new RandomAccessFile("/sys/class/gpio/gpio" + gpio + "/value", "rw")) {
for (int i=0; i<10; i++) {
String v = "1";
System.out.println("Setting value to '" + v + "' for " + gpio);
raf.write(v.getBytes());
Thread.sleep(1000);
v = "0";
System.out.println("Setting value to '" + v + "' for " + gpio);
raf.seek(0);
raf.write(v.getBytes());
Thread.sleep(1000);
}
}
}
}
|
package cz.utb.kryonet;
import com.esotericsoftware.kryonet.Client;
import com.esotericsoftware.kryonet.Connection;
import com.esotericsoftware.kryonet.Listener;
import com.esotericsoftware.kryonet.Server;
import com.esotericsoftware.minlog.Log;
import cz.utb.SQL;
import fr.bmartel.speedtest.SpeedTestSocket;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
public class MyServer {
public Server server;
HashSet<ClientData> loggedIn = new HashSet();
HashMap<String, ClientConnection> connections = new HashMap<>();
SpeedTestSocket speedTestSocket;
float lastDownload;
float lastUpload;
SQL sql;
boolean useDatabase = true;
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
public MyServer(final SQL sql) throws IOException {
this.sql = sql;
server = new Server() {
protected Connection newConnection() {
// By providing our own connection implementation, we can store per
// connection state without a connection ID to state look up.
return new ClientConnection();
}
};
sql.removeOldRecords();
// For consistency, the classes to be sent over the network are
// registered by the same method for both the client and server.
Network.register(server);
server.addListener(new Listener() {
public void received(Connection c, Object object) {
// We know all connections for this server are actually CharacterConnections.
ClientConnection connection = (ClientConnection) c;
ClientData clientData = connection.clientData;
if (object instanceof Network.FollowClient) {
if (((Network.FollowClient) object).follow) {
clientData.followClient = ((Network.FollowClient) object).token;
} else {
clientData.followClient = null;
}
}
if (object instanceof Network.UseDatabase) {
useDatabase = ((Network.UseDatabase) object).useDatabase;
Log.info("Database", "using " + useDatabase);
server.sendToAllExceptTCP(c.getID(), object);
}
if (object instanceof Network.Register) {
networkRegister((Network.Register) object, clientData, connection);
}
if (object instanceof Network.Touches) {
int idClient = 0;
try {
if (useDatabase) {
idClient = sql.getIdByToken(((ClientConnection) c).clientData.token);
}
} catch (Exception e) {
Log.error(e.toString(),
e.getStackTrace()[0].toString());
}
sendTouchToFollovers(connection, object);
for (Network.Touch touch : ((Network.Touches) object).values) {
try {
sql.insertTouch(touch.touchType,
touch.x,
touch.y,
touch.clientCreated,
idClient);
} catch (Exception e) {
Log.error(e.toString(),
e.getStackTrace()[0].toString());
}
}
}
}
public void disconnected(Connection c) {
ClientConnection connection = (ClientConnection) c;
if (connection.clientData != null) {
connections.remove(connection.clientData.token);
loggedIn.remove(connection.clientData);
try {
sql.connection.createStatement().executeUpdate("update client set connected = false where token = '" + connection.clientData.token + "' ");
} catch (NullPointerException | SQLException e) {
Log.error(e.toString(),
e.getStackTrace()[0].toString());
}
sendRegisteredUsers();
}
}
});
server.bind(Network.port);
server.start();
}
public void networkRegister(Network.Register object, ClientData clientData, ClientConnection connection) {
if (clientData != null) {
return;
}
sql.deleteOldTouches();
Network.Register register = object;
String userName = register.userName;
String token = register.token;
if (userName != null && token != null) {
Log.info("client", "registered <" + userName + "> token <" + token + ">");
if (userName.length() != 0) {
connection.clientData = new ClientData();
connection.clientData.userName = userName;
connection.clientData.token = token;
loggedIn.add(connection.clientData);
connections.put(connection.clientData.token, connection);
try {
sql.connection.createStatement().executeUpdate("insert into " +
"client (name, token) " +
"values ('" + userName + "', '" + token + "')");
} catch (NullPointerException | SQLException e) {
Log.error(e.toString(),
e.getStackTrace()[0].toString());
}
connection.clientData.id = sql.getIdByToken(connection.clientData.token);
sendRegisteredUsers();
}
}
}
public void sendTouchToFollovers(ClientConnection clientConnection, Object o) {
for (ClientConnection c : connections.values()) {
try {
if (c.clientData.followClient.equals(clientConnection.clientData.token)) {
c.sendTCP(o);
}
} catch (Exception e) {
Log.error(e.toString(),
e.getStackTrace()[0].toString());
}
}
}
public void sendRegisteredUsers() {
Network.RegisteredUsers registeredUsers = new Network.RegisteredUsers();
registeredUsers.users = new ArrayList<Network.Register>();
for (Iterator<ClientData> aa = loggedIn.iterator(); aa.hasNext(); ) {
ClientData cd = aa.next();
Network.Register register = new Network.Register();
register.userName = cd.userName;
register.token = cd.token;
registeredUsers.users.add(register);
}
server.sendToAllTCP(registeredUsers);
}
// This holds per connection state.
static class ClientConnection extends Connection {
public ClientData clientData;
}
}
|
package com.jim.multipos.ui.vendors.vendor_list;
import com.jim.multipos.config.scope.PerFragment;
import dagger.Binds;
import dagger.Module;
@Module
public abstract class VendorListFragmentPresenterModule {
@Binds
@PerFragment
abstract VendorListFragmentPresenter provideVendorListFragmentPresenter(VendorListFragmentPresenterImpl presenter);
}
|
package com.kush.lib.expressions.evaluators;
import static com.kush.lib.expressions.types.factory.TypedValueFactory.nullValue;
import java.util.Optional;
import com.kush.lib.expressions.ExpressionEvaluator;
import com.kush.lib.expressions.ExpressionException;
import com.kush.lib.expressions.types.Type;
import com.kush.lib.expressions.types.TypedValue;
public class ConstantValueEvaluator<T> implements ExpressionEvaluator<T> {
private final TypedValue constantValue;
public static <T> ExpressionEvaluator<T> withConstantValue(TypedValue value) {
return new ConstantValueEvaluator<>(value);
}
public static <T> ExpressionEvaluator<T> withNull(Type type) {
return withConstantValue(nullValue(type));
}
private ConstantValueEvaluator(TypedValue constantValue) {
this.constantValue = constantValue;
}
@Override
public TypedValue evaluate(T object) throws ExpressionException {
return constantValue;
}
@Override
public Type evaluateType() throws ExpressionException {
return constantValue.getType();
}
@Override
public Optional<TypedValue> getConstantValue() throws ExpressionException {
return Optional.of(constantValue);
}
}
|
package rs.jug.rx.restclient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RestClientModule {
@Bean
public GturnquistQuotersGateway restGateway(){
return new GturnquistQuotersGateway();
}
@Bean
public JsonReader jsonReader(){
return new JsonReader();
}
}
|
package gui;
import other.SwingConsole;
public class GuiRunner {
public static void runLoginFrame(){
SwingConsole.run(new LoginFrame(), 450, 260);
}
static void runRegisterFrame(){
SwingConsole.run(new RegisterFrame(), 620, 320);
}
static void runDepositFrame(){
SwingConsole.run(new DepositFrame(), 620, 320);
}
static void runMenuFrame(){
SwingConsole.run(new MenuFrame(), 620, 320);
}
static void runWithdrawFrame(){
SwingConsole.run(new WithdrawFrame(), 620, 320);
}
static void runInfoFrame(){
SwingConsole.run(new InfoFrame(), 620, 320);
}
static void runRemindCCNFrame(){
SwingConsole.run(new RemindCCNFrame(), 620, 320);
}
}
|
package ssh.dao.impl;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import demo.dao.AbstractDao;
import ssh.dao.HdfsUserDao;
import ssh.model.HdfsUser;
@Component
public class HdfsUserDaoImpl extends AbstractDao implements HdfsUserDao {
private Logger log = LoggerFactory.getLogger(HdfsUserDaoImpl.class);
@Override
public int save(HdfsUser hdfsUser) {
if(checkExist(hdfsUser.getEmail())) return -1;
return (Integer) this.getHibernateTemplate().save(hdfsUser);
}
@Override
public void update(HdfsUser hdfsUser) {
this.getHibernateTemplate().update(hdfsUser);
}
@Override
public HdfsUser loadByEmail(String email){
String hql = "from HdfsUser where email = ?";
List list = this.getHibernateTemplate().find(hql, email);
if(list==null || list.size()<1) return null;
if(list.size()>1){
log.info("多行email!email:{}"+email);
}
return (HdfsUser) list.get(0);
}
public boolean checkExist(String email){
HdfsUser hdfsUser= loadByEmail(email);
return hdfsUser==null ? false: true;
}
}
|
package com.xindq.yilan.domain;
public class FileDetail {
private int id;
private String name;
private String extension;
private String family;
private String detail;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getExtension() {
return extension;
}
public void setExtension(String extension) {
this.extension = extension;
}
public String getFamily() {
return family;
}
public void setFamily(String family) {
this.family = family;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
@Override
public String toString() {
return "FileDetail{" +
"id=" + id +
", name='" + name + '\'' +
", extension='" + extension + '\'' +
", family='" + family + '\'' +
", detail='" + detail + '\'' +
'}';
}
}
|
package com.rs.game.player.content.commands;
import com.rs.game.Animation;
import com.rs.game.ForceTalk;
import com.rs.game.Graphics;
import com.rs.game.WorldTile;
import com.rs.game.player.Player;
//import com.rs.game.player.content.DisplayNameAction;
import com.rs.game.player.content.Magic;
import com.rs.game.player.content.custom.YellHandler;
import com.rs.utils.DisplayNames;
import com.rs.utils.Utils;
import com.rs.game.item.Item;
public class Spawn {
public static boolean processCommand(Player player, String[] cmd, boolean console, boolean clientCommand) {
if (clientCommand)
return true;
// these command are added from previous commands!
if (cmd[0].equals("yell")) {
String message1 = "";
for (int i = 1; i < cmd.length; i++)
message1 += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
YellHandler.sendYell(player, Utils.fixChatMessage(message1));
return true;
}
if (cmd[0].equals("blueskin")) {
player.getAppearence().setSkinColor(12);
player.getAppearence().generateAppearenceData();
return true;
}
if (cmd[0].equals("greenskin")) {
player.getAppearence().setSkinColor(13);
player.getAppearence().generateAppearenceData();
return true;
}
if (cmd[0].equals("item")) {
int itemId = Integer.parseInt(cmd[1]);
long amount = cmd.length < 3 ? 1 : Long.parseLong(cmd[2]);
if (itemId < 1 || itemId > Utils.getItemDefinitionsSize()) {
player.sendMessage("Invalid Item Id. Item Def size is "+Utils.getItemDefinitionsSize()+"");
return true;
}
if (amount > Integer.MAX_VALUE || amount < 1) {
amount = Integer.MAX_VALUE;
}
String itemName = new Item(itemId).getName();
if (itemName == "null" || itemName == null) {
player.sendMessage("Nulled Items can't be spawned.");
return true;
}
if (player.getInventory().add(itemId, (int)amount)) {
player.sendMessage("Spawned: "+itemName+" (Amount: "+Utils.formatNumber(amount)+")");
}
return true;
}
if (cmd[0].equals("item")) {
int itemId = Integer.parseInt(cmd[1]);
long amount = cmd.length < 3 ? 1 : Long.parseLong(cmd[2]);
if (itemId < 1 || itemId > Utils.getItemDefinitionsSize()) {
player.sendMessage("Invalid Item Id. Item Def size is "+Utils.getItemDefinitionsSize()+"");
return true;
}
if (amount > Integer.MAX_VALUE || amount < 1) {
amount = Integer.MAX_VALUE;
}
String itemName = new Item(itemId).getName();
if (itemName == "null" || itemName == null) {
player.sendMessage("Nulled Items can't be spawned.");
return true;
}
if (player.getInventory().add(itemId, (int)amount)) {
player.sendMessage("Spawned: "+itemName+" (Amount: "+Utils.formatNumber(amount)+")");
}
return true;
}
if (cmd[0].equals("sdonorzone")) {
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3635, 3365, 0));
return true;
}
if (cmd[0].equals("stdung")) {
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2681, 9796, 0));
return true;
}
if (cmd[0].equals("title")) {
if (cmd.length < 2) {
player.getPackets().sendGameMessage("Use: ::title id");
return true;
}
try {
player.getAppearence().setTitle(Integer.valueOf(cmd[1]));
} catch (NumberFormatException e) {
player.getPackets().sendGameMessage("Use: ::title id");
}
return true;
}
if (cmd[0].equals("setdisplay")) {
player.getTemporaryAttributtes().put("setdisplay", Boolean.TRUE);
player.getPackets().sendInputNameScript("Enter the display name you wish:");
return true;
}
if (cmd[0].equals("resetdisplay")) {
DisplayNames.removeDisplayName(player);
player.getPackets().sendGameMessage("Removed Display Name");
return true;
}
// ends here * for now *
if (cmd[0].equalsIgnoreCase("dice")) {
if (!player.isDonator()) {
player.getPackets().sendGameMessage(
"You do not have the privileges to use this.");
return true;
}
player.getPackets().sendGameMessage("Rolling...");
player.setNextGraphics(new Graphics(2075));
player.setNextAnimation(new Animation(11900));
//int random = Utils.getRandom(100);
int numberRolled = Utils.getRandom(100);
player.setNextForceTalk(new ForceTalk("You rolled <col=FF0000>" + numberRolled + "</col> " + "on the percentile dice"));
player.getPackets().sendGameMessage("rolled <col=FF0000>" + numberRolled + "</col> " + "on the percentile dice");
return true;
}
if (cmd[0].equals("setdisplay")) {
player.sendMessage("Click on the noticeboard at home if you wish to change your display name.");
return true;
}
if (cmd[0].equals("bank")) {
player.stopAll();
player.getBank().openBank();
return true;
}
return false;
}
}
|
package chessgame.userinterface;
import chessgame.board.Board;
import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;
/**
* This class is a component of the graphical interface. It contains a JPanel,
* that can to updated to reflect the reflect the changes on the board.
* @author mattilei
*/
public class Square {
private JPanel square;
private JButton button;
private String id;
private Color color;
/**
* The constructor creates the square. If there is a piece that has the same
* id as the square, it will be represented by an ImageIcon
*
* @param id the chessboard is composed of 8 x 8 squares. The coordinates of
* the squares are stored in the id
* @param board the square updates itself based on the information stored in
* the board class
* @param color this parameter tells whether this square is light or dark
*/
public Square(String id, Board board, Color color) {
this.square = new JPanel(new BorderLayout());
this.id = id;
this.color = color;
square.setBackground(color);
square.setBorder(BorderFactory.createLineBorder(Color.black, 1));
this.button = null;
if (board.getPiece(id) == null) {
button = new JButton();
} else {
button = new JButton(board.getPiece(id).getImage());
}
button.setContentAreaFilled(false);
button.setBorderPainted(false);
button.addActionListener(new ButtonListener(id, board));
square.add(button);
}
/**
* Returns the JPanel representation of this class.
*
* @return returns this class as a JPanel
*/
public JPanel getSquare() {
return square;
}
public String getId() {
return id;
}
/**
* This method causes the square to update itself based on the information
* found in the board class
*
* @param board uses the board to see if there is a piece on this particular
* square
*/
public void update(Board board) {
JButton button = getButton();
clearBackground();
if (board.getPiece(id) == null) {
button.setIcon(null);
} else {
button.setIcon(board.getPiece(id).getImage());
}
if (id.equals(board.getStartingPoint())) {
paintBackgroundWhite();
}
}
/**
* Paints the background of the square white. Used to highlight which piece
* has been selected.
*/
public void paintBackgroundWhite() {
this.square.setBackground(Color.white);
}
/**
* Paints the background of the square in lighter color than it was
* originally. Used to show possible moves that the piece can make.
*/
public void paintBackgroundLighter() {
Color light = new Color(color.getRed() + 52, color.getGreen() + 42, color.getBlue() + 37);
this.square.setBackground(light);
}
/**
* Turns the background of the square back to normal color
*/
public void clearBackground() {
this.square.setBackground(color);
}
/**
* Returns the JButton-object that is stored in this class. The JButton is
* pressed show which buttons you want to move and where.
*
* @return returns the JButton stored in this class
*/
public JButton getButton() {
return button;
}
}
|
package es.technest.technestexercise.entity;
import es.technest.technestexercise.model.Account;
import org.springframework.http.HttpStatus;
import org.springframework.util.MultiValueMap;
public class ResponseEntity extends org.springframework.http.ResponseEntity<Account> {
public ResponseEntity(HttpStatus status) {
super(status);
}
public ResponseEntity(Account body, HttpStatus status) {
super(body, status);
}
public ResponseEntity(MultiValueMap<String, String> headers, HttpStatus status) {
super(headers, status);
}
public ResponseEntity(Account body, MultiValueMap<String, String> headers, HttpStatus status) {
super(body, headers, status);
}
}
|
import TSim.CommandException;
import TSim.SensorEvent;
import TSim.TSimInterface;
import java.util.concurrent.Semaphore;
public class Lab1 {
private static Semaphore[] sem;
public Lab1(Integer speed1, Integer speed2) {
if (sem == null) {
sem = new Semaphore[6];
for (int i = 0; i < 6; i++) {
sem[i] = new Semaphore(1);
}
}
Train train1 = new Train(1, speed1);
Train train2 = new Train(2, speed2);
train1.start();
train2.start();
}
/**
* A train with an ID and a speed
*/
private class Train extends Thread {
private int id;
private int speed;
private TSimInterface tsi = TSimInterface.getInstance();
private boolean[] hasSemaphore; //trains need to know what semaphores they are holding
private boolean headingNorth; //direction of train
public Train(int id, int speed) {
this.id = id;
this.speed = speed;
this.hasSemaphore = new boolean[6];
if (id == 1) {
headingNorth = false;
} else {
headingNorth = true;
}
}
@Override
public void run() {
try {
tsi.setSpeed(id, speed);
while (true) {
SensorEvent sEvent = tsi.getSensor(id);
if (sEvent.getStatus() == sEvent.ACTIVE) { //only active sensors are interesting.
//Specific if-cases for each sensor
if (sEvent.getXpos() == 15 && sEvent.getYpos() == 7) {
if (headingNorth) {
leaveSection(2);
} else {
enterSectionAndSwitch(2, 17, 7, tsi.SWITCH_RIGHT);
}
}
if (sEvent.getXpos() == 18 && sEvent.getYpos() == 9) {
if (headingNorth) {
leaveSection(3);
} else {
enterAtTrackSplit(3, 15, 9, tsi.SWITCH_RIGHT, tsi.SWITCH_LEFT);
}
}
if (sEvent.getXpos() == 15 && sEvent.getYpos() == 8) {
if (headingNorth) {
leaveSection(2);
} else {
enterSectionAndSwitch(2, 17, 7, tsi.SWITCH_LEFT);
}
}
if (sEvent.getXpos() == 13 && sEvent.getYpos() == 10) {
if (headingNorth) {
enterSectionAndSwitch(2, 15, 9, tsi.SWITCH_LEFT);
} else {
leaveSection(2);
}
}
if (sEvent.getXpos() == 2 && sEvent.getYpos() == 9) {
if (headingNorth) {
enterAtTrackSplit(3, 4, 9, tsi.SWITCH_LEFT, tsi.SWITCH_RIGHT);
} else {
leaveSection(3);
}
}
if (sEvent.getXpos() == 7 && sEvent.getYpos() == 9) {
if (headingNorth) {
leaveSection(4);
} else {
enterSectionAndSwitch(4, 4, 9, tsi.SWITCH_LEFT);
}
}
if (sEvent.getXpos() == 5 && sEvent.getYpos() == 11) {
if (headingNorth) {
enterSectionAndSwitch(4, 3, 11, tsi.SWITCH_LEFT);
} else {
leaveSection(4);
}
}
if (sEvent.getXpos() == 14 && sEvent.getYpos() == 11) {
if (!headingNorth) {
changeDir();
} else {
if (!hasSemaphore[5]) { //fix to lock initial semaphore
sem[5].tryAcquire();
hasSemaphore[5] = true;
}
}
}
if (sEvent.getXpos() == 14 && sEvent.getYpos() == 13) {
if (!headingNorth) {
changeDir();
}
}
if (sEvent.getXpos() == 14 && sEvent.getYpos() == 3) {
if (headingNorth) {
changeDir();
} else {
if (!hasSemaphore[0]) { //fix to lock initial semaphore
sem[0].tryAcquire();
hasSemaphore[0] = true;
}
}
}
if (sEvent.getXpos() == 14 && sEvent.getYpos() == 5) {
if (headingNorth) {
changeDir();
}
}
if (sEvent.getXpos() == 6 && sEvent.getYpos() == 10) {
if (headingNorth) {
leaveSection(4);
} else {
enterSectionAndSwitch(4, 4, 9, tsi.SWITCH_RIGHT);
}
}
if (sEvent.getXpos() == 1 && sEvent.getYpos() == 11) {
if (headingNorth) {
leaveSection(5);
} else {
enterAtTrackSplit(5, 3, 11, tsi.SWITCH_LEFT, tsi.SWITCH_RIGHT);
}
}
if (sEvent.getXpos() == 4 && sEvent.getYpos() == 13) {
if (headingNorth) {
enterSectionAndSwitch(4, 3, 11, tsi.SWITCH_RIGHT);
} else {
leaveSection(4);
}
}
if (sEvent.getXpos() == 10 && sEvent.getYpos() == 7) {
if (headingNorth) {
enterSection(1);
} else {
leaveSection(1);
}
}
if (sEvent.getXpos() == 10 && sEvent.getYpos() == 8) {
if (headingNorth) {
enterSection(1);
} else {
leaveSection(1);
}
}
if (sEvent.getXpos() == 6 && sEvent.getYpos() == 7) {
if (headingNorth) {
leaveSection(1);
} else {
enterSection(1);
}
}
if (sEvent.getXpos() == 8 && sEvent.getYpos() == 5) {
if (headingNorth) {
leaveSection(1);
} else {
enterSection(1);
}
}
if (sEvent.getXpos() == 12 && sEvent.getYpos() == 9) {
if (headingNorth) {
enterSectionAndSwitch(2, 15, 9, tsi.SWITCH_RIGHT);
} else {
leaveSection(2);
}
}
if ((sEvent.getXpos() == 19 && sEvent.getYpos() == 7)) {
if (headingNorth) {
enterAtTrackSplit(0, 17, 7, tsi.SWITCH_RIGHT, tsi.SWITCH_LEFT);
} else {
leaveSection(0);
}
}
}
}
} catch (CommandException e) {
e.printStackTrace();
System.exit(1);
} catch (InterruptedException e) {
e.printStackTrace();
System.exit(1);
}
}
/**
* Train enters a critical section. Will acquire the semaphore corresponding to the section.
*
* @param sectionId The id of the section/semaphore
* @throws CommandException Fails to set speed
* @throws InterruptedException Fails to acquire semaphore
*/
private void enterSection(int sectionId) throws CommandException, InterruptedException {
tsi.setSpeed(id, 0);
sem[sectionId].acquire();
tsi.setSpeed(id, speed);
hasSemaphore[sectionId] = true;
}
/**
* Train enters a critical section and changes orientation of a switch.
* Will acquire the semaphore corresponding to the section.
*
* @param sectionId The id of the section/semaphore
* @param x The x-position of the switch
* @param y The y-position of the switch
* @param switchOrientation Orientation of the switch
* @throws CommandException Fails to set speed or switch
* @throws InterruptedException Fails to acquire semaphore
*/
private void enterSectionAndSwitch(int sectionId, int x, int y, int switchOrientation) throws CommandException, InterruptedException {
enterSection(sectionId);
tsi.setSwitch(x, y, switchOrientation);
}
/**
* Train needs to choose track depending on if one of the tracks are occupied.
* Will acquire the semaphore corresponding to the section if the default track is availible.
*
* @param sectionId The id of the section/semaphore
* @param x The x-position of the switch
* @param y The y-position of the switch
* @param firstChoiceSwitch Orientation of switch if train is allowed to travel the default way
* @param secondChoiceSwitch Orientation of switch otherwise
* @throws CommandException Fails to set switch
*/
private void enterAtTrackSplit(int sectionId, int x, int y, int firstChoiceSwitch, int secondChoiceSwitch) throws CommandException {
if (sem[sectionId].tryAcquire()) {
hasSemaphore[sectionId] = true;
tsi.setSwitch(x, y, firstChoiceSwitch);
} else {
tsi.setSwitch(x, y, secondChoiceSwitch);
}
}
/**
* Train leaves section. Will release the semaphore corresponding to the section.
*
* @param sectionId The id of the section/semaphore
*/
private void leaveSection(int sectionId) {
if (hasSemaphore[sectionId]) {
sem[sectionId].release();
hasSemaphore[sectionId] = false;
}
}
/**
* Changes direction of train e.g. inverts the sign of the velocity.
* Train will first stop before it changes direction.
*
* @throws CommandException Fails to set speed
* @throws InterruptedException Fails to sleep thread
*/
private void changeDir() throws CommandException, InterruptedException {
tsi.setSpeed(id, 0);
this.sleep((long) (1000 + Math.abs(speed) * 20));
speed = -speed;
tsi.setSpeed(id, speed);
if (headingNorth) {
headingNorth = false;
} else {
headingNorth = true;
}
}
}
}
|
package com.atherton.darren.widget.custom;
public interface EventBasedView {
}
|
package com.tencent.mm.plugin.appbrand.game.c;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
class a$a extends Drawable {
Paint fBa;
RectF fBb;
final /* synthetic */ a fBc;
private a$a(a aVar) {
this.fBc = aVar;
this.fBa = new Paint(1);
this.fBb = new RectF();
this.fBa.setColor(-12748166);
this.fBa.setStyle(Style.FILL);
}
/* synthetic */ a$a(a aVar, byte b) {
this(aVar);
}
public final void draw(Canvas canvas) {
float height = ((float) canvas.getHeight()) / 2.0f;
RectF rectF = this.fBb;
this.fBb.top = 0.0f;
rectF.left = 0.0f;
rectF = this.fBb;
float f = height * 2.0f;
this.fBb.bottom = f;
rectF.right = f;
canvas.drawArc(this.fBb, 90.0f, 180.0f, false, this.fBa);
this.fBb.left = ((float) canvas.getWidth()) - (height * 2.0f);
this.fBb.top = 0.0f;
this.fBb.right = (float) canvas.getWidth();
this.fBb.bottom = (float) canvas.getHeight();
canvas.drawArc(this.fBb, -90.0f, 180.0f, false, this.fBa);
canvas.drawRect(height - 1.0f, 0.0f, (((float) this.fBc.getWidth()) - height) + 1.0f, (float) this.fBc.getHeight(), this.fBa);
}
public final void setAlpha(int i) {
}
public final void setColorFilter(ColorFilter colorFilter) {
}
public final int getOpacity() {
return -1;
}
}
|
package Actions;
import model.User;
import DAO.*;
import com.opensymphony.xwork2.ActionSupport;;
@SuppressWarnings("serial")
public class LoginAction extends ActionSupport {
private User user;
private IUserDAO udao = new UserDAO();
public String execute() throws Exception
{
TestDAO tes = new TestDAO();
//tes.test();
//User ur = udao.getUser("mjx");
if(udao.isValidUser(user.getUserName(),user.getUserPWD()))
{
addActionMessage("mjx");
return SUCCESS;
}
else
{
addActionMessage("failed");
return ERROR;
}
}
public User getUser()
{
return user;
}
public void setUser(User user)
{
this.user = user;
}
}
|
package com.earaya.voodoo.config;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.MappingJsonFactory;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import java.io.File;
import java.io.IOException;
public class JsonConfigReader {
private static final JsonFactory JSON_FACTORY;
private static final ObjectMapper JSON_MAPPER;
static {
JSON_FACTORY = new MappingJsonFactory();
JSON_FACTORY.enable(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT);
JSON_FACTORY.enable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
JSON_FACTORY.enable(JsonGenerator.Feature.QUOTE_FIELD_NAMES);
JSON_FACTORY.enable(JsonParser.Feature.ALLOW_COMMENTS);
JSON_FACTORY.enable(JsonParser.Feature.AUTO_CLOSE_SOURCE);
JSON_MAPPER = (ObjectMapper) JSON_FACTORY.getCodec();
JSON_MAPPER.disable(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES);
JSON_MAPPER.disable(DeserializationConfig.Feature.READ_ENUMS_USING_TO_STRING);
}
/**
* Deserializes the given {@link File} as an instance of the given type.
*
* @param src a JSON {@link File}
* @param valueType the {@link Class} to deserialize {@code src} as
* @param <T> the type of {@code valueType}
* @return the contents of {@code src} as an instance of {@code T}
* @throws IOException if there is an error reading from {@code src} or parsing its contents
*/
public static <T> T readValue(File src, Class<T> valueType) throws IOException {
return JSON_MAPPER.readValue(src, valueType);
}
/**
* Deserializes the given {@link JsonNode} as an instance of the given type.
*
* @param root a {@link JsonNode}
* @param klass a {@link TypeReference} of the type to deserialize {@code src} as
* @param <T> the type of {@code valueTypeRef}
* @return the contents of {@code src} as an instance of {@code T}
* @throws IOException if there is an error mapping {@code src} to {@code T}
*/
public static <T> T readValue(JsonNode root, Class<T> klass) throws IOException {
return JSON_MAPPER.readValue(root, klass);
}
}
|
package test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import util.ParseMessage;
import util.StringComparison;
/**
* Продолжение идеи Test6 что строить рекурсивно дерево из lcSubstring-ов. Тогда шаблон будет иметь вид {&}lcSubstring{&}lcSubstring{&}...{&}
*
*/
public class Test14 {
public static void main(String[] args) {
List<String> similarStrings = Arrays.asList(new String[]{
" {sophos_internal_id}: host gmail-smtp-in.l.google.com[64.233.164.27] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 1si9232024lfi.103 - gsmtp (in reply to RCPT TO command)",
" {sophos_internal_id}: host gmail-smtp-in.l.google.com[64.233.164.27] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 jn4si9227864lbc.203 - gsmtp (in reply to RCPT TO command)",
// {sophos_internal_id}: {&}o{&}s{&}t{&}gmail-smtp-in.l.google.com[{&}3.{&}1.{&}2{&}7{&}] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 {&}si{&}.{&} - gsmtp (in reply to RCPT TO command){&}
// {sophos_internal_id}: {&}o{&}s{&}t{&}gmail-smtp-in.l.google.com[{&}3.{&}1.{&}2{&}7{&}] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 {&}si{&}.{&} - gsmtp (in reply to RCPT TO command){&}
" {sophos_internal_id}: to=<su.p.e.r.v.iso.r.20.1.5.invino@gmail.com>, relay=alt1.gmail-smtp-in.l.google.com[74.125.23.26]:25, delay=264, delays=262/0/1.6/0.94, dsn=4.2.1, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.23.26] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 r9si11244175ioi.12 - gsmtp (in reply to RCPT TO command))",
" {sophos_internal_id}: host gmail-smtp-in.l.google.com[173.194.71.27] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 192si9255066lfh.71 - gsmtp (in reply to RCPT TO command)",
" {sophos_internal_id}: to=<su.p.e.r.v.iso.r.20.1.5.invino@gmail.com>, relay=alt1.gmail-smtp-in.l.google.com[74.125.23.26]:25, delay=624, delays=622/0.01/1.4/0.94, dsn=4.2.1, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.23.26] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 72si20143688iob.61 - gsmtp (in reply to RCPT TO command))",
" {sophos_internal_id}: host gmail-smtp-in.l.google.com[64.233.163.27] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 dx2si8644490lbc.94 - gsmtp (in reply to RCPT TO command)",
" {sophos_internal_id}: to=<su.p.e.r.v.iso.r.20.1.5.invino@gmail.com>, relay=alt1.gmail-smtp-in.l.google.com[74.125.203.27]:25, delay=1345, delays=1342/0/1.3/0.94, dsn=4.2.1, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.203.27] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 e97si20700057ioi.206 - gsmtp (in reply to RCPT TO command))"
});
// template =" {sophos_internal_id}: {&}o{&}s{&}t{&}gmail-smtp-in.l.google.com[{&}3.{&}1.{&}2{&}7{&}] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 {&}si{&}.{&} - gsmtp (in reply to RCPT TO command){&}"
// {sophos_internal_id}: {&}o{&}s{&}t{&}gmail-smtp-in.l.google.com[{&}3.{&}1.{&}2{&}7{&}] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 {&}si{&}.{&} - gsmtp (in reply to RCPT TO command){&}
// TEST CASES
/*
List<String> similarStrings = Arrays.asList(new String[]{
" {sophos_internal_id}: from=<{email_address}>, size={size}, nrcpt=1 (queue active)",
" {sophos_internal_id}: from=<prvs={prvs}={email_address}>, size={size}, nrcpt=1 (queue active)"
});
// template = " {sophos_internal_id}: from=<{&}{email_address}>, size={size}, nrcpt=1 (queue active)"
*/
/*
List<String> similarStrings = Arrays.asList(new String[]{
" connect from localhost.localdomain[127.0.0.1]",
" disconnect from localhost.localdomain[127.0.0.1]"
});
// template = " {&}connect from localhost.localdomain[127.0.0.1]"
*/
// System.out.println("united template: "+ test3(similarStrings));
String template = " {sophos_internal_id}: {&}o{&}s{&}t{&}gmail-smtp-in.l.google.com[{&}3.{&}1.{&}2{&}7{&}] said: 450-4.2.1 The user you are trying to contact is receiving mail at a rate that 450-4.2.1 prevents additional messages from being delivered. Please resend your 450-4.2.1 message at a later time. If the user is able to receive mail at that 450-4.2.1 time, your message will be delivered. For more information, please 450-4.2.1 visit 450 4.2.1 https://support.google.com/mail/answer/6592 {&}si{&}.{&} - gsmtp (in reply to RCPT TO command){&}";
Pattern pattern = ParseMessage.buildPatternWithUnnamedPlaceholders(template);
if(matchesAll(pattern, similarStrings)){
System.out.println("matches all");
} else {
System.out.println("doesn't match");
}
}
private static List<String> buildLeftSubstrings(List<String> strings, String lcSubstring){
List<String> leftSubstrings = new ArrayList<String>(strings.size());
int index;
for(String s: strings){
index = s.indexOf(lcSubstring);
leftSubstrings.add(s.substring(0, index));
}
return leftSubstrings;
}
private static List<String> buildRightSubstrings(List<String> strings, String lcSubstring){
List<String> rightSubstrings = new ArrayList<String>(strings.size());
int index;
for(String s: strings){
index = s.indexOf(lcSubstring);
index +=lcSubstring.length();
rightSubstrings.add(s.substring(index, s.length()));
}
return rightSubstrings;
}
private static String test3(List<String> similarStrings){
String lcSubsequence = getLongestCommonSubsequenceForStringGroup(similarStrings);
StringBuilder sb = new StringBuilder();
buildTemplateRecursively(similarStrings, lcSubsequence, sb);
// Сюда вернётся шаблон без завершающего {&}
// Теперь тестовая проверка, сможет ли разобрать без переднего и заднего плейсхолдера
// чтобы их не пихать во все шаблоны
Pattern pattern = ParseMessage.buildPatternWithUnnamedPlaceholders(sb.toString());
if(!matchesAll(pattern, similarStrings)){
System.out.println("doesn't match without trailing {&}");
sb.append("{&}");
}
sb.delete(0, 3);
System.out.println("removed pre-placeholder: \""+ sb.toString() +"\"");
pattern = ParseMessage.buildPatternWithUnnamedPlaceholders(sb.toString());
if(!matchesAll(pattern, similarStrings)){
System.out.println("doesn't match without leading {&}");
sb.insert(0, "{&}");
}
System.out.println("final match");
pattern = ParseMessage.buildPatternWithUnnamedPlaceholders(sb.toString());
if(matchesAll(pattern, similarStrings)){
System.out.println("matches all");
} else {
System.out.println("doesn't match");
}
return sb.toString();
}
private static void buildTemplateRecursively(List<String> similarStrings, String lcSubsequence, StringBuilder sb){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("current string list:");
for(String s: similarStrings){
System.out.println(s);
}
System.out.println("current lcSubsequence: \"" + lcSubsequence + "\"");
String lcSubstring = getLongestCommonSubstringForStringGroupAndLCS(similarStrings, lcSubsequence);
System.out.println("current lcSubstring: \"" + lcSubstring + "\"");
int index;
if(lcSubstring.isEmpty()){
System.out.println("lcSubstring is empty");
sb.append("{&}");
sb.append(lcSubsequence);
System.out.println("current template: \""+sb.toString()+"\"");
return;
}else if(lcSubstring.length()==1){
System.out.println("lcSubstring is 1 symbol long!");
for(int i=0; i<lcSubsequence.length(); i++){
sb.append("{&}");
sb.append(lcSubsequence.charAt(i));
}
System.out.println("current template: \""+sb.toString()+"\"");
System.out.println();
return;
} else {
index = lcSubsequence.indexOf(lcSubstring);
}
System.out.println("current index of lcSubstring in lcSubsequence: "+ index);
String left = lcSubsequence.substring(0, index);
System.out.println("current left: \""+ left + "\"");
String right = lcSubsequence.substring(index+lcSubstring.length(), lcSubsequence.length());
System.out.println("current right: \""+ right + "\"");
System.out.println();
if(!left.isEmpty()){
buildTemplateRecursively(buildLeftSubstrings(similarStrings, lcSubstring), left, sb);
}
sb.append("{&}");
sb.append(lcSubstring);
System.out.println("current template: \""+sb.toString()+"\"");
if(!right.isEmpty()){
// buildTemplateRecursively(similarStrings, right, sb);
buildTemplateRecursively(buildRightSubstrings(similarStrings, lcSubstring), right, sb);
}
}
private static String getLongestCommonSubsequenceForStringGroup(List<String> similarStrings){
if(similarStrings == null || similarStrings.isEmpty()){
throw new IllegalArgumentException("similarStrings shouldn't be null or empty");
}
String lcs = similarStrings.get(0);
for(String s: similarStrings){
lcs = StringComparison.computeLCSubsequence(s, lcs);
}
return lcs;
}
private static String getLongestCommonSubstringForStringGroupAndLCS(List<String> similarStrings, String lcSubsequence){
String lcs = lcSubsequence;
for(String s: similarStrings){
lcs = StringComparison.computeLCSubsting(s, lcs);
}
return lcs;
}
private static boolean matchesAll(Pattern pattern, List<String> similarStrings){
for(String s: similarStrings){
if(!pattern.matcher(s).matches()){
System.out.println("match fails at: "+s);
return false;
}
}
return true;
}
}
|
package unocerounocero;
import java.awt.Color;
public class Colores {
public static Color[] color;
public final static int ORANGE=1;
public final static int YELLOW=2;
public final static int GREEN=3;
public final static int RED=4;
public final static int MAGENTA=5;
public final static int PINK=6;
public final static int WHITE=7;
public final static int CYAN=8;
public final static int BLACK=9;
public final static int BLUE=10;
public Colores() {
color = new Color[11];
color[0]=Color.LIGHT_GRAY;
color[1]=Color.ORANGE;
color[2]=Color.YELLOW;
color[3]=Color.GREEN;
color[4]=Color.RED;
color[5]=Color.MAGENTA;
color[6]=Color.PINK;
color[7]=Color.WHITE;
color[8]=Color.CYAN;
color[9]=Color.BLACK;
color[10]=Color.BLUE;
}
public static int indice (Color c) {
for (int i=1;i<color.length;i++)
if (color[i].equals(c))
return i;
return -1;
}
}
|
package com.zznode.opentnms.isearch.routeAlgorithm.core.cache;
public class MemcachedInfo {
private String address;
private String bytes;
private String version;
private String time;
private String threads;
private String limitMaxBytes;
private String bytesRead;
private String bytesWritten;
private String currConnections;
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBytes() {
return bytes;
}
public void setBytes(String bytes) {
this.bytes = bytes;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getThreads() {
return threads;
}
public void setThreads(String threads) {
this.threads = threads;
}
public String getLimitMaxBytes() {
return limitMaxBytes;
}
public void setLimitMaxBytes(String limitMaxBytes) {
this.limitMaxBytes = limitMaxBytes;
}
public String getBytesRead() {
return bytesRead;
}
public void setBytesRead(String bytesRead) {
this.bytesRead = bytesRead;
}
public String getBytesWritten() {
return bytesWritten;
}
public void setBytesWritten(String bytesWritten) {
this.bytesWritten = bytesWritten;
}
public String getCurrConnections() {
return currConnections;
}
public void setCurrConnections(String currConnections) {
this.currConnections = currConnections;
}
}
|
package com.xingen.calendarview.touch;
import android.view.MotionEvent;
/**
* Created by ${xinGen} on 2018/1/2.
* blog:http://blog.csdn.net/hexingen
* View的touch事件处理类
*/
public interface ViewTouchHandler {
/**
* 处理触摸事件
* @param event
*/
void handleEvent(MotionEvent event);
}
|
package com.cnk.travelogix.sapintegrations.chargeable.itemcharging.data;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for AccountOperation complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AccountOperation">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="type" type="{http://schema.charging.ws.highdeal.com/}AccountOperationType"/>
* <element name="amount" type="{http://schema.ws.highdeal.com/}Amount" minOccurs="0"/>
* <element name="netAmount" type="{http://schema.ws.highdeal.com/}Amount" minOccurs="0"/>
* <element name="taxAmount" type="{http://schema.ws.highdeal.com/}Amount" minOccurs="0"/>
* <element name="mainAccountReference" type="{http://schema.charging.ws.highdeal.com/}AccountReference" minOccurs="0"/>
* <element name="amountAssignment" type="{http://schema.charging.ws.highdeal.com/}AmountAssignment" maxOccurs="unbounded" minOccurs="0"/>
* <element name="key" type="{http://www.w3.org/2001/XMLSchema}int"/>
* <element name="dependentAccountOperationKey" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AccountOperation", propOrder =
{ "type", "amount", "netAmount", "taxAmount", "mainAccountReference", "amountAssignment", "key", "dependentAccountOperationKey" })
public class AccountOperation
{
@XmlElement(required = true)
@XmlSchemaType(name = "string")
protected AccountOperationType type;
protected Amount amount;
protected Amount netAmount;
protected Amount taxAmount;
protected AccountReference mainAccountReference;
protected List<AmountAssignment> amountAssignment;
protected int key;
protected Integer dependentAccountOperationKey;
/**
* Gets the value of the type property.
*
* @return possible object is {@link AccountOperationType }
*
*/
public AccountOperationType getType()
{
return type;
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is {@link AccountOperationType }
*
*/
public void setType(final AccountOperationType value)
{
this.type = value;
}
/**
* Gets the value of the amount property.
*
* @return possible object is {@link Amount }
*
*/
public Amount getAmount()
{
return amount;
}
/**
* Sets the value of the amount property.
*
* @param value
* allowed object is {@link Amount }
*
*/
public void setAmount(final Amount value)
{
this.amount = value;
}
/**
* Gets the value of the netAmount property.
*
* @return possible object is {@link Amount }
*
*/
public Amount getNetAmount()
{
return netAmount;
}
/**
* Sets the value of the netAmount property.
*
* @param value
* allowed object is {@link Amount }
*
*/
public void setNetAmount(final Amount value)
{
this.netAmount = value;
}
/**
* Gets the value of the taxAmount property.
*
* @return possible object is {@link Amount }
*
*/
public Amount getTaxAmount()
{
return taxAmount;
}
/**
* Sets the value of the taxAmount property.
*
* @param value
* allowed object is {@link Amount }
*
*/
public void setTaxAmount(final Amount value)
{
this.taxAmount = value;
}
/**
* Gets the value of the mainAccountReference property.
*
* @return possible object is {@link AccountReference }
*
*/
public AccountReference getMainAccountReference()
{
return mainAccountReference;
}
/**
* Sets the value of the mainAccountReference property.
*
* @param value
* allowed object is {@link AccountReference }
*
*/
public void setMainAccountReference(final AccountReference value)
{
this.mainAccountReference = value;
}
/**
* Gets the value of the amountAssignment property.
*
* <p>
* This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to
* the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for
* the amountAssignment property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getAmountAssignment().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list {@link AmountAssignment }
*
*
*/
public List<AmountAssignment> getAmountAssignment()
{
if (amountAssignment == null)
{
amountAssignment = new ArrayList<AmountAssignment>();
}
return this.amountAssignment;
}
/**
* Gets the value of the key property.
*
*/
public int getKey()
{
return key;
}
/**
* Sets the value of the key property.
*
*/
public void setKey(final int value)
{
this.key = value;
}
/**
* Gets the value of the dependentAccountOperationKey property.
*
* @return possible object is {@link Integer }
*
*/
public Integer getDependentAccountOperationKey()
{
return dependentAccountOperationKey;
}
/**
* Sets the value of the dependentAccountOperationKey property.
*
* @param value
* allowed object is {@link Integer }
*
*/
public void setDependentAccountOperationKey(final Integer value)
{
this.dependentAccountOperationKey = value;
}
}
|
package com.company;
public class CourseList { //özelliik nesneleri tanımlandı
int id;
String Cname;
String detail;
public CourseList(int id , String Cname , String detail){
this.id = id;
this.Cname = Cname;
this.detail = detail;
}
}
|
package grafico;
/**
*
* @author Adriana
*/
public interface VehiculoAereo {
public void volar();
}
|
package real;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
public class Flipkart extends MyBaseTest{
@Test
public void search() throws InterruptedException{
driver.findElement(By.name("field-keywords")).sendKeys("sprays for men");
Thread.sleep(5000);
}
@Test
public void moveelement() throws InterruptedException{
WebElement e = driver.findElement(By.linkText("Amazon Pay"));
Actions a = new Actions(driver);
a.moveToElement(e).build().perform();
Thread.sleep(5000);
}
@Test
public void shop() throws InterruptedException{
WebElement e = (driver.findElement(By.xpath("//span[contains(text(),'Category')]")));
Actions a = new Actions(driver);
a.click(e).build().perform();
Thread.sleep(5000);
}
@Test
public void doublec() throws InterruptedException{
WebElement e = driver.findElement(By.linkText("Today's Deals"));
Actions a = new Actions(driver);
a.doubleClick(e).build().perform();
Thread.sleep(5000);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.