blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
f8c8f59fbdab7a7f74dc6c85b3e82f681071c11e
bb2e9ea7f9a1f90d2aab061f5e3dae5373765bca
/src/main/java/ar/com/kfgodel/function/booleans/arrays/boxed/BooleanToArrayOfBoxedCharacterFunction.java
9a3f9fed40c9bd1bd9a727881616f049499514b0
[ "Apache-2.0" ]
permissive
kfgodel/extended-functions
85f9bb056f7e67aa5297b28930a169773ee8b5fb
990b31353a4f9adab2d70ed0b3464706c65fa75c
refs/heads/master
2021-01-01T20:18:51.712928
2019-10-13T02:00:12
2019-10-13T02:00:12
98,808,487
0
0
null
null
null
null
UTF-8
Java
false
false
281
java
package ar.com.kfgodel.function.booleans.arrays.boxed; import ar.com.kfgodel.function.booleans.arrays.BooleanToArrayOfObjectFunction; /** * Date: 29/07/17 - 19:57 */ public interface BooleanToArrayOfBoxedCharacterFunction extends BooleanToArrayOfObjectFunction<Character> { }
8009b7c39ae393c641debbde02ecd15d6267b4b1
aa3cde82a7b1cab0182c8ce5a5d09796d6772f1e
/AppsterAndroid/Appster/app/src/main/java/com/appster/webservice/request_models/VerifyUsernameRequestModel.java
1c220b70fa9267ce4fee65e2fbe93d97ad982197
[]
no_license
zaizaixinhtrai/belive
fc474fc588bb3065f04e2e30239ca2790eb6c957
db38db29f040e40865d1f5bfa3e35e36fd797ccf
refs/heads/master
2020-09-10T00:39:40.313547
2019-11-14T03:54:06
2019-11-14T03:54:06
221,606,172
0
1
null
null
null
null
UTF-8
Java
false
false
449
java
package com.appster.webservice.request_models; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** * Created by User on 7/19/2016. */ public class VerifyUsernameRequestModel { @SerializedName("UserName") @Expose private String mUserName; public String getUserName() { return mUserName; } public void setUserName(String userName) { mUserName = userName; } }
76e82fea4902c436025629064a99cbdea523c0e5
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project184/src/main/java/org/gradle/test/performance/largejavamultiproject/project184/p922/Production18440.java
0b0146134f7e3968c50ffa38770d15ce404b3f68
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,889
java
package org.gradle.test.performance.largejavamultiproject.project184.p922; public class Production18440 { private String property0; public String getProperty0() { return property0; } public void setProperty0(String value) { property0 = value; } private String property1; public String getProperty1() { return property1; } public void setProperty1(String value) { property1 = value; } private String property2; public String getProperty2() { return property2; } public void setProperty2(String value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
196f4f96b53b134fd85a5f63cc16f0fcbb8d2c7c
7003f56b1955623d8ab9698719b03b8af2ec0aef
/spring-crm-rest-app/src/main/java/com/jerry/crm/rest/CustomerController.java
1cbc6e7c2f51593d3de66397d7d4d68053080f34
[]
no_license
stiffer96/spring-workspace
9affad4389fbc50aa34af1df4004431c89dd05d8
dda5f2523a3075c0a9c180d1a61e5285565250cb
refs/heads/main
2023-05-09T08:40:02.624534
2021-06-03T05:28:05
2021-06-03T05:28:05
333,350,329
0
0
null
null
null
null
UTF-8
Java
false
false
1,932
java
package com.jerry.crm.rest; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.jerry.crm.entity.Customer; import com.jerry.crm.services.CustomerService; @RestController @RequestMapping("/api") public class CustomerController { @Autowired private CustomerService customerService; @GetMapping("/customers") public List<Customer> getAllCustomers(){ return customerService.getCustomers(); } @GetMapping("/customers/{customerId}") public Customer getCustomer(@PathVariable int customerId) { return customerService.getSingleCustomer(customerId); } @PostMapping("/customers") public Customer saveCustomer(@RequestBody Customer theCustomer) { /* * if someone passes new id Explicitly set id to null ,to insert a new customer * because we are using saveOrUpdate method in DAO implementation */ theCustomer.setId(0); customerService.saveOrUpdateCustomer(theCustomer); return theCustomer; } @PutMapping("/customers") public Customer updateCustomer(@RequestBody Customer theCustomer) { //pass id in json the it will update the customer //it is the magic of saveOrUpdate method in DAO implementation customerService.saveOrUpdateCustomer(theCustomer); return theCustomer; } @DeleteMapping("/customers/{customerId}") public String deleteCustomer(@PathVariable int customerId) { return customerService.deleteCustomer(customerId); } }
6fefd15803f1094f7879f036ddae688e33cdd4ac
43639d14aec162a615a1f660a0d2e49b2ca46b52
/DriverSystem/src/org/great/mapper/SchoolEvaluationMapper.java
fb29ea20d9df5cdce9a44e5380dd1cf8fafde18e
[]
no_license
qiu757470/DriverSystem
9bb933171199fa867649d1fbd3eb1bbb1e9b84d2
7a158386d38ff3100ebc965fd5b91022ec671c40
refs/heads/master
2021-09-01T05:16:26.280197
2017-12-25T02:01:05
2017-12-25T02:01:05
115,297,677
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package org.great.mapper; import org.apache.ibatis.annotations.Param; import org.great.annotation.Mapper; import org.great.bean.SchoolEvaluation; @Mapper public interface SchoolEvaluationMapper extends BaseMapper { public int updateStudentToSchoolEvaluatton(SchoolEvaluation schoolEvaluatton); public void deleteByStudentId(@Param("student_id")String id); public SchoolEvaluation findByStudentId(@Param("student_id")String id); }
a16c3a0c5cb134ddcbc26d807a1581223fa0ccec
4594e47af268ba85ea2e9bc01be5f42f7b3a0557
/src/main/java/com/in28minutes/spring/basics/springin5steps/cdi/SomeCdiBusiness.java
1095f60b295d246c8817c5ecfca5e722fbcc6330
[]
no_license
sayaka-tamura/In28minutes_Spring-Master-Class
2bc81730389abda107a44f18126ffd6dc68279da
458d7b1b3ed41ad984f16ffc62abb32b81db2df8
refs/heads/master
2020-05-21T17:25:06.622588
2019-05-13T13:49:11
2019-05-13T13:49:11
186,122,937
1
0
null
null
null
null
UTF-8
Java
false
false
561
java
/** * @author : Sayaka Tamura * May 13, 2019 * Udemy Spring Framework Master Class * https://github.com/in28minutes/spring-master-class/tree/master/01-spring-in-depth */ package com.in28minutes.spring.basics.springin5steps.cdi; import javax.inject.Inject; import javax.inject.Named; @Named public class SomeCdiBusiness { @Inject SomeCdiDao someCdiDao; public SomeCdiDao getSomeCdiDao() { return someCdiDao; } // Setter Injection public void setSomeCdiDao(SomeCdiDao someCdiDao) { this.someCdiDao = someCdiDao; } }
38f7c05b155e7a3fd715299c344d43c034723c0a
ee82da46ff6095868051073fc2c79a699de5ad85
/src/main/java/be/Balor/Manager/Commands/Mob/MobLimit.java
202d113062df3997fed0fbf08b41c5391f4c4218
[]
no_license
boozaa/AdminCmd
5842e6962edc7595a4d07c5aaba5cd6ae80768e4
799864080eb565bf498481db1cd1cbc5e24319a0
refs/heads/master
2021-01-21T00:00:56.488262
2013-01-10T19:03:32
2013-01-10T19:03:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,999
java
/************************************************************************ * This file is part of AdminCmd. * * AdminCmd 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. * * AdminCmd 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 AdminCmd. If not, see <http://www.gnu.org/licenses/>. ************************************************************************/ package be.Balor.Manager.Commands.Mob; import java.util.HashMap; import org.bukkit.command.CommandSender; import org.bukkit.entity.EntityType; import be.Balor.Manager.Commands.CommandArgs; import be.Balor.Manager.Exceptions.PlayerNotFound; import be.Balor.Manager.Exceptions.WorldNotLoaded; import be.Balor.Manager.Permissions.ActionNotPermitedException; import be.Balor.Tools.Type; import be.Balor.Tools.Utils; import be.Balor.World.ACWorld; /** * @author Balor (aka Antoine Aflalo) * */ public class MobLimit extends MobCommand { /** * */ public MobLimit() { permNode = "admincmd.mob.limit"; cmdName = "bal_moblimit"; } /* * (non-Javadoc) * * @see * be.Balor.Manager.ACCommands#execute(org.bukkit.command.CommandSender, * java.lang.String[]) */ @Override public void execute(final CommandSender sender, final CommandArgs args) throws ActionNotPermitedException, PlayerNotFound { ACWorld world = null; int limit; if (args.hasFlag('m')) { final String name = args.getValueFlag('m'); try { world = ACWorld.getWorld(args.getString(0)); } catch (final WorldNotLoaded e) { Utils.sI18n(sender, "worldNotFound", "world", args.getString(0)); return; } final EntityType ct = EntityType.fromName(name); if (ct == null) { Utils.sI18n(sender, "errorMob", "mob", name); return; } final HashMap<String, String> replace = new HashMap<String, String>(); try { limit = args.getInt(1); world.setMobLimit("Craft" + ct.getName(), limit); replace.put("number", args.getString(1)); replace.put("world", world.getName()); replace.put("mob", name); Utils.sI18n(sender, "mobLimitPerMob", replace); } catch (final NumberFormatException e) { if (args.getString(1).equals("none")) { replace.put("world", world.getName()); replace.put("mob", name); ACWorld.getWorld(world.getName()).removeMobLimit( "Craft" + ct.getName()); Utils.sI18n(sender, "mobLimitRemovedPerMob", replace); } else { Utils.sI18n(sender, "NaN", "number", args.getString(1)); } } return; } try { world = ACWorld.getWorld(args.getString(0)); } catch (final WorldNotLoaded e) { Utils.sI18n(sender, "worldNotFound", "world", args.getString(0)); return; } try { final HashMap<String, String> replace = new HashMap<String, String>(); limit = args.getInt(1); world.setInformation(Type.MOB_LIMIT.toString(), limit); replace.put("number", args.getString(1)); replace.put("world", args.getString(0)); Utils.sI18n(sender, "mobLimit", replace); } catch (final NumberFormatException e) { if (args.getString(1).equals("none")) { world.removeInformation(Type.MOB_LIMIT.toString()); Utils.sI18n(sender, "mobLimitRemoved", "world", world.getName()); } else { Utils.sI18n(sender, "NaN", "number", args.getString(1)); } } } /* * (non-Javadoc) * * @see be.Balor.Manager.ACCommands#argsCheck(java.lang.String[]) */ @Override public boolean argsCheck(final String... args) { return args != null && args.length >= 2; } }
cdfb88ce0ac566dc0e301d4fd74fe3757fe832a7
1b9394b1d253e1177ddbe959088edf0f36d28160
/easyPhotos/src/main/java/com/huantansheng/easyphotos/constant/Capture.java
3be9918bd71219788ca7403dd96f0f3135cd783b
[ "Apache-2.0" ]
permissive
joker-fu/EasyPhotos
075457c87a3163de8048f78b24e64cc299b4b36f
8e25c609802f5814f4f436bfd1742be2059af3d5
refs/heads/master
2023-04-02T19:13:07.031804
2022-06-29T07:36:07
2022-06-29T07:36:07
195,025,098
556
93
Apache-2.0
2023-03-21T07:57:27
2019-07-03T09:44:16
Java
UTF-8
Java
false
false
276
java
package com.huantansheng.easyphotos.constant; public class Capture { //拍照录像均可 public static final String ALL = "ALL"; //只能拍照 public static final String IMAGE = "IMAGE"; //只能录像 public static final String VIDEO = "VIDEO"; }
ae12038e85bf79de73300042a8e234d17f1a2b44
ee6c66db877bcbf864a513f84cfaf221b96ef6e6
/Exercícios CondicionaisSE Java/src/exercícios/condicionaisse/java/SaldoBancarioCondicional.java
98e18741abf5e566f755ee7e2b68b7f4fa977893
[]
no_license
gabrielmoraes14/Programa-Java
9bc2cac6e4c52c412c8c1060166b48e63525adf6
b9393649e4fb851d9bf27d5b352690b6e1ec42e8
refs/heads/master
2022-11-07T13:27:08.332121
2020-06-26T17:55:58
2020-06-26T17:55:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,212
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package exercícios.condicionaisse.java; import javax.swing.JOptionPane; /** * * @author PICHAU */ public class SaldoBancarioCondicional { public static void main(String[] args) { //Var double saque, saldoatual, saldofinal, limite; //Entrada saque= Double.parseDouble(JOptionPane.showInputDialog("Quanto você deseja sacar:")); saldoatual=1000; limite=2000; //Processamento saldofinal= saldoatual - saque; if (saldofinal>=0){ JOptionPane.showMessageDialog(null, "Seu saldo final é positivo com: R$"+saldofinal); } if ((saldofinal<0) && (saldofinal>=(-limite))){ JOptionPane.showMessageDialog(null, "Seu saldo final é negativo com: R$"+saldofinal); }else{ JOptionPane.showMessageDialog(null, "Você não possui limite suficiente. Seu limite é de: "+limite); } } }
4cc3755818a3d7039a9c3756b6b459f6c9c2a4e1
ca5e7f184b0bb637556a11aaac2e9c3f8e0e7d81
/Lab/lab1/_Names.java
16a3d936ffb04be29d732b4191263fbb3201f612
[]
no_license
Maecenas/CS61B-DataStructure-Algorithm
ded864f671c6a325f0251273c711845027815646
7b5d8f8027ef49ee6c03c9283bc8b690e7ddcbd6
refs/heads/master
2021-10-20T23:01:44.544832
2019-03-02T11:59:12
2019-03-02T11:59:12
115,643,699
3
0
null
null
null
null
UTF-8
Java
false
false
1,652
java
/* Names.java */ import java.io.*; /** The Names class provides a single function, main, that will * perform various manipulations of the name John Fitzgerald Kennedy. * This is a modification of the program on page 43 of Arnow and Weiss. */ class Names { /** Performs various string operations on the name John Fitzgerald Kennedy. * @param arg is not used. */ public static void main(String arg[]) { String first = "John"; String middle = "Fitzgerald"; String last = "Kennedy"; String initials; String firstInit, middleInit, lastInit; firstInit = first.substring(0,1); middleInit = middle.substring(0,1); lastInit = last.substring(0,1); initials = firstInit.concat(middleInit); initials = initials.concat(lastInit); System.out.println(); System.out.println(first + " " + middle + " " + last + " "); System.out.println(initials); System.out.println(last + ", " + first + " " + middle); System.out.println(last + ", " + first + " " + middleInit + "."); System.out.println(first.toUpperCase() + " " + last.toUpperCase()); System.out.println(first + " equals john is " + first.equals("john")); System.out.println(first + " equals john (ignoring case) is " + first.equalsIgnoreCase("john")); System.out.println("The character at index 3 in " + middle + " is " + middle.substring(3,4)); System.out.println("The index of \"gerald\" within " + middle + " is " + middle.indexOf("gerald")); System.out.println("The index of \"gerald\" within " + last + " is " + last.indexOf("gerald")); System.out.println(); } }
7a1f0de2d8a0ecd4f8cd532757ac2ee41a3bf618
028cbe18b4e5c347f664c592cbc7f56729b74060
/v2/admin/mbeans/src/java/com/sun/enterprise/management/model/ResourceAdapterMdl.java
99ac85194d6fe9c57a90d44dbb382ae2b1229157
[]
no_license
dmatej/Glassfish-SVN-Patched
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
269e29ba90db6d9c38271f7acd2affcacf2416f1
refs/heads/master
2021-05-28T12:55:06.267463
2014-11-11T04:21:44
2014-11-11T04:21:44
23,610,469
1
0
null
null
null
null
UTF-8
Java
false
false
5,001
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package com.sun.enterprise.management.model; import javax.management.ObjectName; import java.util.Set; public class ResourceAdapterMdl extends J2EEManagedObjectMdl { private static String MANAGED_OBJECT_TYPE = "ResourceAdapter"; private String raModuleName = null; private String applicationName = null; private String resourceAdapterName = null; public ResourceAdapterMdl(String name, String rarName, String appName) { super(name, false, false, false); raModuleName = rarName; if(appName != null){ this.applicationName = appName; if(J2EEModuleMdl.isStandAloneModule(applicationName)) this.applicationName = "null"; } else { //standalone this.applicationName = "null"; } resourceAdapterName = name; } public ResourceAdapterMdl(String name, String rarName, String appName, String serverName) { super(name, serverName, false, false, false); raModuleName = rarName; if(appName != null){ this.applicationName = appName; if(J2EEModuleMdl.isStandAloneModule(applicationName)) this.applicationName = "null"; } else { //standalone this.applicationName = "null"; } resourceAdapterName = name; } /** * The type of the J2EEManagedObject as specified by JSR77. The class that implements a specific type must override this method and return the appropriate type string. */ public String getj2eeType() { return MANAGED_OBJECT_TYPE; } /** * The name of the J2EEManagedObject. All managed objects must have a unique name within the context of the management * domain. The name must not be null. */ public String getobjectName() { Set s = findNames("j2eeType="+getj2eeType()+",name="+this.resourceAdapterName+",ResourceAdapterModule="+this.getResourceAdapterModule()+",J2EEApplication="+this.getJ2EEApplication()+",J2EEServer="+this.getJ2EEServer()); Object [] objs = s.toArray(); if (objs.length > 0) { String name = ((ObjectName)objs[0]).toString(); return name; } else { return null; } } /** * returns the OBJECT_NAME of the JCAResource implemented by this resource adapter */ public String getjcaResource() { Set s = findNames("j2eeType=JCAResource,ResourceAdapter="+this.resourceAdapterName+",J2EEServer="+this.getJ2EEServer()); Object [] objs = s.toArray(); if (objs.length > 0) { String name = ((ObjectName)objs[0]).toString(); return name; } else { return null; } } /** * Accessor method for the parent key */ public String getResourceAdapterModule(){ return raModuleName; } /** * Accessor method for the parent key */ public String getJ2EEApplication(){ return this.applicationName; } }
[ "kohsuke@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5" ]
kohsuke@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
516a9b09ed1b856c8bd64a9c26bac4be23842752
60af9095f58a65ae06263b2ff51d0e8c0e3e8e8c
/src/main/java/me/pm/lemon/module/modules/render/OG.java
12691e486f4f1b9377132b2eb4236a12bdf2a492
[ "CC0-1.0" ]
permissive
Li4M4tt8IL/LemonProject
3f02e2677e2df1fd96313355b64b819c94be81df
6db6c0a48ca3dee745deead2f1f618d1904c9b47
refs/heads/master
2023-08-11T14:35:00.496271
2021-10-14T18:26:18
2021-10-14T18:26:18
359,535,851
0
0
null
null
null
null
UTF-8
Java
false
false
908
java
package me.pm.lemon.module.modules.render; import me.pm.lemon.gui.clickGui.settings.*; import me.pm.lemon.module.Category; import me.pm.lemon.module.Module; import me.pm.lemon.module.ModuleManager; import java.awt.*; public class OG extends Module { public OG(String name, Category category, String description, int keyCode, Color color, Setting... settings) { super(name, category, description, keyCode, color, settings); } @Override public void onEnable() { for(Module mod : ModuleManager.getModules()) { String name = mod.getDisplayName(); String ogName = "OG " + name; mod.setDisplayName(ogName); } super.onEnable(); } @Override public void onDisable() { for(Module mod : ModuleManager.getModules()) { mod.setDisplayName(mod.getName()); } super.onDisable(); } }
2e34dc5f1cc0d7d09a54759f72b7487230d2312d
65fb83ad653e6d26a94019d738cd8bccd8094a9c
/src/main/java/pl/ais/zychu/config/OAuth2ServerConfiguration.java
ca4d0406619bc495c11fb86ce6bc5f7a0128e337
[]
no_license
technoprologic/oAuth_REST_API
b0658469fca6ee87123be05df586bd0ba1792585
7f8e224b64a92a8d0b2df96cb6b2236c117df472
refs/heads/master
2021-01-10T02:52:09.495207
2016-04-03T22:05:51
2016-04-03T22:05:51
54,507,233
0
0
null
null
null
null
UTF-8
Java
false
false
4,189
java
package pl.ais.zychu.config; import pl.ais.zychu.service.CustomUserDetailsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; import org.springframework.security.oauth2.provider.token.DefaultTokenServices; import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; /** * Created by emagdnim on 2016-03-21. */ @Configuration public class OAuth2ServerConfiguration { private static final String RESOURCE_ID = "restservice"; @Configuration @EnableResourceServer protected static class ResourceServerConfiguration extends ResourceServerConfigurerAdapter { @Override public void configure(ResourceServerSecurityConfigurer resources) { // @formatter:off resources .resourceId(RESOURCE_ID); // @formatter:on } @Override public void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .antMatchers("/api/**").authenticated() .antMatchers("/api/**/**").authenticated() .antMatchers("/status").anonymous(); // @formatter:on } } @Configuration @EnableAuthorizationServer protected static class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter { private TokenStore tokenStore = new InMemoryTokenStore(); @Autowired @Qualifier("authenticationManagerBean") private AuthenticationManager authenticationManager; @Autowired private CustomUserDetailsService userDetailsService; @Override public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { // @formatter:off endpoints .tokenStore(this.tokenStore) .authenticationManager(this.authenticationManager) .userDetailsService(userDetailsService); // @formatter:on } @Override public void configure(ClientDetailsServiceConfigurer clients) throws Exception { // @formatter:off clients .inMemory() .withClient("clientapp") .authorizedGrantTypes("password", "refresh_token") .authorities("USER") .scopes("read", "write") .resourceIds(RESOURCE_ID) .secret("123456"); // @formatter:on } @Bean @Primary public DefaultTokenServices tokenServices() { DefaultTokenServices tokenServices = new DefaultTokenServices(); tokenServices.setSupportRefreshToken(true); tokenServices.setTokenStore(this.tokenStore); return tokenServices; } } }
d25f96197ef675bc3c81350f884227797eb480e4
beb3dac3bbfe041aa5a4484d379d3cda15f43e20
/src/main/java/com/spring4/AOP/CalculatorImpl.java
65614a7ad3b5ef9f4b885e114938d88b84eeca43
[]
no_license
justinh9408/Spring4_Learning
76f550bdbb2a005d6daed1f01697f4bdf7bd5423
00d70f8de9c621e1e50e8ddd3671835f4fdcafd0
refs/heads/master
2020-11-25T06:30:12.611647
2020-01-17T18:32:26
2020-01-17T18:32:26
228,539,836
0
0
null
2020-10-13T18:16:12
2019-12-17T05:29:02
Java
UTF-8
Java
false
false
559
java
package com.spring4.AOP; import org.springframework.stereotype.Component; /** * @Classname CalculatorImpl * @Description TODO * @Date 2019-12-18 19:19 * @Created by Justin */ @Component public class CalculatorImpl implements ICalculator { @Override public int add(int a, int b) { return a + b; } @Override public int sub(int a, int b) { return a - b; } @Override public int mul(int a, int b) { return a * b; } @Override public int div(int a, int b) { return a/b; } }
0aa116a2d7257744b4725cae7f046d79ae99d204
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-codegurusecurity/src/main/java/com/amazonaws/services/codegurusecurity/model/transform/FindingMetricsValuePerSeverityMarshaller.java
539f95955e9767eec63662bf394d9328d9536caf
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
3,321
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.codegurusecurity.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.codegurusecurity.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * FindingMetricsValuePerSeverityMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class FindingMetricsValuePerSeverityMarshaller { private static final MarshallingInfo<Double> CRITICAL_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("critical").build(); private static final MarshallingInfo<Double> HIGH_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("high").build(); private static final MarshallingInfo<Double> INFO_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("info").build(); private static final MarshallingInfo<Double> LOW_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("low").build(); private static final MarshallingInfo<Double> MEDIUM_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("medium").build(); private static final FindingMetricsValuePerSeverityMarshaller instance = new FindingMetricsValuePerSeverityMarshaller(); public static FindingMetricsValuePerSeverityMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(FindingMetricsValuePerSeverity findingMetricsValuePerSeverity, ProtocolMarshaller protocolMarshaller) { if (findingMetricsValuePerSeverity == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(findingMetricsValuePerSeverity.getCritical(), CRITICAL_BINDING); protocolMarshaller.marshall(findingMetricsValuePerSeverity.getHigh(), HIGH_BINDING); protocolMarshaller.marshall(findingMetricsValuePerSeverity.getInfo(), INFO_BINDING); protocolMarshaller.marshall(findingMetricsValuePerSeverity.getLow(), LOW_BINDING); protocolMarshaller.marshall(findingMetricsValuePerSeverity.getMedium(), MEDIUM_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
7a86073fadbb93c2e5ebaebacd7ad1902c883cf6
ce01dc23a87658fefc6f557174afe540addb51f1
/nature-spirit-ejb/src/main/java/tn/esprit/entities/DonationTheory.java
0d38ef5b8101fa2de801a19dc6cda0f5bb9181a3
[]
no_license
HorizenSS/WZ_ESPRIT_JavaEE_JSF_Nature-Spirit_Project
f0b235fa8051679f7e466d1991da7665d2394a66
1a03735049e9df2e7e2ec87d28bdc6ad23edb411
refs/heads/master
2020-08-29T20:30:59.080305
2017-12-09T20:19:02
2017-12-09T20:19:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,976
java
package tn.esprit.entities; import java.io.Serializable; import java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; /** * Entity implementation class for Entity: Donation * */ @Entity @XmlRootElement public class DonationTheory implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id_Donation_Theory; private Double Amount_of_money; private Date Date_of_transfert; @ManyToOne private Member member; private static final long serialVersionUID = 1L; public DonationTheory() { super(); } public DonationTheory(Integer id_Donation_Theory) { super(); this.id_Donation_Theory = id_Donation_Theory; this.Date_of_transfert = new Date(); } public DonationTheory(Integer id_Donation_Theory, Double Amount_of_money, Date date_of_transfert) { super(); this.id_Donation_Theory = id_Donation_Theory; this.Amount_of_money = Amount_of_money; this.Date_of_transfert = new Date(); } public Integer getId_Donation_Theory() { return id_Donation_Theory; } public void setId_Donation_Theory(Integer id_Donation_Theory) { this.id_Donation_Theory = id_Donation_Theory; } public Double getAmount_of_money() { return this.Amount_of_money; } public void setAmount_of_money(Double Amount_of_money) { this.Amount_of_money = Amount_of_money; } public Date getDate_of_transfert() { return this.Date_of_transfert; } public void setDate_of_transfert(Date Date_of_transfert) { this.Date_of_transfert = Date_of_transfert; } public Member getMember() { return member; } public void setMember(Member member) { this.member = member; } }
7d48515720af39f44848de938ea9dad35214c81c
13203cce329db78063aeeed24f0bcb7ec13ff758
/src/main/java/se/ecutb/spring_data_practice/entity/Address.java
6949b287e635bdbde2bce0494882172e90a3af71
[]
no_license
Dknwhe/spring_data_practice
6f7755f4d2502d5cc395c5f9815453ec214cfb65
2c0818e896681dddd15b26aef294ce63c0f0b062
refs/heads/master
2021-03-02T17:40:01.901391
2020-03-02T11:01:21
2020-03-02T11:01:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,179
java
package se.ecutb.spring_data_practice.entity; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.util.Objects; @Entity public class Address { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int addressId; private String street; private String zipCode; private String city; public Address(int addressId, String street, String zipCode, String city) { this.addressId = addressId; this.street = street; this.zipCode = zipCode; this.city = city; } public Address(String street, String zipCode, String city) { this(0, street,zipCode,city); } Address(){} public int getAddressId() { return addressId; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getZipCode() { return zipCode; } public void setZipCode(String zipCode) { this.zipCode = zipCode; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Address address = (Address) o; return addressId == address.addressId && Objects.equals(street, address.street) && Objects.equals(zipCode, address.zipCode) && Objects.equals(city, address.city); } @Override public int hashCode() { return Objects.hash(addressId, street, zipCode, city); } @Override public String toString() { final StringBuilder sb = new StringBuilder("Address{"); sb.append("addressId=").append(addressId); sb.append(", street='").append(street).append('\''); sb.append(", zipCode='").append(zipCode).append('\''); sb.append(", city='").append(city).append('\''); sb.append('}'); return sb.toString(); } }
a5552bb62d7cb1c4b3e66e7c292a9b51d23d8b6a
fb02000e63167bc2c6e5b81fcd4a20729b23db09
/src/main/java/org/iata/iata/edist/DataListObjectBaseType.java
8b2b50928db5edcca8a6728e597b5f600b8d56e6
[]
no_license
sebastiansumith/hackair
78877b570bb30ab59243cf405bb9da6ed903ccbd
8e62a4d49c7325fe77e7b34d8b8fe02e0a57aaa4
refs/heads/master
2020-03-19T16:47:14.165686
2018-06-09T14:33:10
2018-06-09T14:33:10
136,730,014
0
0
null
null
null
null
UTF-8
Java
false
false
8,823
java
package org.iata.iata.edist; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlIDREF; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * A base type for a Data List object. * * <p>Java class for DataListObjectBaseType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DataListObjectBaseType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attGroup ref="{http://www.iata.org/IATA/EDIST}DataListObjAttrGroup"/> * &lt;attribute name="DisplayAllInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="NetFareInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="ReissueOnlyInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="AutoExchangeInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="BundleInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="MaximumTryInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="NotProcessedInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="RetryInd" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DataListObjectBaseType") @XmlSeeAlso({ org.iata.iata.edist.ListOfDisclosureType.Disclosures.class, org.iata.iata.edist.ListOfBagAllowanceType.CheckedBagAllowance.class, org.iata.iata.edist.FareList.FareGroup.class, org.iata.iata.edist.ListOfCarryOnAllowanceType.CarryOnAllowance.class, org.iata.iata.edist.ListOfMediaType.Media.class, org.iata.iata.edist.ListOfBagDisclosureType.BagDisclosure.class, org.iata.iata.edist.ListOfClassOfServiceType.ServiceClass.class, org.iata.iata.edist.ListOfServiceBundleType.ServiceBundle.class, org.iata.iata.edist.ListOfContentSourceType.ContentSource.class, ListOfOfferTermsType.class, ListOfSeatType.class, org.iata.iata.edist.ListOfServiceType.Service.class, org.iata.iata.edist.PaymentIssueAlertType.Payment.class }) public class DataListObjectBaseType { @XmlAttribute(name = "DisplayAllInd") protected Boolean displayAllInd; @XmlAttribute(name = "NetFareInd") protected Boolean netFareInd; @XmlAttribute(name = "ReissueOnlyInd") protected Boolean reissueOnlyInd; @XmlAttribute(name = "AutoExchangeInd") protected Boolean autoExchangeInd; @XmlAttribute(name = "BundleInd") protected Boolean bundleInd; @XmlAttribute(name = "MaximumTryInd") protected Boolean maximumTryInd; @XmlAttribute(name = "NotProcessedInd") protected Boolean notProcessedInd; @XmlAttribute(name = "RetryInd") protected Boolean retryInd; @XmlAttribute(name = "refs") @XmlIDREF protected List<Object> refs; @XmlAttribute(name = "ListKey", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String listKey; /** * Gets the value of the displayAllInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isDisplayAllInd() { return displayAllInd; } /** * Sets the value of the displayAllInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setDisplayAllInd(Boolean value) { this.displayAllInd = value; } /** * Gets the value of the netFareInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isNetFareInd() { return netFareInd; } /** * Sets the value of the netFareInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setNetFareInd(Boolean value) { this.netFareInd = value; } /** * Gets the value of the reissueOnlyInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isReissueOnlyInd() { return reissueOnlyInd; } /** * Sets the value of the reissueOnlyInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setReissueOnlyInd(Boolean value) { this.reissueOnlyInd = value; } /** * Gets the value of the autoExchangeInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isAutoExchangeInd() { return autoExchangeInd; } /** * Sets the value of the autoExchangeInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setAutoExchangeInd(Boolean value) { this.autoExchangeInd = value; } /** * Gets the value of the bundleInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBundleInd() { return bundleInd; } /** * Sets the value of the bundleInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setBundleInd(Boolean value) { this.bundleInd = value; } /** * Gets the value of the maximumTryInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isMaximumTryInd() { return maximumTryInd; } /** * Sets the value of the maximumTryInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setMaximumTryInd(Boolean value) { this.maximumTryInd = value; } /** * Gets the value of the notProcessedInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isNotProcessedInd() { return notProcessedInd; } /** * Sets the value of the notProcessedInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setNotProcessedInd(Boolean value) { this.notProcessedInd = value; } /** * Gets the value of the retryInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isRetryInd() { return retryInd; } /** * Sets the value of the retryInd property. * * @param value * allowed object is * {@link Boolean } * */ public void setRetryInd(Boolean value) { this.retryInd = value; } /** * Gets the value of the refs property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the refs property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRefs().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Object } * * */ public List<Object> getRefs() { if (refs == null) { refs = new ArrayList<Object>(); } return this.refs; } /** * Gets the value of the listKey property. * * @return * possible object is * {@link String } * */ public String getListKey() { return listKey; } /** * Sets the value of the listKey property. * * @param value * allowed object is * {@link String } * */ public void setListKey(String value) { this.listKey = value; } }
8f124a03e4da791da8b2be9918e15b94095aaca6
3343050b340a8594d802598cddfd0d8709ccc45a
/src/share/classes/javax/swing/MenuSelectionManager.java
3f83acbac075bb734c2498692eac4325b41ccadb
[ "Apache-2.0" ]
permissive
lcyanxi/jdk8
be07ce687ca610c9e543bf3c1168be8228c1f2b3
4f4c2d72670a30dafaf9bb09b908d4da79119cf6
refs/heads/master
2022-05-25T18:11:28.236578
2022-05-03T15:28:01
2022-05-03T15:28:01
228,209,646
0
0
Apache-2.0
2022-05-03T15:28:03
2019-12-15T15:49:24
Java
UTF-8
Java
false
false
18,914
java
/* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; import java.awt.*; import java.util.*; import java.awt.event.*; import javax.swing.event.*; import sun.awt.AppContext; import sun.swing.SwingUtilities2; /** * A MenuSelectionManager owns the selection in menu hierarchy. * * @author Arnaud Weber */ public class MenuSelectionManager { private Vector<MenuElement> selection = new Vector<MenuElement>(); /* diagnostic aids -- should be false for production builds. */ private static final boolean TRACE = false; // trace creates and disposes private static final boolean VERBOSE = false; // show reuse hits/misses private static final boolean DEBUG = false; // show bad params, misc. private static final StringBuilder MENU_SELECTION_MANAGER_KEY = new StringBuilder("javax.swing.MenuSelectionManager"); /** * Returns the default menu selection manager. * * @return a MenuSelectionManager object */ public static MenuSelectionManager defaultManager() { synchronized (MENU_SELECTION_MANAGER_KEY) { AppContext context = AppContext.getAppContext(); MenuSelectionManager msm = (MenuSelectionManager)context.get( MENU_SELECTION_MANAGER_KEY); if (msm == null) { msm = new MenuSelectionManager(); context.put(MENU_SELECTION_MANAGER_KEY, msm); // installing additional listener if found in the AppContext Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY); if (o != null && o instanceof ChangeListener) { msm.addChangeListener((ChangeListener) o); } } return msm; } } /** * Only one ChangeEvent is needed per button model instance since the * event's only state is the source property. The source of events * generated is always "this". */ protected transient ChangeEvent changeEvent = null; protected EventListenerList listenerList = new EventListenerList(); /** * Changes the selection in the menu hierarchy. The elements * in the array are sorted in order from the root menu * element to the currently selected menu element. * <p> * Note that this method is public but is used by the look and * feel engine and should not be called by client applications. * * @param path an array of <code>MenuElement</code> objects specifying * the selected path */ public void setSelectedPath(MenuElement[] path) { int i,c; int currentSelectionCount = selection.size(); int firstDifference = 0; if(path == null) { path = new MenuElement[0]; } if (DEBUG) { System.out.print("Previous: "); printMenuElementArray(getSelectedPath()); System.out.print("New: "); printMenuElementArray(path); } for(i=0,c=path.length;i<c;i++) { if (i < currentSelectionCount && selection.elementAt(i) == path[i]) firstDifference++; else break; } for(i=currentSelectionCount - 1 ; i >= firstDifference ; i--) { MenuElement me = selection.elementAt(i); selection.removeElementAt(i); me.menuSelectionChanged(false); } for(i = firstDifference, c = path.length ; i < c ; i++) { if (path[i] != null) { selection.addElement(path[i]); path[i].menuSelectionChanged(true); } } fireStateChanged(); } /** * Returns the path to the currently selected menu item * * @return an array of MenuElement objects representing the selected path */ public MenuElement[] getSelectedPath() { MenuElement res[] = new MenuElement[selection.size()]; int i,c; for(i=0,c=selection.size();i<c;i++) res[i] = selection.elementAt(i); return res; } /** * Tell the menu selection to close and unselect all the menu components. Call this method * when a choice has been made */ public void clearSelectedPath() { if (selection.size() > 0) { setSelectedPath(null); } } /** * Adds a ChangeListener to the button. * * @param l the listener to add */ public void addChangeListener(ChangeListener l) { listenerList.add(ChangeListener.class, l); } /** * Removes a ChangeListener from the button. * * @param l the listener to remove */ public void removeChangeListener(ChangeListener l) { listenerList.remove(ChangeListener.class, l); } /** * Returns an array of all the <code>ChangeListener</code>s added * to this MenuSelectionManager with addChangeListener(). * * @return all of the <code>ChangeListener</code>s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return listenerList.getListeners(ChangeListener.class); } /** * Notifies all listeners that have registered interest for * notification on this event type. The event instance * is created lazily. * * @see EventListenerList */ protected void fireStateChanged() { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ChangeListener.class) { // Lazily create the event: if (changeEvent == null) changeEvent = new ChangeEvent(this); ((ChangeListener)listeners[i+1]).stateChanged(changeEvent); } } } /** * When a MenuElement receives an event from a MouseListener, it should never process the event * directly. Instead all MenuElements should call this method with the event. * * @param event a MouseEvent object */ public void processMouseEvent(MouseEvent event) { int screenX,screenY; Point p; int i,c,j,d; Component mc; Rectangle r2; int cWidth,cHeight; MenuElement menuElement; MenuElement subElements[]; MenuElement path[]; Vector<MenuElement> tmp; int selectionSize; p = event.getPoint(); Component source = event.getComponent(); if ((source != null) && !source.isShowing()) { // This can happen if a mouseReleased removes the // containing component -- bug 4146684 return; } int type = event.getID(); int modifiers = event.getModifiers(); // 4188027: drag enter/exit added in JDK 1.1.7A, JDK1.2 if ((type==MouseEvent.MOUSE_ENTERED|| type==MouseEvent.MOUSE_EXITED) && ((modifiers & (InputEvent.BUTTON1_MASK | InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK)) !=0 )) { return; } if (source != null) { SwingUtilities.convertPointToScreen(p, source); } screenX = p.x; screenY = p.y; tmp = (Vector<MenuElement>)selection.clone(); selectionSize = tmp.size(); boolean success = false; for (i=selectionSize - 1;i >= 0 && success == false; i--) { menuElement = (MenuElement) tmp.elementAt(i); subElements = menuElement.getSubElements(); path = null; for (j = 0, d = subElements.length;j < d && success == false; j++) { if (subElements[j] == null) continue; mc = subElements[j].getComponent(); if(!mc.isShowing()) continue; if(mc instanceof JComponent) { cWidth = mc.getWidth(); cHeight = mc.getHeight(); } else { r2 = mc.getBounds(); cWidth = r2.width; cHeight = r2.height; } p.x = screenX; p.y = screenY; SwingUtilities.convertPointFromScreen(p,mc); /** Send the event to visible menu element if menu element currently in * the selected path or contains the event location */ if( (p.x >= 0 && p.x < cWidth && p.y >= 0 && p.y < cHeight)) { int k; if(path == null) { path = new MenuElement[i+2]; for(k=0;k<=i;k++) path[k] = (MenuElement)tmp.elementAt(k); } path[i+1] = subElements[j]; MenuElement currentSelection[] = getSelectedPath(); // Enter/exit detection -- needs tuning... if (currentSelection[currentSelection.length-1] != path[i+1] && (currentSelection.length < 2 || currentSelection[currentSelection.length-2] != path[i+1])) { Component oldMC = currentSelection[currentSelection.length-1].getComponent(); MouseEvent exitEvent = new MouseEvent(oldMC, MouseEvent.MOUSE_EXITED, event.getWhen(), event.getModifiers(), p.x, p.y, event.getXOnScreen(), event.getYOnScreen(), event.getClickCount(), event.isPopupTrigger(), MouseEvent.NOBUTTON); currentSelection[currentSelection.length-1]. processMouseEvent(exitEvent, path, this); MouseEvent enterEvent = new MouseEvent(mc, MouseEvent.MOUSE_ENTERED, event.getWhen(), event.getModifiers(), p.x, p.y, event.getXOnScreen(), event.getYOnScreen(), event.getClickCount(), event.isPopupTrigger(), MouseEvent.NOBUTTON); subElements[j].processMouseEvent(enterEvent, path, this); } MouseEvent mouseEvent = new MouseEvent(mc, event.getID(),event. getWhen(), event.getModifiers(), p.x, p.y, event.getXOnScreen(), event.getYOnScreen(), event.getClickCount(), event.isPopupTrigger(), MouseEvent.NOBUTTON); subElements[j].processMouseEvent(mouseEvent, path, this); success = true; event.consume(); } } } } private void printMenuElementArray(MenuElement path[]) { printMenuElementArray(path, false); } private void printMenuElementArray(MenuElement path[], boolean dumpStack) { System.out.println("Path is("); int i, j; for(i=0,j=path.length; i<j ;i++){ for (int k=0; k<=i; k++) System.out.print(" "); MenuElement me = path[i]; if(me instanceof JMenuItem) { System.out.println(((JMenuItem)me).getText() + ", "); } else if (me instanceof JMenuBar) { System.out.println("JMenuBar, "); } else if(me instanceof JPopupMenu) { System.out.println("JPopupMenu, "); } else if (me == null) { System.out.println("NULL , "); } else { System.out.println("" + me + ", "); } } System.out.println(")"); if (dumpStack == true) Thread.dumpStack(); } /** * Returns the component in the currently selected path * which contains sourcePoint. * * @param source The component in whose coordinate space sourcePoint * is given * @param sourcePoint The point which is being tested * @return The component in the currently selected path which * contains sourcePoint (relative to the source component's * coordinate space. If sourcePoint is not inside a component * on the currently selected path, null is returned. */ public Component componentForPoint(Component source, Point sourcePoint) { int screenX,screenY; Point p = sourcePoint; int i,c,j,d; Component mc; Rectangle r2; int cWidth,cHeight; MenuElement menuElement; MenuElement subElements[]; Vector<MenuElement> tmp; int selectionSize; SwingUtilities.convertPointToScreen(p,source); screenX = p.x; screenY = p.y; tmp = (Vector<MenuElement>)selection.clone(); selectionSize = tmp.size(); for(i=selectionSize - 1 ; i >= 0 ; i--) { menuElement = (MenuElement) tmp.elementAt(i); subElements = menuElement.getSubElements(); for(j = 0, d = subElements.length ; j < d ; j++) { if (subElements[j] == null) continue; mc = subElements[j].getComponent(); if(!mc.isShowing()) continue; if(mc instanceof JComponent) { cWidth = mc.getWidth(); cHeight = mc.getHeight(); } else { r2 = mc.getBounds(); cWidth = r2.width; cHeight = r2.height; } p.x = screenX; p.y = screenY; SwingUtilities.convertPointFromScreen(p,mc); /** Return the deepest component on the selection * path in whose bounds the event's point occurs */ if (p.x >= 0 && p.x < cWidth && p.y >= 0 && p.y < cHeight) { return mc; } } } return null; } /** * When a MenuElement receives an event from a KeyListener, it should never process the event * directly. Instead all MenuElements should call this method with the event. * * @param e a KeyEvent object */ public void processKeyEvent(KeyEvent e) { MenuElement[] sel2 = new MenuElement[0]; sel2 = selection.toArray(sel2); int selSize = sel2.length; MenuElement[] path; if (selSize < 1) { return; } for (int i=selSize-1; i>=0; i--) { MenuElement elem = sel2[i]; MenuElement[] subs = elem.getSubElements(); path = null; for (int j=0; j<subs.length; j++) { if (subs[j] == null || !subs[j].getComponent().isShowing() || !subs[j].getComponent().isEnabled()) { continue; } if(path == null) { path = new MenuElement[i+2]; System.arraycopy(sel2, 0, path, 0, i+1); } path[i+1] = subs[j]; subs[j].processKeyEvent(e, path, this); if (e.isConsumed()) { return; } } } // finally dispatch event to the first component in path path = new MenuElement[1]; path[0] = sel2[0]; path[0].processKeyEvent(e, path, this); if (e.isConsumed()) { return; } } /** * Return true if c is part of the currently used menu */ public boolean isComponentPartOfCurrentMenu(Component c) { if(selection.size() > 0) { MenuElement me = selection.elementAt(0); return isComponentPartOfCurrentMenu(me,c); } else return false; } private boolean isComponentPartOfCurrentMenu(MenuElement root,Component c) { MenuElement children[]; int i,d; if (root == null) return false; if(root.getComponent() == c) return true; else { children = root.getSubElements(); for(i=0,d=children.length;i<d;i++) { if(isComponentPartOfCurrentMenu(children[i],c)) return true; } } return false; } }
39fcdea821f62a000213836b01fe2d6d4fe24c33
d999cd6df35fc885e09bbc7dd2344e9cef3734c2
/src/main/java/com/cicd/example/cicddemo/CicddemoApplication.java
811fca95890ff2bb4c92f60e3e8136c7cc715d01
[]
no_license
satyacicd/CICD-Demo
80e836eb8367447b3747a3e248aeb3bfbbc38aa5
e1a662f053cd5b709b75a4c9edb719ad1079b12a
refs/heads/master
2021-07-14T13:57:24.262397
2020-10-04T11:49:37
2020-10-04T11:49:37
209,030,681
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package com.cicd.example.cicddemo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class CicddemoApplication { public static void main(String[] args) { SpringApplication.run(CicddemoApplication.class, args); } }
da13138c7b9b480c3e72e1c8b14c7fc89765c9db
1163d134e77c648ee05d6e0d345cf71cc5e2be1d
/src/edu/mum/wap/controller/CommentController.java
4f0a4e70a5fef6e9267420c74ab938ad700be693
[]
no_license
kknirala/CarPoolingApp
2c6c1c484f892d4efd82f7ca830c3b6ed5cfec7f
e40df1dc9c1fe0b3e3b1085412c7f55678e9c34b
refs/heads/master
2021-06-11T21:55:04.137908
2016-12-24T09:09:07
2016-12-24T09:09:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,748
java
package edu.mum.wap.controller; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.sql.SQLException; import java.util.stream.Collectors; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.gson.Gson; import edu.mum.wap.model.Comments; import edu.mum.wap.model.Likes; import edu.mum.wap.model.mapper.CommentMapper; import edu.mum.wap.model.mapper.LikePostMapper; import edu.mum.wap.service.ICommentService; import edu.mum.wap.service.helper.CommentServiceHelper; import edu.mum.wap.service.impl.CommentServiceImpl; import edu.mum.wap.util.CarPoolingMarshaller; public class CommentController extends HttpServlet { private static final long serialVersionUID = 1L; public CommentController() { } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int commentId = Integer.valueOf(request.getPathInfo().substring(1)); ICommentService commentService = new CommentServiceImpl(); Comments comment = null; try { comment = commentService.findComment(commentId); } catch (SQLException e) { e.printStackTrace(); } String responseText = CarPoolingMarshaller.getJsonFromObject(comment); PrintWriter out = response.getWriter(); out.write(responseText); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Comments comment = null; BufferedReader reader = request.getReader(); String comingresult = reader.lines().collect(Collectors.joining(System.lineSeparator())); Gson gson = new Gson(); CommentMapper commentMapper = new CommentMapper(); commentMapper = gson.fromJson(comingresult, CommentMapper.class); try { comment = CommentServiceHelper.getCommentFrommapper(commentMapper); } catch (SQLException e1) { e1.printStackTrace(); } ICommentService commentService = new CommentServiceImpl(); try { commentService.addNewComment(comment); } catch (SQLException e) { e.printStackTrace(); } String responseText = CarPoolingMarshaller.getJsonFromObject(comment); PrintWriter out = response.getWriter(); out.write(responseText); } @Override protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { BufferedReader reader = req.getReader(); int commentId = Integer.valueOf(req.getPathInfo().substring(1)); Gson gson = new Gson(); Comments comment = gson.fromJson(reader, Comments.class); ICommentService commentService = new CommentServiceImpl(); Comments oldComment = null; try { oldComment = commentService.findComment(commentId); } catch (SQLException e1) { e1.printStackTrace(); } if (oldComment != null) { oldComment.setComment(comment.getComment()); try { commentService.updateComment(comment); } catch (SQLException e) { e.printStackTrace(); } } else { try { commentService.addNewComment(comment); } catch (SQLException e) { e.printStackTrace(); } } String responseText = CarPoolingMarshaller.getJsonFromObject(comment); PrintWriter out = resp.getWriter(); out.write(responseText); } @Override protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { int commentId = Integer.valueOf(req.getPathInfo().substring(1)); ICommentService commentService = new CommentServiceImpl(); try { commentService.deleteComment(commentId); } catch (SQLException e) { e.printStackTrace(); } PrintWriter out = resp.getWriter(); out.write("{deleted: true}"); } }
844637b3863022af6ed1e5be3073e5ec7eb4da7e
994314009c4d046c11bad762c26433d0e4ec99d6
/app/src/main/java/com/example/finalproject_diploma/MainActivity.java
27770b3ef218f389ab0d19b1fac229373ec4c664
[]
no_license
Menna-Elberamy/EcommerceApp-androidproject
2f49bee2254ed56bc0839ef18baae2a64246560a
b25e6d977526b7e7b6070981d6e3eb1b895fe2ac
refs/heads/master
2023-02-25T03:10:24.926935
2021-01-17T00:48:59
2021-01-17T00:48:59
330,287,335
0
0
null
null
null
null
UTF-8
Java
false
false
858
java
package com.example.finalproject_diploma; import androidx.appcompat.app.AppCompatActivity; import androidx.navigation.NavController; import androidx.navigation.Navigation; import androidx.navigation.ui.NavigationUI; import android.os.Bundle; import com.google.android.material.bottomnavigation.BottomNavigationView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getSupportActionBar().hide(); NavController navController = Navigation.findNavController(MainActivity.this , R.id.nav_host_fragment); BottomNavigationView bottomNavigationView = findViewById(R.id.home_nav); NavigationUI.setupWithNavController(bottomNavigationView,navController); } }
aae7c698dfd5d7c492369288628e7d3b1a87411f
3f4f99e6f1d15b9c969ecfdfda6e1eb92e13d029
/FallstudieClient/src/tools/SonderzeichenTest.java
c04ec00c1128b2763e327576753ed35313f638d4
[]
no_license
Andi17/FallClient
88cc643674c700e691a6fcfc37f934a4b7629f5a
f2f603ffa06d6c3bc9e4b6b9884a1cfc899e0d41
refs/heads/master
2016-09-09T21:12:41.483049
2013-10-30T22:16:29
2013-10-30T22:16:29
null
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,139
java
package tools; public class SonderzeichenTest { //Test ob Sonderzeichen innerhalb eines Strings existieren: public boolean test(String s) { //TRUE : Sonderzeichen sind vorhanden. if(s.contains("°") || s.contains("^") || s.contains("!") || s.contains("\"") || s.contains("²") || s.contains("§") || s.contains("³") || s.contains("$") || s.contains("%") || s.contains("&") || s.contains("/") || s.contains("{") || s.contains("(") || s.contains("{") || s.contains("[") || s.contains(")") || s.contains("]") || s.contains("=") || s.contains("}") || s.contains("?") || s.contains("\\") || s.contains("´") || s.contains("`") || s.contains("*") || s.contains("+") || s.contains("~") || s.contains("#") || s.contains("'") || s.contains(">") || s.contains("<") || s.contains("|") || s.contains(",") || s.contains(";") || s.contains(".") || s.contains(":") || s.contains("-") || s.contains("_") ) { return true; } else { //FALSE: Sonderzeichen sind NICHT vorhanden. return false; } } }
2550209b5acbd46fa95787c672ca55a4b1116e2a
62e713720a1ae0eb9cb51e4e6c08e8aaf33c081f
/com.example.e4.rcp.todo/src/org/eclipse/jface/snippets/viewers/CompositeTableSnippet6.java
c9dea77d32dd0235c96d3f6f4ede6c595e8d9e65
[]
no_license
praveen2710/RcpTutGit
0eba50a18eb5d7fc5bc86f91c5adf74cd5c45889
0aea515e6d91a9547fa26feeab551c8c1d6f4fdf
refs/heads/master
2020-12-03T03:51:46.488163
2015-02-15T16:06:54
2015-02-15T16:06:54
28,004,240
0
0
null
null
null
null
UTF-8
Java
false
false
5,725
java
//package org.eclipse.jface.snippets.viewers; // //import org.eclipse.swt.SWT; //import org.eclipse.swt.graphics.Point; //import org.eclipse.swt.layout.FillLayout; //import org.eclipse.swt.layout.GridData; //import org.eclipse.swt.layout.GridLayout; //import org.eclipse.nebula.widgets.compositetable.CompositeTable; //import org.eclipse.nebula.widgets.compositetable.IRowContentProvider; //import org.eclipse.nebula.widgets.compositetable.RowFocusAdapter; //import org.eclipse.swt.widgets.Combo; //import org.eclipse.swt.widgets.Composite; //import org.eclipse.swt.widgets.Control; //import org.eclipse.swt.widgets.Display; //import org.eclipse.swt.widgets.Label; //import org.eclipse.swt.widgets.Shell; //import org.eclipse.swt.widgets.Text; // ///** // * A CompositeTable editing a name/address block // * // * @author djo // */ //public class CompositeTableSnippet6 { // // First some data to edit... // // private static class Address { // public String name; // public String address1; // public String address2; // public String city; // public String state; // public String postalCode; // public Address(String name, String address1, String address2, String city, // String state, String postalCode) { // this.name = name; // this.address1 = address1; // this.address2 = address2; // this.city = city; // this.state = state; // this.postalCode = postalCode; // } // } // // protected static Address[] addressList = new Address[] { // new Address("John Wright", "810 Trail's End", "", "Glen Ellyn", "Illinois", "60017"), // new Address("Anna Smith", "600 Milky Spore Rd", "", "Addison", "Illinois", "60010"), // new Address("Andy Taylor", "1913 North Path", "", "Wheaton", "Illinois", "60187"), // new Address("George Owen", "1624 Highwood", "", "Glenbrook", "Illinois", "60085"), // }; // // // // Now define the row object. It's just a regular Composite like you // // might use to edit an Address anywhere else. // // private static class AddressEditor extends Composite { // // public AddressEditor(Composite parent, int style) { // super(parent, style | SWT.BORDER); // // setLayout(new GridLayout(2, true)); // new Label(this, SWT.NULL).setText("Name:"); // new Label(this, SWT.NULL); // // name = new Text(this, SWT.BORDER); // name.setLayoutData(spanGD()); // // new Label(this, SWT.NULL).setText("Address:"); // new Label(this, SWT.NULL); // // address1 = new Text(this, SWT.BORDER); // address1.setLayoutData(spanGD()); // address2 = new Text(this, SWT.BORDER); // address2.setLayoutData(spanGD()); // // new Label(this, SWT.NULL).setText("City:"); // new Label(this, SWT.NULL).setText("State:"); // // city = new Text(this, SWT.BORDER); // city.setLayoutData(fillGD()); // state = new Combo(this, SWT.BORDER); // state.setLayoutData(fillGD()); // // new Label(this, SWT.NULL).setText("Zip:"); // new Label(this, SWT.NULL); // // postalCode = new Text(this, SWT.BORDER); // postalCode.setLayoutData(spanGD()); // } // // private GridData spanGD() { // GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); // gd.horizontalSpan=2; // return gd; // } // // private GridData fillGD() { // GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); // return gd; // } // // public final Text name; // public final Text address1; // public final Text address2; // public final Text city; // public final Combo state; // public final Text postalCode; // } // // // Where it all starts... // // public static void main (String [] args) { // Display display = new Display (); // Shell shell = new Shell (display); // shell.setText("CompositeTable Snippet 6 -- Edit name/address block"); // shell.setLayout(new FillLayout()); // // CompositeTable table = new CompositeTable(shell, SWT.NULL); // AddressEditor row = new AddressEditor(table, SWT.NULL); // No header? No problem. // table.setRunTime(true); // table.setNumRowsInCollection(addressList.length); // // // Note the JFace-like virtual table API // table.addRowContentProvider(new IRowContentProvider() { // public void refresh(CompositeTable sender, int currentObjectOffset, Control rowControl) { // AddressEditor row = (AddressEditor) rowControl; // row.name.setText(addressList[currentObjectOffset].name); // row.address1.setText(addressList[currentObjectOffset].address1); // row.address2.setText(addressList[currentObjectOffset].address2); // row.city.setText(addressList[currentObjectOffset].city); // row.state.setText(addressList[currentObjectOffset].state); // row.postalCode.setText(addressList[currentObjectOffset].postalCode); // } // }); // // table.addRowFocusListener(new RowFocusAdapter() { // public void depart(CompositeTable sender, int currentObjectOffset, Control rowControl) { // AddressEditor row = (AddressEditor) rowControl; // addressList[currentObjectOffset].name = row.name.getText(); // addressList[currentObjectOffset].address1 = row.address1.getText(); // addressList[currentObjectOffset].address2 = row.address2.getText(); // addressList[currentObjectOffset].city = row.city.getText(); // addressList[currentObjectOffset].state = row.state.getText(); // addressList[currentObjectOffset].postalCode = row.postalCode.getText(); // } // }); // // Point preferredSize = row.computeSize(SWT.DEFAULT, SWT.DEFAULT); // shell.setSize(500, 2*preferredSize.y+35); // shell.open (); // while (!shell.isDisposed()) { // if (!display.readAndDispatch ()) display.sleep (); // } // display.dispose (); // } //}
41276c46811d62506a58c295b0f0e442dc02729a
c532a5c3e5be407550ac910824f40366557137c6
/multable/src/main/java/com/yto/controller/GirlController.java
7a82bfcdc0dce4c6a4a9a3017431448c94c0c341
[]
no_license
670696095/spring-train
609e6fb949eda61306a57c0312e6d63f2915cdba
f6558365eeeaa47c67adf1d089d87d4ab7ce5ec2
refs/heads/master
2020-03-23T14:31:12.853593
2019-01-07T06:29:31
2019-01-07T06:29:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.yto.controller; import com.yto.bean.Girl; import com.yto.service.GirlService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author czw */ @RestController @RequestMapping("beautiful") public class GirlController { @Autowired private GirlService girlService; /** * 七夕女朋友 */ @RequestMapping("Girl") public String findGirlFriend(){ Girl 幻想的女朋友 = new Girl(); 幻想的女朋友.setAge(18); 幻想的女朋友.setName("女神"); 幻想的女朋友.setCupSize("G"); return girlService.saveGirl(幻想的女朋友); } }
7ae218804ba7fd5b7fc97ba1b38c17f510c2c9be
44ef3efb85ec6c63b398477ebe54a0dbaff29c43
/application/CIMS/src/entity/Comment.java
957129575e91f11d33940d1688e0139f90b169b7
[]
no_license
yinsunbo/cims
d7fd3905ecef5d8af99883f6c3619b0c0ae9ce7f
72aa662e1fb6536838a70053827740844ca19c5f
refs/heads/master
2020-06-19T18:06:58.849590
2019-08-15T06:14:41
2019-08-15T06:14:41
196,814,676
0
0
null
null
null
null
UTF-8
Java
false
false
1,876
java
package entity; public class Comment { private Integer comment_id; private String comment_title; private String comment_content; private String comment_time; private Integer customer_id; private Integer movie_id; private String customer_name; public Integer getComment_id() { return comment_id; } public void setComment_id(Integer comment_id) { this.comment_id = comment_id; } public String getComment_title() { return comment_title; } public void setComment_title(String comment_title) { this.comment_title = comment_title; } public String getComment_content() { return comment_content; } public void setComment_content(String comment_content) { this.comment_content = comment_content; } public String getComment_time() { return comment_time; } public void setComment_time(String comment_time) { this.comment_time = comment_time; } public Integer getCustomer_id() { return customer_id; } public void setCustomer_id(Integer customer_id) { this.customer_id = customer_id; } public Integer getMovie_id() { return movie_id; } public void setMovie_id(Integer movie_id) { this.movie_id = movie_id; } @Override public String toString() { return "Comment [comment_id=" + comment_id + ", comment_title=" + comment_title + ", comment_content=" + comment_content + ", comment_time=" + comment_time + ", customer_id=" + customer_id + ", movie_id=" + movie_id + ", customer_name=" + customer_name + "]"; } public String getCustomer_name() { return customer_name; } public void setCustomer_name(String customer_name) { this.customer_name = customer_name; } }
50d6428304c820f93e17a2ce19405d81272bc46e
63330b7c9232b828a91dee24044353c082e83658
/Java_009/src/com/callor/start/Multiple_00.java
1aa96d38a9dfa3036373897cb95224101095ba8a
[]
no_license
ksoyoun02/Biz_2021_01_403_java
0dbc110eaff86b25b1a0d4e4ad3b9a4b22ea8a68
d37e9511d943bec308f77fab81c9ac876307fd8a
refs/heads/master
2023-06-07T17:16:34.789399
2021-06-27T07:40:49
2021-06-27T07:40:49
334,835,412
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
package com.callor.start; public class Multiple_00 { public static void main(String[] args) { int intsum = 0; for(int i = 0; i < 100 ; i++) { int num = i + 1; boolean bYes = num % 3 == 0; boolean bYes1 = num % 9 == 0; if (bYes && bYes1) { System.out.println(num + "는 3의 배수이면서, 9의 배수"); intsum += num; } } System.out.println(intsum + "는 3의 배수이면서, 9의 배수인 수 들의 합"); } }
9bc655bf68d7948871f1fb68e89ebc4f8d449be3
9a7627cc54af82340a2a6dcf994218379b057cef
/slipp/src/test/java/slipp/DispatcherServletTest.java
6f8e2849400e99bea667a24f532f030af03d25e3
[]
no_license
kmdngyu/di-practice
f8009a6c4ac9ff12e03ae2428e1cb7d24ac7d348
55a165da97b19a980ef53a5f26098a3ee85f09aa
refs/heads/master
2020-09-02T22:59:41.164946
2019-11-03T18:56:02
2019-11-03T18:56:02
219,326,349
1
0
null
null
null
null
UTF-8
Java
false
false
3,348
java
package slipp; import nextstep.jdbc.ConnectionManager; import nextstep.mvc.DispatcherServlet; import nextstep.mvc.asis.ControllerHandlerAdapter; import nextstep.mvc.tobe.AnnotationHandlerMapping; import nextstep.mvc.tobe.HandlerExecutionHandlerAdapter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils; import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import slipp.controller.UserSessionUtils; import slipp.domain.User; import static org.assertj.core.api.Assertions.assertThat; class DispatcherServletTest { private DispatcherServlet dispatcher; private MockHttpServletRequest request; private MockHttpServletResponse response; @BeforeEach void setUp() throws Exception { ResourceDatabasePopulator populator = new ResourceDatabasePopulator(); populator.addScript(new ClassPathResource("jwp.sql")); DatabasePopulatorUtils.execute(populator, ConnectionManager.getDataSource()); dispatcher = new DispatcherServlet(); dispatcher.addHandlerMpping(new AnnotationHandlerMapping("slipp.controller")); dispatcher.addHandlerAdapter(new HandlerExecutionHandlerAdapter()); dispatcher.addHandlerAdapter(new ControllerHandlerAdapter()); dispatcher.init(); request = new MockHttpServletRequest(); response = new MockHttpServletResponse(); } @Test void annotation_user_list() throws Exception { request.setRequestURI("/users"); request.setMethod("GET"); dispatcher.service(request, response); assertThat(response.getRedirectedUrl()).isNotNull(); } @Test void annotation_user_create() throws Exception { User user = new User("pobi", "password", "포비", "[email protected]"); createUser(user); assertThat(response.getRedirectedUrl()).isEqualTo("/"); } private void createUser(User user) throws Exception { request.setRequestURI("/users/create"); request.setMethod("POST"); request.setParameter("userId", user.getUserId()); request.setParameter("password", user.getPassword()); request.setParameter("name", user.getName()); request.setParameter("email", user.getEmail()); dispatcher.service(request, response); } @Test void legacy_login_success() throws Exception { User user = new User("pobi", "password", "포비", "[email protected]"); createUser(user); MockHttpServletRequest secondRequest = new MockHttpServletRequest(); secondRequest.setRequestURI("/users/login"); secondRequest.setMethod("POST"); secondRequest.setParameter("userId", user.getUserId()); secondRequest.setParameter("password", user.getPassword()); MockHttpServletResponse secondResponse = new MockHttpServletResponse(); dispatcher.service(secondRequest, secondResponse); assertThat(secondResponse.getRedirectedUrl()).isEqualTo("/"); assertThat(UserSessionUtils.getUserFromSession(secondRequest.getSession())).isNotNull(); } }
ca1f3721da37370fef292282b7f8189a75b960b2
112de83b24eecfde2d6db441cc02fd8136058b92
/project1/src/main/java/com/app/server/repository/appbasicsetup/usermanagement/PasswordAlgoRepositoryImpl.java
a03fec9d0b1479393b22e3fb1d32925d151ed83c
[]
no_license
applifireAlgo/projecttest
759fff04be4ec26588d38c7dfc719eb5d59613d2
38c51c344f492aacc8ea380f3bc901ae12da3a87
refs/heads/master
2021-01-20T18:58:42.878440
2016-06-13T06:18:43
2016-06-13T06:18:43
60,839,059
0
0
null
null
null
null
UTF-8
Java
false
false
9,507
java
package com.app.server.repository.appbasicsetup.usermanagement; import com.app.server.repository.core.SearchInterfaceImpl; import com.app.shared.appbasicsetup.usermanagement.PasswordAlgo; import org.springframework.stereotype.Repository; import com.app.config.annotation.Complexity; import com.app.config.annotation.SourceCodeAuthorClass; import com.athena.server.pluggable.utils.helper.ResourceFactoryManagerHelper; import org.springframework.beans.factory.annotation.Autowired; import com.spartan.pluggable.logger.alarms.AppAlarm; import com.spartan.pluggable.logger.api.LogManagerFactory; import com.athena.server.pluggable.utils.AppLoggerConstant; import com.spartan.pluggable.logger.api.LogManager; import com.athena.server.pluggable.utils.helper.RuntimeLogInfoHelper; import com.spartan.server.password.interfaces.PasswordAlgoInterface; import java.lang.Override; import java.util.List; import org.springframework.transaction.annotation.Transactional; import java.util.Map; @Repository @SourceCodeAuthorClass(createdBy = "[email protected]", updatedBy = "[email protected]", versionNumber = "2", comments = "Repository for PasswordAlgo Master table Entity", complexity = Complexity.LOW) public class PasswordAlgoRepositoryImpl extends SearchInterfaceImpl implements PasswordAlgoRepository<PasswordAlgo> { @Autowired private ResourceFactoryManagerHelper emfResource; private LogManager Log = LogManagerFactory.getInstance(AppLoggerConstant.LOGGER_ID); @Autowired private RuntimeLogInfoHelper runtimeLogInfoHelper; @Override @Transactional public List<PasswordAlgoInterface> findAll() throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); java.util.List<com.spartan.server.password.interfaces.PasswordAlgoInterface> query = emanager.createQuery("select u from PasswordAlgo u where u.systemInfo.activeStatus=1").getResultList(); Log.out.println("ABSUM324990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "findAll", "Total Records Fetched = " + query.size()); return query; } @Override @Transactional public PasswordAlgo save(PasswordAlgo entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); emanager.persist(entity); Log.out.println("ABSUM321990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "save", entity); return entity; } @Override @Transactional public List<PasswordAlgo> save(List<PasswordAlgo> entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); for (int i = 0; i < entity.size(); i++) { com.app.shared.appbasicsetup.usermanagement.PasswordAlgo obj = entity.get(i); emanager.persist(obj); } Log.out.println("ABSUM321990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "saveAll", "Total Records saved = " + entity.size()); return entity; } @Transactional @Override public void delete(String id) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); com.app.shared.appbasicsetup.usermanagement.PasswordAlgo s = emanager.find(com.app.shared.appbasicsetup.usermanagement.PasswordAlgo.class, id); emanager.remove(s); Log.out.println("ABSUM328990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "delete", "Record Deleted"); } @Override @Transactional public void update(PasswordAlgo entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); emanager.merge(entity); Log.out.println("ABSUM322990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "update", entity); } @Override @Transactional public void update(List<PasswordAlgo> entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); for (int i = 0; i < entity.size(); i++) { com.app.shared.appbasicsetup.usermanagement.PasswordAlgo obj = entity.get(i); emanager.merge(obj); } Log.out.println("ABSUM322990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "updateAll", "Total Records updated = " + entity.size()); } @Transactional public List<Object> search(String finderName, Map<String, Object> fields, Map<String, String> fieldMetaData) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); javax.persistence.Query query = emanager.createNamedQuery(finderName); java.util.Map<String, Object> map = new java.util.HashMap<String, Object>(); Map<String, String> metaData = new java.util.HashMap<String, String>(); metaData = fieldMetaData; String inputStr = "01-01-1850 00:00:00 UTC"; java.util.Date date = setFormattedDate(inputStr); java.sql.Timestamp timestamp = new java.sql.Timestamp(date.getTime()); for (Map.Entry<String, String> entry : metaData.entrySet()) { boolean matched = false; for (Map.Entry<String, Object> entry1 : fields.entrySet()) { if (entry.getKey() == entry1.getKey()) { if (entry.getValue().equalsIgnoreCase("integer") || entry.getValue().equalsIgnoreCase("double") || entry.getValue().equalsIgnoreCase("float") || entry.getValue().equalsIgnoreCase("long")) { map.put("min" + entry1.getKey(), entry1.getValue()); map.put("max" + entry1.getKey(), entry1.getValue()); } else if (entry.getValue().equalsIgnoreCase("String")) { map.put(entry1.getKey(), "%" + entry1.getValue() + "%"); } else if (entry.getValue().equalsIgnoreCase("Date") || entry.getValue().equalsIgnoreCase("DateTime")) { java.util.Date dateValue = setFormattedDate(entry1.getValue().toString()); map.put(entry1.getKey(), dateValue); } else if (entry.getValue().equalsIgnoreCase("TimeStamp")) { java.util.Date dateValue = setFormattedDate(entry1.getValue().toString()); map.put(entry1.getKey(), new java.sql.Timestamp(dateValue.getTime())); } else { map.put(entry1.getKey(), entry1.getValue()); } matched = true; break; } } if (!matched) { if (entry.getValue().equalsIgnoreCase("String")) { map.put(entry.getKey(), "%"); } else if (entry.getValue().equalsIgnoreCase("integer")) { map.put("min" + entry.getKey(), Integer.MIN_VALUE); map.put("max" + entry.getKey(), Integer.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("double")) { map.put("min" + entry.getKey(), java.lang.Double.MIN_VALUE); map.put("max" + entry.getKey(), java.lang.Double.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("long")) { map.put("min" + entry.getKey(), java.lang.Long.MIN_VALUE); map.put("max" + entry.getKey(), java.lang.Long.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("float")) { map.put("min" + entry.getKey(), java.lang.Float.MIN_VALUE); map.put("max" + entry.getKey(), java.lang.Float.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("Date") || entry.getValue().equalsIgnoreCase("DATETIME")) { map.put(entry.getKey(), date); } else if (entry.getValue().equalsIgnoreCase("TINYINT")) { map.put(entry.getKey(), 1); } else if (entry.getValue().equalsIgnoreCase("timestamp")) { map.put(entry.getKey(), timestamp); } else if (entry.getValue().equalsIgnoreCase("integer_userAccesCode")) { map.put(entry.getKey(), runtimeLogInfoHelper.getUserAccessCode()); } } } for (Map.Entry<String, Object> entry : map.entrySet()) { query.setParameter(entry.getKey(), entry.getValue()); } java.util.List<Object> list = query.getResultList(); Log.out.println("ABSUM324990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "search", "Total Records Fetched = " + list.size()); return list; } @Transactional public PasswordAlgo findById(String algoId) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); javax.persistence.Query query = emanager.createNamedQuery("PasswordAlgo.findById"); query.setParameter("algoId", algoId); com.app.shared.appbasicsetup.usermanagement.PasswordAlgo listOfPasswordAlgo = (com.app.shared.appbasicsetup.usermanagement.PasswordAlgo) query.getSingleResult(); Log.out.println("ABSUM324990200", runtimeLogInfoHelper.getRequestHeaderBean(), "PasswordAlgoRepositoryImpl", "findById", "Total Records Fetched = " + listOfPasswordAlgo); return listOfPasswordAlgo; } }
[ "applifire@9dadbf43d66a" ]
applifire@9dadbf43d66a
920279a6e7b567fbd6b8a07172cedc3b4c0cdda7
3e1b8c773a22e3b92002abff9def1010d1fbc487
/JavaRushTasks/2.JavaCore/src/com/javarush/task/task13/task1301/Solution.java
874f0c280bdd904032940c998dc46bf8709f5e72
[]
no_license
NadezhdaAMI/JavaRush
8d18174dea5d8482a994ace07c57b1d0f7716ab8
c3c252fc897c5cb68c008ac9f1ec97117ed2293d
refs/heads/master
2021-09-11T19:36:03.947387
2018-04-11T15:29:07
2018-04-11T15:29:07
109,798,109
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.javarush.task.task13.task1301; /* Пиво */ public class Solution { public static void main(String[] args) throws Exception { } public interface Drink { void askMore(String message); void sayThankYou(); boolean isReadyToGoHome(); } public interface Alcohol extends Drink { boolean READY_TO_GO_HOME = false; void sleepOnTheFloor(); } public static abstract class Beer implements Alcohol { boolean READY_TO_GO_HOME = false; public void sleepOnTheFloor(){}; public void askMore(String message){}; public void sayThankYou(){}; public boolean isReadyToGoHome(){ return READY_TO_GO_HOME; }; } }
f9ea4634f10850bca648efc57acc79a9eb3788b5
041fb2a9663dafa71d43bffbee0d1b3ef617622b
/src/main/java/ooadrecap/CheckingCommand.java
0a020c9085a451c8bde6a4faedf5892cb939a6f1
[]
no_license
dmitrymalov/java-application-development
5b16daff36883fca22c1307ae74bd4221fdf09f2
ce843b59636448ed0aa8f341fb9f410e8124a268
refs/heads/master
2021-03-07T02:18:26.258546
2020-05-25T15:06:56
2020-05-25T15:06:56
246,239,697
0
0
null
2020-05-25T15:06:58
2020-03-10T07:54:37
Java
UTF-8
Java
false
false
323
java
package ooadrecap; public abstract class CheckingCommand implements Command { @Override public Command accumulate(Command with) { if (with == null) throw new IllegalArgumentException("NNNUUUUULL!!"); return doAccumulate(); } protected Command doAccumulate() { return null; } }
3a4e17f88c027c08ff7663a1d61a272b8cd6974a
1daba0fd176cd2c40067f2332a3e6277dd5c5873
/src/com/leetcode/ContainsDuplicate.java
798cd5e57809de5443be084e7217ffa90ff46d8f
[]
no_license
nandkunal/leetcode
5ab67725882e6fb049219a251e413978a63bbd7d
26abb0920aba42d83f6684de3842967d1f5c20d9
refs/heads/master
2021-01-10T06:59:39.289598
2017-08-20T03:07:36
2017-08-20T03:07:36
43,912,760
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
package com.leetcode; import java.util.HashSet; import java.util.Set; public class ContainsDuplicate { public boolean containsDuplicate(int[] nums) { Set<Integer> set = new HashSet<Integer>(); for(int n:nums){ if(set.contains(n)){ return true; }else{ set.add(n); } } return false; } public static void main(String[] args) { System.out.println(new ContainsDuplicate().containsDuplicate(new int[]{9,16,1,4})); } }
d897e734f58a1689047f4dec3fac4239a4872fd6
efade908a220b783e0d4aa9445b2cd7cfdeda8a9
/test_questions/src/main/java/by.vorokhobko/matrices_557/package-info.java
4a33b3fb15f128f833928ece69f4023110a22c0b
[ "Apache-2.0" ]
permissive
EvgenyVorohobko/GP_Solutions
7e7f1a25fe951a29679736795e1f857ccb95f272
e316538023038a14ca62688746a9e69fb963fb08
refs/heads/master
2021-09-06T22:16:55.512551
2018-02-12T11:07:15
2018-02-12T11:07:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
/** * //TODO add comments. * * @author Evgeny Vorokhobko ([email protected]). * @version 1. * @since 11.11.2016. */ package by.vorokhobko.matrices_557;
9ee22013aca012eb04bde28cf7bf49436704c9dd
de85906e68700af2d649adac02bae54916fcaa06
/design-mode/src/main/java/com/lin/design/decorator/ShapeDecorator.java
0de09438cdbee7f869427617ac93a278b9af512c
[]
no_license
lwbkfc/parent
65dcfc81c7c381f3e891f6b99968fcdef1df9e79
b89ce9b10677061722301f8b3ef8ffe4513d152b
refs/heads/master
2021-01-21T13:48:11.692586
2016-05-07T17:34:48
2016-05-07T17:34:48
46,555,149
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.lin.design.decorator; /** * Created by Administrator on 2016/1/14. */ public class ShapeDecorator implements Shape { protected Shape decoratedShape; public ShapeDecorator(Shape decoratedShape){ this.decoratedShape = decoratedShape; } @Override public void draw() { decoratedShape.draw(); } }
d7286049174b9e420288627b47a293d991e82946
3116947e2e102aa9f9b0847a77e9c6dd62b181f9
/src/main/java/com/example/demo/services/RequestBodyService.java
4a4b2aa285976f3a4bcd631485e3f05e5dfb68f9
[]
no_license
camward/Spring-REST
d3ada51123c33102f132dca418450aebd1bc7c7d
ae91cadc5bc9e510c62aae759619aff399dbcc7f
refs/heads/master
2022-04-15T10:03:23.941355
2020-04-12T12:47:42
2020-04-12T12:47:42
255,063,745
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package com.example.demo.services; import com.example.demo.dto.RequestBodyDTO; import com.example.demo.dto.ResponseBody; import org.springframework.stereotype.Service; @Service public class RequestBodyService { public ResponseBody bodyTest(RequestBodyDTO requestBodyDTO) { String nameWithID = requestBodyDTO.getId() + ". " + requestBodyDTO.getName(); return new ResponseBody(nameWithID); } }
b1e62ee15067f34c7dab204e114cdc824f326b94
99a9df1c89a3e0c6673634aacc9c3af8d6e71767
/src/main/java/com/wangtingzheng/smms/api/ImageApiFromRoot.java
b6dadf8cab80326e2b93cc558a57019edb04b16f
[]
no_license
WangTingZheng/smms
b238b2c9dd9c1c81b7ab2cf42e38c7f4f49c917c
ad663a97303b176c53abd34df0e4c38e377adb9f
refs/heads/master
2022-07-01T07:01:05.325001
2020-04-05T07:51:39
2020-04-05T07:51:39
250,808,317
1
0
null
null
null
null
UTF-8
Java
false
false
2,309
java
package com.wangtingzheng.smms.api; import com.alibaba.fastjson.JSONObject; import com.wangtingzheng.smms.actions.Image; import com.wangtingzheng.smms.authorization.Account; import com.wangtingzheng.smms.conf.ConfInterface; import com.wangtingzheng.smms.conf.ConfParent; import com.wangtingzheng.smms.utils.InformationConverter; import java.util.HashMap; /** * @author WangTingZheng * @date 2020-04-05 15:41 * @features define function do Image-about action from json file */ public class ImageApiFromRoot { private String JSONPath; public ImageApiFromRoot(Account account) { this.JSONPath = account.JSONPath; } /** * access smms user key value from user home and upload image * @param path the file you want to upload * @return the upload response json object */ public JSONObject uploadFromRoot(String path) { ConfParent confParent = new ConfParent(new ConfInterface() { @Override public JSONObject dealHashMap(HashMap<String, String> para, HashMap<String, String> header) { return Image.upload(header, InformationConverter.pathToHashMap(path)); } }); return confParent.getResponse(JSONPath); } /** * access smms user key value from user home and get temporary History * @return the temporary History response json object */ public JSONObject temporaryHistoryFromRoot() { ConfParent confParent = new ConfParent(new ConfInterface() { @Override public JSONObject dealHashMap(HashMap<String, String> para, HashMap<String, String> header) { return Image.temporaryHistory(header); } }); return confParent.getResponse(JSONPath); } /** * access smms user key value from user home and get upload History * @return the tupload History response json object */ public JSONObject uploadHistoryFromRoot() { ConfParent confParent = new ConfParent(new ConfInterface() { @Override public JSONObject dealHashMap(HashMap<String, String> para, HashMap<String, String> header) { return Image.uploadHistory(header); } }); return confParent.getResponse(JSONPath); } }
817dc0bd05f8893c390d08f869dfb775a88a9375
ff88764592cbd5b06f01cf9c6049d13773af196f
/java-oldexample/src/concurrency/InfinityLoop2.java
b70f986b02dfdd207dbe5858596dda57b2e6b882
[]
no_license
puresprout/code-example
6b0b3ae9c7c486cd1c4fdcd5c74e01c75b36b703
5b4e75b7e241fdc8cdb7976603e42e146ba52e77
refs/heads/master
2021-01-22T19:54:55.584907
2017-04-11T13:58:13
2017-04-11T13:58:13
85,261,698
0
0
null
null
null
null
UTF-8
Java
false
false
950
java
package concurrency; public class InfinityLoop2 extends Thread { private static long[] values; // 값 목록 private static long value; // 복수개 쓰레드가 공유하는 변수 private final long threadValue; // 쓰레드를 위한 고정 값 public InfinityLoop2(long value) { threadValue = value; } public void run() { System.out.println(threadValue + " is started."); while (true) { value = threadValue; check(value); } } public void check(long v) { for (int i = 0; i < values.length; i++) { if (v == values[i]) { //System.out.println("same."); return; } } System.out.println("not same. " + v); System.exit(-1); } public static void main(String[] args) throws InterruptedException { long firstValue = 1000000000000000001L; // 100갱 1원 long secondValue = 0L; // 0원 values = new long[] {firstValue, secondValue}; for (long v : values) { new InfinityLoop2(v).start(); } } }
d70c6d8810ade72286f5756641cee95e0959eb5e
b156742ce2874978376e31b4a24749fa4bac970b
/NewServlet/src/com/login/LoginUser.java
00efd64ac9a826774ae25aae1e74be452256bf96
[]
no_license
gauravshukla0810/freshersbatch-oct16
c68591d47ca57ebf509867d56c2818c1d69564ab
e0eb383e849d37c861c93442b3020291b2fffffa
refs/heads/master
2023-05-02T22:32:46.582757
2016-11-11T05:34:21
2016-11-11T05:34:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,499
java
package com.login; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/LoginUser") public class LoginUser extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void init() throws ServletException { String driverclass = getInitParameter("driverclass"); String name = getServletContext().getInitParameter("name"); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String username=request.getParameter("uname"); String paswd=request.getParameter("pswd"); String driver=getServletConfig().getInitParameter("driverclass"); System.out.println("in servlet"); if(username.equals(paswd)){ System.out.println("in if"); PrintWriter pw=response.getWriter(); pw.println("<html><body><h1>WELCOME "+username+" "+driver+"</h1></body></html>"); } else{ PrintWriter pw=response.getWriter(); pw.println("<html><body><h1>Wrong username and password</h1></body></html>"); } } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
6874006f0c1519642f284a74c102dc20862507c7
f2e744082c66f270d606bfc19d25ecb2510e337c
/sources/com/android/settingslib/notification/EnableZenModeDialog.java
1f51ea49f18d9a8cc196b2279b06297532899adb
[]
no_license
AshutoshSundresh/OnePlusSettings-Java
365c49e178612048451d78ec11474065d44280fa
8015f4badc24494c3931ea99fb834bc2b264919f
refs/heads/master
2023-01-22T12:57:16.272894
2020-11-21T16:30:18
2020-11-21T16:30:18
314,854,903
4
2
null
null
null
null
UTF-8
Java
false
false
21,687
java
package com.android.settingslib.notification; import android.app.ActivityManager; import android.app.AlarmManager; import android.app.AlertDialog; import android.app.Dialog; import android.app.NotificationManager; import android.content.Context; import android.content.DialogInterface; import android.net.Uri; import android.service.notification.Condition; import android.service.notification.ZenModeConfig; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.Log; import android.util.Slog; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.ScrollView; import android.widget.TextView; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.MetricsLogger; import com.android.internal.policy.PhoneWindow; import com.android.settingslib.R$id; import com.android.settingslib.R$layout; import com.android.settingslib.R$string; import java.util.Arrays; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Locale; import java.util.Objects; public class EnableZenModeDialog { @VisibleForTesting protected static final int COUNTDOWN_ALARM_CONDITION_INDEX = 2; @VisibleForTesting protected static final int COUNTDOWN_CONDITION_INDEX = 1; private static final boolean DEBUG = Log.isLoggable("EnableZenModeDialog", 3); private static final int DEFAULT_BUCKET_INDEX; @VisibleForTesting protected static final int FOREVER_CONDITION_INDEX = 0; private static final int MAX_BUCKET_MINUTES; private static final int[] MINUTE_BUCKETS; private static final int MIN_BUCKET_MINUTES; private int MAX_MANUAL_DND_OPTIONS = 3; private AlarmManager mAlarmManager; private boolean mAttached; private int mBucketIndex = -1; @VisibleForTesting protected Context mContext; @VisibleForTesting protected Uri mForeverId; @VisibleForTesting protected LayoutInflater mLayoutInflater; @VisibleForTesting protected NotificationManager mNotificationManager; private int mUserId; @VisibleForTesting protected TextView mZenAlarmWarning; private RadioGroup mZenRadioGroup; @VisibleForTesting protected LinearLayout mZenRadioGroupContent; static { int[] iArr = ZenModeConfig.MINUTE_BUCKETS; MINUTE_BUCKETS = iArr; MIN_BUCKET_MINUTES = iArr[0]; MAX_BUCKET_MINUTES = iArr[iArr.length - 1]; DEFAULT_BUCKET_INDEX = Arrays.binarySearch(iArr, 60); } public EnableZenModeDialog(Context context) { this.mContext = context; } public Dialog createDialog() { this.mNotificationManager = (NotificationManager) this.mContext.getSystemService("notification"); this.mForeverId = Condition.newId(this.mContext).appendPath("forever").build(); this.mAlarmManager = (AlarmManager) this.mContext.getSystemService("alarm"); this.mUserId = this.mContext.getUserId(); this.mAttached = false; AlertDialog.Builder positiveButton = new AlertDialog.Builder(this.mContext).setTitle(R$string.zen_mode_settings_turn_on_dialog_title).setNegativeButton(R$string.cancel, (DialogInterface.OnClickListener) null).setPositiveButton(R$string.zen_mode_enable_dialog_turn_on, new DialogInterface.OnClickListener() { /* class com.android.settingslib.notification.EnableZenModeDialog.AnonymousClass1 */ public void onClick(DialogInterface dialogInterface, int i) { ConditionTag conditionTagAt = EnableZenModeDialog.this.getConditionTagAt(EnableZenModeDialog.this.mZenRadioGroup.getCheckedRadioButtonId()); if (EnableZenModeDialog.this.isForever(conditionTagAt.condition)) { MetricsLogger.action(EnableZenModeDialog.this.mContext, 1259); } else if (EnableZenModeDialog.this.isAlarm(conditionTagAt.condition)) { MetricsLogger.action(EnableZenModeDialog.this.mContext, 1261); } else if (EnableZenModeDialog.this.isCountdown(conditionTagAt.condition)) { MetricsLogger.action(EnableZenModeDialog.this.mContext, 1260); } else { Slog.d("EnableZenModeDialog", "Invalid manual condition: " + conditionTagAt.condition); } EnableZenModeDialog enableZenModeDialog = EnableZenModeDialog.this; enableZenModeDialog.mNotificationManager.setZenMode(1, enableZenModeDialog.getRealConditionId(conditionTagAt.condition), "EnableZenModeDialog"); } }); View contentView = getContentView(); bindConditions(forever()); positiveButton.setView(contentView); return positiveButton.create(); } private void hideAllConditions() { int childCount = this.mZenRadioGroupContent.getChildCount(); for (int i = 0; i < childCount; i++) { this.mZenRadioGroupContent.getChildAt(i).setVisibility(8); } this.mZenAlarmWarning.setVisibility(8); } /* access modifiers changed from: protected */ public View getContentView() { if (this.mLayoutInflater == null) { this.mLayoutInflater = new PhoneWindow(this.mContext).getLayoutInflater(); } View inflate = this.mLayoutInflater.inflate(R$layout.zen_mode_turn_on_dialog_container, (ViewGroup) null); ScrollView scrollView = (ScrollView) inflate.findViewById(R$id.container); this.mZenRadioGroup = (RadioGroup) scrollView.findViewById(R$id.zen_radio_buttons); this.mZenRadioGroupContent = (LinearLayout) scrollView.findViewById(R$id.zen_radio_buttons_content); this.mZenAlarmWarning = (TextView) scrollView.findViewById(R$id.zen_alarm_warning); for (int i = 0; i < this.MAX_MANUAL_DND_OPTIONS; i++) { View inflate2 = this.mLayoutInflater.inflate(R$layout.zen_mode_radio_button, (ViewGroup) this.mZenRadioGroup, false); this.mZenRadioGroup.addView(inflate2); inflate2.setId(i); View inflate3 = this.mLayoutInflater.inflate(R$layout.zen_mode_condition, (ViewGroup) this.mZenRadioGroupContent, false); inflate3.setId(this.MAX_MANUAL_DND_OPTIONS + i); this.mZenRadioGroupContent.addView(inflate3); } hideAllConditions(); return inflate; } /* access modifiers changed from: protected */ @VisibleForTesting public void bind(Condition condition, View view, int i) { final ConditionTag conditionTag; if (condition != null) { boolean z = true; boolean z2 = condition.state == 1; if (view.getTag() != null) { conditionTag = (ConditionTag) view.getTag(); } else { conditionTag = new ConditionTag(); } view.setTag(conditionTag); if (conditionTag.rb != null) { z = false; } if (conditionTag.rb == null) { conditionTag.rb = (RadioButton) this.mZenRadioGroup.getChildAt(i); } conditionTag.condition = condition; final Uri conditionId = getConditionId(condition); if (DEBUG) { Log.d("EnableZenModeDialog", "bind i=" + this.mZenRadioGroupContent.indexOfChild(view) + " first=" + z + " condition=" + conditionId); } conditionTag.rb.setEnabled(z2); conditionTag.rb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { /* class com.android.settingslib.notification.EnableZenModeDialog.AnonymousClass2 */ public void onCheckedChanged(CompoundButton compoundButton, boolean z) { if (z) { conditionTag.rb.setChecked(true); if (EnableZenModeDialog.DEBUG) { Log.d("EnableZenModeDialog", "onCheckedChanged " + conditionId); } MetricsLogger.action(EnableZenModeDialog.this.mContext, 164); EnableZenModeDialog.this.updateAlarmWarningText(conditionTag.condition); } } }); updateUi(conditionTag, view, condition, z2, i, conditionId); view.setVisibility(0); return; } throw new IllegalArgumentException("condition must not be null"); } /* access modifiers changed from: protected */ @VisibleForTesting public ConditionTag getConditionTagAt(int i) { return (ConditionTag) this.mZenRadioGroupContent.getChildAt(i).getTag(); } /* access modifiers changed from: protected */ @VisibleForTesting public void bindConditions(Condition condition) { bind(forever(), this.mZenRadioGroupContent.getChildAt(0), 0); if (condition == null) { bindGenericCountdown(); bindNextAlarm(getTimeUntilNextAlarmCondition()); } else if (isForever(condition)) { getConditionTagAt(0).rb.setChecked(true); bindGenericCountdown(); bindNextAlarm(getTimeUntilNextAlarmCondition()); } else if (isAlarm(condition)) { bindGenericCountdown(); bindNextAlarm(condition); getConditionTagAt(2).rb.setChecked(true); } else if (isCountdown(condition)) { bindNextAlarm(getTimeUntilNextAlarmCondition()); bind(condition, this.mZenRadioGroupContent.getChildAt(1), 1); getConditionTagAt(1).rb.setChecked(true); } else { Slog.d("EnableZenModeDialog", "Invalid manual condition: " + condition); } } public static Uri getConditionId(Condition condition) { if (condition != null) { return condition.id; } return null; } public Condition forever() { return new Condition(Condition.newId(this.mContext).appendPath("forever").build(), foreverSummary(this.mContext), "", "", 0, 1, 0); } public long getNextAlarm() { AlarmManager.AlarmClockInfo nextAlarmClock = this.mAlarmManager.getNextAlarmClock(this.mUserId); if (nextAlarmClock != null) { return nextAlarmClock.getTriggerTime(); } return 0; } /* access modifiers changed from: protected */ @VisibleForTesting public boolean isAlarm(Condition condition) { return condition != null && ZenModeConfig.isValidCountdownToAlarmConditionId(condition.id); } /* access modifiers changed from: protected */ @VisibleForTesting public boolean isCountdown(Condition condition) { return condition != null && ZenModeConfig.isValidCountdownConditionId(condition.id); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private boolean isForever(Condition condition) { return condition != null && this.mForeverId.equals(condition.id); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private Uri getRealConditionId(Condition condition) { if (isForever(condition)) { return null; } return getConditionId(condition); } private String foreverSummary(Context context) { return context.getString(17041530); } private static void setToMidnight(Calendar calendar) { calendar.set(11, 0); calendar.set(12, 0); calendar.set(13, 0); calendar.set(14, 0); } /* access modifiers changed from: protected */ @VisibleForTesting public Condition getTimeUntilNextAlarmCondition() { GregorianCalendar gregorianCalendar = new GregorianCalendar(); setToMidnight(gregorianCalendar); gregorianCalendar.add(5, 6); long nextAlarm = getNextAlarm(); if (nextAlarm <= 0) { return null; } GregorianCalendar gregorianCalendar2 = new GregorianCalendar(); gregorianCalendar2.setTimeInMillis(nextAlarm); setToMidnight(gregorianCalendar2); if (gregorianCalendar.compareTo((Calendar) gregorianCalendar2) >= 0) { return ZenModeConfig.toNextAlarmCondition(this.mContext, nextAlarm, ActivityManager.getCurrentUser()); } return null; } /* access modifiers changed from: protected */ @VisibleForTesting public void bindGenericCountdown() { int i = DEFAULT_BUCKET_INDEX; this.mBucketIndex = i; Condition timeCondition = ZenModeConfig.toTimeCondition(this.mContext, MINUTE_BUCKETS[i], ActivityManager.getCurrentUser()); if (!this.mAttached || getConditionTagAt(1).condition == null) { bind(timeCondition, this.mZenRadioGroupContent.getChildAt(1), 1); } } private void updateUi(final ConditionTag conditionTag, final View view, Condition condition, boolean z, final int i, Uri uri) { String str; if (conditionTag.lines == null) { conditionTag.lines = view.findViewById(16908290); } if (conditionTag.line1 == null) { conditionTag.line1 = (TextView) view.findViewById(16908308); } if (conditionTag.line2 == null) { conditionTag.line2 = (TextView) view.findViewById(16908309); } if (!TextUtils.isEmpty(condition.line1)) { str = condition.line1; } else { str = condition.summary; } String str2 = condition.line2; conditionTag.line1.setText(str); boolean z2 = false; if (TextUtils.isEmpty(str2)) { conditionTag.line2.setVisibility(8); } else { conditionTag.line2.setVisibility(0); conditionTag.line2.setText(str2); } conditionTag.lines.setEnabled(z); float f = 1.0f; conditionTag.lines.setAlpha(z ? 1.0f : 0.4f); conditionTag.lines.setOnClickListener(new View.OnClickListener(this) { /* class com.android.settingslib.notification.EnableZenModeDialog.AnonymousClass3 */ public void onClick(View view) { conditionTag.rb.setChecked(true); } }); long tryParseCountdownConditionId = ZenModeConfig.tryParseCountdownConditionId(uri); ImageView imageView = (ImageView) view.findViewById(16908313); ImageView imageView2 = (ImageView) view.findViewById(16908314); if (i != 1 || tryParseCountdownConditionId <= 0) { if (imageView != null) { ((ViewGroup) view).removeView(imageView); } if (imageView2 != null) { ((ViewGroup) view).removeView(imageView2); return; } return; } imageView.setOnClickListener(new View.OnClickListener() { /* class com.android.settingslib.notification.EnableZenModeDialog.AnonymousClass4 */ public void onClick(View view) { EnableZenModeDialog.this.onClickTimeButton(view, conditionTag, false, i); conditionTag.lines.setAccessibilityLiveRegion(1); } }); imageView2.setOnClickListener(new View.OnClickListener() { /* class com.android.settingslib.notification.EnableZenModeDialog.AnonymousClass5 */ public void onClick(View view) { EnableZenModeDialog.this.onClickTimeButton(view, conditionTag, true, i); conditionTag.lines.setAccessibilityLiveRegion(1); } }); int i2 = this.mBucketIndex; if (i2 > -1) { imageView.setEnabled(i2 > 0); if (this.mBucketIndex < MINUTE_BUCKETS.length - 1) { z2 = true; } imageView2.setEnabled(z2); } else { if (tryParseCountdownConditionId - System.currentTimeMillis() > ((long) (MIN_BUCKET_MINUTES * 60000))) { z2 = true; } imageView.setEnabled(z2); imageView2.setEnabled(!Objects.equals(condition.summary, ZenModeConfig.toTimeCondition(this.mContext, MAX_BUCKET_MINUTES, ActivityManager.getCurrentUser()).summary)); } imageView.setAlpha(imageView.isEnabled() ? 1.0f : 0.5f); if (!imageView2.isEnabled()) { f = 0.5f; } imageView2.setAlpha(f); } /* access modifiers changed from: protected */ @VisibleForTesting public void bindNextAlarm(Condition condition) { View childAt = this.mZenRadioGroupContent.getChildAt(2); ConditionTag conditionTag = (ConditionTag) childAt.getTag(); if (condition != null && (!this.mAttached || conditionTag == null || conditionTag.condition == null)) { bind(condition, childAt, 2); } ConditionTag conditionTag2 = (ConditionTag) childAt.getTag(); int i = 0; boolean z = (conditionTag2 == null || conditionTag2.condition == null) ? false : true; this.mZenRadioGroup.getChildAt(2).setVisibility(z ? 0 : 8); if (!z) { i = 8; } childAt.setVisibility(i); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void onClickTimeButton(View view, ConditionTag conditionTag, boolean z, int i) { Condition condition; int i2; int i3; long j; MetricsLogger.action(this.mContext, 163, z); int length = MINUTE_BUCKETS.length; int i4 = this.mBucketIndex; int i5 = 0; int i6 = -1; if (i4 == -1) { long tryParseCountdownConditionId = ZenModeConfig.tryParseCountdownConditionId(getConditionId(conditionTag.condition)); long currentTimeMillis = System.currentTimeMillis(); while (true) { if (i5 >= length) { condition = null; break; } i2 = z ? i5 : (length - 1) - i5; i3 = MINUTE_BUCKETS[i2]; j = currentTimeMillis + ((long) (60000 * i3)); if ((!z || j <= tryParseCountdownConditionId) && (z || j >= tryParseCountdownConditionId)) { i5++; } } this.mBucketIndex = i2; condition = ZenModeConfig.toTimeCondition(this.mContext, j, i3, ActivityManager.getCurrentUser(), false); if (condition == null) { int i7 = DEFAULT_BUCKET_INDEX; this.mBucketIndex = i7; condition = ZenModeConfig.toTimeCondition(this.mContext, MINUTE_BUCKETS[i7], ActivityManager.getCurrentUser()); } } else { int i8 = length - 1; if (z) { i6 = 1; } int max = Math.max(0, Math.min(i8, i4 + i6)); this.mBucketIndex = max; condition = ZenModeConfig.toTimeCondition(this.mContext, MINUTE_BUCKETS[max], ActivityManager.getCurrentUser()); } bind(condition, view, i); updateAlarmWarningText(conditionTag.condition); conditionTag.rb.setChecked(true); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void updateAlarmWarningText(Condition condition) { String computeAlarmWarningText = computeAlarmWarningText(condition); this.mZenAlarmWarning.setText(computeAlarmWarningText); this.mZenAlarmWarning.setVisibility(computeAlarmWarningText == null ? 8 : 0); } /* access modifiers changed from: protected */ @VisibleForTesting public String computeAlarmWarningText(Condition condition) { int i; if ((this.mNotificationManager.getNotificationPolicy().priorityCategories & 32) != 0) { return null; } long currentTimeMillis = System.currentTimeMillis(); long nextAlarm = getNextAlarm(); if (nextAlarm < currentTimeMillis) { return null; } if (condition == null || isForever(condition)) { i = R$string.zen_alarm_warning_indef; } else { long tryParseCountdownConditionId = ZenModeConfig.tryParseCountdownConditionId(condition.id); i = (tryParseCountdownConditionId <= currentTimeMillis || nextAlarm >= tryParseCountdownConditionId) ? 0 : R$string.zen_alarm_warning; } if (i == 0) { return null; } return this.mContext.getResources().getString(i, getTime(nextAlarm, currentTimeMillis)); } /* access modifiers changed from: protected */ @VisibleForTesting public String getTime(long j, long j2) { boolean z = j - j2 < 86400000; boolean is24HourFormat = DateFormat.is24HourFormat(this.mContext, ActivityManager.getCurrentUser()); return this.mContext.getResources().getString(z ? R$string.alarm_template : R$string.alarm_template_far, DateFormat.format(DateFormat.getBestDateTimePattern(Locale.getDefault(), z ? is24HourFormat ? "Hm" : "hma" : is24HourFormat ? "EEEHm" : "EEEhma"), j)); } /* access modifiers changed from: protected */ @VisibleForTesting public static class ConditionTag { public Condition condition; public TextView line1; public TextView line2; public View lines; public RadioButton rb; protected ConditionTag() { } } }
8320ccb1b62157ac596634c5af8c330dcd86c36c
f487532281c1c6a36a5c62a29744d8323584891b
/sdk/java/src/main/java/com/pulumi/azure/storage/MoverProjectArgs.java
4acd0245c0080f9673fb81a3986b34c750680f2e
[ "BSD-3-Clause", "MPL-2.0", "Apache-2.0" ]
permissive
pulumi/pulumi-azure
a8f8f21c46c802aecf1397c737662ddcc438a2db
c16962e5c4f5810efec2806b8bb49d0da960d1ea
refs/heads/master
2023-08-25T00:17:05.290397
2023-08-24T06:11:55
2023-08-24T06:11:55
103,183,737
129
57
Apache-2.0
2023-09-13T05:44:10
2017-09-11T20:19:15
Java
UTF-8
Java
false
false
4,782
java
// *** WARNING: this file was generated by pulumi-java-gen. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package com.pulumi.azure.storage; import com.pulumi.core.Output; import com.pulumi.core.annotations.Import; import java.lang.String; import java.util.Objects; import java.util.Optional; import javax.annotation.Nullable; public final class MoverProjectArgs extends com.pulumi.resources.ResourceArgs { public static final MoverProjectArgs Empty = new MoverProjectArgs(); /** * Specifies a description for this Storage Mover Project. * */ @Import(name="description") private @Nullable Output<String> description; /** * @return Specifies a description for this Storage Mover Project. * */ public Optional<Output<String>> description() { return Optional.ofNullable(this.description); } /** * Specifies the name which should be used for this Storage Mover Project. Changing this forces a new resource to be created. * */ @Import(name="name") private @Nullable Output<String> name; /** * @return Specifies the name which should be used for this Storage Mover Project. Changing this forces a new resource to be created. * */ public Optional<Output<String>> name() { return Optional.ofNullable(this.name); } /** * Specifies the ID of the storage mover for this Storage Mover Project. Changing this forces a new resource to be created. * */ @Import(name="storageMoverId", required=true) private Output<String> storageMoverId; /** * @return Specifies the ID of the storage mover for this Storage Mover Project. Changing this forces a new resource to be created. * */ public Output<String> storageMoverId() { return this.storageMoverId; } private MoverProjectArgs() {} private MoverProjectArgs(MoverProjectArgs $) { this.description = $.description; this.name = $.name; this.storageMoverId = $.storageMoverId; } public static Builder builder() { return new Builder(); } public static Builder builder(MoverProjectArgs defaults) { return new Builder(defaults); } public static final class Builder { private MoverProjectArgs $; public Builder() { $ = new MoverProjectArgs(); } public Builder(MoverProjectArgs defaults) { $ = new MoverProjectArgs(Objects.requireNonNull(defaults)); } /** * @param description Specifies a description for this Storage Mover Project. * * @return builder * */ public Builder description(@Nullable Output<String> description) { $.description = description; return this; } /** * @param description Specifies a description for this Storage Mover Project. * * @return builder * */ public Builder description(String description) { return description(Output.of(description)); } /** * @param name Specifies the name which should be used for this Storage Mover Project. Changing this forces a new resource to be created. * * @return builder * */ public Builder name(@Nullable Output<String> name) { $.name = name; return this; } /** * @param name Specifies the name which should be used for this Storage Mover Project. Changing this forces a new resource to be created. * * @return builder * */ public Builder name(String name) { return name(Output.of(name)); } /** * @param storageMoverId Specifies the ID of the storage mover for this Storage Mover Project. Changing this forces a new resource to be created. * * @return builder * */ public Builder storageMoverId(Output<String> storageMoverId) { $.storageMoverId = storageMoverId; return this; } /** * @param storageMoverId Specifies the ID of the storage mover for this Storage Mover Project. Changing this forces a new resource to be created. * * @return builder * */ public Builder storageMoverId(String storageMoverId) { return storageMoverId(Output.of(storageMoverId)); } public MoverProjectArgs build() { $.storageMoverId = Objects.requireNonNull($.storageMoverId, "expected parameter 'storageMoverId' to be non-null"); return $; } } }
9207aee102b608c3e7153d81b8036c3fadc2ebce
7d300fbca4ec9ed648dfd0fee1fc7eaa3e5d7b3c
/src/by/it/voitenkov/jd02_01/tasks/a/Runner.java
b138fb8dc2931c5f46cce1acadc0fe030b1feb29
[]
no_license
SergeiVoitenkov/JD2021-01-14
d4e3105bd22deef5c42e8343ed6049c8cb50644f
21c899cefc64ef7951b7a9d33a21f963f846a57b
refs/heads/master
2023-03-17T10:01:49.544504
2021-03-03T19:06:40
2021-03-03T19:06:40
332,151,104
0
0
null
2021-01-23T07:16:08
2021-01-23T07:16:08
null
UTF-8
Java
false
false
252
java
package by.it.voitenkov.jd02_01.tasks.a; class Runner { public static void main(String[] args) throws InterruptedException { Store store = new Store("Vitalur", 2); Thread thread = new Thread(store); thread.start(); } }
10a3f84402bd97bfd672054a8c4edef01a09b61b
6c22ca58f1ed6924771ebe156abf1e7ec12142e7
/src/GDTS/Servidor.java
bd54c8f403f0a5104ec2e53c6efe08acb158f3a7
[]
no_license
srodriguezm/InfracompCaso1
6da20da78eb7fc9cf803669bfd08ecf31857d14b
8a2cbfe550e4802421f435b20faf08ab63461d2e
refs/heads/master
2021-01-24T00:53:47.770224
2018-02-28T13:41:05
2018-02-28T13:41:05
122,784,255
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package GDTS; public class Servidor extends Thread { private Buffer buff; public Servidor(Buffer pbuffer) { // TODO Auto-generated constructor stub buff=pbuffer; } @Override public void run() { // TODO Auto-generated method stub boolean fin=buff.bufferVacio(); while(!fin) { Mensaje m=buff.cogerMensaje(); cambiarMensaje(m); cambiarMensaje(m); buff.dejarMensaje(m); notifyAll(); fin=buff.bufferVacio(); } } public static void main(String args[]) { Buffer b=new Buffer(); } public void cambiarMensaje(Mensaje m) { m.setConsulta(m.getConsulta()+1); } }
12ef8b7d517e2486e2571b5ac8f1377b6d4bd0bf
8edc4181853e2a01fed3d961d8891e8843991287
/ble-characteristic/characteristic-as/src/main/java/org/im97mori/rbt/ble/characteristic/as/AccelerationMemoryData5.java
13f4a3d5856d9f68b895bcb9bd7aa2cca9600068
[ "MIT" ]
permissive
im97mori-github/AndroidRbtUtil
a6f89f78d4c1c7686eaec52ab0ffe9d12008de77
ea811ca4860fba4fe384a2aa644138dfe7f84201
refs/heads/master
2020-06-19T02:29:46.369307
2019-11-13T07:51:24
2019-11-13T07:51:24
196,531,968
0
0
null
null
null
null
UTF-8
Java
false
false
9,914
java
package org.im97mori.rbt.ble.characteristic.as; import android.bluetooth.BluetoothGattCharacteristic; import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import org.im97mori.ble.ByteArrayCreater; import org.im97mori.ble.ByteArrayInterface; import java.nio.ByteBuffer; import java.nio.ByteOrder; import static org.im97mori.rbt.RbtConstants.CharacteristicUUID.ACCELERATION_MEMORY_DATA_CHARACTERISTIC; import static org.im97mori.rbt.RbtConstants.OutputRange.OUTPUT_RANGE_ACCELERATION_UNIT; /** * 2.3.5 Acceleration memory data [Data] (Characteristics UUID: 0x5034) 5 / 13 */ @SuppressWarnings("WeakerAccess") public class AccelerationMemoryData5 implements ByteArrayInterface, Parcelable { /** * Total transfer count data error */ public static final int DATA_ERROR_BIT = 0b10000000_00000000; /** * @see ByteArrayCreater */ public static final ByteArrayCreater<AccelerationMemoryData5> CREATOR = new ByteArrayCreater<AccelerationMemoryData5>() { /** * {@inheritDoc} */ @Override @NonNull public AccelerationMemoryData5 createFromParcel(@NonNull Parcel in) { return new AccelerationMemoryData5(in); } /** * {@inheritDoc} */ @Override @NonNull public AccelerationMemoryData5[] newArray(int size) { return new AccelerationMemoryData5[size]; } /** * {@inheritDoc} */ @Override @NonNull public AccelerationMemoryData5 createFromByteArray(@NonNull byte[] values) { BluetoothGattCharacteristic bluetoothGattCharacteristic = new BluetoothGattCharacteristic(ACCELERATION_MEMORY_DATA_CHARACTERISTIC, 0, 0); bluetoothGattCharacteristic.setValue(values); return new AccelerationMemoryData5(bluetoothGattCharacteristic); } }; /** * Total transfer count */ private final int mTotalTransferCount; /** * Acceleration (X -axis), 2-3 Byte */ private final int mAccelerationXAxis1; /** * Acceleration (Y -axis), 4-5 Byte */ private final int mAccelerationYAxis1; /** * Acceleration (Z -axis), 6-7 Byte */ private final int mAccelerationZAxis1; /** * Acceleration (X -axis), 8-9 Byte */ private final int mAccelerationXAxis2; /** * Acceleration (Y -axis), 10-11 Byte */ private final int mAccelerationYAxis2; /** * Acceleration (Z -axis), 12-13 Byte */ private final int mAccelerationZAxis2; /** * Acceleration (X -axis), 14-15 Byte */ private final int mAccelerationXAxis3; /** * Acceleration (Y -axis), 16-17 Byte */ private final int mAccelerationYAxis3; /** * Acceleration (Z -axis), 18-19 Byte */ private final int mAccelerationZAxis3; /** * Constructor from {@link BluetoothGattCharacteristic} * * @param bluetoothGattCharacteristic Characteristics UUID: 0x5034 */ public AccelerationMemoryData5(@NonNull BluetoothGattCharacteristic bluetoothGattCharacteristic) { mTotalTransferCount = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, 0); mAccelerationXAxis1 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 2); mAccelerationYAxis1 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 4); mAccelerationZAxis1 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 6); mAccelerationXAxis2 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 8); mAccelerationYAxis2 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 10); mAccelerationZAxis2 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 12); mAccelerationXAxis3 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 14); mAccelerationYAxis3 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 16); mAccelerationZAxis3 = bluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 18); } /** * Constructor from {@link Parcel} * * @param in Parcel */ private AccelerationMemoryData5(@NonNull Parcel in) { mTotalTransferCount = in.readInt(); mAccelerationXAxis1 = in.readInt(); mAccelerationYAxis1 = in.readInt(); mAccelerationZAxis1 = in.readInt(); mAccelerationXAxis2 = in.readInt(); mAccelerationYAxis2 = in.readInt(); mAccelerationZAxis2 = in.readInt(); mAccelerationXAxis3 = in.readInt(); mAccelerationYAxis3 = in.readInt(); mAccelerationZAxis3 = in.readInt(); } /** * {@inheritDoc} */ @Override public int describeContents() { return 0; } /** * {@inheritDoc} */ @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mTotalTransferCount); dest.writeInt(mAccelerationXAxis1); dest.writeInt(mAccelerationYAxis1); dest.writeInt(mAccelerationZAxis1); dest.writeInt(mAccelerationXAxis2); dest.writeInt(mAccelerationYAxis2); dest.writeInt(mAccelerationZAxis2); dest.writeInt(mAccelerationXAxis3); dest.writeInt(mAccelerationYAxis3); dest.writeInt(mAccelerationZAxis3); } /** * @return Total transfer count */ public int getTotalTransferCount() { return mTotalTransferCount; } /** * @return {@code true}:Total transfer count is data error, {@code false}:not data error */ public boolean isTotalTransferCountDataError() { return (mTotalTransferCount & DATA_ERROR_BIT) != 0; } /** * @return Acceleration (X -axis), 2-3 Byte */ public int getAccelerationXAxis1() { return mAccelerationXAxis1; } /** * @return Acceleration (X -axis), 2-3 Byte(gal) */ public double getAccelerationXAxis1Gal() { return mAccelerationXAxis1 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (Y -axis), 4-5 Byte */ public int getAccelerationYAxis1() { return mAccelerationYAxis1; } /** * @return Acceleration (Y -axis), 4-5 Byte(gal) */ public double getAccelerationYAxis1Gal() { return mAccelerationYAxis1 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (X -axis), 8-9 Byte */ public int getAccelerationZAxis1() { return mAccelerationZAxis1; } /** * @return Acceleration (Z -axis), 8-9 Byte(gal) */ public double getAccelerationZAxis1Gal() { return mAccelerationZAxis1 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (X -axis), 8-9 Byte */ public int getAccelerationXAxis2() { return mAccelerationXAxis2; } /** * @return Acceleration (X -axis), 8-9 Byte(gal) */ public double getAccelerationXAxis2Gal() { return mAccelerationXAxis2 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (Y -axis), 10-11 Byte */ public int getAccelerationYAxis2() { return mAccelerationYAxis2; } /** * @return Acceleration (Y -axis), 10-11 Byte(gal) */ public double getAccelerationYAxis2Gal() { return mAccelerationYAxis2 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (Z -axis), 12-13 Byte */ public int getAccelerationZAxis2() { return mAccelerationZAxis2; } /** * @return Acceleration (Z -axis), 12-13 Byte(gal) */ public double getAccelerationZAxis2Gal() { return mAccelerationZAxis2 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (X -axis), 14-15 Byte */ public int getAccelerationXAxis3() { return mAccelerationXAxis3; } /** * @return Acceleration (X -axis), 14-15 Byte(gal) */ public double getAccelerationXAxis3Gal() { return mAccelerationXAxis3 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (Y -axis), 16-17 Byte */ public int getAccelerationYAxis3() { return mAccelerationYAxis3; } /** * @return Acceleration (Y -axis), 16-17 Byte(gal) */ public double getAccelerationYAxis3Gal() { return mAccelerationYAxis3 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * @return Acceleration (Z -axis), 18-19 Byte */ public int getAccelerationZAxis3() { return mAccelerationZAxis3; } /** * @return Acceleration (Z -axis), 18-19 Byte(gal) */ public double getAccelerationZAxis3Gal() { return mAccelerationZAxis3 * OUTPUT_RANGE_ACCELERATION_UNIT; } /** * {@inheritDoc} */ @Override @NonNull public byte[] getBytes() { byte[] data = new byte[20]; ByteBuffer byteBuffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN); byteBuffer.putShort((short) mTotalTransferCount); byteBuffer.putShort((short) mAccelerationXAxis1); byteBuffer.putShort((short) mAccelerationYAxis1); byteBuffer.putShort((short) mAccelerationZAxis1); byteBuffer.putShort((short) mAccelerationXAxis2); byteBuffer.putShort((short) mAccelerationYAxis2); byteBuffer.putShort((short) mAccelerationZAxis2); byteBuffer.putShort((short) mAccelerationXAxis3); byteBuffer.putShort((short) mAccelerationYAxis3); byteBuffer.putShort((short) mAccelerationZAxis3); return data; } }
d74c61d8b02ed523c69b33ceaaf1a8e74ad647ca
3f8d8caed16dd3359844e54d1fadb988c98a7cd0
/src/java_io/p3非阻塞异步Nio/p2channel/Test01.java
e0b3c781a27f709a3407dfe8406dd4fe1a9104e1
[]
no_license
Justxyx/JavaSourceLearn
0613ded993394d0f6ac985566d10a84ee062f9ef
8c483b6fdae4aabc9faf5d69a46e7a6abfc3a20e
refs/heads/master
2023-08-06T20:41:41.507549
2021-10-05T14:03:42
2021-10-05T14:03:42
404,720,005
0
0
null
null
null
null
UTF-8
Java
false
false
699
java
package java_io.p3非阻塞异步Nio.p2channel; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * @author xm * @date 2021/10/5 19:41 * @description: * 向外写文件 */ public class Test01 { public static void main(String[] args) throws IOException { FileOutputStream fos = new FileOutputStream("channel.txt"); FileChannel channel = fos.getChannel(); ByteBuffer buffer = ByteBuffer.allocate(1024); buffer.put("你好啊,同学".getBytes()); buffer.flip(); channel.write(buffer); channel.close(); } }
7f5fc0dc7e7b82a58950fe4909ffbf5a98ebaa30
8e5bca1bfba3964b31ac7812171fee6b6ddc1885
/BookStore06_end/src/com/atguigu/util/JDBCUtils.java
6b6844dae10c96b36d2f113091edbf0f5dfd6ca9
[]
no_license
onestepagain/javaweb
ad63aafe22770cb003bc1b32c74270a86b8c54a1
93949f4a3ab72e38716f87f49583f5e805e45af4
refs/heads/master
2022-11-16T22:35:14.853658
2020-07-11T15:11:08
2020-07-11T15:11:08
278,881,863
0
0
null
null
null
null
UTF-8
Java
false
false
1,823
java
package com.atguigu.util; import java.sql.Connection; import java.sql.SQLException; import java.util.Properties; import javax.sql.DataSource; import com.alibaba.druid.pool.DruidDataSourceFactory; /** * 获取连接和释放连接的工具类 * @author Chunsheng Zhang * */ public class JDBCUtils { private static DataSource dataSource; /** * ThreadLocal * get() * set() * remove() */ private static ThreadLocal<Connection> threadLocal = new ThreadLocal<>(); static { try { //1、读取druip.properties文件 Properties pro = new Properties(); pro.load(JDBCUtils.class.getClassLoader().getResourceAsStream("druid.properties")); //2、连接连接池 dataSource = DruidDataSourceFactory.createDataSource(pro); } catch (Exception e) { e.printStackTrace(); } } //获取连接 public static Connection getConnection() { Connection connection = threadLocal.get(); try { if(connection == null) { connection = dataSource.getConnection(); threadLocal.set(connection); } } catch (SQLException e) { e.printStackTrace(); } return connection; } // public static Connection getConnection() { // Connection connection = null; // try { // connection = dataSource.getConnection(); // } catch (SQLException e) { // e.printStackTrace(); // } // return connection; // } //释放连接 public static void releaseConnection() { Connection connection = threadLocal.get(); if(connection != null) { try { connection.close(); threadLocal.remove(); } catch (SQLException e) { e.printStackTrace(); } } } // public static void releaseConnection(Connection connection) { // if(connection != null) { // try { // connection.close(); // } catch (SQLException e) { // e.printStackTrace(); // } // } // } }
717852006c4241feb17af96bf14d3bfc12f94a68
e7b097b5c7260cd8d33d598596545696ee06bb57
/BackEnd/jupiter/src/main/java/com/xma/jupiter/servlet/LogoutServlet.java
55ecd60df0af822b9fcfee21cdaef63a9291d6c9
[]
no_license
MathewXiren/Twitch
6e3ee2c446e205718a8c8d41451253d2ba9ee6a5
9dd814599561aac5ed49705ca8d49fc3176505cb
refs/heads/main
2023-04-15T15:56:04.047553
2021-05-02T19:19:29
2021-05-02T19:19:29
338,639,700
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
package com.xma.jupiter.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; @WebServlet(name = "LogoutServlet", urlPatterns = {"/logout"}) public class LogoutServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); if (session != null) { session.invalidate(); } } }
9cbdae29c668d9ab4a6881c6861b9849e124b3e1
27511a2f9b0abe76e3fcef6d70e66647dd15da96
/src/com/instagram/common/ui/widget/imageview/c.java
5916d70f173b248d232ce4c684f7247edbf4c1d2
[]
no_license
biaolv/com.instagram.android
7edde43d5a909ae2563cf104acfc6891f2a39ebe
3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de
refs/heads/master
2022-05-09T15:05:05.412227
2016-07-21T03:48:36
2016-07-21T03:48:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.instagram.common.ui.widget.imageview; public abstract interface c { public abstract void a(int paramInt); } /* Location: * Qualified Name: com.instagram.common.ui.widget.imageview.c * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
de5eabf0b3e9f483c9b30e0f736981b576ff5df1
df01ebb67cdcb64b63ed3b5fdd16b372e096efc7
/src/by/gstu/entities/Children.java
eaf880064f2d5616ab3145e224d0b8950211ccc3
[]
no_license
Speddecker/CAS
23930a9f3d35161b7b4f2b27d98f0aaded7e7dba
35e24f2b8b02c8bd299559613030abea1870ce0a
refs/heads/master
2020-03-31T23:28:21.986369
2019-02-02T15:28:43
2019-02-02T15:28:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,673
java
/* * Creator: Ivanov Stanislav * * Last modification 16.11.2018 * */ package by.gstu.entities; import java.time.LocalDate; /** * Class that describes chidren entity * * @Author Stanislav Ivanov */ public class Children { private int id; private String firstName; private String secondName; private String thirdName; private LocalDate dateOfBirth; private int childGroupId; /** * Constructor for full-filled class instance * @param id unique identificator * @param firstName * @param secondName * @param thirdName * @param dateOfBirth * @param childGroupId name of the child group */ public Children(int id, String firstName, String secondName, String thirdName, LocalDate dateOfBirth, int childGroupId) { this.id = id; this.firstName = firstName; this.secondName = secondName; this.thirdName = thirdName; this.dateOfBirth = dateOfBirth; this.childGroupId = childGroupId; } public Children(String firstName, String secondName, String thirdName, LocalDate dateOfBirth, int childGroupId) { this.firstName = firstName; this.secondName = secondName; this.thirdName = thirdName; this.dateOfBirth = dateOfBirth; this.childGroupId = childGroupId; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getSecondName() { return secondName; } public void setSecondName(String secondName) { this.secondName = secondName; } public String getThirdName() { return thirdName; } public void setThirdName(String thirdName) { this.thirdName = thirdName; } public LocalDate getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } public int getChildGroupId() { return childGroupId; } public void setChildGroup(int childGroupId) { this.childGroupId = childGroupId; } @Override public String toString() { return "{\"id\":" + id + "," + "\"firstName\":\"" + firstName +"\"," + "\"secondName\":\"" + secondName + "\"," + "\"thirdName\":\"" + thirdName + "\"," + "\"dateOfBirth\":\"" + dateOfBirth.toString() + "\"," + "\"childGroupId\":\""+ childGroupId + "\"}"; } }
432244878830caee377a9d092f5916eee281b7eb
271d0515682426f5241328db72038c5bb22fa5cf
/app/src/main/java/com/akb/Sitiayumelinda/myapplication/Home_Fragment.java
932e5c57592c0f596086fe96e091154fb9f8b5f3
[]
no_license
melinda20/UAS-AKB-10116130
b1a57e86d55c2abde7ac429b6761baa00df9ebca
8f6c928d3b1719d34fd9fd6e569aa98f2647876b
refs/heads/master
2020-07-04T05:37:37.828281
2019-08-13T15:56:36
2019-08-13T15:56:36
202,173,568
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package com.akb.Sitiayumelinda.myapplication; /*Tanggal Pengerjaan = 13 agustus 2019 * NIM = 10116130 * Nama = Siti Ayu Melinda * Kelas = AKB-03*/ import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class Home_Fragment extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_home, container, false); return view; } }
26eb9311b9041b69f47aa1b4f1ac9bb9279031a1
e923146de8154e8afc466db711a92417f87d79be
/src/main/java/jp/yahooapis/im/v201809/auditlog/AuditLogUpdateSource.java
07a4864c546cf164e5e743d60c425abe43d1c565
[ "MIT" ]
permissive
YutaFukuma/ydn-api-java-samples
18d2716b4c9aebc4a9deedfb48fade421c232530
c2568ff4781691710b55b3e9f48b889f36ae9623
refs/heads/master
2020-03-30T23:23:48.376544
2018-09-20T02:49:54
2018-09-20T02:49:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
846
java
package jp.yahooapis.im.v201809.auditlog; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AuditLogUpdateSource. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="AuditLogUpdateSource"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="CAMPAIGN_MANAGEMENT_TOOL"/> * &lt;enumeration value="API"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "AuditLogUpdateSource") @XmlEnum public enum AuditLogUpdateSource { CAMPAIGN_MANAGEMENT_TOOL, API; public String value() { return name(); } public static AuditLogUpdateSource fromValue(String v) { return valueOf(v); } }
3e27e352d2838d4094df70ea1c1283db5feb8b67
90ff8d24dfaa9875e4ddd799c68a590241f6be4e
/src/test/java/cn/com/taiji/security/AppTest.java
baa9bd39a02e723189d4cf18feb0a46390e6f01b
[]
no_license
zmdevelop/security
5e609cd5719cfb6ff9b1f985132a5efc65409828
f93913916a3c91dc999f4a8d5695f124dd748d64
refs/heads/master
2021-01-19T00:54:19.286897
2016-07-20T02:47:40
2016-07-20T02:47:40
63,735,059
0
0
null
null
null
null
UTF-8
Java
false
false
649
java
package cn.com.taiji.security; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
691ab670eab326380695e4223d32613b55f56449
9fb0ed23e3d4832f2dd64c9bc5fb78e2a3874c2f
/Test/31116306朱凯/测试程序/TEST5/src/state1/Disk.java
9f9bd131c27df9dd556a9e2e8880eda4602dff09
[]
no_license
berlinfog/operating-system--firedance
258f8628c4c31f7b852d886d1065b1f74781fdac
3357d0e26e60b6c0f59196c255300369c5f6b9b9
refs/heads/master
2020-04-28T08:54:06.550793
2019-03-30T14:56:07
2019-03-30T14:56:07
null
0
0
null
null
null
null
GB18030
Java
false
false
2,179
java
package state1; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; public class Disk { private int Track_Number;//磁道数 private int Sector_Number;//扇区数 private long Sector_Length;//扇区的大小 protected boolean[][] peek;//记录该扇区是否被占用 private String TrackName = new String("Track_");//路径名 private String SectorName = new String("Sector_");//路径名 public Disk(int t_number,int s_number,long s_length)//构造函数 { this.Track_Number = t_number;//磁道数 this.Sector_Number = s_number;//扇区数 this.Sector_Length = s_length;//扇区的大小 } public void Disk_Initial() throws IOException//磁盘初始化 { peek = new boolean[this.Track_Number][this.Sector_Number];//标志位 for(int i=0;i<this.Track_Number;i++)//每个磁道 { for(int j=0;j<this.Sector_Number;j++)//每个扇区 { peek[i][j] = false;//初始化,设定所有扇区都为空 } } File diskfile = new File("Disk");//仿真的磁盘文件夹 if(!diskfile.exists())//如果该文件夹不存在 { diskfile.mkdirs();//创建磁盘文件架 } File cylinderfile = new File("Disk\\Cylinder");//仿真的柱面文件夹 if(!cylinderfile.exists())//如果该文件夹不存在 { cylinderfile.mkdirs();//创建柱面文件夹 for(int i=0;i<this.Track_Number;i++)//仿真磁道 { File trackfile = new File("Disk\\Cylinder\\" + this.TrackName + Integer.toString(i));//磁道名 if(!trackfile.exists())//如果该文件夹不存在 { trackfile.mkdirs();//创建磁道文件夹 } } for(int i=0;i<this.Track_Number;i++)//仿真扇区 { for(int j=0;j<this.Sector_Number;j++)//每个扇区 { File file = new File("Disk\\Cylinder\\" + this.TrackName + Integer.toString(i) + "\\" + this.SectorName + Integer.toString(j) + ".txt");//每个扇区用一个512B的文本文件表示 RandomAccessFile r = new RandomAccessFile(file, "rw"); //创建文件 r.setLength(this.Sector_Length); //设定文件的大小为扇区的大小512B r.close();//关闭 } } } } }
8e2ddcc2b92a48975e39ca7e500400130a5f47c0
f53203fbbd8deb852bd8fa155413c465ae7378b3
/gabrielaEnache/src/main/java/collections/store/User.java
3fcfc47322850dcfd078a56deab0fafeb160bbf2
[]
no_license
iMarari/Edition_1_SOA
055b3a3943f2f437417e2d4b2edc5fb973b7293b
182e8aea0bedd5ed249212f2abf9f8e2c24ff4db
refs/heads/master
2021-05-21T18:38:48.086282
2020-04-02T13:38:51
2020-04-02T13:38:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,716
java
package collections.store; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class User { private static long idCounter = 0; private long id; private String userName; private Map<String, Address> address; public User(String userName) { this.id = idCounter++; this.userName = userName; this.address = new HashMap<>(); } public long getId() { return id; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public Map<String, Address> getAddress() { return address; } public void setAddress(Map<String, Address> address) { this.address = address; } public void addAddress(String type, Address address) { this.address.put(type, address); } public void removeAddress(String type) { this.address.remove(type); } public static List<User> filerUsersByCity(List<User> userList, String city) { List<User> result = new ArrayList<>(); for (User user : userList) if (user.isFromCity(city)) result.add(user); return result; } public boolean isFromCity(String city) { for (String key : this.getAddress().keySet()) { if (this.getAddress().get(key).getCity().equalsIgnoreCase(city)) return true; } return false; } @Override public String toString() { return "User{" + "Id=" + id + ", userName='" + userName + "'" + ", " + address.toString(); } }
d7b326bfb00d57b292dd9b2881733573c3cf0ae2
d1a9533f941ae7f38dbc5b501f61c95e689c7bf7
/src/main/java/jjjf/config/MybatisJijianJingfeiConfig.java
322956f22fa672e0b218a1a008af43c39abd9b50
[]
no_license
venusshuang/jijianjingfei
2a97190954d5fe93e0803dfe2ca9ef7dab5a84f3
bd467c137a276a5ee862c818099d55fe349cfd96
refs/heads/master
2023-04-06T00:05:33.319889
2021-04-09T08:31:11
2021-04-09T08:31:11
335,803,821
0
0
null
null
null
null
UTF-8
Java
false
false
1,824
java
/* package jjjf.config; import javax.sql.DataSource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; @Configuration @MapperScan(basePackages = "jjjf.dao",sqlSessionFactoryRef = "childckdSqlSessionFactory") public class MybatisJijianJingfeiConfig { @Primary @Bean(name = "JijianJingfeiDataSource") @ConfigurationProperties("spring.datasource.jjjf") public DataSource masterDataSource(){ return DruidDataSourceBuilder.create().build(); } @Bean(name = "JijianJingfeiSqlSessionFactory") public SqlSessionFactory sqlSessionFactory(@Qualifier("JijianJingfeiDataSource") DataSource dataSource) throws Exception { SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean(); sessionFactoryBean.setDataSource(dataSource); sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver() .getResources("classpath:jjjf/mapper/*.xml")); return sessionFactoryBean.getObject(); } @Bean public PlatformTransactionManager childckdTransactionManager(@Qualifier("JijianJingfeiDataSource")DataSource sitDataSource) { return new DataSourceTransactionManager(sitDataSource); } } */
e32661b01bb28ca25025bf8863fbf0c28e203a38
89b04fe4a941a41a3b69e64be3662ef18fd94375
/junit-servers-tomcat/src/main/java/com/github/mjeanroy/junit/servers/tomcat/junit4/TomcatServerJunit4Rule.java
044e1c24f7b6e1b55e9e87131b03f55ce6f459f5
[ "MIT" ]
permissive
mjeanroy/junit-servers
a59bbb842df6ab528d75387cc44045c8dae6c87f
f74487bf0842c50425bea26f5d222acc82048ded
refs/heads/master
2023-08-31T12:12:24.951659
2023-07-24T07:04:09
2023-08-14T16:12:53
22,883,472
33
14
MIT
2023-09-11T12:40:37
2014-08-12T15:57:41
Java
UTF-8
Java
false
false
2,946
java
/** * The MIT License (MIT) * * Copyright (c) 2014-2022 <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.github.mjeanroy.junit.servers.tomcat.junit4; import com.github.mjeanroy.junit.servers.junit4.ServerRule; import com.github.mjeanroy.junit.servers.loggers.Logger; import com.github.mjeanroy.junit.servers.loggers.LoggerFactory; import com.github.mjeanroy.junit.servers.tomcat.EmbeddedTomcatConfiguration; import com.github.mjeanroy.junit.servers.tomcat.EmbeddedTomcat; /** * Rule that can be used to start and stop embedded tomcat server. * * @deprecated Use {@code junit-servers-tomcat-8} instead. */ @Deprecated public class TomcatServerJunit4Rule extends ServerRule { private static final Logger log = LoggerFactory.getLogger(TomcatServerJunit4Rule.class); /** * Create rule. * * @param tomcat Tomcat Embedded Server. * @throws NullPointerException If {@code tomcat} is {@code null}. */ public TomcatServerJunit4Rule(EmbeddedTomcat tomcat) { super(tomcat); log.warn("{} is deprecated and will be removed in the next major release, use junit-servers-tomcat-8 instead, see https://mjeanroy.dev/junit-servers", TomcatServerJunit4Rule.class); } /** * Create rule using tomcat as embedded server. */ public TomcatServerJunit4Rule() { this(new EmbeddedTomcat()); log.warn("{} is deprecated and will be removed in the next major release, use junit-servers-tomcat-8 instead, see https://mjeanroy.dev/junit-servers", TomcatServerJunit4Rule.class); } /** * Create rule. * * @param configuration Tomcat Configuration. */ public TomcatServerJunit4Rule(EmbeddedTomcatConfiguration configuration) { this(new EmbeddedTomcat(configuration)); log.warn("{} is deprecated and will be removed in the next major release, use junit-servers-tomcat-8 instead, see https://mjeanroy.dev/junit-servers", TomcatServerJunit4Rule.class); } }
eccd45950e9b7b49cc24570f08b015ec006f59c5
b385b6e09397f7fa0b4c9a7f2ad112eb2f183539
/app/src/main/java/com/example/zhang/happybirthday/MainActivity.java
69ad34bbd4a6cc9e1bf2ee2682c9e411222aad12
[]
no_license
zhangruiyep/HappyBirthday
ae51538fc996ff1cab92e6bb8c8fdd3760e9c48b
9025e076c3864a86480042f36cfce96f21450d63
refs/heads/master
2021-08-31T16:30:06.299018
2017-12-22T02:50:36
2017-12-22T02:50:36
114,984,066
0
0
null
null
null
null
UTF-8
Java
false
false
344
java
package com.example.zhang.happybirthday; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
15dec788a287c6220d50de9de554e96b392c1442
2d0058ea1dc8d72bd24d1d77a58b3460c893389f
/src/main/java/it/rest/client/restfabrick/service/AccountServiceImpl.java
c3b74c758025ace0410e7e12facc613a3e85744e
[]
no_license
bludef/fabrick
7d8a7c8db5545a2cd98e7ef5691de99f99b7024a
25f19d23a4a32fd463116b9494556e68a5cb3db6
refs/heads/master
2020-07-25T19:18:06.364777
2019-09-14T06:45:26
2019-09-14T06:45:26
208,399,236
0
0
null
null
null
null
UTF-8
Java
false
false
3,372
java
package it.rest.client.restfabrick.service; import it.rest.common.AccountBalance; import it.rest.common.RequestSctOrder; import it.rest.common.ResponseAccountBalance; import it.rest.common.ResponseSctOrder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.*; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import java.util.Collections; @Service public class AccountServiceImpl implements AccountService { private RestTemplate restTemplate; @Autowired public AccountServiceImpl(RestTemplate restTemplate) { this.restTemplate = restTemplate; } /** * Retrieves the balance of a cash account. * @param accountId The ID of the account. * @return ResponseAccountBalance */ @Override public ResponseEntity<ResponseAccountBalance> getAccountBalanceById(String accountId) { final String url = "https://sandbox.platfr.io/api/gbs/banking/v2/accounts/"+accountId+"/balance"; //======================================================================= //============================= HEADER ================================== //======================================================================= HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.setContentType(MediaType.APPLICATION_JSON); requestHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); requestHeaders.set("Auth-Schema","S2S"); HttpEntity<AccountBalance> entity = new HttpEntity<>(requestHeaders); // Send request with GET method, and Headers. return restTemplate.exchange(url,HttpMethod.GET, entity, ResponseAccountBalance.class); } @Override public ResponseEntity<ResponseSctOrder> createSctPaymentOrder(String accountId) { final String uri = "https://sandbox.platfr.io/api/gbs/banking/v2.1/accounts/"+accountId+"/payments/sct/orders"; //======================================================================= //============================= HEADER ================================== //======================================================================= HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.setContentType(MediaType.APPLICATION_JSON); requestHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); requestHeaders.set("Auth-Schema","S2S"); //======================================================================= //================ setting up the request body ========================== //======================================================================= RequestSctOrder requestSctOrder = new RequestSctOrder(); requestSctOrder.setReceiverName("Dan Dan"); requestSctOrder.setDescription("Payment invoice 75/2017"); requestSctOrder.setAmount("900.00"); requestSctOrder.setCurrency("EUR"); requestSctOrder.setExecutionDate("13/09/2019"); requestSctOrder.setFeeType(""); HttpEntity<RequestSctOrder> entity = new HttpEntity<>(requestSctOrder,requestHeaders); // Send request with POST method, and Headers. return restTemplate.exchange(uri, HttpMethod.POST, entity, ResponseSctOrder.class); } }
64292f628b696f57ec3d9df980e4926264029f87
a3b82b2c82b82f6b5b684b84311fcc135d6ccfcf
/src/test/java/com/isen/le/jmockit/advance/InvocationMockUpTest.java
3fc5750e2761fd88e586ef14569467eff1244e07
[]
no_license
Isen18/jmockit-le
d02760cc964ba9d2366ee380707cb85e52b7d589
d96b508a0893043b98649fbe6d70734dccd92525
refs/heads/master
2020-04-17T21:40:24.251297
2019-01-23T10:02:26
2019-01-23T10:02:26
166,960,879
0
0
null
null
null
null
UTF-8
Java
false
false
1,303
java
package com.isen.le.jmockit.advance; import java.util.Calendar; import java.util.Date; import mockit.Invocation; import mockit.Mock; import mockit.MockUp; import org.junit.Assert; import org.junit.Test; /** * @author Isen * @date 2019/1/23 10:51 * @since 1.0 */ //Mock方法中还可以调用老方法 public class InvocationMockUpTest { @Test public void testMockUp() { // 对Java自带类Calendar的get方法进行定制 new MockUp<Calendar>(Calendar.class) { // 申明参数invocation,表示老方法的调用 @Mock public int get(Invocation invocation, int unit) { // 只希望时间是早上7点 if (unit == Calendar.HOUR_OF_DAY) { return 7; } // 其它时间(年份,月份,日,分,秒均不变) return invocation.proceed(unit); } }; Calendar now = Calendar.getInstance(); // 只有小时变成Mock方法 Assert.assertTrue(now.get(Calendar.HOUR_OF_DAY) == 7); // 其它的还是走老的方法 Assert.assertTrue(now.get(Calendar.MONTH) == (new Date()).getMonth()); Assert.assertTrue(now.get(Calendar.DAY_OF_MONTH) == (new Date()).getDate()); } }
c4133ac147e6ae43ac5ebbff2612e6a4957840fb
321f66e270fd63bb39d1ef9ef0ec3f3ffa07ecd7
/src/main/java/com/example/demo/filters/HttpServletRequestWritableWrapper.java
77ad8f2180bfea55c06c7f626a689f97a96f26ee
[]
no_license
misternay/example-filter-spring-boot
6c11260999e3e8e6129429e26e6e6aec23373d82
c3701fb3593c7cfab370766e084b36606fdd4276
refs/heads/master
2023-02-17T22:45:12.727126
2021-01-12T01:16:39
2021-01-12T01:16:39
328,724,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,369
java
package com.example.demo.filters; import com.example.demo.model.SecureRequest; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.io.IOUtils; import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import java.io.*; import static java.nio.charset.StandardCharsets.UTF_8; public class HttpServletRequestWritableWrapper extends HttpServletRequestWrapper { private String decodeBody = ""; public HttpServletRequestWritableWrapper(HttpServletRequest request) { super(request); try { InputStream inputStream = request.getInputStream(); byte[] rawData = IOUtils.toByteArray(inputStream); ObjectMapper mapper = new ObjectMapper(); //MAP request to Secure Request prepare to do something SecureRequest secureRequest = mapper.readValue(rawData, SecureRequest.class); System.out.println("param 1 -> " + secureRequest.getParam1()); System.out.println("param 2 -> " + secureRequest.getParam2()); // secureRequest.getParam1() do process decrypt here //Example mock data if decrpt finnish. String plainTextAfterDecrypt = "{\"mobileNo\":\"rD12Rkn3f1dOzGRFCI7MaYD6aUBK5tWb4y7+dGDnoxI=\",\"citizenNo\":\"1adada2dsa\"}"; this.decodeBody = plainTextAfterDecrypt; } catch (IOException e) { e.printStackTrace(); } } @Override public ServletInputStream getInputStream() { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(decodeBody.getBytes(UTF_8)); return new ServletInputStream() { @Override public boolean isFinished() { return false; } @Override public boolean isReady() { return false; } @Override public void setReadListener(ReadListener readListener) { } @Override public int read() { return byteArrayInputStream.read(); } }; } @Override public BufferedReader getReader() throws IOException { return new BufferedReader(new InputStreamReader(this.getInputStream())); } }
85dd4387ad01448d604a41413f63b6731915bf72
d38afb4d31e0574dd2086fc84e5d664aecc77f5c
/com/planet_ink/coffee_mud/Abilities/Diseases/Disease_Gonorrhea.java
df48aa6f5805dc9c4ac007ac4c2c1440f1c7a791
[ "Apache-2.0" ]
permissive
Dboykey/CoffeeMud
c4775fc6ec9e910ff7ff8523c04567a580a9529e
844704805d3de26a16b83bd07552d6ae82391208
refs/heads/master
2022-04-16T07:07:22.004847
2020-04-06T17:55:33
2020-04-06T17:55:33
255,074,559
0
1
Apache-2.0
2020-04-12T12:10:07
2020-04-12T12:10:06
null
UTF-8
Java
false
false
4,649
java
package com.planet_ink.coffee_mud.Abilities.Diseases; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2003-2020 Bo Zimmerman 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. */ public class Disease_Gonorrhea extends Disease { @Override public String ID() { return "Disease_Gonorrhea"; } private final static String localizedName = CMLib.lang().L("Gonorrhea"); @Override public String name() { return localizedName; } private final static String localizedStaticDisplay = CMLib.lang().L("(Gonorrhea)"); @Override public String displayText() { return localizedStaticDisplay; } @Override protected int canAffectCode() { return CAN_MOBS; } @Override protected int canTargetCode() { return CAN_MOBS; } @Override public int abstractQuality() { return Ability.QUALITY_MALICIOUS; } @Override public boolean putInCommandlist() { return false; } @Override public int difficultyLevel() { return 1; } @Override protected int DISEASE_TICKS() { return 99999; } @Override protected int DISEASE_DELAY() { return CMProps.getIntVar( CMProps.Int.TICKSPERMUDDAY ); } @Override protected String DISEASE_DONE() { return L("Your gonorrhea clears up."); } @Override protected String DISEASE_START() { return L("^G<S-NAME> squeeze(s) <S-HIS-HER> privates uncomfortably.^?"); } @Override protected String DISEASE_AFFECT() { return L("<S-NAME> squeeze(s) <S-HIS-HER> privates uncomfortably."); } @Override public int spreadBitmap() { return DiseaseAffect.SPREAD_STD; } @Override public boolean tick(final Tickable ticking, final int tickID) { if(!super.tick(ticking,tickID)) return false; if(affected==null) return false; if(!(affected instanceof MOB)) return true; final MOB mob=(MOB)affected; if((CMLib.dice().rollPercentage()==1) &&(CMLib.dice().rollPercentage()>mob.charStats().getSave(CharStats.STAT_SAVE_COLD)) &&(!mob.amDead()) &&(CMLib.dice().rollPercentage()<25-mob.charStats().getStat(CharStats.STAT_CONSTITUTION))) { MOB diseaser=invoker; if(diseaser==null) diseaser=mob; final Ability A=CMClass.getAbility("Disease_Arthritis"); A.invoke(diseaser,mob,true,0); } else if((!mob.amDead())&&((--diseaseTick)<=0)) { diseaseTick=DISEASE_DELAY(); mob.location().show(mob,null,CMMsg.MSG_NOISE,DISEASE_AFFECT()); return true; } return true; } @Override public void affectPhyStats(final Physical affected, final PhyStats affectableStats) { super.affectPhyStats(affected,affectableStats); affectableStats.setAttackAdjustment(affectableStats.attackAdjustment()-5); } @Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(affected==null) return super.okMessage(myHost,msg); if(affected instanceof MOB) { final MOB mob=(MOB)affected; if(((msg.amITarget(mob))||(msg.amISource(mob))) &&(msg.tool() instanceof Social) &&(msg.tool().Name().equals("MATE <T-NAME>") ||msg.tool().Name().equals("SEX <T-NAME>"))) { msg.source().tell(mob,null,null,L("<S-NAME> really do(es)n't feel like it.")); return false; } } return super.okMessage(myHost,msg); } }
1bff789cfc792b4bc376f36467cad79c752946e7
ee673e5e88e13877c648f9bc7d81e875412cc63b
/src/main/java/me/itchallenges/pathfinder/domain/rest/EstimateResponse.java
d4c0297b159bd9f9176b814fdfed1c4a93e3c81e
[]
no_license
aslepakurov/itchallenges-qualification-I
d8620fe7c15bdab584708afb55c62f1b2466c3c8
6ab55b7fc661f156da16c8354919038a12fa818a
refs/heads/master
2021-01-20T19:19:38.874821
2016-06-28T13:56:44
2016-06-28T13:56:44
62,145,177
0
0
null
null
null
null
UTF-8
Java
false
false
1,035
java
package me.itchallenges.pathfinder.domain.rest; import me.itchallenges.pathfinder.domain.Path; import java.util.List; /** * Date: 06/08/2016 5:44 PM */ public class EstimateResponse extends Response { private String pointA; private String pointB; private long estimate; //in minutes public EstimateResponse() { super(); } public EstimateResponse(String pointA, String pointB, long estimate, String message, boolean error) { super(message, error); this.pointA = pointA; this.pointB = pointB; this.estimate = estimate; } public String getPointA() { return pointA; } public void setPointA(String pointA) { this.pointA = pointA; } public String getPointB() { return pointB; } public void setPointB(String pointB) { this.pointB = pointB; } public long getEstimate() { return estimate; } public void setEstimate(long estimate) { this.estimate = estimate; } }
3483b7cf41b3367f7290c40412a5582d305fb66f
be6e6d88476ea3d23fb36d4c2d32ec7d613bfd6f
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201406/cm/CampaignServiceInterfacemutate.java
935f307663de767f392d7c1e5a07cf7ed014bec2
[ "Apache-2.0" ]
permissive
peter70304/googleads-java-lib
c050530e4cc4a195e36e7aff76a3185ff98b16eb
46eb2fff866c5cdac55f54502007c4583fb49978
refs/heads/master
2021-01-09T20:22:50.089955
2014-07-21T20:56:22
2014-07-21T20:56:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,696
java
package com.google.api.ads.adwords.jaxws.v201406.cm; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * Adds, updates, or deletes campaigns. * <p class="note"><b>Note:</b> {@link CampaignOperation} does not support the * <code>REMOVE</code> operator. To delete a campaign, set its * {@link Campaign#status status} to <code>DELETED</code>.</p> * @param operations A list of unique operations. * The same campaign cannot be specified in more than one operation. * @return The list of updated campaigns, returned in the same order as the * <code>operations</code> array. * @throws ApiException if problems occurred while updating campaign information. * * * <p>Java class for mutate element declaration. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;element name="mutate"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="operations" type="{https://adwords.google.com/api/adwords/cm/v201406}CampaignOperation" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "operations" }) @XmlRootElement(name = "mutate") public class CampaignServiceInterfacemutate { protected List<CampaignOperation> operations; /** * Gets the value of the operations property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the operations property. * * <p> * For example, to add a new item, do as follows: * <pre> * getOperations().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CampaignOperation } * * */ public List<CampaignOperation> getOperations() { if (operations == null) { operations = new ArrayList<CampaignOperation>(); } return this.operations; } }
2a7d2cddeafc73ee416f0704e7383dcdcf3057d0
f5411119c0ec836b1a5cf609451385a2b2a0c8bf
/src/main/java/ru/mockingrave/Main.java
222108a08b74f276b72a096e0df2b5c2ba89f023
[]
no_license
mockingrave/BattleShip
0acd6e4fb296a6c39bb8b65f4c7b2f4d339b523f
da2ca37519547cde245c8276f727ec6304832bb0
refs/heads/master
2023-01-29T22:46:32.151039
2020-12-09T15:34:19
2020-12-09T15:34:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
package ru.mockingrave; import java.util.Scanner; /** * Класс для запуска программы. */ public class Main { /** * Точка входа в программу. * * @param args массив строк. */ public static void main(String[] args) { // Размер поля. int fieldSize = 10; // Сервис для проверки правильности расстановки кораблей. FieldCheckService checkService = new FieldCheckService(input(fieldSize), fieldSize); if (checkService.validFieldChecker()) { System.out.println("YES"); } else { System.out.println("NO"); } } /** * Ввод данных * * @param n размер поля. * @return двумерный массив введенных данных. */ private static String[][] input(int n) { String[][] fieldArray = new String[n][n]; Scanner scanner = new Scanner(System.in); for (int i = 0; i < n; i++) { String string = scanner.nextLine(); for (int j = 0; j < n; j++) { fieldArray[i][j] = String.valueOf(string.charAt(j)); } } scanner.close(); return fieldArray; } }
8c507002d9f660859b03b4f2a213d83b2b843e15
b2c89738fd7cbfbb58c2c860c9757a22eac41bbf
/app/src/main/java/com/shangame/fiction/ui/bookstore/BookStorePresenter.java
216c4ee41a4d97c66f27689aba697a30defc3d52
[ "Apache-2.0" ]
permissive
daixu/FictionReader
703467042e78fe707c6adb7a2c74c140c6159248
10340694f36b35c2fe5f57ab0ba8a129c662f55f
refs/heads/master
2021-01-03T04:26:11.175391
2020-02-16T12:06:32
2020-02-16T12:06:32
239,920,594
2
0
null
null
null
null
UTF-8
Java
false
false
2,860
java
package com.shangame.fiction.ui.bookstore; import com.shangame.fiction.core.base.RxPresenter; import com.shangame.fiction.net.api.ApiManager; import com.shangame.fiction.net.manager.HttpResultManager; import com.shangame.fiction.net.response.FriendReadResponse; import com.shangame.fiction.net.response.HttpResult; import com.shangame.fiction.net.response.MaleChannelResponse; import com.shangame.fiction.net.response.PictureConfigResponse; import io.reactivex.Observable; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; /** * Create by Speedy on 2018/8/13 */ public class BookStorePresenter extends RxPresenter<BookStoreContacts.View> implements BookStoreContacts.Presenter<BookStoreContacts.View> { @Override public void getBookData(int userId, int pageCount, int maleChannel) { Observable<HttpResult<MaleChannelResponse>> observable = ApiManager.getInstance().getBookData(userId, pageCount, maleChannel); Disposable disposable = HttpResultManager.rxResultHandler(observable, mView, new Consumer<HttpResult<MaleChannelResponse>>() { @Override public void accept(HttpResult<MaleChannelResponse> result) throws Exception { if (mView != null && HttpResultManager.verify(result, mView)) { mView.getBookDataSuccess(result.data); } } }); addSubscribe(disposable); } @Override public void getFriendRead(long userid, int malechannel, int page, int pagesize, int status) { Observable<HttpResult<FriendReadResponse>> observable = ApiManager.getInstance().getFriendRead(userid, malechannel, page, pagesize, status); Disposable disposable = HttpResultManager.rxResultHandler(observable, mView, new Consumer<HttpResult<FriendReadResponse>>() { @Override public void accept(HttpResult<FriendReadResponse> result) throws Exception { if (mView != null && HttpResultManager.verify(result, mView)) { mView.getFriendReadSuccess(result.data); } } }); addSubscribe(disposable); } @Override public void getPictureConfig(int userid, int malechannel) { Observable<HttpResult<PictureConfigResponse>> observable = ApiManager.getInstance().getPictureConfig(userid, malechannel); Disposable disposable = HttpResultManager.rxResultHandler(observable, mView, new Consumer<HttpResult<PictureConfigResponse>>() { @Override public void accept(HttpResult<PictureConfigResponse> result) throws Exception { if (mView != null && HttpResultManager.verify(result, mView)) { mView.getPictureConfigSuccess(result.data); } } }); addSubscribe(disposable); } }
e3660f1bca6eabe928cc2cdacbefe0cf7072a2f5
024e5964a28e5651859ee65a967b38394c17b0fa
/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/delayed/vec/TestDelayedVectorProxy.java
504511ecc89632a1e8f45422f550d927ae4485a2
[ "CDDL-1.0", "LicenseRef-scancode-oracle-openjdk-exception-2.0", "GPL-2.0-only", "Apache-2.0" ]
permissive
veselov/openjpa
273a4b6f7c966bc213d7a78e5ff0c8e35d15bbd9
8be86a6903dcf5d6486bf5578486fdd1fd28fc4a
refs/heads/trunk
2023-03-15T21:23:47.982096
2018-05-14T22:25:05
2018-05-14T22:25:05
136,547,090
0
1
Apache-2.0
2022-07-31T15:16:43
2018-06-08T00:51:16
Java
UTF-8
Java
false
false
4,176
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openjpa.persistence.proxy.delayed.vec; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Vector; import javax.persistence.EntityManager; import org.apache.openjpa.persistence.proxy.delayed.Award; import org.apache.openjpa.persistence.proxy.delayed.Certification; import org.apache.openjpa.persistence.proxy.delayed.DelayedProxyCollectionsTestCase; import org.apache.openjpa.persistence.proxy.delayed.IAccount; import org.apache.openjpa.persistence.proxy.delayed.IDepartment; import org.apache.openjpa.persistence.proxy.delayed.IEmployee; import org.apache.openjpa.persistence.proxy.delayed.IMember; import org.apache.openjpa.persistence.proxy.delayed.IUserIdentity; import org.apache.openjpa.persistence.proxy.delayed.Location; import org.apache.openjpa.persistence.proxy.delayed.Product; public class TestDelayedVectorProxy extends DelayedProxyCollectionsTestCase { public static Object[] _pcList = { Employee.class, Department.class, UserIdentity.class, Member.class, Account.class }; public void setUp() { super.setUp(_pcList); } public void setUp(Object... props){ List<Object> parms = new ArrayList<Object>(); // Add package-specific types parms.addAll(Arrays.asList(_pcList)); // Add properties from super parms.addAll(Arrays.asList(props)); super.setUp(parms.toArray()); } public IUserIdentity findUserIdentity(EntityManager em, int id) { return em.find(UserIdentity.class, id); } public IDepartment findDepartment(EntityManager em, int id) { return em.find(Department.class, id); } public IUserIdentity createUserIdentity() { UserIdentity ui = new UserIdentity(); return ui; } public IAccount createAccount(String name, IUserIdentity ui) { IAccount acct = new Account(name, ui); return acct; } public IDepartment createDepartment() { Department d = new Department(); return d; } public IMember createMember(String name) { Member m = new Member(); m.setName(name); return m; } @Override public IEmployee createEmployee() { Employee e = new Employee(); return e; } @Override public Collection<IEmployee> createEmployees() { return new Vector<IEmployee>(); } @Override public Collection<Product> createProducts() { return new Vector<Product>(); } @Override public Collection<Award> createAwards() { return new Vector<Award>(); } @Override public Collection<Location> createLocations() { return new Vector<Location>(); } @Override public Collection<Certification> createCertifications() { return new Vector<Certification>(); } @Override public Collection<IAccount> createAccounts() { return new Vector<IAccount>(); } @Override public IEmployee getEmployee(Collection<IEmployee> emps, int idx) { return ((Vector<IEmployee>)emps).get(idx); } @Override public Product getProduct(Collection<Product> products, int idx) { return ((Vector<Product>)products).get(idx); } }
58e85e6b8f9a0d29ef1c83d3a0ee16d720496106
dfa1d8218701e8884810edcee5b9079b137a91dc
/build/generated-sources/ap-source-output/modelo/entidades/Lecturaestaciones_.java
c7870a70ab853fbcf4db659c9cb40454a6b51f0b
[]
no_license
AbiPineda/SisHidrometeoroJPA
5d65a0e89d039742b40e52b656c94f3c9fe1b857
31fcbde22b81649f6ddd11449e551a55cb169d14
refs/heads/master
2020-04-06T08:54:25.849024
2018-11-13T04:38:28
2018-11-13T04:38:28
157,321,102
0
0
null
null
null
null
UTF-8
Java
false
false
3,138
java
package modelo.entidades; import java.math.BigDecimal; import java.util.Date; import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; import modelo.entidades.Estacionmeteorologica; @Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2018-11-07T11:30:53") @StaticMetamodel(Lecturaestaciones.class) public class Lecturaestaciones_ { public static volatile SingularAttribute<Lecturaestaciones, Date> date; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> inhum; public static volatile SingularAttribute<Lecturaestaciones, String> hidir; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> rainrate; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> windtx; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> intemp; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> issrecept; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> inemc; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> bar; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> tempout; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> inairdensity; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> hispeed; public static volatile SingularAttribute<Lecturaestaciones, Integer> idhojalecturaestaciones; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> hitemp; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> rain; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> outhum; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> heatdD; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> lowtemp; public static volatile SingularAttribute<Lecturaestaciones, Integer> arcint; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> cooldD; public static volatile SingularAttribute<Lecturaestaciones, String> winddir; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> indew; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> windrun; public static volatile SingularAttribute<Lecturaestaciones, Estacionmeteorologica> idestacion; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> heatindex; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> dewt; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> thwindex; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> windspeed; public static volatile SingularAttribute<Lecturaestaciones, String> time; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> windchill; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> inheat; public static volatile SingularAttribute<Lecturaestaciones, BigDecimal> windsamp; }
ee77cde62139ba69a4c91dae65e6b1140d8ec4cc
d23cb7b94ef184b8a3b3278c41b06a165dc1adfd
/src/com/study/shz/factory/abstr/AsusFactory.java
0c20b2427c8b20c11c4825fa1643ec77fbac78d4
[]
no_license
UserShi/Design-Pattern
6f559b0570779b22efdb73379591c260ca05cf6b
65ce8bc850466fa44761fc17d6f58b2ad51f8162
refs/heads/master
2021-04-03T10:01:37.380300
2018-03-11T08:46:16
2018-03-11T08:46:16
124,736,832
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package com.study.shz.factory.abstr; import com.study.shz.factory.Asus; import com.study.shz.factory.Computer; public class AsusFactory extends AbstractFactory{ @Override public Computer getComputer() { System.err.println("AsusFactory"); return new Asus(); } }
a425e3ed71c3373b5d57dee4b2eb810a11baf347
44803253ca6235cf838f3c8414a575e77ccf0c81
/GCLACS/src/GCLACS/ComponentKind.java
41c86382c0971e3ab2aad401a0290af56635a643
[]
no_license
saharkallel/clacs
c87d28de9150cd71780cf9c4b95d9a4159fd1aa0
682111697a3e3ea769db2ac694d72cfd7fcbc46b
refs/heads/master
2021-01-02T08:20:45.382356
2015-03-17T15:16:40
2015-03-17T15:16:40
32,180,119
0
0
null
null
null
null
UTF-8
Java
false
false
5,403
java
/** * <copyright> * </copyright> * * $Id$ */ package GCLACS; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * <!-- begin-user-doc --> * A representation of the literals of the enumeration '<em><b>Component Kind</b></em>', * and utility methods for working with them. * <!-- end-user-doc --> * @see GCLACS.GCLACSPackage#getComponentKind() * @model * @generated */ public enum ComponentKind implements Enumerator { /** * The '<em><b>Business</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #BUSINESS_VALUE * @generated * @ordered */ BUSINESS(0, "business", "business"), /** * The '<em><b>Constraint</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #CONSTRAINT_VALUE * @generated * @ordered */ CONSTRAINT(0, "constraint", "constraint"), /** * The '<em><b>Contract</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #CONTRACT_VALUE * @generated * @ordered */ CONTRACT(0, "contract", "contract"); /** * The '<em><b>Business</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Business</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #BUSINESS * @model name="business" * @generated * @ordered */ public static final int BUSINESS_VALUE = 0; /** * The '<em><b>Constraint</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Constraint</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #CONSTRAINT * @model name="constraint" * @generated * @ordered */ public static final int CONSTRAINT_VALUE = 0; /** * The '<em><b>Contract</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Contract</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #CONTRACT * @model name="contract" * @generated * @ordered */ public static final int CONTRACT_VALUE = 0; /** * An array of all the '<em><b>Component Kind</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static final ComponentKind[] VALUES_ARRAY = new ComponentKind[] { BUSINESS, CONSTRAINT, CONTRACT, }; /** * A public read-only list of all the '<em><b>Component Kind</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final List<ComponentKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the '<em><b>Component Kind</b></em>' literal with the specified literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ComponentKind get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ComponentKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the '<em><b>Component Kind</b></em>' literal with the specified name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ComponentKind getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ComponentKind result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the '<em><b>Component Kind</b></em>' literal with the specified integer value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ComponentKind get(int value) { switch (value) { case BUSINESS_VALUE: return BUSINESS; } return null; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final int value; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final String name; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final String literal; /** * Only this class can construct instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private ComponentKind(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { return literal; } } //ComponentKind
7c67466e92fa8833c52bdf49db0479be5e70b04a
b6e92d43542aa0abdeeb20305c7b972445dab6c8
/PostFixweb/src/postfixweb/Archivo.java
37615fce332badf7a62aafc9f9866df00091fd63
[]
no_license
JuanjoTM/PostFix
62b3ffb840fcc7ae2d2172077181949b8a54f7a4
3ce6f88498d9910f6f8481dcb3b74e8df87a449b
refs/heads/master
2021-01-22T09:48:17.276343
2014-07-22T05:02:58
2014-07-22T05:02:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,569
java
/*Universidad del Valle de Guatemala Algoritmos y Estructura de Datos Autores: Juan Jose Tzun Carnet: 13017 Carlos Cordero Carnet: 13152 Luis Tello Carnet: 13161 Fecha: 21/07/2014 */ /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package postfixweb; import java.io.*; /** * * @author Digo Regalado */ public class Archivo { //ATRIBUTOS private File archivo; private BufferedReader br; private FileReader fr; //Constructor public Archivo(String nombre){ archivo = new File(nombre+".txt"); if(!archivo.exists()){ System.out.print("No existe el archivo"); } else{ try{ fr = new FileReader(archivo); br = new BufferedReader(fr); }catch (Exception e){ System.out.println(e.getMessage()); } } } //Metodo que permite leer el contenido del archivo de texto public String leerArchivo(){ String contenido = new String(""); try{ String Slinea; while((Slinea=br.readLine())!=null){ contenido = Slinea; } fr.close(); }catch (Exception e){ System.out.println(e.getMessage()); } return contenido; } }
438c1516d9fcab1f3973c14525854bec68867ad7
559ea64c50ae629202d0a9a55e9a3d87e9ef2072
/com/ifoer/dbentity/CarLogo.java
5715cd21d3438088246654e909a9e66e0486b578
[]
no_license
CrazyWolf2014/VehicleBus
07872bf3ab60756e956c75a2b9d8f71cd84e2bc9
450150fc3f4c7d5d7230e8012786e426f3ff1149
refs/heads/master
2021-01-03T07:59:26.796624
2016-06-10T22:04:02
2016-06-10T22:04:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
package com.ifoer.dbentity; public class CarLogo { private String carLogoName; private String carLogoPath; private String lanName; public String getLanName() { return this.lanName; } public void setLanName(String lanName) { this.lanName = lanName; } public String getCarLogoName() { return this.carLogoName; } public void setCarLogoName(String carLogoName) { this.carLogoName = carLogoName; } public String getCarLogoPath() { return this.carLogoPath; } public void setCarLogoPath(String carLogoPath) { this.carLogoPath = carLogoPath; } }
7af241e9df008168aedda34d9c37c528c05ea2d7
3e606ccecee8492c4c68a55fbaec0f3f25d23c71
/shoppingcartui/src/main/java/com/anwesome/ui/shoppingcartui/SelectedItemContainer.java
dfdbb8f715d4045bc9e33c2c8759e7271f0597c6
[]
no_license
Anwesh43/ShoppingCartUI
9ec589df1f5e1d97503ffdabb6cfad23da063cd1
1e0eeaf8ff61a9df6667fd27289966a6c034927d
refs/heads/master
2021-01-23T06:05:54.700271
2017-06-01T10:17:34
2017-06-01T10:17:34
93,009,794
0
0
null
null
null
null
UTF-8
Java
false
false
1,396
java
package com.anwesome.ui.shoppingcartui; import android.view.View; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; /** * Created by anweshmishra on 01/06/17. */ public class SelectedItemContainer { private SelectedItemContainer() { } public static SelectedItemContainer getInstance() { return new SelectedItemContainer(); } private ConcurrentLinkedQueue<ShoppingCartItem> selectedItems = new ConcurrentLinkedQueue<>(); private List<View> subscribers = new ArrayList<>(); public ConcurrentLinkedQueue<ShoppingCartItem> getSelectedItems() { return selectedItems; } public void subscribe(View view) { subscribers.add(view); } public void addItem(ShoppingCartItem item) { boolean itemAlreadyAdded = false; for(ShoppingCartItem shoppingCartItem:selectedItems) { if(shoppingCartItem.equals(item)) { itemAlreadyAdded = true; break; } } if(itemAlreadyAdded) { if(item.getCount() == 0) { selectedItems.remove(item); } } else { if(item.getCount() == 1) { selectedItems.add(item); } } for(View subscriber:subscribers) { subscriber.postInvalidate(); } } }
bf322665146d21a39b82a3b3b72a324a3719ea9d
88e4aeeec2b30391b14c69335101999391e0d27e
/source/shop/main/exitedStates.java
6e55bcb3e2a99c55a6a312f4e5a796b6cd1aed91
[]
no_license
imorhir/OOP_inventorySet
5a596bac76403d50aa5752d4b757808191929339
b20d8c1c9d36cd76b981ba6b58d817e434721482
refs/heads/master
2022-12-29T01:43:56.379999
2020-05-05T22:16:41
2020-05-05T22:16:41
255,297,198
0
0
null
2020-10-13T21:45:47
2020-04-13T10:36:01
Java
UTF-8
Java
false
false
116
java
package shop.main; public class exitedStates implements State { public State run() { return this; } }
0ada891f51c3686a111e7ad26bf68a8f4e10f45a
771722bb1eb7afd8e0086f71116288688d03b589
/test/PackageBatiment/BatimentTest.java
6eeb0d5b622eb6d80061cd280b9366dd162c3051
[]
no_license
ValkyrieHD42/IUT-AlvaAFaim
23311ed50cedd0c0404d623e846ec9be988cba4a
624455654cca5999541416d28ab11157c6dbb146
refs/heads/main
2023-02-19T01:49:07.132831
2023-02-07T20:50:02
2023-02-07T20:50:02
322,350,609
0
0
null
null
null
null
UTF-8
Java
false
false
2,425
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package PackageBatiment; import metier.PackageCarte.PackageCase.Magasin; import metier.PackageCarte.PackageCase.Batiment; import metier.PackageCarte.Coordonnee; import metier.PackageCarte.PackageCase.Case; import metier.PackageCarte.PackageCase.EnumCASE; import metier.PackageCarte.PackageCase.FabriqueCase; import metier.PackageIngredient.EnumINGREDIENTS; import metier.PackageIngredient.Ingredients; import metier.PackageIngredient.Inventaire; import java.util.HashMap; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Galadrielle */ public class BatimentTest { /** * Test of rachatIngredient and VenteIngrédient methods, of class Batiment. */ @Test public void testRachatVenteIngredient() { EnumINGREDIENTS ingredient = EnumINGREDIENTS.TOMATE; Coordonnee coor = new Coordonnee(1,2); Batiment instance = new Magasin(coor); instance.rachatIngredient(ingredient); boolean res = instance.venteIngredient(ingredient); assertTrue(res); boolean res2 = instance.venteIngredient(ingredient); assertFalse(res2); } @Test public void testInitInventaire() { Inventaire inv1 = new Inventaire(); inv1.ajouterIngredient(EnumINGREDIENTS.TOMATE,1); inv1.ajouterIngredient(EnumINGREDIENTS.VIN, 2); Batiment b1 = (Batiment) FabriqueCase.creer(new Coordonnee(6, 1), EnumCASE.MAGASIN); HashMap<EnumINGREDIENTS, Integer> prix1 = new HashMap<EnumINGREDIENTS, Integer>(); prix1.put(EnumINGREDIENTS.TOMATE, 3); b1.initInventaire(inv1, prix1); Assert.assertEquals(3, b1.getPrix(EnumINGREDIENTS.TOMATE)); Ingredients i1 = new Ingredients(EnumINGREDIENTS.TOMATE, 1); Ingredients i2 = new Ingredients(EnumINGREDIENTS.VIN, 2); Assert.assertEquals(true,b1.getInventaire().getIngredients().get(0).equals(i1)); Assert.assertEquals(true,b1.getInventaire().getIngredients().get(1).equals(i2)); Assert.assertEquals(false,b1.getInventaire().getIngredients().get(0).equals(i2)); } }
97582ae2d78a3c04f4c8a3431ba9a7ae8c88f8c5
2ec187d4a6908cbb56e8e85b14b00332392a2798
/src/test/java/com/song/javaTest/ArrayListT.java
2d874e2a27bde765e320b6a2ef7645ef5b0014b9
[]
no_license
songypd/leetcode
1b7a39baecd67b989d94aea24de341f061ecf49e
e0b035282d5ef0ae98f332addd74ea1ecd0f2bb5
refs/heads/master
2023-03-17T19:38:50.574704
2023-03-12T05:18:27
2023-03-12T05:18:27
222,070,493
0
0
null
2022-06-17T03:29:02
2019-11-16T08:38:32
Java
UTF-8
Java
false
false
434
java
package com.song.javaTest; import com.alibaba.fastjson.JSON; import java.util.ArrayList; import java.util.List; /** * @ClassName ArrayListT * @Description Valar Morghulis.Valar Dohaeris * @Author songyp * @Date 2020-12-18 18:55 */ public class ArrayListT { public static void main(String[] args) { List t = new ArrayList<Integer>(); t.add(0,1); System.out.println(JSON.toJSONString(t)); } }
a9a274ca896872bb751c98efd22131536e547941
19ef586488d796d7e65362e1993c8e103b848bfd
/GsmHelloBatch/src/main/java/org/gsm/demos/hello/processor/PersonItemProcessor.java
b2f87319e493dc73af2058db5ccbf5efc26ed848
[ "Apache-2.0" ]
permissive
GabrielSaiz/GsmSpringBatch
6d8d467fa99e565a8b3ec5b98d1754d23aeeb262
0ca05db995a3294faea1099e50bd099023c93e63
refs/heads/master
2022-02-12T00:41:31.066267
2020-03-10T23:11:04
2020-03-10T23:11:04
154,946,208
0
0
Apache-2.0
2022-01-21T23:22:29
2018-10-27T09:15:24
Java
UTF-8
Java
false
false
811
java
package org.gsm.demos.hello.processor; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; import org.gsm.demos.hello.entity.Person; import org.springframework.batch.item.ItemProcessor; public class PersonItemProcessor implements ItemProcessor<Person, Person> { /** * Logger for this class */ private static final Logger logger = LogManager.getLogger(PersonItemProcessor.class.getName()); @Override public Person process(Person person) throws Exception { final String firstName = person.getFirstName().toUpperCase(); final String lastName = person.getLastName().toUpperCase(); final Person transformedPerson = new Person(firstName, lastName); logger.info("Converting (" + person + ") into (" + transformedPerson + ")"); return transformedPerson; } }
88a651df18e0713553cfe0dd79172789d068a6a4
478f94a7785665c183ceae2af6d249f21d447b66
/src/DoubleLinkedList/DoubleLinkedList.java
6bf140971b989b6065042e02ca08b25bfb3c06a6
[]
no_license
navya06/DataStructures-POS
cb3dbbb0750136122f8123d5af152583ff109d5c
97dcf51a2e6e89cd8e4a175feff9368f980bc9d3
refs/heads/master
2021-06-07T14:51:31.238466
2016-11-21T16:44:11
2016-11-21T16:44:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,555
java
package DoubleLinkedList; import LinkedList.Node; /** * Created by NavyaKaree on 11/20/16. */ public class DoubleLinkedList { static int counter; DLLNode head; public void addLast(int data) { if(head==null) { head = new DLLNode(null, data, null); } else { DLLNode currentNode = head; DLLNode tempNode = new DLLNode(data); while (currentNode.getNext() != null) { currentNode = currentNode.getNext(); } currentNode.setNext(tempNode); tempNode.setPrevious(currentNode); } counter++; } public void addFront(int data){ if(head == null){ head= new DLLNode(null, data, null); } else { DLLNode tempNode= new DLLNode(null, data, head); head.previous = tempNode; head = tempNode; } counter++; } public void add(int index, int data){ if(index<0&& index>size()){ return; } else { DLLNode currentNode = head; for(int i=0;i<index;i++){ if(currentNode.getNext() != null) { currentNode = currentNode.getNext(); } } DLLNode tempNode= new DLLNode(currentNode, data, currentNode.getNext()); currentNode.setNext(tempNode); } } public int size(){ return counter; } public void display(){ DLLNode currentNode=head; while(currentNode!=null){ System.out.println(currentNode.getData()); currentNode = currentNode.getNext(); } } public void delete(int index){ if(index<0&& index>size()){ return; } else { DLLNode currentNode = head; for(int i=0;i<index;i++){ if(currentNode.getNext() != null) { currentNode = currentNode.getNext(); } } DLLNode lastNode= currentNode.getPrevious(); lastNode.next= currentNode.next; } } public int search(int index){ DLLNode currentNode = head; if(index<0&& index>size()){ return Integer.parseInt(null); } else { for(int i=0;i<index;i++){ if(currentNode.getNext() != null) { currentNode = currentNode.getNext(); } } } return currentNode.getData(); } }
95bba84e48084009a324f8a0f75346c4e8ae0702
759b918d7c2e27ce4ad14b1b96b4cbdbc76e2968
/network/src/main/java/com/kevalpatel2106/network/responsePojo/base/Status.java
cc55c4f16b3021c45a9ccd1d64aeef652b4241c6
[]
no_license
kevalpatel2106/home
240baccd0084e2298b72065a0d5109a6549888b5
ad041e539d8d1dc185a0f3dfe2106fcf153f1b2e
refs/heads/master
2021-01-19T21:22:01.201755
2017-07-10T16:09:59
2017-07-10T16:09:59
88,648,018
1
0
null
null
null
null
UTF-8
Java
false
false
1,264
java
/* * Copyright 2017 Keval Patel. * * 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.kevalpatel2106.network.responsePojo.base; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** * Created by Keval on 27-Dec-16. * * @author {@link 'https://github.com/kevalpatel2106'} */ @SuppressWarnings("unused") public final class Status { @SerializedName("c") @Expose private Integer c; @SerializedName("m") @Expose private String m; public Integer getStatusCode() { return c; } public void setC(Integer c) { this.c = c; } public String getMessage() { return m; } public void setM(String m) { this.m = m; } }
9f325cd88be39a47f2a35816e8424069ddbb4f0e
6aa460682b58c05c85c13f3592ba232e25496bec
/oppo/src/test/java/testCases/bewakooftestcase2.java
854b4b34e152dbd941bd5823a42506d1e0fb846d
[]
no_license
soumyajit0109/SeleniumTest
e520f6c4d6af675793c223771b5e79aea775ff76
7e91daff2190dd5ccd9c35cef243d5e5ec9e0315
refs/heads/master
2023-05-08T14:45:24.666313
2021-05-24T13:24:50
2021-05-24T13:24:50
370,359,868
0
0
null
null
null
null
UTF-8
Java
false
false
1,673
java
package testCases; import java.io.FileNotFoundException; import java.io.IOException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openqa.selenium.WebDriver; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import pageObject.BewakoofTest2; import resources.Base; import utility.ReuseableComponents; public class bewakooftestcase2 extends Base{ public WebDriver driver; public static Logger Log=(Logger) LogManager.getLogger(bewakooftestcase.class.getName()); ReuseableComponents rc = new ReuseableComponents(); @BeforeMethod public void beforeMethod() throws IOException { driver = setupdriver(); String bewakooftestcaseurl = rc.getProperty("url"); driver.get(bewakooftestcaseurl); Log.info("driver setup successfull"); } @AfterMethod public void afterMethod() { driver.close(); Log.info("driver setup closed"); } @Test(dataProvider="registerdata") public void DefaultTest(String email,String password) { BewakoofTest2 c1= new BewakoofTest2(driver); //Bewakooftest2 c2= new Bewakooftest2(driver); //Bewakooftest2 c3= new Bewakooftest2(driver); //bewakooftest2 c4= new bewakooftest2(driver); c1.getClick_On_Catagor().click(); c1.getClick_On_email().click(); c1.getClick_On_emailid().sendKeys(email); c1.getClick_On_password().sendKeys(password); //c4.getClick_On_Login().click(); } @DataProvider(name="registerdata") public Object[][] getTestData() throws FileNotFoundException, IOException { return rc.readDataFromExcel(0); } }
b71157c9424443a7582668ad57d307ef1d1eec9c
7d86a8d48f281f9423a4bb8d148e4d163902a591
/src/test/java/com/reallifedeveloper/tools/test/fitnesse/FitNesseFixtureTest.java
88005cb205feb8c97eb805568c569be585c7ba13
[ "MIT" ]
permissive
EnriqueDeLavalle/rld-build-tools
fea650223c0c3ca4a4ed0c14f1caeb241ae57d25
1f171b7603bc83de47787e39119cd4e7cca60c66
refs/heads/master
2022-01-31T13:13:22.012528
2017-04-08T13:32:55
2017-04-08T13:32:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,301
java
package com.reallifedeveloper.tools.test.fitnesse; import java.util.Calendar; import java.util.Date; import javax.sql.DataSource; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.springframework.beans.factory.NoSuchBeanDefinitionException; public class FitNesseFixtureTest extends AbstractFitNesseFixture { public FitNesseFixtureTest() { super("/META-INF/spring-context-rld-build-tools-test.xml"); } @Test public void kommentar() { Assert.assertNull("Kommentar ska vara null innan den har satts", getComment()); setComment("foo"); Assert.assertEquals("Fel kommentar: ", "foo", getComment()); } @Test public void getExistingBean() { Assert.assertNotNull("DataSource should not be null", getBean(DataSource.class)); } @Test(expected = NoSuchBeanDefinitionException.class) public void getNonExistingBean() { getBean(Boolean.class); } @Test public void testLogger() { Logger logger = logger(); Assert.assertNotNull("Logger should not be null", logger); logger.info("Logger method is working"); } @Test public void testResetApplicationContext() { Assert.assertNotNull("DataSource should not be null before reset", getBean(DataSource.class)); resetApplicationContext(); Assert.assertNotNull("DataSource should not be null after reset", getBean(DataSource.class)); } @Test public void parseCorrectDate() { Date date = parseDate("2016-03-26"); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); Assert.assertEquals("Wrong year: ", 2016, calendar.get(Calendar.YEAR)); Assert.assertEquals("Wrong month: ", 3 - 1, calendar.get(Calendar.MONTH)); Assert.assertEquals("Wrong day: ", 26, calendar.get(Calendar.DAY_OF_MONTH)); } @Test(expected = IllegalArgumentException.class) public void parseIncorrectDate() { parseDate("foo"); } @Test public void testToString() { Assert.assertEquals("Wrong result from toString: ", "47.11", toString(47.11)); } @Test public void testToStringNull() { Assert.assertEquals("Wrong result from toString: ", null, toString(null)); } }
0fc5513784d9204091711bac226483b82a258cc5
9cb5d23b9bfa35a00f1633c3115539eafbf5e150
/vdc-dummy/src/main/java/de/tub/Server.java
ae66795550aeb29102b7b774feb60bc8526964ba
[ "Apache-2.0" ]
permissive
DITAS-Project/tub-dummy-example
1a7720155b1d34a824354060b511bac86938b0d8
70d3127ffbc8446ed8e519318b78b0d03ecd4fe0
refs/heads/master
2022-07-05T09:06:11.205240
2018-04-23T13:57:18
2018-04-23T13:57:18
117,254,490
1
1
Apache-2.0
2022-06-21T00:13:14
2018-01-12T15:04:42
Java
UTF-8
Java
false
false
4,740
java
/* * Copyright 2017 ISE TU Berlin * * 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 de.tub; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.ExitCodeGenerator; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.ComponentScan; import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.sql.Connection; import java.sql.DriverManager; @SpringBootApplication @EnableSwagger2 @ComponentScan(basePackages = { "de.tub", "de.tub.api" }) public class Server implements CommandLineRunner { @Override public void run(String... arg0) throws Exception { if (arg0.length > 0 && arg0[0].equals("exitcode")) { throw new ExitException(); } } public static void main(String[] args) throws Exception { SpringApplication application = new SpringApplicationBuilder(Server.class) .initializers((ApplicationContextInitializer<ConfigurableApplicationContext>) ctx -> { String cassandraURI = ctx.getEnvironment().getProperty("cassandra.uri"); String databaseURI = ctx.getEnvironment().getProperty("spring.datasource.url"); String user = ctx.getEnvironment().getProperty("spring.datasource.username"); String pass = ctx.getEnvironment().getProperty("spring.datasource.password"); System.out.println("wait for databases to settle"); waitUntilReachable(cassandraURI); waitUntilReachable(databaseURI.substring("jdbc:mysql://".length(),databaseURI.lastIndexOf(':'))); waitForCassandra(cassandraURI); waitForMySQL(databaseURI,user,pass); }) .application(); application.run(args); } private static void waitForCassandra(String uri) { while (!pingCassandra(uri)){ System.out.println("wait for "+uri); try { Thread.sleep(3600); } catch (InterruptedException e) {} } System.out.println(uri+" reachable"); } private static boolean pingCassandra(String cassandraURI) { try(Socket clientSocket = new Socket(cassandraURI, 9042)){ return clientSocket.isConnected(); } catch (IOException e){ return false; } } private static boolean waitForMySQL(String uri, String user, String pass) { while(!pingMySQL(uri,user,pass)){ System.out.println("wait for "+uri); try { Thread.sleep(3600); } catch (InterruptedException e) {} } System.out.println(uri+" reachable"); return true; } private static boolean pingMySQL(String databaseURI, String user, String pass) { try { Connection connection = DriverManager.getConnection(databaseURI,user,pass); connection.close(); return true; } catch(Exception e) { e.printStackTrace(); return false; } } class ExitException extends RuntimeException implements ExitCodeGenerator { private static final long serialVersionUID = 1L; @Override public int getExitCode() { return 10; } } private static boolean waitUntilReachable(String uri) { try { InetAddress addresse = InetAddress.getByName(uri); while(!addresse.isReachable(3600)){ System.out.println("wait for "+uri); } System.out.println(uri+" reachable"); return true; } catch (IOException e) { System.out.println("failed to wait for "+uri); return false; } } }
f11732754fd846288e7004b93b0152922e7d6a82
e1c261f106ffc489bcb4f7d34f4c68d5acd2089a
/src/main/java/PruebaRxJava.java
bed38a13d4b2da31f7344b436843d9d86f61d8b7
[]
no_license
diegoramirez1/RxJavaExample
382c56ed5ce9ceafffa0bb9427b73a5d098a0bbc
31d867d111f907cfed4eb97f78fe10ba3245d854
refs/heads/master
2020-04-22T03:04:01.404512
2019-02-11T05:31:52
2019-02-11T05:31:52
170,073,115
0
0
null
null
null
null
UTF-8
Java
false
false
1,321
java
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import rx.Observable; import rx.functions.Action1; public class PruebaRxJava { public static void main(String[] args) { RxApp rxApp = new RxApp(); rxApp.buscar(); } } class RxApp { private List<Integer> lista1; private List<Integer> lista2; public RxApp(){ lista1 = new ArrayList<>(); lista2 = new ArrayList<>(); this.llenarListas(); } public void llenarListas(){ for (int i=0; i< 100 ; i++){ lista1.add(i); lista2.add(i); } } public void buscar (){ Observable<Integer> ob1 = Observable.from(lista1); Observable<Integer> ob2 = Observable.from(lista2); // Observable.merge(ob1,ob2).subscribe(new Action1<Integer>() { // @Override // public void call(Integer numero) { // // if (numero%2000==0){ // System.out.println(numero); // } // } // }); // Observable.merge(ob1,ob2).filter( numero -> numero%7==0).subscribe(System.out::println); Observable.merge(ob1,ob2).filter( numero -> numero%7==0).subscribe(num -> System.out.println(num)); } }
33ffda71bb9e2ec27760027ecd94f17019a821c9
3c96a90acc0afb2c17289de7b2924fd27afd4c58
/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/FunctionZipProcessor.java
6d487212d18d93628bbddc9ca54ca333a43dddff
[ "Apache-2.0" ]
permissive
Trinorae/quarkus
25d4ac8a2e6ad102b6a9adedb53c379912e18d4b
a8f3fccac1cbf0f34d5f3262d6a472e7c42ed509
refs/heads/master
2022-04-28T21:48:57.799157
2020-04-27T14:01:55
2020-04-27T14:01:55
259,386,142
0
0
Apache-2.0
2020-04-27T16:17:00
2020-04-27T16:17:00
null
UTF-8
Java
false
false
7,668
java
package io.quarkus.amazon.lambda.deployment; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.stream.Stream; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.compress.utils.IOUtils; import org.jboss.logging.Logger; import io.quarkus.deployment.IsNormal; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem; import io.quarkus.deployment.pkg.builditem.JarBuildItem; import io.quarkus.deployment.pkg.builditem.NativeImageBuildItem; import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem; import io.quarkus.deployment.pkg.steps.NativeBuild; /** * Generate deployoment package zip for lambda. * */ public class FunctionZipProcessor { private static final Logger log = Logger.getLogger(FunctionZipProcessor.class); /** * Function.zip is same as the jar plus dependencies in lib/ if not uberjar * plus anything in src/main/zip.jvm * * @param target * @param artifactResultProducer * @param jar * @throws Exception */ @BuildStep(onlyIf = IsNormal.class, onlyIfNot = NativeBuild.class) public void jvmZip(OutputTargetBuildItem target, BuildProducer<ArtifactResultBuildItem> artifactResultProducer, JarBuildItem jar) throws Exception { Path zipPath = target.getOutputDirectory().resolve("function.zip"); Path zipDir = findJvmZipDir(target.getOutputDirectory()); try (ZipArchiveOutputStream zip = new ZipArchiveOutputStream(zipPath.toFile())) { try (ZipArchiveInputStream zinput = new ZipArchiveInputStream(new FileInputStream(jar.getPath().toFile()))) { for (;;) { ZipArchiveEntry entry = zinput.getNextZipEntry(); if (entry == null) break; copyZipEntry(zip, zinput, entry); } } if (zipDir != null) { try (Stream<Path> paths = Files.walk(zipDir)) { paths.filter(Files::isRegularFile) .forEach(path -> { try { int mode = Files.isExecutable(path) ? 0755 : 0644; addZipEntry(zip, path, zipDir.relativize(path).toString().replace('\\', '/'), mode); } catch (Exception ex) { throw new RuntimeException(ex); } }); } } if (!jar.isUberJar()) { try (Stream<Path> paths = Files.walk(jar.getLibraryDir())) { paths.filter(Files::isRegularFile) .forEach(path -> { try { int mode = Files.isExecutable(path) ? 0755 : 0644; addZipEntry(zip, path, "lib/" + jar.getLibraryDir().relativize(path).toString().replace('\\', '/'), mode); } catch (Exception ex) { throw new RuntimeException(ex); } }); } } } } /** * Native function.zip adds anything in src/main/zip.native. If src/main/zip.native/bootstrap * exists then the native executable is renamed to "runner". * * @param target * @param artifactResultProducer * @param nativeImage * @throws Exception */ @BuildStep(onlyIf = { IsNormal.class, NativeBuild.class }) public void nativeZip(OutputTargetBuildItem target, BuildProducer<ArtifactResultBuildItem> artifactResultProducer, NativeImageBuildItem nativeImage) throws Exception { Path zipDir = findNativeZipDir(target.getOutputDirectory()); Path zipPath = target.getOutputDirectory().resolve("function.zip"); Files.delete(zipPath); try (ZipArchiveOutputStream zip = new ZipArchiveOutputStream(zipPath.toFile())) { String executableName = "bootstrap"; if (zipDir != null) { File bootstrap = zipDir.resolve("bootstrap").toFile(); if (bootstrap.exists()) { executableName = "runner"; } try (Stream<Path> paths = Files.walk(zipDir)) { paths.filter(Files::isRegularFile) .forEach(path -> { try { if (bootstrap.equals(path.toFile())) { addZipEntry(zip, path, "bootstrap", 0755); } else { int mode = Files.isExecutable(path) ? 0755 : 0644; addZipEntry(zip, path, zipDir.relativize(path).toString().replace('\\', '/'), mode); } } catch (Exception ex) { throw new RuntimeException(ex); } }); } } addZipEntry(zip, nativeImage.getPath(), executableName, 0755); } ; } private void copyZipEntry(ZipArchiveOutputStream zip, InputStream zinput, ZipArchiveEntry from) throws Exception { ZipArchiveEntry entry = new ZipArchiveEntry(from); zip.putArchiveEntry(entry); IOUtils.copy(zinput, zip); zip.closeArchiveEntry(); } private void addZipEntry(ZipArchiveOutputStream zip, Path path, String name, int mode) throws Exception { ZipArchiveEntry entry = (ZipArchiveEntry) zip.createArchiveEntry(path.toFile(), name); entry.setUnixMode(mode); zip.putArchiveEntry(entry); try (InputStream i = Files.newInputStream(path)) { IOUtils.copy(i, zip); } zip.closeArchiveEntry(); } private static Path findNativeZipDir(Path outputDirectory) { Path mainSrc = findMainSourcesRoot(outputDirectory); if (mainSrc == null) return null; Path zipDir = mainSrc.resolve("zip.native"); return Files.exists(zipDir) && Files.isDirectory(zipDir) ? zipDir : null; } private static Path findJvmZipDir(Path outputDirectory) { Path mainSrc = findMainSourcesRoot(outputDirectory); if (mainSrc == null) return null; Path zipDir = mainSrc.resolve("zip.jvm"); return Files.exists(zipDir) && Files.isDirectory(zipDir) ? zipDir : null; } private static Path findMainSourcesRoot(Path outputDirectory) { Path currentPath = outputDirectory; do { Path toCheck = currentPath.resolve(Paths.get("src", "main")); if (toCheck.toFile().exists()) { return toCheck; } if (Files.exists(currentPath.getParent())) { currentPath = currentPath.getParent(); } else { return null; } } while (true); } }
179e876be14d06299f06fad23ba36b70d3d2c650
f58f413acdd6127ad0ca4267f445393ed34cdf0f
/XianJinDai101/ryxcredit/src/main/java/com/ryx/ryxcredit/utils/CRecyclerViewUtil.java
542d227fc012375cf322ca19794c93a88f43c925
[]
no_license
showdpro/project
798f6dc3a428e0ffc1a6411debf225428f6a5441
8f1df7ed9b2d368467636b521d5e59989ecd85ac
refs/heads/master
2021-07-25T11:59:50.383484
2017-10-30T08:37:22
2017-10-30T08:37:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,551
java
package com.ryx.ryxcredit.utils; import android.view.View; /** * Created by laomao on 16/6/29. */ public class CRecyclerViewUtil { /** * 展开 * * @param v */ public static void expand(final View v) { // item显示的条目 /* final LinearLayout textLayout = (LinearLayout) v.findViewById(R.id.c_repaylist_text_layout); final LinearLayout ImageLayout = (LinearLayout) v.findViewById(R.id.c_repaylist_detail_layout); ImageLayout.measure(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); final int targetHeight = ImageLayout.getMeasuredHeight(); final int textMissHeight = textLayout.getMeasuredHeight(); ImageLayout.getLayoutParams().height = 0; ImageLayout.setVisibility(View.VISIBLE); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { ImageLayout.getLayoutParams().height = interpolatedTime == 1 ? LinearLayout.LayoutParams.WRAP_CONTENT : (int) (targetHeight * interpolatedTime); textLayout.getLayoutParams().height = textMissHeight - (int) (textMissHeight * interpolatedTime); if (interpolatedTime == 1) { textLayout.setVisibility(View.GONE); } v.requestLayout(); } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (targetHeight / v.getContext().getResources().getDisplayMetrics().density)); v.startAnimation(a);*/ } /** * 收缩 * * @param v */ public static void collapse(final View v) { // item显示的条目 /* final LinearLayout textLayout = (LinearLayout) v.findViewById(R.id.c_repaylist_text_layout); final LinearLayout ImageLayout = (LinearLayout) v.findViewById(R.id.c_repaylist_detail_layout); //// TODO: laomao 16/6/29 获取WRAP_CONTENT分配控件不正常,看动画代码的小伙伴研究下。 textLayout.measure(LinearLayout.LayoutParams.MATCH_PARENT, 60); final int initialHeight = ImageLayout.getMeasuredHeight(); final int targetHeight = textLayout.getMeasuredHeight(); textLayout.getLayoutParams().height = 0; textLayout.setVisibility(View.VISIBLE); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { textLayout.getLayoutParams().height = interpolatedTime == 1 ? LinearLayout.LayoutParams.WRAP_CONTENT : (int) (targetHeight * interpolatedTime); if (interpolatedTime == 1) { ImageLayout.setVisibility(View.GONE); textLayout.setVisibility(View.VISIBLE); } else { ImageLayout.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density)); v.startAnimation(a);*/ } }
2b92447268de6b9afad254de24f8a4460ce11332
d130932c41d84a702c7979b518c9d5b35ce6cf7f
/google/com/google/common/collect/ForwardingListMultimap.java
051db1268e265d94d3222dd0af15838192da427b
[ "Apache-2.0" ]
permissive
oneliang/third-party-lib
c20004706d1a718693e58426705f4d108d0f1204
9c0c78f9246c9ac9a467b048c0d4bbed1c22424d
refs/heads/master
2021-01-17T15:59:39.402159
2020-09-16T04:56:40
2020-09-16T04:57:45
56,781,806
1
1
null
null
null
null
UTF-8
Java
false
false
1,647
java
/* * Copyright (C) 2010 The Guava 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 com.google.common.collect; import com.google.common.annotations.GwtCompatible; import java.util.List; /** * A list multimap which forwards all its method calls to another list multimap. * Subclasses should override one or more methods to modify the behavior of * the backing multimap as desired per the <a * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>. * * @author Kurt Alfred Kluever * @since 3.0 */ @GwtCompatible public abstract class ForwardingListMultimap<K, V> extends ForwardingMultimap<K, V> implements ListMultimap<K, V> { /** Constructor for use by subclasses. */ protected ForwardingListMultimap() {} @Override protected abstract ListMultimap<K, V> delegate(); @Override public List<V> get( K key) { return delegate().get(key); } @Override public List<V> removeAll( Object key) { return delegate().removeAll(key); } @Override public List<V> replaceValues(K key, Iterable<? extends V> values) { return delegate().replaceValues(key, values); } }
b924ec853ed43f4ff275b75b99eafd92203f0a88
d2aaa2542219bcecc4a401e72b541f77fd81a816
/hello-spring-cloud-zuul/src/main/java/com/swift/hello/spring/cloud/zuul/filter/LoginFilter.java
06d37988ec571775f14820d16714cbb719f71950
[]
no_license
heqiangsc/hello-spring-cloud
aa2c72792c533511680f75b41efc91d96082e16b
e535606af8b9a10df91109622a6a76302b11572c
refs/heads/master
2022-05-19T06:46:16.971899
2019-12-24T06:45:17
2019-12-24T06:45:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,935
java
package com.swift.hello.spring.cloud.zuul.filter; import com.netflix.zuul.ZuulFilter; import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.exception.ZuulException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; import java.io.IOException; @Component public class LoginFilter extends ZuulFilter { private static final Logger logger = LoggerFactory.getLogger(LoginFilter.class); /** * 配置过滤类型,有四种不同生命周期的过滤器类型 * 1. pre:路由之前 * 2. routing:路由之时 * 3. post:路由之后 * 4. error:发送错误调用 * @return */ @Override public String filterType() { return "pre"; } /** * 配置过滤的顺序 * @return */ @Override public int filterOrder() { return 0; } /** * 配置是否需要过滤:true/需要,false/不需要 * @return */ @Override public boolean shouldFilter() { return true; } /** * 过滤器的具体业务代码 * @return * @throws ZuulException */ @Override public Object run() { RequestContext context = RequestContext.getCurrentContext(); HttpServletRequest request = context.getRequest(); logger.info("{} >>> {}", request.getMethod(), request.getRequestURL().toString()); String token = request.getParameter("token"); if (token == null) { logger.warn("Token is empty"); context.setSendZuulResponse(false); context.setResponseStatusCode(401); try { context.getResponse().getWriter().write("Token is empty"); } catch (IOException e) { } } else { logger.info("OK"); } return null; } }
79967da443ae5f2b3ac02cb58c89e33182527620
83750f24909d4efc03a6e0324d6916fc3ccc731b
/app/OrganizerHut/app/src/main/java/by/hut/flat/calendar/core/config/Main.java
325eddff1296cb27136550388eb08f3c0cae7ce9
[ "MIT" ]
permissive
syrel/hut.by-Organizer
da10c4aa20ecf10543726f50d69f70811800e2ec
aa1c7dce4a962330938cc65ae4ceafb5b467e7ca
refs/heads/master
2020-12-24T15:31:44.221537
2017-01-12T23:31:16
2017-01-12T23:31:16
41,567,418
0
0
null
null
null
null
UTF-8
Java
false
false
1,827
java
package by.hut.flat.calendar.core.config; import by.hut.flat.calendar.R; import by.hut.flat.calendar.core.Config; import android.content.Context; public class Main extends Preferences { private static final String TAG = "main"; private static final String TAB_HOST_HEIGHT_NAME = "tab_host_height"; public int TAB_HOST_HEIGHT; public final boolean OK; public Main(Context context) { super(TAG, context); this.TAB_HOST_HEIGHT = readTabHostHeight(); check(); this.OK = true; } /*------------------------------------------------------------ ------------------------- A C T I O N S ---------------------- ------------------------------------------------------------*/ @Override public void reInit() { this.TAB_HOST_HEIGHT = initTabHostHeight(); } /*------------------------------------------------------------ -------------------------- C H E C K S ----------------------- ------------------------------------------------------------*/ @Override public void check() { if (Config.INST.REINIT){ reInit(); } } /*------------------------------------------------------------ ----------------------------- R E A D ------------------------ ------------------------------------------------------------*/ private int readTabHostHeight(){ int tabHostHeight = this.getInt(TAB_HOST_HEIGHT_NAME); if (tabHostHeight == NONE) tabHostHeight = this.initTabHostHeight(); return tabHostHeight; } /*------------------------------------------------------------ ----------------------------- I N I T ------------------------ ------------------------------------------------------------*/ private int initTabHostHeight(){ int tabHostHeight = (int) resources.getDimension(R.dimen.default_main_tab_host_height); save(TAB_HOST_HEIGHT_NAME, tabHostHeight); return tabHostHeight; } }
d44480216abdec02b24f6c920fd53cfae4125762
f22fd41e3bea4da5c40419b9d0829343b3420862
/src/luogu/PickApples.java
3239959a83e0d630f29e8533c791ac48ff72e192
[]
no_license
nebulaport/programming
efd0e3c17edad16f6a129f3968a1c034885a67d5
623355cd727b82e37e4575efb775501e7328a37b
refs/heads/master
2020-07-22T02:43:56.655063
2020-03-03T07:26:25
2020-03-03T07:26:25
207,051,549
0
0
null
null
null
null
UTF-8
Java
false
false
611
java
package luogu; import java.util.Scanner; /** * @ClassName PickApples * @Description P1046 陶陶摘苹果 * @Author NebulaPort * @Date 2019/9/5 9:32 */ public class PickApples { public static void main(String[] args) { Scanner in=new Scanner(System.in); int[] apples=new int[10]; for (int i = 0; i <10 ; i++) { apples[i]=in.nextInt(); } in.nextLine(); int h=in.nextInt()+30; int cnt=0; for(int apple:apples){ if (apple<=h){ cnt++; } } System.out.println(cnt); } }
7135dd6ef16a0bfef40f371cefca2b82985bb1d7
8b34c1ae5026eada7c526147d10b8d990b6bdbf8
/app/src/main/java/android/example/opentrivia/QuizScore.java
d6ca4cade794426d809bb357ed10abac670610e9
[]
no_license
system-error/OpenTriviaAndroid
b85ed3d6e977760df6d54923f283f17a710a3974
571a115079b18bb16431fae6a658869897622a31
refs/heads/master
2022-11-05T23:51:32.440604
2020-06-17T21:59:13
2020-06-17T21:59:13
273,085,834
0
0
null
null
null
null
UTF-8
Java
false
false
1,601
java
package android.example.opentrivia; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; public class QuizScore extends AppCompatActivity { private TextView displayTheScore; private TextView displayTheFinishMessage; private TextView displayTheAnsweredQuestions; private TextView displayTheTotalQuestions; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_quiz_score); Intent intent = getIntent(); String score = intent.getStringExtra("SCORE"); String NumberOfQuestionsAnswered = intent.getStringExtra("NUMBER_OF_QUESTIONS_ANSWERED"); String totalNumberOfQuestions = intent.getStringExtra("TOTAL_QUESTIONS"); String playersName = intent.getStringExtra("PLAYERS_NAME"); displayTheScore = findViewById(R.id.scoreView); displayTheFinishMessage = findViewById(R.id.textForEndGame); displayTheAnsweredQuestions = findViewById(R.id.answeredView); displayTheTotalQuestions = findViewById(R.id.answsersView); Toast toast = Toast.makeText(this, "Your sore is "+ score, Toast.LENGTH_LONG); toast.show(); displayTheScore.setText(score); displayTheFinishMessage.setText(playersName+" the game is finished! Thank you"); displayTheAnsweredQuestions.setText(NumberOfQuestionsAnswered); displayTheTotalQuestions.setText(totalNumberOfQuestions); } }
d0b5e0f306b43636a95faf81b7ba5abe30e4b730
e3b3a07496d67ad7e06cb61a84ab6bf54f114f20
/satc-ejb/ejbModule/com/sat/sisat/caja/dto/CjGenerico.java
92ba13b2befaed36a37f389f47ef9c58c83c7489
[]
no_license
jelizvt/sisatc
19ddea0112eb4a33bfa08db6ac56e4adfbc87df6
ca0f8eb74feb3211c7b9cb586bbfa3952a966122
refs/heads/master
2022-12-07T21:20:34.181389
2020-08-19T15:30:32
2020-08-19T15:30:32
288,759,982
0
0
null
null
null
null
UTF-8
Java
false
false
10,799
java
package com.sat.sisat.caja.dto; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Timestamp; public class CjGenerico implements Serializable { private int codigo; private String descripcion; private int subconceptoId; private String subconceptoDes; private int cajeroId; private int personaId; private int djId; private int predioId; private int djVehicular; private int vehiculoId; private String DireccionCompleta; private String ListaPredio; private String ListaVehiculo; private String ListaConcepto; private String ListaVencimientos; private String ListaCuota; private String ListaAnyo; private Timestamp FechaInteres; private String Observacion; private BigDecimal Insoluto; private BigDecimal Reajuste; private BigDecimal DerechoEmision; private BigDecimal interesCapitalizado; private BigDecimal interesSimple; private BigDecimal Interes; private BigDecimal SubTotal; private String Periodo; private int ConceptoId; private String ConceptoDes; private int PapeletaId; // papeletas private int papeleta_id; private Timestamp FechaIntraccion; private String nroPapeleta; private String placa; private String infractorDes; private BigDecimal monto7; private BigDecimal monto7a15; private BigDecimal montoMayora15; private String observacionDes; // impuesto vehicular private int codigoVehiculo; private String categoria; private String marca; private String modelo; // impuesto predial private int codigoPredial; private String direccion; private boolean select; // estado cuenta private BigDecimal descuento; private BigDecimal totalCancelado; private String flagControlyCobranza; private String flagFraccionamiento; private String flagTramiteDocumetario; private String flagResolucion; private String storeProcedure; private String uso; private String fisca; private Integer estadoDeudaId; private String estadoDeudaDescripcion; private Integer annoDocumento; private Integer nroDocumentoId; public CjGenerico() { } public String getEstadoDeudaDescripcion() { return estadoDeudaDescripcion; } public void setEstadoDeudaDescripcion(String estadoDeudaDescripcion) { this.estadoDeudaDescripcion = estadoDeudaDescripcion; } public int getCodigo() { return codigo; } public void setCodigo(int codigo) { this.codigo = codigo; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public int getCajeroId() { return cajeroId; } public void setCajeroId(int cajeroId) { this.cajeroId = cajeroId; } public int getPersonaId() { return personaId; } public void setPersonaId(int personaId) { this.personaId = personaId; } public String getListaPredio() { return ListaPredio; } public void setListaPredio(String listaPredio) { ListaPredio = listaPredio; } public String getListaVehiculo() { return ListaVehiculo; } public void setListaVehiculo(String listaVehiculo) { ListaVehiculo = listaVehiculo; } public String getListaConcepto() { return ListaConcepto; } public void setListaConcepto(String listaConcepto) { ListaConcepto = listaConcepto; } public String getListaCuota() { return ListaCuota; } public void setListaCuota(String listaCuota) { ListaCuota = listaCuota; } public String getListaAnyo() { return ListaAnyo; } public void setListaAnyo(String listaAnyo) { ListaAnyo = listaAnyo; } public Timestamp getFechaInteres() { return FechaInteres; } public void setFechaInteres(Timestamp fechaInteres) { FechaInteres = fechaInteres; } public String getObservacion() { return Observacion; } public void setObservacion(String observacion) { Observacion = observacion; } public BigDecimal getInsoluto() { return Insoluto; } public void setInsoluto(BigDecimal insoluto) { Insoluto = insoluto; } public BigDecimal getReajuste() { return Reajuste; } public void setReajuste(BigDecimal reajuste) { Reajuste = reajuste; } public BigDecimal getDerechoEmision() { return DerechoEmision; } public void setDerechoEmision(BigDecimal derechoEmision) { DerechoEmision = derechoEmision; } public BigDecimal getInteres() { return Interes; } public void setInteres(BigDecimal interes) { Interes = interes; } public BigDecimal getSubTotal() { return SubTotal; } public void setSubTotal(BigDecimal subTotal) { SubTotal = subTotal; } public String getPeriodo() { return Periodo; } public void setPeriodo(String periodo) { this.Periodo = periodo; } public int getDjId() { return djId; } public void setDjId(int djId) { this.djId = djId; } public int getPredioId() { return predioId; } public void setPredioId(int predioId) { this.predioId = predioId; } public String getDireccionCompleta() { return DireccionCompleta; } public void setDireccionCompleta(String direccionCompleta) { DireccionCompleta = direccionCompleta; } public int getDjVehicular() { return djVehicular; } public void setDjVehicular(int djVehicular) { this.djVehicular = djVehicular; } public int getVehiculoId() { return vehiculoId; } public void setVehiculoId(int vehiculoId) { this.vehiculoId = vehiculoId; } public String getPlaca() { return placa; } public void setPlaca(String placa) { this.placa = placa; } public String getConceptoDes() { return ConceptoDes; } public void setConceptoDes(String conceptoDes) { ConceptoDes = conceptoDes; } public int getConceptoId() { return ConceptoId; } public void setConceptoId(int conceptoId) { ConceptoId = conceptoId; } public int getSubconceptoId() { return subconceptoId; } public void setSubconceptoId(int subconceptoId) { this.subconceptoId = subconceptoId; } public String getSubconceptoDes() { return subconceptoDes; } public void setSubconceptoDes(String subconceptoDes) { this.subconceptoDes = subconceptoDes; } public boolean isSelect() { return select; } public void setSelect(boolean select) { this.select = select; } public String getListaVencimientos() { return ListaVencimientos; } public void setListaVencimientos(String listaVencimientos) { ListaVencimientos = listaVencimientos; } public int getCodigoVehiculo() { return codigoVehiculo; } public void setCodigoVehiculo(int codigoVehiculo) { this.codigoVehiculo = codigoVehiculo; } public String getCategoria() { return categoria; } public void setCategoria(String categoria) { this.categoria = categoria; } public String getMarca() { return marca; } public void setMarca(String marca) { this.marca = marca; } public String getModelo() { return modelo; } public void setModelo(String modelo) { this.modelo = modelo; } public int getCodigoPredial() { return codigoPredial; } public void setCodigoPredial(int codigoPredial) { this.codigoPredial = codigoPredial; } public int getPapeletaId() { return PapeletaId; } public void setPapeletaId(int papeletaId) { PapeletaId = papeletaId; } public String getDireccion() { return direccion; } public void setDireccion(String direccion) { this.direccion = direccion; } public BigDecimal getMonto7() { return monto7; } public void setMonto7(BigDecimal monto7) { this.monto7 = monto7; } public BigDecimal getMonto7a15() { return monto7a15; } public void setMonto7a15(BigDecimal monto7a15) { this.monto7a15 = monto7a15; } public Timestamp getFechaIntraccion() { return FechaIntraccion; } public void setFechaIntraccion(Timestamp fechaIntraccion) { FechaIntraccion = fechaIntraccion; } public int getPapeleta_id() { return papeleta_id; } public void setPapeleta_id(int papeleta_id) { this.papeleta_id = papeleta_id; } public BigDecimal getMontoMayora15() { return montoMayora15; } public void setMontoMayora15(BigDecimal montoMayora15) { this.montoMayora15 = montoMayora15; } public String getNroPapeleta() { return nroPapeleta; } public void setNroPapeleta(String nroPapeleta) { this.nroPapeleta = nroPapeleta; } public String getInfractorDes() { return infractorDes; } public void setInfractorDes(String infractorDes) { this.infractorDes = infractorDes; } public String getObservacionDes() { return observacionDes; } public void setObservacionDes(String observacionDes) { this.observacionDes = observacionDes; } public BigDecimal getInteresCapitalizado() { return interesCapitalizado; } public void setInteresCapitalizado(BigDecimal interesCapitalizado) { this.interesCapitalizado = interesCapitalizado; } public BigDecimal getInteresSimple() { return interesSimple; } public void setInteresSimple(BigDecimal interesSimple) { this.interesSimple = interesSimple; } public BigDecimal getDescuento() { return descuento; } public void setDescuento(BigDecimal descuento) { this.descuento = descuento; } public BigDecimal getTotalCancelado() { return totalCancelado; } public void setTotalCancelado(BigDecimal totalCancelado) { this.totalCancelado = totalCancelado; } public String getFlagControlyCobranza() { return flagControlyCobranza; } public void setFlagControlyCobranza(String flagControlyCobranza) { this.flagControlyCobranza = flagControlyCobranza; } public String getFlagFraccionamiento() { return flagFraccionamiento; } public void setFlagFraccionamiento(String flagFraccionamiento) { this.flagFraccionamiento = flagFraccionamiento; } public String getFlagTramiteDocumetario() { return flagTramiteDocumetario; } public void setFlagTramiteDocumetario(String flagTramiteDocumetario) { this.flagTramiteDocumetario = flagTramiteDocumetario; } public String getFlagResolucion() { return flagResolucion; } public void setFlagResolucion(String flagResolucion) { this.flagResolucion = flagResolucion; } public String getStoreProcedure() { return storeProcedure; } public void setStoreProcedure(String storeProcedure) { this.storeProcedure = storeProcedure; } public String getUso() { return uso; } public void setUso(String uso) { this.uso = uso; } public String getFisca() { return fisca; } public void setFisca(String fisca) { this.fisca = fisca; } public Integer getEstadoDeudaId() { return estadoDeudaId; } public void setEstadoDeudaId(Integer estadoDeudaId) { this.estadoDeudaId = estadoDeudaId; } public Integer getAnnoDocumento() { return annoDocumento; } public void setAnnoDocumento(Integer annoDocumento) { this.annoDocumento = annoDocumento; } public Integer getNroDocumentoId() { return nroDocumentoId; } public void setNroDocumentoId(Integer nroDocumentoId) { this.nroDocumentoId = nroDocumentoId; } }
921385d4310fd98c9e261fb00315878aa244d35b
fdeda8a217f924b12252a6aee73b54e33783ca4f
/src/main/java/com/appsdeveloperblog/app/ws/SpringApplicationContext.java
fc2b2c925333bb539a5bc386410b2b632a24e983
[]
no_license
Lboggie79/mobile-app-ws
d2253cd40ba98aa986f79ba88374dda57b4d0e17
e6375a6f956c2b2d489b8b27a1520b7d190fe457
refs/heads/master
2020-05-26T23:53:16.551101
2019-05-24T12:12:14
2019-05-24T12:12:14
188,416,089
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
package com.appsdeveloperblog.app.ws; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; public class SpringApplicationContext implements ApplicationContextAware { private static ApplicationContext CONTEXT; @Override public void setApplicationContext(ApplicationContext context) throws BeansException { CONTEXT = context; } public static Object getBean(String beanName) { return CONTEXT.getBean(beanName); } }
6dbce009edaf56a1975039d794439c3e1d785fa2
772d687bc6995a0ac4a787aee07da2fdec7671e6
/src/Donnee/Region.java
0f63e3d48706b522f337519e7f4772c3d6194b35
[]
no_license
Bilail/Obis-3D
526af74503b2f01138e7c3ed1a59b356f2e95413
535cc35d95f4b386967f027a653263ba7a169529
refs/heads/master
2023-08-16T14:14:30.789068
2021-10-26T10:32:01
2021-10-26T10:32:01
373,064,581
0
0
null
null
null
null
UTF-8
Java
false
false
860
java
package Donnee; import application.EarthController; import javafx.geometry.Point2D; import javafx.geometry.Point3D; public class Region { private Point3D p1; private Point3D p2; private Point3D p3; private Point3D p4; public Region(Point2D[] coords) { this.p1= EarthController.geoCoordTo3dCoord((float) coords[0].getX(), (float) coords[0].getY()); this.p2= EarthController.geoCoordTo3dCoord((float) coords[1].getX(), (float) coords[1].getY());; this.p3= EarthController.geoCoordTo3dCoord((float) coords[2].getX(), (float) coords[2].getY());; this.p4= EarthController.geoCoordTo3dCoord((float) coords[3].getX(), (float) coords[3].getY());; } public Point3D[] getPoints() { Point3D[] points = {p1, p2, p3, p4}; return points; } @Override public String toString() { return "{" + p1 + "," + p2 + "," + p3 + "," + p4 + "}"; } }
977db3af47753175306a454a48b60d1b049c82f1
d96e7e05a510ba11a821a52070611c9afa193890
/src/test/java/tools/manager/ToolsManagerApplicationTests.java
a551246c54b13bf6269ba2d1a656e86b1bad3205
[]
no_license
LuizFernandesOliveira/springboot-app-nandodev-tools-manager
9a7d6cb9988cc5e2170476a3df6efbc418c9bd0a
06c0a91dd9fbc119605d1774dee3c7baff017fd4
refs/heads/main
2023-04-10T07:24:02.993143
2021-04-19T16:28:46
2021-04-19T16:28:46
352,535,888
0
0
null
null
null
null
UTF-8
Java
false
false
211
java
package tools.manager; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ToolsManagerApplicationTests { @Test void contextLoads() { } }
51c70ef8571a5d92510ee4b891fdb3965022bb8b
e4fcc28f1e1f584febf31bb90892b4dff58c716c
/app/src/test/java/com/shoppin/merchant/ExampleUnitTest.java
1137b8a1eb9feea1daa62025e511d189fff5cf58
[]
no_license
shoppinDev/Shoppin-Merchant-2.0
2392f47c15a9789a2b036f7a59084d14d637beea
d65b8e62ce39f937312671c82cb1480c481fe514
refs/heads/master
2021-01-12T12:05:59.295722
2016-12-06T12:07:57
2016-12-06T12:07:57
69,237,472
0
0
null
null
null
null
UTF-8
Java
false
false
313
java
package com.shoppin.merchant; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
cc46ef8ae8144eba404d4a7eac589d8753cbd71b
17bf0de1a1f6451282dea4a1805f55bbc172978c
/wsam/src/com/twh/wsam/MainAdmin.java
5540aebe6db48ba064d8004a7782bebfe37c7e4e
[]
no_license
twh0516/wsam
3fb1baedca065f78be9eb2b4e45f78d0ac0b11c8
7554e2fa4b91c6315c1773ca5231ad43fa869039
refs/heads/master
2021-01-11T20:15:21.494673
2017-02-15T17:37:47
2017-02-15T17:37:47
79,075,247
0
0
null
null
null
null
UTF-8
Java
false
false
11,292
java
package com.twh.wsam; import java.awt.Color; import java.awt.Cursor; import java.awt.EventQueue; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SpringLayout; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import com.twh.wsam.addEditExaminationRoom.ExaminationRoomContract; import com.twh.wsam.addEditExaminationRoom.ExaminationRoomPresenter; import com.twh.wsam.addEditExaminationRoom.ExaminationRoomView; import com.twh.wsam.examination.SearchExamination; import com.twh.wsam.examination.AddEditExamination; import com.twh.wsam.login.LoginDialog; import com.twh.wsam.setting.AddSetting; import com.twh.wsam.setting.AddSettingContract; import com.twh.wsam.setting.AddSettingPresenter; import com.twh.wsam.setting.VCRContractor; import com.twh.wsam.setting.VCRPresenter; import com.twh.wsam.student.StudentArchive; import com.twh.wsam.teacher.AddTeacherPresenter; import com.twh.wsam.teacher.SearchTeacher; import com.twh.wsam.teacher.SearchTeacherPresenter; import com.twh.wsam.teacher.AddEditTeacher; import com.twh.wsam.teacher.AddTeacherContract.Presenter; public class MainAdmin extends JFrame { private static final long serialVersionUID = 1L; public static Color mouseEnteredColor = new Color(100, 149, 237); public static Color mouseExitedColor = new Color(0, 0, 0); private JPanel contentPane; /** * Launch the application. */ public static void main(String[] args) { String lookAt = "system"; if (lookAt.equals("system")) { /* 系统风格 */ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } } else if (lookAt.equals("modif")) { /* sun自定义风格 */ try { UIManager.setLookAndFeel("com.sun.java." + "swing.plaf.motif.MotifLookAndFeel"); } catch (Exception e) { e.printStackTrace(); } } else if (lookAt.equals("cross")) { /* 跨平台风格 */ try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } } EventQueue.invokeLater(new Runnable() { public void run() { try { MainAdmin frame = new MainAdmin(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public MainAdmin() { setTitle(Appinfo.appName); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(0, 0, 1064, 680); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JPanel panel = new JPanel(); panel.setBackground(new Color(255, 255, 255)); JPanel panel_1 = new JPanel(); panel_1.setBackground(new Color(255, 255, 255)); SpringLayout sl_panel_1 = new SpringLayout(); panel_1.setLayout(sl_panel_1); // 用于功能模块切换及效果 int moduleCount = 4; final JLabel[] titles = new JLabel[moduleCount]; final JPanel[] modules = new JPanel[moduleCount]; final int addTeacherNo = 0; final int addRoomNo = 1; final int addEnvironmentNo = 2; final int searchTeacherNo = 3; // 添加各功能模块 // 教师信息 AddEditTeacher teacher = new AddEditTeacher(); Presenter presenter = new AddTeacherPresenter(null); presenter.setView(teacher); teacher.setPresenter(presenter); teacher.start(); teacher.setBackground(Color.WHITE); addModule(panel_1, sl_panel_1, teacher, modules, addTeacherNo); // 考场信息 ExaminationRoomView examinationRoom = new ExaminationRoomView(); ExaminationRoomContract.Presenter roomPresenter = new ExaminationRoomPresenter(); roomPresenter.setView(examinationRoom); examinationRoom.setPresenter(roomPresenter); examinationRoom.start(); addModule(panel_1, sl_panel_1, examinationRoom, modules, addRoomNo); // 服务器配置 AddSetting serverConfig = new AddSetting(); AddSettingContract.Presenter addSettingPresenter = new AddSettingPresenter(); addSettingPresenter.setView(serverConfig); serverConfig.setPresenter(addSettingPresenter); VCRContractor.Presenter vcrPresenter = new VCRPresenter(); serverConfig.setVCRPresenter(vcrPresenter); serverConfig.start(); addModule(panel_1, sl_panel_1, serverConfig, modules, addEnvironmentNo); SearchTeacher searchTeacher = new SearchTeacher(); SearchTeacherPresenter searchPresenter = new SearchTeacherPresenter(); searchTeacher.setPresenter(searchPresenter); searchPresenter.setView(searchTeacher); addModule(panel_1, sl_panel_1, searchTeacher, modules, searchTeacherNo); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup().addGap(25) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE).addGap(44) .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 811, Short.MAX_VALUE))); gl_contentPane .setVerticalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup().addGap(20) .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) .addComponent(panel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE) .addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE)) .addContainerGap())); GridBagLayout gbl_panel = new GridBagLayout(); gbl_panel.columnWidths = new int[] { 0 }; gbl_panel.rowHeights = new int[] { 60, 60, 60, 60, 60, 60 }; gbl_panel.columnWeights = new double[] { 0.0 }; gbl_panel.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; panel.setLayout(gbl_panel); JLabel label_teacher = new JLabel("新建教师 "); titles[addTeacherNo] = label_teacher; label_teacher.setOpaque(true); label_teacher.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { selectModule(titles, modules, addTeacherNo); } @Override public void mouseEntered(MouseEvent e) { // label_3.setForeground(mouseEnteredColor); } @Override public void mouseExited(MouseEvent e) { // label_3.setForeground(mouseExitedColor); } }); label_teacher.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); label_teacher.setFont(new Font("宋体", Font.PLAIN, 20)); GridBagConstraints gbc_label_teacher = new GridBagConstraints(); gbc_label_teacher.anchor = GridBagConstraints.NORTHEAST; gbc_label_teacher.insets = new Insets(0, 0, 5, 0); gbc_label_teacher.gridx = 0; gbc_label_teacher.gridy = 0; panel.add(label_teacher, gbc_label_teacher); JLabel label_search = new JLabel("查询教师"); label_search.setOpaque(true); label_search.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); label_search.setFont(new Font("宋体", Font.PLAIN, 20)); GridBagConstraints gbc_label_search = new GridBagConstraints(); gbc_label_search.anchor = GridBagConstraints.NORTHWEST; gbc_label_search.insets = new Insets(0, 0, 5, 0); gbc_label_search.gridx = 0; gbc_label_search.gridy = 1; panel.add(label_search, gbc_label_search); titles[searchTeacherNo] = label_search; label_search.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { selectModule(titles, modules, searchTeacherNo); } @Override public void mouseEntered(MouseEvent e) { // label_3.setForeground(mouseEnteredColor); } @Override public void mouseExited(MouseEvent e) { // label_3.setForeground(mouseExitedColor); } }); JLabel label_environment = new JLabel("环境搭建 "); titles[addEnvironmentNo] = label_environment; label_environment.setOpaque(true); label_environment.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { selectModule(titles, modules, addEnvironmentNo); } @Override public void mouseEntered(MouseEvent e) { // label_4.setForeground(mouseEnteredColor); } @Override public void mouseExited(MouseEvent e) { // label_4.setForeground(mouseExitedColor); } }); JLabel label_room = new JLabel("创建考场 "); titles[addRoomNo] = label_room; label_room.setOpaque(true); label_room.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { selectModule(titles, modules, addRoomNo); } @Override public void mouseEntered(MouseEvent e) { // label_2.setForeground(mouseEnteredColor); } @Override public void mouseExited(MouseEvent e) { // label_2.setForeground(mouseExitedColor); } }); label_room.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); label_room.setFont(new Font("宋体", Font.PLAIN, 20)); GridBagConstraints gbc_label_room = new GridBagConstraints(); gbc_label_room.anchor = GridBagConstraints.NORTHEAST; gbc_label_room.insets = new Insets(0, 0, 5, 0); gbc_label_room.gridx = 0; gbc_label_room.gridy = 2; panel.add(label_room, gbc_label_room); label_environment.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); label_environment.setFont(new Font("宋体", Font.PLAIN, 20)); GridBagConstraints gbc_label_environment = new GridBagConstraints(); gbc_label_environment.insets = new Insets(0, 0, 5, 0); gbc_label_environment.anchor = GridBagConstraints.NORTHEAST; gbc_label_environment.gridx = 0; gbc_label_environment.gridy = 3; panel.add(label_environment, gbc_label_environment); contentPane.setLayout(gl_contentPane); } private void selectModule(JLabel[] titles, JPanel[] modules, int moduleNo) { for (JLabel label : titles) { if (label != null) { label.setForeground(mouseExitedColor); } } for (JPanel panel : modules) { if (panel != null) panel.setVisible(false); } if (moduleNo < titles.length && titles[moduleNo] != null) { titles[moduleNo].setForeground(mouseEnteredColor); } if (moduleNo < modules.length && modules[moduleNo] != null) { modules[moduleNo].setVisible(true); } } private void addModule(JPanel panel_1, SpringLayout sl_panel_1, JPanel module, JPanel[] modules, int no) { sl_panel_1.putConstraint(SpringLayout.EAST, module, 710, SpringLayout.WEST, panel_1); sl_panel_1.putConstraint(SpringLayout.NORTH, module, 10, SpringLayout.NORTH, panel_1); sl_panel_1.putConstraint(SpringLayout.WEST, module, 30, SpringLayout.WEST, panel_1); sl_panel_1.putConstraint(SpringLayout.SOUTH, module, 550, SpringLayout.NORTH, panel_1); module.setVisible(false); panel_1.add(module); if (no < modules.length) modules[no] = module; } }
c4f4715ca35b72de577dcdd8c6be7eea90eb8169
ce8beba8393f507d73d43901e5ca366a4cbfdf90
/status-patients/status-patients-portlet/src/main/java/com/statuspatients/plugins/service/http/PatientsServiceSoap.java
3aa4241b6f1d85461025c1f1d8c0364d7f92f3c7
[]
no_license
PrateekNarang/liferay-demo
5b23f3843ddbc2ab8a6bf849868c65544436665c
0719fded841a7b442107eab49390429a92bc492f
refs/heads/master
2020-05-30T12:41:02.692174
2015-09-03T05:09:49
2015-09-03T05:09:49
41,408,819
0
0
null
null
null
null
UTF-8
Java
false
false
1,686
java
package com.statuspatients.plugins.service.http; /** * Provides the SOAP utility for the * {@link com.statuspatients.plugins.service.PatientsServiceUtil} service utility. The * static methods of this class calls the same methods of the service utility. * However, the signatures are different because it is difficult for SOAP to * support certain types. * * <p> * ServiceBuilder follows certain rules in translating the methods. For example, * if the method in the service utility returns a {@link java.util.List}, that * is translated to an array of {@link com.statuspatients.plugins.model.PatientsSoap}. * If the method in the service utility returns a * {@link com.statuspatients.plugins.model.Patients}, that is translated to a * {@link com.statuspatients.plugins.model.PatientsSoap}. Methods that SOAP cannot * safely wire are skipped. * </p> * * <p> * The benefits of using the SOAP utility is that it is cross platform * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and * even Perl, to call the generated services. One drawback of SOAP is that it is * slow because it needs to serialize all calls into a text format (XML). * </p> * * <p> * You can see a list of services at http://localhost:8080/api/axis. Set the * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure * security. * </p> * * <p> * The SOAP utility is only generated for remote services. * </p> * * @author Brian Wing Shun Chan * @see PatientsServiceHttp * @see com.statuspatients.plugins.model.PatientsSoap * @see com.statuspatients.plugins.service.PatientsServiceUtil * @generated */ public class PatientsServiceSoap { }
1b96859e92ed59692e5b49e394ef97c3e7508922
816813158e603910cae3eac9edfa717b1603dffc
/src/main/java/com/example/livedemo/config/Cora.java
d1db39301134b4ab88740a961d4cb6b59232f054
[]
no_license
dhyjlas/livedemo
3c8fc16097327c7c8ac8ddd04dfc23f74ab183e2
0ecf9510e2c48ef1750a35ae4332bd8d5ddb8f56
refs/heads/master
2020-03-30T00:08:53.231188
2018-09-27T00:53:41
2018-09-27T00:53:41
150,507,320
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
package com.example.livedemo.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * 解决跨域问题 */ @Configuration public class Cora implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**"); } }
f99aec0fcacf6b57acd33b808c6ece3e4811ac01
edcfe7d37f4998181998c6ba5ad051c293a82d78
/migo-gen/src/main/java/com/migo/service/impl/SysGeneratorServiceImpl.java
23ababc31bbd722fe326ff4619d89bfb57ab5a66
[]
no_license
dianzikuangjie/migo-security
6ffc64e9b56b1eae4a95179792bed000f6127af2
88ccdd14fb4e5c37285f17a444f359a553dee7c4
refs/heads/master
2020-05-07T16:48:29.732410
2019-04-11T04:58:15
2019-04-11T04:58:15
180,699,553
1
0
null
2019-04-11T02:31:22
2019-04-11T02:31:21
null
UTF-8
Java
false
false
2,594
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 com.migo.service.impl; import com.migo.dao.SysGeneratorDao; import com.migo.service.SysGeneratorService; import com.migo.utils.GenUtils; import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.ByteArrayOutputStream; import java.util.List; import java.util.Map; import java.util.zip.ZipOutputStream; /** * @author 知秋 * @email [email protected] */ @Service public class SysGeneratorServiceImpl implements SysGeneratorService { @Autowired private SysGeneratorDao sysGeneratorDao; @Override public List<Map<String, Object>> queryList(Map<String, Object> map) { return sysGeneratorDao.queryList(map); } @Override public int queryTotal(Map<String, Object> map) { return sysGeneratorDao.queryTotal(map); } @Override public Map<String, String> queryTable(String tableName) { return sysGeneratorDao.queryTable(tableName); } @Override public List<Map<String, String>> queryColumns(String tableName) { return sysGeneratorDao.queryColumns(tableName); } @Override public byte[] generatorCode(String[] tableNames) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ZipOutputStream zip = new ZipOutputStream(outputStream); for(String tableName : tableNames){ //查询表信息 Map<String, String> table = queryTable(tableName); //查询列信息 List<Map<String, String>> columns = queryColumns(tableName); //生成代码 GenUtils.generatorCode(table, columns, zip); } IOUtils.closeQuietly(zip); return outputStream.toByteArray(); } }
d18a7c3bd1a26e2b6a70c71d3c312c970696ed84
dca9a5c947bf48d209ef541ee2cfc2b3ef402d65
/job/src/main/java/com/viveye.job/XxlJobAdminApplication.java
1a97d693c36d48455cb0d9d795fcca1cac9502b2
[]
no_license
viveyeS/SpringCloud
06f85e52af5f0fbe889e465ec0b9e40045d3349a
6b27c9b5b60cacc7c486df727646ca994e83920d
refs/heads/master
2023-02-13T14:55:24.720479
2021-01-20T01:21:04
2021-01-20T01:21:04
298,158,560
4
1
null
null
null
null
UTF-8
Java
false
false
557
java
package com.viveye.job; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.ComponentScan; /** * @author xuxueli 2018-10-28 00:38:13 */ @ComponentScan("com.viveye") @EnableDiscoveryClient @SpringBootApplication public class XxlJobAdminApplication { public static void main(String[] args) { SpringApplication.run(XxlJobAdminApplication.class, args); } }
94cc1e7c0042f897a6fd53088e3f4b5a3e857ec1
01fa7604b8630f6f928bccc88e4b1ef3463ebe88
/weixin-core/src/main/java/org/fengkeji/weixin/core/WeixinCoreController.java
424e4227a205f93418c7edf264ae1b96f69c24e4
[]
no_license
RoyZeng/fengkeji
539158cf74692cacd4d4076670d49888b36524e1
cd71fcbaf770c6c2411558b37c8a605fb722ab3d
refs/heads/master
2020-12-25T00:03:03.821803
2014-10-22T13:39:04
2014-10-22T13:39:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,600
java
/** * */ package org.fengkeji.weixin.core; import java.io.IOException; import java.io.PrintWriter; import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.fengkeji.weixin.common.util.SignUtil; import org.fengkeji.weixin.base.AbstractWxController; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * @author ASUS * */ @Controller @RequestMapping(value="/weixin/core/") public class WeixinCoreController extends AbstractWxController<WeixinCoreService>{ /** * 确认请求来自微信服务器 */ @RequestMapping(value="execute", method = RequestMethod.GET) public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { // 与接口配置信息中的Token要一致 String token = "fengyilin"; // 微信加密签名 String signature = request.getParameter("signature"); // 时间戳 String timestamp = request.getParameter("timestamp"); // 随机数 String nonce = request.getParameter("nonce"); // 随机字符串 String echostr = request.getParameter("echostr"); PrintWriter out = response.getWriter(); // 通过检验signature对请求进行校验,若校验成功则原样返回echostr,表示接入成功,否则接入失败 if (SignUtil.checkSignature(signature, timestamp, nonce, token)) { out.print(echostr); } out.close(); out = null; } /** * 处理微信服务器发来的消息 */ @RequestMapping(value="execute", method = RequestMethod.POST) public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { // 调用核心业务类接收消息、处理消息 String respMessage = service.processRequest(request); // 响应消息 PrintWriter out = response.getWriter(); out.print(respMessage); out.close(); out= null; } @Override @Inject @Named("CoreService") protected void setService(WeixinCoreService service) { this.service = service; } /** * 处理微信服务器发来的消息 */ @RequestMapping("init") public String init(HttpServletRequest request, HttpServletResponse response,Model model) { model.addAttribute("name","spring-mvc"); return "/login/login"; } }
cf29a23447d9679c5eaf67be0770eff5f63a3b51
2408b8f563b8ca7ab938a38bd7eedf7dbd7dcd7a
/Design_Pattern/src/main/java/structural/facade/example1/OrderEmailTemplate.java
9cb4823d7d0f1d0863d52339a3a2e9d182d7f170
[]
no_license
ravikumar9555564130/Design_Pattern
71e5f939f27acde6b797d865a768928f422606cf
18db26ab56181e3a878c03156a6901478eb8faa2
refs/heads/master
2020-04-29T06:34:06.828416
2019-03-17T15:59:16
2019-03-17T15:59:16
175,920,495
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
package structural.facade.example1; public class OrderEmailTemplate extends Template { @Override public String format(Object obj) { return "TEMPLATE"; } }