blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
682fcc71c56fb5ad25ea9befe77c4bccebf1d7ad | cbd2ce73a291868ca02735dff4d112e131017633 | /src/test/java/BedroomTest.java | 06dff79dd5fd25a2d081e03354cbb3099de40285 | [] | no_license | kaluzsikc/CodeClan_Tower_lab | 181e18b1e9c1c8005af00f3711f1eaf857447da7 | 71f3707c00d0ff0c1b3af11a24b51b9803c0721a | refs/heads/master | 2020-03-31T16:49:57.635880 | 2018-10-10T12:19:12 | 2018-10-10T12:19:12 | 152,393,694 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,064 | java | import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class BedroomTest {
Bedroom bedroom;
Guest guest;
@Before
public void before() {
bedroom = new Bedroom(1, 2,"Double", 100.00 );
guest = new Guest("Bob");
}
@Test
public void hasNumber(){
assertEquals(1, bedroom.getNumber());
}
@Test
public void hasCapacity(){
assertEquals(2, bedroom.getCapacity());
}
@Test
public void hasType(){
assertEquals("Double", bedroom.getType());
}
@Test
public void hasRate(){
assertEquals(100.00, bedroom.getRate(), 0.01);
}
@Test
public void emptyArray(){
assertEquals(0, bedroom.getGuests());
}
@Test
public void addGuest() {
bedroom.addGuest(guest);
assertEquals(1, bedroom.getGuests());
}
@Test
public void removeGuest() {
bedroom.addGuest(guest);
bedroom.removeGuest(guest);
assertEquals(0, bedroom.getGuests());
}
}
| [
"kaluzsikc@gmail.com"
] | kaluzsikc@gmail.com |
be9f8e976428fbdb67ca8e440e0902cd2738626d | 40cd4da5514eb920e6a6889e82590e48720c3d38 | /desktop/applis/apps/apps_util/expressionlanguageutil/src/main/java/code/expressionlanguage/guicompos/stds/FctWindowIsVisible.java | fef10d6e5b39c452d1a92d21bf929d1364537585 | [] | no_license | Cardman/projects | 02704237e81868f8cb614abb37468cebb4ef4b31 | 23a9477dd736795c3af10bccccb3cdfa10c8123c | refs/heads/master | 2023-08-17T11:27:41.999350 | 2023-08-15T07:09:28 | 2023-08-15T07:09:28 | 34,724,613 | 4 | 0 | null | 2020-10-13T08:08:38 | 2015-04-28T10:39:03 | Java | UTF-8 | Java | false | false | 857 | java | package code.expressionlanguage.guicompos.stds;
import code.expressionlanguage.AbstractExiting;
import code.expressionlanguage.ContextEl;
import code.expressionlanguage.exec.ArgumentWrapper;
import code.expressionlanguage.exec.StackCall;
import code.expressionlanguage.exec.util.ArgumentListCall;
import code.expressionlanguage.guicompos.WindowStruct;
import code.expressionlanguage.stds.StdCaller;
import code.expressionlanguage.structs.BooleanStruct;
import code.expressionlanguage.structs.Struct;
public final class FctWindowIsVisible implements StdCaller {
@Override
public ArgumentWrapper call(AbstractExiting _exit, ContextEl _cont, Struct _instance, ArgumentListCall _firstArgs, StackCall _stackCall) {
WindowStruct inst_ = (WindowStruct) _instance;
return new ArgumentWrapper(BooleanStruct.of(inst_.isVisible()));
}
}
| [
"f.desrochettes@gmail.com"
] | f.desrochettes@gmail.com |
04bc32ff3d875ce59cb339fe3bacdb134b4de5df | f96f8e7fd6223bf673e7e82776e03b3ff9f44c26 | /src/main/java/com/baizhi/tss/controller/PoetryController.java | 2a423ea08a4bab5cf76d3784606c73d4084bd3a8 | [] | no_license | GuLiGen/tss | d569e15ebb1da5ac22e4a0490a77320d64941fb9 | df9695c6f55a15bbb232705df4836b77f3fe965a | refs/heads/master | 2020-04-13T05:42:14.431724 | 2018-12-26T02:35:58 | 2018-12-26T02:35:58 | 162,999,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,232 | java | package com.baizhi.tss.controller;
import com.baizhi.tss.entity.Poet;
import com.baizhi.tss.entity.Poetry;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.highlight.*;
import org.apache.lucene.store.FSDirectory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.wltea.analyzer.lucene.IKAnalyzer;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("/poetry")
public class PoetryController {
@RequestMapping("/find")
public String find(String text,String type, HttpSession session,Integer page,Integer pageSize) throws IOException, InvalidTokenOffsetsException, ParseException {
//指定路径
FSDirectory fsDirectory = FSDirectory.open(Paths.get("F:\\index\\08"));
//创建索引读入器
DirectoryReader directoryReader = DirectoryReader.open(fsDirectory);
//创建索引检索器对象
IndexSearcher indexSearcher = new IndexSearcher(directoryReader);
//创建解析器对象 默认查询内容域
QueryParser queryParser = new QueryParser("content",new IKAnalyzer());
Query query = null;
String ss = type+":"+text;
query = queryParser.parse(ss);
/**
* 分页
*/
TopDocs topDocsss = indexSearcher.search(query,pageSize);
//符合条件的总条数
int totalHits = topDocsss.totalHits;
session.setAttribute("count",totalHits);
if(page < 1){
page = 1;
System.out.println(">1");
}
int pages = (totalHits % pageSize == 0) ? (totalHits/pageSize) : (totalHits/pageSize +1);
session.setAttribute("pages",pages);
if(page > pages){
page = pages;
}
//点击上一页 下一页时 需要传递四个数据 这里现将 text 和type存入session中
session.setAttribute("text",text);
session.setAttribute("type",type);
session.setAttribute("page",page);
session.setAttribute("pageSize",pageSize);
//--------------------------------------------------------------------
TopDocs topDocs = null;
if(page <= 1){
topDocs = indexSearcher.search(query,pageSize);
}else if(page > 1){
TopDocs topDocss = indexSearcher.search(query, (page - 1) * pageSize);
//获取到当前页的左右一条数据
ScoreDoc[] scoreDocs = topDocss.scoreDocs;
ScoreDoc scoreDoc = scoreDocs[scoreDocs.length - 1];
topDocs = indexSearcher.searchAfter(scoreDoc,query,pageSize);
}
// 指定高亮格式
SimpleHTMLFormatter formatter = new SimpleHTMLFormatter("<span style='color:red'>", "</span>");
//创建高亮器对象 参数:1.分数器对象
//创建分数器 对象 QueryScorer
Scorer scorer = new QueryScorer(query);
Highlighter highlighter = new Highlighter(formatter,scorer);
ScoreDoc[] scoreDocs = topDocs.scoreDocs;
List<Poetry> list = new ArrayList<Poetry>();
for (ScoreDoc scoreDoc : scoreDocs) {
//分数
float score = scoreDoc.score;
//查询到数据在索引库所对应的编号
int doc = scoreDoc.doc;
//根据编号 获取数据
Document document = directoryReader.document(doc);
//高亮
/**
* 高亮内容
*/
String bestFragmentcontent = highlighter.getBestFragment(new IKAnalyzer(), "content", document.get("content"));
if(bestFragmentcontent == null){
bestFragmentcontent = document.get("content");
}
/**
* 高亮诗名
*/
String bestFragmenttitle = highlighter.getBestFragment(new IKAnalyzer(), "title", document.get("title"));
if(bestFragmenttitle == null){
bestFragmenttitle =document.get("title");
}
/**
* 高亮作者
*/
String bestFragmentauthor = highlighter.getBestFragment(new IKAnalyzer(), "author", document.get("author"));
if(bestFragmentauthor == null){
bestFragmentauthor =document.get("author");
}
/**
* 将数据存入对象 并将对象存入集合
*/
Poetry poetry = new Poetry();
poetry.setTitle(bestFragmenttitle);
poetry.setPoet(new Poet(null,bestFragmentauthor));
poetry.setContent(bestFragmentcontent);
list.add(poetry);
}
session.setAttribute("list",list);
return "redirect:/poetrylist.jsp";
}
}
| [
"guli_g@163.com"
] | guli_g@163.com |
5c4a3af0338941b36701fde5b83e7fe023f10e7e | 09de87f0f3f9364faedb23143e447eba0e73c03b | /src/main/java/uz/pdp/lesson11/entity/Warehouse.java | 7415f37265a5b88c6048f5b7fe75695616732c6a | [] | no_license | Jahongir97/lesson11 | 2394491e61cc01b071d516ab7a930592058cb351 | cc9f4f79754bb61c499c63229f246cf0536649fc | refs/heads/master | 2023-06-17T20:35:42.675271 | 2021-07-09T16:56:37 | 2021-07-09T16:56:37 | 384,414,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package uz.pdp.lesson11.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import uz.pdp.lesson11.entity.template.AbsEntity;
import javax.persistence.Entity;
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
public class Warehouse extends AbsEntity {
}
| [
"jahongir.shomutalov97@gmail.com"
] | jahongir.shomutalov97@gmail.com |
6b37436228e8975c4b736f80a939a915d1655800 | 256dbfd8a0628200f21be6be74baf0886862df30 | /src/main/java/prework2/prework/klasywewnetrzneizagniezdzone/Car.java | 92df55ab8b36bf6efd9354e23d4ae726f665bb4d | [] | no_license | typowy1/bootcamp-javastart-cwiczenia | b2c803c1cbb4e32f98504030e7728a61a69b3a1c | ad594d7d7184845d6df71a372092386ec5227519 | refs/heads/cwiczenia | 2023-03-21T15:24:31.928161 | 2021-03-17T18:33:05 | 2021-03-17T18:33:05 | 300,360,601 | 0 | 0 | null | 2020-11-26T19:44:52 | 2020-10-01T17:14:47 | Java | UTF-8 | Java | false | false | 2,312 | java | package prework2.prework.klasywewnetrzneizagniezdzone;
public class Car {
//https://javastart.pl/kurs/java/java-podstawy-temat-25-klasy-wewn%C4%99trzne/lekcja/java-podstawy-klasy-wewnetrzne-i-zagniezdzone
private Engine engine;
private int fuel;
public Car() {
engine = new Engine("Ferrari");
System.out.println("Utworzono samochód z silnikiem " + engine.engineType);
}
public void go() throws InterruptedException {
while (fuel > 0) {
engine.consumeFuel();
System.out.println("Pozostało " + fuel + " litrów paliwa");
Thread.sleep(1000);
}
System.out.println("Brak paliwa");
}
public void refuel(int liters) {
fuel = fuel + liters;
}
public class Engine {
private String engineType;
private static final int FUEL_CONSUMPTION = 20;
public Engine(String type) {
engineType = type;
}
public void consumeFuel() {
fuel = fuel - FUEL_CONSUMPTION;
}
//this słówko, do pola klasy wewnetrznej odnosimy sie this.fuel = 5;,
// do pola klasy zewnetrznej odnosimy sie Car.this.fuel = 5;
// class Car {
// private int fuel;
//
// private class Engine {
// int fuel;
//
// void consumeFuel() {
// // pole klasy wewnętrznej - Engine
// this.fuel = 5;
//
// // pole klasy otaczającej - Car
// Car.this.fuel = 5;
// }
// }
// }
}
// Zacznijmy tym razem od dołu. W klasie Car zdefiniowaliśmy wewnętrzną publiczną klasę Engine. Publiczna oznacza w tym
// momencie, że nie wykluczamy możliwości utworzenia jej obiektów poza klasą Car. W niej zdefiniowano pola prywatne
// engineType (typ silnika) i stałą FUEL_CONSUMPTION (spalanie na 100km), do której przypisujemy wartość 20. W klasie
// dostępny jest jeden konstruktor i metoda consumeFuel(), w której zmniejszamy stan paliwa, czyli zmienną prywatną klasy Car.
// Jedną z zalet stworzenia klasy Engine wewnątrz klasy Car jest to, że mamy dostęp do wszystkich pól klasy opakowującej,
// nawet jeśli nie udostępnia ona gettera.
}
| [
"lesnickirafal@gmail.com"
] | lesnickirafal@gmail.com |
637fcb2ed8dab12d1ba0971a85bf6b4fc897ddac | d9ca7719f0ddd581f78f9369c3fd19d98cd4fa79 | /src/com/designPattern/behavioral/visitor/ShoppingCartVisitor.java | 3b8abfc387b8e3c50a3e16e0e10a59d813e1c2d7 | [] | no_license | shobhit-bhardwaj/design-patterns | e4e7c147c840ae501c10191b962ab4c242e22c90 | b572d6f47221cc9693e6eeaa643afddd23d53a77 | refs/heads/main | 2023-08-15T04:58:39.010115 | 2021-09-24T11:46:38 | 2021-09-24T11:46:38 | 408,799,560 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package com.designPattern.behavioral.visitor;
public interface ShoppingCartVisitor {
public int visit(Book book);
public int visit(Fruit fruit);
} | [
"successshobhit@gmail.com"
] | successshobhit@gmail.com |
2bd7e1c2e5987d0d522837cd6307d5b730e86ae5 | bf8b21804fbab3bb6630221d9a30ba6ad762ab05 | /MyBlog/src/main/java/com/mb/entity/About.java | 7483e61d1fcae00f14985823088f62ed57318f0f | [] | no_license | mrwang33/MyBlog | 3cf6ee0cdb3f2e637209759b77f94dce2176f778 | 57e70812fca826676028fd397a8e3b7d0b20a9c6 | refs/heads/master | 2021-01-19T21:11:49.015643 | 2018-03-21T09:09:44 | 2018-03-21T09:09:44 | 88,619,889 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,144 | java | package com.mb.entity;
/**
* @author 王欢
* 关于本站
*/
public class About {
//主键
private Integer id;
//简述
private String summary;
//所使用的技术
private String skill;
//人生信条
private String creed;
public About() {
}
public About(Integer id, String summary, String skill, String creed) {
super();
this.id = id;
this.summary = summary;
this.skill = skill;
this.creed = creed;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary == null ? null : summary.trim();
}
public String getSkill() {
return skill;
}
public void setSkill(String skill) {
this.skill = skill == null ? null : skill.trim();
}
public String getCreed() {
return creed;
}
public void setCreed(String creed) {
this.creed = creed == null ? null : creed.trim();
}
} | [
"wang1386528@gmail.com"
] | wang1386528@gmail.com |
13865a9b198c6c6a6c39551ddf5d88fdec2efe7b | d63abc848032588b4949675b24cabeaddcec8efc | /src/Atividades/Agenda.java | aa17698f38c4a4925821bcb11320b44efc0dbf31 | [] | no_license | vinny-vin/AtividadesJava | 829c6235d3a41df7d88d1e315c1da4127daa18d3 | 8478d9722dc1c100a203d644238e67fb100ceef8 | refs/heads/master | 2020-08-02T09:39:15.802285 | 2019-10-22T13:23:20 | 2019-10-22T13:23:20 | 211,305,792 | 1 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,241 | java | // agenda
package Atividades;
import java.util.Scanner;
import Atividades.Contato;
public class Agenda {
static String[] contatos = new String[100];
static Scanner ler = new Scanner (System.in);
static int i = 0;
static String nome;
static String email;
static Agenda teste1 = new Agenda();
static int resp;
static String busc;
public static void main(String[] args) {
teste1.adicionar();
teste1.listar();
}
public void adicionar() {
do {
System.out.println("Digite o nome:");
nome = ler.next();
System.out.println("Digite o email:");
email = ler.next();
Contato teste = new Contato(nome, email);
System.out.println(teste.conjunto);
teste.introduzDados();
contatos[i] = teste.conjunto;
i++;
System.out.println("Deseja continuar adicionando contatos? \n Digite 1 para sim \n Digite 0 para não");
resp = ler.nextInt();
}while(resp == 1);
}
public void listar() {
for(int i = 0; i < contatos.length ; i++) {
if(contatos[i] != null) {
System.out.println("LIsta por ordem de criação: \n Contato" + (i + 1) +":" + contatos[i]);
}
}
}
public void buscar() {
System.out.println("digite o nome do contato que deseja buscar");
busc = ler.next();
}
} | [
"viniciusdbenicio4@gmail.com"
] | viniciusdbenicio4@gmail.com |
457557b26578b2cd95dda08ea9b33f16e923028e | bf4422fd7f2a7f921bf35462d0359b184d39c3e8 | /app/build/generated/source/apt/debug/com/clabuyakchai/user/ui/fragment/navigation/ticket/TicketPresenter$$ViewStateProvider.java | 630411e1111931e45e68782c19247671af6faac6 | [] | no_license | Clabuyakchai/staff-taxi | 9b7a5b76b54551428bde265fc209d5bf95ad710c | d877a817f92a4e7a298f44a2a03526e55364f559 | refs/heads/master | 2020-05-19T16:27:40.075233 | 2019-05-25T15:34:31 | 2019-05-25T15:34:31 | 185,083,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package com.clabuyakchai.user.ui.fragment.navigation.ticket;
import com.arellomobile.mvp.MvpView;
import com.arellomobile.mvp.ViewStateProvider;
import com.arellomobile.mvp.viewstate.MvpViewState;
import java.lang.Override;
public class TicketPresenter$$ViewStateProvider extends ViewStateProvider {
@Override
public MvpViewState<? extends MvpView> getViewState() {
return new TicketView$$State();
}
}
| [
"clabuyakchai@gmail.com"
] | clabuyakchai@gmail.com |
c57ae29c04e169789a6fa54e9601ba465ca2f285 | 18aab46e8ad25d120d779a7b7426dff650982c26 | /java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/OverloadResolutionTest.java | 1b27e3539a9a8d57b388fcc48856efe34d0aec8e | [] | no_license | j717273419/intellij-community | 28f975d8065677b7f9fe9763259dd8c0e95153fb | 1807ab51a541a695674485d089db1d2c9bd31f2d | refs/heads/master | 2021-01-22T10:02:06.985926 | 2014-12-24T11:52:45 | 2014-12-24T11:52:45 | 28,450,384 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,426 | java | /*
* Copyright 2000-2014 JetBrains s.r.o.
*
* 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.intellij.codeInsight.daemon.lambda;
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
import com.intellij.openapi.projectRoots.JavaSdkVersion;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.testFramework.IdeaTestUtil;
import org.jetbrains.annotations.NonNls;
public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution";
@Override
protected void setUp() throws Exception {
super.setUp();
enableInspectionTool(new UnusedDeclarationInspection());
}
public void testPertinentToApplicabilityOfExplicitlyTypedLambda() throws Exception {
doTest();
}
public void testVoidValueCompatibilityOfImplicitlyTypedLambda() throws Exception {
doTest();
}
public void testVoidValueCompatibilityCachedControlFlow() throws Exception {
doTest();
}
public void testVoidValueCompatibilityCanCompleteNormallyWithCallWithExceptionAsLastStatement() throws Exception {
doTest();
}
public void testIDEA102800() throws Exception {
doTest();
}
public void testReturnStatementsInsideNestedLambdasDuringVoidValueCompatibilityChecks() throws Exception {
doTest();
}
public void testIgnoreNonFunctionalArgumentsWhenCheckIfFunctionalMoreSpecific() throws Exception {
doTest();
}
private void doTest() {
doTest(true);
}
private void doTest(boolean warnings) {
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
}
@Override
protected Sdk getProjectJDK() {
return IdeaTestUtil.getMockJdk18();
}
}
| [
"anna.kozlova@jetbrains.com"
] | anna.kozlova@jetbrains.com |
d2430fa8089899c911e87ee9613049a457c4ba89 | fea4d9dffcb7e109420cc41ba1ff98b7310cdc2f | /src/top/zhouhaoran/leetcode/MinOperations3.java | 1340cad805145cd83d19f1ca9fd44c589d72ea0e | [] | no_license | Haoran-001/Leetcode | 21ae1950bed85a16bc9ad4bacd4c2251e4afd381 | 223889df602d794385e805ff07143cfcc2ca0185 | refs/heads/master | 2023-05-06T08:42:18.783628 | 2021-05-27T13:34:29 | 2021-05-27T13:34:29 | 333,754,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 984 | java | package top.zhouhaoran.leetcode;
public class MinOperations3 {
public static void main(String[] args) {
MinOperations3 minOperations = new MinOperations3();
int[] nums = {1, 5, 2, 4, 1};
System.out.println(minOperations.minOperations2(nums));
}
public int minOperations(int[] nums) {
int max = nums[0];
int ans = 0;
for (int i = 1; i < nums.length; i++) {
if (max >= nums[i]) {
max++;
} else {
max = nums[i];
}
ans += (max - nums[i]);
}
return ans;
}
public int minOperations2(int[] nums) {
int temp = nums[0];
int ans = 0;
for (int i = 1; i < nums.length; i++) {
if (temp < nums[i]) {
temp = nums[i];
} else if (temp >= nums[i]) {
temp++;
ans += (temp - nums[i]);
}
}
return ans;
}
}
| [
"mafengwoxiaozi@gmail.com"
] | mafengwoxiaozi@gmail.com |
716ec49ddb284b1fa4db42ab0f0d318baec5659a | f02b62215fd26b9cb5626f343e73cf99216abf63 | /app/src/main/java/io/github/djunicode/djcomps/Database/DataDao/StarDao.java | 31188939c005bfeac5cbc509f5f59984ccc1f025 | [
"MIT"
] | permissive | djunicode/DJ-Comps-Android-App | cbc498ba2652f692deced6f2778434e6dc711809 | d91c99bc3929e97c4e7285269d5c526b7fb0398d | refs/heads/master | 2021-09-08T18:05:45.135462 | 2018-02-17T12:23:51 | 2018-02-17T12:23:51 | 115,252,639 | 0 | 7 | MIT | 2018-03-10T16:29:18 | 2017-12-24T09:24:39 | Java | UTF-8 | Java | false | false | 1,180 | java | package io.github.djunicode.djcomps.Database.DataDao;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import io.github.djunicode.djcomps.Database.Data.File;
import io.github.djunicode.djcomps.Database.Data.Star;
@SuppressWarnings("unused")
@Dao
public interface StarDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
void addStar(Star star);
@Delete
void deleteStar(Star star);
@Query("delete from stars where star_id = :star_id")
void deleteStar(Long star_id);
@Query("delete from stars where file_id = :file_id")
void deleteStarForFile(Long file_id);
@Query("select count(*) from stars where file_id = :file_id")
boolean isFileStarred(Long file_id);
@Query("select * from files, stars where files.file_id = stars.file_id and star_id = :star_id")
File getFileFromStar(Long star_id);
@Query("select * from stars, files where files.file_id = stars.file_id and stars.file_id = :file_id")
Star getStarFromFile(Long file_id);
}
| [
"dcunha.cyprien@gmail.com"
] | dcunha.cyprien@gmail.com |
01beb98e26032b4ecb08d0dfc1063430dd23ada0 | 482db253420be18327facb72d0f5a95b0a175e9c | /src/main/java/com/shop/cosm/repos/ImageRepo.java | 7fce3809f6346a97ab05a69af0bbf33a3cba354d | [] | no_license | ladyJane1999/WebSite | eefeff853833975368a68893a6ff259bdf69aa8a | 125f54043dc3ba6afaf18c02e119c51e64183941 | refs/heads/main | 2023-06-06T16:54:05.115608 | 2021-06-23T20:14:31 | 2021-06-23T20:14:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | java | package com.shop.cosm.repos;
import com.shop.cosm.domain.Image;
import org.apache.catalina.User;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
public interface ImageRepo extends CrudRepository<Image, Long> {
List<Image> findByFilename(String filename);
}
| [
"noreply@github.com"
] | noreply@github.com |
26d32691b134577e628bdada67b2b1fa56657bd7 | 85f6958d26d8062a4e6a2a171ddd503d3b2671f3 | /ActiveMQ_Configuration/AMQ/apache-activemq-5.15.0/data/tmp/jetty-0.0.0.0-8161-admin-_admin-any-6258306592167351219.dir/jsp/org/apache/jsp/tag/web/form/forEachMapEntry_tag.java | 9df528f6a366fe87fb3b49dfe364f15adf0373fd | [] | no_license | sivachandram/EPOS | da650bfa95641f0f74626f51508e2c0b6b18bb58 | ba54cf5e2de4ddb23ef5a6d25782117cbf47a5bc | refs/heads/master | 2022-11-09T21:26:52.468370 | 2020-06-28T21:34:35 | 2020-06-28T21:34:35 | 273,705,941 | 0 | 0 | null | 2020-06-28T21:36:51 | 2020-06-20T12:42:26 | Java | UTF-8 | Java | false | false | 5,703 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: jetty/9.2.22.v20170606
* Generated at: 2018-08-06 16:10:39 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.tag.web.form;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.Iterator;
public final class forEachMapEntry_tag
extends javax.servlet.jsp.tagext.SimpleTagSupport
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = new java.util.HashSet<>();
_jspx_imports_classes.add("java.util.Iterator");
}
private javax.servlet.jsp.JspContext jspContext;
private java.io.Writer _jspx_sout;
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public void setJspContext(javax.servlet.jsp.JspContext ctx) {
super.setJspContext(ctx);
java.util.ArrayList _jspx_nested = null;
java.util.ArrayList _jspx_at_begin = null;
java.util.ArrayList _jspx_at_end = null;
this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(this, ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);
}
public javax.servlet.jsp.JspContext getJspContext() {
return this.jspContext;
}
private java.lang.String var;
private java.util.Map items;
public java.lang.String getVar() {
return this.var;
}
public void setVar(java.lang.String var) {
this.var = var;
jspContext.setAttribute("var", var);
}
public java.util.Map getItems() {
return this.items;
}
public void setItems(java.util.Map items) {
this.items = items;
jspContext.setAttribute("items", items);
}
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
return _jsp_instancemanager;
}
private void _jspInit(javax.servlet.ServletConfig config) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(config.getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(config);
}
public void _jspDestroy() {
}
public void doTag() throws javax.servlet.jsp.JspException, java.io.IOException {
javax.servlet.jsp.PageContext _jspx_page_context = (javax.servlet.jsp.PageContext)jspContext;
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest) _jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse) _jspx_page_context.getResponse();
javax.servlet.http.HttpSession session = _jspx_page_context.getSession();
javax.servlet.ServletContext application = _jspx_page_context.getServletContext();
javax.servlet.ServletConfig config = _jspx_page_context.getServletConfig();
javax.servlet.jsp.JspWriter out = jspContext.getOut();
_jspInit(config);
jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,jspContext);
if( getVar() != null )
_jspx_page_context.setAttribute("var", getVar());
if( getItems() != null )
_jspx_page_context.setAttribute("items", getItems());
try {
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
Iterator iter = items.entrySet().iterator();
while (iter.hasNext()) {
request.setAttribute(var, iter.next());
out.write('\n');
((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();
_jspx_sout = null;
if (getJspBody() != null)
getJspBody().invoke(_jspx_sout);
jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,getJspContext());
out.write('\n');
}
out.write(" \n");
out.write(" \n");
} catch( java.lang.Throwable t ) {
if( t instanceof javax.servlet.jsp.SkipPageException )
throw (javax.servlet.jsp.SkipPageException) t;
if( t instanceof java.io.IOException )
throw (java.io.IOException) t;
if( t instanceof java.lang.IllegalStateException )
throw (java.lang.IllegalStateException) t;
if( t instanceof javax.servlet.jsp.JspException )
throw (javax.servlet.jsp.JspException) t;
throw new javax.servlet.jsp.JspException(t);
} finally {
jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,super.getJspContext());
((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();
}
}
}
| [
"sivachandra.mandalpu1@bp.com"
] | sivachandra.mandalpu1@bp.com |
7eccb0af399d7626e88439470f80923c40ca98ef | fec4a09f54f4a1e60e565ff833523efc4cc6765a | /Dependencies/work/decompile-00fabbe5/net/minecraft/world/level/levelgen/feature/WorldGenFeatureBamboo.java | 5afddaf5a4084b30581f0a6f52cd2aa91da46e89 | [] | no_license | DefiantBurger/SkyblockItems | 012d2082ae3ea43b104ac4f5bf9eeb509889ec47 | b849b99bd4dc52ae2f7144ddee9cbe2fd1e6bf03 | refs/heads/master | 2023-06-23T17:08:45.610270 | 2021-07-27T03:27:28 | 2021-07-27T03:27:28 | 389,780,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,569 | java | package net.minecraft.world.level.levelgen.feature;
import com.mojang.serialization.Codec;
import java.util.Random;
import net.minecraft.core.BlockPosition;
import net.minecraft.core.EnumDirection;
import net.minecraft.world.level.GeneratorAccessSeed;
import net.minecraft.world.level.block.BlockBamboo;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.level.block.state.properties.BlockPropertyBambooSize;
import net.minecraft.world.level.levelgen.HeightMap;
import net.minecraft.world.level.levelgen.feature.configurations.WorldGenFeatureConfigurationChance;
public class WorldGenFeatureBamboo extends WorldGenerator<WorldGenFeatureConfigurationChance> {
private static final IBlockData BAMBOO_TRUNK = (IBlockData) ((IBlockData) ((IBlockData) Blocks.BAMBOO.getBlockData().set(BlockBamboo.AGE, 1)).set(BlockBamboo.LEAVES, BlockPropertyBambooSize.NONE)).set(BlockBamboo.STAGE, 0);
private static final IBlockData BAMBOO_FINAL_LARGE = (IBlockData) ((IBlockData) WorldGenFeatureBamboo.BAMBOO_TRUNK.set(BlockBamboo.LEAVES, BlockPropertyBambooSize.LARGE)).set(BlockBamboo.STAGE, 1);
private static final IBlockData BAMBOO_TOP_LARGE = (IBlockData) WorldGenFeatureBamboo.BAMBOO_TRUNK.set(BlockBamboo.LEAVES, BlockPropertyBambooSize.LARGE);
private static final IBlockData BAMBOO_TOP_SMALL = (IBlockData) WorldGenFeatureBamboo.BAMBOO_TRUNK.set(BlockBamboo.LEAVES, BlockPropertyBambooSize.SMALL);
public WorldGenFeatureBamboo(Codec<WorldGenFeatureConfigurationChance> codec) {
super(codec);
}
@Override
public boolean generate(FeaturePlaceContext<WorldGenFeatureConfigurationChance> featureplacecontext) {
int i = 0;
BlockPosition blockposition = featureplacecontext.d();
GeneratorAccessSeed generatoraccessseed = featureplacecontext.a();
Random random = featureplacecontext.c();
WorldGenFeatureConfigurationChance worldgenfeatureconfigurationchance = (WorldGenFeatureConfigurationChance) featureplacecontext.e();
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i();
BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition.i();
if (generatoraccessseed.isEmpty(blockposition_mutableblockposition)) {
if (Blocks.BAMBOO.getBlockData().canPlace(generatoraccessseed, blockposition_mutableblockposition)) {
int j = random.nextInt(12) + 5;
int k;
if (random.nextFloat() < worldgenfeatureconfigurationchance.probability) {
k = random.nextInt(4) + 1;
for (int l = blockposition.getX() - k; l <= blockposition.getX() + k; ++l) {
for (int i1 = blockposition.getZ() - k; i1 <= blockposition.getZ() + k; ++i1) {
int j1 = l - blockposition.getX();
int k1 = i1 - blockposition.getZ();
if (j1 * j1 + k1 * k1 <= k * k) {
blockposition_mutableblockposition1.d(l, generatoraccessseed.a(HeightMap.Type.WORLD_SURFACE, l, i1) - 1, i1);
if (b(generatoraccessseed.getType(blockposition_mutableblockposition1))) {
generatoraccessseed.setTypeAndData(blockposition_mutableblockposition1, Blocks.PODZOL.getBlockData(), 2);
}
}
}
}
}
for (k = 0; k < j && generatoraccessseed.isEmpty(blockposition_mutableblockposition); ++k) {
generatoraccessseed.setTypeAndData(blockposition_mutableblockposition, WorldGenFeatureBamboo.BAMBOO_TRUNK, 2);
blockposition_mutableblockposition.c(EnumDirection.UP, 1);
}
if (blockposition_mutableblockposition.getY() - blockposition.getY() >= 3) {
generatoraccessseed.setTypeAndData(blockposition_mutableblockposition, WorldGenFeatureBamboo.BAMBOO_FINAL_LARGE, 2);
generatoraccessseed.setTypeAndData(blockposition_mutableblockposition.c(EnumDirection.DOWN, 1), WorldGenFeatureBamboo.BAMBOO_TOP_LARGE, 2);
generatoraccessseed.setTypeAndData(blockposition_mutableblockposition.c(EnumDirection.DOWN, 1), WorldGenFeatureBamboo.BAMBOO_TOP_SMALL, 2);
}
}
++i;
}
return i > 0;
}
}
| [
"joseph.cicalese@gmail.com"
] | joseph.cicalese@gmail.com |
d5dc067cf5450b6fec0503bb428a7eb0876495f6 | 8fdde539d2d0eb0267e888440cdc156d0083806c | /docroot/WEB-INF/src/com/Controller/SignupController.java | 4e10a81a4af91313abfb3caa04f8ec3953023627 | [] | no_license | ganjuss/almatest | df3973bfec9600568e5994c6a4f863b89e419d04 | db05813dbd9507348de80365475b660463b7b60c | refs/heads/master | 2021-01-01T05:07:12.260328 | 2016-05-01T11:26:34 | 2016-05-01T11:26:34 | 57,099,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package com.Controller;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.portlet.ModelAndView;
import org.springframework.web.portlet.bind.annotation.RenderMapping;
public class SignupController {
@Controller("signupController")
@RequestMapping("VIEW")
public class LoginController {
@RenderMapping
public ModelAndView userRegistration(RenderRequest renderRequest,RenderResponse renderResponse){
return null;
}
}}
| [
"muninarayana.ganji@gmail.com"
] | muninarayana.ganji@gmail.com |
647dec55440460ba6da71ef5334e42d8b0b0dc67 | 3e2d6953d7bbc00c68f361e2d2b6bdc290e0ec10 | /kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/kubeaggregator/pkg/apis/apiregistration/v1/APIServiceCondition.java | 54012b135eb3862a97169e84b8de4b51dd551e07 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | rjcastillejo-chile/yakc | 285f165231980a92413a47d9dd5141d039e5150e | 525724c84986161a87d47b586145697ace218d86 | refs/heads/master | 2023-01-07T12:38:16.808615 | 2020-11-10T17:39:30 | 2020-11-10T17:39:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,871 | java | /*
* Copyright 2020 Marc Nuri
*
* 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.marcnuri.yakc.model.io.k8s.kubeaggregator.pkg.apis.apiregistration.v1;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;
/**
* APIServiceCondition describes the state of an APIService at a particular point
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class APIServiceCondition implements Model {
@JsonProperty("lastTransitionTime")
private OffsetDateTime lastTransitionTime;
/**
* Human-readable message indicating details about last transition.
*/
@JsonProperty("message")
private String message;
/**
* Unique, one-word, CamelCase reason for the condition's last transition.
*/
@JsonProperty("reason")
private String reason;
/**
* Status is the status of the condition. Can be True, False, Unknown.
*/
@NonNull
@JsonProperty("status")
private String status;
/**
* Type is the type of the condition.
*/
@NonNull
@JsonProperty("type")
private String type;
}
| [
"marc@marcnuri.com"
] | marc@marcnuri.com |
65e1e7d36c5bcd58dad862c7fc84d2c9105897e8 | 6f356af61b6a00bbd3064882ad16f77b814edecc | /product-app/src/main/java/cn/stylefeng/guns/cloud/product/mapper/GunsCouponsMapper.java | 9215a87f9fdbf5b20f66ccec821356de7336aa12 | [] | no_license | xwb666666/sp_server | 7ebc34b0ea991aca0786520207fedfa69ac17de2 | a8ed11913586cafa80778d0e9900b55bfc540e2b | refs/heads/master | 2023-06-25T07:41:48.280132 | 2021-05-31T01:36:03 | 2021-05-31T01:37:30 | 387,706,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,087 | java | package cn.stylefeng.guns.cloud.product.mapper;
import cn.stylefeng.guns.cloud.product.model.api.GunsCoupons;
import cn.stylefeng.guns.cloud.product.model.api.result.CouponsResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface GunsCouponsMapper extends BaseMapper<GunsCoupons> {
//List<CouponsResult> notUse(Page<CouponsResult> page, Long memberId);
@Select("select a.id, a.name, a.type, a.pic, b.amount, a.discount, a.total_count totalCount, a.pick_count pickCount, a.max_pick_count maxPickCount, a.valid_amount validAmount, " +
"a.is_can_pick isCanPick, a.expire_type expireType, a.fixed_date fixedDate, a.expire_days expireDays, a.product_type productType, a.memo, a.create_time createTime, a.status, " +
"b.code, b.pick_type pickType, b.pick_time pickTime, b.start_time startTime, b.expire_time expireTime, b.use_time useTime, b.status recordStatus" +
" from guns_coupons a, guns_coupons_record b where a.id = b.coupon_id and b.member_id = #{member} and b.`status` < 2 and NOW() < b.expire_time")
List<CouponsResult> notUseListByMember(@Param("member") Long member);
@Select("select a.id, a.name, a.type, a.pic, b.amount, a.discount, a.total_count totalCount, a.pick_count pickCount, a.max_pick_count maxPickCount, a.valid_amount validAmount, " +
"a.is_can_pick isCanPick, a.expire_type expireType, a.fixed_date fixedDate, a.expire_days expireDays, a.product_type productType, a.memo, a.create_time createTime, a.status, " +
"b.code, b.pick_type pickType, b.pick_time pickTime, b.start_time startTime, b.expire_time expireTime, b.use_time useTime, b.status recordStatus" +
" from guns_coupons a, guns_coupons_record b where a.id = b.coupon_id and b.member_id = #{member} and b.`status` = 2 and NOW() < b.expire_time")
List<CouponsResult> useListByMember(@Param("member") Long member);
@Select("select a.id, a.name, a.type, a.pic, b.amount, a.discount, a.total_count totalCount, a.pick_count pickCount, a.max_pick_count maxPickCount, a.valid_amount validAmount, " +
"a.is_can_pick isCanPick, a.expire_type expireType, a.fixed_date fixedDate, a.expire_days expireDays, a.product_type productType, a.memo, a.create_time createTime, a.status, " +
"b.code, b.pick_type pickType, b.pick_time pickTime, b.start_time startTime, b.expire_time expireTime, b.use_time useTime, b.status recordStatus" +
" from guns_coupons a, guns_coupons_record b where a.id = b.coupon_id and b.member_id = #{member} and NOW() > b.expire_time ")
List<CouponsResult> expireListByMember(@Param("member") Long member);
/**-----------------------------领劵中心----------------------------------*/
@Select("select m.number, m.id, m.name, m.type, m.pic, m.amount, m.discount, m.total_count totalCount, m.pick_count pickCount, m.max_pick_count maxPickCount, " +
"m.valid_amount validAmount, m.is_can_pick isCanPick, m.expire_type expireType, m.fixed_date fixedDate, m.expire_days expireDays, m.product_type productType, " +
"m.memo, m.create_time createTime, m.status " +
"from (SELECT IFNULL( b.count , 0 ) AS number, a.id, a.name, a.type, a.pic, a.amount, a.discount, a.total_count, a.pick_count, a.max_pick_count, " +
"a.valid_amount, a.is_can_pick, a.expire_type, a.fixed_date, a.expire_days, a.product_type, a.memo, a.create_time, a.status " +
"FROM guns_coupons a " +
"LEFT JOIN (select count(e.coupon_id) count, e.coupon_id FROM guns_coupons d, guns_coupons_record e WHERE d.id = e.coupon_id and e.member_id = #{member} GROUP BY e.coupon_id ) b ON a.id = b.coupon_id " +
"WHERE a.`status` = 1 and a.total_count > 0 and a.is_can_pick = 1 ) m " +
"where m.max_pick_count > m.number and m.fixed_date > NOW()")
List<CouponsResult> centerList(@Param("member") Long member);
}
| [
"15316314665@163.com"
] | 15316314665@163.com |
2ec75f97c1fa53ef4aca101d0b3abf04be2c27fb | 10bbb2f87e16b4c8c58d12146acab0c7381860bf | /chatbob/Chatbob/src/groupFiles/JiayanFood.java | 038e98749bf1fca870fe9780fc0f62faad0058e2 | [] | no_license | ariqzaman/classwork | cd4abb7b28fb8c07f10f87c90d98ef79e1363a67 | 3a7fec8cf7e493e01b3d10d184abb6190b40d53d | refs/heads/master | 2020-04-09T07:30:24.124800 | 2017-01-06T18:18:10 | 2017-01-06T18:18:10 | 68,128,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,350 | java | package groupFiles;
public class JiayanFood implements Topic {
private boolean inRestaurantLoop;
private boolean inOtherLoop;
private String foodResponse;
private static String [] foods = {"pizza","ice cream","Japanese Food","Korean Food","Halal","Pasta",};
private static String [] restaurants = {"Di Fara Pizza","Ample Hills Creamery","Kyo Ya","Shilla","The Halal Guys Food Cart","Osteria Morini",};
private void whichLoop()
{
int ranLoop = (int)(Math.random()*20+1);
if(ranLoop > 10)
{
inRestaurantLoop = true;
}
else
{
inOtherLoop = true;
}
}
public void talk() {
whichLoop();
SharonChatBox.print("What is your favorite food?");
while(inRestaurantLoop)
{
foodResponse = SharonChatBox.getInput();
suggestRestaurant();
if(!isTriggered(foodResponse))
{
inRestaurantLoop = false;
SharonChatBox.talkForever();
}
}
while(inOtherLoop)
{
foodResponse = SharonChatBox.getInput();
talkFoods();
if(!isTriggered(foodResponse))
{
inOtherLoop = false;
SharonChatBox.talkForever();
}
}
}
private void suggestRestaurant()
{
for(int foodIndex = 0; foodIndex < 6; foodIndex++)
{
if(SharonChatBox.findKeyword(foodResponse, foods[foodIndex], 0)>= 0
&& SharonChatBox.findKeyword(foodResponse, "like", 0)>= 0)
{
SharonChatBox.print("Since you like " + foods[foodIndex] + ". I suggest you go to "+ restaurants[foodIndex]);
}
}
}
public void talkFoods()
{
String [] responseArr = {"like","want","","love","hate"};
String [] qArr = {"Why do you","What makes you","How did you come to"};
int ran = (int)(Math.random()*2+1);
for(int i =0; i<responseArr.length;i++)
{
int prefPsn = SharonChatBox.findKeyword(foodResponse, responseArr[i], 0);
if (prefPsn>=0){
String word = responseArr[i];
String foodPref=foodResponse.substring(prefPsn+5);
SharonChatBox.print(qArr[ran] + " " + word + " "+foodPref+"?");
}
}
}
public boolean isTriggered(String userInput) {
if(SharonChatBox.findKeyword(userInput, "food", 0)>= 0)
{
return true;
}
if(SharonChatBox.findKeyword(userInput, "eat", 0)>= 0)
{
return true;
}
if(SharonChatBox.findKeyword(userInput, "restaurant", 0)>= 0)
{
return true;
}
return false;
}
}
| [
"Student6@10.8.33.148"
] | Student6@10.8.33.148 |
4a283c6b093d19925cc518756a1a47dcc9485114 | b997ef6918f777535d52345537b8f2f5dfa592ed | /src/main/java/algorithm_practice/LeetCode/code000/M040_组合总和2.java | dc18d8c67913acf3730566327e3d47045aed95c3 | [] | no_license | lemonlmlian/algorithms | 6345661f184a051fcc8ff5b436f6314c326969c8 | 234165b4c76d3110cdb7c9d4a35f9e7c0d3a63c0 | refs/heads/master | 2023-07-19T23:49:36.637451 | 2021-08-31T22:16:43 | 2021-08-31T22:17:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,863 | java | package algorithm_practice.LeetCode.code000;
import com.google.common.collect.Lists;
import org.junit.Assert;
import org.junit.Test;
import java.util.*;
import java.util.stream.Collectors;
/*
给定一个数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。
candidates 中的每个数字在每个组合中只能使用一次。
说明:
所有数字(包括目标数)都是正整数。
解集不能包含重复的组合。
示例 1:
输入: candidates = [10,1,2,7,6,1,5], target = 8,
所求解集为:
[
[1, 7],
[1, 2, 5],
[2, 6],
[1, 1, 6]
]
示例 2:
输入: candidates = [2,5,2,1,2], target = 5,
所求解集为:
[
[1,2,2],
[5]
]
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/combination-sum-ii
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class M040_组合总和2 {
@Test
public void testCase() {
int[] candidates = new int[]{10,1,2,7,6,1,5};
int target = 8;
List<List<Integer>> excepted = Lists.newArrayList(
Lists.newArrayList(1, 2, 5),
Lists.newArrayList(1,7),
Lists.newArrayList(2, 6),
Lists.newArrayList(1, 1, 6));
Assert.assertEquals(excepted, combinationSum2(candidates, target));
candidates = new int[]{2,5,2,1,2};
target = 5;
excepted = Lists.newArrayList(
Lists.newArrayList(1,2,2),
Lists.newArrayList(5));
Assert.assertEquals(excepted, combinationSum2(candidates, target));
}
public List<List<Integer>> combinationSum2(int[] candidates, int target) {
List<List<Integer>> res = new ArrayList<>();
Deque<Integer> path = new LinkedList<>();
// 先排序,为了方便后面好判断是否真正只用了1次 candidates 里面的数字
Arrays.sort(candidates);
dfs(res, path, 0, candidates.length, candidates, target);
return res;
}
private void dfs(List<List<Integer>> res, Deque<Integer> path, int begin, int end, int[] candidates, int target) {
if (target < 0) {
return;
}
if (target == 0) {
res.add(new ArrayList<>(path));
}
for (int i = begin; i < end; i++) {
// candidates[i] 不是begin位置的第一个数字
// 且 上一个candidates[i-1] 如果与当前的 candidates[i]相等,说明与同一层的选择重复,需剪枝。
if (i>begin && candidates[i-1] == candidates[i]) {
continue;
}
path.addLast(candidates[i]);
dfs(res, path, i+1, end, candidates, target-candidates[i]);
path.removeLast();
}
}
/**
* 耗时有点高。。
* 每次都有重新遍历 res,重新排序。判断是否contains
*/
private void dfs_V1(List<List<Integer>> res, Deque<Integer> path, int begin, int end, int[] candidates, int target) {
if (target < 0) {
return;
}
if (target == 0 && !contains(res, path)) {
res.add(new ArrayList<>(path));
}
for (int i = begin; i < end; i++) {
path.addLast(candidates[i]);
dfs_V1(res, path, i+1, end, candidates, target - candidates[i]);
path.removeLast();
}
}
private boolean contains(List<List<Integer>> res, Deque<Integer> path) {
List<List<Integer>> sortedRes = new ArrayList<>();
for (List<Integer> oldPath : res) {
sortedRes.add(oldPath.stream().sorted().collect(Collectors.toList()));
}
// res = sortedRes;
return sortedRes.contains(path.stream().sorted().collect(Collectors.toList()));
}
}
| [
"tb178271@alibaba-inc.com"
] | tb178271@alibaba-inc.com |
0a9f1dede3b7508195f9ae146f14179eec757565 | fc6c869ee0228497e41bf357e2803713cdaed63e | /weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/webview/modeltools/c.java | 70ce754bbed2935fecdb8d01efd6bd5afe3c6ef6 | [] | no_license | hyb1234hi/reverse-wechat | cbd26658a667b0c498d2a26a403f93dbeb270b72 | 75d3fd35a2c8a0469dbb057cd16bca3b26c7e736 | refs/heads/master | 2020-09-26T10:12:47.484174 | 2017-11-16T06:54:20 | 2017-11-16T06:54:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,601 | java | package com.tencent.mm.plugin.webview.modeltools;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.ValueCallback;
import com.tencent.gmtrace.GMTrace;
import com.tencent.mm.R.l;
import com.tencent.mm.compatible.util.f;
import com.tencent.mm.plugin.webview.model.ai;
import com.tencent.mm.plugin.webview.ui.tools.e;
import com.tencent.mm.pluginsdk.ui.tools.s;
import com.tencent.mm.protocal.JsapiPermissionWrapper;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bg;
import com.tencent.mm.sdk.platformtools.w;
import com.tencent.mm.ui.MMActivity;
import java.io.File;
public final class c
{
private String rGv;
private String rGw;
private ValueCallback<Uri> rGx;
private ValueCallback<Uri[]> rGy;
public c()
{
GMTrace.i(11979871748096L, 89257);
this.rGv = null;
this.rGw = null;
this.rGx = null;
this.rGy = null;
GMTrace.o(11979871748096L, 89257);
}
private void bCP()
{
GMTrace.i(11980140183552L, 89259);
this.rGv = null;
this.rGx = null;
this.rGy = null;
this.rGw = null;
GMTrace.o(11980140183552L, 89259);
}
private void h(Uri paramUri)
{
GMTrace.i(11980274401280L, 89260);
if (this.rGx != null)
{
this.rGx.onReceiveValue(paramUri);
GMTrace.o(11980274401280L, 89260);
return;
}
if (this.rGy != null)
{
if (paramUri == null)
{
this.rGy.onReceiveValue(null);
GMTrace.o(11980274401280L, 89260);
return;
}
this.rGy.onReceiveValue(new Uri[] { paramUri });
}
GMTrace.o(11980274401280L, 89260);
}
public final void a(Activity paramActivity, e parame, ValueCallback<Uri> paramValueCallback, ValueCallback<Uri[]> paramValueCallback1, String paramString1, String paramString2)
{
GMTrace.i(19382650535936L, 144412);
w.i("MicroMsg.WebViewUI.FileChooser", "openFileChooser with wvPerm(%s), callback(%s), callbackLL(%s), acceptType(%s), capture(%s)", new Object[] { parame, paramValueCallback, paramValueCallback1, paramString1, paramString2 });
bCP();
if ((parame == null) || (parame.bDM() == null))
{
w.e("MicroMsg.WebViewUI.FileChooser", "openFileChooser fail, wvPerm is null");
h(null);
GMTrace.o(19382650535936L, 144412);
return;
}
if (!parame.bDM().eS(56))
{
w.e("MicroMsg.WebViewUI.FileChooser", "open file chooser failed, permission fail");
h(null);
GMTrace.o(19382650535936L, 144412);
return;
}
this.rGx = paramValueCallback;
this.rGy = paramValueCallback1;
this.rGw = System.currentTimeMillis();
this.rGv = paramString1;
paramValueCallback = this.rGw;
paramValueCallback1 = new Intent("android.intent.action.GET_CONTENT");
paramValueCallback1.addCategory("android.intent.category.OPENABLE");
int i;
if (bg.nm(paramString1))
{
paramValueCallback1.setType("*/*");
parame = null;
if (bg.nm(paramString2)) {
break label448;
}
if (!"camera".equalsIgnoreCase(paramString2)) {
break label308;
}
parame = new Intent[] { ai.Lm(paramValueCallback) };
i = 0;
}
for (;;)
{
label223:
if ((i != 0) || (parame == null) || (parame.length == 0))
{
paramValueCallback = new Intent("android.intent.action.CHOOSER");
paramValueCallback.putExtra("android.intent.extra.INITIAL_INTENTS", parame);
paramValueCallback.putExtra("android.intent.extra.TITLE", ab.getContext().getString(R.l.elI));
paramValueCallback.putExtra("android.intent.extra.INTENT", paramValueCallback1);
}
for (parame = paramValueCallback;; parame = parame[0])
{
paramActivity.startActivityForResult(parame, 1);
GMTrace.o(19382650535936L, 144412);
return;
paramValueCallback1.setType(paramString1);
break;
label308:
if ("camcorder".equalsIgnoreCase(paramString2))
{
parame = new Intent[] { ai.bCq() };
i = 0;
break label223;
}
if ("microphone".equalsIgnoreCase(paramString2))
{
parame = new Intent[] { ai.bCr() };
i = 0;
break label223;
}
if (!"*".equalsIgnoreCase(paramString2)) {
break label488;
}
if (paramString1.equalsIgnoreCase("image/*"))
{
parame = new Intent[1];
parame[0] = ai.Lm(paramValueCallback);
}
for (;;)
{
i = 1;
break;
if (paramString1.equalsIgnoreCase("audio/*"))
{
parame = new Intent[1];
parame[0] = ai.bCr();
}
else if (paramString1.equalsIgnoreCase("video/*"))
{
parame = new Intent[1];
parame[0] = ai.bCq();
}
}
label448:
if (!f.eu(16)) {
break label488;
}
w.i("MicroMsg.WebviewJSSDKUtil", "android API version is below 16.");
parame = new Intent[] { ai.Lm(paramValueCallback) };
i = 0;
break label223;
}
label488:
parame = null;
i = 0;
}
}
public final boolean a(MMActivity paramMMActivity, int paramInt1, int paramInt2, Intent paramIntent)
{
GMTrace.i(16885798141952L, 125809);
if (paramInt1 == 1)
{
if ((this.rGx == null) && (this.rGy == null))
{
w.w("MicroMsg.WebViewUI.FileChooser", "uploadFileCallback is null.");
GMTrace.o(16885798141952L, 125809);
return true;
}
Object localObject1;
Object localObject2;
if (paramInt2 == -1)
{
localObject1 = null;
if (paramIntent != null)
{
localObject1 = null;
if (paramIntent.getData() != null) {
break label233;
}
localObject2 = paramIntent.getExtras();
if (localObject2 != null)
{
if (((Bundle)localObject2).getParcelable("android.intent.extra.STREAM") != null) {
localObject1 = (Uri)((Bundle)localObject2).getParcelable("android.intent.extra.STREAM");
}
}
else
{
label102:
localObject1 = bg.f(paramMMActivity, (Uri)localObject1);
w.i("MicroMsg.WebViewUI.FileChooser", "get file path:[%s]", new Object[] { localObject1 });
}
}
else
{
if (bg.nm((String)localObject1)) {
break label448;
}
paramMMActivity = s.PQ((String)localObject1);
w.d("MicroMsg.WebViewUI.FileChooser", "get file mime type [%s]", new Object[] { paramMMActivity });
if (!bg.nm(this.rGv)) {
break label243;
}
paramInt1 = 1;
label168:
if (paramInt1 == 0) {
break label478;
}
if (paramIntent.getData() != null) {
break label439;
}
paramMMActivity = Uri.fromFile(new File((String)localObject1));
}
}
for (;;)
{
w.d("MicroMsg.WebViewUI.FileChooser", "result = " + paramMMActivity);
h(paramMMActivity);
bCP();
break;
localObject1 = null;
break label102;
label233:
localObject1 = paramIntent.getData();
break label102;
label243:
localObject2 = this.rGv.split(",");
paramInt2 = localObject2.length;
paramInt1 = 0;
for (;;)
{
if (paramInt1 >= paramInt2) {
break label434;
}
Object localObject3 = localObject2[paramInt1].replace(" ", "");
boolean bool;
if (bg.nm((String)localObject3)) {
bool = true;
}
for (;;)
{
if (!bool) {
break label427;
}
paramInt1 = 1;
break;
if (!bg.nm(paramMMActivity))
{
if ((!((String)localObject3).contains("/")) || (!paramMMActivity.contains("/")))
{
bool = ((String)localObject3).equals(paramMMActivity);
continue;
}
localObject3 = ((String)localObject3).split("/");
String[] arrayOfString = paramMMActivity.split("/");
if (bg.nl(localObject3[0]).equals(arrayOfString[0]))
{
if ((bg.nl(localObject3[1]).equals("*")) || (bg.nl(localObject3[1]).equals(arrayOfString[1])))
{
bool = true;
continue;
}
bool = false;
continue;
}
}
bool = false;
}
label427:
paramInt1 += 1;
}
label434:
paramInt1 = 0;
break label168;
label439:
paramMMActivity = paramIntent.getData();
continue;
label448:
paramMMActivity = new File(ai.Ll(this.rGw));
if (paramMMActivity.exists()) {
paramMMActivity = Uri.fromFile(paramMMActivity);
} else {
label478:
paramMMActivity = null;
}
}
}
GMTrace.o(16885798141952L, 125809);
return false;
}
}
/* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\mm\plugin\webview\modeltools\c.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"robert0825@gmail.com"
] | robert0825@gmail.com |
d5a32216f8e35d8b359066abcca973b9a2ed2183 | 35ebd91ae1c5110b553365210f65a3dc60048f12 | /src/no/kjelli/generic/gui/GUIComponent.java | 3111f1ecfa36a7d1eef25bf6e7c34112e85b6e25 | [] | no_license | Mugius/KjelliGameEngine | b9bca1b9d3b2e5aa4810813ac8677cbf9f28b382 | 998739b47ca755e3d6d04016ee87d1a9969d0783 | refs/heads/master | 2021-01-22T19:25:56.688576 | 2014-06-25T09:16:20 | 2014-06-25T09:16:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | package no.kjelli.generic.gui;
import no.kjelli.generic.gfx.Drawable;
public interface GUIComponent extends Drawable {
public boolean contains(float x, float y);
public void update();
}
| [
"kjehe91@gmail.com"
] | kjehe91@gmail.com |
af35aa346a21259396e31125ef05ddb2e902c0a4 | 76485e7664cd38c5b09623c6b013826c045966a9 | /app/src/main/java/com/example/ejerciciobroadcastreceiver/Llamada.java | 5ad5f43e2698f20c266f59bae0e358dd7738ce94 | [] | no_license | gabiota2018/ejercicioBroadcastReceiver | a044215a8f46777e4a63545bfe9aa6f9fe522650 | e5aa8b3d51e08e94f867c216a728de89de355c6b | refs/heads/master | 2021-05-19T16:33:29.427236 | 2020-04-01T00:18:55 | 2020-04-01T00:18:55 | 252,029,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 431 | java | package com.example.ejerciciobroadcastreceiver;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
public class Llamada extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_llamada);
Intent i=new Intent(Intent.ACTION_CALL);
}
}
| [
"gabisago6@gmail.com"
] | gabisago6@gmail.com |
a2b402d7297bbd0eb9b32c018da4fb3387faff33 | a2258d3554005b0eb47c229be428dbc8fc74f83a | /springcloud-provider-dept-8001/src/main/java/com/dizhongdi/service/DeptServiceImpl.java | c36675c6b7c8e212f27b444a1778c020c6b74028 | [] | no_license | asdw14/springcloud | 713e83a6b0f704fcefd92b92180200e71365407c | ade26149f22def46315116a3593dcd3a83daa752 | refs/heads/master | 2023-07-07T23:07:11.200872 | 2021-08-18T09:35:41 | 2021-08-18T09:35:41 | 397,206,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 824 | java | package com.dizhongdi.service;
import com.dizhongdi.dao.DeptDao;
import com.dizhongdi.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* ClassName:DeptServiceImpl
* Package:com.dizhongdi.service
* Description:
*
* @Date: 2021/8/17 17:01
* @Author:dizhongdi
*/
@Service
public class DeptServiceImpl implements DeptService{
@Autowired
DeptDao deptDao;
@Override
public Dept queryById(Long deptno) {
Dept dept = deptDao.queryById(deptno);
return dept;
}
@Override
public List<Dept> queryAll() {
List<Dept> depts = deptDao.queryAll();
return depts;
}
@Override
public Boolean addDept(Dept dept) {
return deptDao.addDept(dept);
}
}
| [
"2755063993@qq.com"
] | 2755063993@qq.com |
62a54103b536e13d664ccf3a1d1a3d0668a1febf | 845faab4353aefef7621d31f83116a47b290bcaa | /src/sample/SignUpController.java | ca61d6fabe95a70ce842967c76be3b2364357774 | [] | no_license | meherafrozsworna/OnlineBloodBank | 405cf68b72533429212a8ae7da34cdcfc87f404c | e5d1ed8b3832999208283b32bb956eededcd6cb1 | refs/heads/master | 2022-11-28T07:06:02.740216 | 2020-08-04T15:26:31 | 2020-08-04T15:26:31 | 285,021,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,999 | java | package sample;
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXComboBox;
import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.layout.AnchorPane;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import static sample.Client.nc;
import static sample.Main.hospitalList;
import static sample.Main.personInfoList;
import static sample.loginController.MyId;
public class SignUpController implements Initializable {
public AnchorPane SignpagePane;
public JFXTextField weightField;
public JFXTextField AddressField;
public JFXTextField mobileNumberField;
public JFXTextField nameFild;
public JFXPasswordField passwordField;
public JFXPasswordField ConfirmPassword;
public JFXComboBox BloodGroupField;
public JFXComboBox Genderfield;
public JFXButton saveButton;
public JFXButton cancelButton;
public JFXTextField MailField;
ObservableList<String> bloodGrpList2 = FXCollections.
observableArrayList("O+", "O-", "A+", "A-", "B+", "B-", "AB+", "AB-");
ObservableList<String> genderList = FXCollections.
observableArrayList("Male", "Female");
@Override
public void initialize(URL location, ResourceBundle resources) {
BloodGroupField.setValue("O+");
BloodGroupField.setItems(bloodGrpList2);
Genderfield.setValue("Male");
Genderfield.setItems(genderList);
}
public void cancelButtonAction(ActionEvent actionEvent) {
try {
AnchorPane pane = FXMLLoader.load(getClass().getResource("startPage.fxml"));
SignpagePane.getChildren().setAll(pane);
} catch (IOException e) {
e.printStackTrace();
}
}
public void saveButtonAction(ActionEvent actionEvent) {
try {
int flag = 0;
if (mobileNumberField.getText().isEmpty() || weightField.getText().isEmpty()
|| nameFild.getText().isEmpty() || passwordField.getText().isEmpty()
|| ((String) BloodGroupField.getValue()).isEmpty() ||
((String) Genderfield.getValue()).isEmpty() || ConfirmPassword.getText().isEmpty()) {
flag = 1 ;
AlertBox.display("Form", "Please fill up all the forms");
}else if (!passwordField.getText().equals(ConfirmPassword.getText())) {
flag = 1;
AlertBox.display("Password", "Your password doesn't match");
}
else if (true) {
for (int i = 0; i < personInfoList. size(); i++) {
if (mobileNumberField.getText().equals(personInfoList.get(i).getPhoneNumber_ID())){
flag = 1;
AlertBox.display("Problem", "This mobile number has already been used");
}
}
if (flag == 0){
for (int i = 0; i < hospitalList.size() ; i++) {
if (mobileNumberField.getText().equals(hospitalList.get(i).getPhoneNumber_ID())){
flag = 1 ;
AlertBox.display("Problem", "This mobile number has already been used");
}
}
}
}
if (flag == 0){
String mobile = mobileNumberField.getText();
int weight = Integer.parseInt(weightField.getText());
String address = AddressField.getText();
String name = nameFild.getText();
String password = passwordField.getText();
String bloodgrp = (String) BloodGroupField.getValue();
String gender = (String) Genderfield.getValue();
String mail = MailField.getText();
MemberInfo m = new MemberInfo(mobile, name, address, bloodgrp, gender, weight, password,mail);
//writing object
nc.write(m);
MyId = mobile;
AnchorPane pane = FXMLLoader.load(getClass().getResource("menuPage.fxml"));
SignpagePane.getChildren().setAll(pane);
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void confirmPasswordAction(ActionEvent actionEvent) {
if (!passwordField.getText().equals(ConfirmPassword.getText())) {
AlertBox.display("Password", "Your password doesn't match");
}
}
public void mobileNumberAction(ActionEvent actionEvent) {
try {
long mobile = Integer.parseInt(mobileNumberField.getText());
} catch (Exception e) {
AlertBox.display("Mobile Number", "Enter a valid mobile number");
}
int flag = 0;
for (int i = 0; i < personInfoList.size(); i++) {
if (mobileNumberField.getText().equals(personInfoList.get(i).getPhoneNumber_ID())) {
flag = 1;
AlertBox.display("Problem", "This mobile number has already been used");
}
}
if (flag == 0) {
for (int i = 0; i < hospitalList.size(); i++) {
if (mobileNumberField.getText().equals(hospitalList.get(i).getPhoneNumber_ID())) {
flag = 1;
AlertBox.display("Problem", "This mobile number has already been used");
}
}
}
}
public void weightFieldAction(ActionEvent actionEvent) {
try {
long mobile = Integer.parseInt(mobileNumberField.getText());
} catch (Exception e) {
AlertBox.display("Weight", "Enter a valid weight");
}
}
public void mailAction(ActionEvent actionEvent) {
}
} | [
"meherafroz6331@gmail.com"
] | meherafroz6331@gmail.com |
63943a29c96fb34f2e254e66e99aa67ad78b3514 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2016/12/ConfigLoader.java | 95ef0073c40fa0b41ea484d16bd4924fca8cdd5e | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 4,193 | java | /*
* Copyright (c) 2002-2016 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.server.configuration;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.helpers.collection.Pair;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.configuration.Settings;
public class ConfigLoader
{
public static final String DEFAULT_CONFIG_FILE_NAME = "neo4j.conf";
private final Function<Map<String, String> ,Iterable<Class<?>>> settingsClassesSupplier;
public ConfigLoader( Function<Map<String, String> ,Iterable<Class<?>>> settingsClassesSupplier )
{
this.settingsClassesSupplier = settingsClassesSupplier;
}
public ConfigLoader( List<Class<?>> settingsClasses )
{
this( settings -> settingsClasses );
}
public Config loadConfig( Optional<File> configFile, Pair<String,String>... configOverrides ) throws IOException
{
return loadConfig( Optional.empty(), configFile, configOverrides );
}
public Config loadConfig( Optional<File> homeDir, Optional<File> configFile,
Pair<String,String>... configOverrides )
{
Map<String,String> overriddenSettings = calculateSettings( homeDir, configOverrides );
return new Config( configFile, overriddenSettings, ConfigLoader::overrideEmbeddedDefaults,
settingsClassesSupplier );
}
public Config loadOfflineConfig( Optional<File> homeDir, Optional<File> configFile )
{
return overrideBoltSettings( loadConfig( homeDir, configFile,
Pair.of( GraphDatabaseSettings.auth_enabled.name(), Settings.FALSE ) ) );
}
private Map<String, String> calculateSettings( Optional<File> homeDir,
Pair<String, String>[] configOverrides )
{
HashMap<String, String> settings = new HashMap<>();
settings.putAll( toMap( configOverrides ) );
settings.put( GraphDatabaseSettings.neo4j_home.name(),
homeDir.map( File::getAbsolutePath ).orElse( System.getProperty( "user.dir" ) ) );
return settings;
}
private Map<String, String> toMap( Pair<String, String>[] configOverrides )
{
Map<String, String> overrides = new HashMap<>();
for ( Pair<String, String> configOverride : configOverrides )
{
overrides.put( configOverride.first(), configOverride.other() );
}
return overrides;
}
private static Config overrideBoltSettings( Config config )
{
Map<String,String> overrides = new HashMap<>();
for ( GraphDatabaseSettings.BoltConnector bolt : GraphDatabaseSettings.boltConnectors( config ) )
{
overrides.put( bolt.enabled.name(), Settings.FALSE );
}
overrides.put( new GraphDatabaseSettings.BoltConnector().enabled.name(), Settings.FALSE );
return config.with( overrides );
}
/*
* TODO: This means docs will say defaults are something other than what they are in the server. Better
* make embedded the special case and set the defaults to be what the server will have.
*/
private static void overrideEmbeddedDefaults( Map<String, String> config )
{
config.putIfAbsent( GraphDatabaseSettings.auth_enabled.name(), "true" );
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
c3117944b04ac8c3da2cb3657fdafc6d7ffc0df8 | 7f029c9c427f57e677b4a1e83df8de5055238cc9 | /ContactsProject/app/src/main/java/ro/project/contacts/requests/RetrofitClient.java | 5c5845c6c20789a001f72857e2a76df76bcefda5 | [] | no_license | CosminDragos/Contacts | 8650c4c770eb7ee29ba5a65225c23a1e90bcd592 | 2277a91634cdb8dba8a48353a3b34853582a7dda | refs/heads/master | 2021-06-29T04:39:33.034592 | 2017-09-18T10:24:24 | 2017-09-18T10:24:24 | 103,735,028 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package ro.project.contacts.requests;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by cosmin on 18.09.2017.
*/
public class RetrofitClient {
private static Retrofit retrofit = null;
public static Retrofit getClient(String baseUrl) {
if (retrofit == null) {
retrofit = new Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(baseUrl)
.build();
}
return retrofit;
}
}
| [
"cosmin.deliu1993@gmail.com"
] | cosmin.deliu1993@gmail.com |
e26e3017e3a08641960aaed5203fcf6dc120d261 | c1362a8a76dbb0b28f63caedf40afc8c9cc907b6 | /src/main/java/za/co/paygate/payhost/PaymentMethodType.java | d3fe889672063b6a671b5706928cf86886f5bbe9 | [] | no_license | assertion-enterprise/payhost-common | 4e34a23d3ac1dced0ab71bf6cdd90b79c151c92f | 867309bc89703eeee38f9afffc57a5adc39477c9 | refs/heads/master | 2023-05-04T03:09:54.705822 | 2021-05-22T18:08:58 | 2021-05-22T18:08:58 | 369,875,855 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,354 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// 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: 2021.05.22 at 06:53:12 PM SAST
//
package za.co.paygate.payhost;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for PaymentMethodType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="PaymentMethodType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}token">
* <enumeration value="CC"/>
* <enumeration value="DC"/>
* <enumeration value="EW"/>
* <enumeration value="BT"/>
* <enumeration value="CV"/>
* <enumeration value="PC"/>
* <enumeration value="MO"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "PaymentMethodType")
@XmlEnum
public enum PaymentMethodType {
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">Credit Card</p>
* </pre>
*
*
*/
CC,
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">Debit Card</p>
* </pre>
*
*
*/
DC,
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">eWallet</p>
* </pre>
*
*
*/
EW,
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">Bank Transfer</p>
* </pre>
*
*
*/
BT,
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">Cash Voucher</p>
* </pre>
*
*
*/
CV,
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">Pre-Paid Card</p>
* </pre>
*
*
*/
PC,
/**
*
* <pre>
* <?xml version="1.0" encoding="UTF-8"?><p xmlns:sch="http://www.paygate.co.za/PayHOST" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.paygate.co.za/PayHOST" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xspg="http://www.paygate.co.za/PayHOST">Mobile Payment</p>
* </pre>
*
*
*/
MO;
public String value() {
return name();
}
public static PaymentMethodType fromValue(String v) {
return valueOf(v);
}
}
| [
"assertion-enterprise@outlook.com"
] | assertion-enterprise@outlook.com |
87c62d162874878e60a830b51bb0509423a5611e | f01abc37b4d24b9f0c767e3bc6eae0392055e922 | /ExerciceMenuV4/src/package1/ExerciceMenu.java | d49d2002f9d4c1402f71d5129376c49cd6f90a87 | [] | no_license | thekakamask/ExercicesMenu | a2c2276bbd4033feb4470ba2e5faf86151edadc3 | a3ee839b443027233bad8dac6965a25513b76f60 | refs/heads/master | 2021-01-04T04:14:27.653040 | 2020-02-13T23:35:33 | 2020-02-13T23:35:33 | 240,382,256 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 12,362 | java | package package1;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
import java.util.stream.IntStream;
public class ExerciceMenu {
public static void main(String[] args) {
menu();
}
public static void menu() {
int choixUtilisateur = affichage();
switch (choixUtilisateur) {
case 1 :
exercice1();
break;
case 2 :
exercice2();
break;
case 3 :
exercice3();
break;
case 4 :
exercice4();
break;
case 5 :
exercice5();
break;
case 6 :
exercice6();
break;
case 7 :
exercice7();
break;
case 8 :
exercice8();
break;
case 9 :
exercice9();
break;
case 10 :
exercice10();
break;
case 0 :
System.out.println("fermeture du programme...");
System.exit(0);
}
}
public static int affichage() {
System.out.println("voici le menu du programme : ");
System.out.println("tapez 1 pour l'exercice 1");
System.out.println("tapez 2 pour l'exercice 2");
System.out.println("tapez 3 pour l'exercice 3");
System.out.println("tapez 4 pour l'exercice 4");
System.out.println("tapez 5 pour l'exercice 5");
System.out.println("tapez 6 pour l'exercice 6");
System.out.println("tapez 7 pour l'exercice 7");
System.out.println("tapez 8 pour l'exercice 8");
System.out.println("tapez 9 pour l'exercice 9");
System.out.println("tapez 10 pour l'exercice 10");
System.out.println("tapez 0 pour fermer le programme");
Scanner sc = new Scanner(System.in);
int str = sc.nextInt();
return str;
}
public static void exercice1() {
System.out.println("je vais choisir un nombre entre 1 et 5, nous verrons si vous arrivez a trouver celui que j'ai choisi");
Random r = new Random();
int n = r.nextInt(5);
System.out.println("Veuillez choisir un nombre entre 1 et 5 :");
Scanner sc = new Scanner(System.in);
while (true) {
int str1 = sc.nextInt();
if (n != str1) {
System.out.println("Vous avez saisi le nombre : " + str1);
System.out.println("désolé, il faut reessayer");
}
if (n == str1) {
System.out.println("Vous avez saisi le nombre : " + str1);
System.out.println("bravo");
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice1();
}
if (stri1.equals("non")) {
menu();
}
}
}
}
public static void exercice2() {
System.out.println("je vais choisir un nombre entre 10 et 20, nous verrons si vous arrivez a trouver celui que j'ai choisi");
Random r2 = new Random();
int n2 = r2.nextInt(20);
System.out.println("Veuillez choisir un nombre entre 10 et 20 :");
Scanner sc = new Scanner(System.in);
while (true) {
int str2 = sc.nextInt();
System.out.println("Vous avez saisi le nombre : " + str2);
if (n2 != str2) {
System.out.println("désolé, il faut reessayer");
if (str2 < 10) {
System.out.println(": votre chiffre est au dessous de la borne minimale (10)");
}
if (str2 > 20) {
System.out.println(": votre chiffre est au dessus de la borne maximal (20)");
}
if (str2 < 10 && str2 > 20) {
System.out.println("ce chiffre n'est pas le bon");
}
}
if (n2 == str2) {
System.out.println("bravo");
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice2();
}
if (stri1.equals("non")) {
menu();
}
}
}
}
public static void exercice3() {
System.out.println("choisir un chiffre et je vous indique les 10 suivants :");
Scanner sc = new Scanner(System.in);
int str3 = sc.nextInt();
System.out.println("vous avez choisi ce chiffre : " + str3);
int a2 = str3 + 1;
int b2 = str3 + 2;
int c2 = str3 + 3;
int d2 = str3 + 4;
int e2 = str3 + 5;
int f2 = str3 + 6;
int g2 = str3 + 7;
int h2 = str3 + 8;
int i2 = str3 + 9;
int j2 = str3 + 10;
System.out.println("votre chiffre : " + str3 + " " + "et les dix suivants :" + " " + a2 + " " + b2 + " "
+ c2 + " " + d2 + " " + e2 + " " + f2 + " " + g2 + " " + h2 + " " + i2 + " " + j2 + ".");
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice3();
}
if (stri1.equals("non")) {
menu();
}
}
public static void exercice4() {
System.out.println("choisir un chiffre et je vous indique les 10 suivants :");
Scanner sc = new Scanner(System.in);
int str4 = sc.nextInt();
int chiffre[] = { str4 };
int a3 = str4 + 1;
int b3 = str4 + 2;
int c3 = str4 + 3;
int d3 = str4 + 4;
int e3 = str4 + 5;
int f3 = str4 + 6;
int g3 = str4 + 7;
int h3 = str4 + 8;
int i3 = str4 + 9;
int j3 = str4 + 10;
for (int n3 = 0; n3 < chiffre.length; n3++) {
System.out.println("vous avez choisi ce chiffre : " + str4);
System.out.println("votre chiffre : " + str4 + " " + "et les dix suivants :" + " " + a3 + " " + b3 + " " + c3 + " " + d3 + " " + e3 + " " + f3 + " " + g3 + " " + h3 + " " + i3 + " " + j3 + ".");
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice4();
}
if (stri1.equals("non")) {
menu();
}
}
}
public static void exercice5() {
System.out.println("choisir un chiffre et je vous indiquerais sa table de multiplication jusqu'a 10 :");
Scanner sc = new Scanner(System.in);
int str5 = sc.nextInt();
int a4 = str5 * 1;
int b4 = str5 * 2;
int c4 = str5 * 3;
int d4 = str5 * 4;
int e4 = str5 * 5;
int f4 = str5 * 6;
int g4 = str5 * 7;
int h4 = str5 * 8;
int i4 = str5 * 9;
int j4 = str5 * 10;
System.out.println("vous avez choisi le chiffre :" + str5);
System.out.println("voici sa table de multiplication");
System.out.println(str5 + "*1 = " + a4);
System.out.println(str5 + "*2 = " + b4);
System.out.println(str5 + "*3 = " + c4);
System.out.println(str5 + "*4 = " + d4);
System.out.println(str5 + "*5 = " + e4);
System.out.println(str5 + "*6 = " + f4);
System.out.println(str5 + "*7 = " + g4);
System.out.println(str5 + "*8 = " + h4);
System.out.println(str5 + "*9 = " + i4);
System.out.println(str5 + "*10 = " + j4);
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice5();
}
if (stri1.equals("non")) {
menu();
}
}
public static void exercice6() {
System.out.println("choisir un chiffre et je vous indiquerais la somme de ses entiers positifs :");
int s = 1;
Scanner sc= new Scanner(System.in);
int str6 = sc.nextInt();
for (int i = 0; i < str6; i++) {
s = s + i;
System.out.println("vous avez choisi" + str6);
System.out.println("voici la somme de ses entiers positifs" + s);
}
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice6();
}
if (stri1.equals("non")) {
menu();
}
}
public static void exercice7() {
System.out.println("choisir un chiffre et je vous indiquerais la somme de ses entiers positifs :");
Scanner sc= new Scanner(System.in);
int str7 = sc.nextInt();
System.out.println("vous avez choisi" + str7);
if (str7 != 0) {
for (int i = str7 - 1; i >= 1; i--) {
str7 = str7 * i;
System.out.println("la factorielle est" + str7);
}
} else
str7=1;
System.out.println("la factorielle est" + str7);
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice7();
}
if (stri1.equals("non")) {
menu();
}
}
public static void exercice8() {
System.out.println("choisir 20 chiffres et je vous dirais lequels est le plus grand");
int a = 0;
int tableauChiffres[] = new int[20];
int grandChiffre = 0;
while (a<=21) {
Scanner sc= new Scanner(System.in);
int str8= sc.nextInt();
tableauChiffres[a] = str8;
System.out.println("votre chiffre " + a + " est " + str8);
if (grandChiffre < str8) {
grandChiffre = str8;
}
a++;
if (a==21) {
System.out.println("votre tableau de chiffres :" + Arrays.toString(tableauChiffres));
System.out.println("le plus grand chiffre de vos choix est :" + grandChiffre);
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice8();
}
if (stri1.equals("non")) {
menu();
}
}
}
}
public static void exercice9() {
System.out.println("choisir des chiffres et je vous dirais lequels est le plus grand");
System.out.println("tapez '0' pour terminer");
int a = 0;
ArrayList<Integer> tableauChiffres = new ArrayList<Integer>();
int grandChiffre = 0;
Scanner sc= new Scanner(System.in);
while (true) {
int str9= sc.nextInt();
tableauChiffres.add(str9);
System.out.println("votre chiffre " + a + " est " + str9);
if (grandChiffre < str9) {
grandChiffre = str9;
}
a++;
if (str9 == 0) {
System.out.println("votre tableau de chiffres :" + tableauChiffres);
System.out.println("le plus grand chiffre de vos choix est :" + grandChiffre);
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc1= new Scanner(System.in);
String stri1 = sc1.nextLine();
if (stri1.equals("oui")) {
exercice9();
}
if (stri1.equals("non")) {
menu();
}
}
}
}
public static void exercice10() {
System.out.println("comme une caisse :");
System.out.println("je vais calculez la somme que vous devez et la somme que l'on doit vous rendre");
int somres = 0;
int sompos = 0;
int somdu = 0;
int a = 0;
int b = 0;
int c = 0;
System.out.println("tapez la somme que vous possedez");
Scanner sc= new Scanner(System.in);
int str10= sc.nextInt();
sompos = str10;
System.out.println("vous possedez : " + str10 + "euros");
System.out.println("tapez le prix des articles que vous avez choisi et finissez par 0");
Scanner sc1= new Scanner(System.in);
int str11= sc1.nextInt();
while (str11 > 0) {
somdu = str11+somdu;
}
if (str11 == 0) {
somres = sompos-somdu;
System.out.println("il va vous rendre" + somres);
while (somres >= 10) {
somres -= 10;
a+=1;
while (4<somres && somres<10) {
somres-=5;
b+=1;
while (0<somres && somres<5) {
somres -= 1;
c+=1;
}
}
}
System.out.println("on va vous rendre " + a + " billets de 10 " + b + " billet de 5 " + c + " pieces de 1");
System.out.println("voulez vous reessayer? oui ou non ?");
Scanner sc3= new Scanner(System.in);
String stri1 = sc3.nextLine();
if (stri1.equals("oui")) {
exercice10();
}
if (stri1.equals("non")) {
menu();
}
}
}
public static void exercice11() {
System.out.println("je vais calculer vos chances de gagner aux tierce, quinté et autres impots volontaires");
System.out.print("tapez le nombre de chevaux en course");
int a = 1;
int b = 1;
int c = 1;
int nbrChev=1;
int chevJoue=1;
Scanner sc= new Scanner(System.in);
int str11= sc.nextInt();
nbrChev = str11;
Scanner sc1= new Scanner(System.in);
int str12= sc1.nextInt();
chevJoue = str12;
int i = 2;
}
} | [
"noreply@github.com"
] | noreply@github.com |
955d552f8e017649aa6099e2cb26ce80a0c78939 | 7736da1e7eb763d838e6715e89293d75ea536d3a | /a20/src/main/java/memoizrlabs/com/a20/util6/util3/util6/util4/util1/Ut2.java | 98c928537e9b97380738ac58b1b7a77745bd21d8 | [
"Apache-2.0"
] | permissive | memoizr/gradle-build-times-stress-test | 6944af4a731bda6e84cd27525837b4efed84ebcf | 16bf4e9c8291ad90ccc083f287fb00a8218a43e8 | refs/heads/master | 2020-09-21T04:36:39.864158 | 2016-09-13T12:11:15 | 2016-09-13T12:11:15 | 67,682,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | package memoizrlabs.com.a20.util6.util3.util6.util4.util1;
public class Ut2 {
class Foo {
public void printHey() {
System.out.println("hey");
}
}
class Foo2 {
public void printHey() {
System.out.println("hey");
}
}
class Foo3 {
public void printHey() {
System.out.println("hey");
}
}
class Foo4 {
public void printHey() {
System.out.println("hey");
}
}
}
| [
"memoizrlabs@gmail.com"
] | memoizrlabs@gmail.com |
3f30aff666ba8c9cd548041fbb8dbdefecfc9dc0 | 0659635485cf316d60f95c19a4af669a2c366bce | /Exame_CES28/utm_v1/view/v1/GCS.java | 812ce469aee073a192f6399d55e8819197768ed9 | [] | no_license | urielmendes/Exame_CES28_Uriel | 81ac2b4e3f221772e1a57c426becaa573595df60 | 5bdcd68d2b1fa919fc97f4a2467dcdf0a7a76581 | refs/heads/master | 2021-05-06T13:38:28.110366 | 2017-12-06T05:09:14 | 2017-12-06T05:09:14 | 113,257,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package view.v1;
import presenter.v1.UTM_CTR;
public class GCS {
private static int count = 0 ;
private int id;
private UTM_CTR presenter;
public GCS(){
count++;
id = count;
}
public int getID(){
return id;
}
public void setPresenter(UTM_CTR presenter){
this.presenter = presenter;
this.presenter.add(this);
}
public void moveDrone(int location){
presenter.moveDrone(id, location);
}
public void getStatus(){
presenter.getStatus();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
109a1ddbc1502e0c0a650833cd69731e7177bc81 | dd79cbb44c81a375c4ccbd16aa2abb13d2cf0b0e | /app/src/main/java/com/anrongtec/laucher/adapter/TicketAdapter.java | 5bd428c25dd306df582d81d86dffe27bf922d6dd | [] | no_license | miniPinocchio/LaucherTj | 42771a2c4194d18c15c856b665cd5babb5a68dc8 | f9a31fb0a0c40638abcad65d238524f8afa864ad | refs/heads/master | 2021-04-15T09:48:44.732905 | 2018-04-23T02:45:08 | 2018-04-23T02:45:08 | 116,204,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,051 | java | package com.anrongtec.laucher.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.anrongtec.laucher.R;
import com.anrongtec.laucher.bean.message.AdmComparingInfo;
import com.anrongtec.laucher.util.BitmapUtil;
import com.anrongtec.laucher.util.StationUtil;
import java.util.List;
/**
*
* @author huiliu
* @date 2018/2/2
*
* @email liu594545591@126.com
* @introduce
*/
public class TicketAdapter extends RecyclerView.Adapter<TicketAdapter.TicketAdapterViewHolder> {
private List<AdmComparingInfo> typeInfos;
private Context context;
private View.OnClickListener listener;
public TicketAdapter(List<AdmComparingInfo> typeInfos, Context context, View.OnClickListener listener) {
this.typeInfos = typeInfos;
this.context = context;
this.listener = listener;
}
@Override
public TicketAdapter.TicketAdapterViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_message_info, parent, false);
return new TicketAdapter.TicketAdapterViewHolder(view);
}
@Override
public void onBindViewHolder(TicketAdapter.TicketAdapterViewHolder holder, int position) {
holder.setIsRecyclable(false);
final AdmComparingInfo message = typeInfos.get(position);
if (message != null) {
if (!TextUtils.isEmpty(message.getXp())) {
if (BitmapUtil.stringtoBitmap(message.getXp()) != null) {
holder.ivPhoto.setImageBitmap(BitmapUtil.stringtoBitmap(message.getXp()));
}
}else {
holder.ivPhoto.setImageResource(R.drawable.user_photo_icon);
}
String xxwb = message.getXxwb();
//目的地
String end = xxwb.substring(xxwb.lastIndexOf("前往") + 2);
String start = xxwb.substring(xxwb.lastIndexOf("从") + 1, xxwb.lastIndexOf("前往"));
//买票时间
String rq = xxwb.substring(xxwb.lastIndexOf("于1") + 1, xxwb.lastIndexOf("在"));
System.out.println("rq>>>>>>>>>>" + rq);
String substring = rq.substring(10);
holder.tv_come_time.setText(message.getJpsj());
holder.tv_name.setText(message.getXm());
holder.tv_id.setText("身份证:" + message.getSfzh());
String xzdxz = message.getXzdxz();
holder.tv_location.setText("地址:" + xzdxz);
holder.tv_reason.setText(message.getSqxx());
holder.tv_sex.setText(message.getXb());
String status = message.getStatus();
if (status != null) {
switch (status) {
case "1":
holder.tv_item_person_attention.setText("扣留");
break;
case "2":
holder.tv_item_person_attention.setText("已扣留");
break;
default:
holder.tv_item_person_attention.setText("扣留");
break;
}
}
holder.tv_station_start_station.setText(StationUtil.getStation(start));
holder.tv_station_end_station.setText(StationUtil.getStation(end));
holder.ll_deal.setOnClickListener(listener);
holder.ll_deal.setTag(position);
holder.ll_attention.setOnClickListener(listener);
holder.ll_attention.setTag(position);
}
holder.rl_item_msg.setTag(position);
holder.rl_item_msg.setOnClickListener(listener);
}
@Override
public int getItemCount() {
return typeInfos == null ? 0 : typeInfos.size();
}
class TicketAdapterViewHolder extends RecyclerView.ViewHolder {
ImageView ivPhoto;
TextView tv_name;
TextView tv_state;
TextView tv_id;
TextView tv_location;
TextView tv_reason;
TextView tv_sex;
TextView tv_station_start_station;
TextView tv_station_end_station;
TextView tv_age;
TextView tv_come_time;
TextView tv_item_person_attention;
LinearLayout ll_attention;
LinearLayout ll_deal;
LinearLayout ll_phone;
RelativeLayout rl_item_msg;
TicketAdapterViewHolder(View itemView) {
super(itemView);
ivPhoto = (ImageView) itemView.findViewById(R.id.iv_item_msg_user_photo);
tv_name = (TextView) itemView.findViewById(R.id.tv_item_msg_name);
tv_state = (TextView) itemView.findViewById(R.id.tv_item_msg_state);
tv_sex = (TextView) itemView.findViewById(R.id.tv_item_msg_sex);
tv_id = (TextView) itemView.findViewById(R.id.tv_item_person_id);
tv_come_time = (TextView) itemView.findViewById(R.id.tv_item_person_come_time);
tv_location = (TextView) itemView.findViewById(R.id.tv_item_person_location);
tv_reason = (TextView) itemView.findViewById(R.id.tv_item_person_reason);
tv_station_start_station = (TextView) itemView.findViewById(R.id.tv_item_person_start_station);
tv_station_end_station = (TextView) itemView.findViewById(R.id.tv_item_person_end_station);
ll_attention = (LinearLayout) itemView.findViewById(R.id.ll_focus_people_attention);
ll_deal = (LinearLayout) itemView.findViewById(R.id.ll_focus_people_deal);
ll_phone = (LinearLayout) itemView.findViewById(R.id.ll_focus_people_tel);
rl_item_msg = (RelativeLayout) itemView.findViewById(R.id.rl_item_msg);
tv_item_person_attention = (TextView) itemView.findViewById(R.id.tv_item_person_attention);
}
}
}
| [
"liu594545591@126.com"
] | liu594545591@126.com |
dcbf02dbf8e38e9cee9cf786f84c31727fc5b0b5 | 5bf2dcff5b12cce4102b97af87a400ea7655c51b | /PMS_uestc/src/cn/pms/ssm/po/Students.java | 321e0f342e21004169699bb5509c892b067282fb | [] | no_license | mrfocker/PMS | 95c638f464f507f83dba0daba29278a7fac1ce00 | a5a10d4d6a1fc642788af24a812256dedd89fa09 | refs/heads/master | 2021-01-23T06:40:15.299436 | 2017-08-23T05:38:16 | 2017-08-23T05:38:16 | 93,034,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,110 | java | package cn.pms.ssm.po;
/**
* <p>Title: Student</p>
* <p>Description:TODO </p>
* <p>Company: uestc_xr</p>
* @author liuxiang
* @date ����ʱ�䣺2017��6��6�� ����10:39:29
* @version 1.0
*/
public class Students {
private int id;
private String username;
private int age;
private int salary;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getSalary() {
return salary;
}
public void setSalary(int salary) {
this.salary = salary;
}
@Override
public String toString() {
return "Students [id=" + id + ", username=" + username + ", age=" + age
+ ", salary=" + salary + "]";
}
public Students(int id, String username, int age, int salary) {
// super();
this.id = id;
this.username = username;
this.age = age;
this.salary = salary;
}
public Students() {
// super();
}
} | [
"13457329@qq.com"
] | 13457329@qq.com |
c9def6dff4a0910d8ba239d2dc71c6a633ccfd9f | f14dd6f16625181b1e15ddd23522243b4181eec3 | /trivialt-spring/src/main/java/org/neo4j/app/trivialt/repository/MatchRepository.java | 23ce9a98e8fea82beb8e7f2e88d8b85cf1c25326 | [] | no_license | akollegger/trivial-graph | a04ebedb384f0d7805b6ac6b3299a643950bc842 | 9e480023d4e22cd672c117b70c2a44679e434550 | refs/heads/master | 2021-04-09T16:49:57.323446 | 2011-10-25T23:25:13 | 2011-10-25T23:25:13 | 2,445,103 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | package org.neo4j.app.trivialt.repository;
import org.neo4j.app.trivialt.model.Answer;
import org.neo4j.app.trivialt.model.Match;
import org.springframework.data.neo4j.repository.GraphRepository;
public interface MatchRepository extends GraphRepository<Match> {
}
| [
"andreas.kollegger@neotechnology.com"
] | andreas.kollegger@neotechnology.com |
7d235cf64a8242debef7593271ce70490caf0fc2 | ee19c5b7a48f34b965040ce895dc1337bab1559a | /gwtcx/samples/sample-gxt-mgwt-basic-project/src/main/java/com/kiahu/sample/client/gin/MobileGinjectorProvider.java | 4d3b891fddab804bc1cbcdd66cac6b2837f9dbb1 | [] | no_license | hejunion/gwt-cx | 7895a9737ec22571a8e58685883a6563f9a25f00 | 2729985042b7c7d7ff41da4f2795b1ad291dbbce | refs/heads/master | 2020-04-22T18:26:38.854865 | 2015-05-22T16:07:44 | 2015-05-22T16:07:44 | 36,079,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 911 | java | /**
* (C) Copyright 2012 Kiahu
*
* Licensed under the terms of the GNU General Public License version 3
* as published by the Free Software Foundation. You may obtain a copy of the
* License at: http://www.gnu.org/copyleft/gpl.html
*
* 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.kiahu.sample.client.gin;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
public class MobileGinjectorProvider implements GinjectorProvider {
@Override
public BasicProjectGinjector get() {
Log.debug("MobileGinjectorProvider - get()");
return GWT.create(MobileGinjector.class);
}
}
| [
"rob.ferguson@uptick.com.au@47729709-52d1-c6db-8006-95f89ab1258a"
] | rob.ferguson@uptick.com.au@47729709-52d1-c6db-8006-95f89ab1258a |
5c9ac919a21dc9b80743fa7e656c27c0985e28f8 | dc88c9371095310039cb6500a542dcb467ef1bec | /modules/jooby-spec/src/main/java/org/jooby/internal/spec/DocCollector.java | 6ddc05339abaca099ab5c3c1433de31a25e3f741 | [
"Apache-2.0"
] | permissive | DrorBuhnik/jooby | becce8530985a539407d27cfe1dd92e038ecaab0 | bb1ca35be235c80505d729b3b29d28c5cb4fe970 | refs/heads/master | 2021-01-23T15:04:34.651254 | 2017-06-04T19:44:51 | 2017-06-04T19:44:51 | 93,268,945 | 0 | 0 | null | 2017-06-03T19:12:46 | 2017-06-03T19:12:46 | null | UTF-8 | Java | false | false | 7,377 | 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.jooby.internal.spec;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.jooby.Status;
import org.slf4j.Logger;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.body.MethodDeclaration;
import com.github.javaparser.ast.comments.Comment;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.expr.StringLiteralExpr;
import com.github.javaparser.ast.stmt.ExpressionStmt;
import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
import com.google.common.base.Splitter;
public class DocCollector extends VoidVisitorAdapter<Context> {
private static final Pattern SPLITTER = Pattern.compile("\\s+\\*");
private static final String RETURNS = "@return";
private static final String PARAM = "@param";
private static final String THROWS = "@throws";
private static final Pattern CODE = Pattern
.compile("<code>\\s*(\\d+)\\s*(=\\s*([^<]+))?\\s*</code>");
private Map<String, Object> doc = new HashMap<>();
private Logger log;
public DocCollector(final Logger log) {
this.log = log;
}
public Map<String, Object> accept(final Node node, final String method, final Context ctx) {
try {
node.accept(this, ctx);
if (!doc.containsKey("@statusCodes")) {
Map<Object, Object> codes = new LinkedHashMap<>();
Status status = Status.OK;
if ("DELETE".equals(method)) {
status = Status.NO_CONTENT;
}
codes.put(status.value(), status.reason());
doc.put("@statusCodes", codes);
}
} catch (Exception x) {
log.debug("Doc collector resulted in exception", x);
}
return doc;
}
@Override
public void visit(final MethodCallExpr n, final Context ctx) {
Map<String, Object> doc = doc(n, ctx);
if (doc != null) {
this.doc.putAll(doc);
this.doc.put("@summary", summary(n, ctx));
}
}
@Override
public void visit(final MethodDeclaration m, final Context ctx) {
ClassOrInterfaceDeclaration clazz = clazz(m);
Map<String, Object> doc = doc(m, ctx);
if (doc != null) {
this.doc.putAll(doc);
this.doc.put("@summary", doc(clazz, ctx).get("@text"));
}
}
private ClassOrInterfaceDeclaration clazz(final MethodDeclaration method) {
Node node = method.getParentNode();
while (!(node instanceof ClassOrInterfaceDeclaration)) {
node = node.getParentNode();
}
return (ClassOrInterfaceDeclaration) node;
}
private Map<String, Object> doc(final MethodCallExpr expr, final Context ctx) {
if (expr.getScope() == null) {
return doc(expr.getParentNode(), ctx);
} else {
List<Expression> args = expr.getArgs();
if (args.size() > 0) {
return doc(args.get(0), ctx);
}
}
return null;
}
private Map<String, Object> doc(final Node node, final Context ctx) {
Map<String, Object> hash = new HashMap<>();
Comment comment = node.getComment();
if (comment != null) {
String doc = comment.getContent().trim();
String clean = Splitter.on(SPLITTER)
.trimResults()
.omitEmptyStrings()
.splitToList(doc)
.stream()
.map(l -> l.charAt(0) == '*' ? l.substring(1).trim() : l)
.collect(Collectors.joining("\n"));
int at = clean.indexOf('@');
String text = at == 0 ? null : (at > 0 ? clean.substring(0, at) : clean).trim();
Map<Integer, String> codes = Collections.emptyMap();
String tail = clean.substring(Math.max(0, at));
// params
params(tail, hash::put);
// returns
String returnText = returnText(tail);
codes = new LinkedHashMap<>();
if (returnText != null) {
hash.put("@return", returnText);
Matcher cmatcher = CODE.matcher(returnText);
while (cmatcher.find()) {
Status status = Status.valueOf(Integer.parseInt(cmatcher.group(1).trim()));
String message = Optional.ofNullable(cmatcher.group(3)).orElse(status.reason()).trim();
codes.put(status.value(), message);
}
TypeFromDoc.parse(node, ctx, returnText).ifPresent(type -> hash.put("@type", type));
}
hash.put("@statusCodes", codes);
hash.put("@text", text);
}
return hash;
}
private void params(final String text, final BiConsumer<String, String> callback) {
int at = text.indexOf(PARAM);
while (at != -1) {
int start = at + PARAM.length();
int end = firstOf(text, start, PARAM, RETURNS, THROWS);
String raw = text.substring(start, end).trim();
int space = raw.indexOf(" ");
if (space != -1) {
String name = raw.substring(0, space).trim();
String desc = raw.substring(space).trim();
callback.accept(name, desc);
}
at = text.indexOf(PARAM, end);
}
}
private int firstOf(final String text, final int start, final String... tokens) {
for (String token : tokens) {
int pos = text.indexOf(token, start);
if (pos != -1) {
return pos;
}
}
return text.length();
}
private String returnText(final String doc) {
int retIdx = doc.indexOf(RETURNS);
if (retIdx >= 0) {
String ret = doc.substring(retIdx + RETURNS.length()).trim();
ret = Splitter.on(Pattern.compile("[^\\{]@[a-zA-Z]"))
.trimResults().omitEmptyStrings()
.splitToList(ret)
.stream()
.findFirst()
.get();
return ret;
}
return null;
}
private String summary(final MethodCallExpr it, final Context ctx) {
return usePath(it)
.map(use -> {
Node node = use;
while (!(node instanceof ExpressionStmt)) {
node = node.getParentNode();
}
return node == null ? null : (String) doc(node, ctx).get("@text");
}).orElse(null);
}
private Optional<Node> usePath(final MethodCallExpr it) {
MethodCallExpr expr = AST.scopeOf(it);
String name = expr.getName();
List<Expression> args = expr.getArgs();
if (name.equals("use") && args.size() == 1 && args.get(0) instanceof StringLiteralExpr) {
return Optional.of(expr);
}
return Optional.empty();
}
}
| [
"espina.edgar@gmail.com"
] | espina.edgar@gmail.com |
69e043576c138108f23c42d71c70585b0eabdfe6 | 11be25d79ce0ee45c17045e5d2f606bc417c27f7 | /src/main/java/com/leagueofshadows/notifyme/Parent.java | b2935fac47e08c282b68fbeb34fba195bfaa7647 | [] | no_license | ksiva1996/Notifyme | f504e8ddfb906d14baeb4ef369832b3365f393de | 250bceb9ae91cd30e86cb8e4b5cc9f6b2dcd941f | refs/heads/master | 2021-01-21T05:28:15.558886 | 2017-02-26T07:06:06 | 2017-02-26T07:06:06 | 83,189,693 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,105 | java | package com.leagueofshadows.notifyme;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.transition.ChangeBounds;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class Parent extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parent);
//Getting if a user is already logged in
SharedPreferences sp = getSharedPreferences("preferences",Context.MODE_PRIVATE);
String username = sp.getString("current_username",null);
if(username==null)
{
//if not logged in then go to login / register screen
Intent i = new Intent(this,MainActivity.class);
startActivity(i);
finish();
}
else
{
//if logged in then go to Channels
Intent i = new Intent(this,Channel.class);
startActivity(i);
finish();
}
}
}
| [
"adityagannavarapu.67@gmail.com"
] | adityagannavarapu.67@gmail.com |
701e8536ae10b29faeefa9994f0d3a0ec24a0d64 | 8c8ee65d6e0227e943d15abad039998a3fddf72f | /014springboot/src/main/java/com/springboot/first/controller/SpringBootMain.java | ee7120c1a78cbe3ea2b068de41da406b2cd5c872 | [] | no_license | PriyadharshiniRajendran/testrepo | 64159ebcee3e311e2e2637527f90c715e939bb15 | 7d0e7d192e8d41725e987e8fd1eea3636c2c3312 | refs/heads/master | 2021-04-15T04:49:59.185764 | 2018-03-26T04:59:36 | 2018-03-26T04:59:36 | 126,154,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package com.springboot.first.controller;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
SpringApplication.run(SpringBootMain.class, args);
}
}
| [
"672065@cognizant.com"
] | 672065@cognizant.com |
fe96229dd5a668b5363f9b95cc641064cd21238b | cb91e6f8c31eb6d900a516a72b7042416f98ddce | /Vodka/src/Drinks/Beer.java | d377f6ceb107443030cd25c2d7f0ad122bbcc426 | [] | no_license | purtata/sdaschool | cd52d44b951896000a9255ced26225de6a8a271b | ed198146b09f2a59418c0d8c409e0d5f6bd974c2 | refs/heads/master | 2021-01-13T07:06:25.773175 | 2017-03-09T11:37:47 | 2017-03-09T11:37:47 | 81,819,934 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 680 | java | package Drinks;
public class Beer extends Drink {
private double Cup=500;
Beer(String name, int price, double cap) {
super(name, price, cap);
}
static int nrGlass=0;
public void fillGlass(){
if (goForNewOne()) System.out.println("Piwko puste! Wracamy do menu!");
else{
if (getRest()<Cup) Cup=getRest();
nrGlass++;
System.out.println("Kufel nr "+nrGlass+" nalany!");
setRest(getRest() - Cup);
System.out.println("Zostało w butelce: "+getRest()+" ml");
}
}
public String toString(){
return "Piwko: "+getName()+", Cena: "+getPrice()+"zł, pojemność butelki: "+getCap()+" ml, zostało nam: "+getRest()+" ml, nr pozycji: "+getNr();
}
}
| [
"purtata@poczta.fm"
] | purtata@poczta.fm |
fd70bd40264419e682d8e3f55b1acd042e5009b3 | 7420bf77eebed790cd53dea2683fd43a36057ec3 | /test/src/com/xiaoqian/cn/costomer.java | 0c580deca760dcdeffa6b9dada02743c8a413219 | [
"MIT"
] | permissive | SaraCXQ/repo | 06b5f18837475f91b5bd41ae6973d795675b1333 | bfc0d94f0e91e13c8abedcd477d09dec89c58090 | refs/heads/master | 2021-01-09T20:33:36.626587 | 2016-07-14T15:58:26 | 2016-07-14T15:58:26 | 63,342,802 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 863 | java | package com.xiaoqian.cn;
public class costomer {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Custome custome1 = new Custome();
Thread thread1 = new Thread(custome1,"线程1");
Thread thread2 = new Thread(custome1,"线程2");
thread1.start();
thread2.start();
}
}
class Custome implements Runnable{
public static int number_goods = 10;
public void put()
{
number_goods++;
}
public void get()
{
number_goods--;
}
public void run()
{
synchronized(this)
{
while(true)
{
if(number_goods > 0)
{
get();
System.out.printf("%s线程在get商品%d\n", Thread.currentThread().getName(),number_goods);
}else{
put();
System.out.printf("%s线程在put商品%d\n", Thread.currentThread().getName(),number_goods);
}
}
}
}
} | [
"saracxq0104@gmail.com"
] | saracxq0104@gmail.com |
2e2ea0f2517f07633f5f9f9724c353aa8585bbbe | c3b1e184546c51780a4dd57a95514e4d3c173103 | /com/google/firebase/messaging/zza.java | eb83a5ce92148b68c517fa99d48acf0ad408b94a | [] | no_license | thebhaiwas/NITPatna1 | d3ccfc8a74c96edf0ae639b188be9485da976478 | 7c1a85676f00a99fdec9b8012a10b90901ae89ab | refs/heads/master | 2021-01-11T03:22:19.316235 | 2016-10-16T08:58:44 | 2016-10-16T08:58:44 | 71,039,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,612 | java | package com.google.firebase.messaging;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.app.KeyguardManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Process;
import android.os.SystemClock;
import android.support.v4.app.NotificationCompat.Builder;
import android.text.TextUtils;
import android.util.Log;
import com.google.firebase.iid.FirebaseInstanceIdInternalReceiver;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONArray;
import org.json.JSONException;
class zza {
static zza baX;
private final Context mContext;
private final AtomicInteger zzbeu;
private zza(Context context) {
this.zzbeu = new AtomicInteger((int) SystemClock.elapsedRealtime());
this.mContext = context.getApplicationContext();
}
private PendingIntent zza(Bundle bundle, PendingIntent pendingIntent) {
Intent intent = new Intent("com.google.firebase.messaging.NOTIFICATION_OPEN");
zza(intent, bundle);
intent.putExtra("pending_intent", pendingIntent);
return PendingIntent.getBroadcast(this.mContext, zzbmd(), FirebaseInstanceIdInternalReceiver.zzi(this.mContext, intent), 1073741824);
}
private void zza(Intent intent, Bundle bundle) {
for (String str : bundle.keySet()) {
if (str.startsWith("google.c.a.") || str.equals("from")) {
intent.putExtra(str, bundle.getString(str));
}
}
}
private void zza(String str, Notification notification) {
if (Log.isLoggable("FirebaseMessaging", 3)) {
Log.d("FirebaseMessaging", "Showing notification");
}
NotificationManager notificationManager = (NotificationManager) this.mContext.getSystemService("notification");
if (TextUtils.isEmpty(str)) {
str = "GCM-Notification:" + SystemClock.uptimeMillis();
}
notificationManager.notify(str, 0, notification);
}
static boolean zzac(Bundle bundle) {
return "1".equals(zzf(bundle, "gcm.n.e")) || zzf(bundle, "gcm.n.icon") != null;
}
private Notification zzaf(Bundle bundle) {
CharSequence zzg = zzg(bundle, "gcm.n.title");
CharSequence zzg2 = zzg(bundle, "gcm.n.body");
int zzkb = zzkb(zzf(bundle, "gcm.n.icon"));
Object zzf = zzf(bundle, "gcm.n.color");
Uri zzkc = zzkc(zzat(bundle));
PendingIntent zzag = zzag(bundle);
PendingIntent pendingIntent = null;
if (FirebaseMessagingService.zzav(bundle)) {
zzag = zza(bundle, zzag);
pendingIntent = zzau(bundle);
}
Builder smallIcon = new Builder(this.mContext).setAutoCancel(true).setSmallIcon(zzkb);
if (TextUtils.isEmpty(zzg)) {
smallIcon.setContentTitle(this.mContext.getApplicationInfo().loadLabel(this.mContext.getPackageManager()));
} else {
smallIcon.setContentTitle(zzg);
}
if (!TextUtils.isEmpty(zzg2)) {
smallIcon.setContentText(zzg2);
}
if (!TextUtils.isEmpty(zzf)) {
smallIcon.setColor(Color.parseColor(zzf));
}
if (zzkc != null) {
smallIcon.setSound(zzkc);
}
if (zzag != null) {
smallIcon.setContentIntent(zzag);
}
if (pendingIntent != null) {
smallIcon.setDeleteIntent(pendingIntent);
}
return smallIcon.build();
}
private PendingIntent zzag(Bundle bundle) {
Intent intent;
Object zzf = zzf(bundle, "gcm.n.click_action");
Intent launchIntentForPackage;
if (TextUtils.isEmpty(zzf)) {
launchIntentForPackage = this.mContext.getPackageManager().getLaunchIntentForPackage(this.mContext.getPackageName());
if (launchIntentForPackage == null) {
Log.w("FirebaseMessaging", "No activity found to launch app");
return null;
}
intent = launchIntentForPackage;
} else {
launchIntentForPackage = new Intent(zzf);
launchIntentForPackage.setPackage(this.mContext.getPackageName());
launchIntentForPackage.setFlags(268435456);
intent = launchIntentForPackage;
}
Bundle bundle2 = new Bundle(bundle);
FirebaseMessagingService.zzab(bundle2);
intent.putExtras(bundle2);
for (String str : bundle2.keySet()) {
if (str.startsWith("gcm.n.") || str.startsWith("gcm.notification.")) {
intent.removeExtra(str);
}
}
return PendingIntent.getActivity(this.mContext, zzbmd(), intent, 1073741824);
}
static String zzat(Bundle bundle) {
Object zzf = zzf(bundle, "gcm.n.sound2");
return TextUtils.isEmpty(zzf) ? zzf(bundle, "gcm.n.sound") : zzf;
}
private PendingIntent zzau(Bundle bundle) {
Intent intent = new Intent("com.google.firebase.messaging.NOTIFICATION_DISMISS");
zza(intent, bundle);
return PendingIntent.getBroadcast(this.mContext, zzbmd(), FirebaseInstanceIdInternalReceiver.zzi(this.mContext, intent), 1073741824);
}
private int zzbmd() {
return this.zzbeu.incrementAndGet();
}
static boolean zzdc(Context context) {
if (((KeyguardManager) context.getSystemService("keyguard")).inKeyguardRestrictedInputMode()) {
return false;
}
int myPid = Process.myPid();
List<RunningAppProcessInfo> runningAppProcesses = ((ActivityManager) context.getSystemService("activity")).getRunningAppProcesses();
if (runningAppProcesses == null) {
return false;
}
for (RunningAppProcessInfo runningAppProcessInfo : runningAppProcesses) {
if (runningAppProcessInfo.pid == myPid) {
return runningAppProcessInfo.importance == 100;
}
}
return false;
}
static synchronized zza zzeo(Context context) {
zza com_google_firebase_messaging_zza;
synchronized (zza.class) {
if (baX == null) {
baX = new zza(context);
}
com_google_firebase_messaging_zza = baX;
}
return com_google_firebase_messaging_zza;
}
static String zzf(Bundle bundle, String str) {
String string = bundle.getString(str);
return string == null ? bundle.getString(str.replace("gcm.n.", "gcm.notification.")) : string;
}
private String zzg(Bundle bundle, String str) {
Object zzf = zzf(bundle, str);
if (!TextUtils.isEmpty(zzf)) {
return zzf;
}
String zzh = zzh(bundle, str);
if (TextUtils.isEmpty(zzh)) {
return null;
}
Resources resources = this.mContext.getResources();
int identifier = resources.getIdentifier(zzh, "string", this.mContext.getPackageName());
if (identifier == 0) {
String str2 = "FirebaseMessaging";
String valueOf = String.valueOf(str);
String valueOf2 = String.valueOf("_loc_key");
valueOf2 = String.valueOf(zzka(valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf)));
Log.w(str2, new StringBuilder((String.valueOf(valueOf2).length() + 49) + String.valueOf(zzh).length()).append(valueOf2).append(" resource not found: ").append(zzh).append(" Default value will be used.").toString());
return null;
}
Object[] zzi = zzi(bundle, str);
if (zzi == null) {
return resources.getString(identifier);
}
try {
return resources.getString(identifier, zzi);
} catch (Throwable e) {
valueOf = String.valueOf(Arrays.toString(zzi));
Log.w("FirebaseMessaging", new StringBuilder((String.valueOf(zzh).length() + 58) + String.valueOf(valueOf).length()).append("Missing format argument for ").append(zzh).append(": ").append(valueOf).append(" Default value will be used.").toString(), e);
return null;
}
}
static String zzh(Bundle bundle, String str) {
String valueOf = String.valueOf(str);
String valueOf2 = String.valueOf("_loc_key");
return zzf(bundle, valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf));
}
static Object[] zzi(Bundle bundle, String str) {
String valueOf = String.valueOf(str);
String valueOf2 = String.valueOf("_loc_args");
String zzf = zzf(bundle, valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf));
if (TextUtils.isEmpty(zzf)) {
return null;
}
try {
JSONArray jSONArray = new JSONArray(zzf);
String[] strArr = new String[jSONArray.length()];
for (int i = 0; i < strArr.length; i++) {
strArr[i] = jSONArray.opt(i);
}
return strArr;
} catch (JSONException e) {
valueOf = "FirebaseMessaging";
String valueOf3 = String.valueOf(str);
valueOf2 = String.valueOf("_loc_args");
valueOf2 = String.valueOf(zzka(valueOf2.length() != 0 ? valueOf3.concat(valueOf2) : new String(valueOf3)));
Log.w(valueOf, new StringBuilder((String.valueOf(valueOf2).length() + 41) + String.valueOf(zzf).length()).append("Malformed ").append(valueOf2).append(": ").append(zzf).append(" Default value will be used.").toString());
return null;
}
}
private static String zzka(String str) {
return str.substring("gcm.n.".length());
}
private int zzkb(String str) {
int identifier;
if (!TextUtils.isEmpty(str)) {
Resources resources = this.mContext.getResources();
identifier = resources.getIdentifier(str, "drawable", this.mContext.getPackageName());
if (identifier != 0) {
return identifier;
}
identifier = resources.getIdentifier(str, "mipmap", this.mContext.getPackageName());
if (identifier != 0) {
return identifier;
}
Log.w("FirebaseMessaging", new StringBuilder(String.valueOf(str).length() + 57).append("Icon resource ").append(str).append(" not found. Notification will use app icon.").toString());
}
identifier = this.mContext.getApplicationInfo().icon;
return identifier == 0 ? 17301651 : identifier;
}
private Uri zzkc(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
if ("default".equals(str) || this.mContext.getResources().getIdentifier(str, "raw", this.mContext.getPackageName()) == 0) {
return RingtoneManager.getDefaultUri(2);
}
String valueOf = String.valueOf("android.resource://");
String valueOf2 = String.valueOf(this.mContext.getPackageName());
return Uri.parse(new StringBuilder(((String.valueOf(valueOf).length() + 5) + String.valueOf(valueOf2).length()) + String.valueOf(str).length()).append(valueOf).append(valueOf2).append("/raw/").append(str).toString());
}
void zzas(Bundle bundle) {
zza(zzf(bundle, "gcm.n.tag"), zzaf(bundle));
}
}
| [
"thebhaiwas@gmail.com"
] | thebhaiwas@gmail.com |
090a18fdbae0ccafd9afad1b10b323013847a200 | 9d6ca9d3d1c228ae42e5aa4c1821f66e6632d317 | /app/src/main/java/com/dgcheshang/cheji/netty/po/MsgAll.java | fe690006fb7b6506fd8d73c14a1483bfa25aafea | [] | no_license | linzhibin66/lilunji-master4-wk_face | ff69f8924ddbbd3d7fc5cb3caebba480fd717262 | 9af6003de00a612acf2c4388dc7788895808ce33 | refs/heads/master | 2020-04-27T17:19:27.280497 | 2019-03-08T09:52:27 | 2019-03-08T09:52:27 | 174,511,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package com.dgcheshang.cheji.netty.po;
public class MsgAll implements java.io.Serializable{
/**
* 整体消息解析
*/
private static final long serialVersionUID = 1L;
private String hexString;//待解析的数据
private Header header;//头部信息
private Object Object;//消息体
private String code;//码 0成功 1效验码错误2消息头解析失败3消息体长度跟头部指定长度不符4分包信息
private String errormsg;//附加信息
private String uuid;//通道标志
public String getHexString() {
return hexString;
}
public void setHexString(String hexString) {
this.hexString = hexString;
}
public Header getHeader() {
return header;
}
public void setHeader(Header header) {
this.header = header;
}
public Object getObject() {
return Object;
}
public void setObject(Object object) {
Object = object;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getErrormsg() {
return errormsg;
}
public void setErrormsg(String errormsg) {
this.errormsg = errormsg;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
| [
"878204935@qq.com"
] | 878204935@qq.com |
3fc1af15623a16ffdbd71d9c7e71ab46cce56c54 | 26b7f30c6640b8017a06786e4a2414ad8a4d71dd | /src/number_of_direct_superinterfaces/i28706.java | aef15ef20b9d6e3e1e469bba0cfc531b76951055 | [] | no_license | vincentclee/jvm-limits | b72a2f2dcc18caa458f1e77924221d585f23316b | 2fd1c26d1f7984ea8163bc103ad14b6d72282281 | refs/heads/master | 2020-05-18T11:18:41.711400 | 2014-09-14T04:25:18 | 2014-09-14T04:25:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package number_of_direct_superinterfaces;
public interface i28706 {} | [
"vincentlee.dolbydigital@yahoo.com"
] | vincentlee.dolbydigital@yahoo.com |
92cfa433aa7ca658a17bb11288a7af59c5b488ed | 59083aac612c4e8e51950d00c24953db10d1d272 | /src/main/java/com/grasshopper/ngen/config/AsyncConfiguration.java | 67d02e6412ff8d9aa55c4c50d56d316495b9dbc2 | [] | no_license | BulkSecurityGeneratorProject/ngen | 2489a2b2bb2e03d264c6325f0eab9cf861696fbe | 0ebcee86f97fab422770c18941f0a20ee9e0e472 | refs/heads/master | 2022-12-11T09:05:13.692702 | 2016-04-09T11:16:59 | 2016-04-09T11:16:59 | 296,538,228 | 0 | 0 | null | 2020-09-18T06:51:47 | 2020-09-18T06:51:46 | null | UTF-8 | Java | false | false | 1,628 | java | package com.grasshopper.ngen.config;
import com.grasshopper.ngen.async.ExceptionHandlingAsyncTaskExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.*;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import javax.inject.Inject;
@Configuration
@EnableAsync
@EnableScheduling
public class AsyncConfiguration implements AsyncConfigurer {
private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class);
@Inject
private JHipsterProperties jHipsterProperties;
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("ngen-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new SimpleAsyncUncaughtExceptionHandler();
}
}
| [
"anis.2803@gmail.com"
] | anis.2803@gmail.com |
b7be832bd1fa9020e32aebb6146bb41afab364cf | edc139b0268d5568df88255df03585b5c340b8ca | /projects/org.activebpel.rt.bpel/src/org/activebpel/rt/bpel/def/activity/AeActivitySequenceDef.java | b95b395b4a7cddd0cf065eccd4d627f12c41ad4c | [] | no_license | wangzm05/provenancesys | 61bad1933b2ff5398137fbbeb930a77086e8660b | 031c84095c2a7afc4873bd6ef97012831f88e5a8 | refs/heads/master | 2020-03-27T19:50:15.067788 | 2009-05-08T06:02:31 | 2009-05-08T06:02:31 | 32,144,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,545 | java | // $Header: /Development/AEDevelopment/projects/org.activebpel.rt.bpel/src/org/activebpel/rt/bpel/def/activity/AeActivitySequenceDef.java,v 1.7 2007/09/12 02:48:11 mford Exp $
/////////////////////////////////////////////////////////////////////////////
// PROPRIETARY RIGHTS STATEMENT
// The contents of this file represent confidential information that is the
// proprietary property of Active Endpoints, Inc. Viewing or use of
// this information is prohibited without the express written consent of
// Active Endpoints, Inc. Removal of this PROPRIETARY RIGHTS STATEMENT
// is strictly forbidden. Copyright (c) 2002-2004 All rights reserved.
/////////////////////////////////////////////////////////////////////////////
package org.activebpel.rt.bpel.def.activity;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.activebpel.rt.bpel.def.AeActivityDef;
import org.activebpel.rt.bpel.def.IAeMultipleActivityContainerDef;
import org.activebpel.rt.bpel.def.util.AeDefUtil;
import org.activebpel.rt.bpel.def.visitors.IAeDefVisitor;
/**
* Definition for bpel sequence activity.
*/
public class AeActivitySequenceDef extends AeActivityDef implements IAeMultipleActivityContainerDef
{
// standard elements of the activity definition
private List mActivities = new ArrayList();
/**
* Default constructor
*/
public AeActivitySequenceDef()
{
super();
}
/**
* Adds an activity definition to the list of activities to execute.
*
* @param aActivity activity to be added
*/
public void addActivityDef(AeActivityDef aActivity)
{
mActivities.add(aActivity);
}
/**
* @see org.activebpel.rt.bpel.def.IAeActivityContainerDef#replaceActivityDef(org.activebpel.rt.bpel.def.AeActivityDef, org.activebpel.rt.bpel.def.AeActivityDef)
*/
public void replaceActivityDef(AeActivityDef aOldActivityDef, AeActivityDef aNewActivityDef)
{
AeDefUtil.replaceActivityDef(mActivities, aOldActivityDef, aNewActivityDef);
}
/**
* Returns an iterator of activity definitions to iterate over.
*
* @return iterator over activity list
*/
public Iterator getActivityDefs()
{
return mActivities.iterator();
}
/**
* @see org.activebpel.rt.bpel.def.AeActivityDef#accept(org.activebpel.rt.bpel.def.visitors.IAeDefVisitor)
*/
public void accept(IAeDefVisitor aVisitor)
{
aVisitor.visit(this);
}
}
| [
"wangzm05@ca528a1e-3b83-11de-a81c-fde7d73ceb89"
] | wangzm05@ca528a1e-3b83-11de-a81c-fde7d73ceb89 |
726b7d8f3a3ed5583c50f659aab397bc8769c7da | ae9f48632704fe79a67433b5bd32f6dad4aa2330 | /src/cn/sharesdk/onekeyshare/PlatformGridView.java | 8fdb0e941fe1dec6d6064680d0ee22e8d5e1b91f | [
"Apache-2.0"
] | permissive | arventwei/HeatController | a40e6c6a1138a8389a14556b8e15df2ddb96e7ac | 6434df1f47af003f78320a0d2f3ba131a6138f99 | refs/heads/master | 2021-01-01T16:34:44.957697 | 2014-03-15T16:02:32 | 2014-03-15T16:02:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,883 | java | /*
* 瀹樼綉鍦扮珯:http://www.ShareSDK.cn
* 鎶�湳鏀寔QQ: 4006852216
* 瀹樻柟寰俊:ShareSDK 锛堝鏋滃彂甯冩柊鐗堟湰鐨勮瘽锛屾垜浠皢浼氱涓�椂闂撮�杩囧井淇″皢鐗堟湰鏇存柊鍐呭鎺ㄩ�缁欐偍銆傚鏋滀娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝涔熷彲浠ラ�杩囧井淇′笌鎴戜滑鍙栧緱鑱旂郴锛屾垜浠皢浼氬湪24灏忔椂鍐呯粰浜堝洖澶嶏級
*
* Copyright (c) 2013骞�ShareSDK.cn. All rights reserved.
*/
package cn.sharesdk.onekeyshare;
import com.txmcu.heatcontroller.R;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Handler.Callback;
import android.os.Message;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.TextView;
import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.framework.utils.UIHandler;
/**
* 骞冲彴瀹牸鍒楄〃鏄剧ず宸ュ叿銆� * <p>
* PlatformGridView瀵光�android.support鈥濆寘鏈変緷璧栵紝鍥犳璇锋敞鎰忔鏌ユ偍椤圭洰涓槸
*鍚﹀凡缁忛泦鎴愪簡鐩稿簲鐨刯ar鍖� */
public class PlatformGridView extends LinearLayout implements
OnPageChangeListener, OnClickListener, Callback {
private static final int MSG_PLATFORM_LIST_GOT = 1;
// 姣忛〉鏄剧ず9鏍�
private static final int PAGE_SIZE = 9;
// 瀹牸瀹瑰櫒
private ViewPager pager;
// 椤甸潰鎸囩ず鍣�
private ImageView[] points;
private Bitmap grayPoint;
private Bitmap whitePoint;
// 鏄惁涓嶈烦杞珽ditPage鑰岀洿鎺ュ垎浜�
private boolean silent;
// 骞冲彴鏁版嵁
private Platform[] platformList;
// 浠庡閮ㄤ紶杩涙潵鐨勫垎浜暟鎹紙鍚垵濮嬪寲鏁版嵁锛�
private HashMap<String, Object> reqData;
private OnekeyShare parent;
private ArrayList<CustomerLogo> customers;
public PlatformGridView(Context context) {
super(context);
init(context);
}
public PlatformGridView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
private void init(final Context context) {
setOrientation(VERTICAL);
int dp_10 = cn.sharesdk.framework.utils.R.dipToPx(context, 10);
setPadding(dp_10, dp_10, dp_10, dp_10);
pager = new ViewPager(context);
disableOverScrollMode(pager);
pager.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 1));
pager.setOnPageChangeListener(this);
addView(pager);
// 涓轰簡鏇村ソ鐨剈i鏁堟灉锛屽紑鍚瓙绾跨▼鑾峰彇骞冲彴鍒楄〃
new Thread(){
public void run() {
platformList = ShareSDK.getPlatformList(context);
UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
}
}.start();
}
public boolean handleMessage(Message msg) {
switch (msg.what) {
case MSG_PLATFORM_LIST_GOT: {
afterPlatformListGot();
}
break;
}
return false;
}
/** 鍒濆鍖栧鏍煎垪琛╱i */
public void afterPlatformListGot() {
Context context = getContext();
// 涓轰簡鏇村ソ鐨剈i鏁堟灉锛屽紑鍚瓙绾跨▼鑾峰彇骞冲彴鍒楄〃
int cusSize = customers == null ? 0 : customers.size();
int platSize = platformList == null ? 0 : platformList.length;
int pageSize = (platSize + cusSize) > PAGE_SIZE
? PAGE_SIZE : (platSize + cusSize);
int lines = pageSize / 3;
if (pageSize % 3 > 0) {
lines++;
}
ViewGroup.LayoutParams lp = pager.getLayoutParams();
int dp_10 = cn.sharesdk.framework.utils.R.dipToPx(context, 10);
int scrW = getResources().getDisplayMetrics().widthPixels;
lp.height = (scrW - dp_10 * 2) * lines / 3;
pager.setLayoutParams(lp);
PlatformAdapter adapter = new PlatformAdapter(platformList, customers, this);
pager.setAdapter(adapter);
int pageCount = 0;
if (platformList != null) {
int size = platSize + cusSize;
pageCount = size / PAGE_SIZE;
if (size % PAGE_SIZE > 0) {
pageCount++;
}
}
points = new ImageView[pageCount];
if (points.length <= 0) {
return;
}
LinearLayout llPoints = new LinearLayout(context);
// 濡傛灉椤甸潰鎬绘槸瓒呰繃1锛屽垯璁剧疆椤甸潰鎸囩ず鍣�
llPoints.setVisibility(pageCount > 1 ? View.VISIBLE: View.GONE);
LayoutParams lpLl = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpLl.gravity = Gravity.CENTER_HORIZONTAL;
llPoints.setLayoutParams(lpLl);
addView(llPoints);
int dp_5 = cn.sharesdk.framework.utils.R.dipToPx(context, 5);
grayPoint = BitmapFactory.decodeResource(getResources(), R.drawable.gray_point);
whitePoint = BitmapFactory.decodeResource(getResources(), R.drawable.white_point);
for (int i = 0; i < pageCount; i++) {
points[i] = new ImageView(context);
points[i].setScaleType(ScaleType.CENTER_INSIDE);
points[i].setImageBitmap(grayPoint);
LayoutParams lpIv = new LayoutParams(dp_5, dp_5);
lpIv.setMargins(dp_5, dp_5, dp_5, 0);
points[i].setLayoutParams(lpIv);
llPoints.addView(points[i]);
}
int curPage = pager.getCurrentItem();
points[curPage].setImageBitmap(whitePoint);
}
public void onPageScrollStateChanged(int state) {
if (ViewPager.SCROLL_STATE_IDLE == state) {
for (int i = 0; i < points.length; i++) {
points[i].setImageBitmap(grayPoint);
}
int curPage = pager.getCurrentItem();
points[curPage].setImageBitmap(whitePoint);
}
}
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
public void onPageSelected(int position) {
}
/**
* 璁剧疆椤甸潰鍒濆鍖栧拰鍒嗕韩鎿嶄綔闇�鐨勬暟鎹� * <p>
* 姝ゆ柟娉曞湪{@link OnekeyShare}鐨刄I鍒濆鍖栦腑琚皟鐢� *
* @param intent 鎼哄甫鍒濆鍖栨暟鎹殑Intent
*/
public void setData(HashMap<String, Object> data, boolean silent) {
reqData = data;
this.silent = silent;
}
/** 璁剧疆鑷繁鍥炬爣鍜岀偣鍑讳簨浠�*/
public void setCustomerLogos(ArrayList<CustomerLogo> customers) {
this.customers = customers;
}
/** 璁剧疆鍒嗕韩鎿嶄綔鐨勫洖璋冮〉闈�*/
public void setParent(OnekeyShare parent) {
this.parent = parent;
}
public void onClick(View v) {
Platform plat = (Platform) v.getTag();
if (plat != null) {
if (silent) {
HashMap<Platform, HashMap<String, Object>> shareData
= new HashMap<Platform, HashMap<String,Object>>();
shareData.put(plat, reqData);
parent.share(shareData);
return;
}
String name = plat.getName();
parent.setPlatform(name);
// EditPage涓嶆敮鎸佸井淇″钩鍙般�Google+銆丵Q鍒嗕韩銆丳interest銆佷俊鎭拰閭欢锛屾�鏄墽琛岀洿鎺ュ垎浜�
if (ShareCore.isUseClientToShare(name)
|| ("Evernote".equals(name) && !plat.isSSODisable())) {
HashMap<Platform, HashMap<String, Object>> shareData
= new HashMap<Platform, HashMap<String,Object>>();
shareData.put(plat, reqData);
parent.share(shareData);
return;
}
// 璺宠浆EditPage鍒嗕韩
EditPage page = new EditPage();
page.setShareData(reqData);
page.setParent(parent);
if ("true".equals(String.valueOf(reqData.get("dialogMode")))) {
page.setDialogMode();
}
page.show(parent.getContext(), null);
parent.finish();
}
}
// 绂佺敤ViewPage OverScroll鐨勨�鍙戝厜鈥濇晥鏋�
private void disableOverScrollMode(View view) {
if (Build.VERSION.SDK_INT < 9) {
return;
}
try {
Method m = View.class.getMethod("setOverScrollMode",
new Class[] { Integer.TYPE });
m.setAccessible(true);
m.invoke(view, new Object[] { Integer.valueOf(2) });
} catch (Throwable t) {
t.printStackTrace();
}
}
/** 瀹牸鍒楄〃鏁版嵁閫傞厤鍣�*/
private static class PlatformAdapter extends PagerAdapter {
// 瀹牸鍒楄〃鍏冪礌
private GridView[] girds;
private List<Object> logos;
private OnClickListener callback;
// 琛屾暟
private int lines;
public PlatformAdapter(Platform[] platforms, ArrayList<CustomerLogo> customers,
OnClickListener callback) {
logos = new ArrayList<Object>();
if (platforms != null) {
logos.addAll(Arrays.asList(platforms));
}
if (customers != null) {
logos.addAll(customers);
}
this.callback = callback;
girds = null;
if (logos != null) {
int size = logos.size();
int pageCount = size / PAGE_SIZE;
if (size % PAGE_SIZE > 0) {
pageCount++;
}
girds = new GridView[pageCount];
}
}
public int getCount() {
return girds == null ? 0 : girds.length;
}
public boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
public Object instantiateItem(ViewGroup container, int position) {
if (girds[position] == null) {
int pageSize = PAGE_SIZE;
int curSize = pageSize * position;
int listSize = logos == null ? 0 : logos.size();
if (curSize + pageSize > listSize) {
pageSize = listSize - curSize;
}
Object[] gridBean = new Object[pageSize];
for (int i = 0; i < pageSize; i++) {
gridBean[i] = logos.get(curSize + i);
}
if (position == 0) {
lines = gridBean.length / 3;
if (gridBean.length % 3 > 0) {
lines++;
}
}
girds[position] = new GridView(container.getContext(), callback);
girds[position].setData(lines, gridBean);
}
container.addView(girds[position]);
return girds[position];
}
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
}
/** 绠�槗鐨勫鏍煎垪琛ㄦ帶浠�*/
private static class GridView extends LinearLayout {
private Object[] beans;
private OnClickListener callback;
private int lines;
// 鏍煎瓙瀹藉害
private int iconWidth;
public GridView(Context context, OnClickListener callback) {
super(context);
this.callback = callback;
}
public void setData(int lines, Object[] beans) {
this.lines = lines;
this.beans = beans;
init();
}
private void init() {
int dp_10 = cn.sharesdk.framework.utils.R.dipToPx(getContext(), 10);
int scrW = getResources().getDisplayMetrics().widthPixels;
iconWidth = (scrW - dp_10 * 2) / 3 - dp_10 * 4;
setOrientation(VERTICAL);
int size = beans == null ? 0 : beans.length;
int lineSize = size / 3;
if (size % 3 > 0) {
lineSize++;
}
LayoutParams lp = new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
lp.weight = 1;
for (int i = 0; i < lines; i++) {
LinearLayout llLine = new LinearLayout(getContext());
llLine.setLayoutParams(lp);
addView(llLine);
if (i >= lineSize) {
continue;
}
for (int j = 0; j < 3; j++) {
final int index = i * 3 + j;
if (index >= size) {
LinearLayout llItem = new LinearLayout(getContext());
llItem.setLayoutParams(lp);
llLine.addView(llItem);
continue;
}
final LinearLayout llItem = getView(index, callback, getContext());
llItem.setTag(beans[index]);
llItem.setLayoutParams(lp);
llLine.addView(llItem);
}
}
}
private LinearLayout getView(int position, OnClickListener ocL, Context context) {
Bitmap logo;
String label;
OnClickListener listener;
if (beans[position] instanceof Platform) {
logo = getIcon((Platform) beans[position]);
label = getName((Platform) beans[position]);
listener = ocL;
}
else {
logo = ((CustomerLogo) beans[position]).logo;
label = ((CustomerLogo) beans[position]).label;
listener = ((CustomerLogo) beans[position]).listener;
}
LinearLayout ll = new LinearLayout(context);
ll.setOrientation(LinearLayout.VERTICAL);
int dp_5 = cn.sharesdk.framework.utils.R.dipToPx(context, 5);
ll.setPadding(dp_5, dp_5, dp_5, dp_5);
ImageView iv = new ImageView(context);
iv.setScaleType(ScaleType.CENTER_INSIDE);
LinearLayout.LayoutParams lpIv = new LinearLayout.LayoutParams(
iconWidth, iconWidth);
lpIv.gravity = Gravity.CENTER_HORIZONTAL;
iv.setLayoutParams(lpIv);
iv.setImageBitmap(logo);
ll.addView(iv);
TextView tv = new TextView(context);
tv.setTextColor(0xffffffff);
tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
tv.setSingleLine();
tv.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP);
LinearLayout.LayoutParams lpTv = new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
lpTv.weight = 1;
tv.setLayoutParams(lpTv);
tv.setText(label);
ll.addView(tv);
ll.setOnClickListener(listener);
return ll;
}
private Bitmap getIcon(Platform plat) {
if (plat == null) {
return null;
}
String name = plat.getName();
if (name == null) {
return null;
}
String resName = "logo_" + plat.getName();
int resId = cn.sharesdk.framework.utils.R.getResId(R.drawable.class, resName);
return BitmapFactory.decodeResource(getResources(), resId);
}
private String getName(Platform plat) {
if (plat == null) {
return "";
}
String name = plat.getName();
if (name == null) {
return "";
}
int resId = cn.sharesdk.framework.utils.R.getStringRes(getContext(), plat.getName());
return getContext().getString(resId);
}
}
}
| [
"arventwei@163.com"
] | arventwei@163.com |
6c7059c40d6968b4f600ae5885bff76b0beb945c | 044c902a419760e29255b1104b65d50e7627c15e | /src/main/java/com/ajo/asapp/repos/AbstractIdDaoMySQL.java | d9295c2e16ae37e39d5385f170753eeb20f0f061 | [] | no_license | goodtimefamilyband/chat-sample | e35fe35dca72bbb9b80c081e93e7c0f6f0f11064 | 9aa4af40aaee4fae3c7a68f98347efffbed29a16 | refs/heads/master | 2021-01-19T21:02:46.207461 | 2017-04-18T16:10:14 | 2017-04-18T16:10:14 | 88,596,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,564 | java | package com.ajo.asapp.repos;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.stereotype.Repository;
import com.ajo.asapp.entities.AbstractIdItem;
@Repository
public abstract class AbstractIdDaoMySQL<ObjType extends AbstractIdItem<IdType>, IdType> implements AbstractIdDao<ObjType, IdType> {
public static final String OBJ_FOR_ID_SQL =
"SELECT * FROM :tbl WHERE :id_col = ?";
public static final String COUNT_SQL =
"SELECT COUNT(:id_col) AS c FROM :tbl";
public static final String ALL_OBJ_SQL = "SELECT * FROM :tbl";
protected String obj_for_id_sql;
protected String all_obj_sql;
protected String count_sql;
protected JdbcTemplate jdbcTemplate;
protected SimpleJdbcInsert adder;
protected String tbl;
protected String id_col;
public void setDataSource(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.adder = new SimpleJdbcInsert(dataSource)
.withTableName(this.tbl)
.usingGeneratedKeyColumns(this.id_col);
}
protected void buildQueryBases(String tbl, String id_col) {
obj_for_id_sql = OBJ_FOR_ID_SQL
.replace(":tbl", tbl)
.replace(":id_col", id_col);
all_obj_sql = ALL_OBJ_SQL.replace(":tbl", tbl);
count_sql = COUNT_SQL
.replace(":tbl", tbl)
.replace(":id_col", id_col);
}
protected AbstractIdDaoMySQL(String tbl, String id_col) {
this.tbl = tbl;
this.id_col = id_col;
buildQueryBases(tbl, id_col);
}
public ObjType getForId(IdType id, RowMapper<ObjType> mapper) {
List<ObjType> objList = this.jdbcTemplate.query(obj_for_id_sql, new Object[]{id}, mapper);
if(objList.size() == 0) {
return null;
}
return objList.get(0);
}
public List<ObjType> getAll(RowMapper<ObjType> rm) {
return this.jdbcTemplate.query(this.all_obj_sql, rm);
}
public int getCount() {
List<Integer> count = this.jdbcTemplate.query(this.count_sql, new CountMapper());
return count.get(0);
}
public class CountMapper implements RowMapper<Integer> {
@Override
public Integer mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getInt("c");
}
}
}
| [
"ajo0131@gmail.com"
] | ajo0131@gmail.com |
63f1acf7a5f1b73998141ef97a30089d11054779 | 5d992adb96991fad01ba3788c73d8561ee3918e5 | /survey/src/main/java/com/mum/groupproject/survey/utility/Test.java | 1d048f191b7596969af886fd3cc38d804319c6c4 | [] | no_license | AbduEndrisM/survey-management-system | b23d808141812eccadfdde453a5634f7799ec1af | 0744c711c743879c5148512ccf426ac7c14d1a3b | refs/heads/master | 2020-04-25T19:07:42.700345 | 2019-03-13T05:05:37 | 2019-03-13T05:05:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 697 | java | package com.mum.groupproject.survey.utility;
public class Test {
private String name;
private String description;
private String openDate;
private String endDate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getOpenDate() {
return openDate;
}
public void setOpenDate(String openDate) {
this.openDate = openDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
}
| [
"iradukundajado@10.10.64.41"
] | iradukundajado@10.10.64.41 |
bcf9b41c507ea39df843f7b4ad25d3d69f0dc8e2 | d3be2e879a38329ec7c8665d1abb78fd24847180 | /DoctusBackend/src/co/edu/udea/ingenieriaweb/xsoftbackend/exception/LogicException.java | ddae6073a29ef2543d165955e0660c40d77100b0 | [] | no_license | lianesten/Doctus | 33e68fbf71edea79e1d3e45af95535b06b1798c6 | e4675bea4d21515d6c9557e5d14b118c0035c9d3 | refs/heads/master | 2021-01-10T08:39:01.226594 | 2015-12-14T19:06:29 | 2015-12-14T19:06:29 | 47,994,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 722 | java | package co.edu.udea.ingenieriaweb.xsoftbackend.exception;
/**
* Clase que permite controlar las excepciones de datos faltantes producidas por el Usuario
* @author JoaquinD
*
*/
/**
* Clase realizada para controlor los errores presentados por la falta de informacion ingresada
* o incompleta, Ejemplo (Fecha en formato erroneo,datos faltantes)
* @author Julianesten
*
*/
public class LogicException extends Exception {
/**
* Constructor que recibe un mesaje y lo tira hacia la logica del negocio
* @param mensaje
*/
public LogicException(String mensaje) {
super(mensaje);
}
/**
*
* @param e
* @param mensaje
*/
public LogicException(Exception e, String mensaje) {
super(mensaje);
}
}
| [
"julianesten@gmail.com"
] | julianesten@gmail.com |
bf70be17a0bac96c6417283835c6256c6e6d457d | bd8e44a913871ed394b9b39ffdd165e6fd1bc2c2 | /src/javaapplication3/Overloadmain.java | 2a0a0fd6b828c479d71b18bb53d8ed8dd022acd8 | [] | no_license | Priya-bharambe/Java-Programs | 8f4bf78b0e381461d4437f5aa1347e348db1ac3b | 2c6b60a3cbc0910d52bef2b90b176eb7ba1b422a | refs/heads/master | 2023-04-04T17:36:48.499277 | 2021-04-20T16:15:27 | 2021-04-20T16:15:27 | 359,878,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package javaapplication3;
public class Overloadmain {
public static void main(String[] args) {
System.out.println("main with String[]");
}
public static void main(String args) {
System.out.println("main with String");
}
public static void main() {
System.out.println("main without args");
}
}
| [
"pryabharambe70@gmail.com"
] | pryabharambe70@gmail.com |
d42c3a2aabc57e4c28b499ae730cac82d1f9fbcc | 7e0f6577e690ab0d3f8d25cd5dc260f0c194582c | /src/com/javarush/test/level08/lesson03/task04/Solution.java | 06b70eb1246fe75ead3f5b43785371775c1d5dfe | [] | no_license | DarkRav/javarush | 05b66ea458a7655a80104e8d434fef1fd149e259 | 5a8c649c6271c62e05b6a7f2b9d03fb6da4bfad5 | refs/heads/master | 2021-01-10T18:24:10.775500 | 2015-07-19T08:23:21 | 2015-07-19T08:23:21 | 39,327,055 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package com.javarush.test.level08.lesson03.task04;
import java.util.HashMap;
import java.util.Map;
/* Вывести на экран список ключей
Есть коллекция HashMap<String, String>, туда занесли 10 различных строк. Вывести на экран список ключей, каждый элемент с новой строки.
*/
public class Solution
{
public static void main(String[] args) throws Exception
{
HashMap<String, String> map = new HashMap<String, String>();
map.put("Sim", "Sim");
map.put("Tom", "Tom");
map.put("Arbus", "Arbus");
map.put("Baby", "Baby");
map.put("Cat", "Cat");
map.put("Dog", "Dog");
map.put("Eat", "Eat");
map.put("Food", "Food");
map.put("Gevey", "Gevey");
map.put("Hugs", "Hugs");
printKeys(map);
}
public static void printKeys(Map<String, String> map)
{
for( Map.Entry<String, String> i : map.entrySet())
{
System.out.println(i.getKey());
}
}
}
| [
"rav447@mail.ru"
] | rav447@mail.ru |
86fd7bd299dc0f236d323d14495b773d2d0bbf24 | 2b77fde8ae1132ee45f50199b7069fbc0c5051c0 | /src/main/java/com/psqframework/core/util/Project.java | 642a03ecdcf98919414d622fb3bd523d1c45abf8 | [] | no_license | sudhakarkoonimbedu/RxNova_Conditions | a1bbb7b9df99f4be3c73a7ebc5ae961e9c9c64a3 | 630ed739f44f87a5d66eb7d5341155628f7fba94 | refs/heads/master | 2022-07-10T14:52:05.900937 | 2020-03-09T09:50:08 | 2020-03-09T09:50:08 | 245,997,010 | 0 | 0 | null | 2022-06-29T18:58:58 | 2020-03-09T09:44:58 | Java | UTF-8 | Java | false | false | 1,043 | java | package com.psqframework.core.util;
import org.aeonbits.owner.ConfigFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Project {
public static String ENV_SYSTEM_PROP = "ENV_INSTANCE";
public static String DEFAULT_ENV = "QA";
public static final Logger Log = LoggerFactory.getLogger(Project.class);
public static EnvConfig Env = ConfigFactory.create(EnvConfig.class);
static {
if (System.getProperty(ENV_SYSTEM_PROP) == null)
{
Log.warn("System property for execution enviornment configiration (" +ENV_SYSTEM_PROP + ") not set, using default of " + DEFAULT_ENV);
System.setProperty(ENV_SYSTEM_PROP, DEFAULT_ENV);
Env = ConfigFactory.create(EnvConfig.class);
}
}
public static void beforeStep() {
Log.info("before step");
}
public static void afterStep() {
Log.info("after step");
}
public static void beforeTest() {
Log.info("before test");
}
public static void afterTest() {
Log.info("after test");
Verify.pushSoftAssertions(); //just in cases
}
}
| [
"dt204684@HDDT0129.ad.dstsystems.com"
] | dt204684@HDDT0129.ad.dstsystems.com |
7dfe7258aa0213462043e5e0768ff9ef050f511f | 16b170f6ff0e919217ef8277cbd77f39f3509b73 | /src/main/java/com/epam/model/Student.java | 3e52a250744ac058ed9de55a84524e5879d6b6c8 | [] | no_license | Yevseyenko/HW13Yevseyenko | d807e6fcea0d6787747f6c6f6e29109d7de2ed78 | 8b57b16064297f2ba0efa29377e8cea030880cf7 | refs/heads/master | 2020-03-23T15:02:23.324515 | 2018-07-23T15:27:33 | 2018-07-23T15:27:33 | 141,716,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,097 | java | package com.epam.model;
import com.epam.annotations.Field;
import static com.epam.annotations.Operations.GET;
import static com.epam.annotations.Operations.SET;
public class Student {
private Integer Code_stud;
private String Student_middlename;
private String Student_name;
private String Student_surname;
public Student() {
}
public Student(Integer Code_stud, String Student_name,
String Student_surname, String Student_middlename) {
this.Code_stud = Code_stud;
this.Student_name = Student_name;
this.Student_surname = Student_surname;
this.Student_middlename = Student_middlename;
}
@Field(fieldName = "Code_stud", type = GET)
public Integer getCode_stud() {
return Code_stud;
}
@Field(fieldName = "Student_name", type = GET)
public String getStudent_name() {
return Student_name;
}
@Field(fieldName = "Student_middlename", type = GET)
public String getStudent_middlename() {
return Student_middlename;
}
@Field(fieldName = "Student_surname", type = GET)
public String getStudent_surname() {
return Student_surname;
}
@Field(fieldName = "Code_stud", type = SET)
public void setCode_stud(Integer Code_stud) {
this.Code_stud = Code_stud;
}
@Field(fieldName = "Student_name", type = SET)
public void setStudent_name(String Student_name) {
this.Student_name = Student_name;
}
@Field(fieldName = "Student_middlename", type = SET)
public void setStudent_middlename(String Student_middlename) {
this.Student_middlename = Student_middlename;
}
@Field(fieldName = "Student_surname", type = SET)
public void setStudent_surname(String Student_surname) {
this.Student_surname = Student_surname;
}
@Override
public String toString() {
return "Student [Code_stud= " + Code_stud + ", Student_name= " + Student_name +
", Student_middlename= " + Student_middlename + ", Student_surname= " + Student_surname + "]";
}
}
| [
"jevsejen@gmail.com"
] | jevsejen@gmail.com |
6dc25902e9cecc3453eb27b8ae7828f38040b402 | 967ddef39889371f1e43b8f321d07021d25b2b8a | /common/src/main/java/com/hubertyoung/common/utils/NetworkUtil.java | 9b5222bc014963357cabfc3457afa055b5603409 | [] | no_license | verylove/Litemall-Android | 6a458566dd1f9f312e601a2896d91bd9eaaf5054 | 254fa43b91fad4ff58ea99d1976f27f73ccc8632 | refs/heads/master | 2020-03-27T21:37:58.164981 | 2018-09-03T06:38:36 | 2018-09-03T06:38:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,846 | java | package com.hubertyoung.common.utils;
import android.content.Context;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
public class NetworkUtil {
public static final String TAG = "NetworkUtil";
public static final byte CURRENT_NETWORK_TYPE_NONE = 0;
/*
* 根据APN区分网络类型
*/
public static final byte CURRENT_NETWORK_TYPE_WIFI = 1;// wifi
public static final byte CURRENT_NETWORK_TYPE_CTNET = 2;// ctnet
public static final byte CURRENT_NETWORK_TYPE_CTWAP = 3;// ctwap
public static final byte CURRENT_NETWORK_TYPE_CMWAP = 4;// cmwap
public static final byte CURRENT_NETWORK_TYPE_UNIWAP = 5;// uniwap,3gwap
public static final byte CURRENT_NETWORK_TYPE_CMNET = 6;// cmnet
public static final byte CURRENT_NETWORK_TYPE_UNIET = 7;// uninet,3gnet
/**
* 根据运营商区分网络类型
*/
public static final byte CURRENT_NETWORK_TYPE_CTC = 10;// ctwap,ctnet
public static final byte CURRENT_NETWORK_TYPE_CUC = 11;// uniwap,3gwap,uninet,3gnet
public static final byte CURRENT_NETWORK_TYPE_CM = 12;// cmwap,cmnet
/**
* apn值
*/
private static final String CONNECT_TYPE_WIFI = "wifi";
private static final String CONNECT_TYPE_CTNET = "ctnet";
private static final String CONNECT_TYPE_CTWAP = "ctwap";
private static final String CONNECT_TYPE_CMNET = "cmnet";
private static final String CONNECT_TYPE_CMWAP = "cmwap";
private static final String CONNECT_TYPE_UNIWAP = "uniwap";
private static final String CONNECT_TYPE_UNINET = "uninet";
private static final String CONNECT_TYPE_UNI3GWAP = "3gwap";
private static final String CONNECT_TYPE_UNI3GNET = "3gnet";
private static final Uri PREFERRED_APN_URI = Uri.parse("content://telephony/carriers/preferapn");
public static byte curNetworkType = CURRENT_NETWORK_TYPE_NONE;
/*
*
* 获取网络类型
*
*/
public static int getNetType(Context context){
NetworkInfo networkInfo = getActiveNetworkInfo(context);
if(networkInfo == null){
return -1;
}else
return networkInfo.getType();
}
/**
* 判断当前网络类型。WIFI,NET,WAP
*
* @param context
* @return
*/
public static byte getCurrentNetType(Context context) {
NetworkInfo networkInfo = getActiveNetworkInfo(context);
byte type = CURRENT_NETWORK_TYPE_NONE;
if (networkInfo != null) {
// String typeName = networkInfo.getTypeName();
// XT800
String typeName = networkInfo.getExtraInfo();
if (TextUtils.isEmpty(typeName)) {
typeName = networkInfo.getTypeName();
}
if (!TextUtils.isEmpty(typeName)) {
String temp = typeName.toLowerCase();
if (temp.indexOf(CONNECT_TYPE_WIFI) > -1) {// wifi
type = CURRENT_NETWORK_TYPE_WIFI;
} else if (temp.indexOf(CONNECT_TYPE_CTNET) > -1) {// ctnet
type = CURRENT_NETWORK_TYPE_CTNET;
} else if (temp.indexOf(CONNECT_TYPE_CTWAP) > -1) {// ctwap
type = CURRENT_NETWORK_TYPE_CTWAP;
} else if (temp.indexOf(CONNECT_TYPE_CMNET) > -1) {// cmnet
type = CURRENT_NETWORK_TYPE_CMNET;
} else if (temp.indexOf(CONNECT_TYPE_CMWAP) > -1) {// cmwap
type = CURRENT_NETWORK_TYPE_CMWAP;
} else if (temp.indexOf(CONNECT_TYPE_UNIWAP) > -1) {// uniwap
type = CURRENT_NETWORK_TYPE_UNIWAP;
} else if (temp.indexOf(CONNECT_TYPE_UNI3GWAP) > -1) {// 3gwap
type = CURRENT_NETWORK_TYPE_UNIWAP;
} else if (temp.indexOf(CONNECT_TYPE_UNINET) > -1) {// uninet
type = CURRENT_NETWORK_TYPE_UNIET;
} else if (temp.indexOf(CONNECT_TYPE_UNI3GNET) > -1) {// 3gnet
type = CURRENT_NETWORK_TYPE_UNIET;
}
}
}
if (type == CURRENT_NETWORK_TYPE_NONE) {
String apnType = getApnType(context);
if (apnType != null && apnType.equals(CONNECT_TYPE_CTNET)) {// ctnet
type = CURRENT_NETWORK_TYPE_CTNET;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_CTWAP)) {// ctwap
type = CURRENT_NETWORK_TYPE_CTWAP;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_CMWAP)) {// cmwap
type = CURRENT_NETWORK_TYPE_CMWAP;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_CMNET)) {// cmnet
type = CURRENT_NETWORK_TYPE_CMNET;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_UNIWAP)) {// uniwap
type = CURRENT_NETWORK_TYPE_UNIWAP;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_UNI3GWAP)) {// 3gwap
type = CURRENT_NETWORK_TYPE_UNIWAP;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_UNINET)) {// uninet
type = CURRENT_NETWORK_TYPE_UNIET;
} else if (apnType != null && apnType.equals(CONNECT_TYPE_UNI3GNET)) {// 3gnet
type = CURRENT_NETWORK_TYPE_UNIET;
}
}
curNetworkType = type;
return type;
}
/**
* 判断APNTYPE
*
* @param context
* @return
*/
/**
* @deprecated 4.0
* doc:
* Since the DB may contain corp passwords, we should secure it. Using the same permission as writing to the DB as the read is potentially as damaging as a write
*/
public static String getApnType(Context context) {
String apntype = "nomatch";
Cursor c = context.getContentResolver().query(PREFERRED_APN_URI, null, null, null, null);
if (c != null) {
if (c.moveToFirst()) {
String user = c.getString(c.getColumnIndex("user"));
if (user != null && user.startsWith(CONNECT_TYPE_CTNET)) {
apntype = CONNECT_TYPE_CTNET;
} else if (user != null && user.startsWith(CONNECT_TYPE_CTWAP)) {
apntype = CONNECT_TYPE_CTWAP;
} else if (user != null && user.startsWith(CONNECT_TYPE_CMWAP)) {
apntype = CONNECT_TYPE_CMWAP;
} else if (user != null && user.startsWith(CONNECT_TYPE_CMNET)) {
apntype = CONNECT_TYPE_CMNET;
} else if (user != null && user.startsWith(CONNECT_TYPE_UNIWAP)) {
apntype = CONNECT_TYPE_UNIWAP;
} else if (user != null && user.startsWith(CONNECT_TYPE_UNINET)) {
apntype = CONNECT_TYPE_UNINET;
} else if (user != null && user.startsWith(CONNECT_TYPE_UNI3GWAP)) {
apntype = CONNECT_TYPE_UNI3GWAP;
} else if (user != null && user.startsWith(CONNECT_TYPE_UNI3GNET)) {
apntype = CONNECT_TYPE_UNI3GNET;
}
}
c.close();
c = null;
}
return apntype;
}
/**
* 判断是否有网络可用
*
* @param context
* @return
*/
public static boolean isNetAvailable(Context context) {
NetworkInfo networkInfo = getActiveNetworkInfo(context);
if (networkInfo != null) {
return networkInfo.isAvailable();
} else {
return false;
}
}
/**
* 此判断不可靠
*
* @param context
* @return
*/
public static boolean isNetworkConnected(Context context) {
NetworkInfo networkInfo = getActiveNetworkInfo(context);
if (networkInfo != null) {
boolean a = networkInfo.isConnected();
return a;
} else {
return false;
}
}
/**
* 获取可用的网络信息
*
* @param context
* @return
*/
private static NetworkInfo getActiveNetworkInfo(Context context) {
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo();
} catch (Exception e) {
return null;
}
}
public static boolean isWifiOr3G(Context context) {
if (isWifi(context)) {
return true;
} else {
return is3G(context);
}
}
public static boolean is2G(Context context) {
return !isWifiOr3G(context);
}
public static boolean is3G(Context context) {
int type = getNetworkClass(context);
if (type == NETWORK_CLASS_3_G || type == NETWORK_CLASS_4_G) {
return true;
} else {
return false;
}
}
/**
* 当前网络是否是wifi网络
*
* @param context
* @return
*/
public static boolean isWifi(Context context) {
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni != null) {
if (ni.getType() == ConnectivityManager.TYPE_WIFI) {
return true;
} else {
return false;
}
} else {
return false;
}
} catch (Exception e) {
return false;
}
}
public static boolean getNetworkConnectionStatus(Context context) {
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (manager == null) {
return false;
}
NetworkInfo info = manager.getActiveNetworkInfo();
if (info == null) {
return false;
}
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (tm == null) {
return false;
}
if ((tm.getDataState() == TelephonyManager.DATA_CONNECTED || tm.getDataState() == TelephonyManager.DATA_ACTIVITY_NONE)
&& info.isAvailable()) {
return true;
} else {
return false;
}
}
public static String getNetworkProxyInfo(Context context) {
String proxyHost = android.net.Proxy.getDefaultHost();
int proxyPort = android.net.Proxy.getDefaultPort();
String szport = String.valueOf(proxyPort);
String proxyInfo = null;
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (manager == null) {
return null;
} else {
NetworkInfo info = manager.getActiveNetworkInfo();
if (info != null) {
String typeName = info.getTypeName().toLowerCase();
if (typeName != null && typeName.equals("wifi")) {
return null;
}
} else {
return null;
}
}
if (proxyHost != null && (0 < proxyPort && proxyPort < 65535)) {
proxyInfo = proxyHost + ":" + szport;
return proxyInfo;
} else {
return null;
}
}
public static String getNetworkProxyUrl(Context context) {
if (isWifi(context)) {
return null;
}
String proxyHost = android.net.Proxy.getDefaultHost();
// LogUtil.e(TAG, "proxyHost:" + proxyHost);
return proxyHost;
}
public static String getNetworkProxyUrl() {
/**
* 当网络为wifi时,直接返回空代理: 当ctwap,cmwap,uniwap,3gwap开启时同时开启wifi网络
* ,通过下面的getDefaultHost接口将得到对应wap网络代理ip ,这是错误的,所以在此判断当前网络是否为wifi
*/
if (curNetworkType == CURRENT_NETWORK_TYPE_WIFI) {
return null;
}
String proxyHost = android.net.Proxy.getDefaultHost();
// LogUtil.e(TAG, "proxyHost:" + proxyHost);
return proxyHost;
}
public static int getNetworkProxyPort() {
int proxyPort = android.net.Proxy.getDefaultPort();
return proxyPort;
}
public static boolean isCtwap(Context context) {
if (getApnType(context).equals(CONNECT_TYPE_CTWAP)) {
return true;
} else {
return false;
}
}
public static boolean isUniwap(Context context) {
if (getApnType(context).equals(CONNECT_TYPE_UNIWAP)) {
return true;
} else {
return false;
}
}
public static boolean isCmwap(Context context) {
if (getApnType(context).equals(CONNECT_TYPE_CMWAP)) {
return true;
} else {
return false;
}
}
/**
* 判断是否是电信网络(ctwap,ctnet)
*
* @return
*/
public static boolean isCtcNetwork(Context context) {
byte type = getCurrentNetType(context);
return isCtcNetwork(type);
}
public static boolean isCtcNetwork(String apnName) {
if (apnName == null) {
return false;
}
if (apnName.equals(CONNECT_TYPE_CTWAP) || apnName.equals(CONNECT_TYPE_CTNET)) {
return true;
} else {
return false;
}
}
public static boolean isCtcNetwork(byte type) {
if (type == CURRENT_NETWORK_TYPE_CTWAP || type == CURRENT_NETWORK_TYPE_CTNET) {
return true;
} else {
return false;
}
}
/**
* 判断是否是联通网络(uniwap,uninet,3gwap,3gnet)
*
* @return
*/
public static boolean isCucNetwork(Context context) {
byte type = getCurrentNetType(context);
return isCucNetwork(type);
}
public static boolean isCucNetwork(String apnName) {
if (apnName == null) {
return false;
}
if (apnName.equals(CONNECT_TYPE_UNIWAP) || apnName.equals(CONNECT_TYPE_UNINET)
|| apnName.equals(CONNECT_TYPE_UNI3GWAP) || apnName.equals(CONNECT_TYPE_UNI3GNET)) {
return true;
} else {
return false;
}
}
public static boolean isCucNetwork(byte type) {
if (type == CURRENT_NETWORK_TYPE_UNIWAP || type == CURRENT_NETWORK_TYPE_UNIET) {
return true;
} else {
return false;
}
}
/**
* 判断是否是移动网络(cmwap,cmnet)
*
* @return
*/
public static boolean isCmbNetwork(Context context) {
byte type = getCurrentNetType(context);
return isCmbNetwork(type);
}
public static boolean isCmbNetwork(String apnName) {
if (apnName == null) {
return false;
}
if (apnName.equals(CONNECT_TYPE_CMWAP) || apnName.equals(CONNECT_TYPE_CMNET)) {
return true;
} else {
return false;
}
}
public static boolean isCmbNetwork(byte type) {
if (type == CURRENT_NETWORK_TYPE_CMWAP || type == CURRENT_NETWORK_TYPE_CMNET) {
return true;
} else {
return false;
}
}
/**
* 获取网络运营商类型(中国移动,中国联通,中国电信,wifi)
*
* @param context
* @return
*/
public static byte getNetworkOperators(Context context) {
if (isWifi(context)) {
return CURRENT_NETWORK_TYPE_WIFI;
} else if (isCtcNetwork(context)) {
return CURRENT_NETWORK_TYPE_CTC;
} else if (isCmbNetwork(context)) {
return CURRENT_NETWORK_TYPE_CM;
} else if (isCucNetwork(context)) {
return CURRENT_NETWORK_TYPE_CUC;
} else {
return CURRENT_NETWORK_TYPE_NONE;
}
}
public static byte getNetworkOperators(byte type) {
if (type == CURRENT_NETWORK_TYPE_NONE) {
return CURRENT_NETWORK_TYPE_NONE;
} else if (type == CURRENT_NETWORK_TYPE_WIFI) {
return CURRENT_NETWORK_TYPE_WIFI;
} else if (type == CURRENT_NETWORK_TYPE_CTNET || type == CURRENT_NETWORK_TYPE_CTWAP) {
return CURRENT_NETWORK_TYPE_CTC;
} else if (type == CURRENT_NETWORK_TYPE_CMWAP || type == CURRENT_NETWORK_TYPE_CMNET) {
return CURRENT_NETWORK_TYPE_CM;
} else if (type == CURRENT_NETWORK_TYPE_UNIWAP || type == CURRENT_NETWORK_TYPE_UNIET) {
return CURRENT_NETWORK_TYPE_CUC;
} else {
return CURRENT_NETWORK_TYPE_NONE;
}
}
/**
* 是否需要设置代理(网络请求,一般用于wap网络,但有些机型设置代理会导致系统异常)
*
* @return
*/
public static boolean isNeedSetProxyForNetRequest() { // #00044 +
if (Build.MODEL.equals("SCH-N719") || Build.MODEL.equals("SCH-I939D")) {
return false;
} else {
return true;
}
}
/**
* get mac address of wifi if wifi is active
*/
public static String getActiveMacAddress(Context context) {
WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo();
if (info != null) {
return info.getMacAddress();
}
return "";
}
public static String getNetworkInfo(Context context) {
String info = "";
ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null) {
NetworkInfo activeNetInfo = connectivity.getActiveNetworkInfo();
if (activeNetInfo != null) {
if (activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI) {
info = activeNetInfo.getTypeName();
} else {
StringBuilder sb = new StringBuilder();
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
sb.append(activeNetInfo.getTypeName());
sb.append(" [");
if (tm != null) {
// Result may be unreliable on CDMA networks
sb.append(tm.getNetworkOperatorName());
sb.append("#");
}
sb.append(activeNetInfo.getSubtypeName());
sb.append("]");
info = sb.toString();
}
}
}
return info;
}
public enum NetworkSpeedMode {
LOW, NORMAL, HIGH, UNKNOWN
}
/**
* 网络类型
*/
public static final int NETWORK_CLASS_UNKNOWN = 0;
public static final int NETWORK_CLASS_2_G = 1;
public static final int NETWORK_CLASS_3_G = 2;
public static final int NETWORK_CLASS_4_G = 3;
public static final int NETWORK_CLASS_WIFI = 10;
/**
* 仅判断Mobile网络的慢速.蓝牙等其他网络不做判断.
*
* @param context
* @return
*/
public static NetworkSpeedMode getNetworkSpeedModeInMobile(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager != null) {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null) {
if (networkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
switch (networkInfo.getSubtype()) {
case TelephonyManager.NETWORK_TYPE_IDEN: // ~25 kbps
return NetworkSpeedMode.LOW;
case TelephonyManager.NETWORK_TYPE_CDMA: // ~ 14-64 kbps
return NetworkSpeedMode.LOW;
case TelephonyManager.NETWORK_TYPE_1xRTT: // ~ 50-100 kbps
return NetworkSpeedMode.LOW;
case TelephonyManager.NETWORK_TYPE_EDGE: // ~ 50-100 kbps
return NetworkSpeedMode.LOW;
case TelephonyManager.NETWORK_TYPE_GPRS: // ~ 100 kbps
return NetworkSpeedMode.LOW;
case TelephonyManager.NETWORK_TYPE_EVDO_0: // ~ 400-1000
// kbps
return NetworkSpeedMode.NORMAL;
case TelephonyManager.NETWORK_TYPE_EVDO_A: // ~ 600-1400
// kbps
return NetworkSpeedMode.NORMAL;
case TelephonyManager.NETWORK_TYPE_HSPA: // ~ 700-1700 kbps
return NetworkSpeedMode.NORMAL;
case TelephonyManager.NETWORK_TYPE_UMTS: // ~ 400-7000 kbps
return NetworkSpeedMode.NORMAL;
case 14: // TelephonyManager.NETWORK_TYPE_EHRPD: // ~ 1-2
// Mbps
return NetworkSpeedMode.NORMAL;
case 12: // TelephonyManager.NETWORK_TYPE_EVDO_B: // ~ 5
// Mbps
return NetworkSpeedMode.NORMAL;
case TelephonyManager.NETWORK_TYPE_HSDPA: // ~ 2-14 Mbps
return NetworkSpeedMode.HIGH;
case TelephonyManager.NETWORK_TYPE_HSUPA: // ~ 1-23 Mbps
return NetworkSpeedMode.HIGH;
case 15: // TelephonyManager.NETWORK_TYPE_HSPAP: // ~ 10-20
// Mbps
return NetworkSpeedMode.HIGH;
case 13: // TelephonyManager.NETWORK_TYPE_LTE: // ~ 10+ Mbps
return NetworkSpeedMode.HIGH;
case TelephonyManager.NETWORK_TYPE_UNKNOWN:
return NetworkSpeedMode.NORMAL;
default:
break;
}
}
}
}
return NetworkSpeedMode.UNKNOWN;
}
/**
* 获取在Mobile网络下的网络类型. 2G,3G,4G
*
* @param context
* @return
*/
public static int getNetworkClass(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager != null) {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null) {
if (networkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
switch (networkInfo.getSubtype()) {
case TelephonyManager.NETWORK_TYPE_GPRS:
case TelephonyManager.NETWORK_TYPE_EDGE:
case TelephonyManager.NETWORK_TYPE_CDMA:
case TelephonyManager.NETWORK_TYPE_1xRTT:
case TelephonyManager.NETWORK_TYPE_IDEN:
return NETWORK_CLASS_2_G;
case TelephonyManager.NETWORK_TYPE_UMTS:
case TelephonyManager.NETWORK_TYPE_EVDO_0:
case TelephonyManager.NETWORK_TYPE_EVDO_A:
case TelephonyManager.NETWORK_TYPE_HSDPA:
case TelephonyManager.NETWORK_TYPE_HSUPA:
case TelephonyManager.NETWORK_TYPE_HSPA:
case 12: // TelephonyManager.NETWORK_TYPE_EVDO_B:
case 14: // TelephonyManager.NETWORK_TYPE_EHRPD:
case 15: // TelephonyManager.NETWORK_TYPE_HSPAP:
return NETWORK_CLASS_3_G;
case 13: // TelephonyManager.NETWORK_TYPE_LTE:
return NETWORK_CLASS_4_G;
default:
return NETWORK_CLASS_UNKNOWN;
}
} else if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
return NETWORK_CLASS_WIFI;
}
}
}
return NETWORK_CLASS_UNKNOWN;
}
public static String getNetworkTypeName(Context context) {
String networkName = "UNKNOWN";
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager != null) {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null) {
networkName = getNetworkTypeName(networkInfo.getType());
if (networkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
networkName += "#" + getNetworkTypeNameInMobile(networkInfo.getSubtype());
}
}
}
return networkName;
}
private static String getNetworkTypeNameInMobile(int type) {
switch (type) {
case TelephonyManager.NETWORK_TYPE_GPRS:
return "GPRS";
case TelephonyManager.NETWORK_TYPE_EDGE:
return "EDGE";
case TelephonyManager.NETWORK_TYPE_UMTS:
return "UMTS";
case TelephonyManager.NETWORK_TYPE_HSDPA:
return "HSDPA";
case TelephonyManager.NETWORK_TYPE_HSUPA:
return "HSUPA";
case TelephonyManager.NETWORK_TYPE_HSPA:
return "HSPA";
case TelephonyManager.NETWORK_TYPE_CDMA:
return "CDMA";
case TelephonyManager.NETWORK_TYPE_EVDO_0:
return "CDMA - EvDo rev. 0";
case TelephonyManager.NETWORK_TYPE_EVDO_A:
return "CDMA - EvDo rev. A";
case TelephonyManager.NETWORK_TYPE_EVDO_B:
return "CDMA - EvDo rev. B";
case TelephonyManager.NETWORK_TYPE_1xRTT:
return "CDMA - 1xRTT";
case TelephonyManager.NETWORK_TYPE_LTE:
return "LTE";
case TelephonyManager.NETWORK_TYPE_EHRPD:
return "CDMA - eHRPD";
case TelephonyManager.NETWORK_TYPE_IDEN:
return "iDEN";
case TelephonyManager.NETWORK_TYPE_HSPAP:
return "HSPA+";
default:
return "UNKNOWN";
}
}
private static String getNetworkTypeName(int type) {
switch (type) {
case ConnectivityManager.TYPE_MOBILE:
return "MOBILE";
case ConnectivityManager.TYPE_WIFI:
return "WIFI";
case ConnectivityManager.TYPE_MOBILE_MMS:
return "MOBILE_MMS";
case ConnectivityManager.TYPE_MOBILE_SUPL:
return "MOBILE_SUPL";
case ConnectivityManager.TYPE_MOBILE_DUN:
return "MOBILE_DUN";
case ConnectivityManager.TYPE_MOBILE_HIPRI:
return "MOBILE_HIPRI";
case ConnectivityManager.TYPE_WIMAX:
return "WIMAX";
case ConnectivityManager.TYPE_BLUETOOTH:
return "BLUETOOTH";
case ConnectivityManager.TYPE_DUMMY:
return "DUMMY";
case ConnectivityManager.TYPE_ETHERNET:
return "ETHERNET";
case 10: // ConnectivityManager.TYPE_MOBILE_FOTA:
return "MOBILE_FOTA";
case 11: // ConnectivityManager.TYPE_MOBILE_IMS:
return "MOBILE_IMS";
case 12: // ConnectivityManager.TYPE_MOBILE_CBS:
return "MOBILE_CBS";
case 13: // ConnectivityManager.TYPE_WIFI_P2P:
return "WIFI_P2P";
default:
return Integer.toString(type);
}
}
//中国电信
public static final int ISP_CTCC = 0;
//中国联通
public static final int ISP_CUCC = 1;
//中国移动
public static final int ISP_CMCC = 2;
//中国铁通
public static final int ISP_CTT = 3;
//其他
public static final int ISP_OTHERS = -1;
public static String getSimOperator(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if(tm != null){
return tm.getSimOperator();
}
return null;
}
public static String getNetworkOperator(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if(tm != null){
return tm.getNetworkOperator();
}
return null;
}
public interface LinkNetWorkType {
public static final int UNKNOWN = 0;
public static final int WIFI = 1;
public static final int WWAN = 2;
public static final int _2G = 3;
public static final int _3G = 4;
public static final int _4G = 5;
}
public static int getNetworkTypeForLink(Context context) {
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni != null) {
if (ni.getType() == ConnectivityManager.TYPE_WIFI) {
return LinkNetWorkType.WIFI;
} else {
if (ni.getType() == ConnectivityManager.TYPE_MOBILE) {
switch (ni.getSubtype()) {
case TelephonyManager.NETWORK_TYPE_GPRS:
case TelephonyManager.NETWORK_TYPE_EDGE:
case TelephonyManager.NETWORK_TYPE_CDMA:
case TelephonyManager.NETWORK_TYPE_1xRTT:
case TelephonyManager.NETWORK_TYPE_IDEN:
return LinkNetWorkType._2G;
case TelephonyManager.NETWORK_TYPE_UMTS:
case TelephonyManager.NETWORK_TYPE_EVDO_0:
case TelephonyManager.NETWORK_TYPE_EVDO_A:
case TelephonyManager.NETWORK_TYPE_HSDPA:
case TelephonyManager.NETWORK_TYPE_HSUPA:
case TelephonyManager.NETWORK_TYPE_HSPA:
case 12: // TelephonyManager.NETWORK_TYPE_EVDO_B:
case 14: // TelephonyManager.NETWORK_TYPE_EHRPD:
case 15: // TelephonyManager.NETWORK_TYPE_HSPAP:
return LinkNetWorkType._3G;
case 13: // TelephonyManager.NETWORK_TYPE_LTE:
return LinkNetWorkType._4G;
default:
return LinkNetWorkType._2G;
}
}
}
}
} catch (Exception e) {
return LinkNetWorkType.UNKNOWN;
}
return LinkNetWorkType.UNKNOWN;
}
}
| [
"yj1344393464@163.com"
] | yj1344393464@163.com |
5837f618b1c9658399046ea562f2e71ec5f3525f | 9923e30eb99716bfc179ba2bb789dcddc28f45e6 | /swagger-codegen/jaxrs/src/gen/java/io/swagger/model/DriversSummaryResponse.java | 4cdb2e21c163d64d2df9ee824603f2bbf296c878 | [] | no_license | silverspace/samsara-sdks | cefcd61458ed3c3753ac5e6bf767229dd8df9485 | c054b91e488ab4266f3b3874e9b8e1c9e2d4d5fa | refs/heads/master | 2020-04-25T13:16:59.137551 | 2019-03-01T05:49:05 | 2019-03-01T05:49:05 | 172,804,041 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,277 | java | /*
* Samsara API
* # Introduction Samsara provides API endpoints for interacting with Samsara Cloud, so that you can build powerful applications and custom solutions with sensor data. Samsara has endpoints available to track and analyze sensors, vehicles, and entire fleets. The Samsara Cloud API is a [RESTful API](https://en.wikipedia.org/wiki/Representational_state_transfer) accessed by an [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) client such as wget or curl, or HTTP libraries of most modern programming languages including python, ruby, java. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We allow you to interact securely with our API from a client-side web application (though you should never expose your secret API key). [JSON](http://www.json.org/) is returned by all API responses, including errors. If you’re familiar with what you can build with a REST API, the following API reference guide will be your go-to resource. API access to the Samsara cloud is available to all Samsara administrators. To start developing with Samsara APIs you will need to [obtain your API keys](#section/Authentication) to authenticate your API requests. If you have any questions you can reach out to us on [support@samsara.com](mailto:support@samsara.com) # Endpoints All our APIs can be accessed through HTTP requests to URLs like: ```curl https://api.samsara.com/<version>/<endpoint> ``` All our APIs are [versioned](#section/Versioning). If we intend to make breaking changes to an API which either changes the response format or request parameter, we will increment the version. # Authentication To authenticate your API request you will need to include your secret token. You can manage your API tokens in the [Dashboard](https://cloud.samsara.com). They are visible under `Settings->Organization->API Tokens`. Your API tokens carry many privileges, so be sure to keep them secure. Do not share your secret API tokens in publicly accessible areas such as GitHub, client-side code, and so on. Authentication to the API is performed via [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Provide your API token as the basic access_token value in the URL. You do not need to provide a password. ```curl https://api.samsara.com/<version>/<endpoint>?access_token={access_token} ``` All API requests must be made over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP or without authentication will fail. # Request Methods Our API endpoints use [HTTP request methods](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) to specify the desired operation to be performed. The documentation below specified request method supported by each endpoint and the resulting action. ## GET GET requests are typically used for fetching data (like data for a particular driver). ## POST POST requests are typically used for creating or updating a record (like adding new tags to the system). With that being said, a few of our POST requests can be used for fetching data (like current location data of your fleet). ## PUT PUT requests are typically used for updating an existing record (like updating all devices associated with a particular tag). ## PATCH PATCH requests are typically used for modifying an existing record (like modifying a few devices associated with a particular tag). ## DELETE DELETE requests are used for deleting a record (like deleting a tag from the system). # Response Codes All API requests will respond with appropriate [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). Your API client should handle each response class differently. ## 2XX These are successful responses and indicate that the API request returned the expected response. ## 4XX These indicate that there was a problem with the request like a missing parameter or invalid values. Check the response for specific [error details](#section/Error-Responses). Requests that respond with a 4XX status code, should be modified before retrying. ## 5XX These indicate server errors when the server is unreachable or is misconfigured. In this case, you should retry the API request after some delay. # Error Responses In case of a 4XX status code, the body of the response will contain information to briefly explain the error reported. To help debugging the error, you can refer to the following table for understanding the error message. | Status Code | Message | Description | |-------------|----------------|-------------------------------------------------------------------| | 401 | Invalid token | The API token is invalid and could not be authenticated. Please refer to the [authentication section](#section/Authentication). | | 404 | Page not found | The API endpoint being accessed is invalid. | | 400 | Bad request | Default response for an invalid request. Please check the request to make sure it follows the format specified in the documentation. | # Versioning All our APIs are versioned. Our current API version is `v1` and we are continuously working on improving it further and provide additional endpoints. If we intend to make breaking changes to an API which either changes the response format or request parameter, we will increment the version. Thus, you can use our current API version worry free. # FAQs Check out our [responses to FAQs here](https://kb.samsara.com/hc/en-us/sections/360000538054-APIs). Don’t see an answer to your question? Reach out to us on [support@samsara.com](mailto:support@samsara.com).
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.DriversSummaryResponseSummaries;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
/**
* DriversSummaryResponse
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2019-03-01T04:29:05.032Z")
public class DriversSummaryResponse {
@JsonProperty("Summaries")
private List<DriversSummaryResponseSummaries> summaries = null;
public DriversSummaryResponse summaries(List<DriversSummaryResponseSummaries> summaries) {
this.summaries = summaries;
return this;
}
public DriversSummaryResponse addSummariesItem(DriversSummaryResponseSummaries summariesItem) {
if (this.summaries == null) {
this.summaries = new ArrayList<DriversSummaryResponseSummaries>();
}
this.summaries.add(summariesItem);
return this;
}
/**
* Get summaries
* @return summaries
**/
@JsonProperty("Summaries")
@ApiModelProperty(value = "")
public List<DriversSummaryResponseSummaries> getSummaries() {
return summaries;
}
public void setSummaries(List<DriversSummaryResponseSummaries> summaries) {
this.summaries = summaries;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DriversSummaryResponse driversSummaryResponse = (DriversSummaryResponse) o;
return Objects.equals(this.summaries, driversSummaryResponse.summaries);
}
@Override
public int hashCode() {
return Objects.hash(summaries);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DriversSummaryResponse {\n");
sb.append(" summaries: ").append(toIndentedString(summaries)).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 ");
}
}
| [
"greg@samsara.com"
] | greg@samsara.com |
c3c477b98677322a9dca022ca2d166fbf55f11c3 | 04353a0f166eae12986f7ed704a71fbaac3b9030 | /src/main/java/com/github/aquariusmaster/jphone/repository/package-info.java | 2beb8bdaa94fdbe2d2474cf0d2b8db7dd8f653b6 | [] | no_license | BulkSecurityGeneratorProject/jphone | a96440d8bd08351434163a9716b7cf80035d45ac | 39436d3ef5482ada306b9d0c746170a57aee0406 | refs/heads/master | 2022-12-15T21:35:43.755254 | 2018-02-04T17:05:24 | 2018-02-04T17:05:24 | 296,524,167 | 0 | 0 | null | 2020-09-18T05:37:32 | 2020-09-18T05:37:31 | null | UTF-8 | Java | false | false | 94 | java | /**
* Spring Data JPA repositories.
*/
package com.github.aquariusmaster.jphone.repository;
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
23d0d1a9635f318113cc0f3fd9902713b4d290fa | d90be8f61d116bdbb655adb18c5b1c11ce3a0d7f | /java/bdwl/wechat/src/main/java/com/liaoin/WechatApplication.java | 589daa1e46d617d1e0ef93033659a00f04e12c06 | [] | no_license | wuxh123/bdwl | 5d7946b07e396da155338feea8be8444019c65d0 | c05034473e6c659f6b99953927758d25a7574ee3 | refs/heads/master | 2020-05-24T19:44:44.559787 | 2019-05-19T06:54:59 | 2019-05-19T06:54:59 | 187,441,649 | 0 | 0 | null | 2019-05-19T06:25:17 | 2019-05-19T06:25:17 | null | UTF-8 | Java | false | false | 766 | java | package com.liaoin;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.WebApplicationInitializer;
@SpringBootApplication
public class WechatApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
public static void main(String[] args) {
SpringApplication.run(WechatApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(WechatApplication.class);
}
}
| [
"997342977@qq.com"
] | 997342977@qq.com |
37397ebc046d3d26829db7bd1655b4ecba78edc6 | 4cb7a16afa50677978883b389e9a45519e038091 | /FashionShows.java | 42924f943b98cd1ff2300da3c6f1e5182d35566c | [] | no_license | SageBerg/Sphere-Online-Judge-Problems | b19506a164ed0a50fe3775b22bcbc9b01d47f43c | 1bed7727bc3fff5bcb61e2cc7808f1d8377506ab | refs/heads/master | 2021-01-21T19:28:33.085168 | 2015-11-17T06:03:31 | 2015-11-17T06:03:31 | 27,023,619 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | import java.io.*;
import java.util.Scanner;
import java.util.Arrays;
class FashionShows {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
int trials = Integer.parseInt(scanner.nextLine());
while (trials > 0) {
int couples = Integer.parseInt(scanner.nextLine());
String[] men = scanner.nextLine().split(" ");
String[] women = scanner.nextLine().split(" ");
Arrays.sort(men);
Arrays.sort(women);
int hotness = 0;
for (int i = 0; i < couples; i++) {
hotness += Integer.parseInt(men[i]) *
Integer.parseInt(women[i]);
}
System.out.println(hotness);
trials -= 1;
}
}
}
| [
"sberg@uoregon.edu"
] | sberg@uoregon.edu |
97bad5687858291df24be355680f8d40c523a312 | 6f59a35724c7bab7e42daaa973969acab6b37544 | /app/src/main/java/com/example/hostelnetwork/fragment/CreatedAppointmentFragment.java | 7f29d2408a5c5ac2357f9f629a2a81010b521725 | [] | no_license | TuyetGiang/hostel-network | 552ea0503cdb99aca0ea081dbd3fb7ddf23e0a84 | 0b8bafe84c211b83a8ac61440692631474edec58 | refs/heads/master | 2020-04-29T04:31:36.461228 | 2019-03-28T18:28:39 | 2019-03-28T18:28:39 | 175,849,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,714 | java | package com.example.hostelnetwork.fragment;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.example.hostelnetwork.R;
import com.example.hostelnetwork.activity.AppointmentDetailActivity;
import com.example.hostelnetwork.activity.LoginActivity;
import com.example.hostelnetwork.adapter.CreatedAppointmentListAdapter;
import com.example.hostelnetwork.dto.AppointmentDTO;
import com.example.hostelnetwork.dto.UserDTO;
import com.example.hostelnetwork.model.AppointmentModel;
import com.google.gson.Gson;
import java.util.List;
/**
* A simple {@link Fragment} subclass.
*/
public class CreatedAppointmentFragment extends Fragment {
public CreatedAppointmentFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_created_appointment, container, false);
SharedPreferences accountPreferences = getActivity().getSharedPreferences("ACCOUNT", Context.MODE_PRIVATE);
if (accountPreferences == null || accountPreferences.getString("userInfor", null) == null) {
Intent intent = new Intent(getActivity(), LoginActivity.class);
intent.putExtra("FRAGMENT_ID", R.id.menu_appointments);
startActivity(intent);
} else {
Gson gson = new Gson();
String json = accountPreferences.getString("userInfor", "");
UserDTO userDTO = gson.fromJson(json, UserDTO.class);
AppointmentModel appointmentModel = new AppointmentModel();
List<AppointmentDTO> listData = appointmentModel.getAllAppointment(userDTO.getId(), true);
final ListView listView = view.findViewById(R.id.listView_create_appointment);
listView.setAdapter(new CreatedAppointmentListAdapter(listData, true, getActivity()));
listView.setOnItemClickListener((a, v, position, id) -> {
Object o = listView.getItemAtPosition(position);
AppointmentDTO appointmentDTO = (AppointmentDTO) o;
Intent intent = new Intent(getActivity(), AppointmentDetailActivity.class);
intent.putExtra("APPOINTMENT_DETAIL", gson.toJson(appointmentDTO));
startActivity(intent);
});
}
return view;
}
}
| [
"giang281197@gmail.com"
] | giang281197@gmail.com |
8cc1f5766a20e3f6eed8c1c8cfa41e29b425723d | 8d21be78aeb97287259a2f0c54ae3b2d44ed82c3 | /src/main/java/com/crealabs/creativebasic/commands/WarpCommand.java | c35e21a1bcc9e9cea0640c6655386c0ebb469ef9 | [] | no_license | CreativeBasic/CreativeBasic | 10fee6db95f299ff21ce4af82c3bdab71d4bce84 | d2295c18bbf28851cad7cf7c3f897412cb27f329 | refs/heads/master | 2023-01-11T09:34:00.732533 | 2020-11-08T18:56:02 | 2020-11-08T18:56:02 | 309,454,043 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,061 | java | package com.crealabs.creativebasic.commands;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import java.io.File;
import java.io.IOException;
public class WarpCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player p = (Player) sender;
File file = new File("plugins/CreativeBasic","warps.yml");
YamlConfiguration warps = YamlConfiguration.loadConfiguration(file);
if (cmd.getName().equalsIgnoreCase("delwarp")) {
if (p.hasPermission("creativebasic.cmd.delwarp")) {
if (args.length == 1) {
if (warps.getString(args[0]) != null) {
warps.set(args[0], null);
p.sendMessage("§cYou have remove warp : " + args[0]);
try {
warps.save(file);
} catch (IOException e) {
e.printStackTrace();
}
} else {
p.sendMessage("§cWarp not exist !");
}
} else {
p.sendMessage("§cUsage: /delwarp <name>");
}
} else {
p.sendMessage("§cError you don't have permission for this !");
}
}
if(cmd.getName().equalsIgnoreCase("setwarp")){
if (p.hasPermission("creativebasic.cmd.setwarp")) {
if (args.length == 1) {
String world = p.getWorld().getName();
double x = p.getLocation().getX();
double y = p.getLocation().getY();
double z = p.getLocation().getZ();
double yaw = p.getLocation().getYaw();
double pitch = p.getLocation().getPitch();
warps.set(String.valueOf(args[0]) + ".world", world);
warps.set(String.valueOf(args[0]) + ".x", Double.valueOf(x));
warps.set(String.valueOf(args[0]) + ".y", Double.valueOf(y));
warps.set(String.valueOf(args[0]) + ".z", Double.valueOf(z));
warps.set(String.valueOf(args[0]) + ".yaw", Double.valueOf(yaw));
warps.set(String.valueOf(args[0]) + ".pitch", Double.valueOf(pitch));
try {
warps.save(file);
} catch (IOException e) {
e.printStackTrace();
}
p.sendMessage("§4[§cArmaCommand§4] §cTu as bien crée le warp §4" + args[0]+ " §c!");
} else {
p.sendMessage("§4[§cArmaCommand§4] §c/setwarp <Warp>");
}
} else {
p.sendMessage("§4[§cArmaCommand§4] §cTu n'as pas la permission pour faire ceci");
}
}
if(cmd.getName().equalsIgnoreCase("warp")){
if (p.hasPermission("creativebasic.cmd.warp")) {
if(args.length == 0){
int i = 0;
p.sendMessage("§cList of warps :");
for (String key : warps.getKeys(true)) {
if (!key.contains(".")) {
i++;
p.sendMessage( "§9" + i + " : §b" + key);
}
}
}
if (args.length == 1) {
if (warps.getString(args[0]) != null) {
String world = warps.getString(String.valueOf(args[0]) + ".world");
double x = warps.getDouble(String.valueOf(args[0]) + ".x");
double y = warps.getDouble(String.valueOf(args[0]) + ".y");
double z = warps.getDouble(String.valueOf(args[0]) + ".z");
double yaw = warps.getDouble(String.valueOf(args[0]) + ".yaw");
double pitch = warps.getDouble(String.valueOf(args[0]) + ".pitch");
Location loc = new Location(Bukkit.getWorld(world), x, y, z);
loc.setPitch((float)pitch);
loc.setYaw((float)yaw);
p.teleport(loc);
p.sendMessage( "§cYou succesfully teleported to " + args[0]);
p.playSound(p.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT,80,20);
} else {
p.sendMessage("§cWarp not exist !");
}
}
} else {
p.sendMessage("§cError you don't have permission for this !");
}
}
return false;
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
dbf739eb81484bbe771373cc7af4619eab32875e | 1892d6edd4ba438a01f2413977ccb179e1cd0333 | /src/com/syntax/class03/Homework1.java | 2d925aaa5bee2f1aa0b66e077c6e033a99d8135e | [] | no_license | Dashylya1993/JavaClasses | 5a4fde0f639eedab0c232ffa9fc35d0ce4aff232 | a9b2da66cc5d1664229922c2be18d31486f4a5f4 | refs/heads/master | 2022-11-16T08:37:41.811713 | 2020-07-01T23:32:00 | 2020-07-01T23:32:00 | 274,788,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,987 | java | package com.syntax.class03;
public class Homework1 {
public static void main(String[] args) {
double num1 = 3.5, num2 = 4.2;
double sum = num1 + num2;
double sub = num1 - num2;
double mult = num1 * num2;
double div = num1 / num2;
System.out.println("The addition of 2 numbers " + num1 + " and " + num2 + " is equal to " + sum);
System.out.println("The addition of 2 numbers " + num1 + " and " + num2 + " is equal to " + num1 + num2);
System.out.println("The substaction of 2 numbers " + num1 + " and " + num2 + " is equal to " + sub);
System.out.println("The multiplication of 2 numbers " + num1 + " and " + num2 + " is equal to " + mult);
System.out.println("The multiplication of 2 numbers " + num1 + " and " + num2 + " is equal to " + num1 * num2);
System.out.println("The multiplication of 2 numbers " + num1 + " and " + num2 + " is equal to " + div);
System.out.println("-------------------------------");
///////////////////////////////
//Write a program to find the square of the number 3.9.
// You program should say "The square or the__ is__"
double number = 4.9;
System.out.println("The square of the " + 4.9 + " is " + number * number);
System.out.println("-------------------------------");
//Write a program to print the area and perimeter of a rectangle with width = 5 and height = 8.
//Your program should say. "The perimeter of a rectangle with width ___ and height ____ is equal
//to _____ and the area is __"
int width = 5;
int height = 8;
int area = width * height;
int perimeter = 2 * (width + height);
// int perimeter2 = 2 * width + 2 * height;
System.out.println("The perimeter of a rectangle with width " + width
+ " and height " + height + " is equal to " + perimeter
+ " and area is " + area );
}
}
| [
"*dashylya1993@gmail.com*"
] | *dashylya1993@gmail.com* |
5fd90fc1fb2bd710327c9950e936c68677e1ff7e | 30663ca605a06785a9fd9f84329c60a64286ebdd | /WeatherService/src/main/java/ru/gubernik/weather/weatherservice/AppInitializer.java | b179d3cd501b02ef0d8c729b0db79cc84bae59a8 | [] | no_license | GubernikVladislav/Weather | af6af3b1b96278822a5b6e037c03368ce6fc832b | 8ed99585c2db57bc52a96fa9f4745ebbf6d0335a | refs/heads/master | 2020-04-21T03:44:08.188831 | 2019-02-24T14:03:51 | 2019-02-24T14:03:51 | 169,292,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 919 | java | package ru.gubernik.weather.weatherservice;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.XmlWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
public class AppInitializer implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
XmlWebApplicationContext context = new XmlWebApplicationContext();
context.setConfigLocation("/WEB-INF/spring/dispatcher-config.xml");
ServletRegistration.Dynamic dispatcher = servletContext.addServlet(
"dispatcher",
new DispatcherServlet(context)
);
dispatcher.setLoadOnStartup(1);
dispatcher.addMapping("/");
}
}
| [
"vgubernik@gmail.com"
] | vgubernik@gmail.com |
e04f5a4fa892d8984ffa8b1256cbe0fcee0d6193 | 123bed93a39ee17802602a0474890d8501651da9 | /Transcription-Reference/src/com/jomac/transcription/reference/forms/tablemodels/ReferenceTableModel.java | 64c58d8514027ab0a86008263be4e7013ce792f9 | [] | no_license | JOMAC-TRANS/T-Reference | c030304a7a5fada834ee08026b86ab040a72e9d4 | 480b2ec8c7175bd3a6f100c74e7af01606cc09ed | refs/heads/master | 2020-12-26T15:44:05.120880 | 2020-03-04T15:25:26 | 2020-03-04T15:25:26 | 237,553,528 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,371 | java | package com.jomac.transcription.reference.forms.tablemodels;
import com.jomac.transcription.reference.jpa.models.DictatorBean;
import com.jomac.transcription.reference.jpa.models.DocumentBean;
public class ReferenceTableModel extends ReferenceAbstractTableModel<DocumentBean> {
@Override
public Object getDataAt(int rowIndex, int columnIndex) {
if (data != null && data.size() > 0 && (rowIndex >= 0 && rowIndex <= data.size() - 1)) {
DocumentBean document = data.get(rowIndex);
if (document != null) {
switch (columnIndex) {
case 0:
return document.getDictatorworktypeid().getDictatorid();
case 1:
return Integer.parseInt(
document.getDictatorworktypeid().getWorktypeid().toString());
case 2:
return document.getSearchCount();
}
}
}
return null;
}
@Override
public String[] getColumnNames() {
return new String[]{
"Dictator",
"W.T.",
"Results"
};
}
@Override
public Class[] getColumnTypes() {
return new Class[]{
DictatorBean.class,
Integer.class,
Integer.class
};
}
}
| [
"denrosssalenga@gmail.com"
] | denrosssalenga@gmail.com |
c1dc7726870b5147cc9071f6be7e79ed4e3fb37f | a4dbcc4303506c650eee618fdb4249f06fe0b98e | /cjsj-oa/seal/src/main/java/cn/cjsj/im/App.java | 1060440aabe8c1215861a7fd6110b075588f191d | [
"MIT"
] | permissive | JoshuaRuo/test | 9a03d2779c6d7c36402d851d85c8cfb60d892b3a | 4563d1f195c83da78d2e7e8bc1614c0263dfa579 | refs/heads/master | 2020-04-14T11:35:42.994124 | 2019-02-12T08:57:42 | 2019-02-12T08:57:42 | 163,818,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,189 | java | package cn.cjsj.im;
import android.app.ActivityManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.StrictMode;
import android.support.multidex.MultiDexApplication;
import android.util.Log;
import android.widget.Toast;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.facebook.stetho.Stetho;
import com.facebook.stetho.dumpapp.DumperPlugin;
import com.facebook.stetho.inspector.database.DefaultDatabaseConnectionProvider;
import com.facebook.stetho.inspector.protocol.ChromeDevtoolsDomain;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import cn.cjsj.im.gty.LogUtils;
import cn.cjsj.im.gty.common.ConstantValue;
import cn.cjsj.im.gty.home.base.ContextUtil;
import cn.cjsj.im.stetho.RongDatabaseDriver;
import cn.cjsj.im.stetho.RongDatabaseFilesProvider;
import cn.cjsj.im.stetho.RongDbFilesDumperPlugin;
import cn.cjsj.im.ui.widget.gridviewpager.HomeGridPagerHelper;
import cn.cjsj.im.utils.BadgerCountLoadUtils;
import cn.cjsj.im.utils.BaiduLocationUtil;
import cn.cjsj.im.utils.LimitsLoadUtils;
import cn.cjsj.im.utils.LocalLoadUtils;
import cn.cjsj.im.utils.TokenCacheLoad;
import cn.jpush.android.api.JPushInterface;
/**
* @author LuoYang 2017.12.15
*/
public class App extends MultiDexApplication {
private static final String TAG = "ALI_PUSH";
private long loadTag = -1l;
private static App instance;
public LocationClient mLocationClient = null;
public BDLocationListener myListener = null;
private String phone = null;
private String nickname = null;
private String mToken;
private SharedPreferences sp;
private SharedPreferences.Editor editor;
//hotfix init need attr
public interface MsgDisplayListener {
void handle(String msg);
}
public static MsgDisplayListener msgDisplayListener = null;
public static StringBuilder cacheMsg = new StringBuilder();
public static synchronized App getInstance() {
return instance;
}
@Override
public void onCreate() {
super.onCreate();
instance = this;
LocalLoadUtils.init(instance);
BadgerCountLoadUtils.init(this);
LimitsLoadUtils.init(this);
TokenCacheLoad.init(this);
//模块初始化
ContextUtil.init(getApplicationContext());
// if(!MenuHelper.hasEverInit()){
// MenuHelper.clearMenuDataConfig();
// MenuHelper.init();
// }
if (!HomeGridPagerHelper.hasEverInit()) {
HomeGridPagerHelper.clearMenuDataConfig();
HomeGridPagerHelper.init();
}
Stetho.initialize(new Stetho.Initializer(this) {
@Override
protected Iterable<DumperPlugin> getDumperPlugins() {
return new Stetho.DefaultDumperPluginsBuilder(App.this)
.provide(new RongDbFilesDumperPlugin(App.this, new RongDatabaseFilesProvider(App.this)))
.finish();
}
@Override
protected Iterable<ChromeDevtoolsDomain> getInspectorModules() {
Stetho.DefaultInspectorModulesBuilder defaultInspectorModulesBuilder = new Stetho.DefaultInspectorModulesBuilder(App.this);
defaultInspectorModulesBuilder.provideDatabaseDriver(new RongDatabaseDriver(App.this, new RongDatabaseFilesProvider(App.this), new DefaultDatabaseConnectionProvider()));
return defaultInspectorModulesBuilder.finish();
}
});
//JPUSH初始化
JPushInterface.setDebugMode(true);// 设置开启日志,发布时请关闭日志
JPushInterface.init(this);// 初始化 JPush
ConstantValue.JPUSH_REGISTER_ID = JPushInterface.getRegistrationID(getApplicationContext());
Set<String> tags = new HashSet<>();
tags.add(ConstantValue.JPUSH_RYT_CUSTOMER_TAG);
JPushInterface.setTags(getApplicationContext(), tags, null);
LogUtils.debug("The JPUSH registerId is :" + ConstantValue.JPUSH_REGISTER_ID);
//百度
mLocationClient = new LocationClient(App.getInstance().getApplicationContext());
myListener = new BaiduLocationUtil();
mLocationClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
option.setOpenGps(true);
option.setAddrType("all");
option.setCoorType("bd09ll");
// option.setCoorType("bd0911");
option.setScanSpan(5000);
option.disableCache(true);
mLocationClient.setLocOption(option);
mLocationClient.start();
// try {
sp = getSharedPreferences("config", MODE_PRIVATE);
phone = sp.getString(SealConst.SEALTALK_LOGING_PHONE, "");
nickname = sp.getString(SealConst.SEALTALK_LOGIN_NAME, "");
// //报告Bugly
// CrashReport.initCrashReport(getApplicationContext(), "1a1320adef", true);
// CrashReport.setUserId(nickName);
// } catch (NullPointerException nullException) {
// NLog.d("Application Bugly exception::" + nullException);
// }
//Android 7.0 FileUriExposedException
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure();
//aliPush
// initManService();
// initPushFeedbackService();
// initHttpDnsService();
// initHotfix();
// initPushService(this);
}
public static String getCurProcessName(Context context) {
int pid = android.os.Process.myPid();
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningAppProcessInfo appProcess : activityManager.getRunningAppProcesses()) {
if (appProcess.pid == pid) {
return appProcess.processName;
}
}
return null;
}
public void setLoadTag(long loadTag) {
this.loadTag = loadTag;
LocalLoadUtils.getInstance().setLoadTag(loadTag);
LogUtils.debug("The setLoadTag loadTag is :" + loadTag);
}
public long getLoadTag() {
if (this.loadTag > 0) {
} else {
this.loadTag = LocalLoadUtils.getInstance().getLoadTag();
}
LogUtils.debug("The getLoadTag loadTag is :" + loadTag);
return this.loadTag;
}
public void clearLoadTag() {
this.loadTag = -1l;
LocalLoadUtils.getInstance().removeLoadTag();
}
public void startLocation() {
if (!mLocationClient.isStarted()) {
mLocationClient.start();
}
}
public void stopLocation() {
mLocationClient.stop();
}
//获取缓存token
public String getToken() {
if (mToken != null) {
return mToken;
} else {
return TokenCacheLoad.getInstance().getToken();
}
}
//缓存token
public void setToken(String token) {
this.mToken = token;
TokenCacheLoad.getInstance().setToken(token);
}
//清楚缓存token
public void clearToken(){
TokenCacheLoad.getInstance().clearToken();
}
// private void initManService() {
// MANService manService = MANServiceProvider.getService();
// //打开日志调试
// manService.getMANAnalytics().turnOnDebug();
// manService.getMANAnalytics().setAppVersion("3.0");
//
// //MAN初始化方法之一,通过插件介入后直接在下发json中获取appKey和appSecret初始化
// manService.getMANAnalytics().init(this, getApplicationContext());
// // 通过此接口关闭页面自动打点功能,详见文档4.2
// manService.getMANAnalytics().turnOffAutoPageTrack();
// }
// private void initPushFeedbackService() {
// /**
// * 添加自定义的error handler
// */
// FeedbackAPI.addErrorCallback(new FeedbackErrorCallback() {
// @Override
// public void onError(Context context, String s, ErrorCode errorCode) {
// Toast.makeText(context, "ErrMsg is: " + s, Toast.LENGTH_SHORT).show();
// }
// });
//
// FeedbackAPI.addLeaveCallback(new Callable() {
// @Override
// public Object call() throws Exception {
// Log.d("DemoApplication", "custom leave callback");
// return null;
// }
// });
//
// //初始化
// FeedbackAPI.init(this);
//
// //自定义参数
// JSONObject jsonObject = new JSONObject();
// try {
// jsonObject.put("phone", phone);
// jsonObject.put("nickname", nickname);
// } catch (JSONException e) {
// e.printStackTrace();
// }
// FeedbackAPI.setAppExtInfo(jsonObject);
//
// /**
// * 以下是设置UI
// */
// //设置默认联系方式
// FeedbackAPI.setDefaultUserContactInfo(phone);
// //沉浸式任务栏,控制台设置为true之后此方法才能生效
// FeedbackAPI.setTranslucent(true);
// //设置返回按钮图标
// //FeedbackAPI.setBackIcon(R.drawable.ali_feedback_common_back_btn_bg);
// //设置标题栏"历史反馈"的字号,需要将控制台中此字号设置为0
// FeedbackAPI.setHistoryTextSize(20);
// //设置标题栏高度,单位为像素
// FeedbackAPI.setTitleBarHeight(100);
//
//
// }
//
// private void initHttpDnsService() {
// HttpDnsService httpDns = HttpDns.getService(getApplicationContext());
// // 允许过期IP以实现懒加载策略
//// httpDns.setExpiredIPEnabled(true);
// }
// private void initHotfix() {
// String appVersion = null;
// try {
// appVersion = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
// } catch (PackageManager.NameNotFoundException e) {
// appVersion = "1.0.0";
// }
// SophixManager.getInstance().setContext(this)
// .setAppVersion(appVersion)
// .setAesKey(null)
// .setEnableDebug(true)
// .setPatchLoadStatusStub(new PatchLoadStatusListener() {
// @Override
// public void onLoad(int i, int i1, String s, int i2) {
// String msg = new StringBuilder("").append("Mode:").append(i)
// .append(" Code:").append(i1)
// .append(" Info:").append(s)
// .append(" HandlePatchVersion:").append(i2).toString();
// if (msgDisplayListener != null) {
// msgDisplayListener.handle(msg);
// } else {
// cacheMsg.append("\n").append(msg);
// }
// }
// }).initialize();
// }
// private void initPushService(Context applicationContext) {
// PushServiceFactory.init(applicationContext);
// final CloudPushService pushService = PushServiceFactory.getCloudPushService();
// pushService.register(applicationContext, new CommonCallback() {
// @Override
// public void onSuccess(String s) {
// ConstantValue.JPUSH_REGISTER_ID = pushService.getDeviceId();
// Log.i("ALI_DeviceId", pushService.getDeviceId());
// Log.i(TAG, "init cloudchannel success");
// }
//
// @Override
// public void onFailed(String s, String s1) {
//
// Log.e(TAG, "init cloudchannel failed -- errorcode:" + s + " -- errorMessage:" + s1);
// }
// });
// }
}
| [
"123456"
] | 123456 |
b15ab09b984339d5b5b37fe22c13d028995702ce | ac91e635d6146e0bc2706e3d086afb547ede4100 | /jeecms-parent/jeecms-component/src/main/java/com/jeecms/system/job/CronTypeIndexJob.java | 2b0b63c0eb7c8f77c3ea070392fae87163d5daef | [] | no_license | iamking1987/jeecms_X1.0.1 | 2ad88790ce48618e822519ce7a14560079db0439 | 16e64aabae2cec76ca7e09480691a016ea07e02c | refs/heads/master | 2023-07-10T21:52:40.526148 | 2019-11-11T10:29:51 | 2019-11-11T10:29:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,088 | java | /*
* @Copyright: 江西金磊科技发展有限公司 All rights reserved.Notice 仅限于授权后使用,禁止非授权传阅以及私自用于商业目的。
*/
package com.jeecms.system.job;
import com.jeecms.common.base.scheduler.IBaseJob;
import com.jeecms.common.exception.GlobalException;
import com.jeecms.common.web.ApplicationContextProvider;
import com.jeecms.content.service.ContentStaticPageService;
import com.jeecms.system.service.CmsSiteService;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Calendar;
/**
* 首页静态化任务
*
* @author xiaohui
* @version 1.0
* @date 2019/6/13 11:12
*/
public class CronTypeIndexJob implements IBaseJob {
private static final Logger logger = LoggerFactory.getLogger(CronTypeIndexJob.class);
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
JobDataMap map = context.getMergedJobDataMap();
logger.info("Running Job name : {} ", map.getString("name"));
initService();
Integer siteId = Integer.parseInt(String.valueOf(map.get("siteId")));
try {
staticPageService.index(siteService.findById(siteId), false);
logger.info("静态化首页成功,时间:{}:" + Calendar.getInstance().getTime());
} catch (GlobalException e) {
logger.error("静态化首页失败,时间:{}:" + Calendar.getInstance().getTime());
}
}
private ContentStaticPageService staticPageService;
private CmsSiteService siteService;
private void initService() {
staticPageService = ApplicationContextProvider.getBean(ContentStaticPageService.class);
siteService = ApplicationContextProvider.getBean(CmsSiteService.class);
}
}
| [
"gidcai@gmail.com"
] | gidcai@gmail.com |
9815366322be970c261eb6bcebe8f5d2740ac238 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_da08cd239db1039c3cd15766c21abf93f346f0cb/DefaultActor/2_da08cd239db1039c3cd15766c21abf93f346f0cb_DefaultActor_t.java | d9d69f22484cafa3fb3d83e7f8aad3a53022dba1 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 16,799 | java | // GPars - Groovy Parallel Systems
//
// Copyright © 2008-10 The original author or authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package groovyx.gpars.actor;
import groovy.lang.Closure;
import groovy.time.Duration;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
/**
* The DefaultActor class is the base for all stateful actors, who need to maintain implicit state between subsequent message arrivals.
* Allowing the actor creator to structure code in a continuation-like style with message retrieval react commands mixed within normal code
* makes implementation of some algorithms particularly easy.
* <p/>
* The DefaultActor upon start-up will grab a thread from the associated actor thread pool and run its body.
* The body is either the parameter passed to the constructor, or the act() method, if no parameter has been set.
* The parameter takes precedence over the act() method.
* Once a react() method call is discovered within the actor's body, its Closure-typed parameter will be scheduled for processing on next message arrival.
* To preserve the actor principle of at-most-one active thread per actor, the next message, however, will only be handled once the currently run code finishes and frees the current thread.
* It is thus advisable to avoid code after call to react().
* The loop() method will ensure its body is executed repeatedly, until the actor either finishes or an optional loop condition is not met.
*
* @author Vaclav Pech
* Date: Nov 4th 2010
*/
public class DefaultActor extends AbstractLoopingActor {
private Closure nextContinuation;
private Closure loopClosure;
/**
* Misused also for the code to run at start-up
*/
private Runnable loopCode;
private Callable<Boolean> loopCondition;
private Closure afterLoopCode;
private boolean started = false;
private static final long serialVersionUID = -439517926332934061L;
/**
* Creates an actor, which will execute its act() methods
*/
public DefaultActor() {
this(null);
}
/**
* Creates an actor, which will execute the supplied code
*
* @param code A Runnable or Closure to be considered the actor's body
*/
public DefaultActor(final Runnable code) {
if (code != null) {
if (code instanceof Closure) checkForBodyArguments((Closure) code);
loopCode = code;
}
initialize(new DefaultActorClosure(this));
}
/**
* If no parameter is provided at construction time, the act() method becomes the actor's body
*/
protected void act() {
throw new UnsupportedOperationException("The act method has not been overridden");
}
/**
* Handles all incoming messages
*
* @param message The current message to process
*/
final void onMessage(final Object message) {
if (nextContinuation != null) {
final Closure closure = nextContinuation;
nextContinuation = null;
closure.call(message);
} else
throw new IllegalStateException("The actor " + this + " cannot handle the message " + message + ", as it has no registered message handler at the moment.");
if (nextContinuation == null && !terminatingFlag) {
if (loopCondition == null || evalLoopCondition()) {
if (loopCode == null)
if (loopClosure == null) terminate();
else loopClosure.call();
else loopCode.run();
} else {
if (afterLoopCode != null) {
runAfterLoopCode(afterLoopCode);
}
if (nextContinuation == null) terminate();
}
}
}
/**
* Ensures that the supplied closure will be invoked repeatedly in a loop.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param code The closure to invoke repeatedly
*/
public final void loop(final Runnable code) {
doLoop(null, null, code);
}
/**
* Ensures that the supplied closure will be invoked repeatedly in a loop.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param numberOfLoops The loop will only be run the given number of times
* @param code The closure to invoke repeatedly
*/
protected final void loop(final int numberOfLoops, final Runnable code) {
loop(numberOfLoops, null, code);
}
/**
* Ensures that the supplied closure will be invoked repeatedly in a loop.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param numberOfLoops The loop will only be run the given number of times
* @param afterLoopCode Code to run after the main actor's loop finishes
* @param code The closure to invoke repeatedly
*/
protected final void loop(final int numberOfLoops, final Closure afterLoopCode, final Runnable code) {
doLoop(new Callable<Boolean>() {
private int counter = 0;
@Override
public Boolean call() {
counter++;
//noinspection UnnecessaryBoxing
return Boolean.valueOf(counter <= numberOfLoops);
}
}, afterLoopCode, code);
}
/**
* Ensures that the supplied closure will be invoked repeatedly in a loop.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param condition A condition to evaluate before each iteration starts. If the condition returns false, the loop exits.
* @param code The closure to invoke repeatedly
*/
protected final void loop(final Closure condition, final Runnable code) {
loop(condition, null, code);
}
/**
* Ensures that the supplied closure will be invoked repeatedly in a loop.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param condition A condition to evaluate before each iteration starts. If the condition returns false, the loop exits.
* @param afterLoopCode Code to run after the main actor's loop finishes
* @param code The closure to invoke repeatedly
*/
protected final void loop(final Closure condition, final Closure afterLoopCode, final Runnable code) {
doLoop(new Callable<Boolean>() {
@Override
public Boolean call() {
return (Boolean) condition.call();
}
}, afterLoopCode, code);
}
/**
* Ensures that the supplied closure will be invoked repeatedly in a loop.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param condition A condition to evaluate before each iteration starts. If the condition returns false, the loop exits.
* @param afterLoopCode Code to run after the main actor's loop finishes
* @param code The closure to invoke repeatedly
*/
@SuppressWarnings({"OverlyComplexBooleanExpression"})
private void doLoop(final Callable<Boolean> condition, final Closure afterLoopCode, final Runnable code) {
checkForNull(code);
if (afterLoopCode != null) {
this.afterLoopCode = enhanceClosure(afterLoopCode);
}
loopCondition = condition;
if (code instanceof Closure) {
final Closure closure = (Closure) code;
checkForBodyArguments(closure);
final Closure enhancedClosure = enhanceClosure(closure);
this.loopClosure = enhancedClosure;
assert nextContinuation == null;
while (!terminatingFlag && nextContinuation == null && (loopCondition == null || evalLoopCondition())) {
enhancedClosure.call();
}
if (!terminatingFlag && nextContinuation == null && afterLoopCode != null) {
runAfterLoopCode(afterLoopCode);
}
} else {
this.loopCode = code;
assert nextContinuation == null;
while (!terminatingFlag && nextContinuation == null && (loopCondition == null || evalLoopCondition())) {
loopCode.run();
}
if (!terminatingFlag && nextContinuation == null && afterLoopCode != null) {
runAfterLoopCode(afterLoopCode);
}
}
}
private void runAfterLoopCode(final Closure afterLoopCode) {
loopCondition = null;
loopCode = null;
loopClosure = null;
this.afterLoopCode = null;
afterLoopCode.call();
}
private boolean evalLoopCondition() {
try {
return loopCondition.call();
} catch (Exception ignored) {
return false;
}
}
/**
* Schedules an ActorAction to take the next message off the message queue and to pass it on to the supplied closure.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param code The code to handle the next message. The reply() and replyIfExists() methods are available inside
* the closure to send a reply back to the actor, which sent the original message.
*/
public final void react(final Closure code) {
react(-1L, code);
}
/**
* Schedules an ActorAction to take the next message off the message queue and to pass it on to the supplied closure.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param duration Time to wait at most for a message to arrive. The actor terminates if a message doesn't arrive within the given timeout.
* The TimeCategory DSL to specify timeouts must be enabled explicitly inside the Actor's act() method.
* @param code The code to handle the next message. The reply() and replyIfExists() methods are available inside
* the closure to send a reply back to the actor, which sent the original message.
*/
protected final void react(final Duration duration, final Closure code) {
react(duration.toMilliseconds(), code);
}
/**
* Schedules an ActorAction to take the next message off the message queue and to pass it on to the supplied closure.
* The method never returns, but instead frees the processing thread back to the thread pool.
*
* @param timeout Time in milliseconds to wait at most for a message to arrive. The actor terminates if a message doesn't arrive within the given timeout.
* @param timeUnit a TimeUnit determining how to interpret the timeout parameter
* @param code The code to handle the next message. The reply() and replyIfExists() methods are available inside
* the closure to send a reply back to the actor, which sent the original message.
*/
protected final void react(final long timeout, final TimeUnit timeUnit, final Closure code) {
react(timeUnit.toMillis(timeout), code);
}
/**
* Schedules an ActorAction to take the next message off the message queue and to pass it on to the supplied closure.
* The method never returns, but instead frees the processing thread back to the thread pool.
* Also adds reply() and replyIfExists() methods to the currentActor and the message.
* These methods will call send() on the target actor (the sender of the original message).
* The reply()/replyIfExists() methods invoked on the actor will be sent to all currently processed messages,
* reply()/replyIfExists() invoked on a message will send a reply to the sender of that particular message only.
*
* @param timeout Time in milliseconds to wait at most for a message to arrive. The actor terminates if a message doesn't arrive within the given timeout.
* @param code The code to handle the next message. The reply() and replyIfExists() methods are available inside
* the closure to send a reply back to the actor, which sent the original message.
*/
protected final void react(final long timeout, final Closure code) {
if (!isActorThread()) {
throw new IllegalStateException("Cannot call react from a thread which is not owned by the actor");
}
checkForNull(code);
checkForMessageHandlerArguments(code);
nextContinuation = enhanceClosure(code);
if (timeout >= 0L) setTimeout(timeout);
// throw ActorException.CONTINUE;
}
/**
* Not supported by DefaultActor
*
* @return same actor
*/
@Override
public Actor silentStart() {
throw new UnsupportedOperationException("Old actors cannot start silently. Use DefaultActor instead.");
}
/**
* Starts the Actor and sends it the START_MESSAGE to run any afterStart handlers.
* No messages can be sent or received before an Actor is started.
*
* @return same actor
*/
@Override
public Actor start() {
if (started) throw new IllegalStateException("The DefaultActor cannot be restarted.");
started = true;
return super.start();
}
/**
* Called once the START_MESSAGE arrives.
* We need to run the actor's body here, letting it set nextContinuation to hols the next message handler
*/
@Override
protected void handleStart() {
super.handleStart();
try {
final Runnable startCode = loopCode;
loopCode = null;
if (startCode != null) {
if (startCode instanceof Closure) {
final Closure closure = enhanceClosure((Closure) startCode);
closure.call();
} else {
startCode.run();
}
} else act();
if (nextContinuation == null) terminate();
} catch (IllegalStateException e) {
terminate();
throw e;
}
}
private Closure enhanceClosure(final Closure closure) {
final Closure cloned = (Closure) closure.clone();
if (cloned.getOwner() == cloned.getDelegate()) {
cloned.setResolveStrategy(Closure.DELEGATE_FIRST);
cloned.setDelegate(this);
} else {
cloned.setDelegate(new ForwardingDelegate(cloned.getDelegate(), this));
}
return cloned;
}
private static void checkForNull(final Runnable code) {
if (code == null)
throw new IllegalArgumentException("An actor's message handlers and loops cannot be set to a null value.");
}
private static void checkForBodyArguments(final Closure closure) {
if (closure.getMaximumNumberOfParameters() > 1)
throw new IllegalArgumentException("An actor's body as well as a body of a loop can only expect 0 arguments. " + closure.getMaximumNumberOfParameters() + EXPECTED);
}
private static void checkForMessageHandlerArguments(final Closure code) {
if (code.getMaximumNumberOfParameters() > 1)
throw new IllegalArgumentException("An actor's message handler can only expect 0 or 1 argument. " + code.getMaximumNumberOfParameters() + EXPECTED);
}
private static final String EXPECTED = " expected.";
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a7e2a56c4edac76967c6da40b9c65e8c97f8a32a | 9fc95e8b8273f9f2e6bfc5a937cdeb89033ca43d | /src/com/empadmin/server/classes/InternationalEmployeeType.java | c3fbf975928dd080c74f41fc8eb115fbe38ab278 | [] | no_license | mahdera/sandfordHR | eb7b3f96b95a94f9c9784199be05c0f4c1a9a397 | 5baad2ef7864189f401cb277cf1b8c02dd0a9754 | refs/heads/master | 2021-01-01T17:43:01.125913 | 2014-07-21T13:57:35 | 2014-07-21T13:57:35 | 22,066,394 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,361 | java | /**
*
*/
package com.empadmin.server.classes;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
/**
* @author Mahder on macbook Pro
*
*/
public class InternationalEmployeeType {
private long id;
private long employeeId;
private String employementType;
private int modifiedBy;
private Date modificationDate;
/**
*
*/
public InternationalEmployeeType() {
}
/**
* @param employeeId
* @param employementType
* @param modifiedBy
* @param modificationDate
*/
public InternationalEmployeeType(long employeeId, String employementType,
int modifiedBy, Date modificationDate) {
this.employeeId = employeeId;
this.employementType = employementType;
this.modifiedBy = modifiedBy;
this.modificationDate = modificationDate;
}
/**
* @param id
* @param employeeId
* @param employementType
* @param modifiedBy
* @param modificationDate
*/
public InternationalEmployeeType(long id, long employeeId,
String employementType, int modifiedBy, Date modificationDate) {
this.id = id;
this.employeeId = employeeId;
this.employementType = employementType;
this.modifiedBy = modifiedBy;
this.modificationDate = modificationDate;
}
/**
* @return the id
*/
public long getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(long id) {
this.id = id;
}
/**
* @return the employeeId
*/
public long getEmployeeId() {
return employeeId;
}
/**
* @param employeeId
* the employeeId to set
*/
public void setEmployeeId(long employeeId) {
this.employeeId = employeeId;
}
/**
* @return the employementType
*/
public String getEmployementType() {
return employementType;
}
/**
* @param employementType
* the employementType to set
*/
public void setEmployementType(String employementType) {
this.employementType = employementType;
}
/**
* @return the modifiedBy
*/
public int getModifiedBy() {
return modifiedBy;
}
/**
* @param modifiedBy
* the modifiedBy to set
*/
public void setModifiedBy(int modifiedBy) {
this.modifiedBy = modifiedBy;
}
/**
* @return the modificationDate
*/
public Date getModificationDate() {
return modificationDate;
}
/**
* @param modificationDate
* the modificationDate to set
*/
public void setModificationDate(Date modificationDate) {
this.modificationDate = modificationDate;
}
public void save() {
try {
String sqlStr = "insert into tbl_international_employee_type values(?,?,?,?,?)";
PreparedStatement pStmt = DBConnection.getPreparedStatement(sqlStr);
pStmt.setLong(1, 0);
pStmt.setLong(2, this.getEmployeeId());
pStmt.setString(3, this.getEmployementType());
pStmt.setInt(4, this.getModifiedBy());
pStmt.setDate(5, this.getModificationDate());
DBConnection.writeToDatabase(pStmt);
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.disconnectDatabase();
}
}
public void update(InternationalEmployeeType internationalEmployeeType) {
try {
String sqlStr = "update tbl_international_employee_type set employee_id = ?, employment_type = ?," +
"modified_by = ?, modification_date = ? where id = ?";
PreparedStatement pStmt = DBConnection.getPreparedStatement(sqlStr);
pStmt.setLong(1, internationalEmployeeType.getEmployeeId());
pStmt.setString(2, internationalEmployeeType.getEmployementType());
pStmt.setInt(3, internationalEmployeeType.getModifiedBy());
pStmt.setDate(4, internationalEmployeeType.getModificationDate());
pStmt.setLong(5, internationalEmployeeType.getId());
DBConnection.writeToDatabase(pStmt);
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.disconnectDatabase();
}
}
public static List<InternationalEmployeeType> getAllInternationalEmployeeTypes() {
List<InternationalEmployeeType> list = new ArrayList<InternationalEmployeeType>();
InternationalEmployeeType internationalEmployeeType = null;
try {
String query = "select * from tbl_international_employee_type order by modification_date desc";
ResultSet rSet = DBConnection.readFromDatabase(query);
while(rSet.next()){
internationalEmployeeType = new InternationalEmployeeType(rSet.getLong("id"), rSet.getLong("employee_id"),
rSet.getString("employement_type"), rSet.getInt("modified_by"), rSet.getDate("modification_date"));
list.add(internationalEmployeeType);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.disconnectDatabase();
}
return list;
}
public static InternationalEmployeeType getInternationalEmployeeType(long id) {
InternationalEmployeeType internationalEmployeeType = null;
try {
String query = "select * from tbl_international_employee_type where id = "+id;
ResultSet rSet = DBConnection.readFromDatabase(query);
while(rSet.next()){
internationalEmployeeType = new InternationalEmployeeType(rSet.getLong("id"), rSet.getLong("employee_id"),
rSet.getString("employement_type"), rSet.getInt("modified_by"), rSet.getDate("modification_date"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.disconnectDatabase();
}
return internationalEmployeeType;
}
}// end class
| [
"mahder.neway@echoorigin.com"
] | mahder.neway@echoorigin.com |
dce9a13dd0201e1cc57d209d505336467aceaa33 | ba06c066cd04bff86f203b5036a0b2f9801fccdc | /src/main/java/com/fitzgerald_gmbh/sakuracalendar/EventType.java | 38564addb245075a7168c43628676e397272618a | [] | no_license | GingerFitzgerald/SakuraCalendar | 4b2ea2e17e6e2abbf59488c0cf58531669f74532 | ae42e1e7d0c4cfdc62bf27e5230a54da76dea0cb | refs/heads/master | 2021-01-15T16:57:38.847631 | 2014-11-16T21:04:29 | 2014-11-16T21:04:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package com.fitzgerald_gmbh.sakuracalendar;
import java.awt.Color;
/**
* Class representing EventType.
* @author Kevin Kußmaul
* @version 1.0
*/
class EventType {
private String name;
private Color backgroundColor;
public EventType(String name, Color backgroundColor) {
this.name = name;
this.backgroundColor = backgroundColor;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Color getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(Color backgroundColor) {
this.backgroundColor = backgroundColor;
}
} | [
"Ginger-Fitzgerald@web.de"
] | Ginger-Fitzgerald@web.de |
cce5368859e6b94cbaf6eabde5cfd2cdca9c9ea4 | d8f45363fa00c90fa31e12eae009e412d44fa017 | /src/main/java/com/signal/demo/common/log/SipLogger.java | 7db23c4b403ef98949f4dfb16f5eaf4adf04e8ee | [] | no_license | youjin419/sipdemo | c7d09ff062bc8d391e99fe4570efd1ae6a1d9c76 | d155e5e2a4c3798b183c5d4f714e47ee3fb19a64 | refs/heads/master | 2021-07-04T16:16:38.088640 | 2019-05-27T02:53:49 | 2019-05-27T02:53:49 | 187,941,882 | 0 | 0 | null | 2020-10-13T13:22:36 | 2019-05-22T01:44:44 | Java | UTF-8 | Java | false | false | 191 | java | package com.signal.demo.common.log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SipLogger {
public Logger logger = LoggerFactory.getLogger(this.getClass());
}
| [
"youjin_419@uangel.com"
] | youjin_419@uangel.com |
e14701f6f120c7196b82cbcbb69090a6dae5cc38 | 3bbef59cef198c8f9f38558521a95e5ec670111b | /src/main/java/be/testing/configuration/spring/profiles/UnitResourceTest.java | 0bdbdd641ccb5ffb861a5b99235081a9d0965834 | [] | no_license | bussury/unit-testing | 68b59e961d3825504349fb3f33d16ae4e679ca50 | 3f407a9a930dad6d083724463f27205460b255d8 | refs/heads/master | 2021-01-16T22:31:30.006957 | 2013-04-04T19:31:59 | 2013-04-04T19:31:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package be.testing.configuration.spring.profiles;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Profile;
/**
* @author Koen Serneels
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Profile(UnitResourceTest.name)
public @interface UnitResourceTest {
public static String name = "unit-resource-test";
}
| [
"koen.serneels@skynet.be"
] | koen.serneels@skynet.be |
410646acab6c922f518b7fdf91d23674fada60f0 | b6a5135447c0a72a4bab67bf0e094442c649d05b | /src/main/java/testngPrac/testngp/enums/OS.java | b6746f90a8e95d261d863acf14218c55c6229410 | [] | no_license | Lifesorted/testngp | 5b0b10275eda9d9bb9fd8544b57fb5c563898d7d | c57e6b2643cb4ec002f381f35c62b5c998c9bcee | refs/heads/master | 2023-02-12T01:38:00.693704 | 2021-01-17T09:38:06 | 2021-01-17T09:38:06 | 320,145,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 77 | java | package testngPrac.testngp.enums;
public enum OS {
WINDOW,
MAC,
LINUX
}
| [
"mailmeshailendrakumar@gmail.com"
] | mailmeshailendrakumar@gmail.com |
5899eeac61209b06cafd879ffb253c938eb527f5 | 34e4be0ca22be68cdda46896d2b78f001afb5a94 | /app/src/androidTest/java/emirim0223/kr/hs/emirim/relativelayouttest/ExampleInstrumentedTest.java | 748af4a73d4f5d05653112bb2a51fd8034ca2b73 | [] | no_license | hayoung9000/RelativeLayoutTest | 78fe9d49567a5b4927a4b8bdc6fed0cf83bd887a | f1523bfdcbb5e3e023a3f756fecacbb0e265fdc4 | refs/heads/master | 2021-01-19T00:26:31.393741 | 2017-04-04T11:12:30 | 2017-04-04T11:12:30 | 87,170,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | package emirim0223.kr.hs.emirim.relativelayouttest;
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("emirim0223.kr.hs.emirim.relativelayouttest", appContext.getPackageName());
}
}
| [
"wjsgkdud9000@naver.com"
] | wjsgkdud9000@naver.com |
0c84fc5cdd0661a629e7fcad2e895d16ff8af534 | 13bf45c904dacdee1924804904ea2064e1680fd5 | /app/src/main/java/com/example/tahmid/hydroponicapp/AnimatedReadings.java | 8fb1d07ca57c096ac09ba109b2cdfb3c8ea16049 | [] | no_license | Tahmid46/HydroponicApp | d12b5130d562696f59e8ea620e7f4cdf28d25912 | 19c32f0c24a8f90e1b88d931e14f94880f652468 | refs/heads/master | 2020-05-15T19:36:00.048094 | 2019-09-04T16:15:38 | 2019-09-04T16:15:38 | 182,459,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,649 | java | package com.example.tahmid.hydroponicapp;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.text.DecimalFormat;
import java.util.Random;
import de.nitri.gauge.Gauge;
import me.itangqi.waveloadingview.WaveLoadingView;
public class AnimatedReadings extends AppCompatActivity {
private DatabaseReference databaseReference;
private FirebaseUser user;
private TextView humtv,lighttv,phtv,temptv,wleveltv,wtemptv;
private Thermometer amb_thermometer,w_thermometer;
private float temperature;
private Gauge gauge;
// public int flag=0;
// private static DecimalFormat df2 = new DecimalFormat("#.##");
private WaveLoadingView waveLoadingView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_animated_readings);
humtv=findViewById(R.id.hId);
lighttv=findViewById(R.id.lId);
phtv=findViewById(R.id.ph);
temptv=findViewById(R.id.aTempTid);
wleveltv=findViewById(R.id.wLevel);
wtemptv=findViewById(R.id.wTempId);
amb_thermometer=findViewById(R.id.Athermometer);
w_thermometer=findViewById(R.id.Wthermometer);
gauge=findViewById(R.id.gauge);
waveLoadingView=findViewById(R.id.wlv);
user=FirebaseAuth.getInstance().getCurrentUser();
databaseReference=FirebaseDatabase.getInstance().getReference("Users/"+user.getUid()+"/"+"Values");
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
String hum=dataSnapshot.child("hum").getValue().toString();
String light=dataSnapshot.child("light").getValue().toString();
String ph=dataSnapshot.child("ph").getValue().toString();
String temp=dataSnapshot.child("temp").getValue().toString();
String wlevel=dataSnapshot.child("wlevel").getValue().toString();
String wtemp=dataSnapshot.child("wtemp").getValue().toString();
Random random=new Random();
double ran=Math.random();
if(ran<0.5){
double h=(Double.parseDouble(hum)+ran)-40.0;
humtv.setText(String.format("%.2f",h)+"%");
gauge.moveToValue((float)h);
//hum=Double.toString(h);
}
else{
double h=(Double.parseDouble(hum)-ran)-40.0;
humtv.setText(String.format("%.2f",h)+"%");
gauge.moveToValue((float)h);
//hum=Double.toString(h);
}
lighttv.setText(light);
phtv.setText(String.format("%.2f",Float.parseFloat(ph)));
temptv.setText(temp+"\u00b0"+"C");
wtemptv.setText(wtemp+"\u00b0"+"C");
if(Integer.parseInt(wlevel)<300){
wleveltv.setText("Not Optimal");
}
else{
wleveltv.setText("Optimal");
}
amb_thermometer. setCurrentTemp(Float.parseFloat(temp));
w_thermometer.setCurrentTemp(Float.parseFloat(wtemp));
// gauge.moveToValue(Float.parseFloat(hum));
if(Float.parseFloat(wlevel)<100){
waveLoadingView.setBottomTitle(String.format("%d%%",Integer.parseInt(wlevel)));
waveLoadingView.setCenterTitle("");
waveLoadingView.setTopTitle("");
//waveLoadingView.setProgressValue(Integer.parseInt(wlevel));
}
if(Float.parseFloat(wlevel)<250){
waveLoadingView.setBottomTitle("");
waveLoadingView.setCenterTitle(String.format("%d%%",Integer.parseInt(wlevel)));
waveLoadingView.setTopTitle("");
//waveLoadingView.setProgressValue(Integer.parseInt(wlevel));
}
else{
waveLoadingView.setBottomTitle("");
waveLoadingView.setCenterTitle("");
waveLoadingView.setTopTitle(String.format("%d%%",Integer.parseInt(wlevel)));
//waveLoadingView.setProgressValue(Integer.parseInt(wlevel));
//waveLoadingView.setProgressValue(200);
}
Toast.makeText(getApplicationContext(), "Data fetched", Toast.LENGTH_SHORT).show();
// Toast.makeText(getApplicationContext(),hum+" "+light+" "+ph+" "+temp+" "+wlevel+" "+wtemp,Toast.LENGTH_LONG).show();
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Toast.makeText(getApplicationContext(), "Failed", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.slide_in_left,R.anim.slide_out_right);
}
}
| [
"ashiqur.rahman1023@gmail.com"
] | ashiqur.rahman1023@gmail.com |
d0b8fdd7d0965461565da435519f12484364d86d | d04625d1afdeaf8ab964e74c795afc803de1127d | /src/main/java/com/desafio/backend/tarefa/model/CadastrarUsuarioRequest.java | e02cdd5a72977c8bb26fc8933e3c468bdcedd99f | [] | no_license | regisferneda/desafio-backend-tarefa | 88c5de4a1066ab02ae5ed407ab83db4324512b5f | 7d8cb2c46af16e154438c1c99428c7aa9efd7065 | refs/heads/main | 2023-07-30T07:41:39.368444 | 2021-09-20T00:10:48 | 2021-09-20T00:10:48 | 408,264,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package com.desafio.backend.tarefa.model;
import com.fasterxml.jackson.annotation.JsonProperty;
public class CadastrarUsuarioRequest {
@JsonProperty("nome_usuario")
String nome;
@JsonProperty("email_usuario")
String email;
@JsonProperty("senha_usuario")
String senha;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
}
| [
"regis_ferneda@hotmail.com"
] | regis_ferneda@hotmail.com |
9e1bd24a5f6955807ebfa5207461adf7da666a31 | b6a665a179e9ce33ef6b8082d912bbde4006ed0d | /app/web/controller/src/main/java/com/xiaowei/config/JwtProperties.java | a43f878f8828a749d80e5a63c6d99868541f4311 | [] | no_license | kanshunfu123/springBootgetaway | c74246549246ffa5a6a1817db91786864a3dd17b | 2f41868847220f814cc8ad905566425814f50723 | refs/heads/master | 2020-05-17T23:06:10.846791 | 2019-04-29T07:31:17 | 2019-04-29T07:31:17 | 184,021,192 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,947 | java | package com.xiaowei.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
* jwt相关配置
*/
@Configuration
@ConfigurationProperties(prefix = JwtProperties.JWT_PREFIX)
@PropertySource(value = "classpath:config/jwt.properties",encoding = "UTF-8")
public class JwtProperties {
public static final String JWT_PREFIX = "jwt";
@Value("${jwt.header}")
private String header = "Authorization";
@Value("${jwt.secret}")
private String secret = "mySecret";
@Value("${jwt.expiration}")
private Long expiration = 604800L;
@Value("${jwt.auth-path}")
private String authPath = "auth";
@Value("${jwt.md5-key}")
private String md5Key = "randomKey";
@Value("${jwt.ignore-url}")
private String ignoreUrl = "";
public String getIgnoreUrl() {
return ignoreUrl;
}
public void setIgnoreUrl(String ignoreUrl) {
this.ignoreUrl = ignoreUrl;
}
public static String getJwtPrefix() {
return JWT_PREFIX;
}
public String getHeader() {
return header;
}
public void setHeader(String header) {
this.header = header;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public Long getExpiration() {
return expiration;
}
public void setExpiration(Long expiration) {
this.expiration = expiration;
}
public String getAuthPath() {
return authPath;
}
public void setAuthPath(String authPath) {
this.authPath = authPath;
}
public String getMd5Key() {
return md5Key;
}
public void setMd5Key(String md5Key) {
this.md5Key = md5Key;
}
}
| [
"995234952@qq.com"
] | 995234952@qq.com |
af9699f9b1c0a8748459a5ffa78058f8d0133691 | 0650c73b8091355640c7a4df4f22b7bf2e3ba9b7 | /src/step05_array/step05_01.java | 0eb4478365cbc4a456b20fe0d802c760451793cf | [] | no_license | choahkimm/baekjoonJava | 594e57c49ba6af811061908292b453631784b65b | a4dcc2bd1855fc4b11329e8ceb8e66ccb14a2815 | refs/heads/main | 2023-07-07T07:27:20.647439 | 2021-07-16T09:15:38 | 2021-07-16T09:15:38 | 384,122,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 263 | java | package step05_array;
public class step05_01
{
public static void main(String[] args)
// 10818번. 최소,최대
// 첫째 줄에 주어진 정수 N개의 최솟값과 최댓값을 공백으로 구분해 출력한다.
{
}
}
| [
"choahk.dev@gmail.com"
] | choahk.dev@gmail.com |
3cdb45fc1f511824c35525389becd24f5305561b | 28f10e2ececf46fbdc461646bfca4ba574f79a25 | /blogpessoal/src/main/java/org/generation/blogpessoal/seguranca/UserDetailsImpl.java | b3ab9c1f0ef79d22211fbabb8ccf0f6916b9d05d | [] | no_license | alele43/exerciciosSpringBoot | 1b2655c63e13e21fa0e3be34ab2681093dd6a16f | 047086c5fc9c100f3ef805e06a0cffc6888535b5 | refs/heads/main | 2023-07-04T04:30:29.379875 | 2021-08-09T18:45:38 | 2021-08-09T18:45:38 | 388,864,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,322 | java | package org.generation.blogpessoal.seguranca;
import java.util.Collection;
import org.generation.blogpessoal.model.Usuario;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
public class UserDetailsImpl implements UserDetails{
private static final long serialVersionUID = 1L;
private String userName;
private String password;
public UserDetailsImpl(Usuario user) {
this.userName = user.getUsuario();
this.password = user.getSenha();
}
public UserDetailsImpl() {}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getPassword() {
// TODO Auto-generated method stub
return password;
}
@Override
public String getUsername() {
// TODO Auto-generated method stub
return userName;
}
@Override
public boolean isAccountNonExpired() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isAccountNonLocked() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isCredentialsNonExpired() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isEnabled() {
// TODO Auto-generated method stub
return true;
}
}
| [
"alessandrasousa_43@hotmail.com"
] | alessandrasousa_43@hotmail.com |
30824b8c0c6b02cebd05c3366d1741bce40d1986 | bb2467e8b615cd98729bec01498505f23e2bf2f5 | /supergo-parent/supergo-pojo/src/main/java/com/supergo/common/pojo/Seller.java | fec7e595a94f10c253521c7faa0e3554a3b4e77a | [] | no_license | SuperHcl/study | 61e5f7722b514acbfebb4aa8c1c9ce092dbeaca8 | 95ecf96965750654c7802c1faf326f64216d0290 | refs/heads/master | 2023-08-17T00:19:29.523744 | 2023-08-07T08:11:40 | 2023-08-07T08:11:40 | 193,214,220 | 1 | 0 | null | 2023-03-03T07:45:52 | 2019-06-22T09:09:27 | Java | UTF-8 | Java | false | false | 13,822 | java | package com.supergo.common.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Table(name = "tb_seller")
@ApiModel(value = "seller对象", description = "商家实体类")
public class Seller implements Serializable {
/**
* 用户ID
*/
@Id
@Column(name = "seller_id")
@ApiModelProperty(value = "商家id", name = "sellerId", required = true, dataType = "String")
private String sellerId;
/**
* 公司名
*/
@Column(name = "name")
@ApiModelProperty(value = "公司名称",name = "name", dataType = "String")
private String name;
/**
* 店铺名称
*/
@Column(name = "nick_name")
@ApiModelProperty(value = "店铺名称",name = "nickName", dataType = "String")
private String nickName;
/**
* 密码
*/
@Column(name = "password")
@ApiModelProperty(value = "密码",name = "password", dataType = "String")
private String password;
/**
* EMAIL
*/
@Column(name = "email")
@ApiModelProperty(value = "邮箱",name = "email", dataType = "String")
private String email;
/**
* 公司手机
*/
@Column(name = "mobile")
@ApiModelProperty(value = "公司手机",name = "mobile", dataType = "String")
private String mobile;
/**
* 公司电话
*/
@Column(name = "telephone")
@ApiModelProperty(value = "公司电话",name = "telephone", dataType = "String")
private String telephone;
/**
* 状态
*/
@Column(name = "status")
@ApiModelProperty(value = "商家状态",name = "status", dataType = "String")
private String status;
/**
* 详细地址
*/
@Column(name = "address_detail")
@ApiModelProperty(value = "详细地址",name = "addressDetail", dataType = "String")
private String addressDetail;
/**
* 联系人姓名
*/
@Column(name = "linkman_name")
@ApiModelProperty(value = "联系人姓名",name = "linkmanName", dataType = "String")
private String linkmanName;
/**
* 联系人QQ
*/
@Column(name = "linkman_qq")
@ApiModelProperty(value = "联系人QQ",name = "linkmanQq", dataType = "String")
private String linkmanQq;
/**
* 联系人电话
*/
@Column(name = "linkman_mobile")
@ApiModelProperty(value = "联系人电话",name = "linkmanMobile", dataType = "String")
private String linkmanMobile;
/**
* 联系人EMAIL
*/
@Column(name = "linkman_email")
@ApiModelProperty(value = "联系人邮箱",name = "linkmanEmail", dataType = "String")
private String linkmanEmail;
/**
* 营业执照号
*/
@Column(name = "license_number")
@ApiModelProperty(value = "营业执照号",name = "licenseNumber", dataType = "String")
private String licenseNumber;
/**
* 税务登记证号
*/
@Column(name = "tax_number")
@ApiModelProperty(value = "税务登记证号",name = "taxNumber", dataType = "String")
private String taxNumber;
/**
* 组织机构代码
*/
@Column(name = "org_number")
@ApiModelProperty(value = "组织机构代码",name = "orgNumber", dataType = "String")
private String orgNumber;
/**
* 公司地址
*/
@Column(name = "address")
@ApiModelProperty(value = "公司地址",name = "address", dataType = "Long")
private Long address;
/**
* 公司LOGO图
*/
@Column(name = "logo_pic")
@ApiModelProperty(value = "公司LOGO图",name = "logoPic", dataType = "String")
private String logoPic;
/**
* 简介
*/
@Column(name = "brief")
@ApiModelProperty(value = "简介",name = "brief", dataType = "String")
private String brief;
/**
* 创建日期
*/
@Column(name = "create_time")
@ApiModelProperty(value = "创建日期",name = "createTime", dataType = "Date")
private Date createTime;
/**
* 法定代表人
*/
@Column(name = "legal_person")
@ApiModelProperty(value = "法定代表人",name = "legalPerson", dataType = "String")
private String legalPerson;
/**
* 法定代表人身份证
*/
@Column(name = "legal_person_card_id")
@ApiModelProperty(value = "法定代表人身份证",name = "legalPersonCardId", dataType = "String")
private String legalPersonCardId;
/**
* 开户行账号名称
*/
@Column(name = "bank_user")
@ApiModelProperty(value = "开户行账号名称",name = "bankUser", dataType = "String")
private String bankUser;
/**
* 开户行
*/
@Column(name = "bank_name")
@ApiModelProperty(value = "开户行",name = "bankName", dataType = "String")
private String bankName;
private static final long serialVersionUID = 1L;
/**
* 获取用户ID
*
* @return seller_id - 用户ID
*/
public String getSellerId() {
return sellerId;
}
/**
* 设置用户ID
*
* @param sellerId 用户ID
*/
public void setSellerId(String sellerId) {
this.sellerId = sellerId == null ? null : sellerId.trim();
}
/**
* 获取公司名
*
* @return name - 公司名
*/
public String getName() {
return name;
}
/**
* 设置公司名
*
* @param name 公司名
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* 获取店铺名称
*
* @return nick_name - 店铺名称
*/
public String getNickName() {
return nickName;
}
/**
* 设置店铺名称
*
* @param nickName 店铺名称
*/
public void setNickName(String nickName) {
this.nickName = nickName == null ? null : nickName.trim();
}
/**
* 获取密码
*
* @return password - 密码
*/
public String getPassword() {
return password;
}
/**
* 设置密码
*
* @param password 密码
*/
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
/**
* 获取EMAIL
*
* @return email - EMAIL
*/
public String getEmail() {
return email;
}
/**
* 设置EMAIL
*
* @param email EMAIL
*/
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
/**
* 获取公司手机
*
* @return mobile - 公司手机
*/
public String getMobile() {
return mobile;
}
/**
* 设置公司手机
*
* @param mobile 公司手机
*/
public void setMobile(String mobile) {
this.mobile = mobile == null ? null : mobile.trim();
}
/**
* 获取公司电话
*
* @return telephone - 公司电话
*/
public String getTelephone() {
return telephone;
}
/**
* 设置公司电话
*
* @param telephone 公司电话
*/
public void setTelephone(String telephone) {
this.telephone = telephone == null ? null : telephone.trim();
}
/**
* 获取状态
*
* @return status - 状态
*/
public String getStatus() {
return status;
}
/**
* 设置状态
*
* @param status 状态
*/
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
/**
* 获取详细地址
*
* @return address_detail - 详细地址
*/
public String getAddressDetail() {
return addressDetail;
}
/**
* 设置详细地址
*
* @param addressDetail 详细地址
*/
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail == null ? null : addressDetail.trim();
}
/**
* 获取联系人姓名
*
* @return linkman_name - 联系人姓名
*/
public String getLinkmanName() {
return linkmanName;
}
/**
* 设置联系人姓名
*
* @param linkmanName 联系人姓名
*/
public void setLinkmanName(String linkmanName) {
this.linkmanName = linkmanName == null ? null : linkmanName.trim();
}
/**
* 获取联系人QQ
*
* @return linkman_qq - 联系人QQ
*/
public String getLinkmanQq() {
return linkmanQq;
}
/**
* 设置联系人QQ
*
* @param linkmanQq 联系人QQ
*/
public void setLinkmanQq(String linkmanQq) {
this.linkmanQq = linkmanQq == null ? null : linkmanQq.trim();
}
/**
* 获取联系人电话
*
* @return linkman_mobile - 联系人电话
*/
public String getLinkmanMobile() {
return linkmanMobile;
}
/**
* 设置联系人电话
*
* @param linkmanMobile 联系人电话
*/
public void setLinkmanMobile(String linkmanMobile) {
this.linkmanMobile = linkmanMobile == null ? null : linkmanMobile.trim();
}
/**
* 获取联系人EMAIL
*
* @return linkman_email - 联系人EMAIL
*/
public String getLinkmanEmail() {
return linkmanEmail;
}
/**
* 设置联系人EMAIL
*
* @param linkmanEmail 联系人EMAIL
*/
public void setLinkmanEmail(String linkmanEmail) {
this.linkmanEmail = linkmanEmail == null ? null : linkmanEmail.trim();
}
/**
* 获取营业执照号
*
* @return license_number - 营业执照号
*/
public String getLicenseNumber() {
return licenseNumber;
}
/**
* 设置营业执照号
*
* @param licenseNumber 营业执照号
*/
public void setLicenseNumber(String licenseNumber) {
this.licenseNumber = licenseNumber == null ? null : licenseNumber.trim();
}
/**
* 获取税务登记证号
*
* @return tax_number - 税务登记证号
*/
public String getTaxNumber() {
return taxNumber;
}
/**
* 设置税务登记证号
*
* @param taxNumber 税务登记证号
*/
public void setTaxNumber(String taxNumber) {
this.taxNumber = taxNumber == null ? null : taxNumber.trim();
}
/**
* 获取组织机构代码
*
* @return org_number - 组织机构代码
*/
public String getOrgNumber() {
return orgNumber;
}
/**
* 设置组织机构代码
*
* @param orgNumber 组织机构代码
*/
public void setOrgNumber(String orgNumber) {
this.orgNumber = orgNumber == null ? null : orgNumber.trim();
}
/**
* 获取公司地址
*
* @return address - 公司地址
*/
public Long getAddress() {
return address;
}
/**
* 设置公司地址
*
* @param address 公司地址
*/
public void setAddress(Long address) {
this.address = address;
}
/**
* 获取公司LOGO图
*
* @return logo_pic - 公司LOGO图
*/
public String getLogoPic() {
return logoPic;
}
/**
* 设置公司LOGO图
*
* @param logoPic 公司LOGO图
*/
public void setLogoPic(String logoPic) {
this.logoPic = logoPic == null ? null : logoPic.trim();
}
/**
* 获取简介
*
* @return brief - 简介
*/
public String getBrief() {
return brief;
}
/**
* 设置简介
*
* @param brief 简介
*/
public void setBrief(String brief) {
this.brief = brief == null ? null : brief.trim();
}
/**
* 获取创建日期
*
* @return create_time - 创建日期
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置创建日期
*
* @param createTime 创建日期
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取法定代表人
*
* @return legal_person - 法定代表人
*/
public String getLegalPerson() {
return legalPerson;
}
/**
* 设置法定代表人
*
* @param legalPerson 法定代表人
*/
public void setLegalPerson(String legalPerson) {
this.legalPerson = legalPerson == null ? null : legalPerson.trim();
}
/**
* 获取法定代表人身份证
*
* @return legal_person_card_id - 法定代表人身份证
*/
public String getLegalPersonCardId() {
return legalPersonCardId;
}
/**
* 设置法定代表人身份证
*
* @param legalPersonCardId 法定代表人身份证
*/
public void setLegalPersonCardId(String legalPersonCardId) {
this.legalPersonCardId = legalPersonCardId == null ? null : legalPersonCardId.trim();
}
/**
* 获取开户行账号名称
*
* @return bank_user - 开户行账号名称
*/
public String getBankUser() {
return bankUser;
}
/**
* 设置开户行账号名称
*
* @param bankUser 开户行账号名称
*/
public void setBankUser(String bankUser) {
this.bankUser = bankUser == null ? null : bankUser.trim();
}
/**
* 获取开户行
*
* @return bank_name - 开户行
*/
public String getBankName() {
return bankName;
}
/**
* 设置开户行
*
* @param bankName 开户行
*/
public void setBankName(String bankName) {
this.bankName = bankName == null ? null : bankName.trim();
}
} | [
"157223522@qq.com"
] | 157223522@qq.com |
b90dc881acdb5e96281e7f001feaf7b30700c2c2 | 6fd9f2eccd8a803b347f447971305434d7211eb8 | /plugin/jreframeworker/src/jreframeworker/core/BuildFile.java | f2de7e2124ef0ad7682a0080c246bc21a90618d4 | [
"MIT"
] | permissive | clicknull/JReFrameworker | 1ed503d678eab8deb43fc7e01cd146bcabf018b0 | 0670755c7e840f469ee6e5da8ea8b02c9a621980 | refs/heads/master | 2021-01-13T05:54:18.727252 | 2017-06-18T23:28:24 | 2017-06-18T23:28:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,789 | java | package jreframeworker.core;
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import jreframeworker.log.Log;
public class BuildFile {
public static final String XML_BUILD_FILENAME = "jreframeworker.xml";
private File jrefXMLFile;
private BuildFile(File jrefXMLFile){
this.jrefXMLFile = jrefXMLFile;
}
/**
* Returns a set of all the target jars in the xml file
* @param buildFile
* @return
* @throws SAXException
* @throws IOException
* @throws ParserConfigurationException
*/
public Set<String> getTargets() throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(jrefXMLFile);
doc.getDocumentElement().normalize();
NodeList targets = doc.getElementsByTagName("target");
Set<String> results = new HashSet<String>();
for (int i = 0; i < targets.getLength(); i++) {
Element target = (Element) targets.item(i);
results.add(target.getAttribute("name"));
}
return results;
}
/**
* Adds a target jar to the build file
* @param buildFile
* @param targetJar
* @throws TransformerException
* @throws ParserConfigurationException
* @throws SAXException
* @throws IOException
*/
public void addTarget(String targetJarName) throws TransformerException, ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(jrefXMLFile);
doc.getDocumentElement().normalize();
if(!getTargets().contains(targetJarName)){
// add target
Element rootElement = doc.getDocumentElement();
Element target = doc.createElement("target");
rootElement.appendChild(target);
target.setAttribute("name", targetJarName);
// write the content into xml file
writeBuildFile(jrefXMLFile, doc);
}
}
/**
* Removes a target jar from the build file
* @param project
* @param targetJar
*/
public void removeTarget(String targetJarName) throws TransformerException, ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(jrefXMLFile);
doc.getDocumentElement().normalize();
// remove target
NodeList targets = doc.getElementsByTagName("target");
for (int i = 0; i < targets.getLength(); i++) {
Element target = (Element) targets.item(i);
if(target.getAttribute("name").equals(targetJarName)){
target.getParentNode().removeChild(target);
}
}
// write the content into xml file
writeBuildFile(jrefXMLFile, doc);
}
/**
* Adds an original classpath entry jar to the build file
* @param buildFile
* @param jarName
* @throws TransformerException
* @throws ParserConfigurationException
* @throws SAXException
* @throws IOException
*/
public void addOriginalClasspathEntry(String jarName) throws TransformerException, ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(jrefXMLFile);
doc.getDocumentElement().normalize();
if(!getOriginalClasspathEntries().contains(jarName)){
Element originalClasspath = (Element) doc.getElementsByTagName("original-classpath").item(0);
if(originalClasspath == null){
Element rootElement = doc.getDocumentElement();
originalClasspath = doc.createElement("original-classpath");
rootElement.appendChild(originalClasspath);
}
// add classpath entry
Element entry = doc.createElement("entry");
originalClasspath.appendChild(entry);
entry.setAttribute("library", jarName);
// write the content into xml file
writeBuildFile(jrefXMLFile, doc);
}
}
/**
* Removes an original jar classpath entry from the build file
* @param project
* @param jarName
*/
public void removeOriginalClasspathEntry(String jarName) throws TransformerException, ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(jrefXMLFile);
doc.getDocumentElement().normalize();
// remove target
NodeList targets = doc.getElementsByTagName("entry");
for (int i = 0; i < targets.getLength(); i++) {
Element target = (Element) targets.item(i);
if(target.getAttribute("library").equals(jarName)){
target.getParentNode().removeChild(target);
}
}
// write the content into xml file
writeBuildFile(jrefXMLFile, doc);
}
/**
* Returns a set of all the original classpath library entries
* @param buildFile
* @return
* @throws SAXException
* @throws IOException
* @throws ParserConfigurationException
*/
public Set<String> getOriginalClasspathEntries() throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(jrefXMLFile);
doc.getDocumentElement().normalize();
NodeList targets = doc.getElementsByTagName("entry");
Set<String> results = new HashSet<String>();
for (int i = 0; i < targets.getLength(); i++) {
Element target = (Element) targets.item(i);
results.add(target.getAttribute("library"));
}
return results;
}
/**
* Returns the existing build file or creates one if one does not exist
* @param project
* @return
* @throws JavaModelException
*/
public static BuildFile getOrCreateBuildFile(IJavaProject jProject) {
File buildXMLFile = new File(jProject.getProject().getLocation().toFile().getAbsolutePath() + File.separator + XML_BUILD_FILENAME);
if(buildXMLFile.exists()){
return new BuildFile(buildXMLFile);
} else {
return createBuildFile(jProject);
}
}
/**
* Creates a new build file
* @param project
* @return
* @throws JavaModelException
*/
public static BuildFile createBuildFile(IJavaProject jProject) {
try {
File buildXMLFile = new File(jProject.getProject().getLocation().toFile().getAbsolutePath() + File.separator + XML_BUILD_FILENAME);
String base = jProject.getProject().getLocation().toFile().getCanonicalPath();
String relativeBuildFilePath = buildXMLFile.getCanonicalPath().substring(base.length());
if(relativeBuildFilePath.charAt(0) == File.separatorChar){
relativeBuildFilePath = relativeBuildFilePath.substring(1);
}
Log.info("Created Build XML File: " + relativeBuildFilePath);
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
// root elements
Document doc = docBuilder.newDocument();
Element rootElement = doc.createElement("build");
doc.appendChild(rootElement);
// save the original classpath
Element originalClasspath = doc.createElement("original-classpath");
for(IClasspathEntry entry : jProject.getRawClasspath()){
Element originalClasspathEntry = doc.createElement("entry");
originalClasspathEntry.setAttribute("library", entry.getPath().toString());
}
rootElement.appendChild(originalClasspath);
// write the content into xml file
writeBuildFile(buildXMLFile, doc);
return new BuildFile(buildXMLFile);
} catch (ParserConfigurationException pce) {
Log.error("ParserConfigurationException", pce);
} catch (TransformerException tfe) {
Log.error("TransformerException", tfe);
} catch (IOException ioe) {
Log.error("IOException", ioe);
} catch (JavaModelException jme) {
Log.error("IOException", jme);
} catch (DOMException dome) {
Log.error("DOMException", dome);
}
throw new RuntimeException("Unable to create build file.");
}
/**
* Helper method to write a pretty-printed build xml file
* @param buildXMLFile
* @param doc
* @throws TransformerFactoryConfigurationError
* @throws TransformerConfigurationException
* @throws TransformerException
*/
private static void writeBuildFile(File buildXMLFile, Document doc) throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(buildXMLFile);
transformer.transform(source, result);
}
}
| [
"benjholla@gmail.com"
] | benjholla@gmail.com |
4e00c54362003308dfec21f0721165a02af4a448 | 0a6336496abdb49a8fbcbbbcad581c850356f018 | /src/main/java/org/openapitools/client/model/GetInternalTransactionByTransactionHashAndOperationIdR.java | f8eef2bb14b222aab6c457bf6b3e9b7d913080c4 | [] | no_license | Crypto-APIs/Crypto_APIs_2.0_SDK_Java | 8afba51f53a7a617d66ef6596010cc034a48c17d | 29bac849e4590c4decfa80458fce94a914801019 | refs/heads/main | 2022-09-24T04:43:37.066099 | 2022-09-12T17:38:13 | 2022-09-12T17:38:13 | 360,245,136 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 12,935 | java | /*
* CryptoAPIs
* Crypto APIs is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.
*
* The version of the OpenAPI document: 2021-03-20
* Contact: developers@cryptoapis.io
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.GetInternalTransactionByTransactionHashAndOperationIdRData;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import io.cryptoapis.sdk.JSON;
/**
* GetInternalTransactionByTransactionHashAndOperationIdR
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-09-12T15:09:18.638874Z[Etc/UTC]")
public class GetInternalTransactionByTransactionHashAndOperationIdR {
public static final String SERIALIZED_NAME_API_VERSION = "apiVersion";
@SerializedName(SERIALIZED_NAME_API_VERSION)
private String apiVersion;
public static final String SERIALIZED_NAME_REQUEST_ID = "requestId";
@SerializedName(SERIALIZED_NAME_REQUEST_ID)
private String requestId;
public static final String SERIALIZED_NAME_CONTEXT = "context";
@SerializedName(SERIALIZED_NAME_CONTEXT)
private String context;
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
private GetInternalTransactionByTransactionHashAndOperationIdRData data;
public GetInternalTransactionByTransactionHashAndOperationIdR() {
}
public GetInternalTransactionByTransactionHashAndOperationIdR apiVersion(String apiVersion) {
this.apiVersion = apiVersion;
return this;
}
/**
* Specifies the version of the API that incorporates this endpoint.
* @return apiVersion
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "2021-03-20", required = true, value = "Specifies the version of the API that incorporates this endpoint.")
public String getApiVersion() {
return apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public GetInternalTransactionByTransactionHashAndOperationIdR requestId(String requestId) {
this.requestId = requestId;
return this;
}
/**
* Defines the ID of the request. The `requestId` is generated by Crypto APIs and it's unique for every request.
* @return requestId
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "601c1710034ed6d407996b30", required = true, value = "Defines the ID of the request. The `requestId` is generated by Crypto APIs and it's unique for every request.")
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public GetInternalTransactionByTransactionHashAndOperationIdR context(String context) {
this.context = context;
return this;
}
/**
* In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user.
* @return context
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "yourExampleString", value = "In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user.")
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public GetInternalTransactionByTransactionHashAndOperationIdR data(GetInternalTransactionByTransactionHashAndOperationIdRData data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public GetInternalTransactionByTransactionHashAndOperationIdRData getData() {
return data;
}
public void setData(GetInternalTransactionByTransactionHashAndOperationIdRData data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetInternalTransactionByTransactionHashAndOperationIdR getInternalTransactionByTransactionHashAndOperationIdR = (GetInternalTransactionByTransactionHashAndOperationIdR) o;
return Objects.equals(this.apiVersion, getInternalTransactionByTransactionHashAndOperationIdR.apiVersion) &&
Objects.equals(this.requestId, getInternalTransactionByTransactionHashAndOperationIdR.requestId) &&
Objects.equals(this.context, getInternalTransactionByTransactionHashAndOperationIdR.context) &&
Objects.equals(this.data, getInternalTransactionByTransactionHashAndOperationIdR.data);
}
@Override
public int hashCode() {
return Objects.hash(apiVersion, requestId, context, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetInternalTransactionByTransactionHashAndOperationIdR {\n");
sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n");
sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
sb.append(" context: ").append(toIndentedString(context)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("apiVersion");
openapiFields.add("requestId");
openapiFields.add("context");
openapiFields.add("data");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("apiVersion");
openapiRequiredFields.add("requestId");
openapiRequiredFields.add("data");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to GetInternalTransactionByTransactionHashAndOperationIdR
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (GetInternalTransactionByTransactionHashAndOperationIdR.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in GetInternalTransactionByTransactionHashAndOperationIdR is not found in the empty JSON string", GetInternalTransactionByTransactionHashAndOperationIdR.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!GetInternalTransactionByTransactionHashAndOperationIdR.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetInternalTransactionByTransactionHashAndOperationIdR` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : GetInternalTransactionByTransactionHashAndOperationIdR.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString()));
}
if (jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString()));
}
if (jsonObj.get("context") != null && !jsonObj.get("context").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `context` to be a primitive type in the JSON string but got `%s`", jsonObj.get("context").toString()));
}
// validate the optional field `data`
if (jsonObj.getAsJsonObject("data") != null) {
GetInternalTransactionByTransactionHashAndOperationIdRData.validateJsonObject(jsonObj.getAsJsonObject("data"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!GetInternalTransactionByTransactionHashAndOperationIdR.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'GetInternalTransactionByTransactionHashAndOperationIdR' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<GetInternalTransactionByTransactionHashAndOperationIdR> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(GetInternalTransactionByTransactionHashAndOperationIdR.class));
return (TypeAdapter<T>) new TypeAdapter<GetInternalTransactionByTransactionHashAndOperationIdR>() {
@Override
public void write(JsonWriter out, GetInternalTransactionByTransactionHashAndOperationIdR value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public GetInternalTransactionByTransactionHashAndOperationIdR read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of GetInternalTransactionByTransactionHashAndOperationIdR given an JSON string
*
* @param jsonString JSON string
* @return An instance of GetInternalTransactionByTransactionHashAndOperationIdR
* @throws IOException if the JSON string is invalid with respect to GetInternalTransactionByTransactionHashAndOperationIdR
*/
public static GetInternalTransactionByTransactionHashAndOperationIdR fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, GetInternalTransactionByTransactionHashAndOperationIdR.class);
}
/**
* Convert an instance of GetInternalTransactionByTransactionHashAndOperationIdR to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
| [
"kristiyan.ivanov@menasoftware.com"
] | kristiyan.ivanov@menasoftware.com |
b2712bd66caa7afaf4c76a9660b04448a066188d | 4e16a6780f479bf703e240a1549d090b0bafc53b | /work/decompile-c69e3af0/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorRule.java | 4f50560db2d88b4a08e17ae6d339bf434dcf3c8c | [] | no_license | 0-Yama/ServLT | 559b683832d1f284b94ef4a9dbd4d8adb543e649 | b2153c73bea55fdd4f540ed2fba3a1e46ec37dc5 | refs/heads/master | 2023-03-16T01:37:14.727842 | 2023-03-05T14:55:51 | 2023-03-05T14:55:51 | 302,899,503 | 0 | 2 | null | 2020-10-15T10:51:21 | 2020-10-10T12:42:47 | JavaScript | UTF-8 | Java | false | false | 2,567 | java | package net.minecraft.world.level.levelgen.structure.templatesystem;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.UnmodifiableIterator;
import com.mojang.serialization.Codec;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPosition;
import net.minecraft.util.MathHelper;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.IWorldReader;
import net.minecraft.world.level.block.state.IBlockData;
public class DefinedStructureProcessorRule extends DefinedStructureProcessor {
public static final Codec<DefinedStructureProcessorRule> CODEC = DefinedStructureProcessorPredicates.CODEC.listOf().fieldOf("rules").xmap(DefinedStructureProcessorRule::new, (definedstructureprocessorrule) -> {
return definedstructureprocessorrule.rules;
}).codec();
private final ImmutableList<DefinedStructureProcessorPredicates> rules;
public DefinedStructureProcessorRule(List<? extends DefinedStructureProcessorPredicates> list) {
this.rules = ImmutableList.copyOf(list);
}
@Nullable
@Override
public DefinedStructure.BlockInfo processBlock(IWorldReader iworldreader, BlockPosition blockposition, BlockPosition blockposition1, DefinedStructure.BlockInfo definedstructure_blockinfo, DefinedStructure.BlockInfo definedstructure_blockinfo1, DefinedStructureInfo definedstructureinfo) {
RandomSource randomsource = RandomSource.create(MathHelper.getSeed(definedstructure_blockinfo1.pos));
IBlockData iblockdata = iworldreader.getBlockState(definedstructure_blockinfo1.pos);
UnmodifiableIterator unmodifiableiterator = this.rules.iterator();
DefinedStructureProcessorPredicates definedstructureprocessorpredicates;
do {
if (!unmodifiableiterator.hasNext()) {
return definedstructure_blockinfo1;
}
definedstructureprocessorpredicates = (DefinedStructureProcessorPredicates) unmodifiableiterator.next();
} while (!definedstructureprocessorpredicates.test(definedstructure_blockinfo1.state, iblockdata, definedstructure_blockinfo.pos, definedstructure_blockinfo1.pos, blockposition1, randomsource));
return new DefinedStructure.BlockInfo(definedstructure_blockinfo1.pos, definedstructureprocessorpredicates.getOutputState(), definedstructureprocessorpredicates.getOutputTag());
}
@Override
protected DefinedStructureStructureProcessorType<?> getType() {
return DefinedStructureStructureProcessorType.RULE;
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
687950f19b445561474a79bfe585bd7ae2b4d2c6 | ad1e54acc9f30faabe6e9e5f22dded947dcf1ae4 | /app/src/main/java/samples/exoguru/materialtabs/common/Activities/LodingActivity.java | 4abb25e21bb0350054dbff3c640784d0e9b616e2 | [] | no_license | langloam/LittleMarketKeeper | 2fda7f1a6291ecb472c85791adeec64306d67797 | 1173378c7a35d0ef76f66dd4481f3ed3810af1c3 | refs/heads/master | 2021-01-10T08:06:57.999613 | 2015-11-05T16:16:11 | 2015-11-05T16:16:11 | 43,146,631 | 0 | 0 | null | 2015-11-05T09:01:02 | 2015-09-25T14:00:12 | Java | UTF-8 | Java | false | false | 2,432 | java | package samples.exoguru.materialtabs.common.Activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Message;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import samples.exoguru.materialtabs.MainActivity;
import samples.exoguru.materialtabs.R;
public class LodingActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loding);
// animFadein = AnimationUtils.loadAnimation(getApplicationContext(),
// R.anim.fade_in);
handler.sendMessageDelayed(new Message(), 2500);
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
Intent intent = new Intent();
intent.setClass(LodingActivity.this, MainActivity.class);
LodingActivity.this.startActivity(intent);
LodingActivity.this.finish();
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
/**
overridePendingTransition 畫面轉場效果
(實現淡入淡出的效果)android.R.anim.fade_in, android.R.anim.fade_out;
(由左向右滑入的效果)android.R.anim.slide_in_left, android.R.anim.slide_out_right
(由上向下滑入的效果)android.R.anim.slide_in_up, android.R.anim.slide_out_down
**/
}
};
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_loding, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"lansheu3@gmail.com"
] | lansheu3@gmail.com |
2b484b4a5d13fafd0959c0af38b6824208fffbaf | 6b4cdc6e5c461ed4ab0490de5a0e7e66a6a7d26f | /OpaAPI/src/main/java/gov/nara/opa/api/validation/constraint/UserNameDoesNotExistAlready.java | f6f20486d82a0ed7513f6653b6a21287a3513d3d | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | usnationalarchives/catalog-source | c281dd2963cc204313202c7d9bc2b4e5a942f089 | 74187b9096a388c033ff1f5ca4ec6634b5bba69e | refs/heads/master | 2022-12-23T10:25:40.725697 | 2018-10-01T14:34:56 | 2018-10-01T14:34:56 | 151,100,359 | 5 | 0 | NOASSERTION | 2022-12-16T01:33:10 | 2018-10-01T14:15:31 | Java | UTF-8 | Java | false | false | 923 | java | package gov.nara.opa.api.validation.constraint;
import gov.nara.opa.api.system.ErrorConstants;
import gov.nara.opa.api.system.OpaErrorCodeConstants;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
@Documented
@Constraint(validatedBy = gov.nara.opa.api.validation.constraint.validator.UserNameDoesNotExistAlreadyConstraintValidator.class)
@Target({ ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface UserNameDoesNotExistAlready {
String message() default ErrorConstants.USER_NAME_ALREADY_EXISTS;
String errorCode() default OpaErrorCodeConstants.USER_EXISTS;
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
| [
"jason.clingerman@nara.gov"
] | jason.clingerman@nara.gov |
651fa13ef43b2c6b0b5748ccc366a68bbf513810 | 12c0227082af6074993d9f270223f73004574f48 | /src/com/Kunal/Hibernate/Author_Address.java | 59f7fffa451d58dbd42ecbca4d4116105b8dfabd | [] | no_license | Kunal007gola/Hibernate_Assignment | 7081d5d40141d82152552628483334f4744967cb | cf8d452123d538e87ca893095f89b55389a17c3a | refs/heads/master | 2020-03-21T09:49:48.060004 | 2018-06-24T20:13:17 | 2018-06-24T20:13:17 | 138,419,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 868 | java | package com.Kunal.Hibernate;
import javax.persistence.Column;
import javax.persistence.Embeddable;
@Embeddable
public class Author_Address {
@Column(name="house_number")
private int houseNo;
private String street;
private String city;
private String state;
private int pin;
public int getHouseNo() {
return houseNo;
}
public void setHouseNo(int houseNo) {
this.houseNo = houseNo;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public int getPin() {
return pin;
}
public void setPinCode(int pin) {
this.pin = pin;
}
} | [
"kunalgola64@gmail.com"
] | kunalgola64@gmail.com |
265d6b7a0a5001bb171f188de27d7aa0c82fc1b9 | ff55155f7cb83bfdb93ae9981188293112492220 | /Java code sample/PreqKpiAgentH/src/test/java/com/tsmc/prequal/dao/SalesDaoTest.java | bbd9b055608d010674b6788ae5e0b1d839c5ed01 | [] | no_license | yc-star-inc/Springboot-test | c6c193a36243b228a426946f9a40977e662bce69 | c6e92c8cca14284eedcd939ca8bebaf74785246e | refs/heads/main | 2023-09-01T05:56:02.379201 | 2021-10-11T15:21:20 | 2021-10-11T15:21:20 | 345,296,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,625 | java | package com.tsmc.prequal.dao;
import static org.junit.jupiter.api.Assertions.*;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import com.tsmc.prequal.demo.dao.SalesDao;
import com.tsmc.prequal.demo.po.Sale;
class SalesDaoTest {
private String DsString = "jdbc:oracle:thin:@//localhost:1521/xepdb1";
private String DsUserName = "ppmsappl";
private String DsPassword = "ppmsappla";
private SalesDao dao;
@BeforeEach
void setUp() throws Exception {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUrl(this.DsString);
dataSource.setUsername(this.DsUserName);
dataSource.setPassword(this.DsPassword);
dataSource.setDriverClassName("oracle.jdbc.OracleDriver");
dao = new SalesDao(new JdbcTemplate(dataSource));
}
@Test
void testList() {
List<Sale> listSale = dao.List();
assertFalse(listSale.isEmpty());
}
@Test
void testSave() {
Sale sale = new Sale("Cooler Fan", 1, 49.99f);
dao.save(sale);
}
//@Test
void testGet() {
int id = 41;
Sale sale = dao.get(id) ;
assertNotNull(sale);
}
@Test
void testUpdate() {
Sale sale = new Sale();
sale.setId(81);
sale.setItem("Fried Checken New");
sale.setQuantity(4);
sale.setAmount(20);
dao.update(sale);
}
@Test
void testDelete() {
int id = 41;
dao.deleteSale(id);
}
@Test
void testDeleteByItem() {
String itemString = "Cooler Fan";
dao.deleteSaleByItemName(itemString);
}
}
| [
"yuchien.weng@gmail.com"
] | yuchien.weng@gmail.com |
8e6defaace41189adc073a6578425b67bce1638f | 52f1aaffa0ee334a3a1a96276d6c90c98e6edffa | /src/test/java/cn/zhang/crud/test/SimpleTest.java | f128d14e37a43f6fecc0a20f4515eda25edc3bbc | [] | no_license | superRainGit/complexssm | c1fc5d9a167e99a9e67abff95587660a2b8483d9 | 8348a2994f14f177fbdb7b170c7d35a2824ff8f0 | refs/heads/master | 2021-01-20T08:27:03.307623 | 2017-08-28T00:39:49 | 2017-08-28T00:39:49 | 101,560,731 | 0 | 0 | null | 2017-08-27T15:18:49 | 2017-08-27T15:13:21 | Java | UTF-8 | Java | false | false | 1,683 | java | package cn.zhang.crud.test;
import java.sql.SQLException;
import java.util.UUID;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.zhang.crud.bean.Employee;
import cn.zhang.crud.dao.DepartmentMapper;
import cn.zhang.crud.dao.EmployeeMapper;
@SuppressWarnings("all")
@RunWith(value=SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:applicationContext.xml"})
public class SimpleTest {
private static final Logger logger = LogManager.getLogger(SimpleTest.class.getName());
@Autowired
private DataSource dataSource;
@Autowired
private DepartmentMapper departmentMapper;
@Autowired
private EmployeeMapper employeeMapper;
@Autowired
private SqlSession sqlSession;
@Test
public void testInsert() {
// departmentMapper.insertSelective(new Department(null, "开发部"));
// departmentMapper.insertSelective(new Department(null, "人事部"));
// departmentMapper.insertSelective(new Department(null, "测试部"));
// EmployeeMapper mapper = sqlSession.getMapper(EmployeeMapper.class);
// for(int i = 0; i < 10000; i++) {
// String uid = UUID.randomUUID().toString().substring(0, 6);
// mapper.insert(new Employee(null, uid, "M", uid + "@163.com", 1));
// }
}
@Test
public void testDruidDataSource() throws SQLException {
logger.info(dataSource.getConnection());
}
}
| [
"1071471538@qq.com"
] | 1071471538@qq.com |
233e0de774bd4b6aa0ba86348c07ff5cc586b8b3 | 6aef26bb43231084b52d88faa9eeef2369e754cc | /QuickSort.java | 2b2d91bff5922732649941e3e539416bbbbc7e75 | [] | no_license | adeebafatima/Basic-Algorithms-Implementation | 7a6ee25a1312bfcb034c90ca66c25ed0876cf86c | 468a2d8fba0e87382a200d44683b2e01f9192e2f | refs/heads/master | 2021-04-18T21:30:20.085445 | 2018-05-19T09:51:32 | 2018-05-19T09:51:32 | 126,570,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,017 | java | import java.util.Scanner;
class QuickSort{
public static int partition(int A[],int p,int r){
int key=A[r];
int j=p;
int i=p-1;
while(j<=r-1){
if(A[j]<=key){
i=i+1;
int temp=A[i];
A[i]=A[j];
A[j]=temp;
}
j++;
}
i=i+1;
int temp2=A[i];
A[i]=A[r];
A[r]=temp2;
return i;
}
public static int[]quickSort(int A[],int p,int r){
if(p<r){
int q=partition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
return A;
}
public static void main(String args[]){
Scanner scan=new Scanner(System.in);
System.out.println("Enter number of elements of array: ");
int N=scan.nextInt();
System.out.println("Enter unsorted array");
int[] A = new int[N];
for(int i=0;i<N;i++){
A[i]=scan.nextInt();
}
System.out.println("Unsorted Array ");
for(int i=0;i<N;i++){
System.out.print(A[i]+" ");
}
int[] result=quickSort(A,0,A.length-1);
System.out.println("Sorted Array ");
for(int i=0;i<N;i++){
System.out.print(result[i]+" ");
}
}
} | [
"adeebafatima1@gmail.com"
] | adeebafatima1@gmail.com |
2a119431f9f250862d0d880f846e076aae551451 | a25fc3597759635bbcbb2150120f3ac79e8508dc | /crm/satchi-crm-core/src/main/java/com/fongwell/satchi/crm/core/order/query/mapper/OrderItemMapper.java | 4f2efae6955f4dc145b86e2e9d388e33e5beba43 | [] | no_license | yaozhiqiang1/gittest | f0f4b0c8a6f489776368e363276e392253afd9a6 | 7f8d40b335fab03d2679b9d144dfa4db2a63e1d0 | refs/heads/master | 2020-03-18T06:53:59.975609 | 2018-07-25T11:46:09 | 2018-07-25T11:46:09 | 134,420,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.fongwell.satchi.crm.core.order.query.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Date:2018/7/16
* Author: yaozhiqiang
* Desc:
*/
@Mapper
public interface OrderItemMapper {
Integer queryQuantity(@Param("productId") long productId,@Param("orderId") Long orderId);
}
| [
"yzqjava10@163.com"
] | yzqjava10@163.com |
7e3fb41e5200c6baead278a80157d8c8536d60be | 2840a11414e5e36d8cb356e9274a51232fc5e6e7 | /app/src/main/java/com/muye/rocket/mvp/me/view/LanguageActivity.java | d032786ff3dcccae426d5feca74c56ec83ca86da | [] | no_license | MerkleTreesTec123/rocket_android | a4c5b7cb3f23ddf3c539fe32fbb79a7633618e53 | 8d0a0ff338e414e515c4495d79443635e4e6342d | refs/heads/master | 2022-04-24T10:11:18.223147 | 2020-04-25T03:50:23 | 2020-04-25T03:50:23 | 258,680,671 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,669 | java | package com.muye.rocket.mvp.me.view;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import com.ifenduo.lib_base.tools.LanguageUtil;
import com.ifenduo.lib_base.tools.MMKVTools;
import com.muye.rocket.R;
import com.muye.rocket.base.BaseActivity;
import com.muye.rocket.mvp.home.view.HomeActivity;
import butterknife.BindView;
import butterknife.OnClick;
public class LanguageActivity extends BaseActivity {
@BindView(R.id.chinese_image_view)
ImageView chineseImageView;
@BindView(R.id.english_image_view)
ImageView englishImageView;
@Override
protected int getContentViewLayoutId() {
return R.layout.activity_language;
}
@Override
protected void onCreateViewAfter(Bundle savedInstanceState) {
super.onCreateViewAfter(savedInstanceState);
setNavigationCenter(getString(R.string.language));
bindCheckedLanguage();
}
@Override
protected int getToolbarColor() {
return Color.WHITE;
}
@OnClick({R.id.chinese_container, R.id.english_container})
public void onViewClicked(View view) {
Intent intent = null;
switch (view.getId()) {
case R.id.chinese_container:
if (LanguageUtil.SIMPLIFIED_CHINESE.equals(MMKVTools.getLanguage())) return;
MMKVTools.saveLanguage(LanguageUtil.SIMPLIFIED_CHINESE);
bindCheckedLanguage();
intent = new Intent(this, HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
break;
case R.id.english_container:
if (LanguageUtil.ENGLISH.equals(MMKVTools.getLanguage())) return;
MMKVTools.saveLanguage(LanguageUtil.ENGLISH);
bindCheckedLanguage();
intent = new Intent(this, HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
break;
}
}
private void bindCheckedLanguage() {
String language = MMKVTools.getLanguage();
chineseImageView.setVisibility(LanguageUtil.SIMPLIFIED_CHINESE.equals(language) ? View.VISIBLE : View.GONE);
englishImageView.setVisibility(LanguageUtil.ENGLISH.equals(language) ? View.VISIBLE : View.GONE);
// japaneseImageView.setVisibility(LanguageUtil.JAPANESE.equals(language) ? View.VISIBLE : View.GONE);
}
}
| [
"15385152450@163.com"
] | 15385152450@163.com |
0232416ecec9caa330aec50f7d91a939597cc597 | de4a516c0252922b63e1620b48b1811cd0488380 | /gulimall-common/src/main/java/com/atguigu/common/to/SkuReductionTO.java | c0845b8441562ae65a4d24c496b2b3af270242fc | [] | no_license | hellou1990/gulimall | 31afa78ab05906fa942838056f46dc7591658494 | b2cbc0c800e07801205d4dd0cba5a7e6c1819233 | refs/heads/master | 2023-06-28T03:25:32.676391 | 2021-03-07T07:30:29 | 2021-03-07T07:30:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.atguigu.common.to;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class SkuReductionTO {
private Long skuId;
private int fullCount;
private BigDecimal discount;
private int countStatus;
private BigDecimal fullPrice;
private BigDecimal reducePrice;
private int priceStatus;
private List<MemberPriceTO> memberPrice;
}
| [
"634493683@qq.com"
] | 634493683@qq.com |
e5cb5deaffa6cf84742298541b19a6a421265a1c | 4f8bdb3f85dfd11652b5565dedb80b0991ad7e93 | /javaapkcomcampus_life/src/main/java/com/yhx/app/campus_life/ReleaseActivity.java | 8073befe636f5d5b01d00ceb58f3ed24c4bbefc9 | [] | no_license | OnClickListener2048/javaapk.com-campus_life | 016e88701d732f68a6862242e038ecefd74215c9 | 6761213ce965661574afc51e6d4e9605be78b63d | refs/heads/master | 2020-03-19T07:56:21.242472 | 2018-06-05T10:42:57 | 2018-06-05T10:43:00 | 136,161,944 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,743 | java | package com.yhx.app.campus_life;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Message;
import android.provider.MediaStore;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.yhx.app.common.AppException;
import com.yhx.app.common.Constants;
import com.yhx.app.common.HttpHelper;
import com.yhx.app.common.HttpHelper.Callback;
import com.yhx.app.entity.Shop;
import com.yhx.app.entity.Users;
import com.yhx.app.service.MyApplication;
import org.apache.http.HttpStatus;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
public class ReleaseActivity extends Activity {
private Button btn_back, btn_right;
private Spinner spinner_type;
private String[] titles = {"行业培训类", "广告类", "网络技术类", "网商类", "促销代理类",
"酒店餐饮类", "教育辅导类",};
private View view, dialogView;
private TextView title, lable, gallery, camera;// Spinner的选项,对话框的相册和相机
private ImageView addImageView;
private Dialog dialog;
private LinearLayout addPicLayout;
private Bitmap bitmap;
private ArrayList<Bitmap> bitmap_list = new ArrayList<Bitmap>();
private ArrayList<String> photo_list = new ArrayList<String>();// 图片的路径集合
private String picturePath = null;// 图片的存放路径
private Shop shop;// 发布信息实体
private EditText shopname, price, userPhone, description;
private Button release;
private String type = "fffff";
private MyApplication myApplication;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_release);
myApplication = (MyApplication) this
.getApplicationContext();
myApplication.addActivity(this);
title = (TextView) this.findViewById(R.id.title_tv);
title.setText("发布招聘信息");
shopname = (EditText) this.findViewById(R.id.releaseTitle);
price = (EditText) this.findViewById(R.id.releasePrice);
userPhone = (EditText) this.findViewById(R.id.link);
description = (EditText) this.findViewById(R.id.describe);
addPicLayout = (LinearLayout) this.findViewById(R.id.addPicLayout);
btn_back = (Button) this.findViewById(R.id.button_back);
btn_back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
View view = getLayoutInflater().inflate(R.layout.my_dialog,
null, false);
TextView title = (TextView) view.findViewById(R.id.title);
title.setText("温馨提示");
TextView message = (TextView) view
.findViewById(R.id.message);
message.setVisibility(View.VISIBLE);
message.setText("你确定要取消发布吗?你填写的内容将丢失");
TextView gallery = (TextView) view
.findViewById(R.id.gallery);
gallery.setVisibility(View.GONE);
TextView camera = (TextView) view.findViewById(R.id.camera);
camera.setVisibility(View.GONE);
final Dialog dialog = new Dialog(ReleaseActivity.this,
R.style.myDialogTheme);
dialog.setContentView(view);
dialog.show();
Button cancel = (Button) view.findViewById(R.id.button_cancel);
cancel.setVisibility(View.VISIBLE);
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
Button ok = (Button) view.findViewById(R.id.button_ok);
ok.setVisibility(View.VISIBLE);
ok.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
Intent intent = new Intent(ReleaseActivity.this, MainActivity.class);
ReleaseActivity.this.startActivity(intent);
ReleaseActivity.this.finish();
}
});
}
});
// 注册按钮事件监听
btn_right = (Button) this.findViewById(R.id.button_right);
btn_right.setVisibility(View.GONE);
spinner_type = (Spinner) this.findViewById(R.id.spinner_type);
// 二手类型的spinner的适配器
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, titles) {
@Override
public View getDropDownView(int position, View convertView,
ViewGroup parent) {
view = getLayoutInflater().inflate(R.layout.spinner_item,
parent, false);
lable = (TextView) view.findViewById(R.id.label);
lable.setText(getItem(position));
if (spinner_type.getSelectedItemPosition() == position) {
lable.setTextColor(getResources().getColor(
R.color.selected_fg));
view.setBackgroundColor(getResources().getColor(
R.color.selected_bg));
view.findViewById(R.id.icon).setVisibility(View.VISIBLE);
}
return view;
}
};
spinner_type.setAdapter(adapter);
spinner_type.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view,
int position, long id) {
type = titles[position];
Log.v("dddddddddddddddddddddd", type);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
addImageView = (ImageView) this.findViewById(R.id.addImageView);
addImageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialogView = getLayoutInflater().inflate(R.layout.my_dialog,
null, false);
dialog = new Dialog(ReleaseActivity.this, R.style.myDialogTheme);
dialog.setContentView(dialogView);
dialog.show();
// 从相册选择图片
gallery = (TextView) dialogView.findViewById(R.id.gallery);
gallery.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (photo_list.size() == 3) {
Toast.makeText(ReleaseActivity.this,
"对不起,内存限制不能再添加图片了~~", Toast.LENGTH_LONG)
.show();
} else {
Intent intent = new Intent(
Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.putExtra("return-data", true);
startActivityForResult(intent, 2);
}
dialog.dismiss();
}
});
// 拍照
camera = (TextView) dialogView.findViewById(R.id.camera);
camera.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (photo_list.size() == 3) {
Toast.makeText(ReleaseActivity.this,
"对不起,内存限制只能添加少于等于三张图片", Toast.LENGTH_LONG)
.show();
} else {
Intent intent = new Intent(
MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 1);
}
dialog.dismiss();
}
});
}
});
// 发布信息
release = (Button) this.findViewById(R.id.release);
release.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (checked()) {
View view = getLayoutInflater().inflate(
R.layout.progress_dialog, null, false);
dialog = new Dialog(ReleaseActivity.this,
R.style.myDialogTheme);
dialog.setContentView(view);
dialog.show();
Users users = (Users) myApplication.userMap.get("user");
String picture = "";
for (int i = 0; i < photo_list.size(); i++) {
picture += photo_list.get(i).substring(
photo_list.get(i).lastIndexOf("/") + 1)
+ ";";
}
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("shopname", shopname.getText().toString());
params.put("price", price.getText().toString());
params.put("userName", users.getUserName());
params.put("userPhone", userPhone.getText().toString());
params.put("description", description.getText().toString());
params.put("category", type);
params.put("picture", picture);
Log.v("dddddddddddddddddddddd", params.toString());
HashMap<String, File> fileMap = new HashMap<String, File>();
for (int i = 0; i < photo_list.size(); i++) {
fileMap.put("fileMap" + i, new File(photo_list.get(i)));
}
Log.v("dddddddddddddddddddddd", fileMap.toString());
HttpHelper.asyncMultipartPost(Constants.URL
+ "/second-hand/shop_add.do", params, fileMap,
new Callback() {
@Override
public void dataLoaded(Message msg) {
if (HttpStatus.SC_OK != msg.what) {
dialog.dismiss();
AppException.http(msg.what).makeToast(
ReleaseActivity.this);
return;
}
dialog.dismiss();
String message = (String) msg.obj;
Toast.makeText(ReleaseActivity.this,
message, Toast.LENGTH_LONG).show();
setResult(RESULT_OK,new Intent().putExtra("type",type));
ReleaseActivity.this.finish();
}
});
}
}
});
}
// 图片的处理
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
bitmap = null;
if (requestCode == 1 && resultCode == RESULT_OK) {
String sdStatus = Environment.getExternalStorageState();
if (!sdStatus.equals(Environment.MEDIA_MOUNTED)) { // 检测sd是否可用
Log.v("TestFile",
"SD card is not avaiable/writeable right now.");
return;
}
Bundle bundle = data.getExtras();
bitmap = (Bitmap) bundle.get("data");// 获取相机返回的数据,并转换为Bitmap图片格式
FileOutputStream b = null;
File file = new File("/sdcard/campus_life/myImage/");
file.mkdirs();// 创建文件夹
picturePath = "/sdcard/campus_life/myImage/"
+ System.currentTimeMillis() + ".jpg";
try {
b = new FileOutputStream(picturePath);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, b);// 把数据写入文件
} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
try {
b.flush();
b.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} else if (requestCode == 2 && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
try {
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
picturePath = cursor.getString(columnIndex);
cursor.close();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
bitmap = BitmapFactory.decodeFile(picturePath, options);
} catch (Exception e) {
e.printStackTrace();
}
}
if (bitmap != null && picturePath != null) {
Log.v("dddddddddddddddddddddd", picturePath);
photo_list.add(picturePath);
bitmap_list.add(bitmap);
showPhoto(bitmap);
}
}
// 图片的显示
public void showPhoto(final Bitmap bitmap) {
final View item = LayoutInflater.from(this).inflate(
R.layout.photo_item, null);
ImageView photo = (ImageView) item.findViewById(R.id.photo);
photo.setImageBitmap(bitmap);
ImageView delete = (ImageView) item.findViewById(R.id.photo_delete);
delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
photo_list.remove(picturePath);
addPicLayout.removeView(item);
destoryBitmap(bitmap);
}
});
addPicLayout.addView(item);
}
// 发布信息验证
private boolean checked() {
if (shopname.getText().toString() == null
|| shopname.getText().toString().equals("")) {
Toast.makeText(this, "标题不能为空", Toast.LENGTH_SHORT).show();
return false;
} else if (price.getText().toString() == null
|| price.getText().toString().equals("")) {
Toast.makeText(this, "价格不能为空", Toast.LENGTH_SHORT).show();
return false;
} else if (userPhone.getText().toString() == null
|| userPhone.getText().toString().equals("")
|| userPhone.length() != 11) {
Toast.makeText(this, "电话是十一位", Toast.LENGTH_SHORT).show();
return false;
} else {
return true;
}
}
// 销毁bitmap 释放内存
public void destoryBitmap(Bitmap bitmap) {
if (bitmap != null && !bitmap.isRecycled()) {
bitmap.recycle();
bitmap = null;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
View view = getLayoutInflater().inflate(R.layout.my_dialog,
null, false);
TextView title = (TextView) view.findViewById(R.id.title);
title.setText("温馨提示");
TextView message = (TextView) view
.findViewById(R.id.message);
message.setVisibility(View.VISIBLE);
message.setText("你确定要取消发布吗?你填写的内容将丢失");
TextView gallery = (TextView) view
.findViewById(R.id.gallery);
gallery.setVisibility(View.GONE);
TextView camera = (TextView) view.findViewById(R.id.camera);
camera.setVisibility(View.GONE);
final Dialog dialog = new Dialog(ReleaseActivity.this,
R.style.myDialogTheme);
dialog.setContentView(view);
dialog.show();
Button cancel = (Button) view.findViewById(R.id.button_cancel);
cancel.setVisibility(View.VISIBLE);
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
Button ok = (Button) view.findViewById(R.id.button_ok);
ok.setVisibility(View.VISIBLE);
ok.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
ReleaseActivity.this.finish();
}
});
}
return true;
}
@Override
protected void onDestroy() {
super.onDestroy();
if (bitmap_list != null) {
for (int i = 0; i < bitmap_list.size(); i++) {
destoryBitmap(bitmap_list.get(i));
}
}
}
}
| [
"wangxin@i-counting.cn"
] | wangxin@i-counting.cn |
50eb1e27d30978ed5521ecaa06079270eb5e1112 | f942122d38f346ee7cd73b5c2ea3d99b2074595e | /book1/作业+练习/1/Forward2.java | 3679cfa823b67590c4f36fe20bf73c95251e5f79 | [] | no_license | liaoshanggang/Practice | 4c5304d2e30593a771bda4b44e60b38fe9f5c1ac | ce8c7e9060d7b3588bc7b649aa45c889a8ed1091 | refs/heads/master | 2020-01-19T21:10:26.407801 | 2017-06-27T08:28:10 | 2017-06-27T08:29:23 | 94,212,204 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 208 | java | public class Forward2{
public static void main(String[] args){
System.out.println("\t我的姓名:小样");
System.out.println("\t我的性别:男");
System.out.println("\t我的年龄:18");
}
} | [
"787887060@qq.com"
] | 787887060@qq.com |
a5358afba2b2671bcd051dd98281f23b67e14277 | 7de1b594c5ffe0d007651154ab7edf4014695f8d | /src/main/java/com/example/minjoo/project1/F5_signin.java | ee84062198d2c774ac7967a6b6ba09f2a1f09197 | [] | no_license | GiziSH/Project1 | c2973faeb3c2ba2417f864b3c8ee1bbf0a5e85ae | a9f13ceff5eb6191919c607e0b477dfe13fd8927 | refs/heads/master | 2020-04-01T05:13:38.736413 | 2018-10-13T17:04:48 | 2018-10-13T17:04:48 | 152,894,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,179 | java | package com.example.minjoo.project1;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class F5_signin extends Fragment {
AlertDialog.Builder alertBuilder;
EditText et_id, et_pw, et_pw_chk;
String sId, sPw, sPw_chk;
public F5_signin() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.f5_signin, container, false);
et_id = (EditText) v.findViewById(R.id.et_id);
et_pw = (EditText) v.findViewById(R.id.et_password);
et_pw_chk = (EditText) v.findViewById(R.id.et_password_chk);
alertBuilder = new AlertDialog.Builder(getContext());
Button signinok = (Button)v.findViewById(R.id.bt_signinok);
signinok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {//버튼 눌렸을 때
//버튼을 눌렀을 때 동작하는 소스
sId = et_id.getText().toString();
sPw = et_pw.getText().toString();
sPw_chk = et_pw_chk.getText().toString();
if (sPw.equals(sPw_chk)) { // 비밀번호와 비밀번호 체크값을 비교해서
//패스워드 서로 일치하면 등록
registDB rdb = new registDB();
rdb.execute();
} else {
//패스워드 불일치하면 실패 메세지 팝업
Log.e("RESULT","비밀번호가 일치하지 않습니다.");
alertBuilder
.setTitle("알림")
.setMessage("비밀번호가 일치하지 않습니다.")
.setCancelable(true)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//finish();
}
});
AlertDialog dialog = alertBuilder.create();
dialog.show();
}
//finish();
}
});
return v;
}
/*
public void bt_signinok(View view) {
//버튼을 눌렀을 때 동작하는 소스
sId = et_id.getText().toString();
sPw = et_pw.getText().toString();
sPw_chk = et_pw_chk.getText().toString();
if (sPw.equals(sPw_chk)) { // 비밀번호와 비밀번호 체크값을 비교해서
//패스워드 서로 일치하면 등록
registDB rdb = new registDB();
rdb.execute();
} else {
//패스워드 불일치하면 실패 메세지 팝업
Log.e("RESULT","비밀번호가 일치하지 않습니다.");
alertBuilder
.setTitle("알림")
.setMessage("비밀번호가 일치하지 않습니다.")
.setCancelable(true)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//finish();
}
});
AlertDialog dialog = alertBuilder.create();
dialog.show();
}
//finish();
}*/
public class registDB extends AsyncTask<Void, Integer, Void> {
String data = "";
@Override
protected Void doInBackground(Void... unused) {
/* 인풋 파라메터값 생성 */
String param = "u_id=" + sId + "&u_pw=" + sPw + "";
try {
/* 서버연결 */
URL url = new URL(
"http://192.168.219.109/gizi_signin.php");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.connect();
/* 안드로이드 -> 서버 파라메터값 전달 */
OutputStream outs = conn.getOutputStream();
outs.write(param.getBytes("UTF-8"));
outs.flush();
outs.close();
/* 서버 -> 안드로이드 파라메터값 전달 */
InputStream is = null;
BufferedReader in = null;
is = conn.getInputStream();
in = new BufferedReader(new InputStreamReader(is), 8 * 1024);
String line = null;
StringBuffer buff = new StringBuffer();
while ( ( line = in.readLine() ) != null )
{
buff.append(line + "\n");
}
data = buff.toString().trim();
Log.e("RECV DATA",data);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
/* 서버에서 응답 */
Log.e("RECV DATA",data);
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getContext());
if(data.equals("1"))
{
Log.e("RESULT","성공적으로 처리되었습니다!");
alertBuilder
.setTitle("알림")
.setMessage("성공적으로 등록되었습니다!")
.setCancelable(true)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
F5_signin f5signin = new F5_signin();
android.support.v4.app.FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, f5signin);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
/*
Intent intent = new Intent(MainActivity.this, MainActivity.class);
startActivity(intent);
finish();*/
}
});
AlertDialog dialog = alertBuilder.create();
dialog.show();
}
else if(data.equals("0"))
{
Log.e("RESULT","비밀번호가 일치하지 않습니다.");
alertBuilder
.setTitle("알림")
.setMessage("비밀번호가 일치하지 않습니다.")
.setCancelable(true)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//finish();
}
});
AlertDialog dialog = alertBuilder.create();
dialog.show();
}
else
{
Log.e("RESULT","에러 발생! ERRCODE = " + data);
alertBuilder
.setTitle("알림")
.setMessage("등록중 에러가 발생했습니다! errcode : "+ data)
.setCancelable(true)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//finish();
}
});
AlertDialog dialog = alertBuilder.create();
dialog.show();
}
}
}
}
| [
"duk5315@naver.com"
] | duk5315@naver.com |
11e928dbd0bb652d1366c0387ab5ed6175150ffb | 9a7013038cd5f066f8a8cf06212f72d3a00ef238 | /utils/src/main/java/com/iyiyo/uikit/materialprogressbar/internal/DrawableCompat.java | 4ff472de7c7039cc69366c3566642cff5cecd600 | [
"Apache-2.0"
] | permissive | Yaredgroovy/FolwGeek | e3d99a80a597f00e9dc89e36104b456e731033f1 | 60927e339d51b46b81fca01830f947ed46d1f149 | refs/heads/master | 2023-05-28T17:47:07.111650 | 2016-07-19T07:57:17 | 2016-07-19T07:57:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 801 | java | /*
* Copyright (c) 2015 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
* All Rights Reserved.
*/
package com.iyiyo.uikit.materialprogressbar.internal;
import android.graphics.PorterDuff;
public class DrawableCompat {
/**
* Parses a {@link PorterDuff.Mode} from a tintMode attribute's enum value.
*/
public static PorterDuff.Mode parseTintMode(int value, PorterDuff.Mode defaultMode) {
switch (value) {
case 3: return PorterDuff.Mode.SRC_OVER;
case 5: return PorterDuff.Mode.SRC_IN;
case 9: return PorterDuff.Mode.SRC_ATOP;
case 14: return PorterDuff.Mode.MULTIPLY;
case 15: return PorterDuff.Mode.SCREEN;
case 16: return PorterDuff.Mode.ADD;
default: return defaultMode;
}
}
}
| [
"w710989327@foxmail.com"
] | w710989327@foxmail.com |
1bf2be868107fddfb35829b646f2c8f310a80e7c | a33d75b6f8e7d932e8e4df982bde8ad6d03f58d0 | /src/main/java/com/baomidou/kisso/web/interceptor/package-info.java | bad5bc941f3f1e11d980a7e3e6b59ba577870149 | [
"Apache-2.0"
] | permissive | baomidou/kisso | 0c21837a157cfcf4f26ef80ab74327f1353a865a | ae02958105c5477391dfceb5de5688f4157723c0 | refs/heads/master | 2023-07-14T00:27:21.840075 | 2023-03-01T03:23:27 | 2023-03-01T03:23:27 | 65,987,079 | 269 | 80 | Apache-2.0 | 2021-04-26T03:44:33 | 2016-08-18T10:07:24 | Java | UTF-8 | Java | false | false | 98 | java | /**
* kisso 各种开发框架拦截器实现类
*/
package com.baomidou.kisso.web.interceptor;
| [
"jobob@qq.com"
] | jobob@qq.com |
05746bfe868065656a0747915ef51abee6641b5e | 182b1105c2a1ffbe01dcf9869aa57c9fce789999 | /integral-core/src/main/java/my/com/myriadeas/integral/data/populator/UserGroupDatabasePopulator.java | 98eb6a765ad8b88626114f964d357c463f9b818c | [] | no_license | arlinashah/integral | 73d15e54f5cc071f2b56cc8b21b3ca3d26c2612f | 17108192cdec49b68e3d198913d1109fad4f1bff | refs/heads/master | 2022-12-25T21:54:39.705721 | 2014-09-23T02:30:39 | 2014-09-23T02:30:39 | 24,176,317 | 1 | 0 | null | 2022-12-16T02:38:46 | 2014-09-18T06:14:08 | JavaScript | UTF-8 | Java | false | false | 1,087 | java | package my.com.myriadeas.integral.data.populator;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import my.com.myriadeas.integral.data.jpa.domain.Role;
import my.com.myriadeas.integral.data.jpa.domain.UserGroup;
import my.com.myriadeas.integral.data.jpa.repositories.impl.UserGroupRepositoryImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service(value = "userGroupDatabasePopulator")
public class UserGroupDatabasePopulator extends AbstractDatabasePopulator implements UserGroupDatabasePopulatorIntf {
@Autowired
UserGroupRepositoryImpl userGroupRepository;
@Autowired
RoleDatabasePopulator roleDatabasePopulator;
public void init() {
List<UserGroup> userGroups = new ArrayList<UserGroup>();
userGroups.add(CATALOGUING_GROUP);
userGroups.add(CIRCULATION_GROUP);
Set<Role> roles = new HashSet<Role>();
roles.add(ROLE_USER);
CATALOGUING_GROUP.setRoles(roles);
CIRCULATION_GROUP.setRoles(roles);
userGroupRepository.save(userGroups);
}
}
| [
"arlinashah@gmail.com"
] | arlinashah@gmail.com |
a53e07769c51e87461e87cfa8fcc052d2916dace | 7011949764c8ed005d3e37a0099ad464192499a7 | /app/src/main/java/com/nwpu/wsner/lib/camera/PreviewCallback.java | 72e7256ef7405e13bb376539d46735fe556afb15 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | jingyuzhangzhang/cupboardClient | 131ab0011417c7f9af02fbde6506e1571141e3c8 | c76aab37acb57f7574b93d08cb5c669f91f40c62 | refs/heads/master | 2021-01-19T00:36:02.331433 | 2017-04-04T13:29:20 | 2017-04-04T13:29:20 | 87,189,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,408 | java | package com.nwpu.wsner.lib.camera;
import android.graphics.Point;
import android.hardware.Camera;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
/**
* 描述: 相机预览回调
*/
final class PreviewCallback implements Camera.PreviewCallback {
private static final String TAG = PreviewCallback.class.getSimpleName();
private final CameraConfigurationManager configManager;
private final boolean useOneShotPreviewCallback;
private Handler previewHandler;
private int previewMessage;
PreviewCallback(CameraConfigurationManager configManager, boolean useOneShotPreviewCallback) {
this.configManager = configManager;
this.useOneShotPreviewCallback = useOneShotPreviewCallback;
}
void setHandler(Handler previewHandler, int previewMessage) {
this.previewHandler = previewHandler;
this.previewMessage = previewMessage;
}
public void onPreviewFrame(byte[] data, Camera camera) {
Point cameraResolution = configManager.getCameraResolution();
if (!useOneShotPreviewCallback) {
camera.setPreviewCallback(null);
}
if (previewHandler != null) {
Message message = previewHandler.obtainMessage(previewMessage, cameraResolution.x,
cameraResolution.y, data);
message.sendToTarget();
previewHandler = null;
} else {
Log.d(TAG, "Got preview callback, but no handler for it");
}
}
}
| [
"624571192@qq.com"
] | 624571192@qq.com |
72d11219093c231560be2609d2cda00b08fe311c | 338adff9c80292c00caff3398ed80de47ab6866d | /src/com/example/filemaster/MainActivity.java | 72990641446c8870d1e94d474e72cc743c80409f | [] | no_license | anilds/FileMaster | 409391ec15af69db610745268d66347f23f05527 | cc1ede137db3a404d7a119ebff8646ebb9120773 | refs/heads/master | 2021-01-10T19:50:59.087201 | 2014-10-08T05:30:50 | 2014-10-08T05:30:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,411 | java | package com.example.filemaster;
import java.io.File;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import android.app.Activity;
public class MainActivity extends Activity{
ListView list;
// TextView textview;
private Spinner spinner;
ArrayAdapter<String> listadapter;
ArrayList<String> listdata = new ArrayList<String>();
String[] web =
{
"Documents",
"Downloads",
"Media ",
"Media "
};
Integer[] imageId = {
R.drawable.folder4,
R.drawable.folder4,
R.drawable.floppy,
R.drawable.floppy,
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Json Parsing it will easy.
CustomList adapter = new
CustomList(MainActivity.this, web, imageId);
list=(ListView)findViewById(R.id.list);
// textview=(TextView)findViewById(R.id.txt);
list.setAdapter(adapter);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// Toast.makeText(MainActivity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();
//Intent i = new Intent("com.example.filemaster.SecondActivity");
//startActivity(i);
String item = (String) parent.getItemAtPosition(position);
//Log.i("Postion ID", item);
Toast.makeText(getApplicationContext(),item,Toast.LENGTH_LONG).show();
Intent i;
switch (position) {
case 0:
Toast.makeText(MainActivity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();
i = new Intent("com.example.filemaster.FirstActivity");
startActivity(i);
break;
case 1:
Toast.makeText(MainActivity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();
i = new Intent("com.example.filemaster.SecondActivity");
startActivity(i);
break;
case 2:
//Toast.makeText(MainActivity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();
i = new Intent("com.example.filemaster.ThirdActivity");
startActivity(i);
break;
case 3:
//Toast.makeText(MainActivity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();
i = new Intent("com.example.filemaster.FourActivity");
startActivity(i);
break;
}
}
});
}
//Menu Code BeginsFront Page
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.popup, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId()) {
case R.id.mount:
Toast.makeText(getApplicationContext(),"Item 1 Selected",Toast.LENGTH_LONG).show();
return true;
case R.id.filesystem:
Toast.makeText(getApplicationContext(),"Item 2 Selected",Toast.LENGTH_LONG).show();
return true;
case R.id.about:
Toast.makeText(getApplicationContext(),"Item 3 Selected",Toast.LENGTH_LONG).show();
return true;
case R.id.help:
Toast.makeText(getApplicationContext(),"Item 4 Selected",Toast.LENGTH_LONG).show();
return true;
case R.id.settings:
Toast.makeText(getApplicationContext(),"Item 5 Selected",Toast.LENGTH_LONG).show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
| [
"anildshiv@gmail.com"
] | anildshiv@gmail.com |
285196d9fbac8aca4ce92396a56d0fd4189fd21c | 3fe383525b2dcd3f9a405c5105a4562983c7f7fa | /jenabean/jenabean/src/test/java/test/bean/Visualization.java | f1ad954a3bc72bd402578dc2d1faf0bfae5e3751 | [
"Apache-2.0",
"MIT"
] | permissive | william-vw/mlod | 7e013d999878a1fcd16e4add94e62626a16875a5 | 20d67f8790ef24527d2e0baff4b5dd053b5ab621 | refs/heads/master | 2023-07-25T12:35:00.658936 | 2022-03-02T16:03:55 | 2022-03-02T16:03:55 | 253,907,808 | 0 | 0 | Apache-2.0 | 2023-07-23T11:15:08 | 2020-04-07T20:44:36 | HTML | UTF-8 | Java | false | false | 155 | java | package test.bean;
import thewebsemantic.Namespace;
@Namespace("http://code.google.com/apis/visualization/")
abstract public class Visualization
{
}
| [
"william.van.woensel@gmail.com"
] | william.van.woensel@gmail.com |
b4f8ca2d6d9e09e6a3acffd4cf94a7b5e97da6c8 | 6970cd9e1c123276f8f297caaac3374ef779a72e | /pocchroma/pocchromacore/testsrc/de/techouts/pocchroma/core/job/TicketsRetentionCronJobIntegrationTest.java | ba8a1cc68cf3c22d9735a39294aaa52bbc83d11a | [] | no_license | Prashanth-techouts/tatacroma-poc | 22badc975ebb84ebd270e88932eafdbb4ffe14ec | 21992e275ba96f65b129b4485e76a7e4baa2e727 | refs/heads/master | 2023-06-19T13:32:32.848697 | 2021-07-21T08:28:09 | 2021-07-21T08:28:09 | 388,042,775 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,158 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.techouts.pocchroma.core.job;
import de.hybris.bootstrap.annotations.IntegrationTest;
import de.hybris.platform.servicelayer.ServicelayerTest;
import de.hybris.platform.servicelayer.cronjob.CronJobService;
import de.hybris.platform.servicelayer.i18n.I18NService;
import de.hybris.platform.servicelayer.model.ModelService;
import de.hybris.platform.servicelayer.search.FlexibleSearchService;
import de.hybris.platform.site.BaseSiteService;
import de.hybris.platform.ticket.enums.CsTicketState;
import de.hybris.platform.ticket.model.CsTicketModel;
import org.junit.Before;
import org.junit.Test;
import javax.annotation.Resource;
import java.util.Locale;
import static org.junit.Assert.*;
@IntegrationTest
public class TicketsRetentionCronJobIntegrationTest extends ServicelayerTest
{
private static final String TEST_BASESITE_UID = "testSite";
@Resource
private BaseSiteService baseSiteService;
@Resource
private FlexibleSearchService flexibleSearchService;
@Resource
private I18NService i18NService;
@Resource
private CronJobService cronJobService;
@Resource
private ModelService modelService;
@Before
public void setup() throws Exception
{
createCoreData();
baseSiteService.setCurrentBaseSite(baseSiteService.getBaseSiteForUID(TEST_BASESITE_UID), false);
importCsv("/pocchromacore/import/common/cronjobs.impex", "utf-8");
importCsv("/pocchromacore/test/testTicketRetentionCronJob.impex", "utf-8");
i18NService.setCurrentLocale(Locale.ENGLISH);
}
@Test
public void testTicketsRetentionCronJob()
{
// order to be removed
final CsTicketModel ticketModelTemplate = new CsTicketModel();
ticketModelTemplate.setTicketID("test-ticket-7");
final CsTicketModel ticketModel = flexibleSearchService.getModelByExample(ticketModelTemplate);
assertNotNull("Comments", ticketModel.getComments());
assertEquals("State", CsTicketState.CLOSED, ticketModel.getState());
assertNotNull("RetentionDate", ticketModel.getRetentionDate());
cronJobService.performCronJob(cronJobService.getCronJob("ticketsRetentionCronJob"), true);
// ticket to be removed
assertTrue("test-ticket-7 removed", modelService.isRemoved(ticketModel));
// ticket not to be removed
final CsTicketModel ticketModelTemplate2 = new CsTicketModel();
ticketModelTemplate2.setTicketID("test-ticket-6");
final CsTicketModel ticketNotToBeRemoved = flexibleSearchService.getModelByExample(ticketModelTemplate2);
assertTrue("CsTicket not null", ticketNotToBeRemoved != null);
assertFalse("CsTicket not removed", modelService.isRemoved(ticketNotToBeRemoved));
}
}
| [
"prashanth.g@techouts.com"
] | prashanth.g@techouts.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.