text
stringlengths
10
2.72M
package tv.skimo.meeting.utils; public enum Status { ACTIVE,INACTIVE; }
package la.foton.treinamento.dao; import la.foton.treinamento.entities.Cliente; import java.util.List; public interface ClienteDAO { void insere(Cliente cliente); Cliente consultaPorCPF(String cpf); List<Cliente> consultaTodos(); void atualiza(Cliente cliente); void delete(Cliente cliente); }
package com.controller; import com.alibaba.fastjson.JSONObject; import com.bean.Patient; import com.bean.PriorityConditionSet; import com.bean.User; import com.mapper.IntervalPlanLstMapper; import com.mapper.PatientMapper; import com.mapper.PriorityConditionSetMapper; import com.mapper.UserMapper; import com.service.PatientService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class PatientController { @Autowired PatientService patientService; @Autowired PatientMapper patientMapper; @Autowired UserMapper userMapper; @Autowired IntervalPlanLstMapper intervalPlanLstMapper; @Autowired PriorityConditionSetMapper priorityConditionSetMapper; @RequestMapping("/selectPatient") @ResponseBody public JSONObject selectPatient(Patient patient) { JSONObject jsonObject = new JSONObject(); jsonObject.put("patientList",patientService.getPatient(patient)); return jsonObject; } @PostMapping("/insertPatient") @ResponseBody public JSONObject insertPatient(Patient patient,Integer userId,Integer id) { JSONObject jsonObject = new JSONObject(); User user = userMapper.selectByPrimaryKey(userId); // PriorityConditionSet priorityCondition = priorityConditionSetMapper.selectByPrimaryKey(priority); patient.setIntervalPlanId(id); patient.setRealName(user.getRealName()); patient.setSex(user.getSex()); patient.setPhoneNumber(user.getPhoneNumber()); // patient.setPriority(priorityCondition.getConditionName()); Integer result = patientMapper.insert(patient); intervalPlanLstMapper.updateNum(id); if (result >0 ){ jsonObject.put("info","插入成功!"); }else{ jsonObject.put("info","插入失败!"); } return jsonObject; } @RequestMapping("/deletePatient") @ResponseBody public JSONObject deletePatient(Patient patient) { JSONObject jsonObject = new JSONObject(); intervalPlanLstMapper.updateAddNum(patientMapper.select(patient).get(0).getIntervalPlanId()); Integer result = patientMapper.delete(patient); if (result >0 ){ jsonObject.put("info","删除成功!"); }else{ jsonObject.put("info","删除失败!"); } return jsonObject; } @RequestMapping("/updatePatient") @ResponseBody public JSONObject updatePatient(Patient patient) { JSONObject jsonObject = new JSONObject(); Integer result = patientMapper.updateByPrimaryKeySelective(patient); if (result > 0 ){ jsonObject.put("info","更新成功!"); }else{ jsonObject.put("info","更新失败!"); } return jsonObject; } @RequestMapping("/updatePatientStatus") @ResponseBody public JSONObject updatePatientStatus(Integer patientId) { JSONObject jsonObject = new JSONObject(); Integer result = patientMapper.updatePatientStatus(patientId); if (result > 0 ){ jsonObject.put("info","操作成功!"); }else{ jsonObject.put("info","操作失败!"); } return jsonObject; } }
import javax.swing.*; import java.awt.*; import java.awt.event.*; public abstract class okPanel implements ActionListener{ private JFrame frame; public JPanel mainPanel; public JButton okButton; private JButton cancelButton; private JPanel bottomBar; private JPanel pane; int x; int y; public okPanel(){ frame = new JFrame(); mainPanel = new JPanel(); okButton = new JButton ("OK"); cancelButton = new JButton ("Cancel"); x = 300; y = 200; frame.setResizable(false); } public void buildGUI(){ pane = new JPanel(); pane.setLayout(new GridBagLayout()); GridBagConstraints con = new GridBagConstraints(); con.gridy = 0; con.gridwidth = 3; con.gridheight = 5; mainPanel.setPreferredSize(new Dimension(x,y)); pane.add(mainPanel,con); con = resetConstraints(); con.insets = new Insets(0,20,7,0); con.gridy = 5; okButton.addActionListener(this); pane.add(okButton,con); con.insets = new Insets(0,0,7,20); con.gridx = 2; con.anchor = GridBagConstraints.LINE_END; cancelButton.addActionListener(this); pane.add(cancelButton,con); frame.add(pane); center(); frame.setVisible(true); } public void buildSingleGUI(){ pane = new JPanel(); pane.setLayout(new GridBagLayout()); GridBagConstraints con = new GridBagConstraints(); con.gridy = 0; con.gridwidth = 3; con.gridheight = 5; mainPanel.setPreferredSize(new Dimension(x,y)); pane.add(mainPanel,con); con = resetConstraints(); con.insets = new Insets(0,20,7,0); con.gridy = 6; okButton.addActionListener(this); pane.add(okButton,con); frame.add(pane); center(); frame.setVisible(true); } public void setOKButton(String text){ okButton.setText(text); } public void setCancelButton(String text){ cancelButton.setText(text); } public void setSize(int newX, int newY){ x = newX; y = newY; } public void show(){ frame.setVisible(true); } public JFrame getFrame(){ return frame; } public void hide(){ frame.setVisible(false); } public JPanel getMainPanel(){ return mainPanel; } public void repack(){ frame.pack(); } private GridBagConstraints resetConstraints(){ return new GridBagConstraints(); } public void errorMessage(String message){ JOptionPane.showMessageDialog(frame, message); } public void actionPerformed(ActionEvent e){ if(e.getSource().equals(okButton)){ ok(); } if(e.getSource().equals(cancelButton)){ cancel(); } } public void center(){ Toolkit tk = Toolkit.getDefaultToolkit(); Dimension screenSize = tk.getScreenSize(); int screenHeight = screenSize.height; int screenWidth = screenSize.width; frame.setSize(screenWidth / 4, screenHeight / 4); frame.setLocation(screenWidth / 3, screenHeight / 3); } public abstract void ok(); public abstract void cancel(); }
package com.tencent.mm.ui.transmit; class MsgRetransmitUI$5 implements Runnable { final /* synthetic */ MsgRetransmitUI uDL; MsgRetransmitUI$5(MsgRetransmitUI msgRetransmitUI) { this.uDL = msgRetransmitUI; } public final void run() { this.uDL.finish(); } }
package laba08; import java.awt.BorderLayout; import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; /** * * @author 3D-GRAF */ public class Laba08 { public static DB db = null; /** * @param args the command line arguments */ public static void main(String[] args) { MainWindow.setSystemLookAndFeel(); try { db = new DB(); MainWindow mainwindow = new MainWindow(); mainwindow.refreshAccounts(); mainwindow.setVisible(true); } catch (ClassNotFoundException ex) { System.out.println(ex.getMessage()); } catch (SQLException ex) { //System.out.println(ex.getMessage()); JOptionPane.showMessageDialog(null, "Ошибка запроса"); } } }
package Modulos; import HelperCore.inicializaDriver; import PageObject.Menu; import io.appium.java_client.TouchAction; import io.appium.java_client.android.AndroidElement; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; import java.net.MalformedURLException; import static Helper.MethodBasic.retornaMensagem; import static io.appium.java_client.touch.offset.ElementOption.element; public class Cliques extends inicializaDriver { @Before public void iniciaTeste() throws MalformedURLException { inicializa(); } @Test public void CliqueLongo() throws InterruptedException { Menu.selecionaMenu("Cliques"); new TouchAction(driver) .longPress(element(driver.findElement(By.xpath("//android.widget.TextView[@text='Clique Longo']")))).perform(); Assert.assertEquals("Clique Longo",driver.findElement(By.xpath("//android.widget.TextView[2][@text='Clique Longo']")).getText()); } @Test public void CliqueDuplo() throws InterruptedException { Menu.selecionaMenu("Cliques"); new TouchAction(driver) .press(element(driver.findElement(By.xpath("//android.widget.TextView[@text='Clique duplo']")))) .press(element(driver.findElement(By.xpath("//android.widget.TextView[@text='Clique duplo']")))) .perform(); Assert.assertEquals("Clique duplo",driver.findElement(By.xpath("//android.widget.TextView[1][@text='Clique duplo']")).getText()); } @After public void finalizaTeste() throws MalformedURLException { driver.quit(); } }
package cco; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import lombok.Getter; import lombok.Setter; @Entity public class CcoTipoVeiculo { @Id @Column(name="TIPO_VEICULO_ID") private @Getter @Setter Long id; @Column(name="DESCRICAO") private @Getter @Setter String descricao; public CcoTipoVeiculo(){} public CcoTipoVeiculo(Long id){ this.id = id; } }
package com.tencent.mm.modelvoice; import android.content.Context; import android.media.AudioTrack; import android.media.MediaPlayer.OnCompletionListener; import android.media.MediaPlayer.OnErrorListener; import android.os.Process; import com.tencent.mm.compatible.b.d; import com.tencent.mm.compatible.b.f; import com.tencent.mm.compatible.e.q; import com.tencent.mm.compatible.util.b; import com.tencent.mm.compatible.util.b$a; import com.tencent.mm.e.b.g; import com.tencent.mm.modelvoice.d.a; import com.tencent.mm.platformtools.af; import com.tencent.mm.plugin.report.service.h; import com.tencent.mm.sdk.f.e; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.storage.c; import java.io.InputStream; import java.io.OutputStream; public final class i implements d { private static Object eoY = new Object(); private static int eoZ = -1; private static int epa; private static int epf = 100; public int bEf; private a eoR; private b eoS; private a eoT; private d.b eoU; private volatile boolean eoV; private String eoW; private String eoX; private int epb; private int epc; private com.tencent.mm.e.c.b epd; private int epe; private OnCompletionListener epg; private OnErrorListener eph; private AudioTrack mAudioTrack; private String mFileName; public int mSampleRate; private int mStatus; public final int getStatus() { return this.mStatus; } public i() { this.eoT = null; this.eoU = null; this.bEf = 2; this.mSampleRate = 16000; this.mFileName = ""; this.mStatus = 0; this.eoV = false; this.eoW = ""; this.eoX = ""; this.epc = 0; this.epd = null; this.epe = 8; this.epg = new 1(this); this.eph = new 2(this); eoZ++; this.epb = eoZ; x.i("MicroMsg.SilkPlayer", "[%d] new Instance", new Object[]{Integer.valueOf(this.epb)}); } public i(Context context) { this(); this.eoS = new b(context); } public final void a(a aVar) { this.eoT = aVar; } public final void a(d.b bVar) { this.eoU = bVar; } public final void aK(boolean z) { x.d("MicroMsg.SilkPlayer", "setSpeakerOn: %b", new Object[]{Boolean.valueOf(z)}); this.eoV = true; this.bEf = 2; bV(z); try { this.mAudioTrack.play(); } catch (Exception e) { h.mEJ.a(161, 0, 1, false); h.mEJ.a(161, 3, 1, false); x.e("MicroMsg.SilkPlayer", "audioTrack error:%s", new Object[]{e.getMessage()}); } this.eoV = false; } private void bV(boolean z) { int i; AudioTrack dVar; int i2 = 3; if (this.mAudioTrack != null) { x.i("MicroMsg.SilkPlayer", "mAudioTrack.stop()"); try { this.mAudioTrack.stop(); this.mAudioTrack.release(); } catch (Exception e) { x.e("MicroMsg.SilkPlayer", "mAudioTrack.stop() error: %s", new Object[]{e.getMessage()}); } this.mAudioTrack = null; } int i3 = this.mSampleRate; int i4 = this.bEf; int i5 = this.epe; if (z) { i = 3; } else { i = 0; } if (q.deN.dby) { q.deN.dump(); if (z && q.deN.dcb >= 0) { i = q.deN.dcb; } else if (!z && q.deN.dcc >= 0) { i = q.deN.dcc; } } int minBufferSize = AudioTrack.getMinBufferSize(i3, i4, 2); x.i("AudioDeviceFactory", "speakerOn: %b, type: %d, sampleRate: %d, channelConfig: %d, PlayBufSize: %d, bufTimes: %d", new Object[]{Boolean.valueOf(z), Integer.valueOf(i), Integer.valueOf(i3), Integer.valueOf(i4), Integer.valueOf(minBufferSize), Integer.valueOf(i5)}); d dVar2 = new d(i, i3, i4, i5 * minBufferSize); if (dVar2.getState() == 0) { dVar2.release(); x.i("AudioDeviceFactory", "reconstruct AudioTrack"); if (i != 0) { i2 = 0; } dVar = new d(i2, i3, i4, i5 * minBufferSize); } else { dVar = dVar2; } x.i("AudioDeviceFactory", "AudioTrack state: " + dVar.getState()); this.mAudioTrack = dVar; if (this.mAudioTrack == null || this.mAudioTrack.getState() == 0) { h.mEJ.a(161, 0, 1, false); h.mEJ.a(161, 2, 1, false); try { if (this.mAudioTrack != null) { this.mAudioTrack.release(); this.mAudioTrack = null; } } catch (Exception e2) { } } } public final boolean M(String str, boolean z) { return N(str, z); } public final boolean c(String str, boolean z, int i) { return N(str, z); } private boolean N(String str, boolean z) { int i = 2; if (this.mStatus != 0) { x.e("MicroMsg.SilkPlayer", "startPlay error status:" + this.mStatus); return false; } if (af.exQ) { aB(str, g.bEF); } x.i("MicroMsg.SilkPlayer", "startPlay"); this.mStatus = 1; this.mFileName = str; synchronized (eoY) { oe(str); } if (af.exQ) { int i2; String str2 = g.bEE; if (this.bEf == 2) { i2 = 1; } else { i2 = 2; } this.epd = new com.tencent.mm.e.c.b(str2, i2, this.mSampleRate); } String str3 = "MicroMsg.SilkPlayer"; String str4 = "startPlay, sampleRate: %d, channelCnt: %d "; Object[] objArr = new Object[2]; objArr[0] = Integer.valueOf(this.mSampleRate); if (this.bEf == 2) { i = 1; } objArr[1] = Integer.valueOf(i); x.d(str3, str4, objArr); try { return bW(z); } catch (Throwable e) { try { return bW(true); } catch (Exception e2) { x.e("MicroMsg.SilkPlayer", "startPlay File[" + this.mFileName + "] failed"); x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); this.mStatus = -1; return false; } } } private void oe(String str) { int available; epa = this.epb; x.i("MicroMsg.SilkPlayer", "[%d] SilkDecInit", new Object[]{Integer.valueOf(this.epb)}); try { InputStream openRead = com.tencent.mm.vfs.d.openRead(str); available = openRead.available(); x.d("MicroMsg.SilkPlayer", "SilkDecInit streamlen:%d", new Object[]{Integer.valueOf(available)}); if (!f.yz().yE() || available >= 5000) { this.epe = 8; } else { this.epe = 1; } byte[] bArr = new byte[available]; openRead.read(bArr, 0, available); this.mSampleRate = MediaRecorder.SilkGetEncSampleRate(new byte[]{bArr[0]}); MediaRecorder.SilkDecUnInit(); MediaRecorder.SilkDecInit(this.mSampleRate, bArr, available); available = -1; c fJ = com.tencent.mm.model.c.c.Jx().fJ("100268"); if (fJ.isValid()) { available = bi.getInt((String) fJ.ckq().get("SilkAudioPlayerAgcOn"), 0); } if (1 == available || available == 0) { MediaRecorder.SetVoiceSilkDecControl(epf, new byte[]{(byte) available}, 1); } openRead.close(); } catch (Throwable e) { h.mEJ.a(161, 0, 1, false); h.mEJ.a(161, 1, 1, false); x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); } x.d("MicroMsg.SilkPlayer", "[%d] skip %d frames", new Object[]{Integer.valueOf(this.epb), Integer.valueOf(this.epc)}); byte[] bArr2 = new byte[(AudioTrack.getMinBufferSize(this.mSampleRate, 2, 2) * 2)]; short s = (short) ((this.mSampleRate * 20) / 1000); for (available = 0; available < this.epc; available++) { if (MediaRecorder.SilkDoDec(bArr2, s) <= 0) { x.e("MicroMsg.SilkPlayer", "[%d], skip frame failed: %d", new Object[]{Integer.valueOf(this.epb), Integer.valueOf(MediaRecorder.SilkDoDec(bArr2, s))}); return; } } } private boolean bW(boolean z) { if (!com.tencent.mm.vfs.d.cn(this.mFileName)) { return false; } try { bV(z); if (this.mAudioTrack == null) { return false; } if (this.eoS != null) { this.eoS.requestFocus(); } return TC(); } catch (Throwable e) { if (this.eoS != null) { this.eoS.zY(); } x.e("MicroMsg.SilkPlayer", "playImp : fail, exception = " + e.getMessage()); x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); return false; } } private boolean TC() { if (this.mAudioTrack == null) { return false; } try { x.i("MicroMsg.SilkPlayer", "play"); this.mAudioTrack.play(); this.eoR = new a(this, (byte) 0); e.b(this.eoR, "SilkPlayer_play_" + this.epb, 10); return true; } catch (Exception e) { x.e("MicroMsg.SilkPlayer", "audioTrack error:%s", new Object[]{e.getMessage()}); h.mEJ.a(161, 0, 1, false); h.mEJ.a(161, 3, 1, false); return false; } } public final boolean aI(boolean z) { if (this.mStatus != 1) { return false; } this.mStatus = 2; synchronized (this.eoX) { try { x.v("MicroMsg.SilkPlayer", "before mOk.wait"); long currentTimeMillis = System.currentTimeMillis(); this.eoX.wait(); x.v("MicroMsg.SilkPlayer", "after mOk.wait time:" + (System.currentTimeMillis() - currentTimeMillis)); } catch (Throwable e) { x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); return false; } } if (this.eoS != null && z) { this.eoS.zY(); } return true; } public final boolean vY() { if (this.mStatus != 2) { return false; } this.mStatus = 1; synchronized (this.eoW) { try { x.v("MicroMsg.SilkPlayer", "before mpause.notify"); this.eoW.notify(); x.v("MicroMsg.SilkPlayer", "after mpause.notify"); } catch (Throwable e) { x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); return false; } } if (this.eoS != null) { this.eoS.requestFocus(); } return true; } public final boolean isPlaying() { return this.mStatus == 1; } public final boolean wk() { x.i("MicroMsg.SilkPlayer", "stop status:" + this.mStatus); if (this.mStatus == 1 || this.mStatus == 2) { this.mStatus = 3; synchronized (this.eoW) { try { this.eoW.notify(); if (this.eoS != null) { this.eoS.zY(); } } catch (Throwable e) { x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); if (this.eoS != null) { this.eoS.zY(); } return false; } catch (Throwable th) { if (this.eoS != null) { this.eoS.zY(); } } } return true; } x.e("MicroMsg.SilkPlayer", "stop error status:" + this.mStatus); return false; } public final double wb() { return 0.0d; } public final void b(b$a b_a) { if (b_a != null && this.eoS != null) { this.eoS.a(b_a); } } public final String aB(String str, String str2) { InputStream openRead; Throwable e; String str3 = null; if (this.mStatus != 0) { x.e("MicroMsg.SilkPlayer", "startPlay error status:" + this.mStatus); return str3; } this.mStatus = 1; this.mFileName = str; try { openRead = com.tencent.mm.vfs.d.openRead(str); try { int available = openRead.available(); byte[] bArr = new byte[available]; openRead.read(bArr, 0, available); this.mSampleRate = MediaRecorder.SilkGetEncSampleRate(new byte[]{bArr[0]}); MediaRecorder.SilkDecInit(this.mSampleRate, bArr, available); x.i("MicroMsg.SilkPlayer", "[%d] SilkDecInit in silkToPcm", new Object[]{Integer.valueOf(this.epb)}); openRead.close(); return of(str2); } catch (Exception e2) { e = e2; } } catch (Exception e3) { e = e3; openRead = str3; } x.e("MicroMsg.SilkPlayer", "silkToPcm, file[%s], exception: %s", new Object[]{this.mFileName, e.getMessage()}); x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); this.mStatus = -1; if (openRead == null) { return str3; } try { openRead.close(); return str3; } catch (Throwable e4) { x.printErrStackTrace("MicroMsg.SilkPlayer", e4, "", new Object[0]); return str3; } } private String of(String str) { OutputStream mG; Throwable e; x.d("MicroMsg.SilkPlayer", "hakon silkToPcmImpl()"); if (com.tencent.mm.vfs.d.cn(this.mFileName)) { try { x.d("MicroMsg.SilkPlayer", "hakon silkToPcmImpl thread start"); Process.setThreadPriority(-16); byte[] bArr = new byte[(AudioTrack.getMinBufferSize(this.mSampleRate, 2, 2) << 1)]; short s = (short) ((this.mSampleRate * 20) / 1000); og(str); mG = com.tencent.mm.vfs.d.mG(str); while (true) { if (this.mStatus != 1 && this.mStatus != 2) { break; } int SilkDoDec = MediaRecorder.SilkDoDec(bArr, s); if (SilkDoDec < 0) { this.mStatus = 0; } else { while (this.eoV) { try { Thread.sleep(20); } catch (Exception e2) { e = e2; try { x.e("MicroMsg.SilkPlayer", "hakon silkToPcmImpl thread exception: " + e.getMessage()); x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e)}); this.mStatus = 0; if (mG != null) { try { mG.close(); } catch (Throwable e3) { x.printErrStackTrace("MicroMsg.SilkPlayer", e3, "", new Object[0]); } } return null; } catch (Throwable e32) { x.e("MicroMsg.SilkPlayer", "hakon silkToPcmImpl exception: " + e32.getMessage()); x.e("MicroMsg.SilkPlayer", "exception:%s", new Object[]{bi.i(e32)}); return null; } } } mG.write(bArr, 0, s * 2); mG.flush(); if (SilkDoDec == 0) { this.mStatus = 0; } } } x.d("MicroMsg.SilkPlayer", "hakon silkToPcmImpl thread end"); mG.close(); int SilkDecUnInit = MediaRecorder.SilkDecUnInit(); x.i("MicroMsg.SilkPlayer", "[%d] SilkDecUnInit in silkToPcmImpl", new Object[]{Integer.valueOf(this.epb)}); if (SilkDecUnInit == 0) { return str; } x.e("MicroMsg.SilkPlayer", "hakon silkToPcmImpl res: " + SilkDecUnInit); return str; } catch (Exception e4) { e32 = e4; mG = null; } } else { x.e("MicroMsg.SilkPlayer", "hakon silkToPcmImpl(), file not exist, fileName = %s", new Object[]{this.mFileName}); return null; } } private static boolean og(String str) { if (str == null) { return false; } try { int lastIndexOf = str.lastIndexOf("/"); if (lastIndexOf == -1) { x.w("MicroMsg.SilkPlayer", "ensureFileFloder end == -1"); return false; } com.tencent.mm.vfs.b bVar = new com.tencent.mm.vfs.b(str.substring(0, lastIndexOf + 1)); if (!bVar.exists()) { boolean z = bVar.mkdirs() || bVar.isDirectory(); x.i("MicroMsg.SilkPlayer", "ensureFileFloder mkdir:%s,sucess:%s", new Object[]{r3, Boolean.valueOf(z)}); } return true; } catch (Exception e) { x.w("MicroMsg.SilkPlayer", "ensureFileFloder Exception:", new Object[]{e.getMessage()}); return false; } } }
package com.rc.portal.service.impl; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; import com.rc.portal.dao.OpenSqlDAO; import com.rc.portal.dao.RxTReserveOrderDAO; import com.rc.portal.dao.TFreightDAO; import com.rc.portal.dao.TGoodFreightDAO; import com.rc.portal.dao.TMemberReceiverLatLonDAO; import com.rc.portal.service.RxTReserveOrderManager; import com.rc.portal.vo.RxTReserveOrder; import com.rc.portal.vo.RxTReserveOrderExample; public class RxTReserveOrderManagerImpl implements RxTReserveOrderManager { private RxTReserveOrderDAO rxtreserveorderdao; private TMemberReceiverLatLonDAO tmemberreceiverlatlondao; private TGoodFreightDAO tgoodfreightdao; private TFreightDAO tfreightdao; private OpenSqlDAO opensqldao; public TGoodFreightDAO getTgoodfreightdao() { return tgoodfreightdao; } public void setTgoodfreightdao(TGoodFreightDAO tgoodfreightdao) { this.tgoodfreightdao = tgoodfreightdao; } public TFreightDAO getTfreightdao() { return tfreightdao; } public void setTfreightdao(TFreightDAO tfreightdao) { this.tfreightdao = tfreightdao; } public TMemberReceiverLatLonDAO getTmemberreceiverlatlondao() { return tmemberreceiverlatlondao; } public void setTmemberreceiverlatlondao( TMemberReceiverLatLonDAO tmemberreceiverlatlondao) { this.tmemberreceiverlatlondao = tmemberreceiverlatlondao; } public OpenSqlDAO getOpensqldao() { return opensqldao; } public void setOpensqldao(OpenSqlDAO opensqldao) { this.opensqldao = opensqldao; } public RxTReserveOrderManagerImpl() { super(); } public void setRxtreserveorderdao(RxTReserveOrderDAO rxtreserveorderdao){ this.rxtreserveorderdao=rxtreserveorderdao; } public RxTReserveOrderDAO getRxtreserveorderdao(){ return this.rxtreserveorderdao; } public int countByExample(RxTReserveOrderExample example) throws SQLException{ return rxtreserveorderdao. countByExample( example); } public int deleteByExample(RxTReserveOrderExample example) throws SQLException{ return rxtreserveorderdao. deleteByExample( example); } public int deleteByPrimaryKey(Long id) throws SQLException{ return rxtreserveorderdao. deleteByPrimaryKey( id); } public Long insert(RxTReserveOrder record) throws SQLException{ return rxtreserveorderdao. insert( record); } public Long insertSelective(RxTReserveOrder record) throws SQLException{ return rxtreserveorderdao. insertSelective( record); } public List selectByExample(RxTReserveOrderExample example) throws SQLException{ return rxtreserveorderdao. selectByExample( example); } public RxTReserveOrder selectByPrimaryKey(Long id) throws SQLException{ return rxtreserveorderdao. selectByPrimaryKey( id); } public int updateByExampleSelective(RxTReserveOrder record, RxTReserveOrderExample example) throws SQLException{ return rxtreserveorderdao. updateByExampleSelective( record, example); } public int updateByExample(RxTReserveOrder record, RxTReserveOrderExample example) throws SQLException{ return rxtreserveorderdao. updateByExample( record, example); } public int updateByPrimaryKeySelective(RxTReserveOrder record) throws SQLException{ return rxtreserveorderdao. updateByPrimaryKeySelective( record); } public int updateByPrimaryKey(RxTReserveOrder record) throws SQLException{ return rxtreserveorderdao. updateByPrimaryKey( record); } public Map<String, Object> getReserveOrderPrice(String receiverId,Long memberId,Long goodsId,int goodsNum) throws Exception { Map<String,Object> reserveOrderMap = new HashMap<String,Object>(); //根据商品id获取商品信息 Map map = new HashMap(); map.put("id", goodsId); Map goodsMap = (Map) opensqldao.selectForObjectByMap(map, "t_goods.selectGoodsById"); // TMemberReceiverLatLon memberReceiverLatLon = null; // //订单地址 // if(receiverId != null){ // memberReceiverLatLon =tmemberreceiverlatlondao.selectByPrimaryKey(Long.valueOf(receiverId.trim())); // } //计算商品运费【TODO:可以考虑抽取成接口,供多端调用】 // BigDecimal freight = getReserveFreight(memberReceiverLatLon,goodsId); // // BigDecimal goodsTotal = null; // //商品小计 // if(goodsMap != null && goodsMap.get("pcPrice") != null){ // BigDecimal pcPrice =(BigDecimal) goodsMap.get("pcPrice"); // goodsTotal = pcPrice.multiply(new BigDecimal(goodsNum)); // goodsMap.put("goodsTotal", goodsTotal); // // } // // BigDecimal totalAmount; // //计算订单总价 // if(goodsTotal != null){ // totalAmount = goodsTotal.add(freight); // goodsMap.put("totalAmount", totalAmount); // } reserveOrderMap.put("goods", goodsMap); // reserveOrderMap.put("freight", freight); return reserveOrderMap; } // public BigDecimal getReserveFreight(TMemberReceiverLatLon memberReceiverLatLon,Long goodId) throws SQLException{ // if(memberReceiverLatLon != null // && memberReceiverLatLon.getStoreId() != null && memberReceiverLatLon.getStoreId().trim().length() > 0){ // return new BigDecimal(0); // }else{ // TGoodFreightExample tGoodFreightExample = new TGoodFreightExample(); // tGoodFreightExample.createCriteria().andGoodIdEqualTo(goodId); // List tgoodfreightList = tgoodfreightdao.selectByExample(tGoodFreightExample); // TGoodFreight tGoodFreight = null; // if(tgoodfreightList != null && tgoodfreightList.size() > 0){ // tGoodFreight = (TGoodFreight) tgoodfreightList.get(0); // // Long freightId = tGoodFreight.getFreightId(); // TFreightExample tFreightExample = new TFreightExample(); // tFreightExample.createCriteria().andIdEqualTo(freightId); // List tFreightList = tfreightdao.selectByExample(tFreightExample); // // if(tFreightList != null && tFreightList.size() > 0){ // TFreight tFreight = (TFreight) tFreightList.get(0); // if(tFreight.getIsDelete() != 1){ // return tFreight.getFreight(); // } // } // } // } // // return new BigDecimal(0); // } }
public class RespiratoryMonitor extends Monitor{ private final static Measurement min = new IntMeasurement(12); private final static Measurement max = new IntMeasurement(20); public RespiratoryMonitor() { super(min, max); } }
package com.IRCTradingDataGenerator.tradingDataGenerator; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.util.List; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.mock.web.MockHttpSession; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer; import org.springframework.web.context.WebApplicationContext; import com.IRCTradingDataGenerator.tradingDataGenerator.Models.Collateral; import com.IRCTradingDataGenerator.tradingDataGenerator.Models.Counterparty; import com.IRCTradingDataGenerator.tradingDataGenerator.Models.Principle; import com.IRCTradingDataGenerator.tradingDataGenerator.Models.TradeRequest; import com.IRCTradingDataGenerator.tradingDataGenerator.Models.Trade; import com.IRCTradingDataGenerator.tradingDataGenerator.Models.Transaction; import com.IRCTradingDataGenerator.tradingDataGenerator.Services.DataService; import com.IRCTradingDataGenerator.tradingDataGenerator.Services.TradeService; import com.fasterxml.jackson.databind.ObjectMapper; @SpringBootTest @AutoConfigureMockMvc @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD) public class TradesTests { @Autowired TradeService tradeService; @Autowired DataService dataService; @Autowired WebApplicationContext webApplicationContext; @Autowired ObjectMapper objectMapper; MockMvc mockMvc; MockHttpSession session; final static String TRADE_CONTROLLER_URI = "/tradeController"; @BeforeEach public void setUp() { this.session = new MockHttpSession(); this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext) .apply(SharedHttpSessionConfigurer.sharedHttpSession()) .build(); } @AfterEach public void test() { this.session = null; this.mockMvc = null; } @Test public void testThatTradeCanBeCreated() { String tradeType = "Margin Lending"; Trade trade = new Trade(); trade.setTrade_level("TCTN"); trade.setTrade_quality("Clean"); trade.setReporting_timestamp(dataService.createDateAndTimeFromToday()); Transaction transaction = new Transaction(); transaction.setType_Of_Sft(tradeService.getSFT(tradeType)); transaction.setEvent_date(dataService.createDateFromToday()); transaction.setTermination_date(dataService.createDateFromToday()); transaction.setExecution_timestamp(dataService.createDateAndTimeFromToday()); tradeService.save(transaction); Counterparty counterParty = new Counterparty(); // Set CP A counterParty.setReport_SubmittingEntity(tradeService.getLEI()); counterParty.setEntity_responsible_for_report(counterParty.getReport_SubmittingEntity()); counterParty.setReporting_counterparty(counterParty.getReport_SubmittingEntity()); // Set CP B counterParty.setOther_counterparty(tradeService.getLEI()); counterParty.setReporting_timestamp(dataService.createDateAndTimeFromToday()); counterParty.setBranch_reporting_counterparty(tradeService.getCountry(counterParty.getReporting_counterparty())); counterParty.setBranch_other_counterparty(tradeService.getCountry(counterParty.getOther_counterparty())); counterParty.setOther_counterparty_country(tradeService.getCountry(counterParty.getOther_counterparty())); counterParty.setCounterparty_nature(tradeService.getNature()); counterParty.setSector_of_reporting_counterparty(tradeService.getSectorClass(counterParty.getCounterparty_nature())); counterParty.setAdditional_sector_classification(tradeService.getAddSectorClass()); counterParty.setCounterparty_side(tradeService.getCounterPartySide()); tradeService.save(counterParty); Collateral collateral = new Collateral(); collateral.setLEI_of_issuer(counterParty.getReporting_counterparty()); collateral.setJurisdiction_of_issuer(tradeService.getCountry(collateral.getLEI_of_issuer())); collateral.setReused_collateral_currency(tradeService.getCurrency(collateral.getJurisdiction_of_issuer())); collateral.setFunding_source_currency(tradeService.getCurrency(collateral.getJurisdiction_of_issuer())); collateral.setFunding_source(tradeService.getFundingSource()); collateral.setPrice_currency(tradeService.getCurrency(collateral.getJurisdiction_of_issuer())); collateral.setCurrency_collateral_nom_amount(tradeService.getCurrency(collateral.getJurisdiction_of_issuer())); collateral.setCollateral_component(tradeService.getCollateralComponent()); collateral.setCollateral_quality(tradeService.getCollateralQuality()); collateral.setCollateral_type(tradeService.getCollteralType()); collateral.setMethod_to_provide_collateral(tradeService.getMethodToProvideCollateral()); collateral.setCollateral_market_value(dataService.createNumeric18().toString()); collateral.setPrice_per_unit(dataService.createNumeric11().toString()); collateral.setCollateral_quantity_or_nom_amount(dataService.createNumeric18().toString()); collateral.setHaircut_or_margin(dataService.createNumeric11().toString()); collateral.setEstimated_reuse_of_collateral(dataService.createNumeric18().toString()); collateral.setValue_of_reused_collateral(dataService.createNumeric18().toString()); collateral.setMaturity_date_of_the_security(dataService.createDateFromToday()); collateral.setClassification_of_security_used_as_collateral(dataService.createISIN(collateral.getLEI_of_issuer())); collateral.setIdentification_of_security_as_collateral(dataService.createCFI()); collateral.setAvailability_for_collateral_reuse(dataService.getTrueOrFlase()); tradeService.save(collateral); Principle principle = new Principle(); principle.setDay_count_convention(tradeService.getDayCountConvention()); principle.setFloat_ref_period_time(tradeService.getTimePeriod()); principle.setFloat_pay_freq_time(tradeService.getTimePeriod()); principle.setFloat_reset_freq_time(tradeService.getTimePeriod()); principle.setMargin_currency(tradeService.getCurrency(collateral.getJurisdiction_of_issuer())); principle.setOutstanding_ML_base_currency(tradeService.getCurrency(collateral.getJurisdiction_of_issuer())); principle.setFloating_rate(tradeService.getFloatingRate()); principle.setFixed_rate(dataService.createNumeric11().toString()); principle.setOutstanding_margin_loan(dataService.createNumeric18().toString()); principle.setShort_market_value(dataService.createNumeric18().toString()); principle.setMargin_currency_amount(dataService.createNumeric18().toString()); principle.setFloat_ref_period_multi(dataService.createNumeric3().toString()); principle.setFloat_pay_freq_multi(dataService.createNumeric3().toString()); principle.setFloat_reset_freq_multi(dataService.createNumeric3().toString()); principle.setSpread(dataService.createNumeric5().toString()); tradeService.save(principle); trade.setTrade_transaction(transaction); trade.setTrade_counterparty(counterParty); trade.setTrade_collateral(collateral); trade.setTrade_principle(principle); trade.setTrade_level(tradeService.getLevel()); trade.setTrade_quality("Dirty"); trade.setTrade_type(tradeType); tradeService.save(trade); Assertions.assertNotNull(trade); } @Test public void testThat_TradeCanBeCreated_ViaController() throws Exception { TradeRequest tradeRequest = new TradeRequest("Margin Lending", 10, ""); ResultActions result = this.mockMvc.perform(post(TRADE_CONTROLLER_URI + "/CreateTradeProduct") .session(session) .contentType("application/json") .content(objectMapper.writeValueAsString(tradeRequest))) .andExpect(status().isOk()); Assertions.assertNotNull(result); } @Test public void testThat_AllTrades_CanBeRetrieved() { List<Trade> allTrades = tradeService.getTrades(); Assertions.assertTrue(allTrades.size() > 0); } @Test public void testThat_AllTrades_CanBeretrieved_Viacontroller() throws Exception { ResultActions result = this.mockMvc.perform(get(TRADE_CONTROLLER_URI + "/GetAllTradeProducts") .session(session) .contentType("application/json")) .andExpect(status().isOk()); Assertions.assertNotNull(result); } @Test public void testThat_SingleTrade_CanBeRetrieved() { List<Trade> allTrades = tradeService.getTrades(); int tradeId = allTrades.get(0).getTrade_Id(); Trade tradeFromDb = tradeService.getTradeById(tradeId).get(); Assertions.assertEquals(tradeId, tradeFromDb.getTrade_Id()); } @Test public void testThat_SingleTrade_CanBeRetrieved_ViaController() throws Exception { ResultActions result = this.mockMvc.perform(get(TRADE_CONTROLLER_URI + "/GetTradeProductById/" + 1) .session(session) .contentType("application/json")) .andExpect(status().isOk()); Assertions.assertNotNull(result); } }
package com.microservices.notesservice.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import com.microservices.notesservice.dto.EditLabelDTO; import com.microservices.notesservice.dto.LabelDTO; import com.microservices.notesservice.dto.ResponseDTO; import com.microservices.notesservice.model.LabelDetailsModel; import com.microservices.notesservice.model.NoteDetailsModel; import com.microservices.notesservice.service.ILabelService; import javax.validation.Valid; import java.util.List; import java.util.UUID; @RestController @RequestMapping("/label_api") @CrossOrigin public class LabelController { @Autowired ILabelService labelService; @PostMapping("/adding_label") public ResponseEntity addLabel(@RequestHeader(name = "userId") String userIdToken, @RequestBody @Valid LabelDTO addLabelDto, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return new ResponseEntity<ResponseDTO>(new ResponseDTO(bindingResult.getAllErrors().get(0). getDefaultMessage(), "100", null), HttpStatus.BAD_REQUEST); } LabelDetailsModel labelDetailsModel = labelService.addLabel(userIdToken, addLabelDto); return new ResponseEntity(new ResponseDTO("THE LABEL ADDED SUCCESSFULLY ", "200", labelDetailsModel),HttpStatus.OK); } @GetMapping("/getting_all_label") public ResponseEntity getLabel(@RequestHeader(name = "userId") String userIdToken) { List<LabelDetailsModel> labelList = labelService.setListOfLabel(userIdToken); return new ResponseEntity (new ResponseDTO("THE LABEL LIST ARE ", "200", labelList), HttpStatus.OK); } @PutMapping("/update_label") public ResponseEntity updateLabel(@RequestHeader(name = "userId") String userIdToken, @RequestBody @Valid EditLabelDTO addLabelDto, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return new ResponseEntity<ResponseDTO>(new ResponseDTO(bindingResult.getAllErrors().get(0). getDefaultMessage(), "100", null), HttpStatus.BAD_REQUEST); } LabelDetailsModel labelDetailsModel = labelService.updateLabel(userIdToken, addLabelDto); return new ResponseEntity (new ResponseDTO("THE LABEL UPDATED SUCCESSFULLY ", "200", labelDetailsModel), HttpStatus.OK); } @DeleteMapping public ResponseEntity deleteLabel(@RequestHeader(name = "userId") String userIdToken, @RequestParam(name = "labelId") UUID labelId) { String labelDetailsModel = labelService.deleteLabelDetails(userIdToken, labelId); return new ResponseEntity (new ResponseDTO("THE LABEL DELETED SUCCESSFULLY ", "200", labelDetailsModel), HttpStatus.OK); } @PostMapping("/labels_to_note") public ResponseEntity addLabeltoNote(@RequestHeader String token, @RequestParam UUID labelId, @RequestParam UUID noteId) { NoteDetailsModel noteDetailsModel = labelService.addLabelNote(token, labelId, noteId); return new ResponseEntity (new ResponseDTO("THE LABEL ADDED TO NOTE SUCCESSFULLY ", "200", noteDetailsModel), HttpStatus.OK); } @PutMapping("/labels_to_note_new") public ResponseEntity addNewLabeltoNote(@RequestHeader String token, @RequestParam UUID noteId, @RequestBody @Valid LabelDTO addLabelDto, BindingResult bindingResult){ if (bindingResult.hasErrors()) { return new ResponseEntity<ResponseDTO>(new ResponseDTO(bindingResult.getAllErrors().get(0). getDefaultMessage(), "100", null), HttpStatus.BAD_REQUEST); } NoteDetailsModel noteDetailsModel=labelService.addNewLabelToExistingNote(token,noteId,addLabelDto); return new ResponseEntity (new ResponseDTO("THE LABEL ADDED TO NOTE SUCCESSFULLY ", "200", noteDetailsModel), HttpStatus.OK); } @GetMapping("/getting_all_label_notes") public ResponseEntity getLabelOfNotes(@RequestHeader(name = "userId") String userIdToken, @RequestParam UUID noteId) { List<LabelDetailsModel> labelList=labelService.getLabelByNotes(userIdToken,noteId); return new ResponseEntity (new ResponseDTO("THE LABEL LIST ARE ", "200", labelList), HttpStatus.OK); } @PutMapping("/label/remove_label_from_Note") public ResponseEntity removeLabeltoNote(@RequestHeader String token, @RequestParam UUID labelId, @RequestParam UUID noteId){ String deleteMessage=labelService.deleteLabelFromNote(token,labelId,noteId); return new ResponseEntity (new ResponseDTO("THE LABEL DELETION STATUS ", "200", deleteMessage), HttpStatus.OK); } }
package ch.fhnw.edu.cpib.cst; import ch.fhnw.edu.cpib.cst.interfaces.IExpr; import ch.fhnw.edu.cpib.cst.interfaces.IFactor; import ch.fhnw.edu.cpib.scanner.interfaces.IToken; // factor ::= LPAREN expr RPAREN public class FactorLParen extends Production implements IFactor { protected final IToken T_lParen; protected final IExpr N_expr; protected final IToken T_rParen; public FactorLParen(final IToken t_lParen, final IExpr n_expr, final IToken t_rParen) { T_lParen = t_lParen; T_rParen = t_rParen; N_expr = n_expr; } @Override public ch.fhnw.edu.cpib.ast.interfaces.IFactor toAbsSyntax() { return new ch.fhnw.edu.cpib.ast.ExprFactor(N_expr.toAbsSyntax()); } }
package com.rc.portal.webapp.model; import java.math.BigDecimal; public class GroupModel { private Long goodsid;//商品id private Integer main_goods;//是否主商品 private String short_name;//商品名称 private String abbreviationPicture;//商品缩略图 private BigDecimal price;//商品价格 private BigDecimal pcPrice; private BigDecimal wapPrice; private BigDecimal appPrice; public BigDecimal getPcPrice() { return pcPrice; } public void setPcPrice(BigDecimal pcPrice) { this.pcPrice = pcPrice; } public BigDecimal getWapPrice() { return wapPrice; } public void setWapPrice(BigDecimal wapPrice) { this.wapPrice = wapPrice; } public BigDecimal getAppPrice() { return appPrice; } public void setAppPrice(BigDecimal appPrice) { this.appPrice = appPrice; } public String getShort_name() { return short_name; } public void setShort_name(String shortName) { short_name = shortName; } public Integer getMain_goods() { return main_goods; } public void setMain_goods(Integer mainGoods) { main_goods = mainGoods; } public Long getGoodsid() { return goodsid; } public void setGoodsid(Long goodsid) { this.goodsid = goodsid; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public String getAbbreviationPicture() { return abbreviationPicture; } public void setAbbreviationPicture(String abbreviationPicture) { this.abbreviationPicture = abbreviationPicture; } }
package forex.rates.api.service; import java.time.LocalDate; public interface DateTimeProviderService { long getCurrentTimestamp(); String getTodaysDateAsString(); LocalDate getTodaysDate(); }
package cn.edu.zucc.web.controller; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * 通用界面处理 * Created by zxy on 2016/7/6. * @author zxyAnkh * @since 2016-07-06 */ @Controller("pageController") @RequestMapping("/page") public class PageController { private static final Log logger = LogFactory.getLog(UserController.class); /** * 登录页 */ @RequestMapping(value = "/login", method = RequestMethod.GET) public String login() { logger.info("/page/login"); return "login"; } /* * 登录后跳转页面 根据权限跳转至不同url */ @RequestMapping("/index") public String indexAdmin(){ logger.info("/page/index"); Subject subject = SecurityUtils.getSubject(); if(subject.hasRole("admin")) return "redirect:/ntr/admin/main?page=1"; else if(subject.hasRole("user")) return "redirect:/ntr/user/main"; return "login"; } /** * 401页 */ @RequestMapping("/401") public String error401() { return "401"; } /** * 404页 */ @RequestMapping("/404") public String error404() { return "404"; } /** * 500页 */ @RequestMapping("/500") public String error500() { return "500"; } }
package com.lvt.demo.config; import com.lvt.demo.bean.ResponseBasicObj; import com.lvt.demo.exception.ErrorCode; import com.lvt.demo.service.MessageService; import com.lvt.demo.utils.ApplicationConstants; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.MethodParameter; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; import javax.servlet.http.HttpServletRequest; @ControllerAdvice public class ApplicationReponseBodyFilter implements ResponseBodyAdvice<Object> { @Autowired private MessageService messageService; @Autowired private HttpServletRequest request; @Override public boolean supports(MethodParameter arg0, Class<? extends HttpMessageConverter<?>> arg1) { if (arg0.getMethod().getReturnType() == ResponseEntity.class) { return false; } String servletPath = request.getServletPath(); if (!StringUtils.startsWith(servletPath, ApplicationConstants.APPLICATION_API.API_PREFIX)) { return false; } return true; } @Override public Object beforeBodyWrite(Object body, MethodParameter methodParameter, MediaType mediaType, Class<? extends HttpMessageConverter<?>> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) { return new ResponseBasicObj(messageService.getCode(ErrorCode.SUCCESS), messageService.getMessage(ErrorCode.SUCCESS), body); } }
package presentacion.controlador.command.CommandFactura; import negocio.factorias.FactorySA; import negocio.factura.SAFactura; import presentacion.contexto.Contexto; import presentacion.controlador.command.Command; import presentacion.eventos.EventosFactura; /** * The Class CerrarFactura. */ public class CerrarFactura implements Command { /* * (non-Javadoc) * * @see presentacion.controlador.command.Command#execute(java.lang.Object) */ @Override public Contexto execute(final Object objeto) { final int id = (int) objeto; final SAFactura sa = FactorySA.getInstance().createSAFactura(); String mensaje; Contexto contexto; try { sa.cerrarFactura(id); mensaje = "Factura cerrada correctamente."; contexto = new Contexto(EventosFactura.CERRAR_FACTURA_OK, mensaje); } catch (final Exception e) { mensaje = e.getMessage(); contexto = new Contexto(EventosFactura.CERRAR_FACTURA_KO, mensaje); } return contexto; } }
/* * 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 utils; import java.io.UnsupportedEncodingException; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Florian */ public class Base64UrlTest { public Base64UrlTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } @Test public void testEncodeDecode() { try { String str; // decodage(encodage(str)) = str str = Base64Url.encode("abcdefghi", "UTF-8"); str = Base64Url.decode(str, "UTF-8"); assertEquals("abcdefghi", str); // test décodage padding 1 = str = Base64Url.decode("YWJjZGVmamhpamtsbW4=", "UTF-8"); assertEquals("abcdefjhijklmn", str); // test décodage padding 1 . str = Base64Url.decode("YWJjZGVmamhpamtsbW4.", "UTF-8"); assertEquals("abcdefjhijklmn", str); // test décodage padding 1 omis str = Base64Url.decode("YWJjZGVmamhpamtsbW4", "UTF-8"); assertEquals("abcdefjhijklmn", str); // test encodage, + remplacé par - str = Base64Url.encode("^a~", "UTF-8"); assertEquals("XmF-", str); // test décodage padding 2 = str = Base64Url.decode("c2tqZGhmanNkaGZqc2RoZnNkYQ==", "UTF-8"); assertEquals("skjdhfjsdhfjsdhfsda", str); // test décodage padding 2 . str = Base64Url.decode("c2tqZGhmanNkaGZqc2RoZnNkYQ..", "UTF-8"); assertEquals("skjdhfjsdhfjsdhfsda", str); // test décodage padding 2 omis str = Base64Url.decode("c2tqZGhmanNkaGZqc2RoZnNkYQ", "UTF-8"); assertEquals("skjdhfjsdhfjsdhfsda", str); // encodage sans padding en sortie str = Base64Url.encode("skjdhfjsdhfjsdhfsda", "UTF-8"); assertEquals("c2tqZGhmanNkaGZqc2RoZnNkYQ", str); // décodage : on récupère bien l'entrée précédente str = Base64Url.decode(str, "UTF-8"); assertEquals("skjdhfjsdhfjsdhfsda", str); str = Base64Url.decode("aOly6Q", "ISO-8859-1"); assertEquals("héré", str); } catch (UnsupportedEncodingException ex) { assertTrue(false); Logger.getLogger(Base64UrlTest.class.getName()).log(Level.SEVERE, null, ex); } } }
package com.tt.miniapp.shortcut.dialog; public class TextSpan { public Builder builder; public String text; public DialogConfig.TextClickListener textClickListener; public int textColor; public float textSize; public int typeFace; public Builder getBuilder() { return this.builder; } public String getText() { return this.text; } public DialogConfig.TextClickListener getTextClickListener() { return this.textClickListener; } public int getTextColor() { return this.textColor; } public float getTextSize() { return this.textSize; } public int getTypeFace() { return this.typeFace; } public static class Builder { private TextSpan mTextSpan = new TextSpan(); public TextSpan build() { TextSpan textSpan = this.mTextSpan; textSpan.builder = this; return textSpan; } public Builder setClickCallback(DialogConfig.TextClickListener param1TextClickListener) { this.mTextSpan.textClickListener = param1TextClickListener; return this; } public Builder setText(String param1String) { this.mTextSpan.text = param1String; return this; } public Builder setTextColor(int param1Int) { this.mTextSpan.textColor = param1Int; return this; } public Builder setTextSize(float param1Float) { this.mTextSpan.textSize = param1Float; return this; } public Builder setTypeFace(int param1Int) { this.mTextSpan.typeFace = param1Int; return this; } } } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\shortcut\dialog\TextSpan.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
/** * */ package com.temple.common; import java.io.InputStream; import java.util.Properties; /** * @author Mayur Jain * */ public class LoadConfiguration { private static LoadConfiguration configuration = new LoadConfiguration(); private Properties configProperties = null; public Properties getConfigProperties() { return configProperties; } public void setConfigProperties(Properties configProperties) { this.configProperties = configProperties; } private LoadConfiguration() { configProperties = new Properties(); } public static LoadConfiguration getInstance() { try { InputStream in = LoadConfiguration.class.getClassLoader() .getResourceAsStream("configuration.properties"); configuration.getConfigProperties().load(in); } catch (Exception e) { e.printStackTrace(); } return configuration; } }
package com.example.amapmap; import com.amap.api.location.AMapLocation; /** * @user steven * @createDate 2019/3/13 15:26 * @description 高德地图定位回调接口 */ public interface AmapLocationChangeListener { void onLocationChanged(AMapLocation location); }
package com.cdeid.controller; import gate.creole.ResourceInstantiationException; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import com.cdeid.io.Input; import com.cdeid.io.Output; import com.cdeid.pipeline.firstpass.PassOne; import com.cdeid.pipeline.firstpass.ner.EmailNER; import com.cdeid.pipeline.firstpass.ner.UrlNER; import com.cdeid.pipeline.other.Overlap; import com.cdeid.pipeline.other.PostProcess; import com.cdeid.pipeline.other.PreProcess; /** * mDEID Copyright (C) 2015-16 A. Dehghan * ChristieDEID Copyright (C) 2016 Christie NHS Foundation Trust * * Controller. * */ public class Controller { public Controller(){} /** * Run NLP components: * 1. Pre-processing * 2. PassOne * 3. Post-processing * * @param r_corpus input directory * @param w_corpus output directory * @throws ResourceInstantiationException * @throws IOException * */ public void runLetterNERs(File input_dir, File output_dir, String outputFormat) throws ResourceInstantiationException, IOException{ PreProcess p = new PreProcess(); gate.Document gateDoc = null; Collection<File> fileList = Input.readFolder(input_dir); //to store processed documents @runtime ArrayList<gate.Document> gateDocList = new ArrayList<gate.Document>(); //for each input document: System.out.println("Processing document(s):"); for(File f: fileList){ System.out.print("\r"+f.getName()); gateDoc = Input.getGateDocument(f); if(gateDoc == null) continue; //NLP pre-process i.e., Tokeniser and Sentence splitter gateDoc.setName(f.getName()); //set name; necessary for PassTwo.class p.preProcessingPipeline(gateDoc); gateDocList.add(gateDoc); } System.out.print("\r"); /* * run pass one */ runFirstPassPipeline_UkLetter(gateDocList); /* * run post processing pipeline */ runPostProcessingLetterPipeline(gateDocList); /* * output */ Output.saveNotes(output_dir, gateDocList, outputFormat); } /** * Run first pass pipeline. Prerequisite: PreProcess.java processed gate.Documents. * * @param gateDocList list of gate.Documents */ private static void runFirstPassPipeline_UkLetter(ArrayList<gate.Document> gateDocList){ PassOne p1 = new PassOne(); for(gate.Document g: gateDocList){ p1.firstPassPipeline_Letter(g); Overlap.rmOverlap(g, "HOSPITAL", "passOne"); //needed? UrlNER.run(g); EmailNER.run(g); } } /** * Run post processing pipeline for letters only. Prerequisite: PassOne.java and PassTwo.java processed gate.Documents. * * @param gateDocList */ private static void runPostProcessingLetterPipeline(ArrayList<gate.Document> gateDocList){ PostProcess pp = new PostProcess(); //post processing for(gate.Document g: gateDocList){ pp.postProcessingLetterPipeline(g); } } }
package net.minecraft.entity.ai; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.math.MathHelper; public class EntityAILeapAtTarget extends EntityAIBase { EntityLiving leaper; EntityLivingBase leapTarget; float leapMotionY; public EntityAILeapAtTarget(EntityLiving leapingEntity, float leapMotionYIn) { this.leaper = leapingEntity; this.leapMotionY = leapMotionYIn; setMutexBits(5); } public boolean shouldExecute() { this.leapTarget = this.leaper.getAttackTarget(); if (this.leapTarget == null) return false; double d0 = this.leaper.getDistanceSqToEntity((Entity)this.leapTarget); if (d0 >= 4.0D && d0 <= 16.0D) { if (!this.leaper.onGround) return false; return (this.leaper.getRNG().nextInt(5) == 0); } return false; } public boolean continueExecuting() { return !this.leaper.onGround; } public void startExecuting() { double d0 = this.leapTarget.posX - this.leaper.posX; double d1 = this.leapTarget.posZ - this.leaper.posZ; float f = MathHelper.sqrt(d0 * d0 + d1 * d1); if (f >= 1.0E-4D) { this.leaper.motionX += d0 / f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; this.leaper.motionZ += d1 / f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; } this.leaper.motionY = this.leapMotionY; } } /* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraft\entity\ai\EntityAILeapAtTarget.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
package com.ttianjun.controller; import com.jfinal.aop.Before; import com.jfinal.core.Controller; import com.jfinal.log.Logger; import com.jfinal.plugin.activerecord.*; import com.jfinal.plugin.activerecord.tx.Tx; import com.jfinal.token.TokenManager; import com.ttianjun.ext.Content; import com.ttianjun.interceptor.Seach; import com.ttianjun.model.Menu; import com.ttianjun.model.SeachModel; import com.ttianjun.model.User; import com.ttianjun.pageModel.DataGrid; import com.ttianjun.pageModel.TreeNode; import org.apache.commons.lang.ArrayUtils; import java.util.*; /** * Created by HiWin81 on 2014/11/15 0015. */ public class BaseController<M extends SeachModel<M>> extends Controller { public Logger log=Logger.getLogger(getClass()); protected Model<M> po; protected Class<M> modelClass; protected static String tokenName="token"; protected int tokenTout=600; protected Table table; public BaseController(Class<M> modelClass) { super(); this.modelClass = modelClass; if(modelClass!=null) this.table = TableMapping.me().getTable(this.modelClass); } public void index(){ } public Model<M> get(Long id) { Model<M> model_; try { model_ = modelClass.newInstance(); return model_.findById(id);//Db.findById(this.tableName, id); } catch (Exception e) { } return null; } public void view() { Long id= this.getParaToLong(0,0L); if(id!=null&&id!=0L) this.setAttr("po",get(id)); else this.setAttr("po",new Record()); } public void edit() { try { Long id = this.getParaToLong(0, 0L); if (id != 0L) { po = get(id); }else{ setAttr("now",new Date()); } TokenManager.createToken(this, tokenName, tokenTout); this.setAttr("po",po); } catch (Exception e) { log.error("编辑异常", e); } } public User getCurrentUser(){ return getSessionAttr(Content.SESSION_LOGIN_USER); } @Before(Tx.class) public void save() { String msg; try { Model<M> m = this.getModel(modelClass); if(Arrays.asList(m.getAttrNames()).contains("pid")){//判断是否存在pid if(m.get("pid")==null) m.set("pid",0); } Integer id = m.getInt("id"); Long tokenl=this.getParaToLong("token"); if(tokenl!=null){ if(!TokenManager.validateToken(this, tokenName)){ this.rendJson_(false, "会话令牌错误!",id,new Random().nextLong()); return; } } Date now=new Date(); if (id != null && id != 0) { msg="修改成功!"; m.set("update_time",now);//修改时间 otherSave(m); m.update(); } else { msg="保存成功!"; m.set("create_time",now);//创建时间 m.save(); otherSave(m); } id = m.getInt("id"); rendJson_(true,msg, id,new Random().nextLong()); } catch (Exception e) { log.error("保存异常", e); rendJson_(false, "保存异常!"); e.printStackTrace(); } } public void del() { try { Long id = this.getParaToLong(0); if (id == null||id==0L){ String ids = this.getPara("ids"); if (ids != null && !"".equals(ids)) { Db.update("delete from " + this.table.getName() + " where id in ("+ ids+ ")"); } else { id = this.getParaToLong("ID"); } }else{ po = get(id); if(hashChild(id)==false){ Db.deleteById(this.table.getName(), id); }else{ rendJson_(false, "此数据有相关联的子集数据,请先删除子集数据项!"); return; } } rendJson_(true, "删除成功!",id); } catch (Exception e) { log.error("删除异常", e); rendJson_(false, "删除异常!"); } } public void combotree() { combotree(null); } public void combotree(List<Integer> ckidList) { List<Record> dataList =null; String sql="select id,name,pid from "+table.getName(); Integer id=getParaToInt(0,0); String orderBy=""; if(table.hasColumnLabel("seq")) orderBy=" order by seq "; if(id==0) dataList = Db.find(sql+orderBy); else dataList = Db.find(sql+" where id <> ? "+orderBy,id); List<TreeNode> list = new ArrayList<TreeNode>(); TreeNode rootNode = new TreeNode(); rootNode.setId(0); rootNode.setText(""); rootNode.setIconCls("icon-home"); rootNode.setCanChk(false); //rootNode.setChecked(true); fillTree(dataList, rootNode,"name",true,ckidList); list.add(rootNode); this.renderJson(list); } public void combobox(){ int id=getParaToInt(0,0); List<Record> list=null; String sql="select * from "+table.getName(); if(id==0) list = Db.find(sql); else list = Db.find(sql+" where id <>?",id); this.renderJson(list); } /**树形表格*/ public void treeDataGrid(List<Record> list) { DataGrid dg=new DataGrid(); List<Map<String,Object>> list1=new ArrayList<Map<String,Object>>(); for(Record r:list){ Map<String,Object> d=new HashMap<String,Object>(); for(String col:r.getColumnNames()){ d.put(col,r.get(col)); } Integer pid=r.getInt("pid"); //Integer id=r.getInt("id"); if(pid!=null&&pid!=0) d.put("_parentId",pid);//tree datagrid 需要使用此字段作为父节点关联 //String sql="select * from "+table.getName()+" where pid=?"; //if(Db.find(sql, id).size()>0)//判断是否有子节点 // d.put("state", "closed"); list1.add(d); } dg.setRows(list1); dg.setTotal(list1.size()); this.renderJson(dg); } /** * 通过pid字段关联 * @param dataList 集合 * @param pnode 父节点 * @param cname 节点名称字段 */ protected void fillTree(List<Record> dataList,TreeNode pnode,String cname,Boolean canChk,List<Integer>ckidList) { List<TreeNode> childelist = new ArrayList<TreeNode>(); for (Record m : dataList) { Integer pid_ = m.getInt("pid"); if (pnode.getId() == pid_) { Integer id = m.getInt("id"); TreeNode nodechild = new TreeNode(); nodechild.setId(id); nodechild.setText(m.getStr(cname)); nodechild.setCanChk(canChk); childelist.add(nodechild); if(ckidList!=null&& ArrayUtils.contains(ckidList.toArray(), id)) nodechild.setChecked(true); fillTree(dataList, nodechild,cname,canChk,ckidList); } } if (childelist.isEmpty() == false && childelist.size() > 0) { pnode.setChildren(childelist); } } /** * 保存修改的其他操作 * @param m */ protected void otherSave(Model<M> m){ } /**是否有子集 针对树形数据*/ private boolean hashChild(Long id){ try{ Table tableInfo = TableMapping.me().getTable(modelClass); if(tableInfo.hasColumnLabel("pid")){ List<Record> list=Db.find("select * from "+tableInfo.getName()+" where pid=?", id); return list!=null&&list.isEmpty()==false; } }catch(Exception e){ return false; } return false; } @Before(Seach.class) public void grid(){ Seach seach = getAttr("seachBean"); int page=getParaToInt("page", 1); int rows=this.getParaToInt("rows", 20); otherSeach(seach);//一些其他的查询 try { Page<M> date=modelClass.newInstance().paginate(page,rows,seach); rendDataGrid(date); } catch (Exception e) { log.error("gird",e); rendJson_(false, e.getMessage()); } } /** * 返回easyui格式的列表数据 * @param page 分页数据 * @author 田俊 */ public void rendDataGrid(Page<M> page){ renderJson( new DataGrid(page.getList(),page.getTotalRow())); } /** * 其他查询操作 * @param seach */ protected void otherSeach(Seach seach) { } public void rendJson_(boolean success,String msg,Object... obj){ Map<String,Object> json=new HashMap<String,Object>(); json.put("success",success); json.put("msg",msg); if(obj!=null&&obj.length>0){ json.put("obj",obj[0]); if(obj.length>1){ json.put("tokenid",obj[1]); } } this.renderJson(json); } /** * 是否有权限 * @param key * @return */ public boolean hasPerm(String key){ //是否有权限 返回true代表有权限 User user = getCurrentUser(); List<Menu> menuList = user.getMenuCommon(); if ( key != null) { for(Menu m : menuList){ if(key.equals( m.get("url") ) ) return true; } } return false; } }
package com.hit.neuruimall.mapper; import com.hit.neuruimall.model.AddressModel; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; import java.util.List; @Mapper @Repository public interface AddressMapper { public void insert(AddressModel addressModel); public AddressModel selectById(Integer userId, Integer addressId); public Integer selectUserMaxAddressId(Integer userId); public void deleteById(Integer userId, Integer addressId); public void update(AddressModel addressModel); public List<Integer> selectUserAddressId(Integer id); }
/** * @EquipmentDao.java * @com.lingnet.vocs.dao.equipment * @Description: * * @author zhangyu * @copyright 2017 * @version V * @since 2017年6月2日 */ package com.lingnet.vocs.dao.equipment; import java.util.HashMap; import java.util.List; import java.util.Map; import com.lingnet.common.dao.BaseDao; import com.lingnet.util.Pager; import com.lingnet.vocs.entity.Equipment; /** * @ClassName: EquipmentDao * @Description: TODO * @author zhangyu * @date 2017年6月2日 下午6:33:25 * */ public interface EquipmentDao extends BaseDao<Equipment, String> { /** * @Title: getAirVolumeByEquipment * @param map * @return String * @author wanl * @since 2017年6月29日 V 1.0 */ public String getAirVolumeByEquipment(HashMap<String, Object> map); /** * @Title: getAirVolume * @param map * @return String * @author wanl * @since 2017年6月29日 V 1.0 */ public String getAirVolume(HashMap<String, Object> map); /** * @Title: savePlc * @param id * @return String * @author wanl * @since 2017年7月7日 V 1.0 */ public String savePlc(String id, HashMap<String, Object> map); public Pager getEqByconData(Pager pager, String partnerId); Pager findPagerEquipment(Map<String, String> m, Pager pager, String partnerId); public List<Object[]> getcd(Pager pager,String partnerId,String areaId,Map<String, String> m); }
/* * 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 impl; import adt.KeyValuePair; import adt.Map; /** * * @author технодом */ public class LLStackMap <K, V> implements Map <K,V>{ private LinkedListStack <KeyValuePair<K,V>> pairs; private int size; public LLStackMap () { pairs = new LinkedListStack(); size = 0; } @Override public void define(K key, V value) { KeyValuePair <K, V> m = new KeyValuePair (key,value); if (size == 0) { pairs.push(m); } else{ LinkedListStack <KeyValuePair<K,V>> temp; temp = new LinkedListStack(); for (int i=0; i<pairs.getSize(); i++) { try { KeyValuePair <K, V> x = pairs.pop(); temp.push(x); if (x.getKey().equals(key)){ x.setValue(value); while (temp.getSize()!=0){ pairs.push(temp.pop()); } } else { KeyValuePair <K,V> y; y = new KeyValuePair <K,V> (key,value); y.setKey(key); y.setValue(value); pairs.push(y); } } catch (Exception ex) { System.out.println(ex); } } } } @Override public V getValue(K key) { V result = null; LinkedListStack <KeyValuePair<K,V>> temp; temp = new LinkedListStack(); for (int i=0; i<pairs.getSize(); i++) { try { KeyValuePair <K,V> x = pairs.pop(); temp.push(x); if (x.getKey().equals(key)) result = x.getValue(); while (temp.getSize() != 0) { pairs.push(temp.pop()); return result; } } catch (Exception ex) { System.out.println(ex); } } return null; } @Override public V remove(K key) { V result = null; LinkedListStack <KeyValuePair<K,V>> temp; temp = new LinkedListStack(); for (int i=0; i<pairs.getSize();i++) { try{ KeyValuePair <K,V> x = pairs.pop(); temp.push(x); if (x.getKey().equals(key)) { result=x.getValue(); temp.pop(); } while (temp.getSize() != 0) { pairs.push(temp.pop()); } return result; } catch (Exception ex) { System.out.println(ex); } } return null; } @Override public KeyValuePair<K, V> removeAny() throws Exception { if (pairs.getSize() == 0) throw new Exception ("The map is empty"); KeyValuePair <K,V> result = pairs.pop(); return result; } @Override public int getSize() { return pairs.getSize(); } @Override public void clear() { pairs.clear(); } public String toString () { return pairs.toString(); } }
package com.demo.LogicJob.Entity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; import java.util.List; @Getter @Setter @AllArgsConstructor @NoArgsConstructor @Entity @Table(name = "App_Role", // uniqueConstraints = { // @UniqueConstraint(name = "APP_ROLE_UK", columnNames = "Role_Name") }) public class AppRole { public static final String ROLE_USER = "ROLE_USER"; public static final String ROLE_MANAGER = "ROLE_MANAGER"; public static final String ROLE_ADMIN = "ROLE_ADMIN"; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "Role_Id", nullable = false) private Long roleId; @Column(name = "Role_Name", length = 30, nullable = false) private String roleName; @OneToMany(fetch=FetchType.EAGER, mappedBy="roles") private List<AppUser> users; public AppRole(Long i, String roles) { this.roleId = i; this.roleName = roles; } }
package FirstDay; import static org.junit.Assert.*; import org.junit.Test; public class Pattern5Test { Pattern5 p5=new Pattern5(); String pat5=" *\n **\n ***\n ****\n*****\n"; @Test public void test() { //fail("Not yet implemented"); assertEquals(pat5, p5.match5(5)); } }
package com.philschatz.checklist; public class Const { public static final String TODOITEMSNAPSHOT = "todoitem"; public static final String TODOITEMKEY = "todoitemkey"; public static final String TODOLISTSNAPSHOT = "todolist"; public static final String TODOLISTKEY = "todolistkey"; public static final String NOTIFICATIONID = "notificationid"; private Const() {} }
package problem_solve.bfs; import java.util.ArrayList; import java.util.List; public class Vertex { // Data저장. 물론 Type은 바꿔도 됨 private int data; // vertex 방문 여부 확인 private boolean visited; // 방문할 이웃 Vertex들 // Edge pointing 방식으로 구현한 것. private List<Vertex> neighborList; public Vertex(int data){ this.data = data; this.neighborList = new ArrayList<>(); } public int getData() { return data; } public void setData(int data) { this.data = data; } public boolean isVisited() { return visited; } public void setVisited(boolean visited) { this.visited = visited; } public List<Vertex> getNeighborList() { return neighborList; } public void setNeighborList(List<Vertex> neighborList) { this.neighborList = neighborList; } // 여기 까지 getter and setter public void addNeighbourVertex(Vertex vertex){ // ArrayList에 vertex 추가하여 이웃 정보 저장 this.neighborList.add(vertex); } @Override public String toString() { return super.toString(); } }
/** * OpenKM, Open Document Management System (http://www.openkm.com) * Copyright (c) 2006-2015 Paco Avila & Josep Llort * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package com.openkm.bean.workflow; import java.io.Serializable; import java.util.Calendar; import java.util.List; /** * @author pavila */ public class Token implements Serializable { private static final long serialVersionUID = 9113136516768190724L; private long id; private String name; private boolean suspended; private Token parent; private String node; private Calendar start; private Calendar end; private List<Transition> availableTransitions; private List<Comment> comments; private ProcessInstance processInstance; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isSuspended() { return suspended; } public void setSuspended(boolean suspended) { this.suspended = suspended; } public List<Comment> getComments() { return comments; } public void setComments(List<Comment> comments) { this.comments = comments; } public Token getParent() { return parent; } public void setParent(Token parent) { this.parent = parent; } public String getNode() { return node; } public void setNode(String node) { this.node = node; } public Calendar getStart() { return start; } public void setStart(Calendar start) { this.start = start; } public Calendar getEnd() { return end; } public void setEnd(Calendar end) { this.end = end; } public List<Transition> getAvailableTransitions() { return availableTransitions; } public void setAvailableTransitions(List<Transition> availableTransitions) { this.availableTransitions = availableTransitions; } public ProcessInstance getProcessInstance() { return processInstance; } public void setProcessInstance(ProcessInstance processInstance) { this.processInstance = processInstance; } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); sb.append("id="); sb.append(id); sb.append(", name="); sb.append(name); sb.append(", node="); sb.append(node); sb.append(", availableTransitions="); sb.append(availableTransitions); sb.append(", suspended="); sb.append(suspended); sb.append(", start="); sb.append(start==null?null:start.getTime()); sb.append(", end="); sb.append(end==null?null:end.getTime()); sb.append(", parent="); sb.append(parent); sb.append(", comments="); sb.append(comments); sb.append(", processInstance="); sb.append(processInstance); sb.append("]"); return sb.toString(); } }
package com.milano.bc.model; import java.util.Date; public class Corso { private int codice; private String nome; private Date dataInizio; private Date dataFine; private double costo; private String commento; private String aula; private int codDocente; public int getCodice() { return codice; } public void setCodice(int codice) { this.codice = codice; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public Date getDataInizio() { return dataInizio; } public void setDataInizio(Date dataInizio) { this.dataInizio = dataInizio; } public Date getDataFine() { return dataFine; } public void setDataFine(Date dataFine) { this.dataFine = dataFine; } public double getCosto() { return costo; } public void setCosto(double costo) { this.costo = costo; } public String getCommento() { return commento; } public void setCommento(String commento) { this.commento = commento; } public String getAula() { return aula; } public void setAula(String aula) { this.aula = aula; } public int getCodDocente() { return codDocente; } public void setCodDocente(int codDocente) { this.codDocente = codDocente; } }
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int q = in.nextInt(); int[] arr = new int[n]; int[] newPos = new int[n]; for(int i = 0; i < n; i++) { arr[i] = in.nextInt(); newPos[(i+k)%n] = i; } for(int i = 0; i < q; i++) { System.out.println(arr[newPos[in.nextInt()]]); } } }
package com.horical.hrc7.lib_base.base; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import com.horical.hrc7.lib_base.helper.finder.ViewFinder; import java.lang.reflect.InvocationTargetException; /** * Created by Billy Phan on 6/21/2017. */ public abstract class BaseActivity<T> extends AppCompatActivity { private T handler; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void setContentView(int layoutResID) { super.setContentView(layoutResID); ViewFinder.load(this); setupView(); try { if (!(handler instanceof BaseHandler)) throw new RuntimeException("Handler not instance of BaseHandler"); //invoke onInit of serve BaseServe.class.getDeclaredMethod("onInit", Intent.class).invoke(((BaseHandler) handler).getServe(), getIntent()); //invoke onInit of handler BaseHandler.class.getDeclaredMethod("onInit").invoke(handler); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } } protected abstract void setupView(); public T getHandler() { return handler; } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { // If request is cancelled, the result arrays are empty. if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { // permission was granted, yay! Do the // contacts-related task you need to do. try { BaseHandler.class.getDeclaredMethod("onPermissionsAccepted").invoke(handler); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } } else { // permission denied, boo! Disable the // functionality that depends on this permission. //invoke onPermissionDenied of handler try { BaseHandler.class.getDeclaredMethod("onPermissionsDenied").invoke(handler); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } } } // other 'case' lines to check for other // permissions this app might request }
/* */ package datechooser.beans.editor.descriptor; /* */ /* */ import datechooser.beans.locale.LocaleUtils; /* */ import java.util.Locale; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract class ClassDescriptor /* */ { /* */ protected static final String ONE_LINE_SEPARATOR = ", "; /* */ protected static final String NEW_LINE_SEPARATOR = ",\n"; /* 26 */ private static boolean newLineParameters = true; /* */ /* */ /* */ /* */ /* */ /* */ public ClassDescriptor() {} /* */ /* */ /* */ /* */ /* */ /* */ public abstract Class getDescriptedClass(); /* */ /* */ /* */ /* */ /* */ /* */ public abstract String getJavaDescription(Object paramObject); /* */ /* */ /* */ /* */ /* */ /* */ public abstract String getDescription(Object paramObject); /* */ /* */ /* */ /* */ /* */ public String getDescription(Object value, Locale locale) /* */ { /* 57 */ return getDescription(value) + " (" + LocaleUtils.getEditorLocaleString("default_locale_used") + ")"; /* */ } /* */ /* */ /* */ /* */ /* */ protected String getClassName() /* */ { /* 65 */ return getDescriptedClass().getName(); /* */ } /* */ /* */ /* */ /* */ /* */ protected String getSeparator() /* */ { /* 73 */ return isNewLineParameters() ? ",\n" : ", "; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static boolean isNewLineParameters() /* */ { /* 83 */ return newLineParameters; /* */ } /* */ /* */ /* */ /* */ public static void setNewLineParameters(boolean aNewLineParameters) /* */ { /* 90 */ newLineParameters = aNewLineParameters; /* */ } /* */ /* */ /* */ /* */ /* */ public boolean canProcessNull() /* */ { /* 98 */ return false; /* */ } /* */ } /* Location: /home/work/vm/shared-folder/reverse/ketonix/KetonixUSB-20170310.jar!/datechooser/beans/editor/descriptor/ClassDescriptor.class * Java compiler version: 5 (49.0) * JD-Core Version: 0.7.1 */
package com.liushuai.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import com.liushuai.pojo.Hero; import com.liushuai.pojo.Page; import com.liushuai.pojo.User; import com.liushuai.pojo.UserHero; import com.liushuai.service.UserService; @RestController public class UserController { @Autowired private UserService userService; @RequestMapping("/deletUser") public void deletUser(){ int id = 1; userService.delet(id); } @RequestMapping("/updataUser") public void updataUser(User user){ userService.update(user); } @RequestMapping("/insertUser") public void insertUser(){ User user = new User(); userService.insert(user); } @RequestMapping("/loginPage") public ModelAndView login(HttpServletRequest request,HttpSession session){ ModelAndView mView = new ModelAndView(); if (false) { mView.setViewName("succes"); return mView; } mView.setViewName("login"); return mView; } @RequestMapping("/login") public ModelAndView selectUser(User user){ if (user.getuPassword().equals(userService.get(user.getuNo()).getuPassword())) { return new ModelAndView("succes"); } return new ModelAndView("login"); } @RequestMapping("/list") public List<User> page(@RequestBody Page page){ System.out.println(page); page.jisuanLast(userService.total()); return userService.page(page); } }
package com.samyotech.laundry.model; import java.io.Serializable; import java.util.ArrayList; public class HomeDTO implements Serializable { ArrayList<GetBannerDTO> advertis = new ArrayList<>(); ArrayList<ServicesDTO> service = new ArrayList<>(); ArrayList<PopLaundryDTO> laundry = new ArrayList<>(); ArrayList<SpecialOfferPkgDTO> offer = new ArrayList<>(); ArrayList<NearBYDTO> near_by = new ArrayList<>(); public ArrayList<GetBannerDTO> getAdvertis() { return advertis; } public void setAdvertis(ArrayList<GetBannerDTO> advertis) { this.advertis = advertis; } public ArrayList<ServicesDTO> getService() { return service; } public void setService(ArrayList<ServicesDTO> service) { this.service = service; } public ArrayList<PopLaundryDTO> getLaundry() { return laundry; } public void setLaundry(ArrayList<PopLaundryDTO> laundry) { this.laundry = laundry; } public ArrayList<SpecialOfferPkgDTO> getOffer() { return offer; } public void setOffer(ArrayList<SpecialOfferPkgDTO> offer) { this.offer = offer; } public ArrayList<NearBYDTO> getNear_by() { return near_by; } public void setNear_by(ArrayList<NearBYDTO> near_by) { this.near_by = near_by; } }
/* * 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 Customer; import db.Dbcon; import javax.swing.JOptionPane; /** * * @author USER */ public class Registration_Next extends javax.swing.JFrame { /** * Creates new form Registration_Next */ String userid; public Registration_Next() { // initComponents(); } public Registration_Next(String userid) { this.userid=userid; initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jLabel11 = new javax.swing.JLabel(); username_textfield = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); password_passwordfield = new javax.swing.JPasswordField(); jLabel13 = new javax.swing.JLabel(); confirmpassword_passwordfield = new javax.swing.JPasswordField(); numFamilyMember_spinner = new javax.swing.JSpinner(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel1.setText("No of family Members"); jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel2.setText("Member Details"); jTable1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jTable1.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jTable1.setForeground(new java.awt.Color(255, 255, 255)); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null} }, new String [] { "Name", "Gender", "Age", "Relation", "Occupation", "Aadhaar No" } ) { Class[] types = new Class [] { java.lang.Object.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jTable1.setSelectionBackground(new java.awt.Color(255, 255, 255)); jTable1.getTableHeader().setResizingAllowed(false); jTable1.getTableHeader().setReorderingAllowed(false); jScrollPane1.setViewportView(jTable1); jLabel3.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N jLabel3.setText("Upload your proofs....."); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel4.setText("Address Proof"); jLabel5.setFont(new java.awt.Font("Times New Roman", 2, 14)); // NOI18N jLabel5.setText("[ ID card / Water Bill / Electricity Bill / Telephone Bill / Passport]"); jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel6.setText("Age Certificate"); jLabel7.setFont(new java.awt.Font("Times New Roman", 2, 14)); // NOI18N jLabel7.setText("[SSLC / Birth Certificate ]"); jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel8.setText("Anual Income"); jLabel9.setFont(new java.awt.Font("Times New Roman", 2, 14)); // NOI18N jLabel9.setText("[ Income Certificate ]"); jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel10.setText("Aadhaar Card"); jButton1.setText("Browse"); jButton2.setText("Browse"); jButton3.setText("Browse"); jButton4.setText("Browse"); jButton5.setText("Submit"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton6.setText("Reset"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jButton7.setText("Cancel"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jLabel11.setText("UserName"); jLabel12.setText("Password"); jLabel13.setText("Confirm Password"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(39, 39, 39) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jScrollPane1)) .addGap(51, 51, 51)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(114, 114, 114) .addComponent(jLabel9)) .addComponent(jLabel6) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10)) .addGap(163, 163, 163) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton4) .addGroup(layout.createSequentialGroup() .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(42, 42, 42) .addComponent(jButton6) .addGap(49, 49, 49) .addComponent(jButton7)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton2) .addComponent(jButton3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel11) .addComponent(jLabel12) .addComponent(jLabel13) .addComponent(username_textfield, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE) .addComponent(password_passwordfield) .addComponent(confirmpassword_passwordfield))))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(numFamilyMember_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING))) .addGap(67, 67, 67)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel4) .addGap(172, 172, 172) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(114, 114, 114) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5) .addComponent(jLabel7)))) .addGap(165, 331, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGap(250, 250, 250) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(56, 56, 56) .addComponent(jLabel1) .addGap(7, 7, 7) .addComponent(numFamilyMember_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel3) .addGap(20, 20, 20) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jButton1)) .addGap(13, 13, 13) .addComponent(jLabel5) .addGap(10, 10, 10) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(jButton2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton3)) .addGap(4, 4, 4) .addComponent(jLabel9) .addGap(13, 13, 13) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel10) .addComponent(jButton4)) .addGap(37, 37, 37)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel11) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(username_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel12) .addGap(10, 10, 10) .addComponent(password_passwordfield, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(confirmpassword_passwordfield, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(64, 64, 64))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton5) .addComponent(jButton6) .addComponent(jButton7)) .addContainerGap(40, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: int nofamilymember= Integer.parseInt(numFamilyMember_spinner.getValue().toString()); String username=username_textfield.getText(); String pwd=password_passwordfield.getText().toString(); String confirm_password=confirmpassword_passwordfield.getText().toString(); String password=""; if(pwd.equals(confirm_password)) { password=pwd; // System.out.println(password); String query="update user_details set no_of_family_members='"+nofamilymember+"',user_name='"+username+"',password='"+password+"'where id='"+userid+"'"; System.out.println(query); Dbcon dbcon=new Dbcon(); int rs=dbcon.insert(query);//insert(); if(rs!=0) { System.out.println("updated.."); LoginCustomer loginCustomer=new LoginCustomer(); loginCustomer.setVisible(true); this.dispose(); } else { System.out.println("failed.."); } } else { JOptionPane.showMessageDialog(rootPane, "Password not maching.."); } }//GEN-LAST:event_jButton5ActionPerformed private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed // TODO add your handling code here: LoginCustomer loginCustomer=new LoginCustomer(); loginCustomer.setVisible(true); this.dispose(); }//GEN-LAST:event_jButton7ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jButton6ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Registration_Next.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Registration_Next.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Registration_Next.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Registration_Next.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Registration_Next().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPasswordField confirmpassword_passwordfield; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private javax.swing.JSpinner numFamilyMember_spinner; private javax.swing.JPasswordField password_passwordfield; private javax.swing.JTextField username_textfield; // End of variables declaration//GEN-END:variables }
package com.myseriousorganization.nginx; import difflib.DiffUtils; import difflib.Patch; import org.apache.commons.io.IOUtils; import org.junit.Assert; import org.junit.Test; import java.util.List; /** * Created by crazysoftwarecoder on 12/8/14. */ public class nGinxxerTest { @Test public void testForSimpleJSON() { String sampleInputFile = "/com/myseriousorganization/nginx/sample_input.json"; String jsonString = TestUtil.getJSONString(sampleInputFile); try { String generatednGinxConf = nGinxxer.getNGinxConfigurationString(jsonString); generatednGinxConf = generatednGinxConf.trim(); List<String> generatednGinxConfLines = TestUtil.stringToLines(generatednGinxConf); String expectednGinxConf = IOUtils.toString(getClass().getResourceAsStream("/com/myseriousorganization/nginx/sample_nginx.conf")); expectednGinxConf = expectednGinxConf.trim(); List<String> expectednGinxConfLines = TestUtil.stringToLines(expectednGinxConf); Patch patch = DiffUtils.diff(generatednGinxConfLines, expectednGinxConfLines); Assert.assertTrue("More than one patch differences between generated and actual nginx.conf", patch.getDeltas().size()==0); } catch (Exception e) { Assert.assertTrue("Exception occurred while trying to read (" + sampleInputFile + "):=" + e.getMessage(), false); } } }
package prefeitura.siab.apresentacao; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import org.springframework.web.context.WebApplicationContext; import prefeitura.siab.controller.BusinessException; import prefeitura.siab.controller.EscolaridadeController; import prefeitura.siab.tabela.Escolaridade; @Component @Scope(WebApplicationContext.SCOPE_REQUEST) public class NewEscolaridade { //ATRIBUTOS private @Autowired EscolaridadeController controller; private Escolaridade escolaridade; //PROPRIEDADES public EscolaridadeController getController() { return controller; } public void setController(EscolaridadeController controller) { this.controller = controller; } public Escolaridade getEscolaridade() { return escolaridade; } public void setEscolaridade(Escolaridade escolaridade) { this.escolaridade = escolaridade; } //CONSTRUTOR public NewEscolaridade() { escolaridade = new Escolaridade(); } //MÉTODOS public String saveEscolaridade(){ FacesMessage message = new FacesMessage(); try{ controller.salvarEscolaridade(escolaridade); message.setSummary("Escolaridade Cadastrada com Sucesso!"); message.setSeverity(FacesMessage.SEVERITY_INFO); }catch(BusinessException e){ message.setSummary(e.getMessage()); message.setSeverity(FacesMessage.SEVERITY_ERROR); } FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, message); return null; } }
package com.linkedbook.dao; import com.linkedbook.dto.user.selectprofile.SelectProfileOutput; import com.linkedbook.entity.UserDB; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import org.springframework.data.jpa.repository.Query; import java.util.List; import java.util.Optional; @Repository public interface UserRepository extends JpaRepository<UserDB, Integer> { Optional<UserDB> findByEmail(String email); List<UserDB> findByEmailAndStatus(String email, String status); boolean existsByEmailAndStatus(String email, String status); boolean existsByNicknameAndStatus(String nickname, String status); UserDB findByIdAndStatus(int toUserId, String status); Page<UserDB> findByStatusAndNicknameContaining(String status, String nickname, Pageable paging); @Query(value = "select u.id as userId, u.nickname as nickname, u.info as info, u.image as image, dong.dongmyeonri as dong, ifnull(deal.dealCnt,0) as dealCnt, ifnull(follower.followerCnt,0) as followerCnt, ifnull(following.followingCnt,0) as followingCnt, round(ifnull(manner.mannerScore,0),1) as mannerScore, case when u.id = ?2 then 1 else 0 end as isMine, " + "case when exists(select * from follow f where f.to_user_id = ?1 and f.from_user_id = ?2) then (select f.id from follow f where f.to_user_id = ?1 and f.from_user_id = ?2) else 0 end as isFollow " + "from user u " + "inner join(select ua.user_id, a.dongmyeonri from user_area ua join area a on a.id = ua.area_id where ua.orders = 1) as dong on dong.user_id = u.id " + "left outer join(select user_id, count(id) as dealCnt from deal where status = 'ACTIVATE' group by user_id) as deal on deal.user_id = u.id " + "left outer join(select f.from_user_id, count(f.id) as followingCnt from follow f join user u on f.to_user_id = u.id where u.status = 'ACTIVATE' group by from_user_id) as following on following.from_user_id = u.id " + "left outer join(select f.to_user_id, count(f.id) as followerCnt from follow f join user u on f.from_user_id = u.id where u.status = 'ACTIVATE' group by to_user_id) as follower on follower.to_user_id = u.id " + "left outer join(select user_id, avg(score) as mannerScore from user_deal group by user_id) as manner on manner.user_id = u.id " + "where u.id = ?1", nativeQuery = true) SelectProfileOutput findUserProfile(int id, int myId); @Query(value = "select u.id as id, u.email as email, u.password as password, u.nickname as nickname, u.info as info, u.image as image," + " u.oauth as oauth, u.oauth_id as oauth_id, u.status as status, u.created_at as created_at, u.updated_at as updated_at" + " from user u" + " left outer join(select user_id, count(1) as deal_cnt from deal where deal.status <> 'DELETED' group by user_id) as d on d.user_id = u.id" + " inner join user_area ua on u.id = ua.user_id and u.status = 'ACTIVATE' and ua.orders = 1" + " where u.id <> ?1 and ua.area_id = ?2" + " order by d.deal_cnt DESC", countQuery = "select count(1) from user u" + " left outer join(select user_id, count(1) as deal_cnt from deal where deal.status <> 'DELETED' group by user_id) as d on d.user_id = u.id" + " inner join user_area ua on u.id = ua.user_id and u.status = 'ACTIVATE' and ua.orders = 1" + " where u.id <> ?1 and ua.area_id = ?2", nativeQuery = true) Page<UserDB> findAreaStar(int userId, int areaId, Pageable paging); }
import java.util.ArrayList; import java.util.Collections; import java.util.Random; public class main { static int n = 20; static int size_frame = 3; public static void main(String[] args) { ArrayList<Integer> data_set = new ArrayList<>(); ArrayList<Integer> in_frame = new ArrayList<>(); //Init Data_set Init_Data(data_set); //frame = 3 , data set not sort test_set(data_set,in_frame,3); //frame = 5 , data set not sort test_set(data_set,in_frame,5); //frame = 7 , data set not sort test_set(data_set,in_frame,7); System.out.println("------------------------------------------------------------------------------------------"); //sort data set Collections.sort(data_set); //frame = 3 , data set sorted test_set(data_set,in_frame,3); //frame = 5 , data set sorted test_set(data_set,in_frame,5); //frame = 7 , data set sorted test_set(data_set,in_frame,7); } public static void display(int hit,int page_fault){ System.out.println("Hit : " + hit); System.out.println("Page_fault : " + page_fault); } public static void FIFO(ArrayList<Integer> data_set,ArrayList<Integer> in_frame){ System.out.println("--------------------------------------------"); System.out.println("------------------- FIFO -------------------"); System.out.println("--------------------------------------------"); int hit = 0; int page_fault = 0; for(int i = 0; i < n ; i++){ if(search_frame(in_frame , data_set.get(i)) != -1 ){ hit++; System.out.println("Hit ! data income: " + data_set.get(i) +" data in frame : " +in_frame); continue; }else { page_fault++; if(in_frame.size() < size_frame){ in_frame.add(data_set.get(i)); } else { int tmp = i%size_frame; in_frame.remove(tmp); in_frame.add(tmp,data_set.get(i)); } } System.out.println("Miss! data income: " + data_set.get(i) +" data in frame : " +in_frame); } display(hit , page_fault); System.out.println("--------------------------------------------"); } public static void OPTIMAL(ArrayList<Integer> data_set,ArrayList<Integer> in_frame) { System.out.println("--------------------------------------------"); System.out.println("----------------- OPTIMAL ------------------"); System.out.println("--------------------------------------------"); int hit = 0; int page_fault = 0; for(int i = 0; i< n; i++){ if(search_frame(in_frame , data_set.get(i)) != -1){ hit++; System.out.println("Hit ! data income: " + data_set.get(i) +" data in frame : " +in_frame); continue; } else { page_fault++; if(in_frame.size() < size_frame){ in_frame.add(data_set.get(i)); } else { boolean[] replace = new boolean[size_frame]; for(int tmp = 0;tmp < replace.length ; tmp++) replace[tmp] = true; //System.out.println("Search for : " + (n - i) + " AND " + (i+size_frame)); for(int j = i ; j < n && j < i+size_frame ; j++){ //System.out.println("position : " + j + " is "+data_set.get(j) ); if(search_frame(in_frame,data_set.get(j)) != -1 ){ //System.out.println("found in " + search_frame(in_frame,data_set.get(j))); replace[search_frame(in_frame,data_set.get(j))] = false; } } boolean check_all_false = true; for (int tmp = 0 ; tmp<replace.length; tmp++) { if(replace[tmp] == false) continue; else check_all_false = false; } if(check_all_false) { in_frame.remove(0); in_frame.add(0,data_set.get(i)); } else { for (int j = 0;j<size_frame;j++){ if(replace[j]){ //System.out.println("test"); in_frame.remove(j); in_frame.add(j,data_set.get(i)); break; } } } } System.out.println("Miss! data income: " + data_set.get(i) +" data in frame : " +in_frame); } } display(hit,page_fault); System.out.println("--------------------------------------------"); } public static void LRU(ArrayList<Integer> data_set,ArrayList<Integer> in_frame) { System.out.println("--------------------------------------------"); System.out.println("------------------- LRU --------------------"); System.out.println("--------------------------------------------"); int hit = 0; int page_fault = 0; int[] counter = new int[size_frame]; for(int tmp = 0; tmp < size_frame ; tmp++) counter[tmp] = 0; for(int i = 0; i < n ; i++){ if(search_frame(in_frame , data_set.get(i)) != -1 ){ hit++; counter[i%size_frame] = i; System.out.println("Hit ! data income: " + data_set.get(i) +" data in frame : " +in_frame); continue; }else { page_fault++; if(in_frame.size() < size_frame){ in_frame.add(data_set.get(i)); counter[i%size_frame] = i; } else { int tmp = in_frame.indexOf(Collections.min(in_frame)); in_frame.remove(tmp); in_frame.add(tmp,data_set.get(i)); counter[i%size_frame] = i; } } System.out.println("Miss! data income: " + data_set.get(i) +" data in frame : " +in_frame); } display(hit,page_fault); System.out.println("--------------------------------------------"); } public static void Init_Data(ArrayList<Integer> var){ for(int i = 0; i < n ; i++ ){ var.add(getRandomNumberInRange(0,9)); } } private static int getRandomNumberInRange(int min, int max) { if (min >= max) { throw new IllegalArgumentException("max must be greater than min"); } Random r = new Random(); return r.nextInt((max - min) + 1) + min; } public static int search_frame (ArrayList<Integer> in_frame,int new_data){ for(int i = 0;i<in_frame.size();i++){ if(new_data == in_frame.get(i)){ return i; } else { continue; } } return -1; } public static void show_bool(boolean[] set_of_bool){ for(int i = 0 ; i < set_of_bool.length ; i++) { System.out.println(set_of_bool[i]); } } public static void test_set(ArrayList<Integer>data_set , ArrayList<Integer>in_frame , int no_frame){ size_frame = no_frame; //FIFO System.out.println(data_set); in_frame.removeAll(in_frame); FIFO(data_set,in_frame); //OPTIMAL System.out.println(data_set); in_frame.removeAll(in_frame); OPTIMAL(data_set,in_frame); //LRU System.out.println(data_set); in_frame.removeAll(in_frame); LRU(data_set,in_frame); } }
package utils; import java.util.Random; public class randomGenerator{ public int createRandomNumber() { Random rand = new Random(); int randomOutput = rand.nextInt(3000); return randomOutput; } }
package com.tencent.mm.plugin.wallet.balance.ui.lqt; import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; import com.tencent.mm.platformtools.af; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.vending.g.g; import com.tencent.mm.wallet_core.ui.e; class WalletLqtDetailUI$2 implements OnClickListener { final /* synthetic */ WalletLqtDetailUI pbs; WalletLqtDetailUI$2(WalletLqtDetailUI walletLqtDetailUI) { this.pbs = walletLqtDetailUI; } public final void onClick(View view) { String str = null; boolean z = true; Intent intent; String str2; if (af.eyi) { intent = new Intent(this.pbs, WalletLqtSaveFetchUI.class); str2 = "lqt_save_fund_code"; if (WalletLqtDetailUI.c(this.pbs) != null) { str = WalletLqtDetailUI.c(this.pbs).seK; } intent.putExtra(str2, str); intent.putExtra("lqt_save_fetch_mode", 1); intent.putExtra("lqt_is_show_protocol", WalletLqtDetailUI.c(this.pbs).cej == 1); str = "lqt_is_agree_protocol"; if (WalletLqtDetailUI.c(this.pbs).sfD != 1) { z = false; } intent.putExtra(str, z); intent.putStringArrayListExtra("lqt_protocol_list", WalletLqtDetailUI.e(this.pbs)); intent.putExtra("lqt_profile_wording", WalletLqtDetailUI.c(this.pbs).sfx); this.pbs.startActivity(intent); return; } g.cx(Integer.valueOf(WalletLqtDetailUI.c(this.pbs).rtK)).c(WalletLqtDetailUI.f(this.pbs).oYX); if (bi.oW(WalletLqtDetailUI.c(this.pbs).sfJ)) { intent = new Intent(this.pbs, WalletLqtSaveFetchUI.class); str2 = "lqt_save_fund_code"; if (WalletLqtDetailUI.c(this.pbs) != null) { str = WalletLqtDetailUI.c(this.pbs).seK; } intent.putExtra(str2, str); intent.putExtra("lqt_save_fetch_mode", 1); intent.putExtra("lqt_is_show_protocol", WalletLqtDetailUI.c(this.pbs).cej == 1); str = "lqt_is_agree_protocol"; if (WalletLqtDetailUI.c(this.pbs).sfD != 1) { z = false; } intent.putExtra(str, z); intent.putStringArrayListExtra("lqt_protocol_list", WalletLqtDetailUI.e(this.pbs)); intent.putExtra("lqt_profile_wording", WalletLqtDetailUI.c(this.pbs).sfx); intent.putExtra("lqt_account_type", WalletLqtDetailUI.c(this.pbs).rtK); intent.putExtra("lqt_fund_spid", WalletLqtDetailUI.c(this.pbs).seM); this.pbs.startActivity(intent); return; } x.i("MicroMsg.WalletLqtDetailUI", "click save button, go to block url: %s", new Object[]{WalletLqtDetailUI.c(this.pbs).sfJ}); e.l(this.pbs, WalletLqtDetailUI.c(this.pbs).sfJ, false); } }
package day4_arithmeticOperator; public class contribution { public static void main(String[] args) { // TODO Auto-generated method stub //The program calculate the amount of the pay that will contributed to a retirement // plan if 5%, %8 or %10 monthly pay is witheld. int monthlyPay=6000; double pay5; double pay8; double pay10; pay5=monthlyPay*0.05; pay8=monthlyPay*0.08; pay10=monthlyPay*0.1; System.out.println(" The contribution %5 retirement payment is: $"+ pay5); System.out.println(" The contribution %8 retirement payment is: $"+ pay8); System.out.println(" The contribution %10 retirement payment is: $"+ pay10); } }
package maxzonov.shareloc.ui.location; import android.annotation.SuppressLint; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.content.res.Resources; import android.location.Location; import android.support.v4.app.NotificationCompat; import com.arellomobile.mvp.InjectViewState; import com.arellomobile.mvp.MvpPresenter; import com.google.android.gms.location.FusedLocationProviderClient; import maxzonov.shareloc.R; import maxzonov.shareloc.preferences.PreferencesHelper; import maxzonov.shareloc.utils.AddressReceiver; import maxzonov.shareloc.utils.OnAddressReceivedListener; @InjectViewState public class LocationPresenter extends MvpPresenter<LocationView> implements OnAddressReceivedListener { private String latitude, longitude; private Location lastLocation; private Context context; private Resources res; private static final int NOTIFICATION_FIND_LOCATION_ID = 1; private static final String NOTIFICATION_FIND_LOCATION_CHANNEL = "Channel_1"; private FusedLocationProviderClient fusedLocationClient; private NotificationManager notificationManager; private PreferencesHelper prefsHelperLatitude, prefsHelperLongitude; /** * Location searching method */ protected void getLocationClicked(Context context, FusedLocationProviderClient fusedLocation) { this.context = context; res = context.getResources(); this.fusedLocationClient = fusedLocation; prefsHelperLatitude = new PreferencesHelper(context, res.getString(R.string.prefs_latitude_key)); prefsHelperLongitude = new PreferencesHelper(context, res.getString(R.string.prefs_longitude_key)); getLocation(); } /** * Suppression caused by the fact that permission has been checked in LocationFragment */ @SuppressLint("MissingPermission") private void getLocation() { fusedLocationClient.getLastLocation().addOnSuccessListener(location -> { if (location != null) { lastLocation = location; latitude = String.valueOf(lastLocation.getLatitude()); longitude = String.valueOf(lastLocation.getLongitude()); prefsHelperLatitude.writeToPrefs(res.getString(R.string.prefs_latitude_key), latitude); prefsHelperLongitude.writeToPrefs(res.getString(R.string.prefs_longitude_key), longitude); new AddressReceiver(context, this).execute(lastLocation); } else { getViewState().onLocationResponseError(); } }); } /** * It's a response from the get address callback */ @Override public void onAddressReceived(String address) { getViewState().showInfo(latitude, longitude, address); cancelNotification(notificationManager); } /** * Notification is displayed during the application is searching for satellites */ void showNotification(NotificationManager notificationManager) { this.notificationManager = notificationManager; NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_FIND_LOCATION_CHANNEL) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(context.getString(R.string.app_name)) .setContentText(context.getString(R.string.notification_gps_searching)) .setOngoing(true); // immunity to clearing Notification notification = builder.build(); notificationManager.notify(NOTIFICATION_FIND_LOCATION_ID, notification); } void cancelNotification(NotificationManager notificationManager) { notificationManager.cancel(NOTIFICATION_FIND_LOCATION_ID); } }
package org.scilab.forge.jlatexmath.font; import org.robovm.apple.foundation.NSBundle; import org.robovm.apple.uikit.UIFont; import org.scilab.forge.jlatexmath.BaseObjectHelper; import org.scilab.forge.jlatexmath.exception.ResourceParseException; import org.scilab.forge.jlatexmath.platform.font.Font; import org.scilab.forge.jlatexmath.platform.font.FontLoader; public class FontLoaderI implements FontLoader { private NSBundle mNSBundle; public FontLoaderI() { mNSBundle = NSBundle.getMainBundle(); } public Font loadFont(Object fontType, String name) throws ResourceParseException { //System.out.println("path: "+BaseObjectHelper.getPath(fontType, name)); //System.out.println("name: "+name); String filename = name.substring(name.lastIndexOf("/")+1, name.indexOf(".")); UIFont typeface = UIFont.getFont(filename, 48); //System.out.println("fontname: "+typeface.getFontName()); return new FontI(typeface, Math.round(PIXELS_PER_POINT)); } }
package com.cricmania.models; public class Ball extends Base { private String bowledBy; private String run; private String wicket; private String playedBy; private String commetry; public String getBowledBy() { return bowledBy; } public void setBowledBy(String bowledBy) { this.bowledBy = bowledBy; } public String getRun() { return run; } public void setRun(String run) { this.run = run; } public String getWicket() { return wicket; } public void setWicket(String wicket) { this.wicket = wicket; } public String getPlayedBy() { return playedBy; } public void setPlayedBy(String playedBy) { this.playedBy = playedBy; } public String getCommetry() { return commetry; } public void setCommetry(String commetry) { this.commetry = commetry; } }
package kh.cocoa.controller; import java.sql.Date; import java.text.SimpleDateFormat; import java.util.Iterator; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.nexacro.uiadapter17.spring.core.annotation.ParamDataSet; import com.nexacro.uiadapter17.spring.core.data.NexacroResult; import kh.cocoa.dto.EmployeeDTO; import kh.cocoa.dto.Leave_Taken_UsedDTO; import kh.cocoa.service.EmployeeService; import kh.cocoa.service.Leave_Taken_UsedService; @Controller @RequestMapping("/ltuN") public class NexacroLeave_Taken_UsedController { @Autowired private Leave_Taken_UsedService lservice; @Autowired private EmployeeService eservice; /*넥사크로*/ @RequestMapping("insertAllLTU.ltuN") public String insertAllLTU() { //오늘날짜 받아오기 Date today = new Date(System.currentTimeMillis()); SimpleDateFormat format = new SimpleDateFormat("yyyy"); String year = format.format(today); //employee 리스트 받아오기 List<EmployeeDTO> list = eservice.getListWithdrawN(); //처리 for(int i=0; i<list.size(); i++) { int isExist = lservice.isExist(list.get(i).getCode(), Integer.parseInt(year)); //존재하는지 확인 if(isExist == 0) { //입사일 받아와서 기본 휴가일 수 계산 Date hire_date = list.get(i).getHire_date(); //입사일 String hire_year = format.format(hire_date); //입사년도 int workYear = Integer.parseInt(year) - Integer.parseInt(hire_year); int leaveDay = 0; if(workYear > 0) { //1년이 넘은경우에 연차부여 leaveDay = 15 + (workYear-1)/2; //기본 15일 + 3년차이상부터 2년당 1일씩 } lservice.insert(Integer.parseInt(year), list.get(i).getCode(), leaveDay); } } return "redirect:/membership/selectEmployeeLTU.employee"; } @RequestMapping("addLeave.ltuN") public String addLeave(@ParamDataSet(name="in_ds")List<Leave_Taken_UsedDTO> list) { int empCode = 0; int leaveDay = 0; int year = 0; for(int i=0; i<list.size(); i++) { empCode = list.get(i).getCode(); year = list.get(i).getYear(); Leave_Taken_UsedDTO dto = lservice.getLeaveStatus(empCode, Integer.toString(year)); //해당 년도, 사번에 따른 휴가dto if(dto.getLeave_got() != 0) { leaveDay = dto.getLeave_got() + list.get(i).getAddLeave(); //기존 휴가 + 추가 휴가 }else { leaveDay = list.get(i).getAddLeave(); } lservice.plusLeaveGot(year, empCode, leaveDay); //새로 셋팅 } return "redirect:/membership/selectEmployeeLTU.employee"; } }
package com.tencent.mm.plugin.nearby.ui; import com.tencent.mm.az.d; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.ui.base.MMSlideDelView.f; class NearbySayHiListUI$9 implements f { final /* synthetic */ NearbySayHiListUI lCB; NearbySayHiListUI$9(NearbySayHiListUI nearbySayHiListUI) { this.lCB = nearbySayHiListUI; } public final void bv(Object obj) { if (obj == null) { x.e("MicroMsg.SayHiListUI", "onItemDel object null"); return; } d.SG().YP(obj.toString()); NearbySayHiListUI.b(this.lCB).a(null, null); } }
/* В восточном календаре принят 60-летний цикл, состоящий из 12-летних подциклов, обозначаемых названиями цвета: зеленый, красный, желтый, белый и черный. В каждом подцикле годы носят названия животных: крысы, коровы, тигра, зайца, дракона, змеи, лошади, овцы, обезьяны, курицы, собаки и свиньи. По номеру года определить его название, если 1984 год — начало цикла: «год зеленой крысы». */ public class Ex_27 { public static void main(String[] args){ if (args.length < 1) { System.err.println("You haven't entered an argument! The task requires entering one arguments."); return; } if (args.length > 1) System.out.println("You entered more arguments, than programm needs. \nIt will use only first one."); Integer year = Integer.parseInt(args[0]); System.out.print (year + " is the Year of "); switch (year%5+1){ case 1: System.out.print("White "); break; case 2: System.out.print("Yellow "); break; case 3: System.out.print("Black "); break; case 4: System.out.print("Red "); break; case 5: System.out.print("Green "); break; default: System.out.print("(\\/)_Oo_(\\/) "); } switch (year%12+1){ case 1: System.out.println("Monkey!"); break; case 2: System.out.println("Han!"); break; case 3: System.out.println("Dog!"); break; case 4: System.out.println("Pig!"); break; case 5: System.out.println("Rat!"); break; case 6: System.out.println("Cow!"); break; case 7: System.out.println("Tiger!"); break; case 8: System.out.println("Hear!"); break; case 9: System.out.println("Dragon!"); break; case 10: System.out.println("Snake!"); break; case 11: System.out.println("Horse!"); break; case 12: System.out.println("Sheep!"); break; default: System.out.println("(\\/)_Oo_(\\/)"); } } }
package com.bingo.code.example.design.observer.module; /** * ����۲��߶���ʵ�ָ��µķ�����ʹ�����״̬��Ŀ���״̬����һ�� */ public class ConcreteObserver implements Observer { /** * ʾ�⣬�����ߵ�״̬ */ private String observerState; public void update(Subject subject) { // ����ĸ���ʵ�� //���������Ҫ���¹۲��ߵ�״̬��ʹ����Ŀ���״̬����һ�� observerState = ((ConcreteSubject)subject).getSubjectState(); } }
package com.tfjybj.integral.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.persistence.Column; import java.io.Serializable; import java.util.Date; /** * Team实体 * team * * @author 王云召 * @version ${version} * @since ${version} 2019-09-11 22:13:52 */ @ApiModel(value = "TeamEntity:team") @Data @TableName(value = "zt_team") public class TeamEntity implements Serializable { /** * project */ @ApiModelProperty(value = "project",required = true) @Column(name = "project") private Integer project; /** * account */ @ApiModelProperty(value = "account",required = true) @Column(name = "account") private String account; /** * role */ @ApiModelProperty(value = "role",required = true) @Column(name = "role") private String role; /** * join */ @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8" ) @ApiModelProperty(value = "join",required = true) @Column(name = "join") private Date join; /** * days */ @ApiModelProperty(value = "days",required = true) @Column(name = "days") private Integer days; /** * hours */ @ApiModelProperty(value = "hours",required = true) @Column(name = "hours") private Float hours; }
package capstone.abang.com.Models; /** * Created by Salarda on 23/01/2018. */ public class AdsFile { private String AdCode; private String AdCompBranch; private String AdCompany; private String AdContact; private String AdDesc; private String AdImage; private String AdStatus; public AdsFile(String adCode, String adCompBranch, String adCompany, String adContact, String adDesc, String adImage, String adStatus) { AdCode = adCode; AdCompBranch = adCompBranch; AdCompany = adCompany; AdContact = adContact; AdDesc = adDesc; AdImage = adImage; AdStatus = adStatus; } public AdsFile(){} public String getAdCode() { return AdCode; } public void setAdCode(String adCode) { AdCode = adCode; } public String getAdCompBranch() { return AdCompBranch; } public void setAdCompBranch(String adCompBranch) { AdCompBranch = adCompBranch; } public String getAdCompany() { return AdCompany; } public void setAdCompany(String adCompany) { AdCompany = adCompany; } public String getAdContact() { return AdContact; } public void setAdContact(String adContact) { AdContact = adContact; } public String getAdDesc() { return AdDesc; } public void setAdDesc(String adDesc) { AdDesc = adDesc; } public String getAdImage() { return AdImage; } public void setAdImage(String adImage) { AdImage = adImage; } public String getAdStatus() { return AdStatus; } public void setAdStatus(String adStatus) { AdStatus = adStatus; } }
package com.example.walkthrough; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.viewpager.widget.PagerAdapter; class SliderAdapter extends PagerAdapter { Context context; LayoutInflater layoutInflater; public SliderAdapter(Context context) { this.context = context; } public int[] slide_image={ R.drawable.img1,R.drawable.img2,R.drawable.img3 }; public String[] slide_heading={"Accelerometer","Battery","GPU"}; public String[] slide_body={"An accelerometer is an electromechanical device used to measure acceleration forces. Such forces may be static, like the continuous force of gravity or, as is the case with many mobile devices, dynamic to sense movement or vibrations. Acceleration is the measurement of the change in velocity, or speed divided by time." ,"Batteries are a collection of one or more cells whose chemical reactions create a flow of electrons in a circuit. All batteries are made up of three basic components: an anode (the '-' side), a cathode (the '+' side), and some kind of electrolyte (a substance that chemically reacts with the anode and cathode)." ,"A graphics processing unit (GPU) is a specialized, electronic circuit designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device."}; @Override public int getCount() { return slide_image.length; } @Override public boolean isViewFromObject(@NonNull View view, @NonNull Object object) { return view== (RelativeLayout) object; } @NonNull @Override public Object instantiateItem(@NonNull ViewGroup container, int position) { layoutInflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE); View view = layoutInflater.inflate(R.layout.slide_layout,container,false); ImageView slideimage = (ImageView)view.findViewById(R.id.imageView); TextView text_head = (TextView)view.findViewById(R.id.text_head); TextView text_body = (TextView)view.findViewById(R.id.text_body); slideimage.setImageResource(slide_image[position]); text_head.setText(slide_heading[position]); text_body.setText(slide_body[position]); container.addView(view); return view; } @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { container.removeView((RelativeLayout)object); } }
package com.sinata.rwxchina.component_basic.regimen.entity; /** * @author HRR * @datetime 2017/12/15 * @describe 养生技师实体类 * @modifyRecord */ public class TechnicianEntity { /** * teamsonid : 4 * shopid : 15940954523 * name : 王涛 * head : /Uploads/User/15940954510/74fa142d9e30f3fb7793126a8874f3e9.png * teamson_status : 1 * nickname : 高级按摩师 * workyear : 5 * specialty : 精通中医经络理疗和养生SPA,特对背部全息有独特疗法 * describe : 本人从事健康理疗工作4年有余,毕业于南充德阳中医药大学,师承名师潜心学习成人理疗,手法独特,渗透力强,曾在“唐人一手”整体养生院担任理疗师,精通中医经络理疗和养生SPA,特对背部全息有独特疗法,现跟随反射疗法师,手足拨筋疗法创世人王俊红老师学习全息理疗,擅于通过植物芳香疗法改善颈肩腰腿疼痛,肠胃调理等亚健康。 * createtime : 1513061492 * createdate : 2017-12-12 14:51:32 */ private String teamsonid; private String shopid; private String name; private String head; private String teamson_status; private String nickname; private String workyear; private String specialty; private String describe; private String createtime; private String createdate; public String getTeamsonid() { return teamsonid; } public void setTeamsonid(String teamsonid) { this.teamsonid = teamsonid; } public String getShopid() { return shopid; } public void setShopid(String shopid) { this.shopid = shopid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getHead() { return head; } public void setHead(String head) { this.head = head; } public String getTeamson_status() { return teamson_status; } public void setTeamson_status(String teamson_status) { this.teamson_status = teamson_status; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getWorkyear() { return workyear; } public void setWorkyear(String workyear) { this.workyear = workyear; } public String getSpecialty() { return specialty; } public void setSpecialty(String specialty) { this.specialty = specialty; } public String getDescribe() { return describe; } public void setDescribe(String describe) { this.describe = describe; } public String getCreatetime() { return createtime; } public void setCreatetime(String createtime) { this.createtime = createtime; } public String getCreatedate() { return createdate; } public void setCreatedate(String createdate) { this.createdate = createdate; } }
package spring.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; import spring.entity.ItemDto; import spring.repository.ItemDao; public class RegistController implements Controller{ private ItemDao itemDao; public void setItemDao(ItemDao itemDao) { this.itemDao = itemDao; } @Override public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse arg1) throws Exception { if(req.getMethod().equalsIgnoreCase("get")) { ModelAndView mv = new ModelAndView(); mv.setViewName("/WEB-INF/view/product/regist.jsp"); return mv; } else if(req.getMethod().equalsIgnoreCase("post")) { //µî·Ï ItemDto itemDto = ItemDto.builder() .name(req.getParameter("name")) .type(req.getParameter("type")) .price(Integer.parseInt(req.getParameter("price"))) .build(); itemDao.insert(itemDto); ModelAndView mv = new ModelAndView(); mv.setViewName("/WEB-INF/view/main.jsp"); return mv; } return null; } }
package com.yashketkar.tv; import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.View.OnFocusChangeListener; import android.view.Window; import android.view.WindowManager; import io.vov.vitamio.MediaPlayer; import io.vov.vitamio.widget.MediaController; import io.vov.vitamio.widget.VideoView; public class MediaPlayerActivity extends AppCompatActivity { VideoView videoView; ProgressDialog pDialog; String httpLiveUrl; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Intent intent = getIntent(); httpLiveUrl = intent.getStringExtra("EXTRA_URL"); setContentView(R.layout.activity_mediaplayer); // Create a progressbar pDialog = new ProgressDialog(MediaPlayerActivity.this); // Set progressbar title pDialog.setTitle("Loading Live Stream"); // Set progressbar message pDialog.setMessage("Buffering..."); pDialog.setIndeterminate(false); pDialog.setCancelable(false); // Show progressbar pDialog.show(); videoView = (VideoView) findViewById(R.id.VideoView); videoView.setVideoURI(Uri.parse(httpLiveUrl)); MediaController mediaController = new MediaController(this); videoView.setMediaController(mediaController); videoView.requestFocus(); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { // Close the progress bar and play the video public void onPrepared(MediaPlayer mp) { pDialog.dismiss(); videoView.start(); } }); videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() { // Close the progress bar and play the video public boolean onError(MediaPlayer mp, int x, int y) { // if (y == MediaPlayer.MEDIA_ERROR_UNSUPPORTED) { pDialog.dismiss(); // } return false; } }); videoView.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { hideUI(); } } }); hideUI(); } @SuppressLint("NewApi") public void hideUI() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); getWindow().getDecorView().setOnSystemUiVisibilityChangeListener( new View.OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { // set immersive mode sticky } } }); } } }
package org.apache.commons.net.nntp; import java.io.IOException; public final class NNTPConnectionClosedException extends IOException { private static final long serialVersionUID = 1029785635891040770L; public NNTPConnectionClosedException() {} public NNTPConnectionClosedException(String message) { super(message); } } /* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\org\apache\commons\net\nntp\NNTPConnectionClosedException.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
package com.tencent.mm.plugin.appbrand.task; enum AppBrandRemoteTaskController$a { ; public static int[] anf() { return (int[]) gtJ.clone(); } static { gty = 1; gtz = 2; gtA = 3; gtB = 4; gtC = 5; gtD = 6; gtE = 7; gtF = 8; gtG = 9; gtH = 10; gtI = 11; gtJ = new int[]{gty, gtz, gtA, gtB, gtC, gtD, gtE, gtF, gtG, gtH, gtI}; } }
/** * */ package com.shubhendu.javaworld.datastructures.graphs.weighted; import java.util.ArrayList; import java.util.List; /** * @author ssingh * */ public class GraphValidTree { private Graph G; private class Graph { private int V; private int cc; private List<Integer>[] adj; private boolean[] visited; private int[] edgeTo; public Graph(int v) { this.V = v; this.visited = new boolean[v]; this.edgeTo = new int[v]; this.adj = (ArrayList<Integer>[]) new ArrayList[v]; for (int i = 0; i < V; i++) { this.adj[i] = new ArrayList<Integer>(); } } public void addEdges(int v, int w) { this.adj[v].add(w); this.adj[w].add(v); } } public boolean validTree(int n, int[][] edges) { this.G = new Graph(n); for (int i = 0; i < edges.length; i++) { this.G.addEdges(edges[i][0], edges[i][1]); } this.G.edgeTo[0] = 0; return !hasCycle(0) && checkEachNodeVisited(); } private boolean checkEachNodeVisited() { for (int i = 0; i < this.G.V; i++) { if (!this.G.visited[i]) { return false; } } return true; } private boolean hasCycle(int v) { this.G.visited[v] = true; for (int x : this.G.adj[v]) { if (this.G.visited[x] && this.G.edgeTo[x] != v) { return true; } return hasCycle(x); } return false; } public static void main(String[] args) { int[][] edges = new int[][] {{0,1},{0,2},{2,3},{2,4}}; GraphValidTree gvt = new GraphValidTree(); boolean isValid = gvt.validTree(5, edges); System.out.println(isValid); } }
package com.tt.miniapp.business.cloud; import android.text.TextUtils; import android.util.Base64; import com.bytedance.sandboxapp.b.a; import com.bytedance.sandboxapp.protocol.service.d.a; import com.tt.miniapp.base.MiniAppContext; import com.tt.miniapp.manager.UserInfoManager; import com.tt.miniapphost.AppbrandContext; import com.tt.miniapphost.entity.AppInfoEntity; import com.tt.miniapphost.entity.InitParamsEntity; import d.a.ac; import d.f.a.b; import d.f.b.g; import d.f.b.l; import d.f.b.m; import d.n; import d.t; import java.util.Map; public final class LarkCloudService implements a { public static final Companion Companion = new Companion(null); private final MiniAppContext context; public LarkCloudService(MiniAppContext paramMiniAppContext) { this.context = paramMiniAppContext; } private final String encodeDigestToBase64(byte[] paramArrayOfbyte) { if (paramArrayOfbyte == null) return "-1"; String str = Base64.encodeToString(paramArrayOfbyte, 11); l.a(str, "Base64.encodeToString(di…RAP or Base64.NO_PADDING)"); return str; } private final String generateSign(Map<String, String> paramMap) { // Byte code: // 0: aload_1 // 1: invokeinterface keySet : ()Ljava/util/Set; // 6: checkcast java/lang/Iterable // 9: astore_2 // 10: aload_2 // 11: ldc '$this$sorted' // 13: invokestatic b : (Ljava/lang/Object;Ljava/lang/String;)V // 16: aload_2 // 17: instanceof java/util/Collection // 20: ifeq -> 133 // 23: aload_2 // 24: checkcast java/util/Collection // 27: astore_3 // 28: aload_3 // 29: invokeinterface size : ()I // 34: iconst_1 // 35: if_icmpgt -> 46 // 38: aload_2 // 39: invokestatic f : (Ljava/lang/Iterable;)Ljava/util/List; // 42: astore_2 // 43: goto -> 142 // 46: aload_3 // 47: iconst_0 // 48: anewarray java/lang/Comparable // 51: invokeinterface toArray : ([Ljava/lang/Object;)[Ljava/lang/Object; // 56: astore_2 // 57: aload_2 // 58: ifnull -> 123 // 61: aload_2 // 62: ifnull -> 113 // 65: aload_2 // 66: checkcast [Ljava/lang/Comparable; // 69: astore_2 // 70: aload_2 // 71: ifnull -> 103 // 74: aload_2 // 75: checkcast [Ljava/lang/Object; // 78: astore_2 // 79: aload_2 // 80: ldc '$this$sort' // 82: invokestatic b : (Ljava/lang/Object;Ljava/lang/String;)V // 85: aload_2 // 86: arraylength // 87: iconst_1 // 88: if_icmple -> 95 // 91: aload_2 // 92: invokestatic sort : ([Ljava/lang/Object;)V // 95: aload_2 // 96: invokestatic a : ([Ljava/lang/Object;)Ljava/util/List; // 99: astore_2 // 100: goto -> 142 // 103: new d/u // 106: dup // 107: ldc 'null cannot be cast to non-null type kotlin.Array<kotlin.Any?>' // 109: invokespecial <init> : (Ljava/lang/String;)V // 112: athrow // 113: new d/u // 116: dup // 117: ldc 'null cannot be cast to non-null type kotlin.Array<T>' // 119: invokespecial <init> : (Ljava/lang/String;)V // 122: athrow // 123: new d/u // 126: dup // 127: ldc 'null cannot be cast to non-null type kotlin.Array<T>' // 129: invokespecial <init> : (Ljava/lang/String;)V // 132: athrow // 133: aload_2 // 134: invokestatic g : (Ljava/lang/Iterable;)Ljava/util/List; // 137: astore_2 // 138: aload_2 // 139: invokestatic c : (Ljava/util/List;)V // 142: aload_0 // 143: ldc 'c9ba4701efd919cd748668a821abe126d147afb6d35a439112df25f01dcab26e' // 145: aload_2 // 146: checkcast java/lang/Iterable // 149: ldc '&' // 151: checkcast java/lang/CharSequence // 154: aconst_null // 155: aconst_null // 156: iconst_0 // 157: aconst_null // 158: new com/tt/miniapp/business/cloud/LarkCloudService$generateSign$signStr$1 // 161: dup // 162: aload_1 // 163: invokespecial <init> : (Ljava/util/Map;)V // 166: checkcast d/f/a/b // 169: bipush #30 // 171: aconst_null // 172: invokestatic a : (Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Ld/f/a/b;ILjava/lang/Object;)Ljava/lang/String; // 175: invokestatic encryptHmacSHA1 : (Ljava/lang/String;Ljava/lang/String;)[B // 178: invokespecial encodeDigestToBase64 : ([B)Ljava/lang/String; // 181: areturn } private final String getAid() { AppbrandContext appbrandContext = AppbrandContext.getInst(); l.a(appbrandContext, "AppbrandContext.getInst()"); InitParamsEntity initParamsEntity = appbrandContext.getInitParams(); if (initParamsEntity != null) { String str2 = initParamsEntity.getAppId(); String str1 = str2; return (str2 == null) ? "-1" : str1; } return "-1"; } private final String getAnonymousId() { String str = UserInfoManager.getLocalTmpId(); if (!TextUtils.isEmpty(str)) { l.a(str, "anonymousId"); return str; } return "-1"; } private final String getAppId() { AppInfoEntity appInfoEntity = getContext().getAppInfo(); if (appInfoEntity != null) { String str2 = appInfoEntity.appId; String str1 = str2; return (str2 == null) ? "-1" : str1; } return "-1"; } private final String getNonce() { return String.valueOf(Math.random()); } private final String getSessionId() { String str = (UserInfoManager.getHostClientUserInfo()).sessionId; if (!TextUtils.isEmpty(str)) { l.a(str, "sessionId"); return str; } return "-1"; } private final String getTimeStamp() { return String.valueOf(System.currentTimeMillis()); } public final MiniAppContext getContext() { return this.context; } public final Map<String, String> getRequestHeader() { String str1 = getTimeStamp(); String str2 = getNonce(); String str3 = getAppId(); String str4 = getAid(); String str5 = getSessionId(); String str6 = getAnonymousId(); Map<String, String> map = ac.b(new n[] { t.a("x-lc-mp-timestamp", str1), t.a("x-lc-mp-nonce", str2), t.a("x-lc-mp-appid", str3), t.a("x-lc-mp-aid", str4), t.a("x-lc-mp-sessionid", str5), t.a("x-lc-mp-anonymousid", str6) }); map.put("x-lc-mp-sign", generateSign(ac.b(new n[] { t.a("timestamp", str1), t.a("nonce", str2), t.a("appId", str3), t.a("aId", str4), t.a("sessionId", str5), t.a("anonymousId", str6) }))); return map; } public final void onDestroy() {} public static final class Companion { private Companion() {} } static final class LarkCloudService$generateSign$signStr$1 extends m implements b<String, String> { LarkCloudService$generateSign$signStr$1(Map param1Map) { super(1); } public final String invoke(String param1String) { l.b(param1String, "it"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(param1String); stringBuilder.append('='); stringBuilder.append((String)this.$signMap.get(param1String)); return stringBuilder.toString(); } } } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\business\cloud\LarkCloudService.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
package com.automation.rest_api; import java.util.HashMap; import java.util.Map; import org.apache.http.ParseException; import org.testng.Reporter; import com.automation.exceptions.WebserviceException; import com.automation.utilities.PropertyUtil; import io.restassured.RestAssured; import io.restassured.response.Response; import io.restassured.specification.RequestSpecification; public class RestApiKeywords { private Object body; private Map<String, String> header; PropertyUtil propertyUtil; private String endPoint; public Object getBody() { return body; } public RestApiKeywords setBody(Object body) { this.body = body; return this; } public RestApiKeywords() { header = new HashMap<String, String>(); propertyUtil = new PropertyUtil(); } public Map<String, String> getHeader() { return header; } public RestApiKeywords setHeader(String key, String value) { header.put(key, value); return this; } /** * @description Get the json response from respetive URI With out authentication * @param URI * @return Json Response * @throws WebserviceException * @throws ParseException */ public Response get() throws WebserviceException { Response response = null; try { RequestSpecification request = RestAssured.given().headers(header); response = request.when() .get(PropertyUtil.getProperty("url") + endPoint); Reporter.log(response.asString()); } catch (Exception e) { throw new WebserviceException( "Failed to fetch the response from URI" + PropertyUtil.getProperty("url") + endPoint); } return response; } public Response post() throws WebserviceException { Response response = null; try { response = RestAssured.given().headers(header).body(body).when() .post(PropertyUtil.getProperty("url") + endPoint); Reporter.log(response.asString()); } catch (Exception e) { throw new WebserviceException(new Throwable( "Error occured " + PropertyUtil.getProperty("url") + endPoint + "\n" + e.getMessage())); } return response; } // public Response Put( String URI ,Object body) throws // WebserviceException{return Put( URI,body, null);} public Response put() throws WebserviceException { Response response = null; try { response = RestAssured.given().headers(header).body(body).when() .put(PropertyUtil.getProperty("url") + endPoint); Reporter.log(response.asString()); } catch (Exception e) { throw new WebserviceException(new Throwable( "Error occured " + PropertyUtil.getProperty("url") + endPoint + "\n" + e.getMessage())); } return response; } public Response delete() throws WebserviceException { Response response = null; try { response = RestAssured.given().headers(header).when() .delete(PropertyUtil.getProperty("url") + endPoint); Reporter.log(response.asString()); } catch (Exception e) { throw new WebserviceException(new Throwable( "Error occured " + PropertyUtil.getProperty("url") + endPoint + "\n" + e.getMessage())); } return response; } public String getEndPoint() { return endPoint; } public RestApiKeywords setEndPoint(String endPoint) { this.endPoint = endPoint; return this; } }
package com.testing.class1; public class BaseData { public static void main(String[] args) { //声明变量 byte a; short s; int i; long l; //声明变量,同时赋值 byte fb=1; //同时声明多个变量 int ia,ib; //使用时赋值 ia=1; //同时声明并赋值多个变量 int iia=3,iib=4; System.out.println(fb); System.out.println(iia); //浮点数,默认是double类型 //单精度float,小数点后7-8位 float fa=1.4444444444444444f; //双精度double,小数点后15-17位 double da=1.6666666666666666666; System.out.println(fa); System.out.println(da); boolean ba=true; boolean bd=false; //字符类型,用''引起为字符,用""引起为字符串 char ca='a'; char cb='啊'; //显示'时,用\进行转义 char cc='\''; System.out.println(ca); System.out.println(cb); System.out.println(cc); //字符的存储格式,按一定方式转为整数 //java中使用unicode编码,格式/u[4位16进制数] //字符可以转换为数字,就是它的编码数位 //unicode前128个就是ASCII码 int ic=(int)cc; System.out.println(cc); System.out.println(ic); } }
package org.webmaple.admin; import org.webmaple.admin.mapper.SpiderMapper; import org.webmaple.admin.mapper.TemplateMapper; import org.webmaple.admin.model.Template; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.util.ArrayList; import java.util.List; /** * @author lyifee * on 2021/2/9 */ @SpringBootTest(classes = AdminApplication.class) public class TestMapper { @Autowired private TemplateMapper templateMapper; @Autowired private SpiderMapper spiderMapper; @Test public void templates() { List<Template> templateList = templateMapper.queryTemplates(); for (Template template : templateList) { System.out.println(template.toString()); } } @Test public void templateViews() { List<Template> templateList = templateMapper.queryTemplateViewList(); for (Template template : templateList) { System.out.println(template.toString()); } } @Test public void spiderTest() { ArrayList<String> list = new ArrayList<>(); list.add("worker1"); list.add("worker2"); spiderMapper.removeInvalidNodeSpiders(list); } @Test public void redisTest() { } }
package com.exercise.factorypal.rest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import com.exercise.factorypal.rest.entity.LineSpeedRequest; import com.exercise.factorypal.rest.entity.Metrics; import org.junit.jupiter.api.Test; import org.springframework.http.HttpEntity; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; public class LineSpeedServiceTest { @Test public void testSaveLineSpeed() { LineSpeedService lineSpeedService = new LineSpeedService(); HttpEntity actualSaveLineSpeedResult = lineSpeedService.saveLineSpeed(new LineSpeedRequest()); assertNull(actualSaveLineSpeedResult.getBody()); assertEquals("<204 NO_CONTENT No Content,[]>", actualSaveLineSpeedResult.toString()); assertEquals(HttpStatus.NO_CONTENT, ((ResponseEntity) actualSaveLineSpeedResult).getStatusCode()); } @Test public void testSaveLineSpeed2() { LineSpeedService lineSpeedService = new LineSpeedService(); LineSpeedRequest lineSpeedRequest = new LineSpeedRequest(); lineSpeedRequest.setSpeed(10.0f); HttpEntity actualSaveLineSpeedResult = lineSpeedService.saveLineSpeed(lineSpeedRequest); assertNull(actualSaveLineSpeedResult.getBody()); assertEquals("<204 NO_CONTENT No Content,[]>", actualSaveLineSpeedResult.toString()); assertEquals(HttpStatus.NO_CONTENT, ((ResponseEntity) actualSaveLineSpeedResult).getStatusCode()); } @Test public void testSaveLineSpeed3() { LineSpeedService lineSpeedService = new LineSpeedService(); LineSpeedRequest lineSpeedRequest = new LineSpeedRequest(); lineSpeedRequest.setTimestamp(Long.MAX_VALUE); HttpEntity actualSaveLineSpeedResult = lineSpeedService.saveLineSpeed(lineSpeedRequest); assertNull(actualSaveLineSpeedResult.getBody()); assertEquals("<404 NOT_FOUND Not Found,[]>", actualSaveLineSpeedResult.toString()); assertEquals(HttpStatus.NOT_FOUND, ((ResponseEntity) actualSaveLineSpeedResult).getStatusCode()); } @Test public void testGetMetrics() { HttpEntity<Metrics> actualMetrics = (new LineSpeedService()).getMetrics(1L); assertNull(actualMetrics.getBody()); assertEquals("<404 NOT_FOUND Not Found,[]>", actualMetrics.toString()); assertEquals(HttpStatus.NOT_FOUND, ((ResponseEntity<Metrics>) actualMetrics).getStatusCode()); } }
package chess; /** * Class to check valid moves for Queen, Rook, Knight * Methods for checking on diagonals, Vertical, and Horizontal Moves * @author Jason Hunt * @version 1.0 * @since 2019-03-01 */ public class Hor_Ver_Diag { /** * This method is used to ensure legal move for piece horizontally * @param srcrank start rank of piece * @param srcfile start file of piece * @param destrank destination rank of piece * @param destfile destination file of piece * @param chessboard instance of chess board * @return true or false depending if move is legal or not */ public boolean validHorizontalMove(int srcrank, int srcfile, int destrank, int destfile, Square[][] chessboard) { if(srcrank != destrank) {//if move not in same row invalid move return false; } else { if(destfile - srcfile < 0) {//piece is moving left for(int i = srcfile - 1; i>destfile; i--) {//subtract 1 so it starts at space left of piece if(chessboard[srcrank][i].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } else if(destfile - srcfile > 0) {//piece is moving right for(int i = srcfile + 1; i<destfile; i++) {//add one so it starts space to right of piece if(chessboard[srcrank][i].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } } return true; } /** * This method is used to ensure legal move for piece vertically * @param srcrank start rank of piece * @param srcfile start file of piece * @param destrank destination rank of piece * @param destfile destination file of piece * @param chessboard instance of chess board * @return true or false depending if move is legal or not */ public boolean validVerticalMove(int srcrank, int srcfile, int destrank, int destfile, Square[][] chessboard) { if(srcfile != destfile) {//if not in same column return false not valid vertical move return false; } else { if(destrank - srcrank < 0) {//piece is moving up for(int i = srcrank - 1; i>destrank; i--) {//subtract 1 so it starts at space one up if(chessboard[i][srcfile].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } else if(destrank - srcrank > 0) {//piece is moving down for(int i = srcrank + 1; i<destrank; i++) {//add one so it starts space one down if(chessboard[i][srcfile].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } } return true; } /** * This method is used to ensure legal move for piece diagonally * @param srcrank start rank of piece * @param srcfile start file of piece * @param destrank destination rank of piece * @param destfile destination file of piece * @param chessboard instance of chess board * @return true or false depending if move is legal or not */ public boolean validDiagonalMove(int srcrank, int srcfile, int destrank, int destfile, Square[][] chessboard) { int rankchange, filechange, changingfile; changingfile=srcfile; rankchange = destrank - srcrank; filechange = destfile - srcfile; if(Math.abs(rankchange) != Math.abs(filechange)) {//if changes arent equal its not a diagonal move return false; } else { if(rankchange < 0 && filechange < 0) {//piece is moving up to the left for(int i = srcrank-1; i > destrank; i--) {//check that path to destination is clear changingfile=changingfile-1; if(chessboard[i][changingfile].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } else if(rankchange < 0 && filechange > 0) {//piece is moving up and to the right for(int i = srcrank-1; i > destrank; i--) {//check that path to destination is clear changingfile=changingfile+1; if(chessboard[i][changingfile].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } else if(rankchange > 0 && filechange > 0){//piece is moving down and to the right for(int i = srcrank+1; i < destrank; i++) {//check that path to destination is clear changingfile=changingfile+1; if(chessboard[i][changingfile].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } else if(rankchange > 0 && filechange < 0){//piece is down up and to the left for(int i = srcrank+1; i < destrank; i++) {//check that path to destination is clear changingfile=changingfile-1; if(chessboard[i][changingfile].piece_at!=null) { return false;//if piece is blocking path not a valid move } } } } return true;// if it succeeds path is valid } }
package rugal.westion.jiefanglu.core.dao.impl; import java.util.List; import org.hibernate.Criteria; import org.springframework.stereotype.Repository; import rugal.common.hibernate.HibernateBaseDao; import rugal.common.page.Pagination; import rugal.westion.jiefanglu.core.dao.TypeTagDao; import rugal.westion.jiefanglu.core.entity.TypeTag; /** * * @author Westion */ @Repository public class TypeTagDaoImpl extends HibernateBaseDao<TypeTag, Integer> implements TypeTagDao { @SuppressWarnings("unchecked") @Override public List<TypeTag> list() { return findByCriteria(); } @Override public TypeTag deleteById(Integer id) { TypeTag entity = super.get(id); if (entity != null) { getSession().delete(entity); } return entity; } @Override public TypeTag findById(Integer id) { TypeTag entity = get(id); return entity; } @Override public Pagination getPage(int pageNo, int pageSize) { Criteria crit = createCriteria(); Pagination page = findByCriteria(crit, pageNo, pageSize); return page; } @Override public TypeTag save(TypeTag bean) { getSession().save(bean); return bean; } @Override protected Class<TypeTag> getEntityClass() { return TypeTag.class; } }
import java.util.Random; import java.util.Scanner; public class Main { public static final String BEGINNER_HEADER = "Current Status of Board :\n 0 1 2 3 4 5 6 7 8"; public static final String IMEDIATE_HEADER = "Current Status of Board :\n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"; public static final String ADVANCED_HEADER = "Current Status of Board :\n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23"; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int rows = 0; int cols = 0; int fieldSize = 0; int win = 0; int mines = 0; Random random = new Random(); System.out.println("Enter the Difficulty Level"); System.out.println("Press 0 for BEGINNER (9 * 9 Cells and 10 mines)"); System.out.println("Press 1 for INTERMEDIATE (16 * 16 Cells and 40 mines)"); System.out.println("Press 2 for ADVANCED (24 * 24 and 99 mines)"); fieldSize = Integer.parseInt(scanner.nextLine()); String finalHeader = ""; //Setting the game if (fieldSize == 0) { rows = 9; cols = 9; mines = 10; finalHeader = BEGINNER_HEADER; win = 71; } else if (fieldSize == 1) { rows = 16; cols = 16; mines = 40; finalHeader = IMEDIATE_HEADER; win = 216; } else if (fieldSize == 2) { rows = 24; cols = 24; mines = 99; finalHeader = ADVANCED_HEADER; win = 477; } //Creating a field with bombs char[][] bombField = new char[rows][cols]; for (int r = 0; r < rows; r++) { for (int c = 0; c < cols; c++) { bombField[r][c] = '-'; } } //Creating a player's field char[][] playerField = new char[rows][cols]; for (int r = 0; r < rows; r++) { for (int c = 0; c < cols; c++) { playerField[r][c] = '-'; } } //Intro System.out.println(finalHeader); for (int i = 0; i < rows; i++) { System.out.print(i + " "); for (int j = 0; j < cols; j++) { System.out.print(playerField[i][j] + " "); } System.out.println(); } //Next few lines are insurance that we can't die in the first round System.out.println("Enter your move, (row, column)"); int currRow = Integer.parseInt(scanner.nextLine()); int currCol = Integer.parseInt(scanner.nextLine()); /*Putting the bombs on the field*/ for (int i = 0; i < mines; i++) { int rndRow = random.nextInt(rows); int rndCol = random.nextInt(cols); if (bombField[rndRow][rndCol] != 11332) { bombField[rndRow][rndCol] = 11332; } else { i--; } } // Printing the mines on screen //for (int i = 0; i < rows; i++) { // System.out.print(i + " "); // for (int j = 0; j < cols; j++) { // System.out.print(bombField[i][j] + " "); // } // System.out.println(); //} while (bombField[currRow][currCol] == 11332) { for (int i = 0; i < mines; i++) { int rndRow = random.nextInt(rows); int rndCol = random.nextInt(cols); if (bombField[rndRow][rndCol] != 11332) { bombField[rndRow][rndCol] = 11332; } else { i--; } } } System.out.println(finalHeader); for (int i = 0; i < rows; i++) { System.out.print(i + " "); for (int j = 0; j < cols; j++) { System.out.print(playerField[i][j] + " "); } System.out.println(); } boolean playerAlive = true; while (playerAlive) { int bombCounter = 0; System.out.println("Enter your move, (row, column)"); int chosenRow = Integer.parseInt(scanner.nextLine()); int chosenCol = Integer.parseInt(scanner.nextLine()); //Checking for mines if (chosenRow > 0 && chosenRow < rows) { if (chosenCol > 0 && chosenCol < cols) { bombCounter = checkRowDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol); bombCounter = checkRowUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol); bombCounter = checkColDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol - 1); bombCounter = checkColUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol + 1); bombCounter = checkUpLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol - 1); bombCounter = checkDownLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol - 1); bombCounter = checkDownRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol + 1); bombCounter = checkUpRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol + 1); } } if (chosenRow == 0 && chosenCol == 0) { bombCounter = checkColUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol + 1); bombCounter = checkRowDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol); bombCounter = checkDownRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol + 1); } if (chosenRow == 0 && chosenCol == cols) { bombCounter = checkColDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol - 1); bombCounter = checkRowDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol); bombCounter = checkDownLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol - 1); } if (chosenRow == rows && chosenCol == 0) { bombCounter = checkRowUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol); bombCounter = checkColUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol + 1); bombCounter = checkUpRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol + 1); } if (chosenRow == rows && chosenCol == cols) { bombCounter = checkRowUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol); bombCounter = checkColDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol - 1); bombCounter = checkUpLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol - 1); } if (chosenRow == 0 && chosenCol > 0 && chosenCol < cols) { bombCounter = checkRowDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol); bombCounter = checkColDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol - 1); bombCounter = checkColUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol + 1); bombCounter = checkDownLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol - 1); bombCounter = checkDownRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol + 1); } if (chosenRow == rows && chosenCol > 0 && chosenCol < cols) { bombCounter = checkColDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol - 1); bombCounter = checkColUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol + 1); bombCounter = checkRowUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol); bombCounter = checkUpRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol + 1); bombCounter = checkUpLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol - 1); } if (chosenRow > 0 && chosenRow < rows && chosenCol == 0) { bombCounter = checkRowDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol); bombCounter = checkRowUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol); bombCounter = checkColUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol + 1); bombCounter = checkDownRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol + 1); bombCounter = checkUpRightCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol + 1); } if (chosenRow > 0 && chosenRow < rows && chosenCol == cols) { bombCounter = checkRowDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol); bombCounter = checkRowUp(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol); bombCounter = checkColDown(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow, chosenCol - 1); bombCounter = checkUpLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow - 1, chosenCol - 1); bombCounter = checkDownLeftCorner(bombCounter, bombField, playerField, chosenRow, chosenCol, chosenRow + 1, chosenCol - 1); } win--; if (win == 0) { System.out.println("You win!"); break; } if (bombField[chosenRow][chosenCol] == 11332) { playerAlive = false; System.out.println("You lost!"); break; } char currChar = (char) (bombCounter + '0'); playerField[chosenRow][chosenCol] = currChar; //Printing the field System.out.println(finalHeader); for (int i = 0; i < rows; i++) { System.out.print(i + " "); for (int j = 0; j < cols; j++) { System.out.print(playerField[i][j] + " "); } System.out.println(); } } } private static int checkUpRightCorner(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int i2, int i3) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[i2][i3] == 11332) { bombCounter++; } return bombCounter; } private static int checkDownRightCorner(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int i2, int i3) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[i2][i3] == 11332) { bombCounter++; } return bombCounter; } private static int checkDownLeftCorner(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int i2, int i3) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[i2][i3] == 11332) { bombCounter++; } return bombCounter; } private static int checkUpLeftCorner(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int i2, int i3) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[i2][i3] == 11332) { bombCounter++; } return bombCounter; } private static int checkColUp(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int chosenRow2, int i2) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[chosenRow2][i2] == 11332) { bombCounter++; } return bombCounter; } private static int checkColDown(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int chosenRow2, int i2) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[chosenRow2][i2] == 11332) { bombCounter++; } return bombCounter; } private static int checkRowUp(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int i2, int chosenCol2) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[i2][chosenCol2] == 11332) { bombCounter++; } return bombCounter; } private static int checkRowDown(int bombCounter, char[][] bombField, char[][] playerField, int chosenRow, int chosenCol, int i2, int chosenCol2) { if (playerField[chosenRow][chosenCol] == bombField[chosenRow][chosenCol] && bombField[i2][chosenCol2] == 11332) { bombCounter++; } return bombCounter; } }
package dev.wornairz.tap.kafka; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import org.apache.kafka.connect.data.Schema; import org.apache.kafka.connect.source.SourceRecord; import org.apache.kafka.connect.source.SourceTask; import dev.wornairz.tap.ethereum.EthereumBlocksQueue; public class EthereumSourceTask extends SourceTask { private final String OFFSET_KEY = "Ethereum WSS"; private String kafkaTopic; private EthereumBlocksQueue queue; private Long count; @Override public String version() { return "1"; } @Override public void start(Map<String, String> props) { kafkaTopic = props.get("topic"); queue = EthereumBlocksQueue.getInstance(); count = 0L; } @Override public List<SourceRecord> poll() throws InterruptedException { //The configuration map is passed by the SourceConnector List<SourceRecord> records = new ArrayList<>(); while (!queue.isEmpty()) { String block = queue.remove(); SourceRecord record = new SourceRecord(offsetKey(OFFSET_KEY), offsetValue(count++), kafkaTopic, Schema.STRING_SCHEMA, block); records.add(record); } return records; } @Override public synchronized void stop() { // TODO Auto-generated method stub } private Map<String, String> offsetKey(String wss) { return Collections.singletonMap("wss", wss); } private Map<String, Long> offsetValue(Long pos) { return Collections.singletonMap("position", pos); } }
package RuntimeTerror2021; public class Coord { final int x_col; final int y_row; public Coord(int x_col, int y_row) { this.x_col = x_col; this.y_row = y_row; } public int getX_col() { return x_col; } public int getY_row() { return y_row; } }
package com.avogine.junkyard.scene.entity.light; import org.joml.Vector3f; import com.avogine.junkyard.Theater; import com.avogine.junkyard.scene.entity.EntityComponent; import com.avogine.junkyard.scene.entity.event.EntityEvent; public class DirectionalLight extends EntityComponent { private Vector3f color; private Vector3f direction; private float intensity; private double lightAngle; public DirectionalLight(int entity, Vector3f color, Vector3f direction, float intensity) { super(entity); this.color = color; this.direction = direction; this.intensity = intensity; } public DirectionalLight(DirectionalLight light) { this(light.getEntityID(), light.getColor(), light.getDirection(), light.getIntensity()); } public void update() { // TODO Put this in a time listener yo lightAngle += Theater.getDelta() * 10; if (lightAngle > 90) { setIntensity(0); if (lightAngle >= 360) { lightAngle = 0; } } else if (lightAngle <= -80 || lightAngle >= 80) { float factor = 1 - (float)(Math.abs(lightAngle) - 80) / 10.0f; setIntensity(factor); getColor().y = Math.max(factor, 0.9f); getColor().z = Math.max(factor, 0.5f); } else { setIntensity(1); getColor().x = 1; getColor().y = 1; getColor().z = 1; } double angRad = Math.toRadians(lightAngle); getDirection().x = (float) Math.sin(angRad); getDirection().y = (float) Math.cos(angRad); } @Override public void fireEvent(EntityEvent event) { // TODO Auto-generated method stub } public Vector3f getColor() { return color; } public void setColor(Vector3f color) { this.color = color; } public Vector3f getDirection() { return direction; } public void setDirection(Vector3f direction) { this.direction = direction; } public float getIntensity() { return intensity; } public void setIntensity(float intensity) { this.intensity = intensity; } }
.package Livraria; public class RegistroDeVendas { public static void main(String[] args) { Autor autor = new Autor(); autor.setNome("Marcio"); LivroFisico fisico = new LivroFisico(autor) { fisico.setNome("Java"); fisico.setValor(59.9); } } }
package com.tencent.mm.plugin.backup.bakoldlogic.bakoldpcui; import android.content.Intent; import com.tencent.mm.R; import com.tencent.mm.bg.d; import com.tencent.mm.sdk.platformtools.w; import com.tencent.mm.sdk.platformtools.x; class BakToPcUI$5 implements Runnable { final /* synthetic */ int bFq; final /* synthetic */ BakToPcUI haT; BakToPcUI$5(BakToPcUI bakToPcUI, int i) { this.haT = bakToPcUI; this.bFq = i; } public final void run() { x.d("MicroMsg.BakToPcUI", "BakToPcUI onCloseSocket errType: %d", new Object[]{Integer.valueOf(this.bFq)}); if (this.bFq == -1) { x.d("MicroMsg.BakToPcUI", "BakToPcUI jump tips"); Intent intent = new Intent(); intent.putExtra("title", this.haT.getString(R.l.backup_pc_not_support_title)); intent.putExtra("rawUrl", this.haT.getString(R.l.backup_not_support_doc, new Object[]{w.chP()})); intent.putExtra("showShare", false); intent.putExtra("neverGetA8Key", true); d.b(this.haT, "webview", ".ui.tools.WebViewUI", intent); return; } BakToPcUI.e(this.haT); } }
package cloudscript.lang; /** Language runtime. Mostly helper methods for retrieving global values. */ public class CloudScriptRuntime { static CloudScriptClass objectClass; static CloudScriptObject mainObject; static CloudScriptObject nilObject; static CloudScriptObject trueObject; static CloudScriptObject falseObject; public static CloudScriptClass getObjectClass() { return objectClass; } public static CloudScriptObject getMainObject() { return mainObject; } public static CloudScriptClass getRootClass(String name) { // objectClass is null when boostrapping return objectClass == null ? null : (CloudScriptClass) objectClass.getConstant(name); } public static CloudScriptClass getExceptionClass() { return getRootClass("Exception"); } public static CloudScriptObject getNil() { return nilObject; } public static CloudScriptObject getTrue() { return trueObject; } public static CloudScriptObject getFalse() { return falseObject; } public static CloudScriptObject toBoolean(boolean value) { return value ? CloudScriptRuntime.getTrue() : CloudScriptRuntime.getFalse(); } }
// RunConnectFour.java // 2-19-19 // // This will run the Connect Four game. import java.awt.*; import javax.swing.*; public class RunConnectFour { public static void main(String[] args) { JFrame frame = new JFrame("Connect Four"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ConnectFourFrame game = new ConnectFourFrame(); frame.getContentPane().add(game); frame.pack(); frame.setVisible(true); } }
package com.ccxia.cbcraft.item; import com.ccxia.cbcraft.CbCraft; import com.ccxia.cbcraft.creativetab.CreativeTabsCbCraft; import net.minecraft.item.Item; public class ItemCookieDough extends Item { public ItemCookieDough() { this.setUnlocalizedName(CbCraft.MODID + ".cookieDough"); this.setRegistryName("cookie_dough"); this.setCreativeTab(CreativeTabsCbCraft.tabCbCraft); } }
package com.tencent.mm.pluginsdk.a; import android.content.Context; import com.tencent.mm.ab.d.a; import com.tencent.mm.ar.f; import com.tencent.mm.opensdk.modelmsg.WXMediaMessage; import com.tencent.mm.storage.ap; import com.tencent.mm.storage.bd; import com.tencent.mm.storage.emotion.EmojiInfo; import com.tencent.mm.storage.emotion.q; import com.tencent.mm.storage.emotion.s; import java.util.ArrayList; import java.util.List; public interface d extends e { String a(Context context, WXMediaMessage wXMediaMessage, String str); void a(Context context, bd bdVar); void a(String str, EmojiInfo emojiInfo, bd bdVar); boolean a(Context context, EmojiInfo emojiInfo, int i, String str); boolean a(String str, String str2, long j, String str3, a aVar); byte[] a(EmojiInfo emojiInfo); boolean aDP(); ArrayList<q> aDQ(); ArrayList<String> aDR(); ArrayList<s> aDS(); f aDT(); ap cu(String str, String str2); String cv(String str, String str2); void d(EmojiInfo emojiInfo); int e(EmojiInfo emojiInfo); int[] f(EmojiInfo emojiInfo); boolean o(Context context, String str, String str2); boolean p(ArrayList<q> arrayList); boolean q(ArrayList<s> arrayList); EmojiInfo zi(String str); String zj(String str); List<EmojiInfo> zk(String str); boolean zl(String str); ArrayList<String> zm(String str); String zn(String str); String zo(String str); int zp(String str); String zq(String str); void zr(String str); }
package com.he.jsbinding; import com.google.c.a.a.a.a.a; import java.lang.reflect.Method; import java.nio.ByteBuffer; public class JsEngine { private static RuntimeException pending_exception; public static volatile Type type = Type.Unknown; final long vm; public JsEngine() { loadLibs(); if (type != Type.Unknown) { this.vm = createVM(); return; } throw pending_exception; } JsEngine(long paramLong) { this.vm = paramLong; } private static void addPendingException(Throwable paramThrowable) { if (pending_exception == null) pending_exception = new RuntimeException("failed to create js engine"); a.a(pending_exception, paramThrowable); } static native void callObject(int paramInt1, int paramInt2, int paramInt3); static native void callObjectMethod(int paramInt1, int paramInt2, String paramString, int paramInt3); static native int compileBytes(long paramLong, int paramInt, byte[] paramArrayOfbyte, String paramString, boolean paramBoolean); static native int createArray(long paramLong, int paramInt1, int paramInt2); static native int createArrayBuffer(long paramLong, int paramInt1, int paramInt2); static native int createContext(long paramLong); static native int createFunction(long paramLong, int paramInt, JsFunctionCallback paramJsFunctionCallback); static native int createObject(long paramLong, int paramInt); private static native long createVM(); static native int deserialize(long paramLong, int paramInt, ByteBuffer paramByteBuffer); static native void disposeVM(long paramLong); static native void eval(long paramLong, int paramInt, String paramString1, String paramString2, boolean paramBoolean); static native void evalByteBuffer(long paramLong, int paramInt, ByteBuffer paramByteBuffer, String paramString, boolean paramBoolean); static native void evalBytes(long paramLong, int paramInt, byte[] paramArrayOfbyte, String paramString, boolean paramBoolean); static native void executeScript(long paramLong, int paramInt1, int paramInt2, boolean paramBoolean1, boolean paramBoolean2); static native void getArrayField(int paramInt1, int paramInt2, int paramInt3); static native int getArrayLength(long paramLong, int paramInt1, int paramInt2); static native boolean getBooleanParam(long paramLong, int paramInt); static native boolean getBooleanResult(); static native int getGlobal(long paramLong, int paramInt); static native int getIntParam(long paramLong, int paramInt); static native int getIntResult(int paramInt); static native double getNumberParam(long paramLong, int paramInt); static native double getNumberResult(int paramInt); static native int getObjectParam(long paramLong, int paramInt1, int paramInt2); static native void getObjectProp(int paramInt1, int paramInt2, String paramString); static native int getObjectResult(int paramInt); static native String getStringParam(long paramLong, int paramInt); static native String getStringResult(int paramInt); private static void loadLibs() { // Byte code: // 0: ldc com/he/jsbinding/JsEngine // 2: monitorenter // 3: getstatic com/he/jsbinding/JsEngine.type : Lcom/he/jsbinding/JsEngine$Type; // 6: astore_0 // 7: getstatic com/he/jsbinding/JsEngine$Type.Unknown : Lcom/he/jsbinding/JsEngine$Type; // 10: astore_1 // 11: aload_0 // 12: aload_1 // 13: if_acmpeq -> 20 // 16: ldc com/he/jsbinding/JsEngine // 18: monitorexit // 19: return // 20: aconst_null // 21: putstatic com/he/jsbinding/JsEngine.pending_exception : Ljava/lang/RuntimeException; // 24: ldc 'c++_shared' // 26: invokestatic load : (Ljava/lang/String;)V // 29: goto -> 45 // 32: astore_0 // 33: ldc 'jsbinding' // 35: ldc 'library for c++_shared not loaded' // 37: aload_0 // 38: invokestatic eWithThrowable : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V // 41: aload_0 // 42: invokestatic addPendingException : (Ljava/lang/Throwable;)V // 45: ldc 'v8_libbase.cr' // 47: invokestatic load : (Ljava/lang/String;)V // 50: ldc 'v8_libplatform.cr' // 52: invokestatic load : (Ljava/lang/String;)V // 55: ldc 'v8.cr' // 57: invokestatic load : (Ljava/lang/String;)V // 60: ldc 'skialite' // 62: invokestatic load : (Ljava/lang/String;)V // 65: goto -> 81 // 68: astore_0 // 69: ldc 'jsbinding' // 71: ldc 'load skialite failed' // 73: aload_0 // 74: invokestatic eWithThrowable : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V // 77: aload_0 // 78: invokestatic addPendingException : (Ljava/lang/Throwable;)V // 81: ldc 'helium' // 83: invokestatic load : (Ljava/lang/String;)V // 86: getstatic com/he/jsbinding/JsEngine$Type.V8 : Lcom/he/jsbinding/JsEngine$Type; // 89: putstatic com/he/jsbinding/JsEngine.type : Lcom/he/jsbinding/JsEngine$Type; // 92: ldc 'jsbinding' // 94: iconst_1 // 95: anewarray java/lang/Object // 98: dup // 99: iconst_0 // 100: ldc 'using V8' // 102: aastore // 103: invokestatic d : (Ljava/lang/String;[Ljava/lang/Object;)V // 106: ldc com/he/jsbinding/JsEngine // 108: monitorexit // 109: return // 110: astore_0 // 111: ldc 'jsbinding' // 113: ldc 'load V8 failed' // 115: aload_0 // 116: invokestatic eWithThrowable : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V // 119: aload_0 // 120: invokestatic addPendingException : (Ljava/lang/Throwable;)V // 123: ldc 'gnustl_shared' // 125: invokestatic load : (Ljava/lang/String;)V // 128: goto -> 144 // 131: astore_0 // 132: ldc 'jsbinding' // 134: ldc 'library gnustl_shared not loaded' // 136: aload_0 // 137: invokestatic eWithThrowable : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V // 140: aload_0 // 141: invokestatic addPendingException : (Ljava/lang/Throwable;)V // 144: ldc 'jsc' // 146: invokestatic load : (Ljava/lang/String;)V // 149: ldc 'jsbinding-jsc' // 151: invokestatic load : (Ljava/lang/String;)V // 154: getstatic com/he/jsbinding/JsEngine$Type.JSC : Lcom/he/jsbinding/JsEngine$Type; // 157: putstatic com/he/jsbinding/JsEngine.type : Lcom/he/jsbinding/JsEngine$Type; // 160: ldc 'jsbinding' // 162: iconst_1 // 163: anewarray java/lang/Object // 166: dup // 167: iconst_0 // 168: ldc 'using JSC' // 170: aastore // 171: invokestatic d : (Ljava/lang/String;[Ljava/lang/Object;)V // 174: ldc com/he/jsbinding/JsEngine // 176: monitorexit // 177: return // 178: astore_0 // 179: ldc 'jsbinding' // 181: ldc 'load JSC failed' // 183: aload_0 // 184: invokestatic eWithThrowable : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V // 187: aload_0 // 188: invokestatic addPendingException : (Ljava/lang/Throwable;)V // 191: ldc 'jsbinding' // 193: invokestatic load : (Ljava/lang/String;)V // 196: getstatic com/he/jsbinding/JsEngine$Type.QuickJS : Lcom/he/jsbinding/JsEngine$Type; // 199: putstatic com/he/jsbinding/JsEngine.type : Lcom/he/jsbinding/JsEngine$Type; // 202: ldc 'jsbinding' // 204: iconst_1 // 205: anewarray java/lang/Object // 208: dup // 209: iconst_0 // 210: ldc 'using QuickJS' // 212: aastore // 213: invokestatic d : (Ljava/lang/String;[Ljava/lang/Object;)V // 216: ldc com/he/jsbinding/JsEngine // 218: monitorexit // 219: return // 220: astore_0 // 221: ldc 'jsbinding' // 223: ldc 'load QuickJS failed' // 225: aload_0 // 226: invokestatic eWithThrowable : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V // 229: ldc com/he/jsbinding/JsEngine // 231: monitorexit // 232: return // 233: astore_0 // 234: ldc com/he/jsbinding/JsEngine // 236: monitorexit // 237: aload_0 // 238: athrow // Exception table: // from to target type // 3 11 233 finally // 20 24 233 finally // 24 29 32 finally // 33 45 233 finally // 45 60 110 finally // 60 65 68 finally // 69 81 110 finally // 81 106 110 finally // 111 123 233 finally // 123 128 131 finally // 132 144 233 finally // 144 174 178 finally // 179 191 233 finally // 191 216 220 finally // 221 229 233 finally } static native int makeArray(int paramInt1, int paramInt2); static native ByteBuffer makeDirectBuffer(long paramLong, int paramInt1, int paramInt2); private static void nativeOnInvoke(JsFunctionCallback paramJsFunctionCallback, long paramLong1, int paramInt1, long paramLong2, int paramInt2) { paramJsFunctionCallback.onCall(new JsFunctionContext(paramLong1, paramInt1, paramLong2, paramInt2)); } private static void nativeOnRun(JsContext.ScopeCallback paramScopeCallback, long paramLong, int paramInt) { paramScopeCallback.run(new JsScopedContext(paramLong, paramInt)); } static native int newMethodWrap(long paramLong1, int paramInt, Object paramObject, Method paramMethod, long paramLong2, byte paramByte); static native void objectToString(int paramInt1, int paramInt2); static native void parseJSON(String paramString); public static native void popResult(); static native void pushBoolean(boolean paramBoolean); static native void pushDouble(double paramDouble); static native void pushInt(int paramInt); static native void pushNull(); static native void pushObject(int paramInt1, int paramInt2); static native void pushString(String paramString); static native void pushUndefined(); static native void releaseContext(long paramLong, int paramInt); public static native void releaseDeserializable(ByteBuffer paramByteBuffer); static native void releaseObject(long paramLong, int paramInt1, int paramInt2); static native void releaseScript(long paramLong, int paramInt1, int paramInt2); static native int retain(long paramLong, int paramInt1, int paramInt2, int paramInt3); static native void returns(long paramLong); static native void run(long paramLong, int paramInt, JsContext.ScopeCallback paramScopeCallback); public static native void runInCurrentContext(JsContext.ScopeCallback paramScopeCallback); static native ByteBuffer serialize(long paramLong, int paramInt1, int paramInt2); static native void setObjectProp(int paramInt1, int paramInt2, String paramString); static native String toJSON(long paramLong, int paramInt1, int paramInt2); public void dispose() { disposeVM(this.vm); } public enum Type { JSC, QuickJS, Unknown, V8; static { QuickJS = new Type("QuickJS", 3); $VALUES = new Type[] { Unknown, JSC, V8, QuickJS }; } } } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\he\jsbinding\JsEngine.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
package rjm.romek.awscourse.verifier.s3; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import rjm.romek.awscourse.model.UserTask; import rjm.romek.awscourse.service.S3Service; import rjm.romek.awscourse.verifier.TaskVerifier; @Component public class VersioningEnabledVerifier implements TaskVerifier { @Autowired private S3Service s3Service; @Override public Boolean isCompleted(UserTask userTask) { Map<String, String> answers = userTask.getAnswers(); return s3Service.versioningEnabled(answers.getOrDefault("bucketName", "")); } }
package com.ss.lms.app; public class App { public static void main(String[] args) { Console console = new Console(); console.run(); } }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. */ package org.apache.clerezza.implementation.literal; import org.apache.clerezza.IRI; import org.apache.clerezza.Literal; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.platform.runner.JUnitPlatform; import org.junit.runner.RunWith; import java.util.Arrays; import java.util.Date; /** * @author reto */ @RunWith(JUnitPlatform.class) public class LiteralFactoryTest { /** * Test that a NoConvertorException thrown for an unsupported convertor */ @Test public void unavailableConvertor() { Object value = new Object() { }; Assertions.assertThrows(NoConvertorException.class, () -> LiteralFactory.getInstance().createTypedLiteral(value) ); } /** * Test conversion of byte[] to literal an back */ @Test public void byteArrayConversion() { byte[] bytes = new byte[5]; for (byte i = 0; i < bytes.length; i++) { bytes[i] = i; } Literal literal = LiteralFactory.getInstance().createTypedLiteral(bytes); Assertions.assertEquals(new IRI("http://www.w3.org/2001/XMLSchema#base64Binary"), literal.getDataType()); //we are using bytes.getClass() but there should be a way to get //that instance of Class without getting it from an instance //but this is java-bug 4071439 (would like byte[].class or byte.class.getArrayType()) byte[] bytesBack = LiteralFactory.getInstance().createObject(bytes.getClass(), literal); Assertions.assertTrue(Arrays.equals(bytes, bytesBack)); } /** * Test conversion of java.util.Date to literal an back */ @Test public void dateConversion() { Date date = new Date(); Literal literal = LiteralFactory.getInstance().createTypedLiteral(date); Assertions.assertEquals(new IRI("http://www.w3.org/2001/XMLSchema#dateTime"), literal.getDataType()); Date dateBack = LiteralFactory.getInstance().createObject(Date.class, literal); Assertions.assertEquals(date.getTime(), dateBack.getTime()); } /** * Test conversion of String to literal an back */ @Test public void stringConversion() { String value = "Hello world"; Literal literal = LiteralFactory.getInstance().createTypedLiteral(value); Assertions.assertEquals(new IRI("http://www.w3.org/2001/XMLSchema#string"), literal.getDataType()); String valueBack = LiteralFactory.getInstance().createObject(String.class, literal); Assertions.assertEquals(value, valueBack); } /** * Test conversion of Integer to literal an back */ @Test public void intConversion() { int value = 3; Literal literal = LiteralFactory.getInstance().createTypedLiteral(value); Assertions.assertEquals(new IRI("http://www.w3.org/2001/XMLSchema#int"), literal.getDataType()); Integer valueBack = LiteralFactory.getInstance().createObject(Integer.class, literal); Assertions.assertEquals(value, valueBack.intValue()); } /** * Test conversion of Long to literal an back */ @Test public void longConversion() { long value = 332314646; Literal literal = LiteralFactory.getInstance().createTypedLiteral(value); Assertions.assertEquals(new IRI("http://www.w3.org/2001/XMLSchema#long"), literal.getDataType()); Long valueBack = LiteralFactory.getInstance().createObject(Long.class, literal); Assertions.assertEquals(value, valueBack.longValue()); } }
package amlsim; import amlsim.model.*; import amlsim.model.cash.CashInModel; import amlsim.model.cash.CashOutModel; import sim.engine.SimState; import sim.engine.Steppable; import java.util.*; public class Account implements Steppable { protected String id; protected CashInModel cashInModel; protected CashOutModel cashOutModel; protected boolean isSAR = false; private Branch branch = null; private Set<String> origAcctIDs = new HashSet<>(); // Originator account ID set private Set<String> beneAcctIDs = new HashSet<>(); // Beneficiary account ID set private List<Account> origAccts = new ArrayList<>(); // Originator accounts from which this account receives money private List<Account> beneAccts = new ArrayList<>(); // Beneficiary accounts to which this account sends money private int numSARBene = 0; // Number of SAR beneficiary accounts private String bankID = ""; // Bank ID private Account prevOrig = null; // Previous originator account List<Alert> alerts = new ArrayList<>(); List<AccountGroup> accountGroups = new ArrayList<>(); private Map<String, String> tx_types = new HashMap<>(); // Receiver Client ID --> Transaction Type private static List<String> all_tx_types = new ArrayList<>(); private ArrayList<String> paramFile = new ArrayList<>(); private double balance = 0; protected long startStep = 0; protected long endStep = 0; private Random random; public Account() { this.id = "-"; } /** * Constructor of the account object * @param id Account ID * @param interval Default transaction interval * @param initBalance Initial account balance * @param start Start step * @param end End step */ public Account(String id, int interval, float initBalance, String bankID, Random rand) { this.id = id; this.setBalance(initBalance); this.bankID = bankID; this.random = rand; this.cashInModel = new CashInModel(); this.cashInModel.setAccount(this); this.cashInModel.setParameters(interval, -1, -1); this.cashOutModel = new CashOutModel(); this.cashOutModel.setAccount(this); this.cashOutModel.setParameters(interval, -1, -1); } public String getBankID() { return this.bankID; } public long getStartStep(){ return this.startStep; } public long getEndStep(){ return this.endStep; } void setSAR(boolean flag){ this.isSAR = flag; } public boolean isSAR() { return this.isSAR; } public double getBalance() { return this.balance; } public void setBalance(double balance) { this.balance = balance; } public void withdraw(double ammount) { if (this.balance < ammount) { this.balance = 0; } else { this.balance -= ammount; } } public void deposit(double ammount){ this.balance += ammount; } void setBranch(Branch branch) { this.branch = branch; } public Branch getBranch(){ return this.branch; } public void addBeneAcct(Account bene){ String beneID = bene.id; if(beneAcctIDs.contains(beneID)){ // Already added return; } if(ModelParameters.shouldAddEdge(this, bene)){ beneAccts.add(bene); beneAcctIDs.add(beneID); bene.origAccts.add(this); bene.origAcctIDs.add(id); if(bene.isSAR){ numSARBene++; } } } public void addTxType(Account bene, String ttype){ this.tx_types.put(bene.id, ttype); all_tx_types.add(ttype); } public String getTxType(Account bene) { String destID = bene.id; if (this.tx_types.containsKey(destID)) { return tx_types.get(destID); } else if (!this.tx_types.isEmpty()) { List<String> values = new ArrayList<>(this.tx_types.values()); return values.get(this.random.nextInt(values.size())); } else { return Account.all_tx_types.get(this.random.nextInt(Account.all_tx_types.size())); } } /** * Get previous (originator) accounts * @return Originator account list */ public List<Account> getOrigList(){ return this.origAccts; } /** * Get next (beneficiary) accounts * @return Beneficiary account list */ public List<Account> getBeneList(){ return this.beneAccts; } public void printBeneList(){ System.out.println(this.beneAccts); } public int getNumSARBene(){ return this.numSARBene; } public float getPropSARBene(){ if(numSARBene == 0){ return 0.0F; } return (float)numSARBene / beneAccts.size(); } /** * Register this account to the specified alert. * @param alert Alert */ public void addAlert(Alert alert) { this.alerts.add(alert); } public void addAccountGroup(AccountGroup accountGroup) { this.accountGroups.add(accountGroup); } /** * Perform transactions * @param state AMLSim object */ @Override public void step(SimState state) { long currentStep = state.schedule.getSteps(); // Current simulation step long start = this.startStep >= 0 ? this.startStep : 0; long end = this.endStep > 0 ? this.endStep : AMLSim.getNumOfSteps(); if(currentStep < start || end < currentStep){ return; // Skip transactions if this account is not active } handleAction(state); } public void handleAction(SimState state) { AMLSim amlsim = (AMLSim) state; long step = state.schedule.getSteps(); for (Alert alert : this.alerts) { if (this == alert.getMainAccount()) { alert.registerTransactions(step, this); } } for (AccountGroup accountGroup : this.accountGroups) { Account account = accountGroup.getMainAccount(); if (this == accountGroup.getMainAccount()) { accountGroup.registerTransactions(step, account); } } handleCashTransaction(amlsim); } /** * Make cash transactions (deposit and withdrawal) */ private void handleCashTransaction(AMLSim amlsim){ long step = amlsim.schedule.getSteps(); this.cashInModel.makeTransaction(step); this.cashOutModel.makeTransaction(step); } /** * Get the previous originator account * @return Previous originator account objects */ public Account getPrevOrig(){ return prevOrig; } public String getName() { return this.id; } /** * Get the account identifier as long * @return Account identifier */ public String getID(){ return this.id; } /** * Get the account identifier as String * @return Account identifier */ public String toString() { return "C" + this.id; } public ArrayList<String> getParamFile() { return paramFile; } public void setParamFile(ArrayList<String> paramFile) { this.paramFile = paramFile; } }
package DAO; import model.Product; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; public class ProductDAO implements IProductDAO { BaseDAO baseDAO = new BaseDAO(); Connection connection = baseDAO.getConnection(); @Override public ArrayList<Product> displayAll() { ArrayList<Product> list = new ArrayList<>(); try { PreparedStatement preparedStatement = connection.prepareStatement( "select * from product" ); ResultSet resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { String name = resultSet.getString("name"); String price = resultSet.getString("price"); String quantity = resultSet.getString("quantity"); String color = resultSet.getString("color"); String description = resultSet.getString("description"); String category = resultSet.getString("category"); list.add(new Product(name, price, quantity, color, description, category)); } } catch (SQLException e) { e.printStackTrace(); } return list; } @Override public void delete(String name) { try { PreparedStatement preparedStatement = connection.prepareStatement( "delete from product where `name` = ?" ); preparedStatement.setString(1,name); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } @Override public Product getProduct(String name) { Product product = null; try { PreparedStatement preparedStatement = connection.prepareStatement( "select * from product where name like concat('%',?,'%');" ); preparedStatement.setString(1,name); ResultSet resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { String newName = resultSet.getString("name"); String price = resultSet.getString("price"); String quantity = resultSet.getString("quantity"); String color = resultSet.getString("color"); String description = resultSet.getString("description"); String category = resultSet.getString("category"); product = new Product(newName, price, quantity, color, description, category); } } catch (SQLException e) { e.printStackTrace(); } return product; } @Override public void create(Product product) { try { PreparedStatement preparedStatement = connection.prepareStatement( "insert into product value(?,?,?,?,?,?)" ); // preparedStatement.setString(1, product.getId()); preparedStatement.setString(1, product.getName()); preparedStatement.setString(2, product.getPrice()); preparedStatement.setString(3, product.getQuantity()); preparedStatement.setString(4, product.getColor()); preparedStatement.setString(5, product.getDescription()); preparedStatement.setString(6, product.getCategory()); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } @Override public void edit(String id, Product product) { try { PreparedStatement preparedStatement = connection.prepareStatement( "update customer " + "set id = ?, name = ? " + "where id = ?" ); // preparedStatement.setString(1, product.getId()); preparedStatement.setString(2, product.getName()); preparedStatement.setString(3, id); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } @Override public Product getProductPrice(String price) { Product product = null; try { PreparedStatement preparedStatement = connection.prepareStatement( "select * from product where price = ?" ); preparedStatement.setString(1,price); ResultSet resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { String name = resultSet.getString("name"); String quantity = resultSet.getString("quantity"); String color = resultSet.getString("color"); String description = resultSet.getString("description"); String category = resultSet.getString("category"); product = new Product(name, price, quantity, color, description, category); } } catch (SQLException e) { e.printStackTrace(); } return product; } }
package by.dt.service.impl; import by.dt.entity.Notification; import by.dt.entity.PersonalInformation; import by.dt.entity.User; import by.dt.entity.dto.RegistrationDataDTO; import by.dt.repository.UserRepository; import by.dt.service.UserService; import by.dt.web.controller.exception.AlreadyExistException; import by.dt.web.controller.exception.NotFoundException; import org.bson.types.ObjectId; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserServiceImpl implements UserService { @Autowired private UserRepository userRepository; @Override public User addUser(RegistrationDataDTO registrationDataDTO) { User user = userRepository.findUserByLogin(registrationDataDTO.getLogin()); if(user != null){ throw new AlreadyExistException("User with same login is already exist"); } user = new User(registrationDataDTO); ObjectId objectId = new ObjectId(); user.setId(objectId.toString()); user = userRepository.insert(user); return user; } @Override public User userAuthentication(RegistrationDataDTO registrationDataDTO) { User user = userRepository.findUserByLoginAndPassword(registrationDataDTO.getLogin(), registrationDataDTO.getPassword()); if(user == null){ throw new NotFoundException("User not found"); } return userRepository.findUserByLoginAndPassword(registrationDataDTO.getLogin(), registrationDataDTO.getPassword()); } @Override public void updateFavoriteTradingNetworks(List<String> favoriteTradingNetworksIds, String id) { User user = userRepository.findOne(id); if(user == null){ throw new NotFoundException("User not found"); } user.getUserSettings().setFavoriteTradingNetworkIds(favoriteTradingNetworksIds); userRepository.save(user); } @Override public List<String> getFavoriteTradingNetworks(String id) { User user = userRepository.findOne(id); if(user == null){ throw new NotFoundException("User not found"); } return user.getUserSettings().getFavoriteTradingNetworkIds(); } @Override public List<String> getFavoriteCategories(String id) { User user = userRepository.findOne(id); if(user == null){ throw new NotFoundException("User not found"); } return user.getUserSettings().getFavoriteCategoryIds(); } @Override public void updatePersonalInformation(PersonalInformation personalInformation, String id) { User user = userRepository.findOne(id); if(user == null){ throw new NotFoundException("User not found"); } user.setPersonalInformation(personalInformation); userRepository.save(user); } @Override public Notification getNotificationSettings(String id) { User user = userRepository.findOne(id); if(user == null){ throw new NotFoundException("User not found"); } return user.getUserSettings().getNotification(); } @Override public void updateNotificationSettings(Notification notification, String id) { User user = userRepository.findOne(id); if(user == null){ throw new NotFoundException("User not found"); } user.getUserSettings().setNotification(notification); userRepository.save(user); } }
package com.iswoqqe.lox; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Interpreter implements Expr.Visitor<Object>, Stmt.Visitor<Void> { private final Map<String, Variable> globals = new HashMap<>(); Interpreter() { globals.put("clock", new Variable(new Callable() { @Override public Object call(Interpreter interpreter, List<Object> arguments) { return (double) System.currentTimeMillis() / 1000; } @Override public int arity() { return 0; } @Override public String toString() { return "<native fn: clock()>"; } })); globals.put("print", new Variable(new Callable() { @Override public Object call(Interpreter interpreter, List<Object> arguments) { if (arguments.get(0) == null) { System.out.println("nil"); } else { System.out.println(arguments.get(0).toString()); } return null; } @Override public int arity() { return 1; } @Override public String toString() { return "<native fn: print()>"; } })); } void interpret(List<Stmt> statements) { try { for (Stmt statement : statements) { execute(statement); } } catch (RuntimeError error) { Lox.runtimeError(error); } } void interpret(Stmt statement) { try { execute(statement); } catch (RuntimeError error) { Lox.runtimeError(error); } } void defineNewGlobals(Map<String, Variable> newGlobals) { for (Map.Entry<String, Variable> entry : newGlobals.entrySet()) { globals.put(entry.getKey(), entry.getValue()); } } Map<String, Variable> getGlobalsRef() { return globals; } /* void interpretInEnvironment(Stmt stmt, Environment environment) { Environment previous = this.environment; this.environment = environment; try { execute(stmt); } catch (RuntimeError error) { Lox.runtimeError(error); } finally { this.environment = previous; } } */ @Override public Void visitReturnStmt(Stmt.Return stmt) { Object value = null; if (stmt.expression != null) { value = evaluate(stmt.expression); } throw new Return(value); } @Override public Void visitWhileStmt(Stmt.While stmt) { while (isTruthy(evaluate(stmt.condition))) { execute(stmt.statement); } return null; } @Override public Void visitIfStmt(Stmt.If stmt) { if (isTruthy(evaluate(stmt.condition))) { execute(stmt.thenBranch); } else if (stmt.elseBranch != null) { execute(stmt.elseBranch); } return null; } @Override public Void visitBlockStmt(Stmt.Block stmt) { for (Stmt statement : stmt.statements) { execute(statement); } return null; } @Override public Void visitVarStmt(Stmt.Var stmt) { stmt.resolved.value = evaluate(stmt.initializer); return null; } @Override public Void visitExpressionStmt(Stmt.Expression stmt) { evaluate(stmt.expression); return null; } @Override public Void visitPrintStmt(Stmt.Print stmt) { Object val = evaluate(stmt.expression); System.out.println(stringify(val)); return null; } @Override public Object visitFunctionExpr(Expr.Function expr) { return new Function(expr); } @Override public Object visitCallExpr(Expr.Call expr) { Object callee = evaluate(expr.callee); if (!(callee instanceof Callable)) { throw new RuntimeError(expr.paren, "Can only call functions."); } Callable function = (Callable) callee; if (function.arity() != expr.arguments.size()) { throw new RuntimeError(expr.paren, "Expected " + function.arity() + " arguments but got " + expr.arguments.size() + "."); } List<Object> arguments = new ArrayList<>(); for (Expr e : expr.arguments) { arguments.add(evaluate(e)); } return function.call(this, arguments); } @Override public Object visitOrExpr(Expr.Or expr) { Object val = evaluate(expr.left); if (isTruthy(val)) { return val; } return evaluate(expr.right); } @Override public Object visitAndExpr(Expr.And expr) { Object val = evaluate(expr.left); if (!isTruthy(val)) { return val; } return evaluate(expr.right); } @Override public Object visitAssignExpr(Expr.Assign expr) { expr.resolved.value = evaluate(expr.value); return expr.resolved.value; } @Override public Object visitVarExpr(Expr.Var expr) { return expr.resolved.value; } @Override public Object visitBinaryExpr(Expr.Binary expr) { Object left = evaluate(expr.left); Object right = evaluate(expr.right); switch (expr.operator.type) { case COMMA: return right; case MINUS: checkNumbers(expr.operator, left, right); return (double) left - (double) right; case STAR: checkNumbers(expr.operator, left, right); return (double) left * (double) right; case SLASH: checkNumbers(expr.operator, left, right); return (double) left / (double) right; case PLUS: if (left instanceof Double && right instanceof Double) { return (double) left + (double) right; } if (left instanceof String && right instanceof String) { return (String) left + right; } throw new RuntimeError(expr.operator, "Operands must be numbers or strings."); case GREATER: checkNumbers(expr.operator, left, right); return (double)left > (double)right; case GREATER_EQUAL: checkNumbers(expr.operator, left, right); return (double)left >= (double)right; case LESS: checkNumbers(expr.operator, left, right); return (double)left < (double)right; case LESS_EQUAL: checkNumbers(expr.operator, left, right); return (double)left <= (double)right; case BANG_EQUAL: return !isEqual(left, right); case EQUAL_EQUAL: return isEqual(left, right); } return null; } @Override public Object visitGroupingExpr(Expr.Grouping expr) { return evaluate(expr.expression); } @Override public Object visitLiteralExpr(Expr.Literal expr) { return expr.value; } @Override public Object visitTernaryExpr(Expr.Ternary expr) { Object condition = evaluate(expr.condition); if (isTruthy(condition)) { return evaluate(expr.trueBranch); } else { return evaluate(expr.falseBranch); } } @Override public Object visitUnaryExpr(Expr.Unary expr) { Object right = evaluate(expr.right); switch(expr.operator.type) { case MINUS: checkNumber(expr.operator, right); return -(double) right; case BANG: checkNumber(expr.operator, right); return !isTruthy(right); } return null; } private void execute(Stmt stmt) { stmt.accept(this); } private Object evaluate(Expr expr) { return expr.accept(this); } private String stringify(Object obj) { if (obj == null) { return "nil"; } return obj.toString(); } private boolean isTruthy(Object val) { if (val == null) { return false; } if (val instanceof Boolean) { return (boolean) val; } return true; } private boolean isEqual(Object a, Object b) { if (a == null && b == null) { return true; } if (a == null) { return false; } return a.equals(b); } private void checkNumber(Token operator, Object operand) { if (operand instanceof Double) { return; } throw new RuntimeError(operator, "Operand must be a number."); } private void checkNumbers(Token operator, Object left, Object right) { if (left instanceof Double && right instanceof Double) { return; } throw new RuntimeError(operator, "Operands must be numbers."); } }
package com.rofour.baseball.dao.user.bean; import com.rofour.baseball.controller.model.BasePage; import java.io.Serializable; /** * @ClassName: UserSmsModelBean * @Description: 用户短信模板实体类 * @author 王伟 * @date 2016年3月29日 上午11:15:56 * */ public class UserSmsModelBean extends BasePage implements Serializable { private static final long serialVersionUID = -5528393730634950279L; /** * 用户短信模版主键ID */ private Long smsModelId; /** * 用户ID */ private Long userId; /** * 模板名称 */ private String templateName; /** * 模板内容 */ private String modelContent; public String getEndDate() { return endDate; } public void setEndDate(String endDate) { this.endDate = endDate; } public String getStartDate() { return startDate; } public void setStartDate(String startDate) { this.startDate = startDate; } private String endDate; private String startDate; public String getSubmitTime() { return submitTime; } public void setSubmitTime(String submitTime) { this.submitTime = submitTime; } public String getSmsCount() { return smsCount; } public void setSmsCount(String smsCount) { this.smsCount = smsCount; } private String submitTime; private String smsCount; public UserSmsModelBean(Long smsModelId, Long userId,String templateName,String modelContent) { this.smsModelId = smsModelId; this.userId = userId; this.templateName=templateName; this.modelContent = modelContent; } public UserSmsModelBean() { super(); } public Long getSmsModelId() { return smsModelId; } public void setSmsModelId(Long smsModelId) { this.smsModelId = smsModelId; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public String getTemplateName() { return templateName; } public void setTemplateName(String templateName) { this.templateName = templateName; } public String getModelContent() { return modelContent; } public void setModelContent(String modelContent) { this.modelContent = modelContent == null ? null : modelContent.trim(); } }
package com.tianlang.dao; import com.tianlang.jdbcutil.JDBCUtil; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class ProvinceDao { public String queryProvinceById(Integer provinceId){ String sql = "select name from province where province = ?"; JDBCUtil util = new JDBCUtil(); util.getConnection(); PreparedStatement preparedStatement = util.getPrepareStatement(sql); ResultSet resultSet =null; String name = ""; try { preparedStatement.setInt(1,provinceId); resultSet = preparedStatement.executeQuery(); while (resultSet.next()){ name = resultSet.getString("name"); } } catch (SQLException e) { e.printStackTrace(); }finally { util.close(resultSet); } return name; } }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.com.univag.logic; import br.com.univag.controller.Logica; import br.com.univag.dominio.StatusMovimento; import br.com.univag.dominio.StatusMovimentoExibir; import br.com.univag.dominio.StatusVeiculo; import br.com.univag.dominio.TipoMsg; import br.com.univag.exception.ConexaoException; import br.com.univag.exception.DaoException; import br.com.univag.exception.ServiceException; import br.com.univag.model.GuaritaVo; import br.com.univag.model.MovimentoVo; import br.com.univag.model.UsuarioLogadoVo; import br.com.univag.model.UsuarioVo; import br.com.univag.model.VeiculoVo; import br.com.univag.service.MovimentoVeiculoService; import br.com.univag.service.VeiculoService; import br.com.univag.util.Mensagem; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.Calendar; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author CRISTIANO */ public class RegistrarMovimentoVeiculoLogic implements Logica { Mensagem mensagem = new Mensagem(); MovimentoVeiculoService service = new MovimentoVeiculoService(); VeiculoService veiculoService = new VeiculoService(); Connection con; @Override public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { mensagem.setRequest(request); String logica = request.getParameter("logica"); String placa = request.getParameter("placaVeiculo"); if (placa == null && logica == null) { return "sistema/veiculoView.jsp"; } if (placa != null) { placa = placa.trim(); con = (Connection) request.getAttribute("connection"); veiculoService.setCon(con); try { VeiculoVo vo = veiculoService.selectVeiculoByPlaca(removerMascara(placa).toUpperCase()); if (vo != null) { return "Controller?acao=atualizarInserirVeiculo&codigo=" + vo.getCodigo(); } } catch (DaoException ex) { Logger.getLogger(RegistrarMovimentoVeiculoLogic.class.getName()).log(Level.SEVERE, null, ex); } } if (logica.equals("cadastrarVeiculo")) { UsuarioLogadoVo usuarioLogado = new UsuarioLogadoVo(); VeiculoVo veiculo = new VeiculoVo(); MovimentoVo movimento = new MovimentoVo(); HttpSession session = ((HttpServletRequest) request).getSession(); usuarioLogado = (UsuarioLogadoVo) session.getAttribute("usuarioLogado"); movimento.setUsuario(new UsuarioVo(usuarioLogado.getCodigoUser())); movimento.setGuarita(new GuaritaVo(usuarioLogado.getCodigoGuarita())); movimento.setStatus(StatusMovimento.ENTRADA.getValor()); movimento.setStatus_movimento(StatusMovimentoExibir.ATIVO.getValor()); veiculo.setPlaca(removerMascara(placa).toUpperCase()); veiculo.setStatus(StatusVeiculo.ATIVO.getValor()); try { service.cadastrarMovimentoVeiculoVo(movimento, veiculo); mensagem.message(TipoMsg.INFORMAÇÃO, "Veículo de placa "+ service.maskaraPlca(veiculo.getPlaca()) +" cadastrado com sucesso"); } catch (DaoException | SQLException | ServiceException | ConexaoException | ClassNotFoundException ex) { Logger.getLogger(RegistrarMovimentoVeiculoLogic.class.getName()).log(Level.SEVERE, null, ex); } } return "sistema/veiculoView.jsp"; } public String removerMascara(String str) { str = str.trim(); return str.replaceAll("[^a-zA-Z0-9 ]", ""); } }
package com.bin.progressbar; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Menu; import android.view.MenuItem; import android.widget.ProgressBar; public class MainActivity extends Activity { int status=0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ProgressBar bar=(ProgressBar) findViewById(R.id.bar); //创建一个负责更新进度的Handler final Handler handler=new Handler(){ public void handleMessage(android.os.Message msg) { switch(msg.what){ case 1: bar.setProgress(status); status+=10; break; default: break; } } }; //启动线程来执行任务 new Thread(){ public void run() { while(status<=100){ try { Thread.sleep(1000L); Message message=new Message(); message.what=1; handler.sendMessage(message); } catch (InterruptedException e) { e.printStackTrace(); } } } }.start(); } }
package example.nz.org.take.compiler.userv.generated; /** * Class generated by the take compiler. * This class represents the predicate hasSidePanelAirbags * @version Mon Feb 11 13:49:16 NZDT 2008 */ public class hasSidePanelAirbags { public example.nz.org.take.compiler.userv.domainmodel.Car slot1; public hasSidePanelAirbags( example.nz.org.take.compiler.userv.domainmodel.Car slot1) { super(); this.slot1 = slot1; } public hasSidePanelAirbags() { super(); } }
package fr.mb.volontario.business; import fr.mb.volontario.business.contract.MissionManager; import fr.mb.volontario.dao.contract.InscriptionDAO; import fr.mb.volontario.model.bean.Benevole; import fr.mb.volontario.model.bean.Inscription; import fr.mb.volontario.model.bean.Mission; import fr.mb.volontario.model.exception.FunctionalException; import fr.mb.volontario.model.exception.NotFoundException; import fr.mb.volontario.model.recherche.RechercheMission; import freemarker.template.TemplateException; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.mail.MessagingException; import javax.transaction.Transactional; import java.io.IOException; import java.util.List; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations= {"/ApplicationContextIntegrationTestManager.xml"}) public class MissionManagerTest { @Autowired MissionManager missionManager; @Autowired InscriptionDAO inscriptionDAO; @Test public void initContext(){ } @Test @Transactional @Rollback public void addUserToMissionTest() throws NotFoundException, FunctionalException { try{ missionManager.addUserToMission("Carole", 1); } catch (FunctionalException e){ Assert.assertTrue(e.getMessage().equals("il n'y a plus de place disponible")); } try{ missionManager.addUserToMission("Morgan", 2); } catch (FunctionalException e){ Assert.assertTrue(e.getMessage().equals("L'utilisateur est déjà inscrit à cette mission")); } missionManager.addUserToMission("Carole", 2); Inscription inscription = inscriptionDAO.findById(2).orElseThrow(NotFoundException::new); Boolean verif = false; for (Benevole bene: inscription.getBenevoles() ) { if(bene.getUser().getIdentifiant().equals("Carole")) verif=true; } Assert.assertTrue(verif); } @Test @Transactional @Rollback public void deleteUserFromMissionTest() throws NotFoundException, FunctionalException { missionManager.deleteUserFromMission("Morgan", 1); Inscription inscription = inscriptionDAO.findById(1).orElseThrow(NotFoundException::new); Boolean verif = false; for (Benevole bene: inscription.getBenevoles() ) { if(bene.getUser().getIdentifiant().equals("Morgan")) verif=true; } Assert.assertFalse(verif); } @Test @Rollback public void rechercheMissionTest() throws FunctionalException { RechercheMission recherche = new RechercheMission(); recherche.getDomaine().add(1); recherche.getDisponibilite().add(1); recherche.setCommune("Muret"); recherche.setDepartement("31, Haute-Garonne, Occitanie (Midi-Pyrénées)"); List<Mission> listTest = missionManager.rechercheMission(recherche); Assert.assertTrue("liste non vide",!listTest.isEmpty()); recherche=null; try { listTest = missionManager.rechercheMission(recherche); } catch (Exception e){ Assert.assertEquals("Une erreur est parvenue dans la recherche",e.getMessage()); } } @Test @Rollback public void findDepartementTest() throws NotFoundException { List<String> listDep = missionManager.findDepartement(); Assert.assertEquals(2, listDep.size()); } @Test @Rollback public void findCommuneTest() throws NotFoundException { String departement = "69, Rhône, Auvergne-Rhône-Alpes (Rhône-Alpes)"; List<String> listCom = missionManager.findCommune(departement); Assert.assertEquals(1, listCom.size()); } @Test @Rollback public void findMissionByIdTest() throws NotFoundException, FunctionalException { Mission mission = missionManager.getMissionById(1); Assert.assertEquals("Assistante Maison Retraite",mission.getNom()); try{ mission = missionManager.getMissionById(4562); } catch (NotFoundException e){ Assert.assertEquals("Mission non trouvée",e.getMessage()); } try{ mission = missionManager.getMissionById(0); } catch (FunctionalException e){ Assert.assertEquals("erreur de donnée, l'id est incorrect",e.getMessage()); } } }
package com.lea.proj.service.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.lea.proj.dao.RefundMapper; import com.lea.proj.model.Refund; import com.lea.proj.model.RefundExample; import com.lea.proj.model.common.ConditionVo; import com.lea.proj.model.common.Select2Vo; import com.lea.proj.service.RefundService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service("refundService") public class RefundServiceImpl implements RefundService { @Autowired private RefundMapper refundMapper; @Override public PageInfo<Refund> getDataByPage(Integer pageNum, Integer pageSize) { PageHelper.startPage(pageNum, pageSize); RefundExample example = new RefundExample(); List<Refund> refundList = refundMapper.selectByExample(example); PageInfo result = new PageInfo(refundList); return result; } @Override public void importExcel(List<Refund> refundList) { for (Refund refund : refundList) { refundMapper.saveOrUpdate(refund); } } @Override public List<Select2Vo> getAllOrderId() { List<String> ids = refundMapper.getAllOrderId(); List<Select2Vo> result = new ArrayList<>(); Select2Vo first = new Select2Vo(); first.setId(""); first.setText("全部"); result.add(first); for (String id : ids) { Select2Vo vo = new Select2Vo(); vo.setId(id); vo.setText(id); result.add(vo); } return result; } @Override public List<Refund> getAll() { RefundExample example = new RefundExample(); return refundMapper.selectByExample(example); } @Override public PageInfo<Refund> selectByConditions(Integer pageNum, Integer pageSize, Long id, String startTime, String endTime) { PageHelper.startPage(pageNum, pageSize); ConditionVo vo = new ConditionVo(id, startTime, endTime); List<Refund> refundList = refundMapper.selectByConditions(vo); PageInfo result = new PageInfo(refundList); return result; } }
package sse.tongji.edu.cluster.dataaccess.intf; import org.json.JSONArray; public interface IShowClusterHistoryDao { JSONArray getDataInfo(); JSONArray getData(int id); }
package main.zad2; public class ArraySizeOutOfRangeException extends Exception { ArraySizeOutOfRangeException(String message) { super(message); } }
package com.realcom.helloambulance.controller; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.Principal; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.commons.codec.binary.Base64; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.password.PasswordEncoder; 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 org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.servlet.ModelAndView; import com.realcom.helloambulace.constants.AppConstants; import com.realcom.helloambulance.pojo.AmbulanceRegistration; import com.realcom.helloambulance.pojo.DoctorRegistration; import com.realcom.helloambulance.pojo.HospitalRegistration; import com.realcom.helloambulance.pojo.VendorUploadImage; import com.realcom.helloambulance.services.HospitalService; import com.realcom.helloambulance.services.MailService; import com.realcom.helloambulance.services.UploadServices; import com.realcom.helloambulance.services.VendorServices; import com.realcom.helloambulance.util.ApplicationsUtil; @Controller @RequestMapping(value = "/vendor") public class VendorHomePageController { @Autowired VendorServices vendorServices; @Autowired private MailService mailService; @Autowired PasswordEncoder passwordencoder; @Autowired UploadServices uploadServices; @Autowired private HospitalService hospitalService; // ################ Vendor After Login (Narendra) ###################### @RequestMapping(value = "/") public ModelAndView vendorhomepage(ModelAndView model, HttpServletRequest request, HttpSession httpsession) throws UnsupportedEncodingException { String emailId = ApplicationsUtil.addUserName(request); Integer vendorcount = vendorServices.getCountOfEmailInVendor(emailId); Integer doctorcount = vendorServices.getCountOfEmailInDoctor(emailId); Integer ambulanceCount = vendorServices.getCountOfEmailInAmbulance(emailId); System.out.println("vendorcount" + vendorcount); System.out.println("doctorcount" + doctorcount); System.out.println("ambulanceCount" + ambulanceCount); if (vendorcount == 1) { int vendorId = vendorServices.getLoginUserId(emailId); String vendorGender = vendorServices.getVendorGender(vendorId); String vendorRole = vendorServices.getVendorRole(vendorId); String[] role = vendorRole.split("_"); String roleas = role[2]; String image = null; /// for profile pic Boolean vendorExist = uploadServices.DoctorExistOrNot(vendorId); if (vendorExist != false) { byte[] blob = uploadServices.getImagevendordoctor(vendorId); byte[] encodeBase64 = Base64.encodeBase64(blob); image = new String(encodeBase64, "UTF-8"); System.out.println(image + "image from controller"); httpsession.setAttribute("image", image); model.setViewName("vendoras" + roleas.toLowerCase()); } /// end pic else { model.setViewName("vendoras" + roleas.toLowerCase()); } httpsession.setAttribute("gender", vendorGender); return model; } if (doctorcount == 1) { model.setViewName("doctorpage"); } if (ambulanceCount == 1) { model.setViewName("ambulancepage"); } return model; } @RequestMapping(value = "/vendor/logout", method = RequestMethod.POST) // to vendor log out public ModelAndView vendorLogout(ModelAndView model) { model.setViewName("main-page"); return model; } @RequestMapping(value = "/hosreg", method = RequestMethod.POST) // to vendor log out public ModelAndView HospitalRegistration(ModelAndView model) { model.setViewName("hosreg"); return model; } @RequestMapping(value = "/ambulance_registration", method = RequestMethod.GET) // to vendor log out public ModelAndView AmbulanceRegistrationforambulance(ModelAndView model) { model.setViewName("ambulance_registration"); return model; } // ############## open Vendor page Based On Role when Login (Narendra) ##################### @RequestMapping(value = "/registration") public ModelAndView DoctorRegistration(ModelAndView model, HttpServletRequest request) { String emailId = ApplicationsUtil.addUserName(request); int vendorId = vendorServices.getLoginUserId(emailId); System.out.println(vendorId+"vendorId"); String vendorRole = vendorServices.getVendorRole(vendorId); if (vendorRole.equals(AppConstants.ROLE_DOCTOR)) { Boolean doctorStatus = vendorServices.getDoctorStatus(vendorId); if (doctorStatus == true) { model.setViewName("vendorasdoctor"); } else model.setViewName("doctor_registration"); } if (vendorRole.equals(AppConstants.ROLE_AMBULANCE)) { Boolean doctorStatus = vendorServices.getambulanceStatus(vendorId); if (doctorStatus == true) { model.setViewName("vendorasambulance"); } else model.setViewName("ambulance_registration"); } if (vendorRole.equals(AppConstants.ROLE_HOSPITAL)) { Boolean doctorStatus = hospitalService.gethospitalStatus(vendorId); if (doctorStatus == true) { model.setViewName("vendorashospital"); } else { model.setViewName("hospital_registration"); } } return model; } // ################# Get Profile Details (Vijay) #################### @RequestMapping(value = "/getProfileDetails", method = RequestMethod.GET) public @ResponseBody Map<String, Object> getProfileDetails(HttpServletRequest request) { Principal principal = request.getUserPrincipal(); System.out.println(principal.getName()); Map<String, Object> obj = vendorServices.getProfileDetails(principal.getName()); System.out.println(obj + "in controller"); request.setAttribute("profile", obj); return obj; } @RequestMapping(value = "/DoctorProfile") // to map add user family or frndslist (viewpage) public ModelAndView getDoctorProfileDetails(ModelAndView model, HttpSession httpsession, HttpServletRequest request) { String emailId = ApplicationsUtil.addUserName(request); System.out.println(emailId + "vendorcontroller"); int vendorId = vendorServices.getLoginUserId(emailId); List<DoctorRegistration> doctordetails = vendorServices.getDoctorProfileDetails(vendorId); System.out.println(doctordetails + "doctor details"); httpsession.setAttribute("Doctordetails", doctordetails); model.setViewName("DoctorProfile"); return model; } @RequestMapping(value = "/HospitalProfile") // to map add user family or frndslist (viewpage) public ModelAndView getHospitalProfileDetails(ModelAndView model, HttpSession httpsession, HttpServletRequest request) { String emailId = ApplicationsUtil.addUserName(request); System.out.println(emailId + "vendorcontroller"); int vendorId = vendorServices.getLoginUserId(emailId); List<HospitalRegistration> hospitaldetails = vendorServices.getHospitalProfileDetails(vendorId); System.out.println(hospitaldetails + "hospital details"); httpsession.setAttribute("Hospitaldetails", hospitaldetails); model.setViewName("HospitalProfile"); return model; } //////////////////////////Doctor Extra Details(vijay)//////////// @RequestMapping(value = "/add_details", method = RequestMethod.GET) // to vendor log out public ModelAndView addDoctorDetails(ModelAndView model) { model.setViewName("add_details"); return model; } @RequestMapping(value = "/upload_profile_pic_Doctor") public ModelAndView UploadImageDoctor(ModelAndView model) throws IOException { model.setViewName("upload-profile-pic"); return model; } /* @RequestMapping(value = "/upload_profile_pic_Ambulance") public ModelAndView UploadImageAmbulance(ModelAndView model) throws IOException { model.setViewName("upload-image"); return model; } @RequestMapping(value = "/upload_profile_pic_Hospital") public ModelAndView UploadImagehospital(ModelAndView model) throws IOException { model.setViewName("upload-profile"); return model; }*/ @RequestMapping(value = "/uploadfile",method=RequestMethod.POST) public ModelAndView saveUploadImage(HttpServletRequest request,VendorUploadImage uploadimage, final @RequestParam CommonsMultipartFile[] attachFileObj) { String Email_Id = ApplicationsUtil.addUserName(request); System.out.println(Email_Id); System.out.println("varma method"); int vendorId = vendorServices.getLoginUserId(Email_Id); ; System.out.println(vendorId); Boolean userExist = uploadServices.DoctorExistOrNot(vendorId); String image_name = request.getParameter("image_name"); if ((attachFileObj != null) && (attachFileObj.length > 0) && (!attachFileObj.equals(""))) { for (CommonsMultipartFile aFile : attachFileObj) { if(aFile.isEmpty()) { continue; } else { System.out.println("Attachment Name?= " + aFile.getOriginalFilename() + "\n"); if (!aFile.getOriginalFilename().equals("")) { //UploadImage uploadimage = new UploadImage(); uploadimage.setFile_name(aFile.getOriginalFilename()); uploadimage.setImageName(image_name); uploadimage.setVendor_id(vendorId);//for getting foreign key uploadimage.setData(aFile.getBytes()); // Calling The database Method To Save The Uploaded File In The Db if(userExist!=true) { uploadServices.saveDoctorUploadImage(uploadimage); }if(userExist==true) { uploadServices.UpdateDoctorUploadImage(uploadimage,vendorId); } System.out.println("ok " ); }else { System.out.println("error"); } } System.out.println("File Is Successfully Uploaded.... \n"); } } else { } ModelAndView modelViewObj = new ModelAndView("uploadsuccess"); return modelViewObj; } //################################## Our Ambulances In Ambulance Page(view profile & Edit Profile) (Narendra) ############################################ @RequestMapping(value = "/listof-Ambulances") public ModelAndView getAmbulanceProfileDetails(ModelAndView model) { model.setViewName("listofAmbulances"); return model; } @RequestMapping(value = "/listOfAmbulanceForAmbulance") public @ResponseBody List<AmbulanceRegistration> getAmbulanceListByVendorId(HttpServletRequest request) { String emailId = ApplicationsUtil.addUserName(request); int vendorId = vendorServices.getLoginUserId(emailId); List<AmbulanceRegistration> ambulancedetails = vendorServices.getAmbulanceProfileDetails(vendorId); return ambulancedetails; } @RequestMapping(value="/getAmbulanceProfileDetialsById") public ModelAndView getAmbulanceDetialsInAmbulancePage(@RequestParam("register_ambulance_id") int register_ambulance_id,ModelAndView model) { AmbulanceRegistration ambulance = vendorServices.getAmbulanceProfileDetialsById(register_ambulance_id); System.out.println("ambulance"+ambulance); ambulance.setRegister_ambulance_id(register_ambulance_id); model.addObject("ambulance", ambulance); model.setViewName("ambulanceprofiledetails"); return model; } //************************************** Our Ambulances In Ambulance Page Completed ********************************************* //############################ Add Multiple Ambulances In Ambulance Page (Narendra) ############################### @RequestMapping(value = "/ambreg", method = RequestMethod.GET) // to vendor log out public ModelAndView AmbulanceRegistration(ModelAndView model) { model.setViewName("ambreg"); return model; } @RequestMapping(value="/addAmbulancesforAmbulance",method=RequestMethod.POST) public String ambulanceRegistrationInAmbulance(AmbulanceRegistration ambulance,HttpServletRequest request) { System.out.println(ambulance+"ambulance"); String emailId = ApplicationsUtil.addUserName(request); int vendorId = vendorServices.getLoginUserId(emailId); vendorServices.ambulanceRegistrationInAmbulance(ambulance,vendorId); mailService.sendMailForAmbulancPasswordInAmbulance(ambulance.getEmail_id()); return "hospitalSuccess"; } @RequestMapping(value="ambulanceSuccessInAmbulance") public String ambulanceSuccessInAmbulance() { return "ambulanceSuccessInAmbulance"; } //******************************* Add Multiple Ambulances In Ambulance Page ********************************** //############################ New Password For Ambulance in AmbulancePage (Narendra) ################################ @RequestMapping(value="/newPasswordforAmbulanceInAmbulance/{email_id}") public String newPasswordforAmbulanceInAmbulance(@PathVariable String email_id,Map<String,String> model) { //check if the email id is valid and registered with us. model.put("email_id", email_id); return "setPasswordforAmbulanceInAmbulance"; } @RequestMapping(value = "/setAmbulancepasswordInAmbulanceSuccess", method=RequestMethod.POST) public ModelAndView setAmbulancepasswordInAmbulanceSuccess(ModelAndView model, @RequestParam("email_id") String email_id, @RequestParam("password") String password) { vendorServices.setPasswordForAmbulance(email_id, password); model.setViewName("setpasswordforAmbulanceSuccess"); return model; } //************************************** New Password For Ambulance in AmbulancePage Completed *************************** //################################## Delete Selected Ambulance in Ambulance Page (Narendra) ######################### @RequestMapping("/deleteAmbulanceInAmbulance") public ModelAndView deleteAmbulanceInAmbulance(@RequestParam("register_ambulance_id") int register_ambulance_id,ModelAndView model) { vendorServices.deleteAmbulanceInAmbulance(register_ambulance_id); model.setViewName("redirect:ourAmbulancesforHospital"); return model; } }
package com.tencent.smtt.sdk; import android.annotation.TargetApi; import android.content.Context; import android.os.Build.VERSION; import android.os.Bundle; import android.os.Handler; import android.text.TextUtils; import android.util.Log; import com.tencent.mm.plugin.appbrand.s$l; import com.tencent.smtt.sdk.TbsLogReport.EventType; import com.tencent.smtt.utils.Apn; import com.tencent.smtt.utils.TbsLog; import com.tencent.smtt.utils.a; import com.tencent.smtt.utils.b; import com.tencent.smtt.utils.j; import com.tencent.smtt.utils.v; import java.io.BufferedReader; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.URL; import java.util.HashSet; import java.util.Set; class ag { private static int d = 5; private static int e = 1; private static final String[] f = new String[]{"tbs_downloading_com.tencent.mtt", "tbs_downloading_com.tencent.mm", "tbs_downloading_com.tencent.mobileqq", "tbs_downloading_com.tencent.tbs", "tbs_downloading_com.qzone"}; private Set<String> A; private int B = d; private boolean C; String a; String[] b = null; int c = 0; private Context g; private String h; private String i; private String j; private File k; private long l; private int m = 30000; private int n = 20000; private boolean o; private int p; private int q; private boolean r; private boolean s; private HttpURLConnection t; private String u; private TbsLogReport$TbsLogInfo v; private String w; private int x; private boolean y; private Handler z; public ag(Context context) { this.g = context.getApplicationContext(); this.v = TbsLogReport.a(this.g).a(); this.A = new HashSet(); this.u = "tbs_downloading_" + this.g.getPackageName(); an.a(); this.k = an.s(this.g); if (this.k == null) { throw new NullPointerException("TbsCorePrivateDir is null!"); } f(); this.w = null; this.x = -1; } private long a(long j, long j2) { long currentTimeMillis = System.currentTimeMillis(); this.v.setDownConsumeTime(currentTimeMillis - j); this.v.setDownloadSize(j2); return currentTimeMillis; } @TargetApi(8) static File a(Context context) { try { File file = VERSION.SDK_INT >= 8 ? new File(j.a(context, 4)) : null; if (file == null || file.exists() || file.isDirectory()) { return file; } file.mkdirs(); return file; } catch (Exception e) { TbsLog.e("TbsDownload", "[TbsApkDownloader.backupApkPath] Exception is " + e.getMessage()); return null; } } private static File a(Context context, int i) { File file = new File(j.a(context, i)); if (!file.exists() || !file.isDirectory()) { return null; } return new File(file, TbsDownloader.getOverSea(context) ? "x5.oversea.tbs.org" : "x5.tbs.org").exists() ? file : null; } private String a(Throwable th) { String stackTraceString = Log.getStackTraceString(th); return stackTraceString.length() > 1024 ? stackTraceString.substring(0, 1024) : stackTraceString; } private String a(URL url) { String str = ""; try { return InetAddress.getByName(url.getHost()).getHostAddress(); } catch (Exception e) { return str; } catch (Error e2) { return str; } } private void a(int i, String str, boolean z) { if (z || this.p > this.B) { this.v.setErrorCode(i); this.v.setFailDetail(str); } } private void a(long j) { this.p++; if (j <= 0) { try { j = m(); } catch (Exception e) { return; } } Thread.sleep(j); } private void a(Closeable closeable) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { } } } public static void a(File file, Context context) { if (file != null && file.exists()) { try { File a = a(context); if (a != null) { File file2; if (TbsDownloadConfig.getInstance(context).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V_TYPE, 0) == 1) { file2 = new File(a, "x5.tbs.decouple"); } else { file2 = new File(a, TbsDownloader.getOverSea(context) ? "x5.oversea.tbs.org" : "x5.tbs.org"); } file2.delete(); j.b(file, file2); if (TbsDownloadConfig.getInstance(context).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V_TYPE, 0) != 1 && TbsDownloadConfig.getInstance(context).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DECOUPLECOREVERSION, 0) == a.a(context, file)) { file2 = new File(a, "x5.tbs.decouple"); if (a.a(context, file) != a.a(context, file2)) { file2.delete(); j.b(file, file2); } } } } catch (Exception e) { } } } private void a(String str) { URL url = new URL(str); if (this.t != null) { try { this.t.disconnect(); } catch (Throwable th) { TbsLog.e("TbsDownload", "[initHttpRequest] mHttpRequest.disconnect() Throwable:" + th.toString()); } } this.t = (HttpURLConnection) url.openConnection(); this.t.setRequestProperty("User-Agent", TbsDownloader.a(this.g)); this.t.setRequestProperty("Accept-Encoding", "identity"); this.t.setRequestMethod("GET"); this.t.setInstanceFollowRedirects(false); this.t.setConnectTimeout(this.n); this.t.setReadTimeout(this.m); } @TargetApi(8) static File b(Context context) { try { if (VERSION.SDK_INT < 8) { return null; } File a = a(context, 4); if (a == null) { a = a(context, 3); } if (a == null) { a = a(context, 2); } return a == null ? a(context, 1) : a; } catch (Exception e) { TbsLog.e("TbsDownload", "[TbsApkDownloader.backupApkPath] Exception is " + e.getMessage()); return null; } } private void b(boolean z) { v.a(this.g); TbsDownloadConfig instance = TbsDownloadConfig.getInstance(this.g); instance.a.put(TbsDownloadConfig$TbsConfigKey.KEY_FULL_PACKAGE, Boolean.valueOf(false)); instance.a.put(TbsDownloadConfig$TbsConfigKey.KEY_NEEDDOWNLOAD, Boolean.valueOf(false)); instance.a.put(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOAD_INTERRUPT_CODE_REASON, Integer.valueOf(-123)); instance.commit(); QbSdk.m.onDownloadFinish(z ? 100 : 120); int i = instance.mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_RESPONSECODE, 0); TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOADDECOUPLECORE, 0); if (i == 3 || i > 10000) { File a = a(this.g); if (a != null) { File file = new File(a, TbsDownloader.getOverSea(this.g) ? "x5.oversea.tbs.org" : "x5.tbs.org"); int a2 = a.a(this.g, file); File file2 = new File(this.k, "x5.tbs"); String absolutePath = file2.exists() ? file2.getAbsolutePath() : null; int i2 = instance.mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V, 0); Bundle bundle = new Bundle(); bundle.putInt("operation", i); bundle.putInt("old_core_ver", a2); bundle.putInt("new_core_ver", i2); bundle.putString("old_apk_location", file.getAbsolutePath()); bundle.putString("new_apk_location", absolutePath); bundle.putString("diff_file_location", absolutePath); an.a().b(this.g, bundle); return; } d(); instance.a.put(TbsDownloadConfig$TbsConfigKey.KEY_NEEDDOWNLOAD, Boolean.valueOf(true)); instance.commit(); return; } an.a().a(this.g, new File(this.k, "x5.tbs").getAbsolutePath(), instance.mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V, 0)); a(new File(this.k, "x5.tbs"), this.g); } private boolean b(int i) { try { File file = new File(this.k, "x5.tbs"); File a = a(this.g); if (a == null) { return false; } File file2 = new File(a, TbsDownloader.getOverSea(this.g) ? "x5.oversea.tbs.org" : "x5.tbs.org"); file.delete(); j.b(file2, file); if (a.a(this.g, file, 0, i)) { return true; } TbsLog.i("TbsDownload", "[TbsApkDownloader.copyTbsApkFromBackupToInstall] verifyTbsApk error!!"); return false; } catch (Exception e) { TbsLog.e("TbsDownload", "[TbsApkDownloader.copyTbsApkFromBackupToInstall] Exception is " + e.getMessage()); return false; } } public static void c(Context context) { try { an.a(); File s = an.s(context); new File(s, "x5.tbs").delete(); new File(s, "x5.tbs.temp").delete(); s = a(context); if (s != null) { new File(s, "x5.tbs.org").delete(); new File(s, "x5.oversea.tbs.org").delete(); } } catch (Exception e) { } } private boolean c(boolean z) { TbsLog.i("TbsDownload", "[TbsApkDownloader.deleteFile] isApk=" + z); File file = z ? new File(this.k, "x5.tbs") : new File(this.k, "x5.tbs.temp"); return file.exists() ? file.delete() : true; } private boolean c(boolean z, boolean z2) { long j = 0; TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] isTempFile=" + z); File file = new File(this.k, !z ? "x5.tbs" : "x5.tbs.temp"); if (!file.exists()) { return false; } String string = TbsDownloadConfig.getInstance(this.g).mPreferences.getString(TbsDownloadConfig$TbsConfigKey.KEY_TBSAPK_MD5, null); String a = a.a(file); if (string == null || !string.equals(a)) { TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] isTempFile=" + z + " md5 failed"); if (!z) { return false; } this.v.setCheckErrorDetail("fileMd5 not match"); return false; } boolean renameTo; TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] md5(" + a + ") successful!"); if (z) { long j2; long j3 = TbsDownloadConfig.getInstance(this.g).mPreferences.getLong(TbsDownloadConfig$TbsConfigKey.KEY_TBSAPKFILESIZE, 0); if (!file.exists()) { j2 = 0; } else if (j3 > 0) { j2 = file.length(); if (j3 == j2) { j = j2; } } TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] isTempFile=" + z + " filelength failed"); this.v.setCheckErrorDetail("fileLength:" + j2 + ",contentLength:" + j3); return false; } TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] length(" + j + ") successful!"); int i = -1; if (z2 && !z) { i = a.a(this.g, file); int i2 = TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V, 0); if (i2 != i) { TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] isTempFile=" + z + " versionCode failed"); if (!z) { return false; } this.v.setCheckErrorDetail("fileVersion:" + i + ",configVersion:" + i2); return false; } } TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] tbsApkVersionCode(" + i + ") successful!"); if (z2 && !z) { string = b.a(this.g, file); if (!"3082023f308201a8a00302010202044c46914a300d06092a864886f70d01010505003064310b30090603550406130238363110300e060355040813074265696a696e673110300e060355040713074265696a696e673110300e060355040a130754656e63656e74310c300a060355040b13035753443111300f0603550403130873616d75656c6d6f301e170d3130303732313036313835305a170d3430303731333036313835305a3064310b30090603550406130238363110300e060355040813074265696a696e673110300e060355040713074265696a696e673110300e060355040a130754656e63656e74310c300a060355040b13035753443111300f0603550403130873616d75656c6d6f30819f300d06092a864886f70d010101050003818d0030818902818100c209077044bd0d63ea00ede5b839914cabcc912a87f0f8b390877e0f7a2583f0d5933443c40431c35a4433bc4c965800141961adc44c9625b1d321385221fd097e5bdc2f44a1840d643ab59dc070cf6c4b4b4d98bed5cbb8046e0a7078ae134da107cdf2bfc9b440fe5cb2f7549b44b73202cc6f7c2c55b8cfb0d333a021f01f0203010001300d06092a864886f70d010105050003818100b007db9922774ef4ccfee81ba514a8d57c410257e7a2eba64bfa17c9e690da08106d32f637ac41fbc9f205176c71bde238c872c3ee2f8313502bee44c80288ea4ef377a6f2cdfe4d3653c145c4acfedbfbadea23b559d41980cc3cdd35d79a68240693739aabf5c5ed26148756cf88264226de394c8a24ac35b712b120d4d23a".equals(string)) { TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] isTempFile=" + z + " signature failed"); if (!z) { return false; } this.v.setCheckErrorDetail("signature:" + (string == null ? "null" : Integer.valueOf(string.length()))); return false; } } TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] signature successful!"); if (z) { Throwable th; try { renameTo = file.renameTo(new File(this.k, "x5.tbs")); th = null; } catch (Throwable e) { th = e; renameTo = false; } if (!renameTo) { a(s$l.AppCompatTheme_seekBarStyle, a(th), true); return false; } } renameTo = false; TbsLog.i("TbsDownload", "[TbsApkDownloader.verifyTbsApk] rename(" + renameTo + ") successful!"); return true; } private void f() { this.p = 0; this.q = 0; this.l = -1; this.j = null; this.o = false; this.r = false; this.s = false; this.y = false; } private void g() { TbsLog.i("TbsDownload", "[TbsApkDownloader.closeHttpRequest]"); if (this.t != null) { if (!this.r) { this.v.setResolveIp(a(this.t.getURL())); } try { this.t.disconnect(); } catch (Throwable th) { TbsLog.e("TbsDownload", "[closeHttpRequest] mHttpRequest.disconnect() Throwable:" + th.toString()); } this.t = null; } int i = this.v.a; if (this.r || !this.y) { TbsDownloader.a = false; return; } this.v.setEventTime(System.currentTimeMillis()); String apnInfo = Apn.getApnInfo(this.g); if (apnInfo == null) { apnInfo = ""; } int apnType = Apn.getApnType(this.g); this.v.setApn(apnInfo); this.v.setNetworkType(apnType); if (!(apnType == this.x && apnInfo.equals(this.w))) { this.v.setNetworkChange(0); } if ((this.v.a == 0 || this.v.a == s$l.AppCompatTheme_ratingBarStyleIndicator) && this.v.getDownFinalFlag() == 0) { if (!Apn.isNetworkAvailable(this.g)) { a(s$l.AppCompatTheme_buttonStyleSmall, null, true); } else if (!l()) { a(s$l.AppCompatTheme_buttonStyleSmall, null, true); } } if (TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOADDECOUPLECORE, 0) == 1) { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD_DECOUPLE, this.v); } else { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD, this.v); } this.v.resetArgs(); if (i != 100) { QbSdk.m.onDownloadFinish(i); } } private boolean h() { File file = new File(j.a(this.g, 4), TbsDownloader.getOverSea(this.g) ? "x5.oversea.tbs.org" : "x5.tbs.org"); int i = TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_USE_BACKUP_VERSION, 0); if (i == 0) { i = TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V, 0); } return a.a(this.g, file, 0, i); } private void i() { try { if (TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOADDECOUPLECORE, 0) != 1) { File file = new File(j.a(this.g, 4), TbsDownloader.getOverSea(this.g) ? "x5.oversea.tbs.org" : "x5.tbs.org"); if (file.exists()) { file.delete(); } } } catch (Exception e) { } } private boolean j() { return new File(this.k, "x5.tbs.temp").exists(); } private long k() { File file = new File(this.k, "x5.tbs.temp"); return file.exists() ? file.length() : 0; } private boolean l() { Throwable th; boolean z = false; Closeable inputStream; Closeable inputStreamReader; Closeable bufferedReader; try { inputStream = Runtime.getRuntime().exec("ping " + "www.qq.com").getInputStream(); try { inputStreamReader = new InputStreamReader(inputStream); try { bufferedReader = new BufferedReader(inputStreamReader); int i = 0; do { try { String readLine = bufferedReader.readLine(); if (readLine == null) { break; } else if (readLine.contains("TTL") || readLine.contains("ttl")) { z = true; break; } else { i++; } } catch (Throwable th2) { th = th2; a(inputStream); a(inputStreamReader); a(bufferedReader); throw th; } } while (i < 5); a(inputStream); a(inputStreamReader); a(bufferedReader); } catch (Throwable th3) { th = th3; bufferedReader = null; a(inputStream); a(inputStreamReader); a(bufferedReader); throw th; } } catch (Throwable th4) { th = th4; bufferedReader = null; inputStreamReader = null; a(inputStream); a(inputStreamReader); a(bufferedReader); throw th; } } catch (Throwable th5) { th = th5; bufferedReader = null; inputStreamReader = null; inputStream = null; a(inputStream); a(inputStreamReader); a(bufferedReader); throw th; } return z; } private long m() { switch (this.p) { case 1: case 2: return 20000 * ((long) this.p); case 3: case 4: return 100000; default: return 200000; } } private boolean n() { CharSequence charSequence; Object charSequence2; Throwable th; HttpURLConnection httpURLConnection = null; boolean z = true; boolean z2 = false; boolean z3 = Apn.getApnType(this.g) == 3; TbsLog.i("TbsDownload", "[TbsApkDwonloader.detectWifiNetworkAvailable] isWifi=" + z3); if (z3) { String wifiSSID = Apn.getWifiSSID(this.g); TbsLog.i("TbsDownload", "[TbsApkDwonloader.detectWifiNetworkAvailable] localBSSID=" + wifiSSID); HttpURLConnection httpURLConnection2; try { httpURLConnection2 = (HttpURLConnection) new URL("http://pms.mb.qq.com/rsp204").openConnection(); try { httpURLConnection2.setInstanceFollowRedirects(false); httpURLConnection2.setConnectTimeout(10000); httpURLConnection2.setReadTimeout(10000); httpURLConnection2.setUseCaches(false); httpURLConnection2.getInputStream(); int responseCode = httpURLConnection2.getResponseCode(); TbsLog.i("TbsDownload", "[TbsApkDwonloader.detectWifiNetworkAvailable] responseCode=" + responseCode); if (responseCode != 204) { z = false; } if (httpURLConnection2 != null) { try { httpURLConnection2.disconnect(); charSequence2 = wifiSSID; z2 = z; } catch (Exception e) { charSequence2 = wifiSSID; z2 = z; } } else { charSequence2 = wifiSSID; z2 = z; } } catch (Throwable th2) { th = th2; httpURLConnection = httpURLConnection2; if (httpURLConnection != null) { try { httpURLConnection.disconnect(); } catch (Exception e2) { } } throw th; } } catch (Throwable th3) { th = th3; if (httpURLConnection != null) { try { httpURLConnection.disconnect(); } catch (Exception e22) { } } throw th; } } if (!(z2 || TextUtils.isEmpty(charSequence2) || this.A.contains(charSequence2))) { this.A.add(charSequence2); o(); this.z.sendMessageDelayed(this.z.obtainMessage(150, charSequence2), 120000); } if (z2 && this.A.contains(charSequence2)) { this.A.remove(charSequence2); } return z2; } private void o() { if (this.z == null) { this.z = new ah(this, al.a().getLooper()); } } public void a(int i) { try { File file = new File(this.k, "x5.tbs"); int a = a.a(this.g, file); if (-1 == a || (i > 0 && i == a)) { file.delete(); } } catch (Exception e) { } } public boolean a() { TbsLog.i("TbsApkDownloader", "verifyAndInstallDecoupleCoreFromBackup #1"); try { File file = new File(j.a(this.g, 4), "x5.tbs.decouple"); if (file.exists()) { TbsLog.i("TbsApkDownloader", "verifyAndInstallDecoupleCoreFromBackup #2"); } else { File b = TbsDownloader.b(TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DECOUPLECOREVERSION, -1)); if (b != null && b.exists()) { j.b(b, file); } } if (a.a(this.g, file, 0, TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DECOUPLECOREVERSION, -1))) { TbsLog.i("TbsApkDownloader", "verifyAndInstallDecoupleCoreFromBackup #3"); return an.a().e(this.g); } TbsLog.i("TbsApkDownloader", "verifyAndInstallDecoupleCoreFromBackup no backup file !!!"); file = new File(j.a(this.g, 4), "x5.tbs.decouple"); if (file.exists()) { file.delete(); } return false; } catch (Exception e) { } } public boolean a(boolean z) { if ((z && !n() && (!QbSdk.getDownloadWithoutWifi() || !Apn.isNetworkAvailable(this.g))) || this.b == null || this.c < 0 || this.c >= this.b.length) { return false; } String[] strArr = this.b; int i = this.c; this.c = i + 1; this.j = strArr[i]; this.p = 0; this.q = 0; this.l = -1; this.o = false; this.r = false; this.s = false; this.y = false; return true; } public boolean a(boolean z, boolean z2) { int i; int i2 = TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_USE_BACKUP_VERSION, 0); int i3 = an.a().i(this.g); if (i2 == 0) { i2 = TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V, 0); this.a = "by default key"; i = i2; } else { this.a = "by new key"; i = i2; } if (i == 0 || i == i3) { return false; } if (z2) { boolean z3; File a = TbsDownloader.a(i); if (a != null && a.exists()) { File file = new File(j.a(this.g, 4), TbsDownloader.getOverSea(this.g) ? "x5.oversea.tbs.org" : "x5.tbs.org"); try { if (TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_TBS_DOWNLOAD_V_TYPE, 0) != 1) { j.b(a, file); z3 = true; if (h()) { i(); if (!a.a(this.g, a, 0, i)) { j.b(a); } } else if (b(i)) { TbsDownloadConfig.getInstance(this.g).a.put(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOAD_INTERRUPT_CODE_REASON, Integer.valueOf(-214)); TbsDownloadConfig.getInstance(this.g).setDownloadInterruptCode(-214); b(false); if (!z3) { return true; } a(100, "use local backup apk in startDownload" + this.a, true); if (TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOADDECOUPLECORE, 0) == 1) { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD_DECOUPLE, this.v); } else { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD, this.v); } this.v.resetArgs(); return true; } } } catch (Exception e) { } } z3 = false; if (h()) { i(); if (!a.a(this.g, a, 0, i)) { j.b(a); } } else if (b(i)) { TbsDownloadConfig.getInstance(this.g).a.put(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOAD_INTERRUPT_CODE_REASON, Integer.valueOf(-214)); TbsDownloadConfig.getInstance(this.g).setDownloadInterruptCode(-214); b(false); if (!z3) { return true; } a(100, "use local backup apk in startDownload" + this.a, true); if (TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOADDECOUPLECORE, 0) == 1) { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD_DECOUPLE, this.v); } else { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD, this.v); } this.v.resetArgs(); return true; } } if (c(false, z2)) { TbsDownloadConfig.getInstance(this.g).a.put(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOAD_INTERRUPT_CODE_REASON, Integer.valueOf(-214)); TbsDownloadConfig.getInstance(this.g).setDownloadInterruptCode(-214); b(false); return true; } if (!(c(true) || c(true))) { TbsLog.e("TbsDownload", "[TbsApkDownloader] delete file failed!"); TbsDownloadConfig.getInstance(this.g).setDownloadInterruptCode(-301); } return false; } public int b() { File a = a(this.g); if (a == null) { return 0; } return a.a(this.g, new File(a, TbsDownloader.getOverSea(this.g) ? "x5.oversea.tbs.org" : "x5.tbs.org")); } /* JADX WARNING: inconsistent code. */ /* Code decompiled incorrectly, please refer to instructions dump. */ public void b(boolean r31, boolean r32) { /* r30 = this; r4 = com.tencent.smtt.sdk.an.a(); r0 = r30; r5 = r0.g; r4 = r4.c(r5); if (r4 == 0) goto L_0x0021; L_0x000e: if (r31 != 0) goto L_0x0021; L_0x0010: r4 = 0; com.tencent.smtt.sdk.TbsDownloader.a = r4; r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -322; // 0xfffffffffffffebe float:NaN double:NaN; r4.setDownloadInterruptCode(r5); L_0x0020: return; L_0x0021: r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4 = r4.mPreferences; r5 = "tbs_responsecode"; r6 = 0; r4 = r4.getInt(r5, r6); r5 = 1; if (r4 == r5) goto L_0x003c; L_0x0036: r5 = 2; if (r4 == r5) goto L_0x003c; L_0x0039: r5 = 4; if (r4 != r5) goto L_0x0051; L_0x003c: r4 = 1; r21 = r4; L_0x003f: if (r32 != 0) goto L_0x0055; L_0x0041: r0 = r30; r1 = r31; r2 = r21; r4 = r0.a(r1, r2); if (r4 == 0) goto L_0x0055; L_0x004d: r4 = 0; com.tencent.smtt.sdk.TbsDownloader.a = r4; goto L_0x0020; L_0x0051: r4 = 0; r21 = r4; goto L_0x003f; L_0x0055: r0 = r31; r1 = r30; r1.C = r0; r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4 = r4.mPreferences; r5 = "tbs_downloadurl"; r6 = 0; r4 = r4.getString(r5, r6); r0 = r30; r0.h = r4; r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4 = r4.mPreferences; r5 = "tbs_downloadurl_list"; r6 = 0; r4 = r4.getString(r5, r6); r5 = "TbsDownload"; r6 = new java.lang.StringBuilder; r7 = "backupUrlStrings:"; r6.<init>(r7); r6 = r6.append(r4); r6 = r6.toString(); r7 = 1; com.tencent.smtt.utils.TbsLog.i(r5, r6, r7); r5 = 0; r0 = r30; r0.b = r5; r5 = 0; r0 = r30; r0.c = r5; if (r31 != 0) goto L_0x00c4; L_0x00a6: if (r4 == 0) goto L_0x00c4; L_0x00a8: r5 = ""; r6 = r4.trim(); r5 = r5.equals(r6); if (r5 != 0) goto L_0x00c4; L_0x00b5: r5 = r4.trim(); r6 = ";"; r5 = r5.split(r6); r0 = r30; r0.b = r5; L_0x00c4: r5 = "TbsDownload"; r6 = new java.lang.StringBuilder; r7 = "[TbsApkDownloader.startDownload] mDownloadUrl="; r6.<init>(r7); r0 = r30; r7 = r0.h; r6 = r6.append(r7); r7 = " backupUrlStrings="; r6 = r6.append(r7); r4 = r6.append(r4); r6 = " mLocation="; r4 = r4.append(r6); r0 = r30; r6 = r0.j; r4 = r4.append(r6); r6 = " mCanceled="; r4 = r4.append(r6); r0 = r30; r6 = r0.r; r4 = r4.append(r6); r6 = " mHttpRequest="; r4 = r4.append(r6); r0 = r30; r6 = r0.t; r4 = r4.append(r6); r4 = r4.toString(); com.tencent.smtt.utils.TbsLog.i(r5, r4); r0 = r30; r4 = r0.h; if (r4 != 0) goto L_0x0138; L_0x011c: r0 = r30; r4 = r0.j; if (r4 != 0) goto L_0x0138; L_0x0122: r4 = com.tencent.smtt.sdk.QbSdk.m; r5 = 110; // 0x6e float:1.54E-43 double:5.43E-322; r4.onDownloadFinish(r5); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -302; // 0xfffffffffffffed2 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); goto L_0x0020; L_0x0138: r0 = r30; r4 = r0.t; if (r4 == 0) goto L_0x015a; L_0x013e: r0 = r30; r4 = r0.r; if (r4 != 0) goto L_0x015a; L_0x0144: r4 = com.tencent.smtt.sdk.QbSdk.m; r5 = 110; // 0x6e float:1.54E-43 double:5.43E-322; r4.onDownloadFinish(r5); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -303; // 0xfffffffffffffed1 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); goto L_0x0020; L_0x015a: if (r31 != 0) goto L_0x018d; L_0x015c: r0 = r30; r4 = r0.A; r0 = r30; r5 = r0.g; r5 = com.tencent.smtt.utils.Apn.getWifiSSID(r5); r4 = r4.contains(r5); if (r4 == 0) goto L_0x018d; L_0x016e: r4 = "TbsDownload"; r5 = "[TbsApkDownloader.startDownload] WIFI Unavailable"; com.tencent.smtt.utils.TbsLog.i(r4, r5); r4 = com.tencent.smtt.sdk.QbSdk.m; r5 = 110; // 0x6e float:1.54E-43 double:5.43E-322; r4.onDownloadFinish(r5); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -304; // 0xfffffffffffffed0 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); goto L_0x0020; L_0x018d: r30.f(); r4 = "TbsDownload"; r5 = "STEP 1/2 begin downloading..."; r6 = 1; com.tencent.smtt.utils.TbsLog.i(r4, r5, r6); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r24 = r4.getDownloadMaxflow(); r6 = 0; r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4 = r4.mPreferences; r5 = "tbs_downloadflow"; r8 = 0; r4 = r4.getLong(r5, r8); if (r31 == 0) goto L_0x0271; L_0x01bc: r7 = e; r0 = r30; r0.B = r7; L_0x01c2: r0 = r30; r7 = r0.p; r0 = r30; r8 = r0.B; if (r7 > r8) goto L_0x01ea; L_0x01cc: r0 = r30; r7 = r0.q; r8 = 8; if (r7 <= r8) goto L_0x0279; L_0x01d4: r4 = 123; // 0x7b float:1.72E-43 double:6.1E-322; r5 = 0; r7 = 1; r0 = r30; r0.a(r4, r5, r7); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -306; // 0xfffffffffffffece float:NaN double:NaN; r4.setDownloadInterruptCode(r5); L_0x01ea: r0 = r30; r4 = r0.r; if (r4 != 0) goto L_0x026c; L_0x01f0: r0 = r30; r4 = r0.s; if (r4 == 0) goto L_0x023d; L_0x01f6: r0 = r30; r4 = r0.b; if (r4 != 0) goto L_0x0207; L_0x01fc: if (r6 != 0) goto L_0x0207; L_0x01fe: r4 = 1; r0 = r30; r1 = r21; r6 = r0.c(r4, r1); L_0x0207: r0 = r30; r5 = r0.v; if (r6 == 0) goto L_0x0ebc; L_0x020d: r4 = 1; L_0x020e: r5.setUnpkgFlag(r4); if (r21 != 0) goto L_0x0ec2; L_0x0213: r0 = r30; r5 = r0.v; if (r6 == 0) goto L_0x0ebf; L_0x0219: r4 = 1; L_0x021a: r5.setPatchUpdateFlag(r4); L_0x021d: if (r6 == 0) goto L_0x0ecc; L_0x021f: r4 = 1; r0 = r30; r0.b(r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -317; // 0xfffffffffffffec3 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); r4 = 100; r5 = "success"; r7 = 1; r0 = r30; r0.a(r4, r5, r7); L_0x023d: r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); if (r6 == 0) goto L_0x0ee1; L_0x0247: r5 = r4.mPreferences; r7 = "tbs_download_success_retrytimes"; r8 = 0; r5 = r5.getInt(r7, r8); r7 = r4.a; r8 = "tbs_download_success_retrytimes"; r5 = r5 + 1; r5 = java.lang.Integer.valueOf(r5); r7.put(r8, r5); L_0x025f: r4.commit(); r0 = r30; r5 = r0.v; if (r6 == 0) goto L_0x0f09; L_0x0268: r4 = 1; L_0x0269: r5.setDownFinalFlag(r4); L_0x026c: r30.g(); goto L_0x0020; L_0x0271: r7 = d; r0 = r30; r0.B = r7; goto L_0x01c2; L_0x0279: r22 = java.lang.System.currentTimeMillis(); if (r31 != 0) goto L_0x0385; L_0x027f: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r7 = r7.mPreferences; Catch:{ Throwable -> 0x0570 } r8 = "tbs_downloadstarttime"; r10 = 0; r8 = r7.getLong(r8, r10); Catch:{ Throwable -> 0x0570 } r8 = r22 - r8; r10 = 86400000; // 0x5265c00 float:7.82218E-36 double:4.2687272E-316; r7 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1)); if (r7 <= 0) goto L_0x0328; L_0x029b: r7 = "TbsDownload"; r8 = "[TbsApkDownloader.startDownload] OVER DOWNLOAD_PERIOD"; com.tencent.smtt.utils.TbsLog.i(r7, r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r7 = r7.a; Catch:{ Throwable -> 0x0570 } r8 = "tbs_downloadstarttime"; r9 = java.lang.Long.valueOf(r22); Catch:{ Throwable -> 0x0570 } r7.put(r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r7 = r7.a; Catch:{ Throwable -> 0x0570 } r8 = "tbs_downloadflow"; r10 = 0; r9 = java.lang.Long.valueOf(r10); Catch:{ Throwable -> 0x0570 } r7.put(r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r7.commit(); Catch:{ Throwable -> 0x0570 } r4 = 0; L_0x02db: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.utils.j.b(r7); Catch:{ Throwable -> 0x0570 } if (r7 != 0) goto L_0x0385; L_0x02e5: r7 = "TbsDownload"; r8 = "DownloadBegin FreeSpace too small"; r9 = 1; com.tencent.smtt.utils.TbsLog.i(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r7 = 105; // 0x69 float:1.47E-43 double:5.2E-322; r8 = 0; r9 = 1; r0 = r30; r0.a(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -308; // 0xfffffffffffffecc float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0307: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0328: r7 = "TbsDownload"; r8 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r9 = "[TbsApkDownloader.startDownload] downloadFlow="; r8.<init>(r9); Catch:{ Throwable -> 0x0570 } r8 = r8.append(r4); Catch:{ Throwable -> 0x0570 } r8 = r8.toString(); Catch:{ Throwable -> 0x0570 } com.tencent.smtt.utils.TbsLog.i(r7, r8); Catch:{ Throwable -> 0x0570 } r7 = (r4 > r24 ? 1 : (r4 == r24 ? 0 : -1)); if (r7 < 0) goto L_0x02db; L_0x0342: r7 = "TbsDownload"; r8 = "STEP 1/2 begin downloading...failed because you exceeded max flow!"; r9 = 1; com.tencent.smtt.utils.TbsLog.i(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r7 = 112; // 0x70 float:1.57E-43 double:5.53E-322; r8 = 0; r9 = 1; r0 = r30; r0.a(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -307; // 0xfffffffffffffecd float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0364: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0385: r7 = 1; r0 = r30; r0.y = r7; Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.j; Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x0519; L_0x0390: r0 = r30; r7 = r0.j; Catch:{ Throwable -> 0x0570 } L_0x0394: r8 = "TbsDownload"; r9 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r10 = "try url:"; r9.<init>(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.append(r7); Catch:{ Throwable -> 0x0570 } r10 = ",mRetryTimes:"; r9 = r9.append(r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r10 = r0.p; Catch:{ Throwable -> 0x0570 } r9 = r9.append(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.toString(); Catch:{ Throwable -> 0x0570 } r10 = 1; com.tencent.smtt.utils.TbsLog.i(r8, r9, r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r8 = r0.i; Catch:{ Throwable -> 0x0570 } r8 = r7.equals(r8); Catch:{ Throwable -> 0x0570 } if (r8 != 0) goto L_0x03cb; L_0x03c4: r0 = r30; r8 = r0.v; Catch:{ Throwable -> 0x0570 } r8.setDownloadUrl(r7); Catch:{ Throwable -> 0x0570 } L_0x03cb: r0 = r30; r0.i = r7; Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r7); Catch:{ Throwable -> 0x0570 } r12 = 0; r0 = r30; r7 = r0.o; Catch:{ Throwable -> 0x0570 } if (r7 != 0) goto L_0x0438; L_0x03dc: r12 = r30.k(); Catch:{ Throwable -> 0x0570 } r7 = "TbsDownload"; r8 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r9 = "[TbsApkDownloader.startDownload] range="; r8.<init>(r9); Catch:{ Throwable -> 0x0570 } r8 = r8.append(r12); Catch:{ Throwable -> 0x0570 } r8 = r8.toString(); Catch:{ Throwable -> 0x0570 } com.tencent.smtt.utils.TbsLog.i(r7, r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r8 = r0.l; Catch:{ Throwable -> 0x0570 } r10 = 0; r7 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1)); if (r7 > 0) goto L_0x051f; L_0x0400: r7 = "TbsDownload"; r8 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r9 = "STEP 1/2 begin downloading...current"; r8.<init>(r9); Catch:{ Throwable -> 0x0570 } r8 = r8.append(r12); Catch:{ Throwable -> 0x0570 } r8 = r8.toString(); Catch:{ Throwable -> 0x0570 } r9 = 1; com.tencent.smtt.utils.TbsLog.i(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r8 = "Range"; r9 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r10 = "bytes="; r9.<init>(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.append(r12); Catch:{ Throwable -> 0x0570 } r10 = "-"; r9 = r9.append(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.toString(); Catch:{ Throwable -> 0x0570 } r7.setRequestProperty(r8, r9); Catch:{ Throwable -> 0x0570 } L_0x0438: r0 = r30; r8 = r0.v; Catch:{ Throwable -> 0x0570 } r10 = 0; r7 = (r12 > r10 ? 1 : (r12 == r10 ? 0 : -1)); if (r7 != 0) goto L_0x05e8; L_0x0442: r7 = 0; L_0x0443: r8.setDownloadCancel(r7); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.utils.Apn.getApnType(r7); Catch:{ Throwable -> 0x0570 } r0 = r30; r8 = r0.g; Catch:{ Throwable -> 0x0570 } r8 = com.tencent.smtt.utils.Apn.getApnInfo(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r9 = r0.w; Catch:{ Throwable -> 0x0570 } if (r9 != 0) goto L_0x05eb; L_0x045c: r0 = r30; r9 = r0.x; Catch:{ Throwable -> 0x0570 } r10 = -1; if (r9 != r10) goto L_0x05eb; L_0x0463: r0 = r30; r0.w = r8; Catch:{ Throwable -> 0x0570 } r0 = r30; r0.x = r7; Catch:{ Throwable -> 0x0570 } L_0x046b: r0 = r30; r7 = r0.p; Catch:{ Throwable -> 0x0570 } if (r7 <= 0) goto L_0x047f; L_0x0471: r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r8 = "Referer"; r0 = r30; r9 = r0.h; Catch:{ Throwable -> 0x0570 } r7.addRequestProperty(r8, r9); Catch:{ Throwable -> 0x0570 } L_0x047f: r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r7 = r7.getResponseCode(); Catch:{ Throwable -> 0x0570 } r8 = "TbsDownload"; r9 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r10 = "[TbsApkDownloader.startDownload] responseCode="; r9.<init>(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.append(r7); Catch:{ Throwable -> 0x0570 } r9 = r9.toString(); Catch:{ Throwable -> 0x0570 } com.tencent.smtt.utils.TbsLog.i(r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r8 = r0.v; Catch:{ Throwable -> 0x0570 } r8.setHttpCode(r7); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x04e3; L_0x04a6: r0 = r30; r8 = r0.g; Catch:{ Throwable -> 0x0570 } r8 = com.tencent.smtt.sdk.TbsDownloader.getOverSea(r8); Catch:{ Throwable -> 0x0570 } if (r8 != 0) goto L_0x04e3; L_0x04b0: r0 = r30; r8 = r0.g; Catch:{ Throwable -> 0x0570 } r8 = com.tencent.smtt.utils.Apn.getApnType(r8); Catch:{ Throwable -> 0x0570 } r9 = 3; if (r8 == r9) goto L_0x04c1; L_0x04bb: r8 = com.tencent.smtt.sdk.QbSdk.getDownloadWithoutWifi(); Catch:{ Throwable -> 0x0570 } if (r8 == 0) goto L_0x04cb; L_0x04c1: r0 = r30; r8 = r0.g; Catch:{ Throwable -> 0x0570 } r8 = com.tencent.smtt.utils.Apn.getApnType(r8); Catch:{ Throwable -> 0x0570 } if (r8 != 0) goto L_0x04e3; L_0x04cb: r30.c(); Catch:{ Throwable -> 0x0570 } r8 = com.tencent.smtt.sdk.QbSdk.m; Catch:{ Throwable -> 0x0570 } if (r8 == 0) goto L_0x04d9; L_0x04d2: r8 = com.tencent.smtt.sdk.QbSdk.m; Catch:{ Throwable -> 0x0570 } r9 = 111; // 0x6f float:1.56E-43 double:5.5E-322; r8.onDownloadFinish(r9); Catch:{ Throwable -> 0x0570 } L_0x04d9: r8 = "TbsDownload"; r9 = "Download is canceled due to NOT_WIFI error!"; r10 = 0; com.tencent.smtt.utils.TbsLog.i(r8, r9, r10); Catch:{ Throwable -> 0x0570 } L_0x04e3: r0 = r30; r8 = r0.r; Catch:{ Throwable -> 0x0570 } if (r8 == 0) goto L_0x0632; L_0x04e9: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -309; // 0xfffffffffffffecb float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x04f8: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0519: r0 = r30; r7 = r0.h; Catch:{ Throwable -> 0x0570 } goto L_0x0394; L_0x051f: r7 = "TbsDownload"; r8 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r9 = "#1 STEP 1/2 begin downloading...current/total="; r8.<init>(r9); Catch:{ Throwable -> 0x0570 } r8 = r8.append(r12); Catch:{ Throwable -> 0x0570 } r9 = "/"; r8 = r8.append(r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r10 = r0.l; Catch:{ Throwable -> 0x0570 } r8 = r8.append(r10); Catch:{ Throwable -> 0x0570 } r8 = r8.toString(); Catch:{ Throwable -> 0x0570 } r9 = 1; com.tencent.smtt.utils.TbsLog.i(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r8 = "Range"; r9 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r10 = "bytes="; r9.<init>(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.append(r12); Catch:{ Throwable -> 0x0570 } r10 = "-"; r9 = r9.append(r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r10 = r0.l; Catch:{ Throwable -> 0x0570 } r9 = r9.append(r10); Catch:{ Throwable -> 0x0570 } r9 = r9.toString(); Catch:{ Throwable -> 0x0570 } r7.setRequestProperty(r8, r9); Catch:{ Throwable -> 0x0570 } goto L_0x0438; L_0x0570: r7 = move-exception; L_0x0571: r8 = r7 instanceof javax.net.ssl.SSLHandshakeException; Catch:{ all -> 0x060d } if (r8 == 0) goto L_0x0e71; L_0x0575: if (r31 != 0) goto L_0x0e71; L_0x0577: r0 = r30; r8 = r0.b; Catch:{ all -> 0x060d } if (r8 == 0) goto L_0x0e71; L_0x057d: r8 = 0; r0 = r30; r8 = r0.a(r8); Catch:{ all -> 0x060d } if (r8 == 0) goto L_0x0e71; L_0x0586: r8 = "TbsDownload"; r9 = new java.lang.StringBuilder; Catch:{ all -> 0x060d } r10 = "[startdownload]url:"; r9.<init>(r10); Catch:{ all -> 0x060d } r0 = r30; r10 = r0.j; Catch:{ all -> 0x060d } r9 = r9.append(r10); Catch:{ all -> 0x060d } r10 = " download exception:"; r9 = r9.append(r10); Catch:{ all -> 0x060d } r7 = r7.toString(); Catch:{ all -> 0x060d } r7 = r9.append(r7); Catch:{ all -> 0x060d } r7 = r7.toString(); Catch:{ all -> 0x060d } com.tencent.smtt.utils.TbsLog.e(r8, r7); Catch:{ all -> 0x060d } r7 = 125; // 0x7d float:1.75E-43 double:6.2E-322; r8 = 0; r9 = 1; r0 = r30; r0.a(r7, r8, r9); Catch:{ all -> 0x060d } L_0x05b8: r0 = r30; r7 = r0.g; Catch:{ all -> 0x060d } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ all -> 0x060d } r8 = -316; // 0xfffffffffffffec4 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ all -> 0x060d } if (r31 != 0) goto L_0x01c2; L_0x05c7: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x05e8: r7 = 1; goto L_0x0443; L_0x05eb: r0 = r30; r9 = r0.x; Catch:{ Throwable -> 0x0570 } if (r7 != r9) goto L_0x05fb; L_0x05f1: r0 = r30; r9 = r0.w; Catch:{ Throwable -> 0x0570 } r9 = r8.equals(r9); Catch:{ Throwable -> 0x0570 } if (r9 != 0) goto L_0x046b; L_0x05fb: r0 = r30; r9 = r0.v; Catch:{ Throwable -> 0x0570 } r10 = 0; r9.setNetworkChange(r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.w = r8; Catch:{ Throwable -> 0x0570 } r0 = r30; r0.x = r7; Catch:{ Throwable -> 0x0570 } goto L_0x046b; L_0x060d: r6 = move-exception; r16 = r4; L_0x0610: if (r31 != 0) goto L_0x0631; L_0x0612: r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4 = r4.a; r5 = "tbs_downloadflow"; r7 = java.lang.Long.valueOf(r16); r4.put(r5, r7); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); L_0x0631: throw r6; L_0x0632: r8 = 200; // 0xc8 float:2.8E-43 double:9.9E-322; if (r7 == r8) goto L_0x063a; L_0x0636: r8 = 206; // 0xce float:2.89E-43 double:1.02E-321; if (r7 != r8) goto L_0x0ba2; L_0x063a: r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r7 = r7.getContentLength(); Catch:{ Throwable -> 0x0570 } r8 = (long) r7; Catch:{ Throwable -> 0x0570 } r8 = r8 + r12; r0 = r30; r0.l = r8; Catch:{ Throwable -> 0x0570 } r7 = "TbsDownload"; r8 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r9 = "[TbsApkDownloader.startDownload] mContentLength="; r8.<init>(r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r10 = r0.l; Catch:{ Throwable -> 0x0570 } r8 = r8.append(r10); Catch:{ Throwable -> 0x0570 } r8 = r8.toString(); Catch:{ Throwable -> 0x0570 } com.tencent.smtt.utils.TbsLog.i(r7, r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.v; Catch:{ Throwable -> 0x0570 } r0 = r30; r8 = r0.l; Catch:{ Throwable -> 0x0570 } r7.setPkgSize(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r7 = r7.mPreferences; Catch:{ Throwable -> 0x0570 } r8 = "tbs_apkfilesize"; r10 = 0; r8 = r7.getLong(r8, r10); Catch:{ Throwable -> 0x0570 } r10 = 0; r7 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1)); if (r7 == 0) goto L_0x076e; L_0x0686: r0 = r30; r10 = r0.l; Catch:{ Throwable -> 0x0570 } r7 = (r10 > r8 ? 1 : (r10 == r8 ? 0 : -1)); if (r7 == 0) goto L_0x076e; L_0x068e: r7 = "TbsDownload"; r10 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r11 = "DownloadBegin tbsApkFileSize="; r10.<init>(r11); Catch:{ Throwable -> 0x0570 } r10 = r10.append(r8); Catch:{ Throwable -> 0x0570 } r11 = " but contentLength="; r10 = r10.append(r11); Catch:{ Throwable -> 0x0570 } r0 = r30; r12 = r0.l; Catch:{ Throwable -> 0x0570 } r10 = r10.append(r12); Catch:{ Throwable -> 0x0570 } r10 = r10.toString(); Catch:{ Throwable -> 0x0570 } r11 = 1; com.tencent.smtt.utils.TbsLog.i(r7, r10, r11); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x0755; L_0x06b6: r7 = r30.n(); Catch:{ Throwable -> 0x0570 } if (r7 != 0) goto L_0x06cc; L_0x06bc: r7 = com.tencent.smtt.sdk.QbSdk.getDownloadWithoutWifi(); Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x0755; L_0x06c2: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.utils.Apn.isNetworkAvailable(r7); Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x0755; L_0x06cc: r0 = r30; r7 = r0.b; Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x06fe; L_0x06d2: r7 = 0; r0 = r30; r7 = r0.a(r7); Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x06fe; L_0x06db: if (r31 != 0) goto L_0x01c2; L_0x06dd: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x06fe: r7 = 113; // 0x71 float:1.58E-43 double:5.6E-322; r10 = new java.lang.StringBuilder; Catch:{ Throwable -> 0x0570 } r11 = "tbsApkFileSize="; r10.<init>(r11); Catch:{ Throwable -> 0x0570 } r8 = r10.append(r8); Catch:{ Throwable -> 0x0570 } r9 = " but contentLength="; r8 = r8.append(r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r10 = r0.l; Catch:{ Throwable -> 0x0570 } r8 = r8.append(r10); Catch:{ Throwable -> 0x0570 } r8 = r8.toString(); Catch:{ Throwable -> 0x0570 } r9 = 1; r0 = r30; r0.a(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -310; // 0xfffffffffffffeca float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } L_0x0732: if (r31 != 0) goto L_0x01ea; L_0x0734: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0755: r7 = 101; // 0x65 float:1.42E-43 double:5.0E-322; r8 = "WifiNetworkUnAvailable"; r9 = 1; r0 = r30; r0.a(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -304; // 0xfffffffffffffed0 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } goto L_0x0732; L_0x076e: r10 = 0; r9 = 0; r8 = 0; r7 = "TbsDownload"; r11 = "[TbsApkDownloader.startDownload] begin readResponse"; com.tencent.smtt.utils.TbsLog.i(r7, r11); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.t; Catch:{ IOException -> 0x0f2f, all -> 0x0f10 } r19 = r7.getInputStream(); Catch:{ IOException -> 0x0f2f, all -> 0x0f10 } if (r19 == 0) goto L_0x0a6e; L_0x0784: r0 = r30; r7 = r0.t; Catch:{ IOException -> 0x0834, all -> 0x0f1b } r7 = r7.getContentEncoding(); Catch:{ IOException -> 0x0834, all -> 0x0f1b } if (r7 == 0) goto L_0x0818; L_0x078e: r9 = "gzip"; r9 = r7.contains(r9); Catch:{ IOException -> 0x0834, all -> 0x0f1b } if (r9 == 0) goto L_0x0818; L_0x0797: r18 = new java.util.zip.GZIPInputStream; Catch:{ IOException -> 0x0834, all -> 0x0f1b } r18.<init>(r19); Catch:{ IOException -> 0x0834, all -> 0x0f1b } L_0x079c: r7 = 8192; // 0x2000 float:1.14794E-41 double:4.0474E-320; r0 = new byte[r7]; Catch:{ IOException -> 0x0f32, all -> 0x0f24 } r26 = r0; r20 = new java.io.FileOutputStream; Catch:{ IOException -> 0x0f32, all -> 0x0f24 } r7 = new java.io.File; Catch:{ IOException -> 0x0f32, all -> 0x0f24 } r0 = r30; r8 = r0.k; Catch:{ IOException -> 0x0f32, all -> 0x0f24 } r9 = "x5.tbs.temp"; r7.<init>(r8, r9); Catch:{ IOException -> 0x0f32, all -> 0x0f24 } r8 = 1; r0 = r20; r0.<init>(r7, r8); Catch:{ IOException -> 0x0f32, all -> 0x0f24 } r14 = java.lang.System.currentTimeMillis(); Catch:{ IOException -> 0x093c, all -> 0x099b } r7 = 0; r8 = r12; r10 = r12; r16 = r4; L_0x07bf: r0 = r30; r4 = r0.r; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x0891; L_0x07c5: r4 = "TbsDownload"; r5 = "STEP 1/2 begin downloading...Canceled!"; r8 = 1; com.tencent.smtt.utils.TbsLog.i(r4, r5, r8); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r0 = r30; r4 = r0.g; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = -309; // 0xfffffffffffffecb float:NaN double:NaN; r4.setDownloadInterruptCode(r5); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = r16; L_0x07de: if (r7 == 0) goto L_0x0a72; L_0x07e0: r0 = r30; r1 = r20; r0.a(r1); Catch:{ Throwable -> 0x0570 } r0 = r30; r1 = r18; r0.a(r1); Catch:{ Throwable -> 0x0570 } r0 = r30; r1 = r19; r0.a(r1); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01c2; L_0x07f7: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0818: if (r7 == 0) goto L_0x088d; L_0x081a: r9 = "deflate"; r7 = r7.contains(r9); Catch:{ IOException -> 0x0834, all -> 0x0f1b } if (r7 == 0) goto L_0x088d; L_0x0823: r18 = new java.util.zip.InflaterInputStream; Catch:{ IOException -> 0x0834, all -> 0x0f1b } r7 = new java.util.zip.Inflater; Catch:{ IOException -> 0x0834, all -> 0x0f1b } r9 = 1; r7.<init>(r9); Catch:{ IOException -> 0x0834, all -> 0x0f1b } r0 = r18; r1 = r19; r0.<init>(r1, r7); Catch:{ IOException -> 0x0834, all -> 0x0f1b } goto L_0x079c; L_0x0834: r7 = move-exception; r9 = r19; L_0x0837: r11 = r7 instanceof java.net.SocketTimeoutException; Catch:{ all -> 0x0b97 } if (r11 != 0) goto L_0x083f; L_0x083b: r11 = r7 instanceof java.net.SocketException; Catch:{ all -> 0x0b97 } if (r11 == 0) goto L_0x0abd; L_0x083f: r11 = 100000; // 0x186a0 float:1.4013E-40 double:4.94066E-319; r0 = r30; r0.m = r11; Catch:{ all -> 0x0b97 } r12 = 0; r0 = r30; r0.a(r12); Catch:{ all -> 0x0b97 } r11 = 103; // 0x67 float:1.44E-43 double:5.1E-322; r0 = r30; r7 = r0.a(r7); Catch:{ all -> 0x0b97 } r12 = 0; r0 = r30; r0.a(r11, r7, r12); Catch:{ all -> 0x0b97 } r0 = r30; r0.a(r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r9); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01c2; L_0x086c: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x088d: r18 = r19; goto L_0x079c; L_0x0891: r4 = 0; r5 = 8192; // 0x2000 float:1.14794E-41 double:4.0474E-320; r0 = r18; r1 = r26; r27 = r0.read(r1, r4, r5); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r27 > 0) goto L_0x08e6; L_0x089e: r0 = r30; r4 = r0.b; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x08c9; L_0x08a4: r4 = 1; r0 = r30; r1 = r21; r4 = r0.c(r4, r1); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 != 0) goto L_0x08c9; L_0x08af: if (r31 != 0) goto L_0x08bf; L_0x08b1: r4 = 0; r0 = r30; r4 = r0.a(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x08bf; L_0x08ba: r7 = 1; r4 = r16; goto L_0x07de; L_0x08bf: r4 = 1; r0 = r30; r0.s = r4; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r6 = 0; r4 = r16; goto L_0x07de; L_0x08c9: r4 = 1; r0 = r30; r0.s = r4; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r0 = r30; r4 = r0.b; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x08d5; L_0x08d4: r6 = 1; L_0x08d5: r0 = r30; r4 = r0.g; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = -311; // 0xfffffffffffffec9 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = r16; goto L_0x07de; L_0x08e6: r4 = 0; r0 = r20; r1 = r26; r2 = r27; r0.write(r1, r4, r2); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r20.flush(); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r31 != 0) goto L_0x09bb; L_0x08f5: r0 = r27; r4 = (long) r0; r4 = r4 + r16; r12 = (r4 > r24 ? 1 : (r4 == r24 ? 0 : -1)); if (r12 < 0) goto L_0x0945; L_0x08fe: r8 = "TbsDownload"; r9 = "STEP 1/2 begin downloading...failed because you exceeded max flow!"; r10 = 1; com.tencent.smtt.utils.TbsLog.i(r8, r9, r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r8 = 112; // 0x70 float:1.57E-43 double:5.53E-322; r9 = new java.lang.StringBuilder; Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = "downloadFlow="; r9.<init>(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = r9.append(r4); Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = " downloadMaxflow="; r9 = r9.append(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r0 = r24; r9 = r9.append(r0); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = r9.toString(); Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = 1; r0 = r30; r0.a(r8, r9, r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r0 = r30; r8 = r0.g; Catch:{ IOException -> 0x093c, all -> 0x099b } r8 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r8); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = -307; // 0xfffffffffffffecd float:NaN double:NaN; r8.setDownloadInterruptCode(r9); Catch:{ IOException -> 0x093c, all -> 0x099b } goto L_0x07de; L_0x093c: r7 = move-exception; r8 = r18; r9 = r19; r10 = r20; goto L_0x0837; L_0x0945: r0 = r30; r12 = r0.g; Catch:{ IOException -> 0x093c, all -> 0x099b } r12 = com.tencent.smtt.utils.j.b(r12); Catch:{ IOException -> 0x093c, all -> 0x099b } if (r12 != 0) goto L_0x09b9; L_0x094f: r8 = "TbsDownload"; r9 = "DownloadEnd FreeSpace too small "; r10 = 1; com.tencent.smtt.utils.TbsLog.i(r8, r9, r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r8 = 105; // 0x69 float:1.47E-43 double:5.2E-322; r9 = new java.lang.StringBuilder; Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = "freespace="; r9.<init>(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = com.tencent.smtt.utils.v.a(); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = r9.append(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = ",and minFreeSpace="; r9 = r9.append(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r0 = r30; r10 = r0.g; Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = r10.getDownloadMinFreeSpace(); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = r9.append(r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = r9.toString(); Catch:{ IOException -> 0x093c, all -> 0x099b } r10 = 1; r0 = r30; r0.a(r8, r9, r10); Catch:{ IOException -> 0x093c, all -> 0x099b } r0 = r30; r8 = r0.g; Catch:{ IOException -> 0x093c, all -> 0x099b } r8 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r8); Catch:{ IOException -> 0x093c, all -> 0x099b } r9 = -308; // 0xfffffffffffffecc float:NaN double:NaN; r8.setDownloadInterruptCode(r9); Catch:{ IOException -> 0x093c, all -> 0x099b } goto L_0x07de; L_0x099b: r7 = move-exception; r16 = r4; L_0x099e: r0 = r30; r1 = r20; r0.a(r1); Catch:{ Throwable -> 0x09b4, all -> 0x0f0c } r0 = r30; r1 = r18; r0.a(r1); Catch:{ Throwable -> 0x09b4, all -> 0x0f0c } r0 = r30; r1 = r19; r0.a(r1); Catch:{ Throwable -> 0x09b4, all -> 0x0f0c } throw r7; Catch:{ Throwable -> 0x09b4, all -> 0x0f0c } L_0x09b4: r7 = move-exception; r4 = r16; goto L_0x0571; L_0x09b9: r16 = r4; L_0x09bb: r0 = r27; r4 = (long) r0; r0 = r30; r1 = r22; r22 = r0.a(r1, r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r12 = java.lang.System.currentTimeMillis(); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r0 = r27; r4 = (long) r0; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r8 = r8 + r4; r4 = r12 - r14; r28 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321; r4 = (r4 > r28 ? 1 : (r4 == r28 ? 0 : -1)); if (r4 <= 0) goto L_0x0f47; L_0x09d6: r4 = "TbsDownload"; r5 = new java.lang.StringBuilder; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r14 = "#2 STEP 1/2 begin downloading...current/total="; r5.<init>(r14); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = r5.append(r8); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r14 = "/"; r5 = r5.append(r14); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r0 = r30; r14 = r0.l; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = r5.append(r14); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = r5.toString(); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r14 = 1; com.tencent.smtt.utils.TbsLog.i(r4, r5, r14); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.sdk.QbSdk.m; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x0a10; L_0x0a00: r4 = (double) r8; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r0 = r30; r14 = r0.l; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r14 = (double) r14; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = r4 / r14; r14 = 4636737291354636288; // 0x4059000000000000 float:0.0 double:100.0; r4 = r4 * r14; r4 = (int) r4; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = com.tencent.smtt.sdk.QbSdk.m; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5.onDownloadProgress(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } L_0x0a10: if (r31 != 0) goto L_0x0f44; L_0x0a12: r4 = r8 - r10; r14 = 1048576; // 0x100000 float:1.469368E-39 double:5.180654E-318; r4 = (r4 > r14 ? 1 : (r4 == r14 ? 0 : -1)); if (r4 <= 0) goto L_0x0f44; L_0x0a1b: r0 = r30; r4 = r0.g; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.sdk.TbsDownloader.getOverSea(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 != 0) goto L_0x0a69; L_0x0a25: r0 = r30; r4 = r0.g; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.utils.Apn.getApnType(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = 3; if (r4 == r5) goto L_0x0a36; L_0x0a30: r4 = com.tencent.smtt.sdk.QbSdk.getDownloadWithoutWifi(); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x0a40; L_0x0a36: r0 = r30; r4 = r0.g; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.utils.Apn.getApnType(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 != 0) goto L_0x0a69; L_0x0a40: r30.c(); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.sdk.QbSdk.m; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } if (r4 == 0) goto L_0x0a4e; L_0x0a47: r4 = com.tencent.smtt.sdk.QbSdk.m; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = 111; // 0x6f float:1.56E-43 double:5.5E-322; r4.onDownloadFinish(r5); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } L_0x0a4e: r4 = "TbsDownload"; r5 = "Download is paused due to NOT_WIFI error!"; r8 = 0; com.tencent.smtt.utils.TbsLog.i(r4, r5, r8); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r0 = r30; r4 = r0.g; Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r5 = -304; // 0xfffffffffffffed0 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); Catch:{ IOException -> 0x0f39, all -> 0x0f2b } r4 = r16; goto L_0x07de; L_0x0a69: r4 = r8; L_0x0a6a: r14 = r12; r10 = r4; goto L_0x07bf; L_0x0a6e: r18 = r8; r20 = r10; L_0x0a72: r0 = r30; r1 = r20; r0.a(r1); Catch:{ Throwable -> 0x0570 } r0 = r30; r1 = r18; r0.a(r1); Catch:{ Throwable -> 0x0570 } r0 = r30; r1 = r19; r0.a(r1); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.s; Catch:{ Throwable -> 0x0570 } if (r7 != 0) goto L_0x0a9a; L_0x0a8d: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -319; // 0xfffffffffffffec1 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } L_0x0a9a: if (r31 != 0) goto L_0x01ea; L_0x0a9c: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0abd: if (r31 != 0) goto L_0x0b3b; L_0x0abf: r0 = r30; r11 = r0.g; Catch:{ all -> 0x0b97 } r11 = com.tencent.smtt.utils.j.b(r11); Catch:{ all -> 0x0b97 } if (r11 != 0) goto L_0x0b3b; L_0x0ac9: r7 = 105; // 0x69 float:1.47E-43 double:5.2E-322; r11 = new java.lang.StringBuilder; Catch:{ all -> 0x0b97 } r12 = "freespace="; r11.<init>(r12); Catch:{ all -> 0x0b97 } r12 = com.tencent.smtt.utils.v.a(); Catch:{ all -> 0x0b97 } r11 = r11.append(r12); Catch:{ all -> 0x0b97 } r12 = ",and minFreeSpace="; r11 = r11.append(r12); Catch:{ all -> 0x0b97 } r0 = r30; r12 = r0.g; Catch:{ all -> 0x0b97 } r12 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r12); Catch:{ all -> 0x0b97 } r12 = r12.getDownloadMinFreeSpace(); Catch:{ all -> 0x0b97 } r11 = r11.append(r12); Catch:{ all -> 0x0b97 } r11 = r11.toString(); Catch:{ all -> 0x0b97 } r12 = 1; r0 = r30; r0.a(r7, r11, r12); Catch:{ all -> 0x0b97 } r0 = r30; r7 = r0.g; Catch:{ all -> 0x0b97 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ all -> 0x0b97 } r11 = -308; // 0xfffffffffffffecc float:NaN double:NaN; r7.setDownloadInterruptCode(r11); Catch:{ all -> 0x0b97 } r0 = r30; r0.a(r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r9); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0b1a: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0b3b: r12 = 0; r0 = r30; r0.a(r12); Catch:{ all -> 0x0b97 } r11 = r30.j(); Catch:{ all -> 0x0b97 } if (r11 != 0) goto L_0x0b88; L_0x0b48: r11 = 106; // 0x6a float:1.49E-43 double:5.24E-322; r0 = r30; r7 = r0.a(r7); Catch:{ all -> 0x0b97 } r12 = 0; r0 = r30; r0.a(r11, r7, r12); Catch:{ all -> 0x0b97 } L_0x0b56: r0 = r30; r0.a(r10); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r9); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01c2; L_0x0b67: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0b88: r11 = 104; // 0x68 float:1.46E-43 double:5.14E-322; r0 = r30; r7 = r0.a(r7); Catch:{ all -> 0x0b97 } r12 = 0; r0 = r30; r0.a(r11, r7, r12); Catch:{ all -> 0x0b97 } goto L_0x0b56; L_0x0b97: r7 = move-exception; r16 = r4; r18 = r8; r19 = r9; r20 = r10; goto L_0x099e; L_0x0ba2: r8 = 300; // 0x12c float:4.2E-43 double:1.48E-321; if (r7 < r8) goto L_0x0c25; L_0x0ba6: r8 = 307; // 0x133 float:4.3E-43 double:1.517E-321; if (r7 > r8) goto L_0x0c25; L_0x0baa: r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r8 = "Location"; r7 = r7.getHeaderField(r8); Catch:{ Throwable -> 0x0570 } r8 = android.text.TextUtils.isEmpty(r7); Catch:{ Throwable -> 0x0570 } if (r8 != 0) goto L_0x0bec; L_0x0bbb: r0 = r30; r0.j = r7; Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.q; Catch:{ Throwable -> 0x0570 } r7 = r7 + 1; r0 = r30; r0.q = r7; Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01c2; L_0x0bcb: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0bec: r7 = 124; // 0x7c float:1.74E-43 double:6.13E-322; r8 = 0; r9 = 1; r0 = r30; r0.a(r7, r8, r9); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -312; // 0xfffffffffffffec8 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0c04: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0c25: r8 = 102; // 0x66 float:1.43E-43 double:5.04E-322; r9 = java.lang.String.valueOf(r7); Catch:{ Throwable -> 0x0570 } r10 = 0; r0 = r30; r0.a(r8, r9, r10); Catch:{ Throwable -> 0x0570 } r8 = 416; // 0x1a0 float:5.83E-43 double:2.055E-321; if (r7 != r8) goto L_0x0ca7; L_0x0c35: r7 = 1; r0 = r30; r1 = r21; r7 = r0.c(r7, r1); Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x0c71; L_0x0c40: r6 = 1; r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -214; // 0xffffffffffffff2a float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0c50: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0c71: r7 = 0; r0 = r30; r0.c(r7); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -313; // 0xfffffffffffffec7 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0c86: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0ca7: r8 = 403; // 0x193 float:5.65E-43 double:1.99E-321; if (r7 == r8) goto L_0x0caf; L_0x0cab: r8 = 406; // 0x196 float:5.69E-43 double:2.006E-321; if (r7 != r8) goto L_0x0ce9; L_0x0caf: r0 = r30; r8 = r0.l; Catch:{ Throwable -> 0x0570 } r10 = -1; r8 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1)); if (r8 != 0) goto L_0x0ce9; L_0x0cb9: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -314; // 0xfffffffffffffec6 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0cc8: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0ce9: r8 = 202; // 0xca float:2.83E-43 double:1.0E-321; if (r7 != r8) goto L_0x0d10; L_0x0ced: if (r31 != 0) goto L_0x01c2; L_0x0cef: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0d10: r0 = r30; r8 = r0.p; Catch:{ Throwable -> 0x0570 } r0 = r30; r9 = r0.B; Catch:{ Throwable -> 0x0570 } if (r8 >= r9) goto L_0x0d8b; L_0x0d1a: r8 = 503; // 0x1f7 float:7.05E-43 double:2.485E-321; if (r7 != r8) goto L_0x0d8b; L_0x0d1e: r0 = r30; r7 = r0.t; Catch:{ Throwable -> 0x0570 } r8 = "Retry-After"; r7 = r7.getHeaderField(r8); Catch:{ Throwable -> 0x0570 } r8 = java.lang.Long.parseLong(r7); Catch:{ Throwable -> 0x0570 } r0 = r30; r0.a(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.r; Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x0d68; L_0x0d38: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -309; // 0xfffffffffffffecb float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0d47: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0d68: if (r31 != 0) goto L_0x01c2; L_0x0d6a: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0d8b: r0 = r30; r8 = r0.p; Catch:{ Throwable -> 0x0570 } r0 = r30; r9 = r0.B; Catch:{ Throwable -> 0x0570 } if (r8 >= r9) goto L_0x0e05; L_0x0d95: r8 = 408; // 0x198 float:5.72E-43 double:2.016E-321; if (r7 == r8) goto L_0x0da5; L_0x0d99: r8 = 504; // 0x1f8 float:7.06E-43 double:2.49E-321; if (r7 == r8) goto L_0x0da5; L_0x0d9d: r8 = 502; // 0x1f6 float:7.03E-43 double:2.48E-321; if (r7 == r8) goto L_0x0da5; L_0x0da1: r8 = 408; // 0x198 float:5.72E-43 double:2.016E-321; if (r7 != r8) goto L_0x0e05; L_0x0da5: r8 = 0; r0 = r30; r0.a(r8); Catch:{ Throwable -> 0x0570 } r0 = r30; r7 = r0.r; Catch:{ Throwable -> 0x0570 } if (r7 == 0) goto L_0x0de2; L_0x0db2: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -309; // 0xfffffffffffffecb float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0dc1: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0de2: if (r31 != 0) goto L_0x01c2; L_0x0de4: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0e05: r8 = r30.k(); Catch:{ Throwable -> 0x0570 } r10 = 0; r8 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1)); if (r8 > 0) goto L_0x0e41; L_0x0e0f: r0 = r30; r8 = r0.o; Catch:{ Throwable -> 0x0570 } if (r8 != 0) goto L_0x0e41; L_0x0e15: r8 = 410; // 0x19a float:5.75E-43 double:2.026E-321; if (r7 == r8) goto L_0x0e41; L_0x0e19: r7 = 1; r0 = r30; r0.o = r7; Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01c2; L_0x0e20: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r9 = java.lang.Long.valueOf(r4); r7.put(r8, r9); r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7.commit(); goto L_0x01c2; L_0x0e41: r0 = r30; r7 = r0.g; Catch:{ Throwable -> 0x0570 } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ Throwable -> 0x0570 } r8 = -315; // 0xfffffffffffffec5 float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ Throwable -> 0x0570 } if (r31 != 0) goto L_0x01ea; L_0x0e50: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0e71: r8 = 0; r0 = r30; r0.a(r8); Catch:{ all -> 0x060d } r8 = 107; // 0x6b float:1.5E-43 double:5.3E-322; r0 = r30; r7 = r0.a(r7); Catch:{ all -> 0x060d } r9 = 0; r0 = r30; r0.a(r8, r7, r9); Catch:{ all -> 0x060d } r0 = r30; r7 = r0.r; Catch:{ all -> 0x060d } if (r7 == 0) goto L_0x05b8; L_0x0e8c: r0 = r30; r7 = r0.g; Catch:{ all -> 0x060d } r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); Catch:{ all -> 0x060d } r8 = -309; // 0xfffffffffffffecb float:NaN double:NaN; r7.setDownloadInterruptCode(r8); Catch:{ all -> 0x060d } if (r31 != 0) goto L_0x01ea; L_0x0e9b: r0 = r30; r7 = r0.g; r7 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r7); r7 = r7.a; r8 = "tbs_downloadflow"; r4 = java.lang.Long.valueOf(r4); r7.put(r8, r4); r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r4.commit(); goto L_0x01ea; L_0x0ebc: r4 = 0; goto L_0x020e; L_0x0ebf: r4 = 2; goto L_0x021a; L_0x0ec2: r0 = r30; r4 = r0.v; r5 = 0; r4.setPatchUpdateFlag(r5); goto L_0x021d; L_0x0ecc: r0 = r30; r4 = r0.g; r4 = com.tencent.smtt.sdk.TbsDownloadConfig.getInstance(r4); r5 = -318; // 0xfffffffffffffec2 float:NaN double:NaN; r4.setDownloadInterruptCode(r5); r4 = 0; r0 = r30; r0.c(r4); goto L_0x023d; L_0x0ee1: r5 = r4.mPreferences; r7 = "tbs_download_failed_retrytimes"; r8 = 0; r5 = r5.getInt(r7, r8); r7 = r4.a; r8 = "tbs_download_failed_retrytimes"; r5 = r5 + 1; r9 = java.lang.Integer.valueOf(r5); r7.put(r8, r9); r7 = r4.getDownloadFailedMaxRetrytimes(); if (r5 != r7) goto L_0x025f; L_0x0eff: r0 = r30; r5 = r0.v; r7 = 2; r5.setDownloadCancel(r7); goto L_0x025f; L_0x0f09: r4 = 0; goto L_0x0269; L_0x0f0c: r4 = move-exception; r6 = r4; goto L_0x0610; L_0x0f10: r7 = move-exception; r16 = r4; r18 = r8; r19 = r9; r20 = r10; goto L_0x099e; L_0x0f1b: r7 = move-exception; r16 = r4; r18 = r8; r20 = r10; goto L_0x099e; L_0x0f24: r7 = move-exception; r16 = r4; r20 = r10; goto L_0x099e; L_0x0f2b: r4 = move-exception; r7 = r4; goto L_0x099e; L_0x0f2f: r7 = move-exception; goto L_0x0837; L_0x0f32: r7 = move-exception; r8 = r18; r9 = r19; goto L_0x0837; L_0x0f39: r7 = move-exception; r4 = r16; r8 = r18; r9 = r19; r10 = r20; goto L_0x0837; L_0x0f44: r4 = r10; goto L_0x0a6a; L_0x0f47: r12 = r14; r4 = r10; goto L_0x0a6a; */ throw new UnsupportedOperationException("Method not decompiled: com.tencent.smtt.sdk.ag.b(boolean, boolean):void"); } public void c() { this.r = true; if (TbsShareManager.isThirdPartyApp(this.g)) { TbsLogReport$TbsLogInfo a = TbsLogReport.a(this.g).a(); a.setErrorCode(-309); a.setFailDetail(new Exception()); if (TbsDownloadConfig.getInstance(this.g).mPreferences.getInt(TbsDownloadConfig$TbsConfigKey.KEY_DOWNLOADDECOUPLECORE, 0) == 1) { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD_DECOUPLE, a); } else { TbsLogReport.a(this.g).a(EventType.TYPE_DOWNLOAD, a); } } } public void d() { c(); c(false); c(true); } public boolean e() { TbsLog.i("TbsDownload", "[TbsApkDownloader.isDownloadForeground] mIsDownloadForeground=" + this.C); return this.C; } }