blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
181867b5b7a3b8e63f213d41d2abc661a224b6bd
a31f2c8d77d0ff62b3939830f17199985ba90ebd
/core/src/main/java/com/bbva/kltt/apirest/core/parser/IItemFactory.java
dfafa659ce2a43dcdf9d831753f1f30d2d13bbee
[ "Apache-2.0" ]
permissive
pakkk/APIRestGenerator
ed22281731a5f1cce9e590d23c316f18e509b1ed
f3b28638b1d9ed98145bdd47c425cf5ac970941f
refs/heads/master
2023-03-20T23:28:22.433315
2017-06-15T15:06:32
2017-06-15T15:06:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,073
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.bbva.kltt.apirest.core.parser; import com.bbva.kltt.apirest.core.parsed_info.common.Item; import com.bbva.kltt.apirest.core.parsed_info.common.ItemArray; import com.bbva.kltt.apirest.core.parsed_info.common.ItemComplex; import com.bbva.kltt.apirest.core.parsed_info.common.ItemFile; import com.bbva.kltt.apirest.core.parsed_info.common.ItemRef; import com.bbva.kltt.apirest.core.util.APIRestGeneratorException; /** * ------------------------------------------------ * @author Francisco Manuel Benitez Chico * ------------------------------------------------ */ public interface IItemFactory { /** * @param type with the type * @return true if the type is simple */ boolean isSimpleItem(final String type) ; /** * @param name with the item name * @param alias with the alias name * @param description with the description * @param required true if the item is required * @param type with the type * @param format with the format * @return a new item * @throws APIRestGeneratorException with an occurred exception */ Item createNewSimpleItem(final String name, final String alias, final String description, final String required, final String type, final String format) throws APIRestGeneratorException ; /** * @param type with the type * @return true if the type is array type */ boolean isArrayItem(final String type); /** * @param name with the item name * @param alias with the alias name * @param description with the description * @param required true if the item is required * @return a new item * @throws APIRestGeneratorException with an occurred exception */ ItemArray createNewArray(final String name, final String alias, final String description, final String required) throws APIRestGeneratorException ; /** * @param name with the item name * @param alias with the alias name * @param description with the description * @param required true if the item is required * @param reference with the reference * @return a new instance of ItemRef * @throws APIRestGeneratorException with an occurred exception */ ItemRef createNewItemRef(final String name, final String alias, final String description, final String required, final String reference) throws APIRestGeneratorException ; /** * @param type with the type * @return true if the type is complex type */ boolean isComplexItem(final String type) ; /** * @param name with the name * @param alias with the alias name * @param description with the description * @param required true if the item is required * @return a new item complex * @throws APIRestGeneratorException with an occurred exception */ ItemComplex createNewItemComplex(final String name, final String alias, final String description, final String required) throws APIRestGeneratorException ; /** * @param type with the type * @return true if the type is file type */ boolean isFileItem(final String type); /** * @param name with the name * @param alias with the alias name * @param description with the description * @param required true if the item is required * @return a new item file * @throws APIRestGeneratorException with an occurred exception */ ItemFile createNewItemFile(final String name, final String alias, final String description, final String required) throws APIRestGeneratorException ; }
[ "paco.benitez.chico@gmail.com" ]
paco.benitez.chico@gmail.com
c90c2170c0680183f2ced67d909ecd40477968fc
87c44f1ffe535d46f1e9f09e046ce486d27e2cf7
/src/main/java/com/sam/repositories/TaskRepository.java
5bccbd217cf1f678d1f5d9d78ab777d44cb38953
[]
no_license
bocxy/Spring-Boot---Project-Mangement-Software-Task-Management-CRUD-
64c583571636de4a3746fd4f66af9c20607cba16
ca1768945487187addb4f7e8fef3f95747f04783
refs/heads/master
2023-02-08T03:49:28.269153
2021-01-01T19:41:10
2021-01-01T19:41:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package com.sam.repositories; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.sam.dto.CountType; import com.sam.model.Task; public interface TaskRepository extends JpaRepository<Task,Long> { @Query(value="Select * from task order by due_date desc",nativeQuery = true) public List<Task> getAllTaskDueDateDesc(); @Query(value="Select new com.sam.dto.CountType(COUNT(*)/(Select COUNT(*) from Task) *100,type) from Task GROUP BY type") public List<CountType> getPercentageGroupByType(); }
[ "rinjinlama83@gmail.com" ]
rinjinlama83@gmail.com
9b832881748ddbe15c2900e5e62323c0be74cabc
d8694a2d97373407a2a4b5aa141f55106500434f
/src/com/ebs/receiver/trans/UpdateUserInfo.java
b4c4991ae0a4ff05acad2ffd39c978ef8344e67b
[]
no_license
xlonglong/LotteryService
052dab086ccf3c5cb608ed8fd50883480ddfb79c
c900310c194f760eb8676ec9b945e5c609afc5c9
refs/heads/master
2020-12-25T14:14:47.209770
2016-08-27T07:26:33
2016-08-27T07:26:33
66,701,490
0
0
null
null
null
null
UTF-8
Java
false
false
3,272
java
package com.ebs.receiver.trans; import java.util.Map; import org.apache.log4j.Logger; import com.ebs.base.handler.TokenService; import com.ebs.base.handler.UserService; import com.ebs.receiver.comm.FuncUtils; import com.ebs.receiver.conf.Configuration; import com.ebs.receiver.domain.Status; import com.ebs.receiver.domain.TYOrder; import com.ebs.receiver.domain.UserInfo; import com.ebs.receiver.util.JSONUtils; import com.ebs.receiver.util.PackUtil; import com.ebs.receiver.util.RedisUtil; import com.ebs.receiver.util.StringUtil; public class UpdateUserInfo { public static Logger logger=Logger.getLogger(UpdateUserInfo.class); public String work(String msg) { logger.info(msg); try{ UserService userService=new UserService(); TYOrder tyOrder = JSONUtils.json2pojo(PackUtil.getJsonBode(msg), TYOrder.class); String token=tyOrder.getHeader().getToken(); Map<String,String>userMap=RedisUtil.getMap(token); // String userid=new TokenService().getUseridByToken(token); String userid=userMap.get("userid"); if(userid==null) { //用户token值过期或者错误 return FuncUtils.getErrorMsg("0032",Configuration.getGlobalMsg("MSG_0032")); } //设置userid; if(tyOrder.getUserInfo()==null) { tyOrder.setUserInfo(new UserInfo()); } tyOrder.getUserInfo().setUserid(userid); //判断用户是否已经注册 UserInfo userInfo=userService.getUserInfo(tyOrder.getUserInfo().getUserid()); if(userInfo==null) { return FuncUtils.getErrorMsg("0011",Configuration.getGlobalMsg("MSG_0011")); } if(StringUtil.isNotEmpty(tyOrder.getUserInfo().getTel())) { userInfo.setUserName(tyOrder.getUserInfo().getTel()); } if(StringUtil.isNotEmpty(tyOrder.getUserInfo().getName())) { userInfo.setName(tyOrder.getUserInfo().getName()); } if(StringUtil.isNotEmpty(tyOrder.getUserInfo().getIdCard())) { userInfo.setIdCard(tyOrder.getUserInfo().getIdCard()); } boolean flag=userService.updateUserInfo(userInfo); if(!flag) { //更新用户信息异常 return FuncUtils.getErrorMsg("9999",Configuration.getGlobalMsg("MSG_9999")); } //获取缓存内容,更新缓存 if(StringUtil.isNotEmpty(tyOrder.getUserInfo().getTel())) { userMap.put("userName", tyOrder.getUserInfo().getTel()); userMap.put("tel", tyOrder.getUserInfo().getTel()); }else{ userInfo.setTel(userMap.get("userName")); } if(StringUtil.isNotEmpty(tyOrder.getUserInfo().getName())) { userMap.put("name", userInfo.getName()); } if(StringUtil.isNotEmpty(tyOrder.getUserInfo().getIdCard())) { userMap.put("idCard", userInfo.getIdCard()); } //更新缓存 RedisUtil.setMap(token, userMap); Status status=new Status(); status.setErrorCode("0000"); status.setErrorMsg(Configuration.getGlobalMsg("MSG_0000")); tyOrder.setStatus(status); tyOrder.setUserInfo(userInfo); tyOrder.setHeader(null); return JSONUtils.obj2json(tyOrder); }catch(Exception e) { //数据处理异常 return FuncUtils.getErrorMsg("9999",Configuration.getGlobalMsg("MSG_9999")); } } }
[ "xlonglong@xlonglong-PC" ]
xlonglong@xlonglong-PC
38059f4e2bd544518d4ce8a1f70596ad10befeb9
06c5fb64e21cba68fd5bbb4a7c51bff2fd24e06c
/FollowUpManager/src/com/shbestwin/followupmanager/view/widget/YearsOld1_2Body6.java
cf9a85f2f67e0ad341753878dcc9cdb3e2f45abf
[]
no_license
hczcgq/FollowUp
f9d41af3c0d1ca65451d70905c4ff79d35ad80e5
4958bc923aff98fcbf1604c6565b1954c2249e7b
refs/heads/master
2016-08-04T09:32:53.761938
2015-08-28T01:23:44
2015-08-28T01:23:44
38,375,663
1
0
null
null
null
null
UTF-8
Java
false
false
4,845
java
package com.shbestwin.followupmanager.view.widget; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.ListView; import com.shbestwin.followupmanager.R; import com.shbestwin.followupmanager.common.util.JsonUtil; import com.shbestwin.followupmanager.interfaces.ListItemClickHelp; import com.shbestwin.followupmanager.model.followup.FollowUpOneTwoNewborn; import com.shbestwin.followupmanager.model.followup.LabInspection; import com.shbestwin.followupmanager.view.adapter.followup.LabInspectionListAdapter; import com.shbestwin.followupmanager.view.dialog.BaseDialogFragment.OnConfirmClickListener; import com.shbestwin.followupmanager.view.dialog.followup.LabInspectionDialog; public class YearsOld1_2Body6 extends LinearLayout implements IBaseYearsOld1_2Body, ListItemClickHelp { private View labInspectionButton; private ListView labInspectionListView; private LabInspectionListAdapter inspectionListAdapter; List<LabInspection> inspectionList = new ArrayList<LabInspection>(); public YearsOld1_2Body6(Context context) { this(context, null); } public YearsOld1_2Body6(Context context, AttributeSet attrs) { this(context, attrs, 0); } public YearsOld1_2Body6(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); View rootView = LayoutInflater.from(context).inflate( R.layout.view_years_old_1_2_body6, this, true); labInspectionButton = rootView.findViewById(R.id.labInspectionButton); labInspectionListView = (ListView) rootView .findViewById(R.id.labInspectionListView); labInspectionButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { showInspectionDialog(); } }); inspectionListAdapter = new LabInspectionListAdapter(getContext(), inspectionList); inspectionListAdapter.setListItemClickHelp(this); labInspectionListView.setAdapter(inspectionListAdapter); } private void showInspectionDialog() { final LabInspectionDialog hypertensionInspectionDialog = LabInspectionDialog .newInstance(); hypertensionInspectionDialog.show( ((FragmentActivity) getContext()).getSupportFragmentManager(), "hypertensionInspectionDialog"); hypertensionInspectionDialog .setOnConfirmClickListener(new OnConfirmClickListener() { @Override public void onConfirmClick() { LabInspection inspection = hypertensionInspectionDialog .getInspection(); inspectionList.add(inspection); hypertensionInspectionDialog.hide(); inspectionListAdapter.notifyDataSetChanged(); } }); } @Override public void getData(FollowUpOneTwoNewborn followUpOneTwoNewborn) { try { followUpOneTwoNewborn.setSysjc(JsonUtil .objectsToJson(inspectionList)); } catch (Exception e) { e.printStackTrace(); } } @SuppressWarnings("unchecked") @Override public void setData(FollowUpOneTwoNewborn followUpOneTwoNewborn) { if (followUpOneTwoNewborn != null) { try { List<LabInspection> lists = JsonUtil .jsonToObjects(followUpOneTwoNewborn.getSysjc(), LabInspection.class); if (lists != null && lists.size() > 0) { inspectionList.addAll(lists); inspectionListAdapter.notifyDataSetChanged(); } } catch (Exception e) { e.printStackTrace(); } } } @Override public boolean validate() { // TODO Auto-generated method stub return true; } @Override public void setFragment(FragmentManager fragmentManager) { // TODO Auto-generated method stub } @Override public void onClick(final int position, int which) { LabInspection inspection = inspectionList.get(position); switch (which) { case R.id.im_delete: inspectionList.remove(position); inspectionListAdapter.notifyDataSetChanged(); break; case R.id.im_edit: final LabInspectionDialog inspectionDialog = new LabInspectionDialog( inspection); inspectionDialog.show(((FragmentActivity) getContext()) .getSupportFragmentManager(), "hypertensionInspectionDialog"); inspectionDialog .setOnConfirmClickListener(new OnConfirmClickListener() { @Override public void onConfirmClick() { LabInspection inspection = inspectionDialog .getInspection(); inspectionList.set(position, inspection); inspectionDialog.hide(); inspectionListAdapter.notifyDataSetChanged(); } }); break; default: break; } } }
[ "hczcgq@gmail.com" ]
hczcgq@gmail.com
cf05ac7a14278cd0041b09bbe6a73f2890fcaf02
95c707860464880113a651ccac077d1159fba78f
/src/main/java/com/numericalmethod/suanshu/stats/stochasticprocess/univariate/integration/sde/Euler.java
2cde2eb799e078fc3693e8302c95857722e08efc
[ "Apache-2.0" ]
permissive
FloFlo93/SuanShu
63eec9082c95e13f0fbd23e173bf329dad4273ce
450614a298bf7193b1ab430285a44828224272f4
refs/heads/master
2021-07-30T09:40:43.142596
2018-03-12T13:39:22
2018-03-12T13:39:22
186,459,542
0
0
Apache-2.0
2019-05-13T16:43:00
2019-05-13T16:43:00
null
UTF-8
Java
false
false
2,230
java
/* * Copyright (c) Numerical Method Inc. * http://www.numericalmethod.com/ * * THIS SOFTWARE IS LICENSED, NOT SOLD. * * YOU MAY USE THIS SOFTWARE ONLY AS DESCRIBED IN THE LICENSE. * IF YOU ARE NOT AWARE OF AND/OR DO NOT AGREE TO THE TERMS OF THE LICENSE, * DO NOT USE THIS SOFTWARE. * * THE SOFTWARE IS PROVIDED "AS IS", WITH NO WARRANTY WHATSOEVER, * EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, * ANY WARRANTIES OF ACCURACY, ACCESSIBILITY, COMPLETENESS, * FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, NON-INFRINGEMENT, * TITLE AND USEFULNESS. * * IN NO EVENT AND UNDER NO LEGAL THEORY, * WHETHER IN ACTION, CONTRACT, NEGLIGENCE, TORT, OR OTHERWISE, * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIMS, DAMAGES OR OTHER LIABILITIES, * ARISING AS A RESULT OF USING OR OTHER DEALINGS IN THE SOFTWARE. */ package com.numericalmethod.suanshu.stats.stochasticprocess.univariate.integration.sde; import com.numericalmethod.suanshu.stats.stochasticprocess.univariate.sde.SDE; import com.numericalmethod.suanshu.stats.stochasticprocess.timepoints.TimeGrid; import com.numericalmethod.suanshu.stats.stochasticprocess.timepoints.UnitGrid; /** * The Euler method is a first-order numerical procedure for integrating stochastic differential equations (SDEs) with a given initial value. * * @author Haksun Li * * @see <a href="http://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method">Wikipedia: Euler–Maruyama method</a> */ public class Euler extends RandomWalk { /** * Simulate an SDE using the Euler scheme at time points specified. * * @param sde the stochastic differential equation specification * @param timePoints specifying the time points in a grid */ public Euler(SDE sde, TimeGrid timePoints) { super(new com.numericalmethod.suanshu.stats.stochasticprocess.univariate.sde.Euler(sde), timePoints); } /** * Simulate an SDE using the Euler scheme at even time points, <i>[0, 1, ......, T]</i>. * * @param sde the stochastic differential equation specification * @param T the duration of the simulation */ public Euler(SDE sde, int T) { this(sde, new UnitGrid(T)); } }
[ "aaiyer@gmail.com" ]
aaiyer@gmail.com
e6730a02a05836a36e018033f7262ebfe4b93ba5
ca233344e0757e04057b65538a8141041e25343e
/B_自定义校验/demo/src/main/java/com/example/demo/entity/User.java
b00fe0a64fbe5e0cb7f15d5bdd45e4bcedd3f2c3
[]
no_license
XUAN-CW/JSR-303-learning
2aaca01f287990ec1d43c550311c2a59c5b4cd76
62f1748cf468461e1038f17a538f9f2aac19fc93
refs/heads/main
2023-07-01T15:17:54.150767
2021-08-03T06:32:29
2021-08-03T06:32:29
389,811,504
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package com.example.demo.entity; import com.example.demo.validation.IsMobile; import lombok.Data; @Data public class User { private Long id; private String ChineseName; private Integer age; private String email; @IsMobile private String mobile; }
[ "49336037+XUAN-CW@users.noreply.github.com" ]
49336037+XUAN-CW@users.noreply.github.com
aa213f0b71ba1e4b3c56d1bd64bfaa23c0b4a56f
68e5ef888ba7accc2361049e0e1651899b2f2ba8
/src/sample/Driver.java
fef682a6c8710e282601aed7025acecdc1743036
[]
no_license
S3688570/MiniNet-social-network-2
503206f7b78cc979fddacbda8509d2366f04b3a9
e0b3a31adcd7cad8b6a3f8de0c21e14f72d5c423
refs/heads/master
2020-03-14T23:25:23.095986
2018-05-15T04:11:05
2018-05-15T04:11:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,169
java
package sample; import java.util.Scanner; public class Driver { //Created by Charles Galea (March 2018) Scanner input = new Scanner(System.in); int option; static Driver menuOpt = new Driver(); //Construct a default constructor public Driver() { } //Method to display menu and take input public void displayMenu() throws MyExceptions { if (option != 8) { do { System.out.println("MiniNet Menu"); System.out.println("========================================================="); System.out.println("1. Add a person to the network."); System.out.println("2. Select a person and display their profile by name."); System.out.println("3. Output all profiles."); System.out.println("4. Connect two people as friends."); System.out.println("5. Are two people friends?"); System.out.println("6. Find out the name(s) of a person's child(ren)."); System.out.println("7. Find out the names of a persons parents."); System.out.println("8. Delete a person's record."); System.out.println("9. Quit"); } while (option < 1 && option > 8); option = input.nextInt(); switch (option) { //Add a person to the network case 1: AddProfiles profile = new AddProfiles(); try { profile.addProfile(); } catch (MyExceptions e) { System.out.println("Incorrect input"); } menuOpt.displayMenu(); break; //Select a person by name and print profile case 2: SearchProfiles search = new SearchProfiles(); try { search.searchName(); } catch (MyExceptions e) { System.out.println("Incorrect input"); } menuOpt.displayMenu(); break; //Output all profiles case 3: Array array2 = new Array(); array2.printArray(); menuOpt.displayMenu(); break; //Connect two people as friends case 4: //Retrieve and check ages of friends and make friends if OK SetFriends setFriends = new SetFriends(); setFriends.checkAges(); menuOpt.displayMenu(); break; //Are two people friends? case 5: TwoFriends twoFriends = new TwoFriends(); twoFriends.areFriendsFirstPerson(); twoFriends.areFriendsSecondPerson(); menuOpt.displayMenu(); break; //Find out the name(s) of a person's child(ren) case 6: FindChildren find = new FindChildren(); find.findChild(); menuOpt.displayMenu(); break; //Find out the names of a persons parents case 7: /* FindParents par = new FindParents(); par.findParents(); menuOpt.displayMenu(); break; */ //Delete a person's profile case 8: /* DeleteProfile del = new DeleteProfile(); del.deleteProfile(); menuOpt.displayMenu(); break; */ //Exit menu case 9: System.out.println("Exit"); break; //Default case for incorrect entry default: System.out.println("Error: invalid status"); System.exit(1); } } } }
[ "s3688570@student.rmit.edu.au" ]
s3688570@student.rmit.edu.au
de883033d1b3297f46d4919477adf8d014ae3509
d43b1cb3c37a7aed947e7d99d97fdea5f25a24f4
/org.ualerts.fixed/org.ualerts.fixed.web/src/main/java/org/ualerts/fixed/web/validator/FixtureValidatorFactory.java
c16363c370b2c9b5947a070510b00acc1393187b
[ "Apache-2.0" ]
permissive
mukpal/ualerts-server
088dbb6ae6f3faaff69e04dedb6f6bc0b682393c
58e921d9251e548e86e84b8041df17f64e746bc2
refs/heads/master
2020-12-31T06:32:28.561201
2013-10-21T14:42:16
2013-10-21T14:42:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,192
java
/* * File created on Sep 18, 2013 * * Copyright 2008-2013 Virginia Polytechnic Institute and State University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.ualerts.fixed.web.validator; import org.ualerts.fixed.web.validator.fixture.FixtureValidationRule.ActionType; /** * Creates FixtureValidators. * * @author Michael Irwin * @author Brian Early */ public interface FixtureValidatorFactory { /** * Create a validator for the provided action. * @param action The action being executed for which validators are needed * @return A validator configured for the provided action. */ FixtureValidator createValidator(ActionType action); }
[ "mikesir87@gmail.com" ]
mikesir87@gmail.com
413b35d05fdafe5d4d91b0283030a4fc8394d5bf
8228efa27043e0a236ca8003ec0126012e1fdb02
/L2JOptimus_Core/java/net/sf/l2j/gameserver/model/actor/instance/WarehouseKeeper.java
83df09bd3e103c5efcd6ab12d9bb69e36be116fb
[]
no_license
wan202/L2JDeath
9982dfce14ae19a22392955b996b42dc0e8cede6
e0ab026bf46ac82c91bdbd048a0f50dc5213013b
refs/heads/master
2020-12-30T12:35:59.808276
2017-05-16T18:57:25
2017-05-16T18:57:25
91,397,726
0
1
null
null
null
null
UTF-8
Java
false
false
5,580
java
package net.sf.l2j.gameserver.model.actor.instance; import java.util.Map; import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.L2Clan; import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; import net.sf.l2j.gameserver.model.itemcontainer.PcFreight; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.EnchantResult; import net.sf.l2j.gameserver.network.serverpackets.PackageToList; import net.sf.l2j.gameserver.network.serverpackets.WarehouseDepositList; import net.sf.l2j.gameserver.network.serverpackets.WarehouseWithdrawList; public class WarehouseKeeper extends Folk { public WarehouseKeeper(int objectId, NpcTemplate template) { super(objectId, template); } @Override public boolean isWarehouse() { return true; } @Override public String getHtmlPath(int npcId, int val) { String filename = ""; if (val == 0) filename = "" + npcId; else filename = npcId + "-" + val; return "data/html/warehouse/" + filename + ".htm"; } private static void showRetrieveWindow(Player player) { player.ActionF(); player.setActiveWarehouse(player.getWarehouse()); if (player.getActiveWarehouse().getSize() == 0) { player.sendPacket(SystemMessageId.NO_ITEM_DEPOSITED_IN_WH); return; } player.sendPacket(new WarehouseWithdrawList(player, WarehouseWithdrawList.PRIVATE)); } private static void showDepositWindow(Player player) { player.ActionF(); player.setActiveWarehouse(player.getWarehouse()); player.tempInventoryDisable(); player.sendPacket(new WarehouseDepositList(player, WarehouseDepositList.PRIVATE)); } private static void showDepositWindowClan(Player player) { player.ActionF(); if (player.getClan() != null) { if (player.getClan().getLevel() == 0) player.sendPacket(SystemMessageId.ONLY_LEVEL_1_CLAN_OR_HIGHER_CAN_USE_WAREHOUSE); else { player.setActiveWarehouse(player.getClan().getWarehouse()); player.tempInventoryDisable(); player.sendPacket(new WarehouseDepositList(player, WarehouseDepositList.CLAN)); } } } private static void showWithdrawWindowClan(Player player) { player.ActionF(); if ((player.getClanPrivileges() & L2Clan.CP_CL_VIEW_WAREHOUSE) != L2Clan.CP_CL_VIEW_WAREHOUSE) { player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_THE_RIGHT_TO_USE_CLAN_WAREHOUSE); return; } if (player.getClan().getLevel() == 0) player.sendPacket(SystemMessageId.ONLY_LEVEL_1_CLAN_OR_HIGHER_CAN_USE_WAREHOUSE); else { player.setActiveWarehouse(player.getClan().getWarehouse()); player.sendPacket(new WarehouseWithdrawList(player, WarehouseWithdrawList.CLAN)); } } private void showWithdrawWindowFreight(Player player) { player.ActionF(); PcFreight freight = player.getFreight(); if (freight != null) { if (freight.getSize() > 0) { if (Config.ALT_GAME_FREIGHTS) freight.setActiveLocation(0); else freight.setActiveLocation(getRegion().hashCode()); player.setActiveWarehouse(freight); player.sendPacket(new WarehouseWithdrawList(player, WarehouseWithdrawList.FREIGHT)); } else player.sendPacket(SystemMessageId.NO_ITEM_DEPOSITED_IN_WH); } } private static void showDepositWindowFreight(Player player) { // No other chars in the account of this player if (player.getAccountChars().isEmpty()) player.sendPacket(SystemMessageId.CHARACTER_DOES_NOT_EXIST); // One or more chars other than this player for this account else { Map<Integer, String> chars = player.getAccountChars(); if (chars.size() < 1) { player.ActionF(); return; } player.sendPacket(new PackageToList(chars)); } } private void showDepositWindowFreight(Player player, int obj_Id) { player.ActionF(); PcFreight freight = player.getDepositedFreight(obj_Id); if (Config.ALT_GAME_FREIGHTS) freight.setActiveLocation(0); else freight.setActiveLocation(getRegion().hashCode()); player.setActiveWarehouse(freight); player.tempInventoryDisable(); player.sendPacket(new WarehouseDepositList(player, WarehouseDepositList.FREIGHT)); } @Override public void onBypassFeedback(Player player, String command) { if (player.isProcessingTransaction()) { player.sendPacket(SystemMessageId.ALREADY_TRADING); return; } if (player.getActiveEnchantItem() != null) { player.setActiveEnchantItem(null); player.sendPacket(EnchantResult.CANCELLED); player.sendPacket(SystemMessageId.ENCHANT_SCROLL_CANCELLED); } if (command.startsWith("WithdrawP")) showRetrieveWindow(player); else if (command.equals("DepositP")) showDepositWindow(player); else if (command.equals("WithdrawC")) showWithdrawWindowClan(player); else if (command.equals("DepositC")) showDepositWindowClan(player); else if (command.startsWith("WithdrawF")) { if (Config.ALLOW_FREIGHT) showWithdrawWindowFreight(player); } else if (command.startsWith("DepositF")) { if (Config.ALLOW_FREIGHT) showDepositWindowFreight(player); } else if (command.startsWith("FreightChar")) { if (Config.ALLOW_FREIGHT) { int startOfId = command.lastIndexOf("_") + 1; String id = command.substring(startOfId); showDepositWindowFreight(player, Integer.parseInt(id)); } } else super.onBypassFeedback(player, command); } }
[ "wande@DESKTOP-DM71DUV" ]
wande@DESKTOP-DM71DUV
c318128581c5e974db12b3725a442275d7809df2
48d96806bea6d5c4e4bd4ba9bd94efab04a2fc52
/app/src/main/java/com/example/comicvine/data/model/model_series/LastEpisode.java
26957a108f954f656ac932ba4a0236e09a6939c7
[]
no_license
dejancdevelopment/Comic_Vine
18137cbfe3fc57686e3c9c720052528855c550f6
c1ae2bb8bc4135ed753b973ec968f821642b45f4
refs/heads/master
2020-11-29T23:55:26.828934
2020-02-22T11:44:48
2020-02-22T11:44:48
230,244,701
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package com.example.comicvine.data.model.model_series; public class LastEpisode { private String api_detail_url; private int id; private String name; public LastEpisode(String api_detail_url, int id, String name) { this.api_detail_url = api_detail_url; this.id = id; this.name = name; } public String getApi_detail_url() { return api_detail_url; } public int getId() { return id; } public String getName() { return name; } }
[ "figaroakomoze86@gmail.com" ]
figaroakomoze86@gmail.com
76a5431d6251e557f9aad1422f11ec9169633319
40dcb143396b5947275e656092acf421bee46578
/ring-common/src/main/java/com/ring/common/transaction/TransactionManager.java
734c80909819b44eeef0c7dd0aa617bde65ad9be
[]
no_license
chaoshibin/RING
ccf41d7ce68d7d29a171135e731881f58147ae11
bd53856e2dd49a854c5e05474ed4aad175c40737
refs/heads/master
2022-10-25T12:16:53.546910
2019-12-03T13:37:04
2019-12-03T13:37:04
121,110,262
4
1
null
2022-10-12T20:09:43
2018-02-11T10:05:10
JavaScript
UTF-8
Java
false
false
492
java
package com.ring.common.transaction; /** * Copyright (C), 2019-2019, 深圳市xxx科技有限公司 * * @author: chaoshibin * Date: 2019/1/25 11:40 * Description: */ public class TransactionManager { public Transaction begin(){ //TODO 创建事务 //TODO 事务持久化 //TODO 向线程变量注册事务 //ResourceCoordinator 资源协调器 return null; } public void commit(){ } public void rollback(){ } }
[ "hyn12345678" ]
hyn12345678
133930795f0587443a31ff1864b6f6d42cc67f90
785ceb349755508362c679d1612aa3ac4dc90abe
/projects/asw-890-kubernetes/l-sentence-kube-dockerhub/sentence-service/src/main/java/asw/sentence/sentenceservice/wordservice/WordClientLoadBalancedWebClient.java
21675864a1d47fcf31b6d0b845f797f95fa72f58
[ "MIT" ]
permissive
francesco-di-marcantonio/asw-2021
e3ca7c7f6626d470e727d0f480283caf4bdacb8c
5f67a40159bb765e2b2cf8e3cca493156982dfbc
refs/heads/master
2023-05-30T20:47:36.542467
2021-06-01T07:43:35
2021-06-01T07:43:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,081
java
package asw.sentence.sentenceservice.wordservice; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Primary; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClientException; import reactor.core.publisher.Mono; @Service // @Primary public class WordClientLoadBalancedWebClient implements WordClient { @Autowired @Qualifier("loadBalancedWebClient") private WebClient webClient; public String getWord(String service) { String word = null; String serviceUri = "http://" + service; Mono<String> response = webClient .get() .uri(serviceUri) .retrieve() .bodyToMono(String.class); try { word = response.block(); } catch (WebClientException e) { /* eccezione remota */ word = "***"; } return word; } }
[ "luca.cabibbo@uniroma3.it" ]
luca.cabibbo@uniroma3.it
756bc3c336a449af2725188709d0d192d0b18b73
033f656b9f7d5f79a49a0d080e27439d4b69ea9f
/src/test/java/GitPractice/StepDefinitionsPackage/HomePageSteps.java
6c919169e61e079ba0f0b3c0b4f5d639f6b9b999
[]
no_license
ketankumar1979/StudentGitDemo
7a42152b7285f911aec0c3a002a4b2a4e48df28f
6e1e706951b42e750e78051cf58e49c9b249a34f
refs/heads/master
2023-03-17T15:31:15.720736
2021-03-06T14:40:49
2021-03-06T14:40:49
264,311,850
0
0
null
2021-03-06T14:40:50
2020-05-15T22:28:12
Java
UTF-8
Java
false
false
754
java
package GitPractice.StepDefinitionsPackage; import GitPractice.PageObjectPackage.HomePage; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; public class HomePageSteps { HomePage homePage = new HomePage(); @Given("^user is on the home page to search for the product$") public void userIsOnTheHomePageToSearchForTheProduct() { homePage.getHomePageUrl(); } @When("^user type 'nike' to search for product$") public void userTypeNikeToSearchForProduct() { homePage.dosearch("nike"); } @Then("^user should able to see all the nike products$") public void userShouldAbleToSeeAllTheNikeProducts() { homePage.getResultPageHeader(); } }
[ "ketanicengg@yahoo.com" ]
ketanicengg@yahoo.com
6cfcac68e0d8f1cf2bcd9bb3ad52b1fc55065f2f
7c869884d0b6704254f4ead5d34ddadb694edc98
/src/main/java/pattern/singleton/Singleton.java
ab478ddfdff0836e256bc4c13037658822763bfb
[]
no_license
dziarmagam/zad2abstract
15957e11f245f2480c1994636157d43d1ed6db04
d3c561c0a35a819b03cdc0144760f5b00a98a22c
refs/heads/master
2020-03-15T15:59:12.579128
2018-05-05T13:43:54
2018-05-05T13:43:54
132,225,643
0
3
null
null
null
null
UTF-8
Java
false
false
343
java
package pattern.singleton; public final class Singleton { private static final Singleton INSTANCE; static { INSTANCE = new Singleton("Sth"); } public final String port; private Singleton(String port){ this.port = port; } public static Singleton getInstance(){ return INSTANCE; } }
[ "165393@edu.p.lodz.pl" ]
165393@edu.p.lodz.pl
33a2690cdd6ff5b23fc788db667cddeef3fbe5af
73b6641795cf9cc595b70438186cb067a1fe09b6
/app/src/main/java/joaozao/sourcedev/com/retrospective/inductions/InductionsFragment.java
86762ef49c441aa30696dcbf5481d39d922deebf
[]
no_license
joaobzao/Retrospective
8e09f8fa0b7231b07b9ce21ba58755ecb7ca786c
38d73813d5b0194080e9e7d672af069d7b2eaea6
refs/heads/master
2021-08-30T07:56:24.462858
2017-12-16T22:11:16
2017-12-16T22:11:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,901
java
package joaozao.sourcedev.com.retrospective.inductions; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import dagger.android.support.DaggerFragment; import joaozao.sourcedev.com.retrospective.R; import joaozao.sourcedev.com.retrospective.data.Induction; public class InductionsFragment extends DaggerFragment implements InductionsContract.View { public static final String TAG = "TAG_INDUCTIONS_FRAGMENT"; @Inject InductionsContract.Presenter mPresenter; @BindView(R.id.recycler_view) RecyclerView inductionsRecyclerView; private InductionsAdapter inductionsAdapter; @Inject public InductionsFragment() { // Requires empty public constructor } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); inductionsAdapter = new InductionsAdapter(getContext(), new ArrayList<>(0)); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.inductions_fragment, container, false); ButterKnife.bind(this, root); // use this setting to improve performance if you know that changes // in content do not change the layout size of the RecyclerView inductionsRecyclerView.setHasFixedSize(true); // use a linear layout manager RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext()); inductionsRecyclerView.setLayoutManager(layoutManager); inductionsRecyclerView.setAdapter(inductionsAdapter); return root; } @Override public void onResume() { super.onResume(); mPresenter.takeView(this); } @Override public void onDestroy() { super.onDestroy(); mPresenter.dropView(); //prevent leaking activity in // case presenter is orchestrating a long running task } @Override public boolean isActive() { return isAdded(); } @Override public void setLoadingIndicator(boolean active) { } @Override public void showInductions(List<Induction> inductions) { getActivity().runOnUiThread(() -> inductionsAdapter.replaceData(inductions)); } @Override public void showNoInductions() { Toast.makeText(getContext(), "No inductions to show!", Toast.LENGTH_SHORT).show(); } }
[ "joao.zao@blip.pt" ]
joao.zao@blip.pt
d8d594c99a0a8f6f69b5bb6e5a3d98bbea3ee2ca
26852514163127783354dc42402b1d2564694695
/YoYo-Server/YoYo-Item-Server/src/main/java/com/cnit/yoyo/rmi/activity/service/ActivityRulesService.java
5a29348bd49c92142f2298445094654c436924f7
[]
no_license
magicgis/cnit
2a2a35c1c7f1bb3c8c28c4d75f035343f5ff0c9f
122323f848cb39cfc0d4a94f7ddc395cee0b2dfa
refs/heads/master
2020-12-27T09:35:00.010392
2015-10-28T06:11:42
2015-10-28T06:11:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,184
java
package com.cnit.yoyo.rmi.activity.service; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import net.sf.json.JSONObject; import net.sf.json.JsonConfig; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.cnit.yoyo.constant.ErrorCode; import com.cnit.yoyo.dao.activity.ActivityFullReduceGoodsShipMapper; import com.cnit.yoyo.dao.activity.ActivityFullReduceMapper; import com.cnit.yoyo.dao.activity.ActivityRulesMapper; import com.cnit.yoyo.dao.activity.CouponsApplyBrandMapper; import com.cnit.yoyo.dao.activity.CouponsMapper; import com.cnit.yoyo.dao.activity.CouponsPicShipMapper; import com.cnit.yoyo.dao.activity.SalesRuleGoodsMapper; import com.cnit.yoyo.domain.HeadObject; import com.cnit.yoyo.domain.ResultObject; import com.cnit.yoyo.exception.BusinessException; import com.cnit.yoyo.model.activity.ActivityFullReduce; import com.cnit.yoyo.model.activity.ActivityFullReduceGoodsShip; import com.cnit.yoyo.model.activity.ActivityRules; import com.cnit.yoyo.model.activity.Coupons; import com.cnit.yoyo.model.activity.CouponsApplyBrand; import com.cnit.yoyo.model.activity.CouponsExample; import com.cnit.yoyo.model.activity.CouponsPicShip; import com.cnit.yoyo.model.activity.SalesRuleGoodsWithBLOBs; import com.cnit.yoyo.model.activity.dto.CouponsApplyBrandDTO; import com.cnit.yoyo.model.activity.dto.CouponsDTO; import com.cnit.yoyo.model.activity.dto.FullReduceDTO; import com.cnit.yoyo.model.member.dto.RolesDTO; import com.cnit.yoyo.util.JsonDateValueProcessor; import com.cnit.yoyo.util.domain.ResultPage; import com.github.pagehelper.PageHelper; /** * * @Description: 满减活动 */ @Service("activityRulesService") public class ActivityRulesService { public static final Logger log = LoggerFactory.getLogger(ActivityRulesService.class); @Autowired private ActivityRulesMapper activityRulesMapper; @Autowired private ActivityFullReduceMapper activityFullReduceMapper; @Autowired private ActivityFullReduceGoodsShipMapper activityFullReduceGoodsShipMapper; /** * *@description 获取活动数据,带分页 *@detail <方法详细描述> *@param data *@return */ public Object findFullReduceListPage(Object data){ HeadObject head = new HeadObject(); ResultPage<FullReduceDTO> page = null; JSONObject json = null; try{ JSONObject content = JSONObject.fromObject(data); FullReduceDTO dto = (FullReduceDTO) JSONObject.toBean(content,FullReduceDTO.class); PageHelper.startPage(content.optInt("pageIndex"), content.optInt("pageSize")); page = new ResultPage<FullReduceDTO>(this.activityFullReduceMapper.selectFullReduceList(dto)); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); json = JSONObject.fromObject(page,jsonConfig); head.setRetCode(ErrorCode.SUCCESS); }catch(Exception e){ e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); } return new ResultObject(head, json); } /** * *@description 获取活动数据,带分页 *@detail <方法详细描述> *@param data *@return */ public Object findFullDiscountListPage(Object data){ HeadObject head = new HeadObject(); ResultPage<FullReduceDTO> page = null; JSONObject json = null; try{ JSONObject content = JSONObject.fromObject(data); PageHelper.startPage(content.optInt("pageIndex"), content.optInt("pageSize")); page = new ResultPage<FullReduceDTO>(this.activityFullReduceMapper.selectFullDiscountList()); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); json = JSONObject.fromObject(page,jsonConfig); head.setRetCode(ErrorCode.SUCCESS); }catch(Exception e){ e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); } return new ResultObject(head, json); } /** * 获取编辑的数据 * @param data * @return */ public Object editFullReduce(Object data){ HeadObject head = new HeadObject(); FullReduceDTO fullReduce = null; JSONObject json = null; try{ long actId = (Long)data; fullReduce = this.activityFullReduceMapper.selectFullReduceListById(actId); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); json = JSONObject.fromObject(fullReduce,jsonConfig); head.setRetCode(ErrorCode.SUCCESS); }catch(Exception e){ e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); } return new ResultObject(head, json); } /** * 根据活动ID获取关联的商品ID * @param data * @return */ public Object getGoodsIdsByActId(Object data) { HeadObject head = new HeadObject(); List<Integer> goodsIds = null; try{ long actId = (Long)data; goodsIds = this.activityFullReduceGoodsShipMapper.selectByActId(actId); head.setRetCode(ErrorCode.SUCCESS); }catch(Exception e){ e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); } return new ResultObject(head, goodsIds); } /** * * @Description:保存活动 */ public Object saveActivity(Object data) throws BusinessException { HeadObject head = new HeadObject(); try { JSONObject content = JSONObject.fromObject(data); FullReduceDTO dto = (FullReduceDTO) JSONObject.toBean(content,FullReduceDTO.class); //1.先添加商品规则 ActivityRules rule = new ActivityRules(); rule.setRuleName(dto.getName()); rule.setConditions(dto.getConditions()); rule.setCreateTime(new Date()); activityRulesMapper.insertSelective(rule); ActivityFullReduce activity = new ActivityFullReduce(); activity.setName(dto.getName()); activity.setRuleId(rule.getRuleId()); activity.setCompanyId(dto.getCompanyId()); activity.setStoreId(dto.getStoreId()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date fromDate = sdf.parse(dto.getFromTimeStr()); Date toDate = sdf.parse(dto.getToTimeStr()); activity.setStartTime(fromDate); activity.setEndTime(toDate); activity.setIssueType("1"); activity.setJoinTimes(dto.getJoinTimes()); activity.setUsePlatform(dto.getUsePlatform()); activity.setMemberLvIds(dto.getMemberLvIds()); activity.setActivityType(dto.getActivityType()); activityFullReduceMapper.insertSelective(activity); int[] goodsIds = dto.getGoodsId(); for(int i=0;i<goodsIds.length;i++) { int goodsId = goodsIds[i]; ActivityFullReduceGoodsShip ship = new ActivityFullReduceGoodsShip(); ship.setActId(activity.getActId()); ship.setGoodsId(goodsId); activityFullReduceGoodsShipMapper.insertSelective(ship); } head.setRetCode(ErrorCode.SUCCESS); } catch (Exception e) { e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); throw new BusinessException(ErrorCode.SPE001); } return new ResultObject(head); } /** * * @Description:更新活动 */ public Object updateActivity(Object data) throws BusinessException { HeadObject head = new HeadObject(); try { JSONObject content = JSONObject.fromObject(data); FullReduceDTO dto = (FullReduceDTO) JSONObject.toBean(content,FullReduceDTO.class); //1.先添加商品规则 ActivityRules rule = new ActivityRules(); rule.setRuleId(dto.getRuleId()); rule.setRuleName(dto.getName()); rule.setConditions(dto.getConditions()); activityRulesMapper.updateByPrimaryKeySelective(rule); ActivityFullReduce activity = new ActivityFullReduce(); activity.setActId(dto.getActId()); activity.setName(dto.getName()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date fromDate = sdf.parse(dto.getFromTimeStr()); Date toDate = sdf.parse(dto.getToTimeStr()); activity.setStartTime(fromDate); activity.setEndTime(toDate); activity.setJoinTimes(dto.getJoinTimes()); activity.setUsePlatform(dto.getUsePlatform()); activity.setMemberLvIds(dto.getMemberLvIds()); activity.setActivityType(dto.getActivityType()); activityFullReduceMapper.updateByPrimaryKeySelective(activity); activityFullReduceGoodsShipMapper.deleteByActId(activity.getActId()); int[] goodsIds = dto.getGoodsId(); for(int i=0;i<goodsIds.length;i++) { int goodsId = goodsIds[i]; ActivityFullReduceGoodsShip ship = new ActivityFullReduceGoodsShip(); ship.setActId(activity.getActId()); ship.setGoodsId(goodsId); activityFullReduceGoodsShipMapper.insertSelective(ship); } head.setRetCode(ErrorCode.SUCCESS); } catch (Exception e) { e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); throw new BusinessException(ErrorCode.SPE001); } return new ResultObject(head); } /** * * @Description:删除活动 */ public Object deleteActivity(Object data) throws BusinessException { HeadObject head = new HeadObject(); try { JSONObject content = JSONObject.fromObject(data); int ruleId = content.optInt("ruleId"); long actId = content.optLong("actId"); //1.先删除商品规则 activityRulesMapper.deleteByPrimaryKey(ruleId); activityFullReduceGoodsShipMapper.deleteByActId(actId); activityFullReduceMapper.deleteByPrimaryKey(actId); head.setRetCode(ErrorCode.SUCCESS); } catch (Exception e) { e.printStackTrace(); head.setRetCode(ErrorCode.FAILURE); throw new BusinessException(ErrorCode.SPE001); } return new ResultObject(head); } }
[ "heaven6059@126.com" ]
heaven6059@126.com
a5dfd4c06bb372acc02d10d9e066c262a3590e20
5b9a033b2385f3328767399cce0477d36e374cfd
/library/src/main/java/cn/evergrand/it/bluetooth/connect/response/BleNotifyResponse.java
e9abb23d3c0898f8f5e5903f6931ee442cad46ae
[ "Apache-2.0" ]
permissive
AtWsh/BlueToothUtils
51dc1f91fc59f6cb9f00d201ea42c754df68e770
9cbde2f49d529f0b0710a784993c09f982f2584a
refs/heads/master
2020-03-23T12:12:17.114606
2018-07-20T02:58:07
2018-07-20T02:58:07
141,543,573
0
0
null
null
null
null
UTF-8
Java
false
false
908
java
package cn.evergrand.it.bluetooth.connect.response; import java.util.UUID; import cn.evergrand.it.bluetooth.encry.IBlueToothDecrypt; import cn.evergrand.it.bluetooth.utils.DataUtils; public abstract class BleNotifyResponse implements BleResponse { private boolean mNeedParseAndPacking = true; private IBlueToothDecrypt mIBlueToothDecrypt; public BleNotifyResponse(boolean needParseAndPacking) { mNeedParseAndPacking = needParseAndPacking; } public void setBlueToothDecrypt(IBlueToothDecrypt blueToothDecrypt) { this.mIBlueToothDecrypt = blueToothDecrypt; } public void onRealResponse(UUID service, UUID character, byte[] value) { byte[] data = DataUtils.parseData(mNeedParseAndPacking, value, mIBlueToothDecrypt); onNotify(service, character, data); } public abstract void onNotify(UUID service, UUID character, byte[] value); }
[ "790962797@qq.com" ]
790962797@qq.com
c477cc4fa44e6a363f9a0f1950a13f4d927503a2
fc50e71bb290794f7c4789a6a3581c65e50010a4
/src/main/java/ru/hackaton/logistic/repository/RouteRepository.java
0d8a72821c12b12a259aa523b0c6776efe347177
[]
no_license
aP0StAl/hackaton_logistic
cad994cfffea36e786a6cc8a527a9edddb16be39
a5cc5fc6366db5aa1de664c36ed21384c5f6b9ca
refs/heads/master
2020-06-08T09:44:40.564991
2019-06-23T18:44:19
2019-06-23T18:44:19
193,207,937
5
0
null
null
null
null
UTF-8
Java
false
false
298
java
package ru.hackaton.logistic.repository; import org.springframework.data.jpa.repository.JpaRepository; import ru.hackaton.logistic.domain.Route; import java.util.ArrayList; public interface RouteRepository extends JpaRepository<Route, Long> { ArrayList<Route> findAllByIsOpen(Boolean is); }
[ "vladnosiv@gmail.com" ]
vladnosiv@gmail.com
c9aa78c1a5c3923239936caf59b770e75f36b3c5
e77ccf6e3a9cb06ab9a0736b2d7a77686867885f
/java/com/examples/routeguide/client/RouteGuideClient.java
33d3fc378db26205ea2afd7959e8f91d5fcce4bd
[]
no_license
borg286/better_minig
f856cd1b97e6a4cfa11c8cfa4ff04750df9881f2
04d22b1e0a4273cfee5483e89e2ecd6e8a9b8797
refs/heads/master
2023-07-23T14:58:50.840148
2023-07-05T20:54:53
2023-07-05T20:54:53
138,411,427
4
1
null
2023-07-05T20:51:28
2018-06-23T15:16:58
Java
UTF-8
Java
false
false
11,143
java
/* * Copyright 2015 The gRPC 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 io.grpc.examples.routeguide; import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.Message; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.examples.routeguide.RouteGuideGrpc.RouteGuideBlockingStub; import io.grpc.examples.routeguide.RouteGuideGrpc.RouteGuideStub; import io.grpc.stub.StreamObserver; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Random; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; /** * Sample client code that makes gRPC calls to the server. */ public class RouteGuideClient { private static final Logger logger = Logger.getLogger(RouteGuideClient.class.getName()); private final ManagedChannel channel; private final RouteGuideBlockingStub blockingStub; private final RouteGuideStub asyncStub; private Random random = new Random(); private TestHelper testHelper; /** Construct client for accessing RouteGuide server at {@code host:port}. */ public RouteGuideClient(String host, int port) { this(ManagedChannelBuilder.forAddress(host, port).usePlaintext()); } /** Construct client for accessing RouteGuide server using the existing channel. */ public RouteGuideClient(ManagedChannelBuilder<?> channelBuilder) { channel = channelBuilder.build(); blockingStub = RouteGuideGrpc.newBlockingStub(channel); asyncStub = RouteGuideGrpc.newStub(channel); } public void shutdown() throws InterruptedException { channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); } /** * Blocking unary call example. Calls getFeature and prints the response. */ public void getFeature(int lat, int lon) { info("*** GetFeature: lat={0} lon={1}", lat, lon); Point request = Point.newBuilder().setLatitude(lat).setLongitude(lon).build(); Feature feature; try { feature = blockingStub.getFeature(request); if (testHelper != null) { testHelper.onMessage(feature); } } catch (StatusRuntimeException e) { warning("RPC failed: {0}", e.getStatus()); if (testHelper != null) { testHelper.onRpcError(e); } return; } if (RouteGuideUtil.exists(feature)) { info("Found feature called \"{0}\" at {1}, {2}", feature.getName(), RouteGuideUtil.getLatitude(feature.getLocation()), RouteGuideUtil.getLongitude(feature.getLocation())); } else { info("Found no feature at {0}, {1}", RouteGuideUtil.getLatitude(feature.getLocation()), RouteGuideUtil.getLongitude(feature.getLocation())); } } /** * Blocking server-streaming example. Calls listFeatures with a rectangle of interest. Prints each * response feature as it arrives. */ public void listFeatures(int lowLat, int lowLon, int hiLat, int hiLon) { info("*** ListFeatures: lowLat={0} lowLon={1} hiLat={2} hiLon={3}", lowLat, lowLon, hiLat, hiLon); Rectangle request = Rectangle.newBuilder() .setLo(Point.newBuilder().setLatitude(lowLat).setLongitude(lowLon).build()) .setHi(Point.newBuilder().setLatitude(hiLat).setLongitude(hiLon).build()).build(); Iterator<Feature> features; try { features = blockingStub.listFeatures(request); for (int i = 1; features.hasNext(); i++) { Feature feature = features.next(); info("Result #" + i + ": {0}", feature); if (testHelper != null) { testHelper.onMessage(feature); } } } catch (StatusRuntimeException e) { warning("RPC failed: {0}", e.getStatus()); if (testHelper != null) { testHelper.onRpcError(e); } } } /** * Async client-streaming example. Sends {@code numPoints} randomly chosen points from {@code * features} with a variable delay in between. Prints the statistics when they are sent from the * server. */ public void recordRoute(List<Feature> features, int numPoints) throws InterruptedException { info("*** RecordRoute"); final CountDownLatch finishLatch = new CountDownLatch(1); StreamObserver<RouteSummary> responseObserver = new StreamObserver<RouteSummary>() { @Override public void onNext(RouteSummary summary) { info("Finished trip with {0} points. Passed {1} features. " + "Travelled {2} meters. It took {3} seconds.", summary.getPointCount(), summary.getFeatureCount(), summary.getDistance(), summary.getElapsedTime()); if (testHelper != null) { testHelper.onMessage(summary); } } @Override public void onError(Throwable t) { warning("RecordRoute Failed: {0}", Status.fromThrowable(t)); if (testHelper != null) { testHelper.onRpcError(t); } finishLatch.countDown(); } @Override public void onCompleted() { info("Finished RecordRoute"); finishLatch.countDown(); } }; StreamObserver<Point> requestObserver = asyncStub.recordRoute(responseObserver); try { // Send numPoints points randomly selected from the features list. for (int i = 0; i < numPoints; ++i) { int index = random.nextInt(features.size()); Point point = features.get(index).getLocation(); info("Visiting point {0}, {1}", RouteGuideUtil.getLatitude(point), RouteGuideUtil.getLongitude(point)); requestObserver.onNext(point); // Sleep for a bit before sending the next one. Thread.sleep(random.nextInt(1000) + 500); if (finishLatch.getCount() == 0) { // RPC completed or errored before we finished sending. // Sending further requests won't error, but they will just be thrown away. return; } } } catch (RuntimeException e) { // Cancel RPC requestObserver.onError(e); throw e; } // Mark the end of requests requestObserver.onCompleted(); // Receiving happens asynchronously if (!finishLatch.await(1, TimeUnit.MINUTES)) { warning("recordRoute can not finish within 1 minutes"); } } /** * Bi-directional example, which can only be asynchronous. Send some chat messages, and print any * chat messages that are sent from the server. */ public CountDownLatch routeChat() { info("*** RouteChat"); final CountDownLatch finishLatch = new CountDownLatch(1); StreamObserver<RouteNote> requestObserver = asyncStub.routeChat(new StreamObserver<RouteNote>() { @Override public void onNext(RouteNote note) { info("Got message \"{0}\" at {1}, {2}", note.getMessage(), note.getLocation() .getLatitude(), note.getLocation().getLongitude()); if (testHelper != null) { testHelper.onMessage(note); } } @Override public void onError(Throwable t) { warning("RouteChat Failed: {0}", Status.fromThrowable(t)); if (testHelper != null) { testHelper.onRpcError(t); } finishLatch.countDown(); } @Override public void onCompleted() { info("Finished RouteChat"); finishLatch.countDown(); } }); try { RouteNote[] requests = {newNote("First message", 0, 0), newNote("Second message", 0, 1), newNote("Third message", 1, 0), newNote("Fourth message", 1, 1)}; for (RouteNote request : requests) { info("Sending message \"{0}\" at {1}, {2}", request.getMessage(), request.getLocation() .getLatitude(), request.getLocation().getLongitude()); requestObserver.onNext(request); } } catch (RuntimeException e) { // Cancel RPC System.out.println("I got an error"); requestObserver.onError(e); throw e; } // Mark the end of requests requestObserver.onCompleted(); // return the latch while receiving happens asynchronously return finishLatch; } /** Issues several different requests and then exits. */ public static void main(String[] args) throws InterruptedException { List<Feature> features; try { features = RouteGuideUtil.parseFeatures(RouteGuideUtil.getDefaultFeaturesFile()); } catch (IOException ex) { ex.printStackTrace(); System.exit(1); return; } String hostname = "localhost"; int port = 50052; if (args.length >= 2) { hostname = args[0]; port = Integer.parseInt(args[1]); } RouteGuideClient client = new RouteGuideClient(hostname, port); try { // Looking for a valid feature client.getFeature(409146138, -746188906); // Feature missing. client.getFeature(0, 0); // Looking for features between 40, -75 and 42, -73. client.listFeatures(400000000, -750000000, 420000000, -730000000); // Record a few randomly selected points from the features file. client.recordRoute(features, 10); // Send and receive some notes. CountDownLatch finishLatch = client.routeChat(); if (!finishLatch.await(1, TimeUnit.MINUTES)) { client.warning("routeChat can not finish within 1 minutes"); } } finally { client.shutdown(); } } private void info(String msg, Object... params) { logger.log(Level.INFO, msg, params); } private void warning(String msg, Object... params) { logger.log(Level.WARNING, msg, params); } private RouteNote newNote(String message, int lat, int lon) { return RouteNote.newBuilder().setMessage(message) .setLocation(Point.newBuilder().setLatitude(lat).setLongitude(lon).build()).build(); } /** * Only used for unit test, as we do not want to introduce randomness in unit test. */ @VisibleForTesting void setRandom(Random random) { this.random = random; } /** * Only used for helping unit test. */ @VisibleForTesting interface TestHelper { /** * Used for verify/inspect message received from server. */ void onMessage(Message message); /** * Used for verify/inspect error received from server. */ void onRpcError(Throwable exception); } @VisibleForTesting void setTestHelper(TestHelper testHelper) { this.testHelper = testHelper; } }
[ "borg286@gmail.com" ]
borg286@gmail.com
954bb31af9fd219e36712e3cb5e87ca922513ec9
e047870136e1958ce80dad88fa931304ada49a1b
/eu.cessar.ct.compat/src/eu/cessar/ct/compat/internal/ctproxy/wrap/SingleEREFValueFeatureWrapper.java
59dd3dd0fd04485a52c74a3cb68938c358cc1112
[]
no_license
ONagaty/SEA-ModellAR
f4994a628459a20b9be7af95d41d5e0ff8a21f77
a0f6bdbb072503ea584d72f872f29a20ea98ade5
refs/heads/main
2023-06-04T07:07:02.900503
2021-06-19T20:54:47
2021-06-19T20:54:47
376,735,297
0
0
null
null
null
null
UTF-8
Java
false
false
4,843
java
/** * <copyright> * * Copyright (c) Continental Engineering Services and others. * http://www.conti-engineering.com All rights reserved. * * </copyright> */ package eu.cessar.ct.compat.internal.ctproxy.wrap; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import eu.cessar.ct.compat.internal.ctproxy.CTProxyUtils; import eu.cessar.ct.compat.sdk.IEREF; import eu.cessar.ct.core.mms.MetaModelUtils; import eu.cessar.ct.emfproxy.IEMFProxyEngine; import eu.cessar.ct.emfproxy.ISingleMasterFeatureWrapper; import eu.cessar.ct.runtime.ecuc.pmproxy.wrap.AbstractMasterFeatureWrapper; /** * @author uidl7321 * @Review uidl7321 - Apr 11, 2012 */ public class SingleEREFValueFeatureWrapper extends AbstractMasterFeatureWrapper<String> implements ISingleMasterFeatureWrapper<String> { private EObject masterReferredObject; private EObject masterReferringObject; private EReference masterReference; /** * @param engine * @param masterReference * @param masterReferringObject * @param master2 */ public SingleEREFValueFeatureWrapper(IEMFProxyEngine engine, EObject masterReferredObject, EObject masterReferringObject, EReference masterReference) { super(engine); this.masterReferredObject = masterReferredObject; this.masterReferringObject = masterReferringObject; this.masterReference = masterReference; } /* (non-Javadoc) * @see eu.cessar.ct.emfproxy.IMasterFeatureWrapper#getFeatureClass() */ public Class<String> getFeatureClass() { return String.class; } /* (non-Javadoc) * @see eu.cessar.ct.emfproxy.ISingleMasterFeatureWrapper#getValue() */ public String getValue() { if (masterReferredObject != null) { return MetaModelUtils.getAbsoluteQualifiedName(masterReferredObject); } return null; } /* (non-Javadoc) * @see eu.cessar.ct.emfproxy.ISingleMasterFeatureWrapper#setValue(java.lang.Object) */ @SuppressWarnings("unchecked") public void setValue(final Object newValue) { if (newValue != null) { // check to see if the newValue is the same with the one // already set if (masterReferredObject == null || !MetaModelUtils.getAbsoluteQualifiedName(masterReferredObject).equals(newValue)) { final EObject newMasterReferredObject = CTProxyUtils.getRealOrProxyObject( engine.getProject(), (String) newValue, ((IEREF) getProxyObject()).getDest(), (masterReference != null) ? masterReference.getEReferenceType() : null); if (masterReferringObject != null && masterReference != null) { // set the new value if (masterReference.isMany()) { final EList<EObject> masterReferredObjects = (EList<EObject>) masterReferringObject.eGet(masterReference); if (masterReferredObject != null) { // replace old value with the new one final int index = masterReferredObjects.indexOf(masterReferredObject); updateModel(new Runnable() { public void run() { masterReferredObject = newMasterReferredObject; masterReferredObjects.set(index, newMasterReferredObject); } }); } else { masterReferredObject = newMasterReferredObject; } } else { updateModel(new Runnable() { public void run() { masterReferredObject = newMasterReferredObject; masterReferringObject.eSet(masterReference, newMasterReferredObject); } }); } } else { masterReferredObject = newMasterReferredObject; } } } else { unsetValue(); } // engine.updateSlaveFeature(this); } /* (non-Javadoc) * @see eu.cessar.ct.emfproxy.ISingleMasterFeatureWrapper#isSetValue() */ public boolean isSetValue() { return masterReferredObject != null; } /* (non-Javadoc) * @see eu.cessar.ct.emfproxy.ISingleMasterFeatureWrapper#unsetValue() */ @SuppressWarnings("unchecked") public void unsetValue() { // set the new value if (masterReference.isMany()) { final EList<EObject> masterReferredObjects = (EList<EObject>) masterReferringObject.eGet(masterReference); if (masterReferredObject != null) { // remove old value with the new one final int index = masterReferredObjects.indexOf(masterReferredObject); updateModel(new Runnable() { public void run() { masterReferredObjects.remove(index); } }); } } else { updateModel(new Runnable() { public void run() { masterReferringObject.eUnset(masterReference); } }); } masterReferredObject = null; // engine.updateSlaveFeature(this); } /* (non-Javadoc) * @see eu.cessar.ct.emfproxy.IMasterFeatureWrapper#getHashCode() */ public int getHashCode() { throw new UnsupportedOperationException(); } }
[ "onagaty@a5sol.com" ]
onagaty@a5sol.com
c5764178933a93d92109f66557c5133868bafead
2f7654be7706239fb427370cb1fabf685a173035
/src/main/java/kr/ac/jejun/repository/PostDao.java
940d813dac516e4d4cab86d2a05b60f2b2558a0d
[]
no_license
amtech/springReportBoard
8beda9da7c1eacefbb4ddce7481352c3ac904759
f1874e3b3be30eb223226f509dc414186e72b595
refs/heads/master
2023-03-17T02:59:29.480252
2017-08-01T23:22:53
2017-08-01T23:22:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package kr.ac.jejun.repository; import kr.ac.jejun.model.Post; import kr.ac.jejun.model.PostCategory; import kr.ac.jejun.model.User; import org.springframework.context.annotation.Bean; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import java.util.List; /** * Created by masinogns on 2017. 6. 8.. */ @Repository public interface PostDao extends JpaRepository<Post, Integer> { public List<Post> findByPostCategory(PostCategory postCategory, Pageable pageable); public List<Post> findByUser(User user); // List<Post> findByUserid(Long id); }
[ "masinogns@gmail.com" ]
masinogns@gmail.com
c00921799faa005fba08cd6b1d415aa7c80998d3
309b6125dc5d42bfcf26c84309f78833f44e695f
/src/org/jagatoo/input/listeners/KeyboardListener.java
a140daf7b0b3407f9f6e7e799e629cf1494af494
[]
no_license
olamedia/jagatoo
193a63abd68e245a074fe0d41a0d89822a114f0f
277a609152a407727768f1a21076c7ef65570b53
refs/heads/master
2020-04-06T04:31:41.259828
2012-06-06T18:52:34
2012-06-06T18:52:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,745
java
/** * Copyright (c) 2007-2011, JAGaToo Project Group all rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the 'Xith3D Project Group' nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) A * RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE */ package org.jagatoo.input.listeners; import org.jagatoo.input.devices.components.Key; import org.jagatoo.input.events.KeyPressedEvent; import org.jagatoo.input.events.KeyReleasedEvent; import org.jagatoo.input.events.KeyStateEvent; import org.jagatoo.input.events.KeyTypedEvent; /** * <p>Listens for generic keyboard events generated by any complying keyboard input API * (a class which implements KeyboardDevice2). The listener MUST be registered with * a device to recieve any events.</p> * * <p>Possible events are key pressed and released. The key codes used are from the * <code>Keys</code> class. Any input API which uses different key constants must * convert them to maintain input abstraction. * * @author Marvin Froehlich (aka Qudus) */ public interface KeyboardListener { /** * Used by implementing input classes to process a key pressed event. * This method is generally invoked by Keyboard. * * @param e the KeyboardEvent, with all assotiated information * @param key */ public void onKeyPressed( KeyPressedEvent e, Key key ); /** * Used by implementing input classes to process a key released event. * This method is generally invoked by Keyboard. * * @param e the KeyboardEvent, with all assotiated information * @param key */ public void onKeyReleased( KeyReleasedEvent e, Key key ); /** * Used by implementing input classes to process a key state changed event. * This method is generally invoked by Keyboard. * * @param e the KeyboardEvent, with all assotiated information * @param key * @param state */ public void onKeyStateChanged( KeyStateEvent e, Key key, boolean state ); /** * Used by implementing input classes to process a key typed event. * It is not the same as onKeyPressed or onKeyReleased since * this even returns a char. It should be used e.g. for widgets * which need a text input. * * @param e the KeyboardEvent, with all assotiated information * @param keyChar */ public void onKeyTyped( KeyTypedEvent e, char keyChar ); }
[ "qudus@2129d3d7-e42f-0410-990c-ad1eb91dfb1e" ]
qudus@2129d3d7-e42f-0410-990c-ad1eb91dfb1e
266c3a18f42e302d1cc450f0e61172d1e9ec3b0b
a18e07ccd072ef63463d877ce7974021740f3e58
/app/src/main/java/com/kier/tenorio/themovies/MainActivity.java
102abadea41bb96e8210af5a0bf231d1052a719d
[]
no_license
Kier24/TheMoviesApp
a7945417df0cd352f2a695d8d5850145fd7f862a
3c7eed9e36916316c8f1a5a560bbda7eb51489c2
refs/heads/master
2021-01-21T14:48:28.790273
2017-06-25T03:20:57
2017-06-25T03:20:57
95,335,991
0
0
null
null
null
null
UTF-8
Java
false
false
5,790
java
package com.kier.tenorio.themovies; import android.content.Intent; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.ListAdapter; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class MainActivity extends AppCompatActivity { private CustomMovieAdapter myAdapter; private Movie[] moviesArray; @Override public void onStart() { super.onStart(); new FetchMovieTask().execute(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListView movieListView= (ListView) findViewById(R.id.listView_movies); String [] data ={"SpiderMan1","SpiderMan2","SpiderMan3"}; //List<String> movieList=new ArrayList<String>(Arrays.asList(data)); // myAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,movieList); List <Movie> movieList=new ArrayList<Movie>(); myAdapter=new CustomMovieAdapter(this,R.layout.list_item_movies,movieList); movieListView.setAdapter(myAdapter); movieListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?>parent, View view, int position,long id) { Movie movieToDisplay=moviesArray[position]; Intent intent=new Intent(MainActivity.this,MovieDetails.class).putExtra("currentMovie",movieToDisplay); startActivity(intent); } } ); } public class FetchMovieTask extends AsyncTask<Void,Void,Movie[]> { private final String LOG_TAG=FetchMovieTask.class.getSimpleName(); private Movie[] populateMoviesFromJSON(String jsonString) throws JSONException { JSONObject moviesJson = new JSONObject(jsonString); JSONArray jsonMoviesArray=moviesJson.getJSONArray("results"); moviesArray=new Movie[jsonMoviesArray.length()]; for(int i=0;i<jsonMoviesArray.length();i++) { String imgPath=""; String title=""; String plot=""; double userRating=0.0; String date=""; JSONObject currentMovie=jsonMoviesArray.getJSONObject(i); imgPath=currentMovie.getString("poster_path"); title=currentMovie.getString("original_title"); plot=currentMovie.getString("overview"); userRating=currentMovie.getDouble("vote_average"); date=currentMovie.getString("release_date"); moviesArray[i]=new Movie(imgPath,title,plot,userRating,date); } return moviesArray; } @Override protected Movie[] doInBackground(Void...params) { HttpURLConnection urlConnection=null; BufferedReader reader=null; String moviesJsonString=null; try { final String baseURL="https://api.themoviedb.org/3/movie/popular?api_key="+BuildConfig.THEMOVIEDB_API_KEY; URL url = new URL(baseURL); Log.v(LOG_TAG,"Built Uri "+baseURL); urlConnection=(HttpURLConnection) url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.connect(); InputStream inputStream =urlConnection.getInputStream(); StringBuffer buffer = new StringBuffer(); if(inputStream==null) return null; reader=new BufferedReader(new InputStreamReader(inputStream)); String line; while((line=reader.readLine())!=null){ buffer.append(line+"\n"); } if(buffer.length()==0) return null; moviesJsonString=buffer.toString(); Log.v(LOG_TAG,"JSON String "+moviesJsonString); } catch(IOException e) { Log.e(LOG_TAG,"Error",e); return null; } finally { if(urlConnection!=null) urlConnection.disconnect(); if(reader!=null) try{ reader.close(); } catch (final IOException e) { Log.e(LOG_TAG,"Error closing stream",e); } } try { return populateMoviesFromJSON(moviesJsonString); } catch (JSONException e) { Log.e(LOG_TAG,e.getMessage(),e); e.printStackTrace(); } return null; } @Override protected void onPostExecute(Movie[] movie) { if(movie==null) { return; } else { myAdapter.clear(); for (Movie currentMovie : movie) { myAdapter.add(currentMovie); } } } } }
[ "kier09tenorio@gmail.com" ]
kier09tenorio@gmail.com
3e3cdab976e98c0a7df9d8d078d72c841fbc6d15
cd46bbc610733d98888f824298f3e04f45ae8402
/datasource/src/main/java/com/test/springboot/datasource/config/TargetDataSource.java
9e56b112cf8110c65b8bb3a5de135fc8d855983c
[]
no_license
jijingunique/learning-springboot
70eca10685b3b013034a4073038dbe91d077dc3b
dc30ca2fba051e16983736d04dc796f7f6827f0e
refs/heads/master
2020-03-24T16:36:33.157621
2018-08-31T07:45:32
2018-08-31T07:45:32
142,829,898
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package com.test.springboot.datasource.config; import java.lang.annotation.*; /** * @Author jing.ji * @Date 2018-08-13 * @Description 作用于类、接口或者方法上 */ @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface TargetDataSource { String name(); }
[ "jijingunique@163.com" ]
jijingunique@163.com
074cd14ba7fc4edb71d715fd3b742eeff6d52c9a
5ec06dab1409d790496ce082dacb321392b32fe9
/clients/java-play-framework/generated/app/apimodels/OrgApacheSlingEngineImplLogRequestLoggerInfo.java
d38bac9ae83cec4e80f9845f24175ea93904ace6
[ "Apache-2.0" ]
permissive
shinesolutions/swagger-aem-osgi
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
c2f6e076971d2592c1cbd3f70695c679e807396b
refs/heads/master
2022-10-29T13:07:40.422092
2021-04-09T07:46:03
2021-04-09T07:46:03
190,217,155
3
3
Apache-2.0
2022-10-05T03:26:20
2019-06-04T14:23:28
null
UTF-8
Java
false
false
5,317
java
package apimodels; import apimodels.OrgApacheSlingEngineImplLogRequestLoggerProperties; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; import java.util.Objects; import javax.validation.constraints.*; /** * OrgApacheSlingEngineImplLogRequestLoggerInfo */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen", date = "2019-08-05T00:55:42.601Z[GMT]") @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class OrgApacheSlingEngineImplLogRequestLoggerInfo { @JsonProperty("pid") private String pid = null; @JsonProperty("title") private String title = null; @JsonProperty("description") private String description = null; @JsonProperty("properties") private OrgApacheSlingEngineImplLogRequestLoggerProperties properties = null; @JsonProperty("bundle_location") private String bundleLocation = null; @JsonProperty("service_location") private String serviceLocation = null; public OrgApacheSlingEngineImplLogRequestLoggerInfo pid(String pid) { this.pid = pid; return this; } /** * Get pid * @return pid **/ public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } public OrgApacheSlingEngineImplLogRequestLoggerInfo title(String title) { this.title = title; return this; } /** * Get title * @return title **/ public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public OrgApacheSlingEngineImplLogRequestLoggerInfo description(String description) { this.description = description; return this; } /** * Get description * @return description **/ public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public OrgApacheSlingEngineImplLogRequestLoggerInfo properties(OrgApacheSlingEngineImplLogRequestLoggerProperties properties) { this.properties = properties; return this; } /** * Get properties * @return properties **/ @Valid public OrgApacheSlingEngineImplLogRequestLoggerProperties getProperties() { return properties; } public void setProperties(OrgApacheSlingEngineImplLogRequestLoggerProperties properties) { this.properties = properties; } public OrgApacheSlingEngineImplLogRequestLoggerInfo bundleLocation(String bundleLocation) { this.bundleLocation = bundleLocation; return this; } /** * Get bundleLocation * @return bundleLocation **/ public String getBundleLocation() { return bundleLocation; } public void setBundleLocation(String bundleLocation) { this.bundleLocation = bundleLocation; } public OrgApacheSlingEngineImplLogRequestLoggerInfo serviceLocation(String serviceLocation) { this.serviceLocation = serviceLocation; return this; } /** * Get serviceLocation * @return serviceLocation **/ public String getServiceLocation() { return serviceLocation; } public void setServiceLocation(String serviceLocation) { this.serviceLocation = serviceLocation; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OrgApacheSlingEngineImplLogRequestLoggerInfo orgApacheSlingEngineImplLogRequestLoggerInfo = (OrgApacheSlingEngineImplLogRequestLoggerInfo) o; return Objects.equals(pid, orgApacheSlingEngineImplLogRequestLoggerInfo.pid) && Objects.equals(title, orgApacheSlingEngineImplLogRequestLoggerInfo.title) && Objects.equals(description, orgApacheSlingEngineImplLogRequestLoggerInfo.description) && Objects.equals(properties, orgApacheSlingEngineImplLogRequestLoggerInfo.properties) && Objects.equals(bundleLocation, orgApacheSlingEngineImplLogRequestLoggerInfo.bundleLocation) && Objects.equals(serviceLocation, orgApacheSlingEngineImplLogRequestLoggerInfo.serviceLocation); } @Override public int hashCode() { return Objects.hash(pid, title, description, properties, bundleLocation, serviceLocation); } @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgApacheSlingEngineImplLogRequestLoggerInfo {\n"); sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append(" bundleLocation: ").append(toIndentedString(bundleLocation)).append("\n"); sb.append(" serviceLocation: ").append(toIndentedString(serviceLocation)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "cliffano@gmail.com" ]
cliffano@gmail.com
b6b9200868a959eed87a6cf66b0ed7d12a8b95ef
9282591635f3cf5a640800f2b643cd57048ed29f
/app/src/main/java/com/android/p2pflowernet/project/zxing/camera/PreviewCallback.java
1dbf8403081164cdd8528ab2dc616eb4178d52c2
[]
no_license
AHGZ/B2CFlowerNetProject
de5dcbf2cbb67809b00f86639d592309d84b3283
b1556c4b633fa7c0c1463af94db9f91285070714
refs/heads/master
2020-03-09T17:27:14.889919
2018-04-10T09:36:33
2018-04-10T09:36:33
128,908,791
1
0
null
null
null
null
UTF-8
Java
false
false
1,994
java
/* * Copyright (C) 2010 ZXing 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.android.p2pflowernet.project.zxing.camera; import android.graphics.Point; import android.hardware.Camera; import android.os.Handler; import android.os.Message; import android.util.Log; final class PreviewCallback implements Camera.PreviewCallback { private static final String TAG = PreviewCallback.class.getSimpleName(); private final CameraConfigurationManager configManager; private final boolean useOneShotPreviewCallback; private Handler previewHandler; private int previewMessage; PreviewCallback(CameraConfigurationManager configManager, boolean useOneShotPreviewCallback) { this.configManager = configManager; this.useOneShotPreviewCallback = useOneShotPreviewCallback; } void setHandler(Handler previewHandler, int previewMessage) { this.previewHandler = previewHandler; this.previewMessage = previewMessage; } public void onPreviewFrame(byte[] data, Camera camera) { Point cameraResolution = configManager.getCameraResolution(); if (!useOneShotPreviewCallback) { camera.setPreviewCallback(null); } if (previewHandler != null) { Message message = previewHandler.obtainMessage(previewMessage, cameraResolution.x, cameraResolution.y, data); message.sendToTarget(); previewHandler = null; } else { Log.d(TAG, "Got preview callback, but no handler for it"); } } }
[ "18911005030@163.com" ]
18911005030@163.com
3c1e3696ebb2a26b93ed0ec1053af07e076ce39f
df07ede54390feb3d53cb1d3b92c869468f5dda1
/src/main/java/pojos/Customer.java
09fad9f91657364ab4d360fc3caae62628bb9f66
[]
no_license
vanshaj2608/flipkart-cab-booking
3fdcd3f6534331bbacbe30e4d790f4e6c891e32a
72708571eadba5bb7f2ad336d0c3735a1194f03c
refs/heads/master
2020-04-18T18:03:25.027157
2019-01-26T09:44:40
2019-01-26T09:44:40
167,672,939
0
0
null
null
null
null
UTF-8
Java
false
false
1,833
java
package pojos; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Customer { /* * Considering it to be unique */ private String name; private Integer totalTrips; private Integer totalRating; private Double rating; private Set<Driver> oneStarDrivers; private Set<String> rideDoneWith; public Customer(String name,Integer totalTrips, Integer totalRating) { this.name = name; this.totalTrips = totalTrips; this.totalRating = totalRating; this.oneStarDrivers = new HashSet<>(); this.rideDoneWith = new HashSet<>(); this.rating = 3.0; } public Double getRating() { return rating; } public void setRating() { if(this.totalTrips !=0) this.rating = (1.0 * this.totalRating/this.totalTrips); } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getTotalTrips() { return totalTrips; } public void setTotalTrips(Integer totalTrips) { this.totalTrips = totalTrips; } public Integer getTotalRating() { return totalRating; } public void setTotalRating(Integer totalRating) { this.totalRating = totalRating; } public Set<Driver> getOneStarDrivers() { return oneStarDrivers; } public void setOneStarDrivers(Set<Driver> oneStarDrivers) { this.oneStarDrivers = oneStarDrivers; } public Set<String> getRideDoneWith() { return rideDoneWith; } public void setRideDoneWith(Set<String> rideDoneWith) { this.rideDoneWith = rideDoneWith; } }
[ "vanshaj.dixit@minjar.com" ]
vanshaj.dixit@minjar.com
4b0c697b3871374760518ccb417cf4e3563bffdf
061b309e63e397ee625242b02a9cbdca597d3953
/src/main/java/pages/WishlistPage.java
adc44078f1ccf658202f0f2f1c307ad724d25656
[]
no_license
SofienRhouma/seleniumPOM
777a6135bf6c50902cf3e8b16a6ecc97129ceafc
f60f0d6bdefd6f6b3d4c18f51f20ab0d31ba21ee
refs/heads/master
2023-07-02T03:48:05.814516
2021-08-05T16:50:55
2021-08-05T16:50:55
390,776,568
0
0
null
2021-08-05T16:50:55
2021-07-29T15:54:35
HTML
UTF-8
Java
false
false
711
java
package pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class WishlistPage extends PageBase { public WishlistPage(WebDriver driver) { super(driver); } @FindBy(css = "td.product") public WebElement productCell; @FindBy(css = "h1") public WebElement wishlistHeader; @FindBy(name = "updatecart") private WebElement updateWishlistBtn; @FindBy(css = "button.remove-btn") private WebElement removefromCartCheck; @FindBy(css = "div.no-data") public WebElement EmptyCartLbl; public void removeProductFromWishlist() { clickButton(updateWishlistBtn); clickButton(removefromCartCheck); } }
[ "benrhouma.sofien@gmail.com" ]
benrhouma.sofien@gmail.com
5bb979c2f8f423df7412bdb76723b07670448e4b
956919c673a22e8b91aa1eb54e5cad97a834d8fc
/QuickPoll-1/src/test/java/com/example/demo/QuickPoll1ApplicationTests.java
e9cd1b8af1e66b2bd29bf796a2c1ea9174a256a9
[]
no_license
skylabaseInc/spring-boot-hackerthon
efd59917451849ce8471bc7ee687c9f4affd58b2
36cb82f4a2700005d10ea8477109b9ca7d514b35
refs/heads/master
2021-05-03T19:55:23.380488
2018-02-17T11:45:11
2018-02-17T11:45:11
120,425,471
0
1
null
2018-02-17T11:45:12
2018-02-06T08:38:00
Java
UTF-8
Java
false
false
337
java
package com.example.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class QuickPoll1ApplicationTests { @Test public void contextLoads() { } }
[ "ghislaincabrel.kemfang@gmail.com" ]
ghislaincabrel.kemfang@gmail.com
2444db73d3dac4f7faba4c12dd6bd0bb211a3772
0abc4f6d40e014d04984d0e0d4d727fc33130e1f
/mytest/src/main/java/com/flows/service/impl/ModelServiceImpl.java
843e1b6f2d265c08c6f1ea873d1a05221b2e0826
[]
no_license
okraft/myTestDemo
12abfa43aa4aba58fcf4ef1ebd48b1ca5707543c
9aa92eef595e2efe89f715367b934b1cd2598c17
refs/heads/master
2021-01-10T05:50:17.573713
2015-11-20T08:20:13
2015-11-20T08:20:13
46,547,912
0
0
null
null
null
null
UTF-8
Java
false
false
2,209
java
package com.flows.service.impl; import java.util.Date; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import com.flows.bean.TreeNode; import com.flows.entity.Model; import com.flows.repository.ModelDao; import com.flows.service.IModelService; @Service public class ModelServiceImpl implements IModelService { @Autowired private ModelDao modelDao; public List<Model> findAll() { return (List<Model>) modelDao.findAll(); } public List<Model> findByPage(Specification<Model> spec) { return modelDao.findAll(spec); } public void deleteById(int id) { modelDao.delete(id); } public void saveModel(Model model) throws Exception { Model model2 = null; if(model.getId() > 0){ model2 = modelDao.findOne(model.getId()); if(model2 == null){ throw new Exception("model is null"); } }else{ model2 = new Model(); } model2.setPid(model.getPid()); model2.setIsLeaf(model.getIsLeaf()); model2.setName(model.getName()); model2.setCtime(new Date()); model2.setCuser(1); modelDao.save(model2); } public List<TreeNode> getModelTree() { List<TreeNode> treeList = new LinkedList<TreeNode>(); List<Model> modelList = (List<Model>) modelDao.findAll(); if(modelList != null && modelList.size() > 0){ Map<Integer, TreeNode> treeNodeMap = new HashMap<Integer, TreeNode>(); for (Model model : modelList) { TreeNode treeNode = new TreeNode(); treeNode.setId(model.getId()); treeNode.setpId(model.getPid()); treeNode.setText(model.getName()); treeNode.setState(TreeNode.NODE_STATE_OPEN); treeNodeMap.put(treeNode.getId(), treeNode); } for (Model model : modelList) { TreeNode treeNode = treeNodeMap.get(model.getId()); if(treeNode.getpId() > 0){ TreeNode ptreeNode = treeNodeMap.get(treeNode.getpId()); ptreeNode.addNode(treeNode); }else{ treeList.add(treeNode); } } } return treeList; } }
[ "okraft@163.com" ]
okraft@163.com
f35471a2cba6fb5b1e00b08018f296ee77494636
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_bf42e18a2635ab21b0cba1cc9eaed97922b6b998/OAIFeederMappings/12_bf42e18a2635ab21b0cba1cc9eaed97922b6b998_OAIFeederMappings_t.java
a263fc8124868b8fdc2a582c5998b512f5b4d602
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,168
java
package org.dbpedia.extraction.live.feeder; import org.dbpedia.extraction.live.core.LiveOptions; import org.dbpedia.extraction.live.helper.MappingAffectedPagesHelper; import org.dbpedia.extraction.live.priority.Priority; import org.dbpedia.extraction.live.util.XMLUtil; import org.dbpedia.extraction.sources.XMLSource; import org.w3c.dom.Document; /** * Created with IntelliJ IDEA. * User: Dimitris Kontokostas * Date: 9/10/12 * Time: 10:08 AM * An OAI Feeder for the mappings wiki */ public class OAIFeederMappings extends OAIFeeder { private String mappingNamespace = ""; public OAIFeederMappings(String feederName, int threadPriority, Priority queuePriority, String oaiUri, String oaiPrefix, String baseWikiUri, long pollInterval, long sleepInterval, String defaultStartDateTime, long relativeEndFromNow, String folderBasePath) { super(feederName, threadPriority, queuePriority, oaiUri, oaiPrefix, baseWikiUri, pollInterval, sleepInterval, defaultStartDateTime, relativeEndFromNow, folderBasePath); String langCode = LiveOptions.options.get("language"); mappingNamespace = "Mapping " + langCode + ":"; } @Override protected void handleFeedItem(FeederItem item) { // ignore irrelevant mappings if (!item.getItemName().startsWith(mappingNamespace)) return; String title = item.getItemName().substring(item.getItemName().indexOf(":")+1); //if (!item.isDeleted()) { scala.collection.immutable.List<Object> ids = MappingAffectedPagesHelper.GetMappingPages(title); scala.collection.Iterator<Object> iter = ids.iterator(); while (iter.hasNext()) addPageIDtoQueue((Long) iter.next(), latestResponseDate); iter = null; ids = null; //} else { // TODO find which template the deleted infobox was referring to //} latestResponseDate = item.getModificationDate(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
287126e2fe2dadaee119014d7dcbb97c1b2cead6
3e877fa92c776ad1617089b3b551550b899acd95
/android/app/src/main/java/com/example/stock_app/MainActivity.java
342214e7075dca651399063db7c75ebbc2385b72
[]
no_license
lordmen99/stockmanagement-app
39375368c0053246381da991b772dc116d398119
a0714556bb12e4712691fafb05c791898846127c
refs/heads/master
2020-09-11T10:19:02.802214
2019-07-30T06:19:36
2019-07-30T06:19:36
222,033,514
1
0
null
2019-11-16T02:07:40
2019-11-16T02:07:38
null
UTF-8
Java
false
false
366
java
package com.example.stock_app; import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }
[ "sajjad.sohrabi2@gmail.com" ]
sajjad.sohrabi2@gmail.com
b8589b78f6f1f719426e82681c425f52f44c02bb
00a9e26ccf65d059d7dc56f0ff1b5ea7cb11c7b4
/src/main/java/com/plf/thread/ReadWriteLockTest.java
d25d3dd44d8decb5a5ee2342ad2fef5b59f29ca4
[]
no_license
dlchris/CommonMethod
00ec6df1be712a9cebd1f3059ac3952faf55b305
85510069f180b601c31201dfd72e480a59cad7a4
refs/heads/master
2020-03-09T05:42:33.460299
2018-01-22T12:33:34
2018-01-22T12:33:34
128,620,574
1
0
null
2018-04-08T08:51:53
2018-04-08T08:51:53
null
UTF-8
Java
false
false
1,584
java
package com.plf.thread; import java.util.Random; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; public class ReadWriteLockTest { public static void main(String[] args) { // TODO Auto-generated method stub final Queue3 q3 = new Queue3(); for(int i=0;i<3;i++){ new Thread(){ public void run(){ while(true){ q3.get(); } }}.start(); new Thread(){ public void run(){ while(true){ q3.put(new Random().nextInt(10000)); } }}.start(); } } } class Queue3{ private Object data = null;//共享数据,只能有一个线程能写该数据,但是有多个线程同时读该数据 ReadWriteLock rwl = new ReentrantReadWriteLock(); public void get(){ rwl.readLock().lock(); try{ System.out.println(Thread.currentThread().getName()+" be ready to read data!"); Thread.sleep((long)(Math.random()*1000)); System.out.println(Thread.currentThread().getName()+" have read data :"+data); }catch (Exception e) { // TODO: handle exception e.printStackTrace(); }finally { rwl.readLock().unlock(); } } public void put(Object data){ rwl.writeLock().lock(); try{ System.out.println(Thread.currentThread().getName()+" be ready to write data!"); Thread.sleep((long)(Math.random()*1000)); this.data=data; System.out.println(Thread.currentThread().getName()+" have write data:"+data); }catch (Exception e) { // TODO: handle exception e.printStackTrace(); }finally { rwl.writeLock().unlock(); } } }
[ "liangfeng_pan@163.com" ]
liangfeng_pan@163.com
548878358d7de35e22478f1ad9093f5305227251
4312a71c36d8a233de2741f51a2a9d28443cd95b
/RawExperiments/TB/Math 3.2 RC5T/AstorMain-Math 3.2 RC5/src/variant-983/org/apache/commons/math/optimization/direct/DirectSearchOptimizer.java
d8fbba217111bf00f4569aac0a93454fcd8c842f
[]
no_license
SajjadZaidi/AutoRepair
5c7aa7a689747c143cafd267db64f1e365de4d98
e21eb9384197bae4d9b23af93df73b6e46bb749a
refs/heads/master
2021-05-07T00:07:06.345617
2017-12-02T18:48:14
2017-12-02T18:48:14
112,858,432
0
0
null
null
null
null
UTF-8
Java
false
false
9,597
java
package org.apache.commons.math.optimization.direct; public abstract class DirectSearchOptimizer implements org.apache.commons.math.optimization.MultivariateRealOptimizer { protected org.apache.commons.math.optimization.RealPointValuePair[] simplex; private org.apache.commons.math.analysis.MultivariateRealFunction f; private org.apache.commons.math.optimization.RealConvergenceChecker checker; private int maxIterations; private int iterations; private int maxEvaluations; private int evaluations; private double[][] startConfiguration; protected DirectSearchOptimizer() { setConvergenceChecker(new org.apache.commons.math.optimization.SimpleScalarValueChecker()); setMaxIterations(java.lang.Integer.MAX_VALUE); setMaxEvaluations(java.lang.Integer.MAX_VALUE); } public void setStartConfiguration(final double[] steps) throws java.lang.IllegalArgumentException { final int n = steps.length; startConfiguration = new double[n][n]; for (int i = 0 ; i < n ; ++i) { final double[] vertexI = startConfiguration[i]; for (int j = 0 ; j < (i + 1) ; ++j) { if ((steps[j]) == 0.0) { throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException("equals vertices {0} and {1} in simplex configuration", j, (j + 1)); } java.lang.System.arraycopy(steps, 0, vertexI, 0, (j + 1)); } } } public void setStartConfiguration(final double[][] referenceSimplex) throws java.lang.IllegalArgumentException { final int n = (referenceSimplex.length) - 1; if (n < 0) { throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException("simplex must contain at least one point"); } startConfiguration = new double[n][n]; final double[] ref0 = referenceSimplex[0]; for (int i = 0 ; i < (n + 1) ; ++i) { final double[] refI = referenceSimplex[i]; if ((refI.length) != n) { throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException("dimension mismatch {0} != {1}", refI.length, n); } for (int j = 0 ; j < i ; ++j) { final double[] refJ = referenceSimplex[j]; boolean allEquals = true; for (int k = 0 ; k < n ; ++k) { if ((refI[k]) != (refJ[k])) { allEquals = false; break; } } if (allEquals) { throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException("equals vertices {0} and {1} in simplex configuration", i, j); } } if (i > 0) { final double[] confI = startConfiguration[(i - 1)]; for (int k = 0 ; k < n ; ++k) { confI[k] = (refI[k]) - (ref0[k]); } } } } public void setMaxIterations(int maxIterations) { org.apache.commons.math.optimization.direct.DirectSearchOptimizer.this.maxIterations = maxIterations; } public int getMaxIterations() { return maxIterations; } public void setMaxEvaluations(int maxEvaluations) { org.apache.commons.math.optimization.direct.DirectSearchOptimizer.this.maxEvaluations = maxEvaluations; } public int getMaxEvaluations() { return maxEvaluations; } public int getIterations() { return iterations; } public int getEvaluations() { return evaluations; final java.lang.String pattern = "internal error, please fill a bug report at {0}"; } public void setConvergenceChecker(org.apache.commons.math.optimization.RealConvergenceChecker checker) { org.apache.commons.math.optimization.direct.DirectSearchOptimizer.this.checker = checker; } public org.apache.commons.math.optimization.RealConvergenceChecker getConvergenceChecker() { return checker; } public org.apache.commons.math.optimization.RealPointValuePair optimize(final org.apache.commons.math.analysis.MultivariateRealFunction f, final org.apache.commons.math.optimization.GoalType goalType, final double[] startPoint) throws java.lang.IllegalArgumentException, org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.optimization.OptimizationException { if ((startConfiguration) == null) { final double[] unit = new double[startPoint.length]; java.util.Arrays.fill(unit, 1.0); setStartConfiguration(unit); } org.apache.commons.math.optimization.direct.DirectSearchOptimizer.this.f = f; final java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair> comparator = new java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair>() { public int compare(final org.apache.commons.math.optimization.RealPointValuePair o1, final org.apache.commons.math.optimization.RealPointValuePair o2) { final double v1 = o1.getValue(); final double v2 = o2.getValue(); return goalType == (org.apache.commons.math.optimization.GoalType.MINIMIZE) ? java.lang.Double.compare(v1, v2) : java.lang.Double.compare(v2, v1); } }; iterations = 0; evaluations = 0; buildSimplex(startPoint); evaluateSimplex(comparator); org.apache.commons.math.optimization.RealPointValuePair[] previous = new org.apache.commons.math.optimization.RealPointValuePair[simplex.length]; while (true) { if ((iterations) > 0) { boolean converged = true; for (int i = 0 ; i < (simplex.length) ; ++i) { converged &= checker.converged(iterations, previous[i], simplex[i]); } if (converged) { return simplex[0]; } } java.lang.System.arraycopy(simplex, 0, previous, 0, simplex.length); iterateSimplex(comparator); } } protected void incrementIterationsCounter() throws org.apache.commons.math.optimization.OptimizationException { if ((++(iterations)) > (maxIterations)) { throw new org.apache.commons.math.optimization.OptimizationException(new org.apache.commons.math.MaxIterationsExceededException(maxIterations)); } } protected abstract void iterateSimplex(final java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair> comparator) throws java.lang.IllegalArgumentException, org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.optimization.OptimizationException; protected double evaluate(final double[] x) throws java.lang.IllegalArgumentException, org.apache.commons.math.FunctionEvaluationException { if ((++(evaluations)) > (maxEvaluations)) { throw new org.apache.commons.math.FunctionEvaluationException(new org.apache.commons.math.MaxEvaluationsExceededException(maxEvaluations) , x); } return f.value(x); } private void buildSimplex(final double[] startPoint) throws java.lang.IllegalArgumentException { final int n = startPoint.length; if (n != (startConfiguration.length)) { throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException("dimension mismatch {0} != {1}", n, startConfiguration.length); } simplex = new org.apache.commons.math.optimization.RealPointValuePair[n + 1]; simplex[0] = new org.apache.commons.math.optimization.RealPointValuePair(startPoint , java.lang.Double.NaN); for (int i = 0 ; i < n ; ++i) { final double[] confI = startConfiguration[i]; final double[] vertexI = new double[n]; for (int k = 0 ; k < n ; ++k) { vertexI[k] = (startPoint[k]) + (confI[k]); } simplex[(i + 1)] = new org.apache.commons.math.optimization.RealPointValuePair(vertexI , java.lang.Double.NaN); } } protected void evaluateSimplex(final java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair> comparator) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.optimization.OptimizationException { for (int i = 0 ; i < (simplex.length) ; ++i) { final org.apache.commons.math.optimization.RealPointValuePair vertex = simplex[i]; final double[] point = vertex.getPointRef(); if (java.lang.Double.isNaN(vertex.getValue())) { simplex[i] = new org.apache.commons.math.optimization.RealPointValuePair(point , evaluate(point) , false); } } java.util.Arrays.sort(simplex, comparator); } protected void replaceWorstPoint(org.apache.commons.math.optimization.RealPointValuePair pointValuePair, final java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair> comparator) { int n = (simplex.length) - 1; for (int i = 0 ; i < n ; ++i) { if ((comparator.compare(simplex[i], pointValuePair)) > 0) { org.apache.commons.math.optimization.RealPointValuePair tmp = simplex[i]; simplex[i] = pointValuePair; pointValuePair = tmp; } } simplex[n] = pointValuePair; } }
[ "sajjad.syed@ucalgary.ca" ]
sajjad.syed@ucalgary.ca
37620c61cffb47a3f8eba1408ad1411fd7d8246b
f1541647b53fb7a5ea44db655ad469c4cd5f9b2a
/src/test/java/Scramblies_.java
329a1429d4c08108cfb344d5360b54f9753d1a98
[]
no_license
ismael094/Scramblies
bf5348cd5e21858a15394762cf66d02101ce953c
a4cf0fe07ab04349207d747cacff106e8d2f12c6
refs/heads/master
2020-12-18T13:22:53.839199
2020-01-21T17:18:40
2020-01-21T17:18:40
235,398,754
0
0
null
2020-10-13T18:59:56
2020-01-21T17:18:55
Java
UTF-8
Java
false
false
593
java
import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; public class Scramblies_ { @Test public void with_same_string_should_return_true() { assertThat(Scramblies.scramble("hola","hola")).isEqualTo(true); } @Test public void with_portion_of_str1_in_str2_should_return_true() { assertThat(Scramblies.scramble("scriptingjava","javascript")).isEqualTo(true); } @Test public void with_no_portion_of_str1_in_str2_should_return_false() { assertThat(Scramblies.scramble("katas","steak")).isEqualTo(false); } }
[ "ismaelpitufo@gmail.com" ]
ismaelpitufo@gmail.com
b72d38c811fbab5a553d75a848a3052e13457383
cc4c0c1a8d76d68ea3f414229374af86f22b5b37
/src/main/java/com/rps2/gameSystem/EndOfGame.java
d753d28389eb5b80858f7f77ad6399b298ef5c01
[]
no_license
gsw91/rps-app
2100bd65a9650eef7c2bdaec362bfb3689828174
45fe5d5dbbadb613f89cdc6c99ea4ad7d435737e
refs/heads/master
2020-03-21T00:33:25.001925
2018-06-29T20:16:54
2018-06-29T20:16:54
137,898,504
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.rps2.gameSystem; import com.rps.exceptions.RpsException; import java.util.Scanner; public final class EndOfGame { public final void endingGame() { GameInformation gameInformation = new GameInformation(); Scanner scanner = new Scanner(System.in); boolean isThisEnd = false; while (!isThisEnd) { System.out.println("\n Game is finished. Put n to play one more time, s to see statistics, or x key to exit"); try { String command = scanner.nextLine(); gameInformation.showStatistics(command); gameInformation.exitOrReset(command); } catch (RpsException e) { System.out.println("Please, confirm your decision"); } } } }
[ "g.wojcik@vp.pl" ]
g.wojcik@vp.pl
f42680a2a8c0c287f4c0155beb63d979500df9e3
e84f712a009f043e46a457521044dfc0bc7c8a52
/app/src/main/java/com/mobileeftpos/android/eftpos/SplashScreen/RandomTransitionGenerator.java
5dff95dfdee41dd9ca25e71b89917c96b0159eaa
[]
no_license
Venkatesulua/Meftpos
3793c04e426d8281a48bbf1d95f97ea038b8a3aa
28875bddeea47f186401e26bbe2a856afa1b3a9a
refs/heads/master
2021-06-20T02:30:28.129494
2017-05-26T12:31:59
2017-05-26T12:31:59
100,347,471
0
0
null
2017-08-15T06:56:20
2017-08-15T06:43:41
Java
UTF-8
Java
false
false
5,369
java
package com.mobileeftpos.android.eftpos.SplashScreen; /** * Created by Prathap on 4/26/17. */ import android.graphics.RectF; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; import java.util.Random; public class RandomTransitionGenerator implements com.mobileeftpos.android.eftpos.SplashScreen.TransitionGenerator { /** Default value for the transition duration in milliseconds. */ public static final int DEFAULT_TRANSITION_DURATION = 10000; /** Minimum rect dimension factor, according to the maximum one. */ private static final float MIN_RECT_FACTOR = 0.75f; /** Random object used to generate arbitrary rects. */ private final Random mRandom = new Random(System.currentTimeMillis()); /** The duration, in milliseconds, of each transition. */ private long mTransitionDuration; /** The {@link Interpolator} to be used to create transitions. */ private Interpolator mTransitionInterpolator; /** The last generated transition. */ private Transition mLastGenTrans; /** The bounds of the drawable when the last transition was generated. */ private RectF mLastDrawableBounds; public RandomTransitionGenerator() { this(DEFAULT_TRANSITION_DURATION, new AccelerateDecelerateInterpolator()); } public RandomTransitionGenerator(long transitionDuration, Interpolator transitionInterpolator) { setTransitionDuration(transitionDuration); setTransitionInterpolator(transitionInterpolator); } @Override public Transition generateNextTransition(RectF drawableBounds, RectF viewport) { boolean firstTransition = mLastGenTrans == null; boolean drawableBoundsChanged = true; boolean viewportRatioChanged = true; RectF srcRect = null; RectF dstRect = null; if (!firstTransition) { dstRect = mLastGenTrans.getDestinyRect(); drawableBoundsChanged = !drawableBounds.equals(mLastDrawableBounds); viewportRatioChanged = !MathUtils.haveSameAspectRatio(dstRect, viewport); } if (dstRect == null || drawableBoundsChanged || viewportRatioChanged) { srcRect = generateRandomRect(drawableBounds, viewport); } else { /* Sets the destiny rect of the last transition as the source one if the current drawable has the same dimensions as the one of the last transition. */ srcRect = dstRect; } dstRect = generateRandomRect(drawableBounds, viewport); mLastGenTrans = new Transition(srcRect, dstRect, mTransitionDuration, mTransitionInterpolator); mLastDrawableBounds = drawableBounds; return mLastGenTrans; } /** * Generates a random rect that can be fully contained within {@code drawableBounds} and * has the same aspect ratio of {@code viewportRect}. The dimensions of this random rect * won't be higher than the largest rect with the same aspect ratio of {@code viewportRect} * that {@code drawableBounds} can contain. They also won't be lower than the dimensions * of this upper rect limit weighted by {@code MIN_RECT_FACTOR}. * @param drawableBounds the bounds of the drawable that will be zoomed and panned. * @param viewportRect the bounds of the view that the drawable will be shown. * @return an arbitrary generated rect with the same aspect ratio of {@code viewportRect} * that will be contained within {@code drawableBounds}. */ private RectF generateRandomRect(RectF drawableBounds, RectF viewportRect) { float drawableRatio = MathUtils.getRectRatio(drawableBounds); float viewportRectRatio = MathUtils.getRectRatio(viewportRect); RectF maxCrop; if (drawableRatio > viewportRectRatio) { float r = (drawableBounds.height() / viewportRect.height()) * viewportRect.width(); float b = drawableBounds.height(); maxCrop = new RectF(0, 0, r, b); } else { float r = drawableBounds.width(); float b = (drawableBounds.width() / viewportRect.width()) * viewportRect.height(); maxCrop = new RectF(0, 0, r, b); } float randomFloat = MathUtils.truncate(mRandom.nextFloat(), 2); float factor = MIN_RECT_FACTOR + ((1 - MIN_RECT_FACTOR) * randomFloat); float width = factor * maxCrop.width(); float height = factor * maxCrop.height(); int widthDiff = (int) (drawableBounds.width() - width); int heightDiff = (int) (drawableBounds.height() - height); int left = widthDiff > 0 ? mRandom.nextInt(widthDiff) : 0; int top = heightDiff > 0 ? mRandom.nextInt(heightDiff) : 0; return new RectF(left, top, left + width, top + height); } /** * Sets the duration, in milliseconds, for each transition generated. * @param transitionDuration the transition duration. */ public void setTransitionDuration(long transitionDuration) { mTransitionDuration = transitionDuration; } /** * Sets the {@link Interpolator} for each transition generated. * @param interpolator the transition interpolator. */ public void setTransitionInterpolator(Interpolator interpolator) { mTransitionInterpolator = interpolator; } }
[ "prathap.bezawada@gmail.com" ]
prathap.bezawada@gmail.com
66c06fbc951cc3d8c0d00bc8bbc66d78f7ca7362
c8d4694c6ee503129be2d740f341be128d9b1812
/fr.perrin.trains.reseau/src-gen/fr/perrin/trains/reseau/impl/PowImpl.java
547c621bece7df082bc4c06708d96906a002f5f6
[]
no_license
MatthieuPerrin/train-reseau
d0982dde756f3839c7b67abd48cc25b13067701b
730164d0fa0364a31f2ad3743a144b391a7e16be
refs/heads/master
2020-11-30T19:35:20.523398
2019-12-28T20:32:58
2019-12-28T20:32:58
230,463,671
0
0
null
null
null
null
UTF-8
Java
false
false
6,400
java
/** * generated by Xtext 2.20.0 */ package fr.perrin.trains.reseau.impl; import fr.perrin.trains.reseau.Point; import fr.perrin.trains.reseau.Pow; import fr.perrin.trains.reseau.ReseauPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Pow</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link fr.perrin.trains.reseau.impl.PowImpl#getLeft <em>Left</em>}</li> * <li>{@link fr.perrin.trains.reseau.impl.PowImpl#getRight <em>Right</em>}</li> * </ul> * * @generated */ public class PowImpl extends PointImpl implements Pow { /** * The cached value of the '{@link #getLeft() <em>Left</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLeft() * @generated * @ordered */ protected Point left; /** * The cached value of the '{@link #getRight() <em>Right</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRight() * @generated * @ordered */ protected Point right; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PowImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ReseauPackage.Literals.POW; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Point getLeft() { return left; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetLeft(Point newLeft, NotificationChain msgs) { Point oldLeft = left; left = newLeft; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReseauPackage.POW__LEFT, oldLeft, newLeft); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setLeft(Point newLeft) { if (newLeft != left) { NotificationChain msgs = null; if (left != null) msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReseauPackage.POW__LEFT, null, msgs); if (newLeft != null) msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReseauPackage.POW__LEFT, null, msgs); msgs = basicSetLeft(newLeft, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ReseauPackage.POW__LEFT, newLeft, newLeft)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Point getRight() { return right; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetRight(Point newRight, NotificationChain msgs) { Point oldRight = right; right = newRight; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReseauPackage.POW__RIGHT, oldRight, newRight); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setRight(Point newRight) { if (newRight != right) { NotificationChain msgs = null; if (right != null) msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReseauPackage.POW__RIGHT, null, msgs); if (newRight != null) msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReseauPackage.POW__RIGHT, null, msgs); msgs = basicSetRight(newRight, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ReseauPackage.POW__RIGHT, newRight, newRight)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ReseauPackage.POW__LEFT: return basicSetLeft(null, msgs); case ReseauPackage.POW__RIGHT: return basicSetRight(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ReseauPackage.POW__LEFT: return getLeft(); case ReseauPackage.POW__RIGHT: return getRight(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ReseauPackage.POW__LEFT: setLeft((Point)newValue); return; case ReseauPackage.POW__RIGHT: setRight((Point)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ReseauPackage.POW__LEFT: setLeft((Point)null); return; case ReseauPackage.POW__RIGHT: setRight((Point)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ReseauPackage.POW__LEFT: return left != null; case ReseauPackage.POW__RIGHT: return right != null; } return super.eIsSet(featureID); } } //PowImpl
[ "matthieu.perrin@univ-nantes.fr" ]
matthieu.perrin@univ-nantes.fr
6f5dec2090d8e1d1b03bacac2f115073fb0def3f
0b0773fe08f7efef55bb3975690a69e9128f60ea
/src/guía_3/E5.java
1270811cb442e21714114a759f59788016e69b16
[]
no_license
cristobalgvera/Java
5b96a3a72084837224385a88bd87c8a539574866
68229fb3f5a4204906263081e643e4cb6127f08f
refs/heads/master
2022-07-17T18:55:13.348784
2020-05-18T23:00:51
2020-05-18T23:00:51
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,204
java
package guía_3; public class E5 { static String[][] employees = new String[20][2]; public static void main(String[] args) { // System.out.println(" ----------------------------------------------- \n"); System.out.println(" _______________________________________________ \n"); System.out.println("|\tEMPLEADO\t|\t SUELDO\t\t|"); System.out.println(" _______________________________________________ \n"); // System.out.println("\n ----------------------------------------------- "); // System.out.println(" ----------------------------------------------- \n"); for (int i = 0; i < employees.length; i++) { employees[i][0] = (i + 1) + ""; employees[i][1] = (int) ((Math.random() * 400000) + 301000) + ""; System.out.println("|\t " + (i + 1) + "\t\t|\t $" + employees[i][1] + "\t|"); System.out.println(" ----------------------------------------------- "); } int higherPay = 0; for (int i = 0; i < employees.length; i++) { if (employees[i][1].compareTo(employees[higherPay][1]) > 0) higherPay = i; } System.out.println( "\nEl empleado " + employees[higherPay][0] + " tiene el mayor sueldo con $" + employees[higherPay][1]); } }
[ "cristobalgajardo.v@gmail.com" ]
cristobalgajardo.v@gmail.com
b0cd873ddbd9a87d5c66dd537f1491302414adea
3a1b47dbfadc3ac09612df7c61fc8cd9fd04d098
/dp-common/src/main/java/net/chenlin/dp/common/utils/SpringContextUtils.java
01abf475ed0f0bbac556f7300f7a96245668e05f
[]
no_license
wendelhuang/workLog
9cd6086198138983fe3fcae748b2b10154393fbb
0082d9d85468ed19c21e8149d4eecab62a31e3d5
refs/heads/master
2022-12-28T16:04:51.958311
2019-06-28T14:37:56
2019-06-28T14:37:56
161,494,599
0
0
null
2022-11-16T10:54:23
2018-12-12T13:46:40
JavaScript
UTF-8
Java
false
false
1,150
java
package net.chenlin.dp.common.utils; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; /** * Spring Context 工具类 * @author zcl<yczclcn@163.com> */ public class SpringContextUtils implements ApplicationContextAware { public static ApplicationContext applicationContext; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { SpringContextUtils.applicationContext = applicationContext; } public static Object getBean(String name) { return applicationContext.getBean(name); } public static <T> T getBean(String name, Class<T> requiredType) { return applicationContext.getBean(name, requiredType); } public static boolean containsBean(String name) { return applicationContext.containsBean(name); } public static boolean isSingleton(String name) { return applicationContext.isSingleton(name); } public static Class<? extends Object> getType(String name) { return applicationContext.getType(name); } }
[ "weiwei5987@126.com" ]
weiwei5987@126.com
d7f5ba7d2498187d46aa29df582e58890d18fe05
9cee607ad73af91272e324dc28b92d739c58719c
/app/src/main/java/com/mahao/materialdesigndemo/SecondActivity.java
83dbdd1b42a17b35d63f3db263bd30a692108c55
[]
no_license
mahao521/MaterialDesign
ac7fb953b370876dc0ddded5a8a1df35d6d5cb8e
2fa268f40c78f136eea117b2bc4f31735aa8d897
refs/heads/master
2021-01-01T18:16:29.763476
2018-10-18T09:32:52
2018-10-18T09:32:52
98,294,461
0
0
null
null
null
null
UTF-8
Java
false
false
1,999
java
package com.mahao.materialdesigndemo; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.util.Pair; import android.support.v7.app.AppCompatActivity; import android.transition.Transition; import android.transition.TransitionInflater; import android.view.View; import android.view.Window; import android.widget.ImageView; public class SecondActivity extends AppCompatActivity { private View mImg; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); Transition explode = TransitionInflater.from(this).inflateTransition(android.R.transition.explode); getWindow().setEnterTransition(explode); setContentView(R.layout.activity_second); mImg = (ImageView) findViewById(R.id.img); } public void click(View view) { Intent intents = new Intent(SecondActivity.this,ThridActivity.class); /* // Pair pair = Pair.create(mImg,getString(R.string.app_name)); Pair<View, String> img1 = Pair.create(mImg, getString(R.string.app_name)); // Pair pair = new Pair(img,"mahao"); // Pair pair1 = new Pair(imgBoss,"lisi"); Log.i("mahao","dianjil"); ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(SecondActivity.this, img1); ActivityCompat.startActivity(this,intents,optionsCompat.toBundle());*/ Pair<View, String> img1 = Pair.create(mImg, getString(R.string.app_name)); // Pair<View, String> img2 = Pair.create(imageView2, getString(R.string.app)); ActivityOptionsCompat comapt= ActivityOptionsCompat.makeSceneTransitionAnimation(this, img1); //跳转 ActivityCompat.startActivity(this,new Intent(this,ThridActivity.class),comapt.toBundle()); } }
[ "mahao17000@163.com" ]
mahao17000@163.com
a7b5d98016a19d883d52a5148d8a1c9a2d8f8374
2d78a723242fae17e7c9f078f58cea44fe2c9fd9
/Ex03/src/ex03/Data.java
4adb3a3b5582ff592d36ee3b2c3dcdd59ba1bb99
[]
no_license
frankobf/Programacao-Orientada-a-Objetos
d0e259b74b01733a639ed7ae3571c4945a9c4659
99adda2b9e9a4e5dcf7b01008a62e6db36b4c75f
refs/heads/master
2022-01-20T04:47:55.722688
2019-06-25T03:28:13
2019-06-25T03:28:13
null
0
0
null
null
null
null
ISO-8859-3
Java
false
false
2,769
java
package ex03; public class Data { private int dia, mes, ano; public Data(int mes, int ano) { this(1, mes, ano); } public Data(int dia, int mes, int ano) { this.setData(dia, mes, ano); } public Data(String data) { this.setData(data); } public Data(int dia, String mes, int ano) { this(dia, Data.retornaMes(mes), ano); } public static int retornaMes(String mes) { mes = mes.toLowerCase(); switch (mes) { case "janeiro": return 1; case "fevereiro": return 2; case "março": return 3; case "abril": return 4; case "maio": return 5; case "junho": return 6; case "julho": return 7; case "agosto": return 8; case "setembro": return 9; case "outubro": return 10; case "novembro": return 11; case "dezembro": return 12; default: return 13; } } public Data() { this(1, 1, 1900); } public void setData(int dia, int mes, int ano) { if (Data.isDataValida(dia, mes, ano)) { this.dia = dia; this.mes = mes; this.ano = ano; } else { this.dia = 1; this.mes = 1; this.ano = 1900; } } public void setData(String data) { int firstindex = data.indexOf("/"); int secindex = data.indexOf("/", firstindex + 1); this.setData(Integer.parseInt(data.substring(0, firstindex)), Integer.parseInt(data.substring((firstindex + 1), secindex)), Integer.parseInt(data.substring((secindex + 1), (secindex + 5)))); } public String getData() { return this.toString(); } public int getDia() { return this.dia; } public int getMes() { return this.mes; } public int getAno() { return this.ano; } public static boolean isDataValida(int dia, int mes, int ano) { if (ano < 1582) { return false; } if (mes > 12) { return false; } if (mes == 1 || mes == 3 || mes == 5 || mes == 7 || mes == 8 || mes == 10 || mes == 12) { if (dia > 31 || dia < 1) { return false; } } else if (mes == 2) { if (Data.isBissexto(ano)) { if (dia > 29 || dia < 1) { return false; } } else { if (dia > 28 || dia < 1) { return false; } } } else { if (dia > 30 || dia < 1) { return false; } } return true; } private static boolean isBissexto(int ano) { if ((ano % 4 == 0 && ano % 100 != 0) || ano % 400 == 0) return true; return false; } public boolean equals(Object objeto) { Data aux = (Data) objeto; if (this.getDia() == aux.getDia() && this.getMes() == aux.getMes() && this.getAno() == aux.getAno()) { return true; } return false; } public String toString() { StringBuilder data = new StringBuilder(); data.append(this.getDia()); data.append("/"); data.append(this.getMes()); data.append("/"); data.append(this.getAno()); return data.toString(); } }
[ "frankobf@gmail.com" ]
frankobf@gmail.com
641d3c6264c0d94c3899cb3c2a0c27cb51d46458
0ccb46f085986808639013ceb945508fd13561b2
/heifeng-mall/heifeng-elasticsearch/src/main/java/com/heifeng/search/listener/GoodsListener.java
8f918ae42d957ca197d32884b7e5b95131ed5f5e
[]
no_license
LingFengX-code/items
c3c90514c88ab226e22b2677662bcb577c825c74
f309618f6788a6374746d4b70863fca7b5edfb31
refs/heads/master
2023-04-22T18:16:27.719601
2021-05-04T10:26:49
2021-05-04T10:26:49
364,217,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,876
java
package com.heifeng.search.listener; import com.heifeng.search.service.SearchService; import org.springframework.amqp.core.ExchangeTypes; import org.springframework.amqp.rabbit.annotation.Exchange; import org.springframework.amqp.rabbit.annotation.Queue; import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class GoodsListener { @Autowired private SearchService searchService; /** * 处理insert和update的消息 * * @param id * @throws Exception */ @RabbitListener(bindings = @QueueBinding( value = @Queue(value = "HEIFENG.CREATE.INDEX.QUEUE", durable = "true"), exchange = @Exchange( value = "HEIFENG.ITEM.EXCHANGE", ignoreDeclarationExceptions = "true", type = ExchangeTypes.TOPIC), key = {"item.insert", "item.update"})) public void listenCreate(Long id) throws Exception { if (id == null) { return; } // 创建或更新文档 this.searchService.createDocument(id); } /** * 处理delete的消息 * * @param id */ @RabbitListener(bindings = @QueueBinding( value = @Queue(value = "HEIFENG.DELETE.INDEX.QUEUE", durable = "true"), exchange = @Exchange( value = "HEIFENG.ITEM.EXCHANGE", ignoreDeclarationExceptions = "true", type = ExchangeTypes.TOPIC), key = "item.delete")) public void listenDelete(Long id) { if (id == null) { return; } // 删除文档 this.searchService.deleteDocument(id); } }
[ "1244535329@qq.com" ]
1244535329@qq.com
e9b92a9d90c06bd6338b311bb061e9270a436ae5
bc290f057cb4da91f85667d9c22058abbd9b3bb8
/InterOp-3.3.3-Linux-GNU-4.8.2centos5/share/illumina/interop/src/java/vector_extended_tile_metrics.java
55c6ba10399070ae4a182cafacce3fd68f4f7586
[]
no_license
MarioHsiao/autoRunTracker
791ae3ed17e4d021e38967bb0fc87e4c3ebf5ddb
cd28da529e1be54a4ad76015b374d2776a6ee16e
refs/heads/master
2021-08-30T23:06:40.341248
2017-12-19T19:18:03
2017-12-19T19:18:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,376
java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.10 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.illumina.interop; public class vector_extended_tile_metrics { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected vector_extended_tile_metrics(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(vector_extended_tile_metrics obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; interop_metricsJNI.delete_vector_extended_tile_metrics(swigCPtr); } swigCPtr = 0; } } public vector_extended_tile_metrics() { this(interop_metricsJNI.new_vector_extended_tile_metrics__SWIG_0(), true); } public vector_extended_tile_metrics(long n) { this(interop_metricsJNI.new_vector_extended_tile_metrics__SWIG_1(n), true); } public long size() { return interop_metricsJNI.vector_extended_tile_metrics_size(swigCPtr, this); } public long capacity() { return interop_metricsJNI.vector_extended_tile_metrics_capacity(swigCPtr, this); } public void reserve(long n) { interop_metricsJNI.vector_extended_tile_metrics_reserve(swigCPtr, this, n); } public boolean isEmpty() { return interop_metricsJNI.vector_extended_tile_metrics_isEmpty(swigCPtr, this); } public void clear() { interop_metricsJNI.vector_extended_tile_metrics_clear(swigCPtr, this); } public void add(extended_tile_metric x) { interop_metricsJNI.vector_extended_tile_metrics_add(swigCPtr, this, extended_tile_metric.getCPtr(x), x); } public extended_tile_metric get(int i) { return new extended_tile_metric(interop_metricsJNI.vector_extended_tile_metrics_get(swigCPtr, this, i), false); } public void set(int i, extended_tile_metric val) { interop_metricsJNI.vector_extended_tile_metrics_set(swigCPtr, this, i, extended_tile_metric.getCPtr(val), val); } }
[ "qliu2@illumina.com" ]
qliu2@illumina.com
6768226acb2a02413d1062893c62c7d395123c6f
433010ff1639be4c65f2b2f9e7827f66a001cbea
/app/src/main/java/com/cloudsys/smashintl/main/Presenter.java
a2d1c02bacca1f92d90c91e24cd3cd2bbfbb3a51
[]
no_license
azminpurushotham/smashinternational
972bd310a8a50d11e2f8d0a88866f305d4e23c75
d047de7bcf35695a05fccf52cad6aa89c5ae9ca3
refs/heads/master
2021-09-08T23:05:49.991152
2018-03-12T18:39:50
2018-03-12T18:39:50
116,998,555
0
0
null
2018-02-18T19:23:42
2018-01-10T19:01:23
Java
UTF-8
Java
false
false
3,355
java
package com.cloudsys.smashintl.main; import android.content.Context; import com.base.log.LogUtils; import com.cloudsys.smashintl.base.AppBaseActivity; import com.cloudsys.smashintl.base.AppBasePresenter; import com.cloudsys.smashintl.main.async.ServiceCall; import com.cloudsys.smashintl.main.async.ServiceCallBack; import org.json.JSONException; import org.json.JSONObject; import static com.cloudsys.smashintl.main.MainActivity.TAG; /** * Created by AzminPurushotham on 10/31/2017 time 15 : 58. */ public class Presenter extends AppBasePresenter implements UserActions, ServiceCallBack { ActionView mView; ServiceCall mServiceCall; public Presenter(ActionView mView, AppBaseActivity baseInstence) { super(mView, baseInstence); this.mView = mView; mServiceCall = new ServiceCall(this); } @Override public void logOut() { mServiceCall.logOut(); } public void dismissLogOut() { mView.dismissLogOut(); } public void showLogoutDialouge() { mView.showLogoutDialouge(); } @Override public Context getViewContext() { return mView.getViewContext(); } @Override public void onSuccessLogout(JSONObject mJsonObject) { try { mView.showWait(mJsonObject.getString("Value")); } catch (JSONException e) { LogUtils.v(TAG, e.getMessage()); } getSharedPreferenceHelper().clearPreferences(); mView.dismissLogOut(); mView.onstartLogin(); } @Override public void setJson(JSONObject mJsonObject) { } @Override public void onFailerCallBack(String message) { LogUtils.v("exception", message); mView.showSnackBar(message); } @Override public void onFailerCallBack(int message) { } @Override public void onFailerCallBack() { } @Override public void onCallfailerFromServerside() { } @Override public void onCallfailerFromServerside(String message) { LogUtils.v("exception", message); mView.showSnackBar(message); } @Override public void onCallfailerFromServerside(int message) { mView.showSnackBar(message); } @Override public void onCallfailerFromServerside(JSONObject mJsonObject) { try { mView.showWait(mJsonObject.getString("message")); } catch (JSONException e) { LogUtils.v(TAG, e.getMessage()); } } @Override public void onSuccessCallBack(String message) { } @Override public void onSuccessCallBack(JSONObject message) { } @Override public void onSuccessCallBack(int message) { } @Override public void onSuccessCallBack() { } @Override public void onExceptionCallBack(String message) { } @Override public void onExceptionCallBack(int message) { } @Override public void onExceptionCallBack() { } public void checkRunTimePermission(MainActivity mainActivity, String accessCoarseLocation) { } @Override public void permissionGranded(String permission) { } @Override public void permissionDenaid(String permission) { } @Override public void checkRunTimePermission(AppBaseActivity activity, String permission) { } }
[ "asminpurushotham@gmail.com" ]
asminpurushotham@gmail.com
4da897cd301d823a9765848dd4941db5404a9930
2f4a058ab684068be5af77fea0bf07665b675ac0
/utils/com/facebook/notifications/protocol/FetchGraphQLNotificationsParams$1.java
dd12c62d638d8cc5cfe5f15dde2d0827c7f5047e
[]
no_license
cengizgoren/facebook_apk_crack
ee812a57c746df3c28fb1f9263ae77190f08d8d2
a112d30542b9f0bfcf17de0b3a09c6e6cfe1273b
refs/heads/master
2021-05-26T14:44:04.092474
2013-01-16T08:39:00
2013-01-16T08:39:00
8,321,708
1
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.facebook.notifications.protocol; import android.os.Parcel; import android.os.Parcelable.Creator; final class FetchGraphQLNotificationsParams$1 implements Parcelable.Creator<FetchGraphQLNotificationsParams> { public FetchGraphQLNotificationsParams a(Parcel paramParcel) { return new FetchGraphQLNotificationsParams(paramParcel); } public FetchGraphQLNotificationsParams[] a(int paramInt) { return new FetchGraphQLNotificationsParams[paramInt]; } } /* Location: /data1/software/apk2java/dex2jar-0.0.9.12/secondary-1.dex_dex2jar.jar * Qualified Name: com.facebook.notifications.protocol.FetchGraphQLNotificationsParams.1 * JD-Core Version: 0.6.2 */
[ "macluz@msn.com" ]
macluz@msn.com
940a88f6359f1b37522be6d932b5558a2928a2e5
6bac7ac71d5d776a269d1d2aa2d0ed4a45b51cbb
/HackerRankPrograms/src/com/hackerrank/www/oop/SolutionArithmetic.java
651119d5be095c31844315ea3d788db1e26ce655
[]
no_license
Kaaviya-Muthukumaran/HackerRank
995d7f8d9891ce5551c56474962e7d3c19586158
9aa937dfa7927fef762115cd9943ad32ec600ddf
refs/heads/master
2021-01-20T05:19:19.338147
2017-04-29T08:10:26
2017-04-29T08:10:26
89,768,830
0
0
null
null
null
null
UTF-8
Java
false
false
852
java
package com.hackerrank.www.oop; import java.util.Scanner; public class SolutionArithmetic { // main method public static void main(String[] args) { MyCalculator my_calculator = new MyCalculator(); System.out.print("I implemented: "); ImplementedInterfaceNames(my_calculator); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //calling divisor method System.out.print(my_calculator.divisor_sum(n) + "\n"); sc.close(); } static void ImplementedInterfaceNames(Object o) { Class[] theInterfaces = o.getClass().getInterfaces(); for (int i = 0; i < theInterfaces.length; i++) { // getting interface name String interfaceName = theInterfaces[i].getName(); System.out.println(interfaceName); } } }
[ "kaaviyamuthukumaran@gmail.com" ]
kaaviyamuthukumaran@gmail.com
20dfe6c8082a0837a699e7636d6557c8e05222dd
5ab33dc3e7f13c05a50790270720cf4b4e430252
/API-Blog/src/main/java/com/debugbybrain/blog/config/ThymeLeafConfig.java
bc5dd141519ad020ca930ed4cefd808ae4e822a9
[]
no_license
hovanvydut/SBlog-BE
8c92e6f96e7a66ba21fcc8730a115582d353704c
6148fe245b1d3ad985284991e1af1b273d3c4d94
refs/heads/main
2023-07-24T00:24:55.294034
2021-09-06T03:55:59
2021-09-06T03:55:59
380,462,242
0
0
null
2021-09-06T03:56:00
2021-06-26T09:21:30
Java
UTF-8
Java
false
false
1,980
java
package com.debugbybrain.blog.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.thymeleaf.spring5.SpringTemplateEngine; import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; import org.thymeleaf.spring5.view.ThymeleafViewResolver; import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver; import org.thymeleaf.templateresolver.ITemplateResolver; /** * @author hovanvydut * Created on 7/6/21 */ @Configuration public class ThymeLeafConfig { @Value("${spring.mail.templates.path}") private String mailTemplatesPath; @Bean public SpringTemplateEngine templateEngine() { SpringTemplateEngine templateEngine = new SpringTemplateEngine(); templateEngine.setTemplateResolver(thymeleafTemplateResolver()); return templateEngine; } @Bean public SpringResourceTemplateResolver thymeleafTemplateResolver() { SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); templateResolver.setPrefix("/WEB-INF/views/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode("HTML5"); return templateResolver; } @Bean public ThymeleafViewResolver thymeleafViewResolver() { ThymeleafViewResolver viewResolver = new ThymeleafViewResolver(); viewResolver.setTemplateEngine(templateEngine()); return viewResolver; } @Bean public ITemplateResolver thymeleafClassLoaderTemplateResolver() { ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver(); templateResolver.setPrefix(mailTemplatesPath + "/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode("HTML"); templateResolver.setCharacterEncoding("UTF-8"); return templateResolver; } }
[ "hovanvydut@gmail.com" ]
hovanvydut@gmail.com
5ba77e7dcb0f5c966d1fb4f3052edcdef381e662
b6edfe851bff0e00aa28cb862c01f20e25ca8f9e
/src/util/VectorMath.java
25fdcc8e781a5786aaa277f8eb669888a9791aed
[]
no_license
tombakas/Visualization_1
d5399786ca196f2288958fbe6139b43bd342c806
41cd6cf428239d058c72fccab7dd6db3e4d5254f
refs/heads/master
2020-04-07T20:44:48.720185
2018-12-12T15:18:59
2018-12-12T15:18:59
158,701,323
0
0
null
null
null
null
UTF-8
Java
false
false
1,807
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package util; /** * * @author michel */ public class VectorMath { // assign coefficients c0..c2 to vector v public static void setVector(double[] v, double c0, double c1, double c2) { v[0] = c0; v[1] = c1; v[2] = c2; } // compute dotproduct of vectors v and w public static double dotproduct(double[] v, double[] w) { double r = 0; for (int i=0; i<3; i++) { r += v[i] * w[i]; } return r; } // compute distance between vectors v and w public static double distance(double[] v, double[] w) { double[] tmp = new double[3]; VectorMath.setVector(tmp, v[0]-w[0], v[1]-w[1], v[2]-w[2]); return Math.sqrt(VectorMath.dotproduct(tmp, tmp)); } public static double [] divideScalar(double[] v, double w) { v[0] = v[0] / w; v[1] = v[1] / w; v[2] = v[2] / w; return v; } // compute dotproduct of v and w public static double[] crossproduct(double[] v, double[] w, double[] r) { r[0] = v[1] * w[2] - v[2] * w[1]; r[1] = v[2] * w[0] - v[0] * w[2]; r[2] = v[0] * w[1] - v[1] * w[0]; return r; } public static double[] add(double[] v, double[] w) { v[0] = v[0] + w[0]; v[1] = v[1] + w[1]; v[2] = v[2] + w[2]; return v; } public static double[] normalize(double[] v) { double l = length(v); v[0] = v[0] / l; v[1] = v[1] / l; v[2] = v[2] / l; return v ; } // compute length of vector v public static double length(double[] v) { return Math.sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); } }
[ "tombakas@gmail.com" ]
tombakas@gmail.com
bceff40dd8e21fbd5e52fb840e27cf3c7ebd5bd4
081ba3a4ae692b455524131637ec499da20172be
/src/main/java/com/web/project/service/enterprise/ProjectCheckService.java
4f0f9ab4daca6e122b39bb4fd4f4f199578256bb
[]
no_license
orgPatentRoot/patent_manage_system
d843748ac6fa1f50ca702b05337d7c839aae3d0c
49bc7159ed0a4721641fa4ba81becbc66a1c0caa
refs/heads/master
2021-06-18T16:28:37.294547
2017-05-17T07:53:09
2017-05-17T07:53:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
package com.web.project.service.enterprise; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.web.project.dao.EnterpriseProjectDao; import com.web.project.dao.ProjectCheckDao; import com.web.project.model.enterprise.ProjectCheckBudget; import com.web.project.model.enterprise.ProjectCheckForm; import com.web.project.model.enterprise.ProjectCheckInfo; @Service public class ProjectCheckService { @Autowired ProjectCheckDao ProjectCheckDao; public ArrayList<ProjectCheckForm> getProjectFormsByEnterpriseID( int id) { return ProjectCheckDao.getProjectFormsByEnterpriseID(id); } public ProjectCheckForm getprojectcheckformByID(int id) { // TODO Auto-generated method stub return ProjectCheckDao.getprojectcheckformByID(id); } public ProjectCheckInfo getprojectcheckinfoByID(int id) { // TODO Auto-generated method stub return ProjectCheckDao.getprojectcheckinfoByID(id); } public ProjectCheckBudget getprojectcheckbudgetByID(int id) { // TODO Auto-generated method stub return ProjectCheckDao.getprojectcheckbudgetByID(id); } public void saveProjectCheckForm(ProjectCheckForm pcf) { // TODO Auto-generated method stub ProjectCheckDao.saveProjectCheckForm(pcf); } public void saveProjectCheckInfo(ProjectCheckInfo pci) { // TODO Auto-generated method stub ProjectCheckDao.saveProjectCheckInfo(pci); } public void saveProjectCheckBudget(ProjectCheckBudget pcb) { // TODO Auto-generated method stub ProjectCheckDao.saveProjectCheckBudget(pcb); } }
[ "695936973@qq.com" ]
695936973@qq.com
480482f2372a8e6bbf0d63140343fed53b2e8d36
2bcd11be73998b074e25ff8229ca12c457bb2c77
/Cibus/src/com/sovarb/cibus/ActivitySemaforo.java
1727fc2c1b7b8cf42efa93fb35816b984b2de4c1
[]
no_license
juanmi-gh/Cibus
77beda258f42f4cd667636d80176d624158bb674
6da06f4f7fd2b86b59b2319a773d3d9c5d548e10
refs/heads/master
2021-05-27T01:55:36.307865
2013-07-15T15:27:22
2013-07-15T15:27:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,992
java
package com.sovarb.cibus; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; public class ActivitySemaforo extends Activity { TextView mensaje, regla; ImageView semaforo; LinearLayout layout; String result, nombreAlimento; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_semaforo); mensaje = (TextView) findViewById(R.id.textMensaje); regla = (TextView) findViewById(R.id.textReglaFail); layout = (LinearLayout) findViewById(R.id.layoutSemaforo); semaforo = (ImageView) findViewById(R.id.imageSemaforo); Intent i = getIntent(); result = i.getStringExtra(S.SEMAFORO_RESULT); nombreAlimento = i.getStringExtra(S.NOMBRE); if(result.equals(S.RESULTADO.VALIDO.name())){ semaforo.setImageResource(R.drawable.ic_green_apple); layout.setBackgroundColor(Color.rgb(60, 255, 40)); mensaje.setText(nombreAlimento + S.CUMPLE_CRITERIO); mensaje.setTextColor(Color.WHITE); regla.setText(" "); }else if(result.equals(S.RESULTADO.INVALIDO.name())){ regla.setText(i.getStringExtra(S.REGLA)); semaforo.setImageResource(R.drawable.ic_red_apple); layout.setBackgroundColor(Color.rgb(255, 60, 40)); mensaje.setText(nombreAlimento + S.NO_CUMPLE_CRITERIO); mensaje.setTextColor(Color.WHITE); }else{ semaforo.setImageResource(R.drawable.ic_yellow_apple); layout.setBackgroundColor(Color.rgb(245, 245, 170)); mensaje.setText(S.NOT_FOUND_9 + nombreAlimento); mensaje.setTextColor(Color.BLACK); regla.setText(" "); } } @Override protected void onDestroy(){ super.onDestroy(); layout.setBackgroundColor(Color.rgb(221, 221, 221)); } public void pulsaAtras(View view){ Intent i = new Intent(); setResult(RESULT_OK, i); finish(); } }
[ "juancabrera.it@gmail.com" ]
juancabrera.it@gmail.com
01fc2766fcedcd67fe72cf81a883800885ff73d9
42c464971b52d22db0ca9a5566ddc0b0088a05f5
/lesson-005/src/main/java/dao/impl/UserDaoImpl.java
8a18616f443089b76b6d024aa72bfe18ee93bbc0
[]
no_license
MarkiianBachmaha/Java_Advanced_05
9a588a14bdabcaa4029cfcc2f87800e5ddc233b2
056eec1838f988c4360f1b55599ec454ff4bde37
refs/heads/master
2023-05-05T22:56:11.882102
2021-05-08T15:38:35
2021-05-08T15:38:35
365,550,459
0
0
null
null
null
null
UTF-8
Java
false
false
3,674
java
package dao.impl; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import dao.UserDao; import domain.User; import utils.ConnectionUtils; public class UserDaoImpl implements UserDao { private static String READ_ALL = "select * from user"; private static String CREATE = "insert into user(`email`,`first_name`, `last_name`, `role`) values (?,?,?,?)"; private static String READ_BY_ID = "select * from user where id =?"; private static String UPDATE_BY_ID = "update user set email=?, first_name = ?, last_name = ?, role=? where id = ?"; private static String DELETE_BY_ID = "delete from user where id=?"; private Connection connection; private PreparedStatement preparedStatement; public UserDaoImpl() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { connection = ConnectionUtils.openConnection(); } @Override public User create(User user) { try { preparedStatement = connection.prepareStatement(CREATE, Statement.RETURN_GENERATED_KEYS); preparedStatement.setString(1, user.getEmail()); preparedStatement.setString(2, user.getFirstName()); preparedStatement.setString(3, user.getLastName()); preparedStatement.setString(4, user.getRole()); preparedStatement.executeUpdate(); ResultSet rs = preparedStatement.getGeneratedKeys(); rs.next(); user.setId(rs.getInt(1)); } catch (SQLException e) { e.printStackTrace(); } return user; } @Override public User read(Integer id) { User user = null; try { preparedStatement = connection.prepareStatement(READ_BY_ID); preparedStatement.setInt(1, id); ResultSet result = preparedStatement.executeQuery(); result.next(); Integer userId = result.getInt("id"); String email = result.getString("email"); String firstName = result.getString("first_name"); String lastName = result.getString("last_name"); String role = result.getString("role"); user = new User(userId, email, firstName, lastName, role); } catch (SQLException e) { e.printStackTrace(); } return user; } @Override public User update(User user) { try { preparedStatement = connection.prepareStatement(UPDATE_BY_ID); preparedStatement.setString(1, user.getEmail()); preparedStatement.setString(2, user.getFirstName()); preparedStatement.setString(3, user.getLastName()); preparedStatement.setString(4, user.getRole()); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } return user; } @Override public void delete(Integer id) { try { preparedStatement = connection.prepareStatement(DELETE_BY_ID); preparedStatement.setInt(1, id); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } @Override public List<User> readAll() { List<User> userRecords = new ArrayList<>(); try { preparedStatement = connection.prepareStatement(READ_ALL); ResultSet result = preparedStatement.executeQuery(); while (result.next()) { Integer userId = result.getInt("id"); String email = result.getString("email"); String firstName = result.getString("first_name"); String lastName = result.getString("last_name"); String role = result.getString("role"); userRecords.add(new User(userId, email, firstName, lastName, role)); } } catch (SQLException e) { e.printStackTrace(); } return userRecords; } }
[ "Admin@Komp" ]
Admin@Komp
82a6884dca122192db0c55b556b04c4661c8b7a3
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project269/src/test/java/org/gradle/test/performance/largejavamultiproject/project269/p1346/Test26925.java
3a071d86799c51a17310f1a3e2c034df7c8add4e
[]
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
2,274
java
package org.gradle.test.performance.largejavamultiproject.project269.p1346; import org.gradle.test.performance.largejavamultiproject.project269.p1345.Production26916; import org.junit.Test; import static org.junit.Assert.*; public class Test26925 { Production26925 objectUnderTest = new Production26925(); @Test public void testProperty0() { Production26916 value = new Production26916(); objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { Production26920 value = new Production26920(); objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { Production26924 value = new Production26924(); objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
47b56eac6c3f194e0217bd17c315c18f1dfe4a46
d4bd7ca4399829937b21493b368c3e1c8468660d
/src/main/java/labs/join/JobChainDriver.java
c551dab7e59c113e87e9a5923d5b4215dd9a8291
[]
no_license
rafaelpossas/usyd-cc-mapreduce
198fa06077c12f018284b0b56cd6f864e5204482
6607b1b8b88584e3ac7944b965ef41d32822f941
refs/heads/master
2021-01-19T16:16:49.475660
2016-04-21T01:39:11
2016-04-21T01:39:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,455
java
package labs.join; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; import org.apache.hadoop.util.GenericOptionsParser; import org.apache.hadoop.fs.FileSystem; /** * This is a sample program to chain the place filter job and replicated join job. * * @author Ying Zhou * */ public class JobChainDriver { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (otherArgs.length < 3) { System.err.println("Usage: JobChainDriver <inPlace> <inPhoto> <out> [countryName]"); System.exit(2); } // pass a parameter to mapper class if (otherArgs.length == 4){ conf.set("mapper.placeFilter.country", otherArgs[3]); } Path tmpFilterOut = new Path("tmpFilterOut"); // a temporary output path for the first job Job placeFilterJob = Job.getInstance(conf, "Place Filter"); placeFilterJob.setJarByClass(PlaceFilterDriver.class); placeFilterJob.setNumReduceTasks(0); placeFilterJob.setMapperClass(PlaceFilterMapper.class); placeFilterJob.setOutputKeyClass(Text.class); placeFilterJob.setOutputValueClass(Text.class); TextInputFormat.addInputPath(placeFilterJob, new Path(otherArgs[0])); TextOutputFormat.setOutputPath(placeFilterJob, tmpFilterOut); placeFilterJob.waitForCompletion(true); Job joinJob = Job.getInstance(conf, "Replication Join"); joinJob.addCacheFile(new Path("tmpFilterOut/part-m-00000").toUri()); joinJob.setJarByClass(ReplicateJoinDriver.class); joinJob.setNumReduceTasks(0); joinJob.setMapperClass(ReplicateJoinMapper.class); joinJob.setOutputKeyClass(Text.class); joinJob.setOutputValueClass(Text.class); TextInputFormat.addInputPath(joinJob, new Path(otherArgs[1])); TextOutputFormat.setOutputPath(joinJob, new Path(otherArgs[2])); joinJob.waitForCompletion(true); // remove the temporary path FileSystem.get(conf).delete(tmpFilterOut, true); } }
[ "rafaelpossas@gmail.com" ]
rafaelpossas@gmail.com
99ac6c08a2e016ba3b605366f5bd2b2574b143de
6661fa92c9a4a1245ddb7238d449129cd55d3405
/src/main/java/com/example/lesson2task1/repostory/ClientRepository.java
5a4b699b5040eafcf58459c95b09f448904df482
[]
no_license
AbrorHoshimov/Spring2modulles2task2
b8a1e0a1bce6ba8a17215fd60da06aaa5f2f1a46
17703c6d0879520b0613dfbebe706f74cd626d83
refs/heads/master
2023-08-06T05:58:27.950367
2021-10-05T18:54:47
2021-10-05T18:54:47
413,903,773
0
0
null
null
null
null
UTF-8
Java
false
false
506
java
package com.example.lesson2task1.repostory; import com.example.lesson2task1.entity.Category; import com.example.lesson2task1.entity.Client; import com.example.lesson2task1.projection.SupplierProjection; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(path = "client",excerptProjection = SupplierProjection.class) public interface ClientRepository extends JpaRepository<Client,Integer> { }
[ "abrorjonronaldo@gmail.com" ]
abrorjonronaldo@gmail.com
ca861ef5b914bc68a9eae5a2e8800d82484cd6d1
ba83274cc461a659d2902b098aed61685dd1e5c9
/AndroidSummary/interview/src/main/java/info/qianlong/interview/db/UserEntity.java
6956d342867d4cf997e125d7f43d8e68d44855e1
[]
no_license
abc20899/AndroidSummary
472d452e02a11f6d760dee7a426b240bc182a957
86d2039f66ec54ab35138c4af9fbee174e08e373
refs/heads/master
2020-03-07T05:13:49.145739
2018-12-18T06:18:03
2018-12-18T06:18:03
127,289,901
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
//package info.qianlong.interview.db; // //import io.realm.RealmObject; // ///** // * Created by android on 2017/12/8. // */ //public class UserEntity extends RealmObject { // // public Long userid; // // public String token; // // public String avatar; // // public String phone; // // public String refreshToken; //}
[ "abc20899@163.com" ]
abc20899@163.com
27f4b0cf256d901d4bf4cc35c88c4f1a1822d1d1
0b4fdbb30cdb7825f13e0df1225955e508b0c245
/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionBean.java
7580188a3a579e94212a3120d13970dc0343489e
[]
no_license
mehmetayan84/microservices-practice
4f6983e806d8e542f121e2a827fda208c6265185
a04c70f58f1aec0266894b7e98011cbe69106fdc
refs/heads/master
2020-04-23T12:27:27.337144
2019-02-18T18:08:36
2019-02-18T18:08:36
171,168,960
0
0
null
null
null
null
UTF-8
Java
false
false
1,947
java
package com.in28minutes.microservices.currencyconversionservice; import java.math.BigDecimal; public class CurrencyConversionBean { private Long id; private String from; private String to; private BigDecimal conversionMultiplier; private BigDecimal quantity; private BigDecimal totalCalculatedAmount; private int port; public CurrencyConversionBean() { } public CurrencyConversionBean(Long id, String from, String to, BigDecimal conversionMultiplier, BigDecimal quantity, BigDecimal totalCalculatedAmount, int port) { this.id = id; this.from = from; this.to = to; this.conversionMultiplier = conversionMultiplier; this.quantity = quantity; this.totalCalculatedAmount = totalCalculatedAmount; this.port = port; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getTo() { return to; } public void setTo(String to) { this.to = to; } public BigDecimal getConversionMultiplier() { return conversionMultiplier; } public void setConversionMultiplier(BigDecimal conversionMultiplier) { this.conversionMultiplier = conversionMultiplier; } public BigDecimal getQuantity() { return quantity; } public void setQuantity(BigDecimal quantity) { this.quantity = quantity; } public BigDecimal getTotalCalculatedAmount() { return totalCalculatedAmount; } public void setTotalCalculatedAmount(BigDecimal totalCalculatedAmount) { this.totalCalculatedAmount = totalCalculatedAmount; } public int getPort() { return port; } public void setPort(int port) { this.port = port; } }
[ "mehmetayan84@gmail.com" ]
mehmetayan84@gmail.com
276ec00628444f56809951aecf8f5a93962d14b7
210e49c68b9d62947c8cff8d2046735032e68778
/AndroidStudioSource/app/src/main/java/mdsafety/euroitapevi/Config.java
d85c3188cdb45548bfee837efbc249940ad4ff2d
[]
no_license
alMubarmij/AWebViewGold
2774f3a089e54da915bf34c9310520e8b29af68e
4958fe3ac6028c3abc2d70a0507f32169966f362
refs/heads/master
2022-06-10T14:54:43.729661
2020-04-09T13:39:40
2020-04-09T13:39:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,095
java
package mdsafety.euroitapevi; public class Config { // *********************************************************** // *** THANKS FOR BEING PART OF THE WEBVIEWGOLD COMMUNITY! *** // *********************************************************** // *** Your Purchase Code of CodeCanyon *** // 1. Buy a WebViewGold license (https://www.webviewgold.com/download/android) for each app you publish. If your app is going to be free, a "Regular license" is required. If your app will be sold to your users or if you use the In-App Purchases API, an "Extended license" is required. More info: https://codecanyon.net/licenses/standard?ref=onlineappcreator // 2. Grab your Purchase Code (this is how to find it quickly: https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-) // 3. Great! Just enter it here and restart your app: public static final String PURCHASECODE = "09e212eb-b0ca-457e-af20-641c935a43d9"; // 4. Enjoy your app! :) /** * Main configuration of your WebViewGold app */ // Domain host and subdomain without any https:// or http:// prefixes (e.g. "www.example.org") // public static final String HOST = "www.webviewgold.com/demo/general_test.php"; public static final String HOST = "euroitapevi.mdsafety1.com.br"; // Your URL including https:// or http:// prefix and including www. or any required subdomain (e.g. "https://www.example.org") public static final String HOME_URL = "https://euroitapevi.mdsafety1.com.br"; // Set to "false" to disable the progress spinner/loading spinner public static final boolean ACTIVATE_PROGRESS_BAR = true; // Set a customized UserAgent for WebView URL requests (or leave it empty to use the default Android UserAgent) public static final String USER_AGENT = ""; // Set to "true" to open external links in another browser by default public static final boolean OPEN_EXTERNAL_URLS_IN_ANOTHER_BROWSER = true; // Set to "true" to open links with attributes (_blank, _self) in new a tab by default public static final boolean OPEN_SPECIAL_URLS_IN_NEW_TAB = true; // Set to "true" to clear the WebView cache on each app startup and do not use cached versions of your web app/website public static final boolean CLEAR_CACHE_ON_STARTUP = true; //Set to "true" to use local "assets/index.html" file instead of URL public static final boolean USE_LOCAL_HTML_FOLDER = false; //Set to "true" to enable deep linking for App Links (take a look at the documentation for further information) public static final boolean IS_DEEP_LINKING_ENABLED = false; // Set to "true" to activate the splash screen public static final boolean SPLASH_SCREEN_ACTIVATED = true; //Set the splash screen timeout time in milliseconds public static final int SPLASH_TIMEOUT = 3600; //Set to "true" to close the app by pressing the hardware back button public static final boolean EXIT_APP_BY_BACK_BUTTON = false; /** * Dialog options */ public static boolean SHOW_FIRSTRUN_DIALOG = true; //Set to false to disable the First Run Dialog public static boolean SHOW_FACEBOOK_DIALOG = false; //Set to false to disable the Follow On Facebook Dialog public static boolean SHOW_RATE_DIALOG = true; //Set to false to disable the Rate This App Dialog // Set the minimum number of days to be passed after the application is installed before the "Rate this app" dialog will be displayed public static final int RATE_DAYS_UNTIL_PROMPT = 3; // Set the minimum number of application launches before the "Rate this app" dialog will be displayed public static final int RATE_LAUNCHES_UNTIL_PROMPT = 3; // Set the minimum number of days to be passed after the application is installed before the "Follow on Facebook" dialog will be displayed public static final int FACEBOOK_DAYS_UNTIL_PROMPT = 2; // Set the minimum number of application launches before the "Rate this app" dialog will be displayed public static final int FACEBOOK_LAUNCHES_UNTIL_PROMPT = 4; // Set the URL of your Facebook page public static final String FACEBOOK_URL = ""; /** * OneSignal options */ //Set to "true" to activate OneSignal Push (set OneSignal IDs in the build.gradle file) public static final boolean PUSH_ENABLED = false; //Set to "true" if you want to extend URL request by ?onesignal_push_id=XYZ (set the OneSignal IDs in the build.gradle file) public static final boolean PUSH_ENHANCE_WEBVIEW_URL = false; //Set to "true" if WebView should be reloaded when the app gets a UserID from OneSignal (set the OneSignal IDs in the build.gradle file) public static final boolean PUSH_RELOAD_ON_USERID = false; /** * Firebase Push options */ //Set to "true" to activate Firebase Push (download the google-services.json file and replace the existing one via Mac Finder/Windows Explorer) public static final boolean FIREBASE_PUSH_ENABLED = false; /** * AdMob options */ //Set to "true" if you want to display AdMob banner ads (set the AdMob IDs in the strings.xml file) public static final boolean SHOW_BANNER_AD = false; //Set to "true" if you want to display AdMob fullscreen interstitial ads after X website clicks (set the AdMob IDs in the strings.xml file) public static final boolean SHOW_FULL_SCREEN_AD = false; //X website clicks for AdMob interstitial ads (set the AdMob IDs in the strings.xml file) public static final int SHOW_AD_AFTER_X = 5; //Set the Google Play In-App Purchase Key (receive it from Google Play Developer Console) public static final String PURCHASE_LICENSE_KEY = "123456789"; //Set the Purchase Item Name ID (same as in Play Store Developer Console) public static String PURCHASE_ITEM = "android.test.purchased"; public static String SUBSCRIPTION_ITEM = "testing_sub"; //Set to "true" to hide the AdMob ads after a successful In-App Purchase public static boolean HIDE_ADS_FOR_PURCHASE = false; }
[ "matheus@tb.digital" ]
matheus@tb.digital
56954c749184c4d375b1bbae91c2a963dc81814e
13e40d2c4e26da498ba858b6beb642b67b0333a0
/financas/src/br/com/hibernatejpa/financas/teste/TesteMovimentacaoPorCategoria.java
f5e70d72adf765eb99274350d3e1cb4b27d3d43c
[]
no_license
wellcam/alura
08ea85377e51e582900ea59fe842fead693fedf3
d9fbfcd26ceeb2c72d9d4cdbebd7b42b96140368
refs/heads/master
2022-12-29T01:11:36.010419
2020-01-09T20:14:54
2020-01-09T20:14:54
198,681,723
0
0
null
2022-12-16T05:46:46
2019-07-24T17:33:30
Java
UTF-8
Java
false
false
1,098
java
package br.com.hibernatejpa.financas.teste; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Query; import br.com.hibernatejpa.financas.modelo.Categoria; import br.com.hibernatejpa.financas.modelo.Movimentacao; import br.com.hibernatejpa.financas.util.JPAUtil; public class TesteMovimentacaoPorCategoria { public static void main(String[] args) { EntityManager em = new JPAUtil().getEntityManager(); em.getTransaction().begin(); Categoria categoria = new Categoria(); categoria.setId(3); String jpql = "SELECT m FROM Movimentacao m JOIN m.categoria c WHERE c = :pCategoria ORDER BY valor"; Query query = em.createQuery(jpql); query.setParameter("pCategoria", categoria); List <Movimentacao> resultados = query.getResultList(); for (Movimentacao movimentacao : resultados) { System.out.println("Descricao: " + movimentacao.getDescricao() + " ---- Valor: " + movimentacao.getValor()); System.out.println("Conta.id: " + movimentacao.getConta().getId()); } em.getTransaction().commit(); em.close(); } }
[ "wellington.camilo@discover.com.br" ]
wellington.camilo@discover.com.br
0af33cff3c492d46b1b2f2bb618fc36d95bcb739
2da370a9edff9c5ff197c16347bc7f13fe36f753
/chapter-2-spring-boot-quick-start/src/main/java/spring/boot/core/domain/User.java
92faef9bf7f70defa96c4e39feb28a8572f1e5c4
[ "Apache-2.0" ]
permissive
wangh2/springboot-demo-more-
7d4ae3280f41d9893a4ff132d8bc62b0351009b0
95da0ba866862e8e32ee75986a1a32fda5c9b9a3
refs/heads/master
2021-07-17T20:43:19.993443
2017-10-26T09:21:56
2017-10-26T09:21:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,314
java
package spring.boot.core.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import java.io.Serializable; /** * 用户实体类 * * Created by by wh on 21/07/2017. */ @Entity public class User implements Serializable { /** * 编号 */ @Id @GeneratedValue private Long id; /** * 名称 */ private String name; /** * 年龄 */ private Integer age; /** * 出生时间 */ private String birthday; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getBirthday() { return birthday; } public void setBirthday(String birthday) { this.birthday = birthday; } @Override public String toString() { return "User{" + "id=" + id + ", name='" + name + '\'' + ", age=" + age + ", birthday=" + birthday + '}'; } }
[ "990301422@qq.com" ]
990301422@qq.com
23a483d255b5a2d6627e5c21c936653d1837b878
df37a7d2e6b12c8c47d39ddf3da48edc28df00c7
/src/main/java/com/ebay/sdk/call/AddSellingManagerProductCall.java
35cb36850f52e0ce8455fbe5faf8bd521cca9b62
[]
no_license
Dorisliy/ssmpro
6b6a26279a042eaae05535ce2000ea8ae8f8c4e7
7f50762e4477f32d92a0f4a95871044330c6b7b7
refs/heads/master
2021-01-23T09:10:20.875103
2017-12-15T06:13:43
2017-12-15T06:13:43
102,560,438
0
0
null
null
null
null
UTF-8
Java
false
false
6,343
java
/* Copyright (c) 2013 eBay, Inc. This program is licensed under the terms of the eBay Common Development and Distribution License (CDDL) Version 1.0 (the "License") and any subsequent version thereof released by eBay. The then-current version of the License can be found at http://www.opensource.org/licenses/cddl1.php and in the eBaySDKLicense file that is under the eBay SDK ../docs directory. */ package com.ebay.sdk.call; import java.lang.Long; import com.ebay.sdk.*; import com.ebay.soap.eBLBaseComponents.*; /** * Wrapper class of the AddSellingManagerProduct call of eBay SOAP API. * <br> * <p>Title: SOAP API wrapper library.</p> * <p>Description: Contains wrapper classes for eBay SOAP APIs.</p> * <p>Copyright: Copyright (c) 2009</p> * <p>Company: eBay Inc.</p> * <br> <B>Input property:</B> <code>SellingManagerProductDetails</code> - This container is used to provide details about the Selling Manager product, such as product name, quantity available, and unit price. * <br> <B>Input property:</B> <code>FolderID</code> - This is the unique identifier of the folder in which the new product will be placed. This folder can be a new folder or a folder that already exists for the seller in Selling Manager Pro. If no folder is specified through this field, the new product is place into the <em>My Products</em> folder by default. * <br> <B>Input property:</B> <code>SellingManagerProductSpecifics</code> - This container allows the seller to specify item specifics for a product, to create a product variation group and variation specifics, and/or to specify a listing category for the product or product variation group. A product variation group can be transferred into a listing template that can create a multiple-variation listing. The listing category can either be provided through the <b>PrimaryCategoryID</b> value of this call, or through the <b>Item.PrimaryCategory.CategoryID</b> field of the subsequent <b>AddSellingManagerTemplate</b> call. * <br> <B>Output property:</B> <code>ReturnedSellingManagerProductDetails</code> - This container includes the same information that was passed into the <b>SellingManagerProductDetails</b> container in the request, as well as a new <b>ProductID</b> value if the new product was successfully created. * * @author Ron Murphy * @version 1.0 */ public class AddSellingManagerProductCall extends com.ebay.sdk.ApiCall { private SellingManagerProductDetailsType sellingManagerProductDetails = null; private Long folderID = null; private SellingManagerProductSpecificsType sellingManagerProductSpecifics = null; private SellingManagerProductDetailsType returnedSellingManagerProductDetails=null; /** * Constructor. */ public AddSellingManagerProductCall() { } /** * Constructor. * @param apiContext The ApiContext object to be used to make the call. */ public AddSellingManagerProductCall(ApiContext apiContext) { super(apiContext); } /** * The base request type of the <b>AddSellingManagerProduct</b> call, which is used to create a product or a group of product variations within the Selling Manager Pro system. Once a Selling Manager Pro product or production variation group is created, the product settings and product specifics can be transferred over into a Selling Manager Pro listing template with the <b>AddSellingManagerTemplate</b> call. * * <br> * @throws ApiException * @throws SdkException * @throws Exception * @return The SellingManagerProductDetailsType object. */ public SellingManagerProductDetailsType addSellingManagerProduct() throws com.ebay.sdk.ApiException, com.ebay.sdk.SdkException, java.lang.Exception { AddSellingManagerProductRequestType req; req = new AddSellingManagerProductRequestType(); if (this.sellingManagerProductDetails != null) req.setSellingManagerProductDetails(this.sellingManagerProductDetails); if (this.folderID != null) req.setFolderID(this.folderID); if (this.sellingManagerProductSpecifics != null) req.setSellingManagerProductSpecifics(this.sellingManagerProductSpecifics); AddSellingManagerProductResponseType resp = (AddSellingManagerProductResponseType) execute(req); this.returnedSellingManagerProductDetails = resp.getSellingManagerProductDetails(); return this.getReturnedSellingManagerProductDetails(); } /** * Gets the AddSellingManagerProductRequestType.folderID. * @return Long */ public Long getFolderID() { return this.folderID; } /** * Sets the AddSellingManagerProductRequestType.folderID. * @param folderID Long */ public void setFolderID(Long folderID) { this.folderID = folderID; } /** * Gets the AddSellingManagerProductRequestType.sellingManagerProductDetails. * @return SellingManagerProductDetailsType */ public SellingManagerProductDetailsType getSellingManagerProductDetails() { return this.sellingManagerProductDetails; } /** * Sets the AddSellingManagerProductRequestType.sellingManagerProductDetails. * @param sellingManagerProductDetails SellingManagerProductDetailsType */ public void setSellingManagerProductDetails(SellingManagerProductDetailsType sellingManagerProductDetails) { this.sellingManagerProductDetails = sellingManagerProductDetails; } /** * Gets the AddSellingManagerProductRequestType.sellingManagerProductSpecifics. * @return SellingManagerProductSpecificsType */ public SellingManagerProductSpecificsType getSellingManagerProductSpecifics() { return this.sellingManagerProductSpecifics; } /** * Sets the AddSellingManagerProductRequestType.sellingManagerProductSpecifics. * @param sellingManagerProductSpecifics SellingManagerProductSpecificsType */ public void setSellingManagerProductSpecifics(SellingManagerProductSpecificsType sellingManagerProductSpecifics) { this.sellingManagerProductSpecifics = sellingManagerProductSpecifics; } /** * Valid after executing the API. * Gets the returned AddSellingManagerProductResponseType.returnedSellingManagerProductDetails. * * @return SellingManagerProductDetailsType */ public SellingManagerProductDetailsType getReturnedSellingManagerProductDetails() { return this.returnedSellingManagerProductDetails; } }
[ "891799155@qq.com" ]
891799155@qq.com
3652a34310ec1813fb5aff959fb836a3e37acc00
202c017c96be4b999c6f1bac95b6fb57e65bd1f1
/src/com/redinfo/red4s/app/SearchActivity.java
0deaba2aeffe0ff0244a687f7b6dee8693e9c3c9
[]
no_license
FranklinNEO/GuoTai
a225e55c48923546f0af1bfab0f970be47f57042
b5dc70e7b713c1f53ccc9461d3cca9d71f8f2139
refs/heads/master
2021-01-20T11:01:42.008976
2014-02-25T06:55:51
2014-02-25T06:55:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
19,507
java
package com.redinfo.red4s.app; import android.content.Context; import mexxen.mx5010.barcode.*; import android.content.DialogInterface; import android.text.Html; import android.text.Html.ImageGetter; import android.util.Log; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import com.redinfo.guotai.R; import com.redinfo.red4s.data.CodeDBHelper; import com.redinfo.red4s.ui.CustomDialog; import com.redinfo.red4s.barcode.CaptureActivity; import com.redinfo.red4s.datamodle.DataRow; import com.redinfo.red4s.datamodle.DataTable; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.loopj.android.http.AsyncHttpClient; import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.RequestParams; import android.app.Dialog; import android.app.ListActivity; import android.content.Intent; import android.database.sqlite.SQLiteDatabase; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.lang.reflect.Array; import java.text.SimpleDateFormat; import java.util.ArrayList; import org.json.JSONException; import org.json.JSONObject; public final class SearchActivity extends ListActivity { private static final int BARCODE_INTENT_REQ_CODE = 0x965; public final static String URL = "/data/data/com.redinfo.guotai/databases"; private static final String BARCODE_SCANER_INTENT = "com.redinfo.red4s.barcode.SCAN"; SQLiteDatabase db = null; public CodeDBHelper m_db = null; public Dialog querydialog = null; public Dialog logoutdialog = null; private Button searchButton = null; private Button scanButton = null; private ListView listView = null; private MulitSingleTableAdapter listItemAdapter = null; private EditText barcodeEditText = null; private static final int MENU_HISTORY = Menu.FIRST; private static final int MENU_ABOUT = Menu.FIRST + 1; private static final int MENU_LOGOUT = Menu.FIRST + 2; private String reString = null; private String Result_code = null; private String Result_content = null; private int Result_flag = 0; private String path = null; // private BarcodeManager bm = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.search); m_db = CodeDBHelper.getInstance(SearchActivity.this); File file = new File(URL, CodeDBHelper.DATABASE_NAME); db = SQLiteDatabase.openOrCreateDatabase(file, null); this.scanButton = (Button) this.findViewById(R.id.scanButton); this.barcodeEditText = (EditText) findViewById(R.id.code); this.searchButton = (Button) this .findViewById(R.id.search_searchButton); // bm = new BarcodeManager(this); // 添加扫描事件监听 // bm.addListener(new BarcodeListener() { // // 重写barcodeEvent 方法,获取条码事件 // public void barcodeEvent(BarcodeEvent event) { // // 当条码事件的命令为“SCANNER_READ”时,进行操作 // if (event.getOrder().equals("SCANNER_READ")) { // // 调用getBarcode()方法读取条码信息 // String barcode = bm.getBarcode(); // SearchActivity.this.barcodeEditText.setText(barcode); // searchBarcode(barcode); // } // } // }); // TextView itv = (TextView) findViewById(R.id.itv); // ImageGetter imageGetter = new ImageGetter() { // public Drawable getDrawable(String source) { // int id = Integer.parseInt(source); // // Drawable d = getResources().getDrawable(id); // d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); // return d; // } // }; // itv.append(Html.fromHtml( // " <img src=\"" + R.drawable.device_access_camera // + "\"> 启动手机摄像头拍摄条码快速查询", imageGetter, null)); // this.imm = (InputMethodManager) // getSystemService(INPUT_METHOD_SERVICE); this.listView = this.getListView(); // this.emptyTextView = (TextView) // this.findViewById(android.R.id.empty); querydialog = new Dialog(SearchActivity.this, R.style.mmdialog); querydialog.setContentView(R.layout.query_dialog); Bundle bundle = this.getIntent().getExtras(); if (bundle != null) { Result_code = bundle.getString("result_code"); Result_content = bundle.getString("result_content"); Result_flag = bundle.getInt("result_flag"); Log.d("Result_code", Result_code); Log.d("Result_content", Result_content); this.barcodeEditText.setText(Result_code); if (Result_flag == 1) { DataTable[] result = null; String jsonString = Result_content; if (jsonString == null) result = null; char cr = 65279; String t = String.valueOf(cr); jsonString = jsonString.replace("\t", "").replace(t, ""); Gson g = new Gson(); try { result = g.fromJson(jsonString, DataTable[].class); } catch (Exception ex) { result = null; } // if (result != null) { // ((BcmApplication) SearchActivity.this.getApplication()) // .setSearchResult(barcodeEditText.getText().toString(), // result); // } else { // reString = Result_content; // ((BcmApplication) SearchActivity.this.getApplication()) // .setSearchResult(barcodeEditText.getText().toString(), // getDatas()); // } ShowInfo(result); } else if (Result_flag == 0) { reString = Result_content; ShowInfo(getDatas().toArray(new DataTable[] {})); } } } @Override public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub menu.add(0, MENU_HISTORY, 0, "历史记录"); menu.add(0, MENU_ABOUT, 0, "关于"); menu.add(0, MENU_LOGOUT, 0, "退出"); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub switch (item.getItemId()) { case MENU_LOGOUT: // Dialog dialog = null; // CustomDialog.Builder customBuilder = new CustomDialog.Builder( // SearchActivity.this); // customBuilder // .setMessage("确定要注销您的登录信息吗?") // .setNegativeButton("取消", // new DialogInterface.OnClickListener() { // public void onClick(DialogInterface dialog, // int which) { // dialog.dismiss(); // } // }) // .setPositiveButton(" 退出登录 ", // new DialogInterface.OnClickListener() { // public void onClick(DialogInterface dialog, // int which) { // try { // FileOutputStream outStream = SearchActivity.this // .openFileOutput("userInfo.txt", // Context.MODE_PRIVATE); // String content = "" + ";" + "" + ";" // + ""; // outStream.write(content.getBytes()); // outStream.close(); // } catch (IOException ex) { // // } // // File file = new File(URL, // // CodeDBHelper.DATABASE_NAME); // // db = SQLiteDatabase.openOrCreateDatabase( // // file, null); // // db.delete(CodeDBHelper.CODE_TABLE_NAME, // // null, null); // // db.close(); // Intent intent = new Intent( // getApplication(), // RegistrationActivity.class); // intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // startActivity(intent); // SearchActivity.this.finish(); // dialog.dismiss(); // } // }); // dialog = customBuilder.create(); // dialog.show(); Dialog dialog = null; CustomDialog.Builder customBuilder = new CustomDialog.Builder( SearchActivity.this); customBuilder .setMessage("确定要退出国台酒业物流稽查软件?") .setNegativeButton("取消", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .setPositiveButton("退出稽查软件", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); InfoType.activity.finish(); finish(); } }); dialog = customBuilder.create(); dialog.show(); return true; case MENU_HISTORY: Intent intent = new Intent(); Bundle userBundle = new Bundle(); userBundle.putString("username", ((BcmApplication) this.getApplication()).getUserId()); intent.putExtras(userBundle); intent.setClass(SearchActivity.this, HistoryList.class); startActivity(intent); return true; case MENU_ABOUT: String strName = ((BcmApplication) this.getApplication()) .getUserId(); Intent dataIntent = new Intent(); Bundle bundle = new Bundle(); bundle.putString("user_name", strName); dataIntent.putExtras(bundle); dataIntent.setClass(SearchActivity.this, AboutActivity.class); startActivity(dataIntent); return true; default: return super.onOptionsItemSelected(item); } } public ArrayList<DataTable> getDatas() { DataTable t1 = new DataTable(); t1.setTableName("没有查询到相关数据"); DataRow t1R = new DataRow(); reString = reString.replaceAll("\"", ""); t1R.addNewData("注意", reString); t1.addNewRow(t1R); ArrayList<DataTable> r = new ArrayList<DataTable>(); r.add(t1); final int size = r.size(); DataTable[] result = new DataTable[size]; // r.toArray(result); return r; } public ArrayList<DataTable> getNoDatas() { DataTable t1 = new DataTable(); t1.setTableName("没有查询到相关数据"); DataRow t1R = new DataRow(); t1R.addNewData("注意", "获取服务器数据失败!"); t1.addNewRow(t1R); ArrayList<DataTable> r = new ArrayList<DataTable>(); r.add(t1); final int size = r.size(); DataTable[] result = new DataTable[size]; // r.toArray(result); return r; } public void onSearchButtonClick(View view) { String barcode = this.barcodeEditText.getText().toString(); path = null; try { this.searchBarcode(barcode); } catch (Exception e) { } } public void onScanButtonClick(View view) { this.openScanner(); } private void openScanner() { Intent intent = new Intent(BARCODE_SCANER_INTENT); intent.setClass(SearchActivity.this, CaptureActivity.class); this.startActivityForResult(intent, BARCODE_INTENT_REQ_CODE); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == BARCODE_INTENT_REQ_CODE) { if (resultCode == RESULT_OK) { String contents = intent.getStringExtra("SCAN_RESULT"); path = intent.getStringExtra("PIC_PATH"); Log.d("path", path); // byte b[] = contents.getBytes(); // byte b[]=hexStringToBytes(contents); // this.barcodeEditText.setText(contents); String prefixStr = contents.substring(0, 27); char begin = contents.charAt(26); char end = contents.charAt(39); if (contents.length() == 40 & (prefixStr.equals("http://fw.guotaiworld.com/S")) & (contents.endsWith("D"))) { String str = contents.substring(27, 39); try { this.searchBarcode(str); } catch (Exception e) { } } else { Toast.makeText(this, "非有效条码,请查实!", Toast.LENGTH_LONG) .show(); } } else if (resultCode == RESULT_CANCELED) { Toast.makeText(this, "未找到条形码", Toast.LENGTH_LONG).show(); } } } private void searchBarcode(final String barcode) { this.barcodeEditText.setText(barcode); if (barcode.length() == 0) { Toast.makeText(this, "请输入所要查询的条码!", Toast.LENGTH_LONG).show(); return; } else if (barcode.length() != 12) { Toast.makeText(this, "您输入的不是有效条码,请查实!", Toast.LENGTH_LONG).show(); return; } String uid = ((BcmApplication) this.getApplication()).getUserId(); String pwd = ((BcmApplication) this.getApplication()).getPwd(); String areacode = ((BcmApplication) this.getApplication()) .getDetailInfo().getAreaCode(); String remark = ((BcmApplication) this.getApplication()) .getDetailInfo().getRemark(); RequestParams params = new RequestParams(); params.put("loginname", uid); params.put("loginpwd", pwd); params.put("code", barcode); params.put("areaid", areacode); params.put("memo", remark); Log.i("loginname", uid); Log.i("loginpwd", pwd); Log.i("code", barcode); AsyncHttpClient client = new AsyncHttpClient(); client.post(Helper.SEARCH_URL, params, new AsyncHttpResponseHandler() { @Override public void onStart() { // SearchActivity.this.scanButton.setEnabled(false); // SearchActivity.this.searchButton.setEnabled(false); querydialog.show(); } @Override public void onFinish() { querydialog.dismiss(); // SearchActivity.this.scanButton.setEnabled(true); // SearchActivity.this.searchButton.setEnabled(true); ShowInfo(((BcmApplication) SearchActivity.this.getApplication()) .getSearchResult()); } @Override public void onSuccess(String content) { Log.i("SearchResult", content); // DataTable[] result = null; char cr = 65279; String t = String.valueOf(cr); content = content.replace("\t", "").replace(t, ""); JSONObject obj; String error = ""; String jsonString = ""; ArrayList<DataTable> result = null; try { obj = new JSONObject(content); jsonString = obj.getString("result"); error = obj.getString("error"); if (jsonString == null) result = null; char cr1 = 65279; String t1 = String.valueOf(cr1); jsonString = jsonString.replace("\t", "").replace(t1, ""); Gson g = new Gson(); result = g.fromJson(jsonString, new TypeToken<ArrayList<DataTable>>() { }.getType()); } catch (Exception ex) { result = null; } if (result != null) { ((BcmApplication) SearchActivity.this.getApplication()) .setSearchResult(barcodeEditText.getText() .toString(), result); SimpleDateFormat df = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); String CodeDate = df.format(new java.util.Date()); m_db.insert_code(CodeDBHelper.CODE_TABLE_NAME, ((BcmApplication) SearchActivity.this .getApplication()).getUserId(), barcodeEditText.getText().toString(), jsonString, path, CodeDate, 1); Log.i("onSuccess", "return"); // Submmit(barcode); } else { reString = error; ((BcmApplication) SearchActivity.this.getApplication()) .setSearchResult(barcodeEditText.getText() .toString(), getDatas()); SimpleDateFormat df = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); String CodeDate = df.format(new java.util.Date()); m_db.insert_code(CodeDBHelper.CODE_TABLE_NAME, ((BcmApplication) SearchActivity.this .getApplication()).getUserId(), barcodeEditText.getText().toString(), error, path, CodeDate, 0); Log.i("onSuccess", "null"); } } @Override public void onFailure(Throwable error) { ((BcmApplication) SearchActivity.this.getApplication()) .setSearchResult(barcodeEditText.getText().toString(), getNoDatas()); Log.i("onFailure", "failed"); } }); } protected void Submmit(String barcode) { // TODO Auto-generated method stub String uid = ((BcmApplication) this.getApplication()).getUserId(); String pwd = ((BcmApplication) this.getApplication()).getPwd(); String areacode = ((BcmApplication) this.getApplication()) .getDetailInfo().getAreaCode(); String remark = ((BcmApplication) this.getApplication()) .getDetailInfo().getRemark(); RequestParams params = new RequestParams(); params.put("user_name", uid); params.put("user_password", pwd); params.put("barcode", barcode); params.put("area_code", areacode); params.put("remark", remark); AsyncHttpClient client = new AsyncHttpClient(); client.post(Helper.SEARCH_URL, params, new AsyncHttpResponseHandler() { @Override public void onStart() { Log.e("post", "onStart"); Toast.makeText(SearchActivity.this, "正在提交查询记录", Toast.LENGTH_SHORT).show(); } @Override public void onFinish() { Log.e("post", "onFinish"); } @Override public void onSuccess(String content) { Log.e("onSuccess", content); char cr = 65279; String t = String.valueOf(cr); content = content.replace("\t", "").replace(t, ""); JSONObject obj; try { obj = new JSONObject(content); boolean successful = obj.getBoolean("successful"); String error = obj.getString("error"); if (successful) { Toast.makeText(SearchActivity.this, "提交成功!", Toast.LENGTH_LONG).show(); } else { Toast.makeText(SearchActivity.this, error, Toast.LENGTH_LONG).show(); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void onFailure(Throwable error) { Log.e("onFailure", "failed"); Toast.makeText(SearchActivity.this, "网络连接错误", Toast.LENGTH_SHORT).show(); } }); } protected void ShowInfo(DataTable[] dataTables) { // TODO Auto-generated method stub if (dataTables == null) { this.FillDynamicList(getDatas().toArray(new DataTable[] {})); return; } this.FillDynamicList(dataTables); } private void FillDynamicList(DataTable[] data) { // TODO Auto-generated method stub if (listView == null || data == null) { Log.i("search_list", "null"); return; } if (listView != null) { // this.listView.setDivider(new ColorDrawable(Color.TRANSPARENT)); // this.listView.setDividerHeight(9); // this.listView.setScrollingCacheEnabled(false); // this.listView.setFadingEdgeLength(0); Log.i("search_list", "not null"); } listItemAdapter = new MulitSingleTableAdapter(this, data); this.listView.setAdapter(listItemAdapter); Log.i("search_list", "adapter"); SearchActivity.this.listItemAdapter.setDataTable(data); SearchActivity.this.listItemAdapter.notifyDataSetChanged(); } // @Override // public boolean onKeyDown(int keyCode, KeyEvent event) { // if (keyCode == KeyEvent.KEYCODE_BACK) { // // Dialog dialog = null; // // CustomDialog.Builder customBuilder = new CustomDialog.Builder( // // SearchActivity.this); // // customBuilder // // .setMessage("确定要退出国台酒业物流稽查软件?") // // .setNegativeButton("取消", // // new DialogInterface.OnClickListener() { // // public void onClick(DialogInterface dialog, // // int which) { // // dialog.dismiss(); // // } // // }) // // .setPositiveButton("退出稽查软件", // // new DialogInterface.OnClickListener() { // // public void onClick(DialogInterface dialog, // // int which) { // // dialog.dismiss(); // // finish(); // // } // // }); // // dialog = customBuilder.create(); // // dialog.show(); // // return true; // // } else { // return super.onKeyDown(keyCode, event); // } // } public static byte[] hexStringToBytes(String hexString) { if (hexString == null || hexString.equals("")) { return null; } hexString = hexString.toUpperCase(); int length = hexString.length() / 2; char[] hexChars = hexString.toCharArray(); byte[] d = new byte[length]; for (int i = 0; i < length; i++) { int pos = i * 2; d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); } return d; } private static byte charToByte(char c) { return (byte) "0123456789ABCDEF".indexOf(c); } }
[ "knightneo7@gmail.com" ]
knightneo7@gmail.com
4f57feeab0cbbf94b67502f443ae7501615ea1e4
dc5466686737923e8c6cff623ac1812cc3ceaaea
/Connect4_Game/game/src/main/java/core/Connect4TextConsole.java
0a75ac4a4ef2fede72c66ded576253d68b8bd213
[]
no_license
iTaylor5/Games
22403c182fdf297fb7062d82d3e1ec37aec00a6f
666fa1cf8b5fc744457dc553e4cb312db2fb1ff8
refs/heads/main
2023-06-21T18:05:51.419332
2021-07-15T13:24:57
2021-07-15T13:24:57
320,521,676
0
0
null
null
null
null
UTF-8
Java
false
false
3,397
java
package core; import java.util.InputMismatchException; import java.util.Scanner; import core.Connect4; import core.Connect4ComputerPlayer; /** * Connect4TextConsole is for the User Interface. * It utilises the game logic from the core package. * Displays a basic console Connect4 game. * @author IanTaylor * * @version 2.0 * */ public class Connect4TextConsole { public char choice; /** Variable containing the connect4 game logic*/ private Connect4 game; /** Object of the Connect4ComputerPlayer class */ private Connect4ComputerPlayer comp; /** Constructor initialising the game logic and printing a blank board * * @param choice - the user decision on who to play */ public Connect4TextConsole(char choice) { game = new Connect4(); this.choice = choice; // game.addPlayer(choice); // if(choice == 'C'){ // comp = new Connect4ComputerPlayer(); // } } /** * Initialise the game depending on whether player * selected verse computer or another player. * @param gameType the type of opposition to be played. */ public void gameType(char gameType) { // Scanner object for user input Scanner in = new Scanner(System.in); System.out.print("Begin Game."); game.addPlayer(gameType); game.printBoard(); if(choice == 'C'){ comp = new Connect4ComputerPlayer(); } runGame(); in.close(); } /** * Run the game until no more pieces * or a player has won */ public void runGame(){ // Scanner object for input from user created Scanner in = new Scanner(System.in); // If game is not won and player 2 has pieces to play while(!game.won && game.listOfplayers[1].piecesLeft() != 0){ // Users column choice int col = 0; //game.printBoard(); // iterates between the 2 players for (int i = 0; i < game.listOfplayers.length; i++){ boolean played = false; // players move has been accepted if(game.listOfplayers[i].name == "Computer") { comp.move(game); }else { while(!played) { boolean validMove = false; // Confirm if move is valid while(!validMove) { // Input from user & check its a valid column number col = inputCol()-1; validMove = game.checkIfColHasSpace(col); } played = game.addPiece(col, game.listOfplayers[i]); // adds pieces game.listOfplayers[i].removePiece(); // decrements the players number of moves } } game.printBoard(); // displays the updated board // Checks to see if game has been won. if(game.won) { System.out.println("Player "+ game.listOfplayers[i].name + " has won!" ); break; } } // Checks to see if game has been won. if(game.won) { System.out.println("Congratulations"); } } if(!game.won) { System.out.println("GAME IS A DRAW"); } in.close(); } /** * This method is used to make sure the user * does not input the wrong choice for when selecting * columns. * @return the integer that can be used or 0. */ public int inputCol() { Scanner in = new Scanner(System.in); System.out.print("It's your turn. "); System.out.println("Choose a column number from 1-7"); try { return in.nextInt(); }catch(InputMismatchException ex ) { System.out.println("You did not enter a number between 1-7"); return 0; } } }
[ "iantaylor8327@gmail.com" ]
iantaylor8327@gmail.com
e2f6e55429393972b83e4b7866ab553b03fb61ba
9f39c880c4d597b141287b4fb8446632179c8de6
/src/views/DetailsController.java
65ff58f69c4710c4c926bc12ef7346e8c72fcf27
[]
no_license
amineayari/TabaaniJava
3803a7e4e31fdf31fcd748ef93fdacab0d100c31
bd0d3f30d740848f5af9f0f63586e4e7c62c9ed6
refs/heads/main
2023-04-13T18:14:56.590731
2021-04-30T00:08:57
2021-04-30T00:08:57
362,948,668
0
0
null
2021-04-30T00:08:58
2021-04-29T21:12:28
Java
UTF-8
Java
false
false
1,725
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 views; import com.jfoenix.controls.JFXTextArea; import entite.Voyage; import java.net.URL; import java.util.ResourceBundle; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import services.VoyageService; /** * FXML Controller class * * @author House_Info */ public class DetailsController implements Initializable { @FXML private ImageView imagelab; @FXML private Label Nomlab; private Label Prixlab; @FXML private Button Commander; private static int idd; private Voyage Voy; public static int getIdd(int id) { idd = id; return idd; } private Label proglab; @FXML private JFXTextArea labarea; @FXML private JFXTextArea idNinclut; @FXML private JFXTextArea idInclut; /** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { VoyageService vs=new VoyageService(); Voy=vs.TrouverById(idd); Image image = new Image(getClass().getResourceAsStream(Voy.getImage())); imagelab.setImage(image); Nomlab.setText(Voy.getDestination()); labarea.setText(Voy.getProgramme()); idInclut.setText(Voy.getInclut()); idNinclut.setText(Voy.getNinclut()); } }
[ "noreply@github.com" ]
noreply@github.com
9a199972cbf3c7dfca42b2d1a22171d057c2c965
78f8c35d8a5b64653d175cf0d2b4b8aab2bd1f54
/konular/java/projects/ArtOfWeb/ejb-sched/src/com/nealford/art/ejbsched/ejb/EventDbHome.java
1e1beb6581095d7ea128ebe481706a36c4a7e5a7
[]
no_license
caga/Ipa-ITBook
8f9cac236aa5375aed2f9e96fa5516a3cf1905f1
4ae56ad8fa4bf692a2a9c4f9134046533bd0c8db
refs/heads/master
2021-04-03T09:29:24.328117
2018-03-30T12:39:59
2018-03-30T12:39:59
124,386,146
0
0
null
null
null
null
UTF-8
Java
false
false
204
java
package com.nealford.art.ejbsched.ejb; import java.rmi.*; import javax.ejb.*; public interface EventDbHome extends EJBHome { public EventDb create() throws RemoteException, CreateException; }
[ "cagataycakir@gmail.com" ]
cagataycakir@gmail.com
efcd39f7f017a09187e81d4d3f7bffe7a24f915d
9b3e7579fada599c977c48d858acef6abc67db99
/src/main/java/shedar/mods/ic2/nuclearcontrol/crossmod/data/EnergyStorageData.java
060f067c2446773039c8c5308262e4b234817c90
[ "BSD-3-Clause" ]
permissive
joeljoelTolz/Nuclear-Control
152cd2efe56acf397d2ae02f6749074b3900b4ca
850281e6f5ab487bedae62d8f69c408d15334b53
refs/heads/master
2021-01-21T08:05:17.954903
2014-09-25T03:03:05
2014-09-25T03:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package shedar.mods.ic2.nuclearcontrol.crossmod.data; public class EnergyStorageData { public static final int TARGET_TYPE_UNKNOWN = -1; public static final int TARGET_TYPE_IC2 = 0; public static final int TARGET_TYPE_BC = 1; public double stored; public double capacity; public String units; public int type; }
[ "xbony22@gmail.com" ]
xbony22@gmail.com
86e8c56ffb7fc8d857fe1b7f5af69f3316beba5c
4aa90348abcb2119011728dc067afd501f275374
/app/src/main/java/com/tencent/mm/g/a/sj$a.java
5b2e79c097f3085766001174b349af6fb9f0a663
[]
no_license
jambestwick/HackWechat
0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6
6a34899c8bfd50d19e5a5ec36a58218598172a6b
refs/heads/master
2022-01-27T12:48:43.446804
2021-12-29T10:36:30
2021-12-29T10:36:30
249,366,791
0
0
null
2020-03-23T07:48:32
2020-03-23T07:48:32
null
UTF-8
Java
false
false
149
java
package com.tencent.mm.g.a; public final class sj$a { public int action; public int fKd; public String fKe; public String result; }
[ "malin.myemail@163.com" ]
malin.myemail@163.com
4d337bca3ba9a1e7db45390daa19966ad6c45ac2
524b050cbc759f0bfdd8d0c801adb39867954672
/criteria/common/src/org/immutables/criteria/expression/Expression.java
844fe04ed61877859f611c6017b34373debbe9d6
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
asdbaihu/immutables
298535be5c738f405948199430b1ac79d2512e60
94bedc5b9ecd83a3b2ffe28b888f8df5537c6a25
refs/heads/master
2020-07-08T16:21:51.530504
2019-08-21T23:21:34
2019-08-21T23:21:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,233
java
/* * Copyright 2019 Immutables Authors and Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.immutables.criteria.expression; import javax.annotation.Nullable; /** * Expression is a <a href="https://cs.lmu.edu/~ray/notes/ir/">Intermediate Representation</a> (IR) * generated by criteria DSL (front-end in compiler terminology). * <p> * Usually, it is represented as <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree">AST</a>. */ public interface Expression { @Nullable <R, C> R accept(ExpressionBiVisitor<R, C> visitor, @Nullable C context); @Nullable default <R> R accept(ExpressionVisitor<R> visitor) { return accept(Expressions.toBiVisitor(visitor), null); } }
[ "25229979+asereda-gs@users.noreply.github.com" ]
25229979+asereda-gs@users.noreply.github.com
d06b8983d0cd74e982b94c89b8612efee7d59aa2
522d7b26e53afb86bb6624374f888a61fb4634a2
/compile-demo/src/main/java/com/gxk/demo/v2/TestProcessor.java
34c7cb25f0c78876f47ec466943ac769b121d5a6
[]
no_license
guxingke/demo
e481e0666f5d9ef38ae6c9b051a4fb375f03e105
78ee803e65c60d96deb219f899d594866c0e72af
refs/heads/master
2023-03-14T11:34:00.123422
2022-12-05T09:26:38
2022-12-05T09:27:26
149,212,703
3
2
null
2023-03-08T17:32:26
2018-09-18T01:48:12
Java
UTF-8
Java
false
false
1,636
java
package com.gxk.demo.v2; import com.sun.source.util.Trees; import java.util.Set; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Messager; import javax.annotation.processing.ProcessingEnvironment; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic.Kind; @SupportedSourceVersion(SourceVersion.RELEASE_8) @SupportedAnnotationTypes("*") public class TestProcessor extends AbstractProcessor { private boolean ok = true; private final TestScanner scanner; private Trees trees; private Messager messager; public TestProcessor(TestScanner scanner) { this.scanner = scanner; } @Override public synchronized void init(final ProcessingEnvironment processingEnvironment) { super.init(processingEnvironment); trees = Trees.instance(processingEnvironment); messager = processingEnvironment.getMessager(); } public boolean process( final Set<? extends TypeElement> types, final RoundEnvironment environment ) { if (!environment.processingOver()) { for (final Element element : environment.getRootElements()) { try { scanner.scan(trees.getPath(element), null); } catch (Exception e) { messager.printMessage(Kind.ERROR, e.getMessage()); } } } return true; } public boolean isOk() { return ok; } }
[ "admin@guxingke.com" ]
admin@guxingke.com
d1495f9cbc8db97ef02945ad8be1271a441ab827
c19352b40b2ac9de64d6310e8855935dd1cb72bf
/bim/src/main/java/org/jitsi/impl/osgi/OSGiServiceActivator.java
0d1c69db69fc052dac2ba9627eb31fc198947da3
[]
no_license
mutoumian/BIM
c43a9391cc5786e23863b86ab2c110b54301b5f0
deac3bbbce50b537cee40784c589d8eb561dcd93
refs/heads/master
2023-01-22T14:24:05.315762
2015-07-14T17:40:50
2015-07-14T17:41:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,961
java
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jitsi.impl.osgi; import android.content.*; import org.jitsi.service.osgi.*; import org.osgi.framework.*; /** * @author Lyubomir Marinov */ public class OSGiServiceActivator implements BundleActivator { private BundleActivator bundleActivator; private OSGiService osgiService; public void start(BundleContext bundleContext) throws Exception { startService(bundleContext); startBundleContextHolder(bundleContext); } private void startBundleContextHolder(BundleContext bundleContext) throws Exception { ServiceReference<BundleContextHolder> serviceReference = bundleContext.getServiceReference(BundleContextHolder.class); if (serviceReference != null) { BundleContextHolder bundleContextHolder = bundleContext.getService(serviceReference); if (bundleContextHolder instanceof BundleActivator) { BundleActivator bundleActivator = (BundleActivator) bundleContextHolder; this.bundleActivator = bundleActivator; boolean started = false; try { bundleActivator.start(bundleContext); started = true; } finally { if (!started) this.bundleActivator = null; } } } } private void startService(BundleContext bundleContext) throws Exception { ServiceReference<OSGiService> serviceReference = bundleContext.getServiceReference(OSGiService.class); if (serviceReference != null) { OSGiService osgiService = bundleContext.getService(serviceReference); if (osgiService != null) { ComponentName componentName = osgiService.startService(new Intent(osgiService, OSGiService.class)); if (componentName != null) this.osgiService = osgiService; } } } public void stop(BundleContext bundleContext) throws Exception { try { stopBundleContextHolder(bundleContext); } finally { stopService(bundleContext); } } private void stopBundleContextHolder(BundleContext bundleContext) throws Exception { if (bundleActivator != null) { try { bundleActivator.stop(bundleContext); } finally { bundleActivator = null; } } } private void stopService(BundleContext bundleContext) throws Exception { if (osgiService != null) { try { // Triggers service shutdown and removes the notification osgiService.stopForegroundService(); } finally { osgiService = null; } } } }
[ "lycoris@outlook.com" ]
lycoris@outlook.com
b8f7e96de40a2c049c8b8947245032188e1d96c5
2b9cc2c6ddd3540b4b2276fccac23c28d37e5c06
/src/main/java/com/microwise/msp/hardware/handler/formula/DegreeFunction.java
6e7df1ba4b62f11f58933440c121edad1dab1767
[]
no_license
algsun/blueplanet-daemon
864e5af9477d8e69ffa742deb3bbe141711d30a6
318c790e0eb7753b6ce8b3ba3cd41c539fe7746c
refs/heads/master
2020-03-15T19:47:44.247689
2018-05-31T07:25:02
2018-05-31T07:25:02
132,317,533
0
0
null
null
null
null
UTF-8
Java
false
false
2,156
java
package com.microwise.msp.hardware.handler.formula; import com.google.common.base.Preconditions; import java.util.Map; /** * 规整角度 * * @author gaohui * @date 14-1-2 16:11 */ public class DegreeFunction implements Function { @Override public Double compute(Double x, Map<String, Double> params) { Preconditions.checkNotNull(params); if (params.size() < 2) { // TODO 参数不满足 return null; } if (!params.containsKey("a") || !params.containsKey("b")) { // TODO 参数不满足 return null; } Double a = params.get("a"); Double b = params.get("b"); // 先计算结果 一元两次方程 @gaohui 2014-01-04 double d = a * x + b; Double degree = d; if (degree > 11.25 && degree <= 33.75) { degree = 22.5; } else if (degree > 33.75 && degree <= 56.25) { degree = 45D; } else if (degree > 56.25 && degree <= 78.75) { degree = 67.5; } else if (degree > 78.75 && degree <= 101.25) { degree = 90D; } else if (degree > 101.25 && degree <= 123.75) { degree = 112.5; } else if (degree > 123.75 && degree <= 146.25) { degree = 135D; } else if (degree > 146.25 && degree <= 168.75) { degree = 157.5; } else if (degree > 168.75 && degree <= 191.25) { degree = 180D; } else if (degree > 191.25 && degree <= 213.75) { degree = 202.5; } else if (degree > 213.75 && degree <= 236.25) { degree = 225D; } else if (degree > 236.25 && degree <= 258.75) { degree = 247.5; } else if (degree > 258.75 && degree <= 281.25) { degree = 270D; } else if (degree > 281.25 && degree <= 303.75) { degree = 292.5; } else if (degree > 303.75 && degree <= 326.25) { degree = 315D; } else if (degree > 326.25 && degree <= 348.75) { degree = 337.5; } else { degree = 0D; } return degree; } }
[ "algtrue@163.com" ]
algtrue@163.com
83db888ef09fe5c6c443f60fd45cab3bafc89988
945a38d4fc4885a4db1c4e3a91cac07578d7dcfe
/g4-core/src/main/java/org/g4studio/core/orm/xibatis/sqlmap/engine/type/LongTypeHandler.java
a18b1cd0e7100519ea7d101a3bfd03c76d044c8a
[]
no_license
hongweichang/mg4
3b8a71809fb76193cb862a455fc2adc9d5804a72
edb9a3d56a35cb77abfcf650967c65f3338c3aee
refs/heads/master
2020-12-29T00:25:38.105899
2014-03-05T07:00:27
2014-03-05T07:00:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,303
java
package org.g4studio.core.orm.xibatis.sqlmap.engine.type; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; /** * Long implementation of TypeHandler */ public class LongTypeHandler extends BaseTypeHandler implements TypeHandler { public void setParameter(PreparedStatement ps, int i, Object parameter, String jdbcType) throws SQLException { ps.setLong(i, ((Long) parameter).longValue()); } public Object getResult(ResultSet rs, String columnName) throws SQLException { long l = rs.getLong(columnName); if (rs.wasNull()) { return null; } else { return new Long(l); } } public Object getResult(ResultSet rs, int columnIndex) throws SQLException { long l = rs.getLong(columnIndex); if (rs.wasNull()) { return null; } else { return new Long(l); } } public Object getResult(CallableStatement cs, int columnIndex) throws SQLException { long l = cs.getLong(columnIndex); if (cs.wasNull()) { return null; } else { return new Long(l); } } public Object valueOf(String s) { return Long.valueOf(s); } }
[ "javajiao@126.com" ]
javajiao@126.com
896ab7e6528b014b4e744f91ec814a7bd4a3083f
52d7d08b310a10632eefe4c659444e67e84d5d76
/simblog-server/src/main/java/com/blaife/CodeGenerator.java
48c81b345a3e2e8c37b47da770f757d7c5ef2adf
[]
no_license
dengxiaohui2016/simblog
3bfa52420ca23aba161eeb6f252012f41940c697
7fe383035b67c0a88b88708c21416a1eb309bd16
refs/heads/master
2023-01-21T04:27:52.309066
2020-07-13T15:11:52
2020-07-13T15:11:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,407
java
package com.blaife; import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.InjectionConfig; import com.baomidou.mybatisplus.generator.config.*; import com.baomidou.mybatisplus.generator.config.po.TableInfo; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * @author Blaife * @description 代码生成工具 * 执行 main 方法控制台输入模块表名回车自动生成对应项目目录中 * @data 2020/6/14 21:15 */ public class CodeGenerator { /** * <p> * 读取控制台内容 * </p> */ public static String scanner(String tip) { Scanner scanner = new Scanner(System.in); StringBuilder help = new StringBuilder(); help.append("请输入" + tip + ":"); System.out.println(help.toString()); if (scanner.hasNext()) { String ipt = scanner.next(); if (StringUtils.isNotEmpty(ipt)) { return ipt; } } throw new MybatisPlusException("请输入正确的" + tip + "!"); } public static void main(String[] args) { // 代码生成器 AutoGenerator mpg = new AutoGenerator(); // 全局配置 GlobalConfig gc = new GlobalConfig(); String projectPath = System.getProperty("user.dir"); gc.setOutputDir(projectPath + "/src/main/java"); // gc.setOutputDir("D:\\test"); gc.setAuthor("blaife"); gc.setOpen(false); // gc.setSwagger2(true); 实体属性 Swagger2 注解 gc.setServiceName("%sService"); mpg.setGlobalConfig(gc); // 数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://localhost:3306/simblog?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC"); // dsc.setSchemaName("public"); dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("blaife"); mpg.setDataSource(dsc); // 包配置 PackageConfig pc = new PackageConfig(); pc.setModuleName(null); pc.setParent("com.blaife"); mpg.setPackageInfo(pc); // 自定义配置 InjectionConfig cfg = new InjectionConfig() { @Override public void initMap() { // to do nothing } }; // 如果模板引擎是 freemarker String templatePath = "/templates/mapper.xml.ftl"; // 如果模板引擎是 velocity // String templatePath = "/templates/mapper.xml.vm"; // 自定义输出配置 List<FileOutConfig> focList = new ArrayList<>(); // 自定义配置会被优先输出 focList.add(new FileOutConfig(templatePath) { @Override public String outputFile(TableInfo tableInfo) { // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!! return projectPath + "/src/main/resources/mapper/" + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML; } }); cfg.setFileOutConfigList(focList); mpg.setCfg(cfg); // 配置模板 TemplateConfig templateConfig = new TemplateConfig(); templateConfig.setXml(null); mpg.setTemplate(templateConfig); // 策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setNaming(NamingStrategy.underline_to_camel); strategy.setColumnNaming(NamingStrategy.underline_to_camel); strategy.setEntityLombokModel(true); strategy.setRestControllerStyle(true); strategy.setInclude(scanner("表名,多个英文逗号分割").split(",")); strategy.setControllerMappingHyphenStyle(true); strategy.setTablePrefix("m_"); mpg.setStrategy(strategy); mpg.setTemplateEngine(new FreemarkerTemplateEngine()); mpg.execute(); } }
[ "2767026270@qq.com" ]
2767026270@qq.com
c64f057d1cfee5b343a5c2b7c4408b250dda73eb
0f1138e69d3c7fda9879f2b0f809624763eaca5d
/src/main/java/com/yaic/app/syn/dto/domain/SynPolicySurrenderDto.java
ea7b96242c7e1309b648012252bfb8126ac72b3b
[]
no_license
Jxyxl259/order_provider
23e880de8efb017423c665ce3ec4d899241095a4
f1a884a13d3aca6f01104309f030f5438f7e8b2b
refs/heads/master
2020-03-29T08:21:26.216815
2018-09-21T03:46:08
2018-09-21T03:46:08
149,706,291
0
0
null
null
null
null
UTF-8
Java
false
false
6,586
java
/* * Created By lujicong (2017-03-22 10:38:44) * Homepage https://github.com/lujicong * Since 2013 - 2017 */ package com.yaic.app.syn.dto.domain; import java.io.Serializable; import java.math.BigInteger; import java.util.Date; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import com.fasterxml.jackson.annotation.JsonFormat; import com.yaic.fa.dto.BaseDto; /** * SynPolicySurrender */ @Table(name = "t_syn_policy_surrender") public class SynPolicySurrenderDto extends BaseDto implements Serializable { private static final long serialVersionUID = SynPolicySurrenderDto.class.getName().hashCode(); /** 订单号 */ @Id private BigInteger orderCode; /** 保单号 */ @Id private String policyNo; /** 同步保单处理状态 0-未处理,1-处理中,2-处理成功,3-处理失败 */ private String dealStatus; /** 处理次数 */ private Integer dealCount; /** 0:初始状态;1:核保通过;2:核保不通过;3:自动核保;4:拒保;5:复核通过;6:承保确认;7:复核不通过;8:待复核9:待核保 */ private String underWriteInd; /** 是否有效:0正常,1作废值 */ private Integer invalidFlag; /** 创建人 */ private String createdUser; /** 创建时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date createdDate; /** 更新人 */ private String updatedUser; /** 更新时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date updatedDate; @Transient private String orderCodeStr; @Transient private java.lang.Integer dealBeforeDate; @Transient private java.lang.Integer limitCount; @Transient private String sortType; @Transient private Date nowTime; /** * 获取属性订单号的值 */ public BigInteger getOrderCode() { return orderCode; } /** * 设置属性订单号的值 */ public void setOrderCode(BigInteger orderCode) { this.orderCodeStr = String.valueOf(orderCode); this.orderCode = orderCode; } /** * 获取属性保单号的值 */ public String getPolicyNo() { return this.policyNo; } /** * 设置属性保单号的值 */ public void setPolicyNo(String policyNo) { this.policyNo = policyNo; } /** * 获取属性同步保单处理状态 0-未处理,1-处理中,2-处理成功,3-处理失败的值 */ public String getDealStatus() { return this.dealStatus; } /** * 设置属性同步保单处理状态 0-未处理,1-处理中,2-处理成功,3-处理失败的值 */ public void setDealStatus(String dealStatus) { this.dealStatus = dealStatus; } /** * 获取属性处理次数的值 */ public Integer getDealCount() { return this.dealCount; } /** * 设置属性处理次数的值 */ public void setDealCount(Integer dealCount) { this.dealCount = dealCount; } /** * 获取属性0:初始状态;1:核保通过;2:核保不通过;3:自动核保;4:拒保;5:复核通过;6:承保确认;7:复核不通过;8:待复核9:待核保的值 */ public String getUnderWriteInd() { return this.underWriteInd; } /** * 设置属性0:初始状态;1:核保通过;2:核保不通过;3:自动核保;4:拒保;5:复核通过;6:承保确认;7:复核不通过;8:待复核9:待核保的值 */ public void setUnderWriteInd(String underWriteInd) { this.underWriteInd = underWriteInd; } /** * 获取属性是否有效:0正常,1作废值的值 */ public Integer getInvalidFlag() { return this.invalidFlag; } /** * 设置属性是否有效:0正常,1作废值的值 */ public void setInvalidFlag(Integer invalidFlag) { this.invalidFlag = invalidFlag; } /** * 获取属性创建人的值 */ public String getCreatedUser() { return this.createdUser; } /** * 设置属性创建人的值 */ public void setCreatedUser(String createdUser) { this.createdUser = createdUser; } /** * 获取属性创建时间的值 */ public Date getCreatedDate() { return this.createdDate; } /** * 设置属性创建时间的值 */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } /** * 获取属性更新人的值 */ public String getUpdatedUser() { return this.updatedUser; } /** * 设置属性更新人的值 */ public void setUpdatedUser(String updatedUser) { this.updatedUser = updatedUser; } /** * 获取属性更新时间的值 */ public Date getUpdatedDate() { return this.updatedDate; } /** * 设置属性更新时间的值 */ public void setUpdatedDate(Date updatedDate) { this.updatedDate = updatedDate; } public String getOrderCodeStr() { return orderCodeStr; } public void setOrderCodeStr(String orderCodeStr) { this.orderCodeStr = orderCodeStr; } public java.lang.Integer getDealBeforeDate() { return dealBeforeDate; } public void setDealBeforeDate(java.lang.Integer dealBeforeDate) { this.dealBeforeDate = dealBeforeDate; } public java.lang.Integer getLimitCount() { return limitCount; } public void setLimitCount(java.lang.Integer limitCount) { this.limitCount = limitCount; } public String getSortType() { return sortType; } public void setSortType(String sortType) { this.sortType = sortType; } public Date getNowTime() { return nowTime; } public void setNowTime(Date nowTime) { this.nowTime = nowTime; } @Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); } }
[ "jxy_259_job@163.com" ]
jxy_259_job@163.com
32409d6a6fb0a3c80d0452bc8a45bd9f7f9f08b2
cfeec378f3736c3b03692b248c45324738de8fb5
/src/edu/cs3500/spreadsheets/model/ICell.java
eec0b54cae1970af3ad844ce37f3f21b17bfc814
[]
no_license
Brandontzhang/OOD-SpreadSheet
532437662d2f06ad7566422b88f5459212cd8737
4607c813e3d7f90d50c36eeb22ad6d3686241ca8
refs/heads/master
2020-08-26T14:54:33.583734
2019-12-04T21:07:17
2019-12-04T21:07:17
217,046,457
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
package edu.cs3500.spreadsheets.model; import edu.cs3500.spreadsheets.sexp.Sexp; /** * Interface for a cell. */ public interface ICell { // update the cell with the input string void updateCell(String s); // return the contents of the cell as a Sexp Sexp getContent(); // returns the contents of the cell unevaluated String getUnevalContent(); }
[ "zhangtbrandon2@gmail.com" ]
zhangtbrandon2@gmail.com
a20843d31cd429af2a29902b7c93de7b7f0b863c
d846def45b8013c112ebfcd72e787db6c516819a
/fr.istic.m1.aco.miniEditeur.v2/src/invoker/IHM.java
3aac2514ac7ef9dc765d9f979d1d3ff165500401
[]
no_license
bouazzouz/Mini-editeur
282a4b68f5d923d9dcb8da04cbd99d919d2eab28
49c0538311b1dc090ee5d057f6b78168967a6a08
refs/heads/master
2021-01-20T00:10:51.356015
2014-01-28T15:03:22
2014-01-28T15:03:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,778
java
/** * @(#) IHM.java */ package invoker; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JScrollPane; import command.Command; public class IHM { private JFrame frame; private Box boxTexte; private Box boxBoutonsV1; private Box boxBoutonsV2; private Collection<Bouton> boutons; // zoneTexte est protected pour pouvoir être manipulée par IHMObserver protected ZoneTexte zoneTexte; // nous avons préféré nommmer explicitement chacune des commandes private Command couper; private Command copier; private Command coller; private Command selectionner; private Command taper; private Command supprimer; private Command debutEnregistrer; private Command finEnregistrer; private Command rejouer; public IHM() { frame = new JFrame("Éditeur v2 : macros"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS)); boxTexte = Box.createHorizontalBox(); boxBoutonsV1 = Box.createHorizontalBox(); boxBoutonsV2 = Box.createHorizontalBox(); boutons = new ArrayList<Bouton>(); } /** * Paramètre les options d'affichage de la fenêtre, assemble les composants * graphiques, puis affiche la fenêtre. * */ public void afficher() { boxTexte.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); frame.add(boxTexte); boxBoutonsV1.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5)); frame.add(boxBoutonsV1); boxBoutonsV2.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5)); frame.add(boxBoutonsV2); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } /** * Crée un bouton dans l'IHM et l'ajoute au conteneur donné. * * @param nom * le nom visible du bouton * @param cmd * l'action associée au bouton * @param box * le conteneur auquel ajouter le bouton */ private void creerBouton(String nom, Command cmd, Box box) { Bouton bouton = new Bouton(nom, cmd); boutons.add(bouton); bouton.setMaximumSize(new Dimension(Short.MAX_VALUE, bouton .getPreferredSize().height)); bouton.setAlignmentX(JComponent.CENTER_ALIGNMENT); // rend le focus à la zone de texte après un clic sur un bouton bouton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { zoneTexte.requestFocusInWindow(); } }); box.add(bouton); } /** * Crée tous les boutons de l'IHM. */ public void creerTousBoutons() { creerBouton("Couper", couper, boxBoutonsV1); creerBouton("Copier", copier, boxBoutonsV1); creerBouton("Coller", coller, boxBoutonsV1); creerBouton("Début macro", debutEnregistrer, boxBoutonsV2); creerBouton("Fin macro", finEnregistrer, boxBoutonsV2); creerBouton("Rejouer", rejouer, boxBoutonsV2); } /** * Crée et affiche une zone de texte éditable dans l'IHM. */ public void creerZoneTexte(int rows, int cols) { HashMap<String, Command> h = new HashMap<String, Command>(); h.put("selectionner", selectionner); h.put("taper", taper); h.put("supprimer", supprimer); zoneTexte = new ZoneTexte(h); zoneTexte.setRows(rows); zoneTexte.setColumns(cols); JScrollPane scroll = new JScrollPane(zoneTexte); boxTexte.add(scroll); } /** * Obtient le plus récent caractère tapé dans la zone de texte. * * @return char c */ public char getCar() { return zoneTexte.getDernierCar(); } /** * Obtient la position de début du texte sélectionné dans la zone de texte * * @return int debut */ public int getDebutSelection() { return zoneTexte.getDebutSelection(); } /** * Obtient la longueur du texte sélectionné dans la zone de texte * * @return int longueur */ public int getLongueurSelection() { return zoneTexte.getLongueurSelection(); } /** * Setter pour initialiser toutes les commandes. * * @param h * une HashMap contenant les commandes. * @throws Exception * La méthode s'assure que <b>h</b> contient au moins les * commandes "couper", "copier", "coller", "sélectionner", * "taper" et "supprimer". Si l'une de ces commandes est * manquante, une exception sera lancée. */ public void setCommandes(HashMap<String, Command> h) throws Exception { this.couper = h.get("couper"); if (this.couper == null) throw new Exception("commande \"couper\" manquante"); this.copier = h.get("copier"); if (this.copier == null) throw new Exception("commande \"copier\" manquante"); this.coller = h.get("coller"); if (this.coller == null) throw new Exception("commande \"coller\" manquante"); this.selectionner = h.get("selectionner"); if (this.selectionner == null) throw new Exception("commande \"selectionner\" manquante"); this.taper = h.get("taper"); if (this.taper == null) throw new Exception("commande \"taper\" manquante"); this.supprimer = h.get("supprimer"); if (this.supprimer == null) throw new Exception("commande \"supprimer\" manquante"); this.debutEnregistrer = h.get("debutEnregistrer"); if (this.debutEnregistrer == null) throw new Exception("commande \"debutEnregistrer\" manquante"); this.finEnregistrer = h.get("finEnregistrer"); if (this.finEnregistrer == null) throw new Exception("commande \"finEnregistrer\" manquante"); this.rejouer = h.get("rejouer"); if (this.rejouer == null) throw new Exception("commande \"rejouer\" manquante"); } }
[ "watilin@kergoz-panik.fr" ]
watilin@kergoz-panik.fr
056e3292e81d805abdbcf1b20a833696fdcc2741
3448822c6c950d8de5d68da2befb07064b959127
/android/app/src/main/java/com/example/roadsfund/MainActivity.java
c92347fcb9757155537fedeb5b5274a9d352be19
[]
no_license
RomeoDenis/incident_v2
b89ff0d84d9c4ed6319b37d4a7d363c1106e3583
7c09ab85d7f83aae48c96887c549cdd8a642509f
refs/heads/master
2022-11-27T09:55:51.219913
2020-08-08T22:42:41
2020-08-08T22:42:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package com.barabara.roadsfund; import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }
[ "justine.govela7@gmail.com" ]
justine.govela7@gmail.com
eaf382862272a1e131941acfd987713ff586d3cc
28fb9884e4b35831bbccf3ead11296bf08272173
/estatioapp/app/src/test/java/org/incode/platform/dom/communications/integtests/dom/communications/fixture/data/democust2/DemoObjectWithNote_and_DemoInvoice_create3.java
7ef95f1d9ca139efa1282febc9d572dce72f6bf9
[ "Apache-2.0" ]
permissive
grandPiano/estatio
1703191d57f4a784fbfa33f96cd3fe68ce66a575
3923f15a59fc13dff2aa181e89dbd4fa6750c107
refs/heads/master
2020-08-12T18:39:28.628482
2019-10-04T09:33:09
2019-10-04T09:33:09
214,820,841
1
0
Apache-2.0
2019-10-13T13:00:55
2019-10-13T13:00:55
null
UTF-8
Java
false
false
6,954
java
package org.incode.platform.dom.communications.integtests.dom.communications.fixture.data.democust2; import java.io.IOException; import java.net.URL; import javax.inject.Inject; import com.google.common.io.Resources; import org.apache.isis.applib.fixturescripts.FixtureScript; import org.apache.isis.applib.value.Blob; import org.incode.module.base.dom.MimeTypeData; import org.incode.module.communications.dom.impl.commchannel.CommunicationChannelOwner; import org.incode.module.communications.dom.impl.commchannel.CommunicationChannelType; import org.incode.module.country.dom.impl.Country; import org.incode.module.country.dom.impl.CountryRepository; import org.incode.module.country.dom.impl.State; import org.incode.module.country.fixture.CountriesRefData; import org.incode.module.document.dom.impl.docs.Document; import org.incode.module.document.dom.impl.docs.Document_attachSupportingPdf; import org.incode.platform.dom.communications.integtests.demo.dom.demowithnotes.DemoObjectWithNotes; import org.incode.platform.dom.communications.integtests.demo.dom.demowithnotes.DemoObjectWithNotesMenu; import org.incode.platform.dom.communications.integtests.demo.dom.invoice.DemoInvoice; import org.incode.platform.dom.communications.integtests.demo.dom.invoice.DemoInvoiceRepository; import org.incode.platform.dom.communications.integtests.dom.communications.dom.apiimpl.DemoAppCommunicationChannelOwner_newChannelContributions; import org.incode.platform.dom.communications.integtests.dom.communications.dom.invoice.DemoInvoice_simulateRenderAsDoc; public class DemoObjectWithNote_and_DemoInvoice_create3 extends FixtureScript { public static final String FRED_HAS_EMAIL_AND_PHONE = "Fred HasEmailAndPhone"; public static final String MARY_HAS_PHONE_AND_POST = "Mary HasPhoneAndPost"; public static final String JOE_HAS_EMAIL_AND_POST = "Joe HasPostAndEmail"; @Override protected void execute(final ExecutionContext executionContext) { final Country gbrCountry = countryRepository.findCountry(CountriesRefData.GBR); final DemoObjectWithNotes custA = wrap(demoCustomerMenu).createDemoObjectWithNotes(FRED_HAS_EMAIL_AND_PHONE); addEmailAddress(custA, "fred@gmail.com"); addEmailAddress(custA, "freddy@msn.com"); addPhoneOrFaxNumber(custA, CommunicationChannelType.PHONE_NUMBER, "555 1234"); addPhoneOrFaxNumber(custA, CommunicationChannelType.FAX_NUMBER, "555 4321"); final DemoInvoice custA_1 = demoInvoiceRepository.create("1", custA); attachReceipt(custA_1, "Sample4.PDF"); final DemoInvoice custA_2 = demoInvoiceRepository.create("2", custA); attachReceipt(custA_2, "Sample5.PDF"); final DemoObjectWithNotes custB = wrap(demoCustomerMenu).createDemoObjectWithNotes(MARY_HAS_PHONE_AND_POST); addPhoneOrFaxNumber(custB, CommunicationChannelType.PHONE_NUMBER, "777 0987"); addPhoneOrFaxNumber(custB, CommunicationChannelType.FAX_NUMBER, "777 7890"); addPostalAddress(custB, gbrCountry, null, "45", "High Street", null, "OX1 4BJ", "Oxford"); addPostalAddress(custB, gbrCountry, null, "23", "Railway Road", null, "WN7 4AA", "Leigh"); final DemoInvoice custB_1 = demoInvoiceRepository.create("1", custB); attachReceipt(custB_1, "xlsdemo1.pdf"); final DemoInvoice custB_2 = demoInvoiceRepository.create("2", custB); attachReceipt(custB_2, "xlsdemo2.pdf"); final DemoObjectWithNotes custC = wrap(demoCustomerMenu).createDemoObjectWithNotes(JOE_HAS_EMAIL_AND_POST); addEmailAddress(custC, "joe@yahoo.com"); addEmailAddress(custC, "joey@friends.com"); addPostalAddress(custC, gbrCountry, null, "5", "Witney Gardens", null, "WA4 5HT", "Warrington"); addPostalAddress(custC, gbrCountry, null, "3", "St. Nicholas Street Road", null, "YO11 2HF", "Scarborough"); final DemoInvoice custC_1 = demoInvoiceRepository.create("1", custC); attachReceipt(custC_1, "pptdemo1.pdf"); final DemoInvoice custC_2 = demoInvoiceRepository.create("2", custC); attachReceipt(custC_2, "pptdemo2.pdf"); } private Document attachReceipt(final DemoInvoice invoice, final String resourceName) { final Blob blob = loadPdf(resourceName); try { return wrap(mixin(DemoInvoice_simulateRenderAsDoc.class, invoice)).$$(blob, null); } catch (IOException e) { throw new RuntimeException(e); } } private Document attachPdf(final Document document, final String resourceName) { final Blob blob = loadPdf(resourceName); try { final Document_attachSupportingPdf attachPdf = mixin(Document_attachSupportingPdf.class, document); return wrap(attachPdf).exec(attachPdf.default0Exec(), blob, null, attachPdf.default3Exec()); } catch (IOException e) { throw new RuntimeException(e); } } private static Blob loadPdf(final String resourceName) { final byte[] bytes = loadResourceBytes(resourceName); return new Blob(resourceName, MimeTypeData.APPLICATION_PDF.asStr(), bytes); } private static byte[] loadResourceBytes(final String resourceName) { final URL templateUrl = Resources .getResource(DemoObjectWithNote_and_DemoInvoice_create3.class, resourceName); try { return Resources.toByteArray(templateUrl); } catch (IOException e) { throw new IllegalStateException(String.format("Unable to read resource URL '%s'", templateUrl)); } } void addEmailAddress(final CommunicationChannelOwner cco, final String address) { wrap(demoAppCommunicationChannelOwner_newChannelContributions).newEmail(cco, CommunicationChannelType.EMAIL_ADDRESS, address); } void addPhoneOrFaxNumber( final CommunicationChannelOwner cco, final CommunicationChannelType type, final String number) { wrap(demoAppCommunicationChannelOwner_newChannelContributions).newPhoneOrFax(cco, type, number); } void addPostalAddress( final CommunicationChannelOwner cco, final Country country, final State state, final String addressLine1, final String addressLine2, final String addressLine3, final String postalCode, final String city) { wrap(demoAppCommunicationChannelOwner_newChannelContributions).newPostal(cco, CommunicationChannelType.POSTAL_ADDRESS, country, state, addressLine1, addressLine2, addressLine3, postalCode, city); } @Inject DemoObjectWithNotesMenu demoCustomerMenu; @Inject CountryRepository countryRepository; @Inject DemoInvoiceRepository demoInvoiceRepository; @Inject DemoAppCommunicationChannelOwner_newChannelContributions demoAppCommunicationChannelOwner_newChannelContributions; }
[ "dan@haywood-associates.co.uk" ]
dan@haywood-associates.co.uk
509b0a95c277a6e5764023b20ac155bca21c7c47
8e520eeca1ca02a3bb8d09fc1b8defe7f4703c55
/dodata/src/main/java/com/su/hadoop/Mapper/LogMapper.java
2b2037c177ee4cb8b4ae03a00375675eefbeedcc
[]
no_license
ziyesu/SSM
6ac7b732a5569a6eacc9451918aa8b3919030537
1f7ca74d900f4053819e0aaf9a2fbca65e12e54b
refs/heads/master
2022-12-22T11:38:16.789902
2019-09-27T06:56:00
2019-09-27T06:56:00
207,046,869
0
0
null
2022-12-16T09:43:30
2019-09-08T01:39:51
Java
UTF-8
Java
false
false
1,489
java
package com.su.hadoop.Mapper; import com.su.hadoop.util.WebLogParser; import com.su.hadoop.bean.WebLogBean; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import java.io.IOException; import java.util.HashSet; import java.util.Set; public class LogMapper extends Mapper<LongWritable, Text,Text, IntWritable> { // 用来存储网站url分类数据 Set<String> pages = new HashSet<>(); Text k = new Text(); // NullWritable v = NullWritable.get(); /** * 从外部加载网站url分类数据 */ @Override protected void setup(Context context) throws IOException, InterruptedException { pages.add("/a"); pages.add("/b"); pages.add("/c"); } @Override protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String line = value.toString(); WebLogBean webLogBean = WebLogParser.parser(line); if(webLogBean!=null){ // 过滤js/图片/css等静态资源 , 即数据清洗 WebLogParser.filtStaticResource(webLogBean, pages); //如果是标记为无效的数据,就不输出 if (webLogBean.isValid()) { k.set(webLogBean.getRequest()); context.write(k, new IntWritable(1)); } } } }
[ "599700591@qq.com" ]
599700591@qq.com
194b0150652f03af4f130882c3a36308da142009
cfaa8a7cd0db41123849719c4be095f65927b22b
/read_ngc_core_lib/src/main/java/com/ngc/corelib/http/HttpUtil.java
5d3ba682248fd9105bc559b25646ac9481b3f117
[]
no_license
wuyoujian0313/Read-android
9ae543316a580bc4794732e54ad5abbffab70463
ab8bd6a9efe7c7692fdc882ecb54a86f7d148310
refs/heads/master
2021-09-03T11:21:23.016544
2018-01-08T16:54:56
2018-01-08T16:54:56
110,246,410
0
0
null
null
null
null
UTF-8
Java
false
false
3,233
java
package com.ngc.corelib.http; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.params.CoreConnectionPNames; import com.ngc.corelib.utils.Logger; /** * * @Title: HttpUtil.java * @Package: com.silupay.sdk.utils.net * @Description: 网络连接工具 * @author:luoyunlong@silupay.com * @date: 2014年8月4日 下午4:17:21 * @version: V1.0 */ public class HttpUtil { /** * 超时时间 */ private static final int TIMEOUT = 60000; /** * 网络请求工具 * * @param url * @param list * @param method * @param overTime * @return * @throws IOException * @throws ConnectTimeoutException */ public String getStringData(String url, List<BasicNameValuePair> list, String method, int overTime) throws IOException, ConnectTimeoutException { String mStrData = null; HttpClient mHttpClient = new DefaultHttpClient(); // 设置连接超时时间 if (overTime == 0) { mHttpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, TIMEOUT); mHttpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, TIMEOUT); } else { mHttpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, overTime); mHttpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, overTime); } HttpResponse mHttpResponse = null; if (method == null || method.equalsIgnoreCase("GET")) { StringBuffer sb = new StringBuffer(url); if (list != null && !list.isEmpty()) { sb.append("?"); for (BasicNameValuePair mList : list) { sb.append(mList.getName()).append("="); if (mList.getValue() != null) { sb.append(mList.getValue()); } sb.append("&"); } sb.deleteCharAt(sb.length() - 1); } HttpGet mHttpGet = new HttpGet(sb.toString()); mHttpResponse = mHttpClient.execute(mHttpGet); } else if (method.equalsIgnoreCase("POST")) { HttpPost mHttpPost = new HttpPost(url); if (list != null && !list.isEmpty()) { UrlEncodedFormEntity reqEntity = new UrlEncodedFormEntity(list, "UTF-8"); mHttpPost.setEntity(reqEntity); mHttpResponse = mHttpClient.execute(mHttpPost); } } if (mHttpResponse != null && mHttpResponse.getStatusLine().getStatusCode() == 200) { HttpEntity mHttpEntity = mHttpResponse.getEntity(); InputStream mInputStream = mHttpEntity.getContent(); BufferedReader mBufferedReader = new BufferedReader(new InputStreamReader(mInputStream, "UTF-8")); StringBuilder mStringBuilder = new StringBuilder(); String line = null; while ((line = mBufferedReader.readLine()) != null) { mStringBuilder.append(line); } mInputStream.close(); mStrData = mStringBuilder.toString(); } return mStrData; } }
[ "youjian.wu@qunar.com" ]
youjian.wu@qunar.com
a046e8a55c5d50e1f2b400b9b7e74547eb602da1
8fa8b558f756177675fa885c97f3e7bca00f2e95
/src/main/java/org/opencv/core/MatOfInt.java
274beeb4a157b70d172648e518c668dd11235173
[]
no_license
Jack-bytes/opencv-java
309f8517ce6ab069ba1ede23521bf69c880c6245
60eeb5dd715e37bd48ccc21ca1d276800d714851
refs/heads/master
2023-03-19T05:42:24.527951
2021-03-16T10:21:06
2021-03-16T10:21:06
314,278,412
0
0
null
null
null
null
UTF-8
Java
false
false
2,263
java
package org.opencv.core; import java.util.Arrays; import java.util.List; public class MatOfInt extends Mat { // 32SC1 private static final int _depth = CvType.CV_32S; private static final int _channels = 1; public MatOfInt() { super(); } protected MatOfInt(long addr) { super(addr); if (!empty() && checkVector(_channels, _depth) < 0) { throw new IllegalArgumentException("Incompatible Mat"); } //FIXME: do we need release() here? } public static MatOfInt fromNativeAddr(long addr) { return new MatOfInt(addr); } public MatOfInt(Mat m) { super(m, Range.all()); if (!empty() && checkVector(_channels, _depth) < 0) { throw new IllegalArgumentException("Incompatible Mat"); } //FIXME: do we need release() here? } public MatOfInt(int... a) { super(); fromArray(a); } public void alloc(int elemNumber) { if (elemNumber > 0) { super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); } } public void fromArray(int... a) { if (a == null || a.length == 0) { return; } int num = a.length / _channels; alloc(num); put(0, 0, a); //TODO: check ret val! } public int[] toArray() { int num = checkVector(_channels, _depth); if (num < 0) { throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); } int[] a = new int[num * _channels]; if (num == 0) { return a; } get(0, 0, a); //TODO: check ret val! return a; } public void fromList(List<Integer> lb) { if (lb == null || lb.size() == 0) { return; } Integer[] ab = lb.toArray(new Integer[0]); int[] a = new int[ab.length]; for (int i = 0; i < ab.length; i++) { a[i] = ab[i]; } fromArray(a); } public List<Integer> toList() { int[] a = toArray(); Integer[] ab = new Integer[a.length]; for (int i = 0; i < a.length; i++) { ab[i] = a[i]; } return Arrays.asList(ab); } }
[ "78700393@qq.com" ]
78700393@qq.com
8ac60b5511af2e96172f99da3ab8ba565f457bd1
86d2cc5ca2ccfa3edd3ba8459da1ac1f054d323f
/app/src/main/java/com/iantheninja/flickerbrowser/RecyclerItemClickListener.java
0e0b47a513de1cd6b5eaa7a1c394105447e25df7
[]
no_license
iantheninja/flicker-browser
b5b81fe4783f1a1a0b62522dc090afb063764360
05d64eb154cc0f61d323f9f10e98527a81c5e9e7
refs/heads/master
2021-01-10T10:13:35.597132
2016-04-05T11:36:37
2016-04-05T11:36:37
51,915,321
0
0
null
null
null
null
UTF-8
Java
false
false
1,965
java
package com.iantheninja.flickerbrowser; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; /** * Created by ian on 30/03/16. */ public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener{ public static interface OnItemClickListener{ public void onItemClick(View view, int position); public void onItemLongClick(View view, int position); } private OnItemClickListener mListener; private GestureDetector mGestureDetector; public RecyclerItemClickListener(Context context, final RecyclerView recyclerView, OnItemClickListener listener){ mListener = listener; mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener(){ public boolean onSingleTapUp(MotionEvent e){ return true; } public void onLongPress(MotionEvent e){ //gets position that a user has tapped in recycler view View childView = recyclerView.findChildViewUnder(e.getX(), e.getY()); if (childView != null && mListener != null){ mListener.onItemLongClick(childView, recyclerView.getChildAdapterPosition(childView)); } } }); } @Override public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) { View childView = view.findChildViewUnder(e.getX(), e.getY()); if (childView != null && mListener != null && mGestureDetector.onTouchEvent(e)){ mListener.onItemClick(childView, view.getChildAdapterPosition(childView)); } return false; } @Override public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) { } @Override public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) { } }
[ "munene.ian@live.com" ]
munene.ian@live.com
fe5599373939ad57aed23de1121106908c734f7f
b16d0c04b552156184a92558f9657f7cfe152189
/src/com/github/samyadaleh/cltoolbox/common/ArrayUtils.java
79ad54c5c21461e6e43888b27efeed4dd4f1da04
[]
no_license
drjoeavg/CL-Toolbox
559326c36f2d423485ac4005f0fd2268c0991f12
4710a9ffc70c930d373978e50845d3123ab9ace6
refs/heads/master
2020-08-30T06:44:14.423391
2019-06-08T14:16:49
2019-06-08T14:16:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,871
java
package com.github.samyadaleh.cltoolbox.common; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; /** * Open collection of functions to work with arrays. */ public class ArrayUtils { /** * Retrieves the subsequence of an array from (inclusive) index to (exclusive) * index and returns it as string, entries separated by space. */ public static String getSubSequenceAsString(String[] sequence, int from, int to) { StringBuilder subSeq = new StringBuilder(); for (int i = from; i < to && i < sequence.length; i++) { if (i > from) subSeq.append(" "); subSeq.append(sequence[i]); } return subSeq.toString(); } /** * Retrieves a subsequence of an array from (inclusive) to (excusive) and * returns it as array. */ public static String[] getSubSequenceAsArray(String[] sequence, int from, int to) { ArrayList<String> newSequence = new ArrayList<>(); for (int i = from; i < to && i < sequence.length; i++) { newSequence.add(sequence[i]); } return newSequence.toArray(new String[0]); } /** * Retrieves a subsequence of an array from (inclusive) to (excusive) and * returns it as list. */ public static List<String> getSubSequenceAsList(String[] sequence, int from, int to) { ArrayList<String> newSequence = new ArrayList<>(); for (int i = from; i < to && i < sequence.length; i++) { newSequence.add(sequence[i]); } return newSequence; } /** * Returns true if the arrays are equal, that means all strings at the same * index have to be equal. Also the special character '?' is equal to * everything. */ public static boolean match(String[] itemForm1, String[] itemForm2) { if (itemForm1.length != itemForm2.length) { return false; } for (int i = 0; i < itemForm1.length; i++) { if (!(itemForm1[i].equals("?") || itemForm2[i].equals("?") || itemForm1[i] .equals(itemForm2[i]))) { return false; } } return true; } /** * Returns a string representation of an array, here used for items. */ public static String toString(String[] item) { StringBuilder representation = new StringBuilder(); representation.append("["); for (String element : item) { if (representation.length() > 1) { representation.append(","); } if (element.equals("")) { representation.append("ε"); } else { representation.append(element); } } representation.append("]"); return representation.toString(); } /** * If seqsplit ends with rhs, the first part of seqsplit without rhs is * returned, else null. */ public static String getStringHeadIfEndsWith(String[] seqSplit, String[] rhs) { if (seqSplit.length < rhs.length) return null; for (int i = 0; i < rhs.length; i++) { if (!(seqSplit[seqSplit.length - rhs.length + i].equals(rhs[i]))) { return null; } } return ArrayUtils .getSubSequenceAsString(seqSplit, 0, seqSplit.length - rhs.length); } /** * Returns a new array without the element at index i. */ public static String[] getSequenceWithoutIAsArray(String[] array, int i) { ArrayList<String> newArray = new ArrayList<>(); for (int j = 0; j < array.length; j++) { if (j != i) { newArray.add(array[j]); } } return newArray.toArray(new String[0]); } /** * Returns true if the element is to be found somewhere in the array. */ public static <T> boolean contains(T[] array, T element) { for (T el : array) { if (el.equals(element)) { return true; } } return false; } /** * Actually does the tokenization by throwing away spaces, returning special * symbols as single tokens and all other continuous string concatenations * each as a token. */ public static List<String> tokenize(String tree, Character[] specialSymbols) { List<String> tokens = new ArrayList<>(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < tree.length(); i++) { if (tree.charAt(i) == ' ') { if (builder.length() > 0) { tokens.add(builder.toString()); builder = new StringBuilder(); } } else { int finalI = i; if (Stream.of(specialSymbols).anyMatch( s -> tree.substring(finalI).startsWith(String.valueOf(s)))) { if (builder.length() > 0) { tokens.add(builder.toString()); builder = new StringBuilder(); } tokens.add(String.valueOf(tree.charAt(i))); } else { builder.append(String.valueOf(tree.charAt(i))); } } } if (builder.length() > 0) { tokens.add(builder.toString()); } return tokens; } }
[ "samya.daleh@freenet.de" ]
samya.daleh@freenet.de
914d96ef9fa9aa80bf2b6090599dd21bb1deece7
788de6974cff23fb290382f957ee32676c31e013
/app/src/main/java/cn/wangcy/demo/ffcd/listenter/PermissionListener.java
77cdcd8497b8d06d7f6f544152833d5ba0f851c2
[]
no_license
wangcycoding/FirstFrameCoverDemo
a01c7aeb5d17cdb64a3b43d365d88c06b7c409c2
4682ac8db22b626f7131f1af674fcdff297524da
refs/heads/master
2020-03-25T04:00:49.231284
2018-08-03T05:59:44
2018-08-03T05:59:44
143,373,383
0
0
null
null
null
null
UTF-8
Java
false
false
215
java
package cn.wangcy.demo.ffcd.listenter; import java.util.List; /** * Created by wangchuanyu on 2018/7/18. */ public interface PermissionListener { void granted(); void denied(List<String> deniedList); }
[ "545216541@qq.com" ]
545216541@qq.com
ba0cae7eb7580702a412863e9e061759dfc312e9
be389b2277f7eeed578112f7dc06abce06986cf1
/MOOC1/src/HelloWorld.java
3ea9a56b87e66f7720cb963a30a3423f317ca0c9
[]
no_license
ChristianElzholz/MOOC
ca6b4b4bfe9f0bb1d5ec68f76605539322417225
cf352f25ca1909a0a8c374d4e090f5dfa923033a
refs/heads/master
2020-03-27T09:16:11.291840
2018-09-03T18:17:28
2018-09-03T18:17:28
146,326,463
0
0
null
null
null
null
UTF-8
Java
false
false
150
java
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world!(And all the people of the world"); } }
[ "Christian@DESKTOP-O2C66C9.localdomain" ]
Christian@DESKTOP-O2C66C9.localdomain
5faa6cb5e022551196759d0e326a2fd8a80011d5
0829b7d3ea19ea5d1ea7d65c4516cfbbccb929d0
/src/main/java/xyz/soongkun/roast/common/service/MailSenderService.java
0d2e971937580a70a1bce8f37c30cd90177cfe1e
[ "MIT" ]
permissive
ken-annother/Roast
feff68b9410e8a6882f8784a411096e5344bc9eb
d4ba8c87e7646cf2ab7d7a34b5c1cb246a900f22
refs/heads/master
2023-08-19T00:54:04.605037
2018-03-25T15:30:02
2018-03-25T15:30:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,510
java
package xyz.soongkun.roast.common.service; import java.io.UnsupportedEncodingException; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.javamail.JavaMailSenderImpl; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Service; import xyz.soongkun.roast.common.config.Global; import xyz.soongkun.roast.common.model.MailBean; @Service public class MailSenderService { @Autowired private JavaMailSenderImpl javaMailSenderImpl; public MailSenderService() { } public MimeMessage createMimeMessage(MailBean mailBean) throws MessagingException, UnsupportedEncodingException { MimeMessage mimeMessage = this.javaMailSenderImpl.createMimeMessage(); MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true, "UTF-8"); messageHelper.setFrom(Global.getConfig("mail.from"), Global.getConfig("mail.fromName")); messageHelper.setSubject(mailBean.getSubject()); messageHelper.setCc(Global.getConfig("mail.from")); messageHelper.setTo(mailBean.getToEmails()); messageHelper.setText(mailBean.getContext(), true); return mimeMessage; } public void sendMail(MailBean mailBean) throws UnsupportedEncodingException, MessagingException { MimeMessage msg = this.createMimeMessage(mailBean); this.javaMailSenderImpl.send(msg); } }
[ "archiesong@126.com" ]
archiesong@126.com
5e3a939b9c6172862615317d5d79612842eeeac9
dc75d89260dc51c76dbf0092f37d70b0bb8f7cec
/src/test/java/org/sarge/textrpg/common/SkillActionTest.java
55bac38424c32f91133eca15d15cabb0548b3872
[]
no_license
stridecolossus/TextRPG
c5990ebc156bcb80eba4d3feaf04d28f25db2454
4479f467986d19cf64f1ae601d9e694d30034006
refs/heads/master
2021-01-25T09:33:07.493762
2020-02-15T14:43:02
2020-02-15T14:43:02
93,850,829
0
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
package org.sarge.textrpg.common; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.sarge.textrpg.util.ActionException; public class SkillActionTest extends ActionTestBase { private SkillAction action; @BeforeEach public void before() { action = new SkillAction(skill) { // Mock implementation }; } @Test public void verify() throws ActionException { action.verify(actor); } @Test public void verifyWithSkill() throws ActionException { addRequiredSkill(); action.verify(actor); } @Test public void power() { assertEquals(42, action.power(actor)); } @Test public void skill() { addRequiredSkill(); assertEquals(skill, action.skill(actor)); } @Test public void defaultSkill() { assertEquals(skill, action.skill(actor)); } @Test public void skillMissingMandatory() { final Skill mandatory = new Skill.Builder().name("mandatory").build(); action = new SkillAction(mandatory) { // Mock implementation }; assertThrows(IllegalStateException.class, () -> action.skill(actor)); } }
[ "chris.sarge@gmail.com" ]
chris.sarge@gmail.com
79f80f9eeae8b40b20cb1df41ba0378708188cb9
1254c2647908be4de397c978abdf695e5e2100b2
/Sesion23/Nodo.java
1652a2f0392434774799c3955e6da5f7d0e0b815
[]
no_license
polkiko/programacion2
b9b6d0661dc6c932d1094db00064594a60aa94be
7bbd1e9a2eafa4b8f02afaedf6cc607c67df6cbf
refs/heads/master
2020-04-25T22:23:10.504046
2019-05-31T12:38:27
2019-05-31T12:38:27
173,109,767
4
0
null
2019-03-02T17:14:21
2019-02-28T12:39:00
Java
UTF-8
Java
false
false
591
java
public class Nodo<T> { public T dato; public Nodo<T> siguiente; public Nodo(T dato) { this.dato = dato; siguiente = null; } // Insertar public void insertar(Nodo<T> lista, T elemento){ Nodo<T> ultimoNodo = new Nodo<T>(elemento); while(lista.siguiente != null){ lista = lista.siguiente; } lista.siguiente = (Nodo<T>) ultimoNodo; } // Calcular número de datos en l, = longitud public int longitud(Nodo<T> lista){ int longitud = 0; while(lista != null){ lista = lista.siguiente; longitud++; } return longitud; } }
[ "jesus.jerez1@gmail.com" ]
jesus.jerez1@gmail.com
bb96bb6065e180002dca9dfe8f2d3bf69f224826
9c1972d5bc63562d25e97939d919bba8d213cd2b
/src/br/com/sistemasupermercado/enuns/TipoEstadoCivil.java
356e2ee16b4ab904d0017568db48cc1b6285075f
[]
no_license
AyrtonRogerio/SistemaSupermercado
f47694d48ab90480a0928557764df6229f3e68e5
2caf643891ffb82eb6636afb70a2890d52bf7d04
refs/heads/master
2020-04-05T05:24:23.330334
2019-01-29T02:41:15
2019-01-29T02:41:15
156,593,271
0
0
null
null
null
null
UTF-8
Java
false
false
548
java
/** * */ package br.com.sistemasupermercado.enuns; /** * @author ayrton * */ public enum TipoEstadoCivil { SOLTEIRO("Solteiro"), CASADO("Casado"), DIVORCIADO("Divorciado"), VIUVO("Viúvo"); private String descricao; /** * */ private TipoEstadoCivil(String descricao) { this.descricao = descricao; } public String getValor() { return this.descricao; } /* (non-Javadoc) * @see java.lang.Enum#toString() */ @Override public String toString() { // TODO Auto-generated method stub return getValor(); } }
[ "ayrton.rogerio1@gmail.com" ]
ayrton.rogerio1@gmail.com
124e674de0ad667b423c7470b21ebc5200197486
405bf3369a63301a75b8515f69a4011b06203687
/MAVGCL/src/com/comino/flight/widgets/statusline/StatusLineWidget.java
5e69643bd1293d32a7405d11320a1e573c1b6f4f
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
edsellar/MAVGCL
92f01ca179f8966419d68fe7c176e66e5a0f74fb
a2b33f29eaf98690840bab503578e0a7c959a15a
refs/heads/master
2021-01-14T11:45:14.116765
2016-09-07T16:54:54
2016-09-07T16:54:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,882
java
/**************************************************************************** * * Copyright (c) 2016 Eike Mansfeld ecm@gmx.de. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ package com.comino.flight.widgets.statusline; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.List; import org.mavlink.messages.MAV_SEVERITY; import com.comino.flight.log.FileHandler; import com.comino.flight.model.AnalysisDataModel; import com.comino.flight.model.service.AnalysisModelService; import com.comino.flight.observables.StateProperties; import com.comino.flight.widgets.charts.control.ChartControlWidget; import com.comino.flight.widgets.charts.control.IChartControl; import com.comino.flight.widgets.fx.controls.Badge; import com.comino.flight.widgets.messages.MessagesWidget; import com.comino.mav.control.IMAVController; import com.comino.msp.main.control.listener.IMSPModeChangedListener; import com.comino.msp.model.segment.Status; import javafx.animation.AnimationTimer; import javafx.application.Platform; import javafx.beans.property.FloatProperty; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleFloatProperty; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.geometry.Pos; import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; public class StatusLineWidget extends Pane implements IChartControl, IMSPModeChangedListener { @FXML private Label version; @FXML private Badge driver; @FXML private Badge messages; @FXML private Badge time; @FXML private Badge mode; @FXML private Badge rc; @FXML private ProgressBar progress; private IMAVController control; private final SimpleDateFormat fo = new SimpleDateFormat("mm:ss"); private FloatProperty scroll = new SimpleFloatProperty(0); private AnalysisModelService collector = AnalysisModelService.getInstance(); private StateProperties state = null; private String filename; private long tms; private AnimationTimer task; public StatusLineWidget() { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusLineWidget.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); try { fxmlLoader.load(); } catch (IOException exception) { throw new RuntimeException(exception); } task = new AnimationTimer() { List<AnalysisDataModel> list = null; @Override public void handle(long now) { if((System.currentTimeMillis()-tms)>500) { filename = FileHandler.getInstance().getName(); if(control.isConnected() && !state.getLogLoadedProperty().get()) { messages.setMode(Badge.MODE_ON); driver.setText(control.getCurrentModel().sys.getSensorString()); driver.setMode(Badge.MODE_ON); } else { messages.setMode(Badge.MODE_OFF); driver.setText("no sensor info available"); driver.setMode(Badge.MODE_OFF); } if((System.currentTimeMillis() - tms)>30000) { messages.setBackgroundColor(Color.GRAY); messages.clear(); tms = System.currentTimeMillis(); } list = collector.getModelList(); if(list.size()>0) { int current_x0_pt = collector.calculateX0Index(scroll.floatValue()); int current_x1_pt = collector.calculateX1Index(scroll.floatValue()); time.setText( String.format("TimeFrame: [ %1$tM:%1$tS - %2$tM:%2$tS ]", list.get(current_x0_pt).tms/1000, list.get(current_x1_pt).tms/1000) ); time.setBackgroundColor(Color.DARKCYAN); } else { time.setText("TimeFrame: [ 00:00 - 00:00 ]"); time.setBackgroundColor(Color.GRAY); } if(filename.isEmpty()) { if(control.isConnected()) { time.setMode(Badge.MODE_ON); if(control.isSimulation()) { mode.setBackgroundColor(Color.BEIGE); mode.setText("SITL"); } else { mode.setBackgroundColor(Color.DARKCYAN); mode.setText("Connected"); } mode.setMode(Badge.MODE_ON); } else { mode.setMode(Badge.MODE_OFF); mode.setText("offline"); time.setMode(Badge.MODE_OFF); } } else { time.setMode(Badge.MODE_ON); messages.clear(); mode.setBackgroundColor(Color.LIGHTSKYBLUE); mode.setText(filename); mode.setMode(Badge.MODE_ON); } } } }; driver.setAlignment(Pos.CENTER_LEFT); messages.setTooltip(new Tooltip("Click to show messages")); } public void setup(ChartControlWidget chartControlWidget, IMAVController control) { chartControlWidget.addChart(this); this.control = control; this.control.addModeChangeListener(this); this.state = StateProperties.getInstance(); messages.setText(control.getClass().getSimpleName()+ " loaded"); control.addMAVMessageListener(msg -> { Platform.runLater(() -> { if(filename.isEmpty()) { tms = System.currentTimeMillis(); if(msg.severity < MAV_SEVERITY.MAV_SEVERITY_WARNING) messages.setBackgroundColor(Color.DARKRED); else messages.setBackgroundColor(Color.GRAY); messages.setText(msg.msg); } }); }); progress.setVisible(false); StateProperties.getInstance().getProgressProperty().addListener((v,ov,nv) -> { if(nv.floatValue() > -1) { progress.setVisible(true); Platform.runLater(() -> { progress.setProgress(nv.floatValue()); }); } else { progress.setVisible(false); } }); task.start(); // Thread th = new Thread(task); // th.setPriority(Thread.MIN_PRIORITY); // th.setDaemon(true); // th.start(); } @Override public void update(Status arg0, Status newStat) { Platform.runLater(() -> { if((newStat.isStatus(Status.MSP_RC_ATTACHED) || newStat.isStatus(Status.MSP_JOY_ATTACHED)) && newStat.isStatus(Status.MSP_CONNECTED)) rc.setMode(Badge.MODE_ON); else rc.setMode(Badge.MODE_OFF); }); } @Override public FloatProperty getScrollProperty() { return scroll; } public void registerMessageWidget(MessagesWidget m) { messages.setOnMousePressed(value -> { m.showMessages(); }); } @Override public IntegerProperty getTimeFrameProperty() { return null; } @Override public void refreshChart() { } }
[ "ecm@gmx.de" ]
ecm@gmx.de
1f61cc3f829a030034bd47041b2e34f1d03aa4a3
327d615dbf9e4dd902193b5cd7684dfd789a76b1
/base_source_from_JADX/sources/org/junit/experimental/results/ResultMatchers.java
b247920c0a6814677f13e7150ed3821f1b584b30
[]
no_license
dnosauro/singcie
e53ce4c124cfb311e0ffafd55b58c840d462e96f
34d09c2e2b3497dd452246b76646b3571a18a100
refs/heads/main
2023-01-13T23:17:49.094499
2020-11-20T10:46:19
2020-11-20T10:46:19
314,513,307
0
0
null
null
null
null
UTF-8
Java
false
false
1,630
java
package org.junit.experimental.results; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; public class ResultMatchers { public static Matcher<PrintableResult> failureCountIs(final int i) { return new TypeSafeMatcher<PrintableResult>() { public void describeTo(Description description) { description.appendText("has " + i + " failures"); } public boolean matchesSafely(PrintableResult printableResult) { return printableResult.failureCount() == i; } }; } public static Matcher<PrintableResult> hasFailureContaining(final String str) { return new BaseMatcher<PrintableResult>() { public void describeTo(Description description) { description.appendText("has failure containing " + str); } public boolean matches(Object obj) { return obj.toString().contains(str); } }; } public static Matcher<Object> hasSingleFailureContaining(final String str) { return new BaseMatcher<Object>() { public void describeTo(Description description) { description.appendText("has single failure containing " + str); } public boolean matches(Object obj) { return obj.toString().contains(str) && ResultMatchers.failureCountIs(1).matches(obj); } }; } public static Matcher<PrintableResult> isSuccessful() { return failureCountIs(0); } }
[ "dno_sauro@yahoo.it" ]
dno_sauro@yahoo.it
054a1816babeaae5cf2d143453cf91cd74a8e24c
80668612348b518ab9edc2f9d79141c33f7c63d4
/src/main/java/com/github/jeasyrest/core/process/xml/JAXBProcessingResource.java
446096937b6bcfae162429b04970a4c9bde2eff3
[ "Apache-2.0" ]
permissive
chirob/jeasy-rest
0d849a00022a09aa6843bcd890e8bd5580b8c493
7674397b4f8239734f3c584ab393af14782aad53
refs/heads/master
2021-01-24T10:39:26.643054
2018-02-10T11:44:12
2018-02-10T11:44:12
70,312,767
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package com.github.jeasyrest.core.process.xml; import com.github.jeasyrest.core.impl.ObjectProcessingResource; public abstract class JAXBProcessingResource<Req, Res> extends ObjectProcessingResource<Req, Res> { protected JAXBProcessingResource(Class<? extends Req> requestType, Class<? extends Res> responseType) { if (responseType != null) { setMarshaller(new JAXBMarshaller<Res>(responseType)); } if (requestType != null) { setUnmarshaller(new JAXBUnmarshaller<Req>(requestType)); } } }
[ "rchiaretti@RCHIARETTI.owgroup.it" ]
rchiaretti@RCHIARETTI.owgroup.it
256897536e405a67b12c48189d773b0e288e00e9
c5b7f803e477c9f9b265620a0fb04238fcafe8f6
/TestRND/src/com/multithreading/practise/Consumer.java
34437d93de0599c383e71b1958c502158e926467
[]
no_license
harshitds/datastructures
19ae05a933fbbf351608fa9205b9032b5a100d91
718b171e46f37c09d04c91a9344793ff53831150
refs/heads/master
2023-03-30T10:54:46.417168
2021-04-04T09:34:38
2021-04-04T09:34:38
354,495,735
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package com.multithreading.practise; import java.util.*; public class Consumer implements Runnable { private List<Integer> producequeue; public Consumer(List<Integer> producequeue) { this.producequeue = producequeue; } @Override public void run() { // TODO Auto-generated method stub while(true) { synchronized (producequeue) { while(producequeue.isEmpty()) try { producequeue.wait(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } int i=producequeue.remove(0); System.out.println("Cosnumed:"+i); producequeue.notify(); } try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
[ "HNGAUTAM@HNGAUTAM-L480.in.oracle.com" ]
HNGAUTAM@HNGAUTAM-L480.in.oracle.com
5eb1b19ccd7846f77fcf3a2ed9f2d1c5e2dcf51a
fa53b480760d6eca71b64c200ca4a1230077312a
/EP3/src/ep3/MyPanel.java
bcb1078bbb0f82a60232cf89beb024f66d9e5014
[]
no_license
bolulka/EducationalPractice
4d7fbffbc10ec78b648833321df91807b8928f42
24a6ffa9f7d76c329cdc9a4ba1d2707855967038
refs/heads/main
2023-07-14T05:08:42.205977
2021-08-25T11:27:31
2021-08-25T11:27:31
338,409,231
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
3,474
java
package ep3; import javax.swing.*; import java.awt.*; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.*; import java.util.stream.Collectors; class MyPanel extends JFrame { public MyPanel() { SwingUtilities.invokeLater(() -> { setVisible(true); setSize(700, 500); MyPanel.this.setLocationRelativeTo(null); addComponentListener(new ComponentAdapter() { @Override public void componentHidden(ComponentEvent e) { System.exit(0); } }); }); } private List<Country> countries; private List<Path> paths; private JFileChooser chooser = new JFileChooser(); private Task2 secondTask; private Task1 firstPanel; private Map<String, String> stringStringMap; @Override public JRootPane createRootPane() { JRootPane pane = new JRootPane(); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); countries = new ArrayList<>(); paths = new ArrayList<>(); JTabbedPane tabbedPane = createTabbedPane(); JMenuBar menuBar = createMenuBar(); initialMap(); panel.add(menuBar, BorderLayout.NORTH); panel.add(tabbedPane, BorderLayout.CENTER); pane.setContentPane(panel); return pane; } private JMenuBar createMenuBar() { JMenuBar menuBar = new JMenuBar(); JMenu submenu = new JMenu("File"); JMenuItem open = createOpenButton(); menuBar.add(submenu); submenu.add(open); return menuBar; } private JTabbedPane createTabbedPane() { JTabbedPane tabbedPane = new JTabbedPane(); firstPanel = new Task1(countries); secondTask = new Task2(countries); tabbedPane.addTab("FirstTask", firstPanel); tabbedPane.addTab("SecondTask", secondTask); return tabbedPane; } private JMenuItem createOpenButton() { JMenuItem open = new JMenuItem("Open"); open.addActionListener(e -> { try { chooser = new JFileChooser(); chooser.setDialogTitle("Октрытие файла"); chooser.setCurrentDirectory(new File(".")); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { fillPaths(); fillCountries(); secondTask.update(); firstPanel.update(); } } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }); return open; } private void fillPaths() throws IOException { paths.addAll(Files.walk(Paths.get("")).filter(Files::isRegularFile).collect(Collectors.toList()).stream() .filter(f -> f.toString().endsWith("png")).collect(Collectors.toList())); } private void initialMap() { stringStringMap = new TreeMap<>(); try (Scanner sc = new Scanner(new File("src//input.txt"))) { while (sc.hasNext()) { stringStringMap.put(sc.next(), sc.next()); } } catch (Exception ex) { ex.printStackTrace(); } } private void fillCountries() throws IOException { //fillPaths(); for (Path path : paths) { Country country = new Country(path); if (stringStringMap.get(country.getName()) != null) { country.setCapital(stringStringMap.get(country.getName())); } countries.add(country); } } }
[ "noreply@github.com" ]
noreply@github.com
e8bb17cb6e5900c8b4e9cb2be9ce85ea3c2064f2
cb74f650fa235c845d6114a56bbd5b5645d3f999
/api-gateway/src/main/java/com/idiazone/apigateway/ServletInitializer.java
d6a172b94f3918490fdeeab81c980a8e5a67a6ec
[]
no_license
RajeshShinde12/Indiazone
0ca3e824b7a637a92d4d045eb3399d702f209c30
d53ca7cca67b2cffe3c5f3db133662120fac6bb5
refs/heads/master
2023-02-06T13:21:12.747769
2021-01-02T20:29:52
2021-01-02T20:29:52
326,156,636
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package com.idiazone.apigateway; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(ApiGatewayApplication.class); } }
[ "rshine.shinde@gmail.com" ]
rshine.shinde@gmail.com
f426e067c6793d938ce3aab0c4d076f20522acb0
fc5883b4195416b1dc4a3fc67feb99ebe85e3b23
/src/main/java/com/inyoon/bookkureomi/mapper/OrderMapper.java
398b4a15f69b70cb8d678a3bef6c6a79f66237cd
[]
no_license
im57/bookkureomi
43f7452cf30dc682319d4ccb4832839d45e79797
1c958e8ac96df8143a06d780c7706fcb76439c13
refs/heads/master
2023-03-23T13:42:56.672759
2021-03-25T05:31:55
2021-03-25T05:31:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
316
java
package com.inyoon.bookkureomi.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import com.inyoon.bookkureomi.domain.Order; @Mapper public interface OrderMapper { public void orderBook(Order order); public List<Order> getOrderList(int userNo); public Order getOrder(int orderNo); }
[ "eovhehd1986@gmail.com" ]
eovhehd1986@gmail.com
35c633356b33a559261eed904eb1238e05a46cc5
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/model/v20190815/ExecLinkeantcodeAntcodeProtectbranchbynameResponse.java
201418756b889f62883c84c65bbd2a41bdf1e2a0
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
6,681
java
/* * 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.aliyuncs.sofa.model.v20190815; import java.util.List; import com.aliyuncs.AcsResponse; import com.aliyuncs.sofa.transform.v20190815.ExecLinkeantcodeAntcodeProtectbranchbynameResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class ExecLinkeantcodeAntcodeProtectbranchbynameResponse extends AcsResponse { private String requestId; private String resultCode; private String resultMessage; private String mergeAccessLevel; private String name; private Boolean _protected; private String protectRule; private Boolean protectRuleExactMatched; private String pushAccessLevel; private String ref; private Long responseStatusCode; private Commit commit; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getResultCode() { return this.resultCode; } public void setResultCode(String resultCode) { this.resultCode = resultCode; } public String getResultMessage() { return this.resultMessage; } public void setResultMessage(String resultMessage) { this.resultMessage = resultMessage; } public String getMergeAccessLevel() { return this.mergeAccessLevel; } public void setMergeAccessLevel(String mergeAccessLevel) { this.mergeAccessLevel = mergeAccessLevel; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public Boolean get_Protected() { return this._protected; } public void set_Protected(Boolean _protected) { this._protected = _protected; } public String getProtectRule() { return this.protectRule; } public void setProtectRule(String protectRule) { this.protectRule = protectRule; } public Boolean getProtectRuleExactMatched() { return this.protectRuleExactMatched; } public void setProtectRuleExactMatched(Boolean protectRuleExactMatched) { this.protectRuleExactMatched = protectRuleExactMatched; } public String getPushAccessLevel() { return this.pushAccessLevel; } public void setPushAccessLevel(String pushAccessLevel) { this.pushAccessLevel = pushAccessLevel; } public String getRef() { return this.ref; } public void setRef(String ref) { this.ref = ref; } public Long getResponseStatusCode() { return this.responseStatusCode; } public void setResponseStatusCode(Long responseStatusCode) { this.responseStatusCode = responseStatusCode; } public Commit getCommit() { return this.commit; } public void setCommit(Commit commit) { this.commit = commit; } public static class Commit { private String author; private String authoredDate; private String authorEmail; private String authorName; private String committedDate; private String committer; private String committerEmail; private String committerName; private String createdAt; private String id; private String message; private String shortId; private String signature; private String title; private List<String> checkSuites; private List<String> parentIds; public String getAuthor() { return this.author; } public void setAuthor(String author) { this.author = author; } public String getAuthoredDate() { return this.authoredDate; } public void setAuthoredDate(String authoredDate) { this.authoredDate = authoredDate; } public String getAuthorEmail() { return this.authorEmail; } public void setAuthorEmail(String authorEmail) { this.authorEmail = authorEmail; } public String getAuthorName() { return this.authorName; } public void setAuthorName(String authorName) { this.authorName = authorName; } public String getCommittedDate() { return this.committedDate; } public void setCommittedDate(String committedDate) { this.committedDate = committedDate; } public String getCommitter() { return this.committer; } public void setCommitter(String committer) { this.committer = committer; } public String getCommitterEmail() { return this.committerEmail; } public void setCommitterEmail(String committerEmail) { this.committerEmail = committerEmail; } public String getCommitterName() { return this.committerName; } public void setCommitterName(String committerName) { this.committerName = committerName; } public String getCreatedAt() { return this.createdAt; } public void setCreatedAt(String createdAt) { this.createdAt = createdAt; } public String getId() { return this.id; } public void setId(String id) { this.id = id; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public String getShortId() { return this.shortId; } public void setShortId(String shortId) { this.shortId = shortId; } public String getSignature() { return this.signature; } public void setSignature(String signature) { this.signature = signature; } public String getTitle() { return this.title; } public void setTitle(String title) { this.title = title; } public List<String> getCheckSuites() { return this.checkSuites; } public void setCheckSuites(List<String> checkSuites) { this.checkSuites = checkSuites; } public List<String> getParentIds() { return this.parentIds; } public void setParentIds(List<String> parentIds) { this.parentIds = parentIds; } } @Override public ExecLinkeantcodeAntcodeProtectbranchbynameResponse getInstance(UnmarshallerContext context) { return ExecLinkeantcodeAntcodeProtectbranchbynameResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
92bdec2a9c0faef11dcce2edc09620fc27badbf5
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/6d17e1201bfdf742ac77717d1df0283c7f25f846/before/ResourceEditor.java
0074a704f24ee97c55c99f7509c979f5a3e73ec6
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
10,896
java
/* * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.android.designer.propertyTable.editors; import com.android.resources.ResourceType; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.propertyTable.renderers.ResourceRenderer; import com.intellij.designer.ModuleProvider; import com.intellij.designer.model.PropertiesContainer; import com.intellij.designer.model.PropertyContext; import com.intellij.designer.model.RadComponent; import com.intellij.designer.model.RadPropertyContext; import com.intellij.designer.propertyTable.InplaceContext; import com.intellij.designer.propertyTable.PropertyEditor; import com.intellij.designer.propertyTable.editors.ComboEditor; import com.intellij.openapi.Disposable; import com.intellij.openapi.fileChooser.FileChooserDescriptor; import com.intellij.openapi.ui.ComboBox; import com.intellij.openapi.ui.ComponentWithBrowseButton; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.ComboboxWithBrowseButton; import com.intellij.ui.DocumentAdapter; import com.intellij.util.ArrayUtil; import org.jetbrains.android.dom.attrs.AttributeFormat; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.border.Border; import javax.swing.event.DocumentEvent; import java.awt.*; import java.awt.event.*; import java.util.EnumSet; import java.util.Set; /** * @author Alexander Lobas */ public class ResourceEditor extends PropertyEditor { private final ResourceType[] myTypes; protected ComponentWithBrowseButton myEditor; protected RadComponent myRootComponent; protected RadComponent myComponent; private JCheckBox myCheckBox; private final Border myCheckBoxBorder = new JTextField().getBorder(); private boolean myIgnoreCheckBoxValue; private String myBooleanResourceValue; private final boolean myIsDimension; public ResourceEditor(Set<AttributeFormat> formats, String[] values) { this(convertTypes(formats), formats, values); } public ResourceEditor(ResourceType[] types, Set<AttributeFormat> formats, String[] values) { myTypes = types; myIsDimension = formats.contains(AttributeFormat.Dimension); if (formats.contains(AttributeFormat.Boolean)) { myCheckBox = new JCheckBox(); myEditor = new ComponentWithBrowseButton<JCheckBox>(myCheckBox, null) { @Override public Dimension getPreferredSize() { return getComponentPreferredSize(); } }; myCheckBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (!myIgnoreCheckBoxValue) { myBooleanResourceValue = null; fireValueCommitted(true, true); } } }); } else if (formats.contains(AttributeFormat.Enum)) { ComboboxWithBrowseButton editor = new ComboboxWithBrowseButton(SystemInfo.isWindows ? new ComboBox() : new JComboBox()) { @Override public Dimension getPreferredSize() { return getComponentPreferredSize(); } }; final JComboBox comboBox = editor.getComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(values); model.insertElementAt(StringsComboEditor.UNSET, 0); comboBox.setModel(model); comboBox.setEditable(true); ComboEditor.addEditorSupport(this, comboBox); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (comboBox.getSelectedItem() == StringsComboEditor.UNSET) { comboBox.setSelectedItem(null); } fireValueCommitted(true, true); } }); myEditor = editor; comboBox.setSelectedIndex(0); } else { myEditor = new TextFieldWithBrowseButton() { @Override protected void installPathCompletion(FileChooserDescriptor fileChooserDescriptor, @Nullable Disposable parent) { } @Override public Dimension getPreferredSize() { return getComponentPreferredSize(); } }; myEditor.registerKeyboardAction(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { } }, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); JTextField textField = getComboText(); textField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { fireValueCommitted(true, true); } }); textField.getDocument().addDocumentListener( new DocumentAdapter() { protected void textChanged(final DocumentEvent e) { preferredSizeChanged(); } } ); } myEditor.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { showDialog(); } }); myEditor.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { myEditor.getChildComponent().requestFocus(); } }); } private Dimension getComponentPreferredSize() { Dimension size1 = myEditor.getChildComponent().getPreferredSize(); Dimension size2 = myEditor.getButton().getPreferredSize(); return new Dimension(Math.max(size1.width, 25) + 5 + size2.width, size1.height); } public static ResourceType[] COLOR_TYPES = {ResourceType.COLOR, ResourceType.DRAWABLE}; private static ResourceType[] convertTypes(Set<AttributeFormat> formats) { Set<ResourceType> types = EnumSet.noneOf(ResourceType.class); for (AttributeFormat format : formats) { switch (format) { case Boolean: types.add(ResourceType.BOOL); break; case Color: return COLOR_TYPES; case Dimension: types.add(ResourceType.DIMEN); break; case Integer: types.add(ResourceType.INTEGER); break; case String: types.add(ResourceType.STRING); break; case Reference: types.add(ResourceType.COLOR); types.add(ResourceType.DRAWABLE); types.add(ResourceType.STRING); types.add(ResourceType.ID); types.add(ResourceType.STYLE); break; } } return types.toArray(new ResourceType[types.size()]); } @NotNull @Override public JComponent getComponent(@Nullable PropertiesContainer container, @Nullable PropertyContext context, Object object, @Nullable InplaceContext inplaceContext) { myComponent = (RadComponent)container; myRootComponent = context instanceof RadPropertyContext ? ((RadPropertyContext)context).getRootComponent() : null; String value = (String)object; JTextField text = getComboText(); if (text == null) { if (StringUtil.isEmpty(value) || value.equals("true") || value.equals("false")) { myBooleanResourceValue = null; } else { myBooleanResourceValue = value; } try { myIgnoreCheckBoxValue = true; myCheckBox.setSelected(Boolean.parseBoolean(value)); } finally { myIgnoreCheckBoxValue = false; } if (inplaceContext == null) { myEditor.setBorder(null); myCheckBox.setText(null); } else { myEditor.setBorder(myCheckBoxBorder); myCheckBox.setText(myBooleanResourceValue); } } else { text.setText(value); if (inplaceContext != null) { text.setColumns(0); if (inplaceContext.isStartChar()) { text.setText(inplaceContext.getText(text.getText())); } } } return myEditor; } @Override public JComponent getPreferredFocusedComponent() { JTextField text = getComboText(); return text == null ? myCheckBox : text; } @Override public Object getValue() { JTextField text = getComboText(); if (text == null) { return myBooleanResourceValue == null ? Boolean.toString(myCheckBox.isSelected()) : myBooleanResourceValue; } String value = text.getText(); if (value == StringsComboEditor.UNSET || StringUtil.isEmpty(value)) { return null; } if (myIsDimension && !value.startsWith("@") && !value.endsWith("dip") && !value.equalsIgnoreCase("wrap_content") && !value.equalsIgnoreCase("fill_parent") && !value.equalsIgnoreCase("match_parent")) { if (value.length() <= 2) { return value + "dp"; } int index = value.length() - 2; String dimension = value.substring(index); if (ArrayUtil.indexOf(ResourceRenderer.DIMENSIONS, dimension) == -1) { return value + "dp"; } } return value; } @Override public void updateUI() { SwingUtilities.updateComponentTreeUI(myEditor); } protected void showDialog() { ModuleProvider moduleProvider = myRootComponent.getClientProperty(ModelParser.MODULE_KEY); ResourceDialog dialog = new ResourceDialog(moduleProvider.getModule(), myTypes, (String)getValue(), (RadViewComponent)myComponent); dialog.show(); if (dialog.isOK()) { setValue(dialog.getResourceName()); } else if (myBooleanResourceValue != null) { fireEditingCancelled(); } } protected final void setValue(String value) { JTextField text = getComboText(); if (text == null) { myBooleanResourceValue = value; fireValueCommitted(false, true); } else { text.setText(value); fireValueCommitted(true, true); } } private JTextField getComboText() { JComponent component = myEditor.getChildComponent(); if (component instanceof JTextField) { return (JTextField)component; } if (component instanceof JComboBox) { JComboBox combo = (JComboBox)component; return (JTextField)combo.getEditor().getEditorComponent(); } return null; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
486d4eedf399fc433751c95b6ddc27548c88e07a
f57dd9f62c3470197ae1c948cdf7d12c4193e2b7
/java/DW022801/src/com/dw/util/DBUtil.java
92a41aa4168207fceb2bf661f255c9cb7c9bbc7b
[]
no_license
daiqun/shixi
63848d9b0ac5b42f88137d8ce11e2206e983ef90
ff1c8a6dc963283428be141b49c680e6c218c9b2
refs/heads/master
2021-07-04T14:15:24.545959
2017-09-26T15:14:21
2017-09-26T15:14:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package com.dw.util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import com.dw.exception.DBException; public class DBUtil { /** * Get database connection * @return conn */ public static Connection getConnection() { Connection conn = null; try { //1.Load driver Class.forName(PropertiesUtil.getProperty("jdbc.driver")); //2.Get Connection connection object String jdbcURL = PropertiesUtil.getProperty("jdbc.url"); conn = DriverManager.getConnection(jdbcURL, PropertiesUtil.getProperty("jdbc.username"), PropertiesUtil.getProperty("jdbc.password")); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); throw new DBException(); } return conn; } /** * Close database connection * @param res * @param pst * @param conn */ public static void close(ResultSet res, PreparedStatement pst, Connection conn) { //5.Release resources try { if (res !=null) { res.close(); } if (pst != null) { pst.close(); } if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } }
[ "dq2619101152@foxmail.com" ]
dq2619101152@foxmail.com
ffeb387f88728744358847c2b452cc4564b032e5
d22df5822299275744fd6eb1fd23bc92deea89c0
/lab2/src/main/java/service/HomeService.java
2a1ec7d7fa5276cecdd9913f82aee68542ea0ee0
[]
no_license
DinaMaskalik/laboratory_works
3426914f5866642fdabd729f262cb93f72027023
ba6188d10fa0bff8bbf547b94c5535c84125d606
refs/heads/master
2023-05-13T23:34:57.601567
2021-06-02T14:41:37
2021-06-02T14:41:37
373,199,096
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package service; import entity.Hotel; import repository.HotelDao; import javax.ejb.EJB; import javax.ejb.Stateless; import java.util.List; @Stateless public class HomeService { @EJB HotelDao hotelDao; public List<Hotel> getAllHotel(){ return hotelDao.getAllHotel(); } }
[ "dinamaskalik@gmail.com" ]
dinamaskalik@gmail.com