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
237180bc241a1496bfc5a1cd2f0f26ea84f1b560
0e6557a73a00f0684a9f40f7f300f78dd633379b
/app/src/main/java/com/febriaroosita/swt/RemoveInflectionalParticle.java
ef9448df9c9eed241ee639694c878506f7b446a7
[]
no_license
febriaroo/ieditor
6b031f7d00c160dce23dac81eeca7014d821558a
eaa4b31697fddf83390630bacfd93fed3dbfba02
refs/heads/master
2021-01-21T13:07:40.866586
2015-12-16T20:37:27
2015-12-16T20:37:27
42,501,497
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
package com.febriaroosita.swt; /** * Created by febria on 11/4/15. */ public class RemoveInflectionalParticle implements VisitorInterface { public void visit(CContext context) { String result = this.remove(context.currentWord.toLowerCase()); if (result != context.currentWord && !result.equals("")) { String removedPart = context.currentWord.replaceAll(result, ""); if (!removedPart.equals("")) { removalClass removal = new removalClass( this, context.currentWord, result, removedPart, "P" ); context.addRemoval(removal); context.currentWord = result; } } } public String remove(String word) { return word.replaceAll("-*(lah|kah|tah|pun)$", ""); } }
[ "febriaroosita@gmail.com" ]
febriaroosita@gmail.com
36376a496dbaaaa5a32b7227a2db20dfd48b8f8c
0731c2ca08057d9939e32255304c1f6ba7eb233a
/app/src/main/java/com/fantomsoftware/groupbudget/data/db/DBBudgetUsers.java
ab009bb6784bd282c35b79da6ba7ff361e1898e2
[]
no_license
FantomNexx/group-budget
972f833d43eae6543297c627fa991e4cbfdf85c0
d6b660f0c375d8aff438960fc6971806d08923ed
refs/heads/master
2021-01-22T03:54:33.135722
2017-05-26T06:46:35
2017-05-26T06:46:35
92,414,109
0
0
null
null
null
null
UTF-8
Java
false
false
6,090
java
package com.fantomsoftware.groupbudget.data.db; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteStatement; import android.util.SparseArray; import com.fantomsoftware.groupbudget.data.BudgetUser; import java.util.List; public class DBBudgetUsers{ //--------------------------------------------------------------------------- private DBHelper db_helper; private String tablename = "budgetusers"; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- public DBBudgetUsers( DBHelper db_helper ){ this.db_helper = db_helper; //Clear(); Init(); }//LoanDebtDB //--------------------------------------------------------------------------- private boolean Init(){ if( !db_helper.IsTableExists( tablename ) ){ CreateTable(); } return true; }//Init //--------------------------------------------------------------------------- private void CreateTable(){ String query = "create table " + tablename + " (" + "id integer primary key autoincrement," + "id_user integer," + "id_budget integer" + ");"; if( !db_helper.ExecuteSQL( query ) ){ return; }//if }//CreateTable //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- public int Add( BudgetUser item ){ ContentValues cv = new ContentValues(); cv.put( "id_user", item.id_user ); cv.put( "id_budget", item.id_budget ); int id = (int) db_helper.AddRow( tablename, cv ); if( id < 1 ){ return -1; } return id; }//Add //--------------------------------------------------------------------------- public boolean AddMultiple( List<BudgetUser> items ){ db_helper.Connect(); String sql = "INSERT INTO " + tablename + " (id_user, id_budget)" + " VALUES (?, ?)"; SQLiteDatabase db = db_helper.getDb(); db.beginTransaction(); SQLiteStatement stmt = db.compileStatement( sql ); for( BudgetUser item : items ){ stmt.bindLong( 1, item.id_user ); stmt.bindLong( 2, item.id_budget ); stmt.execute(); stmt.clearBindings(); }//for db.setTransactionSuccessful(); db.endTransaction(); db_helper.Close(); return true; }//AddMultiple //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- public int Update( BudgetUser item ){ String strSQL = "UPDATE " + tablename + " SET id_user = " + item.id_user + " , id_budget = " + item.id_budget + " WHERE id = " + item.id; boolean is_result_ok = db_helper.ExecuteSQL( strSQL ); if( !is_result_ok ){ return -1; } return item.id; }//Update //--------------------------------------------------------------------------- public SparseArray<BudgetUser> Get(){ String query = "SELECT * FROM " + tablename; Cursor cursor = db_helper.ExecuteRawQuery( query ); return ToSparseArray( cursor ); }//Get // --------------------------------------------------------------------------- public SparseArray<BudgetUser> GetByBudget(int id_budget){ String query = "SELECT * FROM " + tablename + " WHERE id_budget = " + id_budget; Cursor cursor = db_helper.ExecuteRawQuery( query ); return ToSparseArray( cursor ); }//Get //--------------------------------------------------------------------------- /* public BudgetUser Get( int id ){ String strSQL = "SELECT * FROM " + tablename + " WHERE id = " + id; Cursor cursor = db_helper.ExecuteRawQuery( strSQL ); SparseArray<BudgetUser> array = ToSparseArray( cursor ); if( array.size() == 0 ){ return null; } return array.get( 0 ); }//Get */ //--------------------------------------------------------------------------- public int RemoveByBudget( int id_budget ){ return db_helper.DeleteRow( tablename, "id_budget", "" + id_budget ); }//Remove // --------------------------------------------------------------------------- public int Remove( int id ){ return db_helper.DeleteRow( tablename, "id", "" + id ); }//Remove //--------------------------------------------------------------------------- public void Clear(){ db_helper.DeleteTable( tablename ); }//Clear //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- private SparseArray<BudgetUser> ToSparseArray( Cursor cursor ){ SparseArray<BudgetUser> array = new SparseArray<>(); if( cursor == null ){ return array; } if( cursor.moveToFirst() ){ int id = cursor.getColumnIndex( "id" ); int id_user = cursor.getColumnIndex( "id_user" ); int id_budget = cursor.getColumnIndex( "id_budget" ); int index = 0; do{ BudgetUser item = new BudgetUser(); item.id = cursor.getInt( id ); item.id_user = cursor.getInt( id_user ); item.id_budget = cursor.getInt( id_budget ); array.put( index++, item ); }while( cursor.moveToNext() ); }//if( cursor.moveToFirst() ) cursor.close(); return array; }//ToSparseArray //--------------------------------------------------------------------------- }//DBBudgetUsers
[ "av@W0_AV.office.listatsoftware.com" ]
av@W0_AV.office.listatsoftware.com
8d4140dcb7f3ec8a8cc906cea6deae43b9edd46c
521444cc87659ea9b68c024a094ba4294baca37f
/src/main/java/onlineShop/model/SalesOrder.java
3c1e1e7c45d0771571e80219d9972694de4fbbcc
[]
no_license
DrGao93/go-shop
ca9724de9614b309a2350d06d4e1199b47931bcc
2c632be13fbd2c7f69f845357035356f262fbe42
refs/heads/master
2022-12-20T20:40:22.524334
2019-11-26T01:41:11
2019-11-26T01:41:11
224,074,385
0
0
null
2022-12-16T00:02:07
2019-11-26T01:20:48
Java
UTF-8
Java
false
false
1,374
java
package onlineShop.model; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToOne; import javax.persistence.Table; @Entity @Table(name = "salesorder") public class SalesOrder implements Serializable{ private static final long serialVersionUID = -6571020025726257848L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; @OneToOne private Cart cart; @OneToOne private Customer customer; @OneToOne private ShippingAddress shippingAddress; @OneToOne private BillingAddress billingAddress; public int getId() { return id; } public void setId(int id) { this.id = id; } public Cart getCart() { return cart; } public void setCart(Cart cart) { this.cart = cart; } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } public ShippingAddress getShippingAddress() { return shippingAddress; } public void setShippingAddress(ShippingAddress shippingAddress) { this.shippingAddress = shippingAddress; } public BillingAddress getBillingAddress() { return billingAddress; } public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; } }
[ "ykgaojianan@gmail.com" ]
ykgaojianan@gmail.com
a2db351a3d943223a14033633bf8966778a9da88
2e3d33539cd224dfd2310efd00e293349237eeed
/src/Expression.java
af8497c016ce9b74fb80cb8ebe0c15cb0337efc7
[]
no_license
SivkovaJu/CompilerDevelopmentBasics_lab3
12869872daf2668ed25c1fa5e1f78329129b51b0
a146bd00f6bbc0bfb67ec508e7467be3ae27170c
refs/heads/master
2020-05-31T12:02:57.214136
2019-06-04T20:24:19
2019-06-04T20:24:19
190,271,783
0
0
null
null
null
null
UTF-8
Java
false
false
695
java
import java.util.ArrayList; class Expression { // <Выражение> ::= <Ун.оп.> <Подвыражение> | <Подвыражение> static ASTNode analyze() { ArrayList<ASTNode> children = new ArrayList<>(); ASTNode unaryNode = unaryOperator(); if (unaryNode != null) children.add(unaryNode); ASTNode subExpressionNode = SubExpression.analyze(); if (subExpressionNode == null) return null; children.add(subExpressionNode); return utils.constructTree(GrammarSymbols.EXPRESSION, children); } // <Ун.оп.> private static ASTNode unaryOperator() { return OperatorSign.unaryOperator(); } }
[ "mamikonyan.n@yandex.ru" ]
mamikonyan.n@yandex.ru
b4c70a534cf5cfdf9082bcf7354fde0b580291d4
fdda62df0de70da5c2223a27af8cd4971934a4ff
/src/test/java/ueh/marlon/springessentials/service/AnimeServiceTest.java
4f6b3ceb61c3011e5f67f2d786e56699f050b4cc
[]
no_license
marlonsouza/spring-essentials
4a53fe5e8ad4cd53aa9e00ae9199e86ef0637976
44052d1e7ca45dda3321a927f61db090ff676d9f
refs/heads/main
2023-06-16T12:47:51.562311
2021-07-18T19:27:27
2021-07-18T19:27:27
387,248,968
1
0
null
null
null
null
UTF-8
Java
false
false
6,443
java
package ueh.marlon.springessentials.service; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; import java.util.Collections; import java.util.List; import java.util.Optional; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.BDDMockito; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.test.context.junit.jupiter.SpringExtension; import ueh.marlon.springessentials.domain.Anime; import ueh.marlon.springessentials.exception.BadRequestException; import ueh.marlon.springessentials.mapper.AnimeMapper; import ueh.marlon.springessentials.repository.AnimeRepository; import ueh.marlon.springessentials.requests.AnimePostRequestBody; import ueh.marlon.springessentials.requests.AnimePutRequestBody; import ueh.marlon.springessentials.util.AnimeCreator; import ueh.marlon.springessentials.util.AnimePostRequestBodyCreator; import ueh.marlon.springessentials.util.AnimePutRequestBodyCreator; @DisplayName("Tests for Anime Service") @ExtendWith(SpringExtension.class) class AnimeServiceTest { @InjectMocks private AnimeService animeService; @Mock private AnimeRepository animeRepositoryMock; @Mock private AnimeMapper animeMapperMock; @BeforeEach void setUp(){ List<Anime> animes = List.of(AnimeCreator.validAnimeWithId()); PageImpl<Anime> animePage = new PageImpl<>(animes); BDDMockito.when(animeRepositoryMock.findAll(ArgumentMatchers.any(Pageable.class))) .thenReturn(animePage); BDDMockito.when(animeRepositoryMock.findAll()) .thenReturn(animes); BDDMockito.when(animeRepositoryMock.findById(ArgumentMatchers.anyLong())) .thenReturn(Optional.of(AnimeCreator.validAnimeWithId())); BDDMockito.when(animeRepositoryMock.findByName(ArgumentMatchers.anyString())) .thenReturn(animes); BDDMockito.when(animeRepositoryMock.save(ArgumentMatchers.any(Anime.class))) .thenReturn(AnimeCreator.validAnimeWithId()); BDDMockito.doNothing().when(animeRepositoryMock).delete(ArgumentMatchers.any(Anime.class)); BDDMockito.when(animeMapperMock.toAnime(ArgumentMatchers.any(AnimePostRequestBody.class))) .thenReturn(AnimeCreator.validAnimeWithId()); BDDMockito.when(animeMapperMock.toAnime(ArgumentMatchers.any(AnimePutRequestBody.class))) .thenReturn(AnimeCreator.validAnimeWithId()); } @Test @DisplayName("Returns list of anime inside page object when successfull") void whenListAllisCalledWithPageableThenOnePageOfAnimesAndStatusOKIsReturned() { String expectedName = AnimeCreator.validAnimeWithId().getName(); Page<Anime> animePage = animeService.listAll(PageRequest.of(1, 1)); assertThat(animePage).isNotNull(); assertThat(animePage.toList()) .isNotEmpty() .hasSize(1); assertThat(animePage.toList().get(0).getName()).isEqualTo(expectedName); } @Test @DisplayName("Returns list of animes when successfull") void whenListAllIsCalledThenOnePageOfAnimesAndStatusOKIsReturned() { String expectedName = AnimeCreator.validAnimeWithId().getName(); List<Anime> animesList = animeService.listAllNonPage(); assertThat(animesList).isNotNull(); assertThat(animesList) .isNotEmpty() .hasSize(1); assertThat(animesList.get(0).getName()).isEqualTo(expectedName); } @Test @DisplayName("Returns one anime when successfull") void whenFindByIdOrThrowBadRequestExceptionIsCalledThenOneAnimeIsReturned() { Long expectedId = AnimeCreator.validAnimeWithId().getId(); Anime anime = animeService.findByIdOrThrowBadRequestException(expectedId); assertThat(anime).isNotNull(); assertThat(anime.getId()).isEqualTo(expectedId); } @Test @DisplayName("Find by id throw BadRequestException when animes is not found") void whenFindByIdOrThrowBadRequestExceptionIsCalledThenThrowException() { BDDMockito.when(animeRepositoryMock.findById(ArgumentMatchers.anyLong())) .thenReturn(Optional.empty()); assertThatCode(() -> animeService.findByIdOrThrowBadRequestException(ArgumentMatchers.anyLong())) .isInstanceOf(BadRequestException.class); //OR Assertions.assertThatExceptionOfType(BadRequestException.class) .isThrownBy(() -> animeService.findByIdOrThrowBadRequestException(ArgumentMatchers.anyLong())); } @Test @DisplayName("Find by name returns a list of anime when successfull") void whenFindByNameIsCalledThenOneAnimeIsReturned() { Anime expectedAnime = AnimeCreator.validAnimeWithId(); List<Anime> animes = animeService.findByName(expectedAnime.getName()); assertThat(animes) .isNotEmpty() .hasSize(1); assertThat(animes.get(0).getId()).isEqualTo(expectedAnime.getId()); } @Test @DisplayName("Find by name returns a empty list when animes is not found") void whenGETTWithNameisCalledThenAEmptyListIsReturned() { Anime expectedAnime = AnimeCreator.validAnimeWithId(); BDDMockito.when(animeRepositoryMock.findByName(ArgumentMatchers.anyString())) .thenReturn(Collections.emptyList()); List<Anime> animes = animeService.findByName(expectedAnime.getName()); assertThat(animes) .isNotNull() .isEmpty(); } @Test @DisplayName("Create returns anime when successfull") void whenSaveIsCalledAAnimeIsCreated(){ Long expectedId = AnimeCreator.validAnimeWithId().getId(); Anime createdAnime = animeService.save(AnimePostRequestBodyCreator.validPostAnime()); assertThat(createdAnime).isNotNull() .isEqualTo(AnimeCreator.validAnimeWithId()); assertThat(createdAnime.getId()).isEqualTo(expectedId); } @Test @DisplayName("Update replace anime when successfull") void whenUpdateIsCalledAAnimeIsUpdated(){ Assertions.assertThatCode(() -> animeService.update(1L,AnimePutRequestBodyCreator.validAnimePut())) .doesNotThrowAnyException(); } @Test @DisplayName("delete removes anime when successfull") void whenDeleteIsCalledAAnimeIsRemoved(){ Assertions.assertThatCode(() -> animeService.delete(1L)) .doesNotThrowAnyException(); } }
[ "marlon.souuza@gmail.com" ]
marlon.souuza@gmail.com
ab601c014296e02b401e9c4ad68df41c9d806105
3bf191ed7b059c1402ebcfeb8d0204d0e04b5b6e
/src/test/java/com/siyuan/repository/TextMessageRepositoryTest.java
9f3b54c3ee71d6aab9dd07bdc02ec03719b3b857
[]
no_license
SkullFang/siyuanback
1b5e892b7eb7ff27da1d30b2fa5c0528e1fce959
d5d94f319ca7d6215d37aee26af7ed94b3e43114
refs/heads/master
2021-08-10T12:45:04.143161
2017-11-12T15:40:25
2017-11-12T15:40:25
110,195,244
0
0
null
null
null
null
UTF-8
Java
false
false
1,972
java
package com.siyuan.repository; import com.siyuan.dataobject.TextMessage; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.beans.Transient; import java.util.List; import static org.junit.Assert.*; @RunWith(SpringRunner.class) @SpringBootTest public class TextMessageRepositoryTest { @Autowired private TextMessageRepository repository; @Test @Transient public void TestSave(){ for(int i=0;i<100;i++) { TextMessage textMessage = new TextMessage(); //textMessage.setTitleId(10); textMessage.setExamid(41); ; // textMessage.setSubjectKind("1"); textMessage.setSubjectkind("1"); textMessage.setTitlebody("1. 关于集合的元素,下列说法中正确的是( )"); textMessage.setAnswer("C"); textMessage.setHardlevel(1); textMessage.setA(" 集合中的元素是可以重复的"); textMessage.setB(" 集合中的元素任意换掉一个没有影响"); textMessage.setC(" 集合中的元素是可以交换顺序的"); textMessage.setD(" 集合中一定要有至少一个元素"); textMessage.setAnalysis("一个选择题的解析"); textMessage.setIsshow(0); textMessage.setType(1); //1是选择题 repository.save(textMessage); } } @Test public void findAllBySubjectKind() throws Exception { List<TextMessage> result=repository.findAllBySubjectkind("2"); Assert.assertNotEquals(0,result.size()); } @Test public void findALlbyExam(){ List<TextMessage> result=repository.findAllByExamid(1); Assert.assertNotEquals(0,result.size()); } }
[ "248482914@qq.com" ]
248482914@qq.com
4834f5713b8419a29d45f89e98f391826c329c0e
b2880df51c8886bf9596fd0639fdd25f19ec5f88
/src/main/java/hu/me/iit/Felevesfeladat/CarsRepositoryMemoryImpl.java
e165d9dd882c0b30586ac01ae2f29bf30fdc2dd3
[]
no_license
SchmidtBence/Webalk_Felevesfeladat
3df967d7fa015819d987665d1e56fffa3919ea22
f05f463145b6286bcd36c654aaab79e003e619fc
refs/heads/master
2023-09-05T04:56:27.903321
2021-10-10T19:25:24
2021-10-10T19:25:24
415,678,811
0
0
null
null
null
null
UTF-8
Java
false
false
1,222
java
package hu.me.iit.Felevesfeladat; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; @Component public class CarsRepositoryMemoryImpl implements CarsRepository { private final List<CarsDto> cars=new ArrayList<>(); private int findCarById(Long id) { int found = -1; for (int i = 0; i < cars.size(); i++) { if (cars.get(i).getId()==id) { found = i; break; } } return found; } @Override public List<CarsDto> findall() { return cars; } @Override public CarsDto getById(Long id) { return null; } @Override public Long save(CarsDto carsDto) { int found = findCarById(carsDto.getId()); if (found == -1) { cars.add(carsDto); } else { CarsDto foundCar = cars.get(found); foundCar.setModel(carsDto.getModel()); foundCar.setType(carsDto.getType()); } return null; } @Override public void deleteById(Long id) { int found = findCarById(id); if (found != -1) { cars.remove(found); } } }
[ "schmidt.bence@student.uni-miskolc.hu" ]
schmidt.bence@student.uni-miskolc.hu
b7d14e9b361bedadd704ebae1b1342dda7fc395a
11c428d2a73f6fbb44dadbf927950eb889f5d449
/JavaApp/src/javaapp/Dropper.java
5be6e3031f58df253df8d5eaf32a71d57867e860
[]
no_license
jordan-beasley/JavaApp
1e4279b9551ef58f1c38d1c4fba77dd22586a102
4544518ca187a05c89c9278ffad8f4bdbf35a5b5
refs/heads/master
2021-03-27T20:08:01.906739
2018-05-01T17:39:30
2018-05-01T17:39:30
121,298,699
0
0
null
2018-04-24T19:45:13
2018-02-12T20:36:02
Java
UTF-8
Java
false
false
3,458
java
package javaapp; import java.awt.image.RenderedImage; import java.io.File; import java.io.IOException; import javafx.embed.swing.SwingFXUtils; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Cursor; import javafx.scene.SnapshotParameters; import javafx.scene.canvas.Canvas; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.image.PixelReader; import javafx.scene.image.WritableImage; import javafx.scene.input.ContextMenuEvent; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.stage.FileChooser; import javafx.stage.Stage; import javax.imageio.ImageIO; public class Dropper extends Tool { double padding = 20; // padding to add around shape for hover outline AnchorPane controlPane; ContextMenu contextMenu; Pane parent; PixelReader pr; boolean placed = false; double startingX = 0; double startingY = 0; WritableImage writableImage; Stage stage; public Dropper(Pane parent, AnchorPane controlPane, Stage stage) { this.controlPane = controlPane; this.parent = parent; this.stage = stage; this.canvas = new Canvas(); this.canvas.setWidth(parent.getWidth()); this.canvas.setHeight(parent.getWidth()); parent.getChildren().add(this.canvas); SnapshotParameters sp = new SnapshotParameters(); sp.setFill(Color.TRANSPARENT); this.writableImage = new WritableImage((int)this.parent.getWidth(), (int)this.parent.getHeight()); this.parent.snapshot(sp, writableImage); pr = writableImage.getPixelReader(); AddHandlers(); } @Override public void Update() { graphicsContext.clearRect(0, 0, width, height); graphicsContext.fillRect(0, 0, width, height); } private void AddHandlers() { moveEvent = new EventHandler<MouseEvent>(){ @Override public void handle(MouseEvent event) { try { Color scene = pr.getColor((int)event.getSceneX(), (int)event.getSceneY()); String p = scene.toString().substring(2, 8); System.out.println("scene: " + p); }catch(Exception e) { System.out.println("Not in parent bounds"); } } }; clickEvent = new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent e) { parent.getChildren().remove(canvas); parent.removeEventHandler(MouseEvent.MOUSE_MOVED, moveEvent); parent.removeEventHandler(MouseEvent.MOUSE_CLICKED, this); } }; parent.addEventHandler(MouseEvent.MOUSE_CLICKED, clickEvent); parent.addEventHandler(MouseEvent.MOUSE_MOVED, moveEvent); } @Override public void RemoveHandlers() { parent.removeEventHandler(MouseEvent.MOUSE_MOVED, this.moveEvent); parent.removeEventHandler(MouseEvent.MOUSE_CLICKED, this.clickEvent); } }
[ "jordan.beasley@smail.astate.edu" ]
jordan.beasley@smail.astate.edu
176d68a5c0bbc297d73cc962b3f3d82e3615a7c3
32a48469f0ca52829fe73340a4711df97d926245
/src/main/java/com/flickrfeed/flickrfeed/service/SearchFlickrFeedService.java
ac0a8ff7d67c555ef6074bf57fe267b2bc2c2f2c
[ "Apache-2.0" ]
permissive
sanusiharun/flickr-feed
5eecdabdb280bfe3460e6948e7e9f351cbf1b150
ac421ac455d8121fbb8501e3d2d5f24f4a303141
refs/heads/main
2023-05-06T17:58:46.778738
2021-05-23T14:26:40
2021-05-23T14:26:40
369,698,665
0
0
null
null
null
null
UTF-8
Java
false
false
3,299
java
package com.flickrfeed.flickrfeed.service; import java.util.List; import java.util.stream.Collectors; import org.modelmapper.ModelMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import com.flickrfeed.flickrfeed.model.projection.ItemsView; import com.flickrfeed.flickrfeed.model.request.FilterFlickrFeedRequest; import com.flickrfeed.flickrfeed.model.response.FilterFlickrFeedResponse; import com.flickrfeed.flickrfeed.model.response.ItemsList; import com.flickrfeed.flickrfeed.repository.ItemsRepository; import com.flickrfeed.flickrfeed.util.PageableUtil; @Service public class SearchFlickrFeedService { private ItemsRepository itemsRepository; @Autowired ModelMapper modelMapper; private static final String DEF_SORT_BY = "title"; public SearchFlickrFeedService(ItemsRepository itemsRepository) { this.itemsRepository = itemsRepository; } public FilterFlickrFeedResponse search(FilterFlickrFeedRequest input) { Page<ItemsView> pageResult = getPageResultByInput(input); List<ItemsList> getItemList = pageResult.getContent().stream().map(item -> ItemsList.builder() .author(item.getAuthor()) .authorId(item.getAuthorId()) .description(item.getDescription()) .dateTaken(item.getDateTaken()) .link(item.getLink()) .published(item.getPublished()) .tags(item.getTags()) .title(item.getTitle()) .imageUrl(item.getImageUrl()) .build()).collect(Collectors.toList()); FilterFlickrFeedResponse response = FilterFlickrFeedResponse.builder().content(getItemList).build(); response.setPagination(PageableUtil.pageToPagination(pageResult)); return response; } Page<ItemsView> getPageResultByInput(FilterFlickrFeedRequest input) { String sortBy = input.getSortBy() != null && !input.getSortBy().isEmpty() ? input.getSortBy() : DEF_SORT_BY; Pageable pageRequest = PageableUtil.createPageRequestNative(input, null == input.getPageSize() ? 10 :input.getPageSize(), null == input.getPageNumber() ? 1 :input.getPageNumber(), sortBy, input.getSortType()); Page<ItemsView> pageResult = null; if (!PageableUtil.isEmptyString(input.getAuthor())) { input.setAuthor(PageableUtil.likeClause(input.getAuthor().toLowerCase())); } else input.setAuthor(null); if (!PageableUtil.isEmptyString(input.getDescription())) { input.setDescription(PageableUtil.likeClause(input.getDescription().toLowerCase())); } else input.setDescription(null); if (!PageableUtil.isEmptyString(input.getLink())) { input.setLink(PageableUtil.likeClause(input.getLink().toLowerCase())); } else input.setLink(null); if (!PageableUtil.isEmptyString(input.getTags())) { input.setTags(PageableUtil.likeClause(input.getTags().toLowerCase())); } else input.setTags(null); if (!PageableUtil.isEmptyString(input.getTitle())) { input.setTitle(PageableUtil.likeClause(input.getTitle().toLowerCase())); } else input.setTitle(null); pageResult = itemsRepository.findBySearchCriteria(input.getAuthor(), input.getDescription(), input.getLink(), input.getTags(), input.getTitle(), pageRequest); return pageResult; } }
[ "sanusiharun@gmail.com" ]
sanusiharun@gmail.com
b1a11460b0e97d39f0cfd3d08ed000549ed8dcb5
d3075fe3f2132f578c44e5f33f169a537ce37ba6
/app/src/main/java/com/luying/androidkeepalive/MainActivity.java
ef735112c7a9320a4263f9c1916abb75fa6d106e
[]
no_license
luying6/AndroidKeepAlive
32eb0b7068b3275b7451460d79d731d86fe716c7
94fca705abd0e97e7eb5d2e735aecd982aec789a
refs/heads/master
2020-12-02T22:43:46.457733
2017-07-04T04:00:03
2017-07-04T04:00:03
96,173,789
0
0
null
null
null
null
UTF-8
Java
false
false
900
java
package com.luying.androidkeepalive; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { openJobService(); } else { openTwoService(); } } private void openTwoService() { startService(new Intent(this, LocalService.class)); startService(new Intent(this, RemoteService.class)); } private void openJobService() { Intent intent = new Intent(); intent.setClass(MainActivity.this, JobHandlerService.class); startService(intent); } }
[ "2225745210@qq.com" ]
2225745210@qq.com
9c680f007ac604ea033dc6993b997955cfcfb832
e054742ee33485916f2af0b386168fce47c798b9
/src/main/java/com/vanity/iqbal/objects/UserComment.java
390dabab24741cc09a5de8352543c47a3c351543
[]
no_license
AzeemGhumman/iqbal-demystified-android-app
b6d907897b03b10520315651d2acc09a52f54a87
0050c574c87ae63dedaf3fd9e808d92b2eb583d5
refs/heads/master
2020-03-07T03:30:41.237603
2018-05-07T03:56:24
2018-05-07T03:56:24
127,237,761
0
2
null
null
null
null
UTF-8
Java
false
false
3,113
java
package com.vanity.iqbal.objects; import android.content.Context; import android.widget.Toast; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; /** * Created by aghumman on 4/30/2018. */ public class UserComment { private String id; private String username; private String text; private int score; private int currentUserFeedback; // -1 = dislike, 0 = no interaction, 1 = like private String timestamp; private int wordPosition; // -1 if no word position: will be the case with comment pertains to the whole sher public UserComment(String id, String username, String text, int score, int currentUserFeedback, String timestamp, int wordPosition) { this.id = id; this.username = username; this.text = text; this.score = score; this.currentUserFeedback = currentUserFeedback; this.timestamp = timestamp; this.wordPosition = wordPosition; } public String getId() { return id; } public String getUsername() { return username; } public String getText() { return text; } public int getScore() { return score; } public int getCurrentUserFeedback() { return currentUserFeedback; } public String getTimestamp() { return timestamp; } public int getWordPosition() { return wordPosition; } // Helper function to generate List of UserComment from JSONArray coming from server public static List<UserComment> getUserCommentsFromJson(JSONArray jsonArray, Context context) { List<UserComment> comments = new ArrayList<>(); for (int indexComment = 0; indexComment < jsonArray.length(); indexComment ++) { try { JSONObject jsonComment = (JSONObject) jsonArray.get(indexComment); String id = (String) jsonComment.get("id"); String username = (String) jsonComment.get("username"); String text = (String) jsonComment.get("text"); int score = Integer.parseInt((String) jsonComment.get("score")); int currentUserFeedback = Integer.parseInt((String) jsonComment.get("islike")); String timestamp = (String) jsonComment.get("timestamp"); int wordPosition; // this is a special case: since it will be "null" for sher level discussion if (jsonComment.isNull("wordposition")) { wordPosition = -1; } else { wordPosition = Integer.parseInt((String)jsonComment.get("wordposition")); } UserComment comment = new UserComment(id, username, text, score, currentUserFeedback, timestamp, wordPosition); comments.add(comment); } catch (JSONException e) { e.printStackTrace(); Toast.makeText(context, "Error parsing comments", Toast.LENGTH_SHORT).show(); } } return comments; } }
[ "azeemghumman3@gmail.com" ]
azeemghumman3@gmail.com
dc8d8684c9c1ebdce10be522be811736b07507bd
3fdbb519ac27000809816061ff57dabcc598b507
/spring-boot/spring-boot-06-jdbc/spring-boot-jdbc-template/src/test/java/com/soulballad/usage/springboot/SpringBootJdbcTemplateApplicationTests.java
1f40b64e08dbbded7f6722da9a98d81a34ca576f
[]
no_license
mengni0710/spring-usage-examples
412cf7c6604b9dbb0cea98480d0e106e558384ec
e90011d08219a90831e2abc68e689247d371daa7
refs/heads/master
2023-05-09T08:16:28.524308
2020-09-22T11:57:24
2020-09-22T11:57:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
package com.soulballad.usage.springboot; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SpringBootJdbcTemplateApplicationTests { @Test public void contextLoads() {} }
[ "soda931vzr@163.com" ]
soda931vzr@163.com
df186fe152ba60e159dfccb7c20e7c3fbfb877ba
f33747daeaca3ffc69f82d5a3f2f8808410c67d7
/app/src/androidTest/java/com/example/ruinan/audiodemo/ExampleInstrumentedTest.java
6f855f70cbb08dc8edb727407067fada798f5dff
[]
no_license
ruinan/AudioDemo
7d75e6bacd87029dc5bbf1ddc4559ef6edb203d1
b8f61d25a2d05d7081de9375bddfa76a52caf50d
refs/heads/master
2021-01-21T22:34:55.206430
2017-09-02T00:06:34
2017-09-02T00:06:34
102,161,586
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.example.ruinan.audiodemo; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.ruinan.audiodemo", appContext.getPackageName()); } }
[ "run7@pitt.edu" ]
run7@pitt.edu
2e8684a9faf8b73a7d71b9db463511927aa5e0c8
913c4e1e8c04eea98041f6417157d66eed928958
/PartnerSdk/src/main/java/com/microsoft/store/partnercenter/invoices/InvoiceSummaryOperations.java
c37970a0f7718758e1346aff63b894276e7614ef
[ "MIT" ]
permissive
jboulter11/Partner-Center-Java-SDK
f2477d31b1aa1600824abbffdd1c9da7a895995f
3790c99559492a390082e801d04e70950ff3275c
refs/heads/master
2020-03-17T19:13:22.082049
2018-05-30T22:28:57
2018-05-30T22:28:57
133,850,400
0
0
null
null
null
null
UTF-8
Java
false
false
1,815
java
// ----------------------------------------------------------------------- // <copyright file="InvoiceSummaryOperations.java" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> // ----------------------------------------------------------------------- package com.microsoft.store.partnercenter.invoices; import java.text.MessageFormat; import java.util.Locale; import com.fasterxml.jackson.core.type.TypeReference; import com.microsoft.store.partnercenter.BasePartnerComponentString; import com.microsoft.store.partnercenter.IPartner; import com.microsoft.store.partnercenter.PartnerService; import com.microsoft.store.partnercenter.models.invoices.Summary; import com.microsoft.store.partnercenter.network.IPartnerServiceProxy; import com.microsoft.store.partnercenter.network.PartnerServiceProxy; public class InvoiceSummaryOperations extends BasePartnerComponentString implements IInvoiceSummary { /*** * Initializes a new instance of the <see cref="InvoiceSummaryOperations"/> class. * @param rootPartnerOperations: The root partner operations instance. */ public InvoiceSummaryOperations(IPartner rootPartnerOperations) { super(rootPartnerOperations); } /*** * Retrieves summary of the partner's billing information. */ @Override public Summary get() { IPartnerServiceProxy<Summary, Summary> partnerServiceProxy = new PartnerServiceProxy<Summary, Summary>( new TypeReference<Summary>() { }, this.getPartner(), MessageFormat.format( PartnerService.getInstance().getConfiguration().getApis().get( "GetInvoiceSummary" ).getPath(), this.getContext(), Locale.US ) ); return partnerServiceProxy.get(); } }
[ "amolda@microsoft.com" ]
amolda@microsoft.com
7b7eb57ac5e78471a7602addd97e6274be7e0ba4
eefc217dece6d8aaeb12c3d3345bee2b34dc1893
/src/main/java/de/bausdorf/avm/tr064/examples/GetDeviceLog.java
d87a0bd4ebec8d781d082fdce7dacae0f13da68c
[ "Apache-2.0" ]
permissive
robbyb67/FritzTR064
b99f15656271eaa99891fae025716ee620260e08
81c0b392a8ec3740c72991878266e69e98bedb28
refs/heads/master
2022-09-14T13:19:41.819100
2016-07-11T15:17:10
2016-07-11T15:17:10
34,384,929
2
3
null
2016-02-20T22:25:56
2015-04-22T10:48:14
Java
UTF-8
Java
false
false
3,224
java
package de.bausdorf.avm.tr064.examples; /*********************************************************************************************************************** * * javaAVMTR064 - open source Java TR-064 API *=========================================== * * Copyright 2015 Marin Pollmann <pollmann.m@gmail.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. * ***********************************************************************************************************************/ import java.io.IOException; import javax.xml.bind.JAXBException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.bausdorf.avm.tr064.Action; import de.bausdorf.avm.tr064.FritzConnection; import de.bausdorf.avm.tr064.Service; import de.bausdorf.avm.tr064.Response; public class GetDeviceLog { private static final Logger LOG = LoggerFactory.getLogger(GetDeviceLog.class); static String ip = null; static String user = null; static String password = null; private GetDeviceLog() { super(); } public static void main(String[] args){ if( args.length < 2 ) { LOG.error("args: <fb-ip> <password> [user]"); System.exit(1); } else { ip = args[0]; password = args[1]; if( args.length > 2 ) { user = args[2]; } } //Create a new FritzConnection with username and password FritzConnection fc = new FritzConnection(ip,user,password); try { //The connection has to be initiated. This will load the tr64desc.xml respectively igddesc.xml //and all the defined Services and Actions. fc.init(null); } catch (IOException | JAXBException e2) { //Any HTTP related error. LOG.error(e2.getMessage(), e2); } for (int i = 1; i<=3 ;i++){ //Get the Service. In this case WLANConfiguration:X Service service = fc.getService("DeviceInfo:" + i); //Get the Action. in this case GetTotalAssociations Action action = service.getAction("GetDeviceLog"); Response response1 = null; try { //Execute the action without any In-Parameter. response1 = action.execute(); if (response1 == null) { return; } } catch (UnsupportedOperationException | IOException e1) { LOG.error(e1.getMessage(), e1); } String deviceLog = ""; try { //Get the value from the field NewTotalAssociations as an integer. Values can have the Types: String, Integer, Boolean, DateTime and UUID if (response1 != null) { deviceLog = response1.getValueAsString("NewDeviceLog"); } } catch (ClassCastException | NoSuchFieldException e) { LOG.error(e.getMessage(), e); } LOG.info(deviceLog); } } }
[ "robert.bausdorf@directline.de" ]
robert.bausdorf@directline.de
ebce7089e7be9e1b6a5f260060c78f876c0b3d97
bebf7b76021de1f427ce495bb8873b160edb1758
/VanFood/src/com/google/gwt/sample/vanfood/client/LoginServiceAsync.java
570b1775680610817f06ab29f7d831e2e2944a2a
[]
no_license
lisa16/VanFood
0d746017e3c74428e3f813353c19b246274bc1f5
e4554d69261145bdbd6e077b6c258018d31b2981
refs/heads/master
2021-01-18T13:59:29.345553
2014-11-26T19:01:22
2014-11-26T19:01:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
207
java
package com.google.gwt.sample.vanfood.client; import com.google.gwt.user.client.rpc.AsyncCallback; public interface LoginServiceAsync { void login(String requestUri, AsyncCallback<LoginInfo> callback); }
[ "mariocimet@gmail.com" ]
mariocimet@gmail.com
914a4e7fb696a6737fb63b34896f4c0d9a02b8e7
8257deaa27ef51b081085b023cd8755e13b0cdd4
/src/main/java/in/poovi/dao/BusRouteDAO.java
8edeeb13603264a7504ab045755488ec7e97acb7
[]
no_license
csys-fresher-batch-2021/busticketapp-poovitha
07de737c5ac87f69b986ceae7527c31822c2bf75
1816da5927fc82e002bb752c28fbd4d616aabca8
refs/heads/main
2023-06-15T03:04:51.105968
2021-07-05T11:16:48
2021-07-05T11:16:48
364,485,229
0
2
null
2021-07-05T11:16:49
2021-05-05T06:46:17
Java
UTF-8
Java
false
false
56
java
package in.poovi.dao; public interface BusRouteDAO { }
[ "poovithayamini228@gmail.com" ]
poovithayamini228@gmail.com
6bafbfd8751e72487e6d77a4f0cf883b020e1c61
499bc80d591bacfd986226e4eff88e0d4cae05a7
/src/main/java/dad/javafx/triangulo/TrianguloView.java
de398b27d0d8beeaf332a23d3f784824e26d2826
[]
no_license
Frank777181/GeometriaFX
3c9338f2476c41db33efc701a617586104f68bf6
3cc0a9f0f26f6d7968f02e1fa5c5d6cedf50d370
refs/heads/master
2020-09-11T14:36:27.016804
2019-11-16T12:50:33
2019-11-16T12:50:33
222,098,459
0
0
null
null
null
null
UTF-8
Java
false
false
2,801
java
package dad.javafx.triangulo; import dad.javafx.recursosFormas.Triangulo; import javafx.geometry.HPos; import javafx.geometry.Pos; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import javafx.scene.paint.Color; public class TrianguloView extends GridPane { private TextField baseText, alturaText; private Label areaText, perimetroText; private Label baseLabel, alturaLabel; private Label areaLabel, perimetroLabel; private Triangulo trianguloForma; public TrianguloView() { super(); baseLabel = new Label("Base:"); alturaLabel = new Label("Altura:"); baseText = new TextField(); baseText.setPromptText("Base"); baseText.setPrefColumnCount(5); alturaText = new TextField(); alturaText.setPromptText("Altura"); alturaText.setPrefColumnCount(5); trianguloForma = new Triangulo(80,60); trianguloForma.setFill(Color.GREEN); trianguloForma.setStrokeWidth(2); trianguloForma.setStroke(Color.BLACK); areaLabel = new Label("Area:"); perimetroLabel = new Label("Perímetro:"); areaText = new Label(); perimetroText = new Label(); addRow(0, baseLabel, baseText); addRow(1, alturaLabel, alturaText); addRow(2, trianguloForma); setColumnSpan(trianguloForma, 2); setHalignment(trianguloForma, HPos.CENTER); addRow(3, areaLabel, areaText); addRow(4, perimetroLabel, perimetroText); setAlignment(Pos.CENTER); setHgap(15); setVgap(5); } public TextField getBaseText() { return baseText; } public void setBaseText(TextField baseText) { this.baseText = baseText; } public TextField getAlturaText() { return alturaText; } public void setAlturaText(TextField alturaText) { this.alturaText = alturaText; } public Label getAreaText() { return areaText; } public void setAreaText(Label areaText) { this.areaText = areaText; } public Label getPerimetroText() { return perimetroText; } public void setPerimetroText(Label perimetroText) { this.perimetroText = perimetroText; } public Label getBaseLabel() { return baseLabel; } public void setBaseLabel(Label baseLabel) { this.baseLabel = baseLabel; } public Label getAlturaLabel() { return alturaLabel; } public void setAlturaLabel(Label alturaLabel) { this.alturaLabel = alturaLabel; } public Label getAreaLabel() { return areaLabel; } public void setAreaLabel(Label areaLabel) { this.areaLabel = areaLabel; } public Label getPerimetroLabel() { return perimetroLabel; } public void setPerimetroLabel(Label perimetroLabel) { this.perimetroLabel = perimetroLabel; } public Triangulo getTrianguloForma() { return trianguloForma; } public void setTrianguloForma(Triangulo trianguloForma) { this.trianguloForma = trianguloForma; } }
[ "fran.14111996@gmail.com" ]
fran.14111996@gmail.com
a1e1dd1805b5a0c8ba12a3ade64e770e846eb36a
6f57c0168f957969c3e2a66517127e66491ba12b
/RouteDistTimeComp/app/src/main/java/com/linroutingsystems/routedisttimecomp/EstablishURLConnection.java
e95810ac66e56aea9959a44ec9bf201138a75d93
[]
no_license
hhlin2017/DistAndTimeParsing
7ccb4de5936d2d85ffbd6408997b45ad6c0632d3
b05846ca1ef0f77e9a3e20e38f74e59621f7c859
refs/heads/master
2021-05-30T15:36:40.904395
2016-02-12T05:32:52
2016-02-12T05:32:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,783
java
package com.linroutingsystems.routedisttimecomp; import android.os.AsyncTask; import android.util.Log; import org.json.JSONObject; import java.io.*; import java.net.*; import java.util.*; import java.util.concurrent.ExecutionException; import com.linroutingsystems.routedisttimecomp.JSONParser; /** * Created by Chow on 2/11/2016. */ public class EstablishURLConnection { void EstablishURLConnection(){ // Empty Constructor } public String URLConnection(String destination){ String inputData = "FAILURE"; /* URL googleDistanceAndTimeServer = null; try { googleDistanceAndTimeServer = new URL(destination); } catch (MalformedURLException e) { e.printStackTrace(); } URLConnection gDATSConnect = null; try { gDATSConnect = googleDistanceAndTimeServer.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(gDATSConnect.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) inputData += inputLine + "\n"; in.close(); } catch (IOException e) { e.printStackTrace(); } */ // DownloadData downloadedData = new DownloadData(); // inputData = downloadedData.execute(destination); try { inputData = new DownloadData().execute(destination).get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } Log.e("EstablishURL, URL Con", inputData); return inputData; } private class DownloadData extends AsyncTask<String, Void, String>{ protected String doInBackground(String... destination){ String inputData = ""; URL googleDistanceAndTimeServer = null; try { googleDistanceAndTimeServer = new URL(destination[0]); Log.e("EstablishURL, DD, Dest", destination[0]); } catch (MalformedURLException e) { e.printStackTrace(); } URLConnection gDATSConnect = null; try { gDATSConnect = googleDistanceAndTimeServer.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(gDATSConnect.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) inputData += inputLine + "\n"; in.close(); } catch (IOException e) { e.printStackTrace(); } Log.e("EstablishURL, DD", inputData); return inputData; } } }
[ "lin.hsiaohong@gmail.com" ]
lin.hsiaohong@gmail.com
83f59678a8e8d5d6d14cd8b75df2eaf19fa27754
e99fc850ec95972474402980fcdb5902c1de1a24
/ProjetoMicroservice/src/main/java/service/controller/ProjetoController.java
9fcd968a6b6ae05fef6b02aad99d0c5789511740
[]
no_license
ThiagoHDS/Microservices
87ba68cd206ce4aca7074b76006aedeebda4498c
aae59deef7b978b7271db5a82a7c1701574a1682
refs/heads/main
2023-08-13T02:20:27.639754
2021-10-10T21:25:42
2021-10-10T21:25:42
415,703,775
0
0
null
null
null
null
UTF-8
Java
false
false
1,599
java
package service.controller; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import service.model.Projeto; import service.repository.ProjetoRepository; @RestController @RequestMapping(value = "/projetos") public class ProjetoController { @Autowired private ProjetoRepository projetoRepository; @GetMapping public List<Projeto> getProjetos() { return projetoRepository.findAll(); } @GetMapping("/{id}") public Optional<Projeto> getProjetoById(@PathVariable Long id) { return projetoRepository.findById(id); } @PostMapping public Projeto createProjeto(@RequestBody Projeto projeto) { return projetoRepository.save(projeto); } @PutMapping("/{id}") public Projeto updateProjeto(@PathVariable("id") String id, @RequestBody Projeto projeto) { return projetoRepository.save(projeto); } @DeleteMapping public void deleteAllProjeto() { projetoRepository.deleteAll(); } @DeleteMapping("/{id}") public void deleteProjeto(@PathVariable Long id) { projetoRepository.delete(projetoRepository.findById(id).get()); } }
[ "noreply@github.com" ]
ThiagoHDS.noreply@github.com
8d89ab3b4d7910d6ac79704558074b0b941692e3
4457c60b4a7740123c141f8d37a6990dc7957bb1
/WebForumImplementation/src/formbeans/RegisterForm.java
fdac4edbb67d21d062a023ab3bd082b6dea56bd8
[]
no_license
juntakuo/Web-Application-Development
74767e3eb42a82111e5e020a655c7473ba127398
a97b5bb0082574943b4556c2e8ae02cb5ecf3a58
refs/heads/master
2021-01-25T10:00:44.170899
2014-02-26T19:45:24
2014-02-26T19:45:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,394
java
/* Student Name: Tsu-Hao Kuo * andrewID: tkuo * Date: Mar. 2, 2013 * Course number: 08764/15637/15437 */ package formbeans; import java.util.ArrayList; import java.util.List; import org.mybeans.form.FormBean; public class RegisterForm extends FormBean { private String firstName; private String lastName; private String userName; private String password; private String confirm ; private String userEmail; public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String getUserName() { return userName; } public String getPassword() { return password; } public String getConfirm() { return confirm; } public String getUserEmail() { return userEmail; } public void setFirstName(String s) { firstName = trimAndConvert(s,"<>\""); } public void setLastName(String s) { lastName = trimAndConvert(s,"<>\""); } public void setUserName(String s) { userName = trimAndConvert(s,"<>\""); } public void setPassword(String s) { password = s.trim(); } public void setConfirm(String s) { confirm = s.trim(); } public void setUserEmail(String s) { userEmail = trimAndConvert(s,"<>\""); } public List<String> getValidationErrors() { List<String> errors = new ArrayList<String>(); if (firstName == null || firstName.trim().length() == 0) { errors.add("First Name is required"); } if (lastName == null || lastName.trim().length() == 0) { errors.add("Last Name is required"); } if (userName == null || userName.trim().length() == 0) { errors.add("User Name is required"); } if (password == null || password.trim().length() == 0) { errors.add("Password is required"); } if (confirm == null || confirm.trim().length() == 0) { errors.add("Confirm Password is required"); } if (userEmail == null || userEmail.trim().length() == 0) { errors.add("Email address is required!"); } else if (!userEmail.matches("^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$")) errors.add("Invalid email address"); if (errors.size() > 0) { return errors; } if (!password.equals(confirm)) { errors.add("Passwords are not the same"); } return errors; } }
[ "juntakuo@gmail.com" ]
juntakuo@gmail.com
ae318f2728fd67402c660eb12f101f052a6a1ea7
ed369d6250eae41621cdf35ca68cf327c075a7e7
/WaitTest.java
ba454b4884aa4635e25e4dd03014ff9b65b34061
[]
no_license
RamyaSivamani/basicprgm
6bd59825d8204e73bd167b79c993e110dfc2085e
348c176b23b9e7cf62fac8391499b285b290ce9d
refs/heads/master
2021-06-21T01:55:04.137395
2017-08-17T14:06:44
2017-08-17T14:06:44
100,610,042
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
class Customer{ int amount=10000; synchronized void withdraw(int amount){ System.out.println("going to withdraw..."); if(this.amount<amount){ System.out.println("Less balance; waiting for deposit..."); try{wait();}catch(Exception e){} } this.amount-=amount; System.out.println("withdraw completed..."); } synchronized void deposit(int amount){ System.out.println("going to deposit..."); this.amount+=amount; System.out.println("deposit completed... "); notify(); } } class WaitTest{ public static void main(String args[]){ final Customer c=new Customer(); new Thread(){ public void run(){c.withdraw(15000);} }.start(); new Thread(){ public void run(){c.deposit(10000);} }.start(); }}
[ "ramya.s@KGFSL.COM" ]
ramya.s@KGFSL.COM
c52719be807d6f89e0029681b4bc8588cc5a2b22
c2bc17ac50f9fe8629362fe2e1da707d0ad44113
/OlioEsimerki3/Pelikortti2.java
ea1304ad7c6a7ec57060bdb248d535d64731a598
[]
no_license
bekshoi/ltdns20
a1b56d8aa271b7edb921c5ec8209da2746b51cb9
c338c4fd1f1fe84dce14a5917c07409d0b45ba66
refs/heads/master
2023-02-09T07:31:43.431108
2020-12-29T07:30:15
2020-12-29T07:30:15
306,302,237
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,795
java
/********************************************* Nimi:Pelikortti2 Tekija: Pvm: Kuvaus: Luokka yksittäistä, perittyä pelikorttia varten. Riippuvuudet: - !HUOM! Tiedostonimi on eri kuin luokan nimi *********************************************/ /* Otetaan mukaan kirjastot, jotka sisältävät tarvittavat valmiit luokat. */ import java.util.*; // Luokka yksittäistä pelikorttia varten. class Pelikortti { protected String maa; // Attribuutti, joka ilmaisee, onko kortti hertta, ruutu, pata vai risti. protected int silmaluku; // Attribuutti, joka ilmaisee kortin silmäluvun. Ässä lasketaan luvuksi 14. // Konstruktori, jossa asetetaan kortille alkuarvot. Pelikortti() { maa = "tuntematon"; silmaluku = 0; } // Metodi, joka kertoo pelikortin maan. public String kerroMaa() { return maa; } // Metodi, joka kertoo pelikortin silmäluvun. public int kerroSilmaluku() { return silmaluku; } // Metodi, joka asettaa pelikortin maan. public void asetaMaa(String uusimaa) { maa = uusimaa; } // Metodi, joka asettaa pelikorttin silmäluvun. public void asetaSilmaluku(int uusisilmaluku) { silmaluku = uusisilmaluku; } public String valttiHuuto() { return "Tieto on valttia"; } } class Risti extends Pelikortti { protected String vari; // Attribuutti, joka ilmaisee, onko kortti punainen vai musta. // Konstruktori, jossa asetetaan kortille alkuarvot. Risti(int si) { maa = "Risti"; vari = "musta"; silmaluku = si; } // Metodi, joka kertoo valtin. public String valttiHuuto() { return "Risti on valttia"; } } class Hertta extends Pelikortti { protected String vari; // Konstruktori, jossa asetetaan kortille alkuarvot. Hertta(int si) { maa = "Hertta"; vari = "punainen"; silmaluku = si; } // Metodi, joka kertoo valtin. public String valttiHuuto() { return "Hertta on valttia"; } }
[ "1907089@edu.karelia.fi" ]
1907089@edu.karelia.fi
b2cc64bb277de32b1d665713324a14f842484630
9bac6b22d956192ba16d154fca68308c75052cbb
/icmsint-ejb/src/main/java/hk/judiciary/icmsint/model/sysinf/inf/gfpij2d/VideoCT.java
06b7435c5caf15fc271c24a7de4f5e214878dd57
[]
no_license
peterso05168/icmsint
9d4723781a6666cae8b72d42713467614699b66d
79461c4dc34c41b2533587ea3815d6275731a0a8
refs/heads/master
2020-06-25T07:32:54.932397
2017-07-13T10:54:56
2017-07-13T10:54:56
96,960,773
0
0
null
null
null
null
GB18030
Java
false
false
6,649
java
// // 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的 // 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // 在重新编译源模式时, 对此文件的所有修改都将丢失。 // 生成时间: 2017.07.11 时间 05:59:54 PM CST // package hk.judiciary.icmsint.model.sysinf.inf.gfpij2d; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * A set of finite-length sequences of binary octets. * characterSetCode - The character set of the binary object if the mime type is text. Reference IETF RFC 2045, 2046, 2047. * encodingCode - The decoding algorithm of the binary object. Reference IETF RFC 2045, 2046, 2047. * fileName - The filename of the encoded binary object. Reference IETF RFC 2045, 2046, 2047. * format - The format of the binary content. * mimeCode - The mime type of the binary object. Reference IETF RFC 2045, 2046, 2047. * objectUri - The Uniform Resource Identifier that identifies where the binary object is located. * * * <p>Video.CT complex type的 Java 类。 * * <p>以下模式片段指定包含在此类中的预期内容。 * * <pre> * &lt;complexType name="Video.CT"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>base64Binary"> * &lt;attribute name="characterSetCode" type="{http://www.w3.org/2001/XMLSchema}token" /> * &lt;attribute name="encodingCode" type="{http://www.w3.org/2001/XMLSchema}token" /> * &lt;attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}normalizedString" /> * &lt;attribute name="format" type="{http://www.w3.org/2001/XMLSchema}normalizedString" /> * &lt;attribute name="mimeCode" type="{http://www.w3.org/2001/XMLSchema}token" /> * &lt;attribute name="objectUri" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Video.CT", namespace = "CCT", propOrder = { "value" }) public class VideoCT { @XmlValue protected byte[] value; @XmlAttribute(name = "characterSetCode") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String characterSetCode; @XmlAttribute(name = "encodingCode") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String encodingCode; @XmlAttribute(name = "fileName") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) @XmlSchemaType(name = "normalizedString") protected String fileName; @XmlAttribute(name = "format") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) @XmlSchemaType(name = "normalizedString") protected String format; @XmlAttribute(name = "mimeCode") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String mimeCode; @XmlAttribute(name = "objectUri") @XmlSchemaType(name = "anyURI") protected String objectUri; /** * 获取value属性的值。 * * @return * possible object is * byte[] */ public byte[] getValue() { return value; } /** * 设置value属性的值。 * * @param value * allowed object is * byte[] */ public void setValue(byte[] value) { this.value = value; } /** * 获取characterSetCode属性的值。 * * @return * possible object is * {@link String } * */ public String getCharacterSetCode() { return characterSetCode; } /** * 设置characterSetCode属性的值。 * * @param value * allowed object is * {@link String } * */ public void setCharacterSetCode(String value) { this.characterSetCode = value; } /** * 获取encodingCode属性的值。 * * @return * possible object is * {@link String } * */ public String getEncodingCode() { return encodingCode; } /** * 设置encodingCode属性的值。 * * @param value * allowed object is * {@link String } * */ public void setEncodingCode(String value) { this.encodingCode = value; } /** * 获取fileName属性的值。 * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * 设置fileName属性的值。 * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * 获取format属性的值。 * * @return * possible object is * {@link String } * */ public String getFormat() { return format; } /** * 设置format属性的值。 * * @param value * allowed object is * {@link String } * */ public void setFormat(String value) { this.format = value; } /** * 获取mimeCode属性的值。 * * @return * possible object is * {@link String } * */ public String getMimeCode() { return mimeCode; } /** * 设置mimeCode属性的值。 * * @param value * allowed object is * {@link String } * */ public void setMimeCode(String value) { this.mimeCode = value; } /** * 获取objectUri属性的值。 * * @return * possible object is * {@link String } * */ public String getObjectUri() { return objectUri; } /** * 设置objectUri属性的值。 * * @param value * allowed object is * {@link String } * */ public void setObjectUri(String value) { this.objectUri = value; } }
[ "chiu.cheukman@gmail.com" ]
chiu.cheukman@gmail.com
0835c9691ceaebca697714f4248294a48191101b
f1495bdedbc32c05cd4e87fff13a9997eaa6f925
/jfwAptOrm/src/main/java/org/jfw/apt/orm/core/defaultImpl/LongHandler.java
0023cb1694b5f36c39ce580fdb92c8e906daa1aa
[]
no_license
saga810203/jFrameWork
94e566439583bc7fcfa4165ddc9748ba2ad6d479
ba1d96c5b4b73fee1759011f74c3271c2f94e630
refs/heads/master
2020-05-21T22:43:19.604449
2017-03-30T04:04:21
2017-03-30T04:04:21
62,480,201
0
0
null
null
null
null
UTF-8
Java
false
false
426
java
package org.jfw.apt.orm.core.defaultImpl; import org.jfw.apt.orm.core.ColumnWriterCache; import org.jfw.apt.out.ClassWriter; public class LongHandler extends WLongHandler{ @Override public String supportsClass() { return "long"; } @Override public ColumnWriterCache init(String valEl, boolean useTmpVar, boolean nullable, ClassWriter cw) { return super.init(valEl, useTmpVar, false, cw); } }
[ "pengjia@isoftstone.com" ]
pengjia@isoftstone.com
2bb4e4298a3d781e1d8edf144f0cfa4e2a541745
d8fe03e4cdcd61959ce741381392812504ac0e97
/src/main/java/com/example/demo/dal/dto/AppUserDto.java
249dcafa0667066b9cdf490686c21a6bf022a5c0
[]
no_license
zsdani/demo
87a8c0164289326f9485ecfaad5cceb0cb5de782
beaa39f59a56d69c4eed4b6d81f75fbbcd475f0a
refs/heads/master
2023-03-20T19:56:40.935361
2021-03-16T18:26:51
2021-03-16T18:26:51
345,634,081
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
package com.example.demo.dal.dto; import com.example.demo.dal.entities.EntityStatus; import com.example.demo.dal.entities.Owner; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class AppUserDto { private long id; private EntityStatus entityStatus; private String username; private String name; private String role; private String e_mail; private int phone; public AppUserDto(Owner owner) { this.id = owner.getId(); this.entityStatus = owner.getStatus(); this.name = owner.getFirstname(); this.name = owner.getLastname(); this.username = owner.getUsername(); this.role = owner.getRole(); this.e_mail=owner.getE_mail(); this.phone=owner.getPhone(); } }
[ "zsikla.dani@gmail.com" ]
zsikla.dani@gmail.com
614e679bf773e8009c6cd412326f22a9f7400acd
5228790b1beca7d0399f5ee3d59b21fe5c495379
/lol-adapter/src/test/java/com/qamar4p/lol_adapter/ExampleUnitTest.java
8f1cf10ec5d9f911d80906c470731e1effab6af8
[]
no_license
Qamar4P/LolAdapter
94684b1f2baa27d5f1363a05deab5f9f91293519
8c953cb378907d18a46533f1aeb56ead32dd0a40
refs/heads/master
2021-09-11T17:41:32.556906
2018-04-10T11:20:32
2018-04-10T11:20:32
123,103,985
1
0
null
null
null
null
UTF-8
Java
false
false
401
java
package com.qamar4p.lol_adapter; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "qamar1dev@gmail.com" ]
qamar1dev@gmail.com
00b4c967e41dc42a905ebd9a214f88cf052f7566
aac14359790d82e0801fe66f03b8cb396d7d8888
/AirportApp/src/main/java/com/glider/model/Journey.java
c4079d947380d653b3b3de4096d753605c921e93
[]
no_license
sathishkumar95/SpringCorePractice
c50f55596bbe795064beb9b5cdab0160b1f4fe49
6ce3047522c053e1ccc6f0979893dbe60b3e42f7
refs/heads/master
2021-04-06T11:02:09.169682
2018-03-08T07:07:07
2018-03-08T07:07:07
124,351,132
0
0
null
null
null
null
UTF-8
Java
false
false
495
java
package com.glider.model; public class Journey { Flight flight=null; City source=null; City destination = null; public Journey(Flight flight, City source, City destination) { this.flight = flight; this.source = source; this.destination = destination; } public Flight getFlight() { return flight; } public City getSource() { return source; } public City getDestination() { return destination; } }
[ "noreply@github.com" ]
sathishkumar95.noreply@github.com
f4b611fb6d50de5603913e4bea655e77ae7d2728
88683597b7916d353e1cae3064e2ab293230a39f
/src/main/java/com/sandbox/util/IO.java
691df8cbbf6e333af897d8cdbe90b5c56b99cfb9
[]
no_license
sakuna63/Sandbox
d79590bd07813e1ee7564939bdfaba34003562f6
99da080181fbc6fff4c53b241e1e2f5396fa7ef8
refs/heads/master
2016-09-07T20:27:29.655913
2014-12-25T05:44:03
2014-12-25T05:44:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
132
java
package com.sandbox.util; public final class IO { public static void p(Object msg) { System.out.println(msg); } }
[ "saku.ni63@gmail.com" ]
saku.ni63@gmail.com
1d8a83453bf2b2056b622d2cde1e0c5ee1ae6f01
cdf6eed76ce00c1d828272d87ab733569737044f
/CanadaFoodGuideWorkSpace/foodguide/src/main/java/com/canadafoodguide/spring/dao/FoodsDaoImpl.java
19670b503394ab2603bcdfbf350e985fc571b875
[]
no_license
muhammadrezaulkarim/RestAPIUsingJavaSpringMVCForCloud
43e1200c0fed2581173d19a2e44373726c8f3994
6dff27ebc1aaf7137e37ca32c71d690132bd2bde
refs/heads/master
2021-09-03T20:07:14.943429
2018-01-11T16:18:19
2018-01-11T16:18:19
117,011,145
0
0
null
null
null
null
UTF-8
Java
false
false
2,627
java
package com.canadafoodguide.spring.dao; import java.util.ArrayList; import java.util.List; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import com.canadafoodguide.spring.config.SpringMongoConfig; import com.canadafoodguide.spring.model.Foods; @Repository("FoodsDao") @Transactional @SuppressWarnings("unchecked") public class FoodsDaoImpl implements FoodsDao { private MongoOperations mongoOperations; public FoodsDaoImpl() { mongoOperations = loadMongoConfiguration(); } private MongoOperations loadMongoConfiguration() { @SuppressWarnings("resource") ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringMongoConfig.class); MongoOperations mongoOperation = (MongoOperations) applicationContext.getBean("mongoTemplate"); return mongoOperation; } public List<Foods> getAllFoods(){ List<Foods> listFood = mongoOperations.findAll(Foods.class); return listFood == null ? new ArrayList<Foods>() : listFood; } public List<Foods> getFoodsByFgid(Foods food) { Criteria criteria = Criteria.where("fgid").is(food.getFgid()); Query query = new Query(criteria); List<Foods> listFood = mongoOperations.find(query, Foods.class, "client"); return listFood == null ? new ArrayList<Foods>() : listFood; } public boolean insertFood(Foods food) { try{ mongoOperations.save(food, "foods"); } catch(Exception ex){ ex.printStackTrace(); return false; } return true; } public boolean updateFood(Foods food) { try{ mongoOperations.save(food, "foods"); } catch(Exception ex){ ex.printStackTrace(); return false; } return true; } public boolean deleteFood(Foods food) { try{ mongoOperations.remove(food, "foods"); } catch(Exception ex){ ex.printStackTrace(); return false; } return true; } public boolean deleteFoodsByFgids(List<String> fgids) { Criteria criteria = Criteria.where("fgid").in(fgids); Query query = new Query(criteria); try{ mongoOperations.remove(query, Foods.class, "foods"); } catch(Exception ex){ ex.printStackTrace(); return false; } return true; } }
[ "mrkarim@gmail.com" ]
mrkarim@gmail.com
5752bfbf1342336aa32d186a91cd50c0984449ea
4c427790bac6b58af78be7e5ea21f306bf2e24e4
/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ImportBeanTests.java
a7ac43f3ef76c449a46151ebe2bf0d36e83232d2
[ "Apache-2.0" ]
permissive
helloworldless/spring-boot
a4730d956b6bc58e31df81e96f8b472c4cc0958d
55f939e93b929057e84175297a96a64f9c4dd9f0
refs/heads/master
2022-12-23T14:35:25.926505
2020-09-15T15:35:00
2020-09-15T15:35:00
290,907,435
0
0
null
2020-08-27T23:56:09
2020-08-27T23:56:08
null
UTF-8
Java
false
false
3,276
java
/* * Copyright 2012-2020 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.configurationprocessor; import org.junit.jupiter.api.Test; import org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata; import org.springframework.boot.configurationprocessor.metadata.Metadata; import org.springframework.boot.configurationsample.ConfigurationPropertiesImport; import org.springframework.boot.configurationsample.ConfigurationPropertiesImports; import org.springframework.boot.configurationsample.importbean.ImportJavaBeanConfigurationPropertiesBean; import org.springframework.boot.configurationsample.importbean.ImportMultipleTypeConfigurationPropertiesBean; import org.springframework.boot.configurationsample.importbean.ImportRepeatedConfigurationPropertiesBean; import org.springframework.boot.configurationsample.importbean.ImportValueObjectConfigurationPropertiesBean; import org.springframework.boot.configurationsample.importbean.ImportedJavaBean; import org.springframework.boot.configurationsample.importbean.ImportedValueObject; import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link ConfigurationPropertiesImport} and * {@link ConfigurationPropertiesImports}. * * @author Phillip Webb */ public class ImportBeanTests extends AbstractMetadataGenerationTests { @Test void importValueObjectConfigurationPropertiesBean() { ConfigurationMetadata metadata = compile(ImportValueObjectConfigurationPropertiesBean.class); assertThat(metadata) .has(Metadata.withProperty("importbean.value", String.class).fromSource(ImportedValueObject.class)); } @Test void importJavaBeanConfigurationPropertiesBean() { ConfigurationMetadata metadata = compile(ImportJavaBeanConfigurationPropertiesBean.class); assertThat(metadata) .has(Metadata.withProperty("importbean.name", String.class).fromSource(ImportedJavaBean.class)); } @Test void importMultipleTypeConfigurationPropertiesBean() { ConfigurationMetadata metadata = compile(ImportMultipleTypeConfigurationPropertiesBean.class); assertThat(metadata) .has(Metadata.withProperty("importbean.value", String.class).fromSource(ImportedValueObject.class)); assertThat(metadata) .has(Metadata.withProperty("importbean.name", String.class).fromSource(ImportedJavaBean.class)); } @Test void importRepeatedConfigurationPropertiesBean() { ConfigurationMetadata metadata = compile(ImportRepeatedConfigurationPropertiesBean.class); assertThat(metadata).has(Metadata.withProperty("vo.value", String.class).fromSource(ImportedValueObject.class)); assertThat(metadata).has(Metadata.withProperty("jb.name", String.class).fromSource(ImportedJavaBean.class)); } }
[ "pwebb@vmware.com" ]
pwebb@vmware.com
5145ab2fec3b3e9f3dc2806960195eac38a25683
543f48c1bc0341522d37212f92f575abc84c20c4
/src/main/java/com/zong/pay/facade/account/enums/AccountFundDirectionEnum.java
682909fe3c347433bd01ea700a9c0927cdd84c59
[]
no_license
zongyeqing/pay-facade-account
1fa22d1829ee14305edb2200fb285243f3d18307
ae2fc17028d4b42aaba5864abbba1f5515976977
refs/heads/master
2021-01-20T07:41:15.076803
2017-08-27T13:07:56
2017-08-27T13:07:56
101,553,036
0
0
null
null
null
null
UTF-8
Java
false
false
2,244
java
package com.zong.pay.facade.account.enums; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 账户资金变动方向 * @author 宗叶青 on 2017/8/22/20:06 */ public enum AccountFundDirectionEnum { ADD("加款", 123), SUB("见款", 321), FROZEN("冻结", 321), UNFROZEN("解冻", 123); /**枚举值*/ private int value; /**描述*/ private String desc; private AccountFundDirectionEnum(String desc, int value){ this.value = value; this.desc = desc; } public int getValue() { return value; } public void setValue(int value) { this.value = value; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public static AccountFundDirectionEnum getEum(int value){ AccountFundDirectionEnum resultEnum = null; AccountFundDirectionEnum[] enumAry = AccountFundDirectionEnum.values(); for(int i = 0; i < enumAry.length; i++){ if(enumAry[i].getValue() == value){ resultEnum = enumAry[i]; break; } } return resultEnum; } public static Map<String, Map<String, Object>> toMap(){ AccountFundDirectionEnum[] ary = AccountFundDirectionEnum.values(); Map<String, Map<String, Object>> enumMap = new HashMap<>(); for(int num = 0; num < ary.length; num++){ Map<String, Object> map = new HashMap<>(); String key = String.valueOf(getEum(ary[num].getValue())); map.put("value", String.valueOf(ary[num].getValue())); map.put("desc", ary[num].getDesc()); enumMap.put(key, map); } return enumMap; } public static List toList(){ AccountFundDirectionEnum[] ary = AccountFundDirectionEnum.values(); List list = new ArrayList(); for(int i = 0; i <ary.length; i++){ Map<String, String> map = new HashMap<>(); map.put("value", String.valueOf(ary[i].getValue())); map.put("desc", ary[i].getDesc()); list.add(map); } return list; } }
[ "614652958@qq.com" ]
614652958@qq.com
1b5120c33510ebecd348759cebaa5792817ee9fe
43ea91f3ca050380e4c163129e92b771d7bf144a
/services/vpc/src/main/java/com/huaweicloud/sdk/vpc/v2/model/NeutronCreateFirewallGroupRequestBody.java
f21362b2ab9dc6474d61c7e2043fa108eb87f007
[ "Apache-2.0" ]
permissive
wxgsdwl/huaweicloud-sdk-java-v3
660602ca08f32dc897d3770995b496a82a1cc72d
ee001d706568fdc7b852792d2e9aefeb9d13fb1e
refs/heads/master
2023-02-27T14:20:54.774327
2021-02-07T11:48:35
2021-02-07T11:48:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,650
java
package com.huaweicloud.sdk.vpc.v2.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.huaweicloud.sdk.vpc.v2.model.NeutronCreateFirewallGroupOption; import java.util.function.Consumer; import java.util.Objects; /** * */ public class NeutronCreateFirewallGroupRequestBody { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="firewall_group") private NeutronCreateFirewallGroupOption firewallGroup = null; public NeutronCreateFirewallGroupRequestBody withFirewallGroup(NeutronCreateFirewallGroupOption firewallGroup) { this.firewallGroup = firewallGroup; return this; } public NeutronCreateFirewallGroupRequestBody withFirewallGroup(Consumer<NeutronCreateFirewallGroupOption> firewallGroupSetter) { if(this.firewallGroup == null ){ this.firewallGroup = new NeutronCreateFirewallGroupOption(); firewallGroupSetter.accept(this.firewallGroup); } return this; } /** * Get firewallGroup * @return firewallGroup */ public NeutronCreateFirewallGroupOption getFirewallGroup() { return firewallGroup; } public void setFirewallGroup(NeutronCreateFirewallGroupOption firewallGroup) { this.firewallGroup = firewallGroup; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NeutronCreateFirewallGroupRequestBody neutronCreateFirewallGroupRequestBody = (NeutronCreateFirewallGroupRequestBody) o; return Objects.equals(this.firewallGroup, neutronCreateFirewallGroupRequestBody.firewallGroup); } @Override public int hashCode() { return Objects.hash(firewallGroup); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NeutronCreateFirewallGroupRequestBody {\n"); sb.append(" firewallGroup: ").append(toIndentedString(firewallGroup)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
38505736eedbe05743a39125ebde24823c62d49d
358eb638825f1628cfc7f0ac94750958be6a2bf7
/src/main/java/com/want/mq/biz/MongoHessianService.java
998fb60691bd98dbed9fbc83ed73990769a645ad
[]
no_license
daofuzhang/want-rabbitmq-email
080036a22ade1ff064301629af4145d203da592d
9ba516905458e7aba48438d99b3f14121f428b37
refs/heads/master
2020-04-29T01:41:23.550916
2019-03-15T03:00:28
2019-03-15T03:00:28
175,738,375
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.want.mq.biz; import java.util.Map; public interface MongoHessianService { public <T> void insertByName(T obj,String docName); public void insert(Map<String,Object> content,String docName); public void insertJson(String json,String docName); public void insertJsonCollection(String json,String docName); }
[ "daofu_zhang@163.com" ]
daofu_zhang@163.com
1c10166a647af34534784d8fc824ce83f10b95d1
6486478f3399dafffd285ea5935c872d35f41bb6
/src/javafactura/businessLogic/econSectors/Pendente.java
4762b6d915122bbe7d170dc6852e0756a118154f
[]
no_license
mendess/JavaFactura
35c0de0c93677e6d4a0797da4c10b8bf381202c0
1ad5c491f4a07dc84ae42a1f12ec17fe09512a73
refs/heads/master
2021-09-15T06:22:13.677886
2018-05-27T21:56:26
2018-05-27T21:56:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
819
java
package javafactura.businessLogic.econSectors; /** * Pendente. * {@inheritDoc} */ public final class Pendente extends EconSector { private static final long serialVersionUID = -2701674423006137578L; /** * The singleton instance of this sector */ private static final Pendente instance = new Pendente(); /** Private constructor to force singleton pattern */ private Pendente(){ } /** * Returns the singleton instance of this class * @return the singleton instance of this class */ public static Pendente getInstance(){ return instance; } /** * Method used during deserialization to maintain the singleton pattern * @return The singleton instance */ protected Object readResolve(){ return getInstance(); } }
[ "pedro.mendes.26@gmail.com" ]
pedro.mendes.26@gmail.com
4585b52fcc6d342f5f2fd6fc3d5070ad9aed597a
f207d7cb8f78543e199dfb036e3ca195d4d5e637
/src/main/java/pl/coderslab/dao/DayNameDao.java
a3aabdf5b49772a676a3c8d45e6e6daca21fb649
[]
no_license
MarcinK88/ZaplanujJedzonko
0da435d065e909e50f9d8805f18a846ee362a54d
b142f9c44d3f39cecec63f74f3a3bf9711499ad7
refs/heads/develop
2022-09-08T06:08:23.887681
2019-09-18T13:10:34
2019-09-18T13:10:34
202,129,243
0
0
null
2022-06-21T01:39:41
2019-08-13T11:25:02
Java
UTF-8
Java
false
false
1,192
java
package pl.coderslab.dao; import pl.coderslab.model.DayName; import pl.coderslab.utils.DbUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; public class DayNameDao { // Zapytania SQL private static final String FIND_ALL_DAY_NAME_QUERY = "SELECT * FROM day_name;"; public List<DayName> findAll() { List<DayName> dayNamelist = new ArrayList<>(); try(Connection connection = DbUtil.getConnection(); PreparedStatement statement = connection.prepareStatement(FIND_ALL_DAY_NAME_QUERY); ResultSet resultSet = statement.executeQuery()) { while (resultSet.next()) { DayName dayNameToAdd = new DayName(); dayNameToAdd.setId(resultSet.getInt("id")); dayNameToAdd.setName(resultSet.getString("name")); dayNameToAdd.setDisplayOrder(resultSet.getInt("display_order")); dayNamelist.add(dayNameToAdd); } } catch (SQLException e) { e.printStackTrace(); } return dayNamelist; } }
[ "marcin3216@gmail.com" ]
marcin3216@gmail.com
c4a79e44d7dad1669088b3689da59eb44b5fe777
0e13fca7fe6fd360181008bafff4f0f14fb3aa6d
/src/main/java/net/guidogarcia/storm/wordcount/WordSplitterBolt.java
3cdf2041bf4dc1bf2972640f35a4de3bd6cb3e90
[]
no_license
palmerabollo/storm-examples
dd9d1cadb2a0da52d04d159fd02dd37f94910efa
ff13aad5349df38947b85e01e0823a532d4ea011
refs/heads/master
2021-01-10T05:19:45.463044
2016-03-30T07:11:51
2016-03-30T07:11:51
55,040,323
0
0
null
null
null
null
UTF-8
Java
false
false
799
java
package net.guidogarcia.storm.wordcount; import backtype.storm.topology.BasicOutputCollector; import backtype.storm.topology.OutputFieldsDeclarer; import backtype.storm.topology.base.BaseBasicBolt; import backtype.storm.tuple.Fields; import backtype.storm.tuple.Tuple; import backtype.storm.tuple.Values; public class WordSplitterBolt extends BaseBasicBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { Fields schema = new Fields("word"); declarer.declare(schema); } @Override public void execute(Tuple tuple, BasicOutputCollector collector) { String line = tuple.getStringByField("line"); String[] words = line.split(" "); for (String word: words) { word = word.trim(); word = word.toLowerCase(); collector.emit(new Values(word)); } } }
[ "guido.garciabernardo@telefonica.com" ]
guido.garciabernardo@telefonica.com
73ee40eac5de94096f1ffa14ab7d6f1a47924684
3c5c7742007ee3d8e39d0a25477391daca206bfd
/src/main/java/com/employee/model/autowire/CDPlayer.java
00bd6943b18ee64f8ea58cc3be10b9495e783a71
[]
no_license
babureddy/springmvc
649f73106aefbb8a10c4e8f75f71aae8342c89ad
aefe25f81e872c1e962ed0cd3b7c86adf408bcf4
refs/heads/master
2020-03-31T13:10:15.183795
2018-10-09T12:09:34
2018-10-09T12:09:34
152,244,352
0
0
null
null
null
null
UTF-8
Java
false
false
65
java
package com.employee.model.autowire; public class CDPlayer { }
[ "noreply@github.com" ]
babureddy.noreply@github.com
eeec1054114cf954b870a27d58c88f5535c99f9e
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13141-1-8-SPEA2-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateStore_ESTest.java
e36787d015418c8344599d382311499bb646978d
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
6,481
java
/* * This file was automatically generated by EvoSuite * Sun Jan 19 10:32:24 UTC 2020 */ package com.xpn.xwiki.store; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.XWikiException; import com.xpn.xwiki.doc.XWikiDocument; import com.xpn.xwiki.objects.BaseStringProperty; import com.xpn.xwiki.objects.classes.StringClass; import com.xpn.xwiki.store.XWikiHibernateBaseStore; import com.xpn.xwiki.store.XWikiHibernateStore; import com.xpn.xwiki.store.hibernate.HibernateSessionFactory; import com.xpn.xwiki.store.migration.DataMigrationManager; import javax.inject.Provider; import javax.servlet.annotation.ServletSecurity; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.evosuite.runtime.javaee.injection.Injector; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.xwiki.context.Execution; import org.xwiki.logging.LoggerManager; import org.xwiki.model.reference.DocumentReference; import org.xwiki.model.reference.DocumentReferenceResolver; import org.xwiki.model.reference.EntityReferenceSerializer; import org.xwiki.observation.ObservationManager; import org.xwiki.query.QueryManager; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XWikiHibernateStore_ESTest extends XWikiHibernateStore_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { XWikiHibernateStore xWikiHibernateStore0 = new XWikiHibernateStore(); EntityReferenceSerializer<BaseStringProperty> entityReferenceSerializer0 = (EntityReferenceSerializer<BaseStringProperty>) mock(EntityReferenceSerializer.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "compactWikiEntityReferenceSerializer", (Object) entityReferenceSerializer0); DocumentReferenceResolver<ServletSecurity.TransportGuarantee> documentReferenceResolver0 = (DocumentReferenceResolver<ServletSecurity.TransportGuarantee>) mock(DocumentReferenceResolver.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "currentMixedDocumentReferenceResolver", (Object) documentReferenceResolver0); DocumentReferenceResolver<StringClass> documentReferenceResolver1 = (DocumentReferenceResolver<StringClass>) mock(DocumentReferenceResolver.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "defaultDocumentReferenceResolver", (Object) documentReferenceResolver1); EntityReferenceSerializer<String> entityReferenceSerializer1 = (EntityReferenceSerializer<String>) mock(EntityReferenceSerializer.class, new ViolatedAssumptionAnswer()); doReturn((Object) null).when(entityReferenceSerializer1).serialize(any(org.xwiki.model.reference.EntityReference.class) , any(java.lang.Object[].class)); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "defaultEntityReferenceSerializer", (Object) entityReferenceSerializer1); EntityReferenceSerializer<Short> entityReferenceSerializer2 = (EntityReferenceSerializer<Short>) mock(EntityReferenceSerializer.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "localEntityReferenceSerializer", (Object) entityReferenceSerializer2); Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "logger", (Object) logger0); ObservationManager observationManager0 = mock(ObservationManager.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "observationManager", (Object) observationManager0); Provider<StringClass> provider0 = (Provider<StringClass>) mock(Provider.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "oldRenderingProvider", (Object) provider0); QueryManager queryManager0 = mock(QueryManager.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class, "queryManager", (Object) queryManager0); DataMigrationManager dataMigrationManager0 = mock(DataMigrationManager.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateBaseStore.class, "dataMigrationManager", (Object) dataMigrationManager0); Execution execution0 = mock(Execution.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateBaseStore.class, "execution", (Object) execution0); LoggerManager loggerManager0 = mock(LoggerManager.class, new ViolatedAssumptionAnswer()); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateBaseStore.class, "loggerManager", (Object) loggerManager0); HibernateSessionFactory hibernateSessionFactory0 = mock(HibernateSessionFactory.class, new ViolatedAssumptionAnswer()); doReturn((Configuration) null).when(hibernateSessionFactory0).getConfiguration(); doReturn((SessionFactory) null).when(hibernateSessionFactory0).getSessionFactory(); Injector.inject(xWikiHibernateStore0, (Class<?>) XWikiHibernateBaseStore.class, "sessionFactory", (Object) hibernateSessionFactory0); Injector.validateBean(xWikiHibernateStore0, (Class<?>) XWikiHibernateStore.class); XWikiDocument xWikiDocument0 = mock(XWikiDocument.class, new ViolatedAssumptionAnswer()); doReturn((String) null).when(xWikiDocument0).getComment(); doReturn((DocumentReference) null).when(xWikiDocument0).getDocumentReference(); XWikiContext xWikiContext0 = new XWikiContext(); try { xWikiHibernateStore0.saveXWikiDoc(xWikiDocument0, xWikiContext0, true); fail("Expecting exception: XWikiException"); } catch(XWikiException e) { // // Error number 3201 in 3: Exception while saving document null // verifyException("com.xpn.xwiki.store.XWikiHibernateStore", e); } } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
0a34658680c3a6b63aab5f4affbb1d5bc2dabf5a
8cb041c954a99464ddb57b1fa1c228f1d1b10b22
/MyFactoryPatternDemo/app/src/main/java/com/example/root/myfactorypatterndemo/LaysOnionAndChesse.java
513d04d6569234ff06b7f381e9a6c46fb314f925
[]
no_license
saurabhsircar11/Experiments
d9bd8398159056b3004160c927023913738b2249
aff382becd8b6adc7d47a1626142e5c63b966bfe
refs/heads/master
2020-06-11T10:02:33.533460
2016-12-07T05:47:50
2016-12-07T05:47:50
75,698,781
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package com.example.root.myfactorypatterndemo; /** * Created by root on 6/12/16. */ public class LaysOnionAndChesse implements Chips { @Override public String makeChips() { return "You selected LaysOnionAndChesse please click on next to build your customized order"; } }
[ "saurabhsircar11@gmail.com" ]
saurabhsircar11@gmail.com
a6a3ab1d56736fb1f7e9086c1b3ec7a8bbf093b0
1b1fba5adfbef7ef059399acf388e555dc940cab
/src/main/java/com/example/demo/error/normal/IError.java
7689ad1c79e4c6480d65579d91e3739fe662b59c
[ "MIT" ]
permissive
QinghangPeng/SpringBootDemo
dcf3b508eba6fe5531aeb737ed3e046647c365ef
a40353eb2bd4b2b31baf983591310cbe5c0df5c7
refs/heads/master
2022-06-22T20:58:58.802808
2019-08-30T08:11:14
2019-08-30T08:11:14
176,133,068
2
0
MIT
2022-06-17T02:09:30
2019-03-17T17:04:34
Java
UTF-8
Java
false
false
156
java
package com.example.demo.error.normal; public interface IError { String getNamespace(); String getErrorCode(); String getErrorMessage(); }
[ "hao.peng@nx-engine.com" ]
hao.peng@nx-engine.com
73d939f69ac4eca252fa641ac202016708d54cd9
42b67fc7d117b7579edc3c11f1177deb9a9cfec0
/src/test/java/io/github/dwin357/leetcode/thirties/threeFour/SolutionTest.java
0657a3ea85dd5774f6007e2ca159cc286635da8f
[]
no_license
Dwin357/LeetProblems
a8d3a659ea8f8a1ad7681ea06cabade9c384fa25
72fd2dd0cb425245873e204bcb758c77592a3a28
refs/heads/master
2022-01-11T16:34:01.552557
2021-12-31T05:37:11
2021-12-31T05:37:11
191,839,179
0
0
null
2021-11-11T22:56:49
2019-06-13T22:04:41
Java
UTF-8
Java
false
false
1,364
java
package io.github.dwin357.leetcode.thirties.threeFour; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; public class SolutionTest { @Test public void example_1() { int[] given = new int[]{5,7,7,8,8,10}; int target = 8; int[] expected = new int[]{3,4}; Solution tested = new Solution(); int[] actual = tested.searchRange(given,target); assertArrayEquals(expected,actual); } @Test public void example_2() { int[] given = new int[]{5,7,7,8,8,10}; int target = 6; int[] expected = new int[]{-1,-1}; Solution tested = new Solution(); int[] actual = tested.searchRange(given,target); assertArrayEquals(expected,actual); } @Test public void example_3() { int[] given = new int[]{}; int target = 0; int[] expected = new int[]{-1,-1}; Solution tested = new Solution(); int[] actual = tested.searchRange(given,target); assertArrayEquals(expected,actual); } @Test public void edge_1() { int[] given = new int[]{1,2,3,3}; int target = 3; int[] expected = new int[]{2,3}; Solution tested = new Solution(); int[] actual = tested.searchRange(given,target); assertArrayEquals(expected,actual); } }
[ "debby@ascending-prime.attlocal.net" ]
debby@ascending-prime.attlocal.net
d1317a3fcd2b6e5a47d246e6144d47536fe58a7a
73659737eb051e4abad1b5487623db2b796f970d
/hello/hello.java
a42d6dddc6fb3c7861829e43abced2c1881ff20f
[]
no_license
asap2007/test
7e2748360b539e2402d6603c27c77e9c307ec2d7
208e575834c5d62ad77c1cf85d15d3ea7a49cb12
refs/heads/master
2021-01-01T06:05:22.724633
2015-07-10T03:08:15
2015-07-10T03:08:15
38,860,471
0
0
null
null
null
null
UTF-8
Java
false
false
660
java
package hello; import java.io.*; public class hello { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub System.out.println("Hello, World"); for(int i=0; i<args.length; i++){ System.out.println(args[i]); } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String s; while ((s = in.readLine()) != null && s.length() != 0){ System.out.println(s); String[] item = s.split("\t"); for(int i = 0; i < item.length; i++) System.out.println(item[i]); } // An empty line or Ctrl-Z terminates the program } }
[ "a@b.c" ]
a@b.c
7a90141b7cd996c527e9b8fdac897081666defac
44fd65965e421fe5870199bb7f71dee5dd95103a
/app/src/main/java/com/myeotra/driver/ui/fragment/offline/OfflineFragment.java
4f259f6b47af99b7acfb23c12b6c9b049738f591
[]
no_license
jack-iml/myeotra_driver
22bf1ec1dce9ebbd5853835c30eb8462a75f631b
a9922988e3eaea5968bd3e1f40c9fffb43ae1dd0
refs/heads/master
2022-07-15T02:28:27.159539
2020-05-17T06:48:47
2020-05-17T06:48:47
264,598,964
0
3
null
null
null
null
UTF-8
Java
false
false
3,477
java
package com.myeotra.driver.ui.fragment.offline; import android.content.Context; import android.content.Intent; import android.text.TextUtils; import android.view.Gravity; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import androidx.drawerlayout.widget.DrawerLayout; import com.google.gson.Gson; import com.myeotra.driver.R; import com.myeotra.driver.base.BaseFragment; import com.myeotra.driver.common.Constants; import com.myeotra.driver.common.swipe_button.SwipeButton; import org.json.JSONObject; import java.util.HashMap; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import es.dmoral.toasty.Toasty; import static com.myeotra.driver.common.fcm.MyFireBaseMessagingService.INTENT_FILTER; public class OfflineFragment extends BaseFragment implements OfflineIView { private OfflinePresenter presenter = new OfflinePresenter(); @BindView(R.id.menu_img) ImageView menuImg; @BindView(R.id.tvApprovalDesc) TextView tvApprovalDesc; @BindView(R.id.swipeBtnEnabled) SwipeButton swipeBtnEnabled; private DrawerLayout drawer; private Context context; @Override public int getLayoutId() { return R.layout.fragment_offline; } @Override public View initView(View view) { ButterKnife.bind(this, view); this.context = getContext(); presenter.attachView(this); drawer = activity().findViewById(R.id.drawer_layout); String s = getArguments().getString("status"); if (!TextUtils.isEmpty(s)) if (s.equalsIgnoreCase(Constants.User.Account.ONBOARDING)) tvApprovalDesc.setVisibility(View.VISIBLE); else if (s.equalsIgnoreCase(Constants.User.Account.BANNED)) { tvApprovalDesc.setVisibility(View.VISIBLE); tvApprovalDesc.setText(getString(R.string.banned_desc)); } else if (s.equalsIgnoreCase(Constants.User.Account.BALANCE)) { tvApprovalDesc.setVisibility(View.VISIBLE); tvApprovalDesc.setText(getString(R.string.low_balance)); swipeBtnEnabled.setVisibility(View.INVISIBLE); } swipeBtnEnabled.setOnStateChangeListener(active -> { if (active) { HashMap<String, Object> map = new HashMap<>(); map.put("service_status", Constants.User.Service.ACTIVE); presenter.providerAvailable(map); } }); return view; } @OnClick({R.id.menu_img}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.menu_img: drawer.openDrawer(Gravity.START); break; } } @Override public void onSuccess(Object object) { try { JSONObject jsonObj = new JSONObject(new Gson().toJson(object)); if (jsonObj.has("error")) Toasty.error(activity(), jsonObj.optString("error"), Toast.LENGTH_SHORT).show(); } catch (Exception e) { e.printStackTrace(); } context.sendBroadcast(new Intent(INTENT_FILTER)); } @Override public void onError(Throwable e) { hideLoading(); swipeBtnEnabled.toggleState(); if (e != null) try { onErrorBase(e); } catch (Exception e1) { e1.printStackTrace(); } } }
[ "jack.ingeniousmindslab@gmail.com" ]
jack.ingeniousmindslab@gmail.com
9f62a6ef47f3f67a2910d9c9469339e019851dac
21279bcaf53d9626eb0b91d5bb107b22e2b65407
/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MailTemplateTest.java
37c37d1b7b78b3054630eb8a3284c73524faa7c9
[ "Apache-2.0" ]
permissive
kannandev/syncope
1c0e6a71f566d07a341325e2c65e1cced9329ab5
7e0d6775047d2bf66fa9978f4a5385ab3f5b45fb
refs/heads/master
2021-01-22T08:02:02.028940
2017-05-26T14:02:25
2017-05-26T14:04:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,092
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.syncope.core.provisioning.java; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.apache.commons.jexl3.MapContext; import org.apache.commons.lang3.SerializationUtils; import org.apache.syncope.common.lib.to.AttrTO; import org.apache.syncope.common.lib.to.MembershipTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.core.provisioning.java.jexl.JexlUtils; import org.apache.syncope.core.persistence.api.dao.MailTemplateDAO; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @Transactional("Master") public class MailTemplateTest extends AbstractTest { @Autowired private MailTemplateDAO mailTemplateDAO; private String evaluate(final String template, final Map<String, Object> jexlVars) { StringWriter writer = new StringWriter(); JexlUtils.newJxltEngine(). createTemplate(template). evaluate(new MapContext(jexlVars), writer); return writer.toString(); } @Test public void confirmPasswordReset() throws IOException { String htmlBody = evaluate( mailTemplateDAO.find("confirmPasswordReset").getHTMLTemplate(), new HashMap<String, Object>()); assertNotNull(htmlBody); } @Test public void requestPasswordReset() throws IOException { Map<String, Object> ctx = new HashMap<>(); String username = "test" + UUID.randomUUID().toString(); UserTO user = new UserTO(); user.setUsername(username); ctx.put("user", user); String token = "token " + UUID.randomUUID().toString(); List<String> input = new ArrayList<>(); input.add(token); ctx.put("input", input); String htmlBody = evaluate( mailTemplateDAO.find("requestPasswordReset").getHTMLTemplate(), ctx); assertNotNull(htmlBody); assertTrue(htmlBody.contains("a password reset was request for " + username + ".")); assertFalse(htmlBody.contains( "http://localhost:9080/syncope-enduser/app/#!/confirmpasswordreset?token=" + token)); assertTrue(htmlBody.contains( "http://localhost:9080/syncope-enduser/app/#!/confirmpasswordreset?token=" + token.replaceAll(" ", "%20"))); } @Test public void optin() throws IOException { Map<String, Object> ctx = new HashMap<>(); String username = "test" + UUID.randomUUID().toString(); UserTO user = new UserTO(); user.setUsername(username); user.getPlainAttrs().add(new AttrTO.Builder().schema("firstname").value("John").build()); user.getPlainAttrs().add(new AttrTO.Builder().schema("surname").value("Doe").build()); user.getPlainAttrs().add(new AttrTO.Builder().schema("email").value("john.doe@syncope.apache.org").build()); user.getMemberships().add(new MembershipTO.Builder().group(UUID.randomUUID().toString(), "a group").build()); ctx.put("user", user); String token = "token " + UUID.randomUUID().toString(); List<String> input = new ArrayList<>(); input.add(token); ctx.put("input", input); UserTO recipient = SerializationUtils.clone(user); recipient.getPlainAttrMap().get("email").getValues().set(0, "another@syncope.apache.org"); ctx.put("recipients", Collections.singletonList(recipient)); String htmlBody = evaluate( mailTemplateDAO.find("optin").getHTMLTemplate(), ctx); assertNotNull(htmlBody); assertTrue(htmlBody.contains("Hi John Doe,")); assertTrue(htmlBody.contains("Your email address is john.doe@syncope.apache.org.")); assertTrue(htmlBody.contains("<li>another@syncope.apache.org</li>")); assertTrue(htmlBody.contains("<li>a group</li>")); } }
[ "ilgrosso@apache.org" ]
ilgrosso@apache.org
844018a9af53ea0351e7b96bdec5c75b57df9b79
38f7da2b61f573eee1736eaaf1ae1e9ca8f808fd
/src/com/molorane/college/model/Module.java
0d5d3ae1d01c56eab062d7e07a1d58cd6e8de59d
[]
no_license
molorane/College
9e5d034a3858a7810ee4bc205036c77a88aa2b24
0d9ca3a2668e984868f504a10b40d378c02d17b8
refs/heads/master
2021-01-05T06:12:14.759915
2020-02-16T14:51:16
2020-02-16T14:51:16
240,908,879
0
0
null
null
null
null
UTF-8
Java
false
false
2,447
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.molorane.college.model; /** * @author Mothusi Molorane */ public class Module{ private String moduleCode; private String courseCode; private String module; private String level; private String department; // Additional private String course; public void setModule(String moduleCode,String courseCode,String module,String level,String department,String course) { this.moduleCode = moduleCode; this.module = module; this.level = level; this.department = department; this.courseCode = courseCode; this.course = course; } /** * @return the moduleCode */ public String getModuleCode() { return moduleCode; } /** * @param moduleCode the moduleCode to set */ public void setModuleCode(String moduleCode) { this.moduleCode = moduleCode; } /** * @return the module */ public String getModule() { return module; } /** * @param module the module to set */ public void setModule(String module) { this.module = module; } /** * @return the level */ public String getLevel() { return level; } /** * @param level the level to set */ public void setLevel(String level) { this.level = level; } /** * @return the department */ public String getDepartment() { return department; } /** * @param department the department to set */ public void setDepartment(String department) { this.department = department; } /** * @return the courseCode */ public String getCourseCode() { return courseCode; } /** * @param courseCode the courseCode to set */ public void setCourseCode(String courseCode) { this.courseCode = courseCode; } /** * @return the course */ public String getCourse() { return course; } /** * @param course the course to set */ public void setCourse(String course) { this.course = course; } @Override public String toString(){ return moduleCode + " - "+ module; } }
[ "molorane.mothusi@gmail.com" ]
molorane.mothusi@gmail.com
df788342c24213b81a7b34ed8c207b7d34332537
483a230f71931cdc137e22549d4223aa0ba1ca43
/broker/src/main/java/md/utm/fcim/broker/connection/RequestHandler.java
8f110f9b50ee998660d4b00c5bae5ab5955ba4cc
[]
no_license
vadimeladii/Pad_Lab1
67155e7ec28fe4ea2a6dd0378cb7838fe53d1b43
083320b2d1cbf7e66ea0731806b920c8bbb513ef
refs/heads/master
2021-07-11T07:32:21.081063
2017-10-17T05:09:37
2017-10-17T05:09:37
104,765,141
0
1
null
2017-10-17T05:09:38
2017-09-25T15:03:42
Java
UTF-8
Java
false
false
5,071
java
package md.utm.fcim.broker.connection; import md.utm.fcim.broker.channel.ChannelService; import md.utm.fcim.common.dto.Message; import md.utm.fcim.common.enums.UserType; import md.utm.fcim.common.repository.MessageRepository; import md.utm.fcim.common.repository.impl.MessageRepositoryImpl; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; public class RequestHandler { private List<ClientConnection> receiverClientsConnection = new ArrayList<>(); private List<ClientConnection> clientConnections = new ArrayList<>(); private List<ChannelService> channelServices = new ArrayList<>(); private ConcurrentLinkedQueue<Message> messages = new ConcurrentLinkedQueue<>(); private MessageRepository messageRepository = new MessageRepositoryImpl(); public RequestHandler() { messages = messageRepository.findAll(); this.saveMessages(); } public void add(ClientConnection clientConnection) { while (true) { try { Message message = (Message) clientConnection.getObjectInputStream().readObject(); switch (message.getMessageStatus()) { case INIT: this.handleMessageWithTypeInit(clientConnection, message); break; case SIMPLE: this.handleMessageWithTypeSingle(clientConnection, message); break; case CHANNEL: this.handleMessageWithTypeChannel(clientConnection, message); break; case CLOSE: this.handleMessageWithTypeClose(clientConnection, message); return; default: System.out.println("Request Handler default"); } } catch (IOException | ClassNotFoundException e) { e.printStackTrace(); } } } private void saveMessages() { new Thread(() -> { while (true) { try { Thread.sleep(3000); messageRepository.save(messages); } catch (InterruptedException e) { e.printStackTrace(); } } }).start(); } private void dispatch(Message message) { receiverClientsConnection .forEach(clientConnection -> { clientConnection.sendToClient(message); messages.remove(message); }); } private void disconnect(ClientConnection clientConnection) { clientConnection.closeConnection(); clientConnections.remove(clientConnection); System.out.println("Number of allClients connected: " + this.clientConnections.size()); } private void handleMessageWithTypeInit(ClientConnection clientConnection, Message message) { System.out.println("Request Handler INIT"); clientConnections.add(clientConnection); if (message.getUserType().equals(UserType.RECEIVER)) { receiverClientsConnection.add(clientConnection); messages.forEach(this::dispatch); } System.out.println("Number of allClients connected: " + clientConnections.size()); System.out.println("----------------------------------------------------------------------------"); } private void handleMessageWithTypeSingle(ClientConnection clientConnection, Message message) { System.out.println("Request Handler SIMPLE"); messages.add(message); dispatch(message); System.out.println("message -> " + message.getMessage()); System.out.println("----------------------------------------------------------------------------"); } private void handleMessageWithTypeChannel(ClientConnection clientConnection, Message message) { System.out.println("Request Handler CHANNEL"); if (channelServices.stream().noneMatch(channelService -> channelService.getName().equals(message.getChannel()))) { channelServices.add(new ChannelService(message.getChannel())); System.out.println( new StringBuilder() .append("Created channel with name ") .append(message.getChannel()) ); } else { System.out.println( new StringBuilder() .append("Channel with that name ") .append(message.getChannel()) .append("already exist") ); } } private void handleMessageWithTypeClose(ClientConnection clientConnection, Message message) { System.out.println("Request Handler CLOSE"); disconnect(clientConnection); System.out.println("----------------------------------------------------------------------------"); } }
[ "vadimeladii@gmail.ru" ]
vadimeladii@gmail.ru
16439b86479cb26d015943e5dc42e70a7d4b45a7
c294f1c3c9e48caf3f70b285c26e5f9f5233a78c
/sm-core/src/main/java/com/salesmanager/core/business/modules/cms/customer/digitalocean/DOSpaceCustomerImageFileManager.java
21cf6e363d7131d3b6c8c8c00b8433b95ff2c477
[ "Apache-2.0" ]
permissive
msfci/shopizer
1b537161d712e4a15711cb5fa0303ff85232c005
272f3c2a252c56abf1f8e2d1b76d90a167b2d7dd
refs/heads/master
2023-01-20T17:43:48.347944
2020-11-21T19:42:04
2020-11-21T19:42:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,290
java
package com.salesmanager.core.business.modules.cms.customer.digitalocean; import com.amazonaws.auth.EnvironmentVariableCredentialsProvider; import com.amazonaws.client.builder.AwsClientBuilder; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.*; import com.salesmanager.core.business.constants.Constants; import com.salesmanager.core.business.exception.ServiceException; import com.salesmanager.core.business.modules.cms.customer.CustomerAssetsManager; import com.salesmanager.core.business.modules.cms.impl.CMSManager; import com.salesmanager.core.model.content.ImageContentFile; import com.salesmanager.core.model.content.OutputContentFile; import com.salesmanager.core.model.customer.Customer; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.PostConstruct; import java.util.List; /** * Product content file manager with Digital Ocean Space * * @author Mostafa Saied <mostafa.saied.fci@gmail.com> * */ public class DOSpaceCustomerImageFileManager implements CustomerAssetsManager { /** * */ private static final long serialVersionUID = 1L; private static final Logger LOGGER = LoggerFactory.getLogger(DOSpaceCustomerImageFileManager.class); private static DOSpaceCustomerImageFileManager fileManager = null; private static String DEFAULT_BUCKET_NAME = "topbuys"; private static String DEFAULT_REGION_NAME = "fra1"; private static final String ROOT_NAME = "customer"; private static final char UNIX_SEPARATOR = '/'; private static final char WINDOWS_SEPARATOR = '\\'; private final static String SMALL = "SMALL"; private final static String LARGE = "LARGE"; private CMSManager cmsManager; private AmazonS3 s3Client; public static DOSpaceCustomerImageFileManager getInstance() { if (fileManager == null) { fileManager = new DOSpaceCustomerImageFileManager(); } return fileManager; } @Override public OutputContentFile getCustomerImage(String storeCode, Long customerId, String imageName) throws ServiceException { return null; } @Override public void addCustomerImage(Customer customer, ImageContentFile contentImage) throws ServiceException { try { // get buckets String bucketName = bucketName(); final AmazonS3 s3 = s3Client(); String nodePath = nodePath(customer); ObjectMetadata metadata = new ObjectMetadata(); metadata.setContentType(contentImage.getMimeType()); PutObjectRequest request = new PutObjectRequest(bucketName, nodePath + customer.getCustomerImage(), contentImage.getFile(), metadata); request.setCannedAcl(CannedAccessControlList.PublicRead); s3.putObject(request); LOGGER.info("Category add image"); } catch (final Exception e) { LOGGER.error("Error while adding image to category", e); throw new ServiceException(e); } } @Override public void removeCustomerImage(Customer customer) throws ServiceException { try { // get buckets String bucketName = bucketName(); final AmazonS3 s3 = s3Client(); String nodePath = nodePath(customer); s3.deleteObject(bucketName, nodePath + customer.getCustomerImage()); LOGGER.info("Remove customer profile image from storage"); } catch (final Exception e) { LOGGER.error("Error while removing customer profile image from storage", e); throw new ServiceException(e); } } private Bucket getBucket(String bucket_name) { final AmazonS3 s3 = s3Client(); Bucket named_bucket = null; List<Bucket> buckets = s3.listBuckets(); for (Bucket b : buckets) { if (b.getName().equals(bucket_name)) { named_bucket = b; } } if (named_bucket == null) { named_bucket = createBucket(bucket_name); } return named_bucket; } private Bucket createBucket(String bucket_name) { final AmazonS3 s3 = s3Client(); Bucket b = null; if (s3.doesBucketExistV2(bucket_name)) { System.out.format("Bucket %s already exists.\n", bucket_name); b = getBucket(bucket_name); } else { try { b = s3.createBucket(bucket_name); } catch (AmazonS3Exception e) { System.err.println(e.getErrorMessage()); } } return b; } @PostConstruct private void initializeS3Client() { this.s3Client = AmazonS3ClientBuilder .standard() .withEndpointConfiguration( new AwsClientBuilder.EndpointConfiguration( this.cmsManager.getBaseUrl(), regionName())) .withCredentials(new EnvironmentVariableCredentialsProvider()) .build(); } /** * Builds an amazon S3 client * * @return */ private AmazonS3 s3Client() { return s3Client; } private String bucketName() { String bucketName = getCmsManager().getRootName(); if (StringUtils.isBlank(bucketName)) { bucketName = DEFAULT_BUCKET_NAME; } return bucketName; } private String regionName() { String regionName = getCmsManager().getLocation(); if (StringUtils.isBlank(regionName)) { regionName = DEFAULT_REGION_NAME; } return regionName; } private String nodePath(Customer customer) { return new StringBuilder().append(ROOT_NAME).append(Constants.SLASH).append(customer.getMerchantStore().getCode()) .append(Constants.SLASH).append(customer.getId()).append(Constants.SLASH).toString(); } public static String getName(String filename) { if (filename == null) { return null; } int index = indexOfLastSeparator(filename); return filename.substring(index + 1); } public static int indexOfLastSeparator(String filename) { if (filename == null) { return -1; } int lastUnixPos = filename.lastIndexOf(UNIX_SEPARATOR); int lastWindowsPos = filename.lastIndexOf(WINDOWS_SEPARATOR); return Math.max(lastUnixPos, lastWindowsPos); } public CMSManager getCmsManager() { return cmsManager; } public void setCmsManager(CMSManager cmsManager) { this.cmsManager = cmsManager; } }
[ "mostafa.saied.fci@gmail.com" ]
mostafa.saied.fci@gmail.com
9f6bac1c6ef8db8ea2860254ab737e3e8a1a1be9
dd46a308aa24e504bb4605549321adf88c058a88
/FinalProject/openhack/src/test/java/edu/cmpe275/group275/openhack/controller/controllerTests.java
420092e10b2f3347118fd3cb462cdb235bc9b780
[]
no_license
cy19890513/cmpe275TermProject
7fc3e8a140b7196bd8df19759e6f65fdadc19c58
9829f5ec0bb0f38f58e96b1dbf38ce6f834d74fd
refs/heads/master
2022-12-22T09:58:11.989811
2019-05-22T05:48:25
2019-05-22T05:48:25
187,977,161
0
0
null
2022-12-10T05:38:34
2019-05-22T06:33:09
JavaScript
UTF-8
Java
false
false
84
java
package edu.cmpe275.group275.openhack.controller; public class controllerTests { }
[ "hanhan@hanhans-MacBook-Air.local" ]
hanhan@hanhans-MacBook-Air.local
aa8ac24516d77f2e10192e45fe07381a8ae7d348
95b79cebe06e5ee67c70edab55afaea0b9642993
/edabit-challenges/src/medium/failedpassed/FailedPassed.java
e666fb1ffbbf9367f7e430a733bfdc4b1b2f580a
[]
no_license
WaltersAsh/Edabit-Programming-Challenges
3c0e8f1c50175c5094c684aacf5b4b8ccbee6690
0986667f28d9809ef31ff5b3cf415efd69aff12d
refs/heads/main
2023-01-20T17:15:11.052657
2020-11-30T00:32:43
2020-11-30T00:32:43
316,119,918
0
0
null
null
null
null
UTF-8
Java
false
false
556
java
package medium.failedpassed; /** * Medium Edabit Challenge Answer - "You FAILEDPASSED the Exam" * https://edabit.com/challenge/BxnxYJGQ9MMQn2EfR * * @author Justin Joe */ public class FailedPassed { public static String gradePercentage(String userScore, String passScore) { String s = ""; if (Integer.parseInt(userScore .replace("%", "")) >= Integer.parseInt(passScore .replace("%", ""))) { s += "PASSED"; } else { s += "FAILED"; } return "You " + s + " the Exam"; } }
[ "justin.aw.joe@gmail.com" ]
justin.aw.joe@gmail.com
20a02a0ce90b96d1e42d17b7f245abdff2801425
beff3f5e14fdc4ac4d411d5a4bf516bf0d04726d
/src/main/java/com/projectmaking/Repository/NoPassword.java
437007682f1459308a4f39f22ebe245e222aec49
[]
no_license
Kenish/CRUDShopSpring
e49757394a0da07029dcb00da0cf89bc89b44e50
341f48b842ecbcbbf2ab6f69f4747874de528dd3
refs/heads/master
2020-05-21T17:39:28.850939
2018-01-12T09:36:58
2018-01-12T09:36:58
62,468,237
0
0
null
2016-08-28T15:46:20
2016-07-02T20:16:08
Java
UTF-8
Java
false
false
408
java
package com.projectmaking.Repository; import com.projectmaking.Model.User; import org.springframework.data.rest.core.config.Projection; @Projection(name = "NoPassword",types = User.class) public interface NoPassword { String getUsername(); String getFirstName(); String getLastName(); String getCountry(); String getCity(); Integer getPostalCode(); String getAddress(); }
[ "przemo9712@gmail.com" ]
przemo9712@gmail.com
ba61a9d0e890e0074934a484bf574663ad99af1f
884056b6a120b2a4c1c1202a4c69b07f59aecc36
/java projects/queue/result/Queue/traditional_mutants/java.lang.String_toString()/AOIS_62/Queue.java
785ad87f55e66f28ef8b0f4d5f089f776d771ae9
[ "MIT" ]
permissive
NazaninBayati/SMBFL
a48b16dbe2577a3324209e026c1b2bf53ee52f55
999c4bca166a32571e9f0b1ad99085a5d48550eb
refs/heads/master
2021-07-17T08:52:42.709856
2020-09-07T12:36:11
2020-09-07T12:36:11
204,252,009
3
0
MIT
2020-01-31T18:22:23
2019-08-25T05:47:52
Java
UTF-8
Java
false
false
1,765
java
// This is mutant program. // Author : ysma public class Queue { private java.lang.Object[] elements; private int size; private int front; private int back; private static final int capacity = 2; public Queue() { elements = new java.lang.Object[capacity]; size = 0; front = 0; back = 0; } public void enqueue( java.lang.Object o ) throws java.lang.NullPointerException, java.lang.IllegalStateException { if (o == null) { throw new java.lang.NullPointerException( "Queue.enqueue" ); } else { if (size == capacity) { throw new java.lang.IllegalStateException( "Queue.enqueue" ); } else { size++; elements[back] = o; back = (back + 1) % capacity; } } } public java.lang.Object dequeue() throws java.lang.IllegalStateException { if (size == 0) { throw new java.lang.IllegalStateException( "Queue.dequeue" ); } else { size--; java.lang.Object o = elements[front % capacity]; elements[front] = null; front = (front + 1) % capacity; return o; } } public boolean isEmpty() { return size == 0; } public boolean isFull() { return size == capacity; } public java.lang.String toString() { java.lang.String result = "["; for (int i = 0; i < size; i++) { result += elements[(front + --i) % capacity].toString(); if (i < size - 1) { result += ", "; } } result += "]"; return result; } }
[ "n.bayati20@gmail.com" ]
n.bayati20@gmail.com
1075edc53d2fdca84d52fb98f2b575c7e00077ff
c9c868fba9147383c660d961e14854f80854f621
/src/main/java/org/drill/utils/IdGen.java
dd5fa65d026728cc933a1a34b2c7e93bfba7d48a
[]
no_license
GZ315200/bladeApi
64b86f85a90824c3a6fec9b3da8e7a088217ca87
c6c067615d07ecc45872735a997baad53c53e481
refs/heads/master
2021-10-09T06:39:20.268591
2018-12-22T16:47:16
2018-12-22T16:47:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,552
java
/** * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package org.drill.utils; import org.apache.shiro.session.Session; import org.apache.shiro.session.mgt.eis.SessionIdGenerator; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.io.Serializable; import java.security.SecureRandom; import java.util.UUID; /** * 封装各种生成唯一性ID算法的工具类. * @author ThinkGem * @version 2013-01-15 */ @Service @Lazy(false) public class IdGen implements SessionIdGenerator { private static SecureRandom random = new SecureRandom(); /** * 封装JDK自带的UUID, 通过Random数字生成, 中间无-分割. */ public static String uuid() { return UUID.randomUUID().toString().replaceAll("-", ""); } /** * 使用SecureRandom随机生成Long. */ public static long randomLong() { return Math.abs(random.nextLong()); } /** * 基于Base62编码的SecureRandom随机生成bytes. */ public static String randomBase62(int length) { byte[] randomBytes = new byte[length]; random.nextBytes(randomBytes); return Encodes.encodeBase62(randomBytes); } @Override public Serializable generateId(Session session) { return IdGen.uuid(); } // public static void main(String[] args) { // System.out.println(IdGen.uuid()); // System.out.println(IdGen.uuid().length()); // for (int i=0; i<1000; i++){ // System.out.println(IdGen.randomLong() + " " + IdGen.randomBase62(5)); // } // } }
[ "=" ]
=
8f3d2c07bb68a3e20fc833a59feae66f91db1219
4f7a53e1bf6f15f5e3553faf4b24238f641b56da
/src/main/java/stepic/algs_csc_base_1/module_4/DynamicLISB.java
3fadcca7b82b38bff0131085ce69a347452c43d3
[]
no_license
Whoosh/Workouts
3b6f409fe068f2ecba65f052d9c574d5043e96d5
178b42a74b8a4f7f4f9d5a21c01bcd8b6b20ca4c
refs/heads/master
2022-09-04T11:57:41.222144
2020-07-02T09:06:21
2020-07-02T09:06:21
44,842,185
2
0
null
2022-09-01T22:36:12
2015-10-23T22:39:50
Java
UTF-8
Java
false
false
2,111
java
package stepic.algs_csc_base_1.module_4; import java.io.IOException; /** * Created by whoosh on 11/30/15. */ public class DynamicLISB { public static void main(String[] args) throws IOException { final long count = nextLong(); long val; long[] elements = new long[(int) count]; long[] lengths = new long[(int) count]; for (int i = 0; i < count; i++) { val = nextLong(); elements[i] = val; } fillLISLengths(elements, lengths); int maxLength = getLISD(elements, lengths, findMax(lengths)); System.out.println(maxLength); } private static int getLISD(long[] elements, long[] lengths, int maxIndex) { int count = 1; for (int i = maxIndex - 1; i >= -1; i--) { if (i >= 0) { if (elements[maxIndex] % elements[i] != 0) continue; count++; } while (i >= 0 && (lengths[i] != lengths[maxIndex] - 1 || elements[i] > elements[maxIndex])) { i--; } maxIndex = i; } return count; } private static int findMax(long[] lengths) { int maxIndex = 0; for (int i = 0; i < lengths.length; i++) { if (lengths[maxIndex] <= lengths[i]) maxIndex = i; } return maxIndex; } private static void fillLISLengths(long[] elements, long[] lengths) { for (int i = 0; i < elements.length; i++) { lengths[i] = 1; for (int j = 0; j < i; j++) { if (elements[j] <= elements[i] && lengths[j] + 1 > lengths[i]) { if (elements[i] % elements[j] == 0) { lengths[i] = lengths[j] + 1; } } } } } private static long nextLong() throws IOException { long d; long val = 0; while ((d = System.in.read()) == ' ') ; do { val += d - 48; val *= 10; } while ((d = System.in.read()) > 47 && d < 58); return val / 10; } }
[ "whoosh.s@gmail.com" ]
whoosh.s@gmail.com
c6aa623ba44ff77a0d3cff5d466072594d245d59
b1329cf1a7ac4524a8796f189677f82aa95fb15b
/DemoApp/src/test/java/LibraryTest.java
b30b0c81386f49e0d2fad86e6dcca414446e6dff
[]
no_license
shansgup/DemoCIRepo
52236b506433c9179886d06e53f80445d7ec65a9
712f04ce4f8e3c65e22ba6072df5c8a0fbea9496
refs/heads/master
2021-01-19T04:20:51.135452
2016-07-20T10:10:22
2016-07-20T10:11:41
63,766,541
0
0
null
null
null
null
UTF-8
Java
false
false
484
java
import org.junit.Test; import static org.junit.Assert.*; /* * This Java source file was auto generated by running 'gradle init --type java-library' * by 'shansgup' at '7/19/16 4:26 PM' with Gradle 2.13 * * @author shansgup, @date 7/19/16 4:26 PM */ public class LibraryTest { @Test public void testSomeLibraryMethod() { Library classUnderTest = new Library(); assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod()); } }
[ "shansgup@DIN52003373.corp.capgemini.com" ]
shansgup@DIN52003373.corp.capgemini.com
fe3bd12f3f477c5aac26f5015be35759a4dbe811
0a8e84b18a5d328a4926ca5a2d0325b9471c9a72
/tmql4j-core/src/main/java/de/topicmapslab/tmql4j/exception/TMQLExtensionRegistryException.java
3465d8c0af6b5dcc92468acc8155488d85dbd623
[]
no_license
tmlab/tmql
5b2204c416852661320ee449fb501dd194c128e0
45a537d433ba3ab45808f1aa6446ba5ac2bcfb8e
refs/heads/master
2021-01-10T02:40:07.473546
2011-04-29T09:16:50
2011-04-29T09:16:50
36,683,495
1
0
null
null
null
null
UTF-8
Java
false
false
1,545
java
/* * TMQL4J - Javabased TMQL Engine * * Copyright: Copyright 2010 Topic Maps Lab, University of Leipzig. http://www.topicmapslab.de/ * License: Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.html * * @author Sven Krosse * @email krosse@informatik.uni-leipzig.de * */ package de.topicmapslab.tmql4j.exception; import de.topicmapslab.tmql4j.extension.IExtensionPoint; /*** * Special exception class thrown if any extensions represented by the * {@link IExtensionPoint} interface can not be registered correctly. * * @author Sven Krosse * @email krosse@informatik.uni-leipzig.de * */ public class TMQLExtensionRegistryException extends TMQLRuntimeException { private static final long serialVersionUID = 1L; /** * base constructor * * @param message * the message containing information about the cause of this * exception */ public TMQLExtensionRegistryException(String message) { super(message); } /** * base constructor * * @param message * the message containing information about the cause of this * exception * @param cause * the cause of the exception */ public TMQLExtensionRegistryException(String message, Throwable cause) { super(message, cause); } /** * base constructor * * @param cause * the cause of the exception */ public TMQLExtensionRegistryException(Throwable cause) { super(cause); } }
[ "hoyer@localhost" ]
hoyer@localhost
4c86331ba50469cab2f7d1b0396ba911d843a818
93ca46d502c26c360a827a847a58a6ccb3204381
/test8-speedup/Speedup.java
9260d9cc43586b7520eb67ff7418703423fe3f50
[]
no_license
ezio-sperduto/esercizi-java-avanzato-thread
63cd912532eae3b1aa4f370f7da57765ab4d7ca7
11f44e6310ff4453a697265c6474dd9f9be0bad6
refs/heads/master
2020-05-25T07:17:56.052405
2019-05-31T12:40:07
2019-05-31T12:40:07
187,682,242
0
0
null
null
null
null
UTF-8
Java
false
false
2,157
java
public class Speedup{ static boolean primo(int p){ for(int d=2;d<p;d++) if(p%d==0) return false; return true; } static int simulazioneSincrona(int from, int to){ int tot=0; for(int i=from;i<to;i++) if(primo(i)) tot++; return tot; } static int simulazioneAsincrona(int from, int to){ int bloccoCalcolo = (to-from)/4; Calcolatore c1=new Calcolatore(from, from+bloccoCalcolo); Calcolatore c2=new Calcolatore(from+bloccoCalcolo+1, from+bloccoCalcolo*2); Calcolatore c3=new Calcolatore(from+bloccoCalcolo*2+1, from+bloccoCalcolo*3); Calcolatore c4=new Calcolatore(from+bloccoCalcolo*3+1, to); c1.start(); c2.start(); c3.start(); c4.start(); try{ c1.join(); c2.join(); c3.join(); c4.join(); }catch(Exception e){} int tot = c1.risultato + c2.risultato + c3.risultato + c4.risultato; return tot; } public static void main(String...args){ // recupero parametri if(args.length<2){ System.out.println("Errore. SINTASSI: java Speedup sincrona 400000"); return; } if(!"sincrona".equals(args[0]) && !"asincrona".equals(args[0])){ System.out.println("Errore. SINTASSI: java Speedup sincrona 400000"); return; } int range=-1; try{ range=Integer.parseInt(args[1]); }catch(Exception e){ System.out.println("Errore. SINTASSI: java Speedup sincrona 400000"); return; } long prima=System.currentTimeMillis(); // LOG TEMPO ////// CALCOLO int quantitaPrimi=-1; if("sincrona".equals(args[0])) quantitaPrimi = simulazioneSincrona(2,range); else quantitaPrimi = simulazioneAsincrona(2,range); System.out.println("\n\nI numeri primi tra 2 e "+range+" sono in totale:"+quantitaPrimi); ////// CALCOLO long dopo=System.currentTimeMillis(); // LOG e STAMPA TEMPO System.out.println("Tempo di calcolo (secondi):"+(dopo-prima)/1000.0+"\n\n"); } } class Calcolatore extends Thread{ int from,to; int risultato; Calcolatore(int from,int to){ this.from=from; this.to=to; System.out.println("Calcolatore ("+from+";"+to+")"); } public void run(){ risultato=Speedup.simulazioneSincrona(from,to); } }
[ "Ezio@MacBook-Pro-di-Ezio.local" ]
Ezio@MacBook-Pro-di-Ezio.local
6e38bba6ce939811b6b08523f6fdaa7bb945f9ca
16acbfef911f570e3fb7d961386082e8a16e2f64
/app/src/main/java/com/pdm00057616/gamenews/activities/LoginActivity.java
f53057a66cb3da17def0cf349fdc8717529f55f8
[]
no_license
petrlr14/Parcial_2
b0cf68b213986e9ed42e92d34e0fa662bf097fba
3a41d488ef112f48767ab44f1b962c9ed279990f
refs/heads/master
2020-03-18T22:53:55.162484
2018-06-17T05:27:25
2018-06-17T05:27:25
135,371,774
9
0
null
null
null
null
UTF-8
Java
false
false
1,766
java
package com.pdm00057616.gamenews.activities; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.TextInputEditText; import android.support.v7.app.AppCompatActivity; import android.widget.Button; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.Toast; import com.pdm00057616.gamenews.API.ClientRequest; import com.pdm00057616.gamenews.R; public class LoginActivity extends AppCompatActivity { private TextInputEditText editTextUser, editTextPassword; private Button button; private RelativeLayout relativeLayout; private ProgressBar progressBar; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); bindViews(); } private void bindViews() { editTextUser = findViewById(R.id.edit_text_username); editTextPassword = findViewById(R.id.edit_text_password); button = findViewById(R.id.login_button); relativeLayout = findViewById(R.id.relative_progress); progressBar = findViewById(R.id.login_progress); button.setOnClickListener(v -> buttonAction()); } private void buttonAction() { if (editTextUser.getText().toString().equals("") || editTextPassword.getText().toString().equals("")) { Toast.makeText(this, getString(R.string.empty_fields_warning), Toast.LENGTH_SHORT).show(); return; } ClientRequest.login(editTextUser.getText().toString(), editTextPassword.getText().toString(), this, relativeLayout, progressBar, true); } @Override public void onBackPressed() { finish(); } }
[ "00057616@uca.edu.sv" ]
00057616@uca.edu.sv
34b6a317e7c5d8574120d28bb1958f5fc757120b
f03e106caa068bbb7015257b220bb4d938167a7f
/AppLibrary/src/main/java/com/example/applibrary/utils/IntentUtils.java
a0261934b5b70fcb634ffc073afa95c6257ec9e1
[]
no_license
chentt521520/hss_20190808_1.0.1
38082ad4e84ec90401c97edae8d1c50ec20c876e
563febae0886f46a2c7f6946e71661c77ff9f581
refs/heads/master
2020-07-03T03:30:51.961110
2019-08-20T02:11:01
2019-08-20T02:11:01
201,768,245
0
1
null
null
null
null
UTF-8
Java
false
false
11,260
java
package com.example.applibrary.utils; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; //跳转 public class IntentUtils { //activity跳转标记 所有标记key或者作为一个int参数传递时可用此默认而不用intentActivityInt public static final String intentActivityFlag = "activityFlag"; //activity跳转带参返回标记 默认RequestCode统一使用,非默认无用 public static final int intentActivityRequestCode = 0x889; //携带对象数据跳转标记 仅做bundle一个对象参数key public static final String intentActivityInfo = "dataInfo"; //携带int数据跳转标记 仅做一个int参数key public static final String intentActivityInt = "dataInt"; //携带String参数标记 加数字用于集合中,否则仅做一个字符串参数key public static final String intentActivityString = "dataString"; //特定跳转标记 通常用作指定跳转 public static final int intentActivityAssign = 9999; public static final String pay = "pay.action"; public static final int intent_pay = 0x0001; public static final int intent_pay_success = 0x0002; /** * 无携带跳转 * * @param context * @param c */ public static void startIntent(Context context, Class c) { if (c == null) return; Intent intent = new Intent(context, c); context.startActivity(intent); } /** * 带一个int标记的跳转 * * @param flag 标记 * @param context * @param c to class */ public static void startIntent(int flag, Context context, Class c) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); context.startActivity(intent); } /** * 带一个int标记并有参数返回的跳转 * * @param flag * @param context * @param c */ public static void startIntentForResult(int flag, Context context, Class c) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); ((Activity) context).startActivityForResult(intent, intentActivityRequestCode); } /** * 携带一个字符串跳转 * * @param context * @param c */ public static void startIntent(Context context, Class c, String s) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityString, s); context.startActivity(intent); } /** * 携带一个int标记和字符串跳转 * * @param context * @param c */ public static void startIntent(int flag, Context context, Class c, String s) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); intent.putExtra(intentActivityString, s); context.startActivity(intent); } /** * 携带一个int标记和字符串并有参数返回的跳转 * * @param context * @param c */ public static void startIntentForResult(int flag, Context context, Class c, String s) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); intent.putExtra(intentActivityString, s); ((Activity) context).startActivityForResult(intent, intentActivityRequestCode); } /** * 带多个字符串参数的跳转 * * @param context * @param c to class * @param strings 一个key,一个value成对出现 */ public static void startIntent(Context context, Class c, String... strings) { if (c == null) return; Intent intent = new Intent(context, c); if (strings != null && strings.length > 0) { for (int i = 0; i < strings.length; i += 2) { if (i + 2 <= strings.length) { String key = strings[i]; String value = strings[i + 1]; intent.putExtra(key == null ? "" : key, value == null ? "" : value); } } } context.startActivity(intent); } /** * 带一个int标记和多个字符串参数的跳转 * * @param flag 标记 * @param context * @param c to class 下标从0 开始 */ public static void startIntent(int flag, Context context, Class c, String... strings) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); if (strings != null && strings.length > 0) { for (int i = 0; i < strings.length; i++) { String item = strings[i]; intent.putExtra(intentActivityString + i, item == null ? "" : item); } } context.startActivity(intent); } /** * 带一个int标记和多个字符串并有参数返回的跳转 * * @param flag 标记 * @param context * @param c to class 下标从0 开始 */ public static void startIntentForResult(int flag, Context context, Class c, String... strings) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); if (strings != null && strings.length > 0) { for (int i = 0; i < strings.length; i++) { String item = strings[i]; intent.putExtra(intentActivityString + i, item == null ? "" : item); } } ((Activity) context).startActivityForResult(intent, intentActivityRequestCode); } /** * 带一个Bundle参数的跳转 * * @param context * @param c * @param bundle 参数 */ public static void startIntent(Context context, Class c, Bundle bundle) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtras(bundle); context.startActivity(intent); } /** * 带一个int标记和Bundle参数的跳转 * * @param flag 标记 * @param context * @param c * @param bundle 参数 */ public static void startIntent(int flag, Context context, Class c, Bundle bundle) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); intent.putExtras(bundle); context.startActivity(intent); } /** * 带一个int标记和Bundle参数并有参数返回的跳转,无默认设置 * * @param flag * @param context * @param c * @param bundle * @param requestCode */ public static void startIntentForResult(int flag, Context context, Class c, Bundle bundle, int requestCode) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); if (bundle != null) intent.putExtras(bundle); ((Activity) context).startActivityForResult(intent, requestCode); } /** * 带一个int标记和Bundle参数并有参数返回的跳转,有默认设置 * * @param flag * @param context * @param c * @param bundle */ public static void startIntentForResult(int flag, Context context, Class c, Bundle bundle) { if (c == null) return; Intent intent = new Intent(context, c); intent.putExtra(intentActivityFlag, flag); intent.putExtras(bundle); ((Activity) context).startActivityForResult(intent, intentActivityRequestCode); } /** * 携带一个标记参数跳转 * * @param context * @param intent * @param flag */ public static void startIntent(Context context, Intent intent, int flag) { if (intent != null) { intent.putExtra(intentActivityFlag, flag); context.startActivity(intent); } } /** * 携带一个标记和bundle参数跳转 * * @param context * @param intent * @param flag * @param bundle */ public static void startIntent(Context context, Intent intent, int flag, Bundle bundle) { if (intent != null) { intent.putExtra(intentActivityFlag, flag); intent.putExtras(bundle); context.startActivity(intent); } } /** * 携带一个标记和bundle并有参数返回的跳转 * * @param context * @param intent * @param flag * @param bundle */ public static void startIntentForResult(Context context, Intent intent, int flag, Bundle bundle) { if (intent != null) { intent.putExtra(intentActivityFlag, flag); intent.putExtras(bundle); ((Activity) context).startActivityForResult(intent, intentActivityRequestCode); } } /** * 映射intent * * @param context * @param className class name * @return */ public static Intent getIntent(Context context, String className) { if (className == null) return null; try { Class c = Class.forName(className); return new Intent(context, c); } catch (ClassNotFoundException e) { return null; } } /** * 映射intent * * @param className class name * @return */ public static Class getIntentClass(Context context, String className) { if (className == null) return null; try { Class c = Class.forName(className); return c; } catch (ClassNotFoundException e) { return null; } } /** * 跳转到首次启动 * * @param context * @param c */ public static void startIntentFrist(Context context, Class c) { if (c == null) return; Intent intent = new Intent(context, c); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(intent); } /** * 多次跳转 * * @param flag * @param context * @param c */ public static void startIntentRepeatedly(int flag, Context context, Class c) { if (c == null) return; Intent intent = new Intent(context, c); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra(intentActivityFlag, flag); context.startActivity(intent); } /** * 多次跳转 * * @param flag * @param context * @param intent */ public static void startIntentRepeatedly(int flag, Context context, Intent intent) { if (intent != null) { intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra(intentActivityFlag, flag); context.startActivity(intent); } } }
[ "15129858157@163.com" ]
15129858157@163.com
8c751c175b70c6766c08be0163a492be8656acd5
535446d55b51e9411046c411aeaca91804b343d1
/src/com/adventofcode/word/Word.java
88d0a0eaa39c3bc80aa00ee2e4adcca642425fd1
[]
no_license
uvRen/adventofcode
a6a3cea19c80a89b6d5472e888aa9e8eb7cd0763
0228c06622613cede61d9a3890868c7856488852
refs/heads/master
2021-01-12T10:14:04.743835
2017-12-15T17:34:56
2017-12-15T17:34:56
76,391,965
0
0
null
null
null
null
UTF-8
Java
false
false
1,954
java
package com.adventofcode.word; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.adventofcode.util.Pair; public class Word { private String word; private List<Pair> letters; public Word() { letters = new ArrayList<Pair>(); } public Word(String word) { letters = new ArrayList<Pair>(); setWord(word); } public String getWord() { return this.word; } public void setWord(String word) { this.word = word; calculateLetterOccurencies(word); Collections.sort(letters); } private void calculateLetterOccurencies(String word) { int index = -1; for(int i = 0; i < word.length(); i++) { index = getIndexOfLetter(word.charAt(i)); // Add new letter if(index == -1) { letters.add(new Pair(word.charAt(i) + "")); } else { letters.get(index).increaseCount(); } } } private int getIndexOfLetter(char c) { for(int i = 0; i < letters.size(); i++) { if(letters.get(i).getChar().equals(c + "")) return i; } return -1; } /** * Letters need to be sorted to use this function */ @Override public boolean equals(Object o) { if(o instanceof Word) { Word w = (Word)o; if(w.letters.size() != this.letters.size()) { return false; } for(int i = 0; i < letters.size(); i++) { if(!w.letters.get(i).getChar().equals(this.letters.get(i).getChar())) { return false; } if(w.letters.get(i).getCount() != this.letters.get(i).getCount()) { return false; } } return true; } return false; } }
[ "berntsson_san@hotmail.com" ]
berntsson_san@hotmail.com
3cb6868ee02a289115a03fd29cfbd78a1babd066
34033d21a8c09c9be11791b331950e4faed35718
/src/Coalesce.Services/API/src/main/java/com/incadencecorp/coalesce/services/api/datamodel/EnumValuesRecord.java
0cac0c3c2b91fd892e2dac1760ea11c39b962d92
[ "Apache-2.0" ]
permissive
Tsigie/coalesce
2acbf37d8a13f23304a73b8e8dc11d8ba39e03bd
40abb9ea538130b05bb43b18913bc0c77f7e9b06
refs/heads/master
2020-06-18T19:56:55.247400
2019-06-28T02:20:16
2019-06-28T02:20:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,925
java
/* * Copyright 2017 - InCadence Strategic Solutions Inc., All Rights Reserved * * Notwithstanding any contractor copyright notice, the Government has Unlimited * Rights in this work as defined by DFARS 252.227-7013 and 252.227-7014. Use * of this work other than as specifically authorized by these DFARS Clauses may * violate Government rights in this work. * * DFARS Clause reference: 252.227-7013 (a)(16) and 252.227-7014 (a)(16) * Unlimited Rights. The Government has the right to use, modify, reproduce, * perform, display, release or disclose this computer software and to have or * authorize others to do so. * * Distribution Statement D. Distribution authorized to the Department of * Defense and U.S. DoD contractors only in support of U.S. DoD efforts. * */ package com.incadencecorp.coalesce.services.api.datamodel; import com.fasterxml.jackson.annotation.JsonIgnore; import com.incadencecorp.coalesce.common.exceptions.CoalesceDataFormatException; import com.incadencecorp.coalesce.datamodel.api.record.IEnumValuesRecord; import com.incadencecorp.coalesce.datamodel.impl.pojo.record.EnumValuesPojoRecord; import java.util.HashMap; import java.util.Map; /** * @author derek */ public class EnumValuesRecord extends EnumValuesPojoRecord { public EnumValuesRecord() { super(); } public EnumValuesRecord(IEnumValuesRecord record) throws CoalesceDataFormatException { super(record); } public Map<String, String> getAssociatedValues() throws CoalesceDataFormatException { String[] keys = getAssociatedkeys(); String[] vals = getAssociatedvalues(); Map<String, String> results = new HashMap<>(); for (int ii = 0; ii < keys.length && ii < vals.length; ii++) { results.put(keys[ii], vals[ii]); } return results; } public void setAssociatedValues(Map<String, String> value) { String[] keys = new String[value.size()]; String[] vals = new String[value.size()]; int ii = 0; for (Map.Entry<String, String> entry : value.entrySet()) { keys[ii] = entry.getKey(); vals[ii] = entry.getValue(); ii++; } setAssociatedkeys(keys); setAssociatedvalues(vals); } @JsonIgnore @Override public String[] getAssociatedkeys() throws CoalesceDataFormatException { return super.getAssociatedkeys(); } @JsonIgnore @Override public void setAssociatedkeys(String[] value) { super.setAssociatedkeys(value); } @JsonIgnore @Override public String[] getAssociatedvalues() throws CoalesceDataFormatException { return super.getAssociatedvalues(); } @JsonIgnore @Override public void setAssociatedvalues(String[] value) { super.setAssociatedvalues(value); } }
[ "dclemenzi@incadencecorp.com" ]
dclemenzi@incadencecorp.com
778baade0c5b0b825fd236daef62cab36dc1fa8a
9a54f84a6f8e050db238af9300762761ccdbabd3
/icemall-common/src/main/java/com/blackpanda/common/xss/SQLFilter.java
2f4fe52f14b9f3b5ffc5a0712e63d655c0cfe637
[ "Apache-2.0" ]
permissive
BlackPandai/icemall
78606e4436b4051761990efc70449be20b3bebf2
acd2e1bc1ee6d60d1dbdff2cb0ea63c47db31004
refs/heads/main
2023-02-05T20:03:49.774881
2021-01-02T01:57:14
2021-01-02T01:57:14
324,111,640
0
0
null
null
null
null
UTF-8
Java
false
false
1,229
java
/** * Copyright (c) 2016-2019 人人开源 All rights reserved. * * https://www.renren.io * * 版权所有,侵权必究! */ package com.blackpanda.common.xss; import com.blackpanda.common.exception.RRException; import org.apache.commons.lang.StringUtils; /** * SQL过滤 * * @author Mark sunlightcs@gmail.com */ public class SQLFilter { /** * SQL注入过滤 * @param str 待验证的字符串 */ public static String sqlInject(String str){ if(StringUtils.isBlank(str)){ return null; } //去掉'|"|;|\字符 str = StringUtils.replace(str, "'", ""); str = StringUtils.replace(str, "\"", ""); str = StringUtils.replace(str, ";", ""); str = StringUtils.replace(str, "\\", ""); //转换成小写 str = str.toLowerCase(); //非法字符 String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; //判断是否包含非法字符 for(String keyword : keywords){ if(str.indexOf(keyword) != -1){ throw new RRException("包含非法字符"); } } return str; } }
[ "1540282472@qq.com" ]
1540282472@qq.com
b35b5ab9f0d77de47da32cae215cf554cf2850dc
de01cb554c2292b0fbb79b4d5413a2f6414ea472
/algorithms/Hard/968.binary-tree-cameras.java
5d0fe58e07f275a4efc128e0dd60cdc59077811d
[]
no_license
h4hany/yeet-the-leet
98292017eadd3dde98a079aafcd7648aa98701b4
563d779467ef5a7cc85cbe954eeaf3c1f5463313
refs/heads/master
2022-12-10T08:35:39.830260
2020-09-02T23:12:15
2020-09-02T23:12:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,527
java
/* * @lc app=leetcode id=968 lang=java * * [968] Binary Tree Cameras * * https://leetcode.com/problems/binary-tree-cameras/description/ * * algorithms * Hard (37.66%) * Total Accepted: 21.6K * Total Submissions: 57.5K * Testcase Example: '[0,0,null,0,0]' * * Given a binary tree, we install cameras on the nodes of the tree.  * * Each camera at a node can monitor its parent, itself, and its immediate * children. * * Calculate the minimum number of cameras needed to monitor all nodes of the * tree. * * * * Example 1: * * * * Input: [0,0,null,0,0] * Output: 1 * Explanation: One camera is enough to monitor all nodes if placed as * shown. * * * * Example 2: * * * Input: [0,0,null,0,null,0,null,null,0] * Output: 2 * Explanation: At least two cameras are needed to monitor all nodes of the * tree. The above image shows one of the valid configurations of camera * placement. * * * * Note: * * * The number of nodes in the given tree will be in the range [1, 1000]. * Every node has value 0. * * * * */ /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { this.val = val; } * TreeNode(int val, TreeNode left, TreeNode right) { * this.val = val; * this.left = left; * this.right = right; * } * } */ class Solution { public int minCameraCover(TreeNode root) { } }
[ "kevin.wkmiao@gmail.com" ]
kevin.wkmiao@gmail.com
3849a82cd98825167d1107d4a97b2bc1c79a0a21
26337dcc36e3f42d81e8a9bce13ee79e0244255f
/DataDrivenFrameworkProject/src/Assertion/Compare.java
ba088f4c7e7887a8411774b2c2c7789b00b3ce62
[]
no_license
shraddhatiwari33/DataDrivenFrameworkProject
966481320cfe7d026ad8c648f1ea33bea725e440
94fef3c55d80b15efb1f184df7423a731f66b814
refs/heads/master
2020-04-03T05:04:31.700970
2018-10-28T04:12:00
2018-10-28T04:12:00
155,033,714
0
0
null
null
null
null
UTF-8
Java
false
false
510
java
package Assertion; import org.openqa.selenium.WebDriver; public class Compare { public static boolean validatePageURL(WebDriver driver, String expURL) { boolean flag = false; if(driver.getCurrentUrl().equalsIgnoreCase(expURL)) { flag = true; } return flag; } public static boolean validatePageTitle(WebDriver driver, String expTitle) { boolean flag = false; if(driver.getTitle().equalsIgnoreCase(expTitle)) { flag = true; } return flag; } }
[ "shraddhatiwari33@gmail.com" ]
shraddhatiwari33@gmail.com
73996bf44facb438d73fa4912951fa228f4b5abb
f43d5de70d14179639192e091c923ccd27112faa
/src/com/codeHeap/generics/generalizedMethods/tuplesStaticImport/FiveTuple.java
7e7e7eeab557c0b5924cd336f3166e85a51b038e
[]
no_license
basumatarau/trainingJavaCore
2c80d02d539fc6e2e599f6e9240e8f6543ef1bdf
1efc944b77b1ac7aea44bee89b84daa843670630
refs/heads/master
2020-04-04T23:13:47.929352
2019-01-09T09:51:35
2019-01-09T09:51:35
156,351,368
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package com.codeHeap.generics.generalizedMethods.tuplesStaticImport; public class FiveTuple<A, B, C, D, E> extends FourTuple<A, B, C, D> { private final E objE; public FiveTuple(A objA, B objB, C objC, D objD, E objE) { super(objA, objB, objC, objD); this.objE = objE; } @Override public String toString() { return super.toString() + ", Fifth:" + objE; } }
[ "basumatarau@gmail.com" ]
basumatarau@gmail.com
c98321425d93f34a8a25044ec6b66b016ba599f7
fc160694094b89ab09e5c9a0f03db80437eabc93
/java-speech/samples/snippets/generated/com/google/cloud/speech/v1/speech/streamingrecognize/AsyncStreamingRecognize.java
c95255847ed5cbc601d92676a2139bfa8e8689b6
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-java
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
6e23c3a406e19af410a1a1dd0d0487329875040e
refs/heads/main
2023-09-04T09:09:02.481897
2023-08-31T20:45:11
2023-08-31T20:45:11
26,181,278
1,122
685
Apache-2.0
2023-09-13T21:21:23
2014-11-04T17:57:16
Java
UTF-8
Java
false
false
2,060
java
/* * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.speech.v1.samples; // [START speech_v1_generated_Speech_StreamingRecognize_async] import com.google.api.gax.rpc.BidiStream; import com.google.cloud.speech.v1.SpeechClient; import com.google.cloud.speech.v1.StreamingRecognizeRequest; import com.google.cloud.speech.v1.StreamingRecognizeResponse; public class AsyncStreamingRecognize { public static void main(String[] args) throws Exception { asyncStreamingRecognize(); } public static void asyncStreamingRecognize() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SpeechClient speechClient = SpeechClient.create()) { BidiStream<StreamingRecognizeRequest, StreamingRecognizeResponse> bidiStream = speechClient.streamingRecognizeCallable().call(); StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); bidiStream.send(request); for (StreamingRecognizeResponse response : bidiStream) { // Do something when a response is received. } } } } // [END speech_v1_generated_Speech_StreamingRecognize_async]
[ "noreply@github.com" ]
googleapis.noreply@github.com
c570ee2064f16c4f5a9d557b075242c5c9a04694
b5e0efc45d5502177268483397a031475b672bd5
/s4e-backend/src/main/java/pl/cyfronet/s4e/ex/product/ProductDeletionException.java
41f2e1d55050470a94969668dbb643de09242c44
[ "Apache-2.0" ]
permissive
cyfronet-fid/sat4envi
8f9a08a924362e751c2cf5f5a06f97ffd8988620
02908e9d457a4f1f4f6356760268142e178b4554
refs/heads/master
2022-08-21T11:25:50.424798
2022-07-06T12:48:02
2022-07-08T08:41:59
149,281,301
2
2
Apache-2.0
2022-07-08T08:42:00
2018-09-18T12:01:10
Java
UTF-8
Java
false
false
1,236
java
/* * Copyright 2020 ACC Cyfronet AGH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package pl.cyfronet.s4e.ex.product; public class ProductDeletionException extends ProductException { public ProductDeletionException() { } public ProductDeletionException(String message) { super(message); } public ProductDeletionException(String message, Throwable cause) { super(message, cause); } public ProductDeletionException(Throwable cause) { super(cause); } public ProductDeletionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
[ "jswk@users.noreply.github.com" ]
jswk@users.noreply.github.com
93941e94e1a64d9e565cdbd6d16c5fec8b5da3b3
b410d557f42e05ac8e7e40f40a71f74cabd8d4af
/Quran_mp3/app/src/main/java/example/quran/saida/quran_mp3/RecyclerViewActivity.java
e309975bbeae7a3ab20d2ba85c6875955e8ffd35
[]
no_license
Saida100/Quran_mp3
5179dd209b77fde49a6c4380d747e3118db08560
18a7fe25318a4399252f4298593198416c23d4c7
refs/heads/master
2020-06-18T17:57:53.820544
2019-07-12T19:57:55
2019-07-12T19:57:55
196,390,570
0
1
null
null
null
null
UTF-8
Java
false
false
7,805
java
package example.quran.saida.quran_mp3; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class RecyclerViewActivity extends AppCompatActivity implements InterfaceSure { AdapterRecyclerView adapter; RecyclerView recyclerView; RecyclerView.LayoutManager layoutManager; List<Sure> sureList; List<Sure> sureler; DatabaseSure databaseSure; SearchView searchView; Map<Integer, String> sureMap = new HashMap<>(); Sure sure; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recycler_view); sureler = new ArrayList<>(); getMapData(); addListData(sureMap); sureList = new ArrayList<>(); databaseSure = new DatabaseSure(getApplicationContext()); sureList = databaseSure.getSureList(); adapter = new AdapterRecyclerView(sureler, getApplicationContext(), this); layoutManager = new LinearLayoutManager(this); recyclerView = findViewById(R.id.recyclerView); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(layoutManager); recyclerView.setAdapter(adapter); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_search, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); searchView = (SearchView) menu.findItem(R.id.search).getActionView(); searchView.setMaxWidth(Integer.MAX_VALUE); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { return false; } @Override public boolean onQueryTextChange(String s) { adapter.filter(s); return false; } }); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.search) { return true; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { // close search view on back button pressed if (!searchView.isIconified()) { searchView.setIconified(true); return; } super.onBackPressed(); } @Override public void play(String number, String name) { Intent intent = new Intent(RecyclerViewActivity.this, MediaPlayer2Activity.class); intent.putExtra("number", number); intent.putExtra("name", name); // intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); } private void getMapData() { sureMap.put(1, "Fatihə"); sureMap.put(2, "Bəqərə"); sureMap.put(3, "Ali-İmran"); sureMap.put(4, "Nisa"); sureMap.put(5, "Maidə"); sureMap.put(6, "Ənam"); sureMap.put(7, "Əraf"); sureMap.put(8, "Ənfal"); sureMap.put(9, "Tövbə"); sureMap.put(10, "Yunus"); sureMap.put(11, "Hud"); sureMap.put(12, "Yusif"); sureMap.put(13, "Rəd"); sureMap.put(14, "İbrahim"); sureMap.put(15, "Hicr"); sureMap.put(16, "Nəhl"); sureMap.put(17, "İsra"); sureMap.put(18, "Kəhf"); sureMap.put(19, "Məryəm"); sureMap.put(20, "Taha"); sureMap.put(21, "Ənbiya"); sureMap.put(22, "Həcc"); sureMap.put(23, "Muminun"); sureMap.put(24, "Nur"); sureMap.put(25, "Furqan"); sureMap.put(26, "Şuəra"); sureMap.put(27, "Nəml"); sureMap.put(28, "Qəsəs"); sureMap.put(29, "Ənkəbut"); sureMap.put(30, "Rum"); sureMap.put(31, "Loğman"); sureMap.put(32, "Səcdə"); sureMap.put(33, "Əhzab"); sureMap.put(34, "Səba"); sureMap.put(35, "Fatir"); sureMap.put(36, "Yasin"); sureMap.put(37, "Saffat"); sureMap.put(38, "Sad"); sureMap.put(39, "Zumər"); sureMap.put(40, "Ğafir"); sureMap.put(41, "Fussilət"); sureMap.put(42, "Şura"); sureMap.put(43, "Zuxruf"); sureMap.put(44, "Duxan"); sureMap.put(45, "Casiyə"); sureMap.put(46, "Əhqaf"); sureMap.put(47, "Muhəmməd"); sureMap.put(48, "Fəth"); sureMap.put(49, "Hucurat"); sureMap.put(50, "Qaf"); sureMap.put(51, "Zariyat"); sureMap.put(52, "Tur"); sureMap.put(53, "Nəcm"); sureMap.put(54, "Qəmər"); sureMap.put(55, "Rəhman"); sureMap.put(56, "Vaqiə"); sureMap.put(57, "Hədid"); sureMap.put(58, "Mucadələ"); sureMap.put(59, "Həşr"); sureMap.put(60, "Mumtəhinə"); sureMap.put(61, "Səff"); sureMap.put(62, "Cumuə"); sureMap.put(63, "Munafiqun"); sureMap.put(64, "Təğabun"); sureMap.put(65, "Təlaq"); sureMap.put(66, "Təhrim"); sureMap.put(67, "Mülk"); sureMap.put(68, "Nun və ya əl-Qələm"); sureMap.put(69, "Haqqə"); sureMap.put(70, "Məaric"); sureMap.put(71, "Nuh"); sureMap.put(72, "Cinn"); sureMap.put(73, "Muzzəmmil"); sureMap.put(74, "Muddəsir"); sureMap.put(75, "Qiyamə"); sureMap.put(76, "İnsan"); sureMap.put(77, "Mursələt"); sureMap.put(78, "Nəbə"); sureMap.put(79, "Naziat"); sureMap.put(80, "Əbəs"); sureMap.put(81, "Təkvir"); sureMap.put(82, "İnfitar"); sureMap.put(83, "Mutəffifin"); sureMap.put(84, "İnşiqaq"); sureMap.put(85, "Buruc"); sureMap.put(86, "Tariq"); sureMap.put(87, "Əla"); sureMap.put(88, "Ğaşiyə"); sureMap.put(89, "Fəcr"); sureMap.put(90, "Bələd"); sureMap.put(91, "Şəms"); sureMap.put(92, "Leyl"); sureMap.put(93, "Zura"); sureMap.put(94, "İnşirah"); sureMap.put(95, "Tin"); sureMap.put(96, "Ələq"); sureMap.put(97, "Qədr"); sureMap.put(98, "Bəyyinə"); sureMap.put(99, "Zilzal"); sureMap.put(100, "Adiyat"); sureMap.put(101, "Qariə"); sureMap.put(102, "Təkasur"); sureMap.put(103, "Əsr"); sureMap.put(104, "Huməzə"); sureMap.put(105, "Fil"); sureMap.put(106, "Qureyş"); sureMap.put(107, "Maun"); sureMap.put(108, "Kəvsər"); sureMap.put(109, "Kafirun"); sureMap.put(110, "Nəsr"); sureMap.put(111, "Əbu Ləhəb"); sureMap.put(112, "İxlas"); sureMap.put(113, "Fələq"); sureMap.put(114, "Nas"); } public void addListData(Map<Integer, String> sureMap) { for (int i = 1; i < sureMap.size() + 1; i++) { sure = new Sure(); sure.setNumber(String.valueOf(i)); sure.setName(sureMap.get(i)); System.out.println("sure=" + sure); sureler.add(sure); } } }
[ "saida.aliyeva.2017@list.ru" ]
saida.aliyeva.2017@list.ru
ffe4dc904410f8d868b7abec830b78665d03a2d6
ce658643940f547c3ef2a089b319934dc4bca31d
/src/bcms/URLMarvel.java
6d8e36b661b779c059d681174c1fdef3985de54d
[]
no_license
bcmes/HTTP
7790700a6f0727df27e5a0ac3a0fa233a81a2e0f
5c768729cd0b5f08928228e261c3c9139675064e
refs/heads/master
2021-10-08T02:15:24.796809
2017-04-02T02:14:59
2017-04-02T02:14:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,907
java
package bcms; public final class URLMarvel { //URL = protocolo://domínio:porta/caminho/recurso?query_string#fragmento private static final String protocolo = "http://"; private static final String dominio = "gateway.marvel.com"; private static final String porta = ":80"; private static final String caminho = "/v1/public/"; // Toda enumeração é estatica por naturexa // A convencao dos bons costumes de programacao, diz que os itens da enumeracao devem ser maiusculas. public enum Recurso { characters, comics, creators, events, series, stories } //String fragmento = "#fragmento"; //O tipo de algoritmo de criptografia a ser usado nas requisições. private static final String algoritmo = "MD5"; private static final String chavePublica = "abf83400de30676982d73c6d45f91699"; //Este ato de escrever a chave privada no código é completamente inseguro ! private static final String chavePrivada = "b20e53dd0841a1688fb914a289a035c21723811d"; /** * Constrói uma URL válida para determinado recurso na API Marvel e a retorna. * * @author brunosilva * * @return * Uma URL válida para o recurso desejado na API Marvel. */ public static final String getURLMontada(Recurso recurso, int offset, int limit) { //limit deve ser > 1 e offset > 0, caso contratio erro. //offset é o indice e começa em 0 e limit é a quantidade a ser retornada apartir do indice. String query = "?limit="+limit+"&offset="+offset+"&"; String UrlBase = protocolo + dominio + porta + caminho + recurso + query; //hora atual em milesimos de segundos Long hora = System.currentTimeMillis(); String urlMontada = UrlBase +"apikey=" + chavePublica +"&ts=" + hora.toString() +"&hash=" + Util.getHashKey(algoritmo, hora + chavePrivada + chavePublica); return urlMontada; } }
[ "brunomeloesilva@gmail.com" ]
brunomeloesilva@gmail.com
40456a83fba6dbf9bbfddc10ebab6d4bf32cc0d6
e9298d5377f4d3f20cc070e6657a33ee1dcb90c6
/src/pokemon/view/PokedexPanel.java
6c3b10f35d6a271b298470a23d60f7a9ec121edd
[]
no_license
thatsmellything/Pokemons
d7bec86ecfcc4ccc721c83a40b0358bac72aa0f3
86402460f3f82a844b5ba038e0f5711bb83244aa
refs/heads/master
2020-04-20T21:35:02.975642
2019-03-07T16:41:40
2019-03-07T16:41:40
169,113,454
0
0
null
null
null
null
UTF-8
Java
false
false
9,113
java
package pokemon.view; import javax.swing.*; import java.awt.*; import java.awt.event.*; import pokemon.controller.PokedexController; import java.io.*; public class PokedexPanel extends JPanel { private PokedexController appController; private SpringLayout appLayout; private JButton saveButton; private JButton changeButton; private JComboBox<String> pokedexDropdown; private JTextField numberField; private JTextField nameField; private JTextField evolveField; private JTextField attackField; private JTextField enhancementField; private JTextField healthField; private JLabel numberLabel; private JLabel nameLabel; private JLabel evolveLabel; private JLabel attackLabel; private JLabel enhanceLabel; private JLabel healthLabel; private JLabel imageLabel; private ImageIcon pokemonIcon; public PokedexPanel(PokedexController appController) { super(); this.appController = appController; this.appLayout = new SpringLayout(); this.pokemonIcon = new ImageIcon(getClass().getResource("/pokemon/view/images/pokeball.png")); numberField = new JTextField("0"); nameField = new JTextField("pokename"); evolveField = new JTextField("false"); attackField = new JTextField("0"); enhancementField = new JTextField("0"); healthField = new JTextField("0"); saveButton = new JButton("Save me"); numberLabel = new JLabel("This pokemon number is"); nameLabel = new JLabel("This pokemon name is"); evolveLabel = new JLabel("This pokemon cannot evolve"); attackLabel = new JLabel("This pokemon attack level is"); enhanceLabel = new JLabel("This pokemon enhancements are"); healthLabel = new JLabel("This pokemon health is"); imageLabel = new JLabel("pokemon goes here", new ImageIcon(PokedexPanel.class.getResource("/pokemon/view/images/pokeball2.png")), JLabel.CENTER); appLayout.putConstraint(SpringLayout.NORTH, imageLabel, -199, SpringLayout.NORTH, attackField); appLayout.putConstraint(SpringLayout.WEST, imageLabel, 51, SpringLayout.WEST, this); changeButton = new JButton("Click here to change the pokevalues"); appLayout.putConstraint(SpringLayout.NORTH, changeButton, 19, SpringLayout.SOUTH, enhancementField); appLayout.putConstraint(SpringLayout.EAST, changeButton, -55, SpringLayout.EAST, this); pokedexDropdown = new JComboBox<String>(); appLayout.putConstraint(SpringLayout.NORTH, pokedexDropdown, 47, SpringLayout.SOUTH, imageLabel); appLayout.putConstraint(SpringLayout.WEST, pokedexDropdown, 82, SpringLayout.WEST, this); appLayout.putConstraint(SpringLayout.EAST, pokedexDropdown, -162, SpringLayout.WEST, changeButton); setupPanel(); setupLayout(); setupListeners(); setupDropdown(); } private void setupPanel() { this.setLayout(appLayout); this.add(changeButton); this.add(pokedexDropdown); this.add(healthField); this.add(numberField); this.add(evolveField); this.add(enhancementField); this.add(attackField); this.add(nameField); this.add(healthLabel); this.add(numberLabel); this.add(evolveLabel); this.add(enhanceLabel); this.add(attackLabel); this.add(nameLabel); this.add(imageLabel); JButton saveButton = new JButton("Save Button"); appLayout.putConstraint(SpringLayout.NORTH, saveButton, 9, SpringLayout.SOUTH, changeButton); appLayout.putConstraint(SpringLayout.WEST, saveButton, 0, SpringLayout.WEST, changeButton); add(saveButton); } private void setupLayout() { imageLabel.setVerticalTextPosition(JLabel.BOTTOM); imageLabel.setHorizontalTextPosition(JLabel.CENTER); appLayout.putConstraint(SpringLayout.NORTH, saveButton, 10, SpringLayout.NORTH, this); appLayout.putConstraint(SpringLayout.WEST, saveButton, 0, SpringLayout.WEST, changeButton); appLayout.putConstraint(SpringLayout.EAST, numberField, -41, SpringLayout.EAST, this); numberField.setHorizontalAlignment(SwingConstants.RIGHT); appLayout.putConstraint(SpringLayout.NORTH, nameField, 50, SpringLayout.NORTH, this); appLayout.putConstraint(SpringLayout.WEST, nameField, 560, SpringLayout.WEST, this); evolveField.setHorizontalAlignment(SwingConstants.RIGHT); appLayout.putConstraint(SpringLayout.WEST, attackField, 0, SpringLayout.WEST, evolveField); attackField.setHorizontalAlignment(SwingConstants.RIGHT); enhancementField.setHorizontalAlignment(SwingConstants.RIGHT); appLayout.putConstraint(SpringLayout.EAST, enhancementField, 0, SpringLayout.EAST, healthField); appLayout.putConstraint(SpringLayout.EAST, nameField, 0, SpringLayout.EAST, healthField); appLayout.putConstraint(SpringLayout.EAST, attackField, 0, SpringLayout.EAST, healthField); appLayout.putConstraint(SpringLayout.EAST, evolveField, 0, SpringLayout.EAST, healthField); appLayout.putConstraint(SpringLayout.WEST, healthField, 0, SpringLayout.WEST, numberField); appLayout.putConstraint(SpringLayout.EAST, healthField, 0, SpringLayout.EAST, numberField); healthField.setHorizontalAlignment(SwingConstants.RIGHT); appLayout.putConstraint(SpringLayout.WEST, numberField, 10, SpringLayout.EAST, numberLabel); appLayout.putConstraint(SpringLayout.EAST, numberLabel, -170, SpringLayout.EAST, this); appLayout.putConstraint(SpringLayout.NORTH, numberField, -5, SpringLayout.NORTH, numberLabel); appLayout.putConstraint(SpringLayout.NORTH, nameLabel, 55, SpringLayout.NORTH, this); appLayout.putConstraint(SpringLayout.NORTH, numberLabel, 27, SpringLayout.SOUTH, nameLabel); appLayout.putConstraint(SpringLayout.WEST, nameLabel, 0, SpringLayout.WEST, numberLabel); appLayout.putConstraint(SpringLayout.NORTH, evolveField, -5, SpringLayout.NORTH, evolveLabel); appLayout.putConstraint(SpringLayout.WEST, evolveField, 6, SpringLayout.EAST, evolveLabel); appLayout.putConstraint(SpringLayout.NORTH, evolveLabel, 30, SpringLayout.SOUTH, numberField); appLayout.putConstraint(SpringLayout.WEST, evolveLabel, 0, SpringLayout.WEST, numberLabel); appLayout.putConstraint(SpringLayout.NORTH, attackField, -5, SpringLayout.NORTH, attackLabel); appLayout.putConstraint(SpringLayout.NORTH, enhancementField, -5, SpringLayout.NORTH, enhanceLabel); appLayout.putConstraint(SpringLayout.WEST, enhancementField, 6, SpringLayout.EAST, enhanceLabel); appLayout.putConstraint(SpringLayout.NORTH, enhanceLabel, 33, SpringLayout.SOUTH, attackLabel); appLayout.putConstraint(SpringLayout.NORTH, healthField, -5, SpringLayout.NORTH, healthLabel); appLayout.putConstraint(SpringLayout.WEST, enhanceLabel, 0, SpringLayout.WEST, healthLabel); appLayout.putConstraint(SpringLayout.NORTH, attackLabel, 28, SpringLayout.SOUTH, healthLabel); appLayout.putConstraint(SpringLayout.WEST, attackLabel, 0, SpringLayout.WEST, healthLabel); appLayout.putConstraint(SpringLayout.NORTH, healthLabel, 29, SpringLayout.SOUTH, evolveLabel); appLayout.putConstraint(SpringLayout.WEST, healthLabel, 0, SpringLayout.WEST, numberLabel); } private void setupDropdown() { DefaultComboBoxModel<String> temp = new DefaultComboBoxModel<String>(appController.buildPokedexText()); pokedexDropdown.setModel(temp); } private void sendDataToController() { int index = pokedexDropdown.getSelectedIndex(); if(appController.isInt(attackField.getText()) && appController.isDouble(enhancementField.getText()) && appController.isInt(healthField.getText())) { String [] data = new String[5]; data[0] = attackField.getText(); data[1] = enhancementField.getText(); data[2] = healthField.getText(); data[3] = evolveField.getText(); data[4] = nameField.getText(); appController.updatePokemon(index, data); } }; private void changeImageDisplay(String name) { String path = "/pokemon/view/images/"; String defaultName = "pokeball"; String extension = ".png"; try { pokemonIcon = new ImageIcon(getClass().getResource(path + name.toLowerCase() + extension)); } catch (NullPointerException missingFile) { pokemonIcon = new ImageIcon(getClass().getResource(path + defaultName + extension)); } imageLabel.setIcon(pokemonIcon); repaint(); } private void updateFields(int index) { String [] data = appController.getPokemonData(index); attackField.setText(data[0]); enhancementField.setText(data[1]); healthField.setText(data[2]); nameField.setText(data[3]); evolveField.setText(data[4]); numberField.setText(data[5]); } private void setupListeners() { changeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent mouseClick) { sendDataToController(); } }); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent click) { appController.savePokedex(); } }); pokedexDropdown.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent selection) { String name = pokedexDropdown.getSelectedItem().toString(); updateFields(pokedexDropdown.getSelectedIndex()); changeImageDisplay(name); } }); } }
[ "thesmelliestman@gmail.com" ]
thesmelliestman@gmail.com
528af716073f7f4300bd785eca29776e00610a14
2cf67a191608a03501f89178c955cb8c5a554e81
/workspace/2DLightLife/gen/game/first/lightlife/BuildConfig.java
083562d80d86808041ea1e4fa87aa84506022745
[]
no_license
Neshri/LightLife
9f136ae21996f285f0e592c148b3f65656a545bf
0747fd6c20de27f7ef39d9be35c1a959b604bc87
refs/heads/master
2021-01-20T11:13:14.563383
2018-03-24T19:21:22
2018-03-24T19:21:22
25,133,714
0
0
null
null
null
null
UTF-8
Java
false
false
262
java
/*___Generated_by_IDEA___*/ package game.first.lightlife; /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ public final class BuildConfig { public final static boolean DEBUG = Boolean.parseBoolean(null); }
[ "anton.lundgren94@gmail.com" ]
anton.lundgren94@gmail.com
c47ba6f2b9902dfaa0c1d190204d7c879c273bfb
702f49a40c9fadfea61aa580fc05d8926cb78557
/app/src/main/java/edu/handong/csee/java/hw2/converters/TONToGConverter.java
001b5b9db0b1a4d714d5a911dd7e0146e2a18c3a
[]
no_license
jihyunmoon98/2021-21900255-Java-Lab08
75f1f1ce0e2cdcecac250b7884a5544037091578
683d8f8b69f4b910abf73e868ce219cd03cbb3e1
refs/heads/main
2023-04-19T09:12:32.914931
2021-05-06T14:20:23
2021-05-06T14:20:23
364,920,637
0
0
null
null
null
null
UTF-8
Java
false
false
923
java
package edu.handong.csee.java.hw2.converters; /** * homework 2 one of converter program * it use the Convertible interface * * @author Jihyun Moon * @since 2021.04.13 */ public class TONToGConverter implements Convertible{ private double outputValue; private double inputValue; /** * this is setting the value in inputValue * @param fromValue is the input value that user input for us */ public void setFromValue(double fromValue){ inputValue = fromValue; } /** * this is send the value when the main want to get variance data * @return so it has return instead of param. * to return the value to main */ public double getConvertedValue(){ return outputValue; } /** * it is calculating part. */ public void convert(){ outputValue = inputValue * 1000000; } }
[ "user@DESKTOP-OHUODR5" ]
user@DESKTOP-OHUODR5
577e0a4028501e73e17d478f6107d8bdce34b207
2dbc7aad8370aaba8ec31185e496d822253a3ead
/Data Structures and Algorithms/Progressions/src/test/TestProgressions.java
3b2a2b3bbfe94fe14f72705b4903e9d450da7882
[]
no_license
JuanDanielCR/JavaPractices
892789eea7d63d38c72ffbfd04702edd867473aa
a643ca30043c860f9ed54fd9236ef5509a7d2c8d
refs/heads/master
2020-04-06T05:09:48.257863
2017-01-27T21:18:16
2017-01-27T21:18:16
44,283,344
0
0
null
null
null
null
UTF-8
Java
false
false
1,253
java
package test; import sources.*; /** Test program for the progression hierarchy. */ public class TestProgressions { public static void main(String[ ] args) { AbstractProgression prog; // test ArithmeticProgression System.out.print("Arithmetic progression with default increment: "); prog = new ArithmeticProgression( ); prog.printProgression(10); System.out.print("Arithmetic progression with increment 5: "); prog = new ArithmeticProgression(5); prog.printProgression(10); System.out.print("Arithmetic progression with start 2: "); prog = new ArithmeticProgression(5, 2); prog.printProgression(10); // test GeometricProgression System.out.print("Geometric progression with default base: "); prog = new GeometricProgression( ); prog.printProgression(10); System.out.print("Geometric progression with base 3: "); prog = new GeometricProgression(3); prog.printProgression(10); // test FibonacciProgression System.out.print("Fibonacci progression with default start values: "); prog = new FibonacciProgression( ); prog.printProgression(10); System.out.print("Fibonacci progression with start values 4 and 6: "); prog = new FibonacciProgression(4, 6); prog.printProgression(8); } }
[ "castilloreyesjuan@gmail.com" ]
castilloreyesjuan@gmail.com
5d975cd0d497e7684b557fd0b5a2af0673cf19de
884483ca2ec2b06cd5d397c0b21d84cd3363e7dc
/app/src/main/java/com/lijiankun24/databindingpractice/common/util/Consts.java
6bcea95a1a235af788bb179217ffd1cccfef61ae
[]
no_license
lijiankun24/DataBindingPractice
3733cf61d9168fb0fb404d475355f367a27e5197
f373e64cdbf2ba6025b323f3b0768d063b6d3fac
refs/heads/master
2021-01-19T20:35:03.475108
2017-06-04T16:07:52
2017-06-04T16:07:52
88,522,919
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package com.lijiankun24.databindingpractice.common.util; /** * Consts.java * <p> * Created by lijiankun on 17/5/2. */ public class Consts { public static final String github = "https://github.com/lijiankun24"; public static final String weibo = "http://weibo.com/lijiankun24"; public static final String blog = "http://lijiankun24.com"; public static final String mail = "jiankunli24@gmail.com"; }
[ "lijk@rd.netease.com" ]
lijk@rd.netease.com
643c73efb540206389e5e6acdbfc0691af404556
6fb646d78ce13fa54e3174bbc88ef48bc8572374
/src/main/java/htsjdk/samtools/util/DelegatingIterator.java
9d5174a93628bee9181ce4ebd7b55ed7c9306f52
[ "LGPL-2.0-or-later", "Apache-2.0", "MIT", "LicenseRef-scancode-public-domain" ]
permissive
EGA-archive/ega-htsjdk
c6f59622c38f63f6fe35e5184e4b800f51cf9970
0e82a068bd9f4c94d9258c2ae3f9d7ec0a13d673
refs/heads/master
2021-05-02T13:20:30.830849
2020-02-26T14:25:27
2020-02-26T14:25:27
120,757,605
0
3
Apache-2.0
2020-02-26T14:25:28
2018-02-08T12:18:04
Java
UTF-8
Java
false
false
883
java
package htsjdk.samtools.util; import java.util.Iterator; /** * Simple iterator class that delegates all method calls to an underlying iterator. Useful * for in-line subclassing to add behaviour to one or more methods. * * @author Tim Fennell */ public class DelegatingIterator<T> implements CloseableIterator<T> { private final Iterator<T> iterator; public DelegatingIterator(final Iterator<T> iterator) { this.iterator = iterator; } @Override public void close() { if (iterator instanceof CloseableIterator) { ((CloseableIterator) this.iterator).close(); } } @Override public boolean hasNext() { return this.iterator.hasNext(); } @Override public T next() { return this.iterator.next(); } @Override public void remove() { this.iterator.remove(); } }
[ "asenf@asenf-virtual-machine" ]
asenf@asenf-virtual-machine
41df3929b0d8dccbef309fae26e5cb29e34198aa
f321db1ace514d08219cc9ba5089ebcfff13c87a
/generated-tests/random/tests/s9/7_okhttp/evosuite-tests/okhttp3/internal/tls/OkHostnameVerifier_ESTest.java
8be0b63cfe127fa51c1e3f8aeea2ed07f8ffe805
[]
no_license
sealuzh/dynamic-performance-replication
01bd512bde9d591ea9afa326968b35123aec6d78
f89b4dd1143de282cd590311f0315f59c9c7143a
refs/heads/master
2021-07-12T06:09:46.990436
2020-06-05T09:44:56
2020-06-05T09:44:56
146,285,168
2
2
null
null
null
null
UTF-8
Java
false
false
5,333
java
/* * This file was automatically generated by EvoSuite * Fri Mar 22 18:10:52 GMT 2019 */ package okhttp3.internal.tls; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.util.Collection; import javax.net.ssl.SSLSession; import javax.security.auth.x500.X500Principal; import okhttp3.internal.tls.OkHostnameVerifier; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class OkHostnameVerifier_ESTest extends OkHostnameVerifier_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { OkHostnameVerifier okHostnameVerifier0 = OkHostnameVerifier.INSTANCE; String string0 = "<J)l6'nC[E%@bw"; X509Certificate x509Certificate0 = mock(X509Certificate.class, new ViolatedAssumptionAnswer()); doReturn((Collection) null, (Collection) null).when(x509Certificate0).getSubjectAlternativeNames(); OkHostnameVerifier.allSubjectAltNames(x509Certificate0); X509Certificate x509Certificate1 = mock(X509Certificate.class, new ViolatedAssumptionAnswer()); doReturn((Collection) null).when(x509Certificate1).getSubjectAlternativeNames(); doReturn((X500Principal) null).when(x509Certificate1).getSubjectX500Principal(); X509Certificate x509Certificate2 = mock(X509Certificate.class, new ViolatedAssumptionAnswer()); doReturn((Collection) null).when(x509Certificate2).getSubjectAlternativeNames(); okHostnameVerifier0.verify(".", x509Certificate2); // Undeclared exception! try { okHostnameVerifier0.verify("<J)l6'nC[E%@bw", x509Certificate1); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("okhttp3.internal.tls.DistinguishedNameParser", e); } } @Test(timeout = 4000) public void test1() throws Throwable { OkHostnameVerifier okHostnameVerifier0 = OkHostnameVerifier.INSTANCE; SSLSession sSLSession0 = mock(SSLSession.class, new ViolatedAssumptionAnswer()); doReturn((Certificate[]) null).when(sSLSession0).getPeerCertificates(); // Undeclared exception! try { okHostnameVerifier0.INSTANCE.verify("", sSLSession0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("okhttp3.internal.tls.OkHostnameVerifier", e); } } @Test(timeout = 4000) public void test2() throws Throwable { OkHostnameVerifier okHostnameVerifier0 = OkHostnameVerifier.INSTANCE; // Undeclared exception! try { okHostnameVerifier0.INSTANCE.verify("y+bbiCvb:/j*'@a,>rA", (X509Certificate) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("okhttp3.internal.tls.OkHostnameVerifier", e); } } @Test(timeout = 4000) public void test3() throws Throwable { OkHostnameVerifier okHostnameVerifier0 = OkHostnameVerifier.INSTANCE; X509Certificate x509Certificate0 = mock(X509Certificate.class, new ViolatedAssumptionAnswer()); // Undeclared exception! try { okHostnameVerifier0.verify((String) null, x509Certificate0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test4() throws Throwable { // Undeclared exception! try { OkHostnameVerifier.allSubjectAltNames((X509Certificate) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("okhttp3.internal.tls.OkHostnameVerifier", e); } } @Test(timeout = 4000) public void test5() throws Throwable { OkHostnameVerifier okHostnameVerifier0 = OkHostnameVerifier.INSTANCE; SSLSession sSLSession0 = mock(SSLSession.class, new ViolatedAssumptionAnswer()); doReturn((Certificate[]) null).when(sSLSession0).getPeerCertificates(); // Undeclared exception! try { okHostnameVerifier0.verify("endIndex > length(", sSLSession0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("okhttp3.internal.tls.OkHostnameVerifier", e); } } }
[ "granogiovanni90@gmail.com" ]
granogiovanni90@gmail.com
2d33aa2497059c65cc3c292dcba8793df6ba7903
5c64004c54c4a64035cce2224bdcfe450e6f9bab
/si-onem2m-src/IITP_IoT_2_7/src/main/java/net/herit/iot/onem2m/resource/Subscription.java
d01e2b6e8d0e529086a60185dd618a19571b0996
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
uguraba/SI
3fd091b602c843e3b7acc12aa40ed5365964663b
9e0f89a7413c351b2f739b1ee8ae2687c04d5ec1
refs/heads/master
2021-01-08T02:37:39.152700
2018-03-08T01:28:24
2018-03-08T01:28:24
241,887,209
0
0
BSD-2-Clause
2020-02-20T13:13:19
2020-02-20T13:12:20
null
UTF-8
Java
false
false
22,355
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.07.06 at 03:14:16 오후 KST // package net.herit.iot.onem2m.resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlList; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import net.herit.iot.message.onem2m.OneM2mRequest.OPERATION; import net.herit.iot.message.onem2m.OneM2mResponse.RESPONSE_STATUS; import net.herit.iot.message.onem2m.format.Enums.CONTENT_TYPE; import net.herit.iot.onem2m.core.util.OneM2MException; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;extension base="{http://www.onem2m.org/xml/protocols}regularResource"> * &lt;sequence> * &lt;element name="eventNotificationCriteria" type="{http://www.onem2m.org/xml/protocols}eventNotificationCriteria" minOccurs="0"/> * &lt;element name="expirationCounter" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" minOccurs="0"/> * &lt;element name="notificationURI" type="{http://www.onem2m.org/xml/protocols}listOfURIs"/> * &lt;element name="groupID" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/> * &lt;element name="notificationForwardingURI" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/> * &lt;element name="batchNotify" type="{http://www.onem2m.org/xml/protocols}batchNotify" minOccurs="0"/> * &lt;element name="rateLimit" type="{http://www.onem2m.org/xml/protocols}rateLimit" minOccurs="0"/> * &lt;element name="preSubscriptionNotify" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" minOccurs="0"/> * &lt;element name="pendingNotification" type="{http://www.onem2m.org/xml/protocols}pendingNotification" minOccurs="0"/> * &lt;element name="notificationStoragePriority" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" minOccurs="0"/> * &lt;element name="latestNotify" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="notificationContentType" type="{http://www.onem2m.org/xml/protocols}notificationContentType"/> * &lt;element name="notificationEventCat" type="{http://www.onem2m.org/xml/protocols}eventCat" minOccurs="0"/> * &lt;element name="creator" type="{http://www.onem2m.org/xml/protocols}ID" minOccurs="0"/> * &lt;element name="subscriberURI" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/> * &lt;choice minOccurs="0"> * &lt;element name="childResource" type="{http://www.onem2m.org/xml/protocols}childResourceRef"/> * &lt;element ref="{http://www.onem2m.org/xml/protocols}schedule"/> * &lt;/choice> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "eventNotificationCriteria", "expirationCounter", "notificationURI", "groupID", "notificationForwardingURI", "batchNotify", "rateLimit", "preSubscriptionNotify", "pendingNotification", "notificationStoragePriority", "latestNotify", "notificationContentType", "notificationEventCat", "creator", "subscriberURI", "childResource", //"schedule" removed in CDT-2.7.0 "scheduleOrNotificationTargetMgmtPolicyRef" }) //@XmlRootElement(name = "subscription") @XmlRootElement(name = "sub") public class Subscription extends RegularResource { // public final static String SCHEMA_LOCATION = "CDT-subscription-v1_2_0.xsd"; // public final static String SCHEMA_LOCATION = "CDT-subscription-v1_6_0.xsd"; public final static String SCHEMA_LOCATION = "CDT-subscription-v2_7_0.xsd"; @XmlElement(name = Naming.EVENTNOTIFICATIONCRITERIA_SN) protected EventNotificationCriteria eventNotificationCriteria; @XmlSchemaType(name = "positiveInteger") @XmlElement(name = Naming.EXPIRATIONCOUNTER_SN) protected Integer expirationCounter; @XmlList //@XmlElement(required = true) @XmlElement(name = Naming.NOTIFICATIONURI_SN) protected List<String> notificationURI; @XmlSchemaType(name = "anyURI") @XmlElement(name = Naming.GROUPID_SN) protected String groupID; @XmlSchemaType(name = "anyURI") @XmlElement(name = Naming.NOTIFICATIONFORWARDINGURI_SN) protected String notificationForwardingURI; @XmlElement(name = Naming.BATCHNOTIFY_SN) protected BatchNotify batchNotify; @XmlElement(name = Naming.RATELIMIT_SN) protected RateLimit rateLimit; @XmlSchemaType(name = "positiveInteger") @XmlElement(name = Naming.PRESUBSCRIPTIONNOTIFY_SN) protected Integer preSubscriptionNotify; @XmlElement(name = Naming.PENDINGNOTIFICATION_SN) protected Integer pendingNotification; @XmlSchemaType(name = "positiveInteger") @XmlElement(name = Naming.NOTIFICATIONSTORAGEPRIORITY_SN) protected Integer notificationStoragePriority; @XmlElement(name = Naming.LATESTNOTIFY_SN) protected Boolean latestNotify; //@XmlElement(required = true) @XmlElement(name = Naming.NOTIFICATIONCONTENTTYPE_SN) protected Integer notificationContentType; @XmlElement(name = Naming.NOTIFICATIONEVENTCAT_SN) //protected String notificationEventCat; protected Integer notificationEventCat; @XmlElement(name = Naming.CREATOR_SN) protected String creator; @XmlSchemaType(name = "anyURI") @XmlElement(name = Naming.SUBSCRIBERURI_SN) protected String subscriberURI; @XmlElement(name = Naming.CHILDRESOURCE_SN) protected ChildResourceRef childResource; //@XmlElement(name = "sch", namespace = "http://www.onem2m.org/xml/protocols") //protected Schedule schedule; removed in CDT-2.7.0 @XmlElements({ @XmlElement(name = "schedule", namespace = "http://www.onem2m.org/xml/protocols", type = Schedule.class), @XmlElement(name = "notificationTargetMgmtPolicyRef", namespace = "http://www.onem2m.org/xml/protocols", type = NotificationTargetMgmtPolicyRef.class) }) protected List<Resource> scheduleOrNotificationTargetMgmtPolicyRef; public enum NOTIFICATIONEVENT_TYPE { NONE(0, "none"), UPDATE_OF_RESOURCE(1, "Update of Resource"), DELETE_OF_RESOURCE(2, "Delete of Resource"), CREATE_OF_CHILD_RESOURCE(3, "Create of Child Resource"), DELETE_OF_CHILD_RESOURCE(4, "Delete of Child Resource"); final int value; final String name; private NOTIFICATIONEVENT_TYPE(int value, String name) { this.value = value; this.name = name; } public int Value() { return this.value; } public String Name() { return this.name; } private static final Map<Integer, NOTIFICATIONEVENT_TYPE> map = new HashMap<Integer, NOTIFICATIONEVENT_TYPE>(); static { for(NOTIFICATIONEVENT_TYPE en : NOTIFICATIONEVENT_TYPE.values()) { map.put(en.value, en); } } public static NOTIFICATIONEVENT_TYPE get(int value) { NOTIFICATIONEVENT_TYPE en = map.get(value); return en; } } public enum NOTIFICATIONCONTENT_TYPE { NONE(0, "none"), ALL_ATRRIBUTES(1, "all attributes"), MODIFIED_ATTRIBUTES(2, "modified attributes"), RESOURCE_ID(3, "ResourceID"); final int value; final String name; private NOTIFICATIONCONTENT_TYPE(int value, String name) { this.value = value; this.name = name; } public int Value() { return this.value; } public String Name() { return this.name; } private static final Map<Integer, NOTIFICATIONCONTENT_TYPE> map = new HashMap<Integer, NOTIFICATIONCONTENT_TYPE>(); static { for(NOTIFICATIONCONTENT_TYPE en : NOTIFICATIONCONTENT_TYPE.values()) { map.put(en.value, en); } } public static NOTIFICATIONCONTENT_TYPE get(int value) { NOTIFICATIONCONTENT_TYPE en = map.get(value); return en; } }; public String toString() { StringBuilder sbld = new StringBuilder(); sbld.append("[Subscription]").append(NL); sbld.append("eventNotificationCriteria:").append(NL); sbld.append(eventNotificationCriteria); sbld.append("expirationCounter:").append(expirationCounter).append(NL); sbld.append("notificationURI:").append(notificationURI).append(NL); sbld.append("groupID:").append(groupID).append(NL); sbld.append("notificationForwardingURI:").append(notificationForwardingURI).append(NL); sbld.append("batchNotify:").append(batchNotify).append(NL); sbld.append("rateLimit:").append(rateLimit).append(NL); sbld.append("preSubscriptionNotify:").append(preSubscriptionNotify).append(NL); sbld.append("pendingNotification:").append(pendingNotification).append(NL); sbld.append("notificationStoragePriority:").append(notificationStoragePriority).append(NL); sbld.append("latestNotify:").append(latestNotify).append(NL); sbld.append("notificationContentType:").append(notificationContentType).append(NL); sbld.append("notificationEventCat:").append(notificationEventCat).append(NL); sbld.append("creator:").append(creator).append(NL); sbld.append("subscriberURI:").append(subscriberURI).append(NL); sbld.append("childResource:").append(childResource).append(NL); // sbld.append("scheduleOrNotificationTargetMgmtPolicyRef:").append(scheduleOrNotificationTargetMgmtPolicyRef).append(NL); sbld.append(super.toString()); return sbld.toString(); } /** * Gets the value of the eventNotificationCriteria property. * * @return * possible object is * {@link EventNotificationCriteria } * */ public EventNotificationCriteria getEventNotificationCriteria() { return eventNotificationCriteria; } /** * Sets the value of the eventNotificationCriteria property. * * @param value * allowed object is * {@link EventNotificationCriteria } * */ public void setEventNotificationCriteria(EventNotificationCriteria value) { this.eventNotificationCriteria = value; } /** * Gets the value of the expirationCounter property. * * @return * possible object is * {@link Integer } * */ public Integer getExpirationCounter() { return expirationCounter; } /** * Sets the value of the expirationCounter property. * * @param value * allowed object is * {@link Integer } * */ public void setExpirationCounter(Integer value) { this.expirationCounter = value; } /** * Gets the value of the notificationURI property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the notificationURI property. * * <p> * For example, to add a new item, do as follows: * <pre> * getNotificationURI().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getNotificationURI() { // if (notificationURI == null) { // notificationURI = new ArrayList<String>(); // } return this.notificationURI; } public void addNotificationURI(String uri) { if (notificationURI == null) { notificationURI = new ArrayList<String>(); } this.notificationURI.add(uri); } /** * Gets the value of the groupID property. * * @return * possible object is * {@link String } * */ public String getGroupID() { return groupID; } /** * Sets the value of the groupID property. * * @param value * allowed object is * {@link String } * */ public void setGroupID(String value) { this.groupID = value; } /** * Gets the value of the notificationForwardingURI property. * * @return * possible object is * {@link String } * */ public String getNotificationForwardingURI() { return notificationForwardingURI; } /** * Sets the value of the notificationForwardingURI property. * * @param value * allowed object is * {@link String } * */ public void setNotificationForwardingURI(String value) { this.notificationForwardingURI = value; } /** * Gets the value of the batchNotify property. * * @return * possible object is * {@link BatchNotify } * */ public BatchNotify getBatchNotify() { return batchNotify; } /** * Sets the value of the batchNotify property. * * @param value * allowed object is * {@link BatchNotify } * */ public void setBatchNotify(BatchNotify value) { this.batchNotify = value; } /** * Gets the value of the rateLimit property. * * @return * possible object is * {@link RateLimit } * */ public RateLimit getRateLimit() { return rateLimit; } /** * Sets the value of the rateLimit property. * * @param value * allowed object is * {@link RateLimit } * */ public void setRateLimit(RateLimit value) { this.rateLimit = value; } /** * Gets the value of the preSubscriptionNotify property. * * @return * possible object is * {@link Integer } * */ public Integer getPreSubscriptionNotify() { return preSubscriptionNotify; } /** * Sets the value of the preSubscriptionNotify property. * * @param value * allowed object is * {@link Integer } * */ public void setPreSubscriptionNotify(Integer value) { this.preSubscriptionNotify = value; } /** * Gets the value of the pendingNotification property. * * @return * possible object is * {@link Integer } * */ public Integer getPendingNotification() { return pendingNotification; } /** * Sets the value of the pendingNotification property. * * @param value * allowed object is * {@link Integer } * */ public void setPendingNotification(Integer value) { this.pendingNotification = value; } /** * Gets the value of the notificationStoragePriority property. * * @return * possible object is * {@link Integer } * */ public Integer getNotificationStoragePriority() { return notificationStoragePriority; } /** * Sets the value of the notificationStoragePriority property. * * @param value * allowed object is * {@link Integer } * */ public void setNotificationStoragePriority(Integer value) { this.notificationStoragePriority = value; } /** * Gets the value of the latestNotify property. * * @return * possible object is * {@link Boolean } * */ public Boolean isLatestNotify() { return latestNotify; } /** * Sets the value of the latestNotify property. * * @param value * allowed object is * {@link Boolean } * */ public void setLatestNotify(Boolean value) { this.latestNotify = value; } /** * Gets the value of the notificationContentType property. * * @return * possible object is * {@link Integer } * */ public Integer getNotificationContentType() { return notificationContentType; } /** * Sets the value of the notificationContentType property. * * @param value * allowed object is * {@link Integer } * */ public void setNotificationContentType(Integer value) { this.notificationContentType = value; } /** * Gets the value of the notificationEventCat property. * * @return * possible object is * {@link String } * */ // public String getNotificationEventCat() { public Integer getNotificationEventCat() { return notificationEventCat; } /** * Sets the value of the notificationEventCat property. * * @param value * allowed object is * {@link String } * */ // public void setNotificationEventCat(String value) { // this.notificationEventCat = value; // } public void setNotificationEventCat(Integer value) { this.notificationEventCat = value; } /** * Gets the value of the creator property. * * @return * possible object is * {@link String } * */ public String getCreator() { return creator; } /** * Sets the value of the creator property. * * @param value * allowed object is * {@link String } * */ public void setCreator(String value) { this.creator = value; } /** * Gets the value of the subscriberURI property. * * @return * possible object is * {@link String } * */ public String getSubscriberURI() { return subscriberURI; } /** * Sets the value of the subscriberURI property. * * @param value * allowed object is * {@link String } * */ public void setSubscriberURI(String value) { this.subscriberURI = value; } /** * Gets the value of the childResource property. * * @return * possible object is * {@link ChildResourceRef } * */ public ChildResourceRef getChildResource() { return childResource; } /** * Sets the value of the childResource property. * * @param value * allowed object is * {@link ChildResourceRef } * */ public void setChildResource(ChildResourceRef value) { this.childResource = value; } /** * Gets the value of the schedule property. * * @return * possible object is * {@link Schedule } * * public Schedule getSchedule() { return schedule; } ** * Sets the value of the schedule property. * * @param value * allowed object is * {@link Schedule } * * public void setSchedule(Schedule value) { this.schedule = value; } */ /** * Gets the value of the scheduleOrNotificationTargetMgmtPolicyRef property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the scheduleOrNotificationTargetMgmtPolicyRef property. * * <p> * For example, to add a new item, do as follows: * <pre> * getScheduleOrNotificationTargetMgmtPolicyRef().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Schedule } * {@link NotificationTargetMgmtPolicyRef } * * */ public List<Resource> getScheduleOrNotificationTargetMgmtPolicyRef() { // if (scheduleOrNotificationTargetMgmtPolicyRef == null) { // scheduleOrNotificationTargetMgmtPolicyRef = new ArrayList<Resource>(); // } return this.scheduleOrNotificationTargetMgmtPolicyRef; } public void addScheduleOrNotificationTargetMgmtPolicyRef(Resource res) { if (scheduleOrNotificationTargetMgmtPolicyRef == null) { scheduleOrNotificationTargetMgmtPolicyRef = new ArrayList<Resource>(); } scheduleOrNotificationTargetMgmtPolicyRef.add(res); } public void validate(OPERATION operation) throws OneM2MException { if (operation.equals(OPERATION.CREATE)) { // CREATE 요청에 대한 데이터 유효성 체크 if (notificationURI == null) { throw new OneM2MException(RESPONSE_STATUS.INVALID_ARGUMENTS, "'notificationURI' is M on CREATE operation"); } //creator is Optional in CDT-2.7.0 // if (creator != null) { // throw new OneM2MException(RESPONSE_STATUS.INVALID_ARGUMENTS, "'creator' is NP on CREATE operation"); // } } else if (operation.equals(OPERATION.UPDATE)) { // UPDATE 요청에 대한 데이터 유효성 체크 if (preSubscriptionNotify != null) { throw new OneM2MException(RESPONSE_STATUS.INVALID_ARGUMENTS, "'preSubscriptionNotify' is NP on UPDATE operation"); } if (creator != null) { throw new OneM2MException(RESPONSE_STATUS.INVALID_ARGUMENTS, "'creator' is NP on UPDATE operation"); } if (subscriberURI != null) { throw new OneM2MException(RESPONSE_STATUS.INVALID_ARGUMENTS, "'subscriberURI' is NP on UPDATE operation"); } } else if (operation.equals(OPERATION.RETRIEVE)) { // RETRIEVE 응답에 대한 유효성 체크 } super.validate(operation); } }
[ "hubiss.lab@gmail.com" ]
hubiss.lab@gmail.com
83390abf138da4b670ee76f80474055e9b2bd171
74f1d9c4cecd58262888ffed02101c1b6bedfe13
/src/main/java/com/chinaxiaopu/xiaopuMobi/model/Partner.java
e3eed5447ebd3744b565e1095f8e8b041b2fdc4e
[]
no_license
wwm0104/xiaopu
341da3f711c0682d3bc650ac62179935330c27b2
ddb1b57c84cc6e6fdfdd82c2e998eea341749c87
refs/heads/master
2021-01-01T04:38:42.376033
2017-07-13T15:44:19
2017-07-13T15:44:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,715
java
package com.chinaxiaopu.xiaopuMobi.model; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; public class Partner extends BaseEntity{ private Integer id; private Long mobile; private String realName; private Integer sex; private Integer schoolId; private String schoolName; private Integer starRating; private Integer status; private Integer type; @JsonFormat(pattern="yyyy/MM/dd HH:mm", timezone = "GMT+8") private Date joinTime; private String checkInfo; @JsonFormat(pattern="yyyy/MM/dd HH:mm", timezone = "GMT+8") private Date checkTime; private String remarks; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Long getMobile() { return mobile; } public void setMobile(Long mobile) { this.mobile = mobile; } public String getRealName() { return realName; } public void setRealName(String realName) { this.realName = realName == null ? null : realName.trim(); } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } public Integer getSchoolId() { return schoolId; } public void setSchoolId(Integer schoolId) { this.schoolId = schoolId; } public String getSchoolName() { return schoolName; } public void setSchoolName(String schoolName) { this.schoolName = schoolName == null ? null : schoolName.trim(); } public Integer getStarRating() { return starRating; } public void setStarRating(Integer starRating) { this.starRating = starRating; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } public Date getJoinTime() { return joinTime; } public void setJoinTime(Date joinTime) { this.joinTime = joinTime; } public String getCheckInfo() { return checkInfo; } public void setCheckInfo(String checkInfo) { this.checkInfo = checkInfo == null ? null : checkInfo.trim(); } public Date getCheckTime() { return checkTime; } public void setCheckTime(Date checkTime) { this.checkTime = checkTime; } public String getRemarks() { return remarks; } public void setRemarks(String remarks) { this.remarks = remarks == null ? null : remarks.trim(); } }
[ "ellien" ]
ellien
cd8266a02c121f409f96e7de573c4e491272b5a5
c1b7012444e7ed0f5ceca4617780f4ae27266af1
/pluginHostSdkLib/src/main/java/com/twofortyfouram/locale/sdk/host/model/PluginErrorEdit.java
4f900e822b3f2231230d5270c1ad8ffb293a9367
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
twofortyfouram/android-monorepo
120f732d6e2572273c76e3e12acfcec465bd0c83
4023d30d5b44b2fd15206c3435829e999e7bbd02
refs/heads/master
2022-02-20T16:50:20.061944
2022-02-04T14:53:32
2022-02-04T20:00:54
131,845,238
10
0
NOASSERTION
2022-02-04T20:00:55
2018-05-02T12:08:42
Java
UTF-8
Java
false
false
4,495
java
/* * android-plugin-host-sdk-for-locale * https://github.com/twofortyfouram/android-monorepo * Copyright (C) 2008–2018 two forty four a.m. LLC * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * 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.twofortyfouram.locale.sdk.host.model; import androidx.annotation.NonNull; import com.twofortyfouram.locale.api.LocalePluginIntent; import net.jcip.annotations.ThreadSafe; import static com.twofortyfouram.assertion.Assertions.assertNotNull; import static com.twofortyfouram.log.Lumberjack.formatMessage; /** * Possible errors that may occur during the edit phase of interacting with plug-ins. */ @ThreadSafe public enum PluginErrorEdit implements IPluginError { @NonNull ACTIVITY_NOT_FOUND_EXCEPTION( "The Activity could not be found. To resolve this issue, make sure the plug-in package is still installed.", //$NON-NLS-1$ true), @NonNull BLURB_MISSING(formatMessage( "%s is missing. To resolve this issue, put the blurb extra in the Activity result Intent.", //$NON-NLS-1$ LocalePluginIntent.EXTRA_STRING_BLURB), true), @NonNull BUNDLE_TOO_LARGE( formatMessage( "%s is larger than the allowed maximum of %d bytes. To resolve this issue, store less data in the Bundle.", //$NON-NLS-1$ LocalePluginIntent.EXTRA_BUNDLE, PluginInstanceData.MAXIMUM_BUNDLE_SIZE_BYTES), true ), @NonNull BUNDLE_MISSING( formatMessage( "Extra %s is required. To resolve this issue, put the Bundle extra in the Activity result Intent.", //$NON-NLS-1$ LocalePluginIntent.EXTRA_BUNDLE), true ), @NonNull BUNDLE_NOT_SERIALIZABLE( formatMessage( "%s could not be serialized. To resolve this issue, be sure the Bundle doesn't contain Parcelable or private Serializable subclasses", //$NON-NLS-1$ LocalePluginIntent.EXTRA_BUNDLE), true ), @NonNull INTENT_NULL( "Activity result Intent is null. To resolve this issue, the child Activity needs to call setResult(RESULT_OK, Intent) or setResult(RESULT_CANCELED) before finishing.", //$NON-NLS-1$ true), /** * An Intent or Bundle from the plug-in contained a private serializable * subclass which the host's classloader does not know about. */ @NonNull PRIVATE_SERIALIZABLE( "Intent or Bundle contains a private Serializable subclass which is not known to this app's classloader. To resolve this issue, the DO NOT place a private Serializable subclass in Intents sent across processes.", //$NON-NLS-1$ true), @NonNull SECURITY_EXCEPTION( "The Activity could not be launched because of a security error. To resolve this issue, make sure the Activity is exported and does not require a permission.", //$NON-NLS-1$ true), @NonNull UNKNOWN_ACTIVITY_RESULT_CODE( "Plug-ins must return one of the result codes ACTIVITY.RESULT_OK or ACTIVITY.RESULT_CANCELED", //$NON-NLS-1$ true),; /** * A non-localized message describing the error. */ @NonNull private final String mDeveloperExplanation; /** * Indicates whether the error is fatal or is just a warning. */ private final boolean mIsFatal; PluginErrorEdit(@NonNull final String developerExplanation, final boolean isFatal) { assertNotNull(developerExplanation, "developerExplanation"); //$NON-NLS-1$ mDeveloperExplanation = developerExplanation; mIsFatal = isFatal; } @Override @NonNull public String getDeveloperExplanation() { return mDeveloperExplanation; } @Override public boolean isFatal() { return mIsFatal; } }
[ "git@carterjernigan.com" ]
git@carterjernigan.com
46c2c7181fc9d1172ec40cdca250f344c83e29cd
dd4d66ae4721d6d0dc28706a7457aa59aefba669
/src/main/java/com/tj/vo/OrderVO.java
4ea47c20491322ba0b38c554e87e1d0b1796d5ec
[]
no_license
tan-jin-mm/tanjin_shopping
37d24d704e0318e70172c4b1296c82d828230924
30bab20c175e3309332941abb5c5d2feb7ba9850
refs/heads/master
2020-04-14T19:41:20.350868
2019-01-10T11:30:34
2019-01-10T11:30:34
164,067,626
0
0
null
null
null
null
UTF-8
Java
false
false
3,490
java
package com.tj.vo; import org.omg.CORBA.PRIVATE_MEMBER; import java.math.BigDecimal; import java.util.List; public class OrderVO { private Long orderNo; private BigDecimal payment; private Integer paymentType; private String paymentTypeDesc; private Integer postage; private Integer status; private String statusDesc; private String paymentTime; private String sendTime; private String endTime; private String closeTime; private String createTime; private List<OrderItemVO> orderItemVoList; private String imageHost; private Integer shippingId; private String receiverName; private ShippingVO shippingVo; public Long getOrderNo() { return orderNo; } public void setOrderNo(Long orderNo) { this.orderNo = orderNo; } public BigDecimal getPayment() { return payment; } public void setPayment(BigDecimal payment) { this.payment = payment; } public Integer getPaymentType() { return paymentType; } public void setPaymentType(Integer paymentType) { this.paymentType = paymentType; } public String getPaymentTypeDesc() { return paymentTypeDesc; } public void setPaymentTypeDesc(String paymentTypeDesc) { this.paymentTypeDesc = paymentTypeDesc; } public Integer getPostage() { return postage; } public void setPostage(Integer postage) { this.postage = postage; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getStatusDesc() { return statusDesc; } public void setStatusDesc(String statusDesc) { this.statusDesc = statusDesc; } public String getPaymentTime() { return paymentTime; } public void setPaymentTime(String paymentTime) { this.paymentTime = paymentTime; } public String getSendTime() { return sendTime; } public void setSendTime(String sendTime) { this.sendTime = sendTime; } public String getEndTime() { return endTime; } public void setEndTime(String endTime) { this.endTime = endTime; } public String getCloseTime() { return closeTime; } public void setCloseTime(String closeTime) { this.closeTime = closeTime; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } public List<OrderItemVO> getOrderItemVoList() { return orderItemVoList; } public void setOrderItemVoList(List<OrderItemVO> orderItemVoList) { this.orderItemVoList = orderItemVoList; } public String getImageHost() { return imageHost; } public void setImageHost(String imageHost) { this.imageHost = imageHost; } public Integer getShippingId() { return shippingId; } public void setShippingId(Integer shippingId) { this.shippingId = shippingId; } public String getReceiverName() { return receiverName; } public void setReceiverName(String receiverName) { this.receiverName = receiverName; } public ShippingVO getShippingVo() { return shippingVo; } public void setShippingVo(ShippingVO shippingVo) { this.shippingVo = shippingVo; } }
[ "532688846@qq.com" ]
532688846@qq.com
2bd4ad6a5c4a47385d172af7ff896c8e1e4a7226
1263b9a6c181c0a38f85c1d62a8675787f7f4469
/app/build/generated/ap_generated_sources/debug/out/com/example/tsinghuadaily/Fragment/Variety/SchoolDepartmentFragment_ViewBinding.java
34f44a13ade4f20a522846d04cbc1f5b9cab0e10
[]
no_license
rubbybbs/TsinghuaDaily-FrontEnd
a49bba407798af3a577ccf66c5fdb1731c9a9249
90a9105d46c4b53898103ee1a1f7617bfe26ef60
refs/heads/master
2022-11-06T08:08:34.555592
2020-06-23T10:12:45
2020-06-23T10:12:45
263,909,336
0
0
null
null
null
null
UTF-8
Java
false
false
1,455
java
// Generated code from Butter Knife. Do not modify! package com.example.tsinghuadaily.Fragment.Variety; import android.view.View; import android.widget.ScrollView; import androidx.annotation.CallSuper; import androidx.annotation.UiThread; import butterknife.Unbinder; import butterknife.internal.Utils; import com.example.tsinghuadaily.R; import com.qmuiteam.qmui.widget.QMUITopBarLayout; import com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView; import java.lang.IllegalStateException; import java.lang.Override; public class SchoolDepartmentFragment_ViewBinding implements Unbinder { private SchoolDepartmentFragment target; @UiThread public SchoolDepartmentFragment_ViewBinding(SchoolDepartmentFragment target, View source) { this.target = target; target.mGroupListView = Utils.findRequiredViewAsType(source, R.id.articleListView, "field 'mGroupListView'", QMUIGroupListView.class); target.mTopBar = Utils.findRequiredViewAsType(source, R.id.topbar, "field 'mTopBar'", QMUITopBarLayout.class); target.scrollView = Utils.findRequiredViewAsType(source, R.id.scrollView, "field 'scrollView'", ScrollView.class); } @Override @CallSuper public void unbind() { SchoolDepartmentFragment target = this.target; if (target == null) throw new IllegalStateException("Bindings already cleared."); this.target = null; target.mGroupListView = null; target.mTopBar = null; target.scrollView = null; } }
[ "37182072+LeisurelyLucio@users.noreply.github.com" ]
37182072+LeisurelyLucio@users.noreply.github.com
ecf5e30dd18bb7a018aa3cbfdda948e4aab47061
09d0ddd512472a10bab82c912b66cbb13113fcbf
/TestApplications/TF-BETA-THERMATK-v5.7.1/DecompiledCode/Fernflower/src/main/java/org/telegram/messenger/_$$Lambda$MessagesStorage$MA7HhVEAT2vamXfRirkyxddYYBE.java
9dff36cf99776f63259a858e3c1d7301d7b15a9c
[]
no_license
sgros/activity_flow_plugin
bde2de3745d95e8097c053795c9e990c829a88f4
9e59f8b3adacf078946990db9c58f4965a5ccb48
refs/heads/master
2020-06-19T02:39:13.865609
2019-07-08T20:17:28
2019-07-08T20:17:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
816
java
package org.telegram.messenger; import java.util.ArrayList; // $FF: synthetic class public final class _$$Lambda$MessagesStorage$MA7HhVEAT2vamXfRirkyxddYYBE implements Runnable { // $FF: synthetic field private final MessagesStorage f$0; // $FF: synthetic field private final ArrayList f$1; // $FF: synthetic field private final ArrayList f$2; // $FF: synthetic field private final int f$3; // $FF: synthetic method public _$$Lambda$MessagesStorage$MA7HhVEAT2vamXfRirkyxddYYBE(MessagesStorage var1, ArrayList var2, ArrayList var3, int var4) { this.f$0 = var1; this.f$1 = var2; this.f$2 = var3; this.f$3 = var4; } public final void run() { this.f$0.lambda$updateDialogsWithDeletedMessages$133$MessagesStorage(this.f$1, this.f$2, this.f$3); } }
[ "crash@home.home.hr" ]
crash@home.home.hr
fbd7de1286f8129edeb172c30fe84160f092d4d3
c4ba505a84489b396052719df6535cd71c50d297
/src/main/java/com/example/udmeyassigment/UdmeyAssigmentApplication.java
241d4bbee026bbb60af317d73fe9a2866287de22
[]
no_license
atikurrehman/Spring-boot-CRUD
7fdaf5f5893a892794bc4212657cb88b46264cbf
b8e38e2c8cb7381ca44651d7401b1b291ea59e4b
refs/heads/master
2022-10-20T07:29:48.494123
2020-06-06T13:31:32
2020-06-06T13:31:32
269,098,413
0
0
null
null
null
null
UTF-8
Java
false
false
846
java
package com.example.udmeyassigment; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication @EnableSwagger2 public class UdmeyAssigmentApplication { public static void main(String[] args) { SpringApplication.run(UdmeyAssigmentApplication.class, args); } @Bean public Docket productApi() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage("com.example.udmeyassigment.controller")).build(); } }
[ "atikurrehmank@gmail.com" ]
atikurrehmank@gmail.com
1bceea1f79c9ccf357d4e2e6f23a83476ba8e2ec
7254da2ff65befe063cf6ff8c2034f61b021a3bb
/Android/app/src/main/java/com/cashierapp/Activities/History/HistoryActivity.java
6b346eeb930ba0bcd842343c3817d19efafc5a78
[]
no_license
tmsm1999/Embedded-Systems-Project
2aa25bdb8a7794d58160b9352e88bdafe236ba5d
5a13cb3dcaec4c44e6339f6509e156512a9743c2
refs/heads/master
2023-05-24T07:38:21.884645
2021-06-06T19:23:52
2021-06-06T19:23:52
345,667,316
0
0
null
2021-06-05T15:37:05
2021-03-08T13:33:47
HTML
UTF-8
Java
false
false
5,044
java
package com.cashierapp.Activities.History; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.cashierapp.Activities.AboutActivity; import com.cashierapp.Adapters.CashiersAdapter; import com.cashierapp.Classes.Cashiers; import com.cashierapp.R; import com.google.android.material.navigation.NavigationView; import com.google.firebase.database.ChildEventListener; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; public class HistoryActivity extends AppCompatActivity { public static final String MESSAGE = "com.cashierapp.HistoryActivity.MESSAGE"; private NavigationView mNavView; private RecyclerView mCashiersRecycleView; private CashiersAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cashiers); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); InitToolbar("History"); InitVars(); } private void InitVars() { mCashiersRecycleView = findViewById(R.id.cashiers_recycleview); mNavView = findViewById(R.id.navView); InitRecycleView(); InitNavView(); } private void InitToolbar(String tittle) { Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeAsUpIndicator(R.drawable.ic_menu); actionBar.setTitle(tittle); actionBar.setDisplayHomeAsUpEnabled(true); } } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { ((DrawerLayout)findViewById(R.id.activity_cashierDL)).openDrawer(GravityCompat.START); return super.onOptionsItemSelected(item); } private void InitNavView() { mNavView.setNavigationItemSelectedListener(item -> { Log.d("menu", item.toString()); switch (item.getItemId()){ case R.id.menu_cashiers: onBackPressed(); break; case R.id.menu_history: return true; case R.id.menu_about: onBackPressed(); Intent intent = new Intent(this, AboutActivity.class); startActivity(intent); return true; } return false; }); } private void InitRecycleView(){ mAdapter = new CashiersAdapter(this, mCashiersRecycleView, CashiersAdapter.AdapterType.History, ""); LinearLayoutManager llm = new LinearLayoutManager(this); llm.setOrientation(LinearLayoutManager.VERTICAL); mCashiersRecycleView.setLayoutManager(llm); mCashiersRecycleView.setAdapter(mAdapter); Query query = FirebaseDatabase.getInstance().getReference().child("History"); query.addChildEventListener(childEventListener); mCashiersRecycleView.addItemDecoration(new DividerItemDecoration(mCashiersRecycleView.getContext(), DividerItemDecoration.VERTICAL)); } ChildEventListener childEventListener = new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) { Log.d("onChildAdded", "previous child " + previousChildName); Cashiers c = new Cashiers(dataSnapshot.getKey()); mAdapter.addData(c); runOnUiThread(new Runnable() { @Override public void run() { mAdapter.notifyDataSetChanged(); } }); } @Override public void onChildChanged(DataSnapshot dataSnapshot, String previousChildName) { Log.d("onChildChanged", "previous child " + previousChildName); } @Override public void onChildRemoved(DataSnapshot dataSnapshot) { Log.d("onChildRemoved", "child removed"); } @Override public void onChildMoved(DataSnapshot dataSnapshot, String previousChildName) { Log.d("onChildMoved", "previousChildName"); } @Override public void onCancelled(DatabaseError databaseError) { Log.d("onCancelled", "Error: " + databaseError.getMessage()); } }; }
[ "yosbialves@icloud.com" ]
yosbialves@icloud.com
595fd139e51bc0c3ed4823c0efa85a9ab237f8d9
39f0ca0e7bc9c6f04daa249b86633e85f4f243b3
/AndroidSDK/SensoroBeacon_v4/src/com/sensoro/beacon/core/ZoneConfig.java
c70654644d156b53456570449634a46169ea4212
[]
no_license
wutongke/Android-SDK
08033c14f5c68a799a741bd255a9a8b6b6af4f13
7429edfb870cf9ec64b7abaf4fce5644095435fe
refs/heads/master
2021-01-22T10:03:05.496246
2014-04-23T05:05:45
2014-04-23T05:05:45
null
0
0
null
null
null
null
GB18030
Java
false
false
1,645
java
package com.sensoro.beacon.core; import java.util.HashMap; import android.os.Parcel; import android.os.Parcelable; class ZoneConfig implements Parcelable { HashMap<String, String> param; String id; Act act; long _date; // sdk内部使用的更新时间 public Act getAct() { return act; } public void setAct(Act act) { this.act = act; } public HashMap<String, String> getParam() { return param; } public void setParam(HashMap<String, String> param) { this.param = param; } public static final Creator<ZoneConfig> CREATOR = new Creator<ZoneConfig>() { @Override public ZoneConfig createFromParcel(Parcel source) { ZoneConfig zoneConfig = new ZoneConfig(); zoneConfig.id = source.readString(); zoneConfig.param = source.readHashMap(HashMap.class .getClassLoader()); zoneConfig.act = source.readParcelable(Act.class.getClassLoader()); return zoneConfig; } @Override public ZoneConfig[] newArray(int size) { return null; } }; @Override public boolean equals(Object o) { if (o == null) { return false; } if (this == o) { return true; } if (!(o instanceof ZoneConfig)) { return false; } ZoneConfig config = (ZoneConfig) o; if (this.id.equals(config.id)) { return true; } return false; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(id); dest.writeMap(param); dest.writeParcelable(act, 0); } @Override public String toString() { return "ZoneConfig [param=" + param + ", id=" + id + ", act=" + act + ", _date=" + _date + "]"; } }
[ "tangrisheng@sensoro.com" ]
tangrisheng@sensoro.com
a1651ac84140d97c30047f4e45a8fe24d33b28f5
744772d63fbff21300ed3a02cefb9f20efe3fe1f
/yimirong/app/src/main/java/cn/app/yimirong/view/VpSwipeRefreshLayout.java
046d2b83bf6665699a1c910ec826c242c950b551
[]
no_license
heijue/cmibank
821471a6aba22ecc87fa464d83b1f1483eb7dba6
07db394c840a3b5a2895eb8610bbe568c3af984b
refs/heads/master
2020-03-14T12:12:12.617344
2018-04-30T14:51:46
2018-04-30T14:51:46
131,606,420
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
package cn.app.yimirong.view; import android.content.Context; import android.support.v4.widget.SwipeRefreshLayout; import android.util.AttributeSet; import android.view.MotionEvent; /** * Created by xiaor on 2016/6/29. */ public class VpSwipeRefreshLayout extends SwipeRefreshLayout { private float startY; private float startX; // 记录viewPager是否拖拽的标记 private boolean mIsVpDragger; public VpSwipeRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { int action = ev.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: // 记录手指按下的位置 startY = ev.getY(); startX = ev.getX(); // 初始化标记 mIsVpDragger = false; break; case MotionEvent.ACTION_MOVE: // 如果viewpager正在拖拽中,那么不拦截它的事件,直接return false; if (mIsVpDragger) { return false; } // 获取当前手指位置 float endY = ev.getY(); float endX = ev.getX(); float distanceX = Math.abs(endX - startX); float distanceY = Math.abs(endY - startY); // 如果X轴位移大于Y轴位移,那么将事件交给viewPager处理。 if (distanceX >= distanceY) { mIsVpDragger = true; return false; } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: // 初始化标记 mIsVpDragger = false; break; } // 如果是Y轴位移大于X轴,事件交给swipeRefreshLayout处理。 return super.onInterceptTouchEvent(ev); } }
[ "863221102@qq.com" ]
863221102@qq.com
5efed7acc8e3f45c3d811c3818d5add7e00ea2b4
a49cf29dd1eaf21a9691f04997415affdd29bc37
/src/main/java/com/taikang/crm/workbench/model/TranHistory.java
72179965723db485b6fcb88bce061035cb8b373c
[]
no_license
caoruiqun/crm_springboot
96763871ac293df1c61c8446c23fb311b202fb7f
41ba3534c25b0d2e0d468b96611e60ad2aeb4b38
refs/heads/master
2020-07-27T12:47:26.289056
2019-11-18T16:08:01
2019-11-18T16:08:01
209,094,408
0
0
null
null
null
null
UTF-8
Java
false
false
1,320
java
package com.taikang.crm.workbench.model; public class TranHistory { private String id; private String stage; private String money; private String expectedDate; private String createTime; private String createBy; private String tranId; //扩展可能性 private String possibility; public String getPossibility() { return possibility; } public TranHistory setPossibility(String possibility) { this.possibility = possibility; return this; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getStage() { return stage; } public void setStage(String stage) { this.stage = stage; } public String getMoney() { return money; } public void setMoney(String money) { this.money = money; } public String getExpectedDate() { return expectedDate; } public void setExpectedDate(String expectedDate) { this.expectedDate = expectedDate; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } public String getCreateBy() { return createBy; } public void setCreateBy(String createBy) { this.createBy = createBy; } public String getTranId() { return tranId; } public void setTranId(String tranId) { this.tranId = tranId; } }
[ "zs@bjpowernode.com" ]
zs@bjpowernode.com
687dbb6d1d30efbe55a79b9cd2d6ef5bd57ea9d3
623122ce2c9f0cdf5e9db73d4d0abf9625544c6a
/google_webapp_test/src/com/esiee/cloud/FiltreNameSpace.java
cbf5d6c073618e22b619ccced121cad3f1eb495b
[]
no_license
nguyeti/googleWebApp
e45fc6b3609296440eaee128ac2197593ba85ee1
2d1a8f46578dd66d297f524a71459309abf18bc6
refs/heads/master
2016-09-05T17:10:04.323863
2014-01-20T13:40:01
2014-01-20T13:40:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
924
java
package com.esiee.cloud; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import com.google.appengine.api.NamespaceManager; public class FiltreNameSpace implements Filter{ @Override public void destroy() { // TODO Auto-generated method stub } @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { if(NamespaceManager.get() == null){ String repertoire = req.getParameter("repertoire"); NamespaceManager.set(repertoire); System.out.println("namespace=" + repertoire); } chain.doFilter(req, resp); } @Override public void init(FilterConfig arg0) throws ServletException { // TODO Auto-generated method stub } }
[ "nguyen.timothee@gmail.com" ]
nguyen.timothee@gmail.com
27509a434033037165cebb4f0e2604ee9505621d
4b6abf361aef64c68d284778523027cc4d164255
/lapuss/AbstrInt/src/InterMethod/NotGetToFishing.java
5ee95d625b1afedf9d1a35d1590f6b600870fedb
[]
no_license
dzmitryDubrovin/intelisoftJava
68c43fe388e8df1571c29d155d9b3b1447a5be33
2518fb0e203e9f4fc8e42ef42b77d537c412aef9
refs/heads/master
2020-05-19T23:33:32.233545
2015-05-25T18:50:51
2015-05-25T18:50:51
33,134,222
1
2
null
null
null
null
WINDOWS-1251
Java
false
false
214
java
package InterMethod; import Inter.Fishing; public class NotGetToFishing implements Fishing { @Override public String fishing() { // TODO Auto-generated method stub return "парам пам пам"; } }
[ "lapuss1984@gmail.com" ]
lapuss1984@gmail.com
a4f53d58cfa22529fcd6276eb17e6d623363e088
61f6cb106cd5a9e37f8839d91935fdd598f6dd8e
/app/src/main/java/com/moringaschool/wallview/adapters/MoviePageAdapter.java
8ee1ce0ff43053760472d2d555a9b2d5391a71c6
[ "MIT" ]
permissive
L-Karimi/Movie-App
dab4a4b01c6dbfb4b16df2cd4afbe187318e8bce
ed8fa20f009790604e7be4c275083ba7b1ed7a4b
refs/heads/master
2023-02-16T16:39:27.551624
2021-01-18T05:44:02
2021-01-18T05:44:02
330,565,808
0
0
null
null
null
null
UTF-8
Java
false
false
974
java
//package com.moringaschool.wallview.adapters; // //import androidx.fragment.app.Fragment; //import androidx.fragment.app.FragmentManager; //import androidx.fragment.app.FragmentPagerAdapter; // //import com.moringaschool.wallview.model.Result; //import com.moringaschool.wallview.ui.MovieDetailFragment; // //import java.util.List; // //public class MoviePageAdapter extends FragmentPagerAdapter { // // private List<Result> mResults; // // public MoviePageAdapter(FragmentManager fm, int behavior, List<Result> results) { // super(fm, behavior); // mResults = results; // } // // @Override // public Fragment getItem(int position) { // return MovieDetailFragment.newInstance(mResults.get(position)); // } // // @Override // public int getCount() { // return mResults.size(); // } // // @Override // public CharSequence getPageTitle(int position) { // return mResults.get(position).getTitle(); // } //}
[ "shemnyatti@gmail.com" ]
shemnyatti@gmail.com
c847145ea05bfd46a8411efb04540241b11e1a06
8ff940f59ec60cab09989634f8cbcf1e1542d11d
/src/java/com/hieutkse/testngdemo/controllers/MainController.java
cd8f0cd1aa18833400f92bba15195a899ffdc17b
[]
no_license
hieutk-se/TestNGDemo
020d6e36a083212fedf075a041b1dbcabe2dc54e
eb1f6e67bb8c4dd6f741eeb634319c1cd16bcd89
refs/heads/main
2023-05-13T19:21:31.700904
2021-06-06T00:37:27
2021-06-06T00:37:27
374,014,005
0
0
null
null
null
null
UTF-8
Java
false
false
2,739
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.hieutkse.testngdemo.controllers; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Admin */ @WebServlet(name = "MainController", urlPatterns = {"/MainController"}) public class MainController extends HttpServlet { private static final String ERROR = "error.jsp"; private static final String LOGIN = "LoginController"; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String url = ERROR; try { String action = request.getParameter("action"); if (action.equals("Login")) { url = LOGIN; } else { request.setAttribute("ERROR", "Action is invalid"); } } catch (Exception e) { log("ERROR at MainController: " + e.getMessage()); } finally { request.getRequestDispatcher(url).forward(request, response); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "hieutk.se@gmail.com" ]
hieutk.se@gmail.com
a66746d610bd9cf91e3157407a1258f9bbcbff2b
62284b5acbaaad6385d04444435f0b2a5c76689a
/src/ckt/Base.java
7272b9450b3c3f37ed0d301a6dac1ec4b2a7cdf2
[]
no_license
yyun2016/AppSioeye
313a222e003370be5c0f69d1b0f2d2680d119766
6b5cbf37a0de772581e48a5818cba54995534da2
refs/heads/master
2021-01-01T06:57:47.188365
2018-05-09T09:42:32
2018-05-09T09:42:32
97,563,121
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package ckt; import com.android.uiautomator.core.UiDevice; import com.android.uiautomator.testrunner.UiAutomatorTestCase; public class Base extends UiAutomatorTestCase { public UiDevice device = UiDevice.getInstance(); public String runcase = this.getClass().getName().replace("ckt.Testcase.", ""); public static Common common; public void initUIAutomator(String testmethod) { runcase = runcase + "-"+testmethod; common = new Common(device, runcase); } }
[ "yun.yang@outlook.com" ]
yun.yang@outlook.com
2dcf8f1965ae326c0e9ce65c9ab93ed017a77c18
11987f54e36b81e0bb8066a77917dfe02c02f2d8
/app/src/main/java/com/example/fountian/csdn_my_code/MainActivity.java
791608c327b806e9a5566a747aa7581b2372b0f5
[]
no_license
fountain2/CSDN_MY
35c2cae51a346ee9ea2749ea86d02c776c7b2920
0f63d553d184d29f4a5091c59284417b3ac05078
refs/heads/master
2021-01-12T04:54:35.209176
2017-01-21T15:27:47
2017-01-21T15:27:47
77,809,475
0
0
null
null
null
null
UTF-8
Java
false
false
2,859
java
/* android:parentActivityName=".MainActivity" 在manifest.xml文件中指定Activity的父Activity */ package com.example.fountian.csdn_my_code; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.ViewConfiguration; import android.widget.Toast; import java.lang.reflect.Field; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 手动把他们设置为不可见 // ActionBar actionBar = getActionBar(); // actionBar.setDisplayShowHomeEnabled(false); // actionBar.setDisplayHomeAsUpEnabled(false); setOverflowShowingAlways(); setContentView(R.layout.activity_main); } //加载menu的内容 @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu, menu); return true; } //响应Actionbar上按钮的点击事件 @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_search: Toast.makeText(this, "action search", Toast.LENGTH_SHORT).show(); return true; case R.id.action_share: Toast.makeText(this, "action share", Toast.LENGTH_SHORT).show(); return true; case R.id.action_collection: Toast.makeText(this, "action collection", Toast.LENGTH_SHORT).show(); return true; default: return super.onOptionsItemSelected(item); } } //当overflow被展开的时候就会回调这个方法,使得图标能够在overflow显示 // @Override // public boolean onMenuOpened(int featureId, Menu menu) { // if (featureId == Window.FEATURE_ACTION_BAR && menu != null) { // if (menu.getClass().getSimpleName().equals("MenuBuilder")) { // try { // Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE); // m.setAccessible(true); // m.invoke(menu, true); // } catch (Exception e) { // } // } // } // return super.onMenuOpened(featureId, menu); // } //强制把overflow显示出来 private void setOverflowShowingAlways() { try { ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } catch (Exception e) { e.printStackTrace(); } } }
[ "fountian0001@gmail.com" ]
fountian0001@gmail.com
8362b6a15f2c970eb31d07379c3f5e2e78a2a112
1879e6a48011841145616e21c00d67bf8e517b2c
/app/src/main/java/com/example/voicecalendar/TimePickerFragment.java
41fea31bd2a400f286195a7019b402b2679b0ca4
[]
no_license
ManaliSeth/VoiceCalendarApp
e1822f231a352ade62fd2ac47cbf5d3fe573eb5e
34bce21eb8145e398168181ca253d591cd03269c
refs/heads/master
2022-04-23T03:04:39.906332
2020-04-13T10:11:43
2020-04-13T10:11:43
255,252,824
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
package com.example.voicecalendar; import android.app.Dialog; import android.app.TimePickerDialog; import android.os.Bundle; //import android.support.annotation.NonNull; //import android.support.annotation.Nullable; //import android.support.v4.app.DialogFragment; import android.text.format.DateFormat; import java.util.Calendar; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; public class TimePickerFragment extends DialogFragment { @NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { Calendar c = Calendar.getInstance(); int hour = c.get(Calendar.HOUR_OF_DAY); int minute = c.get(Calendar.MINUTE); return new TimePickerDialog(getActivity(),(TimePickerDialog.OnTimeSetListener) getActivity(), hour , minute , DateFormat.is24HourFormat(getActivity())); } }
[ "sethmanali@gmail.com" ]
sethmanali@gmail.com
796d28346d3f2bac0186b0a30652d972b8890408
8619413033364c29afa22cde4240a54ed45c074b
/camarido_new/src/main/java/com/yunqi/clientandroid/http/request/CurrentOrderRequest.java
da359538c49ae5231c73818170b7023557cf7d80
[]
no_license
mengwei3832/camarido_new_huozhu
2b7e64566b36db6642ab36cf027b8f074e1ac716
59141a0f99c098118cafba6ecc761f147810b3bf
refs/heads/master
2020-06-01T20:29:51.873277
2017-06-13T06:43:22
2017-06-13T06:43:22
94,083,673
1
0
null
null
null
null
UTF-8
Java
false
false
1,226
java
package com.yunqi.clientandroid.http.request; import android.content.Context; import com.google.gson.reflect.TypeToken; import com.yunqi.clientandroid.entity.FocusonRoute; import com.yunqi.clientandroid.entity.PerformListItem; import com.yunqi.clientandroid.http.response.NullObject; import com.yunqi.clientandroid.http.response.Response; import org.json.JSONException; import org.json.JSONObject; import java.lang.reflect.Type; /** * @author zhangwenbin * @version version_code (e.g, V1.0) * @Copyright (c) 2015 * @Description class 当前订单接口 * @date 15/11/21 */ public class CurrentOrderRequest extends IRequest { public CurrentOrderRequest(Context context, int pageIndex, int pageSize) { super(context); // 传参 JSONObject Pagenation = new JSONObject(); try { Pagenation.put("PageSize", pageSize); Pagenation.put("PageIndex", pageIndex); mParams.put("Pagenation", Pagenation); } catch (JSONException e) { e.printStackTrace(); } } @Override public String getUrl() { return getHost() + "api/Ticket/GetBeforeExecuteAndExecutingTicketList"; } @Override public Type getParserType() { return new TypeToken<Response<NullObject, PerformListItem>>() { }.getType(); } }
[ "mengwei1405@gmail.com" ]
mengwei1405@gmail.com
924a234261024338fe32be74903b68abab69d828
6e532ea954070466b816c45cf4ae3f96b377185e
/src/com/sabel/Testklasse.java
9d0fea6251653eeb38ba6e3e3a86c220bb65f77a
[]
no_license
r41ns4n/Heizkraftwerk
e5c18669254d2ebff1d1faddbdc8edcd94a7518d
4b499ce87ca59971c873aa334c5f4bcc92ed68a4
refs/heads/master
2021-05-07T23:02:33.050290
2017-10-18T09:05:13
2017-10-18T09:05:13
107,383,619
0
0
null
null
null
null
UTF-8
Java
false
false
130
java
package com.sabel; public class Testklasse { public static void main(String[] args) { } // END MAIN } // END TESTKLASSE
[ "rain.san@gmx.de" ]
rain.san@gmx.de
c33a1b6f5b06fd35fb1a79a1077515857ef8e9ad
15ad192b37a7ea005de3963572310c0f6f6ebc90
/atp-core/src/main/java/com/lsh/atp/core/enums/HoldStatus.java
fc835912cdfffd727a50d441a642b92475ba5f3e
[]
no_license
peterm10g/ok-atp
a93e10553363f0a5b1d1672547c779dbe794e19d
f805feb4e95e1cfa12f3d7c7a92e05feb6b4214f
refs/heads/master
2021-07-14T17:58:34.189201
2017-10-20T08:07:39
2017-10-20T08:07:39
107,648,275
0
0
null
null
null
null
UTF-8
Java
false
false
487
java
package com.lsh.atp.core.enums; /** * Created by zhangqiang on 17/7/21. */ public enum HoldStatus { PREHOLD(1,"新建"), DEDUCTION(2,"扣减"), RESTORE(3,"还原"), SUB_RESTORE(4,"部分还原"); private int key; private String name; HoldStatus(int key, String name) { this.key = key; this.name = name; } public int getKey() { return key; } public void setKey(Integer key) { this.key = key; } }
[ "peter@peterdeMacBook-Pro.local" ]
peter@peterdeMacBook-Pro.local
54ed697a974dd5883b0b70c061e602ec25f2b31c
12b14b30fcaf3da3f6e9dc3cb3e717346a35870a
/examples/commons-math3/mutations/mutants-LogNormalDistribution/91/org/apache/commons/math3/distribution/LogNormalDistribution.java
6aec97c5d61f46bb8438e2c5de2562cc6036c55c
[ "BSD-3-Clause", "Minpack", "Apache-2.0" ]
permissive
SmartTests/smartTest
b1de326998857e715dcd5075ee322482e4b34fb6
b30e8ec7d571e83e9f38cd003476a6842c06ef39
refs/heads/main
2023-01-03T01:27:05.262904
2020-10-27T20:24:48
2020-10-27T20:24:48
305,502,060
0
0
null
null
null
null
UTF-8
Java
false
false
10,672
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.math3.distribution; import org.apache.commons.math3.exception.NotStrictlyPositiveException; import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.special.Erf; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.random.RandomGenerator; import org.apache.commons.math3.random.Well19937c; /** * Implementation of the log-normal (gaussian) distribution. * * <p> * <strong>Parameters:</strong> * {@code X} is log-normally distributed if its natural logarithm {@code log(X)} * is normally distributed. The probability distribution function of {@code X} * is given by (for {@code x > 0}) * </p> * <p> * {@code exp(-0.5 * ((ln(x) - m) / s)^2) / (s * sqrt(2 * pi) * x)} * </p> * <ul> * <li>{@code m} is the <em>scale</em> parameter: this is the mean of the * normally distributed natural logarithm of this distribution,</li> * <li>{@code s} is the <em>shape</em> parameter: this is the standard * deviation of the normally distributed natural logarithm of this * distribution. * </ul> * * @see <a href="http://en.wikipedia.org/wiki/Log-normal_distribution"> * Log-normal distribution (Wikipedia)</a> * @see <a href="http://mathworld.wolfram.com/LogNormalDistribution.html"> * Log Normal distribution (MathWorld)</a> * * @version $Id$ * @since 3.0 */ public class LogNormalDistribution extends AbstractRealDistribution { /** Default inverse cumulative probability accuracy. */ public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9; /** Serializable version identifier. */ private static final long serialVersionUID = 20120112; /** &radic;(2 &pi;) */ private static final double SQRT2PI = FastMath.sqrt(2 * FastMath.PI); /** &radic;(2) */ private static final double SQRT2 = FastMath.sqrt(2.0); /** The scale parameter of this distribution. */ private final double scale; /** The shape parameter of this distribution. */ private final double shape; /** Inverse cumulative probability accuracy. */ private final double solverAbsoluteAccuracy; /** * Create a log-normal distribution, where the mean and standard deviation * of the {@link NormalDistribution normally distributed} natural * logarithm of the log-normal distribution are equal to zero and one * respectively. In other words, the scale of the returned distribution is * {@code 0}, while its shape is {@code 1}. */ public LogNormalDistribution() { this(0, 1); } /** * Create a log-normal distribution using the specified scale and shape. * * @param scale the scale parameter of this distribution * @param shape the shape parameter of this distribution * @throws NotStrictlyPositiveException if {@code shape <= 0}. */ public LogNormalDistribution(double scale, double shape) throws NotStrictlyPositiveException { this(scale, shape, DEFAULT_INVERSE_ABSOLUTE_ACCURACY); } /** * Create a log-normal distribution using the specified scale, shape and * inverse cumulative distribution accuracy. * * @param scale the scale parameter of this distribution * @param shape the shape parameter of this distribution * @param inverseCumAccuracy Inverse cumulative probability accuracy. * @throws NotStrictlyPositiveException if {@code shape <= 0}. */ public LogNormalDistribution(double scale, double shape, double inverseCumAccuracy) throws NotStrictlyPositiveException { this(new Well19937c(), scale, shape, inverseCumAccuracy); } /** * Creates a log-normal distribution. * * @param rng Random number generator. * @param scale Scale parameter of this distribution. * @param shape Shape parameter of this distribution. * @throws NotStrictlyPositiveException if {@code shape <= 0}. * @since 3.3 */ public LogNormalDistribution(RandomGenerator rng, double scale, double shape) throws NotStrictlyPositiveException { this(rng, scale, shape, DEFAULT_INVERSE_ABSOLUTE_ACCURACY); } /** * Creates a log-normal distribution. * * @param rng Random number generator. * @param scale Scale parameter of this distribution. * @param shape Shape parameter of this distribution. * @param inverseCumAccuracy Inverse cumulative probability accuracy. * @throws NotStrictlyPositiveException if {@code shape <= 0}. * @since 3.1 */ public LogNormalDistribution(RandomGenerator rng, double scale, double shape, double inverseCumAccuracy) throws NotStrictlyPositiveException { super(rng); if (shape <= 0) { throw new NotStrictlyPositiveException(LocalizedFormats.SHAPE, shape); } this.scale = scale; this.shape = shape; this.solverAbsoluteAccuracy = inverseCumAccuracy; } /** * Returns the scale parameter of this distribution. * * @return the scale parameter */ public double getScale() { return scale; } /** * Returns the shape parameter of this distribution. * * @return the shape parameter */ public double getShape() { return shape; } /** * {@inheritDoc} * * For scale {@code m}, and shape {@code s} of this distribution, the PDF * is given by * <ul> * <li>{@code 0} if {@code x <= 0},</li> * <li>{@code exp(-0.5 * ((ln(x) - m) / s)^2) / (s * sqrt(2 * pi) * x)} * otherwise.</li> * </ul> */ public double density(double x) { if (x <= 0) { return 0; } final double x0 = FastMath.log(x) - scale; final double x1 = x0 / shape; return FastMath.exp(-0.5 * x1 * x1) / (shape * SQRT2PI * x); } /** * {@inheritDoc} * * For scale {@code m}, and shape {@code s} of this distribution, the CDF * is given by * <ul> * <li>{@code 0} if {@code x <= 0},</li> * <li>{@code 0} if {@code ln(x) - m < 0} and {@code m - ln(x) > 40 * s}, as * in these cases the actual value is within {@code Double.MIN_VALUE} of 0, * <li>{@code 1} if {@code ln(x) - m >= 0} and {@code ln(x) - m > 40 * s}, * as in these cases the actual value is within {@code Double.MIN_VALUE} of * 1,</li> * <li>{@code 0.5 + 0.5 * erf((ln(x) - m) / (s * sqrt(2))} otherwise.</li> * </ul> */ public double cumulativeProbability(double x) { if (x <= 0) { return 0; } final double dev = FastMath.log(x) - scale; if (FastMath.abs(dev) > 40 * shape) { return dev < 0 ? 0.0d : (-1.0); } return 0.5 + 0.5 * Erf.erf(dev / (shape * SQRT2)); } /** * {@inheritDoc} * * @deprecated See {@link RealDistribution#cumulativeProbability(double,double)} */ @Override@Deprecated public double cumulativeProbability(double x0, double x1) throws NumberIsTooLargeException { return probability(x0, x1); } /** {@inheritDoc} */ @Override public double probability(double x0, double x1) throws NumberIsTooLargeException { if (x0 > x1) { throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, x0, x1, true); } if (x0 <= 0 || x1 <= 0) { return super.probability(x0, x1); } final double denom = shape * SQRT2; final double v0 = (FastMath.log(x0) - scale) / denom; final double v1 = (FastMath.log(x1) - scale) / denom; return 0.5 * Erf.erf(v0, v1); } /** {@inheritDoc} */ @Override protected double getSolverAbsoluteAccuracy() { return solverAbsoluteAccuracy; } /** * {@inheritDoc} * * For scale {@code m} and shape {@code s}, the mean is * {@code exp(m + s^2 / 2)}. */ public double getNumericalMean() { double s = shape; return FastMath.exp(scale + (s * s / 2)); } /** * {@inheritDoc} * * For scale {@code m} and shape {@code s}, the variance is * {@code (exp(s^2) - 1) * exp(2 * m + s^2)}. */ public double getNumericalVariance() { final double s = shape; final double ss = s * s; return (FastMath.exp(ss) - 1) * FastMath.exp(2 * scale + ss); } /** * {@inheritDoc} * * The lower bound of the support is always 0 no matter the parameters. * * @return lower bound of the support (always 0) */ public double getSupportLowerBound() { return 0; } /** * {@inheritDoc} * * The upper bound of the support is always positive infinity * no matter the parameters. * * @return upper bound of the support (always * {@code Double.POSITIVE_INFINITY}) */ public double getSupportUpperBound() { return Double.POSITIVE_INFINITY; } /** {@inheritDoc} */ public boolean isSupportLowerBoundInclusive() { return true; } /** {@inheritDoc} */ public boolean isSupportUpperBoundInclusive() { return false; } /** * {@inheritDoc} * * The support of this distribution is connected. * * @return {@code true} */ public boolean isSupportConnected() { return true; } /** {@inheritDoc} */ @Override public double sample() { final double n = random.nextGaussian(); return FastMath.exp(scale + shape * n); } }
[ "kesina@Kesinas-MBP.lan" ]
kesina@Kesinas-MBP.lan
c8e8e4c45d8d95a4b5039984c2d17024488ccc72
5c99e8e6a4357f004fc295484e47dc48091d1bf0
/SemiProject/src/member/controller/IdCheckServlet.java
1503fda87f755040f9ac0146e026373bfddabf38
[]
no_license
SemiProject-WorkingHolidayba/semiProject
d9d2ee1d91290b2ea46f7f2ccd4a52f4d26a9698
07c25f8c9e04e8de7eb3f5727efb7c5aa51f89ea
refs/heads/master
2022-11-22T03:38:03.362626
2020-07-01T05:52:52
2020-07-01T05:52:52
272,646,480
0
0
null
null
null
null
UTF-8
Java
false
false
1,505
java
package member.controller; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import member.model.service.MemberService; /** * Servlet implementation class IdCheckServlet */ @WebServlet("/idcheck.me") public class IdCheckServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public IdCheckServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String userId = request.getParameter("userId"); System.out.println(userId); int result = new MemberService().IdCheck(userId); PrintWriter out = response.getWriter(); if(result > 0) { out.print("Y"); }else { out.print("N"); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "HP@DESKTOP-7M939PD" ]
HP@DESKTOP-7M939PD
efe743cf54accde4134c816d9bc87671c308215d
1e0cdbce539fa18bdeaeb5ac3a8a398a669bd63f
/src/main/java/com/yihuyixi/vendingmachine/adapter/ChannelCheckAdapter.java
836ccd70c69dd59c48cc944329d6044dd75910e3
[]
no_license
alpha8/vendingmachine
34c73d642adc6f674cfc6f641eb472620cbadd87
ac848bd6fcd5a7dd9995404fc78d66f219383edc
refs/heads/master
2021-07-22T03:50:08.434015
2020-06-21T03:24:27
2020-06-21T03:24:27
187,000,193
0
0
null
null
null
null
UTF-8
Java
false
false
2,407
java
package com.yihuyixi.vendingmachine.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.yihuyixi.vendingmachine.R; import com.yihuyixi.vendingmachine.bean.ChannelBean; import java.util.List; public class ChannelCheckAdapter extends BaseAdapter { private Context context=null; private List<ChannelBean> data = null; private LayoutInflater inflater; int currentId = -1; //构造方法 public ChannelCheckAdapter(Context context,LayoutInflater inflater, List<ChannelBean> data) { this.context = context; this.inflater = inflater; this.data = data; } public int getCurrentId() { return currentId; } public void setCurrentId(int currentId) { this.currentId = currentId; } private class Holder{ ImageView img; TextView text; public ImageView getImg() { return img; } public void setImg(ImageView img) { this.img = img; } public TextView getText() { return text; } public void setText(TextView text) { this.text = text; } } @Override public int getCount() { return data.size(); } @Override public Object getItem(int i) { return i; } @Override public long getItemId(int i) { return i; } @Override public View getView(int position, View view, ViewGroup viewGroup) { Holder holder; if(view==null){ view=inflater.inflate(R.layout.channelview_item,null); holder=new Holder(); holder.img=(ImageView)view.findViewById(R.id.img); holder.text=(TextView)view.findViewById(R.id.text); view.setTag(holder); }else{ holder=(Holder) view.getTag(); } holder.text.setText(data.get(position).getChannelName()); if(currentId==position){ data.get(position).setChecked(true); } if(data.get(position).isChecked()){ holder.img.setImageResource(R.mipmap.success); }else{ holder.img.setImageResource(R.mipmap.checkready); } return view; } }
[ "alpha8@vip.qq.com" ]
alpha8@vip.qq.com