blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3377d2175404d087065127daecf0da037cef67e | 6811fd178ae01659b5d207b59edbe32acfed45cc | /jira-project/jira-page-objects/src/main/java/com/atlassian/jira/pageobjects/pages/viewissue/DeleteLinkConfirmationDialog.java | 92fa5486c5ba1befcb3cb1b182fd9363e59138b7 | [] | no_license | xiezhifeng/mysource | 540b09a1e3c62614fca819610841ddb73b12326e | 44f29e397a6a2da9340a79b8a3f61b3d51e331d1 | refs/heads/master | 2023-04-14T00:55:23.536578 | 2018-04-19T11:08:38 | 2018-04-19T11:08:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,661 | java | package com.atlassian.jira.pageobjects.pages.viewissue;
import com.atlassian.jira.pageobjects.dialogs.JiraDialog;
import com.atlassian.jira.pageobjects.util.TraceContext;
import com.atlassian.jira.pageobjects.util.Tracer;
import com.atlassian.pageobjects.PageBinder;
import com.atlassian.pageobjects.binder.Init;
import com.atlassian.pageobjects.binder.WaitUntil;
import com.atlassian.pageobjects.elements.PageElement;
import com.atlassian.pageobjects.elements.PageElementFinder;
import com.atlassian.pageobjects.elements.query.Poller;
import com.atlassian.webdriver.AtlassianWebDriver;
import org.openqa.selenium.By;
import javax.inject.Inject;
/**
* Represents the delete link confirmation dialog.
*
* @since v5.0
*/
public class DeleteLinkConfirmationDialog extends JiraDialog
{
private final static String DIALOG_ELEMENT_ID = "delete-issue-link-dialog";
private final static String DIRTY_FLAG_CLASS = "dirtyFlagClass";
@Inject
private PageBinder pageBinder;
@Inject
private PageElementFinder locator;
@Inject
private AtlassianWebDriver driver;
@Inject
private TraceContext traceContext;
private final String issueKey;
private PageElement dialog;
private String title;
private String message;
public DeleteLinkConfirmationDialog(String issueKey)
{
this.issueKey = issueKey;
}
@WaitUntil
public void waitUntilPageReady()
{
Poller.waitUntilTrue(locator.find(By.id(DIALOG_ELEMENT_ID)).timed().isVisible());
}
@Init
public void init()
{
dialog = locator.find(By.id(DIALOG_ELEMENT_ID));
title = dialog.find(By.className(HEADING_AREA_CLASS)).getText();
message = dialog.find(By.className("aui-message")).getText();
}
public String getTitle()
{
return title;
}
public String getMessage()
{
return message;
}
public ViewIssuePage confirm()
{
PageElement deleteButton = locator.find(By.id("issue-link-delete-submit"));
driver.executeScript("AJS.$('#" + DIALOG_ELEMENT_ID + "').addClass('" + DIRTY_FLAG_CLASS + "');");
Tracer tracer = traceContext.checkpoint();
deleteButton.click();
Poller.waitUntilFalse(dialog.timed().hasClass(DIRTY_FLAG_CLASS));
ViewIssuePage viewIssuePage = pageBinder.bind(ViewIssuePage.class, issueKey);
return viewIssuePage.waitForAjaxRefresh(tracer);
}
public ViewIssuePage cancel()
{
PageElement cancelLink = locator.find(By.id("issue-link-delete-cancel"));
cancelLink.click();
return pageBinder.bind(ViewIssuePage.class, issueKey);
}
}
| [
"moink635@gmail.com"
] | moink635@gmail.com |
bf264c440bafb514e546d7bba0c60b61d4047b3a | 60f151a7ab005802de81c08b1337cb88c49a146f | /src/main/java/com/ingenosya/carsapi/controller/UsersController.java | 66c9eb32267e89e520bba8abe0a93d4a8c8a6f4f | [] | no_license | hubgit-githubs/cars-api | 22de441ff4df8f30e9b203c10ea45b827066a886 | b42d9c78497974d540da8636fb6f910c1dc07d22 | refs/heads/master | 2023-04-19T17:44:00.302123 | 2021-05-03T08:05:44 | 2021-05-03T08:05:44 | 363,830,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | package com.ingenosya.carsapi.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ingenosya.carsapi.service.UserService;
@RestController
public class UsersController {
@Autowired
private UserService userService;
@GetMapping("/userCarLogin")
public UserDetails findLogin(String username) throws UsernameNotFoundException {
UserDetails userDetails = userService.loadUserByUsername(username);
return userDetails;
}
}
| [
"a.andrianay@gmail.com"
] | a.andrianay@gmail.com |
bd877bae3db15bd4ca966be20130d69af48096b0 | 3260cac7fde2e168e1f06479778e3e464a85397a | /GuI_2/src/gui/cn/Caculate_2.java | cd8cd304d40bc7a1931e5900b621bebb51edf73c | [] | no_license | niuxingwei/Java | 1df0b1304b4f5c21110e225195b83652b4b310d2 | 071e887f5b90fd76e171c3ec803ff055d18e667f | refs/heads/master | 2020-04-26T09:03:36.218485 | 2019-07-22T11:22:26 | 2019-07-22T11:22:26 | 172,833,042 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,817 | java | package gui.cn;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;
public class Caculate_2 extends JFrame {
/**
*
*/
private static final long serialVersionUID = 4688933049158247876L;
private JPanel contentPane; // 内容面板
private JTextField textField; // 文本框
public Caculate_2() {
setTitle("Caculate"); // 设置窗体的标题
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 设置窗体退出时操作
setBounds(100, 100, 550, 500); // 设置窗体位置和大小
contentPane = new JPanel(); // 创建内容面板
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); // 设置面板的边框
contentPane.setLayout(new BorderLayout(0, 0)); // 设置内容面板为边界布局
setContentPane(contentPane); // 应用内容面板
JPanel panel1 = new JPanel(); // 新建面板用于保存文本框
contentPane.add(panel1, BorderLayout.NORTH); // 将面板放置在边界布局的北部
textField = new JTextField(); // 新建文本框
textField.setHorizontalAlignment(SwingConstants.RIGHT); // 文本框中的文本使用右对齐
panel1.add(textField); // 将文本框增加到面板中
textField.setColumns(40); // 设置文本框的列数是18
textField.setCaretColor(Color.red);
// textField.setBackground(Color.gray);
JPanel panel2 = new JPanel(); // 新建面板用于保存按钮
contentPane.add(panel2, BorderLayout.CENTER); // 将面板放置在边界布局的中央
panel2.setLayout(new GridLayout(4, 4, 5, 5)); // 面板使用网格4X4布局
JButton button01 = new JButton("7"); // 新建按钮
panel2.add(button01); // 应用按钮
JButton button02 = new JButton("8"); // 新建按钮
panel2.add(button02); // 应用按钮
JButton button03 = new JButton("9"); // 新建按钮
panel2.add(button03); // 应用按钮
JButton button04 = new JButton("+"); // 新建按钮
panel2.add(button04); // 应用按钮
JButton button05 = new JButton("4"); // 新建按钮
panel2.add(button05); // 应用按钮
JButton button06 = new JButton("5"); // 新建按钮
panel2.add(button06); // 应用按钮
JButton button07 = new JButton("6"); // 新建按钮
panel2.add(button07); // 应用按钮
JButton button08 = new JButton("-"); // 新建按钮
panel2.add(button08); // 应用按钮
JButton button09 = new JButton("3"); // 新建按钮
panel2.add(button09); // 应用按钮
JButton button10 = new JButton("2"); // 新建按钮
panel2.add(button10); // 应用按钮
JButton button11 = new JButton("1"); // 新建按钮
panel2.add(button11); // 应用按钮
JButton button12 = new JButton("*"); // 新建按钮
panel2.add(button12); // 应用按钮
JButton button13 = new JButton("0"); // 新建按钮
panel2.add(button13); // 应用按钮
JButton button14 = new JButton("."); // 新建按钮
panel2.add(button14); // 应用按钮
JButton button15 = new JButton("="); // 新建按钮
panel2.add(button15); // 应用按钮
JButton button16 = new JButton("/"); // 新建按钮
panel2.add(button16); // 应用按钮
}
public void num(int i){
String s=String.valueOf(i); //将整数变量转化为字符串类型
if((textField.getText()).equals("0")){
//如果文本框的内容为零,则覆盖文本框的内容
textField.setText(s); }
else{ //如果文本框的内容不为零,则在内容后面添加数字
String str = textField.getText() + s;
textField.setText(str);
}
}
public static void main(String[] args) {
Caculate_2 frame = new Caculate_2();
frame.setVisible(true);
}
} | [
"1669250716@qq.com"
] | 1669250716@qq.com |
65c21599a4eeb9f1b6db724dc9464189f3fc4384 | 9df724d20f70ab1099ef36f8eb06b1bc9dedb753 | /jar/src/main/java/com/switchfully/Application.java | 94cfac0e49f74ff97b864f82c0486cda7971f90f | [] | no_license | Mert1980/springboot-stock-excange | 54dddfc332db0407043c2270956c8811be4b89c9 | cceac2fd1245083bbe2a2722b79541bde12854da | refs/heads/master | 2023-08-31T04:11:47.655375 | 2021-10-19T15:37:12 | 2021-10-19T15:37:12 | 417,158,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package com.switchfully;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"mertdemirok80@gmail.com"
] | mertdemirok80@gmail.com |
57e47487b3edc7962e4ff96c190f302c311d9b01 | dfdee144c61d4999a0a6510fbed9980c221b3e2b | /micro-core/src/main/java/micro/core/tool/extension/SpiLoadException.java | cc04fd88817cf14eb971876736141e864f9873e2 | [] | no_license | frankzhengzhiwen/config-server | 3fe6462ad170da1cbb249bfc88b0337f86d25091 | e20d6b759f10c66134736a3b6069107ffa3c02f3 | refs/heads/master | 2021-07-15T00:59:17.639185 | 2017-10-19T14:58:59 | 2017-10-19T14:58:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | /**
* Copyright (c) 2017, micro All Rights Reserved.
*/
package micro.core.tool.extension;
/**
* SPI加载异常类
*
* @author <a href="mailto:frankzhiwen@163.com">郑智文(Frank Zheng)</a>
* @version 0.0.1
* @date 2017年8月14日
*/
public class SpiLoadException extends RuntimeException {
private static final long serialVersionUID = 3166366923805958621L;
/**
* Creates a new instance of SpiLoadException
* @param message
* @param cause
*/
public SpiLoadException(String message, Throwable cause) {
super(message, cause);
}
/**
* Creates a new instance of SpiLoadException
* @param message
*/
public SpiLoadException(String message) {
super(message);
}
/**
* Creates a new instance of SpiLoadException
* @param cause
*/
public SpiLoadException(Throwable cause) {
super(cause);
}
}
| [
"yuanhaitao_cd@keruyun.com"
] | yuanhaitao_cd@keruyun.com |
1f3cdb41f76465eaf4c99c3b537b832eb5cdb2a3 | 611d4baca233346f7122be838d7ee87c2ca6fce2 | /src/com/company/Main.java | 301af6a2c34a0871fc9e032e0c333544990b7b90 | [] | no_license | lizbog-0/github-upload | 3ed43d5fae80afb09bc04f0b044592572e2c8684 | f9e96a5f0942c93152ea38f51454fd8336b526ae | refs/heads/master | 2023-04-07T07:46:22.040189 | 2021-04-21T10:10:22 | 2021-04-21T10:10:22 | 359,897,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 126 | java | package com.company;
public class Main {
public static void main(String[] args) {
System.out.println("lab 4");
}
}
| [
"82875964+lizbog-0@users.noreply.github.com"
] | 82875964+lizbog-0@users.noreply.github.com |
c26cc477867c5ae0007560a99a43c55f0aa86be1 | 0af19401ed289a7a57cffe5011391af550aabee5 | /dell/myapplication/ambulancemain.java | 76c6a96b5ce1be4acb8a2d556a03722c6407a941 | [] | no_license | Priyadarshanipp/AspirantsUI | 2ba6a920054769bfd8b83b99edc04aaaebe12e00 | 52de4aa081b1360be7e6d27192ba5c2c5f077f51 | refs/heads/master | 2021-07-07T10:17:35.852161 | 2017-10-02T13:23:06 | 2017-10-02T13:23:06 | 105,535,160 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,881 | java | package com.example.dell.myapplication;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
public class ambulancemain extends AppCompatActivity {
String []name={"sangli Ambulance services"};
String []contact={"90123456778"};
String []Address={"civil road sangli"};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ambulancemain);
ListView v = (ListView) findViewById(R.id.ambList);
CustomAdapter2 ca = new CustomAdapter2(getBaseContext(),name,Address,contact);
v.setAdapter(ca);
}
}
class CustomAdapter2 extends ArrayAdapter {
String []ambaname;
String []acontact;
String []aaddress;
public CustomAdapter2(Context c, String []name, String []address, String []cont)
{
super(c,R.layout.showamb,R.id.textView28,name);
this.ambaname=name;
this.acontact=address;
this.aaddress=cont;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row=inflater.inflate(R.layout.showamb,viewGroup,false);
TextView tv=(TextView)row.findViewById(R.id.textView28);
TextView tv1=(TextView)row.findViewById(R.id.textView30);
TextView tv2=(TextView)row.findViewById(R.id.textView29);
tv.setText(ambaname[i]);
tv1.setText(acontact[i]);
tv2.setText(aaddress[i]);
return row;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
d4572e3b4903f77bd0ce31adf609e810097f3e67 | 1b1a8c175ef9fee3b81a0dae25e2c431c884532f | /gusofia-case/src/main/java/com/tongbanjie/gusofia/thread/interrupt/MySocketInterrupt.java | 81ecb9d50a3c271ed7baa596de877fe698fd9fec | [] | no_license | gummike/gusofia | 60229a85e28ca33027c7b7f1f29986977721e89c | ca64497cdbbf1ae50c423c579b74279af51d7265 | refs/heads/master | 2021-01-19T22:36:51.605101 | 2017-07-27T03:03:17 | 2017-07-27T03:03:17 | 88,832,467 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,016 | java | package com.tongbanjie.gusofia.thread.interrupt;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author zi.you
* @date 17/7/12
*/
public class MySocketInterrupt extends Thread {
private volatile boolean stop = false;
public static void main(String[] args) throws InterruptedException {
System.out.println("main start");
MySocketInterrupt thread = new MySocketInterrupt();
ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.submit(thread);
Thread.sleep(3000);
// 不能停止非阻塞的线程
thread.interrupt();
// 停止非阻塞线程的方式
// thread.setStop(true);
executorService.shutdown();
System.out.println("main end");
}
@Override
public void run() {
while (!stop) {
System.out.println("running");
}
}
public void setStop(boolean stop) {
this.stop = stop;
}
}
| [
"gulidong@gulidongdeMacBook-Pro.local"
] | gulidong@gulidongdeMacBook-Pro.local |
47a2714aa18f65734dcf8d6e3313018be14ca461 | 599bfd91063e5f7c745c1b111894c30d61d80b63 | /src/ctrl/FormatacaoConteudoCtrl.java | 0219f381adad00e20d6cac8877bd8e5b8ee260b2 | [] | no_license | Douglas5040/SisVenda | c54072812399e1c08eb9bf7ea221b003e638e835 | ad3ea5f3c481bb249ece6a546f0207969436093e | refs/heads/master | 2020-03-25T02:45:02.938484 | 2018-09-12T23:46:56 | 2018-09-12T23:46:56 | 143,305,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ctrl;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
/**
*
* @author Douglas
*/
public class FormatacaoConteudoCtrl extends DefaultTableCellRenderer implements TableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
return this;
}
}
| [
"douglas_doug5040@hotmail.com"
] | douglas_doug5040@hotmail.com |
b398dc943f9c35f2ce87a885e05510c04dc6c785 | 7c265b21297079bc0eae11ec37fa3ba289fed686 | /src/test/java/com/sqa/du/util/helper/InfoTest.java | 2a6d80b773fd20623501920f02c0f917c393327d | [] | no_license | Dancalif/calculator | 50d29739a7cbb6f0ef97c3397cc4a2caad2e8ff9 | 687a32c1983d8363b1eb37699baedff75aeb21a1 | refs/heads/master | 2021-01-10T17:58:35.336840 | 2016-02-12T05:19:28 | 2016-02-12T05:19:28 | 51,568,431 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,268 | java | /**
*
*/
package com.sqa.du.util.helper;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author dancalif
*
*/
public class InfoTest {
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
System.out.println("Runs Before the Class executes - @BeforeClass");
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
System.out.println("Runs After the Class executes - @AfterClass");
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
System.out.println("\tDo Setup for Test Method - @Before");
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
System.out.println("\tDo Tear Down for Test Method - @After");
}
/**
* Test method for
* {@link com.sqa.jf.util.helper.Info#display2DInfo(java.lang.Object[][])}.
*/
@Test
public void testDisplay2DInfo() {
System.out.println("\t\tTest for display2DInfo - @Test");
}
/**
* Test method for
* {@link com.sqa.jf.util.helper.Info#displayInfo(java.lang.Object)}.
*/
@Test
public void testDisplayInfoObject() {
System.out.println("\t\tTest for displayInfoObject - @Test");
}
/**
* Test method for
* {@link com.sqa.jf.util.helper.Info#displayInfo(java.lang.Object[])}.
*/
@Test
public void testDisplayInfoObjectArray() {
System.out.println("\t\tTest for displayInfoObjectArray - @Test");
}
/**
* Test method for
* {@link com.sqa.jf.util.helper.Info#displayInfo(java.lang.Object, java.lang.Object, java.lang.Object[])}
* .
*/
@Test
public void testDisplayInfoObjectObjectObjectArray() {
System.out.println("\t\tTest for displayInfoObjectObjectObjectArray - @Test");
}
/**
* Test method for
* {@link com.sqa.jf.util.helper.Info#get2DInfo(java.lang.Object[][])}.
*/
@Test
public void testGet2DInfo() {
System.out.println("\t\tTest for get2DInfo - @Test");
}
/**
* Test method for
* {@link com.sqa.jf.util.helper.Info#getInfo(java.lang.Object)}.
*/
@Test
public void testGetInfo() {
System.out.println("\t\tTest for getInfo - @Test");
}
} | [
"dancalif@gmail.com"
] | dancalif@gmail.com |
9cdba8c1f174f639358f5e35b70117f2c05c6e28 | d10833ad7d71b6a8196fa0304e07d84f54f38f9a | /app/src/test/java/com/example/okuyamatakahiro/a20190529_baseballdata/ExampleUnitTest.java | ddea0ddaa256eb3c1db9e7a3c627b6711f661fb3 | [] | no_license | yamao-latte/20190529_baseballdata | 5f117409bab77172c4c939dd4f13e234ceb4b320 | c5c82b7b1962118664ab149bb5eb512959225c3e | refs/heads/master | 2020-06-14T03:49:02.013910 | 2019-07-23T15:58:03 | 2019-07-23T15:58:03 | 194,886,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | package com.example.okuyamatakahiro.a20190529_baseballdata;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"jp.oku5704869@gmail.com"
] | jp.oku5704869@gmail.com |
7a6a6425d46145717843958d940e872eb16eae15 | 9dc24d443ebfaa00b7ade7d72fbfc72fd0aeace2 | /src/main/java/com/learn/springboot/ioc/condition/DataSourceConditional.java | fcfec018d9dce44ca6f48ac8f2bb34b5170c5321 | [] | no_license | wdzhlong/learn_springboot | 24ab9de44db9c49adea15e462b745f8bbf4d01e1 | 4ec3635528bee17b8ae8aec5c5121c9edba02ff8 | refs/heads/master | 2023-04-02T23:56:14.538223 | 2020-05-14T01:44:47 | 2020-05-14T01:45:04 | 209,701,452 | 0 | 1 | null | 2023-03-27T22:19:41 | 2019-09-20T03:56:06 | Java | UTF-8 | Java | false | false | 906 | java | package com.learn.springboot.ioc.condition;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;
/**
* @author: zhenghailong
* @date: 2019/9/20 22:05
* @modified By:
* @description:
*/
public class DataSourceConditional implements Condition {
@Override
public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
Environment environment = conditionContext.getEnvironment();
return environment.containsProperty("datasource.driverName") &&
environment.containsProperty("datasource.url") &&
environment.containsProperty("datasource.username") &&
environment.containsProperty("datasource.password");
}
}
| [
"xnzhenghailong@jd.com"
] | xnzhenghailong@jd.com |
656b2c3a63dbd7705bbd8a07e2a5e28ec6e8bb7f | 9b66e43eedeea3f2f490f165f196bcce7116cf68 | /app/src/main/java/cn/edu/gdmec/s07105733/intent/MainActivity.java | 16ce2dcd24fd3b08c3c6c89bb6539b928b5fef4e | [] | no_license | gdmen07150733/Intent | 36d69ffc8be0e63917489b6c884776aed61c755a | eea6331ce6680b89a4d72b5117bef4beedda871c | refs/heads/master | 2021-01-13T10:56:07.259027 | 2016-10-29T05:33:40 | 2016-10-29T05:33:40 | 72,266,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,197 | java | package cn.edu.gdmec.s07105733.intent;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private EditText et1, et2;
private TextView tv1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et1 = (EditText) findViewById(R.id.url);
et2 = (EditText) findViewById(R.id.phone);
tv1 = (TextView) findViewById(R.id.textview1);
}
public void componentname(View v) {
ComponentName componentName = new ComponentName(this, IntentDemo2.class);
Intent i1 = new Intent();
i1.setComponent(componentName);
startActivity(i1);
}
public void intentfilter(View v) {
String action="cn.edu.gdmec.kissme";
Intent i2=new Intent();
i2.setAction(action);
startActivity(i2);
}
public void view(View v) {
Intent i3 = new Intent();
i3.setAction(Intent.ACTION_VIEW);
Uri uri=Uri.parse(et1.getText().toString());
i3.setData(uri);
startActivity(i3);
}
public void dial(View v) {
Intent i3 = new Intent(Intent.ACTION_DIAL);
Uri uri=Uri.parse("tel:"+et2.getText().toString());
i3.setData(uri);
startActivity(i3);
}
public void startactivityforresult(View v) {
Bundle bundle=new Bundle();
bundle.putString("value",et1.getText().toString());
Intent intent=new Intent(MainActivity.this,IntentDemo2.class);
intent.putExtras(bundle);
startActivityForResult(intent,10);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode){
case 10:
Bundle bundle=data.getExtras();
tv1.setText(bundle.getString("result"));
}
super.onActivityResult(requestCode, resultCode, data);
}
}
| [
"413359404"
] | 413359404 |
1b8746a60b36b74629d125e010e841568befeedc | 13a4b831f636b716263141af1bcd5e8c0946d58a | /designmodel/src/adapter/Main.java | 49f1bd6c8e094c6909d033311860e2624af0877d | [] | no_license | wdl2200/designmodel | bf7921047a4b1151d1d93c399f6c6d1e5f7bce3e | 741ad22779a6c4e252c928b1660f03b6e247c88d | refs/heads/master | 2020-03-11T08:06:10.060473 | 2018-05-23T02:28:06 | 2018-05-23T02:28:06 | 129,859,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 141 | java | package adapter;
public class Main {
public static void main(String[] args) {
Target target = new Adaptor();
target.request();
}
}
| [
"30312335+wdl2200@users.noreply.github.com"
] | 30312335+wdl2200@users.noreply.github.com |
21f0153c0723783abad6ad88f73d79048b9c7131 | b9d092d695e3b6d4f6ba05cbd5b174ef385acd5a | /prep/Rock.java | 801f994c0a47c91c07d5d9321013c2669ee9c9a5 | [] | no_license | sylverpyro/cs1121-lab3 | 77153495718d2788555130aee97e40388fcf449b | 1438f696f9a053e200aad050f4cbbdc404b726c8 | refs/heads/master | 2021-01-10T03:10:57.440597 | 2016-02-28T20:33:06 | 2016-02-28T20:33:06 | 52,742,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | import java.awt.*;
public class Rock extends Animator{
public void draw(int clock, Graphics g) {
// the rocks
//rock 1
g.setColor(Color.black);
g.fillOval(50,(clock*4)%230-35,30,30);
//rock 2, 10 up and 80 to the right
g.setColor(Color.black);
g.fillOval(130,(clock*4-10)%230-35,30,30);
} // end of draw method
} // end of Rock class
| [
"sylverpyro@gmail.com"
] | sylverpyro@gmail.com |
735579cf60af8be44f4804e692c61ec89a6e3ead | e4f3b276f927a50a13ece2c32ec83008d69f283a | /Microwave.java | 7d979d286552684e7896a3cc3cc358e0ff7880b6 | [] | no_license | AlexDavisIII/TheFinalMicrowave | b43b9219f4edca4b53d071ed7de544299af3cf30 | 1168c4d9060ad9114a2ef93d1be5a386b4fb05c0 | refs/heads/master | 2016-09-01T14:48:52.700276 | 2015-11-30T17:39:14 | 2015-11-30T17:39:14 | 47,135,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29 | java |
public class Microwave {
}
| [
"alex.iii.davis@gmail.com"
] | alex.iii.davis@gmail.com |
bd75e3698ff0d0d8dbffc58d34af4b100ab5dd91 | a040f6f1b517750bb460c85a57020904dcbd8d8a | /src/me/thefbi/MyConfigManager.java | cb8d843c80c2d2857847ae5cb717cba61e6f3688 | [] | no_license | TheFBI/vXrayLogs | 33733ea6a6fb85257d747bad48f90b1943dfed44 | e2fe6fdc26a8e283f53a598be58dc662f28ee816 | refs/heads/master | 2020-12-25T18:19:54.307304 | 2015-04-04T07:56:45 | 2015-04-04T07:56:45 | 33,398,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,460 | java | package me.thefbi;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import org.bukkit.plugin.java.JavaPlugin;
public class MyConfigManager
{
private JavaPlugin plugin;
public MyConfigManager(JavaPlugin plugin)
{
this.plugin = plugin;
}
public MyConfig getNewConfig(String fileName, String[] header)
{
File file = this.getConfigFile(fileName);
if(!file.exists())
{
this.prepareFile(fileName);
if(header != null && header.length != 0)
this.setHeader(file, header);
}
MyConfig config = new MyConfig(this.getConfigContent(fileName), file, this.getCommentsNum(file), plugin);
return config;
}
public MyConfig getNewConfig(String fileName)
{
return this.getNewConfig(fileName, null);
}
private File getConfigFile(String file)
{
if(file.isEmpty() || file == null)
return null;
File configFile;
if(file.contains("/"))
{
if(file.startsWith("/"))
configFile = new File(plugin.getDataFolder() + file.replace("/", File.separator));
else configFile = new File(plugin.getDataFolder() + File.separator + file.replace("/", File.separator));
}
else configFile = new File(plugin.getDataFolder(), file);
return configFile;
}
public void prepareFile(String filePath, String resource)
{
File file = this.getConfigFile(filePath);
if(file.exists())
return;
try
{
file.getParentFile().mkdirs();
file.createNewFile();
if(resource != null)
if(!resource.isEmpty())
this.copyResource(plugin.getResource(resource), file);
}
catch (IOException e){e.printStackTrace();}
}
public void prepareFile(String filePath)
{
this.prepareFile(filePath, null);
}
public void setHeader(File file, String[] header)
{
if(!file.exists())
return;
try
{
String currentLine;
StringBuilder config = new StringBuilder("");
BufferedReader reader = new BufferedReader(new FileReader(file));
while((currentLine = reader.readLine()) != null)
config.append(currentLine + "\n");
reader.close();
config.append("# +----------------------------------------------------+ #\n");
for(String line : header)
{
if(line.length() > 50)
continue;
int lenght = (50 - line.length()) / 2;
StringBuilder finalLine = new StringBuilder(line);
for(int i = 0; i < lenght; i++)
{
finalLine.append(" ");
finalLine.reverse();
finalLine.append(" ");
finalLine.reverse();
}
if(line.length() % 2 != 0)
finalLine.append(" ");
config.append("# < " + finalLine.toString() + " > #\n");
}
config.append("# +----------------------------------------------------+ #");
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
writer.write(this.prepareConfigString(config.toString()));
writer.flush();
writer.close();
}
catch (IOException e){e.printStackTrace();}
}
public InputStream getConfigContent(File file)
{
if(!file.exists())
return null;
try
{
int commentNum = 0;
String addLine;
String currentLine;
String pluginName = this.getPluginName();
StringBuilder whole = new StringBuilder("");
BufferedReader reader = new BufferedReader(new FileReader(file));
while((currentLine = reader.readLine()) != null)
{
if(currentLine.startsWith("#"))
{
addLine = currentLine.replaceFirst("#", pluginName + "_COMMENT_" + commentNum + ":");
whole.append(addLine + "\n");
commentNum++;
}
else whole.append(currentLine + "\n");
}
String config = whole.toString();
InputStream configStream = new ByteArrayInputStream(config.getBytes(Charset.forName("UTF-8")));
reader.close();
return configStream;
}
catch (IOException e){e.printStackTrace();return null;}
}
private int getCommentsNum(File file)
{
if(!file.exists())
return 0;
try
{
int comments = 0;
String currentLine;
BufferedReader reader = new BufferedReader(new FileReader(file));
while((currentLine = reader.readLine()) != null)
if(currentLine.startsWith("#"))
comments++;
reader.close();
return comments;
}
catch (IOException e){e.printStackTrace();return 0;}
}
public InputStream getConfigContent(String filePath)
{
return this.getConfigContent(this.getConfigFile(filePath));
}
private String prepareConfigString(String configString)
{
int lastLine = 0;
int headerLine = 0;
String[] lines = configString.split("\n");
StringBuilder config = new StringBuilder("");
for(String line : lines)
{
if(line.startsWith(this.getPluginName() + "_COMMENT"))
{
String comment = "#" + line.trim().substring(line.indexOf(":") + 1);
if(comment.startsWith("# +-"))
{
if(headerLine == 0)
{
config.append(comment + "\n");
lastLine = 0;
headerLine = 1;
}
else if(headerLine == 1)
{
config.append(comment + "\n\n");
lastLine = 0;
headerLine = 0;
}
}
else
{
String normalComment;
if(comment.startsWith("# ' "))
normalComment = comment.substring(0, comment.length() - 1).replaceFirst("# ' ", "# ");
else normalComment = comment;
if(lastLine == 0)
config.append(normalComment + "\n");
else if(lastLine == 1)
config.append("\n" + normalComment + "\n");
lastLine = 0;
}
}
else
{
config.append(line + "\n");
lastLine = 1;
}
}
return config.toString();
}
public void saveConfig(String configString, File file)
{
String configuration = this.prepareConfigString(configString);
try
{
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
writer.write(configuration);
writer.flush();
writer.close();
}
catch (IOException e){e.printStackTrace();}
}
public String getPluginName()
{
return plugin.getDescription().getName();
}
private void copyResource(InputStream resource, File file)
{
try
{
OutputStream out = new FileOutputStream(file);
int length;
byte[] buf = new byte[1024];
while((length = resource.read(buf)) > 0)
out.write(buf, 0, length);
out.close();
resource.close();
}
catch (Exception e) {e.printStackTrace();}
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
8c71f1c084ade8cacc65c14b16013acc14be52e7 | e0b83daf42616e752906399582a59a4fd03cd60f | /irshad dir/kamal/demo_Android/Airline/SwitchButtonDemo/app/src/test/java/com/example/switchbuttondemo/ExampleUnitTest.java | 147b42193c4c211c2fba5c3d0fb76b958389b542 | [] | no_license | irshadkhan248/JavaPythonAndroidMysqlCode | f63b6d756bf6a64e9050980567e6a81c6081843a | 659da56425632b68d80c86ae6a8d9a2edeea364f | refs/heads/master | 2021-05-23T11:50:50.536914 | 2020-04-05T16:27:52 | 2020-04-05T16:27:52 | 253,271,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package com.example.switchbuttondemo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"irshad.khan@wohlig.in"
] | irshad.khan@wohlig.in |
ef619ddd97abe206f966199df5e5569374a661c6 | cd5e874936158c4c3fbc4c81302d43f55e44b679 | /ud851-Exercises-student/Lesson09b-ToDo-List-AAC/T09b.10-Exercise-AddViewModelToAddTaskActivity/app/src/main/java/com/example/android/todolist/AddTaskActivity.java | 6d5ceb973f7a02c3ea74f3bdc3fb4ba301284440 | [
"Apache-2.0"
] | permissive | QuangTrungFHFF/AndroidStudioExercises | 3cc7fcde32182ec06f8c3f147498ede9d8d3906a | 22cedd6937384cd678eb41816dfb1a15d689a47e | refs/heads/master | 2023-04-01T21:58:18.192739 | 2021-04-13T21:25:49 | 2021-04-13T21:25:49 | 337,791,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,348 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.todolist;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProvider;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import com.example.android.todolist.database.AppDatabase;
import com.example.android.todolist.database.TaskEntry;
import java.util.Date;
import java.util.List;
public class AddTaskActivity extends AppCompatActivity {
// Extra for the task ID to be received in the intent
public static final String EXTRA_TASK_ID = "extraTaskId";
// Extra for the task ID to be received after rotation
public static final String INSTANCE_TASK_ID = "instanceTaskId";
// Constants for priority
public static final int PRIORITY_HIGH = 1;
public static final int PRIORITY_MEDIUM = 2;
public static final int PRIORITY_LOW = 3;
// Constant for default task id to be used when not in update mode
private static final int DEFAULT_TASK_ID = -1;
// Constant for logging
private static final String TAG = AddTaskActivity.class.getSimpleName();
// Fields for views
EditText mEditText;
RadioGroup mRadioGroup;
Button mButton;
private int mTaskId = DEFAULT_TASK_ID;
// Member variable for the Database
private AppDatabase mDb;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_task);
initViews();
mDb = AppDatabase.getInstance(getApplicationContext());
if (savedInstanceState != null && savedInstanceState.containsKey(INSTANCE_TASK_ID)) {
mTaskId = savedInstanceState.getInt(INSTANCE_TASK_ID, DEFAULT_TASK_ID);
}
Intent intent = getIntent();
if (intent != null && intent.hasExtra(EXTRA_TASK_ID)) {
mButton.setText(R.string.update_button);
if (mTaskId == DEFAULT_TASK_ID) {
// populate the UI
mTaskId = intent.getIntExtra(EXTRA_TASK_ID, DEFAULT_TASK_ID);
// TODO (9) Remove the logging and the call to loadTaskById, this is done in the ViewModel now
AddTaskViewModelFactory factory = new AddTaskViewModelFactory(mDb,mTaskId);
final AddTaskViewModel viewModel = ViewModelProviders.of(this,factory).get(AddTaskViewModel.class);
// TODO (10) Declare a AddTaskViewModelFactory using mDb and mTaskId
// TODO (11) Declare a AddTaskViewModel variable and initialize it by calling ViewModelProviders.of
// for that use the factory created above AddTaskViewModel
// TODO (12) Observe the LiveData object in the ViewModel. Use it also when removing the observer
final LiveData<TaskEntry> task = viewModel.getTask();
viewModel.getTask().observe(this, new Observer<TaskEntry>() {
@Override
public void onChanged(@Nullable TaskEntry taskEntry) {
task.removeObserver(this);
Log.d(TAG, "Receiving database update from LiveData");
populateUI(taskEntry);
}
});
}
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
outState.putInt(INSTANCE_TASK_ID, mTaskId);
super.onSaveInstanceState(outState);
}
/**
* initViews is called from onCreate to init the member variable views
*/
private void initViews() {
mEditText = findViewById(R.id.editTextTaskDescription);
mRadioGroup = findViewById(R.id.radioGroup);
mButton = findViewById(R.id.saveButton);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onSaveButtonClicked();
}
});
}
/**
* populateUI would be called to populate the UI when in update mode
*
* @param task the taskEntry to populate the UI
*/
private void populateUI(TaskEntry task) {
if (task == null) {
return;
}
mEditText.setText(task.getDescription());
setPriorityInViews(task.getPriority());
}
/**
* onSaveButtonClicked is called when the "save" button is clicked.
* It retrieves user input and inserts that new task data into the underlying database.
*/
public void onSaveButtonClicked() {
String description = mEditText.getText().toString();
int priority = getPriorityFromViews();
Date date = new Date();
final TaskEntry task = new TaskEntry(description, priority, date);
AppExecutors.getInstance().diskIO().execute(new Runnable() {
@Override
public void run() {
if (mTaskId == DEFAULT_TASK_ID) {
// insert new task
mDb.taskDao().insertTask(task);
} else {
//update task
task.setId(mTaskId);
mDb.taskDao().updateTask(task);
}
finish();
}
});
}
/**
* getPriority is called whenever the selected priority needs to be retrieved
*/
public int getPriorityFromViews() {
int priority = 1;
int checkedId = ((RadioGroup) findViewById(R.id.radioGroup)).getCheckedRadioButtonId();
switch (checkedId) {
case R.id.radButton1:
priority = PRIORITY_HIGH;
break;
case R.id.radButton2:
priority = PRIORITY_MEDIUM;
break;
case R.id.radButton3:
priority = PRIORITY_LOW;
}
return priority;
}
/**
* setPriority is called when we receive a task from MainActivity
*
* @param priority the priority value
*/
public void setPriorityInViews(int priority) {
switch (priority) {
case PRIORITY_HIGH:
((RadioGroup) findViewById(R.id.radioGroup)).check(R.id.radButton1);
break;
case PRIORITY_MEDIUM:
((RadioGroup) findViewById(R.id.radioGroup)).check(R.id.radButton2);
break;
case PRIORITY_LOW:
((RadioGroup) findViewById(R.id.radioGroup)).check(R.id.radButton3);
}
}
}
| [
"tranquangtrung.vgu@gmail.com"
] | tranquangtrung.vgu@gmail.com |
99a6a299d55929a8c5d4bc2d87dd19196e45cfed | ae481ac20d37923bba9e51c9b5b0854a7fd229e1 | /src/main/java/com/example/lunit/model/UserAccount.java | 65e56f4e90ee68d29014d085deef558d79c64f52 | [] | no_license | 2yeseul/spring-jwt-study | 972c03cb909b4a47da5d3c5ef14e997e678811a5 | 2882bfea29b36263bb9a427de76f3295fb711cb5 | refs/heads/master | 2023-05-03T03:39:09.828138 | 2021-05-13T18:05:13 | 2021-05-13T18:05:13 | 367,058,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | package com.example.lunit.model;
import com.example.lunit.model.Account;
import lombok.Getter;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import java.util.List;
@Getter
public class UserAccount extends User {
private Account account;
public UserAccount(Account account) {
super(account.getEmail(), account.getPassword(), List.of(new SimpleGrantedAuthority("ROLE_USER")));
this.account = account;
}
}
| [
"20152917@sungshin.ac.kr"
] | 20152917@sungshin.ac.kr |
292c3c1869a4fb81a839a8ea33994822b6131b32 | f538b56104c45e04f70ef3473a971d4a67e1b089 | /java/nebula/org.netxms.nebula.widgets.gallery.tests/src/org/netxms/nebula/widgets/gallery/tests/Bug212182Test.java | 7f4a34ed64deb2ff8abbe6a42261d17158ecf7f6 | [] | no_license | phongtran0715/SpiderClient | 85d5d0559c6af0393cd058c25584074d80f8df9a | fdc264a85b7ff52c5dc2b6bb3cc83da62aad2aff | refs/heads/master | 2020-03-20T20:07:12.075655 | 2018-08-10T08:37:10 | 2018-08-10T08:37:10 | 137,671,006 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,837 | java | package org.netxms.nebula.widgets.gallery.tests;
import junit.framework.TestCase;
import org.netxms.nebula.widgets.gallery.DefaultGalleryGroupRenderer;
import org.netxms.nebula.widgets.gallery.DefaultGalleryItemRenderer;
import org.netxms.nebula.widgets.gallery.Gallery;
import org.netxms.nebula.widgets.gallery.GalleryItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Bug212182Test extends TestCase {
private Shell s = null;
private Display d = null;
private boolean createdDisplay = false;
protected void setUp() throws Exception {
d = Display.getCurrent();
if (d == null) {
d = new Display();
createdDisplay = true;
}
s = new Shell(d, SWT.NONE);
super.setUp();
}
protected void tearDown() throws Exception {
if (createdDisplay) {
d.dispose();
}
super.tearDown();
}
public void testBug212182OnGallery() {
Gallery g = new Gallery(s, SWT.V_SCROLL);
// Set Renderers
DefaultGalleryGroupRenderer gr = new DefaultGalleryGroupRenderer();
g.setGroupRenderer(gr);
DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();
g.setItemRenderer(ir);
// Check for NPE or Null
GalleryItem[] items = g.getItems();
assertNotNull(items);
assertEquals(0, items.length);
g.dispose();
}
public void testBug212182OnGalleryItem() {
Gallery g = new Gallery(s, SWT.V_SCROLL);
// Set Renderers
DefaultGalleryGroupRenderer gr = new DefaultGalleryGroupRenderer();
g.setGroupRenderer(gr);
DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();
g.setItemRenderer(ir);
// Create an item
GalleryItem item = new GalleryItem(g, SWT.None);
// Check for NPE or null
GalleryItem[] items = item.getItems();
assertNotNull(items);
assertEquals(0, items.length);
g.dispose();
}
}
| [
"phongtran0715@gmail.com"
] | phongtran0715@gmail.com |
69ed14d0e717b724b46addea578a020f003fd834 | fa51687f6aa32d57a9f5f4efc6dcfda2806f244d | /jdk8-src/src/main/java/javax/swing/plaf/multi/MultiDesktopPaneUI.java | 3adc2b950e6a959d4c399c92e416238f98726b92 | [] | no_license | yida-lxw/jdk8 | 44bad6ccd2d81099bea11433c8f2a0fc2e589eaa | 9f69e5f33eb5ab32e385301b210db1e49e919aac | refs/heads/master | 2022-12-29T23:56:32.001512 | 2020-04-27T04:14:10 | 2020-04-27T04:14:10 | 258,988,898 | 0 | 1 | null | 2020-10-13T21:32:05 | 2020-04-26T09:21:22 | Java | UTF-8 | Java | false | false | 6,389 | java | /*
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.swing.plaf.multi;
import javax.accessibility.Accessible;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.DesktopPaneUI;
import java.awt.*;
import java.util.Vector;
/**
* A multiplexing UI used to combine <code>DesktopPaneUI</code>s.
*
* <p>This file was automatically generated by AutoMulti.
*
* @author Otto Multey
*/
public class MultiDesktopPaneUI extends DesktopPaneUI {
/**
* The vector containing the real UIs. This is populated
* in the call to <code>createUI</code>, and can be obtained by calling
* the <code>getUIs</code> method. The first element is guaranteed to be the real UI
* obtained from the default look and feel.
*/
protected Vector uis = new Vector();
////////////////////
// Common UI methods
////////////////////
/**
* Returns the list of UIs associated with this multiplexing UI. This
* allows processing of the UIs by an application aware of multiplexing
* UIs on components.
*/
public ComponentUI[] getUIs() {
return MultiLookAndFeel.uisToArray(uis);
}
////////////////////
// DesktopPaneUI methods
////////////////////
////////////////////
// ComponentUI methods
////////////////////
/**
* Invokes the <code>contains</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public boolean contains(JComponent a, int b, int c) {
boolean returnValue =
((ComponentUI) (uis.elementAt(0))).contains(a, b, c);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).contains(a, b, c);
}
return returnValue;
}
/**
* Invokes the <code>update</code> method on each UI handled by this object.
*/
public void update(Graphics a, JComponent b) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).update(a, b);
}
}
/**
* Returns a multiplexing UI instance if any of the auxiliary
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
* UI object obtained from the default <code>LookAndFeel</code>.
*/
public static ComponentUI createUI(JComponent a) {
ComponentUI mui = new MultiDesktopPaneUI();
return MultiLookAndFeel.createUIs(mui,
((MultiDesktopPaneUI) mui).uis,
a);
}
/**
* Invokes the <code>installUI</code> method on each UI handled by this object.
*/
public void installUI(JComponent a) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).installUI(a);
}
}
/**
* Invokes the <code>uninstallUI</code> method on each UI handled by this object.
*/
public void uninstallUI(JComponent a) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
}
}
/**
* Invokes the <code>paint</code> method on each UI handled by this object.
*/
public void paint(Graphics a, JComponent b) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).paint(a, b);
}
}
/**
* Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Dimension getPreferredSize(JComponent a) {
Dimension returnValue =
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
}
return returnValue;
}
/**
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Dimension getMinimumSize(JComponent a) {
Dimension returnValue =
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
}
return returnValue;
}
/**
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Dimension getMaximumSize(JComponent a) {
Dimension returnValue =
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
}
return returnValue;
}
/**
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public int getAccessibleChildrenCount(JComponent a) {
int returnValue =
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
}
return returnValue;
}
/**
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Accessible getAccessibleChild(JComponent a, int b) {
Accessible returnValue =
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a, b);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a, b);
}
return returnValue;
}
}
| [
"yida@caibeike.com"
] | yida@caibeike.com |
1dd83e61b868ecf4cc81f6769dc61823cabd623c | 474bf4cff5813b1afb1233c6b2cbae1b6de6959d | /crawler/src/main/java/datapublic/OpenDataset.java | 669946f776db37b0af454f123ec205e16081472b | [] | no_license | crabs-hue/game-of-code-2018 | 97ed9eefcdba1323e6a92c4544027ad660fa3ec4 | 573b3fe1a8088e5750f6eefc96e2c062702acd30 | refs/heads/master | 2021-04-06T14:53:34.420761 | 2018-03-26T20:08:26 | 2018-03-26T20:08:26 | 124,681,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package datapublic;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class OpenDataset {
@Override
public String toString() {
return "OpenDataset [title=" + title + ", sources=" + sources + ", eurovoc=" + eurovoc + ", description="
+ description + ", author=" + author + ", keywords=" + keywords + "]";
}
public String title;
public List<Source> sources = new ArrayList<>();
public Set<String> eurovoc = new HashSet<>();
public String description;
public String author;
public List<String> keywords = new ArrayList<>();
public URL origin;
}
| [
"gerald.even@gmail.com"
] | gerald.even@gmail.com |
262d3c84481eb145f13454081b4322c16f6029b0 | 14822fc611c3b155249e5994f0f0166905debf34 | /src/java/co/matisses/bcs/rest/EmailPatternValidatorREST.java | 9713f14e8afbbd79cdcd3f92c82ec066254ad9f7 | [
"MIT"
] | permissive | matisses/BCS | ea0008c6a9abb8c922de4901e4070128c512b022 | 93e4cf4e37cb0a567f5e9575f25b9d19eb5c8016 | refs/heads/master | 2021-01-25T09:04:08.366035 | 2018-05-09T15:31:47 | 2018-05-09T15:31:47 | 93,775,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,563 | java | package co.matisses.bcs.rest;
import co.matisses.bcs.dto.ResponseDTO;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
/**
*
* @author jguisao
*/
@Stateless
@Path("emailvalidator")
public class EmailPatternValidatorREST {
private static final Logger CONSOLE = Logger.getLogger(ListaRegalosREST.class.getSimpleName());
@GET
@Path("validarformatoemail/{email}")
@Produces({MediaType.APPLICATION_JSON + ";charset=utf-8"})
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public Response validarFormatoEmail(@PathParam("email") String email) {
Pattern ptr = Pattern.compile(EmailPatternValidator.getInstance().getEmailPattern());
if (email == null || email.trim().isEmpty()) {
CONSOLE.log(Level.SEVERE, "Debes ingresar un email");
return Response.ok(new ResponseDTO(-1, "Debes ingresar un email.")).build();
} else if (!ptr.matcher(email).matches()) {
CONSOLE.log(Level.SEVERE, "El formato del email es incorrecto");
return Response.ok(new ResponseDTO(-1, "El formato del email es incorrecto.")).build();
}
return Response.ok(new ResponseDTO(0, "El formato del email es correcto.")).build();
}
} | [
"ygil@matisses.co"
] | ygil@matisses.co |
40449ec3a0e5446ed432c5adf0ba8234e92411d7 | 38c4451ab626dcdc101a11b18e248d33fd8a52e0 | /identifiers/batik-1.7/sources/org/apache/batik/css/engine/value/StringMap.java | e42c1c12057ac13698f848de19a5c402ef65d434 | [] | no_license | habeascorpus/habeascorpus-data | 47da7c08d0f357938c502bae030d5fb8f44f5e01 | 536d55729f3110aee058ad009bcba3e063b39450 | refs/heads/master | 2020-06-04T10:17:20.102451 | 2013-02-19T15:19:21 | 2013-02-19T15:19:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,415 | java | org PACKAGE_IDENTIFIER false
apache PACKAGE_IDENTIFIER false
batik PACKAGE_IDENTIFIER false
css PACKAGE_IDENTIFIER false
engine PACKAGE_IDENTIFIER false
value PACKAGE_IDENTIFIER false
StringMap TYPE_IDENTIFIER true
INITIAL_CAPACITY VARIABLE_IDENTIFIER true
Entry TYPE_IDENTIFIER false
table VARIABLE_IDENTIFIER true
count VARIABLE_IDENTIFIER true
StringMap METHOD_IDENTIFIER false
table VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
INITIAL_CAPACITY VARIABLE_IDENTIFIER false
StringMap METHOD_IDENTIFIER false
StringMap TYPE_IDENTIFIER false
t VARIABLE_IDENTIFIER true
count VARIABLE_IDENTIFIER false
t VARIABLE_IDENTIFIER false
count VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
t VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER true
i VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER true
t VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
n VARIABLE_IDENTIFIER true
e VARIABLE_IDENTIFIER false
n VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
n VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
n VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
n VARIABLE_IDENTIFIER false
n VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
Object TYPE_IDENTIFIER false
get METHOD_IDENTIFIER true
String TYPE_IDENTIFIER false
key VARIABLE_IDENTIFIER true
hash VARIABLE_IDENTIFIER true
key VARIABLE_IDENTIFIER false
hashCode METHOD_IDENTIFIER false
index VARIABLE_IDENTIFIER true
hash VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER true
table VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
Object TYPE_IDENTIFIER false
put METHOD_IDENTIFIER true
String TYPE_IDENTIFIER false
key VARIABLE_IDENTIFIER true
Object TYPE_IDENTIFIER false
value VARIABLE_IDENTIFIER true
hash VARIABLE_IDENTIFIER true
key VARIABLE_IDENTIFIER false
hashCode METHOD_IDENTIFIER false
index VARIABLE_IDENTIFIER true
hash VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER true
table VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
Object TYPE_IDENTIFIER false
old VARIABLE_IDENTIFIER true
e VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
old VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER true
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
count VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER false
rehash METHOD_IDENTIFIER false
index VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER true
Entry TYPE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
rehash METHOD_IDENTIFIER true
Entry TYPE_IDENTIFIER false
oldTable VARIABLE_IDENTIFIER true
table VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
oldTable VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER true
oldTable VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
old VARIABLE_IDENTIFIER true
oldTable VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
old VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER true
old VARIABLE_IDENTIFIER false
old VARIABLE_IDENTIFIER false
old VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER true
e VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER false
table VARIABLE_IDENTIFIER false
index VARIABLE_IDENTIFIER false
e VARIABLE_IDENTIFIER false
Entry TYPE_IDENTIFIER true
hash VARIABLE_IDENTIFIER true
String TYPE_IDENTIFIER false
key VARIABLE_IDENTIFIER true
Object TYPE_IDENTIFIER false
value VARIABLE_IDENTIFIER true
Entry TYPE_IDENTIFIER false
next VARIABLE_IDENTIFIER true
Entry METHOD_IDENTIFIER false
hash VARIABLE_IDENTIFIER true
String TYPE_IDENTIFIER false
key VARIABLE_IDENTIFIER true
Object TYPE_IDENTIFIER false
value VARIABLE_IDENTIFIER true
Entry TYPE_IDENTIFIER false
next VARIABLE_IDENTIFIER true
hash VARIABLE_IDENTIFIER false
hash VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
key VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
value VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
next VARIABLE_IDENTIFIER false
| [
"pschulam@gmail.com"
] | pschulam@gmail.com |
8fe2b920ad47412c0cfec0374625f66acb5fd8e5 | ad70d52463f49f342d06fe785d47a669805c4a5a | /DanmakuFlameMaster/src/main/java/tv/cjump/jni/NativeBitmapFactory.java | 5c1d5470fb10b400e9d258b34189bc6bdbc0f9ef | [
"Apache-2.0"
] | permissive | wangyuetingtao/DanmakuFlameMaster | a213afe6681b9a4bd28ef68b1988dcc2669442be | 1766669852e03eb26117f45f7f7f5749bf4bc689 | refs/heads/master | 2021-01-18T00:55:40.523543 | 2014-09-13T11:58:19 | 2014-09-13T11:59:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,787 | java |
package tv.cjump.jni;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;
import java.lang.reflect.Field;
public class NativeBitmapFactory {
static Field nativeIntField = null;
static boolean nativeLibLoaded = false;
public static void loadLibs() {
if (CpuInfo.isARMSimulatedByX86() || CpuInfo.supportX86() || CpuInfo.supportMips()) {
nativeLibLoaded = false;
return;
}
if (nativeLibLoaded) {
return;
}
try {
if (android.os.Build.VERSION.SDK_INT >= 19) {
System.loadLibrary("ndkbitmap.19");
nativeLibLoaded = true;
} else if (android.os.Build.VERSION.SDK_INT >= 11) {
System.loadLibrary("ndkbitmap.18");
nativeLibLoaded = true;
} else {
nativeLibLoaded = false;
}
} catch (Exception e) {
e.printStackTrace();
nativeLibLoaded = false;
} catch (Error e) {
e.printStackTrace();
nativeLibLoaded = false;
}
if (nativeLibLoaded) {
boolean libInit = init();
if (!libInit) {
release();
nativeLibLoaded = false;
} else {
initField();
boolean confirm = testLib();
if (!confirm) {
// 测试so文件函数是否调用失败
release();
nativeLibLoaded = false;
}
}
}
Log.e("NativeBitmapFactory", "loaded" + nativeLibLoaded);
}
public static void releaseLibs() {
if (nativeLibLoaded) {
release();
}
nativeIntField = null;
nativeLibLoaded = false;
// Log.e("NativeBitmapFactory", "released");
}
static void initField() {
try {
nativeIntField = Bitmap.Config.class.getDeclaredField("nativeInt");
nativeIntField.setAccessible(true);
} catch (NoSuchFieldException e) {
nativeIntField = null;
e.printStackTrace();
}
}
@SuppressLint("NewApi")
private static boolean testLib() {
if (nativeIntField == null) {
return false;
}
Bitmap bitmap = null;
Canvas canvas = null;
try {
bitmap = createNativeBitmap(2, 2, Bitmap.Config.ARGB_8888, true);
boolean result = (bitmap != null && bitmap.getWidth() == 2 && bitmap.getHeight() == 2);
if (result) {
if (android.os.Build.VERSION.SDK_INT >= 17 && !bitmap.isPremultiplied()) {
bitmap.setPremultiplied(true);
}
canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setTextSize(20f);
canvas.drawRect(0f, 0f, (float) bitmap.getWidth(), (float) bitmap.getHeight(),
paint);
canvas.drawText("TestLib", 0, 0, paint);
if (result && android.os.Build.VERSION.SDK_INT >= 17) {
result = bitmap.isPremultiplied();
}
}
return result;
} catch (Exception e) {
Log.e("NativeBitmapFactory", "exception:" + e.toString());
return false;
} catch (Error e) {
return false;
} finally {
if (bitmap != null) {
bitmap.recycle();
bitmap = null;
}
}
}
public static int getNativeConfig(Bitmap.Config config) {
try {
if (nativeIntField == null) {
return 0;
}
int nativeInt = nativeIntField.getInt(config);
return nativeInt;
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return 0;
}
public static Bitmap createBitmap(int width, int height, Bitmap.Config config) {
return createBitmap(width, height, config, config.equals(Bitmap.Config.ARGB_8888));
}
public static void recycle(Bitmap bitmap) {
bitmap.recycle();
}
public static Bitmap createBitmap(int width, int height, Bitmap.Config config, boolean hasAlpha) {
if (nativeLibLoaded == false || nativeIntField == null) {
// Log.e("NativeBitmapFactory", "ndk bitmap create failed");
return Bitmap.createBitmap(width, height, config);
}
return createNativeBitmap(width, height, config, hasAlpha);
}
private static Bitmap createNativeBitmap(int width, int height, Config config, boolean hasAlpha) {
int nativeConfig = getNativeConfig(config);
// Log.e("NativeBitmapFactory", "nativeConfig:" + nativeConfig);
Bitmap bitmap = android.os.Build.VERSION.SDK_INT == 19 ? createBitmap19(width, height,
nativeConfig, hasAlpha) : createBitmap(width, height, nativeConfig, hasAlpha);
// Log.e("NativeBitmapFactory", "create bitmap:" + bitmap);
return bitmap;
}
// ///////////native methods//////////
private static native boolean init();
private static native boolean release();
private static native Bitmap createBitmap(int width, int height, int nativeConfig,
boolean hasAlpha);
private static native Bitmap createBitmap19(int width, int height, int nativeConfig,
boolean hasAlpha);
}
| [
"calmer91@gmail.com"
] | calmer91@gmail.com |
9db9399a48079624d156d9a2edbfa90ba590074e | ec8782f4241ad6de0bd92280bc53e624755b7523 | /AD/ejercicioDOM-SAX-JAXB/src/main/java/XMLManagement/DOM.java | 08b7862e10c66733b2f79b2b773a3a66b5a52811 | [] | no_license | Kahzerx/ejercicios | d91b5e3082e9d0c89e9918a7a74632a7d640271b | 2098e83d9658a42c606efc67ee37908c1f414efd | refs/heads/master | 2023-05-04T05:56:29.175130 | 2021-05-29T22:58:40 | 2021-05-29T22:58:40 | 299,743,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,938 | java | package XMLManagement;
import fileManagement.FileManagement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import utils.Reset;
import utils.Update;
import javax.swing.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
public class DOM {
private static Document doc;
// Se ejecuta al clickar el botón de abrir.
public static void onOpenDOM() {
doc = null;
File f = FileManagement.chooseXMLFile();
if (f == null) {
Reset.noFile();
return;
}
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
factory.setIgnoringElementContentWhitespace(true);
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.parse(f); // Parsear el archivo.
updateWindow();
} catch (ParserConfigurationException | IOException | SAXException e) {
e.printStackTrace();
}
}
// Se ejecuta al clickar el botón de añadir.
public static void onAdd(String published, String title, String author, String editorial) {
if (doc != null) {
if (!title.equals("") && !published.equals("") && !author.equals("") && !editorial.equals("")) {
if (isInt(published)) {
tryAppend(published, title, author, editorial);
} else
JOptionPane.showMessageDialog(null, "La fecha de publicación tiene que ser un número", "ERROR", JOptionPane.ERROR_MESSAGE);
} else
JOptionPane.showMessageDialog(null, "Completa todos los fields antes de añadir", "Incompleto", JOptionPane.ERROR_MESSAGE);
} else JOptionPane.showMessageDialog(null, "Debes abrir un archivo antes", "ERROR", JOptionPane.ERROR_MESSAGE);
}
// Se ejecuta al clickar el botón de editar un título.
public static void onTitleUpdate(String selectedItem, String text) {
if (doc != null) {
if (!selectedItem.equals("") && !text.equals("")) {
tryUpdate(selectedItem, text);
} else
JOptionPane.showMessageDialog(null, "Completa todos los campos antes de continuar", "Incompleto", JOptionPane.ERROR_MESSAGE);
} else JOptionPane.showMessageDialog(null, "Debes abrir un archivo antes", "ERROR", JOptionPane.ERROR_MESSAGE);
}
// Intentar actualizar el título.
private static void tryUpdate(String item, String text) {
Node root = doc.getDocumentElement();
Node temp;
NodeList nodeList = root.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
NodeList subNodes = nodeList.item(i).getChildNodes();
for (int j = 0; j < subNodes.getLength(); j++) {
temp = subNodes.item(j);
if (temp.getNodeType() == Node.ELEMENT_NODE) {
if (temp.getNodeName().equals("Titulo") && temp.getFirstChild().getNodeValue().equals(item)) {
temp.setTextContent(text);
}
}
}
}
updateWindow();
}
// Intentar añadir el nuevo libro.
private static void tryAppend(String published, String title, String author, String editorial) {
Element root = doc.getDocumentElement();
Element newBook = doc.createElement("Libro");
newBook.setAttribute("publicado_en", published);
Element newTitle = doc.createElement("Titulo");
newTitle.appendChild(doc.createTextNode(title));
newBook.appendChild(newTitle);
Element newAuthor = doc.createElement("Autor");
newAuthor.appendChild(doc.createTextNode(author));
newBook.appendChild(newAuthor);
Element newEditorial = doc.createElement("Editorial");
newEditorial.appendChild(doc.createTextNode(editorial));
newBook.appendChild(newEditorial);
root.appendChild(newBook);
updateWindow();
}
// Sacar el contenido del doc para el text area.
private static ArrayList<String[]> getContent(Document doc) {
Node node;
String[] data;
Node root = doc.getFirstChild();
NodeList nodeList = root.getChildNodes();
ArrayList<String[]> values = new ArrayList<>();
for (int i = 0; i < nodeList.getLength(); i++) {
node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
data = process(node);
values.add(data);
}
}
return values;
}
// Procesar libro a libro en array para el text area.
private static String[] process(Node node) {
String[] data = new String[4];
Node temp;
int acc = 1;
data[0] = node.getAttributes().item(0).getNodeValue();
NodeList list = node.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
temp = list.item(i);
if (temp.getNodeType() == Node.ELEMENT_NODE) {
data[acc] = temp.getFirstChild().getNodeValue();
acc++;
}
}
return data;
}
// Guardar el doc actual en un archivo que se puede seleccionar.
public static void writeAndClose() {
if (doc != null) {
try {
File newFile = FileManagement.createAndSave();
if (newFile != null) {
DOMSource src = new DOMSource(doc);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
StreamResult result = new StreamResult(newFile.getAbsolutePath());
transformer.transform(src, result);
}
else JOptionPane.showMessageDialog(null, "No ha sido posible guardar el archivo", "ERROR", JOptionPane.ERROR_MESSAGE);
}
catch (TransformerException e) {
JOptionPane.showMessageDialog(null, "No ha sido posible guardar el archivo", "ERROR", JOptionPane.ERROR_MESSAGE);
}
}
else JOptionPane.showMessageDialog(null, "Debes abrir un archivo antes", "ERROR", JOptionPane.ERROR_MESSAGE);
}
private static boolean isInt(String s) {
try {
Integer.parseInt(s);
return true;
}
catch (NumberFormatException ex) {
return false;
}
}
// Chequeo y envio de la query a XPath.
public static void processQuery(String query) {
if (!query.equals("")) {
if (doc != null) {
XPATH.processQuery(doc, query);
}
else JOptionPane.showMessageDialog(null, "Debes abrir un archivo antes", "ERROR", JOptionPane.ERROR_MESSAGE); // Won't happen but who knows ¯\_(ツ)_/¯.
}
else JOptionPane.showMessageDialog(null, "La consulta no puede estar vacia", "Error", JOptionPane.ERROR_MESSAGE);
}
// Actualizar el text area, los fields y comboBox.
private static void updateWindow() {
Update.updateMainTextArea(getContent(doc), "DOM");
}
}
| [
"kahzer123@gmail.com"
] | kahzer123@gmail.com |
66c1b259bc3dd34e5ce2bf580ba7baaae6327947 | 531a9d4eb01ea4e8497172cacad17499e949fa0a | /src/main/java/BoxOffice/View/PostPurchaseRoute.java | 80381a631c213bd24f732b321bdf459f56aeca7a | [] | no_license | dec1701/Box-Office | 5d1724568e97d73b67923e24b61f7643384f866f | b7706f0869b2f6b0da8df1a1d0c51665126d0e0d | refs/heads/master | 2022-12-27T19:40:38.956722 | 2020-05-18T18:58:37 | 2020-05-18T18:58:37 | 263,959,143 | 0 | 0 | null | 2020-10-13T21:59:32 | 2020-05-14T15:53:35 | Java | UTF-8 | Java | false | false | 1,616 | java | package BoxOffice.View;
import BoxOffice.Controller.Sales;
import spark.*;
/**
* This route is taken when the user has to give information about their
* purchase (what screen, how mnay tickets). Its purpose is to collect
* the information from the user and store it in the session so it can
* be used in other routes.
*/
public class PostPurchaseRoute implements Route {
// Controller class - responsible for managing information btwn Model and View
private Sales sales;
/**
* Constructor - creates a new instance of PostPurchaseRoute
* @param sales - the Controller class for communicating w/ the model
*/
public PostPurchaseRoute(Sales sales){
this.sales = sales;
}
/**
* Performs this route's operations:
* Update the screen's sales & available tickets
* @param request - a Spark request, contains the user's session
* as well as any query parameters
* @param response - a Spark response
* @return the result of the Template Engine's render
*/
@Override
public Object handle(Request request, Response response){
// getting the amount of tickets being purchased & for what screen
int numTix = Integer.parseInt(request.queryParams("numTix"));
int screenNum = Integer.parseInt(request.queryParams("screenNum"));
// tell the Controller that the Model needs to update
int success = sales.makePurchase(screenNum, numTix);
// put the return value in the user's session so other routes can
// access it
Session httpSession = request.session();
httpSession.attribute("success", success);
response.redirect("/purchase");
return null;
}
}
| [
"dec1701@rit.edu"
] | dec1701@rit.edu |
e5ce41fcb47fca1e28e7d0347e5a3f8bcba587bd | 593c8fcbf2d843a5a6688c442fb8dbfd085f8fab | /app/models/Reading.java | ff083d8108f179cc5a304affcd500ba7dd2d97e7 | [] | no_license | Toma5OD/weatherTop | 7c675890255c8fc91ee2ac58a22458d9bcfeee79 | bcb9ab72a7ce5819c29d810a964c6649ff14ff78 | refs/heads/master | 2023-05-05T19:55:46.254748 | 2021-05-23T19:43:17 | 2021-05-23T19:43:17 | 369,271,537 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package models;
import javax.persistence.Entity;
import play.db.jpa.Model;
import java.util.Date;
@Entity
public class Reading extends Model {
public Date date;
public int code;
public double temperature;
public double windSpeed;
public int windDirection;
public int pressure;
public double fahrenheit;
public double celsius;
public double windChill;
public Reading(Date date, int code, double temperature, double windSpeed, int windDirection, int pressure, double fahrenheit, double celsius, double windChill) {
this.date = date;
this.code = code;
this.temperature = temperature;
this.windSpeed = windSpeed;
this.windDirection = windDirection;
this.pressure = pressure;
this.fahrenheit = fahrenheit;
this.celsius = celsius;
this.windChill = windChill;
}
}
| [
"tom1996.18@gmail.com"
] | tom1996.18@gmail.com |
cf5b412278101e3f5b06a21a3e70722f82aeda32 | 0a6e29afc4442f4e0d3f7327b0f2c0832aeb2e5b | /PushbotAutoDriveByTime_LinearRed.java | 5cc103e361abad34d530f6818857ebec20ec1b29 | [] | no_license | Gillgamesh/upgraded-memory | 58abfdc290fb226302336293da972bc40942cfac | 5770a6d0f203fa70e4d05c1d6fd6ea8d49a625c6 | refs/heads/master | 2020-05-26T19:52:44.205219 | 2017-02-19T02:01:31 | 2017-02-19T02:01:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,493 | java | /*
Copyright (c) 2016 Robert Atkinson
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted (subject to the limitations in the disclaimer below) provided that
the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of Robert Atkinson nor the names of his contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS
LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESSFOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.util.ElapsedTime;
/**
* This file illustrates the concept of driving a path based on time.
* It uses the common Pushbot hardware class to define the drive on the robot.
* The code is structured as a LinearOpMode
*
* The code assumes that you do NOT have encoders on the wheels,
* otherwise you would use: PushbotAutoDriveByEncoder;
*
* The desired path in this example is:
* - Drive forward for 3 seconds
* - Spin right for 1.3 seconds
* - Drive Backwards for 1 Second
* - Stop and close the claw.
*
* The code is written in a simple form with no optimizations.
* However, there are several ways that this type of sequence could be streamlined,
*
* Use Android Studios to Copy this Class, and Paste it into your team's code folder with a new name.
* Remove or comment out the @Disabled line to add this opmode to the Driver Station OpMode list
*/
@Autonomous(name="Pushbot: Drive up Ramp RED", group="Pushbot")
public class PushbotAutoDriveByTime_LinearRed extends LinearOpMode {
/* Declare OpMode members. */
private ElapsedTime runtime = new ElapsedTime();
static final double FORWARD_SPEED = 0.6;
static final double TURN_SPEED = 0.5;
@Override
public void runOpMode() {
/*
* Initialize the drive system variables.
* The init() method of the hardware class does all the work here
*/
DcMotor leftFront = hardwareMap.dcMotor.get("leftFront");
DcMotor leftBack = hardwareMap.dcMotor.get("leftBack");
DcMotor rightFront = hardwareMap.dcMotor.get("rightFront");
DcMotor rightBack = hardwareMap.dcMotor.get("rightBack");
leftFront.setDirection(DcMotor.Direction.FORWARD); // Set to REVERSE if using AndyMark motors
leftBack.setDirection(DcMotor.Direction.FORWARD);
rightFront.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors
rightBack.setDirection(DcMotor.Direction.REVERSE);
// Send telemetry message to signify robot waiting;
telemetry.addData("Status", "Ready to run"); //
telemetry.update();
// Wait for the game to start (driver presses PLAY)
waitForStart();
// Step through each leg of the path, ensuring that the Auto mode has not been stopped along the way
// Step 1: Drive forward for 3 seconds
leftFront.setPower(FORWARD_SPEED);
leftBack.setPower(FORWARD_SPEED);
rightFront.setPower(FORWARD_SPEED);
rightBack.setPower(FORWARD_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 2.0)) {
telemetry.addData("Path", "Leg 1: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}
// Step 2: Spin left for 0.9 seconds
leftFront.setPower(-TURN_SPEED);
leftBack.setPower(-TURN_SPEED);
rightFront.setPower(TURN_SPEED);
rightBack.setPower(TURN_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 0.7)) {
telemetry.addData("Path", "Leg 2: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}
// Step 3: Drive forwards for 2.7 Second
leftFront.setPower(FORWARD_SPEED);
leftBack.setPower(FORWARD_SPEED);
rightFront.setPower(FORWARD_SPEED);
rightBack.setPower(FORWARD_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 2.7)) {
telemetry.addData("Path", "Leg 3: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}
}
}
| [
"rsiu@stuy.edu"
] | rsiu@stuy.edu |
b9123900575e19c511adc2d573fa11bfe77036c5 | ceb94f969abf3633643a5eda25fe383779c2ebfe | /TicTacToe/src/tictactoe/EndWin.java | 0d3ff745b08d73de5efbf866a70d797208af07d7 | [] | no_license | hobzamar/A0B36PR2 | c690fa5d4f926c30ca3b115fe58f7d2d6126d861 | 63c140ec1ddae7d453773ca9110836bb4e601afe | refs/heads/master | 2016-08-10T23:45:22.085190 | 2013-05-21T11:56:59 | 2013-05-21T11:56:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,468 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tictactoe;
import java.awt.Toolkit;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
*
* @author Martin
*/
public class EndWin extends JFrame {
int A;
int D;
JLabel L;
JButton B;
JButton C;
Window l;
public EndWin(int a,int b,Window l) {
// super("moje okno");
this.A=a;
this.D=b;
this.l=l;
this.setBounds(200,200,400,200);
this.setTitle("Konec hry");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(null);
if(A%2==1)L=new JLabel("hrac O vyhral");
else L=new JLabel("hrac X vyhral");
L.setBounds(50,20,150,40);
this.add(L);
B=new JButton("hrat znovu");
B.setBounds(40,100,100,32);
this.add(B);
B.addActionListener(new EndOper(this,D,l));
C=new JButton("konec");
C.setBounds(160,100,100,32);
this.add(C);
C.addActionListener(new EndOper(this,0,l));
}
public void kill() {
WindowEvent wev = new WindowEvent(this, WindowEvent.WINDOW_CLOSING);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(wev);
}
}
| [
"Martin@147.32.219.39"
] | Martin@147.32.219.39 |
601feeaddf4ad1125aed45e113e99aa2a63232d1 | 8f079bf706f2e6db2420a868bdd682132fe32c07 | /src/main/java/com/luv2code/springdemo/dao/CustomerDAOImpl.java | 15299ddef977e2f7181b93eca1b23f4f2a5028ec | [] | no_license | SanthoshSelvaraj-hub/web-customer-tracker | 7704bf1cffe5392ebc4aca77438a6d0930b45ed3 | 0c1991d9e0214b21c86bd68d5b18f063376d8619 | refs/heads/main | 2023-06-11T16:19:10.375810 | 2021-07-08T12:43:59 | 2021-07-08T12:43:59 | 383,907,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | package com.luv2code.springdemo.dao;
import java.util.List;
import javax.transaction.Transactional;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.luv2code.springdemo.entity.Customer;
@Repository
public class CustomerDAOImpl implements CustomerDAO {
//Inject the session factory
@Autowired
private SessionFactory sessionFactory;
@Override
public List<Customer> getCustomers() {
// get current session
Session currentSession = sessionFactory.getCurrentSession();
//create a query
Query<Customer> theQuery = currentSession.createQuery("from Customer order by lastName", Customer.class);
//execute query and get result list
List<Customer> customers = theQuery.getResultList();
//return results
return customers;
}
@Override
public void saveCustomer(Customer theCustomer) {
Session currentSession = sessionFactory.getCurrentSession();
currentSession.saveOrUpdate(theCustomer);
}
@Override
public Customer getCustomer(int theId) {
//get current session
Session currentSession = sessionFactory.getCurrentSession();
//retrieve obj from db using the id
Customer theCustomer = currentSession.get(Customer.class, theId);
return theCustomer;
}
}
| [
"70755592+SanthoshSelvaraj-hub@users.noreply.github.com"
] | 70755592+SanthoshSelvaraj-hub@users.noreply.github.com |
90d5efde38ad3cc735e09f68bddeca221ba73e62 | 229f5fbaff2a29248ae4b1174d3c53752d8a07f7 | /src/main/java/com/deer/managementPlatform/entity/FactoryC.java | 9d8ee7e5a4dba1a45d0f0d40b85970904a263dac | [] | no_license | StarAlone9264/ManagementPlatform | 0a76c31547a7dde35feb88247f5ca3ab48cd94e3 | 55ec04985cc71b55c0d0cc04fb03b0ba71660f63 | refs/heads/master | 2023-01-08T02:03:07.391062 | 2020-11-10T09:26:57 | 2020-11-10T09:26:57 | 311,605,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,593 | java | package com.deer.managementPlatform.entity;
import java.util.Date;
/**
* @author wangt
*/
public class FactoryC {
private String factoryId;
private String fullName;
private String factoryName;
private String contactor;
private String phone;
private String mobile;
private String fax;
private String cNote;
private int cType;
private String state;
private String inspector;
private int orderNo;
private String createBy;
private String createDept;
private Date createTime;
public String getFactoryId() {
return factoryId;
}
public void setFactoryId(String factoryId) {
this.factoryId = factoryId;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getContactor() {
return contactor;
}
public void setContactor(String contactor) {
this.contactor = contactor;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getcNote() {
return cNote;
}
public void setcNote(String cNote) {
this.cNote = cNote;
}
public int getcType() {
return cType;
}
public void setcType(int cType) {
this.cType = cType;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getInspector() {
return inspector;
}
public void setInspector(String inspector) {
this.inspector = inspector;
}
public int getOrderNo() {
return orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getCreateDept() {
return createDept;
}
public void setCreateDept(String createDept) {
this.createDept = createDept;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "FactoryC{" +
"factoryId='" + factoryId + '\'' +
", fullName='" + fullName + '\'' +
", factoryName='" + factoryName + '\'' +
", contactor='" + contactor + '\'' +
", phone='" + phone + '\'' +
", mobile='" + mobile + '\'' +
", fax='" + fax + '\'' +
", cNote='" + cNote + '\'' +
", cType=" + cType +
", state='" + state + '\'' +
", inspector='" + inspector + '\'' +
", orderNo=" + orderNo +
", createBy='" + createBy + '\'' +
", createDept='" + createDept + '\'' +
", createTime=" + createTime +
'}';
}
}
| [
"2532446368guji@gmail.com"
] | 2532446368guji@gmail.com |
7dd893affc0ebd8742e0d2d035c7b8ffaf6a5a49 | 14f5dd4888110c44efe17879d2edfdd810d5b0db | /kodilla-good-patterns/src/main/java/com/kodilla/good/patterns/food2door/Runner.java | d4297ae3154be8668362c0466ca2f8b8338ecdd5 | [] | no_license | mdziagacz/maciej-dziagacz-kodilla-java | adea5b46053466a67b9bf633a0df539f40aa2853 | 57dc84513ab7d856b14038ff021c81fde1aaf6e3 | refs/heads/master | 2020-05-07T20:26:52.116042 | 2019-08-26T15:45:10 | 2019-08-26T15:45:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package com.kodilla.good.patterns.food2door;
public class Runner {
public static void main(String[] args) {
Creator order = new Creator();
FoodOrder foodOrder = order.create();
FoodOrderProcessor foodOrderProcessor = new FoodOrderProcessor(new OrderConfirmation(), new SupplierOrderService());
foodOrderProcessor.process(foodOrder);
}
} | [
"m.dziagacz@gmail.com"
] | m.dziagacz@gmail.com |
98548d6a01e74a86feb6eb17a943bca4f4b7ab5c | 255a1a5572d80942793d50a835321a8d87f665e8 | /src/main/java/com/swaaad/model/Horario.java | 5e380096fdcb009ecefc3c0084d69c5ecd12bca7 | [] | no_license | Nelys/swaaad | 7e26c606b76eb07c5e6abb3d2b70044638b4480b | e0095662c1c2d0d294a09f2eb32d88f8a8859a0e | refs/heads/master | 2021-08-31T00:23:02.408911 | 2017-12-20T00:00:48 | 2017-12-20T00:00:48 | 100,424,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,447 | java | package com.swaaad.model;
import java.io.Serializable;
import javax.persistence.*;
import java.sql.Time;
/**
* The persistent class for the horario database table.
*
*/
@Entity
@NamedQuery(name="Horario.findAll", query="SELECT h FROM Horario h")
public class Horario implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="ID_HORARIO")
private int idHorario;
private String dia;
@Column(name="HORA_FIN")
private Time horaFin;
@Column(name="HORA_INICIO")
private Time horaInicio;
//bi-directional many-to-one association to Curso
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="ID_CURSO")
private Curso curso;
public Horario() {
}
public int getIdHorario() {
return this.idHorario;
}
public void setIdHorario(int idHorario) {
this.idHorario = idHorario;
}
public String getDia() {
return this.dia;
}
public void setDia(String dia) {
this.dia = dia;
}
public Time getHoraFin() {
return this.horaFin;
}
public void setHoraFin(Time horaFin) {
this.horaFin = horaFin;
}
public Time getHoraInicio() {
return this.horaInicio;
}
public void setHoraInicio(Time horaInicio) {
this.horaInicio = horaInicio;
}
public Curso getCurso() {
return this.curso;
}
public void setCurso(Curso curso) {
this.curso = curso;
}
} | [
"nelys.mp@gmail.com"
] | nelys.mp@gmail.com |
719ce104e3af7019767b8f355936182af3598bfd | 5bc5bf173c925829b9fa8bf9400db3b2189c199d | /AUTH-BACKEND/src/main/java/com/iesvi/samuel/authbackend/domain/exception/InternalServerException.java | 7d90c8e226a730649b51533581c754f290875e56 | [] | no_license | jlrod2pruebas/proyectodam-samuelvalleinclan | 152a09f6280055019ed56d35b215b6562f8824de | fc8949d1923bebf9a70b8fcefaa48d3f88c3e09c | refs/heads/main | 2023-06-03T05:13:17.077089 | 2021-06-04T10:38:57 | 2021-06-04T10:38:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package com.iesvi.samuel.authbackend.domain.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public class InternalServerException extends RuntimeException {
public InternalServerException(String message) {
super(message);
}
}
| [
"samuel.condelopez@iesvalleinclan.es"
] | samuel.condelopez@iesvalleinclan.es |
49b06668a84d5c1fef7fd8f89c85da5b13fb9691 | 6a649709010f35916b58ad639eb24dc9d7452344 | /AL-Game/src/com/aionemu/gameserver/utils/stats/enums/POWER.java | 2fc55735785a6b32ee2b3c694350f248f95d26a7 | [] | no_license | soulxj/aion-cn | 807860611e746d8d4c456a769a36d3274405fd7e | 8a0a53cf8f99233cbee82f341f2b5c33be0364fa | refs/heads/master | 2016-09-11T01:12:19.660692 | 2014-08-11T14:59:38 | 2014-08-11T14:59:38 | 41,342,802 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,227 | java | /*
* This file is part of aion-unique <aion-unique.smfnew.com>.
*
* aion-unique is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aion-unique is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aion-unique. If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.utils.stats.enums;
/**
* @author ATracer
*/
public enum POWER {
WARRIOR(110),
GLADIATOR(115),
TEMPLAR(115),
SCOUT(100),
ASSASSIN(110),
RANGER(90),
MAGE(90),
SORCERER(90),
SPIRIT_MASTER(90),
PRIEST(95),
CLERIC(105),
CHANTER(110),
ENGINEER(100),
GUNNER(100),
ARTIST(100),
BARD(100);
private int value;
private POWER(int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
| [
"feidebugao@gmail.com"
] | feidebugao@gmail.com |
abc15652b441db6b9efff478143a59ecccd02440 | eaa31015e53ee715d9ed1bb9cf5ee16b3dd09c2b | /src/main/java/WebElementUtils.java | 5a64be542de3cae3b31b597b277e605228986f96 | [] | no_license | KL0nLutiy/BitcoinAuto | 69b10f69baaec59f51c11751cc2b5e7b20e14992 | bdc3307729aa850a797cfccbbb0f6c4405de37fd | refs/heads/master | 2021-01-17T19:11:39.738752 | 2016-07-21T11:36:47 | 2016-07-21T11:36:47 | 63,786,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
/**
* Created by Vlad on 20.07.2016.
*/
public class WebElementUtils {
public static WebElement initElementWhenLoaded(By by){
WebDriver driver = Main.driver;
WebDriverWait wait = new WebDriverWait(driver, Long.parseLong(Configuration.getInstance().getProperty(Configuration.ELEMENT_TIMEOUT))*1000);
wait.until(ExpectedConditions.visibilityOfElementLocated(by));
return driver.findElement(by);
}
public static boolean isElementExist(By by) {
return Main.driver.findElements(by).size() > 0;
}
public static void moveToElement(WebElement element){
Actions actions = new Actions(Main.driver);
actions.moveToElement(element);
actions.perform();
}
public static void scrollUpRight(int pixels){
JavascriptExecutor js = (JavascriptExecutor ) Main.driver;
js.executeScript("window.scrollBy(0," + pixels + ")", "");
}
}
| [
"vladlutiy@gmail.com"
] | vladlutiy@gmail.com |
c0c9f394793c78b39f4b8133412cef9fe7d15e7e | 2658768b2c11a0469b23402d1e5a2d2898c4929c | /src/com/scyb/aisweather/template/dao/impl/StationDaoImpl.java | c47565dc9da7b81256157efaf096b2bbd83250e9 | [] | no_license | cheunyu/ais_msa_sevices | eccaaf0630aeed1f2eb5f6c4a19672d81429b189 | 156421bab3431c0481e1a9490b3152c8862e8006 | refs/heads/master | 2021-01-02T23:18:19.539272 | 2017-08-06T15:49:53 | 2017-08-06T15:49:53 | 99,496,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,331 | java | /**
* @Title: StationDaoImpl.java
* @Package com.scyb.aisweather.template.dao.impl
* @Description: TODO(用一句话描述该文件做什么)
* @author A18ccms A18ccms_gmail_com
* @date 2013-11-14 下午4:21:22
* @version V1.0
*/
package com.scyb.aisweather.template.dao.impl;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.log4j.Logger;
import com.scyb.aisweather.common.dao.impl.BaseDaoImpl;
import com.scyb.aisweather.template.bo.Station;
import com.scyb.aisweather.template.dao.IStationDao;
/**
* @ClassName: StationDaoImpl
* @Description: TODO(基站管理数据层接口实现类)
* @author cheunyu xiaoyuuii@hotmail.com
* @date 2013-11-14 下午4:21:22
*
*/
public class StationDaoImpl extends BaseDaoImpl implements IStationDao {
private Logger log = Logger.getLogger(this.getClass());
/** (非 Javadoc)
* <p>Title: queryAllStations</p>
* <p>Description: </p>
* @return
* @see com.scyb.aisweather.template.dao.IStationDao#queryAllStations()
*/
@Override
public List<Station> queryAllStations() {
String hql = "from Station";
return super.queryList(hql);
}
/** (非 Javadoc)
* <p>Title: removeStaNamesByStaNames</p>
* <p>Description: </p>
* @param staNames
* @return
* @see com.scyb.aisweather.template.dao.IStationDao#removeStaNamesByStaNames(java.lang.String)
*/
@Override
public void removeStaNamesByStaNames(List<String> staNamesList) {
String hql = "from Station sta where sta.stationName in ('";
for(String staName:staNamesList) {
hql += staName + "','";
}
List<?> staList = super.queryList(hql.substring(0, hql.length()-2).toString()+")");
log.info(hql.substring(0, hql.length()-2).toString()+")");
super.delList(staList);
}
@Override
public Set<Station> queryStationsByStaNames(String staNames) {
String hql = "from Station sta where sta.stationName in ('";
for(int i=0;i<staNames.split(",").length;i++) {
hql += staNames.split(",")[i] + "','";
}
List<Station> staList = super.queryList(hql.substring(0, hql.length()-2).toString()+")");
Set staSet = new HashSet();
for(Station sta:staList) {
staSet.add(sta);
}
return staSet;
}
}
| [
"qwe123"
] | qwe123 |
03adbaf23bb79cc6cdd92f29456702ae29c56e44 | 9ea64b036363f592db3992c096542860f7afe528 | /src/main/java/com/pzhu/novel/service/UserInfoService.java | a1cd81d325d701255a62459c20a74b2ada4fbb7f | [
"Apache-2.0"
] | permissive | liupeng12345/novel | 4b47126d503f1acf080cd730a18fb4e9608e7e0a | 6c594ef37c2bb47091e59561d609e0a3a76df075 | refs/heads/master | 2021-09-26T02:13:00.524947 | 2020-01-17T06:24:28 | 2020-01-17T06:24:28 | 180,565,812 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package com.pzhu.novel.service;
import com.pzhu.novel.mbg.model.UserInfo;
public interface UserInfoService {
// 添加
void createUserInfo(UserInfo userInfo);
// 删除
void deleteUserInfo(Long userInfoId);
// 修改
void updateUserInfo(UserInfo userInfo);
}
| [
"750733178@qq.com"
] | 750733178@qq.com |
feb511bb11ea78779adf7b170a7ce366288b14e6 | fb215e679f8bbf3617f5bb9b15b54dc69ecc1265 | /.svn/pristine/23/23f4fd5983a036ecdd378b1ce358bcdbcf269047.svn-base | 2bdf311828ee63bdf20c89d6d0466e8355dffe15 | [] | no_license | fromfield/account_soa | 14e4c47abc995dd7cfb06b6c8acd5d1bcdc98c53 | ed4ef7a51ad1e4e7a8ada5fc722513f6d7b08ea4 | refs/heads/master | 2021-01-10T11:06:28.186591 | 2016-03-01T07:31:45 | 2016-03-01T07:31:45 | 52,856,948 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,161 | package com.tianque.dao.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.tianque.core.base.AbstractBaseDao;
import com.tianque.core.cache.service.CacheService;
import com.tianque.core.cache.service.impl.CacheNameSpace;
import com.tianque.core.cache.util.CacheKeyGenerator;
import com.tianque.dao.IssueTypeDomainDao;
import com.tianque.domain.IssueTypeDomain;
@Repository("issueTypeDomainDao")
public class IssueTypeDomainDaoImpl extends AbstractBaseDao implements
IssueTypeDomainDao {
@Autowired
private CacheService cacheService;
private String findIssueTypeDomainsNameSpace(){
return CacheNameSpace.IssueTypeDomainDao_findIssueTypeDomains;
}
@Override
public List<IssueTypeDomain> findIssueTypeDomains(){
String cacheKey = CacheKeyGenerator.generateCacheKeyFromMethodName(IssueTypeDomain.class, "findIssueTypeDomains","");
List<IssueTypeDomain> result = (List<IssueTypeDomain>)cacheService.get(findIssueTypeDomainsNameSpace(),cacheKey);
if(result!=null){
return result;
}else{
result = this.getSqlMapClientTemplate().queryForList("issueTypeDomain.findIssueTypeDomains");
cacheService.set(findIssueTypeDomainsNameSpace(), cacheKey,result);
return result;
}
}
@Override
public IssueTypeDomain addIssueTypeDomain(IssueTypeDomain issueTypeDomain){
Long id = (Long)this.getSqlMapClientTemplate().insert("issueTypeDomain.insertIssueTypeDomain",issueTypeDomain);
IssueTypeDomain result = getIssueTypeDoaminById(id);
cacheService.invalidateNamespaceCache(findIssueTypeDomainsNameSpace());
cacheService.remove(CacheKeyGenerator.generateCacheKeyFromMethodName(IssueTypeDomain.class, "findIssueTypeDomainsByModule",issueTypeDomain.getModule()));
return result;
}
@Override
public IssueTypeDomain getIssueTypeDoaminById(Long id){
String idCachKey = CacheKeyGenerator.generateCacheKeyFromId(IssueTypeDomain.class, id);
IssueTypeDomain result = (IssueTypeDomain)cacheService.get(idCachKey);
if(result != null){
return result;
}else{
result = reLoadIssueTypeDomain(id);
if(result !=null){
cacheService.set(idCachKey,result);
}
return result;
}
}
private IssueTypeDomain reLoadIssueTypeDomain(Long id) {
return (IssueTypeDomain)this.getSqlMapClientTemplate().queryForObject("issueTypeDomain.getIssueTypeDomainById",id);
}
@Override
public IssueTypeDomain getIssueTypeDoaminByDomainName(String domainName){
return (IssueTypeDomain)this.getSqlMapClientTemplate().queryForObject("issueTypeDomain.getIssueTypeDomainByDomainName",domainName);
}
@Override
public List<IssueTypeDomain> findIssueTypeDomainsByModule(String module) {
String cacheKey = CacheKeyGenerator.generateCacheKeyFromMethodName(IssueTypeDomain.class, "findIssueTypeDomainsByModule",module);
List<IssueTypeDomain> result = (List<IssueTypeDomain>)cacheService.get(cacheKey);
if(result!=null){
return result;
}else{
result = this.getSqlMapClientTemplate().queryForList("issueTypeDomain.findIssueTypeDomainsByModule",module);
cacheService.set(cacheKey,result);
return result;
}
}
}
| [
"liyanlongyan@163.com"
] | liyanlongyan@163.com | |
38192f9a2dd6dad6a256d9429bc0657c05444f34 | bce62b45d3bfc9a638b0722ae194f4b4cb43116a | /youche-flyway/src/main/java/com/youche/flyway/mapper/UserMapper.java | afd74b06800aaec30332a6d0a743ef7cbe597bc0 | [
"Apache-2.0"
] | permissive | youche2021/youche-parent | ee7c032cffb3a0ed66d4b67dd35985850b06b71d | ca5ac80e4ae94798bb736ca71a4ec64793edc691 | refs/heads/main | 2023-03-03T13:54:04.773922 | 2021-02-18T02:53:48 | 2021-02-18T02:53:48 | 332,207,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package com.youche.flyway.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youche.flyway.model.User;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserMapper extends BaseMapper<User> {
}
| [
"youche2021@126.com"
] | youche2021@126.com |
bc1b63675439800ee69359e1c5e6505cce9df9d2 | 236bca572da4ec8dbfa846a2fae63339a1f22898 | /FreeCRMBDD/src/main/java/com/qa/util/TestBase.java | 8b822b728169c5533bc5747f3e6c597fd1331268 | [] | no_license | vnellutla2276/Test-demo | b8a7a2dfe670bd1628c80b05654b73e5609e42fe | a17fd80e539b6e6d538176b66b74705d71627397 | refs/heads/master | 2023-06-08T09:44:37.695806 | 2021-06-28T14:59:43 | 2021-06-28T14:59:43 | 381,068,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,303 | java | package com.qa.util;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class TestBase {
public static WebDriver driver;
public static Properties prop;
public TestBase() {
try {
prop = new Properties();
FileInputStream fis = new FileInputStream(
"C:\\Users\\venkatesh.nellutla\\eclipse-workspace\\FreeCRMBDD\\src\\main\\java\\com\\qa\\config\\config.properties");
prop.load(fis);
}catch(IOException e) {
e.getMessage();
}
}
public static void Initialization() {
String browserName= prop.getProperty("browser");
if(browserName.equals("chrome")){
System.setProperty("webdriver.chrome.driver", "C:\\Users\\venkatesh.nellutla\\eclipse-workspace\\Drivers\\chromedriver.exe");
driver = new ChromeDriver();
}
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(TestUtil.PAGE_LOAD_TIMEOUT, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(TestUtil.IMPLICIT_WAIT, TimeUnit.SECONDS);
driver.get(prop.getProperty("url"));
}
}
| [
"venkatesh.nellutla@tadigital.com"
] | venkatesh.nellutla@tadigital.com |
87c397762c60a50873aec0fc7368c7eea031004b | a363c46e7cbb080db2b3a69a70ebf912195e25c7 | /ls-modules/ls-business/src/main/java/cn/lonsun/publicInfo/internal/service/impl/PublicCatalogCountServiceImpl.java | 024e3187da85d76ae5b40821a7afd645fbd653c9 | [] | no_license | pologood/excms | 601646dd7ea4f58f8423da007413978192090f8d | e1c03f574d0ecbf0200aaffa7facf93841bab02c | refs/heads/master | 2020-05-14T20:07:22.979151 | 2018-10-06T10:51:37 | 2018-10-06T10:51:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,183 | java | package cn.lonsun.publicInfo.internal.service.impl;
import cn.lonsun.core.base.service.impl.BaseService;
import cn.lonsun.publicInfo.internal.entity.PublicCatalogCountEO;
import cn.lonsun.publicInfo.internal.service.IPublicCatalogCountService;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by fth on 2017/5/31.
*/
@Service
public class PublicCatalogCountServiceImpl extends BaseService<PublicCatalogCountEO> implements IPublicCatalogCountService {
@Override
public List<PublicCatalogCountEO> getListByOrganId(Long organId) {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("organId", organId);
return getEntities(PublicCatalogCountEO.class, paramMap);
}
@Override
public void updateOrganCatIdCountByStatus(Long organId, Long catId, Long increment, Integer status, boolean cascade) {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("organId", organId);
paramMap.put("catId", catId);
boolean save = false;
PublicCatalogCountEO update = getEntity(PublicCatalogCountEO.class, paramMap);
if (null == update) {//新增
save = true;
update = new PublicCatalogCountEO();
update.setOrganId(organId);
update.setCatId(catId);
}
// 设置数字
if (status == 1) {//发布
update.setPublishCount(update.getPublishCount() + increment);
if (cascade) {
Long count = update.getUnPublishCount() - increment;
update.setUnPublishCount(count > 0L ? count : 0L);
}
} else if (status == 0) {//取消发布
update.setUnPublishCount(update.getUnPublishCount() + increment);
if (cascade) {
Long count = update.getPublishCount() - increment;
update.setPublishCount(count > 0L ? count : 0L);
}
}
if (save) {//更新到数据库
this.saveEntity(update);
} else {
this.updateEntity(update);
}
}
}
| [
"2885129077@qq.com"
] | 2885129077@qq.com |
f21acbe21f42096f5deb5bf57a52e7ec1b8b0846 | 83d1876a13882b00175c36474391631c5fa0ea9d | /src/main/java/com/sinjinsong/leetcode/medium/LeetCode11.java | f808faac487e87da710cca1f35263d11c2f5bfc1 | [] | no_license | songxinjianqwe/DataStructures | acc9c103666526bb14ef6cf35396c9321d0b5a9b | 53fe5e9ac1605990e3a20bfd4b5c003e9ed60010 | refs/heads/master | 2021-07-01T19:31:32.594899 | 2021-02-01T16:17:58 | 2021-02-01T16:17:58 | 74,250,991 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,816 | java | package com.sinjinsong.leetcode.medium;
public class LeetCode11 {
/**
* 给你 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0) 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
*
* 说明:你不能倾斜容器。
*
*
*
* 示例 1:
*
*
*
* 输入:[1,8,6,2,5,4,8,3,7]
* 输出:49
* 解释:图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下,容器能够容纳水(表示为蓝色部分)的最大值为 49。
* 示例 2:
*
* 输入:height = [1,1]
* 输出:1
* 示例 3:
*
* 输入:height = [4,3,2,1,4]
* 输出:16
* 示例 4:
*
* 输入:height = [1,2,1]
* 输出:2
*
*
* 提示:
*
* n = height.length
* 2 <= n <= 3 * 104
* 0 <= height[i] <= 3 * 104
*
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/container-with-most-water
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
* @param height
* @return
*/
public int maxArea(int[] height) {
int ans = 0;
int i = 0;
int j = height.length - 1;
while(i < j) {
int h = Math.min(height[i], height[j]);
ans = Math.max(ans, h * (j - i));
// 教矮的边往里面移动,这样有可能移动出来更大的乘积
if(height[i] < height[j]) {
i++;
} else {
j--;
}
}
return ans;
}
}
| [
"xinjian@xinjiandeMacBook-Pro.local"
] | xinjian@xinjiandeMacBook-Pro.local |
575bee46209f80432457c9fccf34d26708cb4e83 | 7585e36381e2ea31c47fc63367c3f6179354352a | /Repast-3.1/RepastJ/src/uchicago/src/sim/network/Edge.java | baa8c2d05dff46df423f7c583cb25b9d613b1d27 | [
"MIT"
] | permissive | joaomrcsmartins/MIEIC_AIAD_2020 | 7e8bca4e6b25c4120605989cf61a2526aaa6537e | 94f839c4dc3e1f7a7ac202f871f441a1fb82928b | refs/heads/main | 2023-03-02T05:19:05.323841 | 2021-01-29T12:23:48 | 2021-01-29T12:23:48 | 304,640,622 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,994 | java | /*$$
* Copyright (c) 1999, Trustees of the University of Chicago
* All rights reserved.
*
* Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the following
* conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the University of Chicago nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*$$*/
package uchicago.src.sim.network;
/**
* A interface for all edge objects (as in nodes and edges). Implementing this
* inteface allows the edge to be displayed correctly.<p>
*
* At this time labels are not displayed.
*
* @author Nick Collier
* @version $Revision: 1.3 $ $Date: 2004/11/03 19:51:01 $
*/
public interface Edge {
/**
* Gets the node that this edge comes from.
*/
public Node getFrom();
/**
* Gets the node that this edge goes to
*/
public Node getTo();
/**
* Sets the from node
*/
public void setFrom(Node node);
/**
* Sets the to Node
*/
public void setTo(Node node);
/**
* Sets the label for this edge
*
* @param label the label for this edge
*/
public void setLabel(String label);
/**
* Gets the label for this edge.
*/
public String getLabel();
/**
* Sets the strength of this edge
*/
public void setStrength(double val);
/**
* Gets the strength of this edge
*/
public double getStrength();
/**
* Gets the type of this edge. This is typically used to track the type
* of network.
*/
public String getType();
/**
* Sets the type of this edge. This is typically used to track the type
* of network (i.e. marriage etc.)
*/
public void setType(String type);
}
| [
"anamargaridarl@gmail.com"
] | anamargaridarl@gmail.com |
7c543e1109211d6630ce9b2f4ccbca5f10894ecd | 026f8a97f12dea3f8a31bca600a763ec90684f29 | /rassyeyanie-rules-pims/src/main/java/uk/nhs/kch/rassyeyanie/rules/pims/apas/translations/a31/ApasA31PimsA31.java | 9dbeea5acd17a306af86ab7c43d85d2a1baa5083 | [
"Apache-2.0"
] | permissive | Upsyd/rassyeyanie | 537134e9178e884734f73d6ea8f34d37c908472c | 0ba6868f5b5bc68de87cc9eaf2756d794e2658a1 | refs/heads/master | 2021-05-26T21:31:11.014912 | 2013-10-14T07:50:08 | 2013-10-14T07:50:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package uk.nhs.kch.rassyeyanie.rules.pims.apas.translations.a31;
import org.apache.camel.Body;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.v24.message.ADT_A05;
import ca.uhn.hl7v2.model.v24.segment.PD1;
import ca.uhn.hl7v2.model.v24.segment.PV1;
public class ApasA31PimsA31
{
public void processMessage(@Body ADT_A05 to)
throws HL7Exception
{
this.transform(to.getPD1());
this.transform(to.getPV1());
}
public void transform(PD1 pd1)
{
pd1.clear();
}
public void transform(PV1 pv1)
throws HL7Exception
{
pv1.clear();
pv1.getPv11_SetIDPV1().setValue("1");
pv1.getPv12_PatientClass().setValue("R");
}
}
| [
"elijah.charles@nhs.net"
] | elijah.charles@nhs.net |
d63c66d7e4020c4fd0c293625ac90e0fc051b41f | ee20256c682b77b4b0bef4af82d4acb648c7e193 | /app/src/main/java/com/example/hanbinpark/han/MainActivity.java | f37ad8f70adc5bf1c5cc312f29bacf72ad2f63b1 | [] | no_license | hanbin7011/JavaApplication | bf48a5f7bb7b94a94e99241d4a031a3614928624 | 354aaf8a30fe054f14508a5b2a571876daf47535 | refs/heads/master | 2020-04-10T15:40:15.665639 | 2018-12-10T04:59:15 | 2018-12-10T04:59:15 | 161,118,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | package com.example.hanbinpark.han;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.example.hanbinpark.han.Login.LoginActivity;
import com.example.hanbinpark.han.Login.RegisterActivity;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d(TAG, "onCreate: started");
//Check user already login or not
if(SaveSharedPreference.getUserName(MainActivity.this).length() == 0) {
checkCurrentUser();
}else {
SaveSharedPreference.clearUserName(MainActivity.this);
}
}
private void checkCurrentUser(){
Log.d(TAG, "checkCurrentUser: checking if user is logged in.");
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
}
}
| [
"hanbin7011@gmail.com"
] | hanbin7011@gmail.com |
c03912594646ad1a69b4558fbba0fcce9cc54ebe | 5c9459bc8fb7543ccacb70c143077fb7ed919cfe | /core/src/main/java/org/apache/carbondata/core/indexstore/schema/DataMapSchema.java | 80c68ac18bfc45a2693525500c33146dfb31d8c6 | [
"Apache-2.0"
] | permissive | anubhav100/incubator-carbondata | ffc2bb06d7f6bbd597da6162e067fbb974b0332d | 1e7da59b466ae4f33e3c184db02f218f91a6a2ae | refs/heads/master | 2020-07-25T05:19:04.518946 | 2017-09-20T06:33:18 | 2017-09-21T05:54:39 | 73,782,274 | 1 | 0 | null | 2016-11-15T06:12:07 | 2016-11-15T06:12:06 | null | UTF-8 | Java | false | false | 3,138 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.carbondata.core.indexstore.schema;
import org.apache.carbondata.core.metadata.datatype.DataType;
/**
* It just have 2 types right now, either fixed or variable.
*/
public abstract class DataMapSchema {
protected DataType dataType;
public DataMapSchema(DataType dataType) {
this.dataType = dataType;
}
/**
* Either fixed or variable length.
*
* @return
*/
public DataType getDataType() {
return dataType;
}
/**
* Gives length in case of fixed schema other wise returns length
*
* @return
*/
public abstract int getLength();
/**
* schema type
* @return
*/
public abstract DataMapSchemaType getSchemaType();
/*
* It has always fixed length, length cannot be updated later.
* Usage examples : all primitive types like short, int etc
*/
public static class FixedDataMapSchema extends DataMapSchema {
private int length;
public FixedDataMapSchema(DataType dataType) {
super(dataType);
}
public FixedDataMapSchema(DataType dataType, int length) {
super(dataType);
this.length = length;
}
@Override public int getLength() {
if (length == 0) {
return dataType.getSizeInBytes();
} else {
return length;
}
}
@Override public DataMapSchemaType getSchemaType() {
return DataMapSchemaType.FIXED;
}
}
public static class VariableDataMapSchema extends DataMapSchema {
public VariableDataMapSchema(DataType dataType) {
super(dataType);
}
@Override public int getLength() {
return dataType.getSizeInBytes();
}
@Override public DataMapSchemaType getSchemaType() {
return DataMapSchemaType.VARIABLE;
}
}
public static class StructDataMapSchema extends DataMapSchema {
private DataMapSchema[] childSchemas;
public StructDataMapSchema(DataType dataType, DataMapSchema[] childSchemas) {
super(dataType);
this.childSchemas = childSchemas;
}
@Override public int getLength() {
return dataType.getSizeInBytes();
}
public DataMapSchema[] getChildSchemas() {
return childSchemas;
}
@Override public DataMapSchemaType getSchemaType() {
return DataMapSchemaType.STRUCT;
}
}
public enum DataMapSchemaType {
FIXED, VARIABLE, STRUCT
}
}
| [
"carbondatacontributions@gmail.com"
] | carbondatacontributions@gmail.com |
a401b33203ab04067cdfce89eaa530b91ebf1422 | 8ff06d8691ef4745acea824440f3044572ce1a2c | /app/src/main/java/com/hencoder/hencoderpracticedraw1/practice/Practice7DrawRoundRectView.java | 0a5286728a5d99c697ef1f0ba214b4da8a8cbbbe | [] | no_license | haoguibao/CustomView1 | 5842cffd4a80a65081f7ed1b217ebf7ca38a415f | 776cfd351704638bd1ef09b21e70a1ca882ce7af | refs/heads/master | 2020-06-17T18:45:28.446007 | 2019-07-09T13:30:55 | 2019-07-09T13:30:55 | 196,006,620 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,166 | java | package com.hencoder.hencoderpracticedraw1.practice;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
public class Practice7DrawRoundRectView extends View {
public Practice7DrawRoundRectView(Context context) {
super(context);
}
public Practice7DrawRoundRectView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public Practice7DrawRoundRectView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 练习内容:使用 canvas.drawRoundRect() 方法画圆角矩形
Paint paint = new Paint();
paint.setColor(Color.BLACK);
paint.setStyle(Paint.Style.FILL);
RectF rectF = new RectF(300,200,700,500);
//rectF.set(300,200,700,500);
canvas.drawRoundRect(rectF,50,50,paint);
}
}
| [
"hgbvip123@163.com"
] | hgbvip123@163.com |
aa8a2e05470ce4b05d54559f259fcf44fa707530 | 5137cfa6cf91113853ed74a5faead23502b53aca | /src/main/java/de/compilerbau/NewAwkCompiler/javacc21/Apostrophe.java | 56faf8218947bdcb859237c1d8243e43b61a6b00 | [] | no_license | silasmahler/compilerbau | fcd45e050fb2d4f7ec19ec58b5348df7da45dfa6 | 19f7cbcbd00ac59a93b7e8f7f15ab5b3b285da20 | refs/heads/master | 2022-12-26T01:24:45.378060 | 2020-10-09T22:08:49 | 2020-10-09T22:08:49 | 280,470,246 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | /* Generated by: JavaCC 21 Parser Generator. Do not edit.
* Generated Code for Apostrophe Token subclass
* by the ASTToken.java.ftl template
*/
package de.compilerbau.NewAwkCompiler.javacc21;
import static de.compilerbau.NewAwkCompiler.javacc21.NewAwkConstants.TokenType.*;
@SuppressWarnings("unused")
public class Apostrophe extends Token {
public Apostrophe(TokenType type, String image, String inputSource) {
super(type, image, inputSource);
}
public Apostrophe(TokenType type, String image, FileLineMap fileLineMap) {
super(type, image, fileLineMap);
}
}
| [
"silas-mahler@t-online.de"
] | silas-mahler@t-online.de |
9894bf01b22f11e51d42f629b98aa70e8485f4a8 | 61c682bc6d1dda114f93042383056ac5ed535e38 | /server-gateway/src/main/java/com/xzw/servergateway/filter/MyLogGatewayFilterFactory.java | 15a9dfffbc6c3ae4aad38f0b3a965933a695299f | [] | no_license | xiong180/warehouse | f8ada33fc67624881c431ac62014451bbdbd7756 | 8be8d804e8550165b22ba1bf7d044cc806f0378f | refs/heads/master | 2023-03-02T20:37:44.684580 | 2021-02-13T08:42:22 | 2021-02-13T08:42:22 | 337,597,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,379 | java | package com.xzw.servergateway.filter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;
import java.util.Collections;
import java.util.List;
/**
* MyLogGatewayFilterFactory;
*
* @author xzw
* @date 2021/2/11 13:41
*/
@Component
public class MyLogGatewayFilterFactory extends AbstractGatewayFilterFactory<MyLogGatewayFilterFactory.Config> {
private static final Log log = LogFactory.getLog(MyLogGatewayFilterFactory.class);
private static final String MY_LOG_START_TIME = MyLogGatewayFilterFactory.class.getName() + "." + "startTime";
public MyLogGatewayFilterFactory() {
super(Config.class);
}
@Override
public List<String> shortcutFieldOrder() {
return Collections.singletonList("enabled");
}
@Override
public GatewayFilter apply(Config config) {
return (exchange, chain) -> {
if (!config.isEnabled()) {
return chain.filter(exchange);
}
exchange.getAttributes().put(MY_LOG_START_TIME, System.currentTimeMillis());
return chain.filter(exchange).then(Mono.fromRunnable(() -> {
Long startTime = exchange.getAttribute(MY_LOG_START_TIME);
if (null != startTime) {
ServerHttpRequest serverHttpRequest = exchange.getRequest();
String sb = serverHttpRequest.getURI().getRawPath() +
" : " +
serverHttpRequest.getQueryParams() +
" : " +
(System.currentTimeMillis() - startTime) +
"ms";
log.info(sb);
}
}));
};
}
public static class Config {
/**
* 是否开启
*/
private boolean enabled;
public Config() {
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
}
| [
"180327904@qq.com"
] | 180327904@qq.com |
574509ee705dd9931a2330d12bbcd9d7c7d76086 | ce5cddb4028bf5986fb40c60cc9869c96f99cf34 | /src/main/java/com/nosql/controller/TDESController.java | 3b6a7d41cefc37756fb855c31f9761054e1df52f | [] | no_license | GaberAbutaleb/NoSQL-Authentication-API | 1ae7e3fb460e9b62184d95bc23377923f54582d5 | 2f16ef403032507bdee463d608b22d0525c0929c | refs/heads/master | 2022-04-21T21:29:19.691093 | 2020-04-24T15:47:26 | 2020-04-24T15:47:26 | 258,532,223 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,472 | java | package com.nosql.controller;
import com.nosql.encryption.DESedeUtility;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;
@RestController
public class TDESController {
@Value("${TDESsecretKey}")
String TDESsecretKey;
@PostMapping(value = "/TDESencrypt")
public ResponseEntity<String> encrypt(@RequestBody String text) throws Exception {
SecretKey secretKey = new SecretKeySpec(Base64.getDecoder().decode(TDESsecretKey), "DESede");
DESedeUtility encrypter = new DESedeUtility(secretKey);
String encrypted = encrypter.encrypt(text);
return new ResponseEntity<>(encrypted, HttpStatus.OK);
}
@PostMapping(value = "/TDESdecrypt")
public ResponseEntity<String> dencrypt(@RequestBody String encryptedText) throws Exception {
SecretKey secretKey = new SecretKeySpec(Base64.getDecoder().decode(TDESsecretKey), "DESede");
DESedeUtility encrypter = new DESedeUtility(secretKey);
String decrypted = encrypter.decrypt(encryptedText);
return new ResponseEntity<String>(decrypted, HttpStatus.OK);
}
}
| [
"gaber.elsaid@datagearbi.com"
] | gaber.elsaid@datagearbi.com |
ca726c2b4d7b85b68e301ccd9bd37ca8354c6b1c | fc160694094b89ab09e5c9a0f03db80437eabc93 | /java-automl/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportModelOperationMetadataOrBuilder.java | a34a0ffd8dfdc121cb23b17a9c86d01dbbf049dc | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | googleapis/google-cloud-java | 4f4d97a145e0310db142ecbc3340ce3a2a444e5e | 6e23c3a406e19af410a1a1dd0d0487329875040e | refs/heads/main | 2023-09-04T09:09:02.481897 | 2023-08-31T20:45:11 | 2023-08-31T20:45:11 | 26,181,278 | 1,122 | 685 | Apache-2.0 | 2023-09-13T21:21:23 | 2014-11-04T17:57:16 | Java | UTF-8 | Java | false | false | 2,117 | java | /*
* Copyright 2023 Google LLC
*
* 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
*
* https://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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/automl/v1beta1/operations.proto
package com.google.cloud.automl.v1beta1;
public interface ExportModelOperationMetadataOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ExportModelOperationMetadata)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Output only. Information further describing the output of this model
* export.
* </pre>
*
* <code>
* .google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2;
* </code>
*
* @return Whether the outputInfo field is set.
*/
boolean hasOutputInfo();
/**
*
*
* <pre>
* Output only. Information further describing the output of this model
* export.
* </pre>
*
* <code>
* .google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2;
* </code>
*
* @return The outputInfo.
*/
com.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo
getOutputInfo();
/**
*
*
* <pre>
* Output only. Information further describing the output of this model
* export.
* </pre>
*
* <code>
* .google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2;
* </code>
*/
com.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder
getOutputInfoOrBuilder();
}
| [
"noreply@github.com"
] | noreply@github.com |
64a2e829d09365ac40e11e1867900bbe34e3b3fa | 3a2c98275d5e2d5cf2bed20fca3765718195fd3b | /ANDREW SPENCE JAVA HOMEWORK/JAVA HOMEWORK CHAPTER 4/java_homework_page154Q4_14.java | 11f45e0747419b5f3b7b9a3faf86cf054ee1b39e | [] | no_license | andrewspence2020/Introduction-to-java-with-Daniel-Liang-11th-Edition | 2476f02a7ed49b94724e72a06250f77654689036 | 94288f7a55d36165bd5067d61489a50275fe88ec | refs/heads/master | 2020-08-02T22:23:41.813519 | 2019-09-28T15:53:32 | 2019-09-28T15:53:32 | 211,524,605 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 994 | java | package Java_homework;
import java.util.Scanner;
public class java_homework_page154Q4_14 {
@SuppressWarnings("resource")
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter a letter Grade");
char yourGrade = sc.next().charAt(0);
if (yourGrade == 'A' || yourGrade == 'a') {
System.out.println("The numeric value for A is 4");
}
else if (yourGrade == 'B' || yourGrade == 'b') {
System.out.println("The numeric value for B is 3");
}
else if (yourGrade == 'C' || yourGrade == 'c') {
System.out.println("The numeric value for C is 2");
}
else if(yourGrade == 'D' || yourGrade == 'd') {
System.out.println("The numeric value for D is 1");
}
else if (yourGrade == 'F' || yourGrade == 'f'){
System.out.println("The numeric value for f is 0");
}
else {
System.out.println("Invalid Grade");
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
2b9d1174123d29d412aae315caf36ea0daf369ee | 405ee915cff6cd8a10c82d1034fe1192167cc76c | /src/controllers/MyReservationsController.java | 49c078e66fa98d6065d9433be7a7379fb42e689a | [] | no_license | Mtik333/ClientREST | 5707684f5dbb2863652e0aa75d8aed8c20678713 | a44bcb240f48c8be37637583453c0173621d9c4e | refs/heads/master | 2020-03-18T17:51:38.912218 | 2018-05-30T09:31:56 | 2018-05-30T09:31:56 | 135,055,699 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,520 | java | package controllers;
import cinemaclient.CinemaClient;
import com.qoppa.pdf.PDFException;
import com.qoppa.pdfViewerFX.PDFViewer;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Priority;
import javafx.stage.Stage;
import javafx.util.Callback;
import nothing.ResponseList;
import nothing.RsiReservation;
import javax.ws.rs.core.Response;
import javax.xml.datatype.DatatypeConfigurationException;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
public class MyReservationsController implements Initializable {
private static List<RsiReservation> reservationList;
@FXML
public ListView listView;
private static ObservableList<String> list;
private static RsiReservation findReservation(String id) {
int reservationId = Integer.parseInt(id.replace("-", ""));
for (RsiReservation rsiReservation : reservationList) {
if (rsiReservation.getId().intValue() == reservationId) {
return rsiReservation;
}
}
return null;
}
@Override
public void initialize(URL location, ResourceBundle resources) {
CinemaClient cinemaClient = null;
try {
cinemaClient = new CinemaClient();
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
ResponseList responseList = cinemaClient.getReservations(ResponseList.class);
reservationList = responseList.getReservations().stream().filter(reservation -> reservation.getClientReserverId().getId().intValue() == Everything.rsiClient.getId().intValue()).collect(Collectors.toList());
List<String> reservations = new ArrayList<>();
for (RsiReservation rsiReservation : reservationList) {
StringBuilder sb = new StringBuilder();
sb.append(rsiReservation.getId() + "\t");
sb.append(rsiReservation.getScreeningId().getMovieId().getTitle() + "\t");
Date date = null;
try {
date = rsiReservation.getScreeningId().getGregorianCalendar().toGregorianCalendar().getTime();
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
String formattedDate = formatter.format(date);
sb.append(formattedDate);
reservations.add(sb.toString());
} catch (DatatypeConfigurationException e) {
e.printStackTrace();
}
}
list = FXCollections.observableArrayList(reservations);
listView.setItems(list);
listView.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
@Override
public ListCell<String> call(ListView<String> param) {
return new XCell();
}
});
}
@FXML
private void goToMyReservations() {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("../fxmls/FXMLDocument.fxml"));
Parent root1 = null;
try {
root1 = (Parent) fxmlLoader.load();
} catch (IOException e) {
e.printStackTrace();
}
Stage stage_root = (Stage) listView.getScene().getWindow();
stage_root.setTitle("RSI Cinema - Movies");
stage_root.setScene(new Scene(root1));
stage_root.showAndWait();
}
@FXML
public void dismiss() {
Stage stage = (Stage) listView.getScene().getWindow();
stage.close();
}
static class XCell extends ListCell<String> {
HBox hbox = new HBox();
Label label = new Label("(empty)");
Label label2 = new Label("aaa");
Label label3 = new Label();
Pane pane = new Pane();
Button editButton = new Button("Edit");
Button cancelButton = new Button("Cancel");
Button button = new Button("Details");
String lastItem;
XCell() {
super();
hbox.setSpacing(2);
hbox.getChildren().addAll(label, label2, label3, pane, button, editButton, cancelButton);
HBox.setHgrow(pane, Priority.ALWAYS);
editButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("../fxmls/ChangeReservationSeat.fxml"));
ChangeReservation.reservation = findReservation(label.getText());
Parent root1 = null;
try {
root1 = (Parent) fxmlLoader.load();
} catch (IOException e) {
e.printStackTrace();
}
Stage stage = new Stage();
stage.setTitle("Seat details");
stage.setScene(new Scene(root1));
stage.showAndWait();
}
});
cancelButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Confirmation Dialog");
alert.setHeaderText("Look, a Confirmation Dialog");
alert.setContentText("Are you ok with this?");
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
CinemaClient cinemaClient = null;
try {
cinemaClient = new CinemaClient(Everything.rsiClient.getUsername(),Everything.rsiClient.getPassword());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
}
RsiReservation test = findReservation(label.getText());
cinemaClient.removeReservation(test.getId().toString());
int index = reservationList.indexOf(test);
list.remove(index);
} else {
alert.close();
}
}
});
button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
//https://kbdeveloper.qoppa.com/javafx-pdf-viewer/
CinemaClient cinemaClient = null;
try {
cinemaClient = new CinemaClient(Everything.rsiClient.getUsername(),Everything.rsiClient.getPassword());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
}
RsiReservation test = findReservation(label.getText());
Response response = cinemaClient.pdfReservation(test.getId().toString());
byte[] bais = response.readEntity(byte[].class);
File file = new File("itext-test.pdf");
FileOutputStream fileout = null;
try {
fileout = new FileOutputStream(file);
fileout.write(bais);
PDFViewer m_PDFViewer = new PDFViewer();
m_PDFViewer.loadPDF(file.toURL());
BorderPane borderPane = new BorderPane(m_PDFViewer);
Scene scene = new Scene(borderPane);
Stage stage = new Stage();
stage.setTitle("Reservation in PDF");
stage.setScene(scene);
stage.centerOnScreen();
stage.show();
} catch (IOException | PDFException e) {
e.printStackTrace();
}
}
});
}
@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
setText(null); // No text in label of super class
if (empty) {
lastItem = null;
setGraphic(null);
} else {
lastItem = item;
label.setText(item != null ? item : "<null>");
String[] text = label.getText().split("\t");
label.setText(text[0]);
label2.setText(text[1]);
label3.setText(text[2]);
setGraphic(hbox);
}
}
}
}
| [
"walendziukm@tt.com.pl"
] | walendziukm@tt.com.pl |
239a8349be34fcef98ad5a404e90ffe98783afd5 | 3bbe038dc29e84a03d53cc0d47fb0b47b3e3729d | /open-stf-rest-api-rxjava2-adapter/src/test/java/com/github/e13mort/stf/adapter/filters/ProviderPredicateTest.java | 6d31407f19b90495aac4aafe72751cb0e2bd46f0 | [
"Apache-2.0"
] | permissive | e13mort/stf-rest-client | b2da77bc9e27af6d78301be3eaaff811e165da23 | 4410963cbf51055a98ce3ab1e93979db61ed5d51 | refs/heads/master | 2021-06-15T00:19:22.744385 | 2021-05-29T20:33:06 | 2021-05-29T20:33:06 | 80,465,688 | 4 | 1 | Apache-2.0 | 2021-05-29T19:29:44 | 2017-01-30T21:30:32 | Java | UTF-8 | Java | false | false | 3,052 | java | package com.github.e13mort.stf.adapter.filters;
import com.github.e13mort.stf.model.device.Device;
import com.github.e13mort.stf.model.device.Provider;
import io.reactivex.Observable;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Predicate;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import static com.github.e13mort.stf.adapter.filters.InclusionType.EXCLUDE;
import static com.github.e13mort.stf.adapter.filters.InclusionType.INCLUDE;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ProviderPredicateTest extends SingleMockedStringFieldTest {
@Test
public void testIncludeEmptyPredicateEmmit4Values() throws Exception {
test(create(INCLUDE, ""), 4);
}
@Test
public void testExcludeEmptyPredicateEmmit1Values() throws Exception {
test(create(EXCLUDE, ""), 1).assertValue(new Predicate<Device>() {
@Override
public boolean test(@NonNull Device device) throws Exception {
return device.getProvider().getName() == null;
}
});
}
@Test
public void testIncludeStringProviderWillEmmit4Values() throws Exception {
test(create(INCLUDE, "Provider"),4);
}
@Test
public void testIncludeString1WillEmmit1Values() throws Exception {
test(create(INCLUDE, "1"),1);
}
@Test
public void testIncludeString2WillEmmit2Values() throws Exception {
test(create(INCLUDE, "2"),2);
}
@Test
public void testExcludeStringProviderWillEmmit1Values() throws Exception {
test(create(EXCLUDE, "Provider"),1);
}
@Test
public void testExcludeString2WillEmmit3Values() throws Exception {
test(create(EXCLUDE, "2"),3);
}
@Test
public void testIncludeStringAnyOnNullProviderWontEmmitValue() throws Exception {
getDeviceObservableWithNullProvider()
.filter(create(INCLUDE, "any"))
.test().assertValueCount(0);
}
@Test
public void testExcludeStringAnyOnNullProviderWillEmmitValue() throws Exception {
getDeviceObservableWithNullProvider()
.filter(create(EXCLUDE, "any"))
.test().assertValueCount(1);
}
private Observable<Device> getDeviceObservableWithNullProvider() {
Device device = mock(Device.class);
when(device.getProvider()).thenReturn(null);
return Observable.just(device);
}
@Override
protected String[] getStrings() {
return new String[] {null, "provider1", "provider2", "provider2", "provider3"};
}
@Override
protected Device mockDevice(String param) {
Device mock = mock(Device.class);
Provider provider = new Provider();
provider.setName(param);
when(mock.getProvider()).thenReturn(provider);
return mock;
}
private ProviderPredicate create(InclusionType type, String... templates) {
return new ProviderPredicate(type, Arrays.asList(templates));
}
} | [
"imortan@gmail.com"
] | imortan@gmail.com |
67e973f95a93eb3e2125a24316954eec40eccb3c | 70a20fd2b87e317c11f7e13ee953cc9b15ac2d2b | /wechat-zero/what-fuck/src/main/java/what/fuck/wechat/util/HttpClient.java | ffdb6af0f16b6dfdd89a0a149e63271c189af3dc | [] | no_license | zhoudagang/wechat | 256ad8801e51eac4c0db86ee72c6a87f9badf1d3 | 222df782da9852bf0a3fa876c742434013c3294d | refs/heads/master | 2020-04-09T18:53:06.831075 | 2018-12-05T14:02:31 | 2018-12-05T14:02:31 | 160,526,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,826 | java | package what.fuck.wechat.util;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import what.fuck.wechat.config.Configuration;
import what.fuck.wechat.exception.WeixinException;
import what.fuck.wechat.pojo.Attachment;
import what.fuck.wechat.pojo.Response;
/**
* HttpClient业务
*
* @author qsyang
* @version 1.0
*/
@SuppressWarnings("serial")
public class HttpClient implements java.io.Serializable {
private static final int OK = 200; // OK: Success!
private static final int ConnectionTimeout = Configuration.getConnectionTimeout();
private static final int ReadTimeout = Configuration.getReadTimeout();
private static final String DEFAULT_CHARSET = "UTF-8";
private static final String _GET = "GET";
private static final String _POST = "POST";
/**
* Get 请求
*
* @param url
* 请求地址
* @return 输出流对象
* @throws WeixinException
*/
public Response get(String url) throws WeixinException {
return httpRequest(url, _GET, null);
}
/**
* 上传文件
*
* @param url
* 上传地址
* @param file
* 上传文件对象
* @return 服务器上传响应结果
* @throws IOException
* @throws NoSuchAlgorithmException
* @throws NoSuchProviderException
* @throws KeyManagementException
*/
public String upload(String url, File file)
throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException {
HttpURLConnection http = null;
StringBuffer bufferRes = new StringBuffer();
try {
// 定义数据分隔线
String BOUNDARY = "----WebKitFormBoundaryiDGnV9zdZA1eM1yL";
// 创建https请求连接
http = getHttpURLConnection(url);
// 设置header和ssl证书
setHttpHeader(http, _POST);
// 不缓存
http.setUseCaches(false);
// 保持连接
http.setRequestProperty("connection", "Keep-Alive");
// 设置文档类型
http.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
// 定义输出流
OutputStream out = null;
// 定义输入流
DataInputStream dataInputStream;
try {
out = new DataOutputStream(http.getOutputStream());
byte[] end_data = ("\r\n--" + BOUNDARY + "--\r\n").getBytes();// 定义最后数据分隔线
StringBuilder sb = new StringBuilder();
sb.append("--");
sb.append(BOUNDARY);
sb.append("\r\n");
sb.append("Content-Disposition: form-data;name=\"media\";filename=\"").append(file.getName())
.append("\"\r\n");
sb.append("Content-Type:application/octet-stream\r\n\r\n");
byte[] data = sb.toString().getBytes();
out.write(data);
// 读取文件流
dataInputStream = new DataInputStream(new FileInputStream(file));
int bytes;
byte[] bufferOut = new byte[1024];
while ((bytes = dataInputStream.read(bufferOut)) != -1) {
out.write(bufferOut, 0, bytes);
}
out.write("\r\n".getBytes()); // 多个文件时,二个文件之间加入这个
dataInputStream.close();
out.write(end_data);
out.flush();
} finally {
if (out != null) {
out.close();
}
}
// 定义BufferedReader输入流来读取URL的响应
InputStream ins = null;
try {
ins = http.getInputStream();
BufferedReader read = new BufferedReader(new InputStreamReader(ins, "UTF-8"));
String valueString;
bufferRes = new StringBuffer();
while ((valueString = read.readLine()) != null) {
bufferRes.append(valueString);
}
} finally {
if (ins != null) {
ins.close();
}
}
} finally {
if (http != null) {
// 关闭连接
http.disconnect();
}
}
return bufferRes.toString();
}
/**
* 下载附件
*
* @param url
* 附件地址
* @return 附件对象
* @throws IOException
*/
public Attachment download(String url) throws IOException {
Attachment att = new Attachment();
URL _url = new URL(url);
HttpURLConnection http = (HttpURLConnection) _url.openConnection();
// 设置头
setHttpHeader(http, "GET");
if (http.getContentType().equalsIgnoreCase("text/plain")) {
// 定义BufferedReader输入流来读取URL的响应
InputStream in = http.getInputStream();
BufferedReader read = new BufferedReader(new InputStreamReader(in, "UTF-8"));
String valueString;
StringBuilder bufferRes = new StringBuilder();
while ((valueString = read.readLine()) != null) {
bufferRes.append(valueString);
}
in.close();
att.setError(bufferRes.toString());
} else if (http.getContentType().contains("application/json")) {
// 定义BufferedReader输入流来读取URL的响应
InputStream in = http.getInputStream();
BufferedReader read = new BufferedReader(new InputStreamReader(in, "UTF-8"));
String valueString;
StringBuilder bufferRes = new StringBuilder();
while ((valueString = read.readLine()) != null) {
bufferRes.append(valueString);
}
in.close();
att.setError(bufferRes.toString());
} else {
BufferedInputStream bis = new BufferedInputStream(http.getInputStream());
String ds = http.getHeaderField("Content-disposition");
String fullName = ds.substring(ds.indexOf("filename=\"") + 10, ds.length() - 1);
String relName = fullName.substring(0, fullName.lastIndexOf("."));
String suffix = fullName.substring(relName.length() + 1);
att.setFullName(fullName);
att.setFileName(relName);
att.setSuffix(suffix);
att.setContentLength(http.getHeaderField("Content-Length"));
att.setContentType(http.getHeaderField("Content-Type"));
att.setFileStream(bis);
}
return att;
}
/**
* 获取http请求连接
*
* @param url
* 连接地址
* @return http连接对象
* @throws IOException
*/
private HttpURLConnection getHttpURLConnection(String url) throws IOException {
URL urlGet = new URL(url);
HttpURLConnection con = (HttpURLConnection) urlGet.openConnection();
return con;
}
/**
* 通过http协议请求url
*
* @param url
* 提交地址
* @param method
* 提交方式
* @param postData
* 提交数据
* @return 响应流
* @throws WeixinException
*/
private Response httpRequest(String url, String method, String postData) throws WeixinException {
Response res = null;
OutputStream output;
HttpURLConnection http;
try {
// 创建https请求连接
http = getHttpURLConnection(url);
// 判断https是否为空,如果为空返回null响应
if (http != null) {
// 设置Header信息
setHttpHeader(http, method);
// 判断是否需要提交数据
if (method.equals(_POST) && null != postData) {
// 讲参数转换为字节提交
byte[] bytes = postData.getBytes(DEFAULT_CHARSET);
// 设置头信息
http.setRequestProperty("Content-Length", Integer.toString(bytes.length));
// 开始连接
http.connect();
// 获取返回信息
output = http.getOutputStream();
output.write(bytes);
output.flush();
output.close();
} else {
// 开始连接
http.connect();
}
// 创建输出对象
res = new Response(http);
// 获取响应代码
if (res.getStatus() == OK) {
return res;
}
}
} catch (IOException ex) {
throw new WeixinException(ex.getMessage(), ex);
}
return res;
}
private void setHttpHeader(HttpURLConnection httpUrlConnection, String method) throws IOException {
// 设置header信息
httpUrlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// 设置User-Agent信息
httpUrlConnection.setRequestProperty("User-Agent",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36");
// 设置可接受信息
httpUrlConnection.setDoOutput(true);
// 设置可输入信息
httpUrlConnection.setDoInput(true);
// 设置请求方式
httpUrlConnection.setRequestMethod(method);
// 设置连接超时时间
if (ConnectionTimeout > 0) {
httpUrlConnection.setConnectTimeout(ConnectionTimeout);
} else {
// 默认10秒超时
httpUrlConnection.setConnectTimeout(10000);
}
// 设置请求超时
if (ReadTimeout > 0) {
httpUrlConnection.setReadTimeout(ReadTimeout);
} else {
// 默认10秒超时
httpUrlConnection.setReadTimeout(10000);
}
// 设置编码
httpUrlConnection.setRequestProperty("Charsert", "UTF-8");
}
}
| [
"15371646664@163.com"
] | 15371646664@163.com |
9b919d78bb335dcee52f717913975388eed4a54c | 905760dba6c1f56bba5c24a6a3f38bd11e6da6c5 | /src/main/java/com/wmenjoy/utils/bytecode/AnnotationDefaultAttribute.java | 3239ef87252ba0d0641ee879861464f18bc82f57 | [] | no_license | wmenjoy/common-util | 801f84464388aa8b13ff1c41d57e9015344dba2c | bf192beace1e69014bcb589e3cc43358c7ba9db6 | refs/heads/master | 2021-01-20T12:21:34.617723 | 2016-12-01T13:10:47 | 2016-12-01T13:10:47 | 33,738,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,894 | java | package com.wmenjoy.utils.bytecode;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class AnnotationDefaultAttribute extends AttributeInfo {
protected AnnotationDefaultAttribute(final ConstantPool cp,
final int attrname, final byte[] attrinfo) {
super(cp, attrname, attrinfo);
// TODO Auto-generated constructor stub
}
/**
* The name of the <code>RuntimeVisibleAnnotations</code> attribute.
*/
public static final String visibleTag = "RuntimeVisibleAnnotations";
/**
* The name of the <code>RuntimeInvisibleAnnotations</code> attribute.
*/
public static final String invisibleTag = "RuntimeInvisibleAnnotations";
/**
* Constructs a <code>Runtime(In)VisibleAnnotations_attribute</code>.
*
* @param cp
* constant pool
* @param attrname
* attribute name (<code>visibleTag</code> or
* <code>invisibleTag</code>).
* @param info
* the contents of this attribute. It does not include
* <code>attribute_name_index</code> or
* <code>attribute_length</code>.
*/
public AnnotationsAttribute(final ConstantPool cp, final String attrname,
final byte[] info) {
super(cp, attrname, info);
}
/**
* Constructs an empty <code>Runtime(In)VisibleAnnotations_attribute</code>.
* A new annotation can be later added to the created attribute by
* <code>setAnnotations()</code>.
*
* @param cp
* constant pool
* @param attrname
* attribute name (<code>visibleTag</code> or
* <code>invisibleTag</code>).
* @see #setAnnotations(Annotation[])
*/
public AnnotationsAttribute(final ConstantPool cp, final String attrname) {
this(cp, attrname, new byte[] { 0, 0 });
}
/**
* @param n
* the attribute name.
*/
AnnotationsAttribute(final ConstantPool cp, final int n,
final DataInputStream in) throws IOException {
super(cp, n, in);
}
/**
* Returns <code>num_annotations</code>.
*/
public int numAnnotations() {
return ByteArray.readU16bit(this.info, 0);
}
/**
* Copies this attribute and returns a new copy.
*/
public AttributeInfo copy(final ConstantPool newCp, final Map classnames) {
final Copier copier = new Copier(this.info, this.ConstantPool, newCp,
classnames);
try {
copier.annotationArray();
return new AnnotationsAttribute(newCp, this.getName(),
copier.close());
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
/**
* Parses the annotations and returns a data structure representing the
* annotation with the specified type. See also
* <code>getAnnotations()</code> as to the returned data structure.
*
* @param type
* the annotation type.
* @return null if the specified annotation type is not included.
* @see #getAnnotations()
*/
public Annotation getAnnotation(final String type) {
final Annotation[] annotations = this.getAnnotations();
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].getTypeName().equals(type)) {
return annotations[i];
}
}
return null;
}
/**
* Adds an annotation. If there is an annotation with the same type, it is
* removed before the new annotation is added.
*
* @param annotation
* the added annotation.
*/
public void addAnnotation(final Annotation annotation) {
final String type = annotation.getTypeName();
final Annotation[] annotations = this.getAnnotations();
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].getTypeName().equals(type)) {
annotations[i] = annotation;
this.setAnnotations(annotations);
return;
}
}
final Annotation[] newlist = new Annotation[annotations.length + 1];
System.arraycopy(annotations, 0, newlist, 0, annotations.length);
newlist[annotations.length] = annotation;
this.setAnnotations(newlist);
}
/**
* Parses the annotations and returns a data structure representing that
* parsed annotations. Note that changes of the node values of the returned
* tree are not reflected on the annotations represented by this object
* unless the tree is copied back to this object by
* <code>setAnnotations()</code>.
*
* @see #setAnnotations(Annotation[])
*/
public Annotation[] getAnnotations() {
try {
return new Parser(this.info, this.ConstantPool).parseAnnotations();
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
/**
* Changes the annotations represented by this object according to the given
* array of <code>Annotation</code> objects.
*
* @param annotations
* the data structure representing the new annotations.
*/
public void setAnnotations(final Annotation[] annotations) {
final ByteArrayOutputStream output = new ByteArrayOutputStream();
final AnnotationsWriter writer = new AnnotationsWriter(output,
this.ConstantPool);
try {
final int n = annotations.length;
writer.numAnnotations(n);
for (int i = 0; i < n; ++i) {
annotations[i].write(writer);
}
writer.close();
} catch (final IOException e) {
throw new RuntimeException(e); // should never reach here.
}
this.set(output.toByteArray());
}
/**
* Changes the annotations. A call to this method is equivalent to:
* <ul>
*
* <pre>
* setAnnotations(new Annotation[] { annotation })
* </pre>
*
* </ul>
*
* @param annotation
* the data structure representing the new annotation.
*/
public void setAnnotation(final Annotation annotation) {
this.setAnnotations(new Annotation[] { annotation });
}
/**
* @param oldname
* a JVM class name.
* @param newname
* a JVM class name.
*/
@Override
void renameClass(final String oldname, final String newname) {
final HashMap map = new HashMap();
map.put(oldname, newname);
this.renameClass(map);
}
@Override
void renameClass(final Map classnames) {
final Renamer renamer = new Renamer(this.info, this.getConstantPool(),
classnames);
try {
renamer.annotationArray();
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
@Override
void getRefClasses(final Map classnames) {
this.renameClass(classnames);
}
/**
* Returns a string representation of this object.
*/
@Override
public String toString() {
final Annotation[] a = this.getAnnotations();
final StringBuilder sbuf = new StringBuilder();
int i = 0;
while (i < a.length) {
sbuf.append(a[i++].toString());
if (i != a.length) {
sbuf.append(", ");
}
}
return sbuf.toString();
}
static class Walker {
byte[] info;
Walker(final byte[] attrInfo) {
this.info = attrInfo;
}
final void parameters() throws Exception {
final int numParam = this.info[0] & 0xff;
this.parameters(numParam, 1);
}
void parameters(final int numParam, int pos) throws Exception {
for (int i = 0; i < numParam; ++i) {
pos = this.annotationArray(pos);
}
}
final void annotationArray() throws Exception {
this.annotationArray(0);
}
final int annotationArray(final int pos) throws Exception {
final int num = ByteArray.readU16bit(this.info, pos);
return this.annotationArray(pos + 2, num);
}
int annotationArray(int pos, final int num) throws Exception {
for (int i = 0; i < num; ++i) {
pos = this.annotation(pos);
}
return pos;
}
final int annotation(final int pos) throws Exception {
final int type = ByteArray.readU16bit(this.info, pos);
final int numPairs = ByteArray.readU16bit(this.info, pos + 2);
return this.annotation(pos + 4, type, numPairs);
}
int annotation(int pos, final int type, final int numPairs)
throws Exception {
for (int j = 0; j < numPairs; ++j) {
pos = this.memberValuePair(pos);
}
return pos;
}
final int memberValuePair(final int pos) throws Exception {
final int nameIndex = ByteArray.readU16bit(this.info, pos);
return this.memberValuePair(pos + 2, nameIndex);
}
int memberValuePair(final int pos, final int nameIndex)
throws Exception {
return this.memberValue(pos);
}
final int memberValue(final int pos) throws Exception {
final int tag = this.info[pos] & 0xff;
if (tag == 'e') {
final int typeNameIndex = ByteArray.readU16bit(this.info,
pos + 1);
final int constNameIndex = ByteArray.readU16bit(this.info,
pos + 3);
this.enumMemberValue(pos, typeNameIndex, constNameIndex);
return pos + 5;
} else if (tag == 'c') {
final int index = ByteArray.readU16bit(this.info, pos + 1);
this.classMemberValue(pos, index);
return pos + 3;
} else if (tag == '@') {
return this.annotationMemberValue(pos + 1);
} else if (tag == '[') {
final int num = ByteArray.readU16bit(this.info, pos + 1);
return this.arrayMemberValue(pos + 3, num);
} else { // primitive types or String.
final int index = ByteArray.readU16bit(this.info, pos + 1);
this.constValueMember(tag, index);
return pos + 3;
}
}
void constValueMember(final int tag, final int index) throws Exception {
}
void enumMemberValue(final int pos, final int typeNameIndex,
final int constNameIndex) throws Exception {
}
void classMemberValue(final int pos, final int index) throws Exception {
}
int annotationMemberValue(final int pos) throws Exception {
return this.annotation(pos);
}
int arrayMemberValue(int pos, final int num) throws Exception {
for (int i = 0; i < num; ++i) {
pos = this.memberValue(pos);
}
return pos;
}
}
static class Renamer extends Walker {
ConstantPool cpool;
Map classnames;
/**
* Constructs a renamer. It renames some class names into the new names
* specified by <code>map</code>.
*
* @param info
* the annotations attribute.
* @param cp
* the constant pool.
* @param map
* pairs of replaced and substituted class names. It can be
* null.
*/
Renamer(final byte[] info, final ConstantPool cp, final Map map) {
super(info);
this.cpool = cp;
this.classnames = map;
}
@Override
int annotation(final int pos, final int type, final int numPairs)
throws Exception {
this.renameType(pos - 4, type);
return super.annotation(pos, type, numPairs);
}
@Override
void enumMemberValue(final int pos, final int typeNameIndex,
final int constNameIndex) throws Exception {
this.renameType(pos + 1, typeNameIndex);
super.enumMemberValue(pos, typeNameIndex, constNameIndex);
}
@Override
void classMemberValue(final int pos, final int index) throws Exception {
this.renameType(pos + 1, index);
super.classMemberValue(pos, index);
}
private void renameType(final int pos, final int index) {
final String name = this.cpool.getUtf8Info(index);
final String newName = Descriptor.rename(name, this.classnames);
if (!name.equals(newName)) {
final int index2 = this.cpool.addUtf8Info(newName);
ByteArray.write16bit(index2, this.info, pos);
}
}
}
static class Copier extends Walker {
ByteArrayOutputStream output;
AnnotationsWriter writer;
ConstantPool srcPool, destPool;
Map classnames;
/**
* Constructs a copier. This copier renames some class names into the
* new names specified by <code>map</code> when it copies an annotation
* attribute.
*
* @param info
* the source attribute.
* @param src
* the constant pool of the source class.
* @param dest
* the constant pool of the destination class.
* @param map
* pairs of replaced and substituted class names. It can be
* null.
*/
Copier(final byte[] info, final ConstantPool src,
final ConstantPool dest, final Map map) {
super(info);
this.output = new ByteArrayOutputStream();
this.writer = new AnnotationsWriter(this.output, dest);
this.srcPool = src;
this.destPool = dest;
this.classnames = map;
}
byte[] close() throws IOException {
this.writer.close();
return this.output.toByteArray();
}
@Override
void parameters(final int numParam, final int pos) throws Exception {
this.writer.numParameters(numParam);
super.parameters(numParam, pos);
}
@Override
int annotationArray(final int pos, final int num) throws Exception {
this.writer.numAnnotations(num);
return super.annotationArray(pos, num);
}
@Override
int annotation(final int pos, final int type, final int numPairs)
throws Exception {
this.writer.annotation(this.copyType(type), numPairs);
return super.annotation(pos, type, numPairs);
}
@Override
int memberValuePair(final int pos, final int nameIndex)
throws Exception {
this.writer.memberValuePair(this.copy(nameIndex));
return super.memberValuePair(pos, nameIndex);
}
@Override
void constValueMember(final int tag, final int index) throws Exception {
this.writer.constValueIndex(tag, this.copy(index));
super.constValueMember(tag, index);
}
@Override
void enumMemberValue(final int pos, final int typeNameIndex,
final int constNameIndex) throws Exception {
this.writer.enumConstValue(this.copyType(typeNameIndex),
this.copy(constNameIndex));
super.enumMemberValue(pos, typeNameIndex, constNameIndex);
}
@Override
void classMemberValue(final int pos, final int index) throws Exception {
this.writer.classInfoIndex(this.copyType(index));
super.classMemberValue(pos, index);
}
@Override
int annotationMemberValue(final int pos) throws Exception {
this.writer.annotationValue();
return super.annotationMemberValue(pos);
}
@Override
int arrayMemberValue(final int pos, final int num) throws Exception {
this.writer.arrayValue(num);
return super.arrayMemberValue(pos, num);
}
/**
* Copies a constant pool entry into the destination constant pool and
* returns the index of the copied entry.
*
* @param srcIndex
* the index of the copied entry into the source constant
* pool.
* @return the index of the copied item into the destination constant
* pool.
*/
int copy(final int srcIndex) {
return this.srcPool.copy(srcIndex, this.destPool, this.classnames);
}
/**
* Copies a constant pool entry into the destination constant pool and
* returns the index of the copied entry. That entry must be a Utf8Info
* representing a class name in the L<class name>; form.
*
* @param srcIndex
* the index of the copied entry into the source constant
* pool.
* @return the index of the copied item into the destination constant
* pool.
*/
int copyType(final int srcIndex) {
final String name = this.srcPool.getUtf8Info(srcIndex);
final String newName = Descriptor.rename(name, this.classnames);
return this.destPool.addUtf8Info(newName);
}
}
static class Parser extends Walker {
ConstantPool pool;
Annotation[][] allParams; // all parameters
Annotation[] allAnno; // all annotations
Annotation currentAnno; // current annotation
MemberValue currentMember; // current member
/**
* Constructs a parser. This parser constructs a parse tree of the
* annotations.
*
* @param info
* the attribute.
* @param src
* the constant pool.
*/
Parser(final byte[] info, final ConstantPool cp) {
super(info);
this.pool = cp;
}
Annotation[][] parseParameters() throws Exception {
this.parameters();
return this.allParams;
}
Annotation[] parseAnnotations() throws Exception {
this.annotationArray();
return this.allAnno;
}
MemberValue parseMemberValue() throws Exception {
this.memberValue(0);
return this.currentMember;
}
@Override
void parameters(final int numParam, int pos) throws Exception {
final Annotation[][] params = new Annotation[numParam][];
for (int i = 0; i < numParam; ++i) {
pos = this.annotationArray(pos);
params[i] = this.allAnno;
}
this.allParams = params;
}
@Override
int annotationArray(int pos, final int num) throws Exception {
final Annotation[] array = new Annotation[num];
for (int i = 0; i < num; ++i) {
pos = this.annotation(pos);
array[i] = this.currentAnno;
}
this.allAnno = array;
return pos;
}
@Override
int annotation(final int pos, final int type, final int numPairs)
throws Exception {
this.currentAnno = new Annotation(type, this.pool);
return super.annotation(pos, type, numPairs);
}
@Override
int memberValuePair(int pos, final int nameIndex) throws Exception {
pos = super.memberValuePair(pos, nameIndex);
this.currentAnno.addMemberValue(nameIndex, this.currentMember);
return pos;
}
@Override
void constValueMember(final int tag, final int index) throws Exception {
MemberValue m;
final ConstantPool cp = this.pool;
switch (tag) {
case 'B':
m = new ByteMemberValue(index, cp);
break;
case 'C':
m = new CharMemberValue(index, cp);
break;
case 'D':
m = new DoubleMemberValue(index, cp);
break;
case 'F':
m = new FloatMemberValue(index, cp);
break;
case 'I':
m = new IntegerMemberValue(index, cp);
break;
case 'J':
m = new LongMemberValue(index, cp);
break;
case 'S':
m = new ShortMemberValue(index, cp);
break;
case 'Z':
m = new BooleanMemberValue(index, cp);
break;
case 's':
m = new StringMemberValue(index, cp);
break;
default:
throw new RuntimeException("unknown tag:" + tag);
}
this.currentMember = m;
super.constValueMember(tag, index);
}
@Override
void enumMemberValue(final int pos, final int typeNameIndex,
final int constNameIndex) throws Exception {
this.currentMember = new EnumMemberValue(typeNameIndex,
constNameIndex, this.pool);
super.enumMemberValue(pos, typeNameIndex, constNameIndex);
}
@Override
void classMemberValue(final int pos, final int index) throws Exception {
this.currentMember = new ClassMemberValue(index, this.pool);
super.classMemberValue(pos, index);
}
@Override
int annotationMemberValue(int pos) throws Exception {
final Annotation anno = this.currentAnno;
pos = super.annotationMemberValue(pos);
this.currentMember = new AnnotationMemberValue(this.currentAnno,
this.pool);
this.currentAnno = anno;
return pos;
}
@Override
int arrayMemberValue(int pos, final int num) throws Exception {
final ArrayMemberValue amv = new ArrayMemberValue(this.pool);
final MemberValue[] elements = new MemberValue[num];
for (int i = 0; i < num; ++i) {
pos = this.memberValue(pos);
elements[i] = this.currentMember;
}
amv.setValue(elements);
this.currentMember = amv;
return pos;
}
}
}
| [
"liujinliang12345@126.com"
] | liujinliang12345@126.com |
96824a21cf8f24c5e4f87a4c85aeeb4b5a64018e | 8ab0b3dfbc49021228ec4b9967651e400a2d840a | /app/src/androidTest/java/com/study/android/coolweateher/ExampleInstrumentedTest.java | 22cf8ab02223499cc9b6188be5552b5e00c1f114 | [] | no_license | StrategistK/Weather | b3919ddb5d5f90d5d409841e6f0041a679640901 | 64d8c904de68498a30331db9f9fe275867538a8f | refs/heads/master | 2020-01-23T21:52:48.352858 | 2016-11-25T07:32:23 | 2016-11-25T07:32:23 | 74,735,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.study.android.coolweateher;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.study.android.coolweateher", appContext.getPackageName());
}
}
| [
"815034557@qq.com"
] | 815034557@qq.com |
99db4729403b82228a191c22dc2461db1505f2a3 | 02147f88028a8d04d2ad073e6db46ca3bb99623d | /src/keywords/Computer.java | bcbb2212ba6e9c09faaaea5bf998c2a86ae362c6 | [] | no_license | PeopleNTechJavaSelenium/July2019JavaDay7 | c5296f4be55550f8fbfbbdd38cf5c11d71d06a0b | 1cc39c85a4553e588f3b73ee0be7aaf5e330090b | refs/heads/master | 2020-07-10T08:09:58.332917 | 2019-08-24T21:20:15 | 2019-08-24T21:20:15 | 204,214,105 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package keywords;
public class Computer {
int ramSize;
final int cpu = 3;
public Computer(){}
public Computer(int ramSize){
this.ramSize = ramSize;
}
public void assembleComputer(){
System.out.println("Computer was assembled in USA");
}
public void assembleMonitor(){
System.out.println("Computer Monitor is Retina Screen");
}
}
| [
"matiur@matiurs-MacBook-Air.local"
] | matiur@matiurs-MacBook-Air.local |
1b451be59a1d5ae62fb17b78f05090d8b5f01966 | ae6176a9d4c40034d2eba14111ccd46a3fbc3d85 | /src/main/java/com/dh/DpsdkCore/javafile/Ptz_Sit_Info_t.java | 10cec66ebe0715537ac1c6de0ea5973e2230f14d | [] | no_license | nodie/dahua | 3f3d2c2f816a70e5a2386b64e4b960d0cb6d9c42 | 7256c18079dbc0969fe1f6fa5f9e0a29cbc34e5f | refs/heads/master | 2020-04-09T11:21:06.901047 | 2018-12-04T06:01:38 | 2018-12-04T06:01:38 | 160,306,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package com.dh.DpsdkCore.javafile;
/** 云台三维定位操作信息
@param szCameraId 通道ID
@param pointX 坐标值X
@param pointY 坐标值Y
@param pointZ 坐标值Z
*/
public class Ptz_Sit_Info_t
{
public byte[] szCameraId = new byte[dpsdk_constant_value.DPSDK_CORE_CHL_ID_LEN]; // 通道ID
public int pointX; // 坐标值X
public int pointY; // 坐标值Y
public int pointZ; // 坐标值Z
} | [
"landiyu@gmail.com"
] | landiyu@gmail.com |
13cd2058342ad39fe4e9f1442d76e1553ed871cb | bd24a8bfff71437e78e2d05fc6dead86f4edd819 | /20171013_static/src/min/edu/lab4/AllMethodClass.java | 4f5ad370a95f54051c51c207300a946165463841 | [] | no_license | JungYOsup/java_standard | 50b6ffe296849034299913b43b9af72b66f0fd2c | 75dd746baa1182c6931c56c22750212321204c11 | refs/heads/master | 2022-12-29T11:02:58.574835 | 2020-10-13T02:49:53 | 2020-10-13T02:49:53 | 303,567,699 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package min.edu.lab4;
public class AllMethodClass {
public void nonstaticMethod() {
}
public static void staticMethod() {
}
}
| [
"yosup1004@gmail.com"
] | yosup1004@gmail.com |
86dba2b14440ee5626d292796b4967db08ba126b | a4574fa6a6d887f77dabb2e61b41c604729f8e8d | /Java/DocuSignSample/src/net/docusign/api/_3/BrandDeleteRequest.java | 4f823d7ac166fab9d6e3379753b10f0de8ee5499 | [] | no_license | gauravs23/DocuSign-eSignature-SDK | bc0c66c08e821c34bc8c7185db5914b29e6f70df | 53aad9240b7e8ac3a2bf4cee63b9e6686b0e3563 | refs/heads/master | 2021-01-09T06:03:42.474803 | 2013-07-29T12:29:26 | 2013-07-29T12:29:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,644 | java |
package net.docusign.api._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for BrandDeleteRequest complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="BrandDeleteRequest">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="BrandRequestItems" type="{http://www.docusign.net/API/3.0}ArrayOfBrandRequestItem" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BrandDeleteRequest", propOrder = {
"brandRequestItems"
})
public class BrandDeleteRequest {
@XmlElement(name = "BrandRequestItems")
protected ArrayOfBrandRequestItem brandRequestItems;
/**
* Gets the value of the brandRequestItems property.
*
* @return
* possible object is
* {@link ArrayOfBrandRequestItem }
*
*/
public ArrayOfBrandRequestItem getBrandRequestItems() {
return brandRequestItems;
}
/**
* Sets the value of the brandRequestItems property.
*
* @param value
* allowed object is
* {@link ArrayOfBrandRequestItem }
*
*/
public void setBrandRequestItems(ArrayOfBrandRequestItem value) {
this.brandRequestItems = value;
}
}
| [
"gauravs23@ymail.com"
] | gauravs23@ymail.com |
4aabb81834c73c47cd4d61bf2edd83d4e1655ff2 | 5d24c60d0825c59ea634c562e41e9ca7545e41af | /src/main/java/com/qianmi/admin/common/util/RedisLock.java | 42045a71e6f1fec955a21bdbde348ce57609ccb2 | [] | no_license | jianghong-pc/admin-main | ab3d05a375b29910179e4f8875f5bd75a67b4a1f | 048979c82620de5f3d9a5fb68cc2bbf003f2f1c9 | refs/heads/master | 2021-06-20T19:04:20.364073 | 2017-08-11T02:01:14 | 2017-08-11T02:01:14 | 99,774,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,247 | java | package com.qianmi.admin.common.util;
import com.qianmi.admin.common.exception.AdminRuntimeException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.TimeUnit;
/**
* <p>redis实现分布式锁
* 如:RedisLock lock = new RedisLock();
* lock.lock()
* try {
* //do something
* } catch(Exception e) {
* //progress exception
* lock.unlock();//解锁
* }
* </p>
* <p>缺点:单节点redis服务器依赖过大,一旦挂了将无法获取锁</p>
*
*/
public class RedisLock {
private static final Logger logger = LoggerFactory.getLogger(RedisLock.class);
private static final String KEY_PREFFIX = "redislock.";
private RedisUtil redisClient;
private String lockKey;
private long timeoutmills;
public RedisLock(RedisUtil redisClient, String lockKey, long timeoutmills) {
this.redisClient = redisClient;
this.lockKey = KEY_PREFFIX + lockKey;
this.timeoutmills = timeoutmills;
}
private boolean acquirelock() {
try {
String locktime = String.valueOf(System.currentTimeMillis() + timeoutmills + 1);
if (redisClient.setIfNotExists(lockKey, locktime)) {
return true;
}
if (System.currentTimeMillis() > Long.valueOf(redisClient.get(lockKey))
&& System.currentTimeMillis() > Long.valueOf(redisClient.getAndSet(lockKey,
locktime))) {
return true;
}
return false;
} catch (Exception e) {
e.printStackTrace();
logger.error("redis lock error : key={},e={}",lockKey,e.getMessage());
}
return false;
}
public boolean tryLock(){
return acquirelock();
}
public boolean tryLock(long time, TimeUnit timeUnit){
long lasttime = System.currentTimeMillis();
long timeout = timeUnit.toMillis(time);
while (!acquirelock() && (timeout > 0)){
if(timeout <= 0){
return false;
}
long now = System.currentTimeMillis();
timeout -= now - lasttime;
lasttime = now;
try{
Thread.sleep(timeout-1);
}catch (InterruptedException e){
e.printStackTrace();
}
}
return true;
}
public boolean isLock(){
try {
//获取值
String last = redisClient.get(lockKey);
long lastValue = 0;
if (StringUtils.isNotBlank(last)) {
lastValue = Long.valueOf(last);
long current = System.currentTimeMillis();
//是否超时
if (current > lastValue) {
return false;
}
} else {
return false;
}
} catch (AdminRuntimeException e) {
e.printStackTrace();
}
return true;
}
public boolean unlock(){
try {
redisClient.del(lockKey);
return true;
} catch (AdminRuntimeException e) {
e.printStackTrace();
}
return false;
}
}
| [
"jianghong@qianmi.com"
] | jianghong@qianmi.com |
4a925827645345f61c421cdb54ac20c22a531512 | 43e9cf145b53ad3eb0a728b0e38baaf29645d71b | /src/main/java/com/szczudlinski/dawid/calculation/calculation/config/SwaggerConfig.java | ce052ca032ac6170fd607972e2d1f868a8a0f59d | [] | no_license | dszczudlinski/Calculation | 6795b15f1c6628a75e195951c516d4d79e7d0e2a | 2b1425fa4abe8ccc27c95a70edbe27d316a23fc5 | refs/heads/master | 2020-03-19T16:05:24.310548 | 2018-07-21T09:18:58 | 2018-07-21T09:18:58 | 136,699,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,389 | java | package com.szczudlinski.dawid.calculation.calculation.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.Collections;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.szczudlinski.dawid.calculation.calculation.rest"))
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo());
}
private ApiInfo apiInfo() {
return new ApiInfo(
"\"CALCULATION :: REST API\"",
"Dokumentacja interfejsu RESTful'owego microserwisu Calculation",
"0.1",
"Terms of service",
new Contact("Dawid Szczudliński", "", ""),
"License of API", "", Collections.emptyList());
}
} | [
"dszczudlinski@bluesoft.net.pl"
] | dszczudlinski@bluesoft.net.pl |
48fc62526ef6fa8e37f2ee3818454a1937d6af39 | 5809a664c21f4bc38a76f7f5c0bb334799a50e97 | /src/main/java/com/roger/dao/impl/CrudDaoImpl.java | 0c69e3d1828a99866e8ac60ccced4583bd77ed3b | [] | no_license | LiHongTai/base-spring-mybatis | 223fc02f569d3a73b47ed674961b06ee10a10e44 | 4642e1261cf4b0abdb4fedba5a1b1c2dd531ef6c | refs/heads/master | 2020-03-29T11:54:25.476771 | 2018-11-20T05:37:23 | 2018-11-20T05:37:23 | 149,876,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,971 | java | package com.roger.dao.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.roger.constant.OgnlParamConstant;
import com.roger.dao.CrudDao;
import com.roger.db.GeneralOgnlParam;
import com.roger.db.SqlColumn;
import com.roger.db.SqlColumnFactory;
import com.roger.mapper.GeneralMapper;
import com.roger.utils.GeneralMapperReflectUtil;
import com.roger.utils.PersistentUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class CrudDaoImpl implements CrudDao {
@Autowired
protected GeneralMapper generalMapper;
@Override
public <T> T selectByPrimaryKey(Class<T> clazz, Map<String, Object> paramMap) {
String tableName = PersistentUtil.getTableName(clazz);
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
Map<String, Object> resultMap = generalMapper.selectByPrimaryKey(paramMap);
if (CollectionUtils.isEmpty(resultMap)) {
return null;
}
JSONObject resultJSONObject = JSON.parseObject(JSON.toJSONString(resultMap));
return JSONObject.toJavaObject(resultJSONObject, clazz);
}
@Override
public <T> List<T> selectAdvanced(Class<T> clazz, GeneralOgnlParam generalOgnlParam) {
List<T> resultList = new ArrayList<>();
List<String> columnNameList = GeneralMapperReflectUtil.getAllColumnNames(clazz);
generalOgnlParam.setQueryCoulmn(columnNameList);
List<Map<String, Object>> resultMapList = this.selectAdvancedByColumn(clazz, generalOgnlParam);
for (Map<String, Object> resultMap : resultMapList) {
T target = GeneralMapperReflectUtil.parseToJavaBean(resultMap, clazz);
if (target != null) {
resultList.add(target);
}
}
return resultList;
}
private <T> List<Map<String, Object>> selectAdvancedByColumn(Class<T> clazz, GeneralOgnlParam generalOgnlParam) {
String tableName = PersistentUtil.getTableName(clazz);
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
paramMap.put(OgnlParamConstant.DML_COLUMN_NAME_LIST, generalOgnlParam.getQueryCoulmn());
paramMap.put(OgnlParamConstant.WHERE_CONDITION_EXP, generalOgnlParam.getConditionExp());
paramMap.put(OgnlParamConstant.WHERE_CONDITION_PARAM, generalOgnlParam.getConditionParam());
paramMap.put(OgnlParamConstant.ORDER_BY_EXP, generalOgnlParam.getOrderExp());
if (generalOgnlParam.isEnablePage()) {
Map<String, Object> pageMap = new HashMap<>();
int startRowNo = (generalOgnlParam.getPageNo() - 1) * generalOgnlParam.getPageSize();
pageMap.put(OgnlParamConstant.START_ROW_NO, startRowNo);
pageMap.put(OgnlParamConstant.PAGE_SIZE, generalOgnlParam.getPageSize());
paramMap.put(OgnlParamConstant.PAGE, pageMap);
}
return generalMapper.selectAdvanced(paramMap);
}
@Override
public <T> int insert(T target) {
if (target == null) {
return 0;
}
String tableName = PersistentUtil.getTableName(target.getClass());
Map<String, Object> paramMap = new HashMap<>();
List<SqlColumn> sqlColumnList = new ArrayList<>();
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
paramMap.put(OgnlParamConstant.SQL_COLUMN_LIST, sqlColumnList);
constrSqlColumnList(sqlColumnList, target);
return this.insert(paramMap);
}
@Override
public int insert(Map<String, Object> paramMap) {
return generalMapper.insert(paramMap);
}
@Override
public <T> int batchInsert(List<T> targetList) {
if (CollectionUtils.isEmpty(targetList)) {
return 0;
}
T target = targetList.get(0);
String tableName = PersistentUtil.getTableName(target.getClass());
Map<String, Object> paramMap = new HashMap<>();
//插入的表名
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
List<String> columnNameList = GeneralMapperReflectUtil.getAllColumnNames(target.getClass());
//插入的字段
paramMap.put(OgnlParamConstant.DML_COLUMN_NAME_LIST, columnNameList);
List<List<SqlColumn>> dataList = new ArrayList<>();
//插入的数据
paramMap.put(OgnlParamConstant.BATCH_DATA_LIST, dataList);
for (T t : targetList) {
List<SqlColumn> sqlColumnList = new ArrayList<>();
dataList.add(sqlColumnList);
constrSqlColumnList(sqlColumnList, t);
}
return generalMapper.batchInsert(paramMap);
}
private <T> void constrSqlColumnList(List<SqlColumn> sqlColumnList, T target) {
if (sqlColumnList == null) {
sqlColumnList = new ArrayList<>();
}
List<Field> fieldList = PersistentUtil.getPersistentFields(target.getClass());
for (Field field : fieldList) {
SqlColumn sqlColumn = SqlColumnFactory.createSqlColumn(target, field);
sqlColumnList.add(sqlColumn);
}
}
@Override
public <T> int update(T target, GeneralOgnlParam generalOgnlParam) {
if (target == null) {
return 0;
}
String tableName = PersistentUtil.getTableName(target.getClass());
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
paramMap.put(OgnlParamConstant.WHERE_CONDITION_EXP, generalOgnlParam.getConditionExp());
paramMap.put(OgnlParamConstant.WHERE_CONDITION_PARAM, generalOgnlParam.getConditionParam());
List<SqlColumn> sqlColumnList = new ArrayList<>();
paramMap.put(OgnlParamConstant.SQL_COLUMN_LIST, sqlColumnList);
constrSqlColumnList(sqlColumnList, target);
return generalMapper.update(paramMap);
}
@Override
public <T> int deleteByPrimaryKey(Class<T> clazz, Map<String, Object> paramMap) {
String tableName = PersistentUtil.getTableName(clazz);
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
return generalMapper.deleteByPrimaryKey(paramMap);
}
@Override
public <T> int deleteAdvanced(Class<T> clazz, GeneralOgnlParam generalOgnlParam) {
String tableName = PersistentUtil.getTableName(clazz);
Map<String,Object> paramMap = new HashMap<>();
paramMap.put(OgnlParamConstant.TABLE_NAME, tableName);
paramMap.put(OgnlParamConstant.WHERE_CONDITION_EXP,generalOgnlParam.getConditionExp());
paramMap.put(OgnlParamConstant.WHERE_CONDITION_PARAM,generalOgnlParam.getConditionParam());
return generalMapper.deleteAdvanced(paramMap);
}
}
| [
"631396529@qq.com"
] | 631396529@qq.com |
a2f43b5dff87eb57369b9a2451257491ee1b8c55 | af88facfe12f61c317dfa2b8aa8811b3df896036 | /src/yow2013/immutable/SimpleEventHandler.java | 1c2dfe9f434c9a7dbda6f8b5004c82b17fb325da | [
"Unlicense"
] | permissive | yuchen99/yow2013 | 165ef12510e8e517cbce691a4f68e68221b60981 | cb74a4f76cd6e82048d3cb7d34fa86ac3e263af6 | refs/heads/master | 2021-01-18T12:19:58.877744 | 2013-12-01T23:53:29 | 2013-12-01T23:53:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 252 | java | package yow2013.immutable;
import com.lmax.disruptor.EventHandler;
public class SimpleEventHandler implements EventHandler<SimpleEvent>
{
@Override
public void onEvent(SimpleEvent arg0, long arg1, boolean arg2) throws Exception
{
}
}
| [
"mikeb01@gmail.com"
] | mikeb01@gmail.com |
4f2697db20174f2c6285d9af8f969f2bbdbe1c5c | d1a3d2991995c11c216ab68b905c0e4c1f1a8bef | /src/gui/AddShieldDialog.java | 900e81fd3fec1d3508e0c8250020612fb5889c65 | [] | no_license | ObDivanKenobi/Java-lab2 | e6ffc956ccb2d7f3f1b88578cb2d3e83ba886392 | 4c5872609383a45f6514ab01d29c34b68d26f0b5 | refs/heads/master | 2021-01-25T04:21:45.999174 | 2017-06-22T22:32:52 | 2017-06-22T22:32:52 | 93,430,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,675 | java | package gui;
import javax.swing.*;
import java.awt.event.*;
import classes.DataModels.Goods;
import classes.DataModels.GoodsTypes;
import classes.DataModels.Shield;
public class AddShieldDialog extends JDialog {
private JPanel contentPane;
private JButton buttonOK;
private JButton buttonCancel;
private JTextField textFieldPrice;
private JTextField textFieldName;
private JTextField textFieldShape;
private JTextField textFieldMaterial;
private JTextArea textAreaDescription;
private Shield item;
private int result;
private boolean isNewItem;
public AddShieldDialog() {
isNewItem = true;
setUI();
}
public AddShieldDialog(Shield item) {
setUI();
isNewItem = false;
textFieldName.setText(item.getName());
textFieldPrice.setText(String.format("%d", item.getPrice()));
textFieldShape.setText(item.getShape());
textFieldMaterial.setText(item.getShape());
textAreaDescription.setText(item.getDescription());
}
private void setUI() {
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);
buttonOK.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onOK();
}
});
buttonCancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onCancel();
}
});
// call onCancel() when cross is clicked
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
onCancel();
}
});
// call onCancel() on ESCAPE
contentPane.registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onCancel();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
}
private void onOK() {
if (Validate()) {
result = JOptionPane.OK_OPTION;
this.dispose();
}
else {
JOptionPane.showMessageDialog(null, "Проверьте корректность введённых данных!");
}
}
private void onCancel() {
result = JOptionPane.CANCEL_OPTION;
this.dispose();
}
private boolean Validate() {
int price;
String name, shape, material, description;
try {
name = textFieldName.getText();
price = Integer.parseInt(textFieldPrice.getText());
shape = textFieldShape.getText();
material = textFieldMaterial.getText();
description = textAreaDescription.getText();
if (name == "" || shape == "" || material == "" || description.isEmpty()) throw new IllegalArgumentException();
if (isNewItem)
item = new Shield(Goods.getMaxIdAndInc(), name, price, GoodsTypes.Shield, shape, material, description);
else {
item.setShape(shape);
item.setMaterial(material);
item.setName(name);
item.setDescription(description);
item.setPrice(price);
}
return true;
}
catch (NumberFormatException e) {
return false;
}
}
public Shield getItem() {
return item;
}
public int showDialog() {
pack();
setVisible(true);
return result;
}
}
| [
"ilia.manshin@yandex.ru"
] | ilia.manshin@yandex.ru |
5039a6f09e84eec57557018e79bf051b43b0f893 | 9c2b23a2d6da1e762400ae963c1f787c3121eb89 | /core/com.hundsun.ares.studio.jres.metadata.ui/src/com/hundsun/ares/studio/jres/metadata/ui/actions/JumpAction.java | c9aef296be6dd7fced540eef4d995d2f63e2fd5d | [
"MIT"
] | permissive | zhuyf03516/ares-studio | 5d67757283a52e51100666c9ce35227a63656f0e | 5648b0f606cb061d06c39ac25b7b206f3307882f | refs/heads/master | 2021-01-11T11:31:51.436304 | 2016-08-11T10:56:31 | 2016-08-11T10:56:31 | 65,444,199 | 0 | 0 | null | 2016-08-11T06:24:33 | 2016-08-11T06:24:32 | null | GB18030 | Java | false | false | 2,927 | java | /**
* 源程序名称:JumpAction.java
* 软件著作权:恒生电子股份有限公司 版权所有
* 系统名称:JRES Studio
* 模块名称:com.hundsun.ares.studio.jres.metadata.ui
* 功能说明:元数据用户编辑和UI展现相关功能
* 相关文档:
* 作者:
*/
package com.hundsun.ares.studio.jres.metadata.ui.actions;
import java.util.Collections;
import java.util.List;
import org.apache.log4j.Logger;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import com.hundsun.ares.studio.core.builder.IAresMarkers;
import com.hundsun.ares.studio.jres.metadata.ui.model.MetadataOverviewElement;
import com.hundsun.ares.studio.ui.editor.actions.IUpdateAction;
/**
* 总览页面的条目模型是<code> MetadataOverviewElement</code>
* @author wangxh
*
*
*/
public class JumpAction extends Action implements IUpdateAction{
private Logger logger = Logger.getLogger(getClass());
private ColumnViewer viewer;
public JumpAction(ColumnViewer viewer) {
super("跳转至定义");
this.viewer = viewer;
setId(IMetadataActionIDConstant.CV_JUMP);
}
/**
* @return the viewer
*/
public ColumnViewer getViewer() {
return viewer;
}
/**
* 不会返回null
* @return
*/
protected List<Object> getSelectedObjects() {
ISelection selection = getViewer().getSelection();
if (selection != null && selection instanceof IStructuredSelection) {
return ((IStructuredSelection) selection).toList();
}
return Collections.EMPTY_LIST;
}
@Override
public void run() {
List<Object> objects = getSelectedObjects();
if (objects.size() > 0 ) {
MetadataOverviewElement element = (MetadataOverviewElement) objects.get(0);
if (element!=null && element.getItem() != null && element.getResource() != null) {
try {
IMarker marker = element.getResource().getResource().createMarker(IAresMarkers.BOOK_MARKER_ID);
marker.setAttribute(IMarker.LOCATION, element.getItem().eResource().getURIFragment(element.getItem()));
String editorId = IDE.getEditorDescriptor(element.getResource().getElementName()).getId();
marker.setAttribute(IDE.EDITOR_ID_ATTR, editorId);
IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), marker);
marker.delete();
} catch (PartInitException e) {
logger.error(e.getMessage(), e);
} catch (CoreException e) {
logger.error(e.getMessage(), e);
}
} else {
logger.info("元数据条目为空或者资源为空");
}
}
}
@Override
public void update() {
setEnabled(getSelectedObjects().size()==1);
}
}
| [
"zhuyf@hundsun.com"
] | zhuyf@hundsun.com |
18e80afa3735ecbb4ea0390626b5312dce373da4 | 6e2d69560e77a30452d2b993a8b34a7b4f85e1bf | /src/nestedclass/VideoGames.java | aa13889cc0bea377a58954b31d67f8d8742a513a | [] | no_license | MuneebTahir92/2021Feb-HW6 | 3a7c948782985889da128c3c599610190be7f54f | 9b0431c513f3bd7e5dc83bb954d7eeb1c3fd77a1 | refs/heads/master | 2023-03-11T22:25:12.215354 | 2021-03-01T19:12:28 | 2021-03-01T19:12:28 | 343,528,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 971 | java | package nestedclass;
public class VideoGames {
Playstation ps = new Playstation();
public void buyAGame(String version) {
if(version.equalsIgnoreCase("playstation")) {
ps.buyPSGame();
}else if(version.equalsIgnoreCase("xbox")) {
XBox.buyXBoxGame();
}else if(version.equalsIgnoreCase("nintendo")) {
Nintendo.buySwitchGame();
}else {
NotAvailable.notInStock();
}
}
private class Playstation {
private void buyPSGame() {
System.out.println("I will get the playstation game for you.");
}
}
private static class XBox {
private static void buyXBoxGame() {
System.out.println("I will get the xbox game for you.");
}
}
private static class Nintendo {
private static void buySwitchGame() {
System.out.println("I will get the switch game for you.");
}
}
private static class NotAvailable {
private static void notInStock() {
System.out.println("We do not have that version of the game. Sorry.");
}
}
}
| [
"muneeb@Muneebs-MacBook-Pro.local"
] | muneeb@Muneebs-MacBook-Pro.local |
6a03bb0b4003f7e771e2537da87182e1c1c3fef8 | 3b91ed788572b6d5ac4db1bee814a74560603578 | /com/tencent/mm/plugin/order/ui/MallOrderProductListUI$b$1.java | a8b441e7a26fde4b7f9380f5820afb938b90f031 | [] | no_license | linsir6/WeChat_java | a1deee3035b555fb35a423f367eb5e3e58a17cb0 | 32e52b88c012051100315af6751111bfb6697a29 | refs/heads/master | 2020-05-31T05:40:17.161282 | 2018-08-28T02:07:02 | 2018-08-28T02:07:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package com.tencent.mm.plugin.order.ui;
import android.graphics.Bitmap;
import com.tencent.mm.plugin.order.ui.MallOrderProductListUI.b;
class MallOrderProductListUI$b$1 implements Runnable {
final /* synthetic */ b lPK;
final /* synthetic */ Bitmap val$bmp;
MallOrderProductListUI$b$1(b bVar, Bitmap bitmap) {
this.lPK = bVar;
this.val$bmp = bitmap;
}
public final void run() {
this.lPK.hFT.setImageBitmap(this.val$bmp);
}
}
| [
"707194831@qq.com"
] | 707194831@qq.com |
489807e9683dc844ff69b6f7bd4aab6087c8153d | a962247e51ba04c6a91a5d3091e222a6bb262266 | /basic/1010.java | fd5e93170da1b7930352ae75d0aed4ab9339cbaa | [] | no_license | OhYee/PAT | 7a62c48d1e4da8bc77798a23346e6b2e343584ec | cc6a9b90b895b29014f61073a7d5b03b2865b502 | refs/heads/master | 2020-03-19T07:51:13.148298 | 2018-07-08T10:37:51 | 2018-07-08T10:37:51 | 136,154,288 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 676 | java | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
boolean isFirst = true;
while (in.hasNextInt()) {
int a = in.nextInt();
int n = in.nextInt();
if (n != 0) {
if (isFirst) {
isFirst = false;
} else {
System.out.print(" ");
}
System.out.printf("%d %d", a * n, n - 1);
}
}
if (isFirst){
System.out.print("0 0");
}
System.out.print("\n");
in.close();
}
} | [
"oyohyee@oyohyee.com"
] | oyohyee@oyohyee.com |
b4f84799d3587a0956b76615f7145e9a065dfbc4 | 2ec6b7c100482888e1fe0a11c451b7922104c456 | /app/src/main/java/br/wave/matparacriancas/MainActivity.java | 56a20a2d0a9d48131765280d74433acf5e008256 | [] | no_license | KibaNaoParsa/MatematicaParaCriancas | 384e0f910afaf8d54622cad00e32a847f97cfff5 | 51ad5ec72c1ea68b48ac83d29afc3ba4e93b2e91 | refs/heads/master | 2020-03-07T23:37:49.843092 | 2018-09-18T02:04:51 | 2018-09-18T02:04:51 | 127,786,048 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,110 | java | package br.wave.matparacriancas;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
Button btnFace, btnEstrela;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnFace = (Button) findViewById(R.id.btnFace);
btnEstrela = (Button) findViewById(R.id.btnEstrela);
btnFace.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String url = "https://www.facebook.com/WAVE-Development-519975971719289";
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
btnEstrela.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String url = "https://play.google.com/store/apps/details?id=br.wave.matparacriancas";
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
}
public void abrirSoma(View view){
Intent intent = new Intent(this, Soma.class);
startActivity(intent);
}
public void abrirSubtracao(View view){
Intent intent = new Intent(this, Subtracao.class);
startActivity(intent);
}
public void abrirMultiplicacao(View view){
Intent intent = new Intent(this, Multiplicacao.class);
startActivity(intent);
}
public void abrirDivisao(View view){
Intent intent = new Intent(this, Divisao.class);
startActivity(intent);
}
@Override
public void onBackPressed() {
finish();
System.exit(0);
}
}
| [
"victor.cabral029@gmail.com"
] | victor.cabral029@gmail.com |
cd014e819617315f0b2a82ffec69d2eac0d99a97 | 8433f7e2ea6c63a355af170175cd0d6d7b7d39aa | /app/src/test/java/com/athome/practice/PayIt/ExampleUnitTest.java | cce9e8ed60dbaeee598aff509335278b6ef27a8d | [] | no_license | SinghAnandKumar/PayIt | 69708553126577dff98d732bcac2d33640b645ec | 547022051b4d1a7d8470255ccaec81a84eddc3e4 | refs/heads/master | 2021-08-22T17:14:41.906257 | 2017-11-30T19:11:45 | 2017-11-30T19:11:45 | 112,639,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.athome.practice.PayIt;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"anandkumarsingh808@gmail.com"
] | anandkumarsingh808@gmail.com |
bae87189af1b4d2b5fc8ae826a5d3ba8670da69e | 9fc5127fb5228bdd599fdb9ecbc22830bbfde936 | /src/main/java/com/gt/studentSpring/web/model/Student.java | da9a543a60a7cd51b144fe8b1f112f42685c6243 | [] | no_license | Greg-tts/studentSpringMVC | 19c847b763e63b7e9b36407b8f83b679a46d42b9 | 9f43fe0bf164dffefc850d690b8606ad46e3c3c9 | refs/heads/master | 2022-12-21T23:03:54.658005 | 2019-06-28T05:20:37 | 2019-06-28T05:20:37 | 194,210,985 | 0 | 0 | null | 2022-12-16T02:28:18 | 2019-06-28T05:21:04 | Java | UTF-8 | Java | false | false | 530 | java | package com.gt.studentSpring.web.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Student
{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
private String name;
public Student() {
}
public Student(String name) {
this.name = name;
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} | [
"gtesto@techtalentsouth.com"
] | gtesto@techtalentsouth.com |
ebe7b25be8a44996029d2fe1f10711e8c036e353 | a1390c4f370035a5b04189e6cb2284e9c51d3ef4 | /src/main/java/com/leetcode/array/CountGoodTriplets.java | b882a3f51d9f65e71270edccb9699d7364aba1b2 | [] | no_license | bohenmian/leetcode | 763b2bcc5b39ddd6892f548b26831f8ea66cee14 | 1ab7f180c4f722fde28289ba89b61d77c7c09b06 | refs/heads/master | 2021-06-13T14:56:24.364524 | 2021-02-01T12:31:24 | 2021-02-01T12:31:24 | 102,922,737 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 967 | java | package com.leetcode.array;
public class CountGoodTriplets {
public int countGoodTriplets(int[] arr, int a, int b, int c) {
int ans = 0, n = arr.length;
int[] sum = new int[1001];
for (int j = 0; j < n; ++j) {
for (int k = j + 1; k < n; ++k) {
if (Math.abs(arr[j] - arr[k]) <= b) {
int lj = arr[j] - a, rj = arr[j] + a;
int lk = arr[k] - c, rk = arr[k] + c;
int l = Math.max(0, Math.max(lj, lk)), r = Math.min(1000, Math.min(rj, rk));
if (l <= r) {
if (l == 0) {
ans += sum[r];
} else {
ans += sum[r] - sum[l - 1];
}
}
}
}
for (int k = arr[j]; k <= 1000; ++k) {
++sum[k];
}
}
return ans;
}
}
| [
"bohenmian@gmail.com"
] | bohenmian@gmail.com |
83f02a6675728bca425dc7af039f2787e70ef6a4 | 5b07eb9c8824c1a68942cb97d1b6fdb7b8c88f15 | /console/src/main/java/com/thread/MemoryDemo.java | 2ac3225d14792550f275f366ac38cabf185ea34d | [] | no_license | yue1183283159/demoproject | 519e99d54dc90923ca8f9623287d2afe11d0f76f | 1b751391276e03df840e7237359e67dbada69b86 | refs/heads/master | 2020-05-04T08:36:58.316079 | 2019-04-11T13:48:09 | 2019-04-11T13:48:09 | 179,050,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | java | package com.thread;
public class MemoryDemo
{
public static void main(String[] args)
{
Runtime runtime = Runtime.getRuntime();
// 从操作系统中申请的最大内存
System.out.println(runtime.maxMemory() / 1024 / 1024 + "M");
// 已经申请到的内存
System.out.println(runtime.totalMemory() / 1024 / 1024 + "M");
// 空闲内存
System.out.println(runtime.freeMemory() / 1024 / 1024 + "M");
System.out.println();
for (int i = 0; i < 100; i++)
{
byte[] data = new byte[1024 * 1024 * 10];
System.out.println(i + " --------");
System.out.println(runtime.totalMemory() / 1024 / 1024 + "M");
System.out.println(runtime.freeMemory() / 1024 / 1024 + "M");
//当内存不够用的时候,系统进行垃圾回收,将没有引用的数组对象进行回收,释放内存。
//如果对象有引用(不应该把对象放入静态对象中),就不会被回收,会造成内存泄漏
System.out.println("已经用了" + (runtime.totalMemory() - runtime.freeMemory()) / 1024 / 1024 + "M");
}
}
}
| [
"m13120373809@183.com"
] | m13120373809@183.com |
8fd516be3189619858505cd3c7ce715122dadc8a | 972f1bb7acd17e0b37ee236c761962aae4c62c04 | /PM-Backend/src/main/java/com/pocketmedic/rest/services/ConsultasRest.java | 4a91ba5983c7c30f7cc1098e880cb0cc46334edc | [] | no_license | Negretta/Pocket-Medic | 38b88fac5225aa843d059591853de5ae5367ba24 | 58cee2960659903441e79390b798f03e9dc40eed | refs/heads/master | 2020-12-03T06:42:02.458603 | 2016-04-25T00:02:59 | 2016-04-25T00:02:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,576 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.pocketmedic.rest.services;
import com.pocketmedic.jpa.entities.Consultas;
import com.pocketmedic.jpa.session.ConsultasFacade;
import java.util.List;
import javax.ejb.EJB;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author adsi1
*/
@Path("consultas")
public class ConsultasRest {
@EJB
private ConsultasFacade ejbConsultasFacade;
@POST
@Consumes(MediaType.APPLICATION_JSON)
public void create(Consultas consulta) {
ejbConsultasFacade.create(consulta);
}
@PUT
@Path("{id}")
@Consumes(MediaType.APPLICATION_JSON)
public void edit(@PathParam("id") Integer id, Consultas consulta) {
ejbConsultasFacade.edit(consulta);
}
@DELETE
@Path("{id}")
public void remove(@PathParam("id") Integer id) {
ejbConsultasFacade.remove(ejbConsultasFacade.find(id));
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<Consultas> findAll() {
return ejbConsultasFacade.findAll();
}
@GET
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)
public Consultas findById(@PathParam("id") Integer id) {
return ejbConsultasFacade.find(id);
}
}
| [
"ecaicedo242@misena.edu.co"
] | ecaicedo242@misena.edu.co |
06d3558d2fb2b38fcc06f7711501b9bb6bae9684 | c4c34173dd5a15f23c41836f1388feb276e36f74 | /app/src/main/java/com/zhang/javabase/day14/otherclass/Demo7_SimpleDateFormat.java | 1a303d9eeffbfc35e54cbbb84c5c55d2581a3750 | [] | no_license | keeponZhang/JavaBase | dded4a6c9191b35679df2871d231b0c5618d2380 | c4fe1eeadbc35052c4e36b7bbf983d8eab23b23f | refs/heads/master | 2020-09-15T11:32:06.246228 | 2019-11-24T12:14:21 | 2019-11-24T12:14:21 | 223,432,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,840 | java | package com.zhang.javabase.day14.otherclass;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Demo7_SimpleDateFormat {
/**
* * A:DateFormat类的概述
* DateFormat 是日期/时间格式化子类的抽象类,它以与语言无关的方式格式化并解析日期或时间。是抽象类,所以使用其子类SimpleDateFormat
* B:SimpleDateFormat构造方法
* public SimpleDateFormat()
* public SimpleDateFormat(String pattern)
* C:成员方法
* public final String format(Date date)
* public Date parse(String source)
* @throws ParseException
*/
public static void main(String[] args) throws ParseException {
//demo1();
//demo2();
//demo3();
//将时间字符串转换成日期对象
String str = "2000年08月08日 08:08:08";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
Date d = sdf.parse(str); //将时间字符串转换成日期对象
System.out.println(d);
}
public static void demo3() {
Date d = new Date(); //获取当前时间对象
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//创建日期格式化类对象
System.out.println(sdf.format(d)); //将日期对象转换为字符串
}
public static void demo2() {
Date d = new Date(); //获取当前时间对象
SimpleDateFormat sdf = new SimpleDateFormat(); //创建日期格式化类对象
System.out.println(sdf.format(d)); //88-6-6 下午9:31
}
public static void demo1() {
//DateFormat df = new DateFormat(); //DateFormat是抽象类,不允许实例化
//DateFormat df1 = new SimpleDateFormat();
DateFormat df1 = DateFormat.getDateInstance(); //相当于父类引用指向子类对象,右边的方法返回一个子类对象
}
}
| [
"zhangwengao@yy.com"
] | zhangwengao@yy.com |
1cc5a2e4e57b7cd6a72b661aedacb16f276a5a91 | a80c7c3e84807b13eb0b2947927541645fd04304 | /88MergeSortedArray.java | 9996e0e5a0ff16c96a5335a563af7320379e9c42 | [] | no_license | adspoing/leetcode | e77ca344903b60ea9cacde07b1d7cd6a5dd9a054 | f2c55af5eb354c84937f219a1a7a1114adf31ebf | refs/heads/master | 2020-05-21T13:46:42.816173 | 2016-11-05T15:37:15 | 2016-11-05T15:37:15 | 61,135,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | public void merge(int A[], int m, int B[], int n) {
int i=m-1, j=n-1, k=m+n-1;
while (i>-1 && j>-1) A[k--]= (A[i]>B[j]) ? A[i--] : B[j--];
while (j>-1) A[k--]=B[j--];
} | [
"hcwcyz@gmail.com"
] | hcwcyz@gmail.com |
eac3a451d5651c56f4487c5bb3eb0960ba961842 | 7b73756ba240202ea92f8f0c5c51c8343c0efa5f | /classes5/ryi.java | 0dc3adb3cfe1b6942d4e0d770b880437620843f5 | [] | no_license | meeidol-luo/qooq | 588a4ca6d8ad579b28dec66ec8084399fb0991ef | e723920ac555e99d5325b1d4024552383713c28d | refs/heads/master | 2020-03-27T03:16:06.616300 | 2016-10-08T07:33:58 | 2016-10-08T07:33:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,396 | java | import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.filemanager.app.FileManagerEngine;
import com.tencent.mobileqq.filemanager.core.FileManagerNotifyCenter;
import com.tencent.mobileqq.filemanager.core.OnlineFileSessionWorker;
import com.tencent.mobileqq.filemanager.data.FileManagerEntity;
import com.tencent.mobileqq.filemanager.util.FileManagerUtil;
import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import com.tencent.qphone.base.util.QLog;
public class ryi
extends ryd
{
public ryi(OnlineFileSessionWorker paramOnlineFileSessionWorker)
{
super(paramOnlineFileSessionWorker);
boolean bool = NotVerifyClass.DO_VERIFY_CLASS;
}
protected String a()
{
return "StateChangeToOffFailedWhenRecv";
}
protected void a()
{
FileManagerEntity localFileManagerEntity = this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity;
if (localFileManagerEntity == null) {
QLog.e("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "]. recvOnLineFile entity is null");
}
do
{
return;
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "start send recv cmd.... [" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_Rzk.a + "-" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_Rzk.b + "]");
} while (!this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.a(localFileManagerEntity.peerUin, localFileManagerEntity.nOLfileSessionId));
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 9, 14);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateWaitResultWhenRecv)");
this.jdField_a_of_type_Ryd = new rzj(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface.a().a(localFileManagerEntity.uniseq, localFileManagerEntity.nSessionId, localFileManagerEntity.peerUin, localFileManagerEntity.peerType, 10, null, 6, null);
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface.a().a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity.uniseq, this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity.nSessionId, this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity.peerUin, this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity.peerType, 16, null, 0, null);
}
protected void a(int paramInt)
{
int i = 1;
FileManagerEntity localFileManagerEntity = this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity;
if (localFileManagerEntity == null)
{
QLog.e("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "]. onFileRequestBeHandledByPC entity is null");
return;
}
if (5 != paramInt)
{
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.d();
switch (paramInt)
{
default:
label63:
QLog.e("OnlineFileSessionWorker<FileAssistant>", 1, "OLfile session[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] is not foud . handledbypc type error:" + paramInt);
paramInt = 0;
}
}
while (paramInt != 0)
{
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface.a().a(localFileManagerEntity.uniseq, localFileManagerEntity.nSessionId, localFileManagerEntity.peerUin, localFileManagerEntity.peerType, 12, null, 0, null);
return;
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.b();
break label63;
OnlineFileSessionWorker.b(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 5);
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 5);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateAcceptByPCWhenToOffFailed)");
this.jdField_a_of_type_Ryd = new ryc(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
paramInt = i;
continue;
OnlineFileSessionWorker.b(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 6);
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 6);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateRefuseByPCWhenToOffFailed)");
this.jdField_a_of_type_Ryd = new ryv(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
paramInt = i;
continue;
OnlineFileSessionWorker.b(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 8);
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 8);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateSenderCancelSendWhenToOffFailed)");
this.jdField_a_of_type_Ryd = new rzc(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
paramInt = i;
continue;
OnlineFileSessionWorker.b(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 7);
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 7);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateSaveToWeiYunByPCWhenToOffFailed)");
this.jdField_a_of_type_Ryd = new ryz(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
paramInt = i;
continue;
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
OnlineFileSessionWorker.b(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 11);
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 13, 14);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateChangeToOffWhenToOffFailed)");
this.jdField_a_of_type_Ryd = new ryk(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
paramInt = 0;
}
}
protected void a(int paramInt1, int paramInt2)
{
if (a("onSenderUploadProgressNotify")) {
return;
}
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
b(paramInt1, paramInt2);
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 9, 11, true);
a("StateLocalFailedWhenRecv");
this.jdField_a_of_type_Ryd = new rys(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
}
protected void a(int paramInt, String paramString)
{
if (a("onSenderUploadException")) {
return;
}
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 9, 12, true);
a("StateExcepInvalidWhenRecv");
this.jdField_a_of_type_Ryd = new ryo(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
}
protected void a(boolean paramBoolean)
{
if (this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity == null)
{
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "]. StateWaitingRecvResult entity is null");
return;
}
if (paramBoolean == true)
{
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 9, 11, true);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateLocalFailedWhenRecv)");
this.jdField_a_of_type_Ryd = new rys(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
return;
}
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateChangeToOffFailedWhenRecv)");
}
protected boolean a(int paramInt, String paramString, long paramLong)
{
FileManagerEntity localFileManagerEntity = this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqFilemanagerDataFileManagerEntity;
if (localFileManagerEntity == null)
{
QLog.e("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "]. recvOnLineFile entity is null");
return false;
}
localFileManagerEntity.Uuid = new String(paramString);
localFileManagerEntity.fProgress = 0.0F;
if ((FileManagerUtil.a(localFileManagerEntity.fileName) == 0) && (localFileManagerEntity.Uuid != null) && (localFileManagerEntity.Uuid.length() != 0)) {
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface.a().a(localFileManagerEntity.Uuid, 3, false, localFileManagerEntity);
}
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.a(paramLong, localFileManagerEntity.peerUin);
localFileManagerEntity.setCloudType(1);
OnlineFileSessionWorker.b(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 1, 0);
OnlineFileSessionWorker.c(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 1, 0);
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + "->StateGotoOffFileProcess)");
this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface.a().a(true, 22, new Object[] { Long.valueOf(localFileManagerEntity.nSessionId), Long.valueOf(localFileManagerEntity.nOLfileSessionId) });
this.jdField_a_of_type_Ryd = new ryp(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
return true;
}
protected void b()
{
if (a("onSenderCancelUpload")) {
return;
}
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 11, 9, true);
a("StateCancelUploadWhenRecv");
this.jdField_a_of_type_Ryd = new ryg(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
}
protected void b(boolean paramBoolean)
{
if (paramBoolean == true)
{
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + " recv success response of ask progress, not handle it");
return;
}
QLog.i("OnlineFileSessionWorker<FileAssistant>", 1, "OLfilesession[" + this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker.h + "] state change :(" + this.jdField_a_of_type_Ryd.a() + " recv failed response of ask progress, not handle it");
}
protected void e()
{
if (a("onSenderReplayComeOnRecv")) {
return;
}
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
OnlineFileSessionWorker.a(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker, 9, 11, true);
a("StateLocalFailedWhenRecv");
this.jdField_a_of_type_Ryd = new rys(this.jdField_a_of_type_ComTencentMobileqqFilemanagerCoreOnlineFileSessionWorker);
}
}
/* Location: E:\apk\QQ_91\classes5-dex2jar.jar!\ryi.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
eac5f9cc36c7e0b8e31598835fb50b897f7dd4bf | c7c32c9f134738506a1cb947d189c0cc7febd71a | /src/test/java/com/example/demo/SERVER/controllers/TownControllerTest.java | 11a913ec28572c72df9ddfa54598e2197867b773 | [] | no_license | MikhailZheleznyakov/kurs_work_java | c4f7bb2d3bbcb5b434462cfcbce4ed96770ac5b4 | 21c98de6631f7aea90d50e56412744732f878dbb | refs/heads/master | 2023-05-14T10:38:03.085874 | 2021-06-03T07:35:44 | 2021-06-03T07:35:44 | 355,449,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,229 | java | package com.example.demo.SERVER.controllers;
import com.example.demo.SERVER.repository.TownRepository;
import com.example.demo.SERVER.tables.Driver;
import com.example.demo.SERVER.tables.Town;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.*;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest
@AutoConfigureMockMvc
class TownControllerTest {
@Autowired
public MockMvc mvc;
@Autowired
public TownRepository townRepository;
@Test
void addTown() {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("name","Калининград");
jsonObject.put("info","Кенинсберг");
this.mvc.perform(MockMvcRequestBuilders.post("http://localhost:8282/town/addTown")
.contentType(MediaType.APPLICATION_JSON)
.content(jsonObject.toString())
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andReturn();
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
void getTownAll() {
try {
this.mvc.perform(MockMvcRequestBuilders.get("http://localhost:8282/town/getAllTown"))
.andDo(print())
.andExpect(status().is2xxSuccessful())
.andExpect(mvcResult -> {
String body = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8);
JSONArray jsonArray = new JSONArray(body);
assertEquals(jsonArray.length(), this.townRepository.findAll().size());
})
.andReturn();
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
void deleteTown() {
try{
Town newTown = townRepository.findTownByName("Калининград");
if (newTown == null){
addTown();
}
newTown = townRepository.findTownByName("Калининград");
this.mvc.perform(MockMvcRequestBuilders.delete("http://localhost:8282/town/deleteTown/"+newTown.getId())
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk());
}catch (Exception e){
e.printStackTrace();
}
}
@Test
void updateTown() {
try{
Town newTown = townRepository.findTownByName("Калининград");
JSONObject jsonObject = new JSONObject();
if (newTown == null){
addTown();
}
newTown = townRepository.findTownByName("Калининград");
jsonObject.put("id", newTown.getId());
jsonObject.put("name", "Астрахань");
jsonObject.put("info",newTown.getInfo());
this.mvc.perform(MockMvcRequestBuilders.put("http://localhost:8282/town/updateTown/"+newTown.getId())
.contentType(MediaType.APPLICATION_JSON)
.content(jsonObject.toString())
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andReturn();
} catch (Exception e) {
e.printStackTrace();
}
}
} | [
"ironguy.cool@yandex.ru"
] | ironguy.cool@yandex.ru |
db9f45cc154cdd8cc55f96b0eba76012762cbbac | e423b2a5b34d3a436a795bd0d0053e0aa2bb8fb5 | /RotiKapraMakan/src/com/example/RotiKapraMakan/Maps.java | 2ca48b49d2c1c00b9d3ff3f80647f3ca2e1384c6 | [] | no_license | codeforpakistan/RotiKapraMakan | 023b1f452abc4f287cac49c625abe532cd12fd78 | db5e332792e7a69976bcc6940830f3e34771af7b | refs/heads/master | 2021-01-01T05:49:58.137132 | 2014-02-02T05:52:54 | 2014-02-02T05:52:54 | 16,449,399 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,368 | java | package com.example.RotiKapraMakan;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
public class Maps extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.maps);
// Show the Up button in the action bar.
setupActionBar();
}
/**
* Set up the {@link android.app.ActionBar}.
*/
private void setupActionBar() {
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.maps, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// This ID represents the Home or Up button. In the case of this
// activity, the Up button is shown. Use NavUtils to allow users
// to navigate up one level in the application structure. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"osmanuetian@gmail.com"
] | osmanuetian@gmail.com |
b4e1845869320ccc499d864b03811277c41f1517 | 6c23dc5bf0ba99550089086bdb158845ca632be5 | /ems/src/main/java/com/baizhi/Application.java | 2230827843c66e1c258a310ff89bc98d11c36c85 | [] | no_license | helloshabi/myresopository | a4eec285e83910362c96a8d2ad8a713610a66147 | 788ac42d3c329e703f507613d2fe25635532be60 | refs/heads/master | 2020-04-11T20:43:50.126371 | 2018-12-17T06:01:22 | 2018-12-17T06:01:22 | 162,080,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | package com.baizhi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class,args);
}
}
| [
"zhj@zhj.com"
] | zhj@zhj.com |
5a35b6cbd004632dccebb13858de5ea57c07d4d5 | 14c41b8f2f188824b5d043058389e1ae228784cd | /src/main/java/storm/ReceivePacket.java | 6e9ce7b19aafdc1cc7f992e8c1cbed1927437290 | [] | no_license | xiaohangcd/Datagram | 159186793d3cf9176fcb0c17794d0d12d98c8f03 | d961605f06d7d619198f54c51c00815dc6d76b65 | refs/heads/master | 2020-03-12T14:21:15.883025 | 2018-04-24T03:12:07 | 2018-04-24T03:12:07 | 130,665,222 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,812 | java | package storm;
import Helper.FileHelper;
import Helper.KafkaNewProducer;
import com.google.gson.Gson;
import jpcap.PacketReceiver;
import jpcap.packet.*;
import kafka.server.KafkaApis;
import udp.Datagram_Msg;
/**
* Created by yss on 2018/4/10.
*/
public class ReceivePacket implements PacketReceiver {
KafkaNewProducer producer;
MyConfig baseConfig;
public ReceivePacket()
{
Gson gson=new Gson();
String text = FileHelper.readString("config.json");
baseConfig = gson.fromJson(text, MyConfig.class);
producer=new KafkaNewProducer(baseConfig.brokerList);
}
/**
* 实现的接包方法:
*/
public void receivePacket(Packet packet) {
//UDP包
System.out.println(baseConfig);
if(packet instanceof jpcap.packet.UDPPacket ){
UDPPacket p=(UDPPacket)packet;
if(baseConfig.dst_ports.length!=0)
{
for(int i=0;i<baseConfig.dst_ports.length;i++)
if(p.dst_port==baseConfig.dst_ports[i]) ///抓目的端口为27015的包
{
String src_ip=p.src_ip.getHostAddress();
String dst_ip=p.dst_ip.getHostAddress();
Gson gson=new Gson();
Datagram_Msg msg=new Datagram_Msg(dst_ip,p.dst_port,src_ip,p.src_port,p.len,p.data);
System.out.println(gson.toJson(msg));
String str=new String(p.data);
System.out.println(str);
producer.send(baseConfig.topic,gson.toJson(msg));
break;
}
}
else
{
String src_ip=p.src_ip.getHostAddress();
String dst_ip=p.dst_ip.getHostAddress();
Gson gson=new Gson();
Datagram_Msg msg=new Datagram_Msg(dst_ip,p.dst_port,src_ip,p.src_port,p.len,p.data);
System.out.println(gson.toJson(msg));
producer.send(baseConfig.topic,gson.toJson(msg));
}
}
//取得链路层数据头 :如果你想局网抓包或伪造数据包,嘿嘿
// DatalinkPacket datalink =packet.datalink;
// //如果是以太网包
// if(datalink instanceof jpcap.packet.EthernetPacket){
// EthernetPacket ep=(EthernetPacket)datalink;
// String s=" 以太包: "
// +"|目的MAC: "+ep.getDestinationAddress()
// +"|源MAC: "+ep.getSourceAddress();
// System.out.println(s);
// }
}
public static String bytesToHexString(byte src) {
int v = src & 0xFF;
String hv = Integer.toHexString(v);
return hv;
}
}
| [
"37287475+xiaohangcd@users.noreply.github.com"
] | 37287475+xiaohangcd@users.noreply.github.com |
5f4ebcd4041a5892714207fdad66e13f55830be2 | f0c43871cdc83c829d7482f4be1d9feaa1e9ac64 | /DataStructuresProject/src/com/roshan/shortPrograms/Ascnum.java | 342dabe15d619ba7c60b900e00df66d90e1577e4 | [] | no_license | 164424-RoshanKanwal/All_Assignments | 46ae8e464347413105fef81daeba6b2ba2a57a3a | 80b0f9aab7c0807afb8dbf91cde33462b2aad213 | refs/heads/master | 2020-04-06T22:49:26.313514 | 2019-03-28T11:02:25 | 2019-03-28T11:02:25 | 157,848,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 146 | java | package com.sneha.asgn;
public class Ascnum {
public static void main(String[] args) {
Whilenum n1 = new Whilenum();
n1.MDis(10);
}
}
| [
"roshan.kanwal03@gmail.com"
] | roshan.kanwal03@gmail.com |
81a0140646c764187c397adace44b2f1fbf853b1 | 938111bdb5f4b783f0196eaa9cfd745deab1b0c8 | /Assignmnet-4/springjdbc/spring-jdbc/src/main/java/entities/Employee.java | 45ea9059010ba3c0ba3a73d9a6d00c9a97af4399 | [] | no_license | ChiragDc/Ness-Assignments | 1074f95c3d882066a07a81121ca43c21dcbd25e4 | ac8f789d4004060ff32a91ddb951238943a6af45 | refs/heads/master | 2023-04-27T17:01:20.181919 | 2021-05-10T15:26:22 | 2021-05-10T15:26:22 | 351,385,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package entities;
public class Employee {
private int id;
private String name;
private String email;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"P7112755@ness.com"
] | P7112755@ness.com |
16e2a0657a57de2686e5215a040acef8cf3dd630 | 93318c9c8cf96a67a17533d23de69b24bd505598 | /src/test/java/com/hubbledouble/json_merge_patch/core/NumbersBean.java | f288aa2ccfa537be04a24901978fb5cbb7b5ae02 | [
"BSD-2-Clause"
] | permissive | hubbledouble/json-merge-patch | a29f7a84301f25a2337b5acea2186ad057ad4ad2 | f0725f180e5f9ab004533adcaaa2ebf4b211c755 | refs/heads/master | 2022-12-02T19:01:56.989740 | 2019-06-23T03:47:19 | 2019-06-23T03:47:19 | 193,170,617 | 3 | 0 | BSD-2-Clause | 2022-11-16T12:24:13 | 2019-06-21T23:27:21 | Java | UTF-8 | Java | false | false | 2,616 | java | /*
* BSD 2-Clause License
*
* Copyright (c) 2019, HubbleDouble
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.hubbledouble.json_merge_patch.core;
public class NumbersBean {
private Integer integerNumber;
private Long longNumber;
private Float floatNumber;
private Double doubleNumber;
public NumbersBean() {
}
public NumbersBean(Integer integerNumber, Long longNumber, Float floatNumber, Double doubleNumber) {
this.integerNumber = integerNumber;
this.longNumber = longNumber;
this.floatNumber = floatNumber;
this.doubleNumber = doubleNumber;
}
public Integer getIntegerNumber() {
return integerNumber;
}
public void setIntegerNumber(Integer integerNumber) {
this.integerNumber = integerNumber;
}
public Long getLongNumber() {
return longNumber;
}
public void setLongNumber(Long longNumber) {
this.longNumber = longNumber;
}
public Float getFloatNumber() {
return floatNumber;
}
public void setFloatNumber(Float floatNumber) {
this.floatNumber = floatNumber;
}
public Double getDoubleNumber() {
return doubleNumber;
}
public void setDoubleNumber(Double doubleNumber) {
this.doubleNumber = doubleNumber;
}
} | [
"1724724+jorgesaldivar@users.noreply.github.com"
] | 1724724+jorgesaldivar@users.noreply.github.com |
964c5b9e11e9e34b7498aee404f010fe8c6a4dcf | 8755c851f70cfae0b4132af619a86d083f1ce630 | /src/methods/Difference.java | 7d843638260b539eb309f380e596aff996633120 | [] | no_license | Mohammad9799/MoeBatch14_java | 3412d4e676d60a3c076aad0794d11c9a356bd9ea | a1547e0b61d1767821b578d364a6f15fc5131c15 | refs/heads/master | 2021-01-06T09:37:42.884439 | 2020-02-18T05:08:43 | 2020-02-18T05:08:43 | 241,282,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package methods;
import java.util.Arrays;
public class Difference {
public static void main(String[] args) {
System.out.println(differenceFormString("9323234"));
}
public static int differenceFormString(String number){
String [] arr= number.split("");
Arrays.sort(arr);
System.out.println(Arrays.toString(arr));
return Integer.valueOf(arr[arr.length-1])-Integer.valueOf(arr[0]);
}
}
| [
"hmohammad75@yahoo.com"
] | hmohammad75@yahoo.com |
849edaf20af1cbe1ac5fd353be29a5ecfdd6fd46 | 10186b7d128e5e61f6baf491e0947db76b0dadbc | /jp/cssj/homare/b/a/o.java | 91b43c94505dae7ad5e458baf29991cafa488817 | [
"SMLNJ",
"Apache-1.1",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | MewX/contendo-viewer-v1.6.3 | 7aa1021e8290378315a480ede6640fd1ef5fdfd7 | 69fba3cea4f9a43e48f43148774cfa61b388e7de | refs/heads/main | 2022-07-30T04:51:40.637912 | 2021-03-28T05:06:26 | 2021-03-28T05:06:26 | 351,630,911 | 2 | 0 | Apache-2.0 | 2021-10-12T22:24:53 | 2021-03-26T01:53:24 | Java | UTF-8 | Java | false | false | 213 | java | package jp.cssj.homare.b.a;
public interface o extends j {}
/* Location: /mnt/r/ConTenDoViewer.jar!/jp/cssj/homare/b/a/o.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"xiayuanzhong+gpg2020@gmail.com"
] | xiayuanzhong+gpg2020@gmail.com |
08cacd9bd684dc1ef339398e79490155a1e099b6 | 9b43484680acf284c4b48b7e549e8faf3f45b0e8 | /src/main/java/ch/ethz/idsc/subare/core/util/gfx/StateActionRaster.java | 8d190ff7915a9a785573f98d050fcc6f12e9ff34 | [] | no_license | idsc-frazzoli/subare | fb3a7d71cb9fbfde4f099f668c007661368f4484 | a31193543342c9062479f6689c073d76ad20f190 | refs/heads/master | 2021-03-16T08:50:07.584274 | 2019-11-17T08:54:20 | 2019-11-17T08:54:20 | 84,816,924 | 17 | 6 | null | 2021-02-27T19:35:02 | 2017-03-13T11:06:06 | Java | UTF-8 | Java | false | false | 514 | java | // code by jph
package ch.ethz.idsc.subare.core.util.gfx;
import java.awt.Dimension;
import java.awt.Point;
import ch.ethz.idsc.tensor.Tensor;
public interface StateActionRaster extends Raster {
/** @return dimension of raster */
Dimension dimensionStateActionRaster();
/** @param state
* @param action
* @return point with x, y as coordinates of state-action pair in raster,
* or null if state-action pair does not have a position in the raster */
Point point(Tensor state, Tensor action);
}
| [
"jan.hakenberg@gmail.com"
] | jan.hakenberg@gmail.com |
4a127aebc3ec833c787ffd53eef4fe439420da5d | 6f4b608795ee964306db7e8b816780f3398fef3c | /sprint java/pidev/AjoutCentreController.java | 65c4d79d19266462f350b75fab48dc73c418d401 | [] | no_license | lzemna/DermaBeauty | 8d53976bda892f1cee4434bbdbcdffa40cd97950 | c74af65eeb74788aae063fcc0933ab58c3654fcc | refs/heads/main | 2023-05-09T23:55:54.080831 | 2021-04-27T13:36:15 | 2021-04-27T13:36:15 | 340,943,480 | 0 | 0 | null | 2021-05-26T11:39:04 | 2021-02-21T16:09:34 | Java | UTF-8 | Java | false | false | 2,393 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pidev.centre;
import Entities.Centre;
import Services.ServiceCentre;
import java.io.IOException;
import java.net.URL;
import java.sql.SQLException;
import java.util.List;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javax.swing.JOptionPane;
/**
* FXML Controller class
*
* @author demni
*/
public class AjoutCentreController implements Initializable {
@FXML
private TextField tfnom;
@FXML
private TextField tftelephone;
@FXML
private TextArea tfdescription;
@FXML
private TextField tfemail;
@FXML
private TextField tfhoraire;
@FXML
private TextField tflocalisation;
@FXML
private Button btn;
@FXML
private Button btn1;
@FXML
private ChoiceBox<String> categorie;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
@FXML
private void AjouterCentre(ActionEvent event) throws SQLException, IOException {
ServiceCentre p = new ServiceCentre();
p.addCentre(new Centre(tfnom.getText() , Integer.parseInt(tftelephone.getText()) , tfemail.getText() , tfhoraire.getText() , tfdescription.getText(),tflocalisation.getText() ));
JOptionPane.showMessageDialog(null, "Centre Ajouter");
FXMLLoader loader = new FXMLLoader(getClass().getResource("AfficherCentre.fxml"));
Parent root = loader.load();
tfnom.getScene().setRoot(root);
}
@FXML
private void AfficherCentre(ActionEvent event) throws SQLException, IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("AfficherCentre.fxml"));
Parent root = loader.load();
tfnom.getScene().setRoot(root);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
d2d3cdafb20cba64023400a586a87873c450096e | 4af3dd0800601c1bf4e42f8e142c54b38cbdbd9d | /app/src/main/java/com/neishenmo/sochat/sochatandroid/wheelView/OnWheelChangedListener.java | eab8960cdccbb3f672e01f94633a0e5803c949a4 | [] | no_license | lihuaizhan/SoChatAndroid | 292eb84d2aea4f96c1cf85b9cf2593858c118450 | f098ddc93217b63a31a845df14523966c4e74236 | refs/heads/master | 2023-06-16T09:07:23.928512 | 2023-05-30T01:33:13 | 2023-05-30T01:33:13 | 131,925,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,185 | java | /*
* Copyright 2011 Yuri Kanivets
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.neishenmo.sochat.sochatandroid.wheelView;
/**
* Wheel changed listener interface.
* <p>The onChanged() method is called whenever current wheel positions is changed:
* <li> New Wheel position is set
* <li> Wheel view is scrolled
*/
public interface OnWheelChangedListener {
/**
* Callback method to be invoked when current item changed
* @param wheel the wheel view whose state has changed
* @param oldValue the old value of current item
* @param newValue the new value of current item
*/
void onChanged(WheelView wheel, int oldValue, int newValue);
}
| [
"dongwei@neishenme.com"
] | dongwei@neishenme.com |
fd02d3ca4e9d5f39d49613da22c8fe0de6735b46 | aa1e6fb49207ef7d3d7cc00b688fdb28895c6956 | /P15009900/src/main/java/com/erim/sz/common/constant/ErimConstants.java | 854332d49cf265168ebaa9664145ec86d05e94fa | [] | no_license | zhanght86/erim | f76fec9267200c6951a0a8c1fb3f723de88a039c | 504d81bb4926e496c11a34641dcc67150e78dadc | refs/heads/master | 2021-05-15T17:10:07.801083 | 2016-12-02T09:35:07 | 2016-12-02T09:35:07 | 107,489,023 | 1 | 0 | null | 2017-10-19T02:37:10 | 2017-10-19T02:37:10 | null | UTF-8 | Java | false | false | 3,945 | java | /**
* Copyright (c) e-rimming.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* PageConstants.java : 2014-03-28
*/
package com.erim.sz.common.constant;
/**
* @author 宋哲
* @version 创建时间:2014-03-28
* @description 常用常量
*/
public class ErimConstants {
/** 是 */
public static String YESORNO_YES = "02";
/** 否 */
public static String YESORNO_NO = "01";
/** 男 */
public static String SEX_MALE = "01";
/** 女 */
public static String SEX_FEMALE = "02";
/** 正常 */
public static String STATE_NORMAL = "01";
/** 禁用 */
public static String STATE_FORBIDDEN = "02";
/** 企业角色 - 生产商 */
public static String COMPANYROLE_CREATER = "1";
/** 企业角色 - 销售商 */
public static String COMPANYROLE_SELLER = "2";
/** 企业角色 - 专线商 */
public static String COMPANYROLE_LINE = "3";
/** 企业角色 - 直营 */
public static String COMPANYROLE_ZY = "4";
/** 企业角色 - 佣金 */
public static String COMPANYROLE_YJ = "5";
/** 同城 - 酒店 */
public static String TOWN_HOTEL = "HOTEL";
/** 同城 - 特色餐 */
public static String TOWN_CAFETERIA = "CAFETERIA";
/** 同城 - 导游 */
public static String TOWN_GUIDE = "GUIDE";
/** 同城 - 签证 */
public static String TOWN_MANAGEMENT = "MANAGEMENT";
/** 同城 - 当地旅游 */
public static String TOWN_GROUND = "GROUND";
/** 同城 - 飞机票 */
public static String TOWN_PLANETICKET = "PLANETICKET";
/** 同城 - 租车 */
public static String TOWN_TEXI = "TEXI";
/** 同城 - 火车 */
public static String TOWN_TRANSTICKET = "TRANSTICKET";
/** 同城 - 专线 */
public static String TOWN_LINE = "LINE";
/** 同城 - 门票 */
public static String TOWN_TICKET = "TICKET";
/** 飞机 单程直飞 */
public static String TRANSNTYPE_DCZF = "1";
/** 飞机 单程中转 */
public static String TRANSNTYPE_DCZZ = "2";
/** 导游 - 服务类型 - 国内地陪 */
public static String GUIDE_SERVICE_LOCAL = "01";
/** 导游 - 服务类型 - 国内全陪 */
public static String GUIDE_SERVICE_NATIONAL = "02";
/** 导游 - 服务类型 - 国际/港澳台领队 */
public static String GUIDE_SERVICE_LEADER = "03";
/** 导游 - 服务类型 - 国际地陪 */
public static String GUIDE_SERVICE_GAID = "04";
/** 租车 - 使用类型 - 固定接送 */
public static String TEXI_APPLY_SEND = "01";
/** 租车 - 使用类型 - 包车 */
public static String TEXI_APPLY_CAR = "02";
/** 租车 - 使用类型 - 自驾 */
public static String TEXI_APPLY_DRIVE = "03";
/** 租车 - 固定接送 - 接机 */
public static String TEXI_SEND_JIEJI = "01";
/** 租车 - 固定接送 - 送机 */
public static String TEXI_SEND_SONGJI = "02";
/** 租车 - 固定接送 - 接站 */
public static String TEXI_SEND_JIEZHAN = "03";
/** 租车 - 固定接送 - 送站 */
public static String TEXI_SEND_SONGZHAN = "04";
/** 租车 - 固定接送 - 固定线路 */
public static String TEXI_SEND_GUDING = "05";
/** 机票 - 舱位类型 - 经济舱 */
public static String PLANE_CALSS_ECONOMY = "01";
/** 机票 - 舱位类型 - 商务舱 */
public static String PLANE_CALSS_BUSINESS = "02";
/** 机票 - 舱位类型 - 头等舱 */
public static String PLANE_CALSS_FIRST = "03";
/** 锁定用户 */
public static String LOCK_USER_YES = "1";
/** 测试用户 */
public static String LOCK_USER_TEST = "2";
/** 付费用户 */
public static String LOCK_USER_PAY = "3";
}
| [
"libra0920@qq.com"
] | libra0920@qq.com |
d89e25654c5f5a8e5d054397badb818b17f5a56d | d83da3e8667e749c817c8a7dfe7ea0b4d173a1ab | /mybatis-03/src/test/java/com/quint/test/UserTest.java | 11f8d4f8bc610ba97d404adb3469812b185a4f35 | [] | no_license | wangqgcn/mybatis_study | 52c2d65048e6d86f558dadb16af41b3be73179ca | 8346098c7638b26058b64f697c59d7ddce3ce6f2 | refs/heads/master | 2023-04-23T14:23:59.414349 | 2021-05-07T12:34:17 | 2021-05-07T12:34:17 | 365,127,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,874 | java | package com.quint.test;
import com.quint.mapper.UserMapper;
import com.quint.pojo.User;
import com.quint.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import java.util.HashMap;
import java.util.List;
public class UserTest {
@Test
public void addUser(){
SqlSession sqlSession = MybatisUtil.getSqlSession();
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
mapper.addUser(new User(3,"UserUser","2414144"));
sqlSession.commit();
sqlSession.close();
}
@Test
public void deleteUser(){
SqlSession sqlSession = MybatisUtil.getSqlSession();
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
mapper.deleteUser(3);
sqlSession.commit();
sqlSession.close();
}
@Test
public void updateUser(){
SqlSession sqlSession = MybatisUtil.getSqlSession();
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
User u = mapper.getUserById(4);
u.setName("newUser");
u.setPwd("adawada");
mapper.updateUser(u);
sqlSession.commit();
sqlSession.close();
}
@Test
public void getUserById(){
SqlSession sqlSession = MybatisUtil.getSqlSession();
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
User user = mapper.getUserById(44);
System.out.println(user);
sqlSession.commit();
sqlSession.close();
}
@Test
public void listUser(){
SqlSession sqlSession = MybatisUtil.getSqlSession();
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
List<User> userList = mapper.listUser();
for (User user : userList) {
System.out.println(user);
}
sqlSession.commit();
sqlSession.close();
}
}
| [
"w565422579@gamil.com"
] | w565422579@gamil.com |
ce4c7bdfc11e7476d0357ec2b63869d4d2018ad5 | ae3abe4fd252bab7b381515f7f2c83b5777cd18c | /src/main/java/iterator_composite/dinermergecafe/Waitress.java | 14c530474fa891d5c8f08bf7dc5b9d444c434167 | [] | no_license | sgboy17/design_pattern | 222e1b45326a5db4f39f4b8d589fec6f8473077d | 4f058a0c0f14c8b608758788015b15def009c946 | refs/heads/master | 2020-05-24T10:53:50.831517 | 2017-04-07T21:31:48 | 2017-04-07T21:31:48 | 84,849,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | package iterator_composite.dinermergecafe;
import java.util.ArrayList;
import java.util.Iterator;
/**
* Created by nghiapv on 11/03/2017.
*/
public class Waitress {
// Menu pancakeHouseMenu;
Menu dinerMenu;
// public Waitress(Menu pancakeHouseMenu, Menu dinerMenu) {
public Waitress(Menu dinerMenu) {
// this.pancakeHouseMenu = pancakeHouseMenu;
this.dinerMenu = dinerMenu;
}
public void printMenu(){
// Iterator pancakeIterator = pancakeHouseMenu.createIterator();
Iterator dinerIterator = dinerMenu.createIterator();
// System.out.println("Pancake Menu: ");
// printMenu(pancakeIterator);
System.out.println("Diner Menu: ");
printMenu(dinerIterator);
}
public void printMenu(Iterator iterator){
while (iterator.hasNext()){
MenuItem menuItem = (MenuItem)iterator.next();
System.out.println("name: " + menuItem.getName());
System.out.println("description: " + menuItem.getDescription());
System.out.println("vegetarian: " + (menuItem.isVegetarian()?"yes":"no"));
System.out.println("price: " + menuItem.getPrice());
}
}
}
| [
"nghiapv@ants.vn"
] | nghiapv@ants.vn |
08ceb90eab101d1bb7bea78732303a26a4faaa67 | b72ededb7076c548e5c1e84d31ef55237ab2e1ce | /src/main/java/com/example/mongoRepository/ShopsRepository.java | 7f7b613e66f64a3186538b334a47740c23d960fd | [] | no_license | 20ayoub/Shops | a666145a4e3eb60d1f50c792dfc45e1645ec4d59 | 0c57a834f34c659e503acc51dc9307e5d89f504b | refs/heads/master | 2021-05-07T05:46:24.239600 | 2017-12-22T20:22:58 | 2017-12-22T20:22:58 | 111,592,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 217 | java | package com.example.mongoRepository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.example.model.Shop;
public interface ShopsRepository extends MongoRepository<Shop , String> {
}
| [
"ayoub.elberrahoui@gmail.com"
] | ayoub.elberrahoui@gmail.com |
8eac8a539f9b363050ff743e1e8d1c59334a2bee | 2227e549625f79aff262c49728d51bc732da792f | /src/main/java/com/internship/tmontica_ui/order/model/request/OrderMenusReq.java | 7658467441a8d71adf118e73237211e5071e1077 | [] | no_license | misudev/tmontica-ui | fe21325aa644fac90b8c2766dd3200be1baf11d9 | 1ce8b3f6f148c6483562f07f7c0af169e510803e | refs/heads/master | 2020-07-07T11:11:42.577006 | 2019-08-20T08:24:42 | 2019-08-20T08:24:42 | 203,332,788 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package com.internship.tmontica_ui.order.model.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderMenusReq {
@Min(1)
private int cartId;
}
| [
"jungmisu@tmon.co.kr"
] | jungmisu@tmon.co.kr |
593cdad134368cf7dc7e661d83a452a1e650b0b5 | f16c9c629a4b7a6edee55c4db60f62d5c60a5f02 | /service/src/main/java/by/itacademy/elegantsignal/marketplace/service/impl/LikeServiceImpl.java | 11f9b4c5f2c0c1aa03d4c9564965f5937c14d677 | [] | no_license | pantafive/marketplace | 01ad6442ecfe84fa8a9288cbd972f09566d26770 | 50c751f6f7c63c843d9064931c2afd84faa0a63f | refs/heads/master | 2022-09-25T07:22:45.485241 | 2020-06-04T13:42:48 | 2020-06-04T13:42:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,287 | java | package by.itacademy.elegantsignal.marketplace.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import by.itacademy.elegantsignal.marketplace.daoapi.ILikeDao;
import by.itacademy.elegantsignal.marketplace.daoapi.entity.table.ILike;
import by.itacademy.elegantsignal.marketplace.service.ILikeService;
@Service
public class LikeServiceImpl implements ILikeService {
private final ILikeDao likeDao;
@Autowired
public LikeServiceImpl(final ILikeDao likeDao) {
this.likeDao = likeDao;
}
@Override
public ILike createEntity() {
return likeDao.createEntity();
}
@Override
public void save(final ILike entity) {
final Date modifiedOn = new Date();
if (entity.getId() == null) {
entity.setCreated(modifiedOn);
likeDao.insert(entity);
} else {
throw new RuntimeException("Update for Like filed unawalible. Only delete and create");
}
}
@Override
public ILike get(final Integer id) {
return likeDao.get(id);
}
@Override
public void delete(final Integer id) {
likeDao.delete(id);
}
@Override
public void deleteAll() {
likeDao.deleteAll();
}
@Override
public List<ILike> getAll() {
return likeDao.selectAll();
}
}
| [
"elegantsignal@gmail.com"
] | elegantsignal@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.