text
stringlengths
10
2.72M
package com.projet3.library_webservice.library_webservice_consumer.DAO; import java.sql.SQLException; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.SqlParameterSource; import com.projet3.library_webservice.library_webservice_consumer.RowMapper.BookRowMapper; import com.projet3.library_webservice.library_webservice_consumer.RowMapper.BorrowingRowMapper; import com.projet3.library_webservice.library_webservice_model.beans.Book; import com.projet3.library_webservice.library_webservice_model.beans.Borrowing; import com.projet3.library_webservice.library_webservice_model.beans.User; public class BorrowingDAOImpl extends AbstractDAO implements BorrowingDAO { @Autowired private UserDAO userDAO; @Autowired private BookDAO bookDAO; @Override public Borrowing getBorrowingByBook(Book book) throws SQLException { String sql = "SELECT * FROM borrowing WHERE book_id = :book_id"; SqlParameterSource namedParameters = new MapSqlParameterSource("book_id", book.getId()); Borrowing borrowing = namedParameterTemplate.queryForObject(sql, namedParameters, new BorrowingRowMapper(userDAO, bookDAO)); return borrowing; } @Override public List<Borrowing> getBorrowingByUser(User user) throws SQLException { String sql = "SELECT * FROM borrowing WHERE id_user = :id_user"; SqlParameterSource namedParameters = new MapSqlParameterSource("id_user", user.getId()); List<Borrowing> borrowingList = new ArrayList<Borrowing>(); borrowingList = namedParameterTemplate.query(sql, namedParameters, new BorrowingRowMapper(userDAO, bookDAO)); return borrowingList; } @Override public void createBorrowing(Borrowing borrowing) throws SQLException { String sql = "INSERT INTO borrowing (beginning_date, ending_date, book_id, id_user) VALUES (:beginning_date, :ending_date, :book_id, :id_user)"; MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("beginning_date", borrowing.getBeginningDate()); params.addValue("ending_date", borrowing.getEndingDate()); params.addValue("book_id", borrowing.getBook().getId()); params.addValue("id_user", borrowing.getUser().getId()); namedParameterTemplate.update(sql, params); } @Override public void updateBorrowing(Borrowing borrowing) throws SQLException { String sql = "UPDATE borrowing SET ending_date = :ending_date, extended = 1 WHERE borrowing_id = :borrowing_id"; MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("borrowing_id", borrowing.getId()); params.addValue("ending_date", borrowing.getEndingDate()); namedParameterTemplate.update(sql, params); } @Override public void deleteBorrowing(Borrowing borrowing) throws SQLException { String sql = "DELETE FROM borrowing WHERE borrowing_id = :borrowing_id"; MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("borrowing_id", borrowing.getId()); namedParameterTemplate.update(sql, params); } @Override public List<Borrowing> getBorrowingsById(List<Integer> ids) throws SQLException { String sql = "SELECT * FROM borrowing WHERE book_id IN (:ids)"; SqlParameterSource namedParameters = new MapSqlParameterSource("ids", ids); List<Borrowing> borrowingList = namedParameterTemplate.query(sql, namedParameters, new BorrowingRowMapper(userDAO, bookDAO)); return borrowingList; } }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package co.th.aten.football.ui; import javax.swing.JComponent; import org.springframework.richclient.application.support.AbstractView; /** * * @author Aten */ public class MainView extends AbstractView { @Override protected JComponent createControl() { MainPanel panel = new MainPanel(); return panel; } }
package com.tencent.mm.ui.chatting.viewitems; import android.text.style.ClickableSpan; class ac$a { public int end; public int start; public ClickableSpan udA; ac$a() { } }
package com.suncity.pay.controller; import java.io.IOException; import java.io.InputStream; import java.util.Map; import java.util.Properties; import java.util.TreeMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.suncity.pay.Exception.PayException; import com.suncity.pay.enums.PayEnums; import com.suncity.pay.model.AppPayModel; import com.suncity.pay.service.PayService; import com.suncity.pay.utils.ToolKit; import net.sf.json.JSONObject; import sun.misc.BASE64Decoder; @Controller public class PayController { /**日志记录对象 */ private static final Logger logger = Logger.getLogger(PayController.class); /**配置文件*/ private static final String PROPERTIES = "config.properties"; @Autowired private PayService payService; /** * 发起支付 */ @RequestMapping("/appPay") public String InitiatePay(Map<String, Object> map) { try { // 读取配置文件 , 将map参数返回页面 payService.readfile(map); } catch (Exception e) { e.printStackTrace(); logger.error("读取配置文件异常",e); } return "AppPay"; } /** * 确认支付 * @return */ @RequestMapping("/appConfirm") public String ConfirmPay(HttpServletRequest request) { //接收request 参数 AppPayModel model = new AppPayModel(request); try { //进行 String data = model.getData(); String parameter = "data=" + data + "&merchNo="+ request.getParameter("merchNo") + "&version=" + request.getParameter("version"); //发起支付请求 String requestJson = ToolKit.request(request.getParameter("reqUrl"),parameter); JSONObject jsonResult = JSONObject.fromObject(requestJson); String stateCode = jsonResult.getString("stateCode"); String msg = jsonResult.getString("msg"); if (!stateCode.equals(PayEnums.NORMAL_STATUS.getCode())) { throw new PayException(PayEnums.ABNORMAL_STATUS,msg); } //取得签名 String resultSign = jsonResult.getString("sign"); jsonResult.remove("sign"); //拼接 md5 密钥 进行MD5加密 String splice = jsonResult.toString() + request.getParameter("key"); String MD5String = ToolKit.MD5(splice, request.getParameter("charset")); //与签名进行匹配 if (!MD5String.equals(resultSign)) { throw new PayException(PayEnums.SIGN_MISMATCH_ERROR); } //无误,支付地址 String paymentUrl = jsonResult.getString("qrcodeUrl"); return "redirect:" + paymentUrl; } catch (IOException e) { e.printStackTrace(); } return null; } /** * 订单查询 */ @RequestMapping("/query") public String query(Map<String, Object> map) { try { payService.readfile(map); } catch (Exception e) { logger.error("订单查询 " + e); } return "Query"; } /** * 提交查询 */ @RequestMapping("/submitQuery") public String submitQuery(HttpServletRequest request) { try { payService.submitQuery(request); } catch (IOException e) { logger.error("接口调用出现异常!", e); } return "Query"; } /** * 支付回显 */ @RequestMapping("/callback") public String callback(HttpServletRequest request) { return "Callback"; } /** * 支付回调 * * @throws IOException */ @RequestMapping("/result") public void result(HttpServletRequest request, HttpServletResponse response) throws IOException { // 读取私钥 InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(PROPERTIES); // 加载属性列表 Properties prop = new Properties(); prop.load(inputStream); String privateKey = prop.getProperty("PRIVATE_KEY"); String key = prop.getProperty("key"); String charset = prop.getProperty("charset"); String data = request.getParameter("data"); byte[] result = ToolKit.decryptByPrivateKey(new BASE64Decoder().decodeBuffer(data), privateKey); String resultData = new String(result, charset);// 解密数据 JSONObject jsonObj = JSONObject.fromObject(resultData); Map<String, String> metaSignMap = jsonToMap(jsonObj); String jsonStr = ToolKit.mapToJson(metaSignMap); String sign = ToolKit.MD5(jsonStr.toString() + key, charset); if (!sign.equals(jsonObj.getString("sign"))) { System.out.println("签名校验失败"); throw new PayException(PayEnums.SIGN_MISMATCH_ERROR); } System.out.println("签名校验成功"); // 回调成功返回0 response.getOutputStream().write("0".getBytes()); } /** * 将值放入map * Abbott * @param jsonObj * @return */ public Map<String, String> jsonToMap(JSONObject jsonObj){ Map<String, String> metaSignMap = new TreeMap<String, String>(); metaSignMap.put("merNo", jsonObj.getString("merNo")); metaSignMap.put("netway", jsonObj.getString("netway")); metaSignMap.put("orderNum", jsonObj.getString("orderNum")); metaSignMap.put("amount", jsonObj.getString("amount")); metaSignMap.put("goodsName", jsonObj.getString("goodsName")); metaSignMap.put("payResult", jsonObj.getString("payResult"));// 支付状态 metaSignMap.put("payDate", jsonObj.getString("payDate"));// yyyyMMddHHmmss return metaSignMap; } }
package One; public class SinglyLinkedList { private ListNode head; private static class ListNode { private int data; private ListNode next; public ListNode(int data) { this.data=data; this.next=null; } } public static void main(String[] args) { SinglyLinkedList sll=new SinglyLinkedList(); sll.head=new ListNode(10); ListNode second=new ListNode(11); ListNode third=new ListNode(12); ListNode fourth=new ListNode(13); sll.head.next = second; //10-->11 second.next=third; //10-->11-->12 third.next=fourth; //10-->11-->12-->13 sll.AddAtBeginning(9); sll.display(); System.out.print("\nLength= "+sll.length()); } public void display() { ListNode current=head; for(int i=1;current!=null;i++) { System.out.print(current.data+"-->"); current=current.next; } } public int length() { ListNode current=head; int i=0; while(current!=null) { current=current.next; i++; } return i; } public void AddAtBeginning(int data) { ListNode NewNode=new ListNode(data); NewNode.next=head; head=NewNode; } }
package ducksim.behaviors.QuackBehavior; public class QuackNoWay implements QuackBehavior { @Override public String getQuack() { return ""; } }
package de.zarncke.lib.err; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Constructor; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import javax.annotation.Nonnull; import de.zarncke.lib.coll.L; import de.zarncke.lib.log.Log; /** * Provides tool methods for dealing with Throwables and exceptional circumstances in general. * * @author Gunnar Zarncke */ public final class ExceptionUtil { /** * At most {@value #MAX_TESTED_EXCEPTION_NESTING} levels of nested exceptions are tested. */ public static final int MAX_TESTED_EXCEPTION_NESTING = 32; private ExceptionUtil() { // helper } /** * A ThrowableRewriterException is thrown if there is a problem while * rewriting a throwable. */ public static final class ThrowableRewritingException extends RuntimeException { private static final long serialVersionUID = 1L; /** * Creates a ThrowableRewriterException. */ public ThrowableRewritingException() { super(); } /** * Creates a ThrowableRewriterException. * * @param message An additional message to the exception. */ public ThrowableRewritingException(final String message) { super(message); } } /** * Creates a new message with both the original and the new throwable * message and all of the stack trace. * * @param originalThrowable The original throwable, that was usually caught. * @param newThrowable The new throwable you are about to throw. * @return A throwable of the newThrowable's type, but with all of the stack trace. * @exception ThrowableRewritingException If the exception cannot be rewritten. */ public static Throwable rewrite(final Throwable originalThrowable, final Throwable newThrowable) { // Get the original message and stack trace. StringTokenizer originalMessageLines = tokenize(originalThrowable); // Build new stack trace as message. StringBuffer cutMessage = new StringBuffer(); cutMessage.append("Because of "); // Append just as many lines as required. while (originalMessageLines.hasMoreTokens()) { String messageLine = originalMessageLines.nextToken(); // Get the new message and stack trace. boolean matchFound = false; StringTokenizer newMessageLines = tokenize(newThrowable); while (newMessageLines.hasMoreTokens()) { String newMessageLine = newMessageLines.nextToken(); if (newMessageLine.equals(messageLine) && newMessageLine.indexOf("Exception") < 0 && newMessageLine.indexOf("Error") < 0 && newMessageLine.indexOf("Throwable") < 0) { matchFound = true; break; } } if (matchFound) { break; } cutMessage.append(messageLine).append('\n'); } // Build the bridge between the original and the new throwable. cutMessage.append("there was the following exception: "); cutMessage.append(newThrowable.getClass().getName()).append(": "); cutMessage.append(newThrowable.getMessage()); // Build the new throwable. try { Constructor<?> newThrowableConstructor = newThrowable.getClass().getConstructor( new Class[] { String.class }); return (Throwable) newThrowableConstructor.newInstance(new Object[] { cutMessage.toString() }); } catch (Exception e) { throw new ThrowableRewritingException("Cannot rewrite the exception "// NOPMD + originalThrowable.getClass().getName() + " to " + newThrowable.getClass().getName() + " because of " + e.toString() + ".\n" + "Please make sure that a default constructor for exception is accessable."); } } private static StringTokenizer tokenize(final Throwable throwable) { return new StringTokenizer(getStackTrace(throwable), "\n"); } /** * Like {@link Throwable#initCause(Throwable)} but type safe and the cause is preserved in any case. * If a cause is already set, then the cause chain is followed upwards * * @param <T> type of Throwable * @param throwable != null * @param cause != null * @return throwable (T) */ public static <T extends Throwable> T preserveCause(final T throwable, final Throwable cause) { Throwable t = throwable; while (t.getCause() != null) { t = t.getCause(); } t.initCause(cause); return throwable; } /** * Extracts the stack trace of a throwable. * * @param t The throwable to determine the stack trace of * @return A String representing the current stack trace. */ public static String getStackTrace(final Throwable t) { StringWriter traceWriter = new StringWriter(); t.printStackTrace(new PrintWriter(traceWriter, true)); return traceWriter.getBuffer().toString(); } /** * extract the current stack trace * * @return a String representing the current stacktrace */ public static String getStackTrace() { return getStackTrace(new ExceptionNotIntendedToBeThrown()); } /** * Does everything possible to notify someone, that an impossible * condition occurred in a location, where nobody is about * to catch an Exception. * Examples: * <ul> * <li>static initializer</li> * <li>Thread.run</li> * <li>indirect call of the above</li> * <li>finalizers</li> * <li>shutdown code</li> * </ul> * * @param msg msg * @param ex cause */ public static void emergencyAlert(final String msg, final Throwable ex) { String sep = "\n\n\n!!!!!!!! THE IMPOSSIBLE HAPPENED !!!!!!!!\n\n\n"; System.out.println(msg + sep); // NOPMD ex.printStackTrace(System.out); System.out.println(sep);// NOPMD System.err.println(msg + sep);// NOPMD ex.printStackTrace(System.err); System.err.println(sep);// NOPMD Log.LOG.get().report(msg); } /** * Find caller. * * @param currentThread the current thread * @return the stacktrace element of the caller outside of the warden, null if none found */ public static StackTraceElement findCallingElement(final Thread currentThread) { for (StackTraceElement ste : currentThread.getStackTrace()) { String classname = ste.getClassName(); if (!classname.startsWith(Warden.class.getName()) && !classname.startsWith("java.lang.")) { return ste; } } return null; } /** * Checks whether the stacktrace chain contains a given exception. * * @param throwable to check * @param containedThrowableClass exception to check for presence * @return true if the exception is contained in the {@link Throwable#getCause() chain} */ public static boolean stacktraceContainsException(final Throwable throwable, final Class<? extends Throwable> containedThrowableClass) { int n = 0; // count to avoid looping Throwable cause = throwable; while (cause != null && n < MAX_TESTED_EXCEPTION_NESTING) { if (containedThrowableClass.isInstance(cause)) { return true; } // special common loop if (cause == cause.getCause()) { break; } cause = cause.getCause(); n++; } return false; } /** * Checks whether the stacktrace chain contains a given exception. * * @param exception to check * @param containedException exception to check for presence * @return true if the exception is contained in the {@link Throwable#getCause() chain} */ public static boolean stacktraceContainsException(final Throwable exception, final Throwable containedException) { Throwable cause = exception; int n = 0; while (cause != null && n < MAX_TESTED_EXCEPTION_NESTING) { if (cause == containedException) { // NOPMD we want to test for same exception return true; } cause = cause.getCause(); n++; } return false; } /** * Extracts all unique message texts from a (nested) stacktrace. * * @param throwable to extract messages from * @return List of messages, may be empty */ @Nonnull public static List<String> extractReasons(@Nonnull final Throwable throwable) { List<String> reasons = L.l(); addReasons(throwable, reasons); return reasons; } private static void addReasons(final Throwable throwable, final List<String> reasons) { int n = 0; // count to avoid looping Throwable cause = throwable; while (cause != null && n++ < MAX_TESTED_EXCEPTION_NESTING && reasons.size() < 100) { if (cause instanceof MultiCauseException) { for (Throwable t : ((MultiCauseException) cause).getCauses()) { addReasons(t, reasons); } } String msg = cause.getMessage(); if (msg == null || msg.trim().isEmpty()) { if (cause instanceof NullPointerException) { msg = "missing or null value"; } else { msg = cause.getClass().getSimpleName(); } } boolean found = false; Iterator<String> it = reasons.iterator(); while (it.hasNext()) { String reason = it.next(); if (reason.contains(msg)) { found = true; break; } if (msg.contains(reason)) { it.remove(); break; } } if (!found) { reasons.add(msg); } // special common loop if (cause == cause.getCause()) { break; } cause = cause.getCause(); } } }
package org.chail.orc.utils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.orc.OrcFile; import org.apache.orc.Reader; import org.apache.orc.TypeDescription; import org.apache.orc.Writer; import org.chail.orc.OrcField; import org.chail.orc.input.MyOrcInputFormat; import org.chail.orc.input.MyOrcRecordReader; import org.chail.orc.output.TDHOrcFileds; import org.pentaho.di.core.RowMetaAndData; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @ClassName : OrcUtils * @Description : orc获取有kerberos * @Author : Chail * @Date: 2020-11-02 20:26 */ public class OrcUtils extends BaseHdfsUtils{ public OrcUtils(String path, Configuration configuration) throws Exception { super(path, configuration); } public OrcUtils() throws Exception { } /** * 初始化 * * @param path * @throws Exception */ public OrcUtils(String path) throws Exception { super(path); } /** * 创建orc的写 * * @param filePath * @param schema * @param conf * @return * @throws Exception */ public Writer createOrcWirter(String filePath, TypeDescription schema, Configuration conf) throws Exception { return lock(() -> { return getUgi(isKerberos).doAs(new PrivilegedExceptionAction<Writer>() { @Override public Writer run() throws Exception { OrcFile.WriterOptions setSchema = OrcFile.writerOptions(conf).setSchema(schema); return OrcFile.createWriter(new Path(filePath), setSchema); } }); }); } /** * 获取orc的读取 * * @param filePath * @param conf * @return * @throws Exception */ public Reader getOrcReard(String filePath, Configuration conf) throws Exception { return lock(() -> { return getUgi(isKerberos).doAs(new PrivilegedExceptionAction<Reader>() { @Override public Reader run() throws Exception { FileSystem fileSystem = getFileSystem(path.toString(), configuration); OrcFile.ReaderOptions readerOptions = OrcFile.readerOptions(conf).filesystem(fileSystem); Reader createReader = OrcFile.createReader(new Path(filePath), readerOptions); return createReader; } }); }); } /** * 获取输出字段 * @param path */ public List<OrcField> getInputFeildsFromSchema(String path) throws Exception { List<OrcField> orcFields=new ArrayList<>(); Reader orcReard = getOrcReard(path, getConfiguration()); TypeDescription schema = orcReard.getSchema(); List<TypeDescription> children = schema.getChildren(); List<String> fieldNames = schema.getFieldNames(); for (int i = 0; i < children.size(); i++) { TypeDescription child = children.get(i); if (child.getCategory() == TypeDescription.Category.STRUCT) { for (int k = 0; k < child.getChildren().size(); k++) { orcFields.add(new OrcField(child.getFieldNames().get(k), child.getChildren().get(k).toString())); } } else { orcFields.add(new OrcField(fieldNames.get(i), child.toString())); } } return orcFields; } public Iterator<RowMetaAndData> getRowMetaAndData(String fileName) throws Exception { List<OrcField> inputFeildsFromSchema =getInputFeildsFromSchema(fileName); boolean torc = TDHOrcFileds.isTorc(inputFeildsFromSchema); List<OrcField> removetorcfiled = TDHOrcFileds.removetorcfiled(inputFeildsFromSchema); MyOrcInputFormat format = new MyOrcInputFormat(this, fileName); format.setTorc(torc); format.setConsumerInputFields(removetorcfiled); MyOrcRecordReader createRecordReader = format.createRecordReader(); Iterator<RowMetaAndData> iterator = createRecordReader.iterator(); return iterator; } }
package com.chat.zipchat.Adapter; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.chat.zipchat.Activity.ChatActivity; import com.chat.zipchat.Common.App; import com.chat.zipchat.Model.ChatList.ChatListPojo; import com.chat.zipchat.Model.Contact.ResultItem; import com.chat.zipchat.Model.Contact.ResultItemDao; import com.chat.zipchat.R; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import static com.chat.zipchat.Common.BaseClass.CurrentDateTime; public class ChatListAdapter extends RecyclerView.Adapter<ChatListAdapter.ViewHolder> { private Context mContext; private List<ChatListPojo> chatAdapterList; public ChatListAdapter(Context context, List<ChatListPojo> chatAdapterlist) { mContext = context; this.chatAdapterList = chatAdapterlist; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_chat, viewGroup, false); return new ChatListAdapter.ViewHolder(view); } @Override public void onBindViewHolder(@NonNull ViewHolder viewHolder, final int position) { final List<ResultItem> resultItems = App.getmInstance().resultItemDao.queryBuilder().where( ResultItemDao.Properties.Id.eq(chatAdapterList.get(position).getToId())).list(); if (resultItems.size() > 0) { if (resultItems.get(0).getIsFromContact().equalsIgnoreCase("1")) { viewHolder.mTxtName.setText(resultItems.get(0).getName()); } else { viewHolder.mTxtName.setText(resultItems.get(0).getMobile_number()); } Glide.with(mContext).load(resultItems.get(0).getProfile_picture()).error(R.drawable.defult_user).into(viewHolder.mImgContact); } else { viewHolder.mTxtName.setText("Unknown"); } viewHolder.mTxtMessage.setText(chatAdapterList.get(position).getText()); String date1 = chatAdapterList.get(position).getTimestamp(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm a"); Date testDate = null; try { testDate = sdf.parse(date1); } catch (Exception ex) { ex.printStackTrace(); } SimpleDateFormat formatDate = new SimpleDateFormat("dd/MM/yy"); String strCurrentTime = formatDate.format(CurrentDateTime()); String strCurrentDate = formatDate.format(testDate); if (strCurrentTime.equalsIgnoreCase(strCurrentDate)) { SimpleDateFormat formatter = new SimpleDateFormat("hh:mm a"); String newFormat = formatter.format(testDate); viewHolder.mTxtTime.setText(newFormat); } else { viewHolder.mTxtTime.setText(strCurrentDate); } viewHolder.mRlChat.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mContext, ChatActivity.class); intent.putExtra("toId", chatAdapterList.get(position).getToId()); mContext.startActivity(intent); } }); } @Override public int getItemCount() { return chatAdapterList.size(); } public class ViewHolder extends RecyclerView.ViewHolder { ImageView mImgContact; TextView mTxtName, mTxtTime, mTxtMessage; ImageView imgTik; RelativeLayout mRlChat; public ViewHolder(@NonNull View itemView) { super(itemView); mImgContact = itemView.findViewById(R.id.mImgContact); mTxtName = itemView.findViewById(R.id.mTxtName); mTxtTime = itemView.findViewById(R.id.mTxtTime); mTxtMessage = itemView.findViewById(R.id.mTxtMessage); imgTik = itemView.findViewById(R.id.imgTik); mRlChat = itemView.findViewById(R.id.mRlChat); } } public void updateFragChatList(List<ChatListPojo> newlist) { this.chatAdapterList = newlist; notifyDataSetChanged(); } }
package utility; import java.io.File; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import factory.BrowserFactory; public class Screenshot extends BrowserFactory{ public String Screenshot(String name) throws Exception { TakesScreenshot ts= (TakesScreenshot)driver; File src= ts.getScreenshotAs(OutputType.FILE); String dest= "C:\\Users\\altaf\\eclipse-workspace-practice\\com.hybrid.com\\Screenshots\\"+name+System.currentTimeMillis()+".png"; File destination= new File(dest); FileUtils.copyFile(src, destination); return dest; } }
package com.jim.multipos.ui.reports.service_fee; import com.jim.multipos.config.scope.PerFragment; import dagger.Binds; import dagger.Module; /** * Created by Sirojiddin on 20.01.2018. */ @Module public abstract class ServiceFeeReportPresenterModule { @Binds @PerFragment abstract ServiceFeeReportPresenter provideServiceReportPresenter(ServiceFeeReportPresenterImpl serviceFeeReportPresenter); }
package edu.mayo.cts2.framework.model.extension; import edu.mayo.cts2.framework.model.association.Association; public class LocalIdAssociation extends ChangeableLocalIdResource<Association> { public LocalIdAssociation(Association resource) { super(resource); } public LocalIdAssociation(String localID, Association resource) { super(localID, resource); } }
public class Switch extends Control { private Signal signalOne; private Signal signalTwo; }
package com.decrypt.beeglejobsearch.utils; import android.app.Application; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.decrypt.beeglejobsearch.di.DaggerService; import com.decrypt.beeglejobsearch.di.components.AppComponent; import com.decrypt.beeglejobsearch.di.components.DaggerAppComponent; import com.decrypt.beeglejobsearch.di.modules.RootModule; import com.decrypt.beeglejobsearch.mortar.ScreenScoper; import com.decrypt.beeglejobsearch.ui.activities.DaggerRootActivity_RootComponent; import com.decrypt.beeglejobsearch.ui.activities.RootActivity; import com.decrypt.beeglejobsearch.di.modules.AppModule; import com.decrypt.beeglejobsearch.di.modules.PicassoCacheModule; import mortar.MortarScope; import mortar.bundler.BundleServiceRunner; public class MvpAuthApplication extends Application { public static SharedPreferences sSharedPreferences; private static Context sContext; private static AppComponent appComponent; /** * Необходимо подговить класс Application для работы с Мортаром */ private MortarScope mMortarScope; private MortarScope mRootActivityScope; private static RootActivity.RootComponent mRootComponent; @Override public void onCreate() { super.onCreate(); sContext = getApplicationContext(); createDaggerComponent(); sSharedPreferences= PreferenceManager.getDefaultSharedPreferences(this); createRootActivityComponent(); /** * Создаем корневую область видимости */ mMortarScope = MortarScope.buildRootScope() .withService(DaggerService.SERVICE_NAME, appComponent) .build("Root"); /** * Так как RootActivity будет существовать всегда - в App необходимо создать ее скоуп */ mRootActivityScope = mMortarScope.buildChild() .withService(DaggerService.SERVICE_NAME, mRootComponent) /** * сервис который будет сохранять презентеры в bundle */ .withService(BundleServiceRunner.SERVICE_NAME, new BundleServiceRunner()) .build(RootActivity.class.getName()); /** * Необходимо зарегестрировать созданные скоупы, которые будут жить все время жизни приложения * Имеено благодаря этим скоупам мы моежм восстановить всю цепочку областей видимости до * конкретного экрана -> это главный плюс реализации ScreenScoper'а */ ScreenScoper.registerScope(mMortarScope); ScreenScoper.registerScope(mRootActivityScope); } private void createRootActivityComponent() { mRootComponent = DaggerRootActivity_RootComponent.builder() .appComponent(appComponent) .rootModule(new RootModule()) .picassoCacheModule(new PicassoCacheModule()) .build(); } /** * Для работы с Mortar необходимо переопределить метод getSystemService * @param name * @return */ @Override public Object getSystemService(String name) { return (mMortarScope != null && mMortarScope.hasService(name)) ? mMortarScope.getService(name) : super.getSystemService(name); } public static RootActivity.RootComponent getRootActivityRootComponent() { return mRootComponent; } public static SharedPreferences getSharedPreferences() { return sSharedPreferences; } public static Context getContext() {return sContext;} public static AppComponent getAppComponent() { return appComponent; } private void createDaggerComponent() { appComponent = DaggerAppComponent.builder() .appModule(new AppModule(sContext)) .build(); } }
package com.rd.agergia.testing.dao.test; import java.util.Date; import javax.annotation.Resource; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.rd.agergia.common.entity.Pager; import com.rd.agergia.common.entity.PagerParam; import com.rd.agergia.testing.dao.ibatis.SqlMapTestingDAO; import com.rd.agergia.testing.entity.Testing; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:spring/applicationContext.xml" }) public class SqlMapTestingDaoTest { @Resource private SqlMapTestingDAO sqlMapTestingDAO; @Test public void testInsert() { Testing t = new Testing(); Date d=new Date(); t.setName("测试模块今天111"+d); t.setStatus(false); sqlMapTestingDAO.saveTesting(t); } @Test public void getTesting() { System.out.println(sqlMapTestingDAO.find(new Testing(), 2)); } @Test public void deleteTesting() { sqlMapTestingDAO.deleteTesting(new Testing(), 2); } @Test public void getPageing(){ PagerParam pager=new PagerParam(); pager.setPageOffset(0); pager.setPageSize(5); pager.setOrder("desc"); pager.setSort("id"); Pager<Testing> p=sqlMapTestingDAO.pageing(new Testing(), pager); for(Testing t:p.getData()){ System.out.println(t); } } }
package api.longpoll.bots.model.objects.basic; import api.longpoll.bots.adapters.deserializers.BoolIntDeserializer; import api.longpoll.bots.model.objects.additional.Country; import api.longpoll.bots.model.objects.additional.CropPhoto; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import java.util.List; import java.util.Map; /** * Describes user. * * @see <a href="https://vk.com/dev/objects/user">User</a> */ public class User { /** * User ID. */ @SerializedName("id") private Integer id; /** * First name. */ @SerializedName("first_name") private String firstName; /** * Last name. */ @SerializedName("last_name") private String lastName; /** * Returns if a profile is deleted or blocked. */ @SerializedName("deactivated") private String deactivated; /** * <b>true</b>, if user profile is closed by his privacy settings. */ @SerializedName("is_closed") private Boolean closed; /** * <b>true</b>, if current user can see user profile. */ @SerializedName("can_access_closed") private Boolean canAccessClosed; /** * "About me". */ @SerializedName("about") private String about; /** * Activities. */ @SerializedName("activities") private String activities; /** * User's date of birth. Returned as DD.MM.YYYY or DD.MM (if birth year is hidden). If the whole date is hidden, no field is returned. */ @SerializedName("bdate") private String birthDate; /** * <b>true</b> if a current user is in the requested user's blacklist. */ @SerializedName("blacklisted") @JsonAdapter(BoolIntDeserializer.class) private Boolean blacklisted; /** * <b>true</b> if a user is in the current user's blacklist. */ @SerializedName("blacklisted_by_me") @JsonAdapter(BoolIntDeserializer.class) private Boolean blacklistedByMe; /** * Favorite books. */ @SerializedName("books") private String books; /** * Whether current user can post on the wall. */ @SerializedName("can_post") @JsonAdapter(BoolIntDeserializer.class) private Boolean canPost; /** * Whether current user can see other users' posts on the wall. */ @SerializedName("can_see_all_posts") @JsonAdapter(BoolIntDeserializer.class) private Boolean canSeeAllPosts; /** * Whether current user can see users' audio. */ @SerializedName("can_see_audio") @JsonAdapter(BoolIntDeserializer.class) private Boolean canSeeAudio; /** * Whether current user can send friend request to a user. */ @SerializedName("can_send_friend_request") @JsonAdapter(BoolIntDeserializer.class) private Boolean canSendFriendRequest; /** * Whether current user can write private messages to a user. */ @SerializedName("can_write_private_message") @JsonAdapter(BoolIntDeserializer.class) private Boolean canWritePrivateMessage; /** * Information about user's career. */ @SerializedName("career") private Career career; /** * Information about user's military service. */ @SerializedName("military") private Military military; /** * Favorite movies. */ @SerializedName("movies") private String movies; /** * Favorite music. */ @SerializedName("music") private String music; /** * Nickname. */ @SerializedName("nickname") private String nickname; /** * City specified on user's page in "Contacts" section. */ @SerializedName("city") private String city; /** * Number of common friends with current user. */ @SerializedName("common_count") private Integer commonCount; /** * Returns specified services such as: skype, facebook, twitter, livejournal, instagram. */ @SerializedName("connections") private Map<String, String> connections; /** * Information about user's phone numbers. */ @SerializedName("contacts") private Contacts contacts; /** * Number of various objects the user has. */ @SerializedName("counters") private Counters counters; /** * Country specified on user's page in "Contacts" section. */ @SerializedName("country") private Country country; /** * Data about points used for cropping of profile and preview user photos. */ @SerializedName("crop_photo") private CropPhoto cropPhoto; /** * Page screen name. */ @SerializedName("domain") private String domain; /** * Information about user's higher education institution. */ @SerializedName("education") private Education education; /** * External services with export configured (twitter, facebook, livejournal, instagram). */ @SerializedName("exports") private String exports; /** * First name in nominative case. */ @SerializedName("first_name_nom") private String firstNameNom; /** * First name in genitive case. */ @SerializedName("first_name_gen") private String firstNameGen; /** * First name in dative case. */ @SerializedName("first_name_dat") private String firstNameDat; /** * First name in accusative case. */ @SerializedName("first_name_acc") private String firstNameAcc; /** * First name in instrumental case. */ @SerializedName("first_name_ins") private String firstNameIns; /** * First name in prepositional case. */ @SerializedName("first_name_abl") private String firstNameAbl; /** * Number of followers. */ @SerializedName("followers_count") private Integer followersCount; /** * Friend status with a current user. */ @SerializedName("friend_status") private Integer friendStatus; /** * Favorite games. */ @SerializedName("games") private String games; /** * Whether the user's mobile phone number is available. */ @SerializedName("has_mobile") @JsonAdapter(BoolIntDeserializer.class) private Boolean hasMobile; /** * Whether the user has profile photo. */ @SerializedName("has_photo") @JsonAdapter(BoolIntDeserializer.class) private Boolean hasPhoto; /** * User's home town name. */ @SerializedName("home_town") private String homeTown; /** * Interests. */ @SerializedName("interests") private String interests; /** * Whether the user is in faves of current user. */ @SerializedName("is_favorite") @JsonAdapter(BoolIntDeserializer.class) private Boolean favorite; /** * Whether the user is a friend of current user. */ @SerializedName("is_friend") @JsonAdapter(BoolIntDeserializer.class) private Boolean friend; /** * Whether the user is hidden from current user's feed. */ @SerializedName("is_hidden_from_feed") @JsonAdapter(BoolIntDeserializer.class) private Boolean hiddenFromFeed; /** * Last name in nominative case. */ @SerializedName("last_name_nom") private String lastNameNom; /** * Last name in genitive case. */ @SerializedName("last_name_gen") private String lastNameGen; /** * Last name in dative case. */ @SerializedName("last_name_dat") private String lastNameDat; /** * Last name in accusative case. */ @SerializedName("last_name_acc") private String lastNameAcc; /** * Last name in instrumental case. */ @SerializedName("last_name_ins") private String lastNameIns; /** * Last name in prepositional case. */ @SerializedName("last_name_abl") private String lastNameAbl; /** * Last visit date. */ @SerializedName("last_seen") private LastSeen lastSeen; /** * Comma-separated friend lists IDs the user is included to. */ @SerializedName("lists") private String lists; /** * Maiden name. */ @SerializedName("maiden_name") private String maidenName; /** * User's occupation. */ @SerializedName("occupation") private Occupation occupation; /** * Whether the user is online. */ @SerializedName("online") @JsonAdapter(BoolIntDeserializer.class) private Boolean online; /** * Information from the "Personal views" section. */ @SerializedName("personal") private Personal personal; /** * URL of square photo of the user with 50 pixels in width. */ @SerializedName("photo_50") private String photo_50; /** * URL of square photo of the user with 100 pixels in width. */ @SerializedName("photo_100") private String photo_100; /** * URL of user's photo with 200 pixels in width. */ @SerializedName("photo_200_orig") private String photo_200_orig; /** * URL of square photo of the user with 200 pixels in width. */ @SerializedName("photo_200") private String photo_200; /** * URL of user's photo with 400 pixels in width. */ @SerializedName("photo_400_orig") private String photo_400_orig; /** * String ID of the main profile photo in format {user_id}_{photo_id}, e.g., 6492_192164258. */ @SerializedName("photo_id") private String photo_id; /** * URL of square photo of the user with maximum width. */ @SerializedName("photo_max") private String photo_max; /** * URL of user's photo of maximum size. */ @SerializedName("photo_max_orig") private String photo_max_orig; /** * Favorite quotes. */ @SerializedName("quotes") private String quotes; /** * Current user's relatives list. */ @SerializedName("relatives") private List<Relative> relatives; /** * User relationship status. */ @SerializedName("relation") private Integer relation; /** * List of schools where user studied. */ @SerializedName("schools") private List<School> schools; /** * User page's screen name. */ @SerializedName("screen_name") private String screen_name; /** * User sex. */ @SerializedName("sex") private Integer sex; /** * Returns a website address from a user profile. */ @SerializedName("site") private String site; /** * User status. */ @SerializedName("status") private String status; /** * User time zone. */ @SerializedName("timezone") private Integer timezone; /** * Whether the user a "fire" pictogram. */ @SerializedName("trending") @JsonAdapter(BoolIntDeserializer.class) private Boolean trending; /** * Favorite TV shows. */ @SerializedName("tv") private String tv; /** * List of higher education institutions where user studied. */ @SerializedName("universities") private List<University> universities; /** * <b>true</b> if the profile is verified. */ @SerializedName("verified") @JsonAdapter(BoolIntDeserializer.class) private Boolean verified; /** * Wall default. */ @SerializedName("wall_default") private String wall_default; /** * Describes career. */ public static class Career { /** * Community ID. */ @SerializedName("group_id") private Integer groupId; /** * Company name. */ @SerializedName("company") private String company; /** * Country ID. */ @SerializedName("country_id") private Integer countryId; /** * City ID. */ @SerializedName("city_id") private Integer cityId; /** * City name. */ @SerializedName("city_name") private Integer cityName; /** * Career beginning year. */ @SerializedName("from") private Integer from; /** * Career ending year. */ @SerializedName("until") private Integer until; /** * Position. */ @SerializedName("position") private String position; public Integer getGroupId() { return groupId; } public void setGroupId(Integer groupId) { this.groupId = groupId; } public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } public Integer getCountryId() { return countryId; } public void setCountryId(Integer countryId) { this.countryId = countryId; } public Integer getCityId() { return cityId; } public void setCityId(Integer cityId) { this.cityId = cityId; } public Integer getCityName() { return cityName; } public void setCityName(Integer cityName) { this.cityName = cityName; } public Integer getFrom() { return from; } public void setFrom(Integer from) { this.from = from; } public Integer getUntil() { return until; } public void setUntil(Integer until) { this.until = until; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } @Override public String toString() { return "Career{" + "groupId=" + groupId + ", company='" + company + '\'' + ", countryId=" + countryId + ", cityId=" + cityId + ", cityName=" + cityName + ", from=" + from + ", until=" + until + ", position='" + position + '\'' + '}'; } } /** * Describes city. */ public static class City { /** * City ID. */ @SerializedName("id") private Integer id; /** * City name. */ @SerializedName("title") private String title; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } @Override public String toString() { return "City{" + "id=" + id + ", title='" + title + '\'' + '}'; } } /** * Describes user's phone numbers. */ public static class Contacts { /** * User's mobile phone number. */ @SerializedName("mobile_phone") private String mobilePhone; /** * User's additional phone number. */ @SerializedName("home_phone") private String homePhone; public String getMobilePhone() { return mobilePhone; } public void setMobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; } public String getHomePhone() { return homePhone; } public void setHomePhone(String homePhone) { this.homePhone = homePhone; } @Override public String toString() { return "Contacts{" + "mobilePhone='" + mobilePhone + '\'' + ", homePhone='" + homePhone + '\'' + '}'; } } /** * Describes user's counters. */ public static class Counters { /** * Number of photo albums. */ @SerializedName("albums") private Integer albums; /** * Number of videos. */ @SerializedName("videos") private Integer videos; /** * Number of audios. */ @SerializedName("audios") private Integer audios; /** * Number of photos. */ @SerializedName("photos") private Integer photos; /** * Number of notes. */ @SerializedName("notes") private Integer notes; /** * Number of friends. */ @SerializedName("friends") private Integer friends; /** * Number of communities. */ @SerializedName("groups") private Integer groups; /** * Number of online friends. */ @SerializedName("online_friends") private Integer onlineFriends; /** * Number of mutual friends. */ @SerializedName("mutual_friends") private Integer mutualFriends; /** * Number of videos the user is tagged on. */ @SerializedName("user_videos") private Integer userVideos; /** * Number of followers. */ @SerializedName("followers") private Integer followers; /** * Number of subscriptions. */ @SerializedName("pages") private Integer pages; public Integer getAlbums() { return albums; } public void setAlbums(Integer albums) { this.albums = albums; } public Integer getVideos() { return videos; } public void setVideos(Integer videos) { this.videos = videos; } public Integer getAudios() { return audios; } public void setAudios(Integer audios) { this.audios = audios; } public Integer getPhotos() { return photos; } public void setPhotos(Integer photos) { this.photos = photos; } public Integer getNotes() { return notes; } public void setNotes(Integer notes) { this.notes = notes; } public Integer getFriends() { return friends; } public void setFriends(Integer friends) { this.friends = friends; } public Integer getGroups() { return groups; } public void setGroups(Integer groups) { this.groups = groups; } public Integer getOnlineFriends() { return onlineFriends; } public void setOnlineFriends(Integer onlineFriends) { this.onlineFriends = onlineFriends; } public Integer getMutualFriends() { return mutualFriends; } public void setMutualFriends(Integer mutualFriends) { this.mutualFriends = mutualFriends; } public Integer getUserVideos() { return userVideos; } public void setUserVideos(Integer userVideos) { this.userVideos = userVideos; } public Integer getFollowers() { return followers; } public void setFollowers(Integer followers) { this.followers = followers; } public Integer getPages() { return pages; } public void setPages(Integer pages) { this.pages = pages; } @Override public String toString() { return "Counters{" + "albums=" + albums + ", videos=" + videos + ", audios=" + audios + ", photos=" + photos + ", notes=" + notes + ", friends=" + friends + ", groups=" + groups + ", onlineFriends=" + onlineFriends + ", mutualFriends=" + mutualFriends + ", userVideos=" + userVideos + ", followers=" + followers + ", pages=" + pages + '}'; } } /** * Describes higher education institution. */ public static class Education { /** * University ID. */ @SerializedName("university") private Integer university; /** * University name. */ @SerializedName("university_name") private String universityName; /** * Faculty ID. */ @SerializedName("faculty") private Integer faculty; /** * Faculty name. */ @SerializedName("faculty_name") private String facultyName; /** * Graduation year. */ @SerializedName("graduation") private Integer graduation; public Integer getUniversity() { return university; } public void setUniversity(Integer university) { this.university = university; } public String getUniversityName() { return universityName; } public void setUniversityName(String universityName) { this.universityName = universityName; } public Integer getFaculty() { return faculty; } public void setFaculty(Integer faculty) { this.faculty = faculty; } public String getFacultyName() { return facultyName; } public void setFacultyName(String facultyName) { this.facultyName = facultyName; } public Integer getGraduation() { return graduation; } public void setGraduation(Integer graduation) { this.graduation = graduation; } @Override public String toString() { return "Education{" + "university=" + university + ", universityName='" + universityName + '\'' + ", faculty=" + faculty + ", facultyName='" + facultyName + '\'' + ", graduation=" + graduation + '}'; } } /** * Describes last_seen object. */ public static class LastSeen { /** * Last visit date (in Unixtime). */ @SerializedName("time") private Integer time; /** * Type of the platform that used for the last authorization. */ @SerializedName("platform") private Integer platform; public Integer getTime() { return time; } public void setTime(Integer time) { this.time = time; } public Integer getPlatform() { return platform; } public void setPlatform(Integer platform) { this.platform = platform; } @Override public String toString() { return "LastSeen{" + "time=" + time + ", platform=" + platform + '}'; } } /** * Describes military service. */ public static class Military { /** * Unit number. */ @SerializedName("unit") private String unit; /** * Unit ID. */ @SerializedName("unit_id") private Integer unitId; /** * Country ID. */ @SerializedName("country_id") private Integer countyId; /** * Service starting year. */ @SerializedName("from") private Integer from; /** * Service ending year. */ @SerializedName("until") private Integer until; public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } public Integer getUnitId() { return unitId; } public void setUnitId(Integer unitId) { this.unitId = unitId; } public Integer getCountyId() { return countyId; } public void setCountyId(Integer countyId) { this.countyId = countyId; } public Integer getFrom() { return from; } public void setFrom(Integer from) { this.from = from; } public Integer getUntil() { return until; } public void setUntil(Integer until) { this.until = until; } @Override public String toString() { return "Military{" + "unit='" + unit + '\'' + ", unitId=" + unitId + ", countyId=" + countyId + ", from=" + from + ", until=" + until + '}'; } } /** * Describes occupation. */ public static class Occupation { /** * Possible values: work, school, university. */ @SerializedName("type") private String type; /** * ID of school, university, company group. */ @SerializedName("id") private Integer id; /** * Name of school, university or work place. */ @SerializedName("name") private String name; public String getType() { return type; } public void setType(String type) { this.type = type; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "Occupation{" + "type='" + type + '\'' + ", id=" + id + ", name='" + name + '\'' + '}'; } } /** * Describes "Personal views" section. */ public static class Personal { /** * Political views. */ @SerializedName("political") private Integer political; /** * Languages. */ @SerializedName("langs") private List<String> langs; /** * World view. */ @SerializedName("religion") private String religion; /** * Inspired by. */ @SerializedName("inspired_by") private String inspired_by; /** * Improtant in others. */ @SerializedName("people_main") private Integer people_main; /** * Personal priority. */ @SerializedName("life_main") private Integer life_main; /** * Views on smoking. */ @SerializedName("smoking") private Integer smoking; /** * Views on alcohol. */ @SerializedName("alcohol") private Integer alcohol; public Integer getPolitical() { return political; } public void setPolitical(Integer political) { this.political = political; } public List<String> getLangs() { return langs; } public void setLangs(List<String> langs) { this.langs = langs; } public String getReligion() { return religion; } public void setReligion(String religion) { this.religion = religion; } public String getInspired_by() { return inspired_by; } public void setInspired_by(String inspired_by) { this.inspired_by = inspired_by; } public Integer getPeople_main() { return people_main; } public void setPeople_main(Integer people_main) { this.people_main = people_main; } public Integer getLife_main() { return life_main; } public void setLife_main(Integer life_main) { this.life_main = life_main; } public Integer getSmoking() { return smoking; } public void setSmoking(Integer smoking) { this.smoking = smoking; } public Integer getAlcohol() { return alcohol; } public void setAlcohol(Integer alcohol) { this.alcohol = alcohol; } @Override public String toString() { return "Personal{" + "political=" + political + ", langs=" + langs + ", religion='" + religion + '\'' + ", inspired_by='" + inspired_by + '\'' + ", people_main=" + people_main + ", life_main=" + life_main + ", smoking=" + smoking + ", alcohol=" + alcohol + '}'; } } /** * Describes relative. */ public static class Relative { /** * Relative id. */ @SerializedName("id") private Integer id; /** * Relative name. */ @SerializedName("name") private String name; /** * Relationship type. */ @SerializedName("type") private String type; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type; } public void setType(String type) { this.type = type; } @Override public String toString() { return "Relative{" + "id=" + id + ", name='" + name + '\'' + ", type='" + type + '\'' + '}'; } } /** * Describes school. */ public static class School { /** * School ID. */ @SerializedName("id") private Integer id; /** * ID of the country the school is located in. */ @SerializedName("country") private Integer country; /** * ID of the city the school is located in */ @SerializedName("city") private Integer city; /** * School name. */ @SerializedName("name") private String name; /** * Year the user started to study. */ @SerializedName("year_from") private Integer yearFrom; /** * Year the user finished to study. */ @SerializedName("year_to") private Integer yearTo; /** * Graduation year. */ @SerializedName("year_graduated") private Integer yearGraduated; /** * School class letter. */ @SerializedName("class") private String className; /** * Speciality. */ @SerializedName("speciality") private String speciality; /** * Type ID. */ @SerializedName("type") private Integer type; /** * Type name. */ @SerializedName("type_str") private String type_str; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getCountry() { return country; } public void setCountry(Integer country) { this.country = country; } public Integer getCity() { return city; } public void setCity(Integer city) { this.city = city; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getYearFrom() { return yearFrom; } public void setYearFrom(Integer yearFrom) { this.yearFrom = yearFrom; } public Integer getYearTo() { return yearTo; } public void setYearTo(Integer yearTo) { this.yearTo = yearTo; } public Integer getYearGraduated() { return yearGraduated; } public void setYearGraduated(Integer yearGraduated) { this.yearGraduated = yearGraduated; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public String getSpeciality() { return speciality; } public void setSpeciality(String speciality) { this.speciality = speciality; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } public String getType_str() { return type_str; } public void setType_str(String type_str) { this.type_str = type_str; } @Override public String toString() { return "School{" + "id=" + id + ", country=" + country + ", city=" + city + ", name='" + name + '\'' + ", yearFrom=" + yearFrom + ", yearTo=" + yearTo + ", yearGraduated=" + yearGraduated + ", className='" + className + '\'' + ", speciality='" + speciality + '\'' + ", type=" + type + ", type_str='" + type_str + '\'' + '}'; } } /** * Describes higher education institution. */ public static class University { /** * University ID. */ @SerializedName("id") private Integer id; /** * ID of the country the university is located in. */ @SerializedName("country") private Integer country; /** * ID of the city the university is located in. */ @SerializedName("city") private Integer city; /** * University name. */ @SerializedName("name") private String name; /** * Faculty ID. */ @SerializedName("faculty") private Integer faculty; /** * Faculty name. */ @SerializedName("faculty_name") private String faculty_name; /** * University chair ID. */ @SerializedName("chair") private String chair; /** * Chair name. */ @SerializedName("chair_name") private String chair_name; /** * Graduation year. */ @SerializedName("graduation") private Integer graduation; /** * Eucation form. */ @SerializedName("education_form") private String education_form; /** * Status. */ @SerializedName("education_status") private String education_status; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getCountry() { return country; } public void setCountry(Integer country) { this.country = country; } public Integer getCity() { return city; } public void setCity(Integer city) { this.city = city; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getFaculty() { return faculty; } public void setFaculty(Integer faculty) { this.faculty = faculty; } public String getFaculty_name() { return faculty_name; } public void setFaculty_name(String faculty_name) { this.faculty_name = faculty_name; } public String getChair() { return chair; } public void setChair(String chair) { this.chair = chair; } public String getChair_name() { return chair_name; } public void setChair_name(String chair_name) { this.chair_name = chair_name; } public Integer getGraduation() { return graduation; } public void setGraduation(Integer graduation) { this.graduation = graduation; } public String getEducation_form() { return education_form; } public void setEducation_form(String education_form) { this.education_form = education_form; } public String getEducation_status() { return education_status; } public void setEducation_status(String education_status) { this.education_status = education_status; } @Override public String toString() { return "University{" + "id=" + id + ", country=" + country + ", city=" + city + ", name='" + name + '\'' + ", faculty=" + faculty + ", faculty_name='" + faculty_name + '\'' + ", chair='" + chair + '\'' + ", chair_name='" + chair_name + '\'' + ", graduation=" + graduation + ", education_form='" + education_form + '\'' + ", education_status='" + education_status + '\'' + '}'; } } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getDeactivated() { return deactivated; } public void setDeactivated(String deactivated) { this.deactivated = deactivated; } public Boolean getClosed() { return closed; } public void setClosed(Boolean closed) { this.closed = closed; } public Boolean getCanAccessClosed() { return canAccessClosed; } public void setCanAccessClosed(Boolean canAccessClosed) { this.canAccessClosed = canAccessClosed; } public String getAbout() { return about; } public void setAbout(String about) { this.about = about; } public String getActivities() { return activities; } public void setActivities(String activities) { this.activities = activities; } public String getBirthDate() { return birthDate; } public void setBirthDate(String birthDate) { this.birthDate = birthDate; } public Boolean getBlacklisted() { return blacklisted; } public void setBlacklisted(Boolean blacklisted) { this.blacklisted = blacklisted; } public Boolean getBlacklistedByMe() { return blacklistedByMe; } public void setBlacklistedByMe(Boolean blacklistedByMe) { this.blacklistedByMe = blacklistedByMe; } public String getBooks() { return books; } public void setBooks(String books) { this.books = books; } public Boolean getCanPost() { return canPost; } public void setCanPost(Boolean canPost) { this.canPost = canPost; } public Boolean getCanSeeAllPosts() { return canSeeAllPosts; } public void setCanSeeAllPosts(Boolean canSeeAllPosts) { this.canSeeAllPosts = canSeeAllPosts; } public Boolean getCanSeeAudio() { return canSeeAudio; } public void setCanSeeAudio(Boolean canSeeAudio) { this.canSeeAudio = canSeeAudio; } public Boolean getCanSendFriendRequest() { return canSendFriendRequest; } public void setCanSendFriendRequest(Boolean canSendFriendRequest) { this.canSendFriendRequest = canSendFriendRequest; } public Boolean getCanWritePrivateMessage() { return canWritePrivateMessage; } public void setCanWritePrivateMessage(Boolean canWritePrivateMessage) { this.canWritePrivateMessage = canWritePrivateMessage; } public Career getCareer() { return career; } public void setCareer(Career career) { this.career = career; } public Military getMilitary() { return military; } public void setMilitary(Military military) { this.military = military; } public String getMovies() { return movies; } public void setMovies(String movies) { this.movies = movies; } public String getMusic() { return music; } public void setMusic(String music) { this.music = music; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public Integer getCommonCount() { return commonCount; } public void setCommonCount(Integer commonCount) { this.commonCount = commonCount; } public Map<String, String> getConnections() { return connections; } public void setConnections(Map<String, String> connections) { this.connections = connections; } public Contacts getContacts() { return contacts; } public void setContacts(Contacts contacts) { this.contacts = contacts; } public Counters getCounters() { return counters; } public void setCounters(Counters counters) { this.counters = counters; } public Country getCountry() { return country; } public void setCountry(Country country) { this.country = country; } public CropPhoto getCropPhoto() { return cropPhoto; } public void setCropPhoto(CropPhoto cropPhoto) { this.cropPhoto = cropPhoto; } public String getDomain() { return domain; } public void setDomain(String domain) { this.domain = domain; } public Education getEducation() { return education; } public void setEducation(Education education) { this.education = education; } public String getExports() { return exports; } public void setExports(String exports) { this.exports = exports; } public String getFirstNameNom() { return firstNameNom; } public void setFirstNameNom(String firstNameNom) { this.firstNameNom = firstNameNom; } public String getFirstNameGen() { return firstNameGen; } public void setFirstNameGen(String firstNameGen) { this.firstNameGen = firstNameGen; } public String getFirstNameDat() { return firstNameDat; } public void setFirstNameDat(String firstNameDat) { this.firstNameDat = firstNameDat; } public String getFirstNameAcc() { return firstNameAcc; } public void setFirstNameAcc(String firstNameAcc) { this.firstNameAcc = firstNameAcc; } public String getFirstNameIns() { return firstNameIns; } public void setFirstNameIns(String firstNameIns) { this.firstNameIns = firstNameIns; } public String getFirstNameAbl() { return firstNameAbl; } public void setFirstNameAbl(String firstNameAbl) { this.firstNameAbl = firstNameAbl; } public Integer getFollowersCount() { return followersCount; } public void setFollowersCount(Integer followersCount) { this.followersCount = followersCount; } public Integer getFriendStatus() { return friendStatus; } public void setFriendStatus(Integer friendStatus) { this.friendStatus = friendStatus; } public String getGames() { return games; } public void setGames(String games) { this.games = games; } public Boolean getHasMobile() { return hasMobile; } public void setHasMobile(Boolean hasMobile) { this.hasMobile = hasMobile; } public Boolean getHasPhoto() { return hasPhoto; } public void setHasPhoto(Boolean hasPhoto) { this.hasPhoto = hasPhoto; } public String getHomeTown() { return homeTown; } public void setHomeTown(String homeTown) { this.homeTown = homeTown; } public String getInterests() { return interests; } public void setInterests(String interests) { this.interests = interests; } public Boolean getFavorite() { return favorite; } public void setFavorite(Boolean favorite) { this.favorite = favorite; } public Boolean getFriend() { return friend; } public void setFriend(Boolean friend) { this.friend = friend; } public Boolean getHiddenFromFeed() { return hiddenFromFeed; } public void setHiddenFromFeed(Boolean hiddenFromFeed) { this.hiddenFromFeed = hiddenFromFeed; } public String getLastNameNom() { return lastNameNom; } public void setLastNameNom(String lastNameNom) { this.lastNameNom = lastNameNom; } public String getLastNameGen() { return lastNameGen; } public void setLastNameGen(String lastNameGen) { this.lastNameGen = lastNameGen; } public String getLastNameDat() { return lastNameDat; } public void setLastNameDat(String lastNameDat) { this.lastNameDat = lastNameDat; } public String getLastNameAcc() { return lastNameAcc; } public void setLastNameAcc(String lastNameAcc) { this.lastNameAcc = lastNameAcc; } public String getLastNameIns() { return lastNameIns; } public void setLastNameIns(String lastNameIns) { this.lastNameIns = lastNameIns; } public String getLastNameAbl() { return lastNameAbl; } public void setLastNameAbl(String lastNameAbl) { this.lastNameAbl = lastNameAbl; } public LastSeen getLastSeen() { return lastSeen; } public void setLastSeen(LastSeen lastSeen) { this.lastSeen = lastSeen; } public String getLists() { return lists; } public void setLists(String lists) { this.lists = lists; } public String getMaidenName() { return maidenName; } public void setMaidenName(String maidenName) { this.maidenName = maidenName; } public Occupation getOccupation() { return occupation; } public void setOccupation(Occupation occupation) { this.occupation = occupation; } public Boolean getOnline() { return online; } public void setOnline(Boolean online) { this.online = online; } public Personal getPersonal() { return personal; } public void setPersonal(Personal personal) { this.personal = personal; } public String getPhoto_50() { return photo_50; } public void setPhoto_50(String photo_50) { this.photo_50 = photo_50; } public String getPhoto_100() { return photo_100; } public void setPhoto_100(String photo_100) { this.photo_100 = photo_100; } public String getPhoto_200_orig() { return photo_200_orig; } public void setPhoto_200_orig(String photo_200_orig) { this.photo_200_orig = photo_200_orig; } public String getPhoto_200() { return photo_200; } public void setPhoto_200(String photo_200) { this.photo_200 = photo_200; } public String getPhoto_400_orig() { return photo_400_orig; } public void setPhoto_400_orig(String photo_400_orig) { this.photo_400_orig = photo_400_orig; } public String getPhoto_id() { return photo_id; } public void setPhoto_id(String photo_id) { this.photo_id = photo_id; } public String getPhoto_max() { return photo_max; } public void setPhoto_max(String photo_max) { this.photo_max = photo_max; } public String getPhoto_max_orig() { return photo_max_orig; } public void setPhoto_max_orig(String photo_max_orig) { this.photo_max_orig = photo_max_orig; } public String getQuotes() { return quotes; } public void setQuotes(String quotes) { this.quotes = quotes; } public List<Relative> getRelatives() { return relatives; } public void setRelatives(List<Relative> relatives) { this.relatives = relatives; } public Integer getRelation() { return relation; } public void setRelation(Integer relation) { this.relation = relation; } public List<School> getSchools() { return schools; } public void setSchools(List<School> schools) { this.schools = schools; } public String getScreen_name() { return screen_name; } public void setScreen_name(String screen_name) { this.screen_name = screen_name; } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } public String getSite() { return site; } public void setSite(String site) { this.site = site; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Integer getTimezone() { return timezone; } public void setTimezone(Integer timezone) { this.timezone = timezone; } public Boolean getTrending() { return trending; } public void setTrending(Boolean trending) { this.trending = trending; } public String getTv() { return tv; } public void setTv(String tv) { this.tv = tv; } public List<University> getUniversities() { return universities; } public void setUniversities(List<University> universities) { this.universities = universities; } public Boolean getVerified() { return verified; } public void setVerified(Boolean verified) { this.verified = verified; } public String getWall_default() { return wall_default; } public void setWall_default(String wall_default) { this.wall_default = wall_default; } @Override public String toString() { return "User{" + "id=" + id + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", deactivated='" + deactivated + '\'' + ", closed=" + closed + ", canAccessClosed=" + canAccessClosed + ", about='" + about + '\'' + ", activities='" + activities + '\'' + ", birthDate='" + birthDate + '\'' + ", blacklisted=" + blacklisted + ", blacklistedByMe=" + blacklistedByMe + ", books='" + books + '\'' + ", canPost=" + canPost + ", canSeeAllPosts=" + canSeeAllPosts + ", canSeeAudio=" + canSeeAudio + ", canSendFriendRequest=" + canSendFriendRequest + ", canWritePrivateMessage=" + canWritePrivateMessage + ", career=" + career + ", military=" + military + ", movies='" + movies + '\'' + ", music='" + music + '\'' + ", nickname='" + nickname + '\'' + ", city='" + city + '\'' + ", commonCount=" + commonCount + ", connections=" + connections + ", contacts=" + contacts + ", counters=" + counters + ", country=" + country + ", cropPhoto=" + cropPhoto + ", domain='" + domain + '\'' + ", education=" + education + ", exports='" + exports + '\'' + ", firstNameNom='" + firstNameNom + '\'' + ", firstNameGen='" + firstNameGen + '\'' + ", firstNameDat='" + firstNameDat + '\'' + ", firstNameAcc='" + firstNameAcc + '\'' + ", firstNameIns='" + firstNameIns + '\'' + ", firstNameAbl='" + firstNameAbl + '\'' + ", followersCount=" + followersCount + ", friendStatus=" + friendStatus + ", games='" + games + '\'' + ", hasMobile=" + hasMobile + ", hasPhoto=" + hasPhoto + ", homeTown='" + homeTown + '\'' + ", interests='" + interests + '\'' + ", favorite=" + favorite + ", friend=" + friend + ", hiddenFromFeed=" + hiddenFromFeed + ", lastNameNom='" + lastNameNom + '\'' + ", lastNameGen='" + lastNameGen + '\'' + ", lastNameDat='" + lastNameDat + '\'' + ", lastNameAcc='" + lastNameAcc + '\'' + ", lastNameIns='" + lastNameIns + '\'' + ", lastNameAbl='" + lastNameAbl + '\'' + ", lastSeen=" + lastSeen + ", lists='" + lists + '\'' + ", maidenName='" + maidenName + '\'' + ", occupation=" + occupation + ", online=" + online + ", personal=" + personal + ", photo_50='" + photo_50 + '\'' + ", photo_100='" + photo_100 + '\'' + ", photo_200_orig='" + photo_200_orig + '\'' + ", photo_200='" + photo_200 + '\'' + ", photo_400_orig='" + photo_400_orig + '\'' + ", photo_id='" + photo_id + '\'' + ", photo_max='" + photo_max + '\'' + ", photo_max_orig='" + photo_max_orig + '\'' + ", quotes='" + quotes + '\'' + ", relatives=" + relatives + ", relation=" + relation + ", schools=" + schools + ", screen_name='" + screen_name + '\'' + ", sex=" + sex + ", site='" + site + '\'' + ", status='" + status + '\'' + ", timezone=" + timezone + ", trending=" + trending + ", tv='" + tv + '\'' + ", universities=" + universities + ", verified=" + verified + ", wall_default='" + wall_default + '\'' + '}'; } }
/* * */ package com.library.model.projections; /** * The Interface AvailableBooks. */ public interface AvailableBooks { /** * Gets the id. * * @return the id */ String getId(); /** * Gets the name. * * @return the name */ String getName(); /** * Gets the author. * * @return the author */ String getAuthor(); /** * Gets the isbn. * * @return the isbn */ String getIsbn(); }
package level_1; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor public class Achivement { private int id; private int progress; }
package com.example.andrew.rpgapp; import android.content.Intent; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.ActionBarActivity; import android.view.MenuItem; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; public class CharacterSheet extends ActionBarActivity { private ListView listView; private TextView textTest; private String titleName; private String randName; RandCharBuild charName = new RandCharBuild(); SaveData fileName = new SaveData(); protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_display_array); Intent intent = getIntent(); ArrayList<String> array_list = intent.getStringArrayListExtra(MainActivity.MAIN_MESSAGE); ArrayList<String> randList = charName.nameReturn(); listView = (ListView) findViewById(R.id.mainListView); textTest = (TextView) findViewById(R.id.textViewTest); File file = getFilesDir(); File[] files = file.listFiles(); String out = files.toString(); textTest.setText(out); ArrayAdapter<String> adapter = new ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, array_list); //gotta have an adaptor tho for data structures listView.setAdapter(adapter); //this will 'plug it all in' } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
package com.dil.firstproj; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import com.dil.firstproj.controller.Validator; import com.dil.firstproj.service.FakeNewsService; public class ValidatorTest { @InjectMocks private Validator validator; @Mock private FakeNewsService fakeservice; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); } @Test public void validate_whenEmptyValue_ThenReturnEmpty() { Mockito.when(fakeservice.getHomePage()).thenReturn(""); MatcherAssert.assertThat(validator.validateInput(""), Matchers.equalTo("")); } }
package com.example.lab_1; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import java.util.List; public class ListStringAdapter extends RecyclerView.Adapter<ListStringAdapter.ViewHolder> { private List<String> dataset; public static class ViewHolder extends RecyclerView.ViewHolder { private TextView itemText; public ViewHolder(@NonNull View itemView) { super(itemView); itemText = itemView.findViewById(R.id.item_text); itemView.setOnClickListener(v -> Log.i("Click", "element was clicked")); } public void setItemText(String text) { itemText.setText(text); } } public ListStringAdapter(List<String> dataset) { this.dataset = dataset; } @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_string_item, parent, false); ViewHolder viewHolder = new ViewHolder(view); return viewHolder; } @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { holder.setItemText(dataset.get(position)); } @Override public int getItemCount() { return dataset.size(); } }
package com.ricex.cartracker.androidrequester.request.type; import org.springframework.core.ParameterizedTypeReference; import com.ricex.cartracker.common.entity.Car; public class CarResponseType extends ParameterizedTypeReference<Car> { }
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.PreparedStatement; import java.sql.Statement; import java.util.ArrayList; public class DataAccess { private PreparedStatement findStudentStmt, updateStudentStmt, addStudentStmt, findCourseStmt, addCourseStmt; private Connection conn; private ResultSet resultset; DataAccess() throws Exception { // for uid, pass, put your uid and pass conn = DriverManager.getConnection("jdbc:oracle:thin:@oracle1.centennialcollege.ca:1521:SQLD", "COMP228_F19_K_15", "password"); findStudentStmt = conn.prepareStatement("SELECT * FROM student WHERE rtrim(sid) = ? "); updateStudentStmt = conn .prepareStatement("UPDATE student SET student.first_name = ?, student.last_name = ? WHERE rtrim(student.sid) = ?"); addStudentStmt = conn.prepareStatement("INSERT into student values (?, ?, ?)"); findCourseStmt = conn.prepareStatement("SELECT course_code from student_course where rtrim(sid) = ?"); addCourseStmt = conn.prepareStatement("INSERT into student_course values (?, ?)"); System.out.println("Connected to JDBC"); } Student findStudent(String id) throws Exception { Student st = null; findStudentStmt.setString(1, id); resultset = findStudentStmt.executeQuery(); if (resultset != null) { if (resultset.next()) { String fname = resultset.getString(2); // using index String lname = resultset.getString("last_name"); // using column-name String courses[] = findStudentCourses(id); st = new Student(fname, lname, id, courses); } resultset.close(); return st; } else { throw new Exception("Cannot find record."); } } private String[] findStudentCourses(String id){ ArrayList<String> alist = new ArrayList<String>(); try { findCourseStmt.setString(1, id); resultset = findCourseStmt.executeQuery(); if (resultset != null) { while (resultset.next()) { String cid = resultset.getString("course_code"); // using index alist.add(cid); } resultset.close(); String courses [] = new String[alist.size()]; return alist.toArray(courses); }else{ return new String[0]; //return empty array } }catch (Exception ee){ return new String[0]; //return empty array } } void updateStudent(Student st) throws Exception { updateStudentStmt.setString(1, st.getFirstName()); updateStudentStmt.setString(2, st.getLastName()); updateStudentStmt.setString(3, st.getId()); updateStudentStmt.executeUpdate(); } void addStudent(Student st) throws Exception { addStudentStmt.setString(1, st.getId()); addStudentStmt.setString(2, st.getFirstName()); addStudentStmt.setString(3, st.getLastName()); addStudentStmt.executeUpdate(); addStudentCourses(st.getId(), st.getCourses()); } private void addStudentCourses(String id, String courses[]) throws Exception{ for (String c: courses){ addCourseStmt.setString(1, id); addCourseStmt.setString(2, c); addCourseStmt.executeUpdate(); } } // expected to be called only once String[] getCourses() throws Exception { String query = String.format("SELECT * FROM course "); ArrayList <String> alist = new ArrayList(); Statement statement = conn.createStatement(); resultset = statement.executeQuery(query); if (resultset != null) { while (resultset.next()) { String id = resultset.getString("code"); // using index alist.add(id); } resultset.close(); statement.close(); String courses [] = new String[alist.size()]; return alist.toArray(courses); } else { throw new Exception("Cannot find courses."); } } void disonnect() throws Exception { findStudentStmt.close(); updateStudentStmt.close(); addStudentStmt.close(); conn.close(); } public static void main(String s[]) throws Exception { DataAccess da = null; try { da = new DataAccess(); Student st = da.findStudent("200"); System.out.println("id="+st.getId()); } catch (Exception e) { e.printStackTrace(); throw e; }finally{ if (da != null){ da.disonnect(); } } } }
package com.voksel.electric.pc.domain.id; import com.voksel.electric.pc.domain.entity.Menu; import com.voksel.electric.pc.domain.entity.Role; import java.io.Serializable; /** * Created by edsarp on 8/13/16. */ public class RoleMenuId implements Serializable { private static final long serialVersionUID = 4793736746777455343L; private String roleId; private String menuId; public String getRoleId() { return roleId; } public void setRoleId(String roleId) { this.roleId = roleId; } public String getMenuId() { return menuId; } public void setMenuId(String menuId) { this.menuId = menuId; } }
/* * Copyright 2017 University of Michigan * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package edu.umich.verdict.datatypes; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.apache.commons.lang3.tuple.Pair; import edu.umich.verdict.VerdictJDBCContext; import edu.umich.verdict.exceptions.VerdictException; public class ColumnName { private TableUniqueName tableSource; // an original table source private String tableName; // could be an alias private String columnName; public ColumnName(TableUniqueName tableSource, String tableName, String columnName) { this.tableSource = tableSource; this.tableName = tableName; this.columnName = columnName; } /** * * @param columnName * a possibly full column name including table name and column name * @return */ private static Pair<String, String> parseTableAndColumnName(String columnName) { String[] tokens = columnName.split("\\."); if (tokens.length > 1) { return Pair.of(tokens[tokens.length - 2], tokens[tokens.length - 1]); } else { return Pair.of(null, tokens[tokens.length - 1]); } } // private static Set<String> columnsToTables(List<TableUniqueName> // tableSources) { // Set<String> schemaNames = new HashSet<String>(); // for (TableUniqueName t : tableSources) { // schemaNames.add(t.schemaName); // } // return schemaNames; // } /** * * @param vc * @param tableName * @param columnName * @param tableSources * @return A pair of table name and its alias * @throws VerdictException */ private static Pair<TableUniqueName, String> effectiveTableSourceForColumn(VerdictJDBCContext vc, String tableName, String columnName, List<Pair<TableUniqueName, String>> tableSources) throws VerdictException { if (tableName != null) { for (Pair<TableUniqueName, String> e : tableSources) { if (tableName.equals(e.getLeft().getTableName()) || tableName.equals(e.getRight())) { return e; } } throw new VerdictException(String.format("The table name, %s, cannot be resolved.", tableName)); } else { List<Pair<TableUniqueName, String>> allPossiblePairs = new ArrayList<Pair<TableUniqueName, String>>(); for (Pair<TableUniqueName, String> e : tableSources) { Set<String> columns = vc.getMeta().getColumns(e.getLeft()); for (String c : columns) { if (c.equals(columnName)) { allPossiblePairs.add(e); } } } if (allPossiblePairs.size() == 1) { return allPossiblePairs.get(0); } else if (allPossiblePairs.size() > 1) { throw new VerdictException(String.format("The column name, %s, is ambiguous.", columnName)); } else { throw new VerdictException(String.format("The column name, %s, cannot be resolved.", columnName)); } } } /** * * @param vc * @param tableSources * Pairs of a table source name and its alias * @param columnName * @return * @throws VerdictException */ public static ColumnName uname(VerdictJDBCContext vc, List<Pair<TableUniqueName, String>> tableSources, String columnName) throws VerdictException { Pair<String, String> tc = parseTableAndColumnName(columnName); Pair<TableUniqueName, String> tableNameAndAlias = effectiveTableSourceForColumn(vc, tc.getLeft(), tc.getRight(), tableSources); String tableName = (tableNameAndAlias.getRight() == null) ? tableNameAndAlias.getLeft().getTableName() : tableNameAndAlias.getRight(); return new ColumnName(tableNameAndAlias.getLeft(), tableName, tc.getRight()); } public TableUniqueName getTableSource() { return tableSource; } public String getTableName() { return tableName; } public String localColumnName() { return columnName; } @Override public String toString() { return tableName.toString() + "." + columnName; } }
package com.ojas.es.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Table(name="designation") @javax.persistence.Entity public class Designation implements Entity { /** * */ private static final long serialVersionUID = 1L; @Id @GeneratedValue private Long id; @Column private Date date; @Column(unique = true,nullable = false) private String designation; public Designation() { this.date = new Date(); } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public Date getDate() { return this.date; } public void setDate(Date date) { this.date = date; } public String getDesignation() { return designation; } public void setDesignation(String designation) { this.designation = designation; } @Override public String toString() { return "Designation [id=" + id + ", date=" + date + ", designation=" + designation + "]"; } }
package com.tencent.mm.plugin.record.ui.b; import android.content.ClipboardManager; import android.view.MenuItem; import android.widget.TextView; import com.tencent.mm.R; import com.tencent.mm.plugin.record.ui.b.d.1; import com.tencent.mm.ui.base.h; import com.tencent.mm.ui.base.n.d; class d$1$2 implements d { final /* synthetic */ TextView hNx; final /* synthetic */ 1 mtJ; d$1$2(1 1, TextView textView) { this.mtJ = 1; this.hNx = textView; } public final void onMMMenuItemSelected(MenuItem menuItem, int i) { if (i == 0) { ((ClipboardManager) this.mtJ.mtI.context.getSystemService("clipboard")).setText(this.hNx.getText()); h.bz(this.mtJ.mtI.context, this.mtJ.mtI.context.getString(R.l.app_copy_ok)); } } }
package com.libedi.demo.framework.type; /** * PersistenceUnits * * @author Sang-jun, Park * @since 2019. 09. 10 */ public enum PersistenceUnits { CUSTOMER, ORDER; }
package com.yfancy.web.weixin.controller; import com.yfancy.common.base.Result; import com.yfancy.common.base.url.WEB_WEIXIN_URL_Mapping; import com.yfancy.common.base.util.CommonUtil; import com.yfancy.common.base.util.SerializeXmlUtil; import com.yfancy.web.weixin.config.WeixinConfig; import com.yfancy.web.weixin.helper.WeixinHelper; import com.yfancy.web.weixin.vo.message.BaseMessage; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; @Slf4j @RestController public class WxAccessController { @Autowired private WeixinConfig weixinConfig; @Autowired private WeixinHelper weixinHelper; /** * 微信初始化接入 * @param request * @return */ @RequestMapping(value = WEB_WEIXIN_URL_Mapping.weixin_access, method = RequestMethod.GET) public String weixinAccess(HttpServletRequest request){ log.info("[WxAccessController][weixinAccess]接入微信,开始"); String signature = request.getParameter("signature"); String timestamp = request.getParameter("timestamp"); String nonce = request.getParameter("nonce"); String echostr = request.getParameter("echostr"); String dictSort = CommonUtil.dictSort(timestamp, nonce, weixinConfig.getToken()); log.info("dictSort = {}",dictSort); String sha1 = CommonUtil.sha1(dictSort); log.info("sha1 = {}",sha1); boolean flag = sha1 != null ? sha1.equalsIgnoreCase(signature) : false; if (flag){ log.info("[WxAccessController][weixinAccess]接入微信,接入成功!"); return echostr; } log.info("[WxAccessController][weixinAccess]接入微信,接入失败!"); return null; } /** * 创建微信菜单 * @return */ @RequestMapping(value = WEB_WEIXIN_URL_Mapping.weixin_create_menu, method = RequestMethod.POST) public Result weixinCreateMenu(){ log.info("[WxAccessController][weixinCreateMenu]创建微信菜单,开始!"); String content = weixinHelper.createMenuContent(); Result result = weixinHelper.weixinCreateMenu(content); log.info("[WxAccessController][weixinCreateMenu]创建微信菜单,结束,result={}", result); return result; } /** * 获取微信菜单 * @return */ @RequestMapping(value = WEB_WEIXIN_URL_Mapping.weixin_get_menu, method = RequestMethod.GET) public Result weixinGetMenu(){ log.info("[WxAccessController][weixinGetMenu]获取微信菜单,开始!"); Result result = weixinHelper.weixinGetMenu(); log.info("[WxAccessController][weixinGetMenu]获取微信菜单,结束,result={}",result); return result; } /** * 删除微信菜单 * @return */ @RequestMapping(value = WEB_WEIXIN_URL_Mapping.weixin_del_menu, method = RequestMethod.GET) public Result weixinDelMenu(){ log.info("[WxAccessController][weixinDelMenu]删除微信菜单,开始!"); Result result = weixinHelper.weixinDelMenu(); log.info("[WxAccessController][weixinDelMenu]删除微信菜单,结束,result={}",result); return result; } /** * 微信消息处理 * @param request * @return */ @RequestMapping(value = WEB_WEIXIN_URL_Mapping.weixin_access, method = RequestMethod.POST) public String weixinMessage(HttpServletRequest request){ String xml = CommonUtil.getRequestContent(request); log.info("[WxAccessController][weixinMessage],处理消息,message = {}", xml); String msgType = weixinHelper.getMsgTypeFromWixinReq(xml); BaseMessage baseMessage = weixinHelper.replyAllTypeMsg(msgType,xml); if (baseMessage == null){ return ""; } String beanToXml = SerializeXmlUtil.beanToXml(baseMessage); log.info("[WxAccessController][weixinMessage],处理消息,完成,req = {}",beanToXml); return beanToXml; } }
package com.tencent.mm.plugin.sns.ui; class SnsGalleryUI$1 implements Runnable { final /* synthetic */ SnsGalleryUI nWf; SnsGalleryUI$1(SnsGalleryUI snsGalleryUI) { this.nWf = snsGalleryUI; } public final void run() { this.nWf.nTr.bBY(); } }
package Block; import Exception.BlockException.*; import Exception.IDException.IDNullInFilenameException; import Id.*; import Manager.BlockManager; import Utils.IOUtils; import Utils.MD5; import Utils.Properties; import java.io.File; import java.io.IOException; import java.security.NoSuchAlgorithmException; public class DefaultBlockImpl implements Block { Id<Block> id; BlockManager blockManager; BlockMeta blockMeta; BlockData blockData; public DefaultBlockImpl(BlockManager blockManager, byte[] data) throws IOException, BlockConstructFailException { IdImplFactory idImplFactory = IdImplFactory.getInstance(); this.id = idImplFactory.getNewId(Block.class); this.blockManager = blockManager; String md5 = null; try { md5 = MD5.getByteArrayMD5(data); } catch (NoSuchAlgorithmException e) { throw new BlockConstructFailException("[BlockConstructFailException] constructing block failed. "); } String path = null; path = Properties.BLOCK_PATH + "/" + blockManager.getId().toString() + "/" + this.getIndexId().toString(); this.blockMeta = new DefaultBlockMetaImpl(data.length, md5, path + ".meta"); this.blockData = new DefaultBlockDataImpl(data, path + ".data"); } public DefaultBlockImpl(BlockManager blockManager, BlockMeta blockMeta, BlockData blockData, Id<Block> id) {// 恢复用构造方法 this.id = id; int indexId = id.getId(); IdImplFactory idImplFactory = IdImplFactory.getInstance(); idImplFactory.recoverLocalId(Block.class, indexId);// 防止因为ID工厂localID未更新导致的block覆盖的问题 this.blockManager = blockManager; this.blockMeta = blockMeta; this.blockData = blockData; } @Override public Id<Block> getIndexId() { return id; } @Override public BlockManager getBlockManager() { return blockManager; } @Override public byte[] read() throws IOException, MD5Exception { byte[] data = blockData.getData(); if (check(data)) return data; return null; } @Override public boolean check(byte[] data) throws MD5Exception { String oldMD5 = blockMeta.getCheckSum(); String newMD5 = null; try { newMD5 = MD5.getByteArrayMD5(data); } catch (NoSuchAlgorithmException e) { throw new MD5Exception("[MD5Exception] getting block md5 failed. "); } if (newMD5.equals(oldMD5)) return true; else return false; } @Override public int blockSize() { return blockMeta.getSize(); } public static Block recoverBlock(BlockManager blockManager, File meta, File data) throws IOException, BlockNullException, RecoverBlockFailException { Id<Block> id = null; try { id = IdImplFactory.getIdWithIndex(Block.class, IOUtils.getIntInFileName(meta.getName())); } catch (IDNullInFilenameException e) { throw new RecoverBlockFailException("[RecoverBlockFailException] failed to recover block data."); } byte[] metaData = IOUtils.readByteArrayFromFile(meta, meta.length()); if (metaData == null) { throw new BlockNullException("[BlockNullException] "); } String[] metaLines = (new String(metaData)).split("\n"); int size = Integer.parseInt(metaLines[0]); String checksum = metaLines[1]; BlockMeta blockMeta = new DefaultBlockMetaImpl(size, checksum, meta.getPath()); byte[] dataData = IOUtils.readByteArrayFromFile(data, data.length()); BlockData blockData = new DefaultBlockDataImpl(dataData, data.getPath()); Block block = new DefaultBlockImpl(blockManager, blockMeta, blockData, id); blockManager.registerBlock(block); return block; } }
package com.filiereticsa.arc.augmentepf.models; import android.util.Log; import org.json.JSONException; import org.json.JSONObject; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; /** * Created by ARC© Team for AugmentEPF project on 07/05/2017. */ public class Class { public static final String CATEGORY = "category"; public static final String ROOM = "room"; public static final String DATE_END = "dateEnd"; public static final String DATE_START = "dateStart"; private static final String TAG = "Ici"; private String name; private Date startDate; private Date endDate; private ClassRoom classRoom; private String classRoomName; public Class(String name, Date startDate, Date endDate, ClassRoom classRoom) { this.name = name; this.startDate = startDate; this.endDate = endDate; this.classRoom = classRoom; } public Class(JSONObject jsonObject) { try { this.name = jsonObject.getString(CATEGORY); Calendar calendar = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm", Locale.FRANCE); // get startDate from string String startDateString = jsonObject.getString(DATE_START); try { calendar.setTime(sdf.parse(startDateString)); } catch (ParseException e) { e.printStackTrace(); } this.startDate = calendar.getTime(); // get endDate from string String endDateString = jsonObject.getString(DATE_END); try { calendar.setTime(sdf.parse(endDateString)); } catch (ParseException e) { e.printStackTrace(); } this.endDate = calendar.getTime(); this.classRoomName = jsonObject.getString(ROOM); this.classRoom = ClassRoom.getClassRoomCalled(classRoomName); } catch (JSONException e) { e.printStackTrace(); } Log.d(TAG, "Class: " + this.toString()); } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public ClassRoom getClassRoom() { return classRoom; } public void setClassRoom(ClassRoom classRoom) { this.classRoom = classRoom; } @Override public String toString() { String shortName = name.substring(9, 20); return "Class{" + "name='" + shortName + '\'' + ", " + startDate + ", " + endDate + '}'; } public String getClassRoomName() { return classRoomName; } }
package com.purchase.controller; import com.purchase.entity.SupplierMasterEntity; import com.purchase.service.SupplierMasterService; import com.system.constants.BaseErrorConstants; import com.system.util.*; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; import java.util.Map; @RestController public class SupplierMasterController { private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SupplierMasterController.class); @Autowired private SupplierMasterService supplierMasterService; /** * find list * * @Author qinwanli * @Description //TODO * @Date 2019/5/21 13:18 * @Param [request] **/ @GetMapping(value = "/supplier/findList") public ServiceResult<List<SupplierMasterEntity>> findList(HttpServletRequest request) { ServiceResult<List<SupplierMasterEntity>> result = new ServiceResult<List<SupplierMasterEntity>>(); PagerInfo<?> pagerInfo = null; Map<String, Object> params = null; int supplierId = ConvertUtil.toInt(request.getParameter("supplierId"), 0); int storeId = ConvertUtil.toInt(request.getParameter("storeId"), 0); try { if (!StringUtil.isEmpty(request.getParameter("pageSize"))) { pagerInfo = BaseWebUtil.getPageInfoForPC(request); } params = new HashMap<String, Object>(); if (supplierId > 0) { params.put("supplierId", supplierId); } if (storeId > 0) { params.put("storeId", storeId); } result = supplierMasterService.findList(params, pagerInfo); } catch (Exception e) { LOGGER.error("[SupplierMasterController][findList]:query findList occur exception", e); result.setError(BaseErrorConstants.ERROR_CODE_SERVICE_CONTROLLER, "Find user order list error."); } return result; } /** * find info * * @Author qinwanli * @Description //TODO * @Date 2019/5/21 13:19 * @Param [request] **/ @GetMapping(value = "/supplier/findInfo") public ServiceResult<SupplierMasterEntity> findInfo(HttpServletRequest request) { ServiceResult<SupplierMasterEntity> result = new ServiceResult<SupplierMasterEntity>(); Map<String, Object> params = null; int supplierId = ConvertUtil.toInt(request.getParameter("supplierId"), 0); try { params = new HashMap<String, Object>(); if (supplierId > 0) { params.put("supplierId", supplierId); } result = supplierMasterService.findInfo(params); } catch (Exception e) { LOGGER.error("[SupplierMasterController][findInfo]:query findInfo occur exception", e); result.setError(BaseErrorConstants.ERROR_CODE_SERVICE_CONTROLLER, "Find user order error."); } return result; } /** * do insert * * @Author qinwanli * @Description //TODO * @Date 2019/5/21 13:19 * @Param [supplierMasterEntity] **/ @PostMapping(value = "/supplier/doInsert") public ServiceResult<Integer> doInsert(@RequestBody SupplierMasterEntity supplierMasterEntity) { ServiceResult<Integer> result = new ServiceResult<Integer>(); try { result = supplierMasterService.doInsert(supplierMasterEntity); } catch (Exception e) { LOGGER.error("[SupplierMasterController][doInsert]:Insert occur exception", e); result.setError(BaseErrorConstants.ERROR_CODE_SERVICE_CONTROLLER, "Insert error."); } return result; } /** * do update * * @Author qinwanli * @Description //TODO * @Date 2019/5/21 13:19 * @Param [supplierMasterEntity] **/ @PostMapping(value = "/supplier/doUpdate") public ServiceResult<Integer> doUpdate(@RequestBody SupplierMasterEntity supplierMasterEntity) { ServiceResult<Integer> result = new ServiceResult<Integer>(); try { result = supplierMasterService.doUpdate(supplierMasterEntity); } catch (Exception e) { LOGGER.error("[SupplierMasterController][doUpdate]:Update occur exception", e); result.setError(BaseErrorConstants.ERROR_CODE_SERVICE_CONTROLLER, "Update error."); } return result; } /** * do delete * * @Author qinwanli * @Description //TODO * @Date 2019/5/21 13:19 * @Param [supplierId] **/ @PostMapping(value = "/supplier/doDelete") public ServiceResult<Boolean> doDelete(@RequestParam("supplierId") int supplierId) { ServiceResult<Boolean> result = new ServiceResult<Boolean>(); try { result = supplierMasterService.doDelete(supplierId); } catch (Exception e) { LOGGER.error("[SupplierMasterController][doDelete]:Delete occur exception", e); result.setError(BaseErrorConstants.ERROR_CODE_SERVICE_CONTROLLER, "Delete error."); } return result; } }
package pl.norbgrusz.ui.controller; import com.google.inject.Guice; import com.google.inject.Injector; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.stage.FileChooser; import javafx.stage.Stage; import org.apache.log4j.Logger; import pl.norbgrusz.ui.FXMLFiles; import pl.norbgrusz.ui.KeyFinderApp; import pl.norbgrusz.ui.di.StructureControllerModule; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URL; import java.util.Optional; import java.util.ResourceBundle; public class MainController implements Initializable { private final static Logger logger = Logger.getLogger(MainController.class); @FXML private Button selectFileButton; @FXML private Label pathLabel; @FXML private Button generateButton; private File midiFile = null; private FileChooser fileChooser = initializeFileChooser(); @Override public void initialize(URL location, ResourceBundle resources) { pathLabel.setText("Nie wybrano pliku"); selectFileButton.setOnAction(this::handleSelectFileButton); generateButton.setOnAction(this::handleGenerateButton); } private void handleSelectFileButton(ActionEvent actionEvent) { Stage stage = new Stage(); Optional.ofNullable(fileChooser.showOpenDialog(stage)).ifPresent(file -> { logger.info("Selected file " + file.getAbsolutePath()); midiFile = file; pathLabel.setText(file.getAbsolutePath()); }); } private void handleGenerateButton(ActionEvent actionEvent) { Optional<File> opMidiFile = Optional.ofNullable(midiFile); if (opMidiFile.isPresent()) { Injector injector = Guice.createInjector(new StructureControllerModule(midiFile)); try { showNewGraphWindow(injector); } catch (IOException e) { e.printStackTrace(); } } else { logger.warn("No file selected"); } } private void showNewGraphWindow(Injector injector) throws IOException { Stage stage = new Stage(); FXMLLoader loader = new FXMLLoader(); File fxmlFile = new File(KeyFinderApp.class.getResource(FXMLFiles.STRUCTURE.getPath()).getFile()); loader.setControllerFactory(injector::getInstance); stage.setScene(new Scene(loader.load(new FileInputStream(fxmlFile)))); stage.show(); } private FileChooser initializeFileChooser() { FileChooser fileChooser = new FileChooser(); fileChooser.getExtensionFilters().addAll( new FileChooser.ExtensionFilter(".midi", "*.mid"), new FileChooser.ExtensionFilter(".MIDI", "*.midi") ); fileChooser.setTitle("Open Resource File"); // TODO Delete this after tests fileChooser.setInitialDirectory(new File("D:\\Uczelnia\\Praca dyplomowa\\midi")); return fileChooser; } }
package com.zealot.mytest.service; import java.util.List; import com.zealot.mytest.po.UserRole; public interface UserRoleService { public List<UserRole> findByUser(int uid); }
package domain; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.TreeSet; import com.opencsv.CSVWriter; public class WriteCSVfile { private CSVWriter writer = null; private String csvFile = "C:/1/output.csv"; private Results k = new Results(); private Map<String,List<Methods>> map = k.getSum(); private String headers=null; private List<String[]> list=new ArrayList<>(); private Klaseis l = new Klaseis(); private TreeSet<String> tree = l.getKlaseis(); private String[] h=null; private String [] rows=new String[tree.size()+1]; private int i=0; private int j=0; private List<Methods> methods; public void writeCSVfile() { try { System.out.println("Writing file.."); writer = new CSVWriter(new FileWriter(csvFile)); h=tree.toArray(new String[tree.size()]); headers=Arrays.toString(h); headers=headers.substring(1, headers.length()-1); headers = "Class Name"+", "+headers; rows[0]=headers; for(String key : tree) { j+=1; rows[j]=key+", "; methods=map.get(key); for(i=0;i<methods.size();i++) rows[j]=rows[j]+String.valueOf(methods.get(i).getMs())+", "; } for(i=0;i<rows.length;i++) list.add(new String[] {rows[i]}); writer.writeAll(list); writer.close(); System.out.println("File ready."); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
package com.ims.service.stockAlartService; import java.util.List; import com.ims.dto.ProductDetailDTO; import com.ims.dto.ProductMasterDTO; import com.ims.dto.StockAlertDTO; import com.ims.dto.StockDetailDTO; import com.ims.exception.OperationFailedException; public interface IStockAlartService { public StockAlertDTO saveStockAlert(StockAlertDTO stockAlertDTO) throws OperationFailedException; public List<StockAlertDTO> listStockAlart()throws OperationFailedException; public List<StockDetailDTO> getLowStockProduct() throws OperationFailedException ; public List<StockDetailDTO> getHighStockProduct() throws OperationFailedException ; }
package com.example.java; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import java.util.List; import java.util.Objects; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; /** */ @Slf4j public class ForkJoinDemostrate { @Test public void testCountTask() throws ExecutionException, InterruptedException { ForkJoinTask<Integer> task = ForkJoinPool.commonPool().submit(new CountTask(1, 100)); task.isCompletedAbnormally(); task.isCompletedNormally(); Integer total = task.get(); System.out.printf("The sum of total is:%d",total); } /** * 该例子计算start,start+1,start+2...+end的和 * 原理是将start ~ end 根据THRESHOLD进行任务分割(fork),知道任务粒度<=THRESHOLD再进行计算 * 然后再将结果合并(join) */ public class CountTask extends RecursiveTask<Integer> { private static final int THRESHOLD = 2; private int start; private int end; public CountTask(int start, int end) { this.start = start; this.end = end; } @Override protected Integer compute() { int sum = 0; //如果任务分割到了预计的粒度就开始计算 boolean canCompute = (end - start) <= THRESHOLD; if (canCompute) { log.debug("start counting the sum,start num:{},end num:{}.", start, end); //计算 for (int i = start; i <= end; i++) { sum += i; } } else { //分割 int middle = (start + end) / 2; log.debug("start fork the task.start num:{},end num:{},middle is:{}.", start, end, middle); CountTask leftTask = new CountTask(start, middle); CountTask rightTask = new CountTask(middle + 1, end); //执行子任务 leftTask.fork(); rightTask.fork(); log.debug("start join the task..."); //合并结果 Integer leftResult = leftTask.join(); Integer rightResult = rightTask.join(); sum = leftResult + rightResult; log.debug("join complete,left result is:{},right result is:{}.,sum of left and right is:{}.", leftResult, rightResult, sum); } return sum; } } private static final AtomicInteger count = new AtomicInteger(0); @Test public void testGenerateTask() throws Exception { List<GenerateTask> tasks = Lists.newArrayList(); for (int i = 0; i < 100; i++) { GenerateTask task = new GenerateTask(); tasks.add(task); } ForkJoinPool commonPool = new ForkJoinPool(12); log.debug("start execute GenerateTask..."); commonPool.execute(new GenerateAction(tasks)); //如果无空闲工作线程,让当前线程一起帮助完成任务。 commonPool.awaitQuiescence(0, TimeUnit.NANOSECONDS); log.debug("finish... pool state:{}.",commonPool); } @Test public void testGenerateTask2() throws Exception { List<GenerateTask> tasks = Lists.newArrayList(); for (int i = 0; i < 10000000; i++) { GenerateTask task = new GenerateTask(); tasks.add(task); } ForkJoinPool commonPool = new ForkJoinPool(12); log.debug("start execute GenerateTask..."); GenerateAction action = new GenerateAction(tasks); commonPool.execute(action); while(!action.isDone()){ System.out.printf("pool size: %s,ActiveThreadCount:%s, ,%n" ,commonPool.getPoolSize() ,commonPool.getActiveThreadCount() ); System.out.println(commonPool.getQueuedTaskCount()+"----11111--------------------------"); if(!commonPool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS)){ Thread.sleep(1000); } } log.debug("finish... pool state:{}.",commonPool); } static class GenerateTask{ public void doWork(){ try { Thread.sleep(500); } catch (InterruptedException e) { } int current = count.addAndGet(1); log.debug("generate working...,count number is:{}.",current); } } static class GenerateAction extends RecursiveAction{ //设计单个任务量的阀值为50 大于该数字则继续细分 private static final int THRESHOLD = 5; private List<GenerateTask> taskList; public GenerateAction(List<GenerateTask> taskList) { Objects.requireNonNull(taskList); this.taskList = taskList; } @Override protected void compute() { boolean needSplit = taskList.size() > THRESHOLD; //判断任务量是否大于阀值 if(needSplit){ //任务分割 int middle = taskList.size() / 2; log.debug("Too many tasks need to be broken up.Current quantity:{},then left is:0-{} and right is:{}-{}." ,taskList.size(),middle,(middle + 1),taskList.size()); GenerateAction leftAction = new GenerateAction(taskList.subList(0, middle)); GenerateAction rightAction = new GenerateAction(taskList.subList(middle, taskList.size())); //执行子任务 leftAction.fork(); rightAction.fork(); leftAction.join(); rightAction.join(); }else{ log.debug("start execute task..."); //执行任务 taskList.forEach((e) -> e.doWork()); } } } }
package com.company; import java.util.Map; //一棵二叉树 public class BinaryTree { private Node root; private int size; public BinaryTree() { root = null; size = 0; } public int getSize() { return size; } /** * 往一棵二叉树塞一个值 * * @param value * @return */ public boolean put(String key, Object value) { MyEntry entry = new MyEntry(key, value); Node current = root; Node parent = null; if (null == root) { root = new Node(key.hashCode(), entry, null, null, null); } else { while (current != null) { parent = current; if (current.key < key.hashCode()) { current = current.right; } else if (current.key == key.hashCode() && current.value.getKey().equals(key)) { current.value.setValue(value); return true; } else { current = current.left; } } if (parent.key <= key.hashCode()) { parent.right = new Node(key.hashCode(), entry, parent, null, null); } else { parent.left = new Node(key.hashCode(), entry, parent, null, null); } } size++; return true; } /** * 获取值树中首次出现,若找不到返回null * * @param key * @return */ public Object get(String key) { Node current = root; while (current != null) { if (current.key == key.hashCode() && current.value.getKey().equals(key)) return current.value.getValue(); else if (current.key < key.hashCode()) { current = current.right; } else if (current.key > key.hashCode()) { current = current.left; } } return null; } /** * 查询值是否在二叉树中 * * @param key */ public boolean Exist(String key) { return null != get(key); } /** * delete a value * * @param key */ public void delete(String key) { Node current = root; while (current != null) { if (current.key == key.hashCode() && current.value.getKey().equals(key)) { if (current == root) { deleteRoot(); break; } else { deleteNode(current); break; } } else if (key.hashCode() < current.key) { current = current.left; } else if (key.hashCode() > current.key) { current = current.right; } } size--; if (Exist(key)) { delete(key); } } private void deleteNode(Node node) { if (node.left == null && node.right == null) { if (node.equals(node.parent.left)) { node.parent.left = null; } else { node.parent.right = null; } } else if (node.left == null) { if (node.equals(node.parent.left)) { node.parent.left = node.right; } else { node.parent.right = node.right; } } else if (node.right == null) { if (node.equals(node.parent.right)) { node.parent.left = node.left; } else { node.parent.right = node.left; } } } private void deleteRoot() { Node left = root.left; root = root.right; root.parent = null; Node current = root; while (current.left != null) { current = current.left; } current.left = left; } private static class Node { int key; Map.Entry value; Node parent; Node left; Node right; public Node(int key, Map.Entry value, Node parent, Node left, Node right) { this.key = key; this.value = value; this.parent = parent; this.left = left; this.right = right; } } private static class MyEntry implements Map.Entry { private String key; private Object value; public MyEntry(String key, Object value) { this.key = key; this.value = value; } @Override public Object getKey() { return key; } @Override public Object getValue() { return value; } @Override public Object setValue(Object value) { this.value = value; return this.value; } } }
package hl.restauth.auth.userbase; import java.util.Properties; import org.json.JSONObject; import hl.restauth.auth.AuthConfig; import hl.restauth.auth.JsonUser; public class FileUserMgr implements IUserBase { private JSONObject jsonConfig = null; private String configName = null; private AuthConfig authConfig = null; public FileUserMgr(String aFileName, String aConfigName) { authConfig = AuthConfig.getInstance(); jsonConfig = new JSONObject(); jsonConfig.put("filename", aFileName); setConfigKey(aConfigName); } public JSONObject getJsonConfig() { return jsonConfig; } public JsonUser getUser(String aUserID) { if(aUserID==null) return null; JsonUser json = new JsonUser(); aUserID = aUserID.toLowerCase(); json.setUserID(aUserID); String sPreFix = getConfigKey()+"."+aUserID+"."; Properties propFileInfo = authConfig.getFileUserProps(); //Name String sName = (String) propFileInfo.getProperty(sPreFix+JsonUser._NAME); if(sName!=null) { json.setUserName(sName); } else { return null; } // //AuthType String sAuthType = (String) propFileInfo.getProperty(sPreFix+JsonUser._AUTHTYPE); if(sAuthType!=null) { json.setAuthType(sAuthType); } // //Roles String sRoles = (String) propFileInfo.getProperty(sPreFix+JsonUser._ROLES); if(sRoles!=null) { json.setUserRoles(sRoles, AuthConfig._CFG_ROLES_SEPARATOR ); } // //Password String sUserPass = propFileInfo.getProperty(sPreFix+JsonUser._PASSWORD); if(sUserPass!=null) { json.setUserPassword(sUserPass); } return json; } public String getConfigKey() { return this.configName; } public void setConfigKey(String aConfigName) { this.configName = aConfigName; } }
package com.beiyelin.projectportal.service.impl; import com.beiyelin.common.bean.JwtUser; import com.beiyelin.common.exception.CheckException; import com.beiyelin.common.reqbody.PageReq; import com.beiyelin.common.resbody.PageResp; import com.beiyelin.common.utils.StrUtils; import com.beiyelin.commonsql.jpa.BaseDomainCRUDServiceImpl; import com.beiyelin.commonsql.jpa.BaseTicketCRUDServiceImpl; import com.beiyelin.commonsql.jpa.PageImpl; import com.beiyelin.commonsql.utils.QueryUtils; import com.beiyelin.projectportal.bean.SettleTicketQuery; import com.beiyelin.projectportal.constant.ProjectAuthConstant; import com.beiyelin.projectportal.constant.SettleTicketStatusEnum; import com.beiyelin.projectportal.entity.ProjectAuth; import com.beiyelin.projectportal.entity.SettleDetailWorkloadTicket; import com.beiyelin.projectportal.entity.SettleTicket; import com.beiyelin.projectportal.repository.SettleTicketRepository; import com.beiyelin.projectportal.service.*; import com.google.common.collect.ImmutableSet; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.persistence.Query; import java.math.BigInteger; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import static com.beiyelin.common.constant.MessageCaption.MESSAGE_PARAM_IS_NULL; import static com.beiyelin.common.utils.CheckUtils.notNull; import static com.beiyelin.common.utils.CheckUtils.plainCheck; import static java.lang.String.format; /** * @Description: * @Author: newmann * @Date: Created in 22:35 2018-02-11 */ @Service("settleTicketService") @Slf4j public class SettleTicketServiceImpl extends BaseTicketCRUDServiceImpl<SettleTicket> implements SettleTicketService { private SettleTicketRepository settleTicketRepository; @Autowired public void setSettleTicketRepository(SettleTicketRepository repository){ this.settleTicketRepository = repository; setSuperRepository(repository); } //设置detail服务,以便对detail进行管理 private SettleDetailBorrowMoneyService settleDetailBorrowMoneyService; @Autowired public void setSettleDetailBorrowMoneyService(SettleDetailBorrowMoneyService service){ this.settleDetailBorrowMoneyService = service; } private SettleDetailBorrowMoneyTicketService settleDetailBorrowMoneyTicketService; @Autowired public void setSettleDetailBorrowMoneyTicketService(SettleDetailBorrowMoneyTicketService service){ this.settleDetailBorrowMoneyTicketService = service; } private SettleDetailWorkloadService settleDetailWorkloadService; @Autowired public void setSettleDetailWorkloadService(SettleDetailWorkloadService service){ this.settleDetailWorkloadService = service; } private SettleDetailWorkloadTicketService settleDetailWorkloadTicketService; @Autowired public void setSettleDetailWorkloadTicketService(SettleDetailWorkloadTicketService service){ this.settleDetailWorkloadTicketService = service; } @Override @Transactional public SettleTicket settle(SettleTicket settleTicket) { notNull(settleTicket,MESSAGE_PARAM_IS_NULL); plainCheck(settleTicket.getStatus() == SettleTicketStatusEnum.CHECKED.getValue(), format("结算的结算单 %s 的状态为 %d ,只有已审核状态的单据才能审核。",settleTicket.getId(),settleTicket.getStatus())); log.info(format("开始结算结算单%s。", settleTicket.getId())); SettleTicket result; settleTicket.setStatus(SettleTicketStatusEnum.SETTLED.getValue()); result = super.updateNoTransaction(settleTicket); log.info(format("结算结算单 %s 完成。", settleTicket.getId())); return result; } @Override @Transactional public SettleTicket check(SettleTicket settleTicket) { notNull(settleTicket,MESSAGE_PARAM_IS_NULL); plainCheck(settleTicket.getStatus() == SettleTicketStatusEnum.SUBMITED.getValue(), format("审核的结算单 %s 的状态为 %d ,只有提交状态的单据才能审核。",settleTicket.getId(),settleTicket.getStatus())); log.info(format("开始审核结算单%s。", settleTicket.getId())); SettleTicket result; settleTicket.setStatus(SettleTicketStatusEnum.CHECKED.getValue()); result = super.updateNoTransaction(settleTicket); log.info(format("审核结算单 %s 完成。", settleTicket.getId())); return result; } @Override @Transactional public SettleTicket cancel(SettleTicket settleTicket) { notNull(settleTicket,MESSAGE_PARAM_IS_NULL); log.info(format("开始取消结算单%s。", settleTicket.getId())); SettleTicket result; switch (SettleTicketStatusEnum.getInstance(settleTicket.getStatus())){ case SUBMITED: settleTicket.setStatus(SettleTicketStatusEnum.SUBMITED_DELETED.getValue()); result = super.updateNoTransaction(settleTicket); break; case CHECKED: settleTicket.setStatus(SettleTicketStatusEnum.CHECKED_DELETED.getValue()); result = super.updateNoTransaction(settleTicket); case SETTLED: settleTicket.setStatus(SettleTicketStatusEnum.SETTLED_DELETED.getValue()); result = super.updateNoTransaction(settleTicket); default: throw new CheckException(format("待取消的结算单状态为%d,可取消状态必须为以下几种类型(2,10,30)",settleTicket.getStatus())); } log.info(format("取消结算单 %s 完成。", settleTicket.getId())); return result; } @Override public SettleTicket submit(SettleTicket settleTicket) { notNull(settleTicket,MESSAGE_PARAM_IS_NULL); Set<Integer> status = ImmutableSet.of(SettleTicketStatusEnum.UNSUBMITED.getValue(), SettleTicketStatusEnum.SUBMITED.getValue()); plainCheck(status.contains(settleTicket.getStatus()) , format("提交结算单 %s 的状态为 %d ,只有未提交状态或提交状态的单据才能提交",settleTicket.getId(),settleTicket.getStatus())); log.info(format("开始提交结算单%s。", settleTicket.getId())); SettleTicket result; settleTicket.setStatus(SettleTicketStatusEnum.SUBMITED.getValue()); result = super.updateNoTransaction(settleTicket); log.info(format("提交结算单 %s 完成。", settleTicket.getId())); return result; } @Override @Transactional public void remove(SettleTicket settleTicket) { notNull(settleTicket,MESSAGE_PARAM_IS_NULL); log.info(format("开始删除结算单%s。", settleTicket.getId())); plainCheck(settleTicket.getStatus() == SettleTicketStatusEnum.UNSUBMITED.getValue(), format("删除费用单 %s 的状态为 %d ,只有未提交状态的费用单才能被删除。",settleTicket.getId(),settleTicket.getStatus())); //1、删除单据明细 settleDetailWorkloadTicketService.deleteByMasterId(settleTicket.getId()); settleDetailWorkloadService.deleteByMasterId(settleTicket.getId()); settleDetailBorrowMoneyTicketService.deleteByMasterId(settleTicket.getId()); settleDetailBorrowMoneyService.deleteByMasterId(settleTicket.getId()); //2、删除单据头 settleTicketRepository.delete(settleTicket.getId()); log.info(format("删除结算单%s 成功。", settleTicket.getId())); } @Override public PageResp<SettleTicket> fetchByQuery(SettleTicketQuery query, PageReq pageReq) { notNull(query,MESSAGE_PARAM_IS_NULL); notNull(pageReq,MESSAGE_PARAM_IS_NULL); JwtUser currentUser = getSessionUser(); StringBuilder countSelectSql = new StringBuilder(); countSelectSql.append("select count(*) from "); int firstIndex = (pageReq.getPage()-1)* pageReq.getPageSize(); StringBuilder selectSql = new StringBuilder(); selectSql.append(" select * from "); StringBuilder fromSql = new StringBuilder(); fromSql.append(format(" " + SettleTicket.TABLE_NAME+ " a ")); Map<String,Object> params = new HashMap<>(); StringBuilder whereSql = new StringBuilder(); whereSql.append(" where 1=1 " ); if (!StrUtils.isBlank(query.getBillNo())){ whereSql.append(" and (a.bill_no like :billNo) "); params.put("billNo",StrUtils.genQueryLikeContent(query.getBillNo())); } if (!StrUtils.isBlank(query.getEmployeeId())){ whereSql.append(" and (a.settle_resourse_id = :employeeId) "); params.put("employeeId",query.getEmployeeId().trim()); } if (!StrUtils.isBlank(query.getPersonId())){ whereSql.append(" and (a.settle_resourse_id = :personId) "); params.put("personId",query.getEmployeeId().trim()); } if (!StrUtils.isBlank(query.getOrganizationId())){ whereSql.append(" and (a.settle_resourse_id = :orgId) "); params.put("orgId",query.getEmployeeId().trim()); } if (query.getModifyDateBegin()>0) { whereSql.append(" and (a.modify_date_time >= :modifyDateBegin) "); params.put("modifyDateBegin",query.getModifyDateBegin()); } if (query.getModifyDateEnd()>0) { whereSql.append(" and (a.modify_date_time <= :modifyDateEnd) "); params.put("modifyDateEnd",query.getModifyDateEnd()); } if (!query.getStatus().isEmpty()){ whereSql.append(" and (a.status in (:status)) "); params.put("status",query.getStatus()); // String statusStr = Joiner.on(",").skipNulls().join(employeeQuery.getStatus()); // params.put("status",statusStr); } // whereSql.append(" )) u"); String countSql = new StringBuilder().append(countSelectSql) .append(fromSql) .append(whereSql) .toString(); Query countQuery = this.em.createNativeQuery(countSql); QueryUtils.setParameters(countQuery,params); BigInteger count = (BigInteger) countQuery.getSingleResult(); String resultSQL = new StringBuilder().append(selectSql) .append(fromSql) .append(whereSql) .toString(); Query resultQuery = this.em.createNativeQuery(resultSQL,SettleTicket.class); QueryUtils.setParameters(resultQuery,params); resultQuery.setFirstResult(firstIndex); resultQuery.setMaxResults(pageReq.getPageSize()); List<SettleTicket> resultList = resultQuery.getResultList(); Page<SettleTicket> resultPage = new PageImpl<SettleTicket>(resultList, pageReq.toPageable(), count.longValue()); log.info("Query result:" + resultPage.getContent().toString()); log.info(format("查询结束。条数为:%d",resultPage.getTotalElements())); return new PageResp<>(resultPage); } @Override @Transactional public SettleTicket newTicket() { SettleTicket ticket = new SettleTicket(); ticket.setBillNo(billNoService.newNo(SettleTicket.TABLE_NAME)); return super.create(ticket); } }
package com.anibal.educational.rest_service.domain; import java.util.Date; public class DetalleGasto implements Cloneable{ private Long detalleId; private Long gastoId; private Long gastosNro; private String tarea; private Date fechaGasto; private Double tipoCambio; private Double importe; private Long codeConvinationId; private String observaciones; public DetalleGasto() { super(); } public DetalleGasto(Long detalleId, Long gastoId, Long gastosNro, String tarea, Date fechaGasto, Double tipoCambio, Double importe, Long codeConvinationId, String observaciones) { super(); this.detalleId = detalleId; this.gastoId = gastoId; this.gastosNro = gastosNro; this.tarea = tarea; this.fechaGasto = fechaGasto; this.tipoCambio = tipoCambio; this.importe = importe; this.codeConvinationId = codeConvinationId; this.observaciones = observaciones; } public Long getDetalleId() { return detalleId; } public void setDetalleId(Long detalleId) { this.detalleId = detalleId; } public Long getGastoId() { return gastoId; } public void setGastoId(Long gastoId) { this.gastoId = gastoId; } public Long getGastosNro() { return gastosNro; } public void setGastosNro(Long gastosNro) { this.gastosNro = gastosNro; } public String getTarea() { return tarea; } public void setTarea(String tarea) { this.tarea = tarea; } public Date getFechaGasto() { return fechaGasto; } public void setFechaGasto(Date fechaGasto) { this.fechaGasto = fechaGasto; } public Double getTipoCambio() { return tipoCambio; } public void setTipoCambio(Double tipoCambio) { this.tipoCambio = tipoCambio; } public Double getImporte() { return importe; } public void setImporte(Double importe) { this.importe = importe; } public Long getCodeConvinationId() { return codeConvinationId; } public void setCodeConvinationId(Long codeConvinationId) { this.codeConvinationId = codeConvinationId; } public String getObservaciones() { return observaciones; } public void setObservaciones(String observaciones) { this.observaciones = observaciones; } @Override public String toString() { return "DetalleGasto [detalleId=" + detalleId + ", gastoId=" + gastoId + ", gastosNro=" + gastosNro + ", tarea=" + tarea + ", fechaGasto=" + fechaGasto + ", tipoCambio=" + tipoCambio + ", importe=" + importe + ", codeConvinationId=" + codeConvinationId + ", observaciones=" + observaciones + "]"; } @Override public Object clone() throws CloneNotSupportedException { return super.clone(); } }
package com.blackvelvet.cybos.bridge.cputil ; import com4j.*; /** * ICpStockCode Interface */ @IID("{081AAEAA-DFAF-4B7F-A53A-0D1E4AC58584}") public interface ICpStockCode extends Com4jObject { // Methods: /** * <p> * method CodeToName * </p> * @param code Mandatory java.lang.String parameter. * @return Returns a value of type java.lang.String */ @DISPID(1) //= 0x1. The runtime will prefer the VTID if present @VTID(7) java.lang.String codeToName( java.lang.String code); /** * <p> * method FullCodeToName * </p> * @param code Mandatory java.lang.String parameter. * @return Returns a value of type java.lang.String */ @DISPID(2) //= 0x2. The runtime will prefer the VTID if present @VTID(8) java.lang.String fullCodeToName( java.lang.String code); /** * <p> * method GetCount * </p> * @return Returns a value of type short */ @DISPID(3) //= 0x3. The runtime will prefer the VTID if present @VTID(9) short getCount(); /** * <p> * method GetData * </p> * @param type Mandatory short parameter. * @param index Mandatory short parameter. * @return Returns a value of type java.lang.Object */ @DISPID(4) //= 0x4. The runtime will prefer the VTID if present @VTID(10) @ReturnValue(type=NativeType.VARIANT) java.lang.Object getData( short type, short index); /** * <p> * method CodeToFullCode * </p> * @param code Mandatory java.lang.String parameter. * @return Returns a value of type java.lang.String */ @DISPID(5) //= 0x5. The runtime will prefer the VTID if present @VTID(11) java.lang.String codeToFullCode( java.lang.String code); /** * <p> * method FullCodeToCode * </p> * @param code Mandatory java.lang.String parameter. * @return Returns a value of type java.lang.String */ @DISPID(6) //= 0x6. The runtime will prefer the VTID if present @VTID(12) java.lang.String fullCodeToCode( java.lang.String code); /** * <p> * method NameToCode * </p> * @param name Mandatory java.lang.String parameter. * @return Returns a value of type java.lang.String */ @DISPID(7) //= 0x7. The runtime will prefer the VTID if present @VTID(13) java.lang.String nameToCode( java.lang.String name); /** * <p> * method CodeToIndex * </p> * @param code Mandatory java.lang.String parameter. * @return Returns a value of type int */ @DISPID(8) //= 0x8. The runtime will prefer the VTID if present @VTID(14) int codeToIndex( java.lang.String code); /** * <p> * method GetPriceUnit * </p> * @param code Mandatory java.lang.String parameter. * @param basePrice Mandatory int parameter. * @param directionUp Optional parameter. Default value is false * @return Returns a value of type int */ @DISPID(9) //= 0x9. The runtime will prefer the VTID if present @VTID(15) int getPriceUnit( java.lang.String code, int basePrice, @Optional @DefaultValue("-1") boolean directionUp); // Properties: }
package com.tencent.mm.plugin.mmsight.segment.a; import android.media.MediaPlayer; import android.view.Surface; import com.tencent.mm.compatible.b.j; import com.tencent.mm.plugin.mmsight.segment.a.a.a; import com.tencent.mm.plugin.mmsight.segment.a.a.b; import com.tencent.mm.plugin.mmsight.segment.a.a.c; public final class d implements a { private MediaPlayer epS = new j(); public final void setSurface(Surface surface) { this.epS.setSurface(surface); } public final void setDataSource(String str) { this.epS.setDataSource(str); } public final void prepareAsync() { this.epS.prepareAsync(); } public final void start() { this.epS.start(); } public final void stop() { this.epS.stop(); } public final void pause() { this.epS.pause(); } public final boolean isPlaying() { return this.epS.isPlaying(); } public final void seekTo(int i) { this.epS.seekTo(i); } public final int getCurrentPosition() { return this.epS.getCurrentPosition(); } public final int getDuration() { return this.epS.getDuration(); } public final void release() { this.epS.release(); } public final void setAudioStreamType(int i) { this.epS.setAudioStreamType(i); } public final void setLooping(boolean z) { this.epS.setLooping(z); } public final void setLoop(int i, int i2) { } public final void a(b bVar) { if (bVar == null) { this.epS.setOnPreparedListener(null); } else { this.epS.setOnPreparedListener(new 1(this, bVar)); } } public final void a(c cVar) { if (cVar == null) { this.epS.setOnSeekCompleteListener(null); } else { this.epS.setOnSeekCompleteListener(new 2(this, cVar)); } } public final void a(com.tencent.mm.plugin.mmsight.segment.a.a.d dVar) { if (dVar == null) { this.epS.setOnVideoSizeChangedListener(null); } else { this.epS.setOnVideoSizeChangedListener(new 3(this, dVar)); } } public final void a(a aVar) { if (aVar == null) { this.epS.setOnErrorListener(null); } else { this.epS.setOnErrorListener(new 4(this, aVar)); } } }
package com.tt.miniapp.webapp; import android.os.Handler; import android.os.HandlerThread; import android.webkit.JavascriptInterface; import com.bytedance.sandboxapp.b.a; import com.bytedance.sandboxapp.protocol.service.api.a; import com.bytedance.sandboxapp.protocol.service.api.a.a; import com.bytedance.sandboxapp.protocol.service.api.b.a; import com.bytedance.sandboxapp.protocol.service.api.b.b; import com.bytedance.sandboxapp.protocol.service.api.b.c; import com.bytedance.sandboxapp.protocol.service.api.entity.ApiCallbackData; import com.bytedance.sandboxapp.protocol.service.api.entity.a; import com.bytedance.sandboxapp.protocol.service.api.entity.b; import com.tt.miniapp.AppbrandApplicationImpl; import com.tt.miniapp.WebViewManager; import com.tt.miniapp.msg.ApiGetSystemInfoCtrl; import com.tt.miniapp.msg.ApiHideToastCtrl; import com.tt.miniapp.msg.ApiShowToastCtrl; import com.tt.miniapp.msg.MiniAppApiInvokeParam; import com.tt.miniapp.msg.sync.ApiReportAnalyticsCtrl; import com.tt.miniapp.webapp.api.async.ApiDisablePopGesture; import com.tt.miniapp.webapp.api.async.ApiEndEditing; import com.tt.miniapp.webapp.api.async.ApiReportCustomEvent; import com.tt.miniapp.webapp.api.async.ApiSetStatusBarStyle; import com.tt.miniapp.webapp.api.sync.ApiGetLibraAPIListSync; import com.tt.miniapphost.AppBrandLogger; import com.tt.miniapphost.AppbrandApplication; import com.tt.miniapphost.util.CharacterUtils; import com.tt.miniapphost.util.DebugUtil; import com.tt.option.e.e; import java.lang.ref.WeakReference; public class WebAppBridge { Handler handler; HandlerThread handlerThread; private final a mSandboxAppApiRuntime; private c mWebAppApiHandleExecutor = new c() { public void scheduleHandle(Runnable param1Runnable) { WebAppBridge.this.handler.post(param1Runnable); } }; private final a mWebAppApiRuntime; private int mWebViewId; public WebAppBridge(int paramInt) { this.mWebViewId = paramInt; this.handlerThread = new HandlerThread("WebAppBridge"); this.handlerThread.start(); this.handler = new Handler(this.handlerThread.getLooper()); this.mSandboxAppApiRuntime = ((a)AppbrandApplicationImpl.getInst().getMiniAppContext().getService(a.class)).a(); this.mWebAppApiRuntime = new WebAppApiRuntime(paramInt); } public void callbackDispatch(int paramInt1, String paramString1, int paramInt2, String paramString2) { WebViewManager webViewManager = AppbrandApplicationImpl.getInst().getWebViewManager(); if (webViewManager != null) { if (paramString2.equals("webview")) { webViewManager.webViewinvokeHandler(this.mWebViewId, paramInt1, paramString1, paramInt2); return; } if (paramString2.equals("worker")) { webViewManager.workerInvokeHandler(this.mWebViewId, paramInt1, paramString1, paramInt2); return; } if (paramString2.equals("libra")) webViewManager.libraInvokeHandler(this.mWebViewId, paramInt1, paramString1, paramInt2); } } @JavascriptInterface public String invoke(String paramString1, final String param, final int callbackId, final int divId, final String type) { if (paramString1 == null) return CharacterUtils.empty(); AppBrandLogger.d("WebAppBridge", new Object[] { "invoke event ", paramString1, " param ", param, " callbackId ", Integer.valueOf(callbackId), " divid ", Integer.valueOf(divId), " type ", type }); byte b = -1; int i = paramString1.hashCode(); if (i != -1816397254) { if (i != -516489038) { if (i == 332589195 && paramString1.equals("openSchema")) b = 2; } else if (paramString1.equals("reportAnalytics")) { b = 1; } } else if (paramString1.equals("getLibraAPIList")) { b = 0; } if (b != 0) { final ApiCallbackData event; if (b != 1) { if (b == 2) { b b1 = this.mSandboxAppApiRuntime.handleApiInvoke(a.b.a(this.mWebAppApiRuntime, paramString1, (a)new MiniAppApiInvokeParam(param)).a(this.mWebAppApiHandleExecutor, new WebAppAsyncApiCallbackExecutor(callbackId, divId, type)).a()); if (b1.a) { apiCallbackData = b1.b; return (apiCallbackData == null) ? CharacterUtils.empty() : apiCallbackData.toString(); } DebugUtil.logOrThrow("not trigger api handle", new Object[0]); } this.handler.post(new Runnable() { public void run() { WebAppBridge.this.runJsApiAsync(event, param, callbackId, divId, type); } }); return CharacterUtils.empty(); } return (new ApiReportAnalyticsCtrl((String)apiCallbackData, param)).act(); } return (new ApiGetLibraAPIListSync(param)).act(); } @JavascriptInterface public void onDocumentReady(String paramString) { AppBrandLogger.d("WebAppBridge", new Object[] { "onDocumentReady" }); WeakReference<TTWebAppViewWindow> weakReference = TTWebAppViewWindow.getWeakRef(); if (weakReference == null) return; TTWebAppViewWindow tTWebAppViewWindow = weakReference.get(); if (tTWebAppViewWindow == null) return; tTWebAppViewWindow.hideLoading(); } @JavascriptInterface public String publish(String paramString1, String paramString2, int paramInt, String paramString3) { AppBrandLogger.d("WebAppBridge", new Object[] { " publish event ", paramString1, " param ", paramString2, " divid ", Integer.valueOf(paramInt), " type ", paramString3 }); AppbrandApplication.getInst().getJsBridge().sendMsgToJsCore(paramString1, paramString2, paramInt); return null; } public void runJsApiAsync(String paramString1, String paramString2, int paramInt1, final int divId, final String type) { byte b; switch (paramString1.hashCode()) { default: b = -1; break; case 2104007794: if (paramString1.equals("setStatusBarStyle")) { b = 4; break; } case 843366917: if (paramString1.equals("hideToast")) { b = 1; break; } case 344806259: if (paramString1.equals("getSystemInfo")) { b = 6; break; } case -734314539: if (paramString1.equals("reportCustomEvent")) { b = 2; break; } case -1224756544: if (paramString1.equals("disablePopGesture")) { b = 3; break; } case -1660458947: if (paramString1.equals("endEditing")) { b = 5; break; } case -1913642710: if (paramString1.equals("showToast")) { b = 0; break; } } switch (b) { default: return; case 6: (new ApiGetSystemInfoCtrl(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); return; case 5: (new ApiEndEditing(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); return; case 4: (new ApiSetStatusBarStyle(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); return; case 3: (new ApiDisablePopGesture(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); return; case 2: (new ApiReportCustomEvent(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); return; case 1: (new ApiHideToastCtrl(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); return; case 0: break; } (new ApiShowToastCtrl(paramString2, paramInt1, new e() { public void callback(int param1Int, String param1String) { WebAppBridge.this.callbackDispatch(param1Int, param1String, divId, type); } })).doAct(); } public static class WebAppApiRuntime implements a { public WebAppApiRuntime(int param1Int) {} public a getContext() { return (a)AppbrandApplicationImpl.getInst().getMiniAppContext(); } public b handleApiInvoke(a param1a) { return b.c; } public boolean isDestroyed() { return false; } } class WebAppAsyncApiCallbackExecutor implements b { private final int mCallbackId; private final int mDivId; private final String mType; private WebAppAsyncApiCallbackExecutor(int param1Int1, int param1Int2, String param1String) { this.mCallbackId = param1Int1; this.mDivId = param1Int2; this.mType = param1String; } public void executeCallback(ApiCallbackData param1ApiCallbackData) { WebAppBridge.this.callbackDispatch(this.mCallbackId, param1ApiCallbackData.toString(), this.mDivId, this.mType); } } } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\webapp\WebAppBridge.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
//包声明 package com.testing.class1; //类声明 //公有权限 类 类名{//类名} public class HelloJava { //psvm或是main,回车,快速生成main函数 //main是java运行的入口 public static void main(String[] args) { System.out.println("Hello Java!"); System.out.println("Hello ye"); } }
package com.facebook.jni; import java.util.Iterator; import java.util.Map; public class MapIteratorHelper { private final Iterator<Map.Entry> mIterator; private Object mKey; private Object mValue; public MapIteratorHelper(Map paramMap) { this.mIterator = paramMap.entrySet().iterator(); } boolean hasNext() { if (this.mIterator.hasNext()) { Map.Entry entry = this.mIterator.next(); this.mKey = entry.getKey(); this.mValue = entry.getValue(); return true; } this.mKey = null; this.mValue = null; return false; } } /* Location: C:\Users\august\Desktop\tik\df_rn_kit\classes.jar.jar!\com\facebook\jni\MapIteratorHelper.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
package collection_tasks; import java.util.Set; import java.util.TreeSet; public class cTask3 { static class Human implements Comparable<Human> { int age; String name; @Override public int compareTo(Human human) { return human.age - this.age; } public Human(int age, String name) { this.age = age; this.name = name; } @Override public String toString() { return " name = " + name + ", age = " + age; } } public static void main(String[] args) { Human human1 = new Human( 25, "Max" ); Human human2 = new Human( 30, "Bob" ); Human human3 = new Human( 15, "Liza" ); Human human4 = new Human( 32, "Jo-jo" ); Human human5 = new Human( 89, "Harry" ); Set<Human> humanSet = new TreeSet<>( ); humanSet.add( human1 ); humanSet.add( human2 ); humanSet.add( human3 ); humanSet.add( human4 ); humanSet.add( human5 ); System.out.println(humanSet); } }
package JavaSE.OO.yichang; import java.io.*; /* * 关于finally语句块 * 1、finally语句块可以直接和try语句块联用。try...finally... * 2、try..catch...finally也可以 * 3、在finally语句块中的代码一定会执行 * 4、finally程序块一定会执行,所以通常在程序中为了保证某资源一定会释放,所以一般在finally语句块中释放资源 * 区分final,finalize,finally * final表示不可变的,用来声明变量,方法,修饰的类无法被继承,final static 是常量 * finalize是GC回收器回收零引用的对象前执行的方法 * finally通常配合try语句执行异常代码块,为了保证一定会执行的一段的代码 */ public class ExceptionTest05 { public static void main(String[] args) throws FileNotFoundException { /* try { System.out.println("ABC"); return; }finally { System.out.println("test"); } */ /* try { FileInputStream fis=new FileInputStream("Test.java"); //不会执行 System.out.println("TTTT"); }finally { //会执行 System.out.println("AAAA"); } */ /* try { System.exit(0);//退出java虚拟机jvm }finally { //不会执行 System.out.println("AAAA"); } */ //调用m1方法 int i=m1(); System.out.println(i);//10 //具体用法 FileInputStream fis=null;//必须在外边声明,因为finally中有fis try { fis=new FileInputStream("ExceptionTest05.java"); }catch(FileNotFoundException e) { e.printStackTrace(); }finally { //为了保证资源一定会释放,所以放在finally中 if(fis!=null) { try { fis.close();//释放资源 } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } public static int m1() { /* int i=10; try { return i; }finally { i++; System.out.println("m1的i="+i);//11 } */ //以上代码执行原理 int i=10; try { int temp=i; return temp; }finally { i++; System.out.println("m1的i="+i);//11 } } }
import java.util.LinkedList; import java.util.Scanner; public class Test1 { // crée un paquet de cartes à partir d'une chaîne de caractères static Deck stringToDeck(String s) { Scanner sc = new Scanner(s); LinkedList<Integer> cards = new LinkedList<Integer>(); while (sc.hasNextInt()) { cards.addLast(sc.nextInt()); } sc.close(); return new Deck(cards); } // teste la méthode pick static void testPick(String i1, String i2, String o1, String o2, Integer e) { Deck di1 = stringToDeck(i1); String si1 = di1.toString(); Deck di2 = stringToDeck(i2); String si2 = di2.toString(); Deck do1 = stringToDeck(o1); Deck do2 = stringToDeck(o2); int x = di1.pick(di2); assert(x == e) : "\nPour les paquets d1 = " + si1 + " et d2 = " + si2 + ", l'appel de d1.pick(d2) devrait renvoyer " + e + " au lieu de " + x + "."; assert(di1.toString().equals(do1.toString())) : "\nPour les paquets d1 = " + si1 + " et d2 = " + si2 + ", l'appel de d1.pick(d2) devrait transformer d1 en " + do1 + " au lieu de " + di1 + "."; assert(di2.toString().equals(do2.toString())) : "\nPour les paquets d1 = " + si1 + " et d2 = " + si2 + ", l'appel de d1.pick(d2) devrait transformer d2 en " + do2 + " au lieu de " + di2 + "."; } // teste la méthode pickAll static void testPickAll(String i1, String i2, String o1) { Deck di1 = stringToDeck(i1); String si1 = di1.toString(); Deck di2 = stringToDeck(i2); String si2 = di2.toString(); Deck do1 = stringToDeck(o1); di1.pickAll(di2); assert(di1.toString().equals(do1.toString())) : "\nPour les paquets d1 = " + si1 + " et d2 = " + si2 + ", l'appel de d1.pickAll(d2) devrait transformer d1 en " + do1 + " au lieu de " + di1 + "."; assert(di2.cards.isEmpty()) : "\nL'appel de d1.pickAll(d2) devrait vider d2."; } // teste la méthode isValid static void testIsValid(int nbVals, String s, boolean b) { Deck d = stringToDeck(s); assert(d.isValid(nbVals) == b) : "\nPour le paquet d = " + d + ", l'appel de d.isValid() devrait renvoyer " + b + "."; } public static void main(String[] args) { // vérifie que les asserts sont activés if (!Test1.class.desiredAssertionStatus()) { System.err.println("Vous devez passer l'option -ea à la machine virtuelle Java."); System.err.println("Voir la section 'Activer assert' du préambule du TD."); System.exit(1); } // tests de la méthode pick System.out.print("Test de la méthode pick ... "); testPick("", "", "", "", -1); testPick("1 2", "", "1 2", "", -1); testPick("1 2 3", "4 5 6", "1 2 3 4", "5 6", 4); testPick("", "1", "1", "", 1); System.out.println("[OK]"); // tests de la méthode pickAll System.out.print("Test de la méthode pickAll ... "); testPickAll("", "", ""); testPickAll("1 1", "", "1 1"); testPickAll("1 2 3", "4 5 6", "1 2 3 4 5 6"); testPickAll("", "1 2 3", "1 2 3"); System.out.println("[OK]"); // tests de la méthode isValid System.out.print("Test de la méthode isValid ... "); // valeurs hors des bornes testIsValid(1, "0", false); testIsValid(1, "1 1 1 2", false); // valeurs répétées trop de fois testIsValid(1, "1 1 1 1 1", false); testIsValid(3, "3 1 3 2 3 2 1 3 2 3", false); // paquets valides testIsValid(1, "", true); testIsValid(1, "1 1", true); testIsValid(2, "1 1 1 2", true); testIsValid(3, "1 2 2 3 2 2 1 3 3", true); testIsValid(3, "1 3 1 3 3", true); System.out.println("[OK]"); } }
package com.seemoreinteractive.seemoreinteractive; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.Toast; import com.androidquery.AQuery; import com.seemoreinteractive.seemoreinteractive.helper.Common; public class FullImage extends Activity { String className = this.getClass().getSimpleName(); AQuery aq; String storedProdImage="null", storedProdId="null", storedClientId="null", storedProdUrl="null", storedProdName="null"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_full_image); try{ aq = new AQuery(this); Intent i = getIntent(); ImageView imgvBtnCloset = (ImageView) findViewById(R.id.imgvBtnCloset); imgvBtnCloset.setImageAlpha(0); storedProdImage = i.getStringExtra("storedProdImage"); storedProdId = i.getStringExtra("storedProdId"); storedClientId = i.getStringExtra("storedClientId"); storedProdUrl = i.getStringExtra("storedProdUrl"); storedProdName = i.getStringExtra("storedProdName"); Bitmap bmpImage = aq.getCachedImage(storedProdImage); ImageView imageView = (ImageView) findViewById(R.id.full_image_view); RelativeLayout.LayoutParams rlImageView = (RelativeLayout.LayoutParams)imageView.getLayoutParams(); rlImageView.height= (int)(0.911 * Common.sessionDeviceHeight); imageView.setLayoutParams(rlImageView); imageView.setImageBitmap(bmpImage); imageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try{ FullImage.this.finish(); } catch(Exception e){ e.printStackTrace(); String errorMsg = className+" | imageview click | " +e.getMessage(); Common.sendCrashWithAQuery(FullImage.this, errorMsg); } } }); ImageView imgFooterMiddle = (ImageView) findViewById(R.id.imgvFooterMiddle); imgFooterMiddle.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try{ Intent intent = new Intent(FullImage.this, MenuOptions.class); int requestCode = 0; startActivityForResult(intent, requestCode); overridePendingTransition(R.anim.slide_in_from_bottom, R.anim.slide_out_to_bottom); } catch (Exception e) { e.printStackTrace(); String errorMsg = getClass().getSimpleName()+" | imgFooterMiddle click | " +e.getMessage(); Common.sendCrashWithAQuery(FullImage.this, errorMsg); } } }); ImageView imgvBtnBack = (ImageView) findViewById(R.id.imgvBtnBack); imgvBtnBack.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { FullImage.this.finish(); } }); ImageView imgvBtnShare = (ImageView) findViewById(R.id.imgvBtnShare); imgvBtnShare.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { try{ Intent intent = new Intent(FullImage.this, ShareActivity.class); intent.putExtra("tapOnImage", false); intent.putExtra("image", storedProdImage); intent.putExtra("productId", storedProdId); intent.putExtra("clientId", storedClientId); startActivityForResult(intent, 1); overridePendingTransition(R.xml.slide_in_left, R.xml.slide_out_left); }catch(Exception e){ e.printStackTrace(); String errorMsg = className+" | imgvBtnShare click | " +e.getMessage(); Common.sendCrashWithAQuery(FullImage.this,errorMsg); } } }); ImageView imgBtnCart = (ImageView) findViewById(R.id.imgvBtnCart); imgBtnCart.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try{ if(Common.isNetworkAvailable(FullImage.this)) { if(storedProdUrl.equals("null") || storedProdUrl.equals("") || storedProdUrl == null){ Toast.makeText(getApplicationContext(), "Product is not available.", Toast.LENGTH_LONG).show(); //pDialog.dismiss(); } else { String[] separated = storedProdUrl.split(":"); if(separated[0]!=null && separated[0].equals("tel")){ Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel://"+separated[1])); startActivity(callIntent); } else if(separated[0]!=null && separated[0].equals("telprompt")){ Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel://"+separated[1])); startActivity(callIntent); } else { Intent intent = new Intent(FullImage.this, PurchaseProductWithClientUrl.class); intent.putExtra("productName", storedProdName); intent.putExtra("finalWebSiteUrl", storedProdUrl); startActivity(intent); overridePendingTransition(R.xml.slide_in_left, R.xml.slide_out_left); } } }else{ new Common().instructionBox(FullImage.this,R.string.title_case7,R.string.instruction_case7); } }catch(Exception e){ e.printStackTrace(); String errorMsg = className+" | imgBtnCart click | " +e.getMessage(); Common.sendCrashWithAQuery(FullImage.this,errorMsg); } } }); Button btnCloseFullImage = (Button) findViewById(R.id.btnCloseFullImage); btnCloseFullImage.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub try{ FullImage.this.finish(); } catch(Exception e){ e.printStackTrace(); String errorMsg = className+" | closefullimage click | " +e.getMessage(); Common.sendCrashWithAQuery(FullImage.this, errorMsg); } } }); new Common().clientLogoOrTitleWithThemeColorAndBgImgByPassingColor( this, Common.sessionClientBgColor, Common.sessionClientBackgroundLightColor, Common.sessionClientBackgroundDarkColor, Common.sessionClientLogo, i.getStringExtra("storedProdName"), ""); } catch(Exception e){ e.printStackTrace(); String errorMsg = className+" | oncreate | " +e.getMessage(); Common.sendCrashWithAQuery(FullImage.this, errorMsg); } } }
package com.mes.old.meta; // Generated 2017-5-22 1:25:24 by Hibernate Tools 5.2.1.Final import java.math.BigDecimal; import java.util.Date; /** * MvQualityId generated by hbm2java */ public class MvQualityId implements java.io.Serializable { private String deptno; private String deptid; private Date splydate; private String prtlotno; private String lotno; private BigDecimal chkoutqty; private String itemno; private String prtno; private String workid1; private String material; private String materialid; private String prntno; private String overcode; private String washer; private String washname; private String extdate; private String maintenancer; private String oilname; private String extrckdate; private String checkercode; private String employeeid; private String chkname; private String customerchecker; private Byte armycheckqc; public MvQualityId() { } public MvQualityId(String prtno, String workid1, String employeeid, String chkname) { this.prtno = prtno; this.workid1 = workid1; this.employeeid = employeeid; this.chkname = chkname; } public MvQualityId(String deptno, String deptid, Date splydate, String prtlotno, String lotno, BigDecimal chkoutqty, String itemno, String prtno, String workid1, String material, String materialid, String prntno, String overcode, String washer, String washname, String extdate, String maintenancer, String oilname, String extrckdate, String checkercode, String employeeid, String chkname, String customerchecker, Byte armycheckqc) { this.deptno = deptno; this.deptid = deptid; this.splydate = splydate; this.prtlotno = prtlotno; this.lotno = lotno; this.chkoutqty = chkoutqty; this.itemno = itemno; this.prtno = prtno; this.workid1 = workid1; this.material = material; this.materialid = materialid; this.prntno = prntno; this.overcode = overcode; this.washer = washer; this.washname = washname; this.extdate = extdate; this.maintenancer = maintenancer; this.oilname = oilname; this.extrckdate = extrckdate; this.checkercode = checkercode; this.employeeid = employeeid; this.chkname = chkname; this.customerchecker = customerchecker; this.armycheckqc = armycheckqc; } public String getDeptno() { return this.deptno; } public void setDeptno(String deptno) { this.deptno = deptno; } public String getDeptid() { return this.deptid; } public void setDeptid(String deptid) { this.deptid = deptid; } public Date getSplydate() { return this.splydate; } public void setSplydate(Date splydate) { this.splydate = splydate; } public String getPrtlotno() { return this.prtlotno; } public void setPrtlotno(String prtlotno) { this.prtlotno = prtlotno; } public String getLotno() { return this.lotno; } public void setLotno(String lotno) { this.lotno = lotno; } public BigDecimal getChkoutqty() { return this.chkoutqty; } public void setChkoutqty(BigDecimal chkoutqty) { this.chkoutqty = chkoutqty; } public String getItemno() { return this.itemno; } public void setItemno(String itemno) { this.itemno = itemno; } public String getPrtno() { return this.prtno; } public void setPrtno(String prtno) { this.prtno = prtno; } public String getWorkid1() { return this.workid1; } public void setWorkid1(String workid1) { this.workid1 = workid1; } public String getMaterial() { return this.material; } public void setMaterial(String material) { this.material = material; } public String getMaterialid() { return this.materialid; } public void setMaterialid(String materialid) { this.materialid = materialid; } public String getPrntno() { return this.prntno; } public void setPrntno(String prntno) { this.prntno = prntno; } public String getOvercode() { return this.overcode; } public void setOvercode(String overcode) { this.overcode = overcode; } public String getWasher() { return this.washer; } public void setWasher(String washer) { this.washer = washer; } public String getWashname() { return this.washname; } public void setWashname(String washname) { this.washname = washname; } public String getExtdate() { return this.extdate; } public void setExtdate(String extdate) { this.extdate = extdate; } public String getMaintenancer() { return this.maintenancer; } public void setMaintenancer(String maintenancer) { this.maintenancer = maintenancer; } public String getOilname() { return this.oilname; } public void setOilname(String oilname) { this.oilname = oilname; } public String getExtrckdate() { return this.extrckdate; } public void setExtrckdate(String extrckdate) { this.extrckdate = extrckdate; } public String getCheckercode() { return this.checkercode; } public void setCheckercode(String checkercode) { this.checkercode = checkercode; } public String getEmployeeid() { return this.employeeid; } public void setEmployeeid(String employeeid) { this.employeeid = employeeid; } public String getChkname() { return this.chkname; } public void setChkname(String chkname) { this.chkname = chkname; } public String getCustomerchecker() { return this.customerchecker; } public void setCustomerchecker(String customerchecker) { this.customerchecker = customerchecker; } public Byte getArmycheckqc() { return this.armycheckqc; } public void setArmycheckqc(Byte armycheckqc) { this.armycheckqc = armycheckqc; } public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!(other instanceof MvQualityId)) return false; MvQualityId castOther = (MvQualityId) other; return ((this.getDeptno() == castOther.getDeptno()) || (this.getDeptno() != null && castOther.getDeptno() != null && this.getDeptno().equals(castOther.getDeptno()))) && ((this.getDeptid() == castOther.getDeptid()) || (this.getDeptid() != null && castOther.getDeptid() != null && this.getDeptid().equals(castOther.getDeptid()))) && ((this.getSplydate() == castOther.getSplydate()) || (this.getSplydate() != null && castOther.getSplydate() != null && this.getSplydate().equals(castOther.getSplydate()))) && ((this.getPrtlotno() == castOther.getPrtlotno()) || (this.getPrtlotno() != null && castOther.getPrtlotno() != null && this.getPrtlotno().equals(castOther.getPrtlotno()))) && ((this.getLotno() == castOther.getLotno()) || (this.getLotno() != null && castOther.getLotno() != null && this.getLotno().equals(castOther.getLotno()))) && ((this.getChkoutqty() == castOther.getChkoutqty()) || (this.getChkoutqty() != null && castOther.getChkoutqty() != null && this.getChkoutqty().equals(castOther.getChkoutqty()))) && ((this.getItemno() == castOther.getItemno()) || (this.getItemno() != null && castOther.getItemno() != null && this.getItemno().equals(castOther.getItemno()))) && ((this.getPrtno() == castOther.getPrtno()) || (this.getPrtno() != null && castOther.getPrtno() != null && this.getPrtno().equals(castOther.getPrtno()))) && ((this.getWorkid1() == castOther.getWorkid1()) || (this.getWorkid1() != null && castOther.getWorkid1() != null && this.getWorkid1().equals(castOther.getWorkid1()))) && ((this.getMaterial() == castOther.getMaterial()) || (this.getMaterial() != null && castOther.getMaterial() != null && this.getMaterial().equals(castOther.getMaterial()))) && ((this.getMaterialid() == castOther.getMaterialid()) || (this.getMaterialid() != null && castOther.getMaterialid() != null && this.getMaterialid().equals(castOther.getMaterialid()))) && ((this.getPrntno() == castOther.getPrntno()) || (this.getPrntno() != null && castOther.getPrntno() != null && this.getPrntno().equals(castOther.getPrntno()))) && ((this.getOvercode() == castOther.getOvercode()) || (this.getOvercode() != null && castOther.getOvercode() != null && this.getOvercode().equals(castOther.getOvercode()))) && ((this.getWasher() == castOther.getWasher()) || (this.getWasher() != null && castOther.getWasher() != null && this.getWasher().equals(castOther.getWasher()))) && ((this.getWashname() == castOther.getWashname()) || (this.getWashname() != null && castOther.getWashname() != null && this.getWashname().equals(castOther.getWashname()))) && ((this.getExtdate() == castOther.getExtdate()) || (this.getExtdate() != null && castOther.getExtdate() != null && this.getExtdate().equals(castOther.getExtdate()))) && ((this.getMaintenancer() == castOther.getMaintenancer()) || (this.getMaintenancer() != null && castOther.getMaintenancer() != null && this.getMaintenancer().equals(castOther.getMaintenancer()))) && ((this.getOilname() == castOther.getOilname()) || (this.getOilname() != null && castOther.getOilname() != null && this.getOilname().equals(castOther.getOilname()))) && ((this.getExtrckdate() == castOther.getExtrckdate()) || (this.getExtrckdate() != null && castOther.getExtrckdate() != null && this.getExtrckdate().equals(castOther.getExtrckdate()))) && ((this.getCheckercode() == castOther.getCheckercode()) || (this.getCheckercode() != null && castOther.getCheckercode() != null && this.getCheckercode().equals(castOther.getCheckercode()))) && ((this.getEmployeeid() == castOther.getEmployeeid()) || (this.getEmployeeid() != null && castOther.getEmployeeid() != null && this.getEmployeeid().equals(castOther.getEmployeeid()))) && ((this.getChkname() == castOther.getChkname()) || (this.getChkname() != null && castOther.getChkname() != null && this.getChkname().equals(castOther.getChkname()))) && ((this.getCustomerchecker() == castOther.getCustomerchecker()) || (this.getCustomerchecker() != null && castOther.getCustomerchecker() != null && this.getCustomerchecker().equals(castOther.getCustomerchecker()))) && ((this.getArmycheckqc() == castOther.getArmycheckqc()) || (this.getArmycheckqc() != null && castOther.getArmycheckqc() != null && this.getArmycheckqc().equals(castOther.getArmycheckqc()))); } public int hashCode() { int result = 17; result = 37 * result + (getDeptno() == null ? 0 : this.getDeptno().hashCode()); result = 37 * result + (getDeptid() == null ? 0 : this.getDeptid().hashCode()); result = 37 * result + (getSplydate() == null ? 0 : this.getSplydate().hashCode()); result = 37 * result + (getPrtlotno() == null ? 0 : this.getPrtlotno().hashCode()); result = 37 * result + (getLotno() == null ? 0 : this.getLotno().hashCode()); result = 37 * result + (getChkoutqty() == null ? 0 : this.getChkoutqty().hashCode()); result = 37 * result + (getItemno() == null ? 0 : this.getItemno().hashCode()); result = 37 * result + (getPrtno() == null ? 0 : this.getPrtno().hashCode()); result = 37 * result + (getWorkid1() == null ? 0 : this.getWorkid1().hashCode()); result = 37 * result + (getMaterial() == null ? 0 : this.getMaterial().hashCode()); result = 37 * result + (getMaterialid() == null ? 0 : this.getMaterialid().hashCode()); result = 37 * result + (getPrntno() == null ? 0 : this.getPrntno().hashCode()); result = 37 * result + (getOvercode() == null ? 0 : this.getOvercode().hashCode()); result = 37 * result + (getWasher() == null ? 0 : this.getWasher().hashCode()); result = 37 * result + (getWashname() == null ? 0 : this.getWashname().hashCode()); result = 37 * result + (getExtdate() == null ? 0 : this.getExtdate().hashCode()); result = 37 * result + (getMaintenancer() == null ? 0 : this.getMaintenancer().hashCode()); result = 37 * result + (getOilname() == null ? 0 : this.getOilname().hashCode()); result = 37 * result + (getExtrckdate() == null ? 0 : this.getExtrckdate().hashCode()); result = 37 * result + (getCheckercode() == null ? 0 : this.getCheckercode().hashCode()); result = 37 * result + (getEmployeeid() == null ? 0 : this.getEmployeeid().hashCode()); result = 37 * result + (getChkname() == null ? 0 : this.getChkname().hashCode()); result = 37 * result + (getCustomerchecker() == null ? 0 : this.getCustomerchecker().hashCode()); result = 37 * result + (getArmycheckqc() == null ? 0 : this.getArmycheckqc().hashCode()); return result; } }
package com.tencent.mm.ui.chatting; import android.content.Context; import android.net.Uri; import com.tencent.mm.R; import com.tencent.mm.g.a.iy; import com.tencent.mm.model.au; import com.tencent.mm.model.c; import com.tencent.mm.model.m; import com.tencent.mm.model.q; import com.tencent.mm.model.r; import com.tencent.mm.modelvideo.o; import com.tencent.mm.modelvideo.s; import com.tencent.mm.pluginsdk.model.app.ao; import com.tencent.mm.pluginsdk.model.app.b; import com.tencent.mm.pluginsdk.model.app.f; import com.tencent.mm.pluginsdk.model.app.g; import com.tencent.mm.sdk.b.a; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.storage.ab; import com.tencent.mm.storage.bd; import com.tencent.mm.y.g$a; import java.io.File; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; public final class aj { private ab bTk = null; private Context context; private SimpleDateFormat gVk = new SimpleDateFormat("yyyy-MM-dd"); String juM = null; List<bd> tIM; private String tME = null; ArrayList<Uri> tMF = new ArrayList(); public aj(Context context, List<bd> list, ab abVar) { this.context = context; this.tIM = list; this.bTk = abVar; } public final String cuj() { String str = "MicroMsg.OtherMailHistoryExporter"; String str2 = "export: history is null? %B, selectItems.size = %d"; Object[] objArr = new Object[2]; objArr[0] = Boolean.valueOf(this.juM == null); objArr[1] = Integer.valueOf(this.tIM.size()); x.d(str, str2, objArr); if (this.juM != null) { return this.juM; } this.tMF.clear(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(cuk()); stringBuilder.append("\n\n"); for (bd bdVar : this.tIM) { if (this.tME == null) { this.tME = gw(bdVar.field_createTime); stringBuilder.append(String.format("————— %s —————\n\n", new Object[]{this.tME})); stringBuilder.append("\n"); } else { str = gw(bdVar.field_createTime); if (!str.equals(this.tME)) { this.tME = str; stringBuilder.append(String.format("————— %s —————\n\n", new Object[]{this.tME})); stringBuilder.append("\n"); } } String str3; if (bdVar.isText()) { if (!bdVar.isText()) { str3 = null; } else if (bdVar.field_isSend == 1) { str3 = String.format("%s\n\n%s\n\n", new Object[]{aG(bdVar), bdVar.field_content}); } else if (this.bTk.field_username.endsWith("@chatroom")) { str3 = com.tencent.mm.model.bd.iA(bdVar.field_content) != -1 ? String.format("%s\n\n%s\n\n", new Object[]{aG(bdVar), bdVar.field_content.substring(com.tencent.mm.model.bd.iA(bdVar.field_content) + 1).trim()}) : null; } else { str3 = String.format("%s\n\n%s\n\n", new Object[]{aG(bdVar), bdVar.field_content}); } stringBuilder.append(str3); } else if (bdVar.ckA()) { if (bdVar.ckA()) { long j = bdVar.field_msgId; long j2 = bdVar.field_msgSvrId; str = ae.gu(j); if (bi.oW(str)) { str = ae.gv(j2); } x.d("MicroMsg.OtherMailHistoryExporter", "hdPath[%s]", new Object[]{str}); if (!bi.oW(str)) { this.tMF.add(Uri.parse("file://" + str)); str = String.format("[%s: %s(%s)]", new Object[]{this.context.getString(R.l.email_image_prompt), new File(str).getName(), this.context.getString(R.l.email_attach_tips)}); str3 = String.format("%s\n\n%s\n\n", new Object[]{aG(bdVar), str}); stringBuilder.append(str3); } } str3 = null; stringBuilder.append(str3); } else { if (bdVar.ckz()) { str = String.format("[%s]", new Object[]{this.context.getString(R.l.email_voice_prompt)}); } else if (bdVar.cme()) { str = bdVar.field_isSend == 1 ? this.context.getString(R.l.email_send_voip_prompt) : this.context.getString(R.l.email_receive_voip_prompt); } else if (bdVar.aQo()) { iy iyVar = new iy(); iyVar.bSB.bSv = 1; iyVar.bSB.bGS = bdVar; a.sFg.m(iyVar); str = String.format("[%s]", new Object[]{iyVar.bSC.bPu}); } else { if (bdVar.aQm()) { g$a gp = g$a.gp(bi.WT(bdVar.field_content)); if (gp != null) { switch (gp.type) { case 4: case 6: b SR = ao.asF().SR(gp.bGP); if (SR != null) { File file = new File(SR.field_fileFullPath); if (file.exists()) { this.tMF.add(Uri.fromFile(file)); break; } } break; } f bl = g.bl(gp.appId, true); if (bl == null) { str = ""; } else { String str4 = bl.field_appName; str = 6 == gp.type ? String.format("[%s: %s(%s)]", new Object[]{this.context.getString(R.l.email_appmsg_prompt), str4, this.context.getString(R.l.email_attach_tips)}) : String.format("[%s: %s]", new Object[]{this.context.getString(R.l.email_appmsg_prompt), str4}); } } } else if (bdVar.cmi()) { au.HU(); str = c.FT().GR(bdVar.field_content).nickname; str = String.format("[%s: %s]", new Object[]{this.context.getString(R.l.email_card_prompt), str}); } else if (bdVar.cmj()) { r7 = new Object[3]; o.Ta(); r7[1] = new File(s.nK(bdVar.field_imgPath)).getName(); r7[2] = this.context.getString(R.l.email_attach_tips); str = String.format("[%s: %s(%s)]", r7); o.Ta(); File file2 = new File(s.nK(bdVar.field_imgPath)); if (file2.exists()) { this.tMF.add(Uri.fromFile(file2)); } } else if (bdVar.cml() || bdVar.cmm()) { str = String.format("[%s]", new Object[]{this.context.getString(R.l.email_emoji_prompt)}); } str = null; } x.i("MicroMsg.OtherMailHistoryExporter", "formatOtherMsg, msgStr = %s", new Object[]{str}); stringBuilder.append(String.format("%s\n\n%s\n\n", new Object[]{aG(bdVar), str})); } } stringBuilder.append("\n\n"); this.juM = stringBuilder.toString(); return this.juM; } private String cuk() { String str; if (this.bTk.field_username.endsWith("@chatroom")) { if (bi.oW(this.bTk.field_nickname)) { String str2; str = ""; Iterator it = m.gI(this.bTk.field_username).iterator(); while (true) { str2 = str; if (!it.hasNext()) { break; } str = str2 + r.gT((String) it.next()) + ", "; } str = str2.substring(0, str2.length() - 2); } else { str = this.bTk.BK(); } return String.format(this.context.getString(R.l.send_mail_content_room_start_msg), new Object[]{str}); } str = this.context.getString(R.l.send_mail_content_start_msg); Object[] objArr = new Object[2]; objArr[0] = this.bTk.BK(); au.HU(); objArr[1] = c.DT().get(4, null); return String.format(str, objArr); } private String aG(bd bdVar) { String str; String str2 = null; if (this.bTk.field_username.endsWith("@chatroom")) { str = bdVar.field_content; int iA = com.tencent.mm.model.bd.iA(str); if (iA != -1) { str2 = r.gT(str.substring(0, iA).trim()); } } else { str2 = r.gT(bdVar.field_talker); } if (bdVar.field_isSend == 1) { x.i("MicroMsg.OtherMailHistoryExporter", "isSend"); str2 = q.GH(); } str = new SimpleDateFormat("HH:mm").format(new Date(bdVar.field_createTime)); StringBuilder stringBuilder = new StringBuilder(""); stringBuilder.append(str2); stringBuilder.append(" "); stringBuilder.append(str); return stringBuilder.toString(); } private String gw(long j) { return this.gVk.format(new Date(j)); } }
package shapes.polygon; public class EqualiteralTriangle extends Triangle{ }
package it.dstech.film.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import it.dstech.film.model.Role; import it.dstech.film.service.RoleService; @RestController @RequestMapping("/role") public class RoleController { @Autowired RoleService service; /** * Return json model * * @return */ @RequestMapping(value = { "/getModel" }, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Role getRoleModel() { return new Role(); } /** * List of roles * * @return */ @RequestMapping(value = { "/list" }, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<Role> listUser() { List<Role> roles = service.findAllRoles(); return roles; } }
package com.luban.command.register.service.impl; import com.luban.command.register.dao.RegisterDao; import com.luban.command.register.service.RegisterService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * @ClassName RegisterServiceImpl * @Author yuanlei * @Date 2018/10/16 9:50 * @Version 1.0 **/ @Service("registerService") public class RegisterServiceImpl implements RegisterService { @Autowired private RegisterDao registerDao; @Override public Integer register(String username, String password) { Integer register = registerDao.register(username,password); return register; } }
package com.tencent.mm.plugin.appbrand.jsapi.file; public final class w extends c<aq> { private static final int CTRL_INDEX = 377; private static final String NAME = "readdirSync"; public w() { super(new aq()); } }
package sample; public class Date { private String jour,mois,anneé; public Date(String jour, String mois, String anneé) { this.jour = jour; this.mois = mois; this.anneé = anneé; } public String getJour() { return jour; } public String getMois() { return mois; } public String getAnneé() { return anneé; } @Override public String toString() { return jour+"/"+mois+"/"+anneé; } public void afficher(){ System.out.println(this); } }
/* * Ada Sonar Plugin * Copyright (C) 2010 Akram Ben Aissi * dev@sonar.codehaus.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ package org.sonar.plugins.ada.lexer; import java.util.ArrayList; import java.util.List; import org.sonar.api.BatchExtension; public class PageScanner implements BatchExtension { private final List<DefaultNodeVisitor> visitors = new ArrayList<DefaultNodeVisitor>(); /** * Add a visitor to the list of visitors. */ public void addVisitor(DefaultNodeVisitor visitor) { visitors.add(visitor); } /** * Scan a list of Nodes and send events to the visitors. */ public void scan(List<Node> nodeList, AdaSourceCode sourceCode) { // notify visitors for a new document for (DefaultNodeVisitor visitor : visitors) { visitor.startDocument(sourceCode, nodeList); } // notify the visitors for start and end of element for (Node node : nodeList) { for (DefaultNodeVisitor visitor : visitors) { scanElement(visitor, node); } } // notify visitors for end of document for (DefaultNodeVisitor visitor : visitors) { visitor.endDocument(); } } /** * Scan a single element and send appropriate event: start element, end element, characters, comment, expression or directive. */ private void scanElement(DefaultNodeVisitor visitor, Node node) { switch (node.getNodeType()) { case Tag: TagNode element = (TagNode) node; if ( !element.isEndElement()) { visitor.startElement(element); } if (element.isEndElement() || element.hasEnd()) { visitor.endElement(element); } break; case Text: visitor.characters((TextNode) node); break; case Comment: visitor.comment((CommentNode) node); break; case Expression: visitor.expression((ExpressionNode) node); break; case Directive: visitor.directive((DirectiveNode) node); break; default: break; } } }
package com.jasoftsolutions.mikhuna.domain; import android.content.Context; import com.jasoftsolutions.mikhuna.R; import java.util.ArrayList; /** * Created by pc07 on 06/05/2014. */ public enum AppProblemType { APP_FAIL(1, R.string.problem_type_app_fail), INCORRECT_DATA(2, R.string.problem_type_incorrect_data), CITY_NOT_FOUND(3, R.string.problem_type_city_not_found), OTHER(4, R.string.problem_type_other); private int problemTypeId; private int stringResourceId; AppProblemType(int problemTypeId, int stringResourceId) { this.problemTypeId = problemTypeId; this.stringResourceId = stringResourceId; } public int getProblemTypeId() { return problemTypeId; } public int getStringResourceId() { return stringResourceId; } public static ArrayList<SelectOption> getSelectOptions(Context context) { ArrayList<SelectOption> result = new ArrayList<SelectOption>(); for (AppProblemType item : values()) { result.add(new SelectOption((long)item.getProblemTypeId(), context.getString(item.getStringResourceId()))); } return result; } }
package com.ab.yuri.aifuwu.util; import com.ab.yuri.aifuwu.gson.Exercise; import com.ab.yuri.aifuwu.gson.GPA; import com.ab.yuri.aifuwu.gson.Info; import com.ab.yuri.aifuwu.gson.Oneday; import com.ab.yuri.aifuwu.gson.OnedayImg; import com.ab.yuri.aifuwu.gson.WeatherNow; import com.google.gson.Gson; import org.json.JSONArray; import org.json.JSONObject; /** * Created by Yuri on 2017/1/19. */ public class Utility { /* 解析和处理返回的login信息 */ public static Info handleInfoResponse(String response){ try { Gson gson=new Gson(); Info info=gson.fromJson(response,Info.class); return info; }catch (Exception e){ e.printStackTrace(); } return null; } public static Exercise handleExerciseResponse(String response){ /* 解析和处理返回的Exercise信息 */ try { Gson gson=new Gson(); Exercise exercise=gson.fromJson(response,Exercise.class); return exercise; }catch (Exception e){ e.printStackTrace(); } return null; } public static GPA handleGPAResponse(String response){ /* 解析和处理返回的GPA信息 */ try { Gson gson=new Gson(); GPA gpa=gson.fromJson(response,GPA.class); return gpa; }catch (Exception e){ e.printStackTrace(); } return null; } public static WeatherNow handleWeatherResponse(String response){ /* 解析和处理返回的WeatherNow信息 */ try { JSONObject jsonObject=new JSONObject(response); JSONArray jsonArray=jsonObject.getJSONArray("HeWeather"); String weatherContent=jsonArray.getJSONObject(0).toString(); Gson gson=new Gson(); WeatherNow weatherNow=gson.fromJson(weatherContent,WeatherNow.class); return weatherNow; }catch (Exception e){ e.printStackTrace(); } return null; } public static Oneday handleOnedayResponse(String response){ /* 解析和处理返回的Oneday信息 */ try { Gson gson=new Gson(); Oneday oneday=gson.fromJson(response,Oneday.class); return oneday; }catch (Exception e){ e.printStackTrace(); } return null; } public static OnedayImg handleOnedayImgResponse(String response){ /* 解析和处理返回的Oneday信息 */ try { Gson gson=new Gson(); OnedayImg onedayImg=gson.fromJson(response,OnedayImg.class); return onedayImg; }catch (Exception e){ e.printStackTrace(); } return null; } }
package testes; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import pageObjects.FormPage; public class RequiredFieldTest { private WebDriver driver; private FormPage page; @Before public void initializes() { driver = new ChromeDriver(); driver.manage().window().maximize(); driver.get( "https://docs.google.com/forms/d/e/1FAIpQLScQ7Ej_21M73p2Qf1SaRQt8LgUKGMmPcJt35K8odJKEXzCSMA/viewform?vc=0&c=0&w=1"); page = new FormPage(driver); } @After public void finalize() { driver.quit(); } @Test public void nameRequired() { page.setSend(); Assert.assertEquals("Esta pergunta é obrigatória", page.obterResultadoNome()); } @Test public void emailRequired() { page.setName("Luciano"); page.setSend(); Assert.assertEquals("Esta pergunta é obrigatória", page.obterResultadoEmail()); } }
package petko.osm.model.facade; /** * OSM tag * * @author 5ko * */ public interface OsmTag { /** * Tag key * * @return */ public String getKey(); /** * Tag value * * @return */ public String getValue(); }
package com.momori.wepic.activity; import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.Toast; import com.etsy.android.grid.StaggeredGridView; import com.momori.wepic.R; import com.momori.wepic.WepicApplication; import com.momori.wepic.activity.adapter.StaggeredGridAdapter; import com.momori.wepic.common.Const; import com.momori.wepic.common.SFValue; import com.momori.wepic.controller.post.ImageController; import com.momori.wepic.model.response.ResImageListModel; public class AlbumViewActivity extends Activity implements AbsListView.OnScrollListener, AbsListView.OnItemClickListener { public static final String SAVED_DATA_KEY = "SAVED_DATA"; private StaggeredGridView mGridView; private boolean mHasRequestedMore; private StaggeredGridAdapter mAdapter; private ArrayList<String> mData; private WepicApplication context; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_album_view); this.context = (WepicApplication)getApplicationContext(); /* if (mData == null) { mData = generateData(); } else { for (String data : mData) { mAdapter.add(data); } } mGridView = (StaggeredGridView) findViewById(R.id.grid_view); mAdapter = new StaggeredGridAdapter(this,android.R.layout.simple_list_item_1, mData); // do we have saved data? if (savedInstanceState != null) { mData = savedInstanceState.getStringArrayList(SAVED_DATA_KEY); } mGridView.setAdapter(mAdapter); mGridView.setOnScrollListener(this); mGridView.setOnItemClickListener(this); */ } @Override protected void onSaveInstanceState(final Bundle outState) { super.onSaveInstanceState(outState); outState.putStringArrayList(SAVED_DATA_KEY, mData); } @Override public void onScrollStateChanged(final AbsListView view, final int scrollState) { Log.d(this.getClass().toString(), "onScrollStateChanged:" + scrollState); } @Override public void onScroll(final AbsListView view, final int firstVisibleItem, final int visibleItemCount, final int totalItemCount) { Log.d(this.getClass().toString(), "onScroll firstVisibleItem:" + firstVisibleItem + " visibleItemCount:" + visibleItemCount + " totalItemCount:" + totalItemCount); // our handling if (!mHasRequestedMore) { int lastInScreen = firstVisibleItem + visibleItemCount; if (lastInScreen >= totalItemCount) { Log.d(this.getClass().toString(), "onScroll lastInScreen - so load more"); mHasRequestedMore = true; // onLoadMoreItems(); } } } private void onLoadMoreItems() { final ArrayList<String> sampleData = generateData(); for (String data : sampleData) { mAdapter.add(data); } // stash all the data in our backing store mData.addAll(sampleData); // notify the adapter that we can update now mAdapter.notifyDataSetChanged(); mHasRequestedMore = false; } private ArrayList<String> generateData() { ArrayList<String> listData = new ArrayList<String>(); ImageController imageCtl = new ImageController(); ResImageListModel imglist = imageCtl.getImageList(this.context.getSfValue().getValue(SFValue.PREF_ALBUM_ID, Const.SF_NULL_INT)); for(int i = 0 ; i < imglist.getShared_album().size() ; i++) { listData.add(imglist.getShared_album().get(i).getPhoto_thumb_url()); } return listData; } @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { Toast.makeText(this, "Item Clicked: " + position, Toast.LENGTH_SHORT).show(); } } //import android.support.v7.app.ActionBarActivity; //import android.os.Bundle; //import android.view.Menu; //import android.view.MenuItem; // // //public class AlbumViewActivity extends ActionBarActivity { // // @Override // protected void onCreate(Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setContentView(R.layout.activity_album_view); // } // // // @Override // public boolean onCreateOptionsMenu(Menu menu) { // // Inflate the menu; this adds items to the action bar if it is present. // getMenuInflater().inflate(R.menu.menu_album_view, menu); // return true; // } // // @Override // public boolean onOptionsItemSelected(MenuItem item) { // // Handle action bar item clicks here. The action bar will // // automatically handle clicks on the Home/Up button, so long // // as you specify a parent activity in AndroidManifest.xml. // int id = item.getItemId(); // // //noinspection SimplifiableIfStatement // if (id == R.id.action_settings) { // return true; // } // // return super.onOptionsItemSelected(item); // } //}
class welcome{ public static void main(String[] args){ System.out.println("WELCOME ANKIT"); } }
package com.gelecn.pay.data; public class PayConfig { /** * 密钥 */ public static final String PLATMERID="801453959868565"; //801432887300983=R4FVU1T7X1B5NVT07Z7V4AX4 public static final String REQ_MERCHANT_KEY="0KYQUWUMY8CEAH6WDJYWNTIX"; /** * 密钥 */ //public static final String REQ_MERCHANT_KEY="W0ER0IBP2FJRGI6ZEDAW2JRH"; /** * #消费 请求地址 */ public static final String PAY_URL="http://kuaizhifu.huapay.cn/noCardMer/order.do"; /** * #订单查询 请求地址 */ public static final String QUERY_ORDER="http://kuaizhifu.huapay.cn/noCardMer/queryOrder.do"; /** * #消费撤销 请求地址 */ public static final String REVOKE_URL="http://kuaizhifu.huapay.cn/noCardMer/revokeOrder.do"; }
package cloud.metaapi.sdk.clients.copy_factory.models; /** * CopyFactory strategy time settings */ public class CopyFactoryStrategyTimeSettings { /** * Optional position lifetime, or {@code null}. Default is to keep positions open up to 90 days */ public Integer lifetimeInHours; /** * Optional time interval to copy new positions, or {@code null}. Default is to let 1 minute for the position to get * copied. If position were not copied during this time, the copying will not be retried anymore. */ public Integer openingIntervalInMinutes; }
package Carshop.inpl; import Carshop.cars.Ford; import Carshop.cars.Sedan; import Carshop.cars.Truck; import Carshop.interfaces.Admin; import Carshop.interfaces.Customer; import Carshop.cars.Car; public class MyOwnAutoShop implements Admin, Customer { public Car [] cars = new Car[5]; static int Income; public void CreatureCars(){ cars [0]=new Ford(180,true,2000000,"black",2010,30000); cars [1]=new Ford(220, true,3000000,"white",2018,50000); cars [2]=new Sedan(200,true,2500000,"black",30); cars [3]=new Truck(190,true,2000000,"green",2500); cars [4]=new Truck(190,true,2100000,"green",1900); } public double getIncome() { return Income; } public double getCarsPrice() { double money = 0; for(Car car: cars){ money+=car.getSalePrice(); } return money; } @Override public double getCarPrice(int id) { return cars[id].getSalePrice(); } @Override public String getCarColor(int id) { return cars[id].color; } @Override public void purchaseCar(int id) { Income+=cars[id].getSalePrice(); cars[id].isSellOut=false; } }
package com.cat.service; import com.cat.bean.UserDetails; public interface UserDetailsService { /** * 1.保存用户详细信息 * * @param user */ public void saveUserDetails(UserDetails userDetails); /** * 2.根据用户的编号查找用户的详细信息 * * @param userId * @return */ public UserDetails findUserDetailsByUserId(int userId); /** * 3.查找用户的详细信息到前台 * * @return */ public UserDetails findUserDetailsToFront(); }
package model.Shark; import model.Board; import model.Tile; import model.interfaces.Piece; import resources.Sprites; import java.util.HashSet; import java.util.Set; public class NormUtilitySharkDecorator extends SharkDecorator { public NormUtilitySharkDecorator(Piece decoratedShark) { super(decoratedShark); super.setSprite(Sprites.UtilityShark); } // Used for debugging only - returns ANSI_BLUE U @Override public String toString() { return "\u001B[34m U \u001B[0m"; } @Override public Set<Tile> calcValidSpecials(Tile currentCoord, Board board) { // Adjacent pieces of the same team including diagonals Set<Tile> validSpecials = new HashSet<>(); for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { int x = currentCoord.getX() + i; int y = currentCoord.getY() + j; if (board.getTile(x, y) == null) continue; if (board.getTile(x, y).getPiece() != null) { if (board.getPiece(x, y).getPieceType() == this.getPieceType()) { validSpecials.add(board.getTile(x, y)); } } } } validSpecials.remove(currentCoord); return validSpecials; } @Override public void special(Tile destinationTile, Board board) { for (Tile t : super.getValidSpecials()) { t.getPiece().setHealth(t.getPiece().getHealth() + 1); } } @Override public Piece transform() { Piece newForm = new AltUtilitySharkDecorator(this.decoratedShark); super.getTile().setPiece(newForm); return newForm; } }
package com.tyss.javacloud.loanproject.controller; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; public class MainController { public static void main(String[] args) { Logger logger = LogManager.getLogger(MainController.class); logger.info("******** W E L C O M E ********"); logger.info("******** TO ********"); logger.info("******** LAPS BANK ********"); Login.loginController(); } }
package com.yz.git.sc.account.template; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; /** * @author xuyang * @date 2019/08/20 */ @Component public class RestTemplateConfig { @Bean @LoadBalanced public RestTemplate getRestTemplate(){ return new RestTemplate(); } }
/****************************************************** Cours: LOG121 Projet: Framework.TP3 Nom du fichier: Joueur.java Date créé: 2016-02-18 ******************************************************* Historique des modifications ******************************************************* *@author Vincent Leclerc(LECV07069406) *@author Gabriel Déry(DERG30049401) 2016-02-18 Version initiale *******************************************************/ package Framework.Des; /** * Classe qui va gérer le joueur avec son score * Created by Utilisateur on 2016-02-18. */ public class Joueur implements Comparable<Joueur> { private int numeroJoueur; private int scoreJoueur; /** * Constructeur du joueur * @param numJoueur numéro du joueur dans la partie * @param score score obtenu par le joueur */ public Joueur(int numJoueur,int score) { numeroJoueur = numJoueur; scoreJoueur = score; } /** * @return le score du joueur */ public int getScoreJoueur() { return scoreJoueur; } /** * @return le numéro du joueur */ public int getNumeroJoueur(){return numeroJoueur;} public void setScoreJoueur(int score) { scoreJoueur = scoreJoueur + score; } /* (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Joueur j) { if(j.getScoreJoueur() > this.scoreJoueur) { return 1; } else if(j.getScoreJoueur() < this.scoreJoueur) { return -1; } else { return 0; } } }
package com.archee.picturedownloader.storage.domain; import android.os.Parcel; import android.os.Parcelable; import com.archee.picturedownloader.utils.DateUtils; import com.google.common.base.Objects; import java.util.Date; /** * A parcel object to represent a single entry. */ public class Entry implements Parcelable { private String url; private Date date; public Entry(String url, Date date) { this.url = url; this.date = date; } public String getUrl() { return url; } public Date getDate() { return date; } @Override public String toString() { return url; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeStringArray(new String[] { this.url, DateUtils.format(this.date) }); } @Override public boolean equals(Object obj) { if (obj == null) return false; if (!(obj instanceof Entry)) return false; return Objects.equal(this.getUrl(), ((Entry) obj).getUrl()); } @Override public int hashCode() { return Objects.hashCode(this.url); } public static final Parcelable.Creator<Entry> CREATOR = new Creator<Entry>() { @Override public Entry createFromParcel(Parcel source) { String[] data = new String[2]; source.readStringArray(data); String url = data[0]; Date date = DateUtils.parse(data[1]); return new Entry(url, date); } @Override public Entry[] newArray(int size) { return new Entry[size]; } }; }
/* * 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 models; import java.io.Serializable; /** * * @author 785264 */ public class Note implements Serializable { private String title; private String noteContent; public Note() { } public Note(String title, String noteContent) { this.title = title; this.noteContent = noteContent; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getNoteContent() { return noteContent; } public void setnoteContent(String noteContent) { this.noteContent = noteContent; } }
package net.sf.ardengine.shapes; import net.sf.ardengine.Core; import net.sf.ardengine.Node; import net.sf.ardengine.renderer.IDrawableImpl; public class Polygon extends Node implements IShape{ /**Used by renderer to store object with additional requirements*/ protected final IShapeImpl implementation; /**Coordinates of vertexes*/ protected float[] coords; /** * @param x - X coord of center * @param y - Y coord of center * @param coords points in format [offsetFromX1, offsetFromY1, offsetFromX2, offsetFromY2] accetable by GL_TRIANGLE_STRIP */ public Polygon(float x, float y, float[] coords) { setX(x); setY(y); this.coords = coords; implementation = Core.renderer.createShapeImplementation(this); } /** * Sets new coords of this polygon * @param coords new vertex coords in [x1, y1, x2, y2] format */ public void setCoords(float[] coords) { this.coords = coords; implementation.coordsChanged(); } @Override public float[] getCoords() { return coords; } @Override public ShapeType getType() { return ShapeType.POLYGON; } @Override public void draw() { implementation.draw(); } @Override public IDrawableImpl getImplementation() { return implementation; } @Override public float getWidth() { return implementation.getShapeWidth(); } @Override public float getHeight() { return implementation.getShapeHeight(); } }
package com.sixmac.utils; import com.sixmac.core.Constant; import java.util.Calendar; import java.util.Date; /** * Created by Administrator on 2016/5/27 0027. */ public class YqtqUtils { /** * 获取指定天数的旧天数 * * @return */ public static Date getOldDate() { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, Constant.days * -1); return calendar.getTime(); } }
import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.HashMap; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; /** * View class handling the display of the highscore lists. */ /** * @author Jonatan Markusson, Alexander Klingberg * */ @SuppressWarnings("serial") public class TTHighscoresPanel extends JPanel { public TTController controller; // pointer to controller object public TTHighscoresPanel() { setBackground(Color.WHITE); } /** * Initializes all graphical elements with placeholder text. Must be called after the object has been added to a frame. */ public void setup() { setLayout(null); // absolute positioning Dimension panelSize = getParent().getSize(); Dimension size; JButton toStartButton = new JButton("OK"); toStartButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { controller.toStart(); } }); toStartButton.setFont(new java.awt.Font("Impact", 0, 30)); toStartButton.setOpaque(false); toStartButton.setContentAreaFilled(false); toStartButton.setBorderPainted(false); size = toStartButton.getPreferredSize(); toStartButton.setBounds(panelSize.width / 2 - size.width / 2, panelSize.height / 2 - size.height/ 2 + 300, size.width, size.height); add(toStartButton); } /** * Prints the 10 best highscores in each difficulty from the highscores map. If latestScore != null, mark this as green. * @param highscores A map containing the highscores to be displayed * @param latestScore A score to mark with green color, if null nothing is changed */ public void printHighscores(HashMap<Integer, ArrayList<TTHighscore>> highscores, TTHighscore latestScore) { removeAll(); setup(); Dimension panelSize = getParent().getSize(); int nr = 0; for (Integer i : highscores.keySet()) { //calculate column center int colXCenter = 40 + ((panelSize.width - 80) / highscores.size()) / 2 + nr * (panelSize.width - 80) / highscores.size(); JLabel currentLevel = new JLabel(TTController.DIFFICULTIES[i]); currentLevel.setFont(new java.awt.Font("Impact", 0, 40)); Dimension size = currentLevel.getPreferredSize(); currentLevel.setBounds(colXCenter - size.width / 2, 50, size.width, size.height); add(currentLevel); for (int j = 0; j < 10; j++) { if (highscores.get(i).size() > j) { String currentString = String.format("%d. %s - %.1f", j + 1, highscores.get(i).get(j).name, highscores.get(i).get(j).score); // mark latestScore green if (highscores.get(i).get(j) == latestScore) { currentString = "<html><span color=\"green\">" + currentString + "</span></html>"; } JLabel current = new JLabel(currentString); current.setFont(new java.awt.Font("Impact", 0, 27)); size = current.getPreferredSize(); current.setBounds(colXCenter - size.width / 2, 140 + j * 48, size.width, size.height); add(current); } else { break; } } nr++; } } }
package com.kaoqin.dao; import com.kaoqin.db.Conn; import com.kaoqin.po.QingJia; public class QingJiaDao { public static boolean addQingJia(QingJia qj){ Conn db = new Conn(); String sqlstr = "insert into kq(tid,sid, ktype,course,courseTime,content,days) values(" + qj.getTid() + "," + qj.getSid() + ",'" + qj.getKtype() + "','" + qj.getCourse() + "','" + qj.getCourseTime() + "','" + qj.getContent() + "'," + qj.getDays() + ")"; System.out.println(sqlstr); boolean flag = false; if( db.executeUpdate(sqlstr) > 0) { flag = true; } db.close(); return flag; } }
package de.jmda.app.uml.shape; import javafx.geometry.Point2D; public class Back extends MovablePointProperty implements de.jmda.graph.shape.Back { public Back(Point2D point) { super(point); } public Back(double x, double y) { this(new Point2D(x, y)); } }
package lv11_tiere; public class Rectangle extends Figure { protected double length; protected double width; public Rectangle(double length, double width) { this.length = length; this.width = width; } @Override protected double getPerimeter() { // TODO Auto-generated method stub return (length+width)*2.0; } @Override protected double getArea() { // TODO Auto-generated method stub return length*width*1.0; } }
package com.gdcp.weibo.service; import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import com.gdcp.weibo.BaseTest; import com.gdcp.weibo.dto.UserRelationExecution; import com.gdcp.weibo.entity.User; import com.gdcp.weibo.entity.UserRelation; import com.gdcp.weibo.enums.UserRelationStateEnum; public class UserRelationServiceTest extends BaseTest { @Autowired private UserRelationService userRelationService; @Test public void testGetUserRelations() { UserRelation relationCondition=new UserRelation(); User stars=new User(); stars.setUserId(23L); relationCondition.setStars(stars); UserRelationExecution ure=userRelationService.getUserRelationList(relationCondition); System.out.println(ure.getState()); System.out.println(ure.getUserRelationList().get(0).getFans().getHeadImg()); System.out.println(ure.getUserRelationList().get(0).getFans().getNickName()); System.out.println(ure.getUserRelationList().get(0).getLastEditTime()); System.out.println(ure.getUserRelationList().get(0).getFans().getHeadImg()); } @Test @Ignore public void testUserRelationById() { UserRelationExecution ure=userRelationService.getUserRelation(25, 23); System.out.println(ure.getStateInfo()); } @Test @Ignore public void testCancelUserRelationById() { UserRelationExecution ure=userRelationService.cancelUserRelation(25, 24); System.out.println(UserRelationStateEnum.stateInfoOf(ure.getState())); } @Ignore @Test public void testGetUserRelationList() { UserRelation relationCondition = new UserRelation(); // userRelation.setState(0); User fans = new User(); User stars = new User(); // fans.setUserId(24L); stars.setUserId(25L); // relationCondition.setFans(fans); relationCondition.setStars(stars); UserRelationExecution ure =userRelationService.getUserRelationList(relationCondition); System.out.println(UserRelationStateEnum.stateInfoOf(ure.getState())); System.out.println(ure.getState()); System.out.println(ure.getCount()); System.out.println(ure.getUserRelationList().get(0).getFans().getUserId()); System.out.println(ure.getUserRelationList().get(0).getStars().getUserId()); System.out.println(ure.getUserRelationList().get(1).getFans().getUserId()); System.out.println(ure.getUserRelationList().get(1).getStars().getUserId()); } @Ignore @Test public void testAddUserRelation() { UserRelation userRelation = new UserRelation(); // userRelation.setState(0); User fans = new User(); User stars = new User(); fans.setUserId(25L); stars.setUserId(23L); userRelation.setFans(fans); userRelation.setStars(stars); System.out.println(userRelation.getFans().getUserId()); System.out.println(userRelation.getStars().getUserId()); UserRelationExecution ure =userRelationService.addUserRelation(userRelation); System.out.println(ure.getStateInfo()); System.out.println(ure.getState()); } }
package pl.dostrzegaj.soft.flicloader; import java.io.File; class PhotoFolderDir { private final File dir; private RelativePath relativePath; public PhotoFolderDir(File root,File dir) { this.dir = dir; this.relativePath = new RelativePath(root,dir); } public File getDir() { return dir; } public RelativePath getRelativePath() { return relativePath; } @Override public String toString() { final StringBuilder sb = new StringBuilder("PhotoFolderDir{"); sb.append("dir=").append(dir); sb.append(", relativePath=").append(relativePath); sb.append('}'); return sb.toString(); } }
package com.book.templatemethod; import java.util.Scanner; /** * @author weigs * @date 2017/10/2 0002 */ public class Coffee extends CaffeineBeverage { @Override void brew() { System.out.println("Dripping Coffee through filter"); } @Override void addCondiments() { System.out.println("Adding Suger and Milk"); } @Override boolean customerWantsCondiments() { String answer = getUserInput(); if (answer.toLowerCase().startsWith("y")) { return true; } else { return false; } } public String getUserInput() { System.out.println("Would you like milk and sugar with your coffee (y/n)?"); Scanner scanner = new Scanner(System.in); String answer = scanner.nextLine(); if (answer == null) return "no"; return answer; } }
package com.appdear.client.service.api; import java.io.Serializable; public class ApiCustomAppResult implements Serializable{ public String sv ; public String imei; public String resultcode; public int isok; }
package hr.spring.urlshortener.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty.Access; @JsonIgnoreProperties(ignoreUnknown = true) public class Account { @JsonProperty(value = "accountId", access = Access.WRITE_ONLY) private String accountId; @JsonProperty(value = "success", access = Access.READ_ONLY) private boolean success; @JsonProperty(value = "description", access = Access.READ_ONLY) private String description; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "password", access = Access.READ_ONLY) private String password; public String getAccountId() { return accountId; } public boolean isSuccess() { return success; } public String getDescription() { return description; } public String getPassword() { return password; } public void setAccountId(String accountId) { this.accountId = accountId; } public void setSuccess(boolean success) { this.success = success; } public void setDescription(String description) { this.description = description; } public void setPassword(String password) { this.password = password; } }
package com.example.journey_datn.fragment; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.example.journey_datn.Activity.MainActivity; import com.example.journey_datn.Adapter.AdapterRcvAllDiary; import com.example.journey_datn.Model.Diary; import com.example.journey_datn.R; import com.example.journey_datn.db.FirebaseDB; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class FragmentAllDiary extends Fragment implements AdapterRcvAllDiary.onItemLongClickListener, AdapterRcvAllDiary.onItemClickListener { private RecyclerView rcvAllDiary; private AdapterRcvAllDiary adapterRcvAllDiary; private LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); private FirebaseDB firebaseDB = new FirebaseDB(MainActivity.userId); private ArrayList<Diary> list = new ArrayList<>(); private AdapterRcvAllDiary.OnClickItemTab1 onClickItemTab1; private ImageView imgBack, imgDelete; private Set<Integer> posDelete = new HashSet<>(); private boolean checkRdb = false; private onDeletedItemListener onDeletedItem; public void setOnClickItemTab1(AdapterRcvAllDiary.OnClickItemTab1 onClickItemTab1) { this.onClickItemTab1 = onClickItemTab1; } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_all_diary, container, false); rcvAllDiary = view.findViewById(R.id.rcv_all_diary); imgDelete = view.findViewById(R.id.img_delete_all_diary); imgBack = view.findViewById(R.id.img_back_all_diary); getDataDelay(); imgBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity().finish(); } }); imgDelete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { deleteItems(); } }); return view; } private void getDataDelay(){ new Handler().postDelayed(new Runnable() { @Override public void run() { list = MainActivity.diaryList; adapterRcvAllDiary = new AdapterRcvAllDiary(getContext(), list, onClickItemTab1); rcvAllDiary.setAdapter(adapterRcvAllDiary); rcvAllDiary.setLayoutManager(linearLayoutManager); setAdapter(); } }, 200); } private void setAdapter(){ adapterRcvAllDiary.setItemLongClickListener(this); adapterRcvAllDiary.setItemClickListener(this); } @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); getDataDelay(); } @Override public void onItemClick(int position) { if (checkRdb) { if (list.get(position).isCheckRdb()) posDelete.add(position); else if (posDelete.contains(position)) posDelete.remove(position); } } @Override public void onItemLongClick(int position) { checkRdb = true; imgDelete.setVisibility(View.VISIBLE); } private void deleteItems() { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Delete"); builder.setMessage("Do you want to delete " + posDelete.size() + " diary?"); builder.setCancelable(false); builder.setPositiveButton("Cancel", new DialogInterface.OnClickListener() { @SuppressLint("RestrictedApi") @Override public void onClick(DialogInterface dialogInterface, int i) { refreshDelete(); } }); builder.setNegativeButton("Ok", new DialogInterface.OnClickListener() { @SuppressLint("RestrictedApi") @Override public void onClick(DialogInterface dialogInterface, int i) { List<Diary> diaries = new ArrayList<>(); for (int element : posDelete) diaries.add(list.get(element)); for (Diary diary : diaries) firebaseDB.deleteDiary(diary.getId()); onDeletedItem.deleted(true); refreshDelete(); dialogInterface.dismiss(); } }); AlertDialog alertDialog = builder.create(); alertDialog.show(); } @SuppressLint("RestrictedApi") private void refreshDelete() { checkRdb = false; imgDelete.setVisibility(View.INVISIBLE); adapterRcvAllDiary.notifiData(posDelete); posDelete = new HashSet<>(); } public void setDeleteItem(onDeletedItemListener dl){ this.onDeletedItem = dl; } public interface onDeletedItemListener{ void deleted(boolean dl); } }
package com.tencent.mm.plugin.label.ui; import com.tencent.mm.plugin.label.ui.ContactLabelManagerUI.4; import com.tencent.mm.plugin.label.ui.ContactLabelManagerUI.a; import com.tencent.mm.plugin.label.ui.ContactLabelManagerUI.b; class ContactLabelManagerUI$4$2 implements Runnable { final /* synthetic */ 4 kBn; ContactLabelManagerUI$4$2(4 4) { this.kBn = 4; } public final void run() { ContactLabelManagerUI.a(this.kBn.kBk, b.kBp); a k = ContactLabelManagerUI.k(this.kBn.kBk); k.mData = ContactLabelManagerUI.g(this.kBn.kBk); k.notifyDataSetChanged(); ContactLabelManagerUI.k(this.kBn.kBk).notifyDataSetInvalidated(); if (this.kBn.kBm && ContactLabelManagerUI.c(this.kBn.kBk) != null) { ContactLabelManagerUI.c(this.kBn.kBk).removeMessages(5002); ContactLabelManagerUI.c(this.kBn.kBk).sendEmptyMessageDelayed(5003, 400); } } }
package com.tencent.mm.plugin.facedetect.service; import android.content.Intent; import com.tencent.mm.plugin.facedetect.e.a$b; import com.tencent.mm.sdk.platformtools.ad; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; class b$1 implements a$b { final /* synthetic */ long iPJ; final /* synthetic */ b iPK; b$1(b bVar, long j) { this.iPK = bVar; this.iPJ = j; } public final void AW(String str) { x.i("MicroMsg.FaceDetectServiceControllerMp", "hy: video release done. using: %d ms. file path: %s", new Object[]{Long.valueOf(bi.bI(this.iPJ)), str}); if (!bi.oW(str)) { Intent intent = new Intent(ad.getContext(), FaceUploadVideoService.class); intent.putExtra("key_video_file_name", str); intent.putExtra("k_bio_id", this.iPK.iNq); intent.putExtra("key_app_id", this.iPK.mAppId); ad.getContext().startService(intent); } } }
package net.minecraft.enchantment; import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.init.Enchantments; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public class EnchantmentFrostWalker extends Enchantment { public EnchantmentFrostWalker(Enchantment.Rarity rarityIn, EntityEquipmentSlot... slots) { super(rarityIn, EnumEnchantmentType.ARMOR_FEET, slots); setName("frostWalker"); } public int getMinEnchantability(int enchantmentLevel) { return enchantmentLevel * 10; } public int getMaxEnchantability(int enchantmentLevel) { return getMinEnchantability(enchantmentLevel) + 15; } public boolean isTreasureEnchantment() { return true; } public int getMaxLevel() { return 2; } public static void freezeNearby(EntityLivingBase living, World worldIn, BlockPos pos, int level) { if (living.onGround) { float f = Math.min(16, 2 + level); BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(0, 0, 0); for (BlockPos.MutableBlockPos blockpos$mutableblockpos1 : BlockPos.getAllInBoxMutable(pos.add(-f, -1.0D, -f), pos.add(f, -1.0D, f))) { if (blockpos$mutableblockpos1.distanceSqToCenter(living.posX, living.posY, living.posZ) <= (f * f)) { blockpos$mutableblockpos.setPos(blockpos$mutableblockpos1.getX(), blockpos$mutableblockpos1.getY() + 1, blockpos$mutableblockpos1.getZ()); IBlockState iblockstate = worldIn.getBlockState((BlockPos)blockpos$mutableblockpos); if (iblockstate.getMaterial() == Material.AIR) { IBlockState iblockstate1 = worldIn.getBlockState((BlockPos)blockpos$mutableblockpos1); if (iblockstate1.getMaterial() == Material.WATER && ((Integer)iblockstate1.getValue((IProperty)BlockLiquid.LEVEL)).intValue() == 0 && worldIn.func_190527_a(Blocks.FROSTED_ICE, (BlockPos)blockpos$mutableblockpos1, false, EnumFacing.DOWN, null)) { worldIn.setBlockState((BlockPos)blockpos$mutableblockpos1, Blocks.FROSTED_ICE.getDefaultState()); worldIn.scheduleUpdate(blockpos$mutableblockpos1.toImmutable(), Blocks.FROSTED_ICE, MathHelper.getInt(living.getRNG(), 60, 120)); } } } } } } public boolean canApplyTogether(Enchantment ench) { return (super.canApplyTogether(ench) && ench != Enchantments.DEPTH_STRIDER); } } /* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraft\enchantment\EnchantmentFrostWalker.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
package br.com.pcmaker.dao.impl; import java.util.List; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Order; import org.springframework.stereotype.Repository; import br.com.pcmaker.dao.DAO; import br.com.pcmaker.dao.OrdemServicoAtivaDAO; import br.com.pcmaker.entity.OrdemServicoAtiva; @Repository public class OrdemServicoAtivaDaoImpl extends DAO implements OrdemServicoAtivaDAO{ @SuppressWarnings("unchecked") public List<OrdemServicoAtiva> query() { DetachedCriteria criteria = DetachedCriteria.forClass(OrdemServicoAtiva.class); criteria.addOrder(Order.asc("numeroOrdemServico")); return (List<OrdemServicoAtiva>) template.findByCriteria(criteria); } }
package io.wizzie.bootstrapper.bootstrappers.impl; import io.wizzie.bootstrapper.bootstrappers.base.ThreadBootstrapper; import io.wizzie.bootstrapper.builder.Config; import io.wizzie.bootstrapper.builder.SourceSystem; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.errors.WakeupException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import static org.apache.kafka.clients.consumer.ConsumerConfig.*; public class KafkaBootstrapper extends ThreadBootstrapper { private static final Logger log = LoggerFactory.getLogger(KafkaBootstrapper.class); public final static String BOOTSTRAP_TOPICS_CONFIG = "bootstrap.kafka.topics"; public final static String APPLICATION_ID_CONFIG = "application.id"; AtomicBoolean closed = new AtomicBoolean(false); List<TopicPartition> storePartitions; String appId; KafkaConsumer<String, String> restoreConsumer; @Override public void init(Config config) throws IOException { Properties consumerConfig = new Properties(); appId = config.get(APPLICATION_ID_CONFIG); consumerConfig.put(BOOTSTRAP_SERVERS_CONFIG, config.get(BOOTSTRAP_SERVERS_CONFIG)); consumerConfig.put(AUTO_OFFSET_RESET_CONFIG, "earliest"); consumerConfig.put(ENABLE_AUTO_COMMIT_CONFIG, "false"); consumerConfig.put(KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer"); consumerConfig.put(VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer"); consumerConfig.put(GROUP_ID_CONFIG, String.format( "kafka-bootstrapper-%s-%s", appId, UUID.randomUUID().toString()) ); List<String> bootstrapperTopics = config.get(BOOTSTRAP_TOPICS_CONFIG); storePartitions = new ArrayList<>(); restoreConsumer = new KafkaConsumer<>(consumerConfig); for (String bootstrapperTopic : bootstrapperTopics) { storePartitions.add(new TopicPartition(bootstrapperTopic, 0)); } restoreConsumer.assign(storePartitions); // calculate the end offset of the partition // TODO: this is a bit hacky to first seek then position to get the end offset restoreConsumer.seekToEnd(storePartitions); Map<TopicPartition, Long> endOffsets = new HashMap<>(); for (TopicPartition storePartition : storePartitions) { Long endOffset = restoreConsumer.position(storePartition); endOffsets.put(storePartition, endOffset); } for (Map.Entry<TopicPartition, Long> entry : endOffsets.entrySet()) { long offset = 0L; String jsonStreamConfig = null; restoreConsumer.assign(Collections.singletonList(entry.getKey())); // restore the state from the beginning of the change log otherwise restoreConsumer.seekToBeginning(Collections.singletonList(entry.getKey())); while (offset < entry.getValue()) { for (ConsumerRecord<String, String> record : restoreConsumer.poll(100).records(entry.getKey())) { if (record.key() != null && record.key().equals(appId)) jsonStreamConfig = record.value(); } offset = restoreConsumer.position(entry.getKey()); log.info("Recover from kafka offset[{}], endOffset[{}]", offset, entry.getValue()); } if (jsonStreamConfig != null) { log.info("Find stream configuration with app id [{}]", appId); update(new SourceSystem("kafka", entry.getKey().topic()), jsonStreamConfig); } else { log.info("Don't find any stream configuration with app id [{}]", appId); } } } @Override public void run() { currentThread().setName("KafkaBootstrapper"); restoreConsumer.assign(storePartitions); while (!closed.get()) { log.debug("Searching stream configuration with app id [{}]", appId); try { for (ConsumerRecord<String, String> record : restoreConsumer.poll(5000)) { System.out.println(record); if (record.key() != null && record.key().equals(appId)) { log.info("Find stream configuration with app id [{}]", appId); update(new SourceSystem("kafka", record.topic()), record.value()); } } } catch (WakeupException e) { if (!closed.get()) throw e; log.info("Closing restore consumer ..."); restoreConsumer.close(1, TimeUnit.MINUTES); } } } @Override public synchronized void close() { closed.set(true); restoreConsumer.wakeup(); log.info("Stop KafkaBootstrapper service"); } }
package com.swqs.schooltrade.util; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.swqs.schooltrade.R; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.Display; import android.view.Window; import android.view.WindowManager; import android.widget.ImageView; import okhttp3.Call; import okhttp3.Callback; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public class Util { public static void loadImage(final Activity activity, String url, final ImageView image) { OkHttpClient client = Server.getSharedClient(); Request request = new Request.Builder().url(Server.serverAddress+url).build(); client.newCall(request).enqueue(new Callback() { @Override public void onResponse(Call arg0, Response arg1) throws IOException { try { byte[] bytes = arg1.body().bytes(); final Bitmap bmp = FileUtils.revitionImageSize(bytes); activity.runOnUiThread(new Runnable() { @Override public void run() { image.setImageBitmap(bmp); } }); } catch (Exception ex) { activity.runOnUiThread(new Runnable() { @Override public void run() { image.setImageResource(R.drawable.ic_launcher); } }); } } @Override public void onFailure(Call arg0, IOException arg1) { activity.runOnUiThread(new Runnable() { @Override public void run() { image.setImageResource(R.drawable.ic_launcher); } }); } }); } /** * 验证邮箱 * * @param email * @return */ public static boolean checkEmail(String email) { boolean flag = false; try { String check = "^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; Pattern regex = Pattern.compile(check); Matcher matcher = regex.matcher(email); flag = matcher.matches(); } catch (Exception e) { flag = false; } return flag; } /** * 验证手机号码 * * @param mobiles * @return */ public static boolean checkMobileNumber(String mobileNumber) { boolean flag = false; try { Pattern regex = Pattern .compile("^(((13[0-9])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8})|(0\\d{2}-\\d{8})|(0\\d{3}-\\d{7})$"); Matcher matcher = regex.matcher(mobileNumber); flag = matcher.matches(); } catch (Exception e) { flag = false; } return flag; } public static CustomProgressDialog getProgressDialog(Activity act,int layoutResID) { CustomProgressDialog progressDialog; progressDialog = new CustomProgressDialog(act, layoutResID); progressDialog.setCanceledOnTouchOutside(false); /* * 将对话框的大小按屏幕大小的百分比设置 */ Window dialogWindow = progressDialog.getWindow(); WindowManager m = act.getWindowManager(); Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用 WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值 p.width = (int) (d.getWidth() * 0.9); // 宽度设置为屏幕的0.9 dialogWindow.setAttributes(p); return progressDialog; } }
package emmet.warehousing.operation.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import emmet.core.data.entity.StorageSpace; import emmet.core.data.entity.Warehouse; import emmet.warehousing.operation.exception.DataNotFoundException; import emmet.warehousing.operation.model.StorageSpaceCreateModel; import emmet.warehousing.operation.repository.StorageSpaceRepository; import emmet.warehousing.operation.repository.WarehouseRepository; @Service public class StorageSpaceService { @Autowired WarehouseRepository warehouseRepository; @Autowired StorageSpaceRepository storageSpaceRepository; synchronized public StorageSpace createStorageSpace(String warehouseId,StorageSpaceCreateModel model) throws DataNotFoundException { Warehouse warehouse = warehouseRepository.findOne(warehouseId); if (warehouse == null) { throw new DataNotFoundException("The warehouse is not existed. ID=" + warehouseId); } Long currentSerial = 0L; String lastId = storageSpaceRepository.findLastId(warehouseId); if (lastId != null) { int serialStartPos = lastId.indexOf("-") + 1; currentSerial = Long.valueOf(lastId.substring(serialStartPos, 11)); } //warehouse name in one organization is different List<StorageSpace> list = storageSpaceRepository.findByNameAndWarehouseId(model.getName(), warehouse.getId()); if(list.size()>0){ throw new DataNotFoundException("storage name in one warehouse must be different"); } StorageSpace storage = new StorageSpace(); storage.setWarehouse(warehouse); // Generate ID String id = warehouseId + "-" + String.format("%06d", currentSerial + 1); storage.setId(id); storage.setName(model.getName()); return storageSpaceRepository.save(storage); } public void delete(String storageId) { storageSpaceRepository.delete(storageId); } }
package cn.joes.forkjoin; import java.util.concurrent.RecursiveTask; /** * Created by myijoes on 2018/9/27. * * @author wanqiao */ public class ForkJoinTask extends RecursiveTask<Long> { private int taskSum = 5000; Long start; Long end; public ForkJoinTask(Long start, Long end) { this.start = start; this.end = end; } @Override protected Long compute() { if (end - start <= taskSum) { long total = 0; for (Long i = start; i < end; i++) { total += i; } return total; } else { long avg = (end - start) / 2; ForkJoinTask forkJoinTask = new ForkJoinTask(start, avg); ForkJoinTask forkJoinTask1 = new ForkJoinTask(avg, end); forkJoinTask.fork(); forkJoinTask1.fork(); return forkJoinTask.join() + forkJoinTask.join(); } } }
package com.klj.springtest.vo; import org.apache.http.util.EntityUtils; /** * @author klj * @Title: HttpResult * @Description: TODO * @date 2018/8/610:56 */ public class HttpResult { // 响应的状态码 private int code; // 响应的响应体 private String body; public HttpResult(int code, String body) { this.code = code; this.body = body; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getBody() { return body; } public void setBody(String body) { this.body = body; } }
package support.yz.data.mvc.service.inter; import support.yz.data.entity.entityInfo.*; import java.util.List; public interface TechnologyService { public List<EnterpriseAchievements> getCompanyAchievementsByTechnology(String achievementsDomain) throws Exception; public List<EnterpriseInfo> getCompanyByTechnology(String companyDomain) throws Exception; public List<EnterpriseNews> getCompanyNewsByTechnology(String newsDomain) throws Exception; List<EnterprisePatent> getCompanyPatentByTechnology(String patentDomain) throws Exception; public TechnologyInfo getTechnologyInfoByName(String name) throws Exception; }
package com.zwh.service; import com.zwh.model.User; public interface UserService { User Login(String username, String password); int Enroll(String username, String password, String userPic); User selectName(String username); }
package com.mrice.txl.appthree.bean; import android.text.TextUtils; import java.io.Serializable; /** * Created by Mr on 2017/11/28. */ public class SwitchDetails implements Serializable{ private String id; private String url; private String type; private String show_url; private String appid; private String comment; private String createAt; private String updateAt; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getShow_url() { return show_url; } public void setShow_url(String show_url) { this.show_url = show_url; } public String getAppid() { return appid; } public void setAppid(String appid) { this.appid = appid; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public String getCreateAt() { return createAt; } public void setCreateAt(String createAt) { this.createAt = createAt; } public String getUpdateAt() { return updateAt; } public void setUpdateAt(String updateAt) { this.updateAt = updateAt; } public boolean isSwitchOn() { return TextUtils.equals(show_url, "1"); } }
package GreenValues; /** * Class containing different constant values for green paramaters */ public class GreenValues { /* Shop parameters */ public static double GREEN_PERCEIVED_RISK_CONTRIBUTION_PERCENTIGE = 14.8; public static double GREEN_PERCEIVED_TRUST_CONTRIBUTION_PERCENTIGE = 18; public static double GREEN_BRAND_IMAGE_CONTRIBUTION_PERCENTIGE = 13; public static double ENVIRONMENTAL_ADVERTISEMENT_CONTRIBUTION_PERCENTIGE = 34; /* Agent.Agent parameters*/ public static double GREEN_AWERENESS_CONTRIBUTION_PERCENTIGE = 19; /* There is still 1.2% contribution to GPIN needed so that needs to be random distributed across the other parameters*/ }