blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
0b0bc324128ebb1e3da705c23363b1cf91fe16db
0ba86ba83701de32c9bc54d1ca6756136bcddcfb
/pro/panagram.java
acb28afbd82ca081356ea0ee722466039ce75b30
[]
no_license
Radhika96/rad
ccb8c452b0399436656ab1b4b6cd090752a49ebb
000aae447e55591d1ea5006658dcdeeb9195c82a
refs/heads/master
2020-06-26T20:51:27.883965
2016-09-12T11:18:00
2016-09-12T11:18:00
66,439,997
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
import java.util.Scanner; public class panagram { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); String str=sc.nextLine(); char ck='a';char ch;String out =""; str.toLowerCase(); for(int i=0; i<str.length(); i++) { ch = str.charAt(i); if(ch!=' ') out = out + ch; str = str.replace(ch,' '); } if(out.length()>=26) System.out.println("Panagram"); else System.out.println("Not panagram"); sc.close(); } }
[ "noreply@github.com" ]
Radhika96.noreply@github.com
6f0021f603e54b4eb41745a327cc3f485eb2fe83
6d1a2cb069ad1e3ecd0ce69a5fa6eed6d22c01d9
/No10/GZIPTest.java
ab996ce5dfbdc0f26423ec52f24fcbb2b20191da
[]
no_license
job3-14/EvolutionProgrammingExercises
619aabd7363f9c69d46739c9e19f54d66dc33b92
a331913d32fb52c37b66b6c342d1c4a046c45fa8
refs/heads/master
2023-07-01T03:02:52.742295
2021-08-08T23:27:30
2021-08-08T23:27:30
357,017,551
0
0
null
null
null
null
UTF-8
Java
false
false
976
java
import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.GZIPOutputStream; /** * * @author tool-taro.com */ public class GZIPTest { public static void main(String[] args) throws IOException { //圧縮対象のデータ(今回は文字列) String source = "これはテストです。\n以上。"; //圧縮後のファイルの保存場所 String outputFilePath = "output.txt.gz"; //圧縮前にバイト配列に置き換える際のエンコーディング String encoding = "UTF-8"; GZIPOutputStream gout = null; try { gout = new GZIPOutputStream(new FileOutputStream(outputFilePath)); gout.write(source.getBytes(encoding)); } finally { if (gout != null) { try { gout.close(); } catch (IOException e) { } } } } }
[ "amu@sakai.pro" ]
amu@sakai.pro
37224c96d4408f97a0bad3fc3d27b559d5f83085
4b76b84bb58f70742249975f51a1147499956fa5
/app/src/main/java/cz/msebera/android/httpclient/nio/entity/ProducingNHttpEntity.java
ef50524491884664ea4deb8f67b6d7fe0f986fba
[]
no_license
Loadhao/CoAPService
b6abe19fc6f6d5240ea9591881026094aa4fa738
455c8f99d20ccfe0b042f9c9480efdf9ae326591
refs/heads/master
2020-04-22T13:57:58.241442
2017-08-14T02:06:25
2017-08-14T02:06:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,575
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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package cz.msebera.android.httpclient.nio.entity; import java.io.IOException; import cz.msebera.android.httpclient.HttpEntity; import cz.msebera.android.httpclient.nio.ContentEncoder; import cz.msebera.android.httpclient.nio.IOControl; /** * An {@link HttpEntity} that can stream content out into a * {@link ContentEncoder}. * * @since 4.0 * * @deprecated use (4.2) * {@link cz.msebera.android.httpclient.nio.protocol.BasicAsyncRequestProducer} * or {@link cz.msebera.android.httpclient.nio.protocol.BasicAsyncResponseProducer} */ @Deprecated public interface ProducingNHttpEntity extends HttpEntity { /** * Notification that content should be written to the encoder. * {@link IOControl} instance passed as a parameter to the method can be * used to suspend output events if the entity is temporarily unable to * produce more content. * <p> * When all content is finished, this <b>MUST</b> call {@link ContentEncoder#complete()}. * Failure to do so could result in the entity never being written. * * @param encoder content encoder. * @param ioctrl I/O control of the underlying connection. */ void produceContent(ContentEncoder encoder, IOControl ioctrl) throws IOException; /** * Notification that any resources allocated for writing can be released. */ void finish() throws IOException; }
[ "1350212947@qq.com" ]
1350212947@qq.com
1f3ff29bdaa76899b0e2ea6dd0b922a0d64cabcd
211ecd0fd487040a42fbdd81f6a4ab0cacd6e8d8
/src/main/java/jm/task/core/jdbc/dao/UserDaoJDBCImpl.java
70f20b7a554ba7c36189585f2efd18f0a4271ea3
[]
no_license
Iwor-s/PP_1.1.4_Hibernate
91c5607c668603e6a0c2f2bced2a142a5147f1e2
f490831fd1cc7cb1a7537d5efeab78dc4c1e8ca3
refs/heads/main
2023-07-11T08:15:34.675619
2021-08-17T14:45:00
2021-08-17T20:15:48
394,325,548
0
0
null
null
null
null
UTF-8
Java
false
false
3,355
java
package jm.task.core.jdbc.dao; import jm.task.core.jdbc.model.User; import jm.task.core.jdbc.util.Util; import java.sql.*; import java.util.ArrayList; import java.util.List; public class UserDaoJDBCImpl implements UserDao { public UserDaoJDBCImpl() { } public void createUsersTable() { try (Statement statement = Util.getJDBC().createStatement()) { statement.executeUpdate(SQLUser.CREATE_TABLE.QUERY); } catch (SQLException e) { e.printStackTrace(); } } public void dropUsersTable() { try (Statement statement = Util.getJDBC().createStatement()) { statement.executeUpdate(SQLUser.DROP_TABLE.QUERY); } catch (SQLException e) { e.printStackTrace(); } } public void saveUser(String name, String lastName, byte age) { try (PreparedStatement preparedStatement = Util.getJDBC() .prepareStatement(SQLUser.INSERT.QUERY)) { preparedStatement.setString(1, name); preparedStatement.setString(2, lastName); preparedStatement.setByte(3, age); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } System.out.printf("User с именем %s добавлен в базу данных\n", name); } public void removeUserById(long id) { try (PreparedStatement preparedStatement = Util.getJDBC() .prepareStatement(SQLUser.DELETE_ID.QUERY)) { preparedStatement.setLong(1, id); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } public List<User> getAllUsers() { List<User> usersList = new ArrayList<>(); try (Statement statement = Util.getJDBC().createStatement()) { ResultSet data = statement.executeQuery(SQLUser.SELECT.QUERY); while (data.next()) { User user = new User( data.getString("name"), data.getString("lastName"), data.getByte("age")); user.setId(data.getLong("id")); usersList.add(user); } } catch (SQLException e) { e.printStackTrace(); } return usersList; } public void cleanUsersTable() { try (Statement statement = Util.getJDBC().createStatement()) { statement.executeUpdate(SQLUser.DELETE_ALL.QUERY); } catch (SQLException e) { e.printStackTrace(); } } private enum SQLUser { CREATE_TABLE("CREATE TABLE IF NOT EXISTS `users` (" + "`id` SERIAL PRIMARY KEY, " + "`name` VARCHAR(45) NOT NULL, " + "`lastName` VARCHAR(45) NOT NULL, " + "`age` TINYINT UNSIGNED NOT NULL)"), DROP_TABLE("DROP TABLE IF EXISTS users"), INSERT("INSERT INTO users (id, name, lastName, age) " + "VALUES (DEFAULT, ?, ?, ?)"), SELECT("SELECT * FROM users"), DELETE_ID("DELETE FROM users WHERE id = (?)"), DELETE_ALL("DELETE FROM users"); private final String QUERY; SQLUser(String query) { this.QUERY = query; } } }
[ "iwor@list.ru" ]
iwor@list.ru
690b8f67696e82e590a3fc6aa5e236fcc34c2902
3cbfbfde3adcc1f5fc370c2816755d82e6ec9f7f
/src/mycom/test/mybatis/test/MybatisTest.java
cc20fb66c559d56738110f1eb81bd9b01cb0e1c6
[]
no_license
olafo7/LIMS
9cfad127fe96f12cfca7d9453b0c20dcdf29fe61
367293439b4b434af00bdf52da35abc55b9939a6
refs/heads/master
2020-03-22T13:14:41.709437
2018-03-04T10:42:08
2018-03-04T10:42:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,002
java
package mycom.test.mybatis.test; import java.io.IOException; import java.io.InputStream; import java.sql.Timestamp; import java.util.HashMap; import java.util.List; import java.util.Map; import mycom.dao.CommonMapper; import mycom.dao.DefineAnalysisItemsMapper; import mycom.dao.MfrMapper; import mycom.dao.ModelAnalysisItemsMapper; import mycom.dao.SampleAnalysisItemsMapper; import mycom.dao.SampleMapper; import mycom.pojo.Mfr; import mycom.pojo.ModelAnalysisItems; import mycom.pojo.Sample; import mycom.test.mybatis.domain.LimsTest; import mycom.util.dbutil; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; public class MybatisTest { public static void main(String[] args) throws IOException { //mybatis的配置文件 String resource = "conf.xml"; //使用类加载器加载mybatis的配置文件(它也加载关联的映射文件) InputStream is = MybatisTest.class.getClassLoader().getResourceAsStream(resource); //构建sqlSession的工厂 SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(is); //使用MyBatis提供的Resources类加载mybatis的配置文件(它也加载关联的映射文件) //Reader reader = Resources.getResourceAsReader(resource); //构建sqlSession的工厂 //SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(reader); //创建能执行映射文件中sql的sqlSession SqlSession session = sessionFactory.openSession(); System.out.println("-------------------------"); int sampleId = 34; String tableName = "mfr"; //使用分析项目分表的表名和sampleId,获取该分析项目数值,没有数值的,表示为null;交给前端显示; Map<String, Object> map = new HashMap<String, Object>(); map.put("tableName", "`" + tableName + "`"); map.put("analyser", 11); map.put("sampleId", sampleId); CommonMapper analysisItems = session.getMapper(CommonMapper.class); Object obj = analysisItems.updateCommon(map); System.out.println(obj); /* MfrMapper mfr = session.getMapper(MfrMapper.class); Mfr record = new Mfr(); int analyser = 32323; int id = 2; record.setAnalyser(analyser); record.setId(id); mfr.updateByPrimaryKeySelective(record); mfr.updateByPrimaryKey(record); int sampleId = 28; String tableName = "mfr"; //使用分析项目分表的表名和sampleId,获取该分析项目数值,没有数值的,表示为null;交给前端显示; Map<String, Object> map = new HashMap<String, Object>(); map.put("tableName", "`" + tableName + "`"); map.put("sampleId", sampleId); CommonMapper analysisItems = session.getMapper(CommonMapper.class); Map analysisItemsMap = analysisItems.selectAnalysisItemsMap(map); //这个地方是从分析方法分表中获取到的analysisItemsMap是右值; Map<String, Object> map1 = new HashMap<String, Object>(); map1.put("tableName", tableName); //现在获取左值;也就是使用tableName,从defineAnalysisItems表中分析项目的详细信息; DefineAnalysisItemsMapper analysisItemDetail = session.getMapper(DefineAnalysisItemsMapper.class); Map analysisItemDetailMap = analysisItemDetail.selectBytableName(map1); System.out.println("sssss"); int sampleId = 25; SampleAnalysisItemsMapper obj = session.getMapper(SampleAnalysisItemsMapper.class); String tableName = obj.selectTableNameBySampleId(sampleId); String[] tableNameArray = tableName.split("\\|"); System.out.println(tableNameArray[1]); Map<String, Object> map = new HashMap<String, Object>(); map.put("tableName", "`" + tableNameArray[1] + "`"); map.put("sampleId", sampleId); CommonMapper analysisItems = session.getMapper(CommonMapper.class); Map analysisItemsMap = analysisItems.selectAnalysisItemsMap(map); System.out.println(analysisItemsMap.toString()); int departmentId = 1; byte status = 0; Map<String, Object> map = new HashMap<String, Object>(); map.put("departmentId", departmentId); map.put("status", status); SampleMapper sample = session.getMapper(SampleMapper.class); List<Sample> result = sample.selectSampleByDeparmentIdAndStatus(map); System.out.println(result.get(0).getName()); CommonMapper common = session.getMapper(CommonMapper.class); //在各个分析表中插入一条记录,只给表名和name(使用sample的值),sampleId属性; String tableName ="meltFlowRate"; int sampleId = 21; Map<String, Object> map = new HashMap<String, Object>(); map.put("tableName", "`" + tableName + "`"); map.put("sampleId", sampleId); int res = common.insertSample(map);*/ /** * 映射sql的标识字符串, * me.gacl.mapping.userMapper是userMapper.xml文件中mapper标签的namespace属性的值, * getUser是select标签的id属性值,通过select标签的id属性值就可以找到要执行的SQL */ /* String statement = "mycom.test.mybatis.mapping.limsTestMapper.getTest";//映射sql的标识字符串 LimsTest test = session.selectOne(statement, 1); System.out.println(test); String statement2 = "mycom.dao.SampleMapper.selectByPrimaryKey";//映射sql的标识字符串 Sample result = session.selectOne(statement2, 2); System.out.println(result.getName()); String statement3 = "mycom.dao.SampleMapper.selectAll";//映射sql的标识字符串 List<Sample> result3 = session.selectList(statement3); System.out.println(result3.get(0).getName());*/ System.out.println("-------------------------"); /* //使用动态代理的方式,直接调用方法,无需映射sql的标识字符串 SampleMapper sample = session.getMapper(SampleMapper.class); Sample oneSample = sample.selectByPrimaryKey(1); System.out.println(oneSample.getName()); List<Sample> sampleList= sample.selectAll(); System.out.println(sampleList.get(2).getName()); AnalysisItemsMapper obj = session.getMapper(AnalysisItemsMapper.class); List<AnalysisItems> result2 = obj.selectAll(); System.out.println(result2.get(0).getName()); ModelAnalysisItemsMapper obj2 = session.getMapper(ModelAnalysisItemsMapper.class); List<ModelAnalysisItems> result4 = obj2.selectByModelId(1); System.out.println(result4.get(1).getAnalysisitemid()); int[] ids = {1,2}; AnalysisItemsMapper obj3 = session.getMapper(AnalysisItemsMapper.class); List<AnalysisItems> result5 = obj3.selectByIds(ids); System.out.println(result5.get(0).getName()); SampleMapper sample = session.getMapper(SampleMapper.class); Sample sampleObj = new Sample(); sampleObj.setCreater(11); sampleObj.setDepartmentid(1); sampleObj.setModelname("qqw"); sampleObj.setName("qqq"); sampleObj.setStatus((byte) 1); //Date Timestamp samplingTime = new Timestamp(System.currentTimeMillis()); Timestamp creationTime = new Timestamp(System.currentTimeMillis()); sampleObj.setSamplingtime(samplingTime); sampleObj.setCreationtime(creationTime ); Object res = sample.insertSelective(sampleObj); System.out.println(res); List<Sample> res2 = sample.selectAll(); System.out.println(res2.get(2).getName()); */ session.commit(); session.close(); } }
[ "1575094345@qq.com" ]
1575094345@qq.com
ca65b320aac97cf2732f5cef6bb3660e33703b07
98ac820cbdfd3be7686f1d6680b1d5a33b823491
/CommonUtilPersistance2/src/main/java/com/persistance/jpa/bean/ReservationJPABean.java
e618153a3ad3a16880429194fd3ccee609c792c9
[]
no_license
anghildiyal/springboot
3d2968e799bac9d654d39f8d5609393506b492e3
15c16febef302ae072b0616ad4cebc078dc004bd
refs/heads/master
2020-03-20T09:35:47.247984
2018-08-09T15:16:48
2018-08-09T15:16:48
137,341,768
0
0
null
null
null
null
UTF-8
Java
false
false
1,823
java
package com.persistance.jpa.bean; import java.io.Serializable; import java.sql.Timestamp; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; @Entity @Table(name = "Reservation") public class ReservationJPABean implements Serializable { @Id @Column(name = "id") private Long id; @Column(name = "dt") private Timestamp dt; @Column(name = "user_id") private Long userId; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "restaurantId") private RestaurantJPABean restaurantId; @Column(name = "party_size") private int partySize; public ReservationJPABean() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Timestamp getDt() { return dt; } public void setDt(Timestamp dt) { this.dt = dt; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public int getPartySize() { return partySize; } public void setPartySize(int partySize) { this.partySize = partySize; } public RestaurantJPABean getRestaurant() { return restaurantId; } public void setRestaurant(RestaurantJPABean restaurantId) { this.restaurantId = restaurantId; } @Override public String toString() { return "Reservation [id=" + id + ", dt=" + dt + ", userId=" + userId + ", partySize=" + partySize + "]"; } public ReservationJPABean(Long id, Timestamp dt, Long userId, Long restaurantId, int partySize) { super(); this.id = id; this.dt = dt; this.userId = userId; this.partySize = partySize; } }
[ "anghildiyal@deloitte.com" ]
anghildiyal@deloitte.com
e36632465060a094e2eedc4cf17a38575738bf60
ea45ba5c551840b5c07c14b40c33459a51fdd3ad
/src/test/java/pl/yameo/recruitmenttask/IntegrationTests.java
c137ff98e017ef17ebb57247b54ddf2299a2e193
[]
no_license
danielzeliazkow/yameo
cb260bd84237444943a4692e53aec4f9ce08b27a
21b0ada097ee4b0d791c767725894164b1f36533
refs/heads/master
2020-03-18T06:58:45.670126
2018-05-22T14:10:54
2018-05-22T14:10:54
134,424,724
0
0
null
null
null
null
UTF-8
Java
false
false
3,936
java
package pl.yameo.recruitmenttask; import org.apache.commons.io.IOUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockserver.client.server.MockServerClient; import org.mockserver.model.HttpStatusCode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import pl.yameo.recruitmenttask.RecrutimentTaskApplication; import pl.yameo.recruitmenttask.dto.FileStatisticsDetails; import pl.yameo.recruitmenttask.dto.FileStatistics; import java.io.IOException; import java.math.BigDecimal; import java.time.LocalDateTime; import static org.junit.Assert.assertEquals; import static org.mockserver.integration.ClientAndServer.startClientAndServer; import static org.mockserver.model.HttpRequest.request; import static org.mockserver.model.HttpResponse.response; import static org.mockserver.model.BinaryBody.binary; @RunWith(SpringRunner.class) @SpringBootTest(classes = RecrutimentTaskApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class IntegrationTests { private static final int MOCK_SERVER_PORT = 1080; private static final String MOCKED_SERVER_PATH_TO_FILE = "/getTestFile"; private static final String MOCKED_SERVER_URL = "http://localhost:1080"; private static final String FILE_NAME = "Posts.xml"; @Autowired private ResourceLoader resourceLoader; @LocalServerPort private int port; private TestRestTemplate restTemplate = new TestRestTemplate(); @Before public void setUpMockedServer() throws IOException { startClientAndServer(1080); setUpExpectations(FILE_NAME); } @Test public void testFileController() { ResponseEntity<FileStatistics> response = restTemplate.exchange( createURLWithPort("/analyze"), HttpMethod.POST, createHttpEntity(), FileStatistics.class); assertEquals(HttpStatus.OK ,response.getStatusCode()); FileStatisticsDetails statiscicsRespone = response.getBody().getDetails(); assertEquals(new BigDecimal("2.849"), statiscicsRespone.getAvgScore()); LocalDateTime expectedFirstPostDate = LocalDateTime.parse("2017-08-02T19:22:36.567"); assertEquals(expectedFirstPostDate, statiscicsRespone.getFirstPostDate()); LocalDateTime expectedLastPostDate = LocalDateTime.parse("2018-03-07T20:21:34.083"); assertEquals(expectedLastPostDate, statiscicsRespone.getLastPostDate()); } private String createURLWithPort(String uri) { return "http://localhost:" + port + uri; } @SuppressWarnings("resource") private void setUpExpectations(String fileName) throws IOException { Resource resource = resourceLoader.getResource("classpath:"+fileName); byte[] bytes = IOUtils.toByteArray(resource.getInputStream()); new MockServerClient("localhost", MOCK_SERVER_PORT) .when( request() .withPath(MOCKED_SERVER_PATH_TO_FILE) ) .respond( response() .withStatusCode(HttpStatusCode.OK_200.code()) .withBody(binary(bytes)) ); } private HttpEntity<MultiValueMap<String, String>> createHttpEntity() { MultiValueMap<String, String> map= new LinkedMultiValueMap<>(); map.add("url", MOCKED_SERVER_URL+MOCKED_SERVER_PATH_TO_FILE); return new HttpEntity<>(map, new HttpHeaders()); } }
[ "danielzeliazkow@gmail.com" ]
danielzeliazkow@gmail.com
c7fbf12ed784938a4dbdbd6d6fb159e0b7c3a88f
07a597678e51ceed29d1853750a2f01eefdce462
/src/modelo/Instructions.java
29b6b8345c339e746e9e6fade4e94a40b5cd1e39
[]
no_license
cabandroid/proyectoenglishways
011f362243d80b0c3f62431d1e10f3cf5e6d7cc0
78ecc7eb08f100bd08b5876d2ccd53c6eb6f6afe
refs/heads/master
2020-05-24T18:22:57.144275
2019-05-18T22:40:10
2019-05-18T22:40:10
187,408,561
0
0
null
null
null
null
UTF-8
Java
false
false
1,475
java
package modelo; import java.awt.Cursor; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; public class Instructions extends JFrame implements ActionListener { JLabel l1; JButton b11; int sw1 = 0; public String nickName; public Instructions() { l1 = new JLabel(); b11 = new JButton(); setLayout(null); this.setTitle("Instructions"); ImageIcon intro = new ImageIcon("instructionss.png"); l1.setIcon(new ImageIcon(intro.getImage().getScaledInstance(600, 300, Image.SCALE_SMOOTH))); ImageIcon play = new ImageIcon("return.png"); b11.setIcon(new ImageIcon(play.getImage().getScaledInstance(80, 80, Image.SCALE_SMOOTH))); l1.setBounds(0, 0, 600, 300); b11.setBounds(0, 0, 80, 80); b11.setBorderPainted(false); b11.setCursor(new Cursor(Cursor.HAND_CURSOR)); add(b11); add(l1); b11.addActionListener(this); setBounds(230, 63, 600, 330); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); } public void actionPerformed(ActionEvent e) { if (e.getSource() == b11) { System.out.println("Opcion 1 ejecutada con exito"); dispose(); } } }
[ "DAVID@LAPTOP-1H63TM8L" ]
DAVID@LAPTOP-1H63TM8L
23e9f719e5fb509be8a9f26aa8cdd4b2ea3333b0
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.3-rc2/mule/src/java/org/mule/routing/outbound/AbstractMessageSplitter.java
bf90f3d58ec8265af399d16ba7613676e1e71bcc
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-symphonysoft" ]
permissive
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
4,584
java
/* * $Header$ * $Revision$ * $Date$ * ------------------------------------------------------------------------------------------------------ * * Copyright (c) SymphonySoft Limited. All rights reserved. * http://www.symphonysoft.com * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.mule.routing.outbound; import org.mule.config.MuleProperties; import org.mule.umo.UMOException; import org.mule.umo.UMOMessage; import org.mule.umo.UMOSession; import org.mule.umo.endpoint.UMOEndpoint; import org.mule.umo.routing.CouldNotRouteOutboundMessageException; import org.mule.umo.routing.RoutingException; import java.util.Iterator; import java.util.List; /** * <code>AbstractMessageSplitter</code> is an outbound Message Splitter used * to split the contents of a received message into sup parts that can be * processed by other components. * * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a> * @version $Revision$ */ public abstract class AbstractMessageSplitter extends FilteringOutboundRouter { // determines if the same endpoint will be matched multiple // times until a match is not found // This should be set by overriding classes protected boolean multimatch = true; public UMOMessage route(UMOMessage message, UMOSession session, boolean synchronous) throws RoutingException { String correlationId = (String) propertyExtractor.getProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY, message); initialise(message); UMOEndpoint endpoint; // UMOMessage message; UMOMessage result = null; List list = getEndpoints(); int i = 1; for (Iterator iterator = list.iterator(); iterator.hasNext();) { endpoint = (UMOEndpoint) iterator.next(); message = getMessagePart(message, endpoint); if (message == null) { // Log a warning if there are no messages for a given endpoint logger.warn("Message part is null for endpoint: " + endpoint.getEndpointURI().toString()); } // We'll keep looping to get all messages for the current endpoint // before moving to the next endpoint // This can be turned off by setting the multimatch flag to false while (message != null) { try { if (enableCorrelation != ENABLE_CORRELATION_NEVER) { boolean correlationSet = message.getCorrelationId() != null; if (!correlationSet && (enableCorrelation == ENABLE_CORRELATION_IF_NOT_SET)) { message.setCorrelationId(correlationId); } // take correlation group size from the message // properties, set by concrete message splitter // implementations final int groupSize = message.getCorrelationGroupSize(); message.setCorrelationGroupSize(groupSize); message.setCorrelationSequence(i++); } if (synchronous) { result = send(session, message, endpoint); } else { dispatch(session, message, endpoint); } } catch (UMOException e) { throw new CouldNotRouteOutboundMessageException(message, endpoint, e); } if (!multimatch) { break; } message = getMessagePart(message, endpoint); } } return result; } /** * Template method can be used to split the message up before the * getMessagePart method is called . * * @param message the message being routed */ protected void initialise(UMOMessage message) { } /** * Retrieves a specific message part for the given endpoint. the message * will then be routed via the provider. * * @param message the current message being processed * @param endpoint the endpoint that will be used to route the resulting * message part * @return the message part to dispatch */ protected abstract UMOMessage getMessagePart(UMOMessage message, UMOEndpoint endpoint); }
[ "(no author)@bf997673-6b11-0410-b953-e057580c5b09" ]
(no author)@bf997673-6b11-0410-b953-e057580c5b09
b930a5f6bef7b6d4c1dab1aa1c6cfe07e006f53e
7c51b926ddb0ba883ae340c0ee2d69cd324db0fe
/app/src/main/java/project/wgu/sutton/devin/groceryinventory/activites/LocationDetailActivity.java
d56006415e1003e8c5f769e1eabf904c2e36abf9
[]
no_license
devinsutton90/GroceryInventory
964ddbeb194c913c3c24a8d2fb7185ac546316ad
79ea29de80c6a18eb16f363e5429089cd559b789
refs/heads/master
2021-08-31T16:34:35.764420
2017-12-22T03:21:15
2017-12-22T03:21:15
115,071,930
0
0
null
null
null
null
UTF-8
Java
false
false
7,140
java
package project.wgu.sutton.devin.groceryinventory.activites; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.RelativeLayout; import android.widget.Spinner; import java.util.ArrayList; import project.wgu.sutton.devin.groceryinventory.R; import project.wgu.sutton.devin.groceryinventory.database.DataProvider; import project.wgu.sutton.devin.groceryinventory.model.Food; import project.wgu.sutton.devin.groceryinventory.model.Location; public class LocationDetailActivity extends AppCompatActivity { public static final int NEW_SOURCE_CODE = 1; public static final int DETAIL_SOURCE_CODE = 2; public static final int EDIT_SOURCE_CODE =3; private int id; private int source; private DataProvider dataProvider; private Location location; private EditText name; private Spinner typeSpinner; private ArrayAdapter<CharSequence> typeSpinnerAdapter; private Button save; private Button cancel; private RelativeLayout layout; @Override public boolean onCreateOptionsMenu(Menu menu){ if(getIntent().getIntExtra("SOURCE", -1) == DETAIL_SOURCE_CODE){ MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.location_detail_menu, menu); return true; } else { return false; } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()){ case R.id.edit_location: Intent editIntent = new Intent(LocationDetailActivity.this, LocationDetailActivity.class); editIntent.putExtra("SOURCE", EDIT_SOURCE_CODE); editIntent.putExtra("LOCATION_ID", location.getId()); startActivity(editIntent); return true; case R.id.delete_location: if (checkLocationEmpty(id)){ dataProvider.deleteLocation(location); returnMainActivity(); return true; } else { System.out.println("Location cannot be deleted if not empty"); } } return false; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_location_detail); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); name = findViewById(R.id.nameEditText); typeSpinner = findViewById(R.id.locationTypeSpinner); save = findViewById(R.id.saveButton); cancel = findViewById(R.id.cancelButton); layout = findViewById(R.id.locationDetailLayout); source = getIntent().getIntExtra("SOURCE", -1); id = getIntent().getIntExtra("LOCATION_ID", -1); dataProvider = new DataProvider(this); dataProvider.open(); populateSpinner(); switch (source){ case NEW_SOURCE_CODE: cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { returnMainActivity(); } }); save.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(checkFields()){ Location newLocation = new Location(); newLocation.setName(name.getText().toString().trim()); newLocation.setType(typeSpinner.getSelectedItem().toString().trim()); dataProvider.addLocation(newLocation); returnMainActivity(); } else { System.out.println("Missing fields"); } } }); break; case DETAIL_SOURCE_CODE: location = dataProvider.getLocation(id); populateFields(location); enableFields(false); layout.removeViewInLayout(save); layout.removeViewInLayout(cancel); break; case EDIT_SOURCE_CODE: location = dataProvider.getLocation(id); populateFields(location); enableFields(true); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { returnMainActivity(); } }); save.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(checkFields()){ location.setName(name.getText().toString().trim()); location.setType(typeSpinner.getSelectedItem().toString().trim()); dataProvider.updateLocation(location); returnMainActivity(); } else { System.out.println("Missing fields"); } } }); break; } } private void populateFields(Location location){ name.setText(location.getName()); String type = location.getType(); int spinnerTypePosition = typeSpinnerAdapter.getPosition(type); typeSpinner.setSelection(spinnerTypePosition); } private void populateSpinner() { typeSpinner = findViewById(R.id.locationTypeSpinner); typeSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.location_type, android.R.layout.simple_spinner_item); typeSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); typeSpinner.setAdapter(typeSpinnerAdapter); } private void enableFields(boolean bool){ name.setEnabled(bool); typeSpinner.setEnabled(bool); } private void returnMainActivity() { Intent homeIntent = new Intent(LocationDetailActivity.this, MainActivity.class); startActivity(homeIntent); } private boolean checkFields(){ if(name.getText().toString().trim() != null){ return true; } else { return false; } } private boolean checkLocationEmpty(int id){ ArrayList<Food> foods = dataProvider.getLocationFood(id); if(foods.isEmpty()){ return false; } else { return true; } } }
[ "devinsutton90@gmail.com" ]
devinsutton90@gmail.com
82be1daa8a8737cc060a6776dba9dae8e32e02a7
ddc6d977e2f136f0624ca50a93bd26952fde7ca9
/game/script/com/l2jserver/datapack/quests/Q00155_FindSirWindawood/Q00155_FindSirWindawood.java
a4add6f39330bed8f4a527288cc37cb67318b684
[]
no_license
lorranluck/L2jServerH5
f8030b27c5b7990cc9201b8a921306a5f653a3f0
b3e07b7d05e4cabe744b53ee738d459af19f171d
refs/heads/master
2022-12-02T15:06:50.804284
2020-08-19T23:11:32
2020-08-19T23:11:32
288,535,211
0
0
null
null
null
null
UTF-8
Java
false
false
2,760
java
/* * Copyright © 2004-2020 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.datapack.quests.Q00155_FindSirWindawood; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.model.quest.State; /** * Find Sir Windawood (155) * @author malyelfik */ public class Q00155_FindSirWindawood extends Quest { // NPCs private static final int ABELLOS = 30042; private static final int SIR_COLLIN_WINDAWOOD = 30311; // Items private static final int OFFICIAL_LETTER = 1019; private static final int HASTE_POTION = 734; // Misc private static final int MIN_LEVEL = 3; public Q00155_FindSirWindawood() { super(155, Q00155_FindSirWindawood.class.getSimpleName(), "Find Sir Windawood"); addStartNpc(ABELLOS); addTalkId(ABELLOS, SIR_COLLIN_WINDAWOOD); registerQuestItems(OFFICIAL_LETTER); } @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if ((st != null) && event.equalsIgnoreCase("30042-03.htm")) { st.startQuest(); st.giveItems(OFFICIAL_LETTER, 1); return event; } return null; } @Override public String onTalk(L2Npc npc, L2PcInstance player) { String htmltext = getNoQuestMsg(player); final QuestState st = getQuestState(player, true); switch (npc.getId()) { case ABELLOS: switch (st.getState()) { case State.CREATED: htmltext = (player.getLevel() >= MIN_LEVEL) ? "30042-02.htm" : "30042-01.htm"; break; case State.STARTED: htmltext = "30042-04.html"; break; case State.COMPLETED: htmltext = getAlreadyCompletedMsg(player); break; } break; case SIR_COLLIN_WINDAWOOD: if (st.isStarted() && st.hasQuestItems(OFFICIAL_LETTER)) { st.giveItems(HASTE_POTION, 1); st.exitQuest(false, true); htmltext = "30311-01.html"; } break; } return htmltext; } }
[ "luck_roxy@live.com" ]
luck_roxy@live.com
62af05f715035b334f36fc72dec2095c919d2228
6756d35986a0e3f2a5a1439dc2a43a84e379c647
/subprojects/backend/src/main/java/com/jeeweb/platform/configure/PlatformMybatisConfiguration.java
41b1db06d6e9770d867bef5cc5e83afdf41b6023
[]
no_license
yuanjinyong/jeeweb
528e217ca2357a23813d7fe2b1e70f76169cf596
38c89d217c30488c2068b8ef17dbfe2a246f0c76
refs/heads/master
2021-01-19T13:37:22.380225
2018-01-29T10:25:35
2018-01-29T10:25:35
82,402,589
0
0
null
null
null
null
UTF-8
Java
false
false
2,519
java
/** * */ package com.jeeweb.platform.configure; import javax.sql.DataSource; import org.apache.ibatis.mapping.DatabaseIdProvider; import org.apache.ibatis.plugin.Interceptor; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.util.ObjectUtils; /** * @author 袁进勇 * */ @Configuration @MapperScan(basePackages = { "com.jeeweb.platform.**.mapper.**" }, sqlSessionTemplateRef = "platformSqlSessionTemplate") public class PlatformMybatisConfiguration { @Autowired(required = false) private Interceptor[] interceptors; @Autowired(required = false) private DatabaseIdProvider databaseIdProvider; @Value("${mybatis.mapper.platform.typeAliasesPackage:com.jeeweb.platform.**.entity}") private String typeAliasesPackage; @Value("${mybatis.mapper.platform.mapperLocations:classpath:/com/jeeweb/platform/**/mapper/*Mapper.xml}") private String mapperLocations; @Bean(name = "platformSqlSessionFactory") public SqlSessionFactory platformSqlSessionFactory(@Qualifier("defaultDataSource") DataSource dataSource) throws Exception { SqlSessionFactoryBean factory = new SqlSessionFactoryBean(); factory.setDataSource(dataSource); if (!ObjectUtils.isEmpty(this.interceptors)) { factory.setPlugins(this.interceptors); } if (this.databaseIdProvider != null) { factory.setDatabaseIdProvider(this.databaseIdProvider); } factory.setTypeAliasesPackage(typeAliasesPackage); factory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations)); return factory.getObject(); } @Bean(name = "platformSqlSessionTemplate") public SqlSessionTemplate platformSqlSessionTemplate( @Qualifier("platformSqlSessionFactory") SqlSessionFactory sqlSessionFactory) { return new SqlSessionTemplate(sqlSessionFactory); } }
[ "yjyffc@163.com" ]
yjyffc@163.com
c255aa330f68a9959264f042784932a1deec9ec5
989acabc2d8e62e0f9166e8b8311e1840dfbead9
/workspace/java01/src/제어문/조건문.java
bd05fb7349dc5baf98808501ec0c618cadb365fe
[]
no_license
dlwjdgn8720/androidjava
214cf40d845fe1523a2b7401df78e91998124c98
7cb8407f82f01fb5894b151f3586785f19acf8ef
refs/heads/master
2023-01-22T19:50:39.635282
2020-11-18T09:58:46
2020-11-18T09:58:46
288,131,552
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package 제어문; public class 조건문 { public static void main(String[] args) { int x = 100; if(x >= 200 ) { // 비교 연산자가 반드시 들어가야됨 System.out.println("200보다 크군요!"); } else { System.out.println("200보다 작군요!"); } } }
[ "noreply@github.com" ]
dlwjdgn8720.noreply@github.com
f7a9249cb6f3c7c260d3b56c96426dc4f1ca6af3
c41d5ef4d2cf15cf7e46dacbacb4fa9e02e83afc
/StarWarsCapitalist/src/main/java/com/example/StarWarsCapitalist/generated/World.java
b1766b0e9d542449bf5ddc1adda9a5dcc3de014b
[]
no_license
LucasEtheve/RickMortyCapitalist
77ddb4ee38998231f75067a8a475bde2f9b54973
c387bf8e5ea36c3c361c85f34a15b677a015cdb2
refs/heads/main
2023-04-03T09:33:20.804520
2021-04-11T19:36:44
2021-04-11T19:36:44
335,542,277
0
0
null
null
null
null
UTF-8
Java
false
false
8,390
java
// // Ce fichier a été généré par l'implémentation de référence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b130911.1802 // Voir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Toute modification apportée à ce fichier sera perdue lors de la recompilation du schéma source. // Généré le : 2021.02.02 à 11:25:50 AM CET // package com.example.StarWarsCapitalist.generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Classe Java pour anonymous complex type. * * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="logo" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="money" type="{http://www.w3.org/2001/XMLSchema}double"/> * &lt;element name="score" type="{http://www.w3.org/2001/XMLSchema}double"/> * &lt;element name="totalangels" type="{http://www.w3.org/2001/XMLSchema}double"/> * &lt;element name="activeangels" type="{http://www.w3.org/2001/XMLSchema}double"/> * &lt;element name="angelbonus" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="lastupdate" type="{http://www.w3.org/2001/XMLSchema}long"/> * &lt;element name="products" type="{}productsType"/> * &lt;element name="allunlocks" type="{}palliersType"/> * &lt;element name="upgrades" type="{}palliersType"/> * &lt;element name="angelupgrades" type="{}palliersType"/> * &lt;element name="managers" type="{}palliersType"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "name", "logo", "money", "score", "totalangels", "activeangels", "angelbonus", "lastupdate", "products", "allunlocks", "upgrades", "angelupgrades", "managers" }) @XmlRootElement(name = "world") public class World { @XmlElement(required = true) protected String name; @XmlElement(required = true) protected String logo; protected double money; protected double score; protected double totalangels; protected double activeangels; protected int angelbonus; protected long lastupdate; @XmlElement(required = true) protected ProductsType products; @XmlElement(required = true) protected PalliersType allunlocks; @XmlElement(required = true) protected PalliersType upgrades; @XmlElement(required = true) protected PalliersType angelupgrades; @XmlElement(required = true) protected PalliersType managers; /** * Obtient la valeur de la propriété name. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Définit la valeur de la propriété name. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Obtient la valeur de la propriété logo. * * @return * possible object is * {@link String } * */ public String getLogo() { return logo; } /** * Définit la valeur de la propriété logo. * * @param value * allowed object is * {@link String } * */ public void setLogo(String value) { this.logo = value; } /** * Obtient la valeur de la propriété money. * */ public double getMoney() { return money; } /** * Définit la valeur de la propriété money. * */ public void setMoney(double value) { this.money = value; } /** * Obtient la valeur de la propriété score. * */ public double getScore() { return score; } /** * Définit la valeur de la propriété score. * */ public void setScore(double value) { this.score = value; } /** * Obtient la valeur de la propriété totalangels. * */ public double getTotalangels() { return totalangels; } /** * Définit la valeur de la propriété totalangels. * */ public void setTotalangels(double value) { this.totalangels = value; } /** * Obtient la valeur de la propriété activeangels. * */ public double getActiveangels() { return activeangels; } /** * Définit la valeur de la propriété activeangels. * */ public void setActiveangels(double value) { this.activeangels = value; } /** * Obtient la valeur de la propriété angelbonus. * */ public int getAngelbonus() { return angelbonus; } /** * Définit la valeur de la propriété angelbonus. * */ public void setAngelbonus(int value) { this.angelbonus = value; } /** * Obtient la valeur de la propriété lastupdate. * */ public long getLastupdate() { return lastupdate; } /** * Définit la valeur de la propriété lastupdate. * */ public void setLastupdate(long value) { this.lastupdate = value; } /** * Obtient la valeur de la propriété products. * * @return * possible object is * {@link ProductsType } * */ public ProductsType getProducts() { return products; } /** * Définit la valeur de la propriété products. * * @param value * allowed object is * {@link ProductsType } * */ public void setProducts(ProductsType value) { this.products = value; } /** * Obtient la valeur de la propriété allunlocks. * * @return * possible object is * {@link PalliersType } * */ public PalliersType getAllunlocks() { return allunlocks; } /** * Définit la valeur de la propriété allunlocks. * * @param value * allowed object is * {@link PalliersType } * */ public void setAllunlocks(PalliersType value) { this.allunlocks = value; } /** * Obtient la valeur de la propriété upgrades. * * @return * possible object is * {@link PalliersType } * */ public PalliersType getUpgrades() { return upgrades; } /** * Définit la valeur de la propriété upgrades. * * @param value * allowed object is * {@link PalliersType } * */ public void setUpgrades(PalliersType value) { this.upgrades = value; } /** * Obtient la valeur de la propriété angelupgrades. * * @return * possible object is * {@link PalliersType } * */ public PalliersType getAngelupgrades() { return angelupgrades; } /** * Définit la valeur de la propriété angelupgrades. * * @param value * allowed object is * {@link PalliersType } * */ public void setAngelupgrades(PalliersType value) { this.angelupgrades = value; } /** * Obtient la valeur de la propriété managers. * * @return * possible object is * {@link PalliersType } * */ public PalliersType getManagers() { return managers; } /** * Définit la valeur de la propriété managers. * * @param value * allowed object is * {@link PalliersType } * */ public void setManagers(PalliersType value) { this.managers = value; } }
[ "57803978+LucasEtheve@users.noreply.github.com" ]
57803978+LucasEtheve@users.noreply.github.com
b3ad17309887013b13209570013317cd772ffd55
007dd4a24234c3d1c05b654903ad57bdaf388a0e
/src/main/java/com/rs/webscraper/entity/Product.java
a68ed0ec0463c8be0d5c7f6fad819fb26448dc13
[]
no_license
ryanslevin/price-comparison
7c24933718f423ac12d43c57e2ab535fcf45a40a
5e80a04989e855462f2ec70422bdf448578ce328
refs/heads/master
2020-04-21T05:57:07.834576
2019-05-22T03:52:09
2019-05-22T03:52:09
169,353,951
3
0
null
null
null
null
UTF-8
Java
false
false
4,903
java
package com.rs.webscraper.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="products") public class Product { //Variables with column mapping @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private Integer id; @Column(name="name") private String name; @Column(name="brand") private String brand; @Column(name="category") private String category; @Column(name="sub_category") private String subCategory; @Column(name="wiggle_com_url") private String wiggleComUrl; @Column(name="chain_reaction_cycles_com_url") private String chainReactionCyclesComUrl; @Column(name="amazon_com_url") private String amazonComUrl; @Column(name="image_url") private String imageUrl; @Column(name="wiggle_co_uk_url") private String wiggleCoUkUrl; @Column(name="competitive_cyclist_com_url") private String competitiveCyclistComUrl; @Column(name="merlin_cycles_com_url") private String merlinCyclesComUrl; @Column(name="tredz_co_uk_url") private String tredzCoUkUrl; @Column(name="jenson_usa_com_url") private String jensonUsaComUrl; //Constructors for products public Product() { } public Product(String name, String brand, String category, String subCategory, String wiggleComUrl, String chainReactionCyclesComUrl, String amazonComUrl, String imageUrl, String wiggleCoUkUrl, String competitiveCyclistComUrl, String merlinCyclesComUrl, String tredzCoUkUrl, String jensonUsaComUrl) { super(); this.name = name; this.brand = brand; this.category = category; this.subCategory = subCategory; this.wiggleComUrl = wiggleComUrl; this.chainReactionCyclesComUrl = chainReactionCyclesComUrl; this.amazonComUrl = amazonComUrl; this.imageUrl = imageUrl; this.wiggleCoUkUrl = wiggleCoUkUrl; this.competitiveCyclistComUrl = competitiveCyclistComUrl; this.merlinCyclesComUrl = merlinCyclesComUrl; this.tredzCoUkUrl = tredzCoUkUrl; this.jensonUsaComUrl = jensonUsaComUrl; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getSubCategory() { return subCategory; } public void setSubCategory(String subCategory) { this.subCategory = subCategory; } public String getWiggleComUrl() { return wiggleComUrl; } public void setWiggleComUrl(String wiggleComUrl) { this.wiggleComUrl = wiggleComUrl; } public String getChainReactionCyclesComUrl() { return chainReactionCyclesComUrl; } public void setChainReactionCyclesComUrl(String chainReactionCyclesComUrl) { this.chainReactionCyclesComUrl = chainReactionCyclesComUrl; } public String getAmazonComUrl() { return amazonComUrl; } public void setAmazonComUrl(String amazonComUrl) { this.amazonComUrl = amazonComUrl; } public String getImageUrl() { return imageUrl; } public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } public String getWiggleCoUkUrl() { return wiggleCoUkUrl; } public void setWiggleCoUkUrl(String wiggleCoUkUrl) { this.wiggleCoUkUrl = wiggleCoUkUrl; } public String getCompetitiveCyclistComUrl() { return competitiveCyclistComUrl; } public void setCompetitiveCyclistComUrl(String competitiveCyclistComUrl) { this.competitiveCyclistComUrl = competitiveCyclistComUrl; } public String getMerlinCyclesComUrl() { return merlinCyclesComUrl; } public void setMerlinCyclesComUrl(String merlinCyclesComUrl) { this.merlinCyclesComUrl = merlinCyclesComUrl; } public String getTredzCoUkUrl() { return tredzCoUkUrl; } public void setTredzCoUkUrl(String tredzCoUkUrl) { this.tredzCoUkUrl = tredzCoUkUrl; } public String getJensonUsaComUrl() { return jensonUsaComUrl; } public void setJensonUsaComUrl(String jensonUsaComUrl) { this.jensonUsaComUrl = jensonUsaComUrl; } @Override public String toString() { return "Product [id=" + id + ", name=" + name + ", brand=" + brand + ", category=" + category + ", subCategory=" + subCategory + ", wiggleComUrl=" + wiggleComUrl + ", chainReactionCyclesComUrl=" + chainReactionCyclesComUrl + ", amazonComUrl=" + amazonComUrl + ", imageUrl=" + imageUrl + ", wiggleCoUkUrl=" + wiggleCoUkUrl + ", competitiveCyclistComUrl=" + competitiveCyclistComUrl + ", merlinCyclesComUrl=" + merlinCyclesComUrl + ", tredzCoUkUrl=" + tredzCoUkUrl + ", jensonUsaComUrl=" + jensonUsaComUrl + "]"; } }
[ "ryanslevin@gmail.com" ]
ryanslevin@gmail.com
729e25249f51daf0889f828bb1442d89df3b82e0
447491225e455284f9cc83cd7eb1f661e3d5bb68
/src/GramSchmidt.java
78142f6e6167463303ac65c42beda131366fc6c5
[]
no_license
solan1803/Gram-Schmidt-Algorithm
dfaf63368c1ed5845dd3f5d37afc8db0e4b87765
14be36ea72d6e8e1a0848df892ed7226f3b10cd9
refs/heads/master
2020-12-11T22:17:59.561129
2016-02-17T22:42:29
2016-02-17T22:42:29
51,961,050
0
0
null
null
null
null
UTF-8
Java
false
false
3,851
java
/* * Class: GramSchmidt * Usage: Contains the algorithms for classical gram schmidt and modified gram * schmidt. Comment out one of the lines of code in main to run either * one of the algorithms. * M2AA3 Coursework 1 : Manivannan Solan * JMC Year 2 * CID: 00929139 */ public class GramSchmidt { static final double K = 0.0000000001; // a column vectors final static double[] a1 = { 1, 0, 0, 0, K }; final static double[] a2 = { 1, 0, 0, K, 0 }; final static double[] a3 = { 1, 0, K, 0, 0 }; final static double[] a4 = { 1, K, 0, 0, 0 }; final static double[][] aMatrix = { a1, a2, a3, a4 }; static double[][] qMatrixTranspose = { null, null, null, null }; static double[][] vMatrix1 = { a1, a2, a3, a4 }; static double[][] vMatrix2 = { null, null, null, null }; static double[][] vMatrix3 = { null, null, null, null }; static double[][] vMatrix4 = { null, null, null, null }; static double[][] vMatrixCGS = { null, null, null, null }; static double[][][] vMatrixMGS = { vMatrix1, vMatrix2, vMatrix3, vMatrix4 }; public static void main(String[] args) { //cgsAlgorithm(); mgsAlgorithm(); printQMatrix(); System.out.println("\nPrinting part b\n"); partBPrint(); } public static void printQMatrix() { for (int i = 0; i < qMatrixTranspose.length; i++) { System.out.print("q" + i + ": [ "); for (int j = 0; j < qMatrixTranspose[0].length; j++) { System.out.print(qMatrixTranspose[i][j]); if (j != qMatrixTranspose[0].length - 1) { System.out.print(" , "); } else { System.out.print(" ]"); } } System.out.println(""); } } public static void partBPrint() { int n = qMatrixTranspose[0].length - 1; double[] v1 = new double[n]; double[] v2 = new double[n]; double[] v3 = new double[n]; double[] v4 = new double[n]; double[][] result = { v1, v2, v3, v4 }; for (int i = 0; i < result.length; i++) { System.out.print("[ "); for (int j = 0; j < result[0].length; j++) { result[i][j] = VectorUtils.innerProduct(qMatrixTranspose[i], qMatrixTranspose[j]); if (i == j) result[i][j]--; System.out.print(result[i][j]); if (j != result[0].length - 1) { System.out.print(" , "); } else { System.out.print(" ]"); } } System.out.println(""); } } public static void mgsAlgorithm() { // vMatrixMGS has already been initialised. qMatrixTranspose[0] = VectorUtils.scaleVector(vMatrixMGS[0][0], 1 / VectorUtils.norm(vMatrixMGS[0][0])); for (int i = 1; i < aMatrix.length; i++) { for (int j = i; j < aMatrix.length; j++) { double scale = VectorUtils.innerProduct(vMatrixMGS[i - 1][j], qMatrixTranspose[i - 1]); double[] scaled = VectorUtils.scaleVector(qMatrixTranspose[i - 1], scale); vMatrixMGS[i][j] = VectorUtils.vectorSubtraction(vMatrixMGS[i - 1][j], scaled); } qMatrixTranspose[i] = VectorUtils.scaleVector(vMatrixMGS[i][i], 1 / VectorUtils.norm(vMatrixMGS[i][i])); } } public static void cgsAlgorithm() { vMatrixCGS[0] = aMatrix[0]; qMatrixTranspose[0] = VectorUtils.scaleVector(vMatrixCGS[0], 1 / VectorUtils.norm(vMatrixCGS[0])); for (int i = 1; i < vMatrixCGS.length; i++) { vMatrixCGS[i] = vCalcCGS(i); qMatrixTranspose[i] = VectorUtils.scaleVector(vMatrixCGS[i], 1 / VectorUtils.norm(vMatrixCGS[i])); } } public static double[] vCalcCGS(int index) { double[] aVector = aMatrix[index]; double[] sumVector = new double[5]; for (int j = 0; j < index; j++) { double innerProductCalc = VectorUtils.innerProduct(aVector, qMatrixTranspose[j]); double[] scaledVector = VectorUtils.scaleVector(qMatrixTranspose[j], innerProductCalc); sumVector = VectorUtils.vectorAddition(sumVector, scaledVector); } return VectorUtils.vectorSubtraction(aVector, sumVector); } }
[ "solan1803@googlemail.com" ]
solan1803@googlemail.com
aacfae3ff3576243a8fabcde343b77ff3cade05d
3287ebdf5036ff3d3fe831fee7fd68dcff4124f4
/Practise/src/Calendar/myCalendar.java
05cb1329a75ff6b4a1aadb080160f45a92b418d0
[]
no_license
ladanniel/SRC-Games
2a378de4db1390c4045c86765f468c35cde7557e
4d1d347c107ea75875d4b161ceec3467c370f5b1
refs/heads/master
2020-04-26T11:32:14.773575
2019-03-03T02:02:06
2019-03-03T02:02:06
173,520,024
0
0
null
null
null
null
GB18030
Java
false
false
1,064
java
package Calendar; import java.awt.Font; import java.util.Date; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; public class myCalendar { private JPanel imagePanel,datePanel,p,p2,p3; private JLabel label,l,l2,l3,l4,l5; private ImageIcon background; private JButton b,b2; private JTextField t; private JComboBox<String> month_list = new JComboBox<String>(); private Font f = new Font("微软雅黑",Font.PLAIN,15); private String columns[] = {"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"}; private Date now = new Date(); private JLabel[] day = new JLabel[42]; public static void main(String[] args) { JFrame frame = new JFrame(); frame.setVisible(true); frame.setSize(800,600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); } }
[ "ldanniel@sina.com" ]
ldanniel@sina.com
48e8831051f85f4b1c1dd738067a141fd4465d70
a291aed8cbb0f75048a5e9d57831c90a55701ec1
/src/main/java/剑指offer/替换空格/Solution.java
878d1ec2d369f367945f257b0d0df876a213d576
[ "Apache-2.0" ]
permissive
Euthpic/Leetcode-Java
7714cd0f65c247537d40b101a6a60d02a8f055d7
91257a0e1105b228054b65517c49a39835b46491
refs/heads/master
2022-09-01T15:24:17.697206
2022-08-30T06:39:33
2022-08-30T06:39:33
118,900,674
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package 剑指offer.替换空格; public class Solution { public String replaceSpace(String s) { char[] chars = s.toCharArray(); char[] newChars = new char[s.length() * 3]; int cur = 0; for (char c : chars) { if (c == ' ') { newChars[cur++] = '%'; newChars[cur++] = '2'; newChars[cur++] = '0'; } else { newChars[cur++] = c; } } return new String(newChars,0,cur); } }
[ "490114771@qq.com" ]
490114771@qq.com
b818c0662c3337703c38b2a79d38d8347c8450f6
19ac2fdbbfe3c2b1d1d187a258984967d871ce5b
/Auxiliary/Lua/LuaReactorCheckFuel.java
f3cecce4016c1f60f52907872755882547bc6562
[]
no_license
InterPlay02/ReactorCraft-Not-Official
9e3e95398e42f126152b7914e9cf9aa6802074c2
b8666788894f0400a0f5321390640163b1b8680e
refs/heads/master
2021-06-11T16:07:07.922544
2021-03-28T14:43:43
2021-03-28T14:43:43
163,349,395
0
0
null
null
null
null
UTF-8
Java
false
false
2,277
java
/******************************************************************************* * @author Reika Kalseki * * Copyright 2017 * * All rights reserved. * Distribution of the software in any form is only allowed with * explicit, prior permission from the owner. ******************************************************************************/ package Reika.ReactorCraft.Auxiliary.Lua; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import Reika.DragonAPI.ModInteract.Lua.LuaMethod; import Reika.ReactorCraft.Base.TileEntityNuclearCore; import Reika.ReactorCraft.Registry.ReactorItems; import Reika.ReactorCraft.Registry.ReactorTiles; public class LuaReactorCheckFuel extends LuaMethod { public LuaReactorCheckFuel() { super("checkFuel", TileEntityNuclearCore.class); } @Override protected Object[] invoke(TileEntity te, Object[] args) throws LuaMethodException, InterruptedException { TileEntityNuclearCore tile = (TileEntityNuclearCore)te; ReactorTiles r = tile.getMachine(); int fuel = 0; int maxfuel = 1; if (r == ReactorTiles.BREEDER) { maxfuel = 4*ReactorItems.BREEDERFUEL.getNumberMetadatas(); for (int i = 0; i < 4; i++) { ItemStack is = tile.getStackInSlot(i); if (is != null) { if (is.getItem() == ReactorItems.BREEDERFUEL.getItemInstance()) { fuel += ReactorItems.BREEDERFUEL.getNumberMetadatas()-1-is.getItemDamage(); } } } } else if (r == ReactorTiles.FUEL) { maxfuel = 4*ReactorItems.FUEL.getNumberMetadatas(); for (int i = 0; i < 4; i++) { ItemStack is = tile.getStackInSlot(i); if (is != null) { if (is.getItem() == ReactorItems.FUEL.getItemInstance()) { fuel += ReactorItems.FUEL.getNumberMetadatas()-1-is.getItemDamage(); } else if (is.getItem() == ReactorItems.PLUTONIUM.getItemInstance()) { fuel += ReactorItems.PLUTONIUM.getNumberMetadatas()-1-is.getItemDamage(); } } } } return new Object[]{String.format("%.3f%s", 100F*fuel/maxfuel, "%")}; } @Override public String getDocumentation() { return "Returns the fuel level of a nuclear fuel core."; } @Override public String getArgsAsString() { return ""; } @Override public ReturnType getReturnType() { return ReturnType.STRING; } }
[ "reikasminecraft@gmail.com" ]
reikasminecraft@gmail.com
7350ba79b2f1ac45ce0823430ad2c198f6eb9878
f9efe9a7b321c4c077b7986a93e0fd9e11b35d76
/src/main/java/test/dao/ProductDomainMapper.java
f8154b25326d9f002a35b660010f43b4f484234f
[]
no_license
johnnyshaw/mybatisgen
d4290de4c3afa43a12ef6c2646a27e1f25591649
69c0d572894fe9f484b4ffc29f8c210ddf8fc941
refs/heads/master
2021-01-10T09:56:29.237524
2015-11-10T06:35:17
2015-11-10T06:35:17
45,892,580
0
0
null
null
null
null
UTF-8
Java
false
false
1,356
java
package test.dao; import test.model.ProductDomain; public interface ProductDomainMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table product * * @mbggenerated */ int deleteByPrimaryKey(Integer productId); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table product * * @mbggenerated */ int insert(ProductDomain record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table product * * @mbggenerated */ int insertSelective(ProductDomain record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table product * * @mbggenerated */ ProductDomain selectByPrimaryKey(Integer productId); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table product * * @mbggenerated */ int updateByPrimaryKeySelective(ProductDomain record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table product * * @mbggenerated */ int updateByPrimaryKey(ProductDomain record); }
[ "johnny_56@163.com" ]
johnny_56@163.com
268fb27927834f0aa139740877c6d42b4c8ac805
28b0f0269e6ee1fce2b40e151964d8d0198c315c
/src/main/java/com/dto/identity/KeyCloakServerConfig.java
5fb03a66cfd97980f3f53fcf85de5d3f0ffa7fb5
[]
no_license
AusDTO/keycloak-wrapper
876649a4b25ca6eff5a24e8758def134febeb473
b2c3e83dd52bd29c17e07f20984ca76442d74894
refs/heads/master
2020-12-13T12:52:51.987243
2016-08-23T03:50:18
2016-08-23T03:50:18
65,164,694
1
2
null
null
null
null
UTF-8
Java
false
false
1,193
java
package com.dto.identity; import java.io.Serializable; /** * Created by mohanambalavanan on 8/08/2016. */ public class KeyCloakServerConfig implements Serializable { private String host; private int port; private int workerThreads = Math.max(Runtime.getRuntime().availableProcessors(), 2) * 8; private String resourcesHome; public KeyCloakServerConfig(){ this.host = "0.0.0.0"; if(System.getenv("PORT")!=null){ this.port = Integer.valueOf(System.getenv("PORT")); }else { this.port =8081; } } public String getHost() { return host; } public int getPort() { return port; } public String getResourcesHome() { return resourcesHome; } public void setHost(String host) { this.host = host; } public void setPort(int port) { this.port = port; } public void setResourcesHome(String resourcesHome) { this.resourcesHome = resourcesHome; } public int getWorkerThreads() { return workerThreads; } public void setWorkerThreads(int workerThreads) { this.workerThreads = workerThreads; } }
[ "mohanambalavanan@gmail.com" ]
mohanambalavanan@gmail.com
059974e561292cdde7770e6c3c678f71e6e21778
44782e725a0827d2e0de81e266a644a139b1cef0
/app/src/main/java/com/mcz/temperarure_humidity_appproject/XApplication.java
4a2dc3e320ae4cdfeabf08f14b4d7074c493a374
[]
no_license
MrYangWen/Temperarure_humidity
08309d98b42e675d532789fc2417b66ef983873c
e1612a4689cbb51540181925258f479f82e2bc53
refs/heads/master
2021-10-27T09:10:41.037891
2021-07-03T07:49:10
2021-07-03T07:49:10
184,189,185
2
1
null
null
null
null
UTF-8
Java
false
false
1,751
java
package com.mcz.temperarure_humidity_appproject; import android.app.ActivityManager; import android.app.Application; import android.content.Context; import android.support.multidex.MultiDex; import com.mcz.temperarure_humidity_appproject.app.utils.ScreenUtil; /** * Created by JackMar on 2017/3/1. * 邮箱:1261404794@qq.com */ public class XApplication extends Application { private static XApplication sInstance; //默认的首页位置 public static int currentIndex = 1; //默认pageIndex public static int currentPageIndex = 1; public static boolean isLogin = false; //单例模式中获取唯一的MyApplication实例 public static Context getInstance() { if (sInstance == null) { sInstance = new XApplication(); } return sInstance; } @Override public void onCreate() { super.onCreate(); sInstance = this; init(); } private void init() { ScreenUtil.defaultCenter().init(sInstance); } /** * 获得当前进程的名字 * * @param context * @return 进程号 */ public static String getCurProcessName(Context context) { int pid = android.os.Process.myPid(); ActivityManager activityManager = (ActivityManager) context.getSystemService( Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo appProcess : activityManager.getRunningAppProcesses()) { if (appProcess.pid == pid) { return appProcess.processName; } } return null; } @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(base); } }
[ "" ]
c8e4d4a8fd9cfbdad023183df1999a045dea976d
7712614ad8748d1d53ec1ae2ec80da59cf017dca
/photoapp-api-account-management/src/main/java/microservices/demo/PhotoappApiAccountManagementApplication.java
3158a1e173b2b81318a00d6a64a2f4e2cd6bf28a
[]
no_license
chrisdoberman/spring-microservices-demo
f86f971c933b1f2ad35be16904017f87cb0039ca
77cf5416c27a3ea76bc9571dae4a3d1139895be5
refs/heads/master
2020-05-31T05:25:01.306892
2019-08-03T02:12:21
2019-08-03T02:12:21
190,119,110
0
0
null
null
null
null
UTF-8
Java
false
false
451
java
package microservices.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @EnableDiscoveryClient @SpringBootApplication public class PhotoappApiAccountManagementApplication { public static void main(String[] args) { SpringApplication.run(PhotoappApiAccountManagementApplication.class, args); } }
[ "chris.herb@gmail.com" ]
chris.herb@gmail.com
af5f7f72f1886cd7c172168367f8445405efa466
c208b724ef15c47d1fbfc1d239ad1b7bea97b2f1
/src/main/java/com/br/zup/academy/lais/proposta/Proposta/PropostaController.java
3ae46af2b6b5e10d067374dfa94d6feb6cd7373a
[ "Apache-2.0" ]
permissive
laismukaizup/orange-talents-04-template-proposta
bc0713ac593c39076fa00d26041be9a08b3ebb0b
0b8fa14772fa68e9375b10c70011b3b2291093c6
refs/heads/main
2023-05-05T07:11:45.958709
2021-05-22T02:03:19
2021-05-22T02:03:19
364,997,888
0
0
Apache-2.0
2021-05-06T18:09:36
2021-05-06T18:09:36
null
UTF-8
Java
false
false
2,645
java
package com.br.zup.academy.lais.proposta.Proposta; import com.br.zup.academy.lais.proposta.SistemFinanceiro.AvaliacaoRequest; import com.br.zup.academy.lais.proposta.SistemFinanceiro.FinanceiroClient; import feign.FeignException; import io.opentracing.Span; import io.opentracing.Tracer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.*; import org.springframework.web.util.UriComponentsBuilder; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.transaction.Transactional; import javax.validation.Valid; import java.net.URI; @RestController @RequestMapping("/proposta") public class PropostaController { @PersistenceContext EntityManager manager; @Autowired ProibeDocumentoIgualParaProposta proibeDocumentoIgualParaProposta; @Autowired FinanceiroClient financeiroClient; @InitBinder public void init(WebDataBinder binder) { binder.addValidators(proibeDocumentoIgualParaProposta); } private final Tracer tracer; public PropostaController(Tracer tracer) { this.tracer = tracer; } @PostMapping @Transactional public ResponseEntity cadastrar(@RequestBody @Valid PropostaRequest request, UriComponentsBuilder uriBuilder) { Span activeSpan = tracer.activeSpan(); activeSpan.setBaggageItem("user.email", "luram.archanjo@zup.com.br"); URI uri = uriBuilder.path("/proposta").buildAndExpand().toUri(); Proposta proposta = request.toModel(); manager.persist(proposta); proposta = avaliaProposta(proposta); manager.merge(proposta); return ResponseEntity.created(uri).body(proposta); } @GetMapping(value = "{id}") public ResponseEntity detalhar(@PathVariable("id") Long id) { Proposta proposta = manager.find(Proposta.class, id); if (proposta == null) return ResponseEntity.notFound().build(); return ResponseEntity.ok().body(new PropostaDetalheResponse(proposta.getStatus().name())); } public Proposta avaliaProposta(Proposta proposta) { try { financeiroClient.avaliacao(new AvaliacaoRequest(proposta)); proposta.setStatus(StatusProposta.ELEGIVEL); proposta.setFlagCartaoOK(false); } catch (FeignException.UnprocessableEntity ex) { proposta.setStatus(StatusProposta.NAO_ELEGIVEL); proposta.setFlagCartaoOK(true); } return proposta; } }
[ "lais.mukai@zup.com.br" ]
lais.mukai@zup.com.br
edeed8dfe26c80264c1105137631f366d853e36f
e2c34d08119a03da21cd23f2f45526c86dcd2388
/bundle/src/main/java/com/scrippsnetworks/wcm/opengraph/OpenGraphImage.java
6fed4a1e80ccd042cb4ecc0046345d381aca345b
[]
no_license
ernestlv/support
3dc080184ca217a9acb47a338202108522301ae3
0ab210965e0f15af21319d55231e6ad97df0bc84
refs/heads/master
2021-01-19T07:48:17.723992
2014-08-27T14:15:07
2014-08-27T14:15:07
23,392,068
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
package com.scrippsnetworks.wcm.opengraph; /** * @author Jason Clark * Date: 4/24/13 */ public interface OpenGraphImage { public String getRenditionUrl(); }
[ "eleyva@scrippsnetworks.com" ]
eleyva@scrippsnetworks.com
3e449741e8e44a54900694e015b0e84471bb5645
b77b8c288734b7414dd505cbde379fff69d784b2
/Java16-Thread/src/edu/java/thread03/ThreadMain03.java
2f11a386770a9d07e3490c3974a556347921db13
[]
no_license
gnsdl74/Java1
bd4602e369222eb5e1eabba78e454e3c5081492a
1851bdea62c1368e2330b86cf682fb750a4a4fdb
refs/heads/master
2020-12-03T12:25:24.189121
2020-02-05T08:50:09
2020-02-05T08:50:09
231,315,334
0
0
null
null
null
null
UTF-8
Java
false
false
1,407
java
package edu.java.thread03; class MyRunnable implements Runnable { @Override public void run() { for (int i = 0; i < 100; i++) { System.out.println("쓰레드!"); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } // end run() } // end MyRunnable public class ThreadMain03 { public static void main(String[] args) { // 1. 클래스 인스턴스 생성하여 쓰레드 start() Thread th1 = new Thread(new MyRunnable()); th1.start(); // 2. 익명 클래스를 사용하여 쓰레드 start(); Thread th2 = new Thread(new Runnable() { @Override public void run() { for (int i = 0; i < 100; i++) { System.out.println("익명"); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } // end run() }); // end Anonymous Class th2.start(); // 3. 람다 표현식을 사용하여 쓰레드 start(); new Thread(() -> { for (int i = 0; i < 100; i++) { System.out.println("람다"); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } }).start(); // end Lambda Expression // 다른 곳에서 사용하지 않고 여기서만 사용한다면 위의 코드처럼 줄여쓰기도 가능 } // end main() } // end ThreadMina03
[ "noreply@github.com" ]
gnsdl74.noreply@github.com
ac0490cd26e308e311c9cd9dbe31aaaeab9b634f
2beb11caac290bb67811df76cf501a1c37f947ed
/cfrJava/src/main/java/chapter/twenty/innerbeandemo/InnerBeanEmp.java
c4b9323ceb026d461c96878fc5444944dafec79e
[]
no_license
cfrcfrrr/JavaDemo
4763975d93db10815999d8b94d33b2bcfe95ed1f
ed9f47a56826ac02a88a74e33793e27c11c696a5
refs/heads/master
2020-03-29T13:48:56.781742
2018-11-18T03:38:11
2018-11-18T03:38:11
149,983,676
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package chapter.twenty.innerbeandemo; public class InnerBeanEmp { private InnerBeanDept dept; public InnerBeanDept getDept() { return dept; } public void setDept(InnerBeanDept dept) { this.dept = dept; } }
[ "33483958+cfrcfrrr@users.noreply.github.com" ]
33483958+cfrcfrrr@users.noreply.github.com
0cf4e7776e76032424caea5a9ead64b8e4104f73
66220fbb2b7d99755860cecb02d2e02f946e0f23
/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
032e26b0efe58974134de97ebb80e347fd05992b
[ "MIT" ]
permissive
isabella232/plantuml-mit
27e7c73143241cb13b577203673e3882292e686e
63b2bdb853174c170f304bc56f97294969a87774
refs/heads/master
2022-11-09T00:41:48.471405
2020-06-28T12:42:10
2020-06-28T12:42:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,016
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2020, Arnaud Roques * * Project Info: https://plantuml.com * * If you like this project or if you find it useful, you can support us at: * * https://plantuml.com/patreon (only 1$ per month!) * https://plantuml.com/paypal * * This file is part of PlantUML. * * Licensed under The MIT License (Massachusetts Institute of Technology License) * * See http://opensource.org/licenses/MIT * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * Original Author: Arnaud Roques */ package net.sourceforge.plantuml.activitydiagram.command; import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.UrlBuilder; import net.sourceforge.plantuml.UrlBuilder.ModeUrl; import net.sourceforge.plantuml.activitydiagram.ActivityDiagram; import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexOptional; import net.sourceforge.plantuml.command.regex.RegexOr; import net.sourceforge.plantuml.command.regex.RegexPartialMatch; import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.cucadiagram.Code; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.GroupType; import net.sourceforge.plantuml.cucadiagram.IEntity; import net.sourceforge.plantuml.cucadiagram.ILeaf; import net.sourceforge.plantuml.cucadiagram.Ident; import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.LinkDecor; import net.sourceforge.plantuml.cucadiagram.LinkType; import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement; import net.sourceforge.plantuml.graphic.color.ColorParser; import net.sourceforge.plantuml.graphic.color.ColorType; public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> { public CommandLinkActivity() { super(getRegexConcat()); } private static IRegex getRegexConcat() { return RegexConcat.build(CommandLinkActivity.class.getName(), RegexLeaf.start(), // new RegexOptional(// new RegexOr("FIRST", // new RegexLeaf("STAR", "(\\(\\*(top)?\\))"), // new RegexLeaf("CODE", "([\\p{L}0-9][\\p{L}0-9_.]*)"), // new RegexLeaf("BAR", "(?:==+)[%s]*([\\p{L}0-9_.]+)[%s]*(?:==+)"), // new RegexLeaf("QUOTED", "[%g]([^%g]+)[%g](?:[%s]+as[%s]+([\\p{L}0-9_.]+))?"))), // RegexLeaf.spaceZeroOrMore(), // new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), // RegexLeaf.spaceZeroOrMore(), // ColorParser.exp2(), // RegexLeaf.spaceZeroOrMore(), // new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), // new RegexLeaf("ARROW_BODY1", "([-.]+)"), // new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), // new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), // new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), // new RegexLeaf("ARROW_BODY2", "([-.]*)"), // new RegexLeaf("\\>"), // RegexLeaf.spaceZeroOrMore(), // new RegexOptional(new RegexLeaf("BRACKET", "\\[([^\\]*]+[^\\]]*)\\]")), // RegexLeaf.spaceZeroOrMore(), // new RegexOr("FIRST2", // new RegexLeaf("STAR2", "(\\(\\*(top|\\d+)?\\))"), // new RegexLeaf("OPENBRACKET2", "(\\{)"), // new RegexLeaf("CODE2", "([\\p{L}0-9][\\p{L}0-9_.]*)"), // new RegexLeaf("BAR2", "(?:==+)[%s]*([\\p{L}0-9_.]+)[%s]*(?:==+)"), // new RegexLeaf("QUOTED2", "[%g]([^%g]+)[%g](?:[%s]+as[%s]+([\\p{L}0-9][\\p{L}0-9_.]*))?"), // new RegexLeaf("QUOTED_INVISIBLE2", "(\\w.*?)")), // RegexLeaf.spaceZeroOrMore(), // new RegexLeaf("STEREOTYPE2", "(\\<\\<.*\\>\\>)?"), // RegexLeaf.spaceZeroOrMore(), // new RegexOptional( // new RegexConcat( // new RegexLeaf("in"), // RegexLeaf.spaceOneOrMore(), // new RegexLeaf("PARTITION2", "([%g][^%g]+[%g]|\\S+)") // )), // RegexLeaf.spaceZeroOrMore(), // ColorParser.exp3(), // RegexLeaf.end()); } @Override protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) { final IEntity entity1 = getEntity(diagram, arg, true); if (entity1 == null) { return CommandExecutionResult.error("No such activity"); } if (arg.get("STEREOTYPE", 0) != null) { entity1.setStereotype(new Stereotype(arg.get("STEREOTYPE", 0))); } if (arg.get("BACKCOLOR", 0) != null) { entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet() .getColorIfValid(arg.get("BACKCOLOR", 0))); } final IEntity entity2 = getEntity(diagram, arg, false); if (entity2 == null) { return CommandExecutionResult.error("No such activity"); } if (arg.get("BACKCOLOR2", 0) != null) { entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet() .getColorIfValid(arg.get("BACKCOLOR2", 0))); } if (arg.get("STEREOTYPE2", 0) != null) { entity2.setStereotype(new Stereotype(arg.get("STEREOTYPE2", 0))); } final Display linkLabel = Display.getWithNewlines(arg.get("BRACKET", 0)); final String arrowBody1 = CommandLinkClass.notNull(arg.get("ARROW_BODY1", 0)); final String arrowBody2 = CommandLinkClass.notNull(arg.get("ARROW_BODY2", 0)); final String arrowDirection = CommandLinkClass.notNull(arg.get("ARROW_DIRECTION", 0)); final String arrow = StringUtils.manageArrowForCuca(arrowBody1 + arrowDirection + arrowBody2 + ">"); int lenght = arrow.length() - 1; if (arrowDirection.contains("*")) { lenght = 2; } LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE); if ((arrowBody1 + arrowBody2).contains(".")) { type = type.goDotted(); } Link link = new Link(entity1, entity2, type, linkLabel, lenght, diagram.getSkinParam().getCurrentStyleBuilder()); if (arrowDirection.contains("*")) { link.setConstraint(false); } final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">"); if (direction == Direction.LEFT || direction == Direction.UP) { link = link.getInv(); } if (arg.get("URL", 0) != null) { final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT); final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0)); link.setUrl(urlLink); } link.applyStyle(arg.getLazzy("ARROW_STYLE", 0)); diagram.addLink(link); return CommandExecutionResult.ok(); } static IEntity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean start) { final String suf = start ? "" : "2"; final String openBracket2 = arg.get("OPENBRACKET" + suf, 0); if (openBracket2 != null) { return diagram.createInnerActivity(); } if (arg.get("STAR" + suf, 0) != null) { final String suppId = arg.get("STAR" + suf, 1); if (start) { if (suppId != null) { diagram.getStart().setTop(true); } return diagram.getStart(); } return diagram.getEnd(suppId); } String partition = arg.get("PARTITION" + suf, 0); if (partition != null) { partition = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(partition); } final String idShort = arg.get("CODE" + suf, 0); if (idShort != null) { if (partition != null) { final Ident idNewLong = diagram.buildLeafIdent(partition); final Code codeP = diagram.V1972() ? idNewLong : diagram.buildCode(partition); diagram.gotoGroup(idNewLong, codeP, Display.getWithNewlines(partition), GroupType.PACKAGE, diagram.getRootGroup(), NamespaceStrategy.SINGLE); } final Ident ident = diagram.buildLeafIdent(idShort); final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort); final LeafType type = diagram.V1972() ? getTypeIfExistingSmart(diagram, ident) : getTypeIfExisting(diagram, code); IEntity result; if (diagram.V1972()) { result = diagram.getLeafVerySmart(ident); if (result == null) result = diagram.getOrCreate(ident, code, Display.getWithNewlines(code), type); } else result = diagram.getOrCreate(ident, code, Display.getWithNewlines(code), type); if (partition != null) { diagram.endGroup(); } return result; } final String bar = arg.get("BAR" + suf, 0); if (bar != null) { final Ident identBar = diagram.buildLeafIdent(bar); final Code codeBar = diagram.V1972() ? identBar : diagram.buildCode(bar); if (diagram.V1972()) { final ILeaf result = diagram.getLeafVerySmart(identBar); if (result != null) { return result; } } return diagram.getOrCreate(identBar, codeBar, Display.getWithNewlines(bar), LeafType.SYNCHRO_BAR); } final RegexPartialMatch quoted = arg.get("QUOTED" + suf); if (quoted.get(0) != null) { final String quotedString = quoted.get(1) == null ? quoted.get(0) : quoted.get(1); if (partition != null) { final Ident idNewLong = diagram.buildLeafIdent(partition); final Code codeP = diagram.V1972() ? idNewLong : diagram.buildCode(partition); diagram.gotoGroup(idNewLong, codeP, Display.getWithNewlines(partition), GroupType.PACKAGE, diagram.getRootGroup(), NamespaceStrategy.SINGLE); } final Ident quotedIdent = diagram.buildLeafIdent(quotedString); final Code quotedCode = diagram.V1972() ? quotedIdent : diagram.buildCode(quotedString); final LeafType type = diagram.V1972() ? getTypeIfExistingSmart(diagram, quotedIdent) : getTypeIfExisting( diagram, quotedCode); final IEntity result = diagram.getOrCreate(quotedIdent, quotedCode, Display.getWithNewlines(quoted.get(0)), type); if (partition != null) { diagram.endGroup(); } return result; } final String quoteInvisibleString = arg.get("QUOTED_INVISIBLE" + suf, 0); if (quoteInvisibleString != null) { if (partition != null) { final Ident idNewLong = diagram.buildLeafIdent(partition); final Code codeP = diagram.V1972() ? idNewLong : diagram.buildCode(partition); diagram.gotoGroup(idNewLong, codeP, Display.getWithNewlines(partition), GroupType.PACKAGE, diagram.getRootGroup(), NamespaceStrategy.SINGLE); } final Ident identInvisible = diagram.buildLeafIdent(quoteInvisibleString); final Code quotedInvisible = diagram.V1972() ? identInvisible : diagram.buildCode(quoteInvisibleString); final IEntity result = diagram.getOrCreate(identInvisible, quotedInvisible, Display.getWithNewlines(quotedInvisible), LeafType.ACTIVITY); if (partition != null) { diagram.endGroup(); } return result; } final String first = arg.get("FIRST" + suf, 0); if (first == null) { return diagram.getLastEntityConsulted(); } return null; } private static LeafType getTypeIfExistingSmart(ActivityDiagram system, Ident ident) { final IEntity ent = system.getLeafSmart(ident); if (ent != null) { if (ent.getLeafType() == LeafType.BRANCH) { return LeafType.BRANCH; } } return LeafType.ACTIVITY; } private static LeafType getTypeIfExisting(ActivityDiagram system, Code code) { if (system.leafExist(code)) { final IEntity ent = system.getLeaf(code); if (ent.getLeafType() == LeafType.BRANCH) { return LeafType.BRANCH; } } return LeafType.ACTIVITY; } }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
016c0147b7d08d8e0613f1d25e59b59923729238
c39cd76699b393a049b1e924a0cac53f024ba5ad
/src/lli/adviceNote/TDAdviceNote.java
f86a95923e365f92d1a4248148e09060abba49d1
[]
no_license
duranto2009/btcl-automation
402f26dc6d8e745c0e8368c946f74a5eab703015
33ffa0b8e488d6a0d13c8f08e6b8058fe1b4764b
refs/heads/master
2022-02-27T07:38:19.181886
2019-09-18T10:42:21
2019-09-18T10:42:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,401
java
package lli.adviceNote; import annotation.TableName; import api.ClientAPI; import common.ModuleConstants; import common.RequestFailureException; import common.bill.BillConstants; import common.pdf.PdfMaterial; import ip.MethodReferences; import lli.Application.ReviseClient.ReviseDTO; import lli.Application.ReviseClient.ReviseService; import lli.connection.LLIConnectionConstants; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import nix.constants.NIXConstants; import nix.revise.NIXReviseDTO; import nix.revise.NIXReviseService; import officialLetter.OfficialLetter; import officialLetter.OfficialLetterConcern; import officialLetter.OfficialLetterService; import officialLetter.ReferType; import permission.PermissionRepository; import role.RoleDTO; import user.UserDTO; import user.UserRepository; import util.KeyValuePair; import util.ServiceDAOFactory; import util.TimeConverter; import vpn.client.ClientDetailsDTO; import vpn.clientContactDetails.ClientContactDetailsDTO; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @Data @EqualsAndHashCode(callSuper = false) @TableName("official_letter") @NoArgsConstructor public class TDAdviceNote extends ClientAdviceNote implements PdfMaterial { public TDAdviceNote ( long appId, long clientId ) { super(appId, clientId); } public TDAdviceNote (OfficialLetter ol) { setId(ol.getId()); setModuleId(ol.getModuleId()); setClientId(ol.getClientId()); setApplicationId(ol.getApplicationId()); setOfficialLetterType(ol.getOfficialLetterType()); setClassName(ol.getClassName()); setCreationTime(ol.getCreationTime()); setLastModificationTime(ol.getLastModificationTime()); setDeleted(ol.isDeleted()); } @Override public Map<String, Object> getPdfParameters() throws Exception { Map<String, Object> map = new HashMap<>(); populatePdfParameters(map); return map; } @Override public String getResourceFile() { //change it return BillConstants.LLI_CONNECTION_ADVICE_NOTE; } public void populatePdfParameters(Map<String, Object> map) throws Exception { populateCommonParameters(map); populateClientParameters(map); if(this.moduleId == ModuleConstants.Module_ID_NIX){ NIXReviseDTO reviseDTO = ServiceDAOFactory.getService(NIXReviseService.class).getappById(this.getApplicationId()); map.put("application_type", NIXConstants.nixapplicationTypeNameMap.get(reviseDTO.getApplicationType())); } else { ReviseDTO reviseDTO = ServiceDAOFactory.getService(ReviseService.class).getappById(this.getApplicationId()); map.put("application_type", LLIConnectionConstants.applicationTypeNameMap.get(reviseDTO.getApplicationType())); } } private void populateCommonParameters(Map<String, Object> map) throws Exception { map.put("application_id", Long.toString(this.getApplicationId())); map.put("btcl_heading_advice_note", "../../assets/images/btcl_logo_heading_advice_note.png"); map.put("advice_note_number", String.valueOf(this.getId())); map.put("date", TimeConverter.getDateTimeStringByMillisecAndDateFormat(this.getCreationTime(), "dd/MM/yyyy")); List<OfficialLetterConcern> list = ServiceDAOFactory.getService(OfficialLetterService.class).getRecipientListByOfficialLetterId(this.getId()); OfficialLetterConcern toDesignation = list.stream().filter(t->t.getReferType()== ReferType.TO).findFirst().orElse(null); if(toDesignation == null){ throw new RequestFailureException("NO TO Designation Found"); } UserDTO user = UserRepository.getInstance().getUserDTOByUserID(toDesignation.getRecipientId()); if(user == null){ throw new RequestFailureException("No user found for id " + toDesignation.getRecipientId() ); } RoleDTO roleDTO = PermissionRepository.getInstance().getRoleDTOByRoleID(user.getRoleID()); if(roleDTO == null ){ throw new RequestFailureException("No Role found for user id " + toDesignation.getRecipientId() ); } String roleName = roleDTO.getRoleName(); map.put("recipient", "Server Room"); List<OfficialLetterConcern> ccList = list.stream().filter(t->t.getReferType()==ReferType.CC).collect(Collectors.toList()); List<UserDTO> ccUsers = ccList.stream().map(t->UserRepository.getInstance().getUserDTOByUserID(t.getRecipientId())).collect(Collectors.toList()); AtomicInteger atomicInteger = new AtomicInteger(0); List<KeyValuePair<String, String>>ccListKeyValuePair = ccUsers.stream() .map(t->{ atomicInteger.getAndIncrement(); return MethodReferences.newKeyValueString_String.apply(atomicInteger.toString() + ". " + t.getFullName() + ",", t.getDesignation()+", " + t.getDepartmentName()); }) .collect(Collectors.toList()); map.put("CC", ccListKeyValuePair); UserDTO sender = UserRepository.getInstance().getUserDTOByUserID(toDesignation.getSenderId()); map.put("sender_name", sender.getFullName()); map.put("sender_designation", sender.getDesignation() + ", " + user.getDepartmentName()); } private void populateClientParameters(Map<String, Object> map) throws Exception { KeyValuePair<ClientDetailsDTO, ClientContactDetailsDTO> pair = ClientAPI.getInstance().getPairOfClientDetailsAndClientContactDetails( this.getClientId(), this.getModuleId(), ClientContactDetailsDTO.BILLING_CONTACT); ClientDetailsDTO clientDetailsDTO = pair.key; ClientContactDetailsDTO contactDetailsDTO = pair.value; map.put("client_name", clientDetailsDTO.getName()); map.put("username", clientDetailsDTO.getLoginName() ); map.put("mobile_number", contactDetailsDTO.getPhoneNumber()); //these two needs modification //defaults used for now map.put("client_type", "Govt"); map.put("client_category", "ISP"); // ends here map.put("client_billing_address",contactDetailsDTO.getAddress()); } }
[ "shariful.bony@gmail.com" ]
shariful.bony@gmail.com
e5ef2a43472a04cbe1df181f6f4b0d9434b38a09
6c767e39a6f43a365df29c31f4f64fa0b330b81c
/src/POS/dlg/Dlg_set_date.java
df73628a6ab7c873e948a8ee8dc9b3a15b374352
[]
no_license
yespickmeup/Liquid-Dive
3d190ff03637c248dfc2c04352e8cf11def88aea
2a9f2299c6710e30b2ea4b2514980e88f97a514d
refs/heads/master
2021-01-10T01:13:25.084707
2018-11-13T16:23:50
2018-11-13T16:23:50
51,804,995
0
0
null
null
null
null
UTF-8
Java
false
false
10,092
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * dlg_set_date.java * * Created on Jan 29, 2012, 2:06:45 PM */ package POS.dlg; import POS.svc2.S5_ret_system_date; import POS.to2.to_system_date; import POS.utl.Prompt; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.util.Date; import java.util.logging.Level; import javax.swing.JOptionPane; import mijzcx.synapse.desk.utils.CloseDialog; import mijzcx.synapse.desk.utils.DateUtil; import mijzcx.synapse.desk.utils.KeyMapping; import mijzcx.synapse.desk.utils.KeyMapping.KeyAction; /** * * @author u2 */ public class Dlg_set_date extends javax.swing.JDialog { //<editor-fold defaultstate="collapsed" desc=" callback "> private Callback callback; public void setCallback(Callback callback) { this.callback = callback; } public static interface Callback { void ok(CloseDialog closeDialog, OutputData data); } public static class OutputData { } public static class InputData { } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" Constructors "> private Dlg_set_date(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); myInit(); } private Dlg_set_date(java.awt.Dialog parent, boolean modal) { super(parent, modal); initComponents(); myInit(); } public Dlg_set_date() { super(); initComponents(); myInit(); } private Dlg_set_date myRef; private void setThisRef(Dlg_set_date myRef) { this.myRef = myRef; } private static java.util.Map<Object, Dlg_set_date> dialogContainer = new java.util.HashMap(); public static void clearUpFirst(java.awt.Window parent) { if (dialogContainer.containsKey(parent)) { dialogContainer.remove(parent); } } public static Dlg_set_date create(java.awt.Window parent, boolean modal) { if (modal) { return create(parent, ModalityType.APPLICATION_MODAL); } return create(parent, ModalityType.MODELESS); } public static Dlg_set_date create(java.awt.Window parent, java.awt.Dialog.ModalityType modalType) { if (parent instanceof java.awt.Frame) { Dlg_set_date dialog = dialogContainer.get(parent); if (dialog == null) { dialog = new Dlg_set_date((java.awt.Frame) parent, false); dialog.setModalityType(modalType); dialogContainer.put(parent, dialog); java.util.logging.Logger.getAnonymousLogger(). log(Level.INFO, "instances: {0}", dialogContainer.size()); dialog.setThisRef(dialog); return dialog; } else { dialog.setModalityType(modalType); return dialog; } } if (parent instanceof java.awt.Dialog) { Dlg_set_date dialog = dialogContainer.get(parent); if (dialog == null) { dialog = new Dlg_set_date((java.awt.Dialog) parent, false); dialog.setModalityType(modalType); dialogContainer.put(parent, dialog); java.util.logging.Logger.getAnonymousLogger(). log(Level.INFO, "instances: {0}", dialogContainer.size()); dialog.setThisRef(dialog); return dialog; } else { dialog.setModalityType(modalType); return dialog; } } return null; } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" main "> public static void main(String args[]) { try { javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager. getSystemLookAndFeelClassName()); } catch (Exception e) { throw new RuntimeException(e); } Dlg_set_date dialog = Dlg_set_date.create(new javax.swing.JFrame(), true); dialog.setVisible(true); } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" added "> @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible == true) { getContentPane(). removeAll(); initComponents(); myInit(); repaint(); validateTree(); } } public javax.swing.JPanel getSurface() { return (javax.swing.JPanel) getContentPane(); } public void nullify() { myRef.setVisible(false); myRef = null; } //</editor-fold> /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); dp_date = new com.toedter.calendar.JDateChooser(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(159, 207, 243)); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel1.setText("Choose Date:"); jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(44, 45, -1, -1)); dp_date.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jPanel1.add(dp_date, new org.netbeans.lib.awtextra.AbsoluteConstraints(155, 32, 176, 30)); jButton1.setText("Ok"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 80, 64, 30)); jButton2.setText("Cancel"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 80, 70, 30)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: do_ok(); }//GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here:cancel() cancel(); }//GEN-LAST:event_jButton2ActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private com.toedter.calendar.JDateChooser dp_date; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables //<editor-fold defaultstate="collapsed" desc=" myInit "> private void myInit() { initActionKey(); do_set_date(); } private void initActionKey() { KeyMapping.mapKeyWIFW(getSurface(), KeyEvent.VK_ESCAPE, new KeyAction() { @Override public void actionPerformed(ActionEvent e) { setVisible(false); } }); KeyMapping.mapKeyWIFW(getSurface(), KeyEvent.VK_ENTER, new KeyAction() { @Override public void actionPerformed(ActionEvent e) { do_ok(); } }); } //</editor-fold> private void do_set_date() { Date date = new Date(); // S5_ret_system_date.do_ret_system_date(); dp_date.setDate(date); } public void load(InputData data) { } private void cancel() { this.setVisible(false); } private void do_ok() { if (callback == null) { return; } prcss_work_on(); // Executor.doExecute(this, new Executor.Task() { // // @Override // public void work_on() { // // } // }); } private void prcss_work_on() { if (!check_system_date()) { return; } to_system_date.setCurrent_date(dp_date.getDate()); callback.ok(new CloseDialog(this), new OutputData()); this.dispose(); } private boolean check_system_date() { Date start = S5_ret_system_date.do_ret_system_date(); Date end = dp_date.getDate(); double tot = DateUtil.compareAsDays(start, start); if (tot < 0) { Prompt.call("Cannot Proceed to Date"); // JOptionPane.showMessageDialog(null, "Cannot Proceed to Date"); return false; } else { S5_ret_system_date.set_date(end); return true; } } }
[ "rpascua.synsoftech@gmail.com" ]
rpascua.synsoftech@gmail.com
fc3236fc4864084ca38232fc963b62b3b5c5656f
8140d1dffd3952120b18aec36f7222c737f905c2
/src/day20_stringManipulation_part2/task81_TimeStamp.java
8b1cf08c2e63af2f4ca2240da82ff147547045e2
[]
no_license
adacal-java/java_Europe_B13
37c58730ce4ed8a61ce7d7dc64f5b7a1d43ef9d7
3414c2671b4dfcc77e56eaee1b25844dd8b4a145
refs/heads/master
2020-08-27T07:57:54.532888
2019-10-23T20:51:18
2019-10-23T20:51:18
217,292,307
2
0
null
2019-10-24T12:20:54
2019-10-24T12:20:53
null
UTF-8
Java
false
false
350
java
package day20_stringManipulation_part2; public class task81_TimeStamp { public static void main(String[] args) { String time = "10/01/2019 15:42:00"; System.out.println(timeStamp(time)); } public static String timeStamp(String time) { time = time.replace("/", "").replace(":", "").replace(" ", ""); return time; } }
[ "github@cybertekschool.com" ]
github@cybertekschool.com
8f83d6a25d5d95c4ea2798fe4e9d3ee015aeb9eb
157683d943090fe1bd9c5c500504350182455b2c
/java/dagger/internal/codegen/FrameworkFieldInitializer.java
9bc1d176aa7ed81bc77b0b7de981367e936d7822
[ "Apache-2.0" ]
permissive
Tangpj/dagger
9d1176a263fe50e94e0f6ced3e8c3c72b0d198dd
16c769a104f7109b9725c3e435c8affd104b126c
refs/heads/master
2020-04-02T09:20:32.951975
2018-10-25T06:17:06
2018-10-25T06:36:41
154,288,359
0
0
Apache-2.0
2018-10-23T08:09:18
2018-10-23T08:09:17
null
UTF-8
Java
false
false
8,155
java
/* * Copyright (C) 2015 The Dagger Authors. * * 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 dagger.internal.codegen; import static com.google.common.base.Preconditions.checkNotNull; import static dagger.internal.codegen.AnnotationSpecs.Suppression.RAWTYPES; import static dagger.internal.codegen.GeneratedComponentModel.FieldSpecKind.FRAMEWORK_FIELD; import static javax.lang.model.element.Modifier.PRIVATE; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.CodeBlock; import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.TypeName; import dagger.internal.DelegateFactory; import java.util.Optional; /** * An object that can initialize a framework-type component field for a binding. An instance should * be created for each field. */ class FrameworkFieldInitializer implements FrameworkInstanceSupplier { /** * An object that can determine the expression to use to assign to the component field for a * binding. */ interface FrameworkInstanceCreationExpression { /** Returns the expression to use to assign to the component field for the binding. */ CodeBlock creationExpression(); /** * Returns the type of the creation expression when it is a specific factory type. This * implementation returns {@link Optional#empty()}. */ default Optional<TypeName> specificType() { return Optional.empty(); } /** * Returns the framework class to use for the field, if different from the one implied by the * binding. This implementation returns {@link Optional#empty()}. */ default Optional<ClassName> alternativeFrameworkClass() { return Optional.empty(); } /** * Returns {@code true} if instead of using {@link #creationExpression()} to create a framework * instance, a case in {@link InnerSwitchingProviders} should be created for this binding. */ // TODO(ronshapiro): perhaps this isn't the right approach. Instead of saying "Use // SetFactory.EMPTY because you will only get 1 class for all types of bindings that use // SetFactory", maybe we should still use an inner switching provider but the same switching // provider index for all cases. default boolean useInnerSwitchingProvider() { return true; } } private final GeneratedComponentModel generatedComponentModel; private final ResolvedBindings resolvedBindings; private final FrameworkInstanceCreationExpression frameworkInstanceCreationExpression; private FieldSpec fieldSpec; private InitializationState fieldInitializationState = InitializationState.UNINITIALIZED; FrameworkFieldInitializer( GeneratedComponentModel generatedComponentModel, ResolvedBindings resolvedBindings, FrameworkInstanceCreationExpression frameworkInstanceCreationExpression) { this.generatedComponentModel = checkNotNull(generatedComponentModel); this.resolvedBindings = checkNotNull(resolvedBindings); this.frameworkInstanceCreationExpression = checkNotNull(frameworkInstanceCreationExpression); } /** * Returns the {@link MemberSelect} for the framework field, and adds the field and its * initialization code to the component if it's needed and not already added. */ @Override public final MemberSelect memberSelect() { initializeField(); return MemberSelect.localField(generatedComponentModel.name(), checkNotNull(fieldSpec).name); } /** Adds the field and its initialization code to the component. */ private void initializeField() { switch (fieldInitializationState) { case UNINITIALIZED: // Change our state in case we are recursively invoked via initializeBindingExpression fieldInitializationState = InitializationState.INITIALIZING; CodeBlock.Builder codeBuilder = CodeBlock.builder(); CodeBlock fieldInitialization = frameworkInstanceCreationExpression.creationExpression(); CodeBlock initCode = CodeBlock.of("this.$N = $L;", getOrCreateField(), fieldInitialization); if (fieldInitializationState == InitializationState.DELEGATED) { // If we were recursively invoked, set the delegate factory as part of our initialization CodeBlock delegateFactoryVariable = CodeBlock.of("$NDelegate", fieldSpec); codeBuilder .add( "$1T $2L = ($1T) $3N;", DelegateFactory.class, delegateFactoryVariable, fieldSpec) .add(initCode) .add("$L.setDelegatedProvider($N);", delegateFactoryVariable, fieldSpec); } else { codeBuilder.add(initCode); } generatedComponentModel.addInitialization(codeBuilder.build()); fieldInitializationState = InitializationState.INITIALIZED; break; case INITIALIZING: // We were recursively invoked, so create a delegate factory instead fieldInitializationState = InitializationState.DELEGATED; generatedComponentModel.addInitialization( CodeBlock.of("this.$N = new $T<>();", getOrCreateField(), DelegateFactory.class)); break; case DELEGATED: case INITIALIZED: break; default: throw new AssertionError("Unhandled initialization state: " + fieldInitializationState); } } /** * Adds a field representing the resolved bindings, optionally forcing it to use a particular * binding type (instead of the type the resolved bindings would typically use). */ private FieldSpec getOrCreateField() { if (fieldSpec != null) { return fieldSpec; } boolean useRawType = !generatedComponentModel.isTypeAccessible(resolvedBindings.key().type()); FrameworkField contributionBindingField = FrameworkField.forResolvedBindings( resolvedBindings, frameworkInstanceCreationExpression.alternativeFrameworkClass()); TypeName fieldType; if (!fieldInitializationState.equals(InitializationState.DELEGATED) && specificType().isPresent()) { // For some larger components, this causes javac to compile much faster by getting the // field type to exactly match the type of the expression being assigned to it. fieldType = specificType().get(); } else if (useRawType) { fieldType = contributionBindingField.type().rawType; } else { fieldType = contributionBindingField.type(); } FieldSpec.Builder contributionField = FieldSpec.builder( fieldType, generatedComponentModel.getUniqueFieldName(contributionBindingField.name())); contributionField.addModifiers(PRIVATE); if (useRawType && !specificType().isPresent()) { contributionField.addAnnotation(AnnotationSpecs.suppressWarnings(RAWTYPES)); } fieldSpec = contributionField.build(); generatedComponentModel.addField(FRAMEWORK_FIELD, fieldSpec); return fieldSpec; } /** Returns the type of the instance when it is a specific factory type. */ @Override public Optional<TypeName> specificType() { return frameworkInstanceCreationExpression.specificType(); } /** Initialization state for a factory field. */ private enum InitializationState { /** The field is {@code null}. */ UNINITIALIZED, /** * The field's dependencies are being set up. If the field is needed in this state, use a {@link * DelegateFactory}. */ INITIALIZING, /** * The field's dependencies are being set up, but the field can be used because it has already * been set to a {@link DelegateFactory}. */ DELEGATED, /** The field is set to an undelegated factory. */ INITIALIZED; } }
[ "shapiro.rd@gmail.com" ]
shapiro.rd@gmail.com
6651cf191de9b74338a44d3340f08586e7dadb67
47163c53bf050255ccea8ee7fd88b0a42ddbdf64
/TestServer/src/main/java/ru/thesn/test_server/servlets/DeleteServlet.java
f9ff8233c772ae94e1b05a39e8d9b2cb11598cc3
[]
no_license
Generalus/FileServer
ddcac799ae348a4b8c7e41244791915ad83ee4e6
eabbda456532644478ef8a77b8b6ab08e47eef7e
refs/heads/master
2021-01-20T09:14:38.282307
2017-04-20T21:47:22
2017-04-20T21:47:22
83,918,712
0
0
null
null
null
null
UTF-8
Java
false
false
1,150
java
package ru.thesn.test_server.servlets; import org.apache.commons.io.FileUtils; import ru.thesn.test_server.Constants; import ru.thesn.test_server.Mapping; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Map; public final class DeleteServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map<String, String> md5ToName = Mapping.getInstance().getMd5ToName(); String hash = req.getParameter("hash"); resp.setContentType("text/plain"); PrintWriter out = resp.getWriter(); String deleted = md5ToName.remove(hash); if (deleted != null) { FileUtils.deleteQuietly(new File(Constants.ROOT_FOLDER + deleted)); out.println("Completed!"); } else { out.println("File was not found!"); } out.flush(); out.close(); } }
[ "thesn@yandex.ru" ]
thesn@yandex.ru
fcbdf4487cebe48ad8d3210852c69cbef26a916b
67ed109e86416b1448247371c51fef5893115f7d
/pwdgen2/evilcorp/com.evilcorp.pwdgen_source_from_JADX/sources/android/support/p000v4/media/session/MediaSessionCompatApi21.java
1a0d6557123f5d43c914ac76c6a4e128a47bb0ad
[]
no_license
Hong5489/FSEC2020
cc9fde303e7dced5a1defa121ddc29b88b95ab0d
9063d2266adf688e1792ea78b3f1b61cd28ece89
refs/heads/master
2022-12-01T15:17:21.314765
2020-08-16T15:35:49
2020-08-16T15:35:49
287,962,248
1
0
null
null
null
null
UTF-8
Java
false
false
8,124
java
package android.support.p000v4.media.session; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.media.AudioAttributes.Builder; import android.media.MediaDescription; import android.media.MediaMetadata; import android.media.Rating; import android.media.VolumeProvider; import android.media.session.MediaSession; import android.media.session.MediaSession.Token; import android.media.session.PlaybackState; import android.os.Bundle; import android.os.Handler; import android.os.Parcelable; import android.os.ResultReceiver; import android.util.Log; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /* renamed from: android.support.v4.media.session.MediaSessionCompatApi21 */ class MediaSessionCompatApi21 { static final String TAG = "MediaSessionCompatApi21"; /* renamed from: android.support.v4.media.session.MediaSessionCompatApi21$Callback */ interface Callback { void onCommand(String str, Bundle bundle, ResultReceiver resultReceiver); void onCustomAction(String str, Bundle bundle); void onFastForward(); boolean onMediaButtonEvent(Intent intent); void onPause(); void onPlay(); void onPlayFromMediaId(String str, Bundle bundle); void onPlayFromSearch(String str, Bundle bundle); void onRewind(); void onSeekTo(long j); void onSetRating(Object obj); void onSetRating(Object obj, Bundle bundle); void onSkipToNext(); void onSkipToPrevious(); void onSkipToQueueItem(long j); void onStop(); } /* renamed from: android.support.v4.media.session.MediaSessionCompatApi21$CallbackProxy */ static class CallbackProxy<T extends Callback> extends android.media.session.MediaSession.Callback { protected final T mCallback; public CallbackProxy(T t) { this.mCallback = t; } public void onCommand(String str, Bundle bundle, ResultReceiver resultReceiver) { this.mCallback.onCommand(str, bundle, resultReceiver); } public boolean onMediaButtonEvent(Intent intent) { return this.mCallback.onMediaButtonEvent(intent) || super.onMediaButtonEvent(intent); } public void onPlay() { this.mCallback.onPlay(); } public void onPlayFromMediaId(String str, Bundle bundle) { this.mCallback.onPlayFromMediaId(str, bundle); } public void onPlayFromSearch(String str, Bundle bundle) { this.mCallback.onPlayFromSearch(str, bundle); } public void onSkipToQueueItem(long j) { this.mCallback.onSkipToQueueItem(j); } public void onPause() { this.mCallback.onPause(); } public void onSkipToNext() { this.mCallback.onSkipToNext(); } public void onSkipToPrevious() { this.mCallback.onSkipToPrevious(); } public void onFastForward() { this.mCallback.onFastForward(); } public void onRewind() { this.mCallback.onRewind(); } public void onStop() { this.mCallback.onStop(); } public void onSeekTo(long j) { this.mCallback.onSeekTo(j); } public void onSetRating(Rating rating) { this.mCallback.onSetRating(rating); } public void onCustomAction(String str, Bundle bundle) { this.mCallback.onCustomAction(str, bundle); } } /* renamed from: android.support.v4.media.session.MediaSessionCompatApi21$QueueItem */ static class QueueItem { QueueItem() { } public static Object createItem(Object obj, long j) { return new android.media.session.MediaSession.QueueItem((MediaDescription) obj, j); } public static Object getDescription(Object obj) { return ((android.media.session.MediaSession.QueueItem) obj).getDescription(); } public static long getQueueId(Object obj) { return ((android.media.session.MediaSession.QueueItem) obj).getQueueId(); } } MediaSessionCompatApi21() { } public static Object createSession(Context context, String str) { return new MediaSession(context, str); } public static Object verifySession(Object obj) { if (obj instanceof MediaSession) { return obj; } throw new IllegalArgumentException("mediaSession is not a valid MediaSession object"); } public static Object verifyToken(Object obj) { if (obj instanceof Token) { return obj; } throw new IllegalArgumentException("token is not a valid MediaSession.Token object"); } public static Object createCallback(Callback callback) { return new CallbackProxy(callback); } public static void setCallback(Object obj, Object obj2, Handler handler) { ((MediaSession) obj).setCallback((android.media.session.MediaSession.Callback) obj2, handler); } public static void setFlags(Object obj, int i) { ((MediaSession) obj).setFlags(i); } public static void setPlaybackToLocal(Object obj, int i) { Builder builder = new Builder(); builder.setLegacyStreamType(i); ((MediaSession) obj).setPlaybackToLocal(builder.build()); } public static void setPlaybackToRemote(Object obj, Object obj2) { ((MediaSession) obj).setPlaybackToRemote((VolumeProvider) obj2); } public static void setActive(Object obj, boolean z) { ((MediaSession) obj).setActive(z); } public static boolean isActive(Object obj) { return ((MediaSession) obj).isActive(); } public static void sendSessionEvent(Object obj, String str, Bundle bundle) { ((MediaSession) obj).sendSessionEvent(str, bundle); } public static void release(Object obj) { ((MediaSession) obj).release(); } public static Parcelable getSessionToken(Object obj) { return ((MediaSession) obj).getSessionToken(); } public static void setPlaybackState(Object obj, Object obj2) { ((MediaSession) obj).setPlaybackState((PlaybackState) obj2); } public static void setMetadata(Object obj, Object obj2) { ((MediaSession) obj).setMetadata((MediaMetadata) obj2); } public static void setSessionActivity(Object obj, PendingIntent pendingIntent) { ((MediaSession) obj).setSessionActivity(pendingIntent); } public static void setMediaButtonReceiver(Object obj, PendingIntent pendingIntent) { ((MediaSession) obj).setMediaButtonReceiver(pendingIntent); } public static void setQueue(Object obj, List<Object> list) { if (list == null) { ((MediaSession) obj).setQueue(null); return; } ArrayList arrayList = new ArrayList(); Iterator it = list.iterator(); while (it.hasNext()) { arrayList.add((android.media.session.MediaSession.QueueItem) it.next()); } ((MediaSession) obj).setQueue(arrayList); } public static void setQueueTitle(Object obj, CharSequence charSequence) { ((MediaSession) obj).setQueueTitle(charSequence); } public static void setExtras(Object obj, Bundle bundle) { ((MediaSession) obj).setExtras(bundle); } public static boolean hasCallback(Object obj) { boolean z = false; try { Field declaredField = obj.getClass().getDeclaredField("mCallback"); if (declaredField != null) { declaredField.setAccessible(true); if (declaredField.get(obj) != null) { z = true; } return z; } } catch (IllegalAccessException | NoSuchFieldException unused) { Log.w(TAG, "Failed to get mCallback object."); } return false; } }
[ "hongwei5489@gmail.com" ]
hongwei5489@gmail.com
8c2bf5979fe2b00d2fd322b6133819babdd74b60
77e3220c487964d397f90ad18e8308551ad79a53
/hw06/src/generated/MiniCListener.java
ec394cc385d8925f00cd0c61057c8fe855b7be54
[]
no_license
minkinew/CNU-2019-Fall-Compiler
d4a7ca8683a27b3efa3cff9b27abb72f9d192d2f
c128b68a604552627cb9da96842a7ac562294e35
refs/heads/master
2020-08-12T17:55:57.157616
2019-11-26T14:13:06
2019-11-26T14:13:06
214,814,580
1
1
null
null
null
null
UTF-8
Java
false
false
5,331
java
package generated;// Generated from C:/Users/�αⴺ/IdeaProjects/Compiler_hw02/src\MiniC.g4 by ANTLR 4.7.2 import org.antlr.v4.runtime.tree.ParseTreeListener; /** * This interface defines a complete listener for a parse tree produced by * {@link MiniCParser}. */ public interface MiniCListener extends ParseTreeListener { /** * Enter a parse tree produced by {@link MiniCParser#program}. * @param ctx the parse tree */ void enterProgram(MiniCParser.ProgramContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#program}. * @param ctx the parse tree */ void exitProgram(MiniCParser.ProgramContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#decl}. * @param ctx the parse tree */ void enterDecl(MiniCParser.DeclContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#decl}. * @param ctx the parse tree */ void exitDecl(MiniCParser.DeclContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#var_decl}. * @param ctx the parse tree */ void enterVar_decl(MiniCParser.Var_declContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#var_decl}. * @param ctx the parse tree */ void exitVar_decl(MiniCParser.Var_declContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#type_spec}. * @param ctx the parse tree */ void enterType_spec(MiniCParser.Type_specContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#type_spec}. * @param ctx the parse tree */ void exitType_spec(MiniCParser.Type_specContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#fun_decl}. * @param ctx the parse tree */ void enterFun_decl(MiniCParser.Fun_declContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#fun_decl}. * @param ctx the parse tree */ void exitFun_decl(MiniCParser.Fun_declContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#params}. * @param ctx the parse tree */ void enterParams(MiniCParser.ParamsContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#params}. * @param ctx the parse tree */ void exitParams(MiniCParser.ParamsContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#param}. * @param ctx the parse tree */ void enterParam(MiniCParser.ParamContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#param}. * @param ctx the parse tree */ void exitParam(MiniCParser.ParamContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#stmt}. * @param ctx the parse tree */ void enterStmt(MiniCParser.StmtContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#stmt}. * @param ctx the parse tree */ void exitStmt(MiniCParser.StmtContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#expr_stmt}. * @param ctx the parse tree */ void enterExpr_stmt(MiniCParser.Expr_stmtContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#expr_stmt}. * @param ctx the parse tree */ void exitExpr_stmt(MiniCParser.Expr_stmtContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#while_stmt}. * @param ctx the parse tree */ void enterWhile_stmt(MiniCParser.While_stmtContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#while_stmt}. * @param ctx the parse tree */ void exitWhile_stmt(MiniCParser.While_stmtContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#compound_stmt}. * @param ctx the parse tree */ void enterCompound_stmt(MiniCParser.Compound_stmtContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#compound_stmt}. * @param ctx the parse tree */ void exitCompound_stmt(MiniCParser.Compound_stmtContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#local_decl}. * @param ctx the parse tree */ void enterLocal_decl(MiniCParser.Local_declContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#local_decl}. * @param ctx the parse tree */ void exitLocal_decl(MiniCParser.Local_declContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#if_stmt}. * @param ctx the parse tree */ void enterIf_stmt(MiniCParser.If_stmtContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#if_stmt}. * @param ctx the parse tree */ void exitIf_stmt(MiniCParser.If_stmtContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#return_stmt}. * @param ctx the parse tree */ void enterReturn_stmt(MiniCParser.Return_stmtContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#return_stmt}. * @param ctx the parse tree */ void exitReturn_stmt(MiniCParser.Return_stmtContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#expr}. * @param ctx the parse tree */ void enterExpr(MiniCParser.ExprContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#expr}. * @param ctx the parse tree */ void exitExpr(MiniCParser.ExprContext ctx); /** * Enter a parse tree produced by {@link MiniCParser#args}. * @param ctx the parse tree */ void enterArgs(MiniCParser.ArgsContext ctx); /** * Exit a parse tree produced by {@link MiniCParser#args}. * @param ctx the parse tree */ void exitArgs(MiniCParser.ArgsContext ctx); }
[ "dbs03088@naver.com" ]
dbs03088@naver.com
3dedce0a1ec92d5f32f79bc2515f36ead5a3b421
1d1c6e01e5f51baf5e4752cdf13507a22bf0186f
/src/main/java/siit/InsertServlet.java
e67b1e5113d934aaa6b3b222061c5b92c68f8431
[]
no_license
nickm17/java-grupa-12-web
c260271acf127e76fe91830bbc91be99877e4e27
65dc2a0b19ca9af8c2e6242af33cad2baaf15cf1
refs/heads/master
2021-02-06T01:50:11.561434
2020-02-28T22:04:52
2020-02-28T22:04:52
243,862,489
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package siit; import org.thymeleaf.context.WebContext; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(name = "InsertServlet", urlPatterns = {"/showInsertPage"}) public class InsertServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { WebContext ctx = new WebContext(request, response, request.getServletContext(), request.getLocale()); ThymeleafAppUtil.getTemplateEngine().process("insert", ctx, response.getWriter()); } }
[ "nicolae.spalatelu@gohenry.co.uk" ]
nicolae.spalatelu@gohenry.co.uk
9bef921d1790eeee520a7c65ae9c2cf618a3f53f
9b26e1a38169e25d2129346afd43b6a2a46d8748
/app/src/main/java/com/systango/viperboilerplate/common/Mapper.java
4c2a8021025d263cf0f3e2557f07a9d01467c832
[ "MIT" ]
permissive
mrajput-systango/android-viper-boilerplate
f09f11400c4ecb47d53f30b85259f786f2697224
16ffd9e46a9c4154bfd2ee683d069d895df2517c
refs/heads/master
2020-04-27T18:09:16.069201
2019-03-14T16:42:09
2019-03-14T16:42:09
174,556,359
1
0
null
null
null
null
UTF-8
Java
false
false
213
java
package com.systango.viperboilerplate.common; /** * Created by Mohit Rajput on 13/3/19. * TODO: Insert javadoc information here */ public abstract class Mapper<E, T> { public abstract T mapFrom(E from); }
[ "mrajput@isystango.com" ]
mrajput@isystango.com
5d8311ec66429d344c2831175a55f85fe7fd42db
54c4a26b2306ab9e977335ea90bd283e241cbe3d
/src/com/oaec/b2c/service/impl/OrderServiceImpl.java
1e4d7b69030394365d0d8027a06c4306a6c1aeb8
[]
no_license
KobeBryant8-24-MVP/b2c
49f0b488de84a5aa1ffb56082610a31394b0004b
638de527373cf4edd2b9d3f624accff3880e0241
refs/heads/master
2022-01-13T02:47:14.109715
2019-06-28T02:51:02
2019-06-28T02:51:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,744
java
package com.oaec.b2c.service.impl; import com.alibaba.fastjson.JSON; import com.oaec.b2c.dao.AddressDao; import com.oaec.b2c.dao.CartDao; import com.oaec.b2c.dao.OrderDao; import com.oaec.b2c.dao.ProductDao; import com.oaec.b2c.dao.impl.AddressDaoImpl; import com.oaec.b2c.dao.impl.CartDaoImpl; import com.oaec.b2c.dao.impl.OrderDaoImpl; import com.oaec.b2c.dao.impl.ProductDaoImpl; import com.oaec.b2c.service.OrderService; import java.util.List; import java.util.Map; public class OrderServiceImpl implements OrderService { private OrderDao orderDao = new OrderDaoImpl(); private AddressDao addressDao = new AddressDaoImpl(); private CartDao cartDao = new CartDaoImpl(); private ProductDao productDao = new ProductDaoImpl(); @Override public List<Map<String, Object>> getOrders(Integer userId) { //1.根据用户编号查询用户的所有订单 List<Map<String, Object>> orderList = orderDao.queryByUserId(userId); for (Map<String, Object> map : orderList) { //获取地址编号 int address_id = Integer.parseInt(map.get("address_id").toString()); //2.查询订单对应的地址 Map<String, Object> address = addressDao.queryById(address_id); map.put("address",address); //3.查询出订单的总价钱 int order_id = Integer.parseInt(map.get("order_id").toString()); Double totalPrice = orderDao.getTotalPrice(order_id); map.put("totalPrice",totalPrice); //4.查询出订单对应的商品 List<Map<String, Object>> products = orderDao.queryProductByOrderId(order_id); map.put("products",products); } // System.out.println(JSON.toJSONString(orderList)); return orderList; } @Override public boolean submit(Integer userId, Integer aid, String[] pids) { int result = 0; //1.向订单主表插入数据 int orderId = orderDao.doInsert(userId, aid); for (String pid : pids) { Integer productId = Integer.parseInt(pid); //查询当前编号的商品信息 Map<String, Object> product = cartDao.queryByUserIdAndProductId(userId, productId); product.put("order_id",orderId); //2.向订单明细表插入数据 result += orderDao.doInsertDetail(product); //3.在购物车中删除此商品 result += cartDao.doDelete(userId,productId); //4.修改库存和销量 int quantity = Integer.parseInt(product.get("quantity").toString()); result += productDao.updateInventoryAndSalesVolume(productId,quantity); } return result > 0; } }
[ "351916362@qq.com" ]
351916362@qq.com
ba1e65f7b66063054eb31c0e76f1ecc041abdce3
93b6e782e0b6f2b96fdc728f4e7f00c07dd30801
/aula06/exemplos/exemplo01/Gerente.java
88ee8e5583c9cc159bf0d57ccfebf99c02a207b5
[]
no_license
AlexAlvesJr/turma15b
13eeacc87866be77d51306bb7a5186825fcb2534
1820350890716d21dc54e87013f09c06b1985e93
refs/heads/master
2023-03-19T02:16:40.945214
2021-03-08T16:48:48
2021-03-08T16:48:48
343,409,667
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package exemplos.exemplo01; public class Gerente extends Funcionario { private int numeroFuncionarios; public Gerente(String nome, double salario, int numeroFuncionarios){ super(nome, salario); // chamada ao construtor da classe base (superclasse) this.numeroFuncionarios = numeroFuncionarios; } public void setNumeroFuncionarios(int numeroFuncionarios){ this.numeroFuncionarios = numeroFuncionarios; } public int getNumeroFuncionarios(){ return numeroFuncionarios; } @Override public String toString() { return super.toString() + ": " + numeroFuncionarios; } @Override public void aumentoSalario(double x) { // TODO Auto-generated method stub super.aumentoSalario(x + 10); } }
[ "alexalves_jr@hotmail.com" ]
alexalves_jr@hotmail.com
5a3b87397d4470186c6cf0dc339cff563cb0fcc7
9c28b5998d58a1b22dc2b9957d7cec2c1716776b
/src/main/java/com/design/vending_machine/NotSufficientChangeException.java
e6de3051dfc1b8c190b7e7bc57438ae2fbb83922
[]
no_license
manhhoang/learn-system-design
53511ee93df2b5e706a932018daaa55edb38ccb3
8e14bf77433946e08efdf362934fb23cd2339585
refs/heads/master
2021-09-28T16:20:20.320314
2021-09-19T23:17:20
2021-09-19T23:17:20
100,129,377
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package com.design.vending_machine; public class NotSufficientChangeException extends RuntimeException { private String message; public NotSufficientChangeException(String string) { this.message = string; } @Override public String getMessage(){ return message; } }
[ "thunguyen0705@gmail.com" ]
thunguyen0705@gmail.com
9824411c62c8ed5e7a623dbbd2428624a3f8ce40
9e4b5b3294b2261dc0904de0920759690ea39963
/app/src/main/java/com/example/android/bakingapp/RecipeDetailsActivity.java
7b9308bb40974b1373d52f6fc788e077c18eb423
[]
no_license
PMunnin/BakingApp
2696374337eb807bcd941add9b75b0ff7b858a1d
083bf3d27dc8a86bb161b52e956c76e94c269f8a
refs/heads/master
2020-04-07T18:11:26.124403
2018-11-22T10:41:12
2018-11-22T10:41:12
158,600,622
0
0
null
null
null
null
UTF-8
Java
false
false
6,351
java
package com.example.android.bakingapp; import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import com.example.android.bakingapp.ingredient.Ingredient; import com.example.android.bakingapp.ingredient.IngredientsListFragment; import com.example.android.bakingapp.recipe.Recipe; import com.example.android.bakingapp.step.RecipeStep; import com.example.android.bakingapp.step.RecipeStepDetailFragment; import com.example.android.bakingapp.step.RecipeStepsFragment; import com.example.android.bakingapp.roomdatabase.RecipesDatabase; import com.example.android.bakingapp.R; import timber.log.Timber; public class RecipeDetailsActivity extends AppCompatActivity { public static final String RECIPE_EXTRA_INTENT = "RECIPE_EXTRA_INTENT"; public static final String RECIPE_STEP = "RECIPE_STEP"; public static final String RECIPE_ID_FROM_WIDGET = "RECIPE_ID_FROM_WIDGET"; public static final String TWO_PANE = "TWO_PANE"; public Recipe recipe; public RecipeStep recipeStep; private RecipesDatabase recipesDatabase; @BindView(R.id.recipe_name_title) public TextView mRecipeName; /** * A single-pane display refers to phone screens, and two-pane to larger tablet screens */ private boolean mTwoPane = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recipe_details); ButterKnife.bind(this); getSupportActionBar().setDisplayHomeAsUpEnabled(true); recipesDatabase = RecipesDatabase.getDatabase(getApplicationContext()); if (savedInstanceState != null) { recipe = savedInstanceState.getParcelable(RECIPE_EXTRA_INTENT); mTwoPane = savedInstanceState.getBoolean(TWO_PANE); Timber.d("Restoring the previous information!..."); } else { /** * Retrieve the passed on recipe here */ Intent previousIntent = getIntent(); if(previousIntent.getExtras().containsKey(RECIPE_EXTRA_INTENT)){ recipe = previousIntent.getParcelableExtra(RECIPE_EXTRA_INTENT); } else if(previousIntent.getExtras().containsKey(RECIPE_ID_FROM_WIDGET)){ /** * Flow when the app is lauched from the widget */ int id = previousIntent.getExtras().getInt(RECIPE_ID_FROM_WIDGET); recipe = recipesDatabase.recipeDao().getRecipe(id); recipe.setIngredients((ArrayList<Ingredient>) recipesDatabase.recipeDao().getIngredients(id)); recipe.setSteps((ArrayList<RecipeStep>) recipesDatabase.recipeDao().getSteps(id)); } Timber.d("Recipe name: " + recipe.getName()); //Toast.makeText(this, "Recipe clicked is " + recipe.getName(), Toast.LENGTH_SHORT).show(); } if (findViewById(R.id.linear_layout_to_verify) != null) { mTwoPane = true; Timber.d("This a tablet!"); } getDetails(savedInstanceState); } private void getDetails(Bundle savedInstanceState) { /** * Setting recipe name here */ mRecipeName.setText(recipe.getName()); List<Ingredient> ingredients = recipe.getIngredients(); IngredientsListFragment ingredientsListFragment = (IngredientsListFragment)getFragmentManager().findFragmentById(R.id.ingredient_fragment_container); if(ingredientsListFragment == null) { ingredientsListFragment = new IngredientsListFragment(); ingredientsListFragment.setIngredientsList(ingredients); FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.ingredient_fragment_container, ingredientsListFragment); fragmentTransaction.commit(); } List<RecipeStep> recipeSteps = recipe.getSteps(); RecipeStepsFragment recipeStepsFragment = (RecipeStepsFragment)getFragmentManager() .findFragmentById(R.id.recipe_steps_fragment_container); if(recipeStepsFragment == null) { recipeStepsFragment = new RecipeStepsFragment(); recipeStepsFragment.setRecipeStepList(recipeSteps); recipeStepsFragment.setRecipe(recipe); recipeStepsFragment.setMTwoPane(mTwoPane); recipeStepsFragment.setParentActivity(this); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.recipe_steps_fragment_container, recipeStepsFragment); transaction.commit(); } if(mTwoPane == true){ Bundle bundle = new Bundle(); bundle.putParcelable(RECIPE_EXTRA_INTENT, recipe); /** * Initially display the first step */ recipeStep = recipe.getSteps().get(0); bundle.putParcelable(RECIPE_STEP, recipeStep); bundle.putBoolean(TWO_PANE, true); RecipeStepDetailFragment recipeStepDetailFragment = (RecipeStepDetailFragment) getSupportFragmentManager() .findFragmentById(R.id.recipe_step_detail_fragment); if(recipeStepDetailFragment == null) { recipeStepDetailFragment = new RecipeStepDetailFragment(); recipeStepDetailFragment.setArguments(bundle); /** * Calling the fragment as this is a tablet */ getSupportFragmentManager().beginTransaction() .replace(R.id.recipe_step_detail_fragment, recipeStepDetailFragment) .commit(); } } } @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); Timber.d("Inside onSaveInstanceState() Saving state ...."); outState.putParcelable(RECIPE_EXTRA_INTENT, recipe); outState.putBoolean(TWO_PANE, mTwoPane); } }
[ "pmunnin@gmail.com" ]
pmunnin@gmail.com
60f3ecbcf8d6a4925234485361991ce7b0621649
29159bc4c137fe9104d831a5efe346935eeb2db5
/mmj-cloud-common/src/main/java/com/mmj/common/model/ChannelUserVO.java
87c75d078c598e05a34662e6038073e5219154c0
[]
no_license
xddpool/mmj-cloud
bfb06d2ef08c9e7b967c63f223fc50b1a56aac1c
de4bcb35db509ce929d516d83de765fdc2afdac5
refs/heads/master
2023-06-27T11:16:38.059125
2020-07-24T03:23:48
2020-07-24T03:23:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,276
java
package com.mmj.common.model; /** * 渠道用户数据统计 * @author shenfuding * */ public class ChannelUserVO implements Comparable<ChannelUserVO>{ private Long userId; private String openId; private String unionId; private String createTime; private String channel; private String authorized; public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public String getOpenId() { return openId; } public void setOpenId(String openId) { this.openId = openId; } public String getUnionId() { return unionId; } public void setUnionId(String unionId) { this.unionId = unionId; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } public String getChannel() { return channel; } public void setChannel(String channel) { this.channel = channel; } public String getAuthorized() { return authorized; } public void setAuthorized(String authorized) { this.authorized = authorized; } @Override public int compareTo(ChannelUserVO o) { return this.createTime.compareTo(o.getCreateTime()); } }
[ "shenfuding@shenfudingdeMacBook-Pro.local" ]
shenfuding@shenfudingdeMacBook-Pro.local
52cf70472f08814ef3732bf766a56f0f752cc1df
83029b4bd297d6b5091bbe0f4e4e0608f6f3d51a
/module_base/src/main/java/com/feisukj/base/util/GsonUtils.java
12f2dc6dcff2b2ab34ef82e6dec8d3bd230171dd
[]
no_license
sengeiou/ModuleProject
250a574fbe196befd7f004f784e6050b3160a34e
b92270a9f954e53354e9adf652ba699481c6ff2b
refs/heads/master
2020-05-03T07:28:32.602640
2019-03-29T06:49:36
2019-03-29T06:49:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,176
java
package com.feisukj.base.util; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class GsonUtils { private static Gson gson = new Gson(); /** * 解析jsonObject * @param jsonString * @param classes * @param <T> * @return */ public static <T> T parseObject(String jsonString, Class<T> classes){ if(jsonString == null) return null; T t = null; try { t = gson.fromJson(jsonString,classes); } catch (JsonSyntaxException e) { e.printStackTrace(); } return t; } /** * 解析jsonArray * @param jsonString * @param classes * @param <T> * @return */ public static <T> List<T> parseArray(String jsonString, Class<T[]> classes){ T[] list = gson.fromJson(jsonString,classes); return Arrays.asList(list); } /** * 把实体转换成json数据 * @param o * @return */ public static String parseToJsonString(Object o){ return gson.toJson(o); } /** * 转成list * 解决泛型问题 * @param json * @param cls * @param <T> * @return */ public static <T> List<T> jsonToList(String json, Class<T> cls) { Gson gson = new Gson(); List<T> list = new ArrayList<T>(); JsonArray array = null; try { array = new JsonParser().parse(json).getAsJsonArray(); } catch (Exception e) { e.printStackTrace(); return list; } for(final JsonElement elem : array){ list.add(gson.fromJson(elem, cls)); } return list; } /** * 转成json * * @param object * @return */ public static String GsonString(Object object) { String gsonString = null; if (gson != null) { gsonString = gson.toJson(object); } return gsonString; } }
[ "13028837130@163.com" ]
13028837130@163.com
ed2e01c8ef7b5f280ae09018922eeb5216538e9b
9d5dc97418cb55d779210c0f68f9e421ca33e969
/src/com/prontuario/dominio/gerenciador/GerenciadorConsulta.java
718cc17fbfaa45828b489befaf641f4175d0af96
[]
no_license
Gnoario/Prontuario-Medico
8439dce9da15035af68f1d3e2cff6087adff981c
2a6bc9ad41ba77a688aa763eebe87ddbe803da01
refs/heads/master
2020-06-04T15:29:17.383937
2019-07-13T05:58:58
2019-07-13T05:58:58
192,082,144
0
0
null
null
null
null
UTF-8
Java
false
false
2,828
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.prontuario.dominio.gerenciador; import com.prontuario.dominio.entity.Consulta; import com.prontuario.dominio.entity.Paciente; /** * * @author tadeu */ public class GerenciadorConsulta { GerenciadorDiagnostico diagnostico = new GerenciadorDiagnostico(); Consulta consultas[]; int size; public GerenciadorConsulta(int max) { consultas = new Consulta[max]; size = 0; } public boolean addConsulta(Consulta consulta, Paciente pacientes[], int i) { if (!isFullConsultas()) { consultas[size] = consulta; consultas[size].setPaciente(pacientes[i - 1]); size++; return true; } return false; } public void imprimi() { for (int i = 0; i < size; i++) { System.out.println("__________________________________________________________________"); System.out.println("Paciente de número: " + i + 1); System.out.println("Nome do Paciente: " + consultas[i].getPaciente().getNome()); System.out.println("Idade: " + consultas[i].getPaciente().getIdade()); System.out.println("CPF: " + consultas[i].getPaciente().getCpf()); System.out.println("Médico responsável: " + consultas[i].getMedico().getNome()); System.out.println("Horário da Consulta: " + consultas[i].getHoraDiaConsulta()); System.out.println("__________________________________________________________________"); } } public boolean isFullConsultas() { if (size != consultas.length) { return false; } return true; } public void get(int indice) { if (indice >= 0 && indice < size) { System.out.println("_______________________________________________________________________________"); System.out.println("Você selecionou para consultar o paciente de número: " + indice + 1); System.out.println("Nome do Paciente: " + consultas[indice - 1].getPaciente().getNome()); System.out.println("Idade: " + consultas[indice - 1].getPaciente().getIdade()); System.out.println("CPF: " + consultas[indice - 1].getPaciente().getCpf()); System.out.println("Médico responsável: " + consultas[indice - 1].getMedico().getNome()); System.out.println("Horário da Consulta: " + consultas[indice - 1].getHoraDiaConsulta()); System.out.println("_______________________________________________________________________________"); } } public int getSize() { return size; } }
[ "tadeujenuario@hotmail.com" ]
tadeujenuario@hotmail.com
addc13127178980c769e6f08b4f748c2d0e9d720
eb93d443276350cb4fe68bc7a8f3c72162157133
/app/src/main/java/in/ajitesh/chatterbox/model/ChatBoxReplyMessage.java
dc1d77e448218740743310d067ac96be7a3f465b
[]
no_license
aithsis94/ChatBox
99723711e3e10c03ae03fdefeebeede6ca54a181
b2a2d8b6088ad37a5bda3b0f8d28f4ad46ff0b6e
refs/heads/master
2020-03-31T23:06:04.923892
2018-10-11T19:14:16
2018-10-11T19:14:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package in.ajitesh.chatterbox.model; /** * Created by ajitesh on 11/10/18. */ public class ChatBoxReplyMessage { private MessageInfo message; private String errorMessage; private String success; public MessageInfo getMessage () { return message; } public void setMessage (MessageInfo message) { this.message = message; } public String getErrorMessage () { return errorMessage; } public void setErrorMessage (String errorMessage) { this.errorMessage = errorMessage; } public String getSuccess () { return success; } public void setSuccess (String success) { this.success = success; } }
[ "ajitesh@novopay.in" ]
ajitesh@novopay.in
2db64f880a3f156a10bc7430b8217fa058427f8b
570796c1e7ea97e8a23413f728dbc01370e9e5c0
/developPlatform/Platform_wireerp/src/main/java/com/tengzhi/business/system/fileauth/service/FileAuthService.java
74f8b053ba4cdb97f45ffb47ea6068ddcd75a6f6
[]
no_license
DDengxin/gab
a56b462275516a1ce758927e4f19622eaaef24ad
070f461f5d1d59b150145be561e92877dd78bff9
refs/heads/master
2022-12-13T10:16:43.739906
2020-09-02T06:30:35
2020-09-02T06:30:35
291,856,121
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package com.tengzhi.business.system.fileauth.service; import java.io.IOException; import java.util.Map; import com.tengzhi.base.jpa.dto.BaseDto; import com.tengzhi.base.jpa.page.BasePage; import com.tengzhi.base.jpa.result.Result; public interface FileAuthService{ Result findAll(BaseDto dto); BasePage<Map<String, Object>> findUserRightAll(BaseDto baseDto)throws IOException; void FileAuthSave(Map<String,Object> map); void delete(String arNote); }
[ "1012838949.com" ]
1012838949.com
42247a6693a6ad50c9dc4c3dd7d18477ea386860
34c04d9004a90e6a08ccb15858d22488e5244fad
/src/main/java/com/example/springredditclone/utils/NotificationEmail.java
2d5038f07fe372ce818e6aa418628d12275c894c
[]
no_license
mohamed-elhamra/spring-reddit-clone
6aa28fa6dc95559880e2082a440fdb19849e9177
023252f42165056573abcfb36da62b027a326ddc
refs/heads/master
2023-01-22T09:48:41.849814
2020-12-05T15:03:21
2020-12-05T15:03:21
315,094,184
2
0
null
null
null
null
UTF-8
Java
false
false
300
java
package com.example.springredditclone.utils; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class NotificationEmail { private String subject; private String recipient; private String body; }
[ "melhamra98@gmail.com" ]
melhamra98@gmail.com
80c37983d9331b1491c81a4ce9ff9ccc916556b7
45966aa9c9090c2c2a594822c603e0137d0151f9
/Backend_Final/Grocery-App/src/main/java/com/groceryApp/entities/Grocery.java
bc372fa354b39d77083b2edd4eeb0df228bd6a02
[]
no_license
mchaudhari2798/GroceryFinal
aec4bc4f53b4c2b9b46805753758b448d431d2bd
45be97e103d323fb020162eb5fc783fc3bdeaf21
refs/heads/master
2023-04-22T05:55:07.088858
2021-05-22T16:08:54
2021-05-22T16:08:54
369,741,972
0
0
null
null
null
null
UTF-8
Java
false
false
2,210
java
package com.groceryApp.entities; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Table; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @Entity @Table(name="tbl_gro") public class Grocery { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; private String name; private String description; @Column(name="unit_price") private BigDecimal unitprice; @Column(name="image_url") private String imgeurl; private boolean active; @Column(name="units_in_stock") private int unitsInStock; @Column(name="date_created") private Date createdOn; @ManyToOne @JoinColumn(name="category_id",nullable=false) private GroceryCategory category; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public BigDecimal getUnitprice() { return unitprice; } public void setUnitprice(BigDecimal unitprice) { this.unitprice = unitprice; } public String getImgeurl() { return imgeurl; } public void setImgeurl(String imgeurl) { this.imgeurl = imgeurl; } public boolean isActive() { return active; } public void setActive(boolean active) { this.active = active; } public int getUnitsInStock() { return unitsInStock; } public void setUnitsInStock(int unitsInStock) { this.unitsInStock = unitsInStock; } public Date getCreatedOn() { return createdOn; } public void setCreatedOn(Date createdOn) { this.createdOn = createdOn; } @Override public String toString() { return "Grocery [id=" + id + ", name=" + name + ", description=" + description + ", unitprice=" + unitprice + ", imgeurl=" + imgeurl + ", active=" + active + ", unitsInStock=" + unitsInStock + ", createdOn=" + createdOn + "]"; } }
[ "mohitchaudhari.mc@gmail.com" ]
mohitchaudhari.mc@gmail.com
88e7b9b2781941649136dd413c5fbdb17f1e3e33
32a8329bf23e609295889667c62118ccc2f536f0
/Game/desktop/src/br/edu/ufabc/alunos/desktop/DesktopLauncher.java
d7897f510675b5317bbd7d58703de03fb4a61ecf
[]
no_license
AnBarbosa/JogosDigitais
5874c2deb1a9c126e8757aa84b985a42e4cbb734
7eef1145413d6a5b0ebb0f2076bfdf1461a7dc2d
refs/heads/master
2020-04-22T12:59:03.441609
2019-05-04T00:44:04
2019-05-04T00:44:04
170,392,998
0
0
null
2019-05-03T22:28:24
2019-02-12T21:19:07
Java
UTF-8
Java
false
false
542
java
package br.edu.ufabc.alunos.desktop; import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import br.edu.ufabc.alunos.core.GameApplication; public class DesktopLauncher { public static void main (String[] arg) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.title = "Unnamed Game"; config.width = 800; config.height = 600; config.vSyncEnabled = true; new LwjglApplication(new GameApplication(), config); } }
[ "an.barbosa@outlook.com.br" ]
an.barbosa@outlook.com.br
bb1c63492e72399c6b32a1b4c169f5290979614f
a23c714cee27434346695163b7022e257f3c0468
/wrappers/java/library/src/com/worldpay/innovation/wpwithin/WPWithinWrapperImpl.java
4baeb794ee7acb95e2a4f65a014356fcd72babce
[ "MIT" ]
permissive
Stemnetuk/worldpay-within-sdk
c3a2c67121c3061e24e68ad3e9cde357750b022c
3e94763d6793445f018169551f33d4225d1052e1
refs/heads/master
2020-05-21T08:50:14.689913
2016-09-24T11:44:37
2016-09-24T11:44:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,795
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.worldpay.innovation.wpwithin; import com.worldpay.innovation.wpwithin.eventlistener.EventListener; import com.worldpay.innovation.wpwithin.eventlistener.EventServer; import com.worldpay.innovation.wpwithin.rpc.WPWithin; import com.worldpay.innovation.wpwithin.rpc.launcher.*; import com.worldpay.innovation.wpwithin.rpc.types.ServiceDeliveryToken; import com.worldpay.innovation.wpwithin.thriftadapter.*; import com.worldpay.innovation.wpwithin.types.*; import org.apache.thrift.TException; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TSocket; import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author worldpay */ public class WPWithinWrapperImpl implements WPWithinWrapper { private static final Logger log = Logger.getLogger(WPWithinWrapperImpl.class.getName()); private String hostConfig; private Integer portConfig; private WPWithin.Client cachedClient; private EventServer eventServer; private Launcher launcher; public WPWithinWrapperImpl(String host, Integer port, boolean startRPCAgent) { this(host, port, startRPCAgent, null, 0); } public WPWithinWrapperImpl(String rpcHost, Integer rpcPort, boolean startRPCAgent, EventListener eventListener, int rpcCallbackPort){ this.hostConfig = rpcHost; this.portConfig = rpcPort; if(eventListener != null) { if(rpcCallbackPort <= 0 || rpcCallbackPort > 65535) { throw new WPWithinGeneralException("Callback port must be >0 and <65535"); } eventServer = new EventServer(); eventServer.start(eventListener, rpcCallbackPort); System.out.printf("Did setup and start event server on port: %d\n", rpcCallbackPort); } else { rpcCallbackPort = 0; } if(startRPCAgent) { startRPCAgent(rpcPort, rpcCallbackPort); } setClientIfNotSet(); } private void setClientIfNotSet() { if(this.cachedClient == null) { this.cachedClient = openRpcListener(); } } private WPWithin.Client getClient() { setClientIfNotSet(); return this.cachedClient; } private WPWithin.Client openRpcListener() { TTransport transport = new TSocket(hostConfig, portConfig); try { transport.open(); } catch (TTransportException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Could not open transport socket", ex); } TProtocol protocol = new TBinaryProtocol(transport); WPWithin.Client client = new WPWithin.Client(protocol); return client; } @Override public void setup(String name, String description) throws WPWithinGeneralException { try { getClient().setup(name, description); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Failure to setup in the wrapper", ex); throw new WPWithinGeneralException("Failure to setup in the wrapper"); } } @Override public void addService(WWService theService) throws WPWithinGeneralException { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.INFO, "About to add service"); try { getClient().addService(ServiceAdapter.convertWWService(theService)); } catch(TException ex) { throw new WPWithinGeneralException("Add service to producer failed with Rpc call to the SDK lower level"); } Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.INFO, "Should have successfully added service"); } @Override public void removeService(WWService svc) throws WPWithinGeneralException { try { getClient().removeService(ServiceAdapter.convertWWService(svc)); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Removal of service failed in the wrapper", ex); throw new WPWithinGeneralException("Removal of service failed in the wrapper"); } } @Override public void initConsumer(String scheme, String hostname, Integer port, String urlPrefix, String serverId, WWHCECard hceCard) throws WPWithinGeneralException { try { getClient().initConsumer(scheme, hostname, port, urlPrefix, serverId, HCECardAdapter.convertWWHCECard(hceCard)); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Initiating the consumer failed in the wrapper", ex); throw new WPWithinGeneralException("Initiating the consumer failed in the wrapper"); } } @Override public void initProducer(String merchantClientKey, String merchantServiceKey) throws WPWithinGeneralException { try { getClient().initProducer(merchantClientKey, merchantServiceKey); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Initiating the producer failed in the wrapper", ex); throw new WPWithinGeneralException("Initiating the producer failed in the wrapper"); } } @Override public WWDevice getDevice() throws WPWithinGeneralException { try { return DeviceAdapter.convertDevice(getClient().getDevice()); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Get device in wrapper failed", ex); throw new WPWithinGeneralException("Get device in wrapper failed"); } } @Override public void startServiceBroadcast(Integer timeoutMillis) throws WPWithinGeneralException { try { getClient().startServiceBroadcast(timeoutMillis); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Start service broadcast in wrapper failed", ex); throw new WPWithinGeneralException("Start service broadcast in wrapper failed"); } } @Override public void stopServiceBroadcast() throws WPWithinGeneralException { try { getClient().stopServiceBroadcast(); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Stop service broadcast failed", ex); throw new WPWithinGeneralException("Stop service broadcast failed"); } } @Override public Set<WWServiceMessage> deviceDiscovery(Integer timeoutMillis) throws WPWithinGeneralException { try { return ServiceMessageAdapter.convertServiceMessages(getClient().deviceDiscovery(timeoutMillis)); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Failed device discovery in wrapper", ex); throw new WPWithinGeneralException("Failed device discovery in wrapper"); } } @Override public Set<WWServiceDetails> requestServices() throws WPWithinGeneralException { try { return ServiceDetailsAdapter.convertServiceDetails(getClient().requestServices()); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Request Services failed in wrapper", ex); throw new WPWithinGeneralException("Request Services failed in wrapper"); } } @Override public Set<WWPrice> getServicePrices(Integer serviceId) throws WPWithinGeneralException { try { return PriceAdapter.convertServicePrices(getClient().getServicePrices(serviceId)); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Get Service Prices failed in wrapper", ex); throw new WPWithinGeneralException("Get Service Prices failed in wrapper"); } } @Override public WWTotalPriceResponse selectService(Integer serviceId, Integer numberOfUnits, Integer priceId) throws WPWithinGeneralException { try { return TotalPriceResponseAdapter.convertTotalPriceResponse(getClient().selectService(serviceId, numberOfUnits, priceId)); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Select service failed in wrapper", ex); throw new WPWithinGeneralException("Select service failed in wrapper"); } } @Override public WWPaymentResponse makePayment(WWTotalPriceResponse request) throws WPWithinGeneralException { try { return PaymentResponseAdapter.convertPaymentResponse(getClient().makePayment(TotalPriceResponseAdapter.convertWWTotalPriceResponse(request))); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Failed to make payment in the wrapper", ex); throw new WPWithinGeneralException("Failed to make payment in the wrapper"); } } @Override public WWServiceDeliveryToken beginServiceDelivery(int serviceId, WWServiceDeliveryToken serviceDeliveryToken, Integer unitsToSupply) throws WPWithinGeneralException { try { ServiceDeliveryToken sdt = getClient().beginServiceDelivery(serviceId, ServiceDeliveryTokenAdapter.convertWWServiceDeliveryToken(serviceDeliveryToken), unitsToSupply); return ServiceDeliveryTokenAdapter.convertServiceDeliveryToken(sdt); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Failed to begin Service Delivery in the wrapper", ex); throw new WPWithinGeneralException("Failed to begin Service Delivery in the wrapper"); } } @Override public WWServiceDeliveryToken endServiceDelivery(int serviceId, WWServiceDeliveryToken serviceDeliveryToken, Integer unitsReceived) throws WPWithinGeneralException { try { ServiceDeliveryToken sdt = getClient().endServiceDelivery(serviceId, ServiceDeliveryTokenAdapter.convertWWServiceDeliveryToken(serviceDeliveryToken), unitsReceived); return ServiceDeliveryTokenAdapter.convertServiceDeliveryToken(sdt); } catch (TException ex) { Logger.getLogger(WPWithinWrapperImpl.class.getName()).log(Level.SEVERE, "Failed to end Service Delivery in the wrapper", ex); throw new WPWithinGeneralException("Failed to end Service Delivery in the wrapper"); } } @Override public void stopRPCAgent() { try { if(launcher != null) { launcher.stopProcess(); } } catch (Exception e) { throw new RuntimeException(e); } } private void startRPCAgent(int port, int callbackPort) { String flagLogfile = "wpwithin.log"; String flagLogLevels = "debug,error,info,warn,fatal"; String flagCallbackPort = callbackPort > 0 ? "-callbackport="+callbackPort : ""; String binBase = System.getenv("WPWBIN") == null ? "./rpc-agent-bin" : System.getenv("WPWBIN"); launcher = new Launcher(); Map<OS, PlatformConfig> launchConfig = new HashMap<>(3); PlatformConfig winConfig = new PlatformConfig(); winConfig.setCommand(Architecture.IA32, String.format("%s/rpc-agent-win-32 -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); winConfig.setCommand(Architecture.X86_64, String.format("%s/rpc-agent-win-64 -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); winConfig.setCommand(Architecture.ARM, String.format("%s/rpc-agent-win-arm -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); launchConfig.put(OS.WINDOWS, winConfig); PlatformConfig linuxConfig = new PlatformConfig(); linuxConfig.setCommand(Architecture.IA32, String.format("%s/rpc-agent-linux-32 -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); linuxConfig.setCommand(Architecture.X86_64, String.format("%s/rpc-agent-linux-64 -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); linuxConfig.setCommand(Architecture.ARM, String.format("%s/rpc-agent-linux-arm -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); launchConfig.put(OS.LINUX, linuxConfig); PlatformConfig macConfig = new PlatformConfig(); macConfig.setCommand(Architecture.IA32, String.format("%s/rpc-agent/rpc-agent-mac-32 -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); macConfig.setCommand(Architecture.X86_64, String.format("%s/rpc-agent-mac-64 -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); macConfig.setCommand(Architecture.ARM, String.format("%s/rpc-agent-mac-arm -port=%d -logfile=%s -loglevel=%s %s", binBase, port, flagLogfile, flagLogLevels, flagCallbackPort)); launchConfig.put(OS.MAC, macConfig); Listener listener = new Listener() { @Override public void onApplicationExit(int exitCode, String stdOutput, String errOutput) { System.out.printf("RPC Agent did exit with code: %d\n", exitCode); try { String output = launcher.getStdOutput(); String error = launcher.getErrorOutput(); System.out.println("Output: " + output); System.out.println("Error: " + error); } catch (Exception e) { e.printStackTrace(); } } }; try { launcher.startProcess(launchConfig, listener); } catch (WPWithinGeneralException ioe) { ioe.printStackTrace(); } } }
[ "noreply@github.com" ]
Stemnetuk.noreply@github.com
9095080606204bb087549992ad58ead8438dfdb3
1e7afd41cd988a12ecd2fdb89eb9f2b3584a45d0
/wechat-dev/src/main/java/com/d1m/wechat/model/ReportUserSource.java
55841bd009dea2c777d78e8405e13b249e1ed70b
[]
no_license
GSIL-Monitor/All-Java
44383486991f02f33deb2ac27ff39a9871d360e7
072b7cfb119b5502670c71cddbcf581ae49b5bff
refs/heads/master
2020-04-19T08:24:15.147095
2018-04-04T11:18:47
2018-04-04T11:18:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,399
java
package com.d1m.wechat.model; import java.util.Date; import javax.persistence.*; @Table(name = "report_user_source") public class ReportUserSource { /** * 主键ID */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; /** * 日期 */ private String date; /** * 其他合计-新增的用户数量 */ @Column(name = "new_user_0") private Integer newUser0; /** * 其他合计-取消关注的用户数量 */ @Column(name = "cancel_user_0") private Integer cancelUser0; /** * 公众号搜索-新增的用户数量 */ @Column(name = "new_user_1") private Integer newUser1; /** * 公众号搜索-取消关注的用户数量 */ @Column(name = "cancel_user_1") private Integer cancelUser1; /** * 名片分享-新增的用户数量 */ @Column(name = "new_user_17") private Integer newUser17; /** * 名片分享-取消关注的用户数量 */ @Column(name = "cancel_user_17") private Integer cancelUser17; /** * 扫描二维码-新增的用户数量 */ @Column(name = "new_user_30") private Integer newUser30; /** * 扫描二维码-取消关注的用户数量 */ @Column(name = "cancel_user_30") private Integer cancelUser30; /** * 图文页右上角菜单-新增的用户数量 */ @Column(name = "new_user_43") private Integer newUser43; /** * 图文页右上角菜单-取消关注的用户数量 */ @Column(name = "cancel_user_43") private Integer cancelUser43; /** * 支付后关注(在支付完成页)-新增的用户数量 */ @Column(name = "new_user_51") private Integer newUser51; /** * 支付后关注(在支付完成页)-取消关注的用户数量 */ @Column(name = "cancel_user_51") private Integer cancelUser51; /** * 图文页内公众号名称-新增的用户数量 */ @Column(name = "new_user_57") private Integer newUser57; /** * 图文页内公众号名称-取消关注的用户数量 */ @Column(name = "cancel_user_57") private Integer cancelUser57; /** * 公众号文章广告-新增的用户数量 */ @Column(name = "new_user_75") private Integer newUser75; /** * 公众号文章广告-取消关注的用户数量 */ @Column(name = "cancel_user_75") private Integer cancelUser75; /** * 朋友圈广告-新增的用户数量 */ @Column(name = "new_user_78") private Integer newUser78; /** * 朋友圈广告-取消关注的用户数量 */ @Column(name = "cancel_user_78") private Integer cancelUser78; /** * 总用户数量 */ @Column(name = "cumulate_user") private Integer cumulateUser; /** * 所属公众号ID */ @Column(name = "wechat_id") private Integer wechatId; /** * 创建时间 */ @Column(name = "created_at") private Date createdAt; /** * 获取主键ID * * @return id - 主键ID */ public Integer getId() { return id; } /** * 设置主键ID * * @param id 主键ID */ public void setId(Integer id) { this.id = id; } /** * 获取日期 * * @return date - 日期 */ public String getDate() { return date; } /** * 设置日期 * * @param date 日期 */ public void setDate(String date) { this.date = date == null ? null : date.trim(); } /** * 获取其他合计-新增的用户数量 * * @return new_user_0 - 其他合计-新增的用户数量 */ public Integer getNewUser0() { return newUser0; } /** * 设置其他合计-新增的用户数量 * * @param newUser0 其他合计-新增的用户数量 */ public void setNewUser0(Integer newUser0) { this.newUser0 = newUser0; } /** * 获取其他合计-取消关注的用户数量 * * @return cancel_user_0 - 其他合计-取消关注的用户数量 */ public Integer getCancelUser0() { return cancelUser0; } /** * 设置其他合计-取消关注的用户数量 * * @param cancelUser0 其他合计-取消关注的用户数量 */ public void setCancelUser0(Integer cancelUser0) { this.cancelUser0 = cancelUser0; } /** * 获取公众号搜索-新增的用户数量 * * @return new_user_1 - 公众号搜索-新增的用户数量 */ public Integer getNewUser1() { return newUser1; } /** * 设置公众号搜索-新增的用户数量 * * @param newUser1 公众号搜索-新增的用户数量 */ public void setNewUser1(Integer newUser1) { this.newUser1 = newUser1; } /** * 获取公众号搜索-取消关注的用户数量 * * @return cancel_user_1 - 公众号搜索-取消关注的用户数量 */ public Integer getCancelUser1() { return cancelUser1; } /** * 设置公众号搜索-取消关注的用户数量 * * @param cancelUser1 公众号搜索-取消关注的用户数量 */ public void setCancelUser1(Integer cancelUser1) { this.cancelUser1 = cancelUser1; } /** * 获取名片分享-新增的用户数量 * * @return new_user_17 - 名片分享-新增的用户数量 */ public Integer getNewUser17() { return newUser17; } /** * 设置名片分享-新增的用户数量 * * @param newUser17 名片分享-新增的用户数量 */ public void setNewUser17(Integer newUser17) { this.newUser17 = newUser17; } /** * 获取名片分享-取消关注的用户数量 * * @return cancel_user_17 - 名片分享-取消关注的用户数量 */ public Integer getCancelUser17() { return cancelUser17; } /** * 设置名片分享-取消关注的用户数量 * * @param cancelUser17 名片分享-取消关注的用户数量 */ public void setCancelUser17(Integer cancelUser17) { this.cancelUser17 = cancelUser17; } /** * 获取扫描二维码-新增的用户数量 * * @return new_user_30 - 扫描二维码-新增的用户数量 */ public Integer getNewUser30() { return newUser30; } /** * 设置扫描二维码-新增的用户数量 * * @param newUser30 扫描二维码-新增的用户数量 */ public void setNewUser30(Integer newUser30) { this.newUser30 = newUser30; } /** * 获取扫描二维码-取消关注的用户数量 * * @return cancel_user_30 - 扫描二维码-取消关注的用户数量 */ public Integer getCancelUser30() { return cancelUser30; } /** * 设置扫描二维码-取消关注的用户数量 * * @param cancelUser30 扫描二维码-取消关注的用户数量 */ public void setCancelUser30(Integer cancelUser30) { this.cancelUser30 = cancelUser30; } /** * 获取图文页右上角菜单-新增的用户数量 * * @return new_user_43 - 图文页右上角菜单-新增的用户数量 */ public Integer getNewUser43() { return newUser43; } /** * 设置图文页右上角菜单-新增的用户数量 * * @param newUser43 图文页右上角菜单-新增的用户数量 */ public void setNewUser43(Integer newUser43) { this.newUser43 = newUser43; } /** * 获取图文页右上角菜单-取消关注的用户数量 * * @return cancel_user_43 - 图文页右上角菜单-取消关注的用户数量 */ public Integer getCancelUser43() { return cancelUser43; } /** * 设置图文页右上角菜单-取消关注的用户数量 * * @param cancelUser43 图文页右上角菜单-取消关注的用户数量 */ public void setCancelUser43(Integer cancelUser43) { this.cancelUser43 = cancelUser43; } /** * 获取支付后关注(在支付完成页)-新增的用户数量 * * @return new_user_51 - 支付后关注(在支付完成页)-新增的用户数量 */ public Integer getNewUser51() { return newUser51; } /** * 设置支付后关注(在支付完成页)-新增的用户数量 * * @param newUser51 支付后关注(在支付完成页)-新增的用户数量 */ public void setNewUser51(Integer newUser51) { this.newUser51 = newUser51; } /** * 获取支付后关注(在支付完成页)-取消关注的用户数量 * * @return cancel_user_51 - 支付后关注(在支付完成页)-取消关注的用户数量 */ public Integer getCancelUser51() { return cancelUser51; } /** * 设置支付后关注(在支付完成页)-取消关注的用户数量 * * @param cancelUser51 支付后关注(在支付完成页)-取消关注的用户数量 */ public void setCancelUser51(Integer cancelUser51) { this.cancelUser51 = cancelUser51; } /** * 获取图文页内公众号名称-新增的用户数量 * * @return new_user_57 - 图文页内公众号名称-新增的用户数量 */ public Integer getNewUser57() { return newUser57; } /** * 设置图文页内公众号名称-新增的用户数量 * * @param newUser57 图文页内公众号名称-新增的用户数量 */ public void setNewUser57(Integer newUser57) { this.newUser57 = newUser57; } /** * 获取图文页内公众号名称-取消关注的用户数量 * * @return cancel_user_57 - 图文页内公众号名称-取消关注的用户数量 */ public Integer getCancelUser57() { return cancelUser57; } /** * 设置图文页内公众号名称-取消关注的用户数量 * * @param cancelUser57 图文页内公众号名称-取消关注的用户数量 */ public void setCancelUser57(Integer cancelUser57) { this.cancelUser57 = cancelUser57; } /** * 获取公众号文章广告-新增的用户数量 * * @return new_user_75 - 公众号文章广告-新增的用户数量 */ public Integer getNewUser75() { return newUser75; } /** * 设置公众号文章广告-新增的用户数量 * * @param newUser75 公众号文章广告-新增的用户数量 */ public void setNewUser75(Integer newUser75) { this.newUser75 = newUser75; } /** * 获取公众号文章广告-取消关注的用户数量 * * @return cancel_user_75 - 公众号文章广告-取消关注的用户数量 */ public Integer getCancelUser75() { return cancelUser75; } /** * 设置公众号文章广告-取消关注的用户数量 * * @param cancelUser75 公众号文章广告-取消关注的用户数量 */ public void setCancelUser75(Integer cancelUser75) { this.cancelUser75 = cancelUser75; } /** * 获取朋友圈广告-新增的用户数量 * * @return new_user_78 - 朋友圈广告-新增的用户数量 */ public Integer getNewUser78() { return newUser78; } /** * 设置朋友圈广告-新增的用户数量 * * @param newUser78 朋友圈广告-新增的用户数量 */ public void setNewUser78(Integer newUser78) { this.newUser78 = newUser78; } /** * 获取朋友圈广告-取消关注的用户数量 * * @return cancel_user_78 - 朋友圈广告-取消关注的用户数量 */ public Integer getCancelUser78() { return cancelUser78; } /** * 设置朋友圈广告-取消关注的用户数量 * * @param cancelUser78 朋友圈广告-取消关注的用户数量 */ public void setCancelUser78(Integer cancelUser78) { this.cancelUser78 = cancelUser78; } /** * 获取总用户数量 * * @return cumulate_user - 总用户数量 */ public Integer getCumulateUser() { return cumulateUser; } /** * 设置总用户数量 * * @param cumulateUser 总用户数量 */ public void setCumulateUser(Integer cumulateUser) { this.cumulateUser = cumulateUser; } /** * 获取所属公众号ID * * @return wechat_id - 所属公众号ID */ public Integer getWechatId() { return wechatId; } /** * 设置所属公众号ID * * @param wechatId 所属公众号ID */ public void setWechatId(Integer wechatId) { this.wechatId = wechatId; } /** * 获取创建时间 * * @return created_at - 创建时间 */ public Date getCreatedAt() { return createdAt; } /** * 设置创建时间 * * @param createdAt 创建时间 */ public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; } }
[ "huangalin@laiyifen.com" ]
huangalin@laiyifen.com
5de082932bd31bc6b586fb443d36334b02e09430
700bdc256dba172ca879a84ff3d1e13f0815aabe
/app/src/main/java/net/imoran/auto/music/vui/IVUIManager.java
5db26d9d775a6a2420841ccd2f29ebe1c169ca5f
[]
no_license
wuxianghua/self_project_mc
1fb66558ef0f82a64a863ac1f3c6f0b2f1bed591
a3e94efb8f21b868fcbf7e9260a600488d7191be
refs/heads/master
2020-04-14T15:41:34.772240
2019-01-03T06:57:08
2019-01-03T06:57:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package net.imoran.auto.music.vui; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import net.imoran.auto.music.player.model.SongModel; import net.imoran.sdk.bean.base.BaseContentEntity; import java.util.List; public interface IVUIManager { //处理方控按键 void parseFlyContent(int keyCode); //处理NliVUI控制 void parseNliVUIContent(BaseContentEntity contentEntity); }
[ "shixinhua@imoran.net" ]
shixinhua@imoran.net
b0412220447b5002852653099834729ddaca38ef
2e6c357c599a3195d6bae64544fc8736ff7c8ee6
/src/test/java/com/hemanth/redisusage/RedisUsageApplicationTests.java
5a419dedbe86d71cb0437ca219ef6c78913ba150
[]
no_license
naga-hemanth/redis-usage
95fc752c5357051aaf7c5401ead7cbac4945eee2
8429cd3290edb7c16f945ea5097d664023115180
refs/heads/master
2022-04-18T19:38:46.070140
2020-04-19T17:06:39
2020-04-19T17:06:39
257,001,567
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package com.hemanth.redisusage; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class RedisUsageApplicationTests { @Test void contextLoads() { } }
[ "nagahemanth@bounceshare.com" ]
nagahemanth@bounceshare.com
b5fb19549b5ee3e29065e3f3278c148430dbca4c
bcd555ddf8a0742fc6726ab3d542be3fdbe64984
/src/main/java/com/jubotech/framework/netty/handler/websocket/CircleLikeTaskWebsocketHandler.java
985d5e062a1c8118591a0170f5f59b51b3f2921f
[]
no_license
weixin2026/gongzuoshouji
a63cb30fce728851c22f7965c14c289b46596aa7
de9bf7deda884acce5d2c373a5a0a2f10b0e1bd2
refs/heads/main
2023-06-06T23:23:31.279407
2021-07-12T08:28:41
2021-07-12T08:28:41
385,177,044
2
1
null
null
null
null
UTF-8
Java
false
false
1,833
java
package com.jubotech.framework.netty.handler.websocket; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import com.google.protobuf.util.JsonFormat; import com.jubotech.framework.netty.async.AsyncTaskService; import com.jubotech.framework.netty.common.Constant; import com.jubotech.framework.netty.utils.MessageUtil; import Jubo.JuLiao.IM.Wx.Proto.CircleLikeTask.CircleLikeTaskMessage; import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.EnumErrorCode; import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.EnumMsgType; import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.TransportMessage; import io.netty.channel.ChannelHandlerContext; @Service public class CircleLikeTaskWebsocketHandler{ @Autowired private AsyncTaskService asyncTaskService; private final Logger log = LoggerFactory.getLogger(getClass()); /** * 单条朋友圈点赞任务---pc端经过服务端转发给手机端 * @author wechatno:tangjinjinwx * @param ctx * @param vo */ @Async public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo, String contentJsonStr) { try { log.debug(contentJsonStr); CircleLikeTaskMessage.Builder bd = CircleLikeTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); CircleLikeTaskMessage req = bd.build(); //将消息转发送给手机客户端 asyncTaskService.msgSend2Phone(ctx, req.getWeChatId(), EnumMsgType.CircleLikeTask, vo, req); } catch (Exception e) { e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL); } } }
[ "weixin2026@163.com" ]
weixin2026@163.com
f739610efdadacbf6223b07dd1da547dbbce5dc6
33e6d4efeb165bd8d914b10275be16301e6bbbca
/passbook/src/main/java/com/ivan/passbook/vo/Pass.java
3600d8c9c8d868fb6065dc48dfde68967b6d83e9
[]
no_license
papillonn/MyCards
6c02428383665f40544ccb7bfe1996cdbedc0c24
ffc2501cce174554530b6b912f009c6121af293d
refs/heads/master
2023-03-17T07:08:43.016021
2021-03-07T14:19:18
2021-03-07T14:19:18
345,084,170
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package com.ivan.passbook.vo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; /** * <h1>用户领取的优惠券</h1> * @Author Ivan 16:05 * @Description TODO */ @Data @AllArgsConstructor @NoArgsConstructor public class Pass { /** 用户 id */ private Long userId; /** pass 在 HBase 中的 RowKey */ private String rowKey; /** PassTemplate 在 HBase 中的 RowKey */ //外键关系 private String templateId; /** 优惠券 token, 有可能是 null, 则填充 -1 */ private String token; /** 领取日期 */ private Date assignedDate; /** 消费日期, 不为空代表已经被消费了 */ private Date conDate; }
[ "jinle@bupt.edu.cn" ]
jinle@bupt.edu.cn
f711a12c4dc7c792696a7566d35311a51931606e
2ee50add1941b461329bc7b6debc9bcde45b600f
/src/main/java/ch/uzh/ifi/access/student/config/SchedulingConfig.java
8dc6708a8bd22ce7afeaed707c338633b85b2e72
[]
no_license
mp-access/Backend
38fde910f92fa59d8c372eb89eac164b67a0b7ad
cb7387b29dd3650f1da4c15069a88af5e6c59eee
refs/heads/dev
2022-05-29T01:43:32.551486
2022-03-18T01:15:51
2022-03-18T01:15:51
181,880,239
0
3
null
2022-11-21T15:56:46
2019-04-17T11:47:16
HTML
UTF-8
Java
false
false
2,014
java
package ch.uzh.ifi.access.student.config; import ch.uzh.ifi.access.coderunner.CodeRunner; import ch.uzh.ifi.access.student.evaluation.process.EvalMachineRepoService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import java.time.Instant; import java.time.temporal.ChronoUnit; @Configuration @EnableScheduling public class SchedulingConfig { private static Logger logger = LoggerFactory.getLogger(SchedulingConfig.class); private static final long FIXED_DELAY_IN_MINUTES = 5; private static final long DOCKER_WATCHDOG_DELAY_IN_MINUTES = 5; private static final long DOCKER_IMAGE_UPDATER_DELAY_IN_MINUTES = 60; private final EvalMachineRepoService machineRepository; private final CodeRunner codeRunner; public SchedulingConfig(EvalMachineRepoService machineRepository, CodeRunner codeRunner) { this.machineRepository = machineRepository; this.codeRunner = codeRunner; } @Scheduled(fixedDelay = FIXED_DELAY_IN_MINUTES * 60000) public void cleanUpRepo() { Instant threshold = Instant.now().minus(5, ChronoUnit.MINUTES); logger.info("Starting state machine cleanup. Repository size {}, removing machine older than {}", machineRepository.count(), threshold); machineRepository.removeMachinesOlderThan(threshold); logger.info("Completed cleanup. Repository size {}", machineRepository.count()); } @Scheduled(fixedDelay = DOCKER_WATCHDOG_DELAY_IN_MINUTES * 60000) public void dockerHealthCheck() { logger.info("Docker worker health check"); codeRunner.logDockerInfo(); } @Scheduled(fixedDelay = DOCKER_IMAGE_UPDATER_DELAY_IN_MINUTES * 60000) public void dockerImageUpdater() { logger.info("Docker worker health and image update check"); codeRunner.check(); } }
[ "alexhofmann@gmail.com" ]
alexhofmann@gmail.com
3d537ec2435abd00482cc4f27489730ece0fca58
4040cb2e1393fb191fc1ca5e4752ab6f269e16af
/testall/androiddemo/src/main/java/com/oddshou/androiddemo/view/List4.java
a4dd644351a0b246aa3bb0dcc8384245b626a068
[]
no_license
oddshou/allTestAS
f1dc2a5820582ae0634c1a492c41819504a4dad8
74d12be0390b1be2f9258bc5dadb9db7b63eca1d
refs/heads/master
2020-12-25T07:13:08.054915
2018-07-24T03:23:13
2018-07-24T03:23:13
63,121,162
0
0
null
null
null
null
UTF-8
Java
false
false
4,703
java
/* * Copyright (C) 2007 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.oddshou.androiddemo.view; import com.oddshou.androiddemo.Shakespeare; import android.app.ListActivity; import android.content.Context; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.LinearLayout; import android.widget.TextView; /** * A list view example where the data comes from a custom ListAdapter */ public class List4 extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Use our own list adapter setListAdapter(new SpeechListAdapter(this)); } /** * A sample ListAdapter that presents content from arrays of speeches and * text. * */ private class SpeechListAdapter extends BaseAdapter { public SpeechListAdapter(Context context) { mContext = context; } /** * The number of items in the list is determined by the number of speeches * in our array. * * @see android.widget.ListAdapter#getCount() */ public int getCount() { return Shakespeare.TITLES.length; } /** * Since the data comes from an array, just returning the index is * sufficent to get at the data. If we were using a more complex data * structure, we would return whatever object represents one row in the * list. * * @see android.widget.ListAdapter#getItem(int) */ public Object getItem(int position) { return position; } /** * Use the array index as a unique id. * * @see android.widget.ListAdapter#getItemId(int) */ public long getItemId(int position) { return position; } /** * Make a SpeechView to hold each row. * * @see android.widget.ListAdapter#getView(int, android.view.View, * android.view.ViewGroup) */ public View getView(int position, View convertView, ViewGroup parent) { SpeechView sv; if (convertView == null) { sv = new SpeechView(mContext, Shakespeare.TITLES[position], Shakespeare.DIALOGUE[position]); } else { sv = (SpeechView) convertView; sv.setTitle(Shakespeare.TITLES[position]); sv.setDialogue(Shakespeare.DIALOGUE[position]); } return sv; } /** * Remember our context so we can use it when constructing views. */ private Context mContext; } /** * We will use a SpeechView to display each speech. It's just a LinearLayout * with two text fields. * */ private class SpeechView extends LinearLayout { public SpeechView(Context context, String title, String words) { super(context); this.setOrientation(VERTICAL); // Here we build the child views in code. They could also have // been specified in an XML file. mTitle = new TextView(context); mTitle.setText(title); addView(mTitle, new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); mDialogue = new TextView(context); mDialogue.setText(words); addView(mDialogue, new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); } /** * Convenience method to set the title of a SpeechView */ public void setTitle(String title) { mTitle.setText(title); } /** * Convenience method to set the dialogue of a SpeechView */ public void setDialogue(String words) { mDialogue.setText(words); } private TextView mTitle; private TextView mDialogue; } }
[ "oddshou@sina.com" ]
oddshou@sina.com
02143745f32c6b6b66d55c7d181a837ad7edb1fb
c92b48d40154bd07b5f00c388e816ff225135147
/SosoMgr/src/cn/soso/entity/TalkPackage.java
c31e8fcf3e5c722ae420d4a7dc8119fac8d38e91
[]
no_license
Liuduosheng/Java40_Homework
d27c9f2207a971e7fb136ee1a125cdb4ffc7bcd8
0a3ed2d9271e16d57c2c1776131ea02d3556ba28
refs/heads/master
2021-01-11T14:10:52.684732
2017-06-21T11:01:09
2017-06-21T11:01:09
94,993,804
0
1
null
2017-06-21T11:01:09
2017-06-21T10:45:51
Java
GB18030
Java
false
false
2,862
java
package cn.soso.entity; import cn.soso.common.Common; import cn.soso.service.CallService; import cn.soso.service.SendService; /** * 话唠套餐 * * @author 北大青鸟 * */ public class TalkPackage extends ServicePackage implements CallService, SendService { private int talkTime; // 通话时长(分钟) private int smsCount; // 短信条数(条) public int getTalkTime() { return talkTime; } public void setTalkTime(int talkTime) { this.talkTime = talkTime; } public int getSmsCount() { return smsCount; } public void setSmsCount(int smsCount) { this.smsCount = smsCount; } public TalkPackage() { //套餐数据初始化 this.talkTime = 500; this.smsCount = 30; this.price = 58.0; } public TalkPackage(int talkTime, int smsCount) { super(); this.talkTime = talkTime; this.smsCount = smsCount; } /** * 显示套餐详情 */ public void showInfo() { System.out.println("话唠套餐:通话时长为" + this.talkTime + "分钟/月,短信条数为" + this.smsCount + "条/月,资费为" + this.price + "元/月。"); } public int call(int minCount, MobileCard card) throws Exception{ int temp = minCount; for(int i=0;i<minCount;i++){ if(this.talkTime-card.getRealTalkTime()>=1){ //第一种情况:套餐剩余通话时长可以付1分钟通话 card.setRealTalkTime(card.getRealTalkTime()+1); //实际使用流量加1MB }else if(card.getMoney()>=0.2){ //第二种情况:套餐通话时长已用完,账户余额可以支付1分钟通话,使用账户余额支付 card.setRealTalkTime(card.getRealTalkTime()+1); //实际使用通话时长1分钟 card.setMoney(Common.sub(card.getMoney(),0.2)); //账户余额消费0.2元(1M流量费用) card.setConsumAmount(card.getConsumAmount() + 0.2); }else{ temp = i; //记录实现通话分钟数 throw new Exception("本次已通话"+i+"分钟,您的余额不足,请充值后再使用!"); } } return temp; } public int sendMessage(int smsCount, MobileCard card) throws Exception { int temp = smsCount; for(int i=0;i<smsCount;i++){ if(this.smsCount-card.getRealSMSCount()>=1){ //第一种情况:套餐剩余短信条数可以付1条短信 card.setRealSMSCount(card.getRealSMSCount()+1); //实际使用短信条数加1 }else if(card.getMoney()>=0.1){ //第二种情况:套餐短信条数已用完,账户余额可以支付1条短信,使用账户余额支付 card.setRealSMSCount(card.getRealSMSCount()+1); card.setMoney(Common.sub(card.getMoney(),0.1)); //账户余额消费0.1元(1条短信费用) card.setConsumAmount(card.getConsumAmount() + 0.1); }else{ temp = i; throw new Exception("本次已发送短信"+i+"条,您的余额不足,请充值后再使用!"); } } return temp; } }
[ "290982492@qq.com" ]
290982492@qq.com
64af9d175b70c1ea6a1e52969413c7778058c3a3
8fc78debfc1a01f079df51f996e65786e031ca69
/internalassessment/InternalAssessment.java
c6283cc925ab7221f7bfe543edc3598553d34c4d
[]
no_license
JSharma2K/MultiUtilityProject
a44d1dcf1a460a7ded244b291dcb4307dbf9a6c2
0ff586fd7f72652ecaec95a4be5820ce8f5b4077
refs/heads/master
2020-04-04T16:04:25.466744
2018-11-04T08:52:02
2018-11-04T08:52:02
156,063,775
0
0
null
null
null
null
UTF-8
Java
false
false
470
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 internalassessment; /** * * @author jivitesh's PC */ public class InternalAssessment { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } }
[ "noreply@github.com" ]
JSharma2K.noreply@github.com
a437467b0db95a731e04cc088e554289abf45a26
1707861967088b4d11d7cb33d17ef23c7acd2000
/src/main/java/com/example/demo/controller/SaludoController.java
269edf1ca3ebfc840f00bb397b8e5828eabefcef
[]
no_license
erikaitm546/demo
f95dfe60dbbce757d775e7459085c679050295cc
d1bcb571a30b1a26ba4dd4cb3bf36253685fd313
refs/heads/master
2022-09-27T00:16:19.875121
2020-05-27T23:18:53
2020-05-27T23:18:53
265,698,115
0
0
null
null
null
null
UTF-8
Java
false
false
833
java
package com.example.demo.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.example.demo.model.Saludo; @RestController public class SaludoController { @GetMapping(value = "/saludos", produces="application/json") public Saludo funcionSaludo() { Saludo saludo = new Saludo(); saludo.setNombre("Erika"); saludo.setDescripcion("Hola!! "); return saludo; } @PostMapping(value = "/saludos2", produces="application/json") public Saludo funcionParametrosSaludos(@RequestBody Saludo saludo) { saludo.setNombre("Erika"); return saludo; } }
[ "erika.benitez@sophos.col.com" ]
erika.benitez@sophos.col.com
d7a1bf30d15ac0d4de87b9abda7a0c82bc5836a3
c0da3e0ccf03569d84e239734559311d6a0df840
/Square-Crush/src/samegame/SimpleSameGame.java
9963d91df1e20b0ed0af5c655fef4685be9b4d1c
[ "MIT" ]
permissive
ar-pavel/Mini-Games
cadf65eeb5c9edf4d49803a191c77a4bf60a5d2d
55f9b1a762b5b5e7ef043d68714894d801e15448
refs/heads/main
2023-05-24T15:33:50.618611
2021-06-16T16:24:05
2021-06-16T16:24:05
377,549,218
1
0
null
null
null
null
UTF-8
Java
false
false
4,518
java
package samegame; import java.awt.Color; import java.util.ArrayList; import java.util.Random; import graphics.ColorDef; public class SimpleSameGame { // the board variable needs to be public so that // it can be accessed by the JUnit test. Please // do not modify its visibility. public ArrayList<Tile> board; /** * Constructor: create a board of with 'size' tiles * containing Tiles of different colours using the * random number generator. * * Please DO NOT MODIFY this method * * You can use this constructor as the basis * for the SameGame constructor. * * @param rgen - the random number generator (non null) * @param size - the number of tiles on the board */ public SimpleSameGame(Random rgen, int size) { // create an ArrayList of four different Color objects // which will be used to populate the board ArrayList<Color> colors = new ArrayList<Color>(); colors.add(Color.decode(ColorDef.BLUE)); colors.add(Color.decode(ColorDef.PURPLE)); colors.add(Color.decode(ColorDef.YELLOW)); colors.add(Color.decode(ColorDef.GREEN)); // initialise the ArrayList representing the board board = new ArrayList<Tile>(); for(int i = 0; i < size; i++) { // get a random number from 0 to colors.size()-1 int current = rgen.nextInt(colors.size()); // create a tile with a random colour from the colors array // (based on the random number we just generated) board.add(new Tile(colors.get(current),1)); } } /** * 4 marks (Pass level) * * Return an instance copy of the board. Do not * return a reference copy since the calling method * may modify the returned ArrayList. * * @return an instance copy of the board */ public ArrayList<Tile> getBoard() { // to be completed ArrayList<Tile> returnBoard = new ArrayList(board); return returnBoard; } /** * 5 marks (Pass level) * * Check if index i is a valid index, that is, if there * is a tile on that location. Return false if the index * is invalid or if a null value is encountered in that * index * * @param i - the index to check * @return true if index i is a valid location that contains a Tile, * false otherwise */ public boolean isValidIndex(int i) { // to be completed return (i>=0 && i<board.size()); } /** * 5 marks (Pass level) * * Checks if it is legal to remove a tile on index i from * the board. Recall that a tile can be removed only if * there is an adjacent tile with the same colour (please * see the assignment specification for more information). * Return false if the location given is invalid. * * @param i - the index to be checked * @return true if it is legal to remove the tile at index i, * false otherwise */ public boolean isValidMove(int i) { // to be completed if(!isValidIndex(i)) return false; try{ if((isValidIndex(i-1) && board.get(i).getColor().equals(board.get(i-1).getColor())) || (isValidIndex(i+1) && board.get(i+1).getColor().equals(board.get(i).getColor()))) { return true; } }catch (Exception e){ return false; } return false; } /** * 5 marks (Pass level) * * Checks if the player has run out of moves, that is, if it * is not possible to remove any more tiles from the board. * Return true if there are no more tiles on the board. * * @return true if there are no more valid moves, false otherwise */ public boolean noMoreValidMoves() { // to be completed for(int i=1; i<board.size(); ++i) if(board.get(i).getColor().equals(board.get(i-1).getColor())) //if(isValidMove(i)) return false; return true; } /** 10 marks (Pass level) * * Remove the tile at index i and all adjacent tiles * of the same colour (as discussed in the assignment * specification). * * Do nothing if the index i is invalid or if it is * illegal to remove the tile. * @param i */ public void removeTile(int i) { // to be completed // System.out.println("removeTile called."); if(isValidIndex(i) && isValidMove(i)){ int l=i, r=i; while(isValidIndex(l-1) && board.get(l-1).getColor().equals(board.get(i).getColor())) --l; while(isValidIndex(r+1) && board.get(r+1).getColor().equals(board.get(i).getColor())) ++r; // System.out.println("l = " + l + ", r = " + r); ArrayList<Tile> temp = new ArrayList<>(); for (int j = 0; j < l; j++) { temp.add(board.get(j)); } for (int j = r+1; j < board.size(); j++) { temp.add(board.get(j)); } board=temp; } } }
[ "noreply@github.com" ]
ar-pavel.noreply@github.com
5cf5be8974c746bfd9bb901410a70c755c9df59d
9e6bf5b911e6cf97558d856cb5e2ad1434947f40
/app/src/main/java/com/dpenaskovic/todo/ToDoItem.java
9b6f4321ca4a9742554ac3c0a45ba9bcddaa5446
[ "Apache-2.0" ]
permissive
davepen/ToDo
2a685361fae90d3dca3d36860638a24fa6f6d092
94a30e7e3e188ff5591db89f04c81170509e6c3f
refs/heads/master
2021-01-25T05:51:06.311602
2017-02-15T07:55:13
2017-02-15T07:55:13
80,696,306
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
package com.dpenaskovic.todo; import com.raizlabs.android.dbflow.annotation.Column; import com.raizlabs.android.dbflow.annotation.PrimaryKey; import com.raizlabs.android.dbflow.annotation.Table; import com.raizlabs.android.dbflow.structure.BaseModel; @Table(database = ToDoDatabase.class) public class ToDoItem extends BaseModel { @Column @PrimaryKey int id; @Column String name; public void setId(int id) { this.id = id; } public void setName(String name) { this.name = name; } }
[ "davepen@rocketmail.com" ]
davepen@rocketmail.com
49383efe50a3f0ecba4397c9ad15161d1c7a98a2
20c12251dd577124a8fe7ad666538ce99ed22a67
/src/main/java/com/augustinas/leasing/car/Launcher.java
5f6396cdd8a885dfd524062decfd2330d6037540
[]
no_license
augustinasrce/car-leasing
335664a79ea89bfb5b7031e2c306d7466927ce11
25ca0df3c99f3d1127e95c63587e5e4d72014dbf
refs/heads/master
2022-12-12T21:08:43.827829
2020-09-02T21:06:47
2020-09-02T21:06:47
291,793,427
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package com.augustinas.leasing.car; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Launcher { public static void main(String[] args) { SpringApplication.run(Launcher.class, args); } }
[ "augustinas.sueris@gmail.com" ]
augustinas.sueris@gmail.com
c42f69b72b0c8e5fb06e332ec26019da2d73d686
000d3183075e29a1fb852b5f56d09b162fa782e4
/src/main/java/com/hnong/common/config/parser/MapParser.java
cbbfb91c0a71672e90a99ff69b199c72a3287440
[]
no_license
hnong/common
fed1f8329e95757da161135136d5fa9853c70de0
c0ea7f5832d2c01346ea98b431c7f5d5af5c4cfc
refs/heads/master
2020-05-01T14:29:31.982212
2013-08-02T11:32:42
2013-08-02T11:32:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package com.hnong.common.config.parser; import java.util.Map; public class MapParser extends AbstractParser { private final Map<String, String> config; public MapParser(Map<String, String> configData) { this.config = configData; } @Override protected Map<String, String> getConfigData() { return this.config; } }
[ "violin22175@126.com" ]
violin22175@126.com
e697fce0cffd3b411629f70a00501b4bac8ec71e
ea92635d5400bfc676374b2da0c89d349d2d6128
/app/src/main/java/com/dedsec/newsappassignment/viewmodel/MainActivityViewModel.java
f82561e79b94428b771481daa194b547ea44795b
[]
no_license
dedsec1911/NewsApp-Assignment
49cb41a8f15150c84a2b3b696f5c04fe6a2f8310
16ac83eb9858249090d0a3a7a2cd82f9e925c7a2
refs/heads/main
2023-06-16T20:08:51.401103
2021-07-13T07:02:47
2021-07-13T07:02:47
385,507,304
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package com.dedsec.newsappassignment.viewmodel; import android.app.Application; import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; import java.util.List; import com.dedsec.newsappassignment.model.Article; import com.dedsec.newsappassignment.network.NewsRepository; public class MainActivityViewModel extends AndroidViewModel { NewsRepository newsRepository; public MainActivityViewModel(@NonNull Application application) { super(application); newsRepository = new NewsRepository(application); } public LiveData<List<Article>> getAllArticle() { return newsRepository.getMutableLiveData(); } public LiveData<List<Article>> getOfflineArticle() { return newsRepository.getOfflineData(); } }
[ "noreply@github.com" ]
dedsec1911.noreply@github.com
a2bc2cbc1a94be960e6d5dbe88fb53257097389c
40f4908483b98fc4f370ff4f2d520e1284d045b3
/phase02/immortals_repo/das/temp/src/main/java/mil/darpa/immortals/modulerunner/configuration/AnalysisGeneratorConfiguration.java
4c1c42d77e6147e8ec7eb11a2d3b1b01ffe51bf3
[]
no_license
TF-185/bbn-immortals
7f70610bdbbcbf649f3d9021f087baaa76f0d8ca
e298540f7b5f201779213850291337a8bded66c7
refs/heads/master
2023-05-31T00:16:42.522840
2019-10-24T21:45:07
2019-10-24T21:45:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,053
java
package mil.darpa.immortals.modulerunner.configuration; import javax.annotation.Nullable; /** * Created by awellman@bbn.com on 8/5/16. */ public class AnalysisGeneratorConfiguration { // public final ControlPointFormat controlPointFormat; // public final JavaClassType javaType; // public final SemanticType semanticType; public final int dataTransferUnitsPerBurst; public final int dataTransferBurstCount; public final int dataTransferIntervalMS; public final int testIterations; public final String unprocessedDataTargetFilepath; public final String processedDataTargetFilepath; public final String generatorSourceDataFilepath; public final String processedDataTargetValidationFilepath; public AnalysisGeneratorConfiguration( int dataTransferUnitsPerBurst, int dataTransferBurstCount, int dataTransferIntervalMS, int testIterations, @Nullable String unprocessedDataTargetFilepath, @Nullable String processedDataTargetFilepath, @Nullable String generatorSourceDataFilepath, @Nullable String processedDataTargetValidationFilepath) { this.dataTransferUnitsPerBurst = dataTransferUnitsPerBurst; this.dataTransferBurstCount = dataTransferBurstCount; this.dataTransferIntervalMS = dataTransferIntervalMS; this.testIterations = testIterations; this.unprocessedDataTargetFilepath = unprocessedDataTargetFilepath; this.processedDataTargetFilepath = processedDataTargetFilepath; this.generatorSourceDataFilepath = generatorSourceDataFilepath; this.processedDataTargetValidationFilepath = processedDataTargetValidationFilepath; } public AnalysisGeneratorConfiguration clone() { return new AnalysisGeneratorConfiguration( dataTransferUnitsPerBurst, dataTransferBurstCount, dataTransferIntervalMS, testIterations, unprocessedDataTargetFilepath, processedDataTargetFilepath, generatorSourceDataFilepath, processedDataTargetValidationFilepath); } public String AnalysisGeneratorConfigurationDeclarationClone() { return "new " + AnalysisGeneratorConfiguration.class.getName() + "(" + // return "new AnalysisGeneratorConfiguration(" + dataTransferUnitsPerBurst + "," + dataTransferBurstCount + "," + dataTransferIntervalMS + "," + testIterations + "," + unprocessedDataTargetFilepath + "," + processedDataTargetFilepath + "," + generatorSourceDataFilepath + "," + processedDataTargetValidationFilepath + ")"; } }
[ "awellman@bbn.com" ]
awellman@bbn.com
442a6bb2cb2e8d1838cdfc1dcb99d6774b83230e
4e386c6708201f0daf9854f173ad66104dcd6549
/poc/esb/org.wso2.carbonstudio.eclipse.esb/src/org/wso2/carbonstudio/eclipse/esb/FailoverEndPoint.java
a01ab1193d571c31661a002d0e89cebceee2a388
[]
no_license
whosaner/tools
a386071bf55ec43f091c26c44d34e2c72017c68f
11aad72b0f098672ade5f6c00b2c5742ffbcb845
refs/heads/master
2021-01-17T12:49:47.402884
2014-07-24T16:09:16
2014-07-24T16:09:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
982
java
/* * Copyright 2009-2010 WSO2, Inc. (http://wso2.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.wso2.carbonstudio.eclipse.esb; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Failover End Point</b></em>'. * <!-- end-user-doc --> * * * @see org.wso2.carbonstudio.eclipse.esb.EsbPackage#getFailoverEndPoint() * @model * @generated */ public interface FailoverEndPoint extends ParentEndPoint { } // FailoverEndPoint
[ "melan@a5903396-d722-0410-b921-86c7d4935375" ]
melan@a5903396-d722-0410-b921-86c7d4935375
b9dba400bc4d24b781fcec6cda56b2dde94d4bff
e198a9bb4478b9d0a712173b99a6af9e506647ae
/src/main/java/io/github/alexescalonafernandez/mbox/sort/task/SortTask.java
942e2aeca97b1754995c5ee7b966e2c6c5c222da
[]
no_license
alexescalonafernandez/mbox-sort
c27f7ac3d01bc1459665411b85ed2526ad29b913
2bb9910501f27609b717d3678e6ff43d52182bd8
refs/heads/master
2020-03-30T02:46:07.178407
2018-10-01T15:02:30
2018-10-01T15:02:30
150,648,828
0
0
null
null
null
null
UTF-8
Java
false
false
7,969
java
package io.github.alexescalonafernandez.mbox.sort.task; import java.io.*; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.HashMap; import java.util.Locale; import java.util.Optional; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by alexander.escalona on 27/09/2018. */ public class SortTask implements Runnable{ private final File mboxFile; private File defaultOutputFile; private final Consumer<Integer> progressNotifier; private final BiConsumer<Long, File> sortFileNotifier; private PrintWriter writer; public SortTask(File mboxFile, Consumer<Integer> progressNotifier, BiConsumer<Long, File> sortFileNotifier) { this.mboxFile = mboxFile; this.progressNotifier = progressNotifier; this.sortFileNotifier = sortFileNotifier; boolean flag = true; while (flag) { try { this.defaultOutputFile = File.createTempFile("mbox", ".tmp"); this.defaultOutputFile.deleteOnExit(); writer = new PrintWriter(new FileOutputStream(this.defaultOutputFile, true), true); sortFileNotifier.accept(-1L, this.defaultOutputFile); flag = false; } catch (IOException e) {} } } public void run() { RandomAccessFile raf = null; Pattern pattern = Pattern.compile("[^\\n]*\\n", Pattern.MULTILINE); Matcher matcher; byte[] chunk = new byte[1024]; int byteReads, end = 0; StringBuilder buffer = new StringBuilder(); try { raf = new RandomAccessFile(mboxFile, "r"); while (raf.getFilePointer() < raf.length()) { byteReads = raf.read(chunk); buffer.append(new String(chunk, 0, byteReads)); matcher = pattern.matcher(buffer.toString()); while (matcher.find()) { String line = matcher.group(); processLine(line); end = matcher.end(); } buffer.delete(0, end); progressNotifier.accept(byteReads); } if(buffer.length() > 0) { processLine(buffer.toString()); } buffer.delete(0, buffer.length()); tryCloseWriter(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { raf.close(); } catch (IOException e) { e.printStackTrace(); } } } private void tryCloseWriter() { Optional.ofNullable(writer).ifPresent(pw -> pw.close()); } private void processLine(final String line) throws IOException { Pattern fromPattern = Pattern.compile("^From\\s+[^\\s]+\\s+(.+)$"); Matcher matcher = fromPattern.matcher(line); long serialize; if(matcher.find()) { try { serialize = tryGetDateSerialization(matcher.group(1)); tryCloseWriter(); File file = File.createTempFile("mbox", ".tmp"); file.deleteOnExit(); sortFileNotifier.accept(serialize, file); writer = new PrintWriter(new FileOutputStream(file, true), true); } catch (Exception ex) { tryCloseWriter(); writer = new PrintWriter(new FileOutputStream(this.defaultOutputFile, true), true); } } Optional.ofNullable(writer).ifPresent(pw -> pw.print(line)); } private long tryGetDateSerialization(String toMatch) { final StringBuilder builder = new StringBuilder(toMatch); final HashMap<String, String> fields = new HashMap<>(); final Function<Matcher, String> mapper = m -> { String value = m.group(); builder.replace(m.start(), m.end(), ""); return value; }; fields.put("zone", Optional.ofNullable(Pattern.compile( "((?<=\\b)Z) # match Z UTC, which is the same as +0000\n" + "| # or\n" + "(\n" + "(?<=\\B)[\\+-] # match + or - sign\n" + "(\\d{1,2}|\\d{2}:?\\d{2}(:?\\d{2})?) # match h|hh|hh:mm|hhmm|hh:mm:ss|hhmmss\n" + ")\n" + "(?=\\s|\\n|$) # end boundary", Pattern.COMMENTS )) .map(pattern -> pattern.matcher(builder.toString())) .filter(m -> m.find()) .map(mapper) .orElse("+0000") ); Optional.ofNullable(Pattern.compile("(?<=\\s)(\\d{2}):(\\d{2}):?(\\d{2})?(?=\\s|\\n|$)")) .map(pattern -> pattern.matcher(builder.toString())) .filter(m -> m.find()) .map(m -> { String value = m.group(); fields.put("hour", m.group(1)); fields.put("minute", m.group(2)); fields.put("second", Optional.ofNullable(m.group(3)).orElse("00")); builder.replace(m.start(), m.end(), ""); return value; }) .orElse(null); fields.put("year", Optional.ofNullable(Pattern.compile("(?<=\\s)\\d{4}(?=\\s|\\n|$)")) .map(pattern -> pattern.matcher(builder.toString())) .filter(m -> m.find()) .map(mapper) .orElse(null) ); fields.put("day", Optional.ofNullable(Pattern.compile("(?<=\\s)\\d{2}(?=\\s|\\n|$)")) .map(pattern -> pattern.matcher(builder.toString())) .filter(m -> m.find()) .map(mapper) .orElse(null) ); fields.put("monthName", Optional.ofNullable(Pattern.compile("(?<=\\s)(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?=\\s|\\n|$)")) .map(pattern -> pattern.matcher(builder.toString())) .filter(m -> m.find()) .map(mapper) .orElse(null) ); fields.put("monthNumber", Optional.ofNullable(Pattern.compile("(?<=\\s)\\d{2}(?=\\s|\\n|$)")) .map(pattern -> pattern.matcher(builder.toString())) .filter(m -> m.find()) .map(mapper) .orElse(null) ); Optional.ofNullable(fields.get("monthName")) .ifPresent(monthName -> { int value = Arrays.asList("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") .indexOf(monthName) + 1; String str = String.valueOf(value); if(value < 10) str = "0" + value; fields.put("monthNumber", str); }); builder.delete(0, builder.length()); builder.append(fields.get("day")).append(" ") .append(fields.get("monthNumber")).append(" ") .append(fields.get("year")).append(" ") .append(fields.get("hour")).append(":") .append(fields.get("minute")).append(":") .append(fields.get("second")).append(" ") .append(fields.get("zone")); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MM yyyy HH:mm:ss Z", Locale.ENGLISH); LocalDateTime dateTime = LocalDateTime.parse(builder.toString(), formatter); return dateTime.toEpochSecond(ZoneOffset.of(fields.get("zone"))); } }
[ "alexescalonafernandez@gmail.com" ]
alexescalonafernandez@gmail.com
86d9b6000629a747859de622ffd3a0c0e8126483
617b113244e5afcd1fb4c2ad96d96a53d1afd381
/PluginsAndFeatures/com.persistent.winazure.eclipseplugin/src/com/gigaspaces/azure/wizards/WindowsAzureUndeploymentJob.java
2b8c198cba3edf5cf83bc9954fc6e5ce75f66b16
[]
no_license
gouthammc/MyRun
6e123eec797155f32ea167c3df1f4ebba40475af
18875fe784341d4ecfde26c1de8882ff2414cee6
refs/heads/master
2021-03-13T00:06:48.947103
2014-04-28T15:11:34
2014-04-28T15:11:34
19,239,800
0
1
null
null
null
null
UTF-8
Java
false
false
3,256
java
/******************************************************************************* * Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved * * 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.gigaspaces.azure.wizards; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.ui.console.MessageConsole; import org.eclipse.ui.console.MessageConsoleStream; import waeclipseplugin.Activator; import com.gigaspaces.azure.deploy.DeploymentEventArgs; import com.gigaspaces.azure.deploy.DeploymentEventListener; import com.gigaspaces.azure.deploy.DeploymentManager; import com.gigaspaces.azure.rest.RestAPIException; import com.gigaspaces.azure.util.CommandLineException; import com.microsoftopentechnologies.wacommon.utils.WACommonException; public class WindowsAzureUndeploymentJob extends Job { private String serviceName; private String deploymentName; private String deploymentState; private String name; public WindowsAzureUndeploymentJob(String name, String serviceName, String deploymentName, String deploymentLabel, String deploymentState) { super(name); this.name = name; this.serviceName = serviceName; this.deploymentName = deploymentName; this.deploymentState = deploymentState; } @Override protected IStatus run(final IProgressMonitor monitor) { MessageConsole console = Activator.findConsole(Activator.CONSOLE_NAME); console.clearConsole(); final MessageConsoleStream out = console.newMessageStream(); monitor.beginTask(name, 100); Activator.removeUnNecessaryListener(); DeploymentEventListener undeployListnr = new DeploymentEventListener() { @Override public void onDeploymentStep(DeploymentEventArgs args) { monitor.subTask(args.toString()); monitor.worked(args.getDeployCompleteness()); out.println(args.toString()); } }; Activator.getDefault().addDeploymentEventListener(undeployListnr); Activator.depEveList.add(undeployListnr); try { DeploymentManager.getInstance().undeploy(serviceName, deploymentName,deploymentState); } catch (RestAPIException e) { Activator.getDefault().log(Messages.error,e); } catch (InterruptedException e) { Activator.getDefault().log(Messages.error,e); } catch (CommandLineException e) { // TODO Auto-generated catch block e.printStackTrace(); }catch (WACommonException e) { Activator.getDefault().log(Messages.error,e); e.printStackTrace(); } super.setName(""); monitor.done(); super.done(Status.OK_STATUS); return Status.OK_STATUS; } }
[ "mcgoutham28@gmail.com" ]
mcgoutham28@gmail.com
09c240367e66f2c585f1101a3472cee51ed0fa77
1f2ccf069cd0efc25d99882c8e2e56b9fa9385a7
/04/demos/03-streams-basic/src/test/java/com/pluralsight/streamslambdas/exercises/BasicStreamsExercise02Test.java
985271ab9571d23d1253187bf8d9a215e33a7890
[]
no_license
bran0144/LambdasStreamsPractice
e2ae06b00c2a086ac4a54ed12f47d253947b2f61
3daf97535f8924ea83ad993dfe6c8156884a63d0
refs/heads/main
2023-08-16T00:17:04.235892
2021-10-22T16:46:35
2021-10-22T16:46:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,123
java
package com.pluralsight.streamslambdas.exercises; import com.pluralsight.streamslambdas.Product; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.util.stream.Collectors; import java.util.stream.Stream; import static com.pluralsight.streamslambdas.Category.*; import static org.assertj.core.api.Assertions.assertThat; class BasicStreamsExercise02Test { private BasicStreamsExercise02 exercise = new BasicStreamsExercise02(); @Test @DisplayName("Get product names for category") void getProductNamesForCategory() { assertThat(exercise.getProductNamesForCategory(TestData.getProducts(), OFFICE)) .describedAs("Exercise 2a: Your solution does not return the correct result for the category OFFICE.") .containsExactly("Pencils"); assertThat(exercise.getProductNamesForCategory(TestData.getProducts(), FOOD)) .describedAs("Exercise 2a: Your solution does not return the correct result for the category FOOD.") .containsExactly("Apples", "Spaghetti"); assertThat(exercise.getProductNamesForCategory(TestData.getProducts(), UTENSILS)) .describedAs("Exercise 2a: Your solution does not return the correct result for the category UTENSILS.") .containsExactly("Plates", "Knives", "Forks"); assertThat(exercise.getProductNamesForCategory(TestData.getProducts(), CLEANING)) .describedAs("Exercise 2a: Your solution does not return the correct result for the category CLEANING.") .containsExactly("Detergent"); } @Test @DisplayName("Categories to product names") void categoriesToProductNames() { assertThat(exercise.categoriesToProductNames(TestData.getProducts().stream().collect(Collectors.groupingBy(Product::getCategory)), Stream.of(FOOD, UTENSILS, CLEANING, OFFICE))) .describedAs("Exercise 2b: Your solution does not return the correct result.") .containsExactly("Apples", "Spaghetti", "Plates", "Knives", "Forks", "Detergent", "Pencils"); } }
[ "Katie.Gott@target.com" ]
Katie.Gott@target.com
ed6a147a610c33955d7f5f6efa8bccd1ea00f3f3
86c9a52f0487cfb08cf48ff95bd5b0861459721c
/app/src/main/java/com/tosinorojinmi/theophilus/agriwaves/Models/Series.java
3cdca8e5e9de977a631bcd6c8f9e851a0ee1b8d2
[]
no_license
zeoharlem/AgriWaves
357f5eac6a4caad466fe0de15581bb0921a41292
501b952aba9843e3fb424d9f28e3c8739053e905
refs/heads/master
2021-06-24T22:46:56.045688
2019-06-30T13:25:15
2019-06-30T13:25:15
145,630,133
1
1
null
null
null
null
UTF-8
Java
false
false
2,552
java
package com.tosinorojinmi.theophilus.agriwaves.Models; import android.os.Parcel; import android.os.Parcelable; /** * Created by Theophilus on 8/15/2018. */ public class Series implements Parcelable{ private String seriesId; private String seriesTitle; private String seriesDesc; private String seriesImgs; private String dateCreated; private String totalNumber; public Series() { } public Series(Parcel parcel){ this.seriesId = parcel.readString(); this.seriesTitle = parcel.readString(); this.seriesDesc = parcel.readString(); this.seriesImgs = parcel.readString(); this.dateCreated = parcel.readString(); this.totalNumber = parcel.readString(); } //Initiate the parcelable Object Class public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override public Series createFromParcel(Parcel parcel) { return new Series(parcel); } @Override public Series[] newArray(int i) { return new Series[i]; } }; public String getSeriesId() { return seriesId; } public void setSeriesId(String seriesId) { this.seriesId = seriesId; } public String getSeriesTitle() { return seriesTitle; } public void setSeriesTitle(String seriesTitle) { this.seriesTitle = seriesTitle; } public String getSeriesDesc() { return seriesDesc; } public void setSeriesDesc(String seriesDesc) { this.seriesDesc = seriesDesc; } public String getSeriesImgs() { return seriesImgs; } public void setSeriesImgs(String seriesImgs) { this.seriesImgs = seriesImgs; } public String getDateCreated() { return dateCreated; } public void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } public String getTotalNumber() { return totalNumber; } public void setTotalNumber(String totalNumber) { this.totalNumber = totalNumber; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int i) { parcel.writeString(this.seriesId); parcel.writeString(this.seriesTitle); parcel.writeString(this.seriesDesc); parcel.writeString(this.seriesImgs); parcel.writeString(this.dateCreated); parcel.writeString(this.totalNumber); } }
[ "zeoharlem@yahoo.co.uk" ]
zeoharlem@yahoo.co.uk
244c98b390ab1836b663edcd106671dd13544bfe
54b92ecdf7f54c6b9527779547abd2ba34ed6397
/ICS141_02/src/TextWriting.java
42e1d5187d82dd696e1a4a443efb6457a4119e81
[]
no_license
idgormley/classex
229820d30edb8c09400a97f07655304333c201d8
fa6aeacf18ea5ad40a7fde47723d1634e84ca24d
refs/heads/master
2021-04-09T16:13:25.323878
2018-03-18T18:56:11
2018-03-18T18:56:11
125,756,877
0
0
null
null
null
null
UTF-8
Java
false
false
578
java
import java.io.*; import java.util.Scanner; public class TextWriting { public static void main(String[] args) throws FileNotFoundException { Scanner input= new Scanner(System.in); System.out.println("Enter Your Name"); String name= input.next(); System.out.println("Enter Course Name"); String course=input.next(); System.out.println("Enter Semester of study"); String sem=input.next(); input.close(); try( PrintWriter x = new PrintWriter("personal.txt"); ){ x.println(name); x.println(course); x.println(sem); } } }
[ "idgormley@gmail.com" ]
idgormley@gmail.com
de0a963a1eb823de72190fc980a64bf749986b3f
d1aad47759c43b9ea158501739884502c3dce0bf
/verint-api/src/test/java/ru/cti/iss/verint/dao/VerintDaoITest.java
26f14407436aa804572fff352fea827e1fee6d69
[]
no_license
vadimosipov/unify-record-notification
6546251a23e8ddc0528bf2a7e397839b46b0425d
c675e296448da84f674d8c8604053f2272142b96
refs/heads/master
2021-01-23T01:08:26.126090
2017-03-22T21:50:58
2017-03-22T21:50:58
85,879,657
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
package ru.cti.iss.verint.dao; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import ru.cti.iss.verint.TestVerintConfiguration; import ru.cti.iss.verint.VerintConfiguration; import ru.cti.iss.verint.model.Channel; import javax.inject.Inject; import java.util.List; import java.util.concurrent.ThreadLocalRandom; import static org.junit.Assert.assertEquals; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = VerintConfiguration.class) @ActiveProfiles("test") public class VerintDaoITest extends AbstractJUnit4SpringContextTests { @Inject private VerintDao verintDao; @Test public void shouldFindAllChannels() { int currentChannelsCount = 200; assertEquals(currentChannelsCount, verintDao.findAll().size()); } @Test public void shouldQueryChannelsByExtension() { final int extension = ThreadLocalRandom.current().nextInt(1000, 10_000); final List<Channel> channels = verintDao.findByExtension(String.valueOf(extension)); assertEquals(0, channels.size()); } @Test public void shouldQueryNoChannelsByExtension() { final int extension = 1192; final List<Channel> channels = verintDao.findByExtension(String.valueOf(extension)); assertEquals(1, channels.size()); } }
[ "osipov.vad@gmail.com" ]
osipov.vad@gmail.com
ea278e67e5f66a5b301f45a7abef1c9054eee093
3fa90206007cbd308a4a1b094b35f752816018cf
/src/main/java/com/lisapra/pra4/springaop/LogUtil.java
8a4382a93093bc1295ef52cc4e53442aaeb0b147
[]
no_license
lisapython/SpringPractice
def0149c4d3a59cd2687bc010e36d881c39851ef
9b81ace0f43fe0cad5e6e2fac90b7ffad0cfda1d
refs/heads/master
2023-01-23T04:48:44.050503
2020-12-07T13:14:37
2020-12-07T13:14:37
319,324,499
0
0
null
null
null
null
UTF-8
Java
false
false
1,207
java
package com.lisapra.pra4.springaop; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.*; import org.springframework.stereotype.Component; import java.util.Arrays; @Aspect @Component public class LogUtil { @Before("execution(* *(..))") public static void start(JoinPoint joinPoint){ System.out.println(joinPoint.getSignature().getName()+"方法开始执行,参数是:"+ Arrays.asList(joinPoint.getArgs())); } @AfterReturning(value="execution(* *(..))",returning = "result") public static void stop(JoinPoint joinPoint,Object result){ System.out.println(joinPoint.getSignature().getName()+"方法执行完成,结果是:"+result); } //保留一个精准匹配 @AfterThrowing(value = "execution( public int com.lisapra.pra4.springaop.MyCalculator.*(int,int))",throwing = "ex") public static void logException(JoinPoint joinPoint,Exception ex){ System.out.println(joinPoint.getSignature().getName()+"方法出现异常:"+ex); } @After("execution(* *(..))") public static void end(JoinPoint joinPoint){ System.out.println(joinPoint.getSignature().getName()+"方法执行结束了......"); } }
[ "378341691@qq.com" ]
378341691@qq.com
a96044c82fced9698013ee020dfd001cc602dc61
3fd7cac373d2ecbf80cf6fc961042b1727af478f
/ShifooData/app/src/main/java/com/peepal/shifoodata/PendingSelect.java
2ac76e6ea13c21aebe7088366c474c4c1b45b62a
[]
no_license
Rozelle/AndroidProjects
616481524fccb2f492304f3fe20a8c8a456a5317
5a7245429a3f7466fdfe230a5fa062d6707a930b
refs/heads/master
2020-03-23T08:26:34.806576
2019-02-24T11:44:48
2019-02-24T11:44:48
141,327,118
0
0
null
null
null
null
UTF-8
Java
false
false
16,848
java
package com.peepal.shifoodata; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.AsyncTask; import android.provider.*; import android.provider.Settings; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.telephony.TelephonyManager; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.Toast; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.List; public class PendingSelect extends ActionBarActivity { Intent intent; int position; ListView lv; ArrayList<String> arrayList; String name,phone,amt,date,remarks,txnid; List<ModelP> list; ArrayAdapter<ModelP> adapter; View view; String message,tab; AlertDialog alertDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pending_select); intent=getIntent(); position=intent.getIntExtra("select", 0); arrayList=intent.getStringArrayListExtra("list"); tab=intent.getStringExtra("tab"); lv= (ListView) findViewById(R.id.pendingSelect); adapter = new PendingSelectListadapter(this, getModelP()); lv.setAdapter(adapter); if(tab.equals("Paid")) { Button remind=(Button)findViewById(R.id.remind); remind.setText("Request"); Button move=(Button)findViewById(R.id.paid); move.setText("Move to Pending"); } } public List<ModelP> getModelP() { int i,len; String a; String b; list = new ArrayList<ModelP>(); for(int j=0;j<arrayList.size();j++) { len=arrayList.get(j).length(); i=arrayList.get(j).indexOf('|'); a=arrayList.get(j).substring(0, i); name=a; b=arrayList.get(j).substring(i + 2, len); len=b.length(); i=b.indexOf('|'); a=b.substring(0, i); phone=a; b=b.substring(i + 2, len); len=b.length(); i=b.indexOf('|'); a=b.substring(0, i); amt=a; b=b.substring(i + 2, len); len=b.length(); i = b.indexOf('|'); a = b.substring(0, i); date=a; b = b.substring(i + 2, len); len = b.length(); i = b.indexOf('|'); a = b.substring(0, i); if (a == "!") remarks = ""; else remarks = a; b = b.substring(i + 2, len); txnid=b; list.add(get(name, phone, Integer.parseInt(amt), date, remarks, txnid)); }//for ends // Initially select one of the items list.get(position).setSelected(true); return list; } private ModelP get(String name,String phone,int amt,String date,String remarks,String txnid) { return new ModelP(name,phone,amt,date,remarks,txnid); } public void selectAllClick(View v) { Button b=(Button)findViewById(R.id.selectAll); if(b.getText().toString().equalsIgnoreCase("Select all")) { for (int j = 0; j < arrayList.size(); j++) list.get(j).setSelected(true); b.setText("Unselect all"); } else { for (int j = 0; j < arrayList.size(); j++) list.get(j).setSelected(false); b.setText("Select all"); } adapter.notifyDataSetChanged(); } public void remindClick(View v) { final String keyword; final String android_id = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID); Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy"); String formattedDate = df.format(c.getTime()); Message m; boolean flag = true; MyDBHandler myDBHandler = new MyDBHandler(getApplicationContext(), null, null, 1); if(tab.equals("Pending")) { keyword="remind"; remarks=null; if(isConnected()) { try { for (int j = 0; j < arrayList.size(); j++) { if (list.get(j).isSelected()) { flag = false; message = list.get(j).getPhone() + "-" + list.get(j).getAmount() + "*" + list.get(j).getRemarks(); //send data some how m = myDBHandler.findMessage(list.get(j).getPhone()); m.setDate(formattedDate); myDBHandler.addMessage(m); } } new HttpAsyncTask().execute("http://advanced.shifoo.in/payment/process-data", android_id,keyword,message,remarks); } catch (Exception e) { Toast.makeText(getApplicationContext(), "Data failed, please try again.", Toast.LENGTH_LONG).show(); e.printStackTrace(); } }//if(isConnected) ends else { Toast.makeText(getApplicationContext(), "Please check your Internet connection", Toast.LENGTH_SHORT).show(); } }//if(pending tab)ends else//Paid tab { keyword="shifoo"; for (int j=0;j<arrayList.size();j++) { if (list.get(j).isSelected()) { message += list.get(j).getPhone() + "-" + list.get(j).getAmount() + ","; flag = false; } } if (!flag) { message = message.substring(0, message.length() - 1); AlertDialog.Builder builder = new AlertDialog.Builder(this); // Get the layout inflater LayoutInflater inflater = this.getLayoutInflater(); // Inflate and set the layout for the dialog // Pass null as the parent view because its going in the dialog layout view = inflater.inflate(R.layout.dialog_remark, null); builder.setView(view); alertDialog = builder.create(); Button done = (Button) view.findViewById(R.id.done); done.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EditText editText = (EditText) view.findViewById(R.id.remark); remarks = editText.getText().toString(); if (remarks.length() == 0) { Toast.makeText(getApplicationContext(), "Enter remarks", Toast.LENGTH_SHORT).show(); return; } //add message if (isConnected()) { try { Toast.makeText(getApplicationContext(), "Data sending...", Toast.LENGTH_LONG).show(); //see server url new HttpAsyncTask().execute("http://advanced.shifoo.in/payment/process-data", android_id, keyword, message, remarks); Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy"); String formattedDate = df.format(c.getTime()); Message m; MyDBHandler myDBHandler = new MyDBHandler(getApplicationContext(), null, null, 1); for (int j = 0; j < arrayList.size(); j++) { if (list.get(j).isSelected()) { m = myDBHandler.findMessage(list.get(j).getPhone()); if (m != null) { m.setDate(formattedDate); m.setPaid(0); m.setTxnid("!"); m.setAmount(list.get(j).getAmount()); m.setRemarks(remarks); myDBHandler.addMessage(m); } else { Log.v("tag", "else" + message); m = new Message(list.get(j).getName(), list.get(j).getPhone(), list.get(j).getAmount(), remarks, formattedDate, 0, "!"); myDBHandler.addMessage(m); } }//if ends }//for ends } //try ends catch (Exception e) { Toast.makeText(getApplicationContext(), "Data failed, please try again.", Toast.LENGTH_LONG).show(); e.printStackTrace(); } }//if(isConnected) ends else { Toast.makeText(getApplicationContext(), "Please check your Internet connection", Toast.LENGTH_SHORT).show(); } alertDialog.dismiss(); } }); Button discard = (Button) view.findViewById(R.id.discard); discard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alertDialog.dismiss(); } }); alertDialog.show(); }//if(!flag) closes }//else ends if (flag) Toast.makeText(this, "Select atleast one student", Toast.LENGTH_SHORT).show(); } public boolean isConnected(){ ConnectivityManager connMgr = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) return true; else return false; } private class HttpAsyncTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { return POST(params[0],params[1],params[2],params[3],params[4]); } // onPostExecute displays the results of the AsyncTask. @Override protected void onPostExecute(String result) { Toast.makeText(getBaseContext(), "Data Sent!", Toast.LENGTH_LONG).show(); } } public static String POST(String url, String dev,String keyword,String message,String remarks){ InputStream inputStream = null; String result = ""; try { // 1. create HttpClient HttpClient httpclient = new DefaultHttpClient(); // 2. make POST request to the given URL HttpPost httpPost = new HttpPost(url); String json = ""; // 3. build jsonObject JSONObject jsonObject = new JSONObject(); jsonObject.put("device",dev) .put("keyword",keyword) .put("message",message) .put("remark",remarks); // 4. convert JSONObject to JSON to String json = jsonObject.toString(); // 5. set json to StringEntity StringEntity se = new StringEntity(json); // 6. set httpPost Entity httpPost.setEntity(se); // 7. Set some headers to inform server about the type of the content httpPost.setHeader("Accept", "application/json"); httpPost.setHeader("Content-type", "application/json"); // 8. Execute POST request to the given URL HttpResponse httpResponse = httpclient.execute(httpPost); // 9. receive response as inputStream inputStream = httpResponse.getEntity().getContent(); // 10. convert inputstream to string if(inputStream != null) result = convertInputStreamToString(inputStream); else result = "Did not work!"; } catch (Exception e) {} // 11. return result return result; } private static String convertInputStreamToString(InputStream inputStream) throws IOException { BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream)); String line = ""; String result = ""; while((line = bufferedReader.readLine()) != null) result += line; inputStream.close(); return result; } public void paidClick(View v) { boolean flag=true; Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy"); String formattedDate = df.format(c.getTime()); MyDBHandler myDBHandler=new MyDBHandler(getApplicationContext(),null,null,1); Message m; StudentDBHandler studentDBHandler=new StudentDBHandler(this,null,null,1); Student s; String p; if(tab.equals("Pending")) { for (int j = 0; j < arrayList.size(); j++) { if (list.get(j).isSelected()) { p=list.get(j).getPhone(); flag = false; m = myDBHandler.findMessage(p); m.setTxnid("Paid"); m.setPaid(1); m.setDate(formattedDate); myDBHandler.addMessage(m); s = studentDBHandler.findStudent(p); s.setDate(formattedDate); studentDBHandler.deleteStudent(p); studentDBHandler.addStudent(s); } } } else { for (int j=0;j<arrayList.size();j++) { if (list.get(j).isSelected()) { flag = false; p=list.get(j).getPhone(); m = myDBHandler.findMessage(p); m.setTxnid("!"); m.setPaid(0); m.setDate(formattedDate); myDBHandler.addMessage(m); s = studentDBHandler.findStudent(p); s.setDate("!"); studentDBHandler.deleteStudent(p); studentDBHandler.addStudent(s); } } } if(flag) Toast.makeText(this,"Select atleast one student",Toast.LENGTH_SHORT).show(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_pending_select, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. return super.onOptionsItemSelected(item); } }
[ "rozelle.jain@gmail.com" ]
rozelle.jain@gmail.com
073f1e7b3b2fe8555cd708d3bd7110e0712e6e3a
1de8c5b116e450df0a41298cb6fe37fa00c2a4a6
/app/src/main/java/com/anandniketanbhadaj/skool360student/AsyncTasks/GetStudentResultAsyncTask.java
af96ebbcaacce2263cb198b3ee7e0bcfa197ad51
[]
no_license
Adms1/skool360_student_android
71fad71a512b6132e034d3063c0a6a16c32647d4
330a6c73f5f9d28551a574a4391135cbb862ebd0
refs/heads/master
2020-05-03T03:32:56.936842
2019-05-14T13:08:51
2019-05-14T13:08:51
178,400,989
0
0
null
null
null
null
UTF-8
Java
false
false
1,489
java
package com.anandniketanbhadaj.skool360student.AsyncTasks; import android.os.AsyncTask; import com.anandniketanbhadaj.skool360student.Models.ResultModel; import com.anandniketanbhadaj.skool360student.Utility.AppConfiguration; import com.anandniketanbhadaj.skool360student.Utility.ParseJSON; import com.anandniketanbhadaj.skool360student.WebServicesCall.WebServicesCall; import java.util.ArrayList; import java.util.HashMap; public class GetStudentResultAsyncTask extends AsyncTask<Void, Void, ArrayList<ResultModel>> { HashMap<String, String> param = new HashMap<String, String>(); public GetStudentResultAsyncTask(HashMap<String, String> param) { this.param = param; } @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected ArrayList<ResultModel> doInBackground(Void... params) { String responseString = null; ArrayList<ResultModel> result = null; try { responseString = WebServicesCall.RunScript(AppConfiguration.getUrl(AppConfiguration.GetStudentResult), param); result = ParseJSON.parseUnitTestJson(responseString); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return result; } @Override protected void onPostExecute(ArrayList<ResultModel> result) { super.onPostExecute(result); } }
[ "admsbuild@gmail.com" ]
admsbuild@gmail.com
98f4da667363da3e35e4884cfd329146fc4de493
05551131a89c839790bc8bcabff07e63f99e9941
/src/main/java/io/github/vampirestudios/vks/block/BlockRotatedObject.java
ad386bd679e7bb3aed8565df5218e9669b9c6e9a
[ "CC0-1.0" ]
permissive
vampire-studios/VehiclesAndTheKitchenSink-Fabric
4ea09898c87b2571574b4f1fdd947e7ae26366d6
61f9b27c8d5e14695e7efdcc5b0899cddb3ccdd3
refs/heads/master
2021-08-17T16:39:00.847193
2020-07-11T11:35:53
2020-07-11T11:35:53
203,227,952
0
0
null
null
null
null
UTF-8
Java
false
false
1,511
java
package io.github.vampirestudios.vks.block; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalFacingBlock; import net.minecraft.item.ItemPlacementContext; import net.minecraft.state.StateManager; import net.minecraft.state.property.DirectionProperty; import net.minecraft.util.BlockMirror; import net.minecraft.util.BlockRotation; import net.minecraft.util.math.Direction; /** * Author: MrCrayfish */ public abstract class BlockRotatedObject extends BlockObject { public static final DirectionProperty DIRECTION = HorizontalFacingBlock.FACING; public BlockRotatedObject(Block.Settings properties) { super(properties); this.setDefaultState(this.getStateManager().getDefaultState().with(DIRECTION, Direction.NORTH)); } @Override public BlockState getPlacementState(ItemPlacementContext context) { return super.getPlacementState(context).with(DIRECTION, context.getPlayerFacing()); } @Override protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { super.appendProperties(builder); builder.add(DIRECTION); } @Override public BlockState rotate(BlockState state, BlockRotation rotation) { return state.with(DIRECTION, rotation.rotate(state.get(DIRECTION))); } @Override public BlockState mirror(BlockState state, BlockMirror mirror) { return state.rotate(mirror.getRotation(state.get(DIRECTION))); } }
[ "sindrefagerheim53@gmail.com" ]
sindrefagerheim53@gmail.com
42509b5c4ed08be0889b66e0cd6cd5223cb15f98
d14e22d4062fd7bea4f439d1ba5968bc14cffb9d
/sr-model/src/main/java/com/sp/sr/model/dto/TestRecordDTO.java
e44a399d6ee35ab162e7205c5cad85e77925599c
[]
no_license
anthinkingcoder/sr-core
83681826e30e5da3d763e74d3d23e3d76b7776d2
855ef250dce249d5480ef59eead40824b256eb25
refs/heads/master
2020-03-09T18:43:13.823568
2018-04-10T13:54:18
2018-04-10T13:54:18
128,939,058
1
0
null
null
null
null
UTF-8
Java
false
false
1,528
java
package com.sp.sr.model.dto; import com.sp.sr.model.domain.question.Question; import lombok.Data; import java.util.Date; import java.util.List; @Data public class TestRecordDTO { private Long testRecordId; private String[] categoryIds; private Integer level; private Integer questionNum; private Integer questionRightNum; private Integer origin; private String answerPath; private String resultPath; private Date startTime; private Date endTime; private Integer score; private Integer status; private Long studentId; private QuestionDTO questionTestRecord; private List<Long> questionIds; public TestRecordDTO(String[] categoryIds, Integer level, Integer questionNum, Integer origin) { this.categoryIds = categoryIds; this.level = level; this.questionNum = questionNum; this.origin = origin; } public TestRecordDTO(Long testRecordId, Integer level, Integer questionNum, Integer questionRightNum, Integer origin, String answerPath, String resultPath, Date startTime, Integer score, Integer status, Long studentId) { this.testRecordId = testRecordId; this.level = level; this.questionNum = questionNum; this.questionRightNum = questionRightNum; this.origin = origin; this.answerPath = answerPath; this.resultPath = resultPath; this.startTime = startTime; this.score = score; this.status = status; this.studentId = studentId; } }
[ "837769723@qq.com" ]
837769723@qq.com
f12c0bddf5ac6cf14897fe307208db432897e728
1328df26060ea7a87c1609c704060e563613b4f1
/app/src/main/java/aharoldk/finalproject/HealthActivity.java
83672c9f89f0ec28c4908badd17265f0811a3f11
[]
no_license
aharoldk/Fani_Informasi_Terkini
ff0ad190faeaa0dc0b0feed846ed4f37ed4573bb
169a9f5f42b3e56479afe9c20c25fd54fcefb9aa
refs/heads/master
2021-01-01T15:38:09.690640
2017-07-19T01:44:41
2017-07-19T01:44:41
97,660,350
1
0
null
null
null
null
UTF-8
Java
false
false
5,440
java
package aharoldk.finalproject; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.MenuItem; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.google.gson.Gson; import aharoldk.finalproject.adapter.HealthAdapter; import aharoldk.finalproject.adapter.SportAdapter; import aharoldk.finalproject.clases.Fighters; import aharoldk.finalproject.clases.Products; /** * Created by aharoldk on 25/06/17. */ public class HealthActivity extends AppCompatActivity { private DrawerLayout mDrawerLayout; private ActionBarDrawerToggle mToggle; private NavigationView navigationView; private RecyclerView rvmain; private Products[] products; private HealthAdapter healthAdapter; private Gson gson = new Gson(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_food); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout); mToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.open, R.string.close); navigationView = (NavigationView) findViewById(R.id.navigation); mDrawerLayout.addDrawerListener(mToggle); mToggle.syncState(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); rvmain = (RecyclerView) findViewById(R.id.rvmain); loadData(); navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); Intent homeActivity = new Intent(getApplicationContext(), MainActivity.class); Intent sportActivity = new Intent(getApplicationContext(), SportActivity.class); Intent healthActivity = new Intent(getApplicationContext(), HealthActivity.class); Intent loginActivity = new Intent(getApplicationContext(), LoginActivity.class); if (id == R.id.nav_home) { startActivity(homeActivity); overridePendingTransition(R.anim.trans_in, R.anim.trans_out); } else if (id == R.id.nav_food) { finish(); startActivity(getIntent()); overridePendingTransition(R.anim.trans_in_activity, R.anim.trans_out_activity); } else if (id == R.id.nav_health) { startActivity(healthActivity); overridePendingTransition(R.anim.trans_in, R.anim.trans_out); } else if (id == R.id.nav_sport) { startActivity(sportActivity); overridePendingTransition(R.anim.trans_in, R.anim.trans_out); } else if (id == R.id.nav_login){ startActivity(loginActivity); overridePendingTransition(R.anim.trans_in, R.anim.trans_out); } return true; } }); } private void loadData() { String URL = "http://makeup-api.herokuapp.com/api/v1/products.json?brand=covergirl&product_type=lipstick"; RequestQueue requestQueue = Volley.newRequestQueue(this); StringRequest stringRequest = new StringRequest( Request.Method.GET, URL, new Response.Listener<String>() { @Override public void onResponse(String response) { Log.i("response", response); try { products = gson.fromJson(response, Products[].class); healthAdapter = new HealthAdapter(products, HealthActivity.this); rvmain.setLayoutManager(new LinearLayoutManager(HealthActivity.this)); rvmain.setAdapter(healthAdapter); } catch (Exception e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { error.printStackTrace(); } } ); requestQueue.add(stringRequest); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(mToggle.onOptionsItemSelected(item)){ return true; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { if (this.mDrawerLayout.isDrawerOpen(GravityCompat.START)) { this.mDrawerLayout.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } }
[ "aharoldk@gmail.com" ]
aharoldk@gmail.com
bda2b2955cae752b17349ba9e8c3acd20db08cc8
476b5f9e6b084fe97e9b97efd6a0cf264c46089c
/data/ExampleSourceCodeFiles/DateToStringConverter.java
c9a5c143f500033a78063bdf840100da9ac8406b
[]
no_license
shy942/QueryReform2
7bfa630b3d2bca50b0000460efda8a3c81347193
02e6f25d652d8f0b1d8985711b2fbf60b866b531
refs/heads/master
2021-01-20T20:02:43.072058
2016-07-12T20:41:33
2016-07-12T20:41:33
63,643,457
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
/Users/user/eclipse.platform.ui/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.java copyright objects inc http all rights reserved this program accompanying materials terms eclipse public license accompanies distribution http eclipse org legal epl html contributors objects initial implementation org eclipse core internal databinding conversion java util date org eclipse core databinding conversion converter converts java util date string current locale null values converted empty string date string converter date conversion support converter override object convert object source source null format date source override object from type date override object type string
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
42e41037379d5da1753f33713ed46105525296aa
7b06400cb84f00c07ceee8995a0ef2cb2c050d37
/src/main/java/com/openpojo/random/generator/security/CredentialsRandomGenerator.java
6e1d93c919bd111d3c812717b08e88dcd7658167
[]
no_license
wonjjang/openpojo
d79ddf64a3e0bbfbb5d0e9f5d901cd5a916c7fdf
e2f724d6e9d7427d67f1b717dcf730640f93168a
refs/heads/master
2021-01-19T10:39:34.728184
2017-01-23T06:26:59
2017-01-23T06:26:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,462
java
/* * Copyright (c) 2010-2016 Osman Shoukry * * 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.openpojo.random.generator.security; import java.util.Arrays; import java.util.Collection; import com.openpojo.random.RandomFactory; import com.openpojo.random.RandomGenerator; import sun.security.krb5.Credentials; import sun.security.krb5.EncryptionKey; import sun.security.krb5.PrincipalName; import sun.security.krb5.internal.HostAddresses; import sun.security.krb5.internal.KerberosTime; import sun.security.krb5.internal.Ticket; import sun.security.krb5.internal.TicketFlags; /** * @author oshoukry */ public class CredentialsRandomGenerator implements RandomGenerator { private static final Class<?>[] TYPES = new Class<?>[] { Credentials.class }; private static final CredentialsRandomGenerator INSTANCE = new CredentialsRandomGenerator(); private CredentialsRandomGenerator() { } public static RandomGenerator getInstance() { return INSTANCE; } public Collection<Class<?>> getTypes() { return Arrays.asList(TYPES); } public Object doGenerate(Class<?> type) { Ticket var1 = RandomFactory.getRandomValue(Ticket.class); PrincipalName var2 = RandomFactory.getRandomValue(PrincipalName.class); PrincipalName var3 = RandomFactory.getRandomValue(PrincipalName.class); EncryptionKey var4 = RandomFactory.getRandomValue(EncryptionKey.class); TicketFlags var5 = RandomFactory.getRandomValue(TicketFlags.class); KerberosTime var6 = RandomFactory.getRandomValue(KerberosTime.class); KerberosTime var7 = RandomFactory.getRandomValue(KerberosTime.class); KerberosTime var8 = RandomFactory.getRandomValue(KerberosTime.class); KerberosTime var9 = RandomFactory.getRandomValue(KerberosTime.class); HostAddresses var10 = RandomFactory.getRandomValue(HostAddresses.class); return new Credentials(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); } }
[ "oshoukry@openpojo.com" ]
oshoukry@openpojo.com
76bebf10110cc0fed451f85f58e1de959d1e7143
9dad251a921855243d0dee3c3333cfb89eeb9c8f
/backend/src/main/java/com/online/giftshop/services/CartService.java
85deb872f608cab1a460d8abeccb58b669adecad
[]
no_license
velprak/gift-shop-monolithic
d90df461b5bf6f36cd0756b3576da64719b3052d
8a03951c1731b9fb833b1549a4f9135c2c0083c2
refs/heads/master
2023-05-31T13:11:28.763845
2021-06-17T18:41:57
2021-06-17T18:41:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
/** * @author Gagandeep Singh * @email singh.gagandeep3911@gmail.com * @create date 2021-01-13 22:59:25 * @modify date 2021-01-13 22:59:25 * @desc [description] */ package com.online.giftshop.services; import com.online.giftshop.dto.CartDto; import com.online.giftshop.dto.ItemDto; import com.online.giftshop.entities.Cart; public interface CartService { Cart fetchCartById(Long cartId); Cart addToCart(ItemDto itemDto, Long id); Cart deleteFromCart(Long productId, Long id); // Merge local cart with Server cart // Can be done later Cart mergeCart(CartDto cartDto,Long id); Cart fetchByUserId(Long userId); }
[ "singh.gagandeep3911@gmail.com" ]
singh.gagandeep3911@gmail.com
6048b66e2ea7a4ebd29a6863f9eb4a0c45ae3664
f128faaf396d547183a8c1d640276409a1896b7c
/11architect-stage-15-mycat/分布式事务/tcc-demo/src/main/java/com/example/tccdemo/consumer/ChangeOrderStatus.java
79dd68ba9724886dc7f4a6c1a1449c50a888eee2
[]
no_license
wjphappy90/JiaGou
0708a2c4d2cf0a1fda4a46f09e728cf855a938dc
367fc5e7101cb42d99686027494bb15f73558147
refs/heads/master
2023-01-05T22:04:59.604537
2020-10-28T12:15:34
2020-10-28T12:15:34
307,754,947
1
1
null
null
null
null
UTF-8
Java
false
false
1,991
java
package com.example.tccdemo.consumer; import com.example.tccdemo.db132.dao.OrderMapper; import com.example.tccdemo.db132.model.Order; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; import org.apache.rocketmq.common.message.MessageExt; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.Date; import java.util.List; import static org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus.CONSUME_SUCCESS; import static org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus.RECONSUME_LATER; @Component("messageListener") public class ChangeOrderStatus implements MessageListenerConcurrently { @Resource private OrderMapper orderMapper; @Override public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) { if (list == null || list.size()==0) return CONSUME_SUCCESS; for (MessageExt messageExt : list) { String orderId = messageExt.getKeys(); String msg = new String(messageExt.getBody()); System.out.println("msg="+msg); Order order = orderMapper.selectByPrimaryKey(Integer.parseInt(orderId)); if (order==null) return RECONSUME_LATER; try { order.setOrderStatus(1);//已支付 order.setUpdateTime(new Date()); order.setUpdateUser(0);//系统更新 orderMapper.updateByPrimaryKey(order); }catch (Exception e){ e.printStackTrace(); return RECONSUME_LATER; } } return CONSUME_SUCCESS; } }
[ "981146457@qq.com" ]
981146457@qq.com
e5f9e1ff767d9a18bb5a0545568c8157a1587a1f
b00f1244cb13975c664b79c6bae69061a2a07b45
/WS-KingdeeOnlyCode/app/src/main/java/com/fangzuo/assist/Adapter/DepartmentSpAdapter.java
cd1ae1d1a434129e6ae24bed40ed9dcd118395e9
[]
no_license
huohehuo/KingdeePDA-OnlyCode-GZ-WS
ff61676747f2ea455ebd062fab51bd1609367046
4ebde5e96e0ccdcdef30172ac439619a82509fe4
refs/heads/master
2020-09-05T03:18:47.412409
2020-05-07T09:29:10
2020-05-07T09:29:10
219,965,547
4
1
null
null
null
null
UTF-8
Java
false
false
1,420
java
package com.fangzuo.assist.Adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.fangzuo.assist.Dao.Department; import com.fangzuo.assist.R; import java.util.List; /** * Created by NB on 2017/7/27. */ public class DepartmentSpAdapter extends BaseAdapter { Context context; List<Department> items; private ViewHolder viewHolder; public DepartmentSpAdapter(Context context, List<Department> items) { this.context = context; this.items = items; } @Override public int getCount() { return items.size(); } @Override public Object getItem(int i) { return items.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View view, ViewGroup viewGroup) { if(view==null){ view = LayoutInflater.from(context).inflate(R.layout.itemtext,null); viewHolder = new ViewHolder(); viewHolder.tv = view.findViewById(R.id.textView); view.setTag(viewHolder); }else{ viewHolder = (ViewHolder) view.getTag(); } viewHolder.tv.setText(items.get(i).FName); return view; } class ViewHolder{ TextView tv ; } }
[ "753392431@qq.com" ]
753392431@qq.com
c5f8bee6dbb925b55d45ef7269a851ac773fabdb
da6dae891b6e6869a4962ad24e46749a032c372d
/pruebas/Prueba7.java
69be7614a6b4df63d42bfe56302e202d71d8172e
[]
no_license
HylianPablo/Practica1LDP
34260cb53f3214d3deb4b98ec28fb7366a962fd4
a8202e4b85dd3cc6fbcbeef219cbd4c1c36c8819
refs/heads/master
2022-04-18T19:26:40.816178
2020-04-02T14:42:31
2020-04-02T14:42:31
248,487,734
0
0
null
null
null
null
UTF-8
Java
false
false
397
java
// locc 1, locw 0, locp 18, locf 19, ciclo 4 public class Prueba7{ public static void main(String[] args){ System.out.println("Hola"); System.out.println("Que tal"); int caseo; if(1==1){caseo=1;} switch(num){ /**/case 0: System.out.println("cerocaseo"); break; case 1: System.out.println("unocaseo"); break; default: System.out.println("defalto"); } } }
[ "javier.gaton@alumnos.uva.es" ]
javier.gaton@alumnos.uva.es
fe25d21b313166ea6d305db2edb6218a0778f502
e4f537e7183a1466366b0f1a293850cc583eea3d
/solve/y20/m8/d0827/BJ_10026_적록색약.java
a5d2d0eceaf1406dc39aeace981320723d95895b
[]
no_license
picseo/java
de3d9d5a1df2f462e0027bad23f33d267d73ed31
b0c1988e01ec284fa9ca76839b60099bb606138d
refs/heads/master
2021-08-17T18:09:41.233589
2020-12-26T06:54:52
2020-12-26T06:54:52
236,621,721
0
0
null
null
null
null
UTF-8
Java
false
false
2,089
java
package d0827; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; /* * 적록색약 : R, G를 같게 여긴다. * * 구역으로 나눔 -> bfs * * */ public class BJ_10026_적록색약 { static int[][] dirs = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}}; static int N; static int[][] map; static boolean[][] visited; public static void main(String[] args) { Scanner sc = new Scanner(System.in); N = sc.nextInt(); map = new int[N][N]; for(int i = 0; i < N; i++) { char[] input = sc.next().toCharArray(); for(int j = 0; j < N; j++) { if(input[j] == 'R') { map[i][j] = 1; }else if(input[j] == 'G') { map[i][j] = 2; }else if(input[j] == 'B') { map[i][j] = 3; } } } StringBuilder sb = new StringBuilder(); int cnt = 0; visited = new boolean[N][N]; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { if(!visited[i][j]) { bfs(1, i, j); cnt++; } } } sb.append(cnt).append(" "); cnt = 0; visited = new boolean[N][N]; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { if(!visited[i][j]) { bfs(0, i, j); cnt++; } } } sb.append(cnt); System.out.println(sb.toString()); } private static void bfs(int type, int sx, int sy) { Queue<Integer> q = new LinkedList(); visited[sx][sy] = true; q.add(sx); q.add(sy); while(!q.isEmpty()) { int x = q.poll(); int y = q.poll(); for(int d = 0; d < 4; d++) { int nx = x + dirs[d][0]; int ny = y + dirs[d][1]; if(isIn(nx,ny) && !visited[nx][ny]) { if(type == 1) { if(map[x][y] == map[nx][ny]) { q.add(nx); q.add(ny); visited[nx][ny] = true; } }else { if((map[x][y] < 3 && map[nx][ny] < 3) || (map[x][y] == 3 && map[nx][ny] == 3)) { q.add(nx); q.add(ny); visited[nx][ny] = true; } } } } }//while } private static boolean isIn(int x, int y) { if(x >= 0 && x < N && y >=0 && y < N) { return true; } return false; } }
[ "pucca94@naver.com" ]
pucca94@naver.com
b964296292df63746f056a03d343d6f1477dff05
bcfe402b833b3008d415539315509bf3d28878bc
/service-verification-code/src/main/java/com/golike/serviceverificationcode/service/VerifyCodeService.java
dc5b9d37790625fff18457883500b0d2bc44acba
[]
no_license
muzhenpeng-1998/online-taxi-three
ffff8a849fbeb052fc552832e15401c6eafb3ef0
f45386710693cdbc3f20895ce6fe1c51b31fe994
refs/heads/master
2023-03-28T16:22:13.078456
2021-03-28T00:51:31
2021-03-28T00:51:31
351,071,385
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.golike.serviceverificationcode.service; import com.golike.internalcommon.dto.ResponseResult; import com.golike.internalcommon.dto.serviceverificationcode.response.VerifyCodeResponse; /** * @author yueyi2019 */ public interface VerifyCodeService { /** * 根据身份和手机号生成验证码 * @param identity * @param phoneNumber * @return */ public ResponseResult<VerifyCodeResponse> generate(int identity , String phoneNumber); /** * 校验身份,手机号,验证码的合法性 * @param identity * @param phoneNumber * @param code * @return */ public ResponseResult verify(int identity,String phoneNumber,String code); }
[ "zhiwei741@icloud.com" ]
zhiwei741@icloud.com
aa8504d09e9d47a939a3bb3e97e0984a52136981
e3a9847204ab5eff47883cef0d505f84a5cb9ae4
/Aula10/app/src/main/java/pt/ipbeja/diogopm/aula10/CreateNoteActivity.java
14855e036a006ce38cd6d3e92ede096ef2e378fe
[]
no_license
GaveMasterXX/ANDROID
9486aa79f158da01f43bbe78d97d4baf8bd00ccf
26580bdf1bf93b1b127d9401fc0c25c6b1b09f2e
refs/heads/master
2020-03-29T22:04:09.446276
2019-01-25T15:05:41
2019-01-25T15:05:41
150,401,546
0
0
null
null
null
null
UTF-8
Java
false
false
3,758
java
package pt.ipbeja.diogopm.aula10; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.os.AsyncTask; import android.os.Bundle; import android.provider.MediaStore; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.FirebaseFirestore; import java.io.File; import pt.ipbeja.diogopm.aula10.data.Note; import pt.ipbeja.diogopm.aula10.data.NoteDatabase; import pt.ipbeja.diogopm.aula10.utils.ImageUtils; public class CreateNoteActivity extends AppCompatActivity { private static final int IMAGE_CAPTURE_REQUEST_CODE = 1; private EditText noteTitleEditText; private EditText noteDescriptionEditText; private ImageView notePhoto; private byte[] thumbnailBytes; public static void start(Context context) { Intent starter = new Intent(context, CreateNoteActivity.class); context.startActivity(starter); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_create_note); this.noteTitleEditText = findViewById(R.id.note_title); this.noteDescriptionEditText = findViewById(R.id.note_description); this.notePhoto = findViewById(R.id.note_picture); } public void onTakePictureClick(View view) { takePicture(); } private void takePicture() { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(takePictureIntent, IMAGE_CAPTURE_REQUEST_CODE); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == IMAGE_CAPTURE_REQUEST_CODE && resultCode == RESULT_OK) { Bundle extras = data.getExtras(); Bitmap imageBitmap = (Bitmap) extras.get("data"); this.thumbnailBytes = ImageUtils.getBytesFromBitmap(imageBitmap); notePhoto.setImageBitmap(imageBitmap); } } public void onSaveNoteClick(View view) { // todo validate field (including photo) ... Note note = new Note( noteTitleEditText.getText().toString(), noteDescriptionEditText.getText().toString(), thumbnailBytes); new SaveNoteTask().execute(note); } private void uploadNote(Note note) { // todo save note to Firebase-Firestore and photo bytes to Firebase-Storage (called on SaveNoteTask#onPostExecute) FirebaseFirestore.getInstance() .collection("notes") .add(note) .addOnSuccessListener(this, new OnSuccessListener<DocumentReference>() { @Override public void onSuccess(DocumentReference documentReference) { finish(); } }); } private class SaveNoteTask extends AsyncTask<Note, Void, Note> { @Override protected Note doInBackground(Note... notes) { Note note = notes[0]; long id = NoteDatabase.getInstance(getApplicationContext()) .noteDao() .insert(note); note.setId(id); return note; } @Override protected void onPostExecute(Note note) { // todo upload note to Firebase-Firestore and image to Firebase-Storage uploadNote(note); } } }
[ "tiago_vampiro1994@hotmail.com" ]
tiago_vampiro1994@hotmail.com
23fef3c2d76d6b367b0ac993c9a545dda964a23b
4a84ec0deef975d1fd64a207ffc64d545a0d7f9b
/src/com/java/ocp/chapter4/stream/TerminalOperaionsDemo.java
15ae7a929e6ad28547e92be959562961c75776c8
[]
no_license
erickjaucian/OCP
0dc258a06073631d32e8a2d30f5b7324ae90e0a8
a440fdf0f238c5ee58ce64fa960539cb21b96101
refs/heads/master
2020-03-30T20:25:15.915690
2018-10-15T14:59:11
2018-10-15T14:59:11
151,577,435
0
0
null
null
null
null
UTF-8
Java
false
false
4,694
java
package com.java.ocp.chapter4.stream; import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.TreeSet; import java.util.function.BinaryOperator; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; public class TerminalOperaionsDemo { public static void main(String[] args) { Stream<String> stream = Stream.of("w","o","l","f"); String s = stream.collect(StringBuffer::new, StringBuffer::append, StringBuffer::append).toString(); //System.out.println(s); collectSample(); } public static void countSample() { //count Stream<String> countStream = Stream.of("gorilla", "monkey", "bonobo"); System.out.println(countStream.count()); Stream<Double> doubleStream = Stream.generate(Math::random); System.out.println(doubleStream.count()); } public static void minMaxSample() { //min and max Stream<String> stream1 = Stream.of("monkey", "ape", "bonobo"); Optional<String> min = stream1.min((s1, s2) -> s1.length()-s2.length()); min.ifPresent(System.out::println); Stream<String> stream2 = Stream.of("monkey", "monkyy", "bonobo"); Optional<String> max = stream2.max((s1, s2) -> s1.length()-s2.length()); max.ifPresent(System.out::println); } public static void findAnyFindFirstSample() { //findAny findFirst Stream<String> s = Stream.of("gorilla", "gorilla", "bonobo"); Stream<String> infinite = Stream.generate(() -> "chimp"); //s.findFirst().ifPresent(System.out::println); // monkey //infinite.findAny().ifPresent(System.out::println); // chimp } public static void anyMatchAllMatchNoneMatchSample() { //anyMatch allMatch noneMatch List<String> list = Arrays.asList("monkey", "2", "chimp"); Stream<String> infinite2 = Stream.generate(() -> "chimp"); Predicate<String> pred = x -> Character.isLetter(x.charAt(0)); //System.out.println(list.stream().anyMatch(pred)); // true //System.out.println(list.stream().allMatch(pred)); // false //System.out.println(list.stream().noneMatch(pred)); // false //System.out.println(infinite2.anyMatch(pred)); // true } public static void forEachSample() { //forEach Stream<String> stream3 = Stream.of("Monkey", "Gorilla", "Bonobo"); //stream3.forEach(System.out::print); // MonkeyGorillaBonobo } public static void reduceSample() { //reduce String[] array = new String[] { "w", "o", "l", "f" }; String result = ""; for (String string: array) result = result + string; //System.out.println(result); //T reduce(T paramT, BinaryOperator<T> paramBinaryOperator); --- (1) Stream<String> streamSample1 = Stream.of("w", "o", "l", "f"); String word1 = streamSample1.reduce("", (string, c) -> string + c); System.out.println(word1); // wolf Stream<String> streamSample2 = Stream.of("w", "o", "l", "f"); String word2 = streamSample2.reduce("", String::concat); System.out.println(word2); // wolf Stream<Integer> streamSample3 = Stream.of(3, 5, 6); System.out.println(streamSample3.reduce(1, (a, b) -> a*b)); BinaryOperator<Integer> op = (a, b) -> a * b; Stream<Integer> empty = Stream.empty(); Stream<Integer> oneElement = Stream.of(3); Stream<Integer> threeElements = Stream.of(3, 5, 6); //Optional<T> reduce(BinaryOperator<T> paramBinaryOperator); --- (2) empty.reduce(op).ifPresent(System.out::print); // no output oneElement.reduce(op).ifPresent(System.out::print); // 3 threeElements.reduce(op).ifPresent(System.out::print); // 90 //<U> U reduce(U paramU, BiFunction<U, ? super T, U> paramBiFunction, BinaryOperator<U> paramBinaryOperator); BinaryOperator<Integer> op1 = (a, b) -> a * b; Stream<Integer> stream = Stream.of(3, 5, 6); System.out.println(stream.reduce(1, op1, op1)); // 90 } public static void collectSample() { Stream<String> stream1 = Stream.of("w", "o", "l", "f"); StringBuilder word = stream1.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append); System.out.println(word); Stream<String> stream2 = Stream.of("w", "o", "l", "f"); TreeSet<String> set2 = stream2.collect(TreeSet::new, TreeSet::add, TreeSet::addAll); System.out.println(set2); // [f, l, o, w] Stream<String> stream3 = Stream.of("w", "o", "l", "f"); TreeSet<String> set3 = stream3.collect(Collectors.toCollection(TreeSet::new)); System.out.println(set3); // [f, l, o, w] Stream<String> stream4 = Stream.of("w", "o", "l", "f"); Set<String> set4 = stream4.collect(Collectors.toSet()); System.out.println(set4); // [f, w, l, o] } }
[ "erick.del.rey5@gmail.com" ]
erick.del.rey5@gmail.com
1956f914f7f63167712ae74e1c2dc8f6b3590259
5cde1b7939890a3984bb4072ce2a2c69e33bc37d
/src/main/java/com/virtual/teacher/controllers/HomepageController.java
2075c7ecedf1749d3e342c49aa54ac7f6158cd97
[]
no_license
vikiiism/virtualteacher
433adb8692ea78753cdfc9c72128612186101624
e3c7b5711f3edf8f82dbce95895453e583b2c0e4
refs/heads/master
2022-10-17T04:34:10.111433
2020-06-17T22:13:06
2020-06-17T22:13:06
273,086,021
0
0
null
null
null
null
UTF-8
Java
false
false
1,589
java
package com.virtual.teacher.controllers; import com.virtual.teacher.models.User; import com.virtual.teacher.services.ContractService; import com.virtual.teacher.services.interfaces.CourseService; import com.virtual.teacher.services.interfaces.UserService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller @RequiredArgsConstructor(onConstructor = @__(@Autowired)) public class HomepageController { private final CourseService courseService; private final UserService userService; private final ContractService contractService; @GetMapping("/index") public String showHomePage(Model model) { return displayHomePage(model); } @GetMapping("/") public String showHomePageSecond(Model model) { return displayHomePage(model); } private String displayHomePage(Model model) { try { User loggedUser = contractService.currentUser(); if (loggedUser != null) { model.addAttribute("loggedUser", loggedUser); model.addAttribute("path", "/photos/" + userService.getLastPhoto(loggedUser).getFileName()); } } catch (IllegalArgumentException e) { model.addAttribute("exceptionMessage", e.getMessage()); } model.addAttribute("allCourses", courseService.getTopRated()); return "index"; } }
[ "viktoriyageorge@gmail.com" ]
viktoriyageorge@gmail.com
05ad92b7bdc3e1c08bf5aebf27cfae5f39c92d04
ac809c1aaed1d894b5540f98121c420e5322b8a6
/src/com/PodstawyProgramowania/Lista3/Zadanie2/MenuMain.java
ba4f5071671f0d116fb018672f2eb4c07b295ae7
[]
no_license
marcinkokoszka/PodstawyProgramowania
3845cad2acca54e8a66e3112791e0e5b262acd2a
e308dfb1b6d6e19760cc73981bee2ae9d126d9e4
refs/heads/master
2021-01-11T01:29:38.768194
2017-03-08T16:41:17
2017-03-08T16:41:17
70,726,712
0
0
null
null
null
null
UTF-8
Java
false
false
1,909
java
package com.PodstawyProgramowania.Lista3.Zadanie2; import java.io.IOException; import java.util.Scanner; /** * Created by kokoseq on 18.11.2016. */ public class MenuMain { static void menu() { menu: while (true) { System.out.println("MENU:\n1. Wyświetl wszystkich pracowników\n2. Wyszukaj pracowników\n3. Dodaj pracownika\n4. Zapisz listę pracowników\n5. Wczytaj listę pracowników\n6. Wyjście z programu"); Scanner s = new Scanner(System.in); int choice = s.nextInt(); switch (choice) { case 1: int i = 1; for (Employee e : MainProgram.employees.array) { System.out.println("" + i + ". " + e); i++; } System.out.println(); break; case 2: MenuSearch.Menu(); break; case 3: MenuAddEmployee.menu(); break; case 4: try { FileSaveLoad.saveToFile(MainProgram.employees); } catch (IOException e) { System.out.println("Nie można zapisać pliku\n"); } System.out.println("Lista pracowników zapisana\n"); break; case 5: try { MainProgram.employees = FileSaveLoad.readFromFile(); } catch (IOException | ClassNotFoundException e) { System.out.println("Nie można wczytać pliku\n"); } System.out.println("Lista pracowników wczytana\n"); break; case 6: break menu; } } } }
[ "marcin.kokoszka@gmail.com" ]
marcin.kokoszka@gmail.com
86e214e020f586407a959def04be06f1ba8de4a4
6f56033565d77f315d46fc6e7ebdfb9ff77efd55
/src/xx/xxclass/XXJavaClass.java
d34ffc3c9e80969c686de661ad883be200b84997
[]
no_license
xicalango/XXClass
9b9e56343a3b7d55386d3d6220b455d290ec90ce
330a8c12d1bc6ee77b7bbdd1db2d0d5bd32add16
refs/heads/master
2018-12-29T20:57:31.799243
2015-06-11T22:32:50
2015-06-11T22:32:50
37,289,628
0
0
null
null
null
null
UTF-8
Java
false
false
2,182
java
package xx.xxclass; public class XXJavaClass extends XXClass { XXJavaClass(XXClassManager classManager, String name) { super(classManager, name); setToJavaObject((mgr, self, pars) -> ((XXJavaInstance) self).getJavaValue()); defFn("+", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() + pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("-", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() - pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("*", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() * pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("/", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() / pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("<", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() < pars[0].asJavaObject(Number.class).doubleValue()); }); defFn(">", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() > pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("==", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() == pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("<=", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() <= pars[0].asJavaObject(Number.class).doubleValue()); }); defFn(">=", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Number.class).doubleValue() >= pars[0].asJavaObject(Number.class).doubleValue()); }); defFn("..", (mgr, self, pars) -> { return mgr.$$(self.asJavaObject(Object.class).toString() + pars[0].asJavaObject(Object.class).toString()); }); redefFn("__str__", old -> (mgr, self, pars) -> { return mgr.$$(String.valueOf(self.asJavaObject(Object.class))); }); } XXJavaInstance newInstance(Object o) { return new XXJavaInstance(this, o); } }
[ "weldale@gmail.com" ]
weldale@gmail.com
4ad7d7da2739440f171523b4279a022157a345dd
a3f3fde7d9ff68ac5bc323d7c8005dcac4ec7c4d
/spring-boot-jdbc/src/main/java/com/jeiker/jdbc/service/UserService.java
0089d343f0f98d168ced61526d7de72a7ca0e1b2
[ "MIT" ]
permissive
WKQ89/spring-boot2
6a4b0d4afeb3e1f7ded1cc70cbb87b2411c58d87
17c90330576836db78df100b384fac0013c6c6b3
refs/heads/master
2022-04-01T17:59:48.118374
2020-01-03T02:52:36
2020-01-03T02:52:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
873
java
package com.jeiker.jdbc.service; import com.jeiker.jdbc.model.User; import java.util.List; /** * Description: 用户 Service * User: jeikerxiao * Date: 2019/1/9 2:29 PM */ public interface UserService { /** * 保存用户 * * @param user */ Boolean saveUser(User user); /** * 查询所有用户 * * @return */ List<User> getAllUser(); /** * 查询用户 * * @param userId * @return */ User getUser(Long userId); /** * 根据用户名查询用户 * * @param name * @return */ User getUserByName(String name); /** * 删除用户 * * @param userId * @return */ Boolean deleteUser(Long userId); /** * 修改用户 * * @param user * @return */ Boolean updateUser(User user); }
[ "jeiker@126.com" ]
jeiker@126.com
3340f2cf82487918978638877206af03fc2cd8d2
686acd7bb78f8e2675144fe723f8e178aa2f1307
/tomcat.8084/work/Tomcat/localhost/ROOT/org/apache/jsp/index_jsp.java
f3c2bae89e5a339c02fa36f9ab530cc9254d109b
[]
no_license
FernandoArellano/java2eeinterview
cb1f9b2c634734c79a43a1d4dad09db8fc7297a9
cb2103c94a716b38578db6ee29bfc969cfa8a9d0
refs/heads/master
2020-04-13T03:18:45.213522
2018-12-23T22:16:35
2018-12-23T22:16:35
162,927,542
0
0
null
null
null
null
UTF-8
Java
false
false
11,106
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/8.0.28 * Generated at: 2018-12-23 21:43:14 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { int x=0; private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; static { _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(2); _jspx_dependants.put("jar:file:/C:/Users/Fernando_Arellano/.m2/repository/jstl/jstl/1.2/jstl-1.2.jar!/META-INF/c.tld", Long.valueOf(1153403082000L)); _jspx_dependants.put("file:/C:/Users/Fernando_Arellano/.m2/repository/jstl/jstl/1.2/jstl-1.2.jar", Long.valueOf(1545547908069L)); } private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = null; } private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest; private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); } public void _jspDestroy() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release(); } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final java.lang.String _jspx_method = request.getMethod(); if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD"); return; } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n"); out.write("<!-- page directive errorPage, isErrorPage, import, isElIgnored, session, contentType, language-->\r\n"); out.write("<!-- taglib import tag library-->\r\n"); out.write("<!-- include directive, includes a file at compilation-->\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write(" <title>Menu</title>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); out.write("\r\n"); if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return; out.write("\r\n"); out.write("<br>\r\n"); out.write("<p>Select Team</p>\r\n"); out.write("<form action=\"setTeam\" method=\"post\">\r\n"); out.write("<select name=\"teamName\">\r\n"); out.write(" <option value=\"America\">America</option>\r\n"); out.write(" <option value=\"Chivas\">Chivas</option>\r\n"); out.write(" <option value=\"Tigres\">Tigres</option>\r\n"); out.write("</select>\r\n"); out.write(" <input type=\"submit\" value=\"Select Team\">\r\n"); out.write("</form>\r\n"); out.write("<a href=\"/addPlayer\">Add Player</a>\r\n"); out.write("<a href=\"/seePlayers\">See Players for team</a>\r\n"); out.write("<br><br>\r\n"); out.write("\r\n"); out.write("Declaration\r\n"); out.write("\r\n"); out.write("<br>\r\n"); out.write("Scriptlet\r\n"); out.write("\r\n"); String cadena = "soy una cadena en scriptlet"; x++; out.write("\r\n"); out.write("<br>\r\n"); out.write("Expression\r\n"); out.write("<br>\r\n"); out.print( cadena.toUpperCase()); out.write('\r'); out.write('\n'); out.print( x); out.write("\r\n"); out.write("<br><br>\r\n"); out.write("\r\n"); out.write("jsp:\r\n"); out.write("<br>\r\n"); com.virtualpairprogrammers.domain.Equipo equipo = null; equipo = (com.virtualpairprogrammers.domain.Equipo) _jspx_page_context.getAttribute("equipo", javax.servlet.jsp.PageContext.PAGE_SCOPE); if (equipo == null){ equipo = new com.virtualpairprogrammers.domain.Equipo(); _jspx_page_context.setAttribute("equipo", equipo, javax.servlet.jsp.PageContext.PAGE_SCOPE); out.write("\r\n"); out.write(" "); org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("equipo"), "name", "America", null, null, false); out.write("\r\n"); out.write(" "); org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("equipo"), "championships", "13", null, null, false); out.write("\r\n"); out.write(" "); org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("equipo"), "fundation", "1916", null, null, false); out.write('\r'); out.write('\n'); } out.write('\r'); out.write('\n'); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${equipo}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("\r\n"); out.write("\r\n"); out.write("<br>\r\n"); out.write("jsp:getProperty\r\n"); out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.virtualpairprogrammers.domain.Equipo)_jspx_page_context.findAttribute("equipo")).getName()))); out.write("\r\n"); out.write("<br>\r\n"); out.write("\r\n"); org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "americaCampeon.jsp", out, false); out.write("\r\n"); out.write("<br>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("</body>\r\n"); out.write("</html>\r\n"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f0.setParent(null); // /index.jsp(19,0) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${teamName !=null}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag(); if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write(" Team "); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${teamName}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write(" selected\r\n"); int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return false; } }
[ "fernando_arellano@epam.com" ]
fernando_arellano@epam.com
84003291f1ac55cb80893ce62ff578bcb5d5a2e5
090242a5b9d892f34178b090ae6f50fc6c2d7ed6
/classes/org/w3c/dom/html/HTMLScriptElement.java
8e5cd5b05d2e7ce9920a1256745b2afa2f1ba89a
[]
no_license
realityforge/q2java
e0097bce832600cc32ae6836139f93a2933d6542
dc67c81629e45bc69ddbd4b834f4e09e87cd30e0
refs/heads/master
2022-04-20T18:45:34.346489
2015-06-24T21:27:04
2015-06-24T21:27:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,670
java
/* * Copyright (c) 1999 World Wide Web Consortium, * (Massachusetts Institute of Technology, Institut National de Recherche * en Informatique et en Automatique, Keio University). * All Rights Reserved. http://www.w3.org/Consortium/Legal/ */ package org.w3c.dom.html; /** * Script statements. See the SCRIPT element definition in HTML 4.0. */ public interface HTMLScriptElement extends HTMLElement { /** * The script content of the element. */ public String getText(); public void setText(String text); /** * Reserved for future use. */ public String getHtmlFor(); public void setHtmlFor(String htmlFor); /** * Reserved for future use. */ public String getEvent(); public void setEvent(String event); /** * The character encoding of the linked resource. See the charset attribute * definition in HTML 4.0. */ public String getCharset(); public void setCharset(String charset); /** * Indicates that the user agent can defer processing of the script. See * the defer attribute definition in HTML 4.0. */ public boolean getDefer(); public void setDefer(boolean defer); /** * URI designating an external script. See the src attribute definition in * HTML 4.0. */ public String getSrc(); public void setSrc(String src); /** * The content type of the script language. See the type attribute definition * in HTML 4.0. */ public String getType(); public void setType(String type); }
[ "bp@barryp.org" ]
bp@barryp.org
a4abd4a55fd08f974c87bdb0d34218422ba6fc0a
dcfcf948230feec43698c401158d037f5191dc25
/src/org/openuap/cms/resource/action/UploadAction.java
a84d46173bd4039f2a360689fc7c908cda27bd27
[ "Apache-2.0" ]
permissive
orangeforjava/ocms
32ee4894cbe60b2f70be4714713950c44ce64289
a0fe00a7cd26276f29b6defa8931fc09b0209328
refs/heads/master
2021-05-27T12:24:23.459328
2013-09-10T09:28:00
2013-09-10T09:28:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,455
java
/* * Copyright 2005-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.openuap.cms.resource.action; import java.awt.Dimension; import java.io.File; import java.util.Map; import java.util.StringTokenizer; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.openuap.base.util.ControllerHelper; import org.openuap.base.util.FileUtil; import org.openuap.base.util.StringUtil; import org.openuap.cms.config.CMSConfig; import org.openuap.cms.core.action.AdminAction; import org.openuap.cms.resource.manager.ResourceManager; import org.openuap.cms.resource.model.Resource; import org.openuap.cms.util.file.PathNameStrategy; import org.openuap.cms.util.file.impl.DatePathNameStrategy; import org.openuap.util.ImageUtil; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; /** * <p> * 资源上传控制器. * </p> * * <p> * $Id: UploadAction.java 4026 2011-03-22 14:58:42Z orangeforjava $ * </p> * * @author Joseph * @version 1.0 */ public class UploadAction extends AdminAction { protected String jsinfoViewName; protected PathNameStrategy pathNameStrategy; protected ResourceManager resourceManager; protected String uploadFileViewName; public UploadAction() { initDefaultViewName(); } protected void initDefaultViewName() { jsinfoViewName = "/plugin/cms/base/screens/jsinfo.html"; uploadFileViewName = "/plugin/cms/base/screens/resource/resource_upload.html"; } protected ModelAndView beforeUploadFile(HttpServletRequest request, HttpServletResponse response, ControllerHelper helper, Map model) { return null; } protected ModelAndView afterUploadFile(HttpServletRequest request, HttpServletResponse response, ControllerHelper helper, Map model) { return null; } public ModelAndView doUploadFile(HttpServletRequest request, HttpServletResponse response, ControllerHelper helper, Map model) { // // ModelAndView mv1 = beforeUploadFile(request, response, helper, model); if (mv1 != null) { return mv1; } // ModelAndView mv = new ModelAndView(jsinfoViewName, model); String type = request.getParameter("type"); String category = request.getParameter("category"); String nodeId = request.getParameter("nodeId"); String changeName = request.getParameter("changeName"); String msgView = request.getParameter("msgView"); String customCategory = request.getParameter("customCategory"); if (msgView == null) { msgView = ""; } if (nodeId == null) { nodeId = "0"; } if (customCategory == null) { customCategory = ""; } model.put("msgView", msgView); try { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; // MultipartFile multipartFile = multipartRequest.getFile("uploadFile"); String contentType = FileUtil.getExtension(multipartFile.getOriginalFilename()); // is valid type if (!isValidFileType(category, contentType)) { String msgType = "error"; String msg = "请选择正确的文件类型-(" + getAcceptFileType(category) + ")"; model.put("msgType", msgType); model.put("msg", msg); return mv; } // dir create,auto mode,every dir not more than 100 files // or simple the // year(4)/month(2)/day(2)/type+year(4)+month(2)+day(2)+hour(2)+minute(2)+second(2)+ms(2) if (pathNameStrategy == null) { pathNameStrategy = new DatePathNameStrategy(); pathNameStrategy.setUserName(this.getUser().getName()); } // String pathName = pathNameStrategy.getPathName(); File dir = makeDir(category + File.separator + pathName); // transfer the file String destFileName = pathNameStrategy.getFileName(category); String fileName = destFileName + "." + FileUtil.getExtension(multipartFile.getOriginalFilename()); File file = new File(dir, fileName); // add to the database Resource rs = new Resource(); rs.setCategory(category); // get the now seconds long now = System.currentTimeMillis(); // // Integer inow = new Integer(String.valueOf(now)); rs.setCreationDate(new Long(now)); rs.setModifiedDate(new Long(now)); Long nid; if (nodeId != null) { nid = new Long(nodeId); } else { nid = new Long(0L); } rs.setNodeId(nid); rs.setCreationUserId(this.getUser().getUserId()); // if (category.equals("img")) { Dimension dm = ImageUtil.getDimension(multipartFile.getInputStream()); // if (dm != null) { String info = dm.width + "*" + dm.height; rs.setInfo(info); } else { rs.setInfo(""); } } else { rs.setInfo(""); } // rs.setName(destFileName + "." + FileUtil.getExtension(multipartFile.getOriginalFilename())); rs.setParentId(new Long(0)); long size = multipartFile.getSize(); size = size / 1024; // b->kb if (size == 0) { size = 1; } Integer kbsize = new Integer(String.valueOf(size)); rs.setSize(kbsize); rs.setSrc(" "); rs.setType(new Integer(type)); rs.setTitle(FileUtil.getFileName(multipartFile.getOriginalFilename())); rs.setPath(category + "/" + pathName + "/" + destFileName + "." + FileUtil.getExtension(multipartFile.getOriginalFilename())); // rs.setDownloadTimes(new Integer(0)); rs.setCustomCategory(customCategory); resourceManager.addResource(rs); // multipartFile.transferTo(file); // String msgType = "success"; String msg = "上传文件成功," + "文件已经成功改名为:" + fileName; model.put("msgType", msgType); model.put("msg", msg); return mv; } catch (Exception e) { e.printStackTrace(); String msgType = "error"; String msg = "上传文件出现意外错误:" + e.getMessage(); model.put("msgType", msgType); model.put("msg", msg); return mv; } } /** * show the editor upload dialog. * * @param request * * @param response * * @param helper * * @param model * * @return */ public ModelAndView doShowUploadDialog(HttpServletRequest request, HttpServletResponse response, ControllerHelper helper, Map model) { ModelAndView mv = new ModelAndView(uploadFileViewName, model); String nodeId = request.getParameter("nodeId"); String category = request.getParameter("category"); model.put("nodeId", nodeId); model.put("category", category); return mv; } protected File makeDir(String path) { String rootDir = CMSConfig.getInstance().getResourceRootPath(); String mypath = rootDir + File.separator + path; mypath = StringUtil.normalizePath(mypath); File dir = new File(mypath); if (!dir.exists() || dir.isFile()) { dir.mkdirs(); } return dir; } /** * * @param type * String * @param contentType * String * @return boolean */ protected boolean isValidFileType(String type, String contentType) { // String acceptTypes = getAcceptFileType(type); if (acceptTypes != null) { StringTokenizer tk = new StringTokenizer(acceptTypes, "|"); while (tk.hasMoreTokens()) { String acType = tk.nextToken(); if (contentType.indexOf(acType) > -1) { return true; } } return false; } return false; } protected String getAcceptFileType(String type) { if (type != null) { if (type.equals("img")) { String acceptTypes = CMSConfig.getInstance().getUploadFileImageType(); return acceptTypes; } else if (type.equals("flash")) { String acceptTypes = CMSConfig.getInstance().getUploadFileFlashType(); return acceptTypes; } else if (type.equals("attach")) { String acceptTypes = CMSConfig.getInstance().getUploadFileAttachType(); return acceptTypes; } else if (type.equals("sattach")) { String acceptTypes = CMSConfig.getInstance().getUploadFileAttachType(); return acceptTypes; }else if(type.equals("media")) { String acceptTypes = CMSConfig.getInstance().getUploadFileMediaType(); return acceptTypes; } } return null; } protected String getFullPath() { return ""; } public void setJsinfoViewName(String jsinfoViewName) { this.jsinfoViewName = jsinfoViewName; } public void setPathNameStrategy(PathNameStrategy pathNameStrategy) { this.pathNameStrategy = pathNameStrategy; } public void setResourceManager(ResourceManager resourceManager) { this.resourceManager = resourceManager; } public void setUploadFileViewName(String uploadFileViewName) { this.uploadFileViewName = uploadFileViewName; } public ResourceManager getResourceManager() { return this.resourceManager; } public String getJsinfoViewName() { return jsinfoViewName; } public PathNameStrategy getPathNameStrategy() { return pathNameStrategy; } public String getUploadFileViewName() { return uploadFileViewName; } }
[ "juweiping@qq.com" ]
juweiping@qq.com
a5afad1d8dd6ba8caf6e9bc17bc886614d4b5595
2b95b1bfcad920cf5957dc279e7b3d572dff65f1
/web-demo-project/src/test/java/com/example/demo/WebDemoProjectApplicationTests.java
62019ac437086e15c1c703406bdbe125df1455ef
[]
no_license
iamSeulgii/web-dev-demo
dad00a3a2a8180a2dd0169c99b368a570e7204d3
195faf65696b64cd96a9d860fe8be17214cd66c9
refs/heads/master
2023-08-11T06:14:55.623006
2021-10-07T04:55:03
2021-10-07T04:55:03
411,690,715
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.example.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class WebDemoProjectApplicationTests { @Test void contextLoads() { } }
[ "ebbi33@hanwha.com" ]
ebbi33@hanwha.com
4e76c2d33336355d78cc0b1ac068b5c4442cc88a
1c802ccd42f848a9863d591c37d732a1f1e647cc
/base.api/src/test/java/org/elastos/contract/Greeter.java
cb3fc5143eb5753662647b745e7ecaf70f177bc5
[]
no_license
elastos/Elastos.ORG.Wallet.Service
c8e84a5edaa385e5628bad7def36ec78abab891b
55dfbf41d3fecaf325af4f6df7a4fb0e91ba0af6
refs/heads/master
2021-07-12T00:15:27.813002
2020-06-03T04:04:45
2020-06-03T04:06:16
139,665,814
0
4
null
null
null
null
UTF-8
Java
false
false
5,003
java
package org.elastos.contract; import java.math.BigInteger; import java.util.Arrays; import java.util.Collections; import org.web3j.abi.FunctionEncoder; import org.web3j.abi.TypeReference; import org.web3j.abi.datatypes.Function; import org.web3j.abi.datatypes.Type; import org.web3j.abi.datatypes.Utf8String; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.RemoteCall; import org.web3j.protocol.core.methods.response.TransactionReceipt; import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; /** * <p>Auto generated code. * <p><strong>Do not modify!</strong> * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update. * * <p>Generated with web3j version 3.5.0. */ public class Greeter extends Contract { private static final String BINARY = "608060405234801561001057600080fd5b506040516102ec3803806102ec83398101604052805160008054600160a060020a0319163317905501805161004c906001906020840190610053565b50506100ee565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061009457805160ff19168380011785556100c1565b828001600101855582156100c1579182015b828111156100c15782518255916020019190600101906100a6565b506100cd9291506100d1565b5090565b6100eb91905b808211156100cd57600081556001016100d7565b90565b6101ef806100fd6000396000f30060806040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b58114610050578063cfae321714610067575b600080fd5b34801561005c57600080fd5b506100656100f1565b005b34801561007357600080fd5b5061007c61012e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100b657818101518382015260200161009e565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60005473ffffffffffffffffffffffffffffffffffffffff1633141561012c5760005473ffffffffffffffffffffffffffffffffffffffff16ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156101b95780601f1061018e576101008083540402835291602001916101b9565b820191906000526020600020905b81548152906001019060200180831161019c57829003601f168201915b50505050509050905600a165627a7a7230582087475dd9f57b9d96b47b6c1482ebda58be5ccb75dd6c1d4a0b85074e5f6adb400029"; public static final String FUNC_KILL = "kill"; public static final String FUNC_GREET = "greet"; protected Greeter(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } protected Greeter(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } public RemoteCall<TransactionReceipt> kill() { final Function function = new Function( FUNC_KILL, Arrays.<Type>asList(), Collections.<TypeReference<?>>emptyList()); return executeRemoteCallTransaction(function); } public RemoteCall<String> greet() { final Function function = new Function(FUNC_GREET, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public static RemoteCall<Greeter> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String _greeting) { String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(_greeting))); return deployRemoteCall(Greeter.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor); } public static RemoteCall<Greeter> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String _greeting) { String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(_greeting))); return deployRemoteCall(Greeter.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor); } public static Greeter load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { return new Greeter(contractAddress, web3j, credentials, gasPrice, gasLimit); } public static Greeter load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { return new Greeter(contractAddress, web3j, transactionManager, gasPrice, gasLimit); } }
[ "1406629722@qq.com" ]
1406629722@qq.com
0f87f57f30e34def214a2520ba3ef7cda310c14f
456689979987458788ede43c508b1e3f06fb56bc
/src/main/java/com/socodd/entities/Societe.java
f1ca918b9ce2e63c409d7e700b0d14ea17f0266d
[]
no_license
said321/socodd
cff313e93e35342791d25bbc98e6721071c6dd82
caeb1829fedea3c2447e4d3bcdc1406f6b4fa160
refs/heads/master
2020-03-23T21:36:13.081992
2018-09-12T05:08:48
2018-09-12T05:08:48
141,448,187
0
0
null
null
null
null
UTF-8
Java
false
false
4,387
java
package com.socodd.entities; // Generated 7 sept. 2018 13:04:21 by Hibernate Tools 3.6.0.Final import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Id; import javax.persistence.Table; /** * Societe generated by hbm2java */ @Entity @Table(name = "societe", catalog = "db_socodd") public class Societe implements java.io.Serializable { private Integer id; private String code; private String activite; private String adresse; private String agrement; private String codeFiscal; private String codeImpExp; private String compteContrib; private String email; private String telephone; private String fax; private String pays; private String raisonSociale; private String siteWeb; private String ville; public Societe() { } public Societe(String code, String activite, String adresse, String agrement, String codeFiscal, String codeImpExp, String compteContrib, String email, String telephone, String fax, String pays, String raisonSociale, String siteWeb, String ville) { this.code = code; this.activite = activite; this.adresse = adresse; this.agrement = agrement; this.codeFiscal = codeFiscal; this.codeImpExp = codeImpExp; this.compteContrib = compteContrib; this.email = email; this.telephone = telephone; this.fax = fax; this.pays = pays; this.raisonSociale = raisonSociale; this.siteWeb = siteWeb; this.ville = ville; } @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @Column(name = "code", nullable = false, length = 5) public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } @Column(name = "activite", nullable = false, length = 50) public String getActivite() { return this.activite; } public void setActivite(String activite) { this.activite = activite; } @Column(name = "adresse", nullable = false) public String getAdresse() { return this.adresse; } public void setAdresse(String adresse) { this.adresse = adresse; } @Column(name = "agrement", nullable = false, length = 50) public String getAgrement() { return this.agrement; } public void setAgrement(String agrement) { this.agrement = agrement; } @Column(name = "code_fiscal", nullable = false, length = 50) public String getCodeFiscal() { return this.codeFiscal; } public void setCodeFiscal(String codeFiscal) { this.codeFiscal = codeFiscal; } @Column(name = "code_imp_exp", nullable = false, length = 50) public String getCodeImpExp() { return this.codeImpExp; } public void setCodeImpExp(String codeImpExp) { this.codeImpExp = codeImpExp; } @Column(name = "compte_contrib", nullable = false, length = 50) public String getCompteContrib() { return this.compteContrib; } public void setCompteContrib(String compteContrib) { this.compteContrib = compteContrib; } @Column(name = "email", nullable = false, length = 50) public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } @Column(name = "telephone", nullable = false, length = 10) public String getTelephone() { return this.telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } @Column(name = "fax", nullable = false, length = 10) public String getFax() { return this.fax; } public void setFax(String fax) { this.fax = fax; } @Column(name = "pays", nullable = false, length = 50) public String getPays() { return this.pays; } public void setPays(String pays) { this.pays = pays; } @Column(name = "raison_sociale", nullable = false, length = 50) public String getRaisonSociale() { return this.raisonSociale; } public void setRaisonSociale(String raisonSociale) { this.raisonSociale = raisonSociale; } @Column(name = "site_web", nullable = false, length = 50) public String getSiteWeb() { return this.siteWeb; } public void setSiteWeb(String siteWeb) { this.siteWeb = siteWeb; } @Column(name = "ville", nullable = false, length = 50) public String getVille() { return this.ville; } public void setVille(String ville) { this.ville = ville; } }
[ "you@example.com" ]
you@example.com
54b06fc64e56190eee1da53ac89e60edcfc8c647
0c577256b135645f68d6af5388637e9e62e6aff3
/Rtc555Sdk/Rtc555Sdk/src/main/java/com/comcast/rtc555sdk/RtcNativeBridge.java
a4eca178f2ad0f7d9ccf8293a73757702e5a48ad
[ "MIT" ]
permissive
adline-st/555-rtc-android-sdk
dc3154e957c53765cfb4a91babb19e1313ea4e0e
251fcd63c3ffa459028b740e92bf9a461024aae4
refs/heads/master
2021-03-14T10:42:02.624342
2020-02-18T19:59:39
2020-02-18T19:59:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,169
java
package com.comcast.rtc555sdk; import androidx.annotation.NonNull; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import java.util.HashMap; import javax.annotation.Nonnull; public class RtcNativeBridge extends ReactContextBaseJavaModule{ private RtcNativeEventObserver observer; RtcNativeBridge(ReactApplicationContext reactContext) { super(reactContext); } RtcNativeBridge(ReactApplicationContext reactContext,RtcNativeEventObserver obj) { super(reactContext); this.observer = obj; } @Nonnull @Override public String getName() { return "RtcNativeBridge"; } @ReactMethod void onRtcConnectionStateChange(@NonNull String state) { observer.onRtcNativeEventConnectionStateChange(state); } @ReactMethod void onRtcConnectionError(@NonNull ReadableMap errorInfo) { HashMap errorInfoMap = ConversionUtil.toMap(errorInfo); observer.onRtcNativeEventConnectionError(errorInfoMap); } @ReactMethod void onRtcSessionStatus(@NonNull String status,String traceid) { observer.onRtcNativeEventSessionStatus(status,traceid); } @ReactMethod void onRtcSessionError(@NonNull ReadableMap errorInfo,String traceid) { HashMap errorInfoMap = ConversionUtil.toMap(errorInfo); observer.onRtcNativeEventSessionError(errorInfoMap, traceid); } @ReactMethod void onNotification(@NonNull ReadableMap notification) { HashMap notificationData = ConversionUtil.toMap(notification); observer.onRtcNativeEventNotification(notificationData); } @ReactMethod void onCallResponse(@NonNull String response){ observer.onRtcNativeEventCallSuccess(response); } @ReactMethod void onCallFailed(@NonNull ReadableMap errorInfo){ HashMap errorInfoMap = ConversionUtil.toMap(errorInfo); observer.onRtcNativeEventCallFailed(errorInfoMap); } @ReactMethod void onRejectSuccess(@NonNull String callId){ observer.onRtcNativeEventCallSuccess(callId); } @ReactMethod void onRejectFailed(@NonNull ReadableMap errorInfo){ HashMap errorInfoMap = ConversionUtil.toMap(errorInfo); observer.onRtcNativeEventCallFailed(errorInfoMap); } @ReactMethod void onCallMerged(@NonNull String callId){ observer.onRtcNativeEventCallMergeSuccess(callId); } public interface RtcNativeEventObserver{ void onRtcNativeEventConnectionStateChange(String connectionState); void onRtcNativeEventConnectionError(HashMap errorInfo); void onRtcNativeEventSessionStatus(String sessionStatus, String callId); void onRtcNativeEventSessionError(HashMap errorInfo, String callId); void onRtcNativeEventNotification(HashMap notfyData); void onRtcNativeEventCallSuccess(String response); void onRtcNativeEventCallFailed(HashMap errorInfo); void onRtcNativeEventCallMergeSuccess(String callId); } }
[ "harish.28gupta@gmail.com" ]
harish.28gupta@gmail.com