text
stringlengths
10
2.72M
package com.showdy.hotfix; import android.app.Application; import android.content.Context; import java.io.File; public class FixApplication extends Application { @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); HotFix.installPatch(this,new File("/sdcard/patch.jar")); } }
package br.com.desafio.repositories; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import br.com.desafio.models.SalaEventoEntity; /** * Utilizado JpaRepository para facilitar as operações ao Banco de Dados. * */ @Repository public interface SalaEventoRepository extends JpaRepository<SalaEventoEntity,Integer> { }
package com.soap.springboot.entity; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; @Entity @Table(name="soap_author") public class AuthorEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue private long authorId; private String firstname; private String lastname; public AuthorEntity(){ } public AuthorEntity(String firstname, String lastname) { this.firstname = firstname; this.lastname = lastname; } public long getAuthorId() { return authorId; } public void setAuthorId(long authorId) { this.authorId = authorId; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } }
package com.company; public abstract class AnimalComponent { public void add(AnimalComponent newAnimalComponent) { throw new UnsupportedOperationException(); } public void remove(AnimalComponent newAnimalComponent) { throw new UnsupportedOperationException(); } public AnimalComponent getAnimalComponent(int componentIndex) { throw new UnsupportedOperationException(); } public String getAnimalName() { throw new UnsupportedOperationException(); } public void displayAnimalInformation() { throw new UnsupportedOperationException(); } }
package english.parser.implementations.map; import include.learning.perceptron.PackedScoreMap; import include.linguistics.english.ETagSet2; @SuppressWarnings("serial") public final class ETagSet2Map extends PackedScoreMap<ETagSet2> { public ETagSet2Map(final String input_name, final int table_size) { super(input_name, table_size); } @Override public ETagSet2 loadKeyFromString(final String str) { ETagSet2 ts = new ETagSet2(); ts.load(str); return ts; } @Override public String generateStringFromKey(final ETagSet2 key) { return "[ " + key.toString() + " ]"; } @Override public ETagSet2 allocate_key(final ETagSet2 key) { return new ETagSet2(key); } }
package pl.ark.chr.buginator.service; import pl.ark.chr.buginator.domain.BaseEntity; import pl.ark.chr.buginator.domain.auth.UserApplication; import pl.ark.chr.buginator.persistence.security.FilterData; import pl.ark.chr.buginator.app.exceptions.DataAccessException; import java.util.List; import java.util.Set; /** * Created by Arek on 2017-01-18. */ public interface RestrictedAccessCrudService<T extends BaseEntity & FilterData> { T save(T t, Set<UserApplication> userApplications) throws DataAccessException; T get(Long id, Set<UserApplication> userApplications) throws DataAccessException; List<T> getAllByApplication(Long appId, Set<UserApplication> userApplications) throws DataAccessException; void delete(Long id, Set<UserApplication> userApplications) throws DataAccessException; }
package net.ostree.swing; import java.awt.Color; import java.awt.BorderLayout; import java.awt.event.*; import javax.swing.*; public class Login2 { public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } static void createAndShowGUI() { ////////////////////////////////////////////////////////////// loginWindow = new JFrame("登录信息"); loginWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); loginWindow.setBounds(350,350,250,200); loginWindow.setResizable(false); JPanel usernamePanel = new JPanel(); usernamePanel.add(new JLabel("用户名:",JLabel.CENTER)); usernamePanel.add(usernameField); JPanel passwordPanel = new JPanel(); passwordPanel.add(new JLabel("密 码:",JLabel.CENTER)); passwordPanel.add(passwordField); Box box = new Box(BoxLayout.Y_AXIS); box.add(usernamePanel); box.add(passwordPanel); JPanel infoPanel = new JPanel(); infoPanel.add(box); infoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(244,144,44)),"填写登录信息")); JButton submitButton = new JButton("登录"); JButton cancelButton = new JButton("取消"); submitButton.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { String username = usernameField.getText(); String password = passwordField.getText(); if(!username.equals("") && !password.equals("")) { loginWindow.dispose(); mainFrame.getContentPane().add(new JLabel("用户名:"+username+" 密码是:"+password,JLabel.CENTER)); mainFrame.setVisible(true); } else { JOptionPane.showMessageDialog(null,"用户名和密码不能为空","提示",JOptionPane.WARNING_MESSAGE); System.exit(1); } } }); cancelButton.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { System.exit(0); } }); JPanel buttonPanel = new JPanel(); buttonPanel.add(submitButton); buttonPanel.add(cancelButton); loginWindow.getContentPane().add(infoPanel,BorderLayout.CENTER); loginWindow.getContentPane().add(buttonPanel,BorderLayout.SOUTH); loginWindow.getContentPane().add(new JPanel(),BorderLayout.EAST); loginWindow.getContentPane().add(new JPanel(),BorderLayout.WEST); loginWindow.setVisible(true); ///////////////////////////////////////////////////////////////// mainFrame = new JFrame(); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setBounds(250,250,400,300); mainFrame.setVisible(false); } static JFrame loginWindow,mainFrame; static final JTextField usernameField = new JTextField(10); static final JPasswordField passwordField = new JPasswordField(10); }
package gui; import interaction.Interaction; import javax.swing.*; import java.awt.*; import java.io.*; import static logic.Type.*; public class Settings implements Serializable { static private final String fileAddress = "src\\main\\resources\\settings.txt"; static public MainDisplay topDisplay = new MainDisplay( new Font("Sans-Serif", Font.PLAIN, 10), new Rectangle( 0, 0, (Settings.tile << 2) - (Settings.tile >> 2), Settings.tile / 3), SwingConstants.CENTER), bottomDisplay = new MainDisplay( new Font("Sans-Serif", Font.PLAIN, 14), new Rectangle( 0, Settings.tile / 3, (Settings.tile << 2) - (Settings.tile >> 2), (Settings.tile / 3) << 1), SwingConstants.CENTER); static public Button[] basicCalculator = { new Button(Interaction.CLEAR, null, 'C'), // 0 new Button(Interaction.ADD_TO_QUEUE, EXPONENT, '^'), // 1 new Button(Interaction.ADD_TO_QUEUE, ROOT, '√'), // 2 new Button(Interaction.ADD_TO_QUEUE, MULTIPLY, '*'), // 3 new Button(Interaction.ADD_TO_PARSER, VALUE, '7'), // 4 new Button(Interaction.ADD_TO_PARSER, VALUE, '8'), // 5 new Button(Interaction.ADD_TO_PARSER, VALUE, '9'), // 6 new Button(Interaction.ADD_TO_QUEUE, DIVIDE, '/'), // 7 new Button(Interaction.ADD_TO_PARSER, VALUE, '4'), // 8 new Button(Interaction.ADD_TO_PARSER, VALUE, '5'), // 9 new Button(Interaction.ADD_TO_PARSER, VALUE, '6'), // 10 new Button(Interaction.ADD_TO_QUEUE, ADD, '+'), // 11 new Button(Interaction.ADD_TO_PARSER, VALUE, '1'), // 12 new Button(Interaction.ADD_TO_PARSER, VALUE, '2'), // 13 new Button(Interaction.ADD_TO_PARSER, VALUE, '3'), // 14 new Button(Interaction.ADD_TO_QUEUE, SUBTRACT, '-'), // 15 new Button(Interaction.SWITCH_SIGN, null, '∓'), // 16 new Button(Interaction.ADD_TO_PARSER, VALUE, '0'), // 17 new Button(Interaction.ADD_TO_PARSER, VALUE, '.'), // 18 new Button(Interaction.SOLVE, EVALUATE, '=')}; // 19 static public int tile = 60, buttonRowLength = 4, windowDefaultCloseOperation = JFrame.DO_NOTHING_ON_CLOSE; public Point windowAnchor = new Point(200, 200); public boolean windowResizable = false; // -------------------------------------------------------------------------------------------------------------------- public Settings() { } // -------------------------------------------------------------------------------------------------------------------- static public Settings readSettings() { Settings cache = new Settings(); try { FileInputStream fis = new FileInputStream(fileAddress); ObjectInputStream ois = new ObjectInputStream(fis); cache = (Settings) ois.readObject(); } catch (Exception e) { e.printStackTrace(); } return cache; } public void writeSettings(Point windowNewAnchor) { setWindowAnchor(windowNewAnchor); try { FileOutputStream fos = new FileOutputStream(fileAddress); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(this); oos.close(); fos.close(); } catch (Exception f) { f.printStackTrace(); } } void setWindowAnchor(Point windowNewAnchor) { this.windowAnchor = windowNewAnchor; } }
package cpracticeB; public class a14 { public static void main(String[] args) { printPay(10.00, 40); printPay(10.00, 50); printPay(7.50, 38); printPay(8.50, 66); } // 시급과 일한 시간을 입력받아, 주급을 출력 public static void printPay(double basePay, int hours) { double pay = 0.0; double overtime = 0; /* 해당 메소드를 완성하세요. */ if (basePay < 8) { System.out.println("최저 시급 에러!"); } else if (hours > 60) { System.out.println("초과 근무시간 에러!"); } else if (hours > 40) { overtime = hours - 40; pay = basePay * 40 + basePay * 1.5 * overtime; System.out.printf("$ %.2f\n", pay); } else { pay = basePay * hours; System.out.printf("$ %.2f\n", pay); } } }
package com.spbsu.flamestream.core.graph; import java.io.Serializable; import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; public interface SerializableToLongFunction<T> extends Serializable, ToLongFunction<T> {}
package k2.event; import k2.valueobject.GameId; import k2.valueobject.PawnColor; public class PassedEvent { private final GameId gameId; private final PawnColor player; public PassedEvent(GameId gameId, PawnColor player) { this.gameId = gameId; this.player = player; } public PawnColor getPlayer() { return player; } }
package info.ntek.clock.adapters; import android.support.v4.view.PagerAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import info.ntek.R; import info.ntek.gsp.data.time.HourItem; import java.util.ArrayList; /** * @author Milos Milanovic */ public class ViewPagerAdapter extends PagerAdapter { private ArrayList<HourItem> mItems = null; @Override public Object instantiateItem(ViewGroup collection, int position) { View lView = LayoutInflater.from(collection.getContext()) .inflate(R.layout.layout_viewpager_item, collection, false); collection.addView(lView); setUpView(lView, position); return lView; } @Override public void destroyItem(ViewGroup collection, int position, Object view) { collection.removeView((View) view); view = null; } @Override public int getCount() { return mItems != null ? mItems.size() : 0; } @Override public boolean isViewFromObject(View view, Object object) { return ((View) object).equals(view); } private void setUpView(View view, int position) { ((TextView) view.findViewById(R.id.times)).setText(" " + mItems.get(position).toString()); } public void addItems(ArrayList items) { mItems = items; notifyDataSetChanged(); } public ArrayList<HourItem> getItems() { return mItems; } }
package com.gameassist.plugin.worms3.app; import android.util.Log; import android.view.View; import com.gameassist.plugin.ClassLoaderCallback; import com.gameassist.plugin.Plugin; import java.lang.reflect.Constructor; import java.lang.reflect.Field; public class PluginEntry extends Plugin { private static final String LIB_HOOK_PLUGIN = "myworms3"; private View pluginView; private static PluginEntry instance; public static PluginEntry getInstance() { return instance; } @Override public boolean OnPluginCreate() { Log.i("hook_OnPluginCreate","begin_111"); /* ClassLoader loader=getTargetApplication().getClassLoader(); try{ Class c= loader.loadClass("android.taobao.util.TaoLog"); //修改属性 Constructor c1 = c.getConstructor(); Object obj= c1.newInstance(); Field field=c.getDeclaredField("isPrintLog"); field.setAccessible(true); field.setBoolean(obj, true); Log.i("hook_OnPluginCreate","begin_2222"); }catch (Exception e){ }*/ getPluginManager().registerClassLoaderOverride(this, getClass().getClassLoader(), new ClassLoaderCallback() { @Override public boolean shouldOverrideClass(String s) { if(s.equals("android.taobao.util.TaoLog")){ Log.i("hook_OnPluginCreate","begin_2222---"); return true; } return false; } @Override public boolean shouldOverrideResource(String s) { return false; } }); // System.loadLibrary(LIB_HOOK_PLUGIN); instance = this; return false; } public boolean pluginHasUI() { return false; } @Override public void OnPlguinDestroy() { } @Override public void OnPluginUIHide() { } @Override public View OnPluginUIShow() { return pluginView; } }
package com.zhao.rpc.provider; import com.zhao.rpc.config.RpcConfigAbstract; import lombok.Data; @Data public class ProviderConfig extends RpcConfigAbstract { protected Object ref; }
package com.shopify.admin.popup; import java.util.List; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestParam; import com.shopify.admin.AdminData; import com.shopify.admin.seller.AdminSellerData; import com.shopify.common.SpConstants; import com.shopify.shop.ShopData; /** * 관리자 팝업 컨트롤러 * */ @Controller public class AdminNewPopupController { private Logger LOGGER = LoggerFactory.getLogger(AdminNewPopupController.class); /** * 운영관리 > 관리자 등록 Popup * @return */ @GetMapping(value = "/admin/admin/popup/adminNewPop") public String adminList(Model model,HttpSession sess, AdminData admin) { AdminData adminData = (AdminData) sess.getAttribute(SpConstants.ADMIN_SESSION_KEY); return "/admin/popup/popAdminNew"; } /** * 관리자 > 셀러관리 > 랭크수정 Popup * @return */ @GetMapping(value = "/admin/popup/seller/popSellerRank") public String adminSellerRank(Model model, AdminSellerData setting, HttpSession sess , @RequestParam(value = "email", required = false, defaultValue = "") String email , @RequestParam(value = "rankId", required = false, defaultValue = "") String rankId , @RequestParam(value = "shopStatus", required = false, defaultValue = "") String shopStatus , @RequestParam(value = "paymentMethod", required = false, defaultValue = "") String paymentMethod ) { setting.setEmail(email); setting.setRankId(rankId); setting.setShopStatus(shopStatus); setting.setPaymentMethod(paymentMethod); model.addAttribute("seller", setting); return "/admin/popup/popSellerRank"; } }
package com.tencent.mm.graphics.b; import android.content.Context; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.Timer; public enum d { ; public boolean bgH; public Timer bno; public WeakReference<Context> djp; public HashMap<Integer, a> djq; public final Object djr; private d(String str) { this.djp = null; this.djq = new HashMap(); this.bgH = false; this.bno = null; this.djr = new Object(); } public final void Cl() { synchronized (this.djr) { if (this.bgH) { if (this.bno != null) { this.bno.cancel(); } this.bgH = false; return; } } } }
package org.campustalk.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.campustalk.Settings; /** * Servlet implementation class UserLogout */ @WebServlet("/Logout") public class UserLogout extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public UserLogout() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub HttpSession session = request.getSession(true); session.invalidate(); Cookie[] c = request.getCookies(); if (c != null) { for (int i = 0; i < c.length; i++) { Cookie curr = c[i]; String cnm = curr.getName(); if (cnm.equalsIgnoreCase("CampusTalkLogedIn")) { curr.setMaxAge(0); response.addCookie(curr); } } } response.sendRedirect(Settings.APPURL); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } }
package ftp.server; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.io.OutputStreamWriter; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.ServerSocket; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; /** * Alberto Mur & Javier Antoran. */ public class HandleList extends HandleFTPConnection{ private File f; public HandleList(File f, int lPort, InetAddress rHost, int rPort) throws Exception{ super(lPort, rHost, rPort); this.f = f; } private void sendList(Path dir) { try { DirectoryStream<Path> list = Files.newDirectoryStream(dir); String filename; for (Path entry : list) { if (! Files.isDirectory(entry)) { filename = entry.getFileName().toString(); } else { filename = "(dir) " + entry.getFileName().toString(); } this.out.write(new String(filename + "\t" + Files.size(entry) + "\n").getBytes()); } this.out.flush(); } catch (IOException e) { System.out.println(e.getMessage()); } } public void run() { System.out.println("FTP Listing handler launched." ); try { establishTCP(); Path dir = Paths.get(this.f.getAbsolutePath()); sendList(dir); this.out.close(); this.clientSocket.close(); this.welcomingSocket.close(); sendUDPOK(null); } catch (Exception e) { System.out.println(e.getMessage()); } } }
package ccc; public class Test { public static void main(String[] args) { int i=9; if(i==9){ System.out.println("first programs to be pushed on the git hub repository from eclipse"); } } }
/** * * Bank Account.java * TCSS-143 - Summer 2019 * Assignment 4 * Subclass for BankAccount.java */ /** * This class is a subclass of BankAccount.java super class: AccountTester.java * The class do different implementations similar to the bankaccount class * This class sets a new boolean filed myStatusActivity - which shall be true when balance greater than 25$ * This class makes deposit/withdraw and calculate balance as the BankAccount.java does * * @author Adam Shandi * @version July 28 2019 * @university of Washington */ public class SavingsAccount extends BankAccount{ /** Private boolean field myStatusIsActive - false by default*/ private boolean myStatusIsActive; /** final int filed of number 25**/ private static final int TWENTY_FIVE_NUMBER=25; /** final int filed of number 5 **/ private static final int FIVE =5; /** * * CONSTRUCTOR - SavingsAccount constructor that takes two arguments * * @param final String name of the owner - theOwnerName * @param theInterestRate double - the interest rate */ public SavingsAccount(final String theOwnerName, final double theInterestRate){ super(theOwnerName, theInterestRate); if(getBalance()<25){ this.myStatusIsActive=false; } } /** * * Processes deposit into saving account * @param double the amount of money to be deposited - theAmount * @return boolean flag true or false depends on the deposit activity */ @Override public boolean processDeposit(final double theAmount){ boolean flag=super.processDeposit(theAmount); if(getBalance()>TWENTY_FIVE_NUMBER){ this.myStatusIsActive=true; } return flag; } /** * * Processes withdrawal into saving account * @param doouble theAmount of money to be withdrawed * @return boolean flag true or false depends on the on the withdrawal processes */ @Override public boolean processWithdrawal(final double theAmount) { boolean flag=false; if (this.myStatusIsActive) { flag = super.processWithdrawal(theAmount); if (myMonthlyWithdrawCount >= 5) { myMonthlyServiceCharges++; } if (getBalance() < TWENTY_FIVE_NUMBER) { this.myStatusIsActive = false; } } return flag; } /** * * Perform the monthly Processes * @super BankAccount.Java * See the BankAccount class for the details * @return void */ public void performMonthlyProcess( ){ super.performMonthlyProcess(); if(getBalance() >= TWENTY_FIVE_NUMBER) { this.myStatusIsActive = true; } else{ this.myStatusIsActive=false; } } /** * @super toString() method in the bacnkAccount class * see BankAccount.java class for the detailed information * @return String info for the customer the SavingsAccount class objecet */ @Override public String toString(){ return super.toString()+", myStatusIsActive: "+this.myStatusIsActive; } }
package com.array; public class ArrayDebug { public static void main(String[] args) { int[] score = {20,30,40,50,90,70}; int sum = 0; for (int i = 0; i < score.length; ++i) { sum+=score[i]; System.out.println(score[i]); } System.out.println(sum); } }
package com.xrigau.droidcon.espresso.util; public class DeveloperError extends RuntimeException { public DeveloperError(String reason) { super(reason); } }
package club.eridani.cursa.module.modules.client; import club.eridani.cursa.common.annotations.Module; import club.eridani.cursa.common.annotations.Parallel; import club.eridani.cursa.module.Category; import club.eridani.cursa.module.ModuleBase; import club.eridani.cursa.setting.Setting; @Parallel @Module(name = "GUI", category = Category.CLIENT) public class GUI extends ModuleBase { public Setting<Boolean> rainbow = setting("Rainbow",false); public Setting<Float> rainbowSpeed = setting("Rainbow Speed", 1.0f,0.0f,30.0f).whenTrue(rainbow); public Setting<Float> rainbowSaturation = setting("Saturation",0.75f,0.0f,1.0f).whenTrue(rainbow); public Setting<Float> rainbowBrightness = setting("Brightness",0.8f,0.0f,1.0f).whenTrue(rainbow); public Setting<Integer> red = setting("Red",70,0,255).whenFalse(rainbow); public Setting<Integer> green = setting("Green",170,0,255).whenFalse(rainbow); public Setting<Integer> blue = setting("Blue",255,0,255).whenFalse(rainbow); public Setting<Integer> transparency = setting("Transparency",200,0,255); public Setting<Boolean> particle = setting("Particle",true); public Setting<String> background = setting("Background","Shadow",listOf("Shadow","Blur","Both","None")); @Override public void onEnable(){ disable(); } }
package os.nota; abstract class Movimentacao { private String nome; public Movimentacao(String nome) { this.nome = nome; } @Override public String toString() { return nome; } }
package ba.bitcamp.LabS02D04; public class While3i5 { public static void main(String[] args) { System.out.print("Unesite broj: "); int num = TextIO.getInt(); int counter = 1; int counter2 = 1; int counterTrica = 0; int counterPetica = 0; int rezultat = 0; while (counter <= num){ rezultat = counter % 3; counter++; if (rezultat == 0){ counterTrica = counterTrica + 1; } } while (counter2 <= num){ rezultat = counter2 % 5; counter2++; if (rezultat == 0){ counterPetica = counterPetica + 1; } } System.out.println("Djeljivo sa tri brojeva: " + counterTrica); System.out.println("Djeljivo sa pet brojeva: " + counterPetica); } }
package my.app.platform.controller.admin; import my.app.platform.domain.LoginRecord; import my.app.platform.domain.OptionRecord; import my.app.platform.repository.mapper.experiment.IExpInfoDao; import my.app.platform.repository.mapper.log.ILogInfoDao; import my.app.platform.service.StudentService; import my.app.platform.service.TeacherService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpSession; import java.util.List; /** * @author 夏之阳 * 创建时间:2016-04-29 21:11 * 创建说明:管理员界面 */ @Controller @RequestMapping(value = "/admin") public class AdminHomeController { @Autowired private HttpSession session; @Autowired private ILogInfoDao logInfoDao; @Autowired private TeacherService teacherService; @Autowired private StudentService studentService; @Autowired private IExpInfoDao expInfoDao; //首页 @RequestMapping(value = "/home") public String admin(Model model){ String id = session.getAttribute("uid").toString(); String name = session.getAttribute("name").toString(); model.addAttribute("name", name); int t_num = teacherService.getTeacherList().size(); model.addAttribute("t_num",t_num); int s_num = studentService.getStudentList().size(); model.addAttribute("s_num",s_num); int e_num = expInfoDao.queryAllMExp().size(); model.addAttribute("e_num", e_num); List<LoginRecord> loginRecordList = logInfoDao.queryLoginRecord(id); model.addAttribute("login_record",loginRecordList); List<OptionRecord> optionRecordList = logInfoDao.queryOptionRecord(id); model.addAttribute("option_record",optionRecordList); return "/admin/home"; } }
/* * 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 javaassignment1.pkg2015; /** * * @author c0664020 */ public class JavaAssignment12015 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here // System.out.println("Hello World!"); /* *************************** *Assignment #1 *Job title: Jr.Java Developer *http://www.indeed.ca/cmp/Inspired-Staffing-Inc./jobs/Junior-Java-Developer-33c75cda53a56495?q=java+developer * * *Java EE: Java Enterprise Edition - https://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition * *Toronto : $80k *Vancouver: $85k *waterloo : $80k *test */ } }
package ap.cayenne.learning.functions; import org.apache.cayenne.ObjectContext; import org.example.cayenne.persistent.Payment; public class PaymentFunctions { public static Payment createPayment(ObjectContext context){ Payment payment; payment = createPayment(0, context); return payment; } public static Payment createPayment (int amount, ObjectContext context){ Payment payment; payment = context.newObject(Payment.class); payment.setAmount(amount); return payment; } }
package include.linguistics.english; import include.Tuple2; import include.linguistics.english.ESetOfLabels; import english.pos.ETag; public final class ETagESetOfLabels extends Tuple2<ETag, ESetOfLabels> { public ETagESetOfLabels() { super(); } public ETagESetOfLabels(final ETagESetOfLabels tag_tagset) { refer(tag_tagset.m_object1, tag_tagset.m_object2); } public ETagESetOfLabels(final ETag tag, final ESetOfLabels tagset) { super(tag, tagset); } @Override public ETag create_object1(final ETag a) { return a; } @Override public ESetOfLabels create_object2(final ESetOfLabels b) { return b; } }
package com.elvarg.world.entity.combat.magic; import java.util.Arrays; import java.util.Optional; import com.elvarg.util.Misc; import com.elvarg.world.entity.Entity; import com.elvarg.world.entity.impl.Character; import com.elvarg.world.entity.impl.player.Player; import com.elvarg.world.model.Item; import com.elvarg.world.model.MagicSpellbook; import com.elvarg.world.model.Skill; import com.elvarg.world.model.container.impl.Equipment; /** * A parent class represented by any generic spell able to be cast by an * {@link Entity}. * * @author lare96 */ public abstract class Spell { /** * Determines if this spell is able to be cast by the argued {@link Player}. * We do not include {@link Npc}s here since no checks need to be made for * them when they cast a spell. * * @param player * the player casting the spell. * @return <code>true</code> if the spell can be cast by the player, * <code>false</code> otherwise. */ public boolean canCast(Player player, boolean delete) { // We first check the level required. if (player.getSkillManager().getCurrentLevel(Skill.MAGIC) < levelRequired()) { player.getPacketSender().sendMessage( "You need a Magic level of " + levelRequired() + " to cast this spell."); player.getCombat().reset(); return false; } // Secondly we check if they have proper magic spellbook // If not, reset all magic attributes such as current spell // Aswell as autocast spell if(!player.getSpellbook().equals(getSpellbook())) { Autocasting.setAutocast(player, null); player.getCombat().setCastSpell(null); player.getCombat().reset(); return false; } // Then we check the items required. if (itemsRequired(player).isPresent()) { // Suppress the runes based on the staff, we then use the new array // of items that don't include suppressed runes. Item[] items = PlayerMagicStaff.suppressRunes(player, itemsRequired(player).get()); // Now check if we have all of the runes. if (!player.getInventory().containsAll(items)) { // We don't, so we can't cast. player.getPacketSender().sendMessage( "You do not have the required items to cast this spell."); player.getCombat().setCastSpell(null); player.getCombat().reset(); return false; } // Finally, we check the equipment required. if (equipmentRequired(player).isPresent()) { if (!player.getEquipment().containsAll( equipmentRequired(player).get())) { player.getPacketSender().sendMessage( "You do not have the required equipment to cast this spell."); player.getCombat().setCastSpell(null); player.getCombat().reset(); return false; } } //Check staff of the dead and don't delete runes at a rate of 1/8 if(player.getEquipment().getItems()[Equipment.WEAPON_SLOT].getId() == 11791) { if(Misc.getRandom(8) == 1) { player.getPacketSender().sendMessage("Your Staff of the dead negated your runes for this cast."); delete = false; } } // We've made it through the checks, so we have the items and can // remove them now. if(delete) { for(Item it : Arrays.asList(items)) { if(it != null) player.getInventory().delete(it); } } } return true; } public abstract int spellId(); /** * The level required to cast this spell. * * @return the level required to cast this spell. */ public abstract int levelRequired(); /** * The base experience given when this spell is cast. * * @return the base experience given when this spell is cast. */ public abstract int baseExperience(); /** * The items required to cast this spell. * * @param player * the player's inventory to check for these items. * * @return the items required to cast this spell, or <code>null</code> if * there are no items required. */ public abstract Optional<Item[]> itemsRequired(Player player); /** * The equipment required to cast this spell. * * @param player * the player's equipment to check for these items. * * @return the equipment required to cast this spell, or <code>null</code> * if there is no equipment required. */ public abstract Optional<Item[]> equipmentRequired(Player player); /** * The method invoked when the spell is cast. * * @param cast * the entity casting the spell. * @param castOn * the target of the spell. */ public abstract void startCast(Character cast, Character castOn); /** * Returns the spellbook in which this spell is. * @return */ public MagicSpellbook getSpellbook() { return MagicSpellbook.NORMAL; } }
package net.minecraft.entity.passive; import javax.annotation.Nullable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.datafix.DataFixer; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootTableList; public class EntityZombieHorse extends AbstractHorse { public EntityZombieHorse(World p_i47293_1_) { super(p_i47293_1_); } public static void func_190693_b(DataFixer p_190693_0_) { AbstractHorse.func_190683_c(p_190693_0_, EntityZombieHorse.class); } protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(15.0D); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.20000000298023224D); getEntityAttribute(JUMP_STRENGTH).setBaseValue(getModifiedJumpStrength()); } public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; } protected SoundEvent getAmbientSound() { super.getAmbientSound(); return SoundEvents.ENTITY_ZOMBIE_HORSE_AMBIENT; } protected SoundEvent getDeathSound() { super.getDeathSound(); return SoundEvents.ENTITY_ZOMBIE_HORSE_DEATH; } protected SoundEvent getHurtSound(DamageSource p_184601_1_) { super.getHurtSound(p_184601_1_); return SoundEvents.ENTITY_ZOMBIE_HORSE_HURT; } @Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_ZOMBIE_HORSE; } public boolean processInteract(EntityPlayer player, EnumHand hand) { ItemStack itemstack = player.getHeldItem(hand); boolean flag = !itemstack.func_190926_b(); if (flag && itemstack.getItem() == Items.SPAWN_EGG) return super.processInteract(player, hand); if (!isTame()) return false; if (isChild()) return super.processInteract(player, hand); if (player.isSneaking()) { openGUI(player); return true; } if (isBeingRidden()) return super.processInteract(player, hand); if (flag) { if (!isHorseSaddled() && itemstack.getItem() == Items.SADDLE) { openGUI(player); return true; } if (itemstack.interactWithEntity(player, (EntityLivingBase)this, hand)) return true; } mountTo(player); return true; } } /* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraft\entity\passive\EntityZombieHorse.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
package com.checkers.network.client; import com.checkers.server.beans.*; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.util.EntityUtils; import org.codehaus.jackson.map.ObjectMapper; import java.io.*; import java.util.ArrayList; import java.util.Date; import java.util.List; /* * Author Alexey Kuchin * * This class get and return game objects from server * */ public class GameHandler{ public Game game = new Game(); public ListenObjectsHandler listenObjectsHandler = new ListenObjectsHandler(); public User userBlack = new User(); public User userWhite = new User(); private Date date = new Date(); public GameHandler(String inName, String inType, String inBoard, String inDescript){ game.setName(inName); if(inType.length() >= 1){game.setType(inType);} else game.setType(null); if(inBoard.length() >= 1){game.setBoard(inBoard);} else game.setBoard(null); if(inDescript.length() >= 1){game.setDescription(inDescript);} else game.setDescription(null); } public List<Game> getAllGames() throws IOException { //defenition DefaultHttpClient httpclient = NetworkClient.getHttpClient(); BasicHttpContext localcontext = NetworkClient.getLocalContext(); ObjectMapper mapper = new ObjectMapper(); ArrayList<Game> game = new ArrayList<Game>(); //end HttpGet request = new HttpGet(NetworkClient.currLink + "games/"); HttpResponse response = httpclient.execute(request,localcontext); HttpEntity entity = response.getEntity(); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = new String(""); line = rd.readLine(); while (line != null) { StringReader reader = new StringReader(line); try{ for(Game tmpGame : mapper.readValue(reader, Game[].class)) game.add(tmpGame); }catch(Exception e){ reader = new StringReader(line); ExceptionMessage eMsg = mapper.readValue(reader, ExceptionMessage.class); System.out.println("error:"+ eMsg.getCode() +"->" + eMsg.getMessage()); return null; } line = rd.readLine(); } EntityUtils.consume(entity); return game; } //this method get current game public Game getDataNow(long Gauid) throws ClientProtocolException, IOException{ //defenition DefaultHttpClient httpclient = NetworkClient.getHttpClient(); BasicHttpContext localcontext = NetworkClient.getLocalContext(); ObjectMapper mapper = new ObjectMapper(); Game game; //end HttpGet request = new HttpGet(NetworkClient.currLink + "games/" + Long.toString(Gauid)); HttpResponse response = httpclient.execute(request,localcontext); HttpEntity entity = response.getEntity(); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = new String(""); if ((line = rd.readLine()) != null) { StringReader reader = new StringReader(line); try{ game = mapper.readValue(reader, Game.class); return game; }catch(Exception e){ reader = new StringReader(line); ExceptionMessage eMsg = mapper.readValue(reader, ExceptionMessage.class); System.out.println("error:"+ eMsg.getCode() +"->" + eMsg.getMessage()); return null; } } EntityUtils.consume(entity); return null; } public void initCreatedGame(){ listenObjectsHandler.getListenObjects().setGame(NetworkClient.gameH.game); } public ListenObjectsHandler listenGame() throws IOException { long GAUID = NetworkClient.gameH.game.getGauid(); long SUID; try{ SUID = NetworkClient.lastStep.getSuid(); }catch(Exception e){ SUID = Integer.MAX_VALUE; } //if(SUID == null) SUID = Integer.MAX_VALUE; // SUID = Integer.MAX_VALUE; String state = NetworkClient.gameH.game.getState(); System.out.println("GAUID:"+GAUID+";SUID:"+SUID+";state:"+state); DefaultHttpClient httpclient = NetworkClient.getHttpClient(); BasicHttpContext localcontext = NetworkClient.getLocalContext(); StringWriter writer = new StringWriter(); ObjectMapper mapper = new ObjectMapper(); //mapper.writeValue(writer, game); HttpGet get = new HttpGet(NetworkClient.currLink + "games/" + GAUID+"?mode=listen&lastStepSuid="+SUID+"&currentGameState="+state); /*/games/{gauid}?mode=listen&lastStepSuid={suid}&currentGameState={state} */ // StringEntity input = new StringEntity(writer.toString()); //here instead of JSON you can also have XML // input.setContentType("application/json"); //get.set .setEntity(input); HttpResponse response = httpclient.execute(get, localcontext); HttpEntity entity = response.getEntity(); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = new String(""); if ((line = rd.readLine()) != null) { System.out.println("Game handler:"+line); StringReader reader = new StringReader(line); try{ ListenObjectsHandler value = new ListenObjectsHandler(); value.setListenObjects(mapper.readValue(reader, ListenObjects.class)); //game.setGauid(value.getGauid()); //System.out.println("Game handler all ok:"+value.getListenObjects().getGame().getState()); return value; }catch(Exception e){ // Step value = new Step(); try{ NetworkClient.lastStep = mapper.readValue(reader, Step.class); }catch(Exception e1){ System.out.println("Game handler exception:" + e1.getMessage()); reader = new StringReader(line); ExceptionMessage eMsg = mapper.readValue(reader, ExceptionMessage.class); System.out.println("error:"+ eMsg.getCode() +"->" + eMsg.getMessage()); return null; } } } System.out.println("Game hendler exit with null"); EntityUtils.consume(entity); return null; } /* /games/{gauid}?mode=listen&lastStepSuid={suid}&currentGameState={state} */ public Game joinToGame(long GAUID) throws ClientProtocolException, IOException{ DefaultHttpClient httpclient = NetworkClient.getHttpClient(); BasicHttpContext localcontext = NetworkClient.getLocalContext(); StringWriter writer = new StringWriter(); ObjectMapper mapper = new ObjectMapper(); mapper.writeValue(writer, game); HttpPut put = new HttpPut(NetworkClient.currLink + "games/" + GAUID+"?action=join"); StringEntity input = new StringEntity(writer.toString()); //here instead of JSON you can also have XML input.setContentType("application/json"); put.setEntity(input); HttpResponse response = httpclient.execute(put, localcontext); HttpEntity entity = response.getEntity(); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = new String(""); if ((line = rd.readLine()) != null) { StringReader reader = new StringReader(line); Game value = mapper.readValue(reader, Game.class); try{ game.setGauid(value.getGauid()); return value; }catch(Exception e){ reader = new StringReader(line); ExceptionMessage eMsg = mapper.readValue(reader, ExceptionMessage.class); System.out.println("error:"+ eMsg.getCode() +"->" + eMsg.getMessage()); return null; } } EntityUtils.consume(entity); return null; } public Game postDataNow() throws ClientProtocolException, IOException{ DefaultHttpClient httpclient = NetworkClient.getHttpClient(); BasicHttpContext localcontext = NetworkClient.getLocalContext(); StringWriter writer = new StringWriter(); ObjectMapper mapper = new ObjectMapper(); System.out.println("game_param='"+ game.getType()+"'"+" '"+game.getBoard()+"'"); mapper.writeValue(writer, game); HttpPost post = new HttpPost(NetworkClient.currLink + "games/"); StringEntity input = new StringEntity(writer.toString()); //here instead of JSON you can also have XML input.setContentType("application/json"); post.setEntity(input); HttpResponse response = httpclient.execute(post, localcontext); HttpEntity entity = response.getEntity(); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = new String(""); if ((line = rd.readLine()) != null) { StringReader reader = new StringReader(line); try{ Game value = mapper.readValue(reader, Game.class); game.setGauid(value.getGauid()); return value; }catch(Exception e){ reader = new StringReader(line); ExceptionMessage eMsg = mapper.readValue(reader, ExceptionMessage.class); System.out.println("error:"+ eMsg.getCode() +"->" + eMsg.getMessage()); return null; } } EntityUtils.consume(entity); return null; } }
package com.Flonx9; /** * @Auther:Flonx * @Date:2021/1/14 - 01 - 14 - 19:13 * @Description: com.Flonx9 * @Version: 1.0 */ public class Test { public static void main(String[] args) { // create a Student class Student stu1 = new Student(); stu1.setSno(1001); stu1.setAge(18); stu1.setHeight(180.0); stu1.setName("Flonx"); System.out.println("This guy's name is:"+ stu1.getName()+","+"His age is :"+stu1.getAge()); stu1.study(); stu1.eat(); stu1.sleep(); } }
package LessonsJavaCore_11.Auto; public class Helm { private int diameterHelm; private String materialHelm; public int getDiameterHelm(){ return diameterHelm; } public String getMaterialHelm(){ return materialHelm; } public Helm(){ } public Helm(int diameterHelm){ this.diameterHelm = diameterHelm; } public Helm(String materialHelm){ this.materialHelm = materialHelm; } public Helm(int diameterHelm,String materialHelm){ this.diameterHelm = diameterHelm; this.materialHelm = materialHelm; } public String toString(int diameterHelm,String materialHelm){ return "Diameter Helm : " + diameterHelm + " , " + "Material Helm : " + materialHelm; } }
package com.java.app.beans; import java.util.Date; /** * Table with column name declare for Overhead and profit master using hibernate. */ public class DimensionsDO { private Integer id; private DomainsDO domainsDO; private String sDimensionsName; private String sCreatedBy; private Date dCreatedDate; private String sUpdatedBy; private Date dUpdatedDate; private char cIsDeleted; private String sKey; public DimensionsDO() {} public DimensionsDO(Integer id) { this.id = id; } /** * @return the id */ public Integer getId() { return id; } /** * @param id the id to set */ public void setId(Integer id) { this.id = id; } /** * @return the domainsDO */ public DomainsDO getDomainsDO() { return domainsDO; } /** * @param domainsDO the domainsDO to set */ public void setDomainsDO(DomainsDO domainsDO) { this.domainsDO = domainsDO; } public String getsDimensionsName() { return sDimensionsName; } public void setsDimensionsName(String sDimensionsName) { this.sDimensionsName = sDimensionsName; } /** * @return the sCreatedBy */ public String getsCreatedBy() { return sCreatedBy; } /** * @param sCreatedBy the sCreatedBy to set */ public void setsCreatedBy(String sCreatedBy) { this.sCreatedBy = sCreatedBy; } /** * @return the dCreatedDate */ public Date getdCreatedDate() { return dCreatedDate; } /** * @param dCreatedDate the dCreatedDate to set */ public void setdCreatedDate(Date dCreatedDate) { this.dCreatedDate = dCreatedDate; } /** * @return the sUpdatedBy */ public String getsUpdatedBy() { return sUpdatedBy; } /** * @param sUpdatedBy the sUpdatedBy to set */ public void setsUpdatedBy(String sUpdatedBy) { this.sUpdatedBy = sUpdatedBy; } /** * @return the dUpdatedDate */ public Date getdUpdatedDate() { return dUpdatedDate; } /** * @param dUpdatedDate the dUpdatedDate to set */ public void setdUpdatedDate(Date dUpdatedDate) { this.dUpdatedDate = dUpdatedDate; } /** * @return the cIsDeleted */ public char getcIsDeleted() { return cIsDeleted; } /** * @param cIsDeleted the cIsDeleted to set */ public void setcIsDeleted(char cIsDeleted) { this.cIsDeleted = cIsDeleted; } public String getsKey() { return sKey; } public void setsKey(String sKey) { this.sKey = sKey; } }
package cn.chinaunicom.monitor.http.Response; import cn.chinaunicom.monitor.beans.AlarmCategory; /** * 告警主页中告警分类列表的返回数据 * Created by yfYang on 2017/8/28. */ public class UnCheckAlarmCategoryResp extends BaseResp { public AlarmCategory data; }
/* * 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 oopProjectFinal; import java.io.Serializable; /** * * @author x18114245 */ public class hr implements Serializable { private String firstname; private String surname; private String dob; private String id; private String address; private String ppsnumber; //overloaded constructor public hr(String firstname, String surname, String dob, String id, String address, String ppsnumber) { this.firstname = firstname; this.surname = surname; this.dob = dob; this.id = id; this.address = address; this.ppsnumber = ppsnumber; } //default constructor public hr() { firstname = ""; surname = ""; dob = ""; id = ""; address = ""; ppsnumber = ""; } public String getFirstname() { return firstname; } public String getSurname() { return surname; } public String getDob() { return dob; } public String getId() { return id; } public String getAddress() { return address; } public String getPpsnumber() { return ppsnumber; } public void setFirstname(String firstname) { this.firstname = firstname; } public void setSurname(String surname) { this.surname = surname; } public void setDob(String dob) { this.dob = dob; } public void setId(String id) { this.id = id; } public void setAddress(String address) { this.address = address; } public void setPpsnumber(String ppsnumber) { this.ppsnumber = ppsnumber; } public String employeedetails() { /// CREATE EMPLOYEEDETAILS METHOD TO RETURN FIRSTNAME,SURNAME ,ID AND ADDRESS WILL BE USED FOR POLYMORPHISM IN HR AND PAROLGUI return "firstname: " + firstname + "\n" + "surname: " + surname + "\n" + "dob: " + dob + "\n" + "id: " + id + "\n" + "address: " + address + "\n" + "ppsnumber: " + ppsnumber + "\n"; } //give methods innicial values of zero public Double prsi() { return 0.0; } public Double gross() { return 0.0; } public Double netpay() { return 0.0; } public Double taxablePay() { return 0.0; } public Double usc() { return 0.0; } public Double pay() { return 0.0; } }
package com.lti.selendemo; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import io.github.bonigarcia.wdm.WebDriverManager; public class Demo { public static void main(String[] args) { //System.setProperty("webdriver.chrome.driver", "D:\\LTI\\chromedriver_win32\\chromedriver.exe"); WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); //driver.get("https://www.amazon.in/"); // driver.findElement(By.id("twotabsearchtextbox")).sendKeys("Tshirts"); // driver.findElement(By.name("field-keywords")).sendKeys("Iphone 13"); // driver.findElement(By.xpath("//*[@id=\"nav-search-submit-button\"]")).click(); //driver.findElement(By.cssSelector("#twotabsearchtextbox")).sendKeys("TshitS"); driver.get("https://www.facebook.com/"); // driver.findElement(By.xpath("//*[@id='email']")).sendKeys("abc"); //driver.findElement(By.xpath("//*[@id='email' and @type = 'text']")).sendKeys("abc"); driver.findElement(By.xpath("//*[@id='email' or @type = 'text']")).sendKeys("abc"); driver.findElement(By.xpath("//*[@id=\"pass\"]")).sendKeys("abc"); driver.findElement(By.name("login")).click(); } }
package com.weicent.android.csma.ui.fragment; import android.app.Fragment; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.ab.fragment.AbAlertDialogFragment; import com.ab.util.AbDialogUtil; import com.weicent.android.csma.App; import com.weicent.android.csma.R; import com.weicent.android.csma.data.NetWorkWeb; import com.weicent.android.csma.data.model.result.Users; import com.weicent.android.csma.support.SharedTool; import com.weicent.android.csma.support.T; import com.weicent.android.csma.ui.AboutActivity; import com.weicent.android.csma.ui.LoginActivity; import com.weicent.android.csma.ui.detail.UsersDetailActivity; import com.weicent.android.csma.ui.list.BuysListActivity; import com.weicent.android.csma.ui.list.CommodityList1Activity; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; /** * 我 */ public class UsersFragment extends Fragment { @Bind(R.id.textTitle) TextView textTitle; @Bind(R.id.textRight) TextView textRight; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_users, container, false); ButterKnife.bind(this, rootView); return rootView; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); initView(); if (SharedTool.getInt(App.SHARED_ID) <= 0) { startActivity(new Intent(getActivity(), LoginActivity.class) .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)); } } private void initView() { textRight.setVisibility(View.GONE); textTitle.setText("我"); } //操作事件 @OnClick({R.id.btnPersonalData, R.id.btnAbout, R.id.btnLoginOut, R.id.btnCommodity, R.id.btnBuys}) public void onClick(View view) { switch (view.getId()) { case R.id.btnPersonalData://个人资料 startActivity(new Intent(getActivity(), UsersDetailActivity.class)); break; case R.id.btnAbout://关于 startActivity(new Intent(getActivity(), AboutActivity.class)); break; case R.id.btnCommodity://我的商品 startActivity(new Intent(getActivity(), CommodityList1Activity.class).putExtra("type", 1)); break; case R.id.btnBuys://我的求购 startActivity(new Intent(getActivity(), BuysListActivity.class)); break; case R.id.btnLoginOut://注销 AbDialogUtil.showAlertDialog(getActivity(), "提示", "确定要注销当前账号吗?" , new AbAlertDialogFragment.AbDialogOnClickListener() { @Override public void onPositiveClick() { new Users().setClearAll(); T.showShort(getActivity(), "注销成功!"); startActivity(new Intent(getActivity(), LoginActivity.class) .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)); getActivity().finish(); } @Override public void onNegativeClick() { } }); break; } } @Override public void onDestroyView() { super.onDestroyView(); if (NetWorkWeb.getInstance().getHttpClient() == null) { // AbLogUtil.d("cancelAllRequests"," is null"); return; } else { NetWorkWeb.getInstance().getHttpClient().cancelAllRequests(true);//关闭所有请求 // AbLogUtil.d("cancelAllRequests"," is ok"); } } }
package hr.fer.tel.ruazosa.shopshop.util; import hr.fer.tel.ruazosa.shopshop.DropboxConnect; import com.dropbox.client2.exception.DropboxException; /** * Thread used to get user information from Dropbox Server * */ public class AccountInfo extends Thread{ private String accInfo = ""; public String getAccInfo(){ return accInfo; } @Override public void run(){ try { accInfo = DropboxConnect.mApi.accountInfo().displayName; } catch (DropboxException e) { e.printStackTrace(); } } }
package home.work.helloworld; import org.testng.annotations.Test; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** * Created by Lena on 24.05.2016. */ public class Institute { public static Map<Integer, String> corpus = new HashMap<Integer, String>(); //public static Student student = new Student(); public static ArrayList<Student> students; public static Map<Integer, String> library = new HashMap<Integer, String>(); public static void main(String args[]){ //System.out.println("Key = "); //int i; for (int i=1; i<10; i++) { Student.studentAdd(i,"physics course="+(int) (Math.random()*5)); } for (int j=1; j<10; j++) { corpusAdd(j,"Address "+j); } for (Map.Entry<Integer, String> entry : corpus.entrySet()){ libraryAdd(entry.getKey(), "LibraryName on "+entry.getValue()); } System.out.println("Print Corpuses"); printAllMap(corpus); System.out.println("Print Library"); printAllMap(library); System.out.println("Print Students"); printAllMap(Student.students); } public static void corpusAdd(Integer id, String address){ //System.out.println(id+" "+address); corpus.put(id, address); } public static void libraryAdd(Integer corpusID, String name){ //System.out.println(corpusID+" "+name); library.put(corpusID, name); } public static void printAllMap(Map <Integer, String> map){ for (Map.Entry<Integer, String> entry : map.entrySet()){ System.out.println("Key = "+entry.getKey()+" Value = "+entry.getValue()); } } }
package com.tencent.mm.plugin.appbrand.jsapi; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import com.tencent.mm.plugin.appbrand.appcache.ao; import com.tencent.mm.plugin.appbrand.l; import com.tencent.mm.plugin.appbrand.page.e; import com.tencent.mm.plugin.appbrand.widget.c; import com.tencent.mm.plugin.appbrand.widget.c.a; import com.tencent.mm.sdk.platformtools.bi; import java.io.Closeable; import java.io.InputStream; import org.json.JSONObject; public final class bl extends a { public static final int CTRL_INDEX = -2; public static final String NAME = "setTabBarItem"; public final void a(l lVar, JSONObject jSONObject, int i) { try { int i2 = jSONObject.getInt("index"); String optString = jSONObject.optString("text", ""); String optString2 = jSONObject.optString("iconPath", ""); String optString3 = jSONObject.optString("selectedIconPath", ""); com.tencent.mm.plugin.appbrand.page.l currentPage = lVar.fdO.fcz.getCurrentPage(); if (currentPage instanceof e) { Closeable d = ao.d(lVar.fdO, optString2); Bitmap decodeStream = BitmapFactory.decodeStream(d); if (d != null) { bi.d(d); } InputStream d2 = ao.d(lVar.fdO, optString3); Bitmap decodeStream2 = BitmapFactory.decodeStream(d2); if (d2 != null) { bi.d(d); } c tabBar = ((e) currentPage).getTabBar(); if (i2 < tabBar.gEl.size()) { a aVar = (a) tabBar.gEl.get(i2); aVar.gEw = optString; if (decodeStream == null) { decodeStream = aVar.sq; } aVar.sq = decodeStream; if (decodeStream2 == null) { decodeStream = aVar.gEv; } else { decodeStream = decodeStream2; } aVar.gEv = decodeStream; tabBar.aoV(); } lVar.E(i, f("ok", null)); return; } lVar.E(i, f("fail:not TabBar page", null)); } catch (Exception e) { lVar.E(i, f("fail", null)); } } }
/* * Copyright (c) 2012, ubivent GmbH, Thomas Butter, Oliver Seuffert * All right reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. * * This software is based on RFC6386 * * Copyright (c) 2010, 2011, Google Inc. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be * found in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ package com.ubivent.vp8; public class DequantFactors { public final static int TOKEN_BLOCK_Y1 = 0; public final static int TOKEN_BLOCK_UV = 1; public final static int TOKEN_BLOCK_Y2 = 2; public final static int TOKEN_BLOCK_TYPES = 3; int quant_idx; short factor[][] = new short[TOKEN_BLOCK_TYPES][2]; /* [ Y1, UV, Y2 ] * [ DC, AC ] */ }
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlAdapter; public class ColumnConfigAdapter extends XmlAdapter<ColumnConfigAdapter.HiddenColumnConfigList, ExcelHiddenColumnConfig> { @Override public HiddenColumnConfigList marshal(ExcelHiddenColumnConfig obj) throws Exception { HiddenColumnConfigList hiddenColumnConfigList = new HiddenColumnConfigList(); hiddenColumnConfigList.setGlobalHiddenColumn(obj .getGlobalHiddenColumn()); List<ColumnConfig> columnConfigList = new ArrayList<>(); Map<String, String[]> TPNHiddenColumnConfig = obj .getTPNHiddenColumnConfig(); Map<String, String[]> externalHiddenColumnConfig = obj .getExternalHiddenColumnConfig(); Map<String, String[]> hiddenColumnConfig = obj.getHiddenColumnConfig(); addHiddenColumn(columnConfigList, hiddenColumnConfig); for (Map.Entry<String, String[]> entry : TPNHiddenColumnConfig .entrySet()) { ColumnConfig columnConfig = new ColumnConfig(entry.getKey(), entry.getValue()); columnConfig.setTPN(true); String[] values = externalHiddenColumnConfig.get(entry.getKey()); if (values != null) { columnConfig.setExternal(true); externalHiddenColumnConfig.remove(entry.getKey()); } columnConfigList.add(columnConfig); } for (Map.Entry<String, String[]> entry : externalHiddenColumnConfig .entrySet()) { ColumnConfig columnConfig = new ColumnConfig(entry.getKey(), entry.getValue()); columnConfig.setExternal(true); columnConfigList.add(columnConfig); } hiddenColumnConfigList.setHiddenColumnConfigList(columnConfigList); return hiddenColumnConfigList; } private void addHiddenColumn(List<ColumnConfig> columnConfigList, Map<String, String[]> hiddenColumnConfig) { for (Map.Entry<String, String[]> entry : hiddenColumnConfig.entrySet()) { columnConfigList.add(new ColumnConfig(entry.getKey(), entry .getValue())); } } @Override public ExcelHiddenColumnConfig unmarshal(HiddenColumnConfigList xml) throws Exception { Map<String, String[]> TPNHiddenColumnConfig = new HashMap<>(); Map<String, String[]> externalHiddenColumnConfig = new HashMap<>(); Map<String, String[]> hiddenColumnConfig = new HashMap<>(); for (ColumnConfig columnConfig : xml.getHiddenColumnConfigList()) { if (columnConfig.isTPN()) { TPNHiddenColumnConfig.put(columnConfig.getStoreProcedureName(), columnConfig.getColumnName()); } if (columnConfig.isExternal()) { externalHiddenColumnConfig.put(columnConfig.getStoreProcedureName(), columnConfig.getColumnName()); } if(!(columnConfig.isTPN()&&columnConfig.isExternal())){ hiddenColumnConfig.put(columnConfig.getStoreProcedureName(), columnConfig.getColumnName()); } } ExcelHiddenColumnConfig excelHiddenColumnConfig = new ExcelHiddenColumnConfig(); excelHiddenColumnConfig.setExternalHiddenColumnConfig(externalHiddenColumnConfig); excelHiddenColumnConfig.setHiddenColumnConfig(hiddenColumnConfig); excelHiddenColumnConfig.setTPNHiddenColumnConfig(TPNHiddenColumnConfig); excelHiddenColumnConfig.setGlobalHiddenColumn(xml.getGlobalHiddenColumn()); return excelHiddenColumnConfig; } @XmlAccessorType(XmlAccessType.FIELD) static public class HiddenColumnConfigList { @XmlElement(name="hiddenColumnConfig") private List<ColumnConfig> hiddenColumnConfigList; @XmlList private List<String> globalHiddenColumn = null; public List<ColumnConfig> getHiddenColumnConfigList() { return hiddenColumnConfigList; } public List<String> getGlobalHiddenColumn() { return globalHiddenColumn; } public void setGlobalHiddenColumn(List<String> globalHiddenColumn) { this.globalHiddenColumn = globalHiddenColumn; } public void setHiddenColumnConfigList( List<ColumnConfig> hiddenColumnConfigList) { this.hiddenColumnConfigList = hiddenColumnConfigList; } } }
package cn.org.cerambycidae.Servlet.StudentDataBase; import cn.org.cerambycidae.pojo.StudentInfo; import cn.org.cerambycidae.pojo.StudentInfoExample; import cn.org.cerambycidae.service.Impl.StudentInfoServiceImpl; import cn.org.cerambycidae.service.StudentInfoService; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @WebServlet(urlPatterns = {"/DataBaseStudent/ShowStudentDataBase"}) public class ShowAntoherDataBaseServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("utf-8"); //数据处理,数据库连接方面,用来响应消息 StudentInfoService studentInfoService=new StudentInfoServiceImpl(); StudentInfoExample studentInfo = new StudentInfoExample(); StudentInfoExample.Criteria criteria = studentInfo.createCriteria(); criteria.andNameLike("%%"); List<StudentInfo> students = studentInfoService.selectByExample(studentInfo); request.getSession().setAttribute("students",students); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response); } }
package com.fang.example.spring.di; /** * Created by andy on 4/3/16. */ public interface Knight { public void embarkOnquest(); }
package com.cg.ibs.spmgmt.dao; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import com.cg.ibs.spmgmt.bean.BankAdmin; import com.cg.ibs.spmgmt.bean.SPCustomerData; import com.cg.ibs.spmgmt.bean.ServiceProvider; import com.cg.ibs.spmgmt.exception.IBSException; public interface ServiceProviderDao { ServiceProvider addServiceProvider(ServiceProvider serviceProvider) throws IBSException; ServiceProvider updateServiceProvider(ServiceProvider serviceProvider) throws IBSException; ServiceProvider getServiceProviderById(String userId) throws IBSException; List<ServiceProvider> getServiceProviders() throws IBSException; List<ServiceProvider> getPendingServiceProviders() throws IBSException; List<ServiceProvider> getApprovedServiceProviders() throws IBSException; List<ServiceProvider> getDisapprovedServiceProviders() throws IBSException; List<ServiceProvider> getApprovedDisapprovedServiceProviders() throws IBSException; BankAdmin getBankAdmin(String adminId) throws IBSException; BigInteger getLastSPI() throws IBSException; String checkUserId(String userId) throws IBSException; void addSPCustomerData(SPCustomerData customerData); List<SPCustomerData> getSPData(ServiceProvider serviceProvider) throws IBSException; boolean checkUniqueConstarints(ServiceProvider serviceProvider); }
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE * All rights reserved. * * This software is the confidential and proprietary information of SAP * Hybris ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with SAP Hybris. */ package com.cnk.travelogix.services.paymentgateways.request.decorators; import de.hybris.platform.servicelayer.config.ConfigurationService; import de.hybris.platform.servicelayer.session.Session; import de.hybris.platform.servicelayer.session.SessionService; import java.util.Map; import javax.annotation.Resource; import com.cnk.travelogix.integrations.payment.request.beans.FormAttribute; /** * */ public abstract class PaymentGatewayRequestFormDecorator implements PaymentGatewayRequestForm { @Resource(name = "sessionService") private SessionService sessionService; @Resource(name = "configurationService") private ConfigurationService configurationService; /** * @return the configurationService */ public ConfigurationService getConfigurationService() { return configurationService; } /** * @return the sessionService */ public SessionService getSessionService() { return sessionService; } protected PaymentGatewayRequestForm paymentGatewayProviderRequestForm; protected void updateFormAttributeFlags(final FormAttribute formAttribute, final String value) { formAttribute.setValue(value); formAttribute.setValueReady(true); formAttribute.setDefaultValueFlag(false); formAttribute.setDecoratorRequired(false); } public PaymentGatewayRequestFormDecorator(final PaymentGatewayRequestForm paymentGatewayProviderRequestForm) { this.paymentGatewayProviderRequestForm = paymentGatewayProviderRequestForm; } public PaymentGatewayRequestFormDecorator() { super(); } @Override public FormAttribute processRequestAttibuteValue(final FormAttribute formAttribute, final Map<String, FormAttribute> valueMap) throws Exception { return paymentGatewayProviderRequestForm.processRequestAttibuteValue(formAttribute, valueMap); } public void setThisValueInSession(final String key, final String value) { final Session session = getSessionService().getCurrentSession(); if (session != null) { session.setAttribute(key, value); } } }
package com.emily.framework.common.utils.hash; import com.emily.framework.common.enums.AppHttpStatus; import com.emily.framework.common.exception.BusinessException; import com.emily.framework.common.utils.constant.CharsetUtils; import org.apache.commons.lang3.StringUtils; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; /** * @description: URL编码解码工具类 application/x-www-form-rulencoded MIME字符串之间的转换 * @create: 2020/07/29 */ public class URLCoderUtils { /** * URL数据编码,默认UTF8 * * @param content 数据类型 * @return */ public static String decode(String content) { return decode(content, CharsetUtils.UTF_8); } /** * URL数据解码 * * @param content 数据字符串 * @param enc 编码 * @return */ public static String decode(String content, String enc) { if (StringUtils.isEmpty(content)) { return null; } try { return URLDecoder.decode(content, enc); } catch (UnsupportedEncodingException e) { throw new BusinessException(AppHttpStatus.ILLEGAL_ARGUMENT_EXCEPTION); } } /** * URL数据编码,默认UTF8 * * @param content 数据类型 * @return */ public static String encode(String content) { return encode(content, CharsetUtils.UTF_8); } /** * URL数据编码 * * @param content 数据字符串 * @param enc 编码 * @return */ public static String encode(String content, String enc) { if (StringUtils.isEmpty(content)) { return null; } try { return URLEncoder.encode(content, enc); } catch (UnsupportedEncodingException e) { throw new BusinessException(AppHttpStatus.ILLEGAL_ARGUMENT_EXCEPTION); } } }
package com.pz.Dto; import lombok.*; @Setter @Getter @Builder @AllArgsConstructor @NoArgsConstructor public class PokojeDto { private long id; private int numer; private long idTypPokoju; private boolean niedostepny; private String opis; }
package br.com.giorgetti.games.squareplatform.gamestate.title; import br.com.giorgetti.games.squareplatform.gamestate.GameState; import br.com.giorgetti.games.squareplatform.gamestate.levels.LevelStateManager; import br.com.giorgetti.games.squareplatform.main.GamePanel; import br.com.giorgetti.games.squareplatform.tiles.Background; import javafx.embed.swing.JFXPanel; import javax.imageio.ImageIO; import java.awt.*; import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.LinkedHashMap; /** * State that is turned on when user enters the game or when game is over. */ public class TitleState extends JFXPanel implements GameState { public static final String SPEED_PCT = "40"; private Background backgroundSky; private BufferedImage titleImage; private int bgMaxX, bgMaxY; private int x, y; private int ySpeed = 1; public static final String START = "Start"; public static final String CHOOSE_LEVEL = "Choose level"; public static final String OPTIONS = "Options"; private int selectedOption = 0; private String[] options = new String[]{START, OPTIONS}; private static final LinkedHashMap<String, GameState> menuOptions = new LinkedHashMap<>(); private static TitleState instance; /** * Make this a singleton * @return */ public static TitleState getInstance() { if ( instance == null ) { instance = new TitleState(); } return instance; } private TitleState() { try { backgroundSky = new Background("/backgrounds/background.png", SPEED_PCT); titleImage = ImageIO.read(this.getClass().getResourceAsStream("/title/title.png")); int drawTimes = 100 / Integer.parseInt(SPEED_PCT); bgMaxX = backgroundSky.getImage().getWidth() * drawTimes; bgMaxY = backgroundSky.getImage().getHeight() * drawTimes; menuOptions.put(START, LevelStateManager.getInstance()); menuOptions.put(OPTIONS, OptionState.getInstance()); } catch (IOException e) { e.printStackTrace(); } } @Override public void update() { x++; y+=ySpeed; if ( y >= bgMaxY || y <= 0) { ySpeed = ySpeed * -1; } } @Override public void draw(Graphics2D g) { // Draw the BG backgroundSky.draw(g, x, y); // Draw the Title g.drawImage(titleImage, 0,0, null); // Draw the menu options int strX = GamePanel.WIDTH / 10 * 5; int strY = 220; for ( String option : options ) { boolean selected = option.equals(options[selectedOption]); g.setColor(Color.BLACK); g.drawString(option, strX, strY); if ( selected ) { g.drawString(">", strX-15, strY); } g.setColor(Color.WHITE); g.drawString(option, strX+1, strY+1); if ( selected ) { g.drawString(">", strX-14, strY+1); } strY += 20; } } @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { if ( e.getKeyCode() == KeyEvent.VK_ENTER ) { assignState(); } else if ( e.getKeyCode() == KeyEvent.VK_ESCAPE ) { System.exit(0); } if ( e.getKeyCode() == KeyEvent.VK_UP ) { if ( --selectedOption < 0 ) { selectedOption = options.length - 1; } } else if ( e.getKeyCode() == KeyEvent.VK_DOWN ) { if ( ++selectedOption >= options.length ) { selectedOption = 0; } } } private void assignState() { String opt = options[selectedOption]; GameState gs = menuOptions.get(opt); switch (opt) { case START: LevelStateManager.getInstance().newGame(); menuOptions.put(opt, LevelStateManager.getInstance()); GamePanel.gsm.switchGameState(gs); break; case OPTIONS: GamePanel.gsm.addTemporaryState(gs); break; default: break; } } @Override public void keyReleased(KeyEvent e) { } @Override public void notifySwitchedOff() { } @Override public void notifySwitchedOn() { } }
package br.edu.ifam.saf.itens; import java.util.List; import br.edu.ifam.saf.api.dto.ItemDTO; import br.edu.ifam.saf.mvp.BasePresenter; import br.edu.ifam.saf.mvp.LoadingView; public interface ItensContract { interface View extends LoadingView { void mostrarItens(List<ItemDTO> itens); void mostrarItem(ItemDTO item); } interface Presenter extends BasePresenter { void carregarListaDeItens(); void onItemClick(ItemDTO item); void atualizar(); } }
package com.tencent.mm.plugin.sns.ui; import android.view.View; import com.tencent.mm.ui.base.MMSlideDelView.g; class SnsMsgUI$13 implements g { final /* synthetic */ SnsMsgUI nYl; SnsMsgUI$13(SnsMsgUI snsMsgUI) { this.nYl = snsMsgUI; } public final void t(View view, int i) { SnsMsgUI.c(this.nYl).performItemClick(view, i, 0); } }
package action17_task; public class Human { Human human; }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mathpar.students.sidkoBosa.sidko; import com.mathpar.matrix.MatrixS; import com.mathpar.number.Array; import com.mathpar.number.Element; import com.mathpar.number.NumberR64; import com.mathpar.number.NumberZp32; import com.mathpar.number.Ring; import com.mathpar.number.VectorS; import com.mathpar.parallel.utils.MPITransport; import java.io.IOException; import java.util.Random; import mpi.MPI; import mpi.MPIException; /** * * @author alla */ public class PracticeMatrixModule2 { public static void main(String[] args)throws MPIException, IOException,ClassNotFoundException { //MatrixMul4.multMatrix(args); //MatrixMul8.multMatrix(args); MultiplyMatrixToVector.multiplyMatrToVect(args); //MultiplyVectorToScalar.MultVectToSclr(args); } } /* openmpi/bin/mpirun --hostfile hostfile -np 4 java -cp /home/alla/Documents/stemedu/stemedu/target/classes com/mathpar/students/ukma17i41/sidko/PracticeMatrixModule2 Result: I'm processor 2 I'm processor 3 I'm processor 1 res = [[0.95, 1.23] [0.7, 1.39]] send result res = [[0.28, 0.7 ] [0.86, 1.44]] res = [[0.32, 0.72] [0.96, 1.13]] recv 1 to 0 send resultsend result recv 2 to 0 recv 3 to 0 RES= [[0.74, 1.06, 0.95, 1.23] [0.94, 0.94, 0.7, 1.39] [0.32, 0.72, 0.28, 0.7 ] [0.96, 1.13, 0.86, 1.44]] */ class MatrixMul4 { static int tag = 0; static int mod = 13; public static MatrixS mmultiply(MatrixS a, MatrixS b,MatrixS c, MatrixS d, Ring ring) { return (a.multiply(b, ring)).add(c.multiply(d, ring), ring); } public static void multMatrix(String[] args)throws MPIException, IOException,ClassNotFoundException { Ring ring = new Ring("R64[x]"); MPI.Init(new String[0]); int rank = MPI.COMM_WORLD.getRank(); if (rank == 0) { ring.setMOD32(mod); int ord = 4; int den = 10000; Random rnd = new Random(); MatrixS A = new MatrixS(ord, ord, den, new int[] {5, 5}, rnd, NumberZp32.ONE, ring); MatrixS B = new MatrixS(ord, ord, den, new int[] {5, 5}, rnd, NumberZp32.ONE, ring); MatrixS[] DD = new MatrixS[4]; MatrixS CC = null; MatrixS[] AA = A.split(); MatrixS[] BB = B.split(); MPITransport.sendObjectArray(new Object[] {AA[0], BB[1], AA[1], BB[3]},0,4, 1, 1); MPITransport.sendObjectArray(new Object[] {AA[2], BB[0], AA[3], BB[2]},0,4, 2, 2); MPITransport.sendObjectArray(new Object[] {AA[2], BB[1], AA[3], BB[3]},0,4, 3, 3); DD[0] = (AA[0].multiply(BB[0], ring)).add(AA[1].multiply(BB[2], ring), ring); DD[1] = (MatrixS) MPITransport.recvObject(1, 1); System.out.println("recv 1 to 0"); DD[2] = (MatrixS) MPITransport.recvObject(2, 2); System.out.println("recv 2 to 0"); DD[3] = (MatrixS) MPITransport.recvObject(3, 3); System.out.println("recv 3 to 0"); CC = MatrixS.join(DD); System.out.println("RES= " + CC.toString()); } else { System.out.println("I'm processor " + rank); ring.setMOD32(mod); Object[] n = new Object[4]; MPITransport.recvObjectArray(n,0,4, 0, rank); MatrixS a = (MatrixS) n[0]; MatrixS b = (MatrixS) n[1]; MatrixS c = (MatrixS) n[2]; MatrixS d = (MatrixS) n[3]; MatrixS res = mmultiply(a, b, c, d, ring); System.out.println("res = " + res); MPITransport.sendObject(res, 0, rank); System.out.println("send result"); } MPI.Finalize(); } } /* openmpi/bin/mpirun --hostfile hostfile -np 8 java -cp /home/alla/Documents/stemedu/stemedu/target/classes com/mathpar/students/ukma17i41/sidko/PracticeMatrixModule2 Result: I'm processor 2 I'm processor 4 I'm processor 5I'm processor 7 I'm processor 1 I'm processor 3 A = [[0.24, 0.22, 0.54, 0.64] [0.68, 0.12, 0.47, 0.27] [0.79, 0.77, 0.58, 0.76] [0.92, 0.1, 0.05, 0.06]] B = [[0.82, 0.09, 0.57, 0.49] [0.03, 0.93, 0.08, 0.02] [0.42, 0.46, 0.07, 0.28] [0.11, 0.44, 0.87, 0.95]] I'm processor 6 RES = [[0.5, 0.75, 0.75, 0.88] [0.79, 0.51, 0.67, 0.73] [0.99, 1.39, 1.21, 1.29] [0.79, 0.22, 0.59, 0.53]] */ class MatrixMul8 { public static void multMatrix(String[] args)throws MPIException, IOException,ClassNotFoundException { Ring ring = new Ring("R64[x]"); MPI.Init(new String[0]); int rank = MPI.COMM_WORLD.getRank(); if (rank == 0) { int ord = 4; int den = 10000; Random rnd = new Random(); MatrixS A = new MatrixS(ord, ord, den, new int[] {5, 3}, rnd, NumberZp32.ONE, ring); System.out.println("A = " + A); MatrixS B = new MatrixS(ord, ord, den, new int[] {5, 3}, rnd, NumberZp32.ONE, ring); System.out.println("B = " + B); MatrixS D = null; MatrixS[] AA = A.split(); MatrixS[] BB = B.split(); int tag = 0; MPITransport.sendObjectArray(new Object[] {AA[1], BB[2]},0,2, 1, tag); MPITransport.sendObjectArray(new Object[] {AA[0], BB[1]},0,2, 2, tag); MPITransport.sendObjectArray(new Object[] {AA[1], BB[3]},0,2, 3, tag); MPITransport.sendObjectArray(new Object[] {AA[2], BB[0]},0,2, 4, tag); MPITransport.sendObjectArray(new Object[] {AA[3], BB[2]},0,2, 5, tag); MPITransport.sendObjectArray(new Object[] {AA[2], BB[1]},0,2, 6, tag); MPITransport.sendObjectArray(new Object[] {AA[3], BB[3]},0,2, 7, tag); MatrixS[] DD = new MatrixS[4]; DD[0] = (AA[0].multiply(BB[0], ring)).add((MatrixS) MPITransport.recvObject(1, 3),ring); DD[1] = (MatrixS) MPITransport.recvObject(2, 3); DD[2] = (MatrixS) MPITransport.recvObject(4, 3); DD[3] = (MatrixS) MPITransport.recvObject(6, 3); D = MatrixS.join(DD); System.out.println("RES = " + D.toString()); } else { System.out.println("I'm processor " + rank); Object[] b = new Object[2]; MPITransport.recvObjectArray(b,0,2,0, 0); MatrixS[] a = new MatrixS[b.length]; for (int i = 0; i < b.length; i++) a[i] = (MatrixS) b[i]; MatrixS res = a[0].multiply(a[1], ring); if (rank % 2 == 0) { MatrixS p = res.add((MatrixS) MPITransport.recvObject(rank + 1, 3), ring); MPITransport.sendObject(p, 0, 3); } else { MPITransport.sendObject(res, rank - 1, 3); } } MPI.Finalize(); } } /* openmpi/bin/mpirun --hostfile hostfile -np 10 java -cp /home/alla/Documents/stemedu/stemedu/target/classes com/mathpar/students/ukma17i41/sidko/PracticeMatrixModule2 2 Result: I'm processor 3 I'm processor 9 I'm processor 6 I'm processor 7 I'm processor 5 I'm processor 2 I'm processor 4 I'm processor 1 I'm processor 8 Matrix A = [[6, 26] [23, 21]] Vector B = [1, 3] rank = 0 row = [6, 26] rank = 0 row = [23, 21] rank = 1 B = [1, 3] send result rank = 9 B = [1, 3] rank = 4 B = [1, 3] send result rank = 3 B = [1, 3] send result rank = 6 B = [1, 3] rank = 8 B = [1, 3] rank = 2 B = [1, 3] send result send result rank = 7 B = [1, 3] send result send result send result rank = 5 B = [1, 3] send result A * B = [[[6, 18], [26, 78]], [[23, 69], [21, 63]]] */ class MultiplyMatrixToVector { public static void multiplyMatrToVect(String[] args)throws MPIException, IOException,ClassNotFoundException { Ring ring = new Ring("Z[x]"); MPI.Init(args); int rank = MPI.COMM_WORLD.getRank(); int size = MPI.COMM_WORLD.getSize(); int ord = Integer.parseInt(args[0]); int k = ord / size; int n = ord - k * (size - 1); if (rank == 0) { int den = 10000; Random rnd = new Random(); MatrixS A = new MatrixS(ord, ord, den, new int[] {5, 5}, rnd, NumberZp32.ONE, ring); System.out.println("Matrix A = " + A); VectorS B = new VectorS(ord, den, new int[] {5, 5}, rnd, ring); System.out.println("Vector B = " + B); Element[] res0 = new Element[n]; for (int i = 0; i < n; i++) { res0[i] = new VectorS(A.M[i]).transpose(ring).multiply(B, ring); System.out.println("rank = " + rank + " row = " + Array.toString(A.M[i])); } for (int j = 1; j < size; j++) { for (int z = 0; z < k; z++) MPITransport.sendObject(A.M[n + (j - 1) * k+ j * z], j, 100 + j); MPITransport.sendObject(B.V, j, 100 + j); } Element[] result = new Element[ord]; System.arraycopy(res0, 0, result, 0, n); for (int t = 1; t < size; t++) { Element[] resRank = (Element[])MPITransport.recvObject(t, 100 + t); System.arraycopy(resRank, 0, result, n +(t - 1) * k, resRank.length); } System.out.println("A * B = " + new VectorS(result).toString(ring)); } else { System.out.println("I'm processor " + rank); Element[][] A = new Element[k][ord]; for (int i = 0; i < k; i++) { A[i] = (Element[])MPITransport.recvObject(0, 100 + rank); System.out.println("rank = " + rank + "row = " + Array.toString(A[i])); } Element[] B = (Element[])MPITransport.recvObject(0, 100 + rank); System.out.println("rank = " + rank + " B = "+ Array.toString(B)); Element[] result = new Element[k]; for (int j = 0; j < A.length; j++) result[j] = new VectorS(A[j]).transpose(ring).multiply(new VectorS(B), ring); MPITransport.sendObject(result, 0, 100 + rank); System.out.println("send result"); } MPI.Finalize(); } } /* openmpi/bin/mpirun --hostfile hostfile -np 10 java -cp /home/alla/Documents/stemedu/stemedu/target/classes com/mathpar/students/ukma17i41/sidko/PracticeMatrixModule2 5 6 Result: I'm processor 1 I'm processor 3 I'm processor 7 I'm processor 4 I'm processor 5 I'm processor 9 I'm processor 2 I'm processor 6 I'm processor 8 Vector B = [6, 29, 1, 24, 1] rank = 4 B = [] send result rank = 9 B = [] rank = 2 B = [] rank = 8 B = [] rank = 5 B = []send result rank = 3 B = [] rank = 1 B = [] send result rank = 6 B = [] send result rank = 7 B = [] send result send result send result send result send result B * S = [36, 174, 6, 144, 6] */ class MultiplyVectorToScalar { public static void MultVectToSclr(String[] args)throws MPIException, IOException,ClassNotFoundException { Ring ring = new Ring("Z[x]"); MPI.Init(args); int rank = MPI.COMM_WORLD.getRank(); int size = MPI.COMM_WORLD.getSize(); int ord = Integer.parseInt(args[0]); Element s = NumberR64.valueOf(Integer.parseInt(args[1])); int k = ord / size; int n = ord - k * (size - 1); if (rank == 0) { int den = 10000; Random rnd = new Random(); VectorS B = new VectorS(ord, den, new int[] {5, 5}, rnd, ring); System.out.println("Vector B = " + B); Element[] res0 = new Element[n]; for (int i = 0; i < n; i++) res0[i] = B.V[i].multiply(s, ring); for (int j = 1; j < size; j++) { Element[] v = new Element[k]; System.arraycopy(B.V, n + (j - 1) * k, v, 0, k); MPITransport.sendObject(v, j, 100 + j); } Element[] result = new Element[ord]; System.arraycopy(res0, 0, result, 0, n); for (int t = 1; t < size; t++) { Element[] resRank = (Element[])MPITransport.recvObject(t, 100 + t); System.arraycopy(resRank, 0, result, n +(t - 1) * k, resRank.length); } System.out.println("B * S = " + new VectorS(result).toString(ring)); } else { System.out.println("I'm processor " + rank); Element[] B = (Element[])MPITransport.recvObject(0, 100 + rank); System.out.println("rank = " + rank +" B = " + Array.toString(B)); Element[] result = new Element[k]; for (int j = 0; j < B.length; j++) result[j] = B[j].multiply(s, ring); MPITransport.sendObject(result, 0, 100 + rank); System.out.println("send result"); } MPI.Finalize(); } }
package com.profile.cv.ahmed.cvprofile.interfaces; /** * Created by ahmed on 1/6/2017. */ public interface OnImageClick { void onImage(int pos); }
package com.tt.miniapphost; public final class AppbrandApplication { private static IAppbrandApplication sRealAppbrandApplication; public static IAppbrandApplication getInst() { // Byte code: // 0: getstatic com/tt/miniapphost/AppbrandApplication.sRealAppbrandApplication : Lcom/tt/miniapphost/IAppbrandApplication; // 3: ifnonnull -> 33 // 6: ldc com/tt/miniapphost/AppbrandApplication // 8: monitorenter // 9: getstatic com/tt/miniapphost/AppbrandApplication.sRealAppbrandApplication : Lcom/tt/miniapphost/IAppbrandApplication; // 12: ifnonnull -> 21 // 15: invokestatic getInst : ()Lcom/tt/miniapp/AppbrandApplicationImpl; // 18: putstatic com/tt/miniapphost/AppbrandApplication.sRealAppbrandApplication : Lcom/tt/miniapphost/IAppbrandApplication; // 21: ldc com/tt/miniapphost/AppbrandApplication // 23: monitorexit // 24: goto -> 33 // 27: astore_0 // 28: ldc com/tt/miniapphost/AppbrandApplication // 30: monitorexit // 31: aload_0 // 32: athrow // 33: getstatic com/tt/miniapphost/AppbrandApplication.sRealAppbrandApplication : Lcom/tt/miniapphost/IAppbrandApplication; // 36: areturn // Exception table: // from to target type // 9 21 27 finally // 21 24 27 finally // 28 31 27 finally } } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapphost\AppbrandApplication.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
package com.deepu.mypptcontroller; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.deepu.mypptcontroller.client.bluetoothconnectivity.BluetoothDevices; import com.deepu.mypptcontroller.client.ui.MainActivity; public class SecondActivity extends Activity { Button bluetoothbutton,wifibutton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); bluetoothbutton = (Button) findViewById(R.id.bluetoothbutton); wifibutton = (Button) findViewById(R.id.wifibutton); bluetoothbutton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(SecondActivity.this, BluetoothDevices.class); startActivity(intent); } }); wifibutton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(SecondActivity.this,MainActivity.class); startActivity(intent); } }); } }
package uo.asw.tests; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import uo.asw.tests.business.PruebaJSON2String; @RunWith(Suite.class) @SuiteClasses({ PruebaJSON2String.class }) public class AllTests { }
package Gestion_Formations.login; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.Font; import java.awt.SystemColor; import javax.swing.UIManager; import javax.swing.JTextField; import javax.swing.JPasswordField; import javax.swing.JButton; import java.awt.event.ActionListener; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.awt.event.ActionEvent; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.Color; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.JComboBox; import javax.swing.DefaultComboBoxModel; public class RegisterForm { private JFrame frmRegisterForm; private JLabel lblNewLabel_5; private JTextField textNom; private JTextField textPrenom; private JTextField textLogin; private JTextField textVille; private JPasswordField textPassword; private JPasswordField Confirmpassword; private JButton btnRegister; private JButton btnReset; private JButton btnClose; Connection connexion; PreparedStatement stmt; private JLabel lblNewLabel_2; private JLabel lblNewLabel_3; private JLabel lblNewLabel_4; private JLabel lblNewLabel_6; private JLabel lblNewLabel_7; private JLabel lblNewLabel_8; private JLabel lblNewLabel_9; private JComboBox cmbType; private JLabel lblNewLabel_10; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { RegisterForm window = new RegisterForm(); window.frmRegisterForm.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public RegisterForm() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frmRegisterForm = new JFrame(); frmRegisterForm.setResizable(false); frmRegisterForm.setVisible(true); frmRegisterForm.setTitle("Register_Form"); frmRegisterForm.getContentPane().setFont(new Font("Tahoma", Font.BOLD, 12)); frmRegisterForm.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frmRegisterForm.getContentPane().setForeground(SystemColor.info); frmRegisterForm.getContentPane().setBackground(UIManager.getColor("activeCaption")); frmRegisterForm.setBounds(100, 100, 507, 751); frmRegisterForm.getContentPane().setLayout(null); JLabel lblNewLabel = new JLabel("Register form"); lblNewLabel.setForeground(SystemColor.desktop); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 26)); lblNewLabel.setBounds(153, 11, 186, 52); frmRegisterForm.getContentPane().add(lblNewLabel); JLabel lblNewLabel_1 = new JLabel("Last name :"); lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_1.setBounds(61, 108, 96, 25); frmRegisterForm.getContentPane().add(lblNewLabel_1); JLabel lblNewLabel_1_1 = new JLabel("First name :"); lblNewLabel_1_1.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_1_1.setBounds(61, 179, 90, 25); frmRegisterForm.getContentPane().add(lblNewLabel_1_1); JLabel lblNewLabel_1_2 = new JLabel("Login :"); lblNewLabel_1_2.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_1_2.setBounds(98, 254, 59, 25); frmRegisterForm.getContentPane().add(lblNewLabel_1_2); JLabel lblNewLabel_1_3 = new JLabel("Password :"); lblNewLabel_1_3.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_1_3.setBounds(73, 325, 84, 25); frmRegisterForm.getContentPane().add(lblNewLabel_1_3); JLabel lblNewLabel_1_4 = new JLabel("City:"); lblNewLabel_1_4.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_1_4.setBounds(110, 470, 54, 25); frmRegisterForm.getContentPane().add(lblNewLabel_1_4); lblNewLabel_5 = new JLabel("Confirm Password :"); lblNewLabel_5.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_5.setBounds(10, 398, 145, 25); frmRegisterForm.getContentPane().add(lblNewLabel_5); textNom = new JTextField(); textNom.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent arg0) { lblNewLabel_2.setText(""); } }); textNom.setFont(new Font("Tahoma", Font.BOLD, 15)); textNom.setToolTipText(""); textNom.setBounds(230, 104, 223, 33); frmRegisterForm.getContentPane().add(textNom); textNom.setColumns(10); textPrenom = new JTextField(); textPrenom.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { lblNewLabel_3.setText(""); } }); textPrenom.setFont(new Font("Tahoma", Font.BOLD, 15)); textPrenom.setColumns(10); textPrenom.setBounds(230, 175, 223, 33); frmRegisterForm.getContentPane().add(textPrenom); textLogin = new JTextField(); textLogin.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { lblNewLabel_4.setText(""); } }); textLogin.setFont(new Font("Tahoma", Font.BOLD, 15)); textLogin.setColumns(10); textLogin.setBounds(230, 250, 223, 33); frmRegisterForm.getContentPane().add(textLogin); textPassword = new JPasswordField(); textPassword.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { lblNewLabel_6.setText(""); } }); textPassword.setBounds(230, 323, 220, 33); frmRegisterForm.getContentPane().add(textPassword); Confirmpassword = new JPasswordField(); Confirmpassword.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { lblNewLabel_7.setText(""); } }); Confirmpassword.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { ValidatePassword(); } }); Confirmpassword.setBounds(230, 396, 223, 33); frmRegisterForm.getContentPane().add(Confirmpassword); btnRegister = new JButton("Register"); btnRegister.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ValidatePassword(); Register(); } }); textVille = new JTextField(); textVille.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { lblNewLabel_8.setText(""); } }); textVille.setFont(new Font("Tahoma", Font.BOLD, 15)); textVille.setColumns(10); textVille.setBounds(230, 466, 223, 33); frmRegisterForm.getContentPane().add(textVille); btnRegister.setFont(new Font("Tahoma", Font.BOLD, 15)); btnRegister.setBounds(70, 612, 99, 33); frmRegisterForm.getContentPane().add(btnRegister); btnReset = new JButton("Reset"); btnReset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Clear(); } }); btnReset.setFont(new Font("Tahoma", Font.BOLD, 15)); btnReset.setBounds(199, 612, 106, 33); frmRegisterForm.getContentPane().add(btnReset); btnClose = new JButton("Close"); btnClose.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frmRegisterForm.dispose(); } }); btnClose.setFont(new Font("Tahoma", Font.BOLD, 15)); btnClose.setBounds(331, 612, 106, 33); frmRegisterForm.getContentPane().add(btnClose); lblNewLabel_2 = new JLabel(""); lblNewLabel_2.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_2.setForeground(Color.RED); lblNewLabel_2.setBounds(240, 142, 213, 22); frmRegisterForm.getContentPane().add(lblNewLabel_2); lblNewLabel_3 = new JLabel(""); lblNewLabel_3.setForeground(Color.RED); lblNewLabel_3.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_3.setBounds(240, 214, 213, 25); frmRegisterForm.getContentPane().add(lblNewLabel_3); lblNewLabel_4 = new JLabel(""); lblNewLabel_4.setForeground(Color.RED); lblNewLabel_4.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_4.setBounds(240, 287, 213, 25); frmRegisterForm.getContentPane().add(lblNewLabel_4); lblNewLabel_6 = new JLabel(""); lblNewLabel_6.setForeground(Color.RED); lblNewLabel_6.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_6.setBounds(240, 359, 210, 26); frmRegisterForm.getContentPane().add(lblNewLabel_6); lblNewLabel_7 = new JLabel(""); lblNewLabel_7.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_7.setForeground(Color.RED); lblNewLabel_7.setBounds(240, 437, 241, 25); frmRegisterForm.getContentPane().add(lblNewLabel_7); lblNewLabel_8 = new JLabel(""); lblNewLabel_8.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_8.setForeground(Color.RED); lblNewLabel_8.setBounds(240, 504, 213, 25); frmRegisterForm.getContentPane().add(lblNewLabel_8); JButton btnNewButton = new JButton("Login"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Login login = new Login(); frmRegisterForm.dispose(); } }); btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 15)); btnNewButton.setBounds(199, 656, 106, 33); frmRegisterForm.getContentPane().add(btnNewButton); lblNewLabel_9 = new JLabel("User Type:"); lblNewLabel_9.setFont(new Font("Tahoma", Font.BOLD, 15)); lblNewLabel_9.setBounds(68, 531, 99, 33); frmRegisterForm.getContentPane().add(lblNewLabel_9); cmbType = new JComboBox(); cmbType.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent arg0) { lblNewLabel_10.setText(""); } }); cmbType.setFont(new Font("Tahoma", Font.BOLD, 15)); cmbType.setModel(new DefaultComboBoxModel(new String[] {"admin", "user"})); cmbType.setBounds(234, 531, 219, 33); frmRegisterForm.getContentPane().add(cmbType); lblNewLabel_10 = new JLabel(""); lblNewLabel_10.setForeground(Color.RED); lblNewLabel_10.setFont(new Font("Tahoma", Font.BOLD, 11)); lblNewLabel_10.setBounds(244, 575, 209, 26); frmRegisterForm.getContentPane().add(lblNewLabel_10); } public void Clear() { textNom.setText(""); textPrenom.setText(""); textLogin.setText(""); textPassword.setText(""); Confirmpassword.setText(""); textVille.setText(""); textNom.requestFocus(); } public void Register() { String nom = textNom.getText(); String prenom = textPrenom.getText(); String login = textLogin.getText(); String ville = textVille.getText(); String password = textPassword.getText(); String confirmpassword = Confirmpassword.getText(); String type = cmbType.getSelectedItem().toString(); if (textNom.getText().trim().isEmpty() && textPrenom.getText().trim().isEmpty() && textLogin.getText().trim().isEmpty() && textPassword.getText().trim().isEmpty() && Confirmpassword.getText().trim().isEmpty()&& textVille.getText().trim().isEmpty()) { lblNewLabel_2.setText("* le champ nom est vide !!"); lblNewLabel_3.setText("* le champ prenom est vide !!"); lblNewLabel_4.setText("* le champ login est vide !!"); lblNewLabel_6.setText("* le champ password est vide !!"); lblNewLabel_7.setText("* le champ confirmpassword est vide !!"); lblNewLabel_8.setText("* le champ ville est vide !!"); } else if(textNom.getText().trim().isEmpty()) { lblNewLabel_2.setText("le champ nom est vide !!"); } else if(textPrenom.getText().trim().isEmpty()) { lblNewLabel_3.setText("le champ prenom est vide !!"); } else if(textLogin.getText().trim().isEmpty()) { lblNewLabel_4.setText("le champ login est vide !!"); } else if(textPassword.getText().trim().isEmpty()) { lblNewLabel_6.setText("le champ password est vide !!"); } else if(Confirmpassword.getText().trim().isEmpty()) { lblNewLabel_7.setText("le champ confirmpassword est vide !!"); } else if(textVille.getText().trim().isEmpty()){ lblNewLabel_8.setText("le champ ville est vide !!"); } else { try { Class.forName("com.mysql.cj.jdbc.Driver"); connexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/gestion_formations", "root", ""); stmt = connexion.prepareStatement("insert into employe(nom, prenom, login, password, confirm_password, ville, type_user)values(?,?,?,?,?,?,?)"); stmt.setString(1,nom); stmt.setString(2,prenom); stmt.setString(3,login); stmt.setString(4,password); stmt.setString(5,confirmpassword); stmt.setString(6,ville); stmt.setString(7,type); stmt.execute(); JOptionPane.showMessageDialog(btnRegister, "You have been successfully registered"); Clear(); } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } public void ValidatePassword() { String password = textPassword.getText(); String confirmpassword = Confirmpassword.getText(); if(!password.equals(confirmpassword)) { JOptionPane.showMessageDialog(btnRegister, "Password does not match, please check"); Confirmpassword.requestFocus(); } } }
import java.util.Scanner; public class Add { int a; int b; int c; Scanner scan = new Scanner(System.in); Add() { System.out.print("Enter Fisrt Number : "); a = scan.nextInt(); System.out.print("Enter Second Number : "); b = scan.nextInt(); } Add(int a,int b) { this.a = a; this.b = b; } void add() { c = a + b; } void disp() { System.out.println("First value is "+a+"\nSecond Value is "+b); System.out.println("Sum is "+c); } }
package com.example.demo.api; //import com.example.demo.APIConsumer; import com.example.demo.api.entities.BudgetBreakdown; import com.example.demo.domain.Country; import com.example.demo.services.CountryService; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; import java.util.List; //import com.example.demo.repos.EuroExchangeRatesRepository; @RestController @RequestMapping("/api/v1/countries") @RequiredArgsConstructor public class CountryController { private final CountryService countryService; @GetMapping public ResponseEntity<List<Country>> fetchAllCountries() { return ResponseEntity.ok(countryService.getAllCountries()); } @GetMapping("/calculateBudget") public ResponseEntity<BudgetBreakdown> calculateBudget(@RequestParam String startingCountry, BigDecimal budgetPerCountry, BigDecimal totalBudget, String currency) { return ResponseEntity.ok(countryService.calculateBudget(startingCountry, budgetPerCountry, totalBudget, currency)); } }
package com.ys.service.topic; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; /** * Created by yushi on 2017/3/21. */ @RequestMapping("/topic") @ResponseBody public interface TopicService { @RequestMapping(value = "/product", method = RequestMethod.GET) public void product() throws Exception; @RequestMapping(value = "/consumer", method = RequestMethod.GET) public void consumer() throws InterruptedException; }
package dao; import entity.Profesion; public interface ProfesionDAO extends GenericDAO<Profesion> { }
import java.util.*; class multiplegreat { public static void main(String args[]) { int n,i,b=0; Scanner in = new Scanner(System.in); n=in.nextInt(); int a[]=new int[n]; for(i=0;i<n;i++){ a[i]=in.nextInt(); } Arrays.sort(a); int p=a.length-1; int y=a.length-2; b=a[p] * a[y]; System.out.println(""+b); }}
package model; import controller.Controller; import java.io.*; import java.net.Socket; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Timer; import java.util.TimerTask; public class SocketController extends Timer { private final Socket socket; private String interlocutorNickname; private final byte[] interlocutorIP; private DataInputStream in; private DataOutputStream out; private final Cryptographer cryptographer; SocketController(String nickname, Socket client) { this.socket = client; this.interlocutorIP = client.getInetAddress().getAddress(); try { in = new DataInputStream(new BufferedInputStream(client.getInputStream())); out = new DataOutputStream(new BufferedOutputStream(client.getOutputStream())); } catch (IOException e) { System.out.println("Error: failed get input/output streams (SocketController class)"); } cryptographer = new Cryptographer(); sayHello(nickname); this.scheduleAtFixedRate(getMessageTask, 0, 800); } // give(get) to(from) interlocutor 1) RSA public key, 2) AES secret key, 3) nickname private void sayHello(String nickname) { sendWithoutEncode(cryptographer.getPublicKeyBytes()); cryptographer.setInterlocutorPublicKey(getMessage(true)); delay(10); sendWithoutEncode(cryptographer.getEncodedSecretKey()); cryptographer.setInterlocutorSecretKey(getMessage(true)); delay(10); send(nickname.getBytes()); interlocutorNickname = new String(cryptographer.decode(getMessage(true))); } public void delay(int millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); } } // message listener (period = 0.8 second) TimerTask getMessageTask = new TimerTask() { @Override public void run() { byte[] message = getMessage(false); // read from socket only one time if (message == null) return; // there is no new message message = cryptographer.decode(message); byte[] goodbyeMessage = "terminateCurrentSession".getBytes(StandardCharsets.UTF_8); if (Arrays.equals(message, goodbyeMessage)) Controller.getInstance().sessionCompleted(interlocutorIP); else Controller.getInstance().newMessageFromInterlocutor(message); } }; // receive new message from socket // loop == false => 1 attempt // loop == true => until the message arrives private byte[] getMessage(boolean loop) { byte[] data = null; do { try { if (in.available() > 0) { loop = false; data = new byte[in.available()]; for (int i = 0; i < data.length; i++) data[i] = in.readByte(); } } catch (IOException e) { System.out.println("Error: failed to read bytes from socket (SocketController class)"); } } while (loop); return data; } // returns: true == success / false == fail public boolean sendWithoutEncode(byte[] data) { try { out.write(data); out.flush(); return true; } catch (IOException e) { return false; } } // returns: true == success / false == fail public boolean send(byte[] data) { try { out.write(cryptographer.encode(data)); out.flush(); return true; } catch (IOException e) { return false; } } public void sayGoodbye() { send("terminateCurrentSession".getBytes(StandardCharsets.UTF_8)); } // destroy current connection public void stop() { this.cancel(); try { in.close(); out.close(); socket.close(); } catch (IOException e) { System.out.println("Error: failed to stop the client (SocketController class)"); } } public byte[] getIP() { return interlocutorIP; } public String getInterlocutorNickname() { return interlocutorNickname; } public boolean isClosed() { return socket.isClosed(); } }
package git.akka.cluster.client; import akka.actor.ActorPath; import akka.actor.ActorPaths; import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.Props; import akka.cluster.client.ClusterClient; import akka.cluster.client.ClusterClientSettings; import akka.dispatch.OnSuccess; import static akka.pattern.Patterns.ask; import akka.util.Timeout; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.concurrent.TimeUnit; import scala.concurrent.ExecutionContext; import scala.concurrent.duration.Duration; import scala.concurrent.duration.FiniteDuration; /** * * @author gaston */ public class ClusterClientApplication { public static void main(String[] args) throws Exception { Config config = ConfigFactory.parseString( "akka.remote.netty.tcp.port=0"). withFallback(ConfigFactory.parseString("akka.cluster.roles = [front]")). withFallback(ConfigFactory.load()); ActorSystem system = ActorSystem.create("ClusterSystem", config); final ActorRef clusterClient = system.actorOf(ClusterClient.props( ClusterClientSettings.create(system).withInitialContacts(initialContacts())), "client"); ActorRef hijo = system.actorOf(Props.create(AkkaClusterClient.class, clusterClient), "frontClient"); final FiniteDuration interval = Duration.create(30, TimeUnit.SECONDS); final Timeout timeout = new Timeout(Duration.create(10, TimeUnit.SECONDS)); final ExecutionContext ec = system.dispatcher(); system.scheduler().schedule(interval, interval, () -> { ask(hijo, "Va un mensaje", timeout).onSuccess(new OnSuccess<Object>() { @Override public void onSuccess(Object result) { System.out.println(result); } }, ec); }, ec); } static Set<ActorPath> initialContacts() { return new HashSet<ActorPath>(Arrays.asList( ActorPaths.fromString("akka.tcp://ClusterSystem@127.0.0.1:2551/system/receptionist"), ActorPaths.fromString("akka.tcp://ClusterSystem@127.0.0.1:2552/system/receptionist"))); } }
package com.company; import java.util.Scanner; public class Main { private static Scanner input = new Scanner(System.in); public static void main(String[] args) { Triangle a = new Triangle(new Point(1, 2), new Point(2, 3), new Point(3, 6)); a.show(); System.out.println(a.getFirst().getLengthBetweenPoints(a.getSecond())); System.out.println(a.getSecond().getLengthBetweenPoints(a.getThird())); System.out.println(a.getThird().getLengthBetweenPoints(a.getFirst())); System.out.println(a.getPerimeter()); System.out.println(a.getSquare()); } }
/** * 时间自然语言分析工具类: TimeNLPUtil<br> * * 注意:NLP会有一定的识别失败率,在不断迭代开发提高成功率 * * @author xkzhangsan */ package com.xkzhangsan.time.nlp;
package com.main; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static void main(String[] args) { final long startTime = System.currentTimeMillis(); HashMap<String, Integer> myDictionary = new HashMap<String, Integer>(); HashMap<String, Integer> myStemmedDictionay = new HashMap<String, Integer>(); String cranfield_path = ""; Scanner in = new Scanner(System.in); // Get the path of Cranfield folder from the user System.out.println("Enter the complete path of the Cranfield documents directory"); cranfield_path = in.next(); // Part - 1 Tokenizing Tokenizer myTokenizer = new Tokenizer(cranfield_path); myDictionary = myTokenizer.tokenize(); myTokenizer.getStats(); // Part - 2 Stemming Stemmer s = new Stemmer(myTokenizer.getFileCount()); for(Map.Entry<String, Integer> e: myDictionary.entrySet()) { String currentString = e.getKey(); int currentCount = e.getValue(); int stringLength = currentString.length(); char[] w = currentString.toCharArray(); for(int i = 0; i < stringLength; i++) { s.add(w[i]); } s.stem(); String u; u = s.toString(); s.addStemToDictionary(u, currentCount); } s.getStats(); final long endTime = System.currentTimeMillis(); System.out.println("Total time taken : " + (endTime - startTime)); } }
package graphana.operationsystem; import global.ConversionOps; import graphana.ExecutionManager; import graphana.UserInterface; import graphana.graphs.GraphLibrary; import graphana.graphs.exceptions.InvalidGraphConfigException; import graphana.model.Option; import graphana.script.bindings.basictypes.GEdge; import graphana.script.bindings.basictypes.GVertex; import graphana.script.execution.ExecutionTimeout; import libraries.jung.JungLib; import scriptinterface.CallMetadataFactory; import scriptinterface.execution.returnvalues.ExecutionError; import scriptinterface.execution.returnvalues.ExecutionErrorMessage; import scriptinterface.execution.returnvalues.ExecutionReturn; /** * Operation that operates on a given graph. This includes modifying, processing etc. * * @author Andreas Fender */ public abstract class GraphOperation extends Operation { private GraphLibrary<?, ?>[] compatibleLibs; private boolean directedAllowed = true, loopsAllowed = true, emptyAllowed = true, alwaysConvertToDirected = false, alwaysCopy = false, statusDeletion = false; /** * Called, whenever a valid operation invokation was done which means that general errors and warnings are caught * before the method is called. * * @param graph the graph on which the operation is to be applied * @param userInterface the user interface * @param args the arguments with which the operation was called */ protected abstract <VertexType, EdgeType> ExecutionReturn execute(GraphLibrary<VertexType, EdgeType> graph, UserInterface userInterface, OperationArguments args); /** * Execution of the graph operation. This method is called when the user or a script invokes the graph operation. * * @param graph the input graph. * @param mainControl access to the main control of the program. * @param args evaluated arguments of the call. * @param inputKey the original string with which this command was called in the script or by the user. * @return the return value of the execution (can be an ExecutionError as well). */ @SuppressWarnings({"unchecked", "rawtypes"}) public <VertexType, EdgeType> ExecutionReturn execute(GraphLibrary<VertexType, EdgeType> graph, ExecutionManager mainControl, ExecutionReturn[] args, CallMetadataFactory callMetaData, String inputKey) { ExecutionError callError = parameterTuple.checkCall(args); if (callError != null) return callError; UserInterface curUI = mainControl.getUserInterface(); //Check configuration if (graph == null) return new ExecutionErrorMessage("No graph given.", "NO_GRAPH"); if (!isEmptyAllowed() && graph.isEmpty()) return new ExecutionErrorMessage("Graph is empty.", "EMPTY_GRAPH"); if (!this.loopsAllowed && !isLoopFree(graph)) return new ExecutionErrorMessage("Graph must be loop-free.", "GRAPH_NOT_LOOP_FREE"); //Graph conversion GraphLibrary<?, ?> curGraph = graph; boolean libCompatible = true; boolean dirConverted = isAlwaysConvertToDirected() && !graph.isDirected(); if (dirConverted) { //Convert to directed curGraph = getStdLibInstance(); try { graph.copyToGraph(curGraph, Option.FORCETRUE, Option.KEEP, Option.KEEP, curUI); } catch (InvalidGraphConfigException e) { return new ExecutionErrorMessage("Cannot convert to directed graph (not supported by " + curGraph .getLibName() + ")", "CANNOT_CONVERT"); } } else { if (!checkGraphDirected(curGraph)) return new ExecutionErrorMessage("Directed not allowed.", "GRAPH_DIRECTED"); //Lib compatibility libCompatible = allLibsCompatible(); for (int i = 0; i < getCompatibleLibCount(); i++) if (ConversionOps.extendsClass(curGraph.getClass(), getCompatibleLib(i))) { libCompatible = true; break; } if (!libCompatible) { curGraph = getStdLibInstance(); try { curUI.setProgressMessage(this.getMainKey() + " uses " + curGraph.getLibName() + ". Converting " + "graph..."); graph.copyToGraph(curGraph, Option.KEEP, Option.KEEP, Option.KEEP, curUI); curUI.hideProgressOutput(); } catch (InvalidGraphConfigException e) { return new ExecutionErrorMessage("Cannot convert to " + curGraph.getLibName() + ": " + e .getMessage(), "CANNOT_CONVERT"); } curUI.warningOutputFac("Current graph incompatible -> " + graph.getLibName() + " temporally " + "converted" + " to " + curGraph.getLibName() + ".", callMetaData); curUI.clearProgressMessage(); } else if (isAlwaysCopy()) { curGraph = getStdLibInstance(); try { curUI.setProgressMessage("Copying graph..."); graph.copyToGraph(curGraph, isAlwaysConvertToDirected() ? Option.FORCETRUE : Option.KEEP, Option .KEEP, Option.KEEP, curUI); curUI.hideProgressOutput(); } catch (InvalidGraphConfigException e) { mainControl.getUserInterface().hideProgressOutput(); return new ExecutionErrorMessage("Cannot convert to directed graph (not supported by " + graph .getLibName() + ")", "CANNOT_CONVERT"); } } } if (dirConverted && isDirectedAllowed()) curUI.warningOutputFac("Undirected graph temporally converted to directed graph.", callMetaData); //Transfer vertex and edge arguments if (curGraph != graph) { for (int i = 0; i < args.length; i++) { if (args[i] instanceof GEdge) { EdgeType edge = ((GEdge<VertexType, EdgeType>) args[i]).getValue(); String startVertexIdent = graph.getVertexIdent(graph.getStartVertex(edge)); String endVertexIdent = graph.getVertexIdent(graph.getEndVertex(edge)); args[i] = new GEdge(curGraph, curGraph.getEdgeByIdent(startVertexIdent, endVertexIdent)); } if (args[i] instanceof GVertex) { String vertexIdent = graph.getVertexIdent(((GVertex<VertexType>) args[i]).getValue()); args[i] = new GVertex(curGraph.getVertexByIdent(vertexIdent)); } } } OperationArguments execArgs = new OperationArguments(graph, args, this, mainControl, callMetaData, inputKey); //Execution boolean algoTimerActive = mainControl.isAlgoTimerActive(); curGraph.setBlockCacheOutput(!mainControl.isCachingOn() || algoTimerActive || mainControl.getUserInterface() .isAlgorithmVisualizationActive()); if (this instanceof GraphAlgorithm) curGraph.clearStates(true); OperationThread algoThread = new OperationThread(mainControl, curGraph, this, execArgs); curUI.setOperationThread(algoThread); long timeOut = (!(this instanceof GraphAlgorithm) || curUI.isAlgorithmVisualizationActive() || mainControl .getAlgorithmTimeout() == 0) ? 0 : mainControl.getAlgorithmTimeout(); algoThread.run(timeOut); curUI.removeOperationThread(); if (algoTimerActive && (this instanceof GraphAlgorithm)) mainControl.incAlgorithmTimer(algoThread.getExecutionTime()); curGraph.setBlockCacheOutput(false); if (!algoThread.isExecutionFinished()) { curUI.hideProgressOutput(); switch (algoThread.getFinishType()) { case STOPPEDBYUSER: return new ExecutionErrorMessage("Stopped by user.", "STOPPED_BY_USER"); case TIMEOUT: return new ExecutionTimeout(mainControl.getAlgorithmTimeout()); case CANCELLEDBYPROGRAM: return ExecutionReturn.VOID; default: return new ExecutionErrorMessage("Thread error", "THREAD_ERROR"); } } if (this.isStatusDeletion()) curGraph.clearStates(true); ExecutionReturn res = algoThread.getResult(); curUI.hideProgressOutput(); return res; } /** * Sets the libraries which the operation is compatible with. If this method is never called, then it is assumed * that the graph operation is compatible with any graph library, which means, that it only uses the high-level * methods of GraphLibrary without accessing the internal graph directly. * * @param compatibleLibs an array of instances of GraphLibrary. The instances do not need to be initialized, only * constructed. */ protected final void setCompatibleLibs(GraphLibrary<?, ?>[] compatibleLibs) { this.compatibleLibs = compatibleLibs; } /** * Does the same as setCompatibleLibs() but sets only one GraphLibrary instead of multiple ones. * * @param compatibleLib the only graph library which the graph operation is compatible with. */ protected final void setCompatibleLib(GraphLibrary<?, ?> compatibleLib) { if (compatibleLib == null) setCompatibleLibs(null); else setCompatibleLibs(new GraphLibrary[]{compatibleLib}); } /** * Defines the graph configurations which the graph operation is compatible with. * * @param directedAllowed if true, then the input graph can be directed. * @param loopsAllowed if true, then the input graph may contain loops. * @param emptyAllowed if true, then the input graph may be empty. */ protected final void setAllowedGraphConfig(boolean directedAllowed, boolean loopsAllowed, boolean emptyAllowed) { this.directedAllowed = directedAllowed; this.loopsAllowed = loopsAllowed; this.emptyAllowed = emptyAllowed; } /** * Tells whether or not states are deleted after the operation is finished. * * @return true iff states are deleted after the operation is finished. */ public final boolean isStatusDeletion() { return this.statusDeletion; } /** * Tells whether or not vertex and edge states are deleted after the operation call */ protected final void setStatusDeletion(boolean deleteStatus) { this.statusDeletion = deleteStatus; } /** * Tells whether or not the input graph is allowed to be directed. * * @return true iff directed graphs are allowed as input. */ public final boolean isDirectedAllowed() { return this.directedAllowed; } /** * Tells whether or not the input graph is allowed to have loops. * * @return true iff graphs with loops are allowed as input. */ public final boolean isLoopsAllowed() { return loopsAllowed; } /** * Tells whether or not the input graph is allowed to be empty. * * @return true iff empty graphs are allowed as input. */ public final boolean isEmptyAllowed() { return this.emptyAllowed; } /** * Checks whether the input graph satisfies the directed precondition. * * @param graph the input graph for the graph operation. * @return true, iff directed graphs are allowed or the graph is undirected. */ public final boolean checkGraphDirected(GraphLibrary<?, ?> graph) { return (directedAllowed || !graph.isDirected()); } /** * Checks whether the input graph is loop-free. * * @param graph the input graph for the graph operation. * @return true, iff graphs with loops are allowed or the graph does not have any loops. */ public final boolean isLoopFree(GraphLibrary<?, ?> graph) { return (graph.isForceLoopFree() || graph.isLoopFree()); } /** * If this method is called during initialization then the input graph of the execute method is always directed. */ protected final void setAlwaysConvertToDirected() { this.alwaysConvertToDirected = true; } /** * Tells whether or not input graphs are converted into directed graphs whenever this graph operation is called. * * @return true iff input graphs are always converted into directed graphs. */ public final boolean isAlwaysConvertToDirected() { return this.alwaysConvertToDirected; } /** * If this method is called during initialization then the input graph of the execute method is always a deep * copy of the original graph. So modifications will never affect the original graph. */ protected final void setAlwaysCopy() { this.alwaysCopy = true; } /** * Tells whether or not input graphs are always copied before the graph operation is applied. * * @return true, iff there is always a deep copy of the input graph created before executing the graph operation. */ public final boolean isAlwaysCopy() { return this.alwaysCopy; } /** * Returns true iff the input graph satisfies the allowed graph configuration. * * @param graph the input graph to check. * @return true iff the input graph is valid for this graph operation. */ public final boolean checkGraphConfig(GraphLibrary<?, ?> graph) { return checkGraphDirected(graph) && isLoopFree(graph); } /** * Returns the number of graph libraries with which the graph operation can be called or -1 if it is compatible * with all graph libraries. * * @return the number of graph libraries with which the graph operation can be called or -1 if it is compatible * with all graph libraries. */ public final int getCompatibleLibCount() { if (compatibleLibs == null) return -1; else return compatibleLibs.length; } /** * Returns the compatible graph library with the given index. * * @param libIndex the index of the compatible graph library. * @return the compatible graph library or null if the index is out of bounds. */ @SuppressWarnings("rawtypes") public Class<? extends GraphLibrary> getCompatibleLib(int libIndex) { if (compatibleLibs[libIndex] == null) return GraphLibrary.class; if (libIndex < 0 || libIndex > compatibleLibs.length) return null; else return compatibleLibs[libIndex].getClass(); } /** * Returns an instance of a subclass of GraphLibrary of the compatible graph library at the given index. * * @param libIndex the index of the compatible graph library. * @return an uninitialized instance of a subclass of GraphLibrary of the compatible graph library at the given * index. */ public GraphLibrary<?, ?> getLibInstance(int libIndex) { try { return compatibleLibs[libIndex].getClass().newInstance(); } catch (Exception ex) { return null; } } /** * Returns an instance of a subclass of GraphLibrary of the preferred compatible graph library. * * @return an instance of a subclass of GraphLibrary of the preferred compatible graph library. */ public GraphLibrary<?, ?> getStdLibInstance() { if (compatibleLibs == null || compatibleLibs.length == 0) return new JungLib(); return getLibInstance(0); } /** * Tells whether or not this graph operation can be called with any graph library. * * @return true iff this graph operation is compatible with every graph library. */ public boolean allLibsCompatible() { return (compatibleLibs == null || compatibleLibs.length == 0); } @Override public String getOperationTypeAsString() { return "Graph operation"; } }
package com.iwars.mine.Adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import com.iwars.mine.Model.ModelListGigi; import com.iwars.mine.R; import java.util.List; public class AdapterListGigi extends RecyclerView.Adapter<AdapterListGigi.HolderData> { private List<ModelListGigi> mItems ; private Context context; public AdapterListGigi(Context context, List<ModelListGigi> items) { this.mItems = items; this.context = context; } @Override public AdapterListGigi.HolderData onCreateViewHolder(ViewGroup parent, int viewType) { View layout = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_gigi,parent,false); AdapterListGigi.HolderData holderData = new AdapterListGigi.HolderData(layout); return holderData; } @Override public void onBindViewHolder(AdapterListGigi.HolderData holder, int position) { ModelListGigi md = mItems.get(position); //holder.tvtanggal.setText(md.getTanggal()); holder.tvno.setText(md.getNo_antrian()); holder.tvnama.setText(md.getNama()); holder.tvstatus.setText(md.getKet_status()); holder.md = md; } @Override public int getItemCount() { return mItems.size(); } class HolderData extends RecyclerView.ViewHolder { TextView tvtanggal,tvstatus,tvno, tvnama; ModelListGigi md; public HolderData (View view) { super(view); //tvtanggal = (TextView) view.findViewById(R.id.tanggal); tvno = (TextView) view.findViewById(R.id.no_antrian); tvnama = (TextView) view.findViewById(R.id.nama); tvstatus = (TextView) view.findViewById(R.id.ket_status); } } }
package dev.borowiecki.home.after_week_2.company.standard; public abstract class Employee { }
package com.kareo.ui.codingcapture.implementation.request; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by narendral on 10/08/15. */ @JsonIgnoreProperties(ignoreUnknown = true) public class ProcedureCodesRequest { @JsonProperty("CustomerID") private Long customerId; @JsonProperty("SearchString") private String searchString; public ProcedureCodesRequest(Long customerId, String searchString) { this.customerId = customerId; this.searchString = searchString; } public String getSearchString() { return searchString; } public void setSearchString(String searchString) { this.searchString = searchString; } public Long getCustomerId() { return customerId; } public void setCustomerId(Long customerId) { this.customerId = customerId; } }
package topcoder_crawler.rank; import topcoder_crawler.model.Challenge; import java.util.List; public interface Rankable { List<Challenge> rank(); }
package org.maven.ide.eclipse.authentication; import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; public interface ISecurityRealmPersistence { String EXTENSION_POINT_ID = "org.maven.ide.eclipse.authentication.SecurityRealmPersistence"; String ATTR_PRIORITY = "priority"; public int getPriority(); Set<IAuthRealm> getRealms( IProgressMonitor monitor ) throws SecurityRealmPersistenceException; void addRealm( IAuthRealm realm, IProgressMonitor monitor ) throws SecurityRealmPersistenceException; void updateRealm( IAuthRealm realm, IProgressMonitor monitor ) throws SecurityRealmPersistenceException; void deleteRealm( String realmId, IProgressMonitor monitor ) throws SecurityRealmPersistenceException; Set<ISecurityRealmURLAssoc> getURLToRealmAssocs( IProgressMonitor monitor ) throws SecurityRealmPersistenceException; ISecurityRealmURLAssoc addURLToRealmAssoc( ISecurityRealmURLAssoc securityRealmURLAssoc, IProgressMonitor monitor ) throws SecurityRealmPersistenceException; void updateURLToRealmAssoc( ISecurityRealmURLAssoc securityRealmURLAssoc, IProgressMonitor monitor ) throws SecurityRealmPersistenceException; void deleteURLToRealmAssoc( String urlAssocId, IProgressMonitor monitor ) throws SecurityRealmPersistenceException; /** * @return true only if this instance is the one used by the AuthRegistry for security realm persistence. */ boolean isActive(); /** * Used by the AuthRegistry to indicate that this instance is the one used by the AuthRegistry for security realm * persistence. */ void setActive( boolean active ); }
package id.ac.ub.ptiik.papps.base; public class User { public String username; public String password; public String nama; public String gelar_awal; public String gelar_akhir; public String karyawan_id; public String role; public int level; public int status; public String getNamaGelar() { String nama = this.nama; if(gelar_awal != null && !gelar_awal.equals("null") && !gelar_awal.trim().equals("")) nama = gelar_awal + " " + nama; if(gelar_akhir != null && !gelar_akhir.equals("null") && !gelar_akhir.trim().equals("")) nama = nama + ", " + gelar_akhir; return nama; } }
package com.tencent.mm.plugin.appbrand.jsapi.audio; import com.tencent.mm.plugin.appbrand.ipc.AppBrandMainProcessService; import com.tencent.mm.plugin.appbrand.jsapi.a; import com.tencent.mm.plugin.appbrand.l; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import org.json.JSONObject; public final class JsApiStopPlayVoice extends a { public static final int CTRL_INDEX = 35; public static final String NAME = "stopVoice"; public final void a(l lVar, JSONObject jSONObject, int i) { String optString = jSONObject.optString("localId"); x.i("MicroMsg.JsApiStopPlayVoice", "doStopVoice, appId : %s, localId : %s", new Object[]{lVar.mAppId, optString}); AppBrandMainProcessService.a(new StopPlayVoice((byte) 0)); lVar.E(i, f("ok", null)); JsApiStartPlayVoice.fIW = null; } public static void ahZ() { if (!bi.oW(JsApiStartPlayVoice.fIW)) { AppBrandMainProcessService.a(new StopPlayVoice((byte) 0)); JsApiStartPlayVoice.fIW = null; } } }
public class PumpGasUnit1 extends PumpGasUnit { Data1 d; public PumpGasUnit1(Data data) { d=(Data1)data; } @Override public void PumpGasUnit() { d.setG(d.getG()+1); d.setTotal(d.getPrice()*d.getG()); } }
package com.swqs.schooltrade.entity; import java.io.Serializable; import java.sql.Date; public class Judgement implements Serializable { private Date createDate; private Date editDate; Integer id; Goods goods; User judgeAcc; String text; public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public Date getEditDate() { return editDate; } public void setEditDate(Date editDate) { this.editDate = editDate; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Goods getGoods() { return goods; } public void setGoods(Goods goods) { this.goods = goods; } public User getJudgeAcc() { return judgeAcc; } public void setJudgeAcc(User judgeAcc) { this.judgeAcc = judgeAcc; } public String getText() { return text; } public void setText(String text) { this.text = text; } }
package com.techelevator.tenmo.dao; import java.util.ArrayList; import java.util.List; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.stereotype.Component; import com.techelevator.tenmo.dao.TransferDAO; import com.techelevator.tenmo.model.Transfer; @Component public class JDBCTransferDAO implements TransferDAO{ private JdbcTemplate jdbc; public JDBCTransferDAO (JdbcTemplate jdbc){ this.jdbc = jdbc; } @Override public List<Transfer> transferHistory(int accountId) { List<Transfer> transferList = new ArrayList<Transfer>(); String sql = "SELECT * FROM transfers WHERE account_to = ? OR account_from = ?"; SqlRowSet result = jdbc.queryForRowSet(sql, accountId, accountId); while(result.next()) { int id = result.getInt("transfer_id"); int typeId = result.getInt("transfer_type_id"); int statusId = result.getInt("transfer_status_id"); int accountFrom = result.getInt("account_from"); int accountTo = result.getInt("account_to"); double amount = result.getDouble("amount"); Transfer transfer = new Transfer(id, typeId, statusId, accountFrom, accountTo, amount); transferList.add(transfer); } return transferList; } @Override public Transfer viewTransfer(int transferId) { Transfer transfer = null; String sql = "SELECT * FROM transfers WHERE transfer_id = ?"; SqlRowSet result = jdbc.queryForRowSet(sql, transferId); while(result.next()) { int id = result.getInt("transfer_id"); int typeId = result.getInt("transfer_type_id"); int statusId = result.getInt("transfer_status_id"); int accountFrom = result.getInt("account_from"); int accountTo = result.getInt("account_to"); double amount = result.getDouble("amount"); transfer = new Transfer(id, typeId, statusId, accountFrom, accountTo, amount); } return transfer; } @Override public Transfer createTransfer(int type, int status, int from, int to, double amount) { String sql = "INSERT INTO transfers (transfer_type_id, transfer_status_id, account_from, account_to, amount) VALUES (?, ?, ?, ?, ?)"; jdbc.update(sql, type, status, from, to, amount); String sql2 = "SELECT transfer_id FROM transfers ORDER BY transfer_id DESC LIMIT 1"; SqlRowSet result = jdbc.queryForRowSet(sql2); int id = 0; while(result.next()) { id = result.getInt("transfer_id"); } Transfer transfer = new Transfer(id, type, status, from, to, amount); return transfer; } }
package com.cms.common.form; import java.util.List; import java.util.Map; /** * @author lansb *分页相关信息 */ public class PaginForm { private int totalCount;//总数 private int numPerPage;//每页显示数量 private int pageNum;//当前页数 private List<Map<String, Object>> dataList;//数据集合 private int pageNumShown;//展示直接点击的数字 private int startNum;//开始条数 public int getStartNum() { return startNum; } public void setStartNum(int startNum) { this.startNum = startNum; } public int getPageNumShown() { return pageNumShown; } public void setPageNumShown(int pageNumShown) { this.pageNumShown = pageNumShown; } public int getPageNum() { return pageNum; } public void setPageNum(int pageNum) { this.pageNum = pageNum; } public List<Map<String, Object>> getDataList() { return dataList; } public void setDataList(List<Map<String, Object>> dataList) { this.dataList = dataList; } public int getNumPerPage() { return numPerPage; } public void setNumPerPage(int numPerPage) { this.numPerPage = numPerPage; } public int getTotalCount() { return totalCount; } public void setTotalCount(int totalCount) { this.totalCount = totalCount; } }
package com.cloudogu.smeagol.repository.infrastructure; public class MissingSmeagolPluginException extends RuntimeException { public MissingSmeagolPluginException() { super("SCM is missing Smeagol plugin"); } }
import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class IslaiduIrasas extends Irasas{ private String kategorija; private String atsiskaitymoTipas = ""; public IslaiduIrasas(float suma, Boolean pozymisArIBanka, String papildomaInfo, LocalDateTime dataIrLaikas) { super(suma, papildomaInfo, pozymisArIBanka, dataIrLaikas); // TODO Auto-generated constructor stub this.kategorija = "Islaidos"; } @Override public String toString() { if (this.getPozymisArIBanka() == true) { setAtsiskaitymoTipas("Banko pavedimas."); } else if (this.getPozymisArIBanka() == false){ setAtsiskaitymoTipas("Atsiskaitymas grynais."); } DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy.MM.dd HH:mm"); return "Data: " + dtf.format(this.getDataIrLaikas()) + "\nID#: " + this.getId() + "\nSuma: " + this.getSuma() + "\nKategorija: " + this.getKategorija()+"\nAtsiskaitymo tipas: " + this.getAtsiskaitymoTipas()+"\nPapildoma informacija: " + this.getPapildomaInfo(); } public String getAtsiskaitymoTipas() { return atsiskaitymoTipas; } public void setAtsiskaitymoTipas(String atsiskaitymoTipas) { this.atsiskaitymoTipas = atsiskaitymoTipas; } public String getKategorija() { return kategorija; } public void setKategorija(String kategorija) { this.kategorija = kategorija; } // suma // data Su Laiku // kategorija // atsiskaitymo Budas // papildoma Info // public String atsiskaitymas(){ // if (pozymisArIBanka==true) { // atsiskaitymoTipas = "Banko pavedimas."; // } else { // atsiskaitymoTipas = "Atsiskaitymas grynais."; // } return atsiskaitymoTipas; // } }
package android.support.v7.widget; import android.support.v4.view.z; import android.support.v7.widget.RecyclerView.c; class RecyclerView$o extends c { final /* synthetic */ RecyclerView RQ; private RecyclerView$o(RecyclerView recyclerView) { this.RQ = recyclerView; } /* synthetic */ RecyclerView$o(RecyclerView recyclerView, byte b) { this(recyclerView); } public final void onChanged() { this.RQ.O(null); RecyclerView.h(this.RQ); this.RQ.RB.SK = true; RecyclerView.n(this.RQ); if (!this.RQ.QP.eE()) { this.RQ.requestLayout(); } } public final void c(int i, int i2, Object obj) { Object obj2 = 1; this.RQ.O(null); e eVar = this.RQ.QP; eVar.LR.add(eVar.a(4, i, i2, obj)); eVar.LX |= 4; if (eVar.LR.size() != 1) { obj2 = null; } if (obj2 != null) { gg(); } } public final void ac(int i, int i2) { int i3 = 1; this.RQ.O(null); e eVar = this.RQ.QP; eVar.LR.add(eVar.a(1, i, i2, null)); eVar.LX |= 1; if (eVar.LR.size() != 1) { i3 = 0; } if (i3 != 0) { gg(); } } public final void ad(int i, int i2) { Object obj = 1; this.RQ.O(null); e eVar = this.RQ.QP; eVar.LR.add(eVar.a(2, i, i2, null)); eVar.LX |= 2; if (eVar.LR.size() != 1) { obj = null; } if (obj != null) { gg(); } } /* JADX WARNING: inconsistent code. */ /* Code decompiled incorrectly, please refer to instructions dump. */ public final void ae(int r6, int r7) { /* r5 = this; r4 = 0; r0 = 1; r1 = r5.RQ; r1.O(r4); r1 = r5.RQ; r1 = r1.QP; if (r6 == r7) goto L_0x002c; L_0x000d: r2 = r1.LR; r3 = 8; r3 = r1.a(r3, r6, r7, r4); r2.add(r3); r2 = r1.LX; r2 = r2 | 8; r1.LX = r2; r1 = r1.LR; r1 = r1.size(); if (r1 != r0) goto L_0x002c; L_0x0026: if (r0 == 0) goto L_0x002b; L_0x0028: r5.gg(); L_0x002b: return; L_0x002c: r0 = 0; goto L_0x0026; */ throw new UnsupportedOperationException("Method not decompiled: android.support.v7.widget.RecyclerView$o.ae(int, int):void"); } private void gg() { if (RecyclerView.o(this.RQ) && RecyclerView.p(this.RQ) && RecyclerView.q(this.RQ)) { z.a(this.RQ, RecyclerView.r(this.RQ)); return; } RecyclerView.s(this.RQ); this.RQ.requestLayout(); } }
package com.basho.riak.client.api.commands.mapreduce; public interface MapReduceInput { }
package uk.ac.ed.inf.aqmaps.simulation.planning.path; import java.util.Deque; import org.locationtech.jts.geom.Coordinate; import uk.ac.ed.inf.aqmaps.simulation.Sensor; import uk.ac.ed.inf.aqmaps.simulation.planning.ConstrainedTreeGraph; /** * Path planners create a detailed path between given route points which takes a sensor data collector * between the route points according to the path planner's constraints */ public interface PathPlanner { /** * Plans the exact path required to reach all the given sensors, the specific constraints on placed on the route are decided * by the specific implementation of the planner itself. * @param startCoordinate the starting coordinate * @param route the sensors in order they need to be accessed * @param graph the graph which defines the traversal graph * @param formLoop if true the path will lead back to the start coordinate * @return */ public Deque<PathSegment> planPath( Coordinate startCoordinate, Deque<Sensor> route, ConstrainedTreeGraph graph, boolean formLoop); }
package com.sdl.webapp.common.controller; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.model.EntityModel; import com.sdl.webapp.common.api.model.MvcData; import com.sdl.webapp.common.api.model.ViewModel; import com.sdl.webapp.common.api.model.mvcdata.DefaultsMvcData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.http.HttpServletRequest; import static com.sdl.webapp.common.api.model.mvcdata.DefaultsMvcData.CoreAreaConstants.CORE_AREA_NAME; import static com.sdl.webapp.common.api.model.mvcdata.DefaultsMvcData.CoreAreaConstants.ENTITY_CONTROLLER_NAME; import static com.sdl.webapp.common.controller.ControllerUtils.INCLUDE_PATH_PREFIX; import static com.sdl.webapp.common.controller.RequestAttributeNames.ENTITY_MODEL; /** * Entity controller for the Core area. * <p> * This handles include requests to /system/mvc/Core/Entity/{regionName}/{entityId} * </p> */ @Controller @RequestMapping(INCLUDE_PATH_PREFIX + CORE_AREA_NAME + '/' + ENTITY_CONTROLLER_NAME) public class EntityController extends BaseController { private static final Logger LOG = LoggerFactory.getLogger(EntityController.class); /** * Handles a request for an entity. * * @param request The request. * @param entityId The entity id. * @return The name of the entity view that should be rendered for this request. * @throws ContentProviderException If an error occurs so that the entity cannot not be retrieved. * @throws java.lang.Exception if any. */ @RequestMapping(method = RequestMethod.GET, value = DefaultsMvcData.CoreAreaConstants.ENTITY_ACTION_NAME + "/{entityId}") public String handleGetEntity(HttpServletRequest request, @PathVariable String entityId) throws Exception { return handleEntityRequest(request, entityId); } /** * <p>handleEntityRequest.</p> * * @param request a {@link javax.servlet.http.HttpServletRequest} object. * @param entityId a {@link java.lang.String} object. * @return a {@link java.lang.String} object. * @throws java.lang.Exception if any. */ protected String handleEntityRequest(HttpServletRequest request, String entityId) throws Exception { LOG.trace("handleGetEntity: entityId={}", entityId); final EntityModel originalModel = getEntityFromRequest(request, entityId); final ViewModel enrichedEntity = enrichModel(originalModel, request); final EntityModel entity = enrichedEntity instanceof EntityModel ? (EntityModel) enrichedEntity : originalModel; request.setAttribute(ENTITY_MODEL, entity); final MvcData mvcData = entity.getMvcData(); LOG.trace("Entity MvcData: {}", mvcData); return viewNameResolver.resolveView(mvcData, "Entity"); } }
package com.example.administrator.halachavtech.Model.Hazmana; import java.util.UUID; /** * Created by Administrator on 11/01/2017. */ public class Rav { private String name; private String surname; private String uuid; public Rav() { } public Rav(String name, String surname, String uuid) { this.name = name; this.surname = surname; this.uuid = uuid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } @Override public String toString() { return "Rav{" + "name='" + name + '\'' + ", surname='" + surname + '\'' + ", uuid=" + uuid + '}'; } }
package emp.application.service; import java.util.LinkedList; import java.util.List; import java.util.Queue; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import emp.application.model.Organization; import emp.application.repository.OrganizationRepository; @Service @Transactional public class OrganizationService { @Autowired private OrganizationRepository organizationRepository; @PersistenceContext private EntityManager em; private static final Logger logger = Logger.getLogger(OrganizationService.class); @Transactional(readOnly = true) //@Cacheable("orgList") public List<Organization> findAll() { return organizationRepository.findAll(); } public Organization save(Organization organization) { /* try { em.persist(role); logger.info("persist"); } catch (Exception e) { logger.error("Persist Exception", e);*/ organization = em.merge(organization); logger.info("Merge"); /* }*/ return organization; } public void delete(Organization org) { Queue<Organization> queueOrganizations = new LinkedList<Organization>(); queueOrganizations.add(org); while (!queueOrganizations.isEmpty()) { Organization organization = queueOrganizations.remove(); queueOrganizations.addAll(organization.getChildOrganizations()); organization = em.merge(organization); em.remove(organization); } } public Organization findById(int Id) { return organizationRepository.findById(Id); } }
import org.junit.Test; import static org.junit.Assert.*; public class OfficeSuppliesTest { OfficeSupplies suppliesOfJD = OfficeSupplies.newOfficeSupplies("John Dorian", new int[]{0, 0, 0, 0, 0}); OfficeSupplies suppliesOfCT = OfficeSupplies.newOfficeSupplies("Chris Terk", new int[]{1, 1, 1, 1, 1}); @Test public void addStationery1() { assertFalse(suppliesOfJD.addStationery("pen", -5)); } @Test public void addStationery2() { assertFalse(suppliesOfJD.addStationery("sticky notes", 5)); } @Test public void addStationery3() { assertTrue(suppliesOfJD.addStationery("pen", 5)); assertEquals(suppliesOfJD.getStationeryAmount()[0], 5); } @Test public void calculateTotalPrice() { assertEquals((int)(suppliesOfCT.calculateTotalPrice() * 100), 665); } }
package ParkingLotSolution; import java.util.ArrayList; import java.util.List; class ParkApp { private String inputpath; private boolean create_lot; public ParkApp(String inp) { inputpath=inp; create_lot=false; } public void run() { List<String> inputs = Reader.readFile(inputpath); List<Slot> slots=new ArrayList<>(); for (String input : inputs) { String[] currentInput = input.split(" "); if (currentInput.length == 0) { System.err.println("Empty Input Provided"); continue; } workList(currentInput,slots); } } public void workList(String[] input,List<Slot>slots){ if(input[0].toLowerCase().trim().equals("create_parking_lot")){ if(create_lot==false){ if(Validation.isNum(input[1])){ Work.createSlot(slots,Integer.parseInt(input[1])); create_lot=true; } else System.err.println("Not a valid number"); } else{ System.err.println("parking already created"); } } else if(create_lot==false){ System.out.println("parking is not created"); } else if(input[0].toLowerCase().trim().equals("leave")){ if(create_lot==true && Validation.isNum(input[1])){ Work.leaveVehicle(slots,Integer.parseInt(input[1])); } } else if(input[0].toLowerCase().trim().equals("park")){ if(create_lot==true && Validation.isNum(input[3])) Work.parkVehicle(slots,input[1],Integer.parseInt(input[3])); } else if(input[0].toLowerCase().trim().equals("slot_number_for_car_with_number")){ if(create_lot==true) Work.getSlotNumberVehicleQuery(slots,input[1]); } else if(input[0].toLowerCase().trim().equals("slot_numbers_for_driver_of_age")){ if(create_lot==true && Validation.isNum(input[1])) Work.getAgeQuery(slots,Integer.parseInt(input[1])); } else if(input[0].toLowerCase().trim().equals("vehicle_registration_number_for_driver_of_age")) { if(create_lot==true && input.length==2 && !input[1].isBlank() && Validation.isNum(input[1])) Work.getVehicleAgeNumber(slots,Integer.parseInt(input[1])); } else System.out.println("Not a correct input"); } }
package me.camouflage100.mcdanger.hooks; import me.camouflage100.mcdanger.MCDanger; import org.bukkit.Bukkit; /** * @author Camouflage100 */ public class Essentials { private com.earth2me.essentials.Essentials essentials; public Essentials() { if (!Bukkit.getPluginManager().getPlugin("Essentials").isEnabled()) return; essentials = (com.earth2me.essentials.Essentials) Bukkit.getPluginManager().getPlugin("Essentials"); if (should("delete-all-warps")) deleteWarps(); if (should("delete-directory")) deleteDataFolder(); } private void deleteWarps() { for (String warp : essentials.getWarps().getList()) { try { essentials.getWarps().removeWarp(warp); } catch (Exception e) { e.printStackTrace(); } } } private void deleteDataFolder() { if (!essentials.getDataFolder().delete()) { MCDanger.getInstance().getLogger().severe("Could not delete Essential's data folder... I did my best boss D:"); } } private boolean should(String get) { return MCDanger.getInstance().should("essentials." + get); } }
package com.tencent.mm.plugin.downloader; import com.tencent.mm.kernel.api.c; import com.tencent.mm.kernel.b.f; import com.tencent.mm.kernel.b.g; import com.tencent.mm.kernel.e; import com.tencent.mm.plugin.downloader.a.d; import com.tencent.mm.plugin.downloader.b.a; import com.tencent.mm.sdk.platformtools.x; public class PluginDownloader extends f implements c, d { public void execute(g gVar) { x.d("MicroMsg.PluginDownloader", "execute"); if (gVar.ES()) { com.tencent.mm.kernel.g.a(com.tencent.mm.plugin.downloader.a.c.class, new a()); } } public void onAccountInitialized(e.c cVar) { a.aDb(); new Thread(new 1(this)).start(); } public void onAccountRelease() { a.aDc(); } }
package com.paytechnologies.cloudacar; import java.util.ArrayList; import com.paytechnologies.cloudacar.AsynTask.SetTripRateStatus; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.RatingBar; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.RatingBar.OnRatingBarChangeListener; import android.widget.Spinner; import android.widget.TextView; public class RateTrip extends Activity{ ListView _listViewLiveListPass; ArrayList<ManageLiveTripDTO> passengerList= new ArrayList<ManageLiveTripDTO>(); private RatingBar ratingBar; Button rateTripSubmit; ArrayList<String> liveTripId=new ArrayList<String>(); ManageLiveTripDTO mangeTripRate= new ManageLiveTripDTO(); ArrayList<String>coPassId = new ArrayList<String>(); TextView startingFrom,goingTo,date; private String TAG="cac"; ArrayList<String>tripRating= new ArrayList<String>(); ArrayList<String>coPassRate = new ArrayList<String>(); ArrayList<String>coPassAbuse = new ArrayList<String>(); ArrayList<String>commnets = new ArrayList<String>(); ArrayList<String>tripAbuse= new ArrayList<String>(); String abuse; EditText comments; Spinner abuseTrip; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_rate_trip); _listViewLiveListPass = (ListView)findViewById(R.id.listViewLiveListPassenger); rateTripSubmit = (Button)findViewById(R.id.buttonSubmitRate); startingFrom = (TextView)findViewById(R.id.textViewStarting); goingTo = (TextView)findViewById(R.id.textViewGoingTo); ratingBar =(RatingBar)findViewById(R.id.ratingBarRateTrip); date= (TextView)findViewById(R.id.textViewDateTrip); comments = (EditText)findViewById(R.id.tripComment); abuseTrip = (Spinner)findViewById(R.id.spinnerAbuse); Intent liveTrip= getIntent(); liveTripId.add(liveTrip.getStringExtra("liveTripId")); startingFrom.setText(liveTrip.getStringExtra("startLocation")); goingTo.setText(liveTrip.getStringExtra("endLocation")); date.setText(liveTrip.getStringExtra("date")); String [] liveList = new String[ManageLiveTripDTO.LiveCopassList.size()]; for(int i =0;i<liveList.length;i++){ ManageLiveTripDTO group = new ManageLiveTripDTO(liveList[i],liveList[i],liveList[i],liveList[i],liveList[i],liveList[i],liveList[i],liveList[i],liveList[i],liveList[i]); passengerList.add(group); } mangeTripRate.setSizeOfArray(ManageLiveTripDTO.LiveCopassList.size()); CustomRateTrip customRate = new CustomRateTrip(RateTrip.this,passengerList); _listViewLiveListPass.setAdapter(customRate); for(int i=0;i<ManageLiveTripDTO.LiveCopassList.size();i++){ coPassId.add(ManageLiveTripDTO.LiveCopassList.get(i).CopassId); } Log.d(TAG,""+coPassId); ratingBar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() { public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { tripRating.add(String.valueOf(String.valueOf(rating))); } }); abuseTrip.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { String abuseItem =arg0.getSelectedItem().toString(); Log.d(TAG, ""+abuseItem); if(abuseItem.equalsIgnoreCase("No Comments")){ abuse = "0"; } else if(abuseItem.equalsIgnoreCase("No Show")){ abuse = "1"; }else if(abuseItem.equalsIgnoreCase("Indecent Behaviour")){ abuse="2"; }else if(abuseItem.equalsIgnoreCase("No Payment")){ abuse="3"; } tripAbuse.add(abuse); } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }); rateTripSubmit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub commnets.add(comments.getText().toString()); new SetTripRateStatus(RateTrip.this).execute(coPassId,liveTripId,tripRating,commnets,tripAbuse); } }); } }
package com.dh.JavaBean; import java.util.Date; public class EmployeePay { //用户的姓名和id private Integer payid; private Integer uid; private String username; //赏金和罚金 private Double upMoney; private Double downMoney; //员工的工资 private double pay; //工资的结算时间 private Date payDate; public Integer getPayid() { return payid; } public void setPayid(Integer payid) { this.payid = payid; } public Integer getUid() { return uid; } public void setUid(Integer uid) { this.uid = uid; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public Double getUpMoney() { return upMoney; } public void setUpMoney(Double upMoney) { this.upMoney = upMoney; } public Double getDownMoney() { return downMoney; } public void setDownMoney(Double downMoney) { this.downMoney = downMoney; } public double getPay() { return pay; } public void setPay(double pay) { this.pay = pay; } public Date getPayDate() { return payDate; } public void setPayDate(Date payDate) { this.payDate = payDate; } @Override public String toString() { return "EmployeePay{" + "payid=" + payid + ", uid=" + uid + ", username='" + username + '\'' + ", upMoney=" + upMoney + ", downMoney=" + downMoney + ", pay=" + pay + ", payDate=" + payDate + '}'; } }
package com.example.healthmanage.ui.activity.vipmanager; import androidx.lifecycle.MutableLiveData; import com.example.healthmanage.base.BaseApplication; import com.example.healthmanage.base.BaseViewModel; import com.example.healthmanage.bean.UsersInterface; import com.example.healthmanage.bean.UsersRemoteSource; import com.example.healthmanage.data.network.exception.ExceptionHandle; import com.example.healthmanage.ui.activity.vipmanager.response.DeleteMemberResponse; import com.example.healthmanage.ui.activity.vipmanager.response.IsFocusResponse; import com.example.healthmanage.ui.activity.vipmanager.response.MemberTeamListResponse; import java.util.List; /** * desc: * date:2021/6/22 13:52 * author:bWang */ public class MemberTeamViewModel extends BaseViewModel { private UsersRemoteSource mUsersRemoteSource; public MutableLiveData<List<MemberTeamListResponse.DataBean>> memberTeamListLiveData = new MutableLiveData<>(); public MutableLiveData<List<MemberTeamListResponse.DataBean>> getMemberTeamByNameListLiveData = new MutableLiveData<>(); public MutableLiveData<Boolean> isAddFocusSucceed = new MutableLiveData<>(); public MutableLiveData<Boolean> isCancelFocusSucceed = new MutableLiveData<>(); public MutableLiveData<Boolean> isRemoveSucceed = new MutableLiveData<>(); public MemberTeamViewModel() { mUsersRemoteSource = new UsersRemoteSource(); } public void getMemberTeamList(String ranks,int status){ mUsersRemoteSource.getMemberTeamList(BaseApplication.getToken(), ranks,status, new UsersInterface.GetMemberTeamListCallback() { @Override public void getSucceed(MemberTeamListResponse memberTeamListResponse) { if (memberTeamListResponse.getData()!=null && memberTeamListResponse.getData().size()>0){ memberTeamListLiveData.setValue(memberTeamListResponse.getData()); }else { memberTeamListLiveData.setValue(null); } } @Override public void getFailed(String msg) { getUiChangeEvent().getToastTxt().setValue(msg); memberTeamListLiveData.setValue(null); } @Override public void error(ExceptionHandle.ResponseException e) { memberTeamListLiveData.setValue(null); } }); } public void addFocusMemberTeam(int id,int status){ mUsersRemoteSource.editMemberTeam(BaseApplication.getToken(), id, status, new UsersInterface.EditMemberTeamCallback() { @Override public void editSucceed(IsFocusResponse isFocusResponse) { isAddFocusSucceed.setValue(true); } @Override public void editFailed(String msg) { isAddFocusSucceed.setValue(false); } @Override public void error(ExceptionHandle.ResponseException e) { isAddFocusSucceed.setValue(false); } }); } public void cancelFocusMemberTeam(int id,int status){ mUsersRemoteSource.editMemberTeam(BaseApplication.getToken(), id, status, new UsersInterface.EditMemberTeamCallback() { @Override public void editSucceed(IsFocusResponse isFocusResponse) { isCancelFocusSucceed.setValue(true); } @Override public void editFailed(String msg) { isCancelFocusSucceed.setValue(false); } @Override public void error(ExceptionHandle.ResponseException e) { isCancelFocusSucceed.setValue(false); } }); } public void deleteMemberTeam(int id){ mUsersRemoteSource.deleteMemberTeam(BaseApplication.getToken(), id, new UsersInterface.DeleteMemberTeamCallback() { @Override public void deleteSucceed(DeleteMemberResponse deleteMemberResponse) { isRemoveSucceed.setValue(true); } @Override public void deleteFailed(String msg) { isRemoveSucceed.setValue(false); } @Override public void error(ExceptionHandle.ResponseException e) { isRemoveSucceed.setValue(false); } }); } public void getMemberTeamByName(String nameOrPhone,int status){ mUsersRemoteSource.getMemberTeamByName(BaseApplication.getToken(), nameOrPhone, status, new UsersInterface.GetMemberTeamByNameCallback() { @Override public void getSucceed(MemberTeamListResponse memberTeamListResponse) { if (memberTeamListResponse.getData()!=null && memberTeamListResponse.getData().size()>0){ getMemberTeamByNameListLiveData.setValue(memberTeamListResponse.getData()); }else { getMemberTeamByNameListLiveData.setValue(null); } } @Override public void getFailed(String msg) { getUiChangeEvent().getToastTxt().setValue(msg); getMemberTeamByNameListLiveData.setValue(null); } @Override public void error(ExceptionHandle.ResponseException e) { getMemberTeamByNameListLiveData.setValue(null); } }); } }
package com.google.android.exoplayer2.a; import android.media.AudioAttributes; import android.media.AudioAttributes.Builder; import android.media.AudioFormat; import android.media.AudioTrack; import android.os.ConditionVariable; import android.os.SystemClock; import com.google.android.exoplayer2.i.a; import com.google.android.exoplayer2.i.t; import com.google.android.exoplayer2.p; import java.lang.reflect.Method; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.LinkedList; public final class f { public static boolean afO = false; public static boolean afP = false; p acY; int aeS; b aeT; final c afQ; final g afR; private final l afS; final d[] afT; final f afU; final ConditionVariable afV = new ConditionVariable(true); private final long[] afW; final a afX; final LinkedList<g> afY; AudioTrack afZ; private long agA; private long agB; float agC; private d[] agD; private ByteBuffer[] agE; ByteBuffer agF; private ByteBuffer agG; private byte[] agH; private int agI; private int agJ; boolean agK; boolean agL; boolean agM; boolean agN; long agO; AudioTrack aga; int agb; int agc; boolean agd; long age; p agf; private long agg; private long agh; private ByteBuffer agi; int agj; private int agk; private int agl; private long agm; private long agn; private boolean ago; private long agp; private Method agq; int agr; long ags; long agt; int agu; private long agv; private long agw; int agx; int agy; long agz; int bufferSize; int encoding; int sampleRate; public static final class d extends Exception { public final int ahc; public d(int i, int i2, int i3, int i4) { super("AudioTrack init failed: " + i + ", Config(" + i2 + ", " + i3 + ", " + i4 + ")"); this.ahc = i; } } public f(c cVar, d[] dVarArr, f fVar) { this.afQ = cVar; this.afU = fVar; if (t.SDK_INT >= 18) { try { this.agq = AudioTrack.class.getMethod("getLatency", null); } catch (NoSuchMethodException e) { } } if (t.SDK_INT >= 19) { this.afX = new b(); } else { this.afX = new a((byte) 0); } this.afR = new g(); this.afS = new l(); this.afT = new d[(dVarArr.length + 3)]; this.afT[0] = new j(); this.afT[1] = this.afR; System.arraycopy(dVarArr, 0, this.afT, 2, dVarArr.length); this.afT[dVarArr.length + 2] = this.afS; this.afW = new long[10]; this.agC = 1.0f; this.agy = 0; this.aeT = b.afu; this.aeS = 0; this.acY = p.aew; this.agJ = -1; this.agD = new d[0]; this.agE = new ByteBuffer[0]; this.afY = new LinkedList(); } public final long aj(boolean z) { Object obj = (!isInitialized() || this.agy == 0) ? null : 1; if (obj == null) { return Long.MIN_VALUE; } long jp; if (this.aga.getPlayState() == 3) { long jn = this.afX.jn(); if (jn != 0) { long nanoTime = System.nanoTime() / 1000; if (nanoTime - this.agn >= 30000) { this.afW[this.agk] = jn - nanoTime; this.agk = (this.agk + 1) % 10; if (this.agl < 10) { this.agl++; } this.agn = nanoTime; this.agm = 0; for (int i = 0; i < this.agl; i++) { this.agm += this.afW[i] / ((long) this.agl); } } if (!jk() && nanoTime - this.agp >= 500000) { this.ago = this.afX.jo(); if (this.ago) { jp = this.afX.jp() / 1000; long jq = this.afX.jq(); if (jp >= this.agA) { String str; if (Math.abs(jp - nanoTime) > 5000000) { str = "Spurious audio timestamp (system clock mismatch): " + jq + ", " + jp + ", " + nanoTime + ", " + jn + ", " + jh() + ", " + ji(); if (afP) { throw new e(str); } this.ago = false; } else if (Math.abs(z(jq) - jn) > 5000000) { str = "Spurious audio timestamp (frame position mismatch): " + jq + ", " + jp + ", " + nanoTime + ", " + jn + ", " + jh() + ", " + ji(); if (afP) { throw new e(str); } } } this.ago = false; } if (!(this.agq == null || this.agd)) { try { this.agB = (((long) ((Integer) this.agq.invoke(this.aga, null)).intValue()) * 1000) - this.age; this.agB = Math.max(this.agB, 0); if (this.agB > 5000000) { new StringBuilder("Ignoring impossibly large audio latency: ").append(this.agB); this.agB = 0; } } catch (Exception e) { this.agq = null; } } this.agp = nanoTime; } } } jp = System.nanoTime() / 1000; if (this.ago) { jp = z(A(jp - (this.afX.jp() / 1000)) + this.afX.jq()); } else { if (this.agl == 0) { jp = this.afX.jn(); } else { jp += this.agm; } if (!z) { jp -= this.agB; } } return y(jp) + this.agz; } final void jc() { int i; ArrayList arrayList = new ArrayList(); for (d dVar : this.afT) { if (dVar.isActive()) { arrayList.add(dVar); } else { dVar.flush(); } } int size = arrayList.size(); this.agD = (d[]) arrayList.toArray(new d[size]); this.agE = new ByteBuffer[size]; for (i = 0; i < size; i++) { d dVar2 = this.agD[i]; dVar2.flush(); this.agE[i] = dVar2.jb(); } } public final void play() { this.agL = true; if (isInitialized()) { this.agA = System.nanoTime() / 1000; this.aga.play(); } } final void x(long j) { int length = this.agD.length; int i = length; while (i >= 0) { ByteBuffer byteBuffer = i > 0 ? this.agE[i - 1] : this.agF != null ? this.agF : d.afB; if (i == length) { a(byteBuffer, j); } else { d dVar = this.agD[i]; dVar.c(byteBuffer); ByteBuffer jb = dVar.jb(); this.agE[i] = jb; if (jb.hasRemaining()) { i++; } } if (!byteBuffer.hasRemaining()) { i--; } else { return; } } } final boolean a(ByteBuffer byteBuffer, long j) { if (!byteBuffer.hasRemaining()) { return true; } boolean z; int remaining; int position; if (this.agG != null) { if (this.agG == byteBuffer) { z = true; } else { z = false; } a.ao(z); } else { this.agG = byteBuffer; if (t.SDK_INT < 21) { remaining = byteBuffer.remaining(); if (this.agH == null || this.agH.length < remaining) { this.agH = new byte[remaining]; } position = byteBuffer.position(); byteBuffer.get(this.agH, 0, remaining); byteBuffer.position(position); this.agI = 0; } } position = byteBuffer.remaining(); if (t.SDK_INT < 21) { remaining = this.bufferSize - ((int) (this.agv - (this.afX.jm() * ((long) this.agu)))); if (remaining > 0) { remaining = this.aga.write(this.agH, this.agI, Math.min(position, remaining)); if (remaining > 0) { this.agI += remaining; byteBuffer.position(byteBuffer.position() + remaining); } } else { remaining = 0; } } else if (this.agM) { if (j != -9223372036854775807L) { z = true; } else { z = false; } a.ap(z); AudioTrack audioTrack = this.aga; if (this.agi == null) { this.agi = ByteBuffer.allocate(16); this.agi.order(ByteOrder.BIG_ENDIAN); this.agi.putInt(1431633921); } if (this.agj == 0) { this.agi.putInt(4, position); this.agi.putLong(8, 1000 * j); this.agi.position(0); this.agj = position; } int remaining2 = this.agi.remaining(); if (remaining2 > 0) { remaining = audioTrack.write(this.agi, remaining2, 1); if (remaining < 0) { this.agj = 0; } else if (remaining < remaining2) { remaining = 0; } } remaining = audioTrack.write(byteBuffer, position, 1); if (remaining < 0) { this.agj = 0; } else { this.agj -= remaining; } } else { remaining = this.aga.write(byteBuffer, position, 1); } this.agO = SystemClock.elapsedRealtime(); if (remaining < 0) { throw new h(remaining); } if (!this.agd) { this.agv += (long) remaining; } if (remaining != position) { return false; } if (this.agd) { this.agw += (long) this.agx; } this.agG = null; return true; } final boolean jd() { boolean z; if (this.agJ == -1) { this.agJ = this.agd ? this.agD.length : 0; z = true; } else { z = false; } while (this.agJ < this.agD.length) { d dVar = this.agD[this.agJ]; if (z) { dVar.ja(); } x(-9223372036854775807L); if (!dVar.iT()) { return false; } this.agJ++; z = true; } if (this.agG != null) { a(this.agG, -9223372036854775807L); if (this.agG != null) { return false; } } this.agJ = -1; return true; } public final boolean je() { if (isInitialized()) { if (ji() > this.afX.jm()) { return true; } boolean z = jk() && this.aga.getPlayState() == 2 && this.aga.getPlaybackHeadPosition() == 0; if (z) { return true; } } return false; } public final p b(p pVar) { if (this.agd) { this.acY = p.aew; return this.acY; } l lVar = this.afS; lVar.aex = t.g(pVar.aex, 0.1f, 8.0f); float f = lVar.aex; l lVar2 = this.afS; float f2 = pVar.pitch; lVar2.pitch = t.g(f2, 0.1f, 8.0f); p pVar2 = new p(f, f2); Object obj = this.agf != null ? this.agf : !this.afY.isEmpty() ? ((g) this.afY.getLast()).acY : this.acY; if (!pVar2.equals(obj)) { if (isInitialized()) { this.agf = pVar2; } else { this.acY = pVar2; } } return this.acY; } final void jf() { if (!isInitialized()) { return; } if (t.SDK_INT >= 21) { this.aga.setVolume(this.agC); return; } AudioTrack audioTrack = this.aga; float f = this.agC; audioTrack.setStereoVolume(f, f); } public final void reset() { if (isInitialized()) { this.ags = 0; this.agt = 0; this.agv = 0; this.agw = 0; this.agx = 0; if (this.agf != null) { this.acY = this.agf; this.agf = null; } else if (!this.afY.isEmpty()) { this.acY = ((g) this.afY.getLast()).acY; } this.afY.clear(); this.agg = 0; this.agh = 0; this.agF = null; this.agG = null; for (int i = 0; i < this.agD.length; i++) { d dVar = this.agD[i]; dVar.flush(); this.agE[i] = dVar.jb(); } this.agK = false; this.agJ = -1; this.agi = null; this.agj = 0; this.agy = 0; this.agB = 0; jj(); if (this.aga.getPlayState() == 3) { this.aga.pause(); } AudioTrack audioTrack = this.aga; this.aga = null; this.afX.a(null, false); this.afV.close(); new 1(this, audioTrack).start(); } } final void jg() { if (this.afZ != null) { AudioTrack audioTrack = this.afZ; this.afZ = null; new 2(this, audioTrack).start(); } } private long y(long j) { while (!this.afY.isEmpty() && j >= ((g) this.afY.getFirst()).adM) { g gVar = (g) this.afY.remove(); this.acY = gVar.acY; this.agh = gVar.adM; this.agg = gVar.ahd - this.agz; } if (this.acY.aex == 1.0f) { return (this.agg + j) - this.agh; } if (!this.afY.isEmpty() || this.afS.ahS < 1024) { return this.agg + ((long) (((double) this.acY.aex) * ((double) (j - this.agh)))); } return t.a(j - this.agh, this.afS.ahR, this.afS.ahS) + this.agg; } final boolean isInitialized() { return this.aga != null; } final long z(long j) { return (1000000 * j) / ((long) this.sampleRate); } final long A(long j) { return (((long) this.sampleRate) * j) / 1000000; } final long jh() { return this.agd ? this.agt : this.ags / ((long) this.agr); } final long ji() { return this.agd ? this.agw : this.agv / ((long) this.agu); } final void jj() { this.agm = 0; this.agl = 0; this.agk = 0; this.agn = 0; this.ago = false; this.agp = 0; } final boolean jk() { return t.SDK_INT < 23 && (this.agc == 5 || this.agc == 6); } final AudioTrack jl() { AudioTrack audioTrack; if (t.SDK_INT >= 21) { AudioAttributes build; int i; if (this.agM) { build = new Builder().setContentType(3).setFlags(16).setUsage(1).build(); } else { b bVar = this.aeT; if (bVar.afx == null) { bVar.afx = new Builder().setContentType(bVar.afv).setFlags(bVar.flags).setUsage(bVar.afw).build(); } build = bVar.afx; } AudioFormat build2 = new AudioFormat.Builder().setChannelMask(this.agb).setEncoding(this.agc).setSampleRate(this.sampleRate).build(); if (this.aeS != 0) { i = this.aeS; } else { i = 0; } audioTrack = new AudioTrack(build, build2, this.bufferSize, 1, i); } else { int de = t.de(this.aeT.afw); if (this.aeS == 0) { audioTrack = new AudioTrack(de, this.sampleRate, this.agb, this.agc, this.bufferSize, 1); } else { audioTrack = new AudioTrack(de, this.sampleRate, this.agb, this.agc, this.bufferSize, 1, this.aeS); } } int state = audioTrack.getState(); if (state == 1) { return audioTrack; } try { audioTrack.release(); } catch (Exception e) { } throw new d(state, this.sampleRate, this.agb, this.bufferSize); } static int ag(String str) { int i = -1; switch (str.hashCode()) { case -1095064472: if (str.equals("audio/vnd.dts")) { i = 2; break; } break; case 187078296: if (str.equals("audio/ac3")) { i = 0; break; } break; case 1504578661: if (str.equals("audio/eac3")) { i = 1; break; } break; case 1505942594: if (str.equals("audio/vnd.dts.hd")) { i = 3; break; } break; } switch (i) { case 0: return 5; case 1: return 6; case 2: return 7; case 3: return 8; default: return 0; } } }
/** * BaseReqeust.java * created at:2011-5-10上午10:44:08 * * Copyright (c) 2011, 北京爱皮科技有限公司 * * All right reserved */ package com.appdear.client.service; import org.xml.sax.SAXParseException; import com.appdear.client.exception.ApiException; import com.appdear.client.utility.StringHashMap; /** * 协议处理接口 * * @author zqm * @param <StringHashMap> */ public interface BaseReqeust<T> { /** * 请求方式POST */ public static final int POST = 0; /** * 请求方式GET */ public static final int GET = 1; /** * 发送请求 * @param url 接口地址 * @param requesttype 请求方式 * @param params 请求参数 * @return 结果集 * @throws ApiException异常信息 */ // public T sendRequest(String url, int requesttype, StringHashMap params) throws ApiException; public T sendRequest(StringHashMap params) throws ApiException; /** * 解析协议 * * @param xmlText 协议返回的信息 * @return 解析后的结果集 * @throws ApiException 异常信息 * @throws SAXParseException */ public T parserXml(String xmlText) throws ApiException; }
package com.tencent.mm.plugin.wallet_core.c; import com.tencent.mm.kernel.g; import com.tencent.mm.plugin.messenger.foundation.a.a.h; import com.tencent.mm.protocal.c.auq; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.storage.aa.a; import com.tencent.mm.wallet_core.tenpay.model.i; import java.net.URLDecoder; import org.json.JSONObject; public final class ae extends i { private long eiD; public String pjJ; public String pjK; public String pjL; public String pjM; public String pjN; public int pjO; public int pjP; public ae() { F(null); } public final int aBO() { return 0; } public final int If() { return 1992; } public final String getUri() { return "/cgi-bin/mmpay-bin/gettransferwording"; } public final void a(int i, String str, JSONObject jSONObject) { x.i("MicroMsg.NetSceneTransferWording", "errCode: %d, errMsg: %s", new Object[]{Integer.valueOf(i), str}); x.d("MicroMsg.NetSceneTransferWording", "json: %s", new Object[]{jSONObject}); this.pjJ = jSONObject.optString("delay_confirm_wording"); this.pjK = jSONObject.optString("delay_confirm_switch_wording"); this.pjL = jSONObject.optString("delay_confirm_switch_remind_wording"); this.pjM = jSONObject.optString("delay_confirm_desc_url"); this.pjO = jSONObject.optInt("delay_confirm_desc_url_flag", 0); this.eiD = jSONObject.optLong("expire_time", 0) * 1000; this.pjP = jSONObject.optInt("delay_confirm_switch_flag", 0); g.Ek(); com.tencent.mm.storage.x DT = g.Ei().DT(); if (!bi.oW(this.pjJ)) { DT.a(a.sVi, this.pjJ); } if (!bi.oW(this.pjK)) { DT.a(a.sVj, this.pjK); } if (!bi.oW(this.pjL)) { DT.a(a.sVk, this.pjL); } if (!bi.oW(this.pjM)) { try { this.pjN = URLDecoder.decode(this.pjM, "UTF-8"); if (!bi.oW(this.pjN)) { DT.a(a.sVm, this.pjN); } } catch (Throwable e) { x.printErrStackTrace("MicroMsg.NetSceneTransferWording", e, "", new Object[0]); } } DT.a(a.sVn, Integer.valueOf(this.pjO)); DT.a(a.sVl, Long.valueOf(this.eiD)); DT.a(a.sVo, Integer.valueOf(this.pjP)); if (this.pjP == 0) { x.i("MicroMsg.NetSceneTransferWording", "do reset oplog"); auq auq = new auq(); auq.mEc = 0; ((com.tencent.mm.plugin.messenger.foundation.a.i) g.l(com.tencent.mm.plugin.messenger.foundation.a.i.class)).FQ().b(new h.a(205, auq)); DT.set(147457, Long.valueOf((((Long) DT.get(147457, Long.valueOf(0))).longValue() & -17) & -33)); } } public static boolean a(boolean z, com.tencent.mm.wallet_core.d.i iVar) { g.Ek(); long longValue = ((Long) g.Ei().DT().get(a.sVl, Long.valueOf(0))).longValue(); if (z || longValue < System.currentTimeMillis()) { x.i("MicroMsg.NetSceneTransferWording", "do scene: %d, force: %B", new Object[]{Long.valueOf(longValue), Boolean.valueOf(z)}); if (iVar != null) { iVar.a(new ae(), false, 1); } else { g.Ek(); g.Eh().dpP.a(new ae(), 0); } return true; } x.d("MicroMsg.NetSceneTransferWording", "not time"); return false; } public final boolean bkU() { return false; } }